ZHANGYUXUAN-zR commited on
Commit
670f013
·
verified ·
1 Parent(s): ddd33a0

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 +206 -0
  2. md/train/2vubO341F_E/2vubO341F_E.md +255 -0
  3. md/train/6puCSjH3hwA/6puCSjH3hwA.md +524 -0
  4. md/train/9GsFOUyUPi/9GsFOUyUPi.md +406 -0
  5. md/train/9xPJ7cZ4ntc/9xPJ7cZ4ntc.md +288 -0
  6. md/train/B1X0mzZCW/B1X0mzZCW.md +576 -0
  7. md/train/BJ_UL-k0b/BJ_UL-k0b.md +343 -0
  8. md/train/BJxgz2R9t7/BJxgz2R9t7.md +296 -0
  9. md/train/BXewfAYMmJw/BXewfAYMmJw.md +448 -0
  10. md/train/Byx1VnR9K7/Byx1VnR9K7.md +164 -0
  11. md/train/Byx91R4twB/Byx91R4twB.md +388 -0
  12. md/train/H1cKvl-Rb/H1cKvl-Rb.md +403 -0
  13. md/train/HJlA0C4tPS/HJlA0C4tPS.md +284 -0
  14. md/train/HkeryxBtPB/HkeryxBtPB.md +0 -0
  15. md/train/HyesB2RqFQ/HyesB2RqFQ.md +320 -0
  16. md/train/KOk7mUGspN9/KOk7mUGspN9.md +571 -0
  17. md/train/S1Q79heRW/S1Q79heRW.md +209 -0
  18. md/train/S1fQSiCcYm/S1fQSiCcYm.md +308 -0
  19. md/train/SJAr0QFxe/SJAr0QFxe.md +452 -0
  20. md/train/SylKikSYDH/SylKikSYDH.md +358 -0
  21. md/train/kHSu4ebxFXY/kHSu4ebxFXY.md +329 -0
  22. md/train/mW7M0QsDbcw/mW7M0QsDbcw.md +433 -0
  23. md/train/rJxgknCcK7/rJxgknCcK7.md +317 -0
  24. md/train/yWd42CWN3c/yWd42CWN3c.md +324 -0
  25. parse/dev/03RLpj-tc_/03RLpj-tc__layout.pdf +3 -0
  26. parse/dev/03RLpj-tc_/03RLpj-tc__origin.pdf +3 -0
  27. parse/dev/03RLpj-tc_/03RLpj-tc__span.pdf +3 -0
  28. parse/dev/09hVcSDkea/09hVcSDkea_layout.pdf +3 -0
  29. parse/dev/09hVcSDkea/09hVcSDkea_origin.pdf +3 -0
  30. parse/dev/09hVcSDkea/09hVcSDkea_span.pdf +3 -0
  31. parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_layout.pdf +3 -0
  32. parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_origin.pdf +3 -0
  33. parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_span.pdf +3 -0
  34. parse/dev/1PL1NIMMrw/1PL1NIMMrw_layout.pdf +3 -0
  35. parse/dev/1PL1NIMMrw/1PL1NIMMrw_origin.pdf +3 -0
  36. parse/dev/1PL1NIMMrw/1PL1NIMMrw_span.pdf +3 -0
  37. parse/dev/1W0z96MFEoH/1W0z96MFEoH_layout.pdf +3 -0
  38. parse/dev/1W0z96MFEoH/1W0z96MFEoH_origin.pdf +3 -0
  39. parse/dev/1W0z96MFEoH/1W0z96MFEoH_span.pdf +3 -0
  40. parse/dev/1YEF6TA8Di/1YEF6TA8Di_layout.pdf +3 -0
  41. parse/dev/1YEF6TA8Di/1YEF6TA8Di_origin.pdf +3 -0
  42. parse/dev/1YEF6TA8Di/1YEF6TA8Di_span.pdf +3 -0
  43. parse/dev/1qvx610Cu7/1qvx610Cu7_layout.pdf +3 -0
  44. parse/dev/1qvx610Cu7/1qvx610Cu7_origin.pdf +3 -0
  45. parse/dev/1qvx610Cu7/1qvx610Cu7_span.pdf +3 -0
  46. parse/dev/4hturzLcKX/4hturzLcKX_layout.pdf +3 -0
  47. parse/dev/4hturzLcKX/4hturzLcKX_origin.pdf +3 -0
  48. parse/dev/4hturzLcKX/4hturzLcKX_span.pdf +3 -0
  49. parse/dev/6UtOXn1LwNE/6UtOXn1LwNE_layout.pdf +3 -0
  50. parse/dev/6UtOXn1LwNE/6UtOXn1LwNE_origin.pdf +3 -0
.gitattributes CHANGED
@@ -15808,3 +15808,209 @@ parse/train/_X_4Akcd8Re/_X_4Akcd8Re_layout.pdf filter=lfs diff=lfs merge=lfs -te
15808
  parse/train/_X_4Akcd8Re/_X_4Akcd8Re_origin.pdf filter=lfs diff=lfs merge=lfs -text
15809
  parse/train/_X_4Akcd8Re/_X_4Akcd8Re_span.pdf filter=lfs diff=lfs merge=lfs -text
15810
  parse/train/HyGySsAct7/HyGySsAct7_layout.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15808
  parse/train/_X_4Akcd8Re/_X_4Akcd8Re_origin.pdf filter=lfs diff=lfs merge=lfs -text
15809
  parse/train/_X_4Akcd8Re/_X_4Akcd8Re_span.pdf filter=lfs diff=lfs merge=lfs -text
15810
  parse/train/HyGySsAct7/HyGySsAct7_layout.pdf filter=lfs diff=lfs merge=lfs -text
15811
+ parse/dev/GGi4igGZEB-/GGi4igGZEB-_span.pdf filter=lfs diff=lfs merge=lfs -text
15812
+ parse/dev/MpJjrfSJ-Xs/MpJjrfSJ-Xs_layout.pdf filter=lfs diff=lfs merge=lfs -text
15813
+ parse/dev/pCucay08Co/pCucay08Co_span.pdf filter=lfs diff=lfs merge=lfs -text
15814
+ parse/dev/lzZstLVGVGW/lzZstLVGVGW_span.pdf filter=lfs diff=lfs merge=lfs -text
15815
+ parse/dev/lzZstLVGVGW/lzZstLVGVGW_origin.pdf filter=lfs diff=lfs merge=lfs -text
15816
+ parse/dev/lzZstLVGVGW/lzZstLVGVGW_layout.pdf filter=lfs diff=lfs merge=lfs -text
15817
+ parse/dev/hpBTIv2uy_E/hpBTIv2uy_E_origin.pdf filter=lfs diff=lfs merge=lfs -text
15818
+ parse/dev/GGi4igGZEB-/GGi4igGZEB-_layout.pdf filter=lfs diff=lfs merge=lfs -text
15819
+ parse/dev/b90lKL1IqcF/b90lKL1IqcF_layout.pdf filter=lfs diff=lfs merge=lfs -text
15820
+ parse/dev/EMLJ_mTz_z/EMLJ_mTz_z_origin.pdf filter=lfs diff=lfs merge=lfs -text
15821
+ parse/dev/hpBTIv2uy_E/hpBTIv2uy_E_layout.pdf filter=lfs diff=lfs merge=lfs -text
15822
+ parse/dev/kroqZZb-6s/kroqZZb-6s_layout.pdf filter=lfs diff=lfs merge=lfs -text
15823
+ parse/dev/b90lKL1IqcF/b90lKL1IqcF_origin.pdf filter=lfs diff=lfs merge=lfs -text
15824
+ parse/dev/EMLJ_mTz_z/EMLJ_mTz_z_span.pdf filter=lfs diff=lfs merge=lfs -text
15825
+ parse/dev/kroqZZb-6s/kroqZZb-6s_origin.pdf filter=lfs diff=lfs merge=lfs -text
15826
+ parse/dev/kroqZZb-6s/kroqZZb-6s_span.pdf filter=lfs diff=lfs merge=lfs -text
15827
+ parse/dev/hpBTIv2uy_E/hpBTIv2uy_E_span.pdf filter=lfs diff=lfs merge=lfs -text
15828
+ parse/dev/1YEF6TA8Di/1YEF6TA8Di_layout.pdf filter=lfs diff=lfs merge=lfs -text
15829
+ parse/dev/b90lKL1IqcF/b90lKL1IqcF_span.pdf filter=lfs diff=lfs merge=lfs -text
15830
+ parse/dev/_nGgzQjzaRy/_nGgzQjzaRy_span.pdf filter=lfs diff=lfs merge=lfs -text
15831
+ parse/dev/_nGgzQjzaRy/_nGgzQjzaRy_layout.pdf filter=lfs diff=lfs merge=lfs -text
15832
+ parse/dev/wYqLTy4wkor/wYqLTy4wkor_origin.pdf filter=lfs diff=lfs merge=lfs -text
15833
+ parse/dev/1YEF6TA8Di/1YEF6TA8Di_span.pdf filter=lfs diff=lfs merge=lfs -text
15834
+ parse/dev/_nGgzQjzaRy/_nGgzQjzaRy_origin.pdf filter=lfs diff=lfs merge=lfs -text
15835
+ parse/dev/EMLJ_mTz_z/EMLJ_mTz_z_layout.pdf filter=lfs diff=lfs merge=lfs -text
15836
+ parse/dev/Wjp1AYB8lH/Wjp1AYB8lH_layout.pdf filter=lfs diff=lfs merge=lfs -text
15837
+ parse/dev/wYqLTy4wkor/wYqLTy4wkor_span.pdf filter=lfs diff=lfs merge=lfs -text
15838
+ parse/dev/1YEF6TA8Di/1YEF6TA8Di_origin.pdf filter=lfs diff=lfs merge=lfs -text
15839
+ parse/dev/Wjp1AYB8lH/Wjp1AYB8lH_span.pdf filter=lfs diff=lfs merge=lfs -text
15840
+ parse/dev/RdJVFCHjUMI/RdJVFCHjUMI_layout.pdf filter=lfs diff=lfs merge=lfs -text
15841
+ parse/dev/lL3lnMbR4WU/lL3lnMbR4WU_origin.pdf filter=lfs diff=lfs merge=lfs -text
15842
+ parse/dev/RdJVFCHjUMI/RdJVFCHjUMI_origin.pdf filter=lfs diff=lfs merge=lfs -text
15843
+ parse/dev/TrjbxzRcnf-/TrjbxzRcnf-_origin.pdf filter=lfs diff=lfs merge=lfs -text
15844
+ parse/dev/wYqLTy4wkor/wYqLTy4wkor_layout.pdf filter=lfs diff=lfs merge=lfs -text
15845
+ parse/dev/lL3lnMbR4WU/lL3lnMbR4WU_span.pdf filter=lfs diff=lfs merge=lfs -text
15846
+ parse/dev/RdJVFCHjUMI/RdJVFCHjUMI_span.pdf filter=lfs diff=lfs merge=lfs -text
15847
+ parse/dev/TrjbxzRcnf-/TrjbxzRcnf-_span.pdf filter=lfs diff=lfs merge=lfs -text
15848
+ parse/dev/lL3lnMbR4WU/lL3lnMbR4WU_layout.pdf filter=lfs diff=lfs merge=lfs -text
15849
+ parse/dev/dFbKQaRk15w/dFbKQaRk15w_origin.pdf filter=lfs diff=lfs merge=lfs -text
15850
+ parse/dev/Yacmpz84TH/Yacmpz84TH_origin.pdf filter=lfs diff=lfs merge=lfs -text
15851
+ parse/dev/Yacmpz84TH/Yacmpz84TH_span.pdf filter=lfs diff=lfs merge=lfs -text
15852
+ parse/dev/dFbKQaRk15w/dFbKQaRk15w_span.pdf filter=lfs diff=lfs merge=lfs -text
15853
+ parse/dev/dFbKQaRk15w/dFbKQaRk15w_layout.pdf filter=lfs diff=lfs merge=lfs -text
15854
+ parse/dev/TrjbxzRcnf-/TrjbxzRcnf-_layout.pdf filter=lfs diff=lfs merge=lfs -text
15855
+ parse/dev/03RLpj-tc_/03RLpj-tc__origin.pdf filter=lfs diff=lfs merge=lfs -text
15856
+ parse/dev/Wjp1AYB8lH/Wjp1AYB8lH_origin.pdf filter=lfs diff=lfs merge=lfs -text
15857
+ parse/dev/AJg35fkqOPA/AJg35fkqOPA_span.pdf filter=lfs diff=lfs merge=lfs -text
15858
+ parse/dev/PUIqjT4rzq7/PUIqjT4rzq7_origin.pdf filter=lfs diff=lfs merge=lfs -text
15859
+ parse/dev/Yacmpz84TH/Yacmpz84TH_layout.pdf filter=lfs diff=lfs merge=lfs -text
15860
+ parse/dev/03RLpj-tc_/03RLpj-tc__layout.pdf filter=lfs diff=lfs merge=lfs -text
15861
+ parse/dev/aUkOeKsGe2X/aUkOeKsGe2X_span.pdf filter=lfs diff=lfs merge=lfs -text
15862
+ parse/dev/PUIqjT4rzq7/PUIqjT4rzq7_span.pdf filter=lfs diff=lfs merge=lfs -text
15863
+ parse/dev/AJg35fkqOPA/AJg35fkqOPA_layout.pdf filter=lfs diff=lfs merge=lfs -text
15864
+ parse/dev/aUkOeKsGe2X/aUkOeKsGe2X_origin.pdf filter=lfs diff=lfs merge=lfs -text
15865
+ parse/dev/AJg35fkqOPA/AJg35fkqOPA_origin.pdf filter=lfs diff=lfs merge=lfs -text
15866
+ parse/dev/03RLpj-tc_/03RLpj-tc__span.pdf filter=lfs diff=lfs merge=lfs -text
15867
+ parse/dev/cx5ViLfcVq/cx5ViLfcVq_layout.pdf filter=lfs diff=lfs merge=lfs -text
15868
+ parse/dev/_CDixzkzeyb/_CDixzkzeyb_layout.pdf filter=lfs diff=lfs merge=lfs -text
15869
+ parse/dev/TG8KACxEON/TG8KACxEON_origin.pdf filter=lfs diff=lfs merge=lfs -text
15870
+ parse/dev/J8P7g_mDpno/J8P7g_mDpno_origin.pdf filter=lfs diff=lfs merge=lfs -text
15871
+ parse/dev/J8P7g_mDpno/J8P7g_mDpno_layout.pdf filter=lfs diff=lfs merge=lfs -text
15872
+ parse/dev/cx5ViLfcVq/cx5ViLfcVq_origin.pdf filter=lfs diff=lfs merge=lfs -text
15873
+ parse/dev/FPCMqjI0jXN/FPCMqjI0jXN_span.pdf filter=lfs diff=lfs merge=lfs -text
15874
+ parse/dev/J8P7g_mDpno/J8P7g_mDpno_span.pdf filter=lfs diff=lfs merge=lfs -text
15875
+ parse/dev/cx5ViLfcVq/cx5ViLfcVq_span.pdf filter=lfs diff=lfs merge=lfs -text
15876
+ parse/dev/PUIqjT4rzq7/PUIqjT4rzq7_layout.pdf filter=lfs diff=lfs merge=lfs -text
15877
+ parse/dev/TG8KACxEON/TG8KACxEON_span.pdf filter=lfs diff=lfs merge=lfs -text
15878
+ parse/dev/FPCMqjI0jXN/FPCMqjI0jXN_origin.pdf filter=lfs diff=lfs merge=lfs -text
15879
+ parse/dev/TG8KACxEON/TG8KACxEON_layout.pdf filter=lfs diff=lfs merge=lfs -text
15880
+ parse/dev/1qvx610Cu7/1qvx610Cu7_layout.pdf filter=lfs diff=lfs merge=lfs -text
15881
+ parse/dev/aUkOeKsGe2X/aUkOeKsGe2X_layout.pdf filter=lfs diff=lfs merge=lfs -text
15882
+ parse/dev/1PL1NIMMrw/1PL1NIMMrw_origin.pdf filter=lfs diff=lfs merge=lfs -text
15883
+ parse/dev/_CDixzkzeyb/_CDixzkzeyb_origin.pdf filter=lfs diff=lfs merge=lfs -text
15884
+ parse/dev/1qvx610Cu7/1qvx610Cu7_origin.pdf filter=lfs diff=lfs merge=lfs -text
15885
+ parse/dev/_CDixzkzeyb/_CDixzkzeyb_span.pdf filter=lfs diff=lfs merge=lfs -text
15886
+ parse/dev/1qvx610Cu7/1qvx610Cu7_span.pdf filter=lfs diff=lfs merge=lfs -text
15887
+ parse/dev/FPCMqjI0jXN/FPCMqjI0jXN_layout.pdf filter=lfs diff=lfs merge=lfs -text
15888
+ parse/dev/1PL1NIMMrw/1PL1NIMMrw_span.pdf filter=lfs diff=lfs merge=lfs -text
15889
+ parse/dev/zSkYVeX7bC4/zSkYVeX7bC4_layout.pdf filter=lfs diff=lfs merge=lfs -text
15890
+ parse/dev/krI-ahhgN2/krI-ahhgN2_origin.pdf filter=lfs diff=lfs merge=lfs -text
15891
+ parse/dev/6UtOXn1LwNE/6UtOXn1LwNE_span.pdf filter=lfs diff=lfs merge=lfs -text
15892
+ parse/dev/zSkYVeX7bC4/zSkYVeX7bC4_span.pdf filter=lfs diff=lfs merge=lfs -text
15893
+ parse/dev/zSkYVeX7bC4/zSkYVeX7bC4_origin.pdf filter=lfs diff=lfs merge=lfs -text
15894
+ parse/dev/MG3YN3z1J4M/MG3YN3z1J4M_origin.pdf filter=lfs diff=lfs merge=lfs -text
15895
+ parse/dev/1PL1NIMMrw/1PL1NIMMrw_layout.pdf filter=lfs diff=lfs merge=lfs -text
15896
+ parse/dev/UhEJz3wgLnG/UhEJz3wgLnG_origin.pdf filter=lfs diff=lfs merge=lfs -text
15897
+ parse/dev/UhEJz3wgLnG/UhEJz3wgLnG_layout.pdf filter=lfs diff=lfs merge=lfs -text
15898
+ parse/dev/UhEJz3wgLnG/UhEJz3wgLnG_span.pdf filter=lfs diff=lfs merge=lfs -text
15899
+ parse/dev/MG3YN3z1J4M/MG3YN3z1J4M_span.pdf filter=lfs diff=lfs merge=lfs -text
15900
+ parse/dev/krI-ahhgN2/krI-ahhgN2_span.pdf filter=lfs diff=lfs merge=lfs -text
15901
+ parse/dev/GAUwreODU5L/GAUwreODU5L_layout.pdf filter=lfs diff=lfs merge=lfs -text
15902
+ parse/dev/nJfylDvgzlq/nJfylDvgzlq_origin.pdf filter=lfs diff=lfs merge=lfs -text
15903
+ parse/dev/GAUwreODU5L/GAUwreODU5L_origin.pdf filter=lfs diff=lfs merge=lfs -text
15904
+ parse/dev/nJfylDvgzlq/nJfylDvgzlq_layout.pdf filter=lfs diff=lfs merge=lfs -text
15905
+ parse/dev/krI-ahhgN2/krI-ahhgN2_layout.pdf filter=lfs diff=lfs merge=lfs -text
15906
+ parse/dev/6UtOXn1LwNE/6UtOXn1LwNE_origin.pdf filter=lfs diff=lfs merge=lfs -text
15907
+ parse/dev/MG3YN3z1J4M/MG3YN3z1J4M_layout.pdf filter=lfs diff=lfs merge=lfs -text
15908
+ parse/dev/9t-j3xDm7_Q/9t-j3xDm7_Q_layout.pdf filter=lfs diff=lfs merge=lfs -text
15909
+ parse/dev/9t-j3xDm7_Q/9t-j3xDm7_Q_span.pdf filter=lfs diff=lfs merge=lfs -text
15910
+ parse/dev/hFCUPkSSRE/hFCUPkSSRE_span.pdf filter=lfs diff=lfs merge=lfs -text
15911
+ parse/dev/nUmCcZ5RKF/nUmCcZ5RKF_layout.pdf filter=lfs diff=lfs merge=lfs -text
15912
+ parse/dev/Zq2G_VTV53T/Zq2G_VTV53T_layout.pdf filter=lfs diff=lfs merge=lfs -text
15913
+ parse/dev/nUmCcZ5RKF/nUmCcZ5RKF_span.pdf filter=lfs diff=lfs merge=lfs -text
15914
+ parse/dev/oEsYs3WRc3/oEsYs3WRc3_origin.pdf filter=lfs diff=lfs merge=lfs -text
15915
+ parse/dev/hFCUPkSSRE/hFCUPkSSRE_layout.pdf filter=lfs diff=lfs merge=lfs -text
15916
+ parse/dev/RFGkzxMFqby/RFGkzxMFqby_layout.pdf filter=lfs diff=lfs merge=lfs -text
15917
+ parse/dev/nN3aVRQsxGd/nN3aVRQsxGd_span.pdf filter=lfs diff=lfs merge=lfs -text
15918
+ parse/dev/nN3aVRQsxGd/nN3aVRQsxGd_layout.pdf filter=lfs diff=lfs merge=lfs -text
15919
+ parse/dev/oEsYs3WRc3/oEsYs3WRc3_span.pdf filter=lfs diff=lfs merge=lfs -text
15920
+ parse/dev/hFCUPkSSRE/hFCUPkSSRE_origin.pdf filter=lfs diff=lfs merge=lfs -text
15921
+ parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_origin.pdf filter=lfs diff=lfs merge=lfs -text
15922
+ parse/dev/RFGkzxMFqby/RFGkzxMFqby_span.pdf filter=lfs diff=lfs merge=lfs -text
15923
+ parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_layout.pdf filter=lfs diff=lfs merge=lfs -text
15924
+ parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_span.pdf filter=lfs diff=lfs merge=lfs -text
15925
+ parse/dev/nN3aVRQsxGd/nN3aVRQsxGd_origin.pdf filter=lfs diff=lfs merge=lfs -text
15926
+ parse/dev/RFGkzxMFqby/RFGkzxMFqby_origin.pdf filter=lfs diff=lfs merge=lfs -text
15927
+ parse/dev/nL2lDlsrZU/nL2lDlsrZU_layout.pdf filter=lfs diff=lfs merge=lfs -text
15928
+ parse/dev/nL2lDlsrZU/nL2lDlsrZU_span.pdf filter=lfs diff=lfs merge=lfs -text
15929
+ parse/dev/zSeoDvsDCe/zSeoDvsDCe_layout.pdf filter=lfs diff=lfs merge=lfs -text
15930
+ parse/dev/zSeoDvsDCe/zSeoDvsDCe_span.pdf filter=lfs diff=lfs merge=lfs -text
15931
+ parse/dev/ZWjEkv9rjo/ZWjEkv9rjo_span.pdf filter=lfs diff=lfs merge=lfs -text
15932
+ parse/dev/S37hOerQLB/S37hOerQLB_span.pdf filter=lfs diff=lfs merge=lfs -text
15933
+ parse/dev/ZWjEkv9rjo/ZWjEkv9rjo_layout.pdf filter=lfs diff=lfs merge=lfs -text
15934
+ parse/dev/nL2lDlsrZU/nL2lDlsrZU_origin.pdf filter=lfs diff=lfs merge=lfs -text
15935
+ parse/dev/ZWjEkv9rjo/ZWjEkv9rjo_origin.pdf filter=lfs diff=lfs merge=lfs -text
15936
+ parse/dev/HH3GHN_Q1Ba/HH3GHN_Q1Ba_origin.pdf filter=lfs diff=lfs merge=lfs -text
15937
+ parse/dev/S37hOerQLB/S37hOerQLB_origin.pdf filter=lfs diff=lfs merge=lfs -text
15938
+ parse/dev/zSeoDvsDCe/zSeoDvsDCe_origin.pdf filter=lfs diff=lfs merge=lfs -text
15939
+ parse/dev/BqxE86ufTzq/BqxE86ufTzq_origin.pdf filter=lfs diff=lfs merge=lfs -text
15940
+ parse/dev/Czsdv-S4-w9/Czsdv-S4-w9_origin.pdf filter=lfs diff=lfs merge=lfs -text
15941
+ parse/dev/Czsdv-S4-w9/Czsdv-S4-w9_layout.pdf filter=lfs diff=lfs merge=lfs -text
15942
+ parse/dev/S37hOerQLB/S37hOerQLB_layout.pdf filter=lfs diff=lfs merge=lfs -text
15943
+ parse/dev/BqxE86ufTzq/BqxE86ufTzq_layout.pdf filter=lfs diff=lfs merge=lfs -text
15944
+ parse/dev/BqxE86ufTzq/BqxE86ufTzq_span.pdf filter=lfs diff=lfs merge=lfs -text
15945
+ parse/dev/Czsdv-S4-w9/Czsdv-S4-w9_span.pdf filter=lfs diff=lfs merge=lfs -text
15946
+ parse/dev/HH3GHN_Q1Ba/HH3GHN_Q1Ba_layout.pdf filter=lfs diff=lfs merge=lfs -text
15947
+ parse/dev/HH3GHN_Q1Ba/HH3GHN_Q1Ba_span.pdf filter=lfs diff=lfs merge=lfs -text
15948
+ parse/dev/Dl4LetuLdyK/Dl4LetuLdyK_layout.pdf filter=lfs diff=lfs merge=lfs -text
15949
+ parse/dev/Dl4LetuLdyK/Dl4LetuLdyK_origin.pdf filter=lfs diff=lfs merge=lfs -text
15950
+ parse/dev/Dl4LetuLdyK/Dl4LetuLdyK_span.pdf filter=lfs diff=lfs merge=lfs -text
15951
+ parse/dev/NAQvF08TcyG/NAQvF08TcyG_span.pdf filter=lfs diff=lfs merge=lfs -text
15952
+ parse/dev/zDiHoIWa0q1/zDiHoIWa0q1_span.pdf filter=lfs diff=lfs merge=lfs -text
15953
+ parse/dev/zDiHoIWa0q1/zDiHoIWa0q1_origin.pdf filter=lfs diff=lfs merge=lfs -text
15954
+ parse/dev/GAUwreODU5L/GAUwreODU5L_span.pdf filter=lfs diff=lfs merge=lfs -text
15955
+ parse/dev/nJfylDvgzlq/nJfylDvgzlq_span.pdf filter=lfs diff=lfs merge=lfs -text
15956
+ parse/dev/xENf4QUL4LW/xENf4QUL4LW_layout.pdf filter=lfs diff=lfs merge=lfs -text
15957
+ parse/dev/l0zLcLGdcL/l0zLcLGdcL_span.pdf filter=lfs diff=lfs merge=lfs -text
15958
+ parse/dev/9t-j3xDm7_Q/9t-j3xDm7_Q_origin.pdf filter=lfs diff=lfs merge=lfs -text
15959
+ parse/dev/g2YraF75Tj/g2YraF75Tj_span.pdf filter=lfs diff=lfs merge=lfs -text
15960
+ parse/dev/6UtOXn1LwNE/6UtOXn1LwNE_layout.pdf filter=lfs diff=lfs merge=lfs -text
15961
+ parse/dev/TiZYrQ-mPup/TiZYrQ-mPup_span.pdf filter=lfs diff=lfs merge=lfs -text
15962
+ parse/dev/xENf4QUL4LW/xENf4QUL4LW_origin.pdf filter=lfs diff=lfs merge=lfs -text
15963
+ parse/dev/xENf4QUL4LW/xENf4QUL4LW_span.pdf filter=lfs diff=lfs merge=lfs -text
15964
+ parse/dev/g2YraF75Tj/g2YraF75Tj_origin.pdf filter=lfs diff=lfs merge=lfs -text
15965
+ parse/dev/l0zLcLGdcL/l0zLcLGdcL_origin.pdf filter=lfs diff=lfs merge=lfs -text
15966
+ parse/dev/g2YraF75Tj/g2YraF75Tj_layout.pdf filter=lfs diff=lfs merge=lfs -text
15967
+ parse/dev/MCVfX7HgPO/MCVfX7HgPO_span.pdf filter=lfs diff=lfs merge=lfs -text
15968
+ parse/dev/TiZYrQ-mPup/TiZYrQ-mPup_origin.pdf filter=lfs diff=lfs merge=lfs -text
15969
+ parse/dev/JtBRnrlOEFN/JtBRnrlOEFN_span.pdf filter=lfs diff=lfs merge=lfs -text
15970
+ parse/dev/MCVfX7HgPO/MCVfX7HgPO_origin.pdf filter=lfs diff=lfs merge=lfs -text
15971
+ parse/dev/UERcQuXlwy/UERcQuXlwy_origin.pdf filter=lfs diff=lfs merge=lfs -text
15972
+ parse/dev/l0zLcLGdcL/l0zLcLGdcL_layout.pdf filter=lfs diff=lfs merge=lfs -text
15973
+ parse/dev/MCVfX7HgPO/MCVfX7HgPO_layout.pdf filter=lfs diff=lfs merge=lfs -text
15974
+ parse/dev/_xwr8gOBeV1/_xwr8gOBeV1_origin.pdf filter=lfs diff=lfs merge=lfs -text
15975
+ parse/dev/TiZYrQ-mPup/TiZYrQ-mPup_layout.pdf filter=lfs diff=lfs merge=lfs -text
15976
+ parse/dev/_xwr8gOBeV1/_xwr8gOBeV1_span.pdf filter=lfs diff=lfs merge=lfs -text
15977
+ parse/dev/UERcQuXlwy/UERcQuXlwy_span.pdf filter=lfs diff=lfs merge=lfs -text
15978
+ parse/dev/UERcQuXlwy/UERcQuXlwy_layout.pdf filter=lfs diff=lfs merge=lfs -text
15979
+ parse/dev/JtBRnrlOEFN/JtBRnrlOEFN_origin.pdf filter=lfs diff=lfs merge=lfs -text
15980
+ parse/dev/JtBRnrlOEFN/JtBRnrlOEFN_layout.pdf filter=lfs diff=lfs merge=lfs -text
15981
+ parse/dev/EdIGMCHk4l/EdIGMCHk4l_layout.pdf filter=lfs diff=lfs merge=lfs -text
15982
+ parse/dev/ti6fH3EhFkv/ti6fH3EhFkv_layout.pdf filter=lfs diff=lfs merge=lfs -text
15983
+ parse/dev/ti6fH3EhFkv/ti6fH3EhFkv_origin.pdf filter=lfs diff=lfs merge=lfs -text
15984
+ parse/dev/EdIGMCHk4l/EdIGMCHk4l_origin.pdf filter=lfs diff=lfs merge=lfs -text
15985
+ parse/dev/_xwr8gOBeV1/_xwr8gOBeV1_layout.pdf filter=lfs diff=lfs merge=lfs -text
15986
+ parse/dev/ti6fH3EhFkv/ti6fH3EhFkv_span.pdf filter=lfs diff=lfs merge=lfs -text
15987
+ parse/dev/EdIGMCHk4l/EdIGMCHk4l_span.pdf filter=lfs diff=lfs merge=lfs -text
15988
+ parse/dev/GKfNB4BegL/GKfNB4BegL_layout.pdf filter=lfs diff=lfs merge=lfs -text
15989
+ parse/dev/Zq2G_VTV53T/Zq2G_VTV53T_origin.pdf filter=lfs diff=lfs merge=lfs -text
15990
+ parse/dev/nUmCcZ5RKF/nUmCcZ5RKF_origin.pdf filter=lfs diff=lfs merge=lfs -text
15991
+ parse/dev/GKfNB4BegL/GKfNB4BegL_origin.pdf filter=lfs diff=lfs merge=lfs -text
15992
+ parse/dev/Zq2G_VTV53T/Zq2G_VTV53T_span.pdf filter=lfs diff=lfs merge=lfs -text
15993
+ parse/dev/oEsYs3WRc3/oEsYs3WRc3_layout.pdf filter=lfs diff=lfs merge=lfs -text
15994
+ parse/dev/GKfNB4BegL/GKfNB4BegL_span.pdf filter=lfs diff=lfs merge=lfs -text
15995
+ parse/dev/zDiHoIWa0q1/zDiHoIWa0q1_layout.pdf filter=lfs diff=lfs merge=lfs -text
15996
+ parse/dev/NAQvF08TcyG/NAQvF08TcyG_layout.pdf filter=lfs diff=lfs merge=lfs -text
15997
+ parse/dev/NAQvF08TcyG/NAQvF08TcyG_origin.pdf filter=lfs diff=lfs merge=lfs -text
15998
+ parse/dev/4hturzLcKX/4hturzLcKX_layout.pdf filter=lfs diff=lfs merge=lfs -text
15999
+ parse/dev/4hturzLcKX/4hturzLcKX_origin.pdf filter=lfs diff=lfs merge=lfs -text
16000
+ parse/dev/4hturzLcKX/4hturzLcKX_span.pdf filter=lfs diff=lfs merge=lfs -text
16001
+ parse/dev/oDRQGo8I7P/oDRQGo8I7P_layout.pdf filter=lfs diff=lfs merge=lfs -text
16002
+ parse/dev/vSix3HPYKSU/vSix3HPYKSU_span.pdf filter=lfs diff=lfs merge=lfs -text
16003
+ parse/dev/1W0z96MFEoH/1W0z96MFEoH_layout.pdf filter=lfs diff=lfs merge=lfs -text
16004
+ parse/dev/oDRQGo8I7P/oDRQGo8I7P_span.pdf filter=lfs diff=lfs merge=lfs -text
16005
+ parse/dev/oDRQGo8I7P/oDRQGo8I7P_origin.pdf filter=lfs diff=lfs merge=lfs -text
16006
+ parse/dev/vSix3HPYKSU/vSix3HPYKSU_origin.pdf filter=lfs diff=lfs merge=lfs -text
16007
+ parse/dev/1W0z96MFEoH/1W0z96MFEoH_origin.pdf filter=lfs diff=lfs merge=lfs -text
16008
+ parse/dev/1W0z96MFEoH/1W0z96MFEoH_span.pdf filter=lfs diff=lfs merge=lfs -text
16009
+ parse/dev/vSix3HPYKSU/vSix3HPYKSU_layout.pdf filter=lfs diff=lfs merge=lfs -text
16010
+ parse/dev/BIpTWmO_BY/BIpTWmO_BY_origin.pdf filter=lfs diff=lfs merge=lfs -text
16011
+ parse/dev/BIpTWmO_BY/BIpTWmO_BY_layout.pdf filter=lfs diff=lfs merge=lfs -text
16012
+ parse/dev/09hVcSDkea/09hVcSDkea_span.pdf filter=lfs diff=lfs merge=lfs -text
16013
+ parse/dev/o4neHaKMlse/o4neHaKMlse_span.pdf filter=lfs diff=lfs merge=lfs -text
16014
+ parse/dev/BIpTWmO_BY/BIpTWmO_BY_span.pdf filter=lfs diff=lfs merge=lfs -text
16015
+ parse/dev/09hVcSDkea/09hVcSDkea_layout.pdf filter=lfs diff=lfs merge=lfs -text
16016
+ parse/dev/09hVcSDkea/09hVcSDkea_origin.pdf filter=lfs diff=lfs merge=lfs -text
md/train/2vubO341F_E/2vubO341F_E.md ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # All Tokens Matter: Token Labeling for Training Better Vision Transformers
2
+
3
+ Zihang Jiang1∗ Qibin Hou2,1† Li Yuan3 Daquan Zhou1 Yujun Shi1
4
+
5
+ Xiaojie Jin4 Anran Wang4 Jiashi Feng4
6
+
7
+ 1National University of Singapore 2Nankai University
8
+
9
+ # 3 Peking University 4ByteDance
10
+
11
+ {jzh0103,andrewhoux,ylustcnus,zhoudaquan21,shiyujun1016}@gmail.com xjjin0731@gmail.com, anran.wang@bytedance.com, jshfeng@gmail.com
12
+
13
+ # Abstract
14
+
15
+ In this paper, we present token labeling—a new training objective for training high-performance vision transformers (ViTs). Different from the standard training objective of ViTs that computes the classification loss on an additional trainable class token, our proposed one takes advantage of all the image patch tokens to compute the training loss in a dense manner. Specifically, token labeling reformulates the image classification problem into multiple token-level recognition problems and assigns each patch token with an individual location-specific supervision generated by a machine annotator. Experiments show that token labeling can clearly and consistently improve the performance of various ViT models across a wide spectrum. For a vision transformer with 26M learnable parameters serving as an example, with token labeling, the model can achieve $8 4 . 4 \%$ Top-1 accuracy on ImageNet. The result can be further increased to $8 6 . 4 \%$ by slightly scaling the model size up to 150M, delivering the minimal-sized model among previous models $( 2 5 0 \mathbf { M } + )$ reaching $86 \%$ . We also show that token labeling can clearly improve the generalization capability of the pretrained models on downstream tasks with dense prediction, such as semantic segmentation. Our code and model are publicly available at https://github.com/zihangJiang/TokenLabeling.
16
+
17
+ # 1 Introduction
18
+
19
+ Transformers [39] have achieved great performance for almost all the natural language processing (NLP) tasks over the past years [4, 14, 24]. Motivated by such success, recently, many researchers attempt to build transformer models for vision tasks, and their encouraging results have shown the great potential of transformer based models for image classification [6, 15, 25, 36, 40, 46], especially the strong benefits of the self-attention mechanism in building long-range dependencies between pairs of input tokens.
20
+
21
+ Despite the importance of gathering long-range dependencies, recent work on local data augmentation [57] has demonstrated that well modeling and leveraging local information for image classification would avoid biasing the model towards skewed and non-generalizable patterns and substantially improve the model performance. However, recent vision transformers normally utilize class tokens that aggregate global information to predict the output class while neglecting the role of other patch tokens that encode rich information on their respective local image patches.
22
+
23
+ ![](images/9c7bb663ccabca3baefdad385c72c84db533d97dbd497ac18638700c9e1d548b.jpg)
24
+ Figure 1: Comparison between the proposed LV-ViT and other recent works based on vision transformers, including T2T-ViT [46], ConViT [12], BoTNet [31], DeepViT [59], DeiT [36], ViT [15], Swin Transformer [25], LambdaNet [1], CvT [43], CrossViT [6], PVT [40], CaiT [37]. Note that we only show models whose model sizes are under 100M. As can be seen, our LV-ViT achieves the best results using the least amount of learnable parameters. The default test resolution is $2 2 4 \times 2 2 4$ unless specified after $@$ .
25
+
26
+ In this paper, we present a new training objective for vision transformers, termed token labeling, that takes advantage of both the patch tokens and the class tokens. Our method takes a $K$ -dimensional score map generated by a machine annotator as supervision to supervise all the tokens in a dense manner, where $K$ is the number of categories for the target dataset. In this way, each patch token is explicitly associated with an individual location-specific supervision indicating the existence of the target objects inside the corresponding image patch, so as to improve the object grounding and recognition capabilities of vision transformers with negligible computation overhead. To the best of our knowledge, this is the first work demonstrating that dense supervision is beneficial to vision transformers in image classification.
27
+
28
+ According to our experiments, utilizing the proposed token labeling objective can clearly boost the performance of vision transformers. As shown in Figure 1, our model, named LV-ViT, with 56M parameters, yields $8 5 . 4 \%$ top-1 accuracy on ImageNet [13], behaving better than all the other transformer-based models having no more than 100M parameters. When the model size is scaled up to 150M, the result can be further improved to $8 6 . 4 \%$ . In addition, we have empirically found that the pretrained models with token labeling are also beneficial to downstream tasks with dense prediction, such as semantic segmentation.
29
+
30
+ # 2 Related Work
31
+
32
+ Transformers [39] refer to the models that entirely rely on the self-attention mechanism to build global dependencies, which are originally designed for natural language processing tasks. Due to their strong capability of capturing spatial information, transformers have also been successfully applied to a variety of vision problems, including low-level vision tasks like image enhancement [7, 45], as well as more challenging tasks such as image classification [9, 15], object detection [5, 11, 55, 61], segmentation [7, 33, 41] and image generation [28]. Some works also extend transformers for video and 3D point cloud processing [50, 53, 60].
33
+
34
+ Vision Transformer (ViT) is one of the earlier attempts that achieved state-of-the-art performance on ImageNet classification, using pure transformers as basic building blocks. However, ViTs need pretraining on very large datasets, such as ImageNet-22k and JFT-300M, and huge computation resources to achieve comparable performance to ResNet [18] with a similar model size trained on ImageNet. Later, DeiT [36] manages to tackle the data-inefficiency problem by simply adjusting the network architecture and adding an additional token along with the class token for Knowledge Distillation [21, 47] to improve model performance.
35
+
36
+ ![](images/77890e011e8cc08c2d9f50310be754cb08f7894ee6cb766ac590a7580f42e616.jpg)
37
+ Figure 2: Pipeline of training vision transformers with token labeling. Other than utilizing the class token (pink rectangle), we also take advantage of all the output patch tokens (orange rounded rectangle) by assigning each patch token an individual location-specific prediction generated by a machine annotator [3] as supervision (see the part in the red dash rectangle). Our proposed token labeling method can be treated as an auxiliary objective to provide each patch token the local details that aid vision transformers to more accurately locate and recognize the target objects. Note that the traditional vision transformer training does not include the red dash rectangle part.
38
+
39
+ Some recent works [6, 16, 43, 46] also attempt to introduce the local dependency into vision transformers by modifying the patch embedding block or the transformer block or both, leading to significant performance gains. Moreover, there are also some works [20, 25, 40] adopting a pyramid structure to reduce the overall computation while maintaining the model’s ability to capture low-level features.
40
+
41
+ Unlike most aforementioned works that design new transformer blocks or transformer architectures, we attempt to improve vision transformers by studying the role of patch tokens that embed rich local information inside image patches. We show that by slightly tuning the structure of vision transformers and employing the proposed token labeling objective, we can achieve strong baselines for transformer models at different model size levels.
42
+
43
+ # 3 Token Labeling Method
44
+
45
+ In this section, we first briefly review the structure of the vision transformer [15] and then describe the proposed training objective—token labeling.
46
+
47
+ # 3.1 Revisiting Vision Transformer
48
+
49
+ A typical vision transformer [15] first decomposes a fixed-size input image into a sequence of small patches. Each small patch is mapped to a feature vector, or called a token, by projection with a linear layer. Then, all the tokens combined with an additional learnable class token for classification score prediction are sent into a stack of transformer blocks for feature encoding.
50
+
51
+ In loss computing, the class token from the output tokens of the last transformer block is usually selected and sent into a linear layer for the classification score prediction. Mathematically, given an image $I$ , denote the output of the last transformer block as $[ \bar { X } ^ { c l s } , X ^ { 1 } , . . . , X ^ { N } ]$ , where $N$ is the total number of patch tokens, and $X ^ { c l s }$ and $X ^ { 1 } , . . . , X ^ { N }$ correspond to the class token and the patch tokens, respectively. The classification loss for image $I$ can be written as
52
+
53
+ $$
54
+ L _ { c l s } = H ( { X } ^ { c l s } , { y } ^ { c l s } ) ,
55
+ $$
56
+
57
+ where $H ( \cdot , \cdot )$ is the softmax cross-entropy loss and $y ^ { c l s }$ is the class label.
58
+
59
+ ![](images/c741b481df54f67e411d3cc1b30dc7deb904c80d9d11e57036dbf5b27cdbfb8f.jpg)
60
+ Figure 3: Comparison between CutMix [48] (Left) and our proposed MixToken (Right). CutMix is operated on the input images. This results in patches containing mixed regions from the two images (see the patches enclosed by red bounding boxes). Differently, MixToken targets at mixing tokens after patch embedding. This enables each token after patch embedding to have clean content as shown in the right part of this figure. The detailed advantage of MixToken can be found in Sec. 4.2.
61
+
62
+ # 3.2 Token Labeling
63
+
64
+ The above classification problem only adopts an image-level label as supervision whereas it neglects the rich information embedded in each image patch. In this subsection, we present a new training objective—token labeling—that takes advantage of the complementary information between the patch tokens and the class tokens.
65
+
66
+ Token Labeling: Different from the classification loss as formulated in Eqn. (1) that measures the distance between the single class token (representing the whole input image) and the corresponding image-level label, token labeling emphasizes the importance of all output tokens and advocates that each output token should be associated with an individual location-specific label. Therefore, in our method, the ground truth for an input image involves not only a single $K$ -dimensional vector $y ^ { c l s }$ but also a $K \times N$ matrix or called a $K$ -dimensional score map as represented by $[ y ^ { 1 } , . . . , y ^ { N } ]$ , where $N$ is the number of the output patch tokens.
67
+
68
+ Specifically, we leverage a dense score map for each training image and use the cross-entropy loss between each output patch token and the corresponding aligned label in the dense score map as an auxiliary loss at the training phase. Figure 2 provides an intuitive interpretation. Given the output patch tokens $X ^ { 1 } , . . . , X ^ { N }$ and the corresponding labels $[ y ^ { 1 } , . . . , y ^ { N } ]$ , the token labeling objective can be defined as
69
+
70
+ $$
71
+ L _ { t l } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } H ( X ^ { i } , y ^ { i } ) .
72
+ $$
73
+
74
+ Recall that $H$ is the cross-entropy loss. Therefore, the total loss function can be written as
75
+
76
+ $$
77
+ \begin{array} { l } { { { \cal L } _ { t o t a l } = H ( X ^ { c l s } , y ^ { c l s } ) + \beta \cdot L _ { t l } , } } \\ { { { } } } \\ { { = H ( X ^ { c l s } , y ^ { c l s } ) + \beta \cdot \displaystyle \frac { 1 } { N } \sum _ { i = 1 } ^ { N } H ( X ^ { i } , y ^ { i } ) , } } \end{array}
78
+ $$
79
+
80
+ where $\beta$ is a hyper-parameter to balance the two terms. In our experiment, we empirically set it to 0.5.
81
+
82
+ Advantages: Our token labeling offers the following advantages. First of all, unlike knowledge distillation methods that require a teacher model to generate supervision labels online, token labeling is a cheap operation. The dense score map can be generated by a pretrained model in advance (e.g., EfficientNet [34] or NFNet [3]). During training, we only need to crop the score map and perform interpolation to make it aligned with the cropped image in the spatial coordinate. Thus, the additional computations are negligible. Second, rather than utilizing a single label vector as supervision as done in most classification models and the ReLabel strategy [49], we also harness score maps to supervise the models in a dense manner and thereby the label for each patch token provides location-specific information, which can aid the training models to easily discover the target objects and improve the recognition accuracy. Last but not the least, as dense supervision is adopted in training, we found that the pretrained models with token labeling benefit downstream tasks with dense prediction, like semantic segmentation.
83
+
84
+ # 3.3 Token Labeling with MixToken
85
+
86
+ While training vision transformer, previous studies [36, 46] have shown that augmentation methods, like MixUp [52] and CutMix [48], can effectively boost the performance and robustness of the models. However, vision transformers rely on patch-based tokenization to map each input image to a sequence of tokens and our token labeling strategy also operates on patch-based token labels. If we apply CutMix directly on the raw image, some of the resulting patches may contain content from two images, leading to mixed regions within a small patch as shown in Figure 3. When performing token labeling, it is difficult to assign each output token a clean and correct label. Taking this situation into account, we rethink the CutMix augmentation method and present MixToken, which can be viewed as a modified version of CutMix operating on the tokens after patch embedding as illustrated in the right part of Figure 3.
87
+
88
+ To be specific, for two images denoted as $I _ { 1 } , I _ { 2 }$ and their corresponding token labels $Y _ { 1 } = [ y _ { 1 } ^ { 1 } , . . . , y _ { 1 } ^ { N } ]$ as well as $Y _ { 2 } = [ y _ { 2 } ^ { 1 } , . . . , y _ { 2 } ^ { N } ]$ , we first feed the two images into the patch embedding module to tokenize each as a sequence of tokens, resulting in $T _ { 1 } = [ t _ { 1 } ^ { 1 } , . . . , t _ { 1 } ^ { N } ]$ and $\bar { T _ { 2 } } = [ t _ { 2 } ^ { 1 } , . . . , t _ { 2 } ^ { N } ]$ . Then, we produce a new sequence of tokens by applying MixToken using a binary mask $M$ as follows:
89
+
90
+ $$
91
+ \hat { T } = T _ { 1 } \odot M + T _ { 2 } \odot ( 1 - M ) ,
92
+ $$
93
+
94
+ where $\odot$ is element-wise multiplication. We use the same way to generate the mask $M$ as in [48]. For the corresponding token labels, we also mix them using the same mask $M$ :
95
+
96
+ $$
97
+ \hat { Y } = Y _ { 1 } \odot M + Y _ { 2 } \odot ( 1 - M ) .
98
+ $$
99
+
100
+ The label for the class token can be written as
101
+
102
+ $$
103
+ y ^ { \hat { c } l s } = \bar { M } y _ { 1 } ^ { c l s } + ( 1 - \bar { M } ) y _ { 2 } ^ { c l s } ,
104
+ $$
105
+
106
+ where $\bar { M }$ is the average of all element values of $M$ .
107
+
108
+ # 4 Experiments
109
+
110
+ # 4.1 Experiment Setup
111
+
112
+ We evaluate our method on the ImageNet [13] dataset. All experiments are built and conducted upon PyTorch [29] and the timm [42] library. We follow the standard training schedule and train our models on the ImageNet dataset for 300 epochs. Besides normal augmentations like CutOut [57] and RandAug [10], we also explore the effect of applying MixUp [52] and CutMix [48] together with our proposed token labeling. Empirically, we have found that using MixUp together with token labeling brings no benefit to the performance, and thus we do not apply it in our experiments.
113
+
114
+ For optimization, by default, we use the AdamW optimizer [27] with a linear learning rate scaling strategy $\begin{array} { r } { l r = 1 0 ^ { - 3 } \times \frac { b a t c h \_ s i z e } { 6 4 0 } } \end{array}$ and $5 \times 1 0 ^ { - 2 }$ weight decay rate. For Dropout regularization, we observe that for small models, using Dropout hurts the performance. This has also been observed in a few other works related to training vision transformers [36, 37, 46]. As a result, we do not apply Dropout [32] and use Stochastic Depth [23] instead. More details on hyper-parameters and finetuning can be found in our supplementary materials.
115
+
116
+ We use the NFNet-F6 [3] trained on ImageNet with an $8 6 . 3 \%$ Top-1 accuracy as the machine annotator to generate dense score maps for the ImageNet dataset, yielding a 1000-dimensional score map for each image for training. The score map generation procedure is similar to [49], but we limit our experiment setting by training all models from scratch on ImageNet without extra data support, such as JFT-300M and ImageNet-22K. This is different from the original ReLabel paper [49], in which the EfficientNet-L2 model pretrained on JFT-300M is used. The input resolution for NFNet-F6 is $5 7 6 \times 5 7 6$ , and the dimension of the corresponding output score map for each image is $L \in \mathbb { R } ^ { 1 8 \times 1 8 \times 1 0 0 0 }$ . During training, the target labels for the tokens are generated by applying RoIAlign [17] on the corresponding score map. In practice, we only store the top-5 score maps for each position in half-precision to save space as storing the entire score maps for all the images results in 2TB storage. In our experiment, we only need 10GB of storage to store all the score maps.
117
+
118
+ Table 1: Performance of the proposed LV-ViT with different model sizes. Here, ‘depth’ denotes the number of transformer blocks used in different models. By default, the test resolution is set to $2 2 4 \times 2 2 4$ except the last one which is $2 8 8 \times 2 8 8$ .
119
+
120
+ <table><tr><td>Name</td><td>Depth</td><td>Embed dim.</td><td>MLP Ratio</td><td>#Heads</td><td>#Params</td><td>Throughput (im/s)</td><td>Test size</td><td>Top-1 Acc. (%)</td></tr><tr><td>LV-ViT-T</td><td>12</td><td>240</td><td>3.0</td><td>4</td><td>8.5M</td><td>2032.6</td><td>224</td><td>79.1</td></tr><tr><td>LV-ViT-S</td><td>16</td><td>384</td><td>3.0</td><td>6</td><td>26M</td><td>1018.2</td><td>224</td><td>83.3</td></tr><tr><td>LV-ViT-M</td><td>20</td><td>512</td><td>3.0</td><td>8</td><td>56M</td><td>668.9</td><td>224</td><td>84.1</td></tr><tr><td>LV-ViT-L</td><td>24</td><td>768</td><td>3.0</td><td>12</td><td>150M</td><td>204.8</td><td>288</td><td>85.3</td></tr></table>
121
+
122
+ # 4.2 Ablation Analysis
123
+
124
+ Model Settings: The default settings of the proposed LV-ViT are given in Table 1, where both token labeling and MixToken are used. A slight architecture modification to ViT [15] is that we replace the patch embedding module with a 4-layer convolution to better tokenize the input image and integrate local information. Detailed ablation about patch embedding can be found in our supplementary materials. As can be seen, our LV-ViT-T with only $8 . 5 { \bf M }$ parameters can already achieve a top-1 accuracy of $7 9 . 1 \%$ on ImageNet. Increasing the embedding dimension and network depth can further boost the performance. More experiments compared to other methods can be found in Sec. 4.3. In the following ablation experiments, we will set our LV-ViT-S as baseline and show the advantages of the proposed token labeling and MixToken methods.
125
+
126
+ MixToken: We use MixToken as a substitution for CutMix while applying token labeling. Our experiments show that MixToken performs better than CutMix for token-based transformer models. As shown in Table 2, when training with the original ImageNet labels, using MixToken is $0 . 1 \%$ higher than using CutMix. When using the ReLabel supervision, we can also see an advantage of $0 . { \bar { 2 } } \%$ over the CutMix baseline. Combining with our token labeling, the performance can be further raised to $8 3 . 3 \%$ .
127
+
128
+ Table 2: Ablation on the proposed MixToken and token labeling augmentations. We also show results with either the ImageNet hard label and the ReLabel [49] as supervision.
129
+
130
+ <table><tr><td>Aug. Method</td><td>Supervision</td><td>Top-1 Acc.</td></tr><tr><td>MixToken</td><td>Token labeling</td><td>83.3</td></tr><tr><td>MixToken</td><td>ReLabel</td><td>83.0</td></tr><tr><td>CutMix</td><td>ReLabel</td><td>82.8</td></tr><tr><td>Mixtoken</td><td>ImageNet Label</td><td>82.5</td></tr><tr><td>CutMix</td><td>ImageNet Label</td><td>82.4</td></tr></table>
131
+
132
+ Table 3: Ablation on different widely-used data augmentations. We have empirically found our proposed MixToken performs even better than the combination of MixUp and CutMix in vision transformers.
133
+
134
+ <table><tr><td>MixToken</td><td>MixUp</td><td>CutOut</td><td>RandAug</td><td>Top-1 Acc.</td></tr><tr><td></td><td></td><td></td><td></td><td>83.3</td></tr><tr><td></td><td></td><td></td><td></td><td>81.3</td></tr><tr><td>&gt;x&gt;</td><td>xx&gt;</td><td>&gt;&gt;&gt;</td><td>&gt;&gt;&gt;</td><td>83.1</td></tr><tr><td></td><td>X</td><td></td><td>√</td><td>83.0</td></tr><tr><td>广</td><td>X</td><td>X</td><td>X</td><td>82.8</td></tr></table>
135
+
136
+ Data Augmentation: Here, we study the compatibility of MixToken with other augmentation techniques, such as MixUp [52], CutOut [57] and RandAug [10]. The ablation results are shown in Table 3. We can see when all the four augmentation methods are used, a top-1 accuracy of $8 3 . 1 \%$ is achieved. Interestingly, when the MixUp augmentation is removed, the performance can be improved to $8 3 . 3 \%$ . This may be explained as, using MixToken and MixUp at the same time would bring too much noise in the label, and consequently cause confusion of the model. Moreover, the CutOut augmentation, which randomly erases some parts of the image, is also effective and removing it brings a performance drop of $\dot { 0 } . 3 \%$ . Similarly, the RandAug augmentation also contributes to the performance and using it brings an improvement of $0 . 5 \%$ .
137
+
138
+ All Tokens Matter: To show the importance of involving all tokens in our token labeling method, we attempt to randomly drop some tokens and use the remaining ones for computing the token labeling loss. The percentage of the remaining tokens is denoted as Token Participation Rate. As shown in Figure 4 (Left), we conduct experiments on two models: LV-ViT-S and LV-ViT-M. As can be seen, using only $2 0 \%$ of the tokens to compute the token labeling loss decreases the performance $( - 0 . 5 \%$ for LV-ViT-S and $- 0 . 4 \%$ for LV-ViT-M). Involving more tokens for loss computation consistently leads to better performance. Since involving all tokens brings negligible computation cost and gives the best performance, we always set the token participation rate as $\mathrm { \bar { 1 0 0 \% } }$ in the following experiments.
139
+
140
+ ![](images/810578c2e36580b46aa98e4ec01030b20f6e00994c33dafcaa4cde435beb4d46.jpg)
141
+ Figure 4: Left: LV-ViT ImageNet Top-1 Accuracy w.r.t. the token participation rate while applying token labeling. Token participation rate indicates the percentage of patch tokens involved in computing the token labeling loss. This experiment reflects that all tokens matter for vision transformers. Right: LV-ViT-S ImageNet Top-1 Accuracy w.r.t. different annotator models. The point size indicates the parameter number of the annotator model. Clearly, our token labeling objective is robust to different annotator models.
142
+
143
+ Table 4: Comparison of token labeling (TL), knowledge distillation (KD) based method and ReLabel method based on utilized tokens, DeiT-S/LV-ViT-S Top-1 accuracy on ImageNet validation set and training time on a single V100 GPU node.
144
+
145
+ <table><tr><td>Method</td><td>Online KD</td><td>Online TL</td><td>TL</td><td>ReLabel</td><td>Vanilla</td></tr><tr><td>Tokens Utilized</td><td>2</td><td>All</td><td>All</td><td>1</td><td>1</td></tr><tr><td>DeiT-S Acc. (%)</td><td>81.2</td><td>81.8</td><td>81.0</td><td>80.4</td><td>79.9</td></tr><tr><td>LV-ViT-S Acc. (%)</td><td>83.0</td><td>83.5</td><td>83.3</td><td>82.8</td><td>82.4</td></tr><tr><td>Training Time (8× V100)</td><td>63 hrs</td><td>63 hrs</td><td>45 hrs</td><td>45 hrs</td><td>41 hrs</td></tr></table>
146
+
147
+ Online Token Labeling: Unlike the online knowledge distillation method which generates labels by a teacher model online, our token labeling approach utilizes the dense label map generated in advance and directly applies the corresponding augmentation methods, such as random crop, on the label map to obtain token-level labels. To directly compare with the online knowledge distillation based method and validate the effectiveness of token-level supervision, we further conduct experiments on the online version of our token labeling method, which generates token-level labels online during training. Following DeiT [36], we use RegNetY-16GF [30] as the online teacher model. Results in terms of DeiT-S/LV-ViT-S Top-1 accuracy and training time for our token labeling, online knowledge distillation, and ReLabel [49] are listed in Table 4, with number of utilized tokens also included for clear comparison. As can be seen, for both online and offline cases, using token-level supervision can improve the overall performance with only negligible additional training cost. Meanwhile, compared to the vanilla training baseline, our proposed offline token labeling brings almost no additional training cost, and boosts the overall performance of LV-ViT-S by $0 . 9 \%$ , which well demonstrates its efficiency and effectiveness.
148
+
149
+ Robustness to Different Annotators: To evaluate the robustness of our token labeling method, we use different pretrained CNNs, including EfficientNet-B3,B4,B5,B6,B7,B8 [34], NFNet-F6 [3] and ResNest269E [51], as annotator models to provide dense supervision. Results are shown in the right part of Figure 4. We can see that, even if we use an annotator with relatively lower performance, such as EfficientNet-B3 whose Top-1 accuracy is $8 1 . 6 \%$ , it can still provide multi-label location-specific supervision and help improve the performance of our LV-ViT-S model. Meanwhile, annotator models with better performance can provide more accurate supervision, bringing even better performance, as stronger annotator models can generate better token-level labels. The largest annotator NFNet-F6 [3], which has the best performance of $8 6 . 3 \%$ , allows us to achieve the best result for LV-ViT-S, which is $8 3 . 3 \%$ . In addition, we also attempt to use a better model, EfficientNet-L2 pretrained on JFT-300M as described in [49] which has $8 8 . 2 \%$ Top-1 ImageNet accuracy, as our annotator. The performance of LV-ViT-S can be further improved to $8 \mathrm { { 3 . 5 \% } }$ . However, to fairly compare with the models without extra training data, we only report results based on dense supervision produced by NFNet-F6 [3] that uses only ImageNet training data.
150
+
151
+ ![](images/a3d559defddf629a8a69e1ea7f71228daa68e20f028756c9b3671f019cf5ad40.jpg)
152
+ Figure 5: Performance of the proposed token labeling objective on three different vision transformers: DeiT [36] (Left), T2T-ViT [46] (Middle), and LV-ViT (Right). Our method has a consistent improvement on all 7 different ViT models.
153
+
154
+ Robustness to Different ViT Variants: To further evaluate the robustness of our token labeling, we train different transformer-based networks, including DeiT [36], T2T-ViT [3] and our model LV-ViT, with the proposed training objective. Results are shown in Figure 5. It can be found that, all the models trained with token labeling consistently outperform their vanilla counterparts, demonstrating the robustness of token labeling with respect to different variants of patch-based vision transformers. Meanwhile, for different scales of the models, the improvement is also consistent. Interestingly, we observe larger improvements for larger models. These indicate that our proposed token labeling method is widely applicable to a large range of patch-based vision transformer variants.
155
+
156
+ Beyond Vision Transformers: We further explore the performance of token labeling on other CNN-based and MLP-based models. Results are shown in Table 5. Besides our re-implementation with more data augmentation and regularization techniques, we also provide the results from the original papers. It can be found that for both MLP-based and CNN-based models, our token labeling objective can also improve the performance over strong baselines by providing location-specific dense supervision.
157
+
158
+ Table 5: Performance of the proposed token labeling objective on representative CNN-based (ResNeSt) and MLP-based (Mixer-MLP) models. Our method has a consistent improvement on all different models. Here † indicates results reported in original papers.
159
+
160
+ <table><tr><td>Model</td><td colspan="3">Mixer-S/16 [35]</td><td colspan="3">Mixer-B/16 [35]</td><td colspan="3">Mixer-L/16 [35]</td><td colspan="3">ResNeSt-50 [51]</td></tr><tr><td>Token Labeling</td><td>X</td><td>X</td><td>√</td><td>×</td><td>X</td><td>√</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>√</td></tr><tr><td>Parameters</td><td>18M</td><td>18M18M</td><td></td><td>59M</td><td>59M 59M</td><td></td><td>207M</td><td></td><td>207M207M</td><td>27M</td><td></td><td>27M 27M</td></tr><tr><td>Top-1 Acc. (%)</td><td>73.8t</td><td>75.6</td><td>76.1</td><td>76.4</td><td>78.3</td><td>79.5</td><td>71.6t</td><td>77.7</td><td>80.1</td><td>81.1t</td><td>80.9</td><td>81.5</td></tr></table>
161
+
162
+ # 4.3 Comparison to Other Methods
163
+
164
+ We compare our proposed model LV-ViT with other state-of-the-art methods in Table 6. For smallsized models, when the test resolution is set to $2 2 4 \times 2 2 4$ , we achieve an $8 3 . 3 \%$ accuracy on ImageNet with only 26M parameters, which is $3 . 4 \%$ higher than the strong baseline DeiT-S [36]. For mediumsized models, when the test resolution is set to $3 8 4 \times 3 8 4$ we achieve the performance of $8 5 . 4 \%$ , the same as CaiT-S36 [37], but with much less computational cost and parameters. Note that both DeiT and CaiT use knowledge distillation to improve their models, which introduce much more computations in training. However, we do not require any extra computations in training and only have to compute and store the dense score maps in advance. For large-sized models, our LV-ViT-L with a test resolution of $4 4 8 \times 4 4 8$ achieves an $8 6 . 2 \%$ top-1 accuracy, which is comparable to CaiT-M36 [37] but with far fewer FLOPs and parameters.
165
+
166
+ Table 6: Top-1 accuracy comparison with other methods on ImageNet [13] and ImageNet Real [2]. All models are trained without external data. With the same computation and parameter constraint, our model consistently outperforms other CNN-based and transformer-based counterparts. The results of CNNs and ViT are referenced from [37].
167
+
168
+ <table><tr><td>Network</td><td>Params</td><td>FLOPs</td><td>Train size</td><td>Test size</td><td>Top-1(%)</td><td>Real Top-1 (%)</td></tr><tr><td>EfficientNet-B5 [34] SNNO</td><td>30M</td><td>9.9B</td><td>456</td><td>456</td><td>83.6</td><td>88.3</td></tr><tr><td>EfficientNet-B7 [34]</td><td>66M</td><td>37.0B</td><td>600</td><td>600</td><td>84.3</td><td></td></tr><tr><td>Fix-EfficientNet-B8 [34,38]</td><td>87M</td><td>89.5B</td><td>672</td><td>800</td><td>85.7</td><td>90.0</td></tr><tr><td>NFNet-F3 [3]</td><td>255M</td><td>114.8B</td><td>320</td><td>416</td><td>85.7</td><td>89.4</td></tr><tr><td>NFNet-F4 [3]</td><td>316M</td><td>215.3B</td><td>384</td><td>512</td><td>85.9</td><td>89.4</td></tr><tr><td>NFNet-F5[3]</td><td>377M</td><td>289.8B</td><td>416</td><td>544</td><td>86.0</td><td>89.2</td></tr><tr><td>ViT-B/16 [15]</td><td>86M</td><td>55.4B</td><td>224</td><td>384</td><td>77.9</td><td>83.6</td></tr><tr><td>ViT-L/16[15]</td><td>307M</td><td>190.7B</td><td>224</td><td>384</td><td>76.5</td><td>82.2</td></tr><tr><td>T2T-ViT-14 [46]</td><td>22M</td><td>5.2B</td><td>224</td><td>224</td><td>81.5</td><td></td></tr><tr><td>T2T-ViT-14↑384 [46]</td><td>22M</td><td>17.1B</td><td>224</td><td>384</td><td>83.3</td><td>1</td></tr><tr><td>Cross ViT [6]</td><td>45M</td><td>56.6B</td><td>224</td><td>480</td><td>84.1</td><td>一</td></tr><tr><td>Swin-B[25]</td><td>88M</td><td>47.0B</td><td>224</td><td>384</td><td>84.2</td><td></td></tr><tr><td>TNT-B[16]</td><td>66M</td><td>14.1B</td><td>224</td><td>224</td><td>82.8</td><td></td></tr><tr><td>iriirrrrrs DeepViT-S [59]</td><td>27M</td><td>6.2B</td><td>224</td><td>224</td><td>82.3</td><td></td></tr><tr><td>DeepViT-L [59]</td><td>55M</td><td>12.5B</td><td>224</td><td>224</td><td>83.1</td><td></td></tr><tr><td>DeiT-S[36]</td><td>22M</td><td>4.6B</td><td>224</td><td>224</td><td>79.9</td><td>85.7</td></tr><tr><td>Distilled DeiT-S [36]</td><td>22M</td><td>4.6B</td><td>224</td><td>224</td><td>81.2</td><td>86.8</td></tr><tr><td>DeiT-B [36]</td><td>86M</td><td>17.5B</td><td>224</td><td>224</td><td>81.8</td><td>86.7</td></tr><tr><td>DeiT-B↑384 [36]</td><td>86M</td><td>55.4B</td><td>224</td><td>384</td><td>83.1</td><td>87.7</td></tr><tr><td>Distilled DeiT-B [36]</td><td>87M</td><td>17.5B</td><td>224</td><td>224</td><td>83.4</td><td>88.3</td></tr><tr><td>BoTNet-S1-128 [31]</td><td>79.1M</td><td>19.3B</td><td>256</td><td>256</td><td>84.2</td><td></td></tr><tr><td>BoTNet-S1-128↑384 [31]</td><td>79.1M</td><td>45.8B</td><td>256</td><td>384</td><td>84.7</td><td>-</td></tr><tr><td>CaiT-S36↑384 [37]</td><td>68M</td><td>48.0B</td><td>224</td><td>384</td><td>85.4</td><td>- 89.8</td></tr><tr><td>CaiT-M36[37]</td><td>271M</td><td>53.7B</td><td>224</td><td>224</td><td>85.1</td><td>89.3</td></tr><tr><td>CaiT-M36↑448 [37]</td><td>271M</td><td>247.8B</td><td>224</td><td>448</td><td>86.3</td><td>90.2</td></tr><tr><td>LV-ViT-S</td><td>26M</td><td>6.6B</td><td>224</td><td>224</td><td>83.3</td><td></td></tr><tr><td>江 LV-ViT-S↑384</td><td>26M</td><td>22.2B</td><td>224</td><td>384</td><td>84.4</td><td>88.1 88.9</td></tr><tr><td>LV-ViT-M</td><td>56M</td><td>16.0B</td><td>224</td><td>224</td><td>84.1</td><td>88.4</td></tr><tr><td>W LV-ViT-M↑384</td><td>56M</td><td>42.2B</td><td>224</td><td>384</td><td>85.4</td><td>89.5</td></tr><tr><td>LV-ViT-L</td><td>150M</td><td>59.0B</td><td>288</td><td>288</td><td>85.3</td><td>89.3</td></tr><tr><td>0 LV-ViT-L↑448</td><td>150M</td><td>157.2B</td><td>288</td><td>448</td><td>85.9</td><td>89.7</td></tr><tr><td>LV-ViT-L↑448</td><td>150M</td><td>157.2B</td><td>448</td><td>448</td><td>86.2</td><td>89.9</td></tr><tr><td>LV-ViT-L↑512</td><td>151M</td><td>214.8B</td><td>448</td><td>512</td><td>86.4</td><td>90.1</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
169
+
170
+ # 4.4 Semantic Segmentation on ADE20K
171
+
172
+ It has been shown in [19] that different training techniques for pretrained models have different impacts on downstream tasks with dense prediction, like semantic segmentation. To demonstrate the advantage of the proposed token labeling objective on tasks with dense prediction, we apply our pretrained LV-ViT with token labeling to the semantic segmentation task.
173
+
174
+ Similar to previous work [25], we run experiments on the widely-used ADE20K [58] dataset. ADE20K contains 25K images in total, including 20K images for training, 2K images for validation and 3K images for test, and covering 150 different foreground categories. We take both FCN [26] and UperNet [44] as our segmentation frameworks and use the mmseg toolbox to implement. During training, following [25], we use the AdamW optimizer with an initial learning rate of 6e-5 and a weight decay of 0.01. We also use a linear learning schedule with a minimum learning rate of 5e-6. All models are trained on 8 GPUs and with a batch size of 16 (i.e., 2 images on each GPU). The input resolution is set to $5 1 2 \times 5 1 2$ . In inference, a multi-scale test with interpolation rates of [0.75, 1.0, 1.25, 1.5, 1.75] is used. As suggested by [58], we report results in terms of both mean intersection-over-union (mIoU) and the average pixel accuracy (Pixel Acc.).
175
+
176
+ In Table 7, we test the performance of token labeling on both FCN and UperNet frameworks. The FCN framework has a light convolutional head and can directly reflect the performance of the pretrained models in terms of transferable capability. As can be seen, pretrained models with token labeling perform better than those without token labeling. This indicates token labeling is indeed beneficial to semantic segmentation.
177
+
178
+ Table 7: Transfer performance of the proposed LV-ViT in semantic segmentation. We take two classic methods, FCN and UperNet, as segmentation architectures and show both single-scale (SS) and multi-scale (MS) results on the validation set.
179
+
180
+ <table><tr><td>Method</td><td>Token Labeling</td><td>Model Size</td><td>mIoU (SS)</td><td>P. Acc. (SS)</td><td>mIoU (MS)</td><td>P. Acc. (MS)</td></tr><tr><td>LV-ViT-S + FCN</td><td>×</td><td>30M</td><td>46.1</td><td>81.9</td><td>47.3</td><td>82.6</td></tr><tr><td>LV-ViT-S + FCN</td><td></td><td>30M</td><td>47.2</td><td>82.4</td><td>48.4</td><td>83.0</td></tr><tr><td>LV-ViT-S + UperNet</td><td></td><td>44M</td><td>46.5</td><td>82.1</td><td>47.6</td><td>82.7</td></tr><tr><td>LV-ViT-S + UperNet</td><td>X</td><td>44M</td><td>47.9</td><td>82.6</td><td>48.6</td><td>83.1</td></tr></table>
181
+
182
+ We also compare our segmentation results with previous state-of-the-art segmentation methods in Table 8. Without pretraining on large-scale datasets such as ImageNet-22K, our LV-ViT-M with the UperNet segmentation architecture achieves an mIoU score of 50.6 with only 77M parameters. This result is much better than the previous CNN-based and transformer-based models. Furthermore, using our LV-ViT-L as the pretrained model yields a better result of 51.8 in terms of mIoU. As far as we know, this is the best result reported on ADE20K with no pretraining on ImageNet-22K or other large-scale datasets.
183
+
184
+ Table 8: Comparison with previous work on ADE20K validation set. As far as we know, our LVViT-L $^ +$ UperNet achieves the best result on ADE20K with only ImageNet-1K as training data in pretraining. †Pretrained on ImageNet-22K.
185
+
186
+ <table><tr><td></td><td>Backbone</td><td>Segmentation Architecture</td><td>Model Size</td><td>mIoU (MS)</td><td>Pixel Acc. (MS)</td></tr><tr><td rowspan="5">SNNO</td><td>ResNet-269</td><td>PSPNet [54]</td><td></td><td>44.9</td><td>81.7</td></tr><tr><td>ResNet-101</td><td>UperNet [44]</td><td>86M</td><td>44.9</td><td>-</td></tr><tr><td>ResNet-101</td><td>Strip Pooling [22]</td><td></td><td>45.6</td><td>82.1</td></tr><tr><td>ResNeSt200</td><td>DeepLabV3+ [8]</td><td>88M</td><td>48.4</td><td>1</td></tr><tr><td>DeiT-S</td><td>UperNet</td><td>52M</td><td>44.0</td><td>-</td></tr><tr><td rowspan="5">Tirriiirrss</td><td>ViT-Larget</td><td>SETR [56]</td><td>308M</td><td>50.3</td><td>83.5</td></tr><tr><td>Swin-T[25]</td><td>UperNet</td><td>60M</td><td>46.1</td><td>1</td></tr><tr><td>Swin-S [25]</td><td>UperNet</td><td>81M</td><td>49.3</td><td>=</td></tr><tr><td>Swin-B [25]</td><td>UperNet</td><td>121M</td><td>49.7</td><td></td></tr><tr><td>Swin-B† [25]</td><td>UperNet</td><td>121M</td><td>51.6</td><td>-</td></tr><tr><td rowspan="4">LIA-AT</td><td>LV-ViT-S</td><td>FCN</td><td>30M</td><td>48.4</td><td>83.0</td></tr><tr><td>LV-ViT-S</td><td>UperNet</td><td>44M</td><td>48.6</td><td>83.1</td></tr><tr><td>LV-ViT-M</td><td>UperNet</td><td>77M</td><td>50.6</td><td>83.5</td></tr><tr><td>LV-ViT-L</td><td>UperNet</td><td>209M</td><td>51.8</td><td>84.1</td></tr></table>
187
+
188
+ # 5 Conclusions and Discussion
189
+
190
+ In this paper, we introduce a new token labeling method to help improve the performance of vision transformers. We also analyze the effectiveness and robustness of our token labeling with respect to different annotators and different variants of patch-based vision transformers. By applying token labeling, our proposed LV-ViT achieves $8 4 . 4 \%$ Top-1 accuracy with only 26M parameters and $8 6 . 4 \%$ Top-1 accuracy with 150M parameters on ImageNet-1K benchmark.
191
+
192
+ Despite the effectiveness, token labeling has a limitation of requiring a pretrained model as the machine annotator. Fortunately, the machine annotating procedure can be done in advance to avoid introducing extra computational cost in training. This makes our method quite different from knowledge distillation methods that rely on online teaching. For users with limited machine resources on hand, our token labeling provides a promising training technique to improve the performance of vision transformers.
193
+
194
+ References
195
+ [1] Irwan Bello. Lambdanetworks: Modeling long-range interactions without attention. arXiv preprint arXiv:2102.08602, 2021.
196
+ [2] Lucas Beyer, Olivier J Hénaff, Alexander Kolesnikov, Xiaohua Zhai, and Aäron van den Oord. Are we done with imagenet? arXiv preprint arXiv:2006.07159, 2020.
197
+ [3] Andrew Brock, Soham De, Samuel L Smith, and Karen Simonyan. High-performance large-scale image recognition without normalization. arXiv preprint arXiv:2102.06171, 2021.
198
+ [4] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
199
+ [5] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. arXiv preprint arXiv:2005.12872, 2020.
200
+ [6] Chun-Fu Chen, Quanfu Fan, and Rameswar Panda. Crossvit: Cross-attention multi-scale vision transformer for image classification. arXiv preprint arXiv:2103.14899, 2021.
201
+ [7] Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020.
202
+ [8] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In Proceedings of the European conference on computer vision (ECCV), pages 801–818, 2018.
203
+ [9] Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In International Conference on Machine Learning, pages 1691–1703. PMLR, 2020.
204
+ [10] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 702–703, 2020.
205
+ [11] Zhigang Dai, Bolun Cai, Yugeng Lin, and Junying Chen. Up-detr: Unsupervised pre-training for object detection with transformers. arXiv preprint arXiv:2011.09094, 2020.
206
+ [12] Stéphane d’Ascoli, Hugo Touvron, Matthew Leavitt, Ari Morcos, Giulio Biroli, and Levent Sagun. Convit: Improving vision transformers with soft convolutional inductive biases. arXiv preprint arXiv:2103.10697, 2021.
207
+ [13] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
208
+ [14] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
209
+ [15] 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.
210
+ [16] Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. Transformer in transformer. arXiv preprint arXiv:2103.00112, 2021.
211
+ [17] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 2961–2969, 2017.
212
+ [18] 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.
213
+ [19] Tong He, Zhi Zhang, Hang Zhang, Zhongyue Zhang, Junyuan Xie, and Mu Li. Bag of tricks for image classification with convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 558–567, 2019.
214
+ [20] Byeongho Heo, Sangdoo Yun, Dongyoon Han, Sanghyuk Chun, Junsuk Choe, and Seong Joon Oh. Rethinking spatial dimensions of vision transformers. arXiv preprint arXiv:2103.16302, 2021.
215
+ [21] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
216
+ [22] Qibin Hou, Li Zhang, Ming-Ming Cheng, and Jiashi Feng. Strip pooling: Rethinking spatial pooling for scene parsing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4003–4012, 2020.
217
+ [23] Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European conference on computer vision, pages 646–661. Springer, 2016.
218
+ [24] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
219
+ [25] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
220
+ [26] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3431–3440, 2015.
221
+ [27] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
222
+ [28] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
223
+ [29] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in neural information processing systems, pages 8026–8037, 2019.
224
+ [30] Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollár. Designing network design spaces. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10428–10436, 2020.
225
+ [31] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
226
+ [32] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014.
227
+ [33] Zhiqing Sun, Shengcao Cao, Yiming Yang, and Kris Kitani. Rethinking transformer-based set prediction for object detection. arXiv preprint arXiv:2011.10881, 2020.
228
+ [34] Mingxing Tan and Quoc V Le. Efficientnet: Rethinking model scaling for convolutional neural networks. arXiv preprint arXiv:1905.11946, 2019.
229
+ [35] Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, et al. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint arXiv:2105.01601, 2021.
230
+ [36] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
231
+ [37] Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021.
232
+ [38] Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Hervé Jégou. Fixing the train-test resolution discrepancy. arXiv preprint arXiv:1906.06423, 2019.
233
+ [39] 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:5998–6008, 2017.
234
+ [40] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122, 2021.
235
+ [41] Yuqing Wang, Zhaoliang Xu, Xinlong Wang, Chunhua Shen, Baoshan Cheng, Hao Shen, and Huaxia Xia. End-to-end video instance segmentation with transformers. arXiv preprint arXiv:2011.14503, 2020.
236
+ [42] Ross Wightman. Pytorch image models. https://github.com/rwightman/ pytorch-image-models, 2019.
237
+ [43] Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan, and Lei Zhang. Cvt: Introducing convolutions to vision transformers. arXiv preprint arXiv:2103.15808, 2021.
238
+ [44] Tete Xiao, Yingcheng Liu, Bolei Zhou, Yuning Jiang, and Jian Sun. Unified perceptual parsing for scene understanding. In Proceedings of the European Conference on Computer Vision (ECCV), pages 418–434, 2018.
239
+ [45] Fuzhi Yang, Huan Yang, Jianlong Fu, Hongtao Lu, and Baining Guo. Learning texture transformer network for image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5791–5800, 2020.
240
+ [46] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
241
+ [47] Li Yuan, Francis EH Tay, Guilin Li, Tao Wang, and Jiashi Feng. Revisiting knowledge distillation via label smoothing regularization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3903–3911, 2020.
242
+ [48] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6023–6032, 2019.
243
+ [49] Sangdoo Yun, Seong Joon Oh, Byeongho Heo, Dongyoon Han, Junsuk Choe, and Sanghyuk Chun. Re-labeling imagenet: from single to multi-labels, from global to localized labels. arXiv preprint arXiv:2101.05022, 2021.
244
+ [50] Yanhong Zeng, Jianlong Fu, and Hongyang Chao. Learning joint spatial-temporal transformations for video inpainting. In European Conference on Computer Vision, pages 528–543. Springer, 2020.
245
+ [51] Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Zhi Zhang, Haibin Lin, Yue Sun, Tong He, Jonas Muller, R. Manmatha, Mu Li, and Alexander Smola. Resnest: Split-attention networks. arXiv preprint arXiv:2004.08955, 2020.
246
+ [52] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
247
+ [53] Hengshuang Zhao, Li Jiang, Jiaya Jia, Philip Torr, and Vladlen Koltun. Point transformer. arXiv preprint arXiv:2012.09164, 2020.
248
+ [54] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2881–2890, 2017.
249
+ [55] Minghang Zheng, Peng Gao, Xiaogang Wang, Hongsheng Li, and Hao Dong. End-to-end object detection with adaptive clustering transformer. arXiv preprint arXiv:2011.09315, 2020.
250
+ [56] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. arXiv preprint arXiv:2012.15840, 2020.
251
+ [57] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13001–13008, 2020.
252
+ [58] 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.
253
+ [59] Daquan Zhou, Bingyi Kang, Xiaojie Jin, Linjie Yang, Xiaochen Lian, Qibin Hou, and Jiashi Feng. Deepvit: Towards deeper vision transformer. arXiv preprint arXiv:2103.11886, 2021.
254
+ [60] Luowei Zhou, Yingbo Zhou, Jason J Corso, Richard Socher, and Caiming Xiong. End-to-end dense video captioning with masked transformer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8739–8748, 2018.
255
+ [61] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020.
md/train/6puCSjH3hwA/6puCSjH3hwA.md ADDED
@@ -0,0 +1,524 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A GOOD IMAGE GENERATOR IS WHAT YOU NEED FOR HIGH-RESOLUTION VIDEO SYNTHESIS
2
+
3
+ Yu Tian1∗, Jian $\mathbf { R e n } ^ { 2 }$ , Menglei Chai2, Kyle Olszewski2, Xi Peng3,
4
+ Dimitris N. Metaxas1, Sergey Tulyakov2
5
+ 1Rutgers University, 2Snap Inc., 3University of Delaware
6
+ {yt219, dnm}@cs.rutgers.edu,
7
+ {jren, mchai, kolszewski, stulyakov}@snapchat.com
8
+
9
+ # ABSTRACT
10
+
11
+ Image and video synthesis are closely related areas aiming at generating content from noise. While rapid progress has been demonstrated in improving imagebased models to handle large resolutions, high-quality renderings, and wide variations in image content, achieving comparable video generation results remains problematic. We present a framework that leverages contemporary image generators to render high-resolution videos. We frame the video synthesis problem as discovering a trajectory in the latent space of a pre-trained and fixed image generator. Not only does such a framework render high-resolution videos, but it also is an order of magnitude more computationally efficient. We introduce a motion generator that discovers the desired trajectory, in which content and motion are disentangled. With such a representation, our framework allows for a broad range of applications, including content and motion manipulation. Furthermore, we introduce a new task, which we call cross-domain video synthesis, in which the image and motion generators are trained on disjoint datasets belonging to different domains. This allows for generating moving objects for which the desired video data is not available. Extensive experiments on various datasets demonstrate the advantages of our methods over existing video generation techniques. Code will be released at https://github.com/snap-research/MoCoGAN-HD.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Video synthesis seeks to generate a sequence of moving pictures from noise. While its closely related counterpart—image synthesis—has seen substantial advances in recent years, allowing for synthesizing at high resolutions (Karras et al., 2017), rendering images often indistinguishable from real ones (Karras et al., 2019), and supporting multiple classes of image content (Zhang et al., 2019), contemporary improvements in the domain of video synthesis have been comparatively modest. Due to the statistical complexity of videos and larger model sizes, video synthesis produces relatively low-resolution videos, yet requires longer training times. For example, scaling the image generator of Brock et al. (2019) to generate $2 5 6 \times 2 5 6$ videos requires a substantial computational budget1. Can we use a similar method to attain higher resolutions? We believe a different approach is needed.
16
+
17
+ There are two desired properties for generated videos: (i) high quality for each individual frame, and (ii) the frame sequence should be temporally consistent, i.e. depicting the same content with plausible motion. Previous works (Tulyakov et al., 2018; Clark et al., 2019) attempt to achieve both goals with a single framework, making such methods computationally demanding when high resolution is desired. We suggest a different perspective on this problem. We hypothesize that, given an image generator that has learned the distribution of video frames as independent images, a video can be represented as a sequence of latent codes from this generator. The problem of video synthesis can then be framed as discovering a latent trajectory that renders temporally consistent images. Hence, we demonstrate that (i) can be addressed by a pre-trained and fixed image generator, and (ii) can be achieved using the proposed framework to create appropriate image sequences.
18
+
19
+ To discover the appropriate latent trajectory, we introduce a motion generator, implemented via two recurrent neural networks, that operates on the initial content code to obtain the motion representation. We model motion as a residual between continuous latent codes that are passed to the image generator for individual frame generation. Such a residual representation can also facilitate the disentangling of motion and content. The motion generator is trained using the chosen image discriminator with contrastive loss to force the content to be temporally consistent, and a patch-based multi-scale video discriminator for learning motion patterns. Our framework supports contemporary image generators such as StyleGAN2 (Karras et al., 2019) and BigGAN (Brock et al., 2019).
20
+
21
+ We name our approach as MoCoGAN-HD (Motion and Content decomposed GAN for HighDefinition video synthesis) as it features several major advantages over traditional video synthesis pipelines. First, it transcends the limited resolutions of existing techniques, allowing for the generation of high-quality videos at resolutions up to $1 0 2 4 \times 1 0 2 4$ . Second, as we search for a latent trajectory in an image generator, our method is computationally more efficient, requiring an order of magnitude less training time than previous video-based works (Clark et al., 2019). Third, as the image generator is fixed, it can be trained on a separate high-quality image dataset. Due to the disentangled representation of motion and content, our approach can learn motion from a video dataset and apply it to an image dataset, even in the case of two datasets belonging to different domains. It thus unleashes the power of an image generator to synthesize high quality videos when a domain (e.g., dogs) contains many high-quality images but no corresponding high-quality videos (see Fig. 4). In this manner, our method can generate realistic videos of objects it has never seen moving during training (such as generating realistic pet face videos using motions extracted from images of talking people). We refer to this new video generation task as cross-domain video synthesis. Finally, we quantitatively and qualitatively evaluate our approach, attaining state-of-the-art performance on each benchmark, and establish a challenging new baseline for video synthesis methods.
22
+
23
+ # 2 RELATED WORK
24
+
25
+ Video Synthesis. Approaches to image generation and translation using Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) have demonstrated the ability to synthesize high quality images (Radford et al., 2016; Zhang et al., 2019; Brock et al., 2019; Donahue & Simonyan, 2019; Jin et al., 2021). Built upon image translation (Isola et al., 2017; Wang et al., 2018b), works on video-to-video translation (Bansal et al., 2018; Wang et al., 2018a) are capable of converting an input video to a high-resolution output in another domain. However, the task of high-fidelity video generation, in the unconditional setting, is still a difficult and unresolved problem. Without the strong conditional inputs such as segmentation masks (Wang et al., 2019) or human poses (Chan et al., 2019; Ren et al., 2020) that are employed by video-to-video translation works, generating videos following the distribution of training video samples is challenging. Earlier works on GANbased video modeling, including MDPGAN (Yushchenko et al., 2019), VGAN (Vondrick et al., 2016), TGAN (Saito et al., 2017), MoCoGAN (Tulyakov et al., 2018), ProgressiveVGAN (Acharya et al., 2018), TGANv2 (Saito et al., 2020) show promising results on low-resolution datasets. Recent efforts demonstrate the capacity to generate more realistic videos, but with significantly more computation (Clark et al., 2019; Weissenborn et al., 2020). In this paper, we focus on generating realistic videos using manageable computational resources. LDVDGAN (Kahembwe & Ramamoorthy, 2020) uses low dimensional discriminator to reduce model size and can generate videos with resolution up to $5 1 2 \times 5 1 2$ , while we decrease training cost by utilizing a pre-trained image generator. The high-quality generation is achieved by using pre-trained image generators, while the motion trajectory is modeled within the latent space. Additionally, learning motion in the latent space allows us to easily adapt the video generation model to the task of video prediction (Denton et al., 2017), in which the starting frame is given (Denton & Fergus, 2018; Zhao et al., 2018; Walker et al., 2017; Villegas et al., 2017b;a; Babaeizadeh et al., 2017; Hsieh et al., 2018; Byeon et al., 2018), by inverting the initial frame through the generator (Abdal et al., 2020), instead of training an extra image encoder (Tulyakov et al., 2018; Zhang et al., 2020).
26
+
27
+ Interpretable Latent Directions. The latent space of GANs is known to consist of semantically meaningful vectors for image manipulation. Both supervised methods, either using human annotations or pre-trained image classifiers (Goetschalckx et al., 2019; Shen et al., 2020), and unsupervised methods (Jahanian et al., 2020; Plumerault et al., 2020), are able to find interpretable directions for image editing, such as supervising directions for image rotation or background removal (Voynov &
28
+
29
+ ![](images/1d51f6cbf295d027c9a3cd793ca8bdc6862f3cbdc3e68b27dcb8f2dd21f8b26d.jpg)
30
+ Figure 1: Left: Given an initial latent code $\mathbf { z } _ { 1 }$ , a trajectory $\epsilon _ { t }$ , and a PCA basis $\mathbf { V }$ , the motion generator $G _ { \mathrm { M } }$ encodes $\mathbf { z } _ { 1 }$ using $\mathrm { L S T M _ { \mathrm { e n c } } }$ to get the initial hidden state and uses $\mathrm { L S T M _ { d e c } }$ to estimate hidden states for future frames. The image generator $G _ { \mathrm { I } }$ synthesizes images using the predicted latent codes. The discriminator $D _ { \mathrm { { V } } }$ is trained on both real and generated video sequences. Right: For each generated video, the first and subsequent frames are sent to an image discriminator $D _ { \mathrm { I } }$ . An encoder-like network $F$ calculates the features of synthesized images used to compute the contrastive loss ${ \mathcal { L } } _ { \mathrm { c o n t r } }$ with positive (same image content, but different augmentation, shown in blue) and negative pairs (different image content and augmentation, shown in red).
31
+
32
+ Babenko, 2020; Shen & Zhou, 2020). We further consider the motion vectors in the latent space. By disentangling the motion trajectories in an unsupervised fashion, we are able to transfer the motion information from a video dataset to an image dataset in which no temporal information is available.
33
+
34
+ Contrastive Representation Learning is widely studied in unsupervised learning tasks (He et al., 2020; Chen et al., 2020a;b; Henaff et al., 2020; L ´ owe et al., 2019; Oord et al., 2018; Misra & Maaten, ¨ 2020). Related inputs, such as images (Wu et al., 2018) or latent representations (Hjelm et al., 2019), which can vary while training due to data augmentation, are forced to be close by minimizing differences in their representation during training. Recent work (Park et al., 2020) applies noisecontrastive estimation (Gutmann & Hyvarinen, 2010) to image generation tasks by learning the ¨ correspondence between image patches, achieving performance superior to that attained when using cycle-consistency constraints (Zhu et al., 2017; Yi et al., 2017). On the other hand, we learn an image discriminator to create videos with coherent content by leveraging contrastive loss (Hadsell et al., 2006) along with an adversarial loss (Goodfellow et al., 2014).
35
+
36
+ # 3 METHOD
37
+
38
+ In this section, we introduce our method for high-resolution video generation. Our framework is built on top of a pre-trained image generator (Karras et al., 2020a;b; Zhao et al., 2020a;b), which helps to generate high-quality image frames and boosts the training efficiency with manageable computational resources. In addition, with the image generator fixed during training, we can disentangle video motion from image content, and enable video synthesis even when the image content and the video motion come from different domains.
39
+
40
+ More specifically, our inference framework includes a motion generator $G _ { \mathrm { M } }$ and an image generator $G _ { \mathrm { I } }$ . $G _ { \mathrm { M } }$ is implemented with two LSTM networks (Hochreiter & Schmidhuber, 1997) and predicts the latent motion trajectory $\mathbf { Z } = \left\{ \mathbf { z } _ { 1 } , \mathbf { z } _ { 2 } , \cdots , \mathbf { z } _ { n } \right\}$ , where $n$ is the number of frames in the synthesized video. The image generator $G _ { \mathrm { I } }$ can thus synthesize each individual frame from the motion trajectory. The generated video sequence $\tilde { \mathbf { v } }$ is given by $\tilde { \mathbf { v } } = \{ \tilde { \mathbf { x } } _ { 1 } , \tilde { \mathbf { x } } _ { 2 } , \cdots , \tilde { \mathbf { x } } _ { n } \}$ . For each synthesized frame $\tilde { \mathbf { x } } _ { t }$ , we have $\tilde { \mathbf { x } } _ { t } = G _ { \mathrm { I } } ( \mathbf { z } _ { t } )$ for $t = 1 , 2 , \cdots , n$ . We also define the real video clip as $\mathbf { v } = \{ \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \cdots , \mathbf { x } _ { n } \}$ and the training video distribution as $p _ { v }$ .
41
+
42
+ To train the motion generator $G _ { \mathrm { M } }$ to discover the desired motion trajectory, we apply a video discriminator to constrain the generated motion patterns to be similar to those of the training videos, and an image discriminator to force the frame content to be temporally consistent. Our framework is illustrated in Fig. 1. We describe each component in more detail in the following sections.
43
+
44
+ # 3.1 MOTION GENERATOR
45
+
46
+ The motion generator $G _ { \mathrm { M } }$ predicts consecutive latent codes using an input code $\mathbf { z } _ { 1 } \in { \mathcal { Z } }$ , where the latent space $\mathcal { Z }$ is also shared by the image generator. For BigGAN (Brock et al., 2019), we sample $\mathbf { z } _ { 1 }$ from the normal distribution $p _ { z }$ . For StyleGAN2 (Karras et al., 2020b), $p _ { z }$ is the distribution after the multi-layer perceptron (MLP), as the latent codes within this distribution can be semantically disentangled better than when using the normal distribution (Shen et al., 2020; Zhu et al., 2020).
47
+
48
+ Formally, $G _ { \mathrm { M } }$ includes an LSTM encoder $\mathrm { L S T M _ { \mathrm { e n c } } }$ , which encodes $\mathbf { z } _ { 1 }$ to get the initial hidden state, and a LSTM decoder $\mathrm { L S T M _ { d e c } }$ , which estimates $n - 1$ continuous hidden states recursively:
49
+
50
+ $$
51
+ \begin{array} { c } { { { \bf h } _ { 1 } , { \bf c } _ { 1 } = \mathrm { L S T M } _ { \mathrm { e n c } } ( { \bf z } _ { 1 } ) , } } \\ { { { \bf h } _ { t } , { \bf c } _ { t } = \mathrm { L S T M } _ { \mathrm { d e c } } ( \epsilon _ { t } , ( { \bf h } _ { t - 1 } , { \bf c } _ { t - 1 } ) ) , t = 2 , 3 , \cdots , n , } } \end{array}
52
+ $$
53
+
54
+ where $\mathbf { h }$ and c denote the hidden state and cell state respectively, and $\epsilon _ { t }$ is a noise vector sampled from the normal distribution to model the motion diversity at timestamp $t$ .
55
+
56
+ Motion Disentanglement. Prior work (Tulyakov et al., 2018) applies $\mathbf { h } _ { t }$ as the motion code for the frame to be generated, while the content code is fixed for all frames. However, such a design requires a recurrent network to estimate the motion while preserving consistent content from the latent vector, which is difficult to learn in practice. Instead, we propose to use a sequence of motion residuals for estimating the motion trajectory. Specifically, we model the motion residual as the linear combination of a set of interpretable directions in the latent space (Shen & Zhou, 2020; Hark ¨ onen ¨ et al., 2020). We first conduct principal component analysis (PCA) on $m$ randomly sampled latent vectors from $\mathcal { Z }$ to get the basis $\mathbf { V }$ . Then, we estimate the motion direction from the previous frame $\mathbf { z } _ { t - 1 }$ to the current frame $\mathbf { z } _ { t }$ by using $\mathbf { h } _ { t }$ and $\mathbf { V }$ as follows:
57
+
58
+ $$
59
+ \mathbf { z } _ { t } = \mathbf { z } _ { t - 1 } + \lambda \cdot \mathbf { h } _ { t } \cdot \mathbf { V } , t = 2 , 3 , \cdots , n ,
60
+ $$
61
+
62
+ where the hidden state ${ \mathbf h } _ { t } \in [ - 1 , 1 ]$ , and $\lambda$ controls the step given by the residual. With Eqn. 1 and Eqn. 2, we have $G _ { \mathrm { M } } ( \mathbf { z } _ { 1 } ) = \left\{ \mathbf { z } _ { 1 } , \mathbf { z } _ { 2 } , \cdots , \mathbf { z } _ { n } \right\}$ , and the generated video $\tilde { \mathbf { v } }$ is given as $\tilde { { \textbf { v } } } =$ $G _ { \mathrm { I } } ( G _ { \mathrm { M } } ( \mathbf { z } _ { 1 } ) )$ .
63
+
64
+ Motion Diversity. In Eqn. 1, we introduce a noise vector $\epsilon _ { t }$ to control the diversity of motion. However, we observe that the LSTM decoder tends to neglect the $\epsilon _ { t }$ , resulting in motion mode collapse, meaning that $G _ { \mathrm { M } }$ cannot capture the diverse motion patterns from training videos and generate distinct videos from one initial latent code with similar motion patterns for different sequences of noise vectors. To alleviate this issue, we introduce a mutual information loss ${ \mathcal { L } } _ { \mathrm { m } }$ to maximize the mutual information between the hidden vector $\mathbf { h } _ { t }$ and the noise vector $\epsilon _ { t }$ . With $\mathrm { s i m } ( \mathbf { u } , \mathbf { v } ) = \mathbf { u } ^ { T } \mathbf { v } / \left\| \mathbf { u } \right\| \left\| \mathbf { v } \right\|$ denoting the cosine similarity between vectors $\mathbf { u }$ and $\mathbf { v }$ , we define ${ \mathcal { L } } _ { \mathrm { m } }$ as follows:
65
+
66
+ $$
67
+ \mathcal { L } _ { \mathrm { m } } = \frac { 1 } { n - 1 } \sum _ { t = 2 } ^ { n } \sin ( H ( \mathbf { h } _ { t } ) , \epsilon _ { t } ) ,
68
+ $$
69
+
70
+ where $H$ is a 2-layer MLP that serves as a mapping function.
71
+
72
+ Learning. To learn the appropriate parameters for the motion generator $G _ { \mathrm { M } }$ , we apply a multi-scale video discriminator $D _ { \mathrm { { V } } }$ to tell whether a video sequence is real or synthesized. The discriminator is based on the architecture of PatchGAN (Isola et al., 2017). However, we use 3D convolutional layers in $D _ { \mathrm { { V } } }$ , as they can model temporal dynamics better than 2D convolutional layers. We divide input video sequence into small 3D patches, and classify each patch as real or fake. The local responses for the input sequence are averaged to produce the final output. Additionally, each frame in the input video sequence is conditioned on the first frame, as it falls into the distribution of the pre-trained image generator, for more stable training. We thus optimize the following adversarial loss to learn $G _ { \mathrm { M } }$ and $D _ { \mathrm { { V } } }$ :
73
+
74
+ $$
75
+ \mathcal { L } _ { D _ { \mathrm { V } } } = \mathbb { E } _ { { \mathbf { v } } \sim p _ { v } } \left[ \log D _ { \mathrm { v } } ( { \mathbf { v } } ) \right] + \mathbb { E } _ { { \mathbf { z } } _ { 1 } \sim p _ { z } } \left[ \log ( 1 - D _ { \mathrm { V } } ( G _ { \mathrm { I } } ( G _ { \mathrm { M } } ( { \mathbf { z } } _ { 1 } ) ) ) ) \right] .
76
+ $$
77
+
78
+ # 3.2 CONTRASTIVE IMAGE DISCRIMINATOR
79
+
80
+ As our image generator is pre-trained, we may use an image generator that is trained on a given domain, e.g. images of animal faces (Choi et al., 2020), and learn the motion generator parameters using videos from a different domain, such as videos of human facial expressions (Nagrani et al.,
81
+
82
+ 2017). With Eqn. 4 alone, however, we lack the ability to explicitly constrain the generated images $\tilde { \mathbf { x } } _ { t \mid t > 1 }$ to possess similar quality and content as the first image $\tilde { \mathbf { x } } _ { 1 }$ , which is sampled from the image space of the image generator and thus has high fidelity. Hence, we introduce a contrastive image discriminator $D _ { \mathrm { I } }$ , which is illustrated in Fig. 1, to match both image quality and content between $\tilde { \mathbf { x } } _ { 1 }$ and $\tilde { \mathbf { x } } _ { t \mid t > 1 }$ .
83
+
84
+ Quality Matching. To increase the perceptual quality, we train $D _ { \mathrm { I } }$ and $G _ { \mathrm { M } }$ adversarially by forwarding $\tilde { \mathbf { x } } _ { t }$ into the discriminator $D _ { \mathrm { I } }$ and using $\tilde { \mathbf { x } } _ { 1 }$ as real sample and $\tilde { \mathbf { X } } _ { t \mid t > 1 }$ as the fake sample.
85
+
86
+ $$
87
+ \mathcal { L } _ { D _ { 1 } } = \mathbb { E } _ { \mathbf { z } _ { 1 } \sim p _ { z } } \left[ \log D _ { \mathrm { I } } ( G _ { \mathrm { I } } ( \mathbf { z } _ { 1 } ) ) \right] + \mathbb { E } _ { \mathbf { z } _ { 1 } \sim p _ { z } , \mathbf { z } _ { t } \sim G _ { \mathrm { M } } ( \mathbf { z } _ { 1 } ) | t > 1 } \left[ \log ( 1 - D _ { \mathrm { I } } ( G _ { \mathrm { I } } ( \mathbf { z } _ { t } ) ) ) \right] .
88
+ $$
89
+
90
+ Content Matching. To learn content similarity between frames within a video, we use the image discriminator as a feature extractor and train it with a form of contrastive loss known as InfoNCE (Oord et al., 2018). The goal is that pairs of images with the same content should be close together in embedding space, while images containing different content should be far apart.
91
+
92
+ Given a minibatch of $N$ generated videos $\{ \tilde { \mathbf { v } } ^ { ( 1 ) } , \tilde { \mathbf { v } } ^ { ( 2 ) } , \cdots , \tilde { \mathbf { v } } ^ { ( N ) } \}$ , we randomly sample one frame $t$ from each video: $\{ \tilde { \mathbf { x } } _ { t } ^ { ( 1 ) } , \tilde { \mathbf { x } } _ { t } ^ { ( 2 ) } , \cdot \cdot \cdot , \tilde { \mathbf { x } } _ { t } ^ { ( N ) } \}$ , and make two randomly augmented versions $( \tilde { \mathbf { x } } _ { t } ^ { ( i a ) } , \tilde { \mathbf { x } } _ { t } ^ { ( i b ) } )$ for each frame $\tilde { \mathbf { x } } _ { t } ^ { ( i ) }$ , resulting in $2 N$ samples. $( \tilde { \mathbf { x } } _ { t } ^ { ( i a ) } , \tilde { \mathbf { x } } _ { t } ^ { ( i b ) } )$ are positive pairs, as they share the same content. $( \tilde { \mathbf { x } } _ { t } ^ { ( i \cdot ) } , \tilde { \mathbf { x } } _ { t } ^ { ( j \cdot ) } )$ are all negative pairs for $i \neq j$ .
93
+
94
+ Let $F$ be an encoder network, which shares the same weights and architecture of $D _ { \mathrm { I } }$ , but excluding the last layer of $D _ { \mathrm { I } }$ and including a 2-layer MLP as a projection head that produces the representation of the input images. We have a contrastive loss function ${ \mathcal { L } } _ { \mathrm { c o n t r } }$ , which is the cross-entropy computed across $2 N$ augmentations as follows:
95
+
96
+ $$
97
+ \mathcal { L } _ { \mathrm { c o n t r } } = - \sum _ { i = 1 } ^ { N } \sum _ { \alpha = a } ^ { b } \log \frac { \exp ( \sin ( F ( \tilde { \mathbf { x } } _ { t } ^ { ( i a ) } ) , F ( \tilde { \mathbf { x } } _ { t } ^ { ( i b ) } ) ) / \tau ) } { \sum _ { j = 1 } ^ { N } \sum _ { \beta = a } ^ { b } \mathbb { 1 } _ { [ j \neq i ] } ( \exp ( \sin ( F ( \tilde { \mathbf { x } } _ { t } ^ { ( i \alpha ) } ) , F ( \tilde { \mathbf { x } } _ { t } ^ { ( j \beta ) } ) ) / \tau ) } ,
98
+ $$
99
+
100
+ where $\sin ( \cdot , \cdot )$ is the cosine similarity function defined in Eqn. 3, $\mathbb { 1 } _ { [ j \neq i ] } \in \{ 0 , 1 \}$ is equal to 1 iff $j \neq i$ , and $\tau$ is a temperature parameter empirically set to 0.07. We use a momentum decoder mechanism similar to that of MoCo (He et al., 2020) by maintaining a memory bank to delete the oldest negative pairs and update the new negative pairs. We apply augmentation methods including translation, color jittering, and cutout (DeVries & Taylor, 2017) on synthesized images. With the positive and negative pairs generated on-the-fly during training, the discriminator can effectively focus on the content of the input samples.
101
+
102
+ The choice of positive pairs in Eqn. 6 is specifically designed for cross-domain video synthesis, as videos of arbitrary content from the image domain is not available. In the case that images and videos are from the same domain, the positive and negative pairs are easier to obtain. We randomly select and augment two frames from a real video to create positive pairs sharing the same content, while the negative pairs contain augmented images from different real videos.
103
+
104
+ Aside from ${ \mathcal { L } } _ { \mathrm { c o n t r } }$ , we also adopt the feature matching loss (Wang et al., 2018b) ${ \mathcal { L } } _ { \mathrm { f } }$ between the generated first frame and other frames by changing the $L _ { 1 }$ regularization to cosine similarity.
105
+
106
+ Full Objective. The overall loss function for training motion generator, video discriminator, and image discriminator is thus defined as:
107
+
108
+ $$
109
+ \operatorname* { m i n } _ { G _ { \mathrm { M } } } ( \operatorname* { m a x } _ { D _ { \mathrm { V } } } \mathcal { L } _ { D _ { \mathrm { V } } } + \operatorname* { m a x } _ { D _ { \mathrm { I } } } \mathcal { L } _ { D _ { \mathrm { I } } } ) + \operatorname* { m a x } _ { G _ { \mathrm { M } } } ( \lambda _ { \mathrm { m } } \mathcal { L } _ { \mathrm { m } } + \lambda _ { \mathrm { f } } \mathcal { L } _ { \mathrm { f } } ) + \operatorname* { m i n } _ { D _ { \mathrm { I } } } ( \lambda _ { \mathrm { c o n t r } } \mathcal { L } _ { \mathrm { c o n t r } } )
110
+ $$
111
+
112
+ where $\lambda _ { \mathrm { m } }$ , $\lambda _ { \mathrm { c o n t r } }$ , and $\lambda _ { \mathrm { f } }$ are hyperparameters to balance losses.
113
+
114
+ # 4 EXPERIMENTS
115
+
116
+ In this section, we evaluate the proposed approach on several benchmark datasets for video generation. We also demonstrate cross-domain video synthesis for various image and video datasets.
117
+
118
+ # 4.1 VIDEO GENERATION
119
+
120
+ We conduct experiments on three datasets including UCF-101 (Soomro et al., 2012), FaceForensics (Rossler et al., 2018), and Sky Time-lapse (Xiong et al., 2018) for unconditional video synthesis. ¨ We use StyleGAN2 as the image generator. Training details can be found in Appx. B.
121
+
122
+ Table 1: IS and FVD on UCF-101.
123
+
124
+ <table><tr><td>Method</td><td>IS (↑)</td><td>FVD (↓)</td></tr><tr><td>VGAN</td><td>8.31 ± .09</td><td></td></tr><tr><td>TGAN</td><td>11.85 ± .07</td><td></td></tr><tr><td>MoCoGAN</td><td>12.42 ± .07</td><td></td></tr><tr><td>ProgressiveVGAN</td><td>14.56 ± .05</td><td></td></tr><tr><td>LDVD-GAN</td><td>22.91 ± .19</td><td></td></tr><tr><td>TGANv2</td><td>26.60 ± .47</td><td>1209 ± 28</td></tr><tr><td>DVD-GAN</td><td>27.38 ± .53</td><td>=</td></tr><tr><td>Ours</td><td>33.95 ± .25</td><td>700 ± 24</td></tr></table>
125
+
126
+ Table 2: FVD, ACD, and Human Preference on FaceForensics.
127
+
128
+ <table><tr><td>Method</td><td>FVD (↓)</td><td>ACD (↓)</td></tr><tr><td>GT</td><td>9.02</td><td>0.2935</td></tr><tr><td>TGANv2 Ours</td><td>58.03 53.26</td><td>0.4914 0.3300</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Method</td><td>Human Preference</td><td>(%)</td></tr><tr><td>Ours /TGANv2</td><td></td><td>73.6 / 26.4</td></tr></table>
129
+
130
+ UCF-101 is widely used in video generation. The dataset includes 13, 320 videos of 101 sport categories. The resolution of each video is $3 2 0 \times 2 4 0$ . To process the data, we crop a rectangle with size of $2 4 0 \times 2 4 0$ from each frame in a video and resize it to $2 5 6 \times 2 5 6$ . We train the motion generator to predict 16 frames. For evaluation, we report Inception Score (IS) (Saito et al., 2020) on 10, 000 generated videos and Fr´echet Video Distance (FVD) (Unterthiner et al., 2018) on 2, 048 videos. The classifier used to calculate IS is a C3D network (Tran et al., 2015) that is trained on the Sports-1M dataset (Karpathy et al., 2014) and fine-tuned on UCF-101, which is the same model used in previous works (Saito et al., 2020; Clark et al., 2019).
131
+
132
+ The quantitative results are shown in Tab. 1. Our method achieves state-of-the-art results for both IS and FVD, and outperforms existing works by a large margin. Interestingly, this result indicates that a well-trained image generator has learned to represent rich motion patterns, and therefore can be used to synthesize high-quality videos when used with a well-trained motion generator.
133
+
134
+ FaceForensics is a dataset containing news videos featuring various reporters. We use all the images from 704 training videos, with a resolution of $2 5 6 \times 2 5 6$ , to learn an image generator, and sequences of 16 consecutive frames to train motion generator. Note that our network can generate even longer continuous sequences, e.g. 64 frames (Fig. 12 in Appx.), though only 16 frames are used for training.
135
+
136
+ We show the FVD between generated and real video clips (16 frames in length) for different methods in Tab. 2. Additionally, we use the Average Content Distance (ACD) from MoCoGAN (Tulyakov et al., 2018) to evaluate the identity consistency for these human face videos. We calculate ACD values over 256 videos. We also report the two metrics for ground truth (GT) videos. To get FVD of GT videos, we randomly sample two groups of real videos and compute the score. Our method achieves better results than TGANv2 (Saito et al., 2020). Both methods have low FVD values, and can generate complex motion patterns
137
+
138
+ ![](images/009d321d03f84d81cb9272a74b4285a7fff0d1fa52834fcf57e94097294ed8e9.jpg)
139
+ Figure 2: Example generated videos from a model trained on FaceForensics. We can generate natural and photo-realistic videos with various motion patterns, such as eye blink and talking. Four examples show frames 2, 7, 11, and 16.
140
+
141
+ close to the real data. However, the much lower ACD value of our approach, which is close to GT, demonstrates that the videos it synthesizes have much better identity consistency than the videos from TGANv2. Qualitative examples in Fig. 2 illustrate different motions patterns learned from the dataset. Furthermore, we perform perceptual experiments using Amazon Mechanical Turk (AMT) by presenting a pair of videos from the two methods to users and asking them to select a more realistic one. Results in Tab. 2 indicate our method outperforms TGANv2 in $7 3 . 6 \%$ of the comparisons.
142
+
143
+ Sky Time-Lapse is a video dataset consisting of dynamic sky scenes, such as moving clouds. The number of video clips for training and testing is 35, 392 and 2, 815, respectively. We resize images to $1 2 8 \times 1 2 8$ and train the model to generate 16 frames. We compare our methods with the two recent approaches of MDGAN (Xiong et al., 2018) and DTVNet (Zhang et al., 2020), which are specifically designed for this dataset. In Tab. 3, we report the FVD for all three methods. It is clear that our approach significantly outperforms the others. Example sequences are shown in Fig. 3.
144
+
145
+ Following DTVNet (Zhang et al., 2020), we evaluate the proposed model for the task of video prediction. We use the Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity (SSIM) (Wang et al., 2004) as evaluation metrics to measure the frame quality at the pixel level and the structural similarity between synthesized and real video frames. Evaluation is performed on the testing set. We select the first frame $\mathbf { x } _ { 1 }$ from each video clip and project it to the latent space of the image generator (Abdal et al., 2020) to get $\hat { \mathbf { z } } _ { 1 }$ . We use $\hat { \mathbf { z } } _ { 1 }$ as the starting latent code for motion generator to get 16 latent codes, and interpolate them to get 32 latent codes to synthesize a video sequence, where the first frame is given by $G _ { \mathrm { I } } ( \hat { \bf z } _ { 1 } )$ . For a fair comparison, we also use $G _ { \mathrm { I } } ( \hat { \bf z } _ { 1 } )$ as the starting frame for MDGAN and DTVNet to calculate the metrics with ground truth videos. In addition, we calculate the PSNR and SSIM between $\mathbf { x } _ { 1 }$ and $G _ { \mathrm { I } } ( \hat { \bf z } _ { 1 } )$ as the upper bound for all methods, which we denote as Up-B. Tab. 3 shows the video prediction results, which demonstrate that our method’s performance is superior to those of MDGAN and DTVNet. Interestingly, by simply interpolating the motion trajectory, we can easily generate longer video sequence, e.g. from 16 to 32 frames, while retaining high quality.
146
+
147
+ Table 3: Evaluation on Sky Time-lapse for video synthesis and prediction.
148
+
149
+ <table><tr><td>Method</td><td>FVD (↓)</td><td>PSNR (↑)</td><td>SSIM (↑)</td></tr><tr><td>Up-B</td><td>1</td><td>25.367</td><td>0.781</td></tr><tr><td>MDGAN</td><td>840.95</td><td>13.840</td><td>0.581</td></tr><tr><td>DTVNet</td><td>451.14</td><td>21.953</td><td>0.531</td></tr><tr><td>Ours</td><td>77.77</td><td>22.286</td><td>0.688</td></tr></table>
150
+
151
+ ![](images/e2a803672b70bf1b3a1b61ee267e94d5b0a9b41de7977e03b19b1449e7d3eb79.jpg)
152
+ Figure 3: Sample generated frames at several time steps $\mathbf { \rho } ( t )$ for the Sky Time-lapse dataset.
153
+
154
+ ![](images/6ea4cb0bfae791a923a6b9dadc2f96d39c0ed245967d5bbd678103fcd228f383.jpg)
155
+ Figure 4: Example sequences for cross-domain video generation. First Row: (FFHQ, VoxCeleb). Second Row: (LSUN-Church, TLVDB). Third Row: (AFHQ-Dog, VoxCeleb). Fourth Row: (AnimeFaces, VoxCeleb). Images in the first and second rows have a resolution of $2 5 6 \times 2 5 6$ , while the third and fourth rows have a resolution of $5 1 2 \times 5 1 2$ .
156
+
157
+ # 4.2 CROSS-DOMAIN VIDEO GENERATION
158
+
159
+ To demonstrate how our approach can disentangle motion from image content and transfer motion patterns from one domain to another, we perform several experiments on various datasets. More specifically, we use the StyleGAN2 model, pre-trained on the FFHQ (Karras et al., 2019), AFHQDog (Choi et al., 2020), AnimeFaces (Branwen, 2019), and LSUN-Church (Yu et al., 2015) datasets, as the image generators. We learn human facial motion from VoxCeleb (Nagrani et al., 2020) and time-lapse transitions in outdoor scenes from TLVDB (Shih et al., 2013). In these experiments, a pair such as (FFHQ, VoxCeleb) indicates that we synthesize videos with image content from FFHQ and motion patterns from VoxCeleb. We generate videos with a resolution of $2 5 6 \times 2 5 6$ and $1 0 2 4 \times 1 0 2 4$ for FFHQ, $5 1 2 \times 5 1 2$ for AFHQ-Dog and AnimeFaces, and $2 5 6 \times 2 5 6$ for LSUN-Church. Qualitative examples for (FFHQ, VoxCeleb), (LSUN-Church, TLVDB), (AFHQ-Dog, VoxCeleb), and (AnimeFaces, VoxCeleb) are shown in Fig. 4, depicting high-quality and temporally consistent videos (more videos, including results with BigGAN as the image generator, are shown in the Appendix).
160
+
161
+ We also demonstrate how the motion and content are disentangled in Fig. 5 and Fig. 6, which portray generated videos with the same identity but performing diverse motion patterns, and the same motion applied to different identities, respectively. We show results from (AFHQ-Dog, VoxCeleb) (first two rows) and (AnimeFaces, VoxCeleb) (last two rows) in these two figures.
162
+
163
+ ![](images/09659f6861048e5e0134752c50211a917651a84a057589302fb57f579616201b.jpg)
164
+ Figure 5: The first and second row (also the third and fourth row) share the same initial content code but with different motion codes.
165
+
166
+ ![](images/52bc42e59b25ba73ffc31e42a584757750dcc1cbb3d55b7b1ac10dc667e8de59.jpg)
167
+ Figure 6: The first and second row (also the third and fourth row) share the same motion code but with different content codes.
168
+
169
+ # 4.3 ABLATION ANALYSIS
170
+
171
+ We first report IS and FVD in Tab. 4 for UCF-101 using the following methods: w/o Eqn. 2 uses $\mathbf { z } _ { t } =$ $\mathbf { h } _ { t }$ instead of estimating the residual as in Eqn. 2; w/o $D _ { \mathrm { I } }$ omits the contrastive image discriminator $D _ { \mathrm { I } }$ and uses the video discriminator $D _ { \mathrm { { V } } }$ only for learning the motion generator; w/o $D _ { \mathrm { { V } } }$ omits $D _ { \mathrm { V } }$ during training; and Full-128 and $F u l l { - } 2 5 6$ indicate that we generate videos using our full method with resolutions of $1 2 8 \times 1 2 8$ and $2 5 6 \times 2 5 6$ , respectively. We resize frames for all methods to $1 2 8 \times 1 2 8$ when calculating IS and FVD. The full method outperforms all others, proving the importance of each module for learning temporally consistent and high-quality videos.
172
+
173
+ We perform further analysis of our cross-domain video generation on (FFHQ, VoxCeleb). We compare our full method $( F u l l )$ with two variants. w/o ${ \mathcal { L } } _ { \mathrm { c o n t r } }$ denotes that we omit the contrastive loss (Eqn. 6) from $D _ { \mathrm { I } }$ , and w/o ${ \mathcal { L } } _ { \mathrm { m } }$ indicates that we omit the mutual information loss (Eqn. 3) for the motion generator. The results in Tab. 5 demonstrate that ${ \mathcal { L } } _ { \mathrm { c o n t r } }$ is beneficial for learning videos with coherent content, as employing ${ \mathcal { L } } _ { \mathrm { c o n t r } }$ results in lower ACD values and higher human preferences. ${ \mathcal { L } } _ { \mathrm { m } }$ also contributes to generating higher quality videos by mitigating motion synchronization. To validate the motion diversity, we show pairs of 9 randomly generated videos from the two methods to users and ask them to choose which one has superior motion diversity, including rotations and facial expressions. User preference suggests that using ${ \mathcal { L } } _ { \mathrm { m } }$ increases motion diversity.
174
+
175
+ Table 4: Ablation study on UCF-101.
176
+
177
+ <table><tr><td>Method</td><td>IS (↑)</td><td>FVD (↓)</td></tr><tr><td>w/o Eqn. 2</td><td>28.20</td><td>790.87</td></tr><tr><td>w/o D1</td><td>33.22</td><td>796.67</td></tr><tr><td>w/o Dv</td><td>33.84</td><td>867.43</td></tr><tr><td>Full-128</td><td>32.36</td><td>838.09</td></tr><tr><td>Full-256</td><td>33.95</td><td>700.00</td></tr></table>
178
+
179
+ Table 5: Ablation study on (FFHQ, VoxCeleb).
180
+
181
+ <table><tr><td>Method</td><td>w/o Lcontr</td><td>w/o Lm</td><td>Full</td></tr><tr><td>ACD (↓)</td><td>0.5328</td><td>0.5158</td><td>0.4353</td></tr><tr><td>Method</td><td></td><td>Human Preference (%)</td><td></td></tr><tr><td>Full vs w/o Lcontr Full vs w/o Lm</td><td></td><td>68.3 / 31.7 64.4 / 35.6</td><td></td></tr></table>
182
+
183
+ # 4.4 LONG SEQUENCE GENERATION
184
+
185
+ Due to the limitation of computational resources, we train MoCoGAN-HD to synthesize 16 consecutive frames. However, we can generate longer video sequences during inference by applying the following two ways.
186
+
187
+ Motion Generator Unrolling. For motion generator, we can run the LSTM decoder for more steps to synthesize long video sequences. In Fig. 7, we show a synthesized video example of 64 frames using the model trained on the FaceForensics dataset. Our method is capable to synthesize videos with more frames than the number of frames used for training.
188
+
189
+ ![](images/eb58dda6e71eb8437862ac9901d8339ddc7f246564f649044df7a6980983a46f.jpg)
190
+ Figure 7: The generation of a 64-frame video using a model trained with 16-frame on FaceForensics.
191
+
192
+ Motion Interpolation. We can do interpolation on the motion trajectory directly to synthesize long videos. Fig. 8 shows an interpolation example of 32-frame on (AFHQ-Dog, VoxCeleb) dataset.
193
+
194
+ ![](images/516b6dbf38791c9a04fa97dffd0f9fd5c0d80ee72907af4bbb938ef7aa66bd6c.jpg)
195
+ Figure 8: The generation of a 32-frame video on (AFHQ-Dog, VoxCeleb) by doing the interpolation on motion trajectory.
196
+
197
+ # 5 CONCLUSION
198
+
199
+ In this work, we present a novel approach to video synthesis. Building on contemporary advances in image synthesis, we show that a good image generator and our framework are essential ingredients to boost video synthesis fidelity and resolution. The key is to find a meaningful trajectory in the image generator’s latent space. This is achieved using the proposed motion generator, which produces a sequence of motion residuals, with the contrastive image discriminator and video discriminator. This disentangled representation further extends applications of video synthesis to content and motion manipulation and cross-domain video synthesis. The framework achieves superior results on a variety of benchmarks and reaches resolutions unattainable by prior state-of-the-art techniques.
200
+
201
+ # REFERENCES
202
+
203
+ Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan $^ { + + }$ : How to edit the embedded images? In CVPR, 2020.
204
+
205
+ Dinesh Acharya, Zhiwu Huang, Danda Pani Paudel, and Luc Van Gool. Towards high resolution video generation with progressive growing of sliced wasserstein gans. arXiv:1810.02419, 2018.
206
+
207
+ Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. In ICLR, 2017.
208
+
209
+ Aayush Bansal, Shugao Ma, Deva Ramanan, and Yaser Sheikh. Recycle-gan: Unsupervised video retargeting. In ECCV, 2018.
210
+
211
+ Gwern Branwen. Making anime faces with stylegan. 2019.
212
+
213
+ Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In ICLR, 2019.
214
+
215
+ Wonmin Byeon, Qin Wang, Rupesh Kumar Srivastava, and Petros Koumoutsakos. Contextvp: Fully context-aware video prediction. In ECCV, 2018.
216
+
217
+ Caroline Chan, Shiry Ginosar, Tinghui Zhou, and Alexei A Efros. Everybody dance now. In ICCV, 2019.
218
+
219
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020a.
220
+
221
+ Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big selfsupervised models are strong semi-supervised learners. arXiv:2006.10029, 2020b.
222
+
223
+ Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image synthesis for multiple domains. In CVPR, 2020.
224
+
225
+ Aidan Clark, Jeff Donahue, and Karen Simonyan. Adversarial video generation on complex datasets. arXiv, 2019.
226
+
227
+ Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In ICML, 2018.
228
+
229
+ Emily L Denton et al. Unsupervised learning of disentangled representations from video. In Advances in neural information processing systems, pp. 4414–4423, 2017.
230
+
231
+ Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv:1708.04552, 2017.
232
+
233
+ Jeff Donahue and Karen Simonyan. Large scale adversarial representation learning. In NeurIPS, 2019.
234
+
235
+ Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. arXiv preprint arXiv:1710.05268, 2017.
236
+
237
+ Lore Goetschalckx, Alex Andonian, Aude Oliva, and Phillip Isola. Ganalyze: Toward visual definitions of cognitive image properties. In ICCV, 2019.
238
+
239
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NeurIPS, 2014.
240
+
241
+ Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle ¨ for unnormalized statistical models. In AISTATS, 2010.
242
+
243
+ Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In CVPR, 2006.
244
+
245
+ Erik Hark ¨ onen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. Ganspace: Discovering ¨ interpretable gan controls. arXiv:2004.02546, 2020.
246
+
247
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
248
+
249
+ Olivier J Henaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, SM Eslami, and ´ Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. In ICML, 2020.
250
+
251
+ 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 NeurIPs, 2017.
252
+
253
+ 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. In ICLR, 2019.
254
+
255
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 1997.
256
+
257
+ Jun-Ting Hsieh, Bingbin Liu, De-An Huang, Li F Fei-Fei, and Juan Carlos Niebles. Learning to decompose and disentangle representations for video prediction. In NeurIPS, 2018.
258
+
259
+ Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017.
260
+
261
+ Ali Jahanian, Lucy Chai, and Phillip Isola. On the”steerability” of generative adversarial networks. In ICLR, 2020.
262
+
263
+ Qing Jin, Jian Ren, Oliver J. Woodford, Jiazhuo Wang, Geng Yuan Yuan, Yanzhi Wang, and Sergey Tulyakov. Teachers do more than teach: Compressing image-to-image models. arXiv preprint arXiv:2103.03467, 2021.
264
+
265
+ Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016.
266
+
267
+ Emmanuel Kahembwe and Subramanian Ramamoorthy. Lower dimensional kernels for video discriminators. Neural Networks, 132:506–520, 2020.
268
+
269
+ Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li FeiFei. Large-scale video classification with convolutional neural networks. In CVPR, 2014.
270
+
271
+ Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. arXiv:1710.10196, 2017.
272
+
273
+ Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019.
274
+
275
+ Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. arXiv:2006.06676, 2020a.
276
+
277
+ Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In CVPR, 2020b.
278
+
279
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014.
280
+
281
+ Sindy Lowe, Peter O’Connor, and Bastiaan Veeling. Putting an end to end-to-end: Gradient-isolated ¨ learning of representations. In NeurIPS, 2019.
282
+
283
+ Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In CVPR, 2020.
284
+
285
+ A. Nagrani, J. S. Chung, and A. Zisserman. Voxceleb: a large-scale speaker identification dataset. In INTERSPEECH, 2017.
286
+
287
+ Arsha Nagrani, Joon Son Chung, Weidi Xie, and Andrew Zisserman. Voxceleb: Large-scale speaker verification in the wild. Computer Speech & Language, 2020.
288
+
289
+ Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv:1807.03748, 2018.
290
+ Taesung Park, Alexei A. Efros, Richard Zhang, and Jun-Yan Zhu. Contrastive learning for unpaired image-to-image translation. In ECCV, 2020.
291
+ Antoine Plumerault, Herve Le Borgne, and C ´ eline Hudelot. Controlling generative models with ´ continuous factors of variations. In ICLR, 2020.
292
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016.
293
+ Jian Ren, Menglei Chai, Sergey Tulyakov, Chen Fang, Xiaohui Shen, and Jianchao Yang. Human motion transfer from poses in the wild. arXiv:2004.03142, 2020.
294
+ Andreas Rossler, Davide Cozzolino, Luisa Verdoliva, Christian Riess, Justus Thies, and Matthias ¨ Nießner. Faceforensics: A large-scale video dataset for forgery detection in human faces. arXiv:1803.09179, 2018.
295
+ Masaki Saito, Eiichi Matsumoto, and Shunta Saito. Temporal generative adversarial nets with singular value clipping. In ICCV, 2017.
296
+ Masaki Saito, Shunta Saito, Masanori Koyama, and Sosuke Kobayashi. Train sparsely, generate densely: Memory-efficient unsupervised training of high-resolution temporal gan. IJCV, 2020.
297
+ Yujun Shen and Bolei Zhou. Closed-form factorization of latent semantics in gans. arXiv:2007.06600, 2020.
298
+ Yujun Shen, Jinjin Gu, Xiaoou Tang, and Bolei Zhou. Interpreting the latent space of gans for semantic face editing. In CVPR, 2020.
299
+ Yichang Shih, Sylvain Paris, Fredo Durand, and William T Freeman. Data-driven hallucination of ´ different times of day from a single outdoor photo. TOG, 2013.
300
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv:1409.1556, 2014.
301
+ Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv:1212.0402, 2012.
302
+ Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In ICCV, 2015.
303
+ Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. Mocogan: Decomposing motion and content for video generation. In CVPR, 2018.
304
+ Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges. arXiv:1812.01717, 2018.
305
+ Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. In ICLR, 2017a.
306
+ Ruben Villegas, Jimei Yang, Yuliang Zou, Sungryull Sohn, Xunyu Lin, and Honglak Lee. Learning to generate long-term future via hierarchical prediction. In ICML, 2017b.
307
+ Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In NeurIPS, 2016.
308
+ Andrey Voynov and Artem Babenko. Unsupervised discovery of interpretable directions in the gan latent space. In ICML, 2020.
309
+ Jacob Walker, Kenneth Marino, Abhinav Gupta, and Martial Hebert. The pose knows: Video forecasting by generating pose futures. In ICCV, 2017.
310
+
311
+ Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Guilin Liu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Video-to-video synthesis. In NeurIPS, 2018a.
312
+
313
+ Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Highresolution image synthesis and semantic manipulation with conditional gans. In CVPR, 2018b.
314
+
315
+ Ting-Chun Wang, Ming-Yu Liu, Andrew Tao, Guilin Liu, Jan Kautz, and Bryan Catanzaro. Fewshot video-to-video synthesis. In NeurIPS, 2019.
316
+
317
+ Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. TIP, 2004.
318
+
319
+ Dirk Weissenborn, Oscar Tackstr ¨ om, and Jakob Uszkoreit. Scaling autoregressive video models. In ¨ ICLR, 2020.
320
+
321
+ Zhirong Wu, Yuanjun Xiong, X Yu Stella, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In CVPR, 2018.
322
+
323
+ Wei Xiong, Wenhan Luo, Lin Ma, Wei Liu, and Jiebo Luo. Learning to generate time-lapse videos using multi-stage dynamic generative adversarial networks. In CVPR, 2018.
324
+
325
+ Zili Yi, Hao Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for imageto-image translation. In ICCV, 2017.
326
+
327
+ 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:1506.03365, 2015.
328
+
329
+ Vladyslav Yushchenko, Nikita Araslanov, and Stefan Roth. Markov decision process for video generation. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pp. 0–0, 2019.
330
+
331
+ Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In ICML, 2019.
332
+
333
+ Jiangning Zhang, Chao Xu, Liang Liu, Mengmeng Wang, Xia Wu, Yong Liu, and Yunliang Jiang. Dtvnet: Dynamic time-lapse video generation via single still image. In ECCV, 2020.
334
+
335
+ Long Zhao, Xi Peng, Yu Tian, Mubbasir Kapadia, and Dimitris Metaxas. Learning to forecast and refine residual motion for image-to-video generation. In Proceedings of the European conference on computer vision (ECCV), pp. 387–403, 2018.
336
+
337
+ Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han. Differentiable augmentation for data-efficient gan training. arXiv:2006.10738, 2020a.
338
+
339
+ Zhengli Zhao, Zizhao Zhang, Ting Chen, Sameer Singh, and Han Zhang. Image augmentations for gan training. arXiv:2006.02595, 2020b.
340
+
341
+ Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. In-domain gan inversion for real image editing. In ECCV, 2020.
342
+
343
+ Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017.
344
+
345
+ # A ADDITIONAL DETAILS FOR THE FRAMEWORK
346
+
347
+ # A.1 ADDITIONAL DETAILS FOR THE MOTION GENERATOR
348
+
349
+ To use StyleGAN2 (Karras et al., 2020b) as the image generator, we randomly sample $1 , 0 0 0 , 0 0 0$ latent codes from the input space $\mathcal { Z }$ and send them to the 8-layer MLPs to get the latent codes in the space of $\mathcal { W }$ . Each latent code is a 512-dimension vector. We perform PCA on these 1, 000, 000 latent codes and select the top 384 principal components to form the matrix $\mathbf { V } \in \mathbb { R } ^ { 3 8 4 \times 5 1 2 }$ , which is used to model the motion residuals in Eqn. 2. The LSTM encoder and the LSTM decoder in the motion generator both have an input size of 512 and a hidden size of 384. The noise vector $\epsilon _ { t }$ in Eqn. 1 is also a 512-dimension vector, and the network $H$ in Eqn. 3 is a 2-layer MLPs with 512 hidden units in each of the two fully-connected layers.
350
+
351
+ For BigGAN (Brock et al., 2019), we sample the latent code directly from the space of $\mathcal { Z }$
352
+
353
+ A.2 ADDITIONAL DETAILS FOR THE DISCRIMINATORS
354
+
355
+ # A.2.1 VIDEO DISCRIMINATOR
356
+
357
+ The input images for the video discriminator $D _ { \mathrm { { V } } }$ are processed at two scales. We downsample the output images from the image generator to the resolution of $1 2 8 \times 1 2 8$ and $6 4 \times 6 4$ . For indomain video synthesis, the input sequences for $D _ { \mathrm { { V } } }$ have the shape of $6 \times ( n - 1 ) \times 1 2 8 \times 1 2 8$ and $6 \times ( n - 1 ) \times \mathbf { \bar { 6 4 } } \times 6 4$ , where $n$ is the sequence length used for training. For each of the $( n - 1 )$ subsequent frames, we concatenate the RGB channels of both the first frame and that subsequent frame, resulting in a 6-channel input. For cross-domain video synthesis, the input sequences for $D _ { \mathrm { { V } } }$ have the shape of $3 \times n \times 1 2 8 \times 1 2 8$ and $3 \times n \times 6 4 \times 6 4$ , as the concatenation of the first frame will make the discriminator aware the domain gaps. Details for $D _ { \mathrm { { V } } }$ are shown in Tab. 6.
358
+
359
+ Table 6: The network architecture for video discriminator.
360
+
361
+ <table><tr><td>Operation</td><td>Kernel</td><td>Strides</td><td># Channels</td><td>Norm Type</td><td>Nonlinearity</td></tr><tr><td>Conv3d</td><td>4×4</td><td>2</td><td>64</td><td></td><td>Leaky ReLU (0.2)</td></tr><tr><td>Conv3d</td><td>4×4</td><td>2</td><td>128</td><td>InstanceNorm3d</td><td>Leaky ReLU (0.2)</td></tr><tr><td>Conv3d</td><td>4×4</td><td>2</td><td>256</td><td>InstanceNorm3d</td><td>Leaky ReLU (0.2)</td></tr><tr><td>Conv3d</td><td>4×4</td><td>1</td><td>512</td><td>InstanceNorm3d</td><td>Leaky ReLU (0.2)</td></tr><tr><td>Conv3d</td><td>4×4</td><td>1</td><td>1</td><td>=</td><td>=</td></tr></table>
362
+
363
+ # A.2.2 IMAGE DISCRIMINATOR
364
+
365
+ The image discriminator $D _ { \mathrm { I } }$ has an architecture based on that of the $\mathrm { B i g G A N }$ discriminator, except that we remove the self-attention layer. The feature extractor $F$ used for contrastive learning has the same architecture as $D _ { \mathrm { I } }$ , except that it does not include the last layer of $D _ { \mathrm { I } }$ but has two additional fully connected (FC) layers as the projection head. The number of hidden units for these two FC layers are both 256.
366
+
367
+ Here we describe in more detail the image augmentation and memory bank techniques used for conducting contrastive learning.
368
+
369
+ Image Augmentation. We perform data augmentation on images to create positive and negative pairs. We normalize the images to $[ - 1 , 1 ]$ and apply the following augmentation techniques.
370
+
371
+ • Affine. We augment each image with an affine transformation defined with three random parameters: rotation $\alpha _ { r } \in \mathcal { U } ( \bar { - } 1 8 0 , 1 8 0 )$ , translation $\alpha _ { t } \in \mathcal { U } ( - 0 . 1 , 0 . 1 )$ , and scale $\alpha _ { s } \in$ $\mathcal { U } ( 0 . 9 5 , 1 . 0 5 )$ .
372
+ • Brightness. We add a random value $\alpha _ { b } \sim \mathcal { U } ( - 0 . 5 , 0 . 5 )$ to all channels of each image.
373
+ • Color. We add a random value $\alpha _ { c } \sim \mathcal { U } ( - 0 . 5 , 0 . 5 )$ to one randomly-selected channel of each image.
374
+
375
+ • Cutout (DeVries & Taylor, 2017). We mask out pixels in a random subregion of each image to 0. Each subregion starts at a random point and with size $( \alpha _ { m } H , \alpha _ { m } W )$ , where $\alpha _ { m } \sim \mathcal { U } ( 0 , 0 . 2 5 )$ and $( H , W )$ is the image resolution.
376
+
377
+ • Flipping. We horizontally flip the image with the probability of 0.5.
378
+
379
+ Memory Bank. It has been shown that contrastive learning benefits from large batch-sizes and negative pairs (Chen et al., 2020b). To increase the number of negative pairs, we incorporate the memory mechanism from MoCo (He et al., 2020), which designates a memory bank to store negative examples. More specifically, we keep an exponential moving average of the image discriminator, and its output of fake video frames are buffered as negative examples. We use a memory bank with a dictionary size of 4, 096.
380
+
381
+ # B MORE DETAILS FOR EXPERIMENTS
382
+
383
+ Image Generators. We train the unconditional StyleGAN2 models from scratch on the UCF-101, FaceForensics, Sky Time-lapse, and AFHQ-Dog datasets. We train the image generators with the official Tensorflow code2 and select the checkpoints that obtain the best Fr´echet inception distance (FID) (Heusel et al., 2017) score to be used as the image generators. The FID score of each image generator is shown in Table 7. For FFHQ, AnimeFaces, and LSUN-Church, we simply use the released pre-trained models.
384
+
385
+ We also train an unconditional BigGAN model on the FFHQ dataset using the public PyTorch code3.
386
+ We train a model with resolution $1 2 8 \times 1 2 8$ and select the last checkpoint as the image generator.
387
+
388
+ Table 7: FID of our trained StyleGAN2 models on different datasets.
389
+
390
+ <table><tr><td></td><td>UCF-101</td><td>FaceForensics</td><td>Sky Time-lapse</td><td>AFHQ-Dog</td></tr><tr><td>FID</td><td>45.63</td><td>10.99</td><td>10.80</td><td>7.85</td></tr></table>
391
+
392
+ Training Time. We train each image generator for UCF-101, FaceForensics, Sky Time-lapse, and AFHQ-Dog in less than 2 days using 8 Tesla V100 GPUs. For FFHQ, AnimeFaces, and LSUNChurch, we use the released models with no training cost. The training time for video generators ranges from $1 . 5 \sim 3$ days depending on the datasets (Due to the memory issue, the training for generating videos with resolution of $1 , 0 2 4 \times 1 , 0 2 4$ was done on 8 Quadro RTX 8000, with 5 days). The total training time for all the datasets is $1 . 5 \sim 5$ days and the estimated cost for training on Google Cloud is $\$ 0.78 \sim \ S 2.3 K$ .
393
+
394
+ Implementation Details. We implement our experiments with PyTorch 1.3.1 and also tested them with PyTorch 1.6. We use the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 0.0001 for $G _ { \mathrm { M } }$ , $D _ { \mathrm { { V } } }$ , and $D _ { \mathrm { I } }$ in all experiments. In Eqn. 2, we set $\lambda = 0 . 5$ for conventional video generation tasks and use a smaller $\lambda = 0 . 2$ for cross-domain video generation, as it improves the content consistency. In Eqn. 7, we set $\lambda _ { \mathrm { m } } = \lambda _ { \mathrm { c o n t r } } = \lambda _ { \mathrm { f } } = 1$ . Grid searching on these hyper-parameters could potentially lead to a performance boost. For TGANv2, we use the released code4 to train the models on UCF-101 and FaceForensics using 8 Tesla V100 with 16GB of GPU memory.
395
+
396
+ Video Prediction. For video prediction, we predict consecutive frames, given the first frame $\mathbf { x }$ from a test video clip as the input. We find the inverse latent code $\hat { \bf z } _ { 1 }$ for $\mathbf { x } _ { 1 }$ by minimizing the following objective:
397
+
398
+ $$
399
+ \hat { \mathbf { z } } _ { 1 } = \underset { \hat { \mathbf { z } } _ { 1 } } { \arg \operatorname* { m i n } } \left\| \mathbf { x } _ { 1 } - G _ { \mathrm { I } } ( \hat { \mathbf { z } } _ { 1 } ) \right\| _ { 2 } + \lambda _ { \mathrm { v g g } } \left\| F _ { \mathrm { v g g } } ( \mathbf { x } _ { 1 } ) - F _ { \mathrm { v g g } } ( G _ { \mathrm { I } } ( \hat { \mathbf { z } } _ { 1 } ) ) \right\| _ { 2 } ,
400
+ $$
401
+
402
+ where $\lambda _ { \mathrm { v g g } }$ is the weight for perceptual loss (Johnson et al., 2016), $F _ { \mathrm { v g g } }$ is the VGG feature extraction model (Simonyan $\&$ Zisserman, 2014). We set $\lambda _ { \mathrm { v g g } } = 1$ and optimize Eqn. 8 for $2 0 , 0 0 0$ iterations. We take $\hat { \mathbf { z } } _ { 1 }$ as the input to our model for video prediction.
403
+
404
+ AMT Experiments. We present more details on the AMT experiments for different experimental settings and datasets. For each experiment, we run 5 iterations to get the averaged score.
405
+
406
+ • FaceForensics, Ours vs TGANv2. We randomly select 300 videos from each method and ask users to select the better one from a pair of videos. • Sky Time-lapse, Ours vs DTVNet. We compare our method with DTVNet on the video prediction task. The testing set of Sky Time-lapse dataset includes 2, 815 short video clips. Considering that many of these video clips share similar content and are sampled from 148 long videos, we select 148 short videos with different content for testing. For these videos, we perform inversion (Eqn. 8) on the first frame to get the latent code and generate videos. For DTVNet, we use the first frame directly as input to produce their results. We ask users to chose the one with better video quality from a pair of videos generated by our method and DTVNet. The results shown in Tab. 8 demonstrate the clear advantage of our approach.
407
+
408
+ Table 8: Human evaluation experiments on Sky Time-lapse dataset.
409
+
410
+ <table><tr><td>Method</td><td>Human Preference (%)</td></tr><tr><td>Ours /DTVNet</td><td>77.3 / 22.7</td></tr></table>
411
+
412
+ • FFHQ, Full vs w/o ${ \mathcal { L } } _ { \mathrm { c o n t r } }$ . We randomly sample 200 videos generated by each method and ask users to select the more realistic one from a pair of videos.
413
+
414
+ • FFHQ, Full vs w/o ${ \mathcal { L } } _ { \mathrm { m } }$ . For each method, we use the same content code $\mathbf { z } _ { 1 }$ to generate 9 videos with different motion trajectories, and organize them into a $3 \times 3$ grid. To conduct AMT experiments, we randomly generate $5 0 3 \times 3$ videos for each method and ask users to choose the one with higher motion diversity from a pair of videos.
415
+
416
+ Cross-Domain Video Generation. We provide more details on the image and video datasets.
417
+
418
+ • Image Datasets:
419
+
420
+ – FFHQ (Karras et al., 2019) consists of 70, 000 high-quality face images at $1 0 2 4 \times 1 0 2 4$ resolution with considerable variation in terms of age, ethnicity, and background.
421
+ – AFHQ-Dog (Choi et al., 2020) contains 5, 239 high-quality dog images at $5 1 2 \times 5 1 2$ resolution with both training and testing sets.
422
+ – AnimeFaces (Branwen, 2019) includes 2, 232, 462 anime face images at $5 1 2 \times 5 1 2$ resolution.
423
+ – LSUN-Church (Yu et al., 2015) includes 126, 227 in-the-wild church images at $2 5 6 \times$ 256 resolution.
424
+
425
+ • Video Datasets:
426
+
427
+ – VoxCeleb (Nagrani et al., 2020) consists of 22, 496 short clips of human speech, extracted from interview videos uploaded to YouTube.
428
+ – TLVDB (Shih et al., 2013) includes 463 time-lapse videos, covering a wide range of landscapes and cityscapes.
429
+
430
+ For the video datasets, we randomly select 32 consecutive frames from training videos and select every other frame to form a 16-frame sequence for training.
431
+
432
+ # C MORE VIDEO RESULTS
433
+
434
+ In this section, we provide more qualitative video results generated by our approach. We show the thumbnail from each video in the figures. Full resolution videos are in the supplementary material. We also provide an HTML page to visualize these videos.
435
+
436
+ UCF-101. In Fig. 9, we show videos generated by our approach on the UCF-101 dataset.
437
+
438
+ FaceForensics. In Fig. 10, we show the generated videos for FaceForensics. In Fig. 11 and Fig. 12, we show that our approach can generate long consecutive results, 32 and 64 frames respectively, even when trained with 16-frame clips. In Fig. 13, we demonstrate that our approach can generate diverse motion patterns using the same content code. In Fig. 14, we apply the same motion codes with different content to get the synthesized videos.
439
+
440
+ Sky Time-lapse. Fig. 15 shows the generated videos for the Sky Time-lapse dataset.
441
+
442
+ (FFHQ, VoxCeleb). Fig. 16, Fig. 17, and Fig. 18 present the generated videos that have motion patterns from VoxCeleb and content from FFHQ, with resolutions of $1 2 8 \times 1 2 8$ , $2 5 6 \times 2 5 6$ , and $1 0 2 4 \times 1 0 2 4$ , respectively. We use BigGAN as the generator for Fig. 16 and StyleGAN2 for Fig. 17 and Fig. 18.
443
+
444
+ (AFHQ-Dog, VoxCeleb). Fig. 19 presents the generated videos that have motion patterns from VoxCeleb and content from AFHQ-Dog. The videos have a resolution of $5 1 2 \times 5 1 2$ . In Fig. 20, we show the interpolation between every two frames to get longer sequences.
445
+
446
+ (AnimeFaces, VoxCeleb). Fig. 21 shows the generated videos that have motion patterns from VoxCeleb and content from AmimeFaces. The videos have a resolution of $5 1 2 \times 5 1 2$ .
447
+
448
+ (LSUN-Church, TLVDB). Fig. 22 presents the generated videos that have time-lapse changing style from TLVDB and content from LSUN-Church.
449
+
450
+ ![](images/656422d8a2df210e3146707dcdb12fde3649bcd3fcf93f62ecdf145702a17967.jpg)
451
+ Figure 9: Example videos generated by our approach on the UCF-101 dataset.
452
+
453
+ ![](images/c5ff5419633d0644e0e341a7d75db48338d2b5671868858be71bd04e7c6153c9.jpg)
454
+ Figure 10: Example videos generated by our approach on the FaceForensics dataset.
455
+
456
+ ![](images/761d1c674d9ee743520b4d034eacf7d8346b26568f13046f11ddbba719fa7f2f.jpg)
457
+ Figure 11: The generated videos on the FaceForensics dataset consisting of 32 frames.
458
+
459
+ ![](images/4ad635a60c3aa8237ade234971f9517c9b4f08c1ac26fe96e7b8da092a2e4e05.jpg)
460
+ Figure 12: The generated videos on the FaceForensics dataset consisting of 64 frames.
461
+
462
+ ![](images/ad012a7a8f176597f32f4e1311158d969b6df2f4076ace43e878320dae39797c.jpg)
463
+ Figure 13: Each row is synthesized using the same content code to generate diverse motion patterns. Please see the corresponding supplementary video for a better illustration.
464
+
465
+ ![](images/4003a2aba6d19b3fe338880c8b3e5c746593f5f9594f7bc953b40b71f3a38c3c.jpg)
466
+ Figure 14: Each row is synthesized with the same motion trajectory but different content codes. Please see the corresponding supplementary video for a better illustration.
467
+
468
+ ![](images/b09b8b7b2442b49f813aef812bf5318c58277beb10c2652b3353bffd59871d25.jpg)
469
+ Figure 15: Example videos generated by our approach on the Sky Time-lapse dataset. The videos have a resolution of $1 2 8 \times 1 2 8$ .
470
+
471
+ ![](images/4c1fdaa7a976b8b57c81778061255328995263d4c5ebb109c4052315586de727.jpg)
472
+ Figure 16: Cross-domain video generation for (FFHQ, Vox). The videos have a resolution of $1 2 8 \times 1 2 8$ .
473
+
474
+ ![](images/56cc49b5a03b5c0cbe43a035e35986744b62a7d970b623473e8d5733feee46b7.jpg)
475
+ Figure 17: Cross-domain video generation for (FFHQ, Vox). The videos have a resolution of $2 5 6 \times 2 5 6$ .
476
+
477
+ ![](images/183d0acfc91549f201c5ccdfaeca4ec1e9c5528883c01ff6f7b227665552e808.jpg)
478
+ Figure 18: Cross-domain video generation for (FFHQ, Vox). The videos have a resolution of $1 0 2 4 \times 1 0 2 4$ .
479
+
480
+ ![](images/fe517c17c7bcd4684ef59d85cc5e690d7dbd7a3e30efb2733313cb7f8d5680ac.jpg)
481
+ Figure 19: Cross-domain video generation for (AFHQ-Dog, Vox). The videos have a resolution of $5 1 2 \times 5 1 2$ .
482
+
483
+ ![](images/7b9c9e6c87fcefbc321f30d0b5fe95a91ed52cda550800332e0721ca28cdd274.jpg)
484
+ Figure 20: Cross-domain video generation for (AFHQ-Dog, Vox). We interpolate every two frames to get 32 sequential frames. The videos have a resolution of $5 1 2 \times 5 1 2$ .
485
+
486
+ ![](images/407cf308e90a25e7054af47caa2195e530ebe7e2c0eadad7146c7c49c8fcb5ff.jpg)
487
+ Figure 21: Cross-domain video generation for (AnimeFaces, Vox). The videos have a resolution of $5 1 2 \times 5 1 2$ .
488
+
489
+ ![](images/e8e559630390e3cf2b0fa67b36c8a27d2dd8d927cedb590947e66c71c6b98aae.jpg)
490
+ Figure 22: Cross-domain video generation for (LSUN-Church, TLVDB). The videos have a resolution of $2 5 6 \times 2 5 6$ .
491
+
492
+ # D MORE ABLATION ANALYSIS FOR MUTUAL INFORMATION LOSS ${ \mathcal { L } } _ { \mathrm { m } }$
493
+
494
+ In addition to Tab. 5, we perform another ablation experiment to show how mutual information loss ${ \mathcal { L } } _ { \mathrm { m } }$ improves motion diversity by considering the following setting. We random sample a content code $z _ { 1 } \in { \mathcal { Z } }$ and use it as an input to synthesize 100 videos, where each video contains 16 frames. We average the generated 100 videos (they share the same first frame) to get one meanvideo, which contains 16 frames. For example, for the last frame in the mean-video, it is obtained by averaging all the last frames from the 100 generated videos. We also calculate the per-pixel standard deviation (std) for each averaged frame in the mean-video. More blurry frames and higher per-pixel std indicate the 100 synthetic videos contain more diverse motion.
495
+
496
+ We evaluate the settings of $F u l l$ and w/o ${ \mathcal { L } } _ { \mathrm { m } }$ (without using the mutual information loss) by running the above experiments for 50 times, e.g., sampling $z _ { 1 }$ for 50 times. Across the 50 trials, for Full model, the mean and std of the per-pixel std for the $1 6 ^ { t h }$ frame (the last frame in a generated video) is $0 . 2 3 3 \pm 0 . 0 3 6$ , which is significantly higher than that of the w/o ${ \mathcal { L } } _ { \mathrm { m } }$ model $( 0 . 1 2 6 \pm 0 . 0 2 5 )$ . In Fig. 23, we show 8 examples of the last frame from the mean-video and the images with per-pixel std (See supplementary material for the whole videos). Our Full model has more diverse motion as the averaged frame is more blurry and the per-pixel std is higher. Note that StyleGAN2 enables noise inputs for extra randomness, we disable it in this ablation study.
497
+
498
+ ![](images/51c0580023dc8299a096d24d1d17147ffce9571574f91afc09ee116a73dc2d59.jpg)
499
+ Figure 23: Row 1 and 3: The last frame of the mean-video and per-pixel std of w/o ${ \mathcal { L } } _ { \mathrm { m } }$ model. Row 2 and 4: The last frame of the mean-video and per-pixel std of the Full model. The Full model has a more blurry mean-video and higher per-pixel std, which indicates more diverse motion.
500
+
501
+ # E LIMITATIONS
502
+
503
+ Our framework requires a well-trained image generator for frame synthesis. In order to synthesize high-quality and temporally coherent videos, an ideal image generator should satisfy two requirements: R1. The image generator should synthesize high-quality images, otherwise the video discriminator can easily tell the generated videos as the image quality is different from the real videos. R2. The image generator should be able to generate diverse image contents to include enough motion modes for sequence modeling.
504
+
505
+ Example of R1. UCF-101 is a challenging dataset even for the training of an image generator. In Tab. 7, the StyleGAN2 model trained on UCF-101 has FID 45.63, which is much worse than the others. We hypothesis the reason is that UCF-101 dataset has many categories, but within each category, it includes relatively a small amount of videos and these videos share very similar content. Such observation is also discussed in DVDGAN (Clark et al., 2019). Although we can achieve state-of-the-art performance on UCF-101 dataset, the quality of the generated videos is not as good as other datasets (Fig. 9), and the quality of synthesized videos is still not close to real videos.
506
+
507
+ Example of R2. We test our method on BAIR Robot Pushing Dataset (Ebert et al., 2017). We train a $6 4 \times 6 4$ StyleGAN2 image generator with using the frames from BAIR videos. The image generator has FID as 6.12. Based on the image generator, we train a video generation model that can synthesize 16 frames. An example of synthesized video is shown in Fig. 24 (more videos are in the supplementary materials). We can see our method can successfully model shadow changing, the robot arm moving, but it struggles to decouple the robot arm from some small objects in the background, which we show analysis follows.
508
+
509
+ ![](images/e0a325556e98c9afa069fb37200cb4337e35330e735c2c25f0a85677a8bc04eb.jpg)
510
+ Figure 24: A synthesized video using BAIR dataset. Note the background changing of the first frame (upper-left) and the last frame (bottom-right).
511
+
512
+ # E.1 ANALYSIS OF THE INFORMATION CONTAINED IN PCA COMPONENTS.
513
+
514
+ Inspired by previous work (Hark ¨ onen et al., 2020), we further investigate the latent space of the ¨ image generator by considering the information contained in each PCA component. Fig. 25 shows the percentage of total variance captured by top PCA components. The image generator on BAIR compresses most of the information on a few components. Specially, the top $2 0 \mathrm { P C A }$ components captures $8 5 \%$ of the variance. In contrast, the latent space of the image generator trained on FFHQ (and FFHQ 1024 for high-resolution image synthesis) uses $1 0 0 ~ \mathrm { P C A }$ components to capture $8 5 \%$ information. This implies the BAIR generator models the dataset in a low-dimension space, and such generator increases the difficulty for fully disentangling all the objects in images for manipulation.
515
+
516
+ ![](images/713dfec61ead66f47ab290bc97279a7013cf407f42be55df1cb69d2350749654.jpg)
517
+ Figure 25: Percentage of variations captured by top PCA components on different models.
518
+
519
+ Moreover, we visualize the video synthesis results by moving along the top $2 0 ~ \mathrm { P C A }$ components. Let $V _ { i }$ denote the $i ^ { t h }$ PCA component. Given content code $z _ { 1 }$ , we synthesize a 5-frame video clip by using the following sequence as input: $\left\{ z _ { 1 } - 2 V _ { i } , z _ { 1 } - V _ { i } , z _ { 1 } , z _ { 1 } + V _ { i } , z _ { 1 } + 2 V _ { i } \right\}$ . In Fig. 26, we show the video synthesis results by moving along the top $2 0 ~ \mathrm { P C A }$ directions. It can be seen that: 1) changing the later components (the $8 ^ { t h }$ and later rows) of BAIR only make small changes; 2) the first 7 components of BAIR have entangled semantic meaning, while the components in FFHQ have more disentangled meaning ( $2 ^ { n d }$ row, rotation; $2 0 ^ { t h }$ row, smile). This indicates the image generator of BAIR may not cover enough (disentangled) motion modes, and it might be hard for the motion generator to fully disentangle all the contents and motion with only a few dominating PCA components, while for the image generator trained on FFHQ, it is much easier for disentangling foreground and background.
520
+
521
+ ![](images/621309b8d0cfc18d02ea6eb4d0907fd0b2ba1236fa9d88914060e90d5d238210.jpg)
522
+ Figure 26: Visualization of top 20 principle components of BAIR (left) and FFHQ (right).
523
+
524
+ ![](images/16867bbe72a5c0478477b3900f51e5bedb8d081ccc14e71cbb70cf69c80d4340.jpg)
md/train/9GsFOUyUPi/9GsFOUyUPi.md ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PROGRESSIVE SKELETONIZATION: TRIMMING MORE FAT FROM A NETWORK AT INITIALIZATION
2
+
3
+ Pau de Jorge∗ University of Oxford & NAVER LABS Europe†
4
+
5
+ Amartya Sanyal University of Oxford & The Alan Turing Institute, London, UK
6
+
7
+ Harkirat S. Behl University of Oxford
8
+
9
+ Philip H. S. Torr University of Oxford
10
+
11
+ Grégory Rogez NAVER LABS Europe
12
+
13
+ Puneet K. Dokania University of Oxford & Five AI Limited
14
+
15
+ # ABSTRACT
16
+
17
+ Recent studies have shown that skeletonization (pruning parameters) of networks at initialization provides all the practical benefits of sparsity both at inference and training time, while only marginally degrading their performance. However, we observe that beyond a certain level of sparsity (approx $9 5 \%$ ), these approaches fail to preserve the network performance, and to our surprise, in many cases perform even worse than trivial random pruning. To this end, we propose an objective to find a skeletonized network with maximum foresight connection sensitivity (FORCE) whereby the trainability, in terms of connection sensitivity, of a pruned network is taken into consideration. We then propose two approximate procedures to maximize our objective (1) Iterative SNIP: allows parameters that were unimportant at earlier stages of skeletonization to become important at later stages; and (2) FORCE: iterative process that allows exploration by allowing already pruned parameters to resurrect at later stages of skeletonization. Empirical analysis on a large suite of experiments show that our approach, while providing at least as good a performance as other recent approaches on moderate pruning levels, provide remarkably improved performance on higher pruning levels (could remove up to $9 9 . 5 \%$ parameters while keeping the networks trainable).
18
+
19
+ # 1 INTRODUCTION
20
+
21
+ The majority of pruning algorithms for Deep Neural Networks require training dense models and often fine-tuning sparse sub-networks in order to obtain their pruned counterparts. In Frankle & Carbin (2019), the authors provide empirical evidence to support the hypothesis that there exist sparse sub-networks that can be trained from scratch to achieve similar performance as the dense ones. However, their method to find such sub-networks requires training the full-sized model and intermediate sub-networks, making the process much more expensive.
22
+
23
+ Recently, Lee et al. (2019) presented SNIP. Building upon almost a three decades old saliency criterion for pruning trained models (Mozer & Smolensky, 1989), they are able to predict, at initialization, the importance each weight will have later in training. Pruning at initialization methods are much cheaper than conventional pruning methods. Moreover, while traditional pruning methods can help accelerate inference tasks, pruning at initialization may go one step further and provide the same benefits at train time Elsen et al. (2020).
24
+
25
+ Wang et al. (2020) (GRASP) noted that after applying the pruning mask, gradients are modified due to non-trivial interactions between weights. Thus, maximizing SNIP criterion before pruning might be sub-optimal. They present an approximation to maximize the gradient norm after pruning, where they treat pruning as a perturbation on the weight matrix and use the first order Taylor’s approximation. While they show improved performance, their approximation involves computing a Hessian-vector product which is expensive both in terms of memory and computation.
26
+
27
+ ![](images/ba3922794f20bd64c31072a7397cfcfc21be6a6c4358b48849b4ca9f0c55dffa.jpg)
28
+ Figure 1: Test accuracies on CIFAR-10 (ResNet50) for different pruning methods. Each point is the average over 3 runs of prune-train-test. The shaded areas denote the standard deviation of the runs (too small to be visible in some cases). Random corresponds to removing connections uniformly.
29
+
30
+ We argue that both SNIP and GRASP approximations of the gradients after pruning do not hold for high pruning levels, where a large portion of the weights are removed at once. In this work, while we rely on the saliency criteria introduced by Mozer & Smolensky (1989), we optimize what this saliency would be after pruning, rather than before. Hence, we name our criteria Foresight Connection sEnsitivity (FORCE). We introduce two approximate procedures to progressively optimize our objective. The first, which turns out to be equivalent to applying SNIP iteratively, removes a small fraction of weights at each step and re-computes the gradients after each pruning round. This allows to take into account the intricate interactions between weights, re-adjusting the importance of connections at each step. The second procedure, which we name FORCE, is also iterative in nature, but contrary to the first, it allows pruned parameters to resurrect. Hence, it supports exploration, which otherwise is not possible in the case of iterative SNIP. Moreover, one-shot SNIP can be viewed as a particular case of using only one iteration. Empirically, we find that both SNIP and GRASP have a sharp drop in performance when targeting higher pruning levels. Surprisingly, they perform even worse than random pruning as can be seen in Fig 1. In contrast, our proposed pruning procedures prove to be significantly more robust on a wide range of pruning levels.
31
+
32
+ # 2 RELATED WORK
33
+
34
+ Pruning trained models Most of the pruning works follow the train – prune – fine-tune cycle (Mozer & Smolensky, 1989; LeCun et al., 1990; Hassibi et al., 1993; Han et al., 2015; Molchanov et al., 2017; Guo et al., 2016), which requires training the dense network until convergence, followed by multiple iterations of pruning and fine-tuning until a target sparsity is reached. Particularly, Molchanov et al. (2017) present a criterion very similar to Mozer & Smolensky (1989) and therefore similar to Lee et al. (2019) and our FORCE, but they focus on pruning whole neurons, and involve training rounds while pruning. Frankle & Carbin (2019) and Frankle et al. (2020) showed that it was possible to find sparse sub-networks that, when trained from scratch or an early training iteration, were able to match or even surpass the performance of their dense counterparts. Nevertheless, to find them they use a costly procedure based on Han et al. (2015). All these methods rely on having a trained network, thus, they are not applicable before training. In contrast, our algorithm is able to find a trainable sub-network with randomly initialized weights. Making the overall pruning cost much cheaper and presenting an opportunity to leverage the sparsity during training as well.
35
+
36
+ Induce sparsity during training Another popular approach has been to induce sparsity during training. This can be achieved by modifying the loss function to consider sparsity as part of the optimization (Chauvin, 1989; Carreira-Perpiñán & Idelbayev, 2018; Louizos et al., 2018) or by dynamically pruning during training (Bellec et al., 2018; Mocanu et al., 2018; Mostafa & Wang, 2019; Dai et al., 2019; Dettmers & Zettlemoyer, 2020; Lin et al., 2020; Kusupati et al., 2020; Evci et al., 2019). These methods are usually cheaper than pruning after training, but they still need to train the network to select the final sparse sub-network. We focus on finding sparse sub-networks before any weight update, which is not directly comparable.
37
+
38
+ Pruning at initialization These methods present a significant leap with respect to other pruning methods. While traditional pruning mechanisms focused on bringing speed-up and memory reduction at inference time, pruning at initialization methods bring the same gains both at training and inference time. Moreover, they can be seen as a form of Neural Architecture Search (Zoph & Le, 2016) to find more efficient network topologies. Thus, they have both a theoretical and practical interest.
39
+
40
+ Lee et al. (2019) presented SNIP, a method to estimate, at initialization, the importance that each weight could have later during training. SNIP analyses the effect of each weight on the loss function when perturbed at initialization. In Lee et al. (2020), the authors studied pruning at initialization from a signal propagation perspective, focusing on the initialization scheme. Recently, Wang et al. (2020) proposed GRASP, a different method based on the gradient norm after pruning and showed a significant improvement for higher levels of sparsity. However, neither SNIP nor GRASP perform sufficiently well when larger compressions and speed-ups are required and a larger fraction of the weights need to be pruned. In this paper, we analyse the approximations made by SNIP and GRASP, and present a more suitable solution to maximize the saliency after pruning.
41
+
42
+ # 3 PROBLEM FORMULATION: PRUNING AT INITIALIZATION
43
+
44
+ Given a dataset $\mathbf { \mathcal { D } } = \{ ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \} _ { i = 1 } ^ { n }$ , the training of a neural network $f$ parameterized by $\pmb { \theta } \in \mathbb { R } ^ { m }$ can be written as minimizing the following empirical risk:
45
+
46
+ $$
47
+ \underset { \pmb { \theta } } { \arg \operatorname* { m i n } } \ \frac { 1 } { n } \sum _ { i } \mathcal { L } ( ( f ( \mathbf { x } _ { i } ; \pmb { \theta } ) ) , \mathbf { y } _ { i } ) \quad \mathrm { s . t . } \pmb { \theta } \in \mathcal { C } ,
48
+ $$
49
+
50
+ where $\mathcal { L }$ and $\mathcal { C }$ denote the loss function and the constraint set, respectively. Unconstrained (standard) training corresponds to ${ \mathcal { C } } = \mathbb { R } ^ { m }$ . Assuming we have access to the gradients (batch-wise) of the empirical risk, an optimization algorithm (e.g. SGD) is generally used to optimize the above objective, that, during the optimization process, produces a sequence of iterates $\textcircled { \pmb { \theta } } _ { i } \rbrace _ { i = 0 } ^ { T }$ , where $\pmb { \theta } _ { 0 }$ and $\pmb { \theta } _ { T }$ denote the initial and the final (optimal) parameters, respectively. Given a target sparsity level of $k < m$ , the general parameter pruning problem involves $\mathcal { C }$ with a constraint $\lVert \pmb { \theta } _ { T } \rVert _ { 0 } \leq k$ , i.e., the final optimal iterate must have a maximum of $k$ non-zero elements. Note that there is no such constraint with the intermediate iterates.
51
+
52
+ Pruning at initialization, the main focus of this work, adds further restrictions to the above mentioned formulation by constraining all the iterates to lie in a fixed subspace of $\mathcal { C }$ . Precisely, the constraints are to find an initialization $\pmb { \theta } _ { 0 }$ such that $\lVert \pmb \theta _ { 0 } \rVert _ { 0 } \le k ^ { 1 }$ , and the intermediate iterates are $\pmb { \theta } _ { i } \in \bar { \mathcal { C } } \subset \mathcal { C }$ , $\forall i \in$ $\{ 1 , \ldots , T \}$ , where $\bar { \mathcal { C } }$ is the subspace of $\mathbb { R } ^ { m }$ spanned by the natural basis vectors $\{ \mathbf { e } _ { j } \} _ { j \in \mathtt { s u p p } ( \pmb { \theta } _ { 0 } ) }$ Here, ${ \tt s u p p } ( \pmb { \theta } _ { 0 } )$ denotes the support of $\pmb { \theta } _ { 0 }$ , i.e., the set of indices with non-zero entries. The first condition defines the sub-network at initialization with $k$ parameters, and the second fixes its topology throughout the training process. Since there are $\binom { m } { k }$ such possible sub-spaces, exhaustive search to find the optimal sub-space to optimize (1) is impractical as it would require training $\binom { m } { k }$ neural networks. Below we discuss two recent approaches that circumvent this problem by maximizing a hand-designed data-dependent objective function. These objectives are tailored to preserve some relationships between the parameters, the loss, and the dataset, that might be sufficient to obtain a reliable $\pmb { \theta } _ { 0 }$ . For the ease of notation, we will use $\pmb \theta$ to denote the dense initialization.
53
+
54
+ SNIP Lee et al. (2019) present a method based on the saliency criterion from Mozer & Smolensky (1989). They add a key insight and show this criteria works surprisingly well to predict, at initialization, the importance each connection will have during training. The idea is to preserve the parameters that will have maximum impact on the loss when perturbed. Let $\pmb { c } \in \{ 0 , 1 \} ^ { m }$ be a binary vector, and $\odot$ the Hadamard product. Then, the connection sensitivity in SNIP is computed as:
55
+
56
+ $$
57
+ \pmb { \mathscr { g } } ( \pmb { \theta } ) : = \left. \frac { \partial \mathcal { L } ( \pmb { \theta } \odot \pmb { c } ) } { \partial \pmb { c } } \right| _ { \pmb { c } = 1 } = \frac { \partial \mathcal { L } ( \pmb { \theta } ) } { \partial \pmb { \theta } } \odot \pmb { \theta } .
58
+ $$
59
+
60
+ Once $\pmb { g } ( \pmb { \theta } )$ is obtained, the parameters corresponding to the top- $k$ values of $| g ( \pmb \theta ) _ { i } |$ are then kept. Intuitively, SNIP favors those weights that are far from the origin and provide high gradients (irrespective of the direction). We note that SNIP objective can be written as the following problem:
61
+
62
+ $$
63
+ \operatorname* { m a x } _ { c } S ( \pmb { \theta } , { \pmb { c } } ) : = \sum _ { i \in \mathrm { s u p p } ( { \pmb { c } } ) } | \theta _ { i } \nabla \mathcal { L } ( \pmb { \theta } ) _ { i } | \mathrm { s . t . } { \pmb { c } } \in \{ 0 , 1 \} ^ { m } , \| { \pmb { c } } \| _ { 0 } = k .
64
+ $$
65
+
66
+ It is trivial to note that the optimal solution to the above problem can be obtained by selecting the indices corresponding to the top- $k$ values of $| \theta _ { i } \nabla \mathcal { L } ( \theta ) _ { i } |$ .
67
+
68
+ GRASP Wang et al. (2020) note that the SNIP saliency is measuring the connection sensitivity of the weights before pruning, however, it is likely to change after pruning. Moreover, they argue that, at initialization, it is more important to preserve the gradient signal than the loss itself. They propose to use as saliency the gradient norm of the loss $\Delta \mathcal { L } ( \mathbf { \bar { \boldsymbol { \theta } } } ) = \nabla \mathcal { L } ( \mathbf { \bar { \boldsymbol { \theta } } } ) ^ { T } \nabla \mathcal { L } ( \mathbf { \boldsymbol { \theta } } )$ , but measured after pruning. To maximize it, Wang et al. (2020) adopt the same approximation introduced in LeCun et al. (1990) and treat pruning as a perturbation on the initial weights. Their method is equivalent to solving:
69
+
70
+ $$
71
+ \operatorname* { m a x } _ { c } G ( \theta , c ) : = \sum _ { \left\{ i : c _ { i } = 0 \right\} } - \theta _ { i } \left[ \mathbf { H } \mathbf { g } \right] _ { i } \mathrm { ~ s . t . ~ } c \in \{ 0 , 1 \} ^ { m } , \| c \| _ { 0 } = k .
72
+ $$
73
+
74
+ Where $\mathbf { H }$ and $\mathbf { g }$ denote the Hessian and the gradient of the loss respectively.
75
+
76
+ # 4 FORESIGHT CONNECTION SENSITIVITY
77
+
78
+ Since removing connections of a neural network will have significant impact on its forward and backward signals, we are interested in obtaining a pruned network that is easy to train. We use connection sensitivity of the loss function as a proxy for the so-called trainability of a network. To this end, we first define connection sensitivity after pruning which we name Foresight Connection sEnsitivity (FORCE), and then propose two procedures to optimize it in order to obtain the desired pruned network. Let $\bar { \pmb { \theta } } = \pmb { \theta } \odot \bar { \pmb { c } }$ denotes the pruned parameters once a binary mask $^ c$ with $\| \boldsymbol { c } \| _ { 0 } =$ $k \leq m$ is applied. The FORCE at $\bar { \pmb { \theta } }$ for a given mask $\hat { c }$ is then obtained as:
79
+
80
+ $$
81
+ g ( \bar { \theta } ) : = \left. \frac { \partial \mathcal { L } ( \bar { \theta } ) } { \partial c } \right| _ { c = \hat { c } } = \left. \frac { \partial \mathcal { L } ( \bar { \theta } ) } { \partial \bar { \theta } } \right| _ { c = \hat { c } } \odot \left. \frac { \partial \bar { \theta } } { \partial c } \right| _ { c = \hat { c } } = \left. \frac { \partial \mathcal { L } ( \bar { \theta } ) } { \partial \bar { \theta } } \right| _ { c = \hat { c } } \odot \theta .
82
+ $$
83
+
84
+ The last equality is obtained by rewriting $\bar { \pmb { \theta } }$ as $\mathrm { d i a g } ( \pmb { \theta } ) \pmb { c }$ , where $\operatorname { d i a g } ( \pmb \theta )$ is a diagonal matrix with $\pmb \theta$ as its elements, and then differentiating w.r.t. $^ c$ . Note, when $k < m$ , the sub-network $\bar { \pmb { \theta } }$ is obtained by removing connections corresponding to all the weights for which the binary variable is zero. Therefore, only the weights corresponding to the indices for which $\mathbf { \boldsymbol { c } } ( i ) = 1$ contribute in equation (5), all other weights do not participate in forward and backward propagation and are to be ignored. We now discuss the crucial differences between our formulation (5), SNIP (2) and GRASP (4).
85
+
86
+ • When $\hat { c } = { \bf 1 }$ , the formulation is exactly the same as the connection sensitivity used in SNIP. However, $\hat { c } = { \bf 1 }$ is too restrictive in the sense that it assumes that all the parameters are active in the network and they are removed one by one with replacement, therefore, it fails to capture the impact of removing a group of parameters. Our formulation uses weights and gradients corresponding to $\bar { \pmb { \theta } }$ thus, compared to SNIP, provides a better indication of the training dynamics of the pruned network. However, GRASP formulation is based on the assumption that pruning is a small perturbation on the Gradient Norm which, also shown experimentally, is not always a reliable assumption. When $\left\| \hat { \pmb { c } } \right\| _ { 0 } \ll \| \mathbf { 1 } \| _ { 0 }$ , i.e., extreme pruning, the gradients before and after pruning will have very different values as $\lVert \pmb \theta \odot \hat { \pmb c } \rVert _ { 2 } \ll \lVert \pmb \theta \rVert _ { 2 }$ , making SNIP and GRASP unreliable (empirically we find SNIP and GRASP fail in the case of high sparsity).
87
+
88
+ FORCE saliency Note FORCE (5) is defined for a given sub-network which is unknown a priori, as our objective itself is to find the sub-network with maximum connection sensitivity. Similar to the reformulation of SNIP in (3), the objective to find such sub-network corresponding to the foresight connection sensitivity can be written as:
89
+
90
+ $$
91
+ \operatorname* { m a x } _ { c } S ( \pmb { \theta } , \pmb { c } ) : = \sum _ { i \in \mathrm { s u p p } ( \pmb { c } ) } \left| \theta _ { i } \nabla \mathcal { L } ( \pmb { \theta } \odot \pmb { c } ) _ { i } \right| \mathrm { ~ s . t . ~ } \pmb { c } \in \{ 0 , 1 \} ^ { m } , \| \pmb { c } \| _ { 0 } = k .
92
+ $$
93
+
94
+ Here $\nabla { \mathcal { L } } ( \pmb { \theta } \odot \mathbf { c } ) _ { i }$ represents the $i$ -th index of $\left. \frac { \partial \mathcal { L } ( \bar { \pmb { \theta } } ) } { \partial \bar { \pmb { \theta } } } \right| _ { c }$ . As opposed to (3), finding the optimal solution of (6) is non trivial as it requires computing the gradients of all possible $\binom { m } { k }$ sub-networks in order to find the one with maximum sensitivity. To this end, we present two approximate solutions to the above problem that primarily involve (i) progressively increasing the degree of pruning, and (ii) solving an approximation of (6) at each stage of pruning.
95
+
96
+ Progressive Pruning (Iterative SNIP) Let $k$ be the number of parameters to be kept after pruning. Let us assume that we know a schedule (will be discussed later) to divide $k$ into a set of natural numbers $\{ k _ { t } \} _ { t = 1 } ^ { T }$ such that $k _ { t } > k _ { t + 1 }$ and $k _ { T } = k$ . Now, given the mask $c _ { t }$ corresponding to $k _ { t }$ , pruning from $k _ { t }$ to $k _ { t + 1 }$ can be formulated using the connection sensitivity (5) as:
97
+
98
+ $$
99
+ \begin{array} { r } { c _ { t + 1 } = \underset { c } { \arg \operatorname* { m a x } } \ S ( \bar { \theta } , c ) \mathrm { ~ s . t . ~ } c \in \{ 0 , 1 \} ^ { m } , \ \left. c \right. _ { 0 } = k _ { t + 1 } , \ c \odot c _ { t } = c , } \end{array}
100
+ $$
101
+
102
+ where $\bar { \pmb { \theta } } = \pmb { \theta } \odot \pmb { c } _ { t }$ . The additional constraint $\mathbf { \boldsymbol { c } } \odot \mathbf { \boldsymbol { c } } _ { t } = \mathbf { \boldsymbol { c } }$ ensures that no parameter that had been pruned earlier is activated again. Assuming that the pruning schedule ensures a smooth transition from one topology to another $( \left\| \pmb { c } _ { t } \right\| _ { 0 } \approx \left\| \pmb { c } _ { t + 1 } \right\| _ { 0 } )$ such that the gradient approximation $\begin{array} { r } { \left. \frac { \partial \mathcal { L } ( \bar { \pmb { \theta } } ) } { \partial \bar { \pmb { \theta } } } \right| _ { \pmb { c } _ { t } } \approx \left. \frac { \partial \mathcal { L } ( \bar { \pmb { \theta } } ) } { \partial \bar { \pmb { \theta } } } \right| _ { \pmb { c } _ { t + 1 } } } \end{array}$ is valid, (7) can be approximated as solving (3) at $\bar { \pmb { \theta } }$ . Thus, for a given schedule over $k$ , our first approximate solution to (6) involves solving (3) iteratively. This allows re-assessing the importance of connections after changing the sub-network. For a schedule with $T = 1$ , we recover SNIP where a crude gradient approximation between the dense network $\mathbf { c } _ { 0 } = \mathbf { 1 }$ and the final mask $^ c$ is being used. This approach of ours turns out to be algorithmically similar to a concurrent work (Verdenius et al., 2020). However, our motivation comes from a novel objective function (5) which also gives place to our second approach (FORCE). Tanaka et al. (2020) also concurrently study the effect of iterative pruning and report, similar to our findings, pruning progressively is needed for high sparsities.
103
+
104
+ Progressive Sparsification (FORCE) The constraint $\mathbf { \boldsymbol { c } } \odot \mathbf { \boldsymbol { c } } _ { t } = \mathbf { \boldsymbol { c } }$ in (7) (Iterative SNIP) might be restrictive in the sense that while re-assessing the importance of unpruned parameters, it does not allow previously pruned parameters to resurrect (even if they could become important). This hinders exploration which can be unfavourable in finding a suitable sub-network. Here we remove this constraint, meaning, the weights for which $\boldsymbol { c } ( i ) = \bar { 0 }$ are not removed from the network, rather they are assigned a value of zero. Therefore, while not contributing to the forward signal, they might have a non-zero gradient. This relaxation modifies the saliency in (5) whereby the gradient is now computed at a sparsified network instead of a pruned network. Similar to the above approach, we sparsify the network progressively and once the desired sparsity is reached, all connections with $\bar { \mathbf { \Psi } } \bar { \mathbf { c } } ( i ) = \mathbf { \bar { 0 } }$ are pruned. Note, the step of removing zero weights is valid if removing such connections does not adversely impact the gradient flow of the unpruned parameters. We, in fact, found it to be true in our experiments shown in Fig 7 (Appendix). However, this assumption might not hold always.
105
+
106
+ An overview of Iterative SNIP and FORCE is presented in Algorithm 1.
107
+
108
+ Sparsity schedule Both the above discussed iterative procedures approximately optimize (5), however, they depend on a sparsity/pruning schedule favouring small steps to be able to reliably apply the mentioned gradient approximation. One such valid schedule would be where the portion of newly removed weights with respect to the remaining weights is small. We find a simple exponential decay schedule, defined below, to work very well on all our experiments:
109
+
110
+ $$
111
+ { \mathrm { p ~ m o d e : ~ } } k _ { t } = \exp \left\{ \alpha \log k + ( 1 - \alpha ) \log m \right\} , \ \alpha = { \frac { t } { T } } .
112
+ $$
113
+
114
+ In section 5.3 we empirically show that these methods are very robust to the hyperparameter $T$ .
115
+
116
+ Some theoretical insights When pruning weights gradually, we are looking for the best possible sub-network in a neighbourhood defined by the previous mask and the amount of weights removed at that step. The problem being non-convex and non-smooth makes it challenging to prove if the mask
117
+
118
+ Algorithm 1 FORCE/Iter SNIP algorithms to find a pruning mask
119
+
120
+ 1: Inputs: Training set $\mathcal { D }$ , final sparsity $k$ , number of steps $T$ , weights $\pmb { \theta } _ { 0 } \in \mathbb { R } ^ { m }$ .
121
+ 2: Obtain $\{ k _ { t } \} _ { t = 1 : T }$ using the chosen schedule (refer to Eq (8))
122
+ 3: Define intial mask $\mathbf { c _ { 0 } = 1 }$
123
+ 4: for $t = 0 , \ldots , T - 1$ do
124
+ 5: Sample mini-batch $\{ z _ { i } \} _ { i = 1 } ^ { n }$ from $\mathcal { D }$
125
+ 6: Define $\bar { \pmb { \theta } } = \pmb { \theta } \odot \pmb { c } _ { t }$ (as sparsified (FORCE) vs pruned (Iter SNIP) network)
126
+ 7: Compute $\pmb { g } ( \bar { \pmb { \theta } } )$ (refer to Eq (5) )
127
+ 8: $I = \{ i _ { 1 } , \dots , i _ { k _ { t + 1 } } \}$ are top- $k _ { t + 1 }$ values of $\left| g _ { i } \right|$
128
+ 9: Build $c _ { t + 1 }$ by setting to 0 all indices not included in $I$ .
129
+ 10: end for
130
+ 11: Return: $c _ { T }$ .
131
+
132
+ obtained by our method is globally optimal. However, in Appendix D we prove that each intermediate mask obtained with Iterative SNIP is indeed an approximate local minima, where the degree of sub-optimality increases with the pruning step size. This gives some validation on why SNIP fails on higher sparsity. We can not provide the same guarantees for FORCE (there is no obvious link between the step size and the distance between masks), nevertheless, we empirically observe that FORCE is quite robust and more often than not improves over the performance of Iterative SNIP, which is not able to recover weights once pruned. We present further analysis in Appendix C.4.
133
+
134
+ # 5 EXPERIMENTS
135
+
136
+ In the following we evaluate the efficacy of our approaches accross different architectures and datasets.
137
+ Training settings, architecture descriptions, and implementation details are provided in Appendix A.
138
+
139
+ # 5.1 RESULTS ON CIFAR-10
140
+
141
+ Fig 2 compares the accuracy of the described iterative approaches with both SNIP and GRASP. We also report the performance of a dense and a random pruning baseline. Both SNIP and GRASP consider a single batch to approximate the saliencies, while we employ a different batch of data at each stage of our gradual skeletonization process. For a fair comparison, and to understand how the number of batches impacts performance, we also run these methods averaging the saliencies over $T$ batches, where $T$ is the number of iterations. SNIP-MB and GRASP-MB respectively refer to these multi-batch (MB) counterparts. In these experiments, we use $T = 3 0 0$ . We study the hyper-parameter robustness regarding $T$ later in section 5.3.
142
+
143
+ ![](images/32ae3d8e970d3d96e95e4913d95d9fce042a50161dfcde406b9c09285a092db6.jpg)
144
+ Figure 2: Test accuracies on CIFAR-10 for different pruning methods. With increased number of batches (-MB) one-shot methods are more robust at higher sparsity levels, but our gradual pruning approaches can go even further. Moreover, FORCE consistently reaches higher accuracy than other methods across most sparsity levels. Each point is an average of $\geq 3$ runs of prune-train-test. The shaded areas denote the standard deviation of the runs (too small to be visible in some cases). Note that in (b), GRASP and GRASP-MB overlap.
145
+
146
+ We observe that for moderate sparsity levels, one batch is sufficient for both SNIP and GRASP as reported in Lee et al. (2019); Wang et al. (2020). However, as we increase the level of sparsity, the performance of SNIP and GRASP degrades dramatically. For example, at $9 9 . 0 \%$ sparsity, SNIP drops down to $1 0 \%$ accuracy for both ResNet50 and VGG19, which is equivalent to random guessing as there are 10 classes. Note, in the case of randomly pruned networks, accuracy is nearly $\bar { 7 } 5 \%$ and $8 2 \%$ for ResNet50 and VGG19, respectively, which is significantly better than the performance of SNIP. However, to our surprise, just using multiple batches to compute the connection sensitivity used in SNIP improves it from $1 0 \%$ to almost $9 0 \%$ . This clearly indicates that a better approximation of the connection sensitivity is necessary for good performance in the case of high sparsity regime. Similar trends, although not this extreme, can be observed in the case of GRASP as well. On the other hand, gradual pruning approaches are much more robust in terms of sparsity for example, in the case of $9 9 . { \bar { 9 } } \%$ pruning, while one-shot approaches perform as good as a random classifier (nearly $1 0 \%$ accuracy), both FORCE and Iterative SNIP obtain more than $8 0 \%$ accuracy. While the accuracies obtained at higher sparsities might have degraded too much for some use cases, we argue this is an encouraging result, as no approach before has pruned a network at initialization to such extremes while keeping the network trainable and these results might encourage the community to improve the performance further. Finally, gradual pruning methods consistently improve over other methods even at moderate sparsity levels (refer to Fig 5), this motivates the use of FORCE or Iterative SNIP instead of other methods by default at any sparsity regime. Moreover, the additional cost of using iterative pruning instead of SNIP-MB is negligible compared to the cost of training and is significantly cheaper than GRASP-MB, further discussed in section 5.3.
147
+
148
+ ![](images/ff11ed6c70a4393fea4dc1aba0d965cdfd05ac6875771c946b2f6733a5aea11e.jpg)
149
+ Figure 3: Test accuracies on CIFAR-100 and Tiny Imagenet for different pruning methods. Each point is the average over 3 runs of prune-train-test. The shaded areas denote the standard deviation of the runs (too small to be visible in some cases).
150
+
151
+ # 5.2 RESULTS ON LARGER DATASETS
152
+
153
+ We now present experiments on large datasets. Wang et al. (2020) and Lee et al. (2019) suggest using a batch of size ${ \sim } 1 0$ times the number of classes, which is very large in these experiments. Instead, for memory efficiency, we average the saliencies over several mini-batches. For CIFAR100 and Tiny-ImageNet, we average 10 and 20 batches per iteration respectively, with 128 examples per batch. As we increase the number of batches per iteration, computing the pruning mask becomes more expensive. From Fig 4, we observe that the accuracy converges after just a few iterations. Thus, for the following experiments we used 60 iterations. For a fair comparison, we run SNIP and GRASP with $T \times B$ batches, where $T$ is the number of iterations and $B$ the number of batches per iteration in our method. We find the results, presented in Fig 3, consistent with trends in CIFAR-10.
154
+
155
+ In the case of Imagenet, we use a batch size of 256 examples and 40 batches per iteration. We use the official implementation of VGG19 with batch norm and Resnet50 from Paszke et al. (2017). As presented in Table 1, gradual pruning methods are consistently better than SNIP, with a larger gap as we increase sparsity. We would like to emphasize that FORCE is able to prune $9 0 \%$ of the weights of VGG while losing less than $3 \%$ of the accuracy, we find this remarkable for a method that prunes before any weight update. Interestingly, GRASP performs better than other methods at $9 5 \%$ sparsity (VGG), moreover, it also slightly surpasses FORCE for Resnet50 at $90 \%$ , however, it under-performs random pruning at $9 5 \%$ . In fact, we find all other methods to perform worse than random pruning for Resnet50. We hypothesize that, for a much more challenging task (Imagenet with 1000 classes), Resnet50 architecture might not be extremely overparametrized. For instance,
156
+
157
+ Table 1: Test accuracies on Imagenet for different pruning methods and sparsities.
158
+
159
+ <table><tr><td>Network</td><td colspan="4">VGG19</td><td colspan="4">Resnet50</td></tr><tr><td>Sparsity percentage</td><td colspan="2">90%</td><td colspan="2">95%</td><td colspan="2">90%</td><td colspan="2">95%</td></tr><tr><td>Accuracy</td><td>Top-1</td><td>Top-5</td><td>Top-1</td><td>Top-5</td><td>Top-1</td><td>Top-5</td><td>Top-1</td><td>Top-5</td></tr><tr><td>(Baseline)</td><td>73.1</td><td>91.3</td><td></td><td></td><td>75.6</td><td>92.8</td><td></td><td></td></tr><tr><td>FORCE (Ours)</td><td>70.2</td><td>89.5</td><td>65.8</td><td>86.8</td><td>64.9</td><td>86.5</td><td>59.0</td><td>82.3</td></tr><tr><td>Iter SNIP (Ours)</td><td>69.8</td><td>89.5</td><td>65.9</td><td>86.9</td><td>63.7</td><td>85.5</td><td>54.7</td><td>78.9</td></tr><tr><td>GRASP Wang et al. (2020)</td><td>69.5</td><td>89.2</td><td>67.6</td><td>87.8</td><td>65.4</td><td>86.7</td><td>46.2</td><td>66.0</td></tr><tr><td>SNIP Lee et al. (2019)</td><td>68.5</td><td>88.8</td><td>63.8</td><td>86.0</td><td>61.5</td><td>83.9</td><td>44.3</td><td>69.6</td></tr><tr><td>Random</td><td>64.2</td><td>86.0</td><td>56.6</td><td>81.0</td><td>64.6</td><td>86.0</td><td>57.2</td><td>80.8</td></tr></table>
160
+
161
+ ![](images/1f32e408cc2d391823461cfa36c40447f4cb419570cbc4b6ef418e23f8b86445.jpg)
162
+ Figure 4: Left: FORCE saliency (6) obtained with (7) when varying $T$ normalized by the saliency with one-shot SNIP $T = 1$ ). Pruning iteratively brings more gains for higher sparsity levels. Error bars not shown for better visualization. Middle: Test acc pruning with FORCE and Iter SNIP at $9 9 . 5 \%$ sparsity for different $T$ . Both methods are extremely robust to the choice of $T$ . Right: Wall time to compute pruning masks for CIFAR10/Resnet50/TeslaK40m vs acc at $9 9 . 5 \%$ sparsity; $( x \ b )$ means we used $x$ batches to compute the gradients while $\scriptstyle { \dot { x } }$ it) denotes we used $x$ pruning iterations, with one batch per iteration. Numbers in red indicate performance below random pruning.
163
+
164
+ VGG19 has 143.68M parameters while Resnet50 uses 25.56M (refer to Table 2). On the other hand, the fact that random pruning can yield relatively trainable architectures for these sparsity levels is somewhat surprising and might indicate that there still is room for improvement in this direction. Results seem to indicate that the FORCE saliency is a step in the right direction and we hypothesize further improvements on its optimization might lead to even better performance. In Appendix C.6, we show superior performance of our approach on the Mobilenet-v2 architecture (Sandler et al., 2018) as well, which is much more "slim" than Resnet and VGG 2.
165
+
166
+ # 5.3 ANALYSIS
167
+
168
+ Saliency optimization To experimentally validate our approach (7), we conduct an ablation study where we compute the FORCE saliency after pruning (5) while varying the number of iterations $T$ for different sparsity levels. In Fig 4 (left) we present the relative change in saliency as we vary the number of iterations $T$ , note when $T = 1$ we recover one-shot SNIP. As expected, for moderate levels of sparsity, using multiple iterations does not have a significant impact on the saliency. Nevertheless, as we target higher sparsity levels, we can see that the saliency can be better optimized when pruning iteratively. In Appendix C.1 we include results for FORCE where we observe similar trends.
169
+
170
+ Hyperparameter robustness As shown in Figures 2 and 3, for low sparsity levels, all methods are comparable, but as we move to higher sparsity levels, the gap becomes larger. In Fig 4 (middle) we fix sparsity at $9 9 . 5 \%$ and study the accuracy as we vary the number of iterations $T$ . Each point is averaged over 3 trials. SNIP $T = 1$ ) yields sub-networks unable to train $10 \%$ acc), but as we move to iterative pruning $( T > 1$ ) accuracy increases up to $90 \%$ for FORCE and $89 \%$ for Iter SNIP. Moreover, accuracy is remarkably robust to the choice of $T$ , the best performance for both FORCE and Iter SNIP is with more iterations, however a small number of iterations already brings a huge boost. This suggests these methods might be used by default by a user without worrying too much about hyper-parameter tuning, easily adapting the amount of iterations to their budget.
171
+
172
+ Pruning cost As shown in Fig 2, SNIP performance quickly degrades beyond $9 5 \%$ sparsity. Wang et al. (2020) suggested GRASP as a more robust alternative, however, it needs to compute a Hessian vector product which is significantly more expensive in terms of memory and time. In Fig 4 (right), we compare the time cost of different methods to obtain the pruning masks along with the corresponding accuracy. We observe that both SNIP and GRASP are fragile when using only one batch (red accuracy indicates performance below random baseline). When using multiple batches their robustness increases, but so does the pruning cost. Moreover, we find that gradual pruning based on the FORCE saliency is much cheaper than GRASP-MB when using equal amount of batches, this is because GRASP involves an expensive Hessian vector product. Thus, FORCE (or Iterative SNIP) would be preferable over GRASP-MB even when they have comparable accuracies.
173
+
174
+ FORCE vs Iterative SNIP Empirically, we find that FORCE tends to outperform Iter SNIP more often than not, suggesting that allowing weights to recover is indeed beneficial despite having less theoretical guarantees (see gradient approximation in Section 4). Thus, we would make FORCE algorithm our default choice, especially for Resnet architectures. In Appendix C.4 we empirically observe two distinct phases when pruning with FORCE. The first one involves exploration (early phase) when the amount of pruned and recovered weights seem to increase, indicating exploration of masks that are quite different from each other. The second, however, shows rapid decrease in weight recovery, indicating a phase where the algorithm converges to a more constrained topology. As opposed to Iter SNIP, the possibility of the exploration of many possible sub-networks before converging to a final topology might be the reason behind the slightly improved performance of FORCE. But this exploration comes at a price, in Fig 4 (middle and left) we observe how, despite FORCE reaching a higher accuracy when using enough steps, if we are under a highly constrained computational budget and can only afford a few pruning iterations, Iter SNIP is more likely to obtain a better pruning mask. This is indeed expected as FORCE might need more iterations to converge to a good sub-space, while Iter SNIP will be forced to converge by construction. A combination of FORCE and Iter SNIP might lead to an even better approach, we leave this for future work.
175
+
176
+ Early pruning as an additional baseline Our gradual pruning approaches (SNIP-MB and GRASPMB as well) use multiple batches to obtain a pruned mask, considering that pruning can be regarded as a form of training (Mallya et al., 2018), we create another baseline for the sake of completeness. We train a network for one epoch, a similar number of iterations as used by our approach, and then use magnitude pruning to obtain the final mask, we call this approach early pruning (more details in Appendix C.5). Interestingly, we find that early pruning tends to perform worse than SNIP-MB (and gradual pruning) for Resnet, and shows competitive performance at low sparsity level for VGG but with a sharp drop in the performance as the sparsity level increases. Even though these experiments support the superiority of our approach, we would like to emphasize that they do not conclude that any early pruning strategy would be suboptimal compared to pruning at initialization as an effective approach in this direction might require devising a well thought objective function.
177
+
178
+ Iterative pruning to maximize the Gradient Norm In Sec 4, we have seen Iterative SNIP can be used to optimize the FORCE saliency. We also tried to use GRASP iteratively, however, after a few iterations the resulting networks were not trainable. Interestingly, if we apply the gradient approximation to GRASP saliency (instead of Taylor), we can come up with a different iterative approximation to maximize the gradient norm after pruning. We empirically observe this method is more robust than GRASP to high sparsity levels. This suggests that 1) Iterative pruning, although beneficial, can not be trivially applied to any method. 2) The gradient approximation is more general than in the context of FORCE/SNIP sensitivity. We present further details and results in Appendix E.
179
+
180
+ # 6 DISCUSSION
181
+
182
+ Pruning at initialization has become an active area of research both for its practical and theoretical interests. In this work, we discovered that existing methods mostly perform below random pruning at extreme sparsity regime. We presented FORCE, a new saliency to compute the connection sensitivity after pruning, and two approximations to progressively optimize FORCE in order to prune networks at initialization. We showed that our methods are significantly better than the existing approaches for pruning at extreme sparsity levels, and are at least as good as the existing ones for pruning at moderate sparsity levels. We also provided theoretical insights on why progressive skeletonization is beneficial at initialization, and showed that the cost of iterative methods is reasonable compared to the existing ones. Although pruning iteratively has been ubiquitous in the pruning community, it was not evident that pruning at initialization might benefit from this scheme. Particularly, not every approximation could be used for gradual pruning as we have shown with GRASP. However, the gradient approximation allowed us to gradually prune while maximizing either the gradient norm or FORCE. We consider our results might encourage future work to further investigate the exploration/exploitation trade-off in pruning and find more efficient pruning schedules, not limited to the pruning at initialization.
183
+
184
+ # ACKNOWLEDGMENTS
185
+
186
+ This work was supported by the Royal Academy of Engineering under the Research Chair and Senior Research Fellowships scheme, EPSRC/MURI grant EP/N019474/1 and Five AI Limited. Pau de Jorge was fully funded by NAVER LABS Europe. Amartya Sanyal acknowledges support from The Alan Turing Institute under the Turing Doctoral Studentship grant TU/C/000023. Harkirat was supported using a Tencent studentship through the University of Oxford.
187
+
188
+ # REFERENCES
189
+
190
+ Guillaume Bellec, David Kappel, Wolfgang Maass, and Robert Legenstein. Deep rewiring: Training very sparse deep networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BJ_wN01C-.
191
+
192
+ Miguel Á. Carreira-Perpiñán and Yerlan Idelbayev. “learning-compression” algorithms for neural net pruning. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
193
+
194
+ Yves Chauvin. A back-propagation algorithm with optimal use of hidden units. In Advances in neural information processing systems, pp. 519–526, 1989.
195
+
196
+ Xiaoliang Dai, Hongxu Yin, and Niraj K Jha. Nest: A neural network synthesis tool based on a grow-and-prune paradigm. IEEE Transactions on Computers, 68(10):1487–1497, 2019.
197
+
198
+ Tim Dettmers and Luke Zettlemoyer. Sparse networks from scratch: Faster training without losing performance, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ ByeSYa4KPS.
199
+
200
+ Erich Elsen, Marat Dukhan, Trevor Gale, and Karen Simonyan. Fast sparse convnets. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14629–14638, 2020.
201
+
202
+ Utku Evci, Trevor Gale, Jacob Menick, Pablo Samuel Castro, and Erich Elsen. Rigging the lottery: Making all tickets winners. arXiv preprint arXiv:1911.11134, 2019.
203
+
204
+ Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rJl-b3RcF7.
205
+
206
+ Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M. Roy, and Michael Carbin. Stabilizing the lottery ticket hypothesis, 2020.
207
+
208
+ Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. In Advances in neural information processing systems, pp. 1379–1387, 2016.
209
+
210
+ Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, pp. 1135–1143, 2015.
211
+
212
+ Babak Hassibi, David G Stork, and Gregory J Wolff. Optimal brain surgeon and general network pruning. In IEEE international conference on neural networks, pp. 293–299. IEEE, 1993.
213
+
214
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
215
+
216
+ Alex Krizhevsky et al. Learning multiple layers of features from tiny images, 2009.
217
+
218
+ Aditya Kusupati, Vivek Ramanujan, Raghav Somani, Mitchell Wortsman, Prateek Jain, Sham M. Kakade, and Ali Farhadi. Soft threshold weight reparameterization for learnable sparsity. ArXiv, abs/2002.03231, 2020.
219
+
220
+ Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems, pp. 598–605, 1990.
221
+
222
+ Namhoon Lee, Thalaiyasingam Ajanthan, and Philip Torr. SNIP: SINGLE-SHOT NETWORK PRUNING BASED ON CONNECTION SENSITIVITY. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ B1VZqjAcYX.
223
+
224
+ Namhoon Lee, Thalaiyasingam Ajanthan, Stephen Gould, and Philip H. S. Torr. A signal propagation perspective for pruning neural networks at initialization. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HJeTo2VFwH.
225
+
226
+ Tao Lin, Sebastian U. Stich, Luis Barba, Daniil Dmitriev, and Martin Jaggi. Dynamic model pruning with feedback. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $_ { \cdot } =$ SJem8lSFwB.
227
+
228
+ Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. In International Conference on Learning Representations, 2018.
229
+
230
+ Christos Louizos, Max Welling, and Diederik P. Kingma. Learning sparse neural networks through l0 regularization. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id ${ . } =$ H1Y8hhg0b.
231
+
232
+ Arun Mallya, Dillon Davis, and Svetlana Lazebnik. Piggyback: Adapting a single network to multiple tasks by learning to mask weights. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 67–82, 2018.
233
+
234
+ Decebal Constantin Mocanu, Elena Mocanu, Peter Stone, Phuong H Nguyen, Madeleine Gibescu, and Antonio Liotta. Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science. Nature communications, 9(1):1–12, 2018.
235
+
236
+ Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient inference. In International Conference on Learning Representations, 2017.
237
+
238
+ Hesham Mostafa and Xin Wang. Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization, 2019. URL https://openreview.net/forum? id=S1xBioR5KX.
239
+
240
+ Michael C Mozer and Paul Smolensky. Skeletonization: A technique for trimming the fat from a network via relevance assessment. In Advances in Neural Information Processing Systems, 1989.
241
+
242
+ Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch, 2017.
243
+
244
+ Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115 (3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
245
+
246
+ M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L. Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4510–4520, 2018. doi: 10.1109/CVPR.2018.00474.
247
+
248
+ Hidenori Tanaka, Daniel Kunin, Daniel L Yamins, and Surya Ganguli. Pruning neural networks without any data by iteratively conserving synaptic flow. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 6377–6389. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/46a4378f835dc8040c8057beb6a2da52-Paper.pdf.
249
+
250
+ Stijn Verdenius, Maarten Stol, and Patrick Forré. Pruning via iterative ranking of sensitivity statistics. arXiv preprint arXiv:2006.00896, 2020.
251
+
252
+ Chaoqi Wang, Guodong Zhang, and Roger Grosse. Picking winning tickets before training by preserving gradient flow. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SkgsACVKPH.
253
+
254
+ Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
255
+
256
+ # A PRUNING IMPLEMENTATION DETAILS
257
+
258
+ We present experiments on CIFAR-10/100 (Krizhevsky et al., 2009), which consists of 60k $3 2 \times 3 2$ colour images divided into $1 0 / 1 0 0$ classes, and also on Imagenet challenge ILSVRC-2012 (Russakovsky et al., 2015) and its smaller version Tiny-ImageNet, which respectively consist of $1 . 2 { \mathrm { M } } / 1 { \mathrm { k } }$ and $1 0 0 \dot { \mathrm { k } } / 2 0 0$ images/classes. Networks are initialized using the Kaiming normal initialization (He et al., 2015). For CIFAR datasets, we train Resnet $5 0 ^ { 3 }$ and $\mathrm { V \bar { G } G 1 9 ^ { 4 } }$ architectures during 350 epochs with a batch size of 128. We start with a learning rate of 0.1 and divide it by 10 at 150 and 250 epochs. As optimizer we use SGD with momentum 0.9 and weight decay $5 \times 1 0 ^ { - 4 }$ . We separate $10 \%$ of the training data for validation and report results on the test set. We perform mean and std normalization and augment the data with random crops and horizontal flips. For Tiny-Imagenet, we use the same architectures. We train during 300 epochs and divide the learning rate by 10 at 1/2 and 3/4 of the training. Other hyper-parameters remain the same. For ImageNet training, we adapt the official code5 of Paszke et al. (2017) and we use the default settings. In this case, we use the Resnet50 and VGG19 with batch normalization architectures as implemented in Paszke et al. (2017).
259
+
260
+ In the case of FORCE and Iter SNIP, we adapt the same public implementation6 of SNIP as Wang et al. (2020). Instead of defining an auxiliary mask to compute the saliencies, we compute the product of the weight times the gradient, which was shown to be equivalent in Lee et al. (2020). As for GRASP, we use their public code.7 After pruning, we implement pruned connections by setting the corresponding weight to 0 and forcing the gradient to be 0. This way, a pruned weight will remain 0 during training.
261
+
262
+ An important difference between SNIP and GRASP implementations is in the way they select the mini-batch to compute the saliency. SNIP implementation simply loads a batch from the dataloader. In contrast, in GRASP implementation they keep loading batches of data until they obtain exactly 10 examples of each class, discarding redundant samples. In order to compare the methods in equal conditions, we decided to use the way SNIP collects the data since it is simpler to implement and does not require extra memory. This might cause small discrepancies between our results and the ones reported in Wang et al. (2020).
263
+
264
+ Table 2: Percentage of weights per layer for each network and dataset.
265
+
266
+ <table><tr><td>Layer type</td><td>Conv</td><td>Fully connected</td><td>BatchNorm</td><td>Bias</td><td>Prunable</td><td>Total</td></tr><tr><td>CIFAR10</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Resnet50</td><td>99.69</td><td>0.09</td><td>0.11</td><td>0.11</td><td>99.78</td><td>23.52M</td></tr><tr><td>VGG19</td><td>99.92</td><td>0.03</td><td>0.03</td><td>0.03</td><td>99.95</td><td>20.04M</td></tr><tr><td>CIFAR100</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Resnet50</td><td>98.91</td><td>0.86</td><td>0.11</td><td>0.11</td><td>99.78</td><td>23.71M</td></tr><tr><td>VGG19</td><td>99.69</td><td>0.25</td><td>0.03</td><td>0.03</td><td>99.94</td><td>20.08M</td></tr><tr><td>TinyImagenet</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Resnet50</td><td>98.06</td><td>1.71</td><td>0.11</td><td>0.11</td><td>99.78</td><td>23.91M</td></tr><tr><td>VGG19</td><td>99.44</td><td>0.51</td><td>0.03</td><td>0.03</td><td>99.94</td><td>20.13M</td></tr><tr><td>Imagenet</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Resnet50</td><td>91.77</td><td>8.01</td><td>0.10</td><td>0.11</td><td>99.79</td><td>25.56M</td></tr><tr><td>VGG19</td><td>13.93</td><td>86.05</td><td>0.01</td><td>0.01</td><td>99.98</td><td>143.68M</td></tr></table>
267
+
268
+ A meaningful design choice regarding SNIP and GRASP implementations is that they only prune convolutional and fully connected layers. These layers constitute the vast majority of parameters in most networks, however, as we move to high sparsity regimes, batch norm layers constitute a non-negligible amount. For CIFAR10, batch norm plus biases constitute $0 . 2 \%$ and $0 . 0 5 \%$ of the parameters of Resnet50 and VGG19 networks respectively. For consistency, we have as well restricted pruning to convolutional and fully connected layers and reported percentage sparsity with respect to the prunable parameters, as is also done in Lee et al. (2019) and Wang et al. (2020) to the best of our knowledge. In Table 2 we show the percentage of prunable weights for each network and dataset we use. In future experiments we will explore the performance of pruning at initialization when including batch norm layers and biases as well.
269
+
270
+ ![](images/241864e2afa263a15bc0673ce478298cf938cba1fbf6b2d53f9d6f010cba0fb3.jpg)
271
+ Figure 5: Test accuracies on CIFAR-10/100 and Tiny Imagenet for different pruning methods. Each point is the average over 3 runs of prune-train-test. The shaded areas denote the standard deviation of the runs (too small to be visible in some cases).
272
+
273
+ # B ADDITIONAL ACCURACY-SPARSITY PLOTS
274
+
275
+ In the main text we show the complete range of the accuracy-sparsity curves for the different methods so it is clear why more robust methods are needed. However, it makes it more difficult to appreciate the smaller differences at lower sparsities. In Fig 5 we show the accuracy-sparsity curves where we cut the y axis to show only the higher accuracies.
276
+
277
+ # C FURTHER ANALYSIS OF PRUNING AT INITIALIZATION
278
+
279
+ # C.1 SALIENCY VS T
280
+
281
+ In Fig 4 (left) we have seen that for higher sparsity levels, FORCE obtains a higher saliency when we increase the number of iterations. In Fig 6 we compare the relative saliencies as we increase the number of iterations for FORCE and Iterative SNIP. As can be seen, both have a similar behaviour.
282
+
283
+ # C.2 PRUNING VS SPARSIFICATION
284
+
285
+ FORCE algorithm is able to recover pruned weights in later iterations of pruning. In order to do that, we do not consider the intermediate masks as pruning masks but rather as sparsification masks, where connections are set to 0 but not their gradients. In order to understand how does computing the FORCE (5) on a sparsified vs pruned network affect the saliency, we prune several masks with FORCE algorithm at varying sparsity levels. For each mask, we then compute their FORCE saliency either considering the pruned network (gradients of pruned connections will be set to 0 during the backward pass) or the sparsified network (we only set to 0 the connections, but let the gradient signal flow through all the connections). Results are presented in Fig 7. We observe that the two methods to compute the saliency are strongly correlated, thus, we can assume that when we use the FORCE algorithm that maximizes the saliency of sparsified networks we will also maximize the saliency of the corresponding pruned networks.
286
+
287
+ ![](images/d8d14d57b44ea21b137e2aa6b0022b2542d6bdc8db241ba10710b50ab3e5f26f.jpg)
288
+ Figure 6: FORCE saliency (6) obtained with iterative pruning normalized by the saliency obtained with one-shot SNIP, $T = 1$ . (a) Applying the FORCE algorithm (b) Using Iterative SNIP. Note how both methods have similar behaviour.
289
+
290
+ ![](images/11496fbc93334e2bb240e2f02bc38a3354a6fa2a2a3b9f665371b526e648ea16.jpg)
291
+ Figure 7: FORCE saliency computed for masks as we vary sparsity. FORCE (sparsification) refers to measuring FORCE when we allow the gradients of zeroed connections to be non-zero, while FORCE (pruning) cuts all backward signal of any removed connection. As can be seen on the plot, they are strongly correlated.
292
+
293
+ # C.3 NETWORK STRUCTURE AFTER PRUNING
294
+
295
+ In Fig 8 we visualize the structure of the networks after pruning $9 9 . 9 \%$ of the parameters. We show the fraction of remaining weights and the total number of remaining weights per layer after pruning. As seen in (a) and (d), all analysed methods show a tendency to preserve the initial and final layers and to prune more heavily the deep convolutional layers, this is consistent with results reported in Wang et al. (2020). In (b) and (e), we note that FORCE has a structure that stands out compared to other methods that are more similar. This is reasonable since, it is the only method that allows pruned weights to recover. In the zoomed plots (c) and (f) we would like to point out that FORCE and Iterative SNIP preserve more weights on the deeper layers than GRASP and SNIP for VGG19 while we observe the opposite behaviour for Resnet50.
296
+
297
+ In Fig 2, we observe that gradual pruning is able to prune the Resnet50 network up to $9 9 . 9 9 \%$ sparsity without falling to random accuracy. In contrast, with VGG19 we observe Iterative SNIP is not able to prune more than $9 9 . 9 \%$ . In Fig 8 we observe that for Resnet50, all methods prune some layers completely. However, in the case of ResNets, even if a convolutional layer is entirely pruned, skip connections still allow the flow of forward and backward signal. On the other hand, architectures without skip connections, such as VGG, require non-empty layers to keep the flow of information. Interestingly, in (c) we observe how FORCE and Iter SNIP have a larger amount of completely pruned layers than GRASP, however, there are a few deep layers with a significantly larger amount of unpruned weights. This seems to indicate that when a high sparsity is required, it is more efficient to have fewer layers with more weights than several extremely sparse layers.
298
+
299
+ ![](images/1c4cc11211a007f7d20534bbc8c663bef04daa2fd759df47a4acb4c4e22aa97b.jpg)
300
+ Figure 8: Visualization of remaining weights after pruning $9 9 . 9 \%$ of the weights of Resnet-50 and VGG-19 for CIFAR-10. (a) and (d) show the fraction of remaining weights for each prunable layer. (b) and (e) show the actual number of remaining weights and (c) and (f) zoom to the bottom part of the plot. Observe in (c) and (f) that some layers have exactly 0 weights left, so they are removed entirely.
301
+
302
+ ![](images/9d10a7ad4423519576c8803e8b2b80150ca515fa2f7840bb875581ef881139ec.jpg)
303
+ Figure 9: Normalized amount of globally pruned and recovered weights at each pruning iteration for Resnet50, CIFAR-10 when pruned with (a) Iterative SNIP and (b) FORCE. As expected, the amount of recovered weights for Iterative SNIP is constantly zero, since this is by design. Moreover, the amount of pruned weights decays exponentially as expected from our pruning schedule. On the other hand, we see the amount of recovered weights is non-zero with FORCE, interestingly the amount of pruned/recovered weights does not decay monotonically but has a clear peak, indicating there is an "exploration" and a "convergence" phase during pruning.
304
+
305
+ # C.4 EVOLUTION OF PRUNING MASKS
306
+
307
+ As discussed in the main text, FORCE allows weights that have been pruned at earlier iterations to become non-zero again, we argue this might be beneficial compared to Iterative SNIP which will not be able to correct any possible "mistakes" made in earlier iterations. In particular, it seems to give certain advantage to prune VGG to high sparsities without breaking the flow of information (pruning a layer entirely) as can be seen in Fig 2 (b). In order to gain a better intuition of how does the amount of pruned/recovered weights ratio evolve during pruning, in Fig 9 we plot the normalized amount of pruned and recovered weights (globally on the whole network) at each iteration of FORCE and also for Iter SNIP as a sanity check. Note that Iterative SNIP does not recover weights and the amount of weights pruned at each step decays exponentially (this is expected since we derived Iterative SNIP as a constrained optimization of FORCE where each network needs to be a sub-network of the previous iteration. On the other hand, FORCE does recover weights. Moreover, the amount of pruned/recovered weights does not decay monotonically but has a clear peak, indicating there are two phases during pruning: While the amount of pruned weights increases, the algorithm explores masks which are quite far away from each other, although this might be harmful for the gradient approximation (refer to section 4), we argue that during the initial pruning iterations the network is still quite over-parametrized. After reaching a peak, both the pruning and recovery rapidly decay, thus the masks converge to a more constrained subset.
308
+
309
+ # C.5 COMPARISON WITH EARLY PRUNING
310
+
311
+ For fair comparison, we provided the same amount of data to SNIP and GRASP as was used by our approach and call this variant SNIP-MB and GRASP-MB. Similarly, under this new baseline which we call early pruning, we train the network on 1 epoch of data of CIFAR-10, that is slightly more examples than our pruning at initialization methods which use $1 2 8 \cdot 3 0 0 = 3 8 4 0 0$ examples (see section 5). After training for 1 epoch we perform magnitude pruning which requires no extra cost (results presented in Fig 10). Although early pruning yields competitive results for VGG at moderate sparsity levels, it soon degrades its performance as we prune more weights. On the other hand, for Resnet architecture it is sub-optimal at all evaluated sparsity levels. Note, this result does not mean that any early pruning strategy would be sub-optimal compared to pruning at initialization, however exploring this further is out of the scope of this work.
312
+
313
+ ![](images/cf6c96d1b7218c79b229924bba57df87b5618c94c32e3d42ec1f381a5093b10e.jpg)
314
+ Figure 10: Test accuracies on CIFAR-10 for different pruning methods. Each point is the average over 3 runs of prune-train-test. The shaded areas denote the standard deviation of the runs (too small to be visible in some cases). Early pruning is at most on par with gradual pruning at initialization methods and has a strong drop in performance as we go to higher sparsities.
315
+
316
+ # C.6 MOBILENET EXPERIMENTS
317
+
318
+ All our experiments were on overparameterized architectures such as Resnet and VGG. To test the wider usability of our methods, in this section we prune the Mobilenet-v2 architecture8 (Sandler et al., 2018) which is much more "slim" than Resnet and VGG (Mobilenet has 2.3M params compared to 20.03M and 23.5M of VGG and Resnet respectively). Results are provided in Fig 11. Similarly to Resnet and VGG architectures, we see that gradual pruning tends to better preserve accuracy at higher sparsity levels than one-shot methods. Moreover, both FORCE and Iter SNIP improve over SNIP at moderate sparsity levels as well. FORCE and Iter SNIP have comparable accuracies except for high sparsity where Iter SNIP surpasses FORCE. We hypothesize for such a slim architecture $\approx 1 0 \times$ fewer parameters than Resnet and VGG) the gradient approximation becomes even more sensitive to the distance between iterative masks and perhaps the exploration of FORCE is harmful in this case. As discussed in the main paper, we believe that further research to understand the exploration/exploitation trade-off when pruning might yield to even more efficient pruning schemes, especially for very high sparsity levels. We train using the same settings as described in Appendix A except for the weight decay which is set to $4 \times 1 0 ^ { - 5 }$ , following the settings of the original Mobilenet paper.
319
+
320
+ ![](images/7110cd910bb63a8ee3800f3086fa3af4bdf82d4f0d7efc169c1efb2d280fa320.jpg)
321
+ Figure 11: Test accuracies on CIFAR-10 for different pruning methods on Mobilenet architecture. Each point is the average over 3 runs of prune-train-test. The shaded areas denote the standard deviation of the runs (too small to be visible in some cases). When pruning Mobilenet-v2 architecture, which has roughly $1 0 \times$ less parameters than Resnet or VGG, we observe a similar pattern: Gradual pruning tends to be able to preserve accuracy for higher sparsities better than one-shot methods. Moreover, it tends to improve slightly over SNIP at moderate sparsities as well. Although GRASP does not show an acute drop in performance like SNIP, it seems to be sub-optimal with respect to other methods across all sparsities.
322
+
323
+ # D LOCAL OPTIMAL MASKS
324
+
325
+ Definition 1 $( ( p , \epsilon )$ -local optimal mask). Consider any two sets9 $\mathbf { c } _ { t } \subseteq \{ 1 , \cdots , m \}$ and $\mathbf { c } _ { t + 1 } \subset \mathbf { c } _ { t }$ For any $\epsilon > 0$ and $0 \leq p \leq | \mathbf { c } _ { t } \rangle \langle \mathbf { c } _ { t + 1 } |$ , $\mathbf { c } _ { t + 1 }$ is a $( p , \epsilon )$ local optimal with respect to $\mathbf { c } _ { t }$ if the following holds
326
+
327
+ $$
328
+ S ( \theta , \mathbf { c } _ { t + 1 } ) \geq S ( \theta , ( \mathbf { c } _ { t + 1 } \backslash S _ { - } ) \cup S _ { + } ) - \epsilon
329
+ $$
330
+
331
+ for all $S _ { - } \subset { \mathbf { c } } _ { t + 1 } , | S _ { - } | = p$ and $S _ { + } \subset ( \mathbf { c } _ { t } \setminus ( \mathbf { c } _ { t + 1 } ) , | S _ { + } | = p .$ .
332
+
333
+ Definition 2 (CRS; Coordinate-Restricted-Smoothness). Given a function $\mathcal { L } : \mathbb { R } ^ { m } \mathbb { R }$ (which encodes both the network architecture and the dataset), $\mathcal { L }$ is said to be $\lambda _ { c }$ -Coordinated Restricted
334
+
335
+ Smooth with respect to $\mathbf { c } \subseteq \{ 1 , \cdots , m \}$ if there exists a real number $\lambda _ { c }$ such that
336
+
337
+ $$
338
+ \left. \mathbf { c } \odot \boldsymbol { \nabla } \mathcal { L } \left( \mathbf { w } \odot \mathbf { c } \right) - \mathbf { c } \odot \boldsymbol { \nabla } \mathcal { L } \left( \mathbf { w } \odot \widehat { \mathbf { c } } \right) \right. _ { \infty } \leq \lambda _ { c } \left. \mathbf { w } \odot \mathbf { c } - \mathbf { w } \odot \widehat { \mathbf { c } } \right. _ { 1 }
339
+ $$
340
+
341
+ for all $\mathbf { w } \in \mathbb { R } ^ { m }$ and $\widehat { \mathbf { c } } \subset \mathbf { c }$ . When $s = | \mathbf { c } \rangle \widehat { \mathbf { c } } |$ , an application of Holder’s inequality shows
342
+
343
+ $$
344
+ \lambda _ { c } \left\| \mathbf { w } \odot \mathbf { c } - \mathbf { w } \odot { \widehat { \mathbf { c } } } \right\| _ { 1 } \leq \lambda _ { c } \left\| \mathbf { w } \right\| _ { \infty } \left\| \mathbf { c } - { \widehat { \mathbf { c } } } \right\| _ { 1 } = \lambda _ { c } s \left\| \mathbf { w } \right\| _ { \infty }
345
+ $$
346
+
347
+ We define $\mathcal { L }$ to be $\Lambda$ -total CRS if there exists a function $\Lambda : \left\{ 0 , 1 \right\} ^ { m } \to \mathbb { R }$ such that for all $\mathbf { c } \in \{ 0 , 1 \} ^ { m }$ $\mathcal { L }$ is $\Lambda \left( \mathbf { c } \right)$ -Coordinate-Restricted-Smooth with respect to $\mathbf { c }$ (for ease of notation we use $\Lambda \left( \mathbf { c } \right) = \lambda _ { \mathbf { c } }$ ).
348
+
349
+ Theorem 1 (Informal). The mask $\mathbf { c } _ { t + 1 }$ produced from $\mathbf { c } _ { t }$ by FORCE is $\left( p , 2 \lambda p \left\| \theta \right\| _ { \infty } ^ { 2 } \left| \mathbf { c } _ { t } \right| \right)$ -local optimal if the $\mathcal { L }$ is $\Lambda$ -CRS..
350
+
351
+ Proof. Consider the masks $\mathbf { c } _ { t }$ and $\mathbf { c } _ { t + 1 }$ where the latter is obtained by one step of FORCE on the former. Let $S _ { - }$ and $S _ { + }$ be any set of size $p$ such that $S _ { - } \subset c _ { t + 1 }$ and $S _ { + } \subset ( \mathbf { c } _ { t } \setminus \mathbf { c } _ { t + 1 } )$ . Finally, for ease of notation we define $\zeta \overset { \cdot } { = } ( c _ { t + 1 } \setminus S _ { - } ) \cup S _ { + }$
352
+
353
+ $$
354
+ \begin{array} { r l } { S \left( \theta , \zeta \right) - S \left( \theta , \mathbf { c } _ { t + 1 } \right) = \displaystyle \sum _ { i \in \zeta } \left| \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \zeta \right) _ { i } \right| - \displaystyle \sum _ { i \in \mathbf { c } _ { t + 1 } } \left| \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \mathbf { c } _ { t + 1 } \right) _ { i } \right| } & { } \\ { = \underbrace { \displaystyle \sum _ { i \in \mathbf { c } _ { t + 1 } } \left| \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \zeta \right) _ { i } \right| - \displaystyle \sum _ { i \in \mathbf { c } _ { t + 1 } } \left| \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \mathbf { c } _ { t + 1 } \right) _ { i } \right| } _ { \mathrm { ~ r _ 1 ~ } } } & { } \\ { + \displaystyle \sum _ { i \in S _ { + } } \left| \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \zeta \right) _ { i } \right| - \displaystyle \sum _ { i \in S _ { - } } \left| \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \zeta \right) _ { i } \right| } & { } \end{array}
355
+ $$
356
+
357
+ Let us look at the three terms individually. We assume that $\mathcal { L }$ is $\Lambda$ -CRS.
358
+
359
+ $$
360
+ \begin{array} { r l r l } & { \Gamma _ { 1 } = \displaystyle \sum _ { i \in { \bf c } + 1 } \left| \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \zeta \right) _ { i } \right| - \left| \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot { \bf c } _ { t + 1 } \right) _ { i } \right| } & \\ & { \quad \le \left\| { \bf c } _ { t + 1 } \odot \theta \odot \nabla \mathcal { L } \left( \theta \odot { \bf c } _ { t + 1 } \right) - { \bf c } _ { t + 1 } \odot \theta \odot \nabla \mathcal { L } \left( \theta \odot \zeta \right) \right\| _ { 1 } } & & { \mathrm { B y ~ T r i a n g l e ~ I n e q u a l i t y } } \\ & { \quad \le \left\| { \bf c } _ { t + 1 } \odot \theta \right\| _ { 1 } \left\| { \bf c } _ { t + 1 } \odot \nabla \mathcal { L } \left( \theta \odot { \bf c } _ { t + 1 } \right) - { \bf c } _ { t + 1 } \odot \nabla \mathcal { L } \left( \theta \odot \zeta \right) \right\| _ { \infty } } & & { \mathrm { B y ~ H o l d e r ~ s ~ I n e q u a l i t y } } \\ & { \quad \le 2 \lambda _ { c _ { t + 1 } } \left| c _ { t + 1 } \right| p \left\| \theta \right\| _ { \infty } ^ { 2 } } & & { \quad \cdot \ \cdot \mathcal { L } \mathrm { i s ~ \Lambda - C R S } \enspace ( 1 2 ) } \end{array}
361
+ $$
362
+
363
+ $$
364
+ \begin{array} { r l } & { \Gamma _ { 2 } = \displaystyle \sum _ { i \in S _ { + } } | \theta _ { i } \cdot \nabla \mathcal { L } ( \theta \odot \zeta ) _ { i } | - | \theta _ { i } \cdot \nabla \mathcal { L } ( \theta \odot \mathbf { c } _ { t } ) _ { i } | + | \theta _ { i } \cdot \nabla \mathcal { L } ( \theta \odot \mathbf { c } _ { t } ) _ { i } | } \\ & { \quad \le \displaystyle \sum _ { i \in S _ { + } } | \theta _ { i } \cdot \nabla \mathcal { L } ( \theta \odot \mathbf { c } _ { t } ) _ { i } | + \lambda _ { \mathbf { c } _ { t } } p \| \theta \| _ { \infty } ^ { 2 } ( | \mathbf { c } _ { t } | - | \mathbf { c } _ { t + 1 } | ) \qquad \cdot | \mathbf { c } _ { t } \zeta | = | \mathbf { c } _ { t } | - | \mathbf { c } _ { t + 1 } | , } \end{array}
365
+ $$
366
+
367
+ $$
368
+ \begin{array} { r l } & { \Gamma _ { 3 } = - \displaystyle \sum _ { i \in S _ { - } } \left. \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \zeta \right) _ { i } \right. + \left. \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \mathbf { c } _ { t } \right) _ { i } \right. - \left. \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \mathbf { c } _ { t } \right) _ { i } \right. } \\ & { \quad \leq - \displaystyle \sum _ { i \in S _ { - } } \left. \theta _ { i } \cdot \nabla \mathcal { L } \left( \theta \odot \mathbf { c } _ { t } \right) _ { i } \right. + \lambda _ { \mathbf { c } _ { t } } p \left. \left. \theta \right. \right. _ { \infty } ^ { 2 } \left( \left. \mathbf { c } _ { t } \right. - \left. \mathbf { c } _ { t + 1 } \right. \right) , } \end{array}
369
+ $$
370
+
371
+ Adding eqs. (13) and (14), we get
372
+
373
+ $$
374
+ \begin{array} { r l r } { { \Gamma _ { 2 } + \Gamma _ { 3 } \leq \sum _ { i \in S _ { + } } | \theta _ { i } \cdot \nabla \mathcal { L } ( \theta \odot \mathbf { c } _ { t } ) _ { i } | - \sum _ { i \in S _ { - } } | \theta _ { i } \cdot \nabla \mathcal { L } ( \theta \odot \mathbf { c } _ { t } ) _ { i } | + 2 \lambda _ { \mathbf { c } _ { t } } p \| \theta \| _ { \infty } ^ { 2 } ( | \mathbf { c } _ { t } | - | \mathbf { c } _ { t + 1 } | ) } } \\ & { } & { \leq 2 \lambda _ { \mathbf { c } _ { t } } p \| \theta \| _ { \infty } ^ { 2 } ( | \mathbf { c } _ { t } | - | \mathbf { c } _ { t + 1 } | ) - \gamma p \qquad \mathrm { ( } } \end{array}
375
+ $$
376
+
377
+ Substituting eqs. (12) and (15) into (11) we get
378
+
379
+ $$
380
+ \begin{array} { r l } & { S \left( \theta , \zeta \right) - S \left( \theta , \mathbf { c } _ { t + 1 } \right) \leq 2 \lambda _ { \mathbf { c } _ { t + 1 } } \left. \mathbf { c } _ { t + 1 } \right. p \left. \theta \right. _ { \infty } ^ { 2 } + 2 \lambda _ { \mathbf { c } _ { t } } p \left. \theta \right. _ { \infty } ^ { 2 } \left( \left. \mathbf { c } _ { t } \right. - \left. \mathbf { c } _ { t + 1 } \right. \right) - \gamma p } \\ & { \qquad = 2 \lambda _ { \mathbf { c } _ { t + 1 } } p \left. \theta \right. _ { \infty } ^ { 2 } \left( \left. \mathbf { c } _ { t + 1 } \right. + \left( \left. \mathbf { c } _ { t } \right. - \left. \mathbf { c } _ { t + 1 } \right. \right) \right) - \gamma p } \\ & { \qquad S \left( \theta , \mathbf { c } _ { t + 1 } \right) \geq S \left( \theta , \zeta \right) - 2 \lambda _ { \mathbf { c } _ { t + 1 } } p \left. \theta \right. _ { \infty } ^ { 2 } \left. \mathbf { c } _ { t } \right. + \gamma p } \\ & { \qquad S \left( \theta , \mathbf { c } _ { t + 1 } \right) \geq S \left( \theta , \zeta \right) - 2 \lambda _ { \mathbf { c } _ { t + 1 } } p \left. \theta \right. _ { \infty } ^ { 2 } \left. \mathbf { c } _ { t } \right. } \end{array}
381
+ $$
382
+
383
+ ![](images/d8b98a0c83faf38c3a57f672f7fbede8b57c22e5d23e2a2f670c2e77c8c3694f.jpg)
384
+ Figure 12: Test accuracies for different datasets and networks when pruned with different methods. Each point is the average over 3 runs of prune-train-test. The shaded areas denote the standard deviation of the runs (sometimes too small to be visible).
385
+
386
+ # E.1 MAXIMIZING THE GRADIENT NORM USING THE GRADIENT APPROXIMATION
387
+
388
+ In order to maximize the gradient norm after pruning, the authors in Wang et al. (2020) use the first order Taylor’s approximation. While this seems to be better suited than SNIP for higher levels of sparsity, it assumes that pruning is a small perturbation on the weight matrix. We argue that this approximation will not be valid as we push towards extreme sparsity values. Our gradient approximation (refer to section 4) can also be applied to maximize the gradient norm after pruning. In this case, we have
389
+
390
+ $$
391
+ G ( \pmb \theta , \pmb c ) : = \Delta \mathcal { L } ( \pmb \theta \odot \pmb c ) - \Delta \mathcal { L } ( \pmb \theta ) \approx \sum _ { \{ i : c _ { i } = 0 \} } - [ \nabla \mathcal { L } ( \pmb \theta ) _ { i } ] ^ { 2 } ,
392
+ $$
393
+
394
+ where we assume pruned connections have null gradients (this is equivalent to the restriction used for Iterative SNIP) and we assume gradients remain unchanged for unpruned weights (gradient approximation). Combining this approximation with Eq. (7), we obtain a new pruning method we name Iterative GRASP, although it is not the same as applying GRASP iteratively. Unlike FORCE, Iterative GRASP does not recover GRASP when $T = 1$ .
395
+
396
+ In Fig 12 we compare Iterative GRASP to other pruning methods. We use the same settings as described in section 5. We observe that Iterative GRASP outperforms GRASP in the high sparsity region. Moreover, for VGG19 architecture Iterative GRASP achieves comparable performance to Iterative SNIP. Nevertheless, for Resnet50 we see that Iterative GRASP performance falls below that of FORCE and Iterative SNIP as we prune more weights. FORCE saliency takes into account both the gradient and the magnitude of the weights when computing the saliency, on the other hand, the Gradient Norm only takes gradients into account, therefore it is using less information. We hypothesize this might the reason why Iterative GRASP does not match Iterative SNIP.
397
+
398
+ ![](images/58b86f033b68321529a3d68b84d47bed61f2262e27023b687a6ab029c7cb5868.jpg)
399
+ E.2 ITERATIVE GRASP (PRUNING CONSISTENCY)
400
+ Figure 13: (a) - (c) Portion of remaining weights for each layer. Each point is an average of 3 runs and the error bars (hardly visible) denote standard deviation. (b) - (d) Portion of remaining weights for each intermediate mask that is computed during iterative pruning with global portion of remaining weights of 0.01.
401
+
402
+ As explained in the main text, we tried to apply GRASP iteratively with the Taylor approximation described in Wang et al. (2020). Unfortunately, we found that all resulting masks yield networks unable to train. In light of this result, we performed some analysis of the behaviour of GRASP compared to that of SNIP and, in the following, we provide some insights as to why we can not use GRASP’s approximation iteratively.
403
+
404
+ In Liu et al. (2018), the authors show that applying a pruning method to the same architecture with different random initializations would yield consistent pruning masks. Specifically, they find that the percentage of pruned weights in each layer had very low variance. We reproduce the same experiment and additionally explore another dimension, the (global) sparsity level. Given an architecture, we prune it at varying levels of sparsity and extract the percentage of remaining weights at each layer. For each level of sparsity, we average the results over 3 trials of initialize-prune. As shown in Fig 2, both SNIP and GRASP have very low variance across initializations, on the other hand, as we vary the global sparsity with GRASP, the percentage of remaining weights for each layer is inconsistent. The layers that are most preserved at high levels of sparsity, such as the initial and last layers, are the most heavily pruned at low sparsity levels.
405
+
406
+ The authors in Liu et al. (2018), reason that manually designed networks have layers which are more redundant than others. Therefore, pruning methods even this redundancies by pruning layers with different percentages. We extend this reasoning, and hypothesize that pruning algorithms should always have preference for pruning the same (redundant) layers across all levels of sparsity. We denote this as pruning consistency. We observe that when applying iterative pruning to GRASP, the resulting masks tend to prune almost all of the weights at the initial and final layers, producing networks that are unable to converge. When using iterative pruning, we prune a small portion of remaining weights at each step. Thus, we are always in the low sparsity regime, where the GRASP behaviour is reversed. Conversely, when we use SNIP the behaviour changes completely. In this case, the preserved layers are consistent across sparsity levels, and when we use iterative pruning we obtain networks that reach high accuracy values.
md/train/9xPJ7cZ4ntc/9xPJ7cZ4ntc.md ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SNIPS: Solving Noisy Inverse Problems Stochastically
2
+
3
+ Bahjat Kawar, Gregory Vaksman, Michael Elad Computer Science Department, Technion, Haifa, Israel {bahjat.kawar, grishav, elad}@cs.technion.ac.il
4
+
5
+ # Abstract
6
+
7
+ In this work we introduce a novel stochastic algorithm dubbed SNIPS, which draws samples from the posterior distribution of any linear inverse problem, where the observation is assumed to be contaminated by additive white Gaussian noise. Our solution incorporates ideas from Langevin dynamics and Newton’s method, and exploits a pre-trained minimum mean squared error (MMSE) Gaussian denoiser. The proposed approach relies on an intricate derivation of the posterior score function that includes a singular value decomposition (SVD) of the degradation operator, in order to obtain a tractable iterative algorithm for the desired sampling. Due to its stochasticity, the algorithm can produce multiple high perceptual quality samples for the same noisy observation. We demonstrate the abilities of the proposed paradigm for image deblurring, super-resolution, and compressive sensing. We show that the samples produced are sharp, detailed and consistent with the given measurements, and their diversity exposes the inherent uncertainty in the inverse problem being solved.
8
+
9
+ # 1 Introduction
10
+
11
+ Many problems in the field of image processing can be cast as noisy linear inverse problems. This family of tasks includes denoising, inpainting, deblurring, super resolution, compressive sensing, and many other image recovery problems. A general linear inverse problem is posed as
12
+
13
+ $$
14
+ \mathbf { y } = \mathbf { H } \mathbf { x } + \mathbf { z } ,
15
+ $$
16
+
17
+ where we aim to recover a signal $\mathbf { x }$ from its measurement $\mathbf { y }$ , given through a linear degradation operator $\mathbf { H }$ and a contaminating noise, being additive, white and Gaussian, $\mathbf { \overline { { z } } } \sim \mathcal { N } \left( 0 , \sigma _ { 0 } ^ { 2 } \mathbf { \check { I } } \right)$ . In this work we assume that both $\mathbf { H }$ and $\sigma _ { 0 }$ are known.
18
+
19
+ Over the years, many strategies, algorithms and underlying statistical models were developed for handling image restoration problems. A key ingredient in many of the classic attempts is the prior that aims to regularize the inversion process and lead to visually pleasing results. Among the various options explored, we mention sparsity-inspired techniques [13, 55, 11], local Gaussian-mixture modeling [57, 63], and methods relying on non-local self-similarity [6, 9, 36, 51]. More recently, and with the emergence of deep learning techniques, a direct design of the recovery path from y to an estimate of $\mathbf { x }$ took the lead, yielding state-of-the-art results in various linear inverse problems, such as denoising [25, 59, 61, 52], deblurring [22, 48], super resolution [10, 17, 54] and other tasks [29, 28, 19, 16, 37, 58].
20
+
21
+ Despite the evident success of the above techniques, many image restoration algorithms still have a critical shortcoming: In cases of severe degradation, most recovery algorithms tend to produce washed out reconstructions that lack details. Indeed, most image restoration techniques seek a reconstruction that minimizes the mean squared error between the restored image, ˆx, and the unknown original one, x. When the degradation is acute and information is irreversibly lost, image reconstruction becomes a highly ill-posed problem, implying that many possible clean images could explain the given measurements. The MMSE solution averages all these candidate solutions, being the conditional mean of the posterior of $\mathbf { x }$ given y, leading to an image with loss of fine details in the majority of practical cases. A recent work reported in [5] has shown that reconstruction algorithms necessarily suffer from a perception-distortion tradeoff, i.e., targeting a minimization of the error between $\hat { \bf x }$ and $\mathbf { x }$ (in any metric) is necessarily accompanied by a compromised perceptual quality. As a consequence, as long as we stick to the tendency to design recovery algorithms that aim for minimum MSE (or other distances), only a limited perceptual improvement can be expected.
22
+
23
+ When perceptual quality becomes our prime objective, the strategy for solving inverse problems must necessarily change. More specifically, the solution should concentrate on producing a sample (or many of them) from the posterior distribution $p \left( \mathbf { x } | \mathbf { y } \right)$ instead of its conditional mean. Recently, two such approaches have been suggested – GAN-based and Langevin sampling. Generative Adversarial Networks (GANs) have shown impressive results in generating realistically looking images (e.g., [14, 35]). GANs can be utilized for solving inverse problems while producing high-quality images (see e.g. [2, 31, 34]). These solvers aim to produce a diverse set of output images that are consistent with the measurements, while also being aligned with the distribution of clean examples. A major disadvantage of GAN-based algorithms for inverse problems is their tendency (as practiced in [2, 31, 34]) to assume noiseless measurements, a condition seldom met in practice. An exception to this is the work reported in [33], which adapts a conditional GAN to become a stochastic denoiser.
24
+
25
+ The second approach for sampling from the posterior, and the one we shall be focusing on in this paper, is based on Langevin dynamics. This core iterative technique enables sampling from a given distribution by leveraging the availability of the score function – the gradient of the log of the probability density function [38, 3]. The work reported in [44, 20, 46] utilizes the annealed Langevin dynamics method, both for image synthesis and for solving noiseless inverse problems.1 Their synthesis algorithm relies on an MMSE Gaussian denoiser (given as a neural network) for approximating a gradually blurred score function. In their treatment of inverse problems, the conditional score remains tractable and manageable due to the noiseless measurements assumption.
26
+
27
+ The question addressed in this paper is the following: How can the above line of Langevin-based work be generalized for handling linear inverse problems, as in Equation 1, in which the measurements are noisy? A partial and limited answer to this question has already been given in [21] for the tasks of image denoising and inpainting. The present work generalizes these ([44, 20, 46, 21]) results, and introduces a systematic way for sampling from the posterior distribution of any given noisy linear inverse problem. As we carefully show, this extension is far from being trivial, due to two prime reasons: (i) The involvement of the degradation operator H, which poses a difficulty for establishing a relationship between the reconstructed image and the noisy observation; and (ii) The intricate connection between the measurements’ and the synthetic annealed Langevin noise. Our proposed remedy is a decorrelation of the measurements equation via a singular value decomposition (SVD) of the operator H, which decouples the dependencies between the measurements, enabling each to be addressed by an adapted iterative process. In addition, we define the annealing noise to be built as portions of the measurement noise itself, in a manner that facilitates a constructive derivation of the conditional score function.
28
+
29
+ Following earlier work [44, 20, 46, 21], our algorithm is initialized with a random noise image, gradually converging to the reconstructed result, while following the direction of the log-posterior gradient, estimated using an MMSE denoiser. Via a careful construction of the gradual annealing noise sequence, from very high values to low ones, the entries in the derived score switch mode. Those referring to non-zero singular values start by being purely dependent on the measurements, and then transition to incorporate prior information based on the denoiser. As for entries referring to zero singular values, their corresponding entries undergo a pure synthesis process based on the prior-only score function. Note that the denoiser blends values in the evolving sample, thus intermixing the influence of the gradient entries. Our derivations include an analytical expression for a positiondependent step size vector, drawing inspiration from Newton’s method in optimization. This stabilizes the algorithm and is shown to be essential for its success.
30
+
31
+ We refer hereafter to our algorithm as SNIPS (Solution of Noisy Inverse Problems Stochastically). Observe that as we target to sample from the posterior distribution $p \left( \mathbf { x } | \mathbf { y } \right)$ , different runs of SNIPS on the same input necessarily yield different results, all of which valid solutions to the given inverse problem. This should not come as a surprise, as ill-posedness implies that there are multiple viable solutions for the same data, as has already been suggested in the context of super resolution [31, 2, 34]. We demonstrate SNIPS on image deblurring, single image super resolution, and compressive sensing, all of which contain non-negligible noise, and emphasize the high perceptual quality of the results, their diversity, and their relation to the MMSE estimate.
32
+
33
+ ![](images/c82146786b5adb3c31fe1fe0e0cc72d1662774fbb84d513189a447eec3bd7cf3.jpg)
34
+ Figure 1: Deblurring results on CelebA [27] images (uniform $5 \times 5$ blur and an additive noise with $\sigma _ { 0 } = 0 . 1$ ). Here and in all other shown figures, the standard deviation image is scaled by 4 for better visual inspection.
35
+
36
+ To summarize, this paper’s contributions are threefold:
37
+
38
+ • We present an intricate derivation of the blurred posterior score function for general noisy inverse problems, where both the measurement and the target image contain delicately inter-connected additive white Gaussian noise. • We introduce a novel stochastic algorithm – SNIPS – that can sample from the posterior distribution of these problems. The algorithm relies on the availability of an MMSE denoiser. • We demonstrate impressive results of SNIPS on image deblurring, single image super resolution, and compressive sensing, all of which are highly noisy and ill-posed.
39
+
40
+ Before diving into the details of this work, we should mention that using Gaussian denoisers iteratively for handling general linear inverse problems has been already proposed in the context of the Plugand-Play-Prior $( \mathrm { P n P } )$ method [53] and RED [39], and their many followup papers (e.g., [60, 30, 1, 49, 7, 50, 40, 4]). However, both PnP and RED are quite different from our work, as they do not target sampling from the posterior, but rather focus on MAP or MMSE estimation.
41
+
42
+ # 2 Background
43
+
44
+ The Langevin dynamics algorithm [3, 38] suggests sampling from a probability distribution $p \left( \mathbf { x } \right)$ using the iterative transition rule
45
+
46
+ $$
47
+ { \bf x } _ { t + 1 } = { { \bf x } _ { t } } + \alpha \nabla _ { { \bf x } _ { t } } \log p \left( { { \bf x } _ { t } } \right) + \sqrt { 2 \alpha } { \bf z } _ { t } \mathrm { ~ , ~ }
48
+ $$
49
+
50
+ where $\mathbf { z } _ { t } \sim \mathcal { N } ( 0 , \mathbf { I } )$ and $\alpha$ is an appropriately chosen small constant. The added $\mathbf { z } _ { t }$ allows for stochastic sampling, avoiding a collapse to a maximum of the distribution. Initialized randomly, after a sufficiently large number of iterations, and under some mild conditions, this process converges to a sample from the desired distribution $p \left( \mathbf { x } \right)$ [38].
51
+
52
+ The work reported in [44] extends the aforementioned algorithm into annealed Langevin dynamics. The annealing proposed replaces the score function in Equation 2 with a blurred version of it, $\nabla _ { \tilde { \mathbf { x } } _ { t } } \log { p \left( \tilde { \mathbf { x } } _ { t } \right) }$ , where $\tilde { \mathbf { x } } _ { \mathbf { t } } = \mathbf { x } _ { t } + \mathbf { n }$ and $\mathbf { n } \sim { \mathcal { N } } \left( 0 , \sigma ^ { 2 } \mathbf { I } \right)$ is a synthetically injected noise. The core idea is to start with a very high noise level $\sigma$ and gradually drop it to near-zero, all while using a step size $\alpha$ dependent on the noise level. These changes allow the algorithm to converge much faster and perform better, because it widens the basin of attraction of the sampling process. The work in [20] further develops this line of work by leveraging a brilliant relation attributed to Miyasawa [32] (also known as Stein’s integration by parts trick [47] or Tweedie’s identity [12]). It is given as
53
+
54
+ $$
55
+ { \nabla } _ { \tilde { \mathbf { x } } _ { t } } \log p \left( \tilde { \mathbf { x } } _ { t } \right) = \frac { \mathbf { D } \left( \tilde { \mathbf { x } } _ { t } , \sigma \right) - \tilde { \mathbf { x } } _ { t } } { { \sigma } ^ { 2 } } ,
56
+ $$
57
+
58
+ where $\mathbf { D } \left( \tilde { \mathbf { x } } _ { t } , \sigma \right) = \mathbb { E } \left[ \mathbf { x } | \tilde { \mathbf { x } } _ { t } \right]$ is the minimizer of the MSE measure $\mathbb { E } \left[ \lVert \mathbf { x } - \mathbf { D } \left( \tilde { \mathbf { x } } _ { t } , \sigma \right) \rVert _ { 2 } ^ { 2 } \right]$ , which can be approximated using a denoising neural network. This facilitates the use of denoisers in Langevin dynamics as a replacement for the evasive score function.
59
+
60
+ When turning to solve inverse problems, previous work suggests sampling from the posterior distribution $p \left( \mathbf { x } | \mathbf { y } \right)$ using annealed Langevin dynamics [20, 46, 21] or similar methods [15, 18, 42, 26], by replacing the score function used in the generation algorithm with a conditional one. As it turns out, if limiting assumptions can be posed on the measurements formation, the conditional score is tractable, and thus generalization of the annealed Langevin process to these problems is within reach. Indeed, in [44, 20, 46, 42, 26] the core assumption is $\mathbf { y } = \mathbf { H } \mathbf { x }$ for specific and simplified choices of $\mathbf { H }$ and with no noise in the measurements. The works in [15, 23] avoid these difficulties altogether by returning to the original (non-annealed) Langevin method, with the unavoidable cost of becoming extremely slow. In addition, their algorithms are demonstrated on inverse problems in which the additive noise is restricted to be very weak. The work in [21] is broader, allowing for an arbitrary additive white Gaussian noise, but limits $\mathbf { H }$ to the problems of denoising or inpainting. While all these works demonstrate high quality results, there is currently no clear way for deriving the blurred score function of a general linear inverse problem as posed in Equation 1. In the following, we present such a derivation.
61
+
62
+ # 3 The Proposed Approach: Deriving the Conditional Score Function
63
+
64
+ # 3.1 Problem Setting
65
+
66
+ We consider the problem of recovering a signal $\mathbf { x } \in \mathbb { R } ^ { N }$ (where $\mathbf { x } \sim p \left( \mathbf { x } \right)$ and $p \left( \mathbf { x } \right)$ is unknown) from the observation $\mathbf { y } = \mathbf { H } \mathbf { x } + \mathbf { z }$ , where $\mathbf { y } \in \mathbb { R } ^ { M } , \mathbf { H } \in \mathbb { R } ^ { M \times N } , M \leq N , \mathbf { z } \sim \mathcal { N } \left( 0 , \sigma _ { 0 } ^ { 2 } \mathbf { I } \right)$ , and $\mathbf { H }$ and $\sigma _ { 0 }$ are known.2 Our ultimate goal is to sample from the posterior $p \left( \mathbf { x } | \mathbf { y } \right)$ . However, since access to the score function $\nabla _ { \mathbf { x } } \log p ( \mathbf { x } | \mathbf { y } )$ is not available, we retarget our goal, as explained above, to sampling from blurred posterior distributions, $p \left( \tilde { \mathbf { x } } | \mathbf { y } \right)$ , where $\tilde { \mathbf { x } } = \mathbf { x } + \mathbf { n }$ and $\mathbf { n } \sim { \mathcal { N } } \left( 0 , \sigma ^ { 2 } \mathbf { I } \right)$ , with noise levels $\sigma$ starting very high, and decreasing towards near-zero.
67
+
68
+ As explained in the supplemental material, the sampling should be performed in the SVD domain in order to get a tractable derivation of the blurred score function. Thus, we consider the singular value decomposition (SVD) of $\mathbf { H }$ , given as $\mathbf { H } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { T }$ , where $\mathbf { U } \in \mathbb { R } ^ { M \times M }$ and $\mathbf { V } \in \mathbb { R } ^ { N \times N }$ are orthogonal matrices, and $\pmb { \Sigma } \in \mathbb { R } ^ { M \times N }$ is a rectangular diagonal matrix containing the singular values of H, denoted as {sj}Mj=1 i n descending order $\quad : s _ { 1 } > s _ { 2 } > \dots > s _ { M - 1 } > s _ { M } \geq 0 \quad$ ). For convenience of notations, we also define $s _ { j } = 0$ for $j = M + 1 , \dotsc , N$ . To that end, we notice that
69
+
70
+ $$
71
+ p \left( \tilde { \mathbf { x } } | \mathbf { y } \right) = p \left( \tilde { \mathbf { x } } | \mathbf { U } ^ { T } \mathbf { y } \right) = p \left( \mathbf { V } ^ { T } \tilde { \mathbf { x } } | \mathbf { U } ^ { T } \mathbf { y } \right) .
72
+ $$
73
+
74
+ The first equality holds because the multiplication of $\mathbf { y }$ by the orthogonal matrix $\mathbf { U } ^ { T }$ does not add or remove information, and the second equality holds because the multiplication of $\tilde { \bf x }$ by $\mathbf { V } ^ { T }$ does not change its probability [24]. Therefore, sampling from $p \left( \mathbf { V } ^ { T } \tilde { \mathbf { x } } | \mathbf { U } ^ { T } \mathbf { y } \right)$ and then multiplying the result by $\mathbf { V }$ will produce the desired sample from $p \left( \mathbf { \tilde { x } } | \mathbf { y } \right)$ . As we are using Langevin dynamics, we need to calculate the conditional score function $\nabla _ { \mathbf { V } ^ { T } \widetilde { \mathbf { x } } } \log p \left( \mathbf { V } ^ { T } \widetilde { \mathbf { x } } | \mathbf { U } ^ { T } \mathbf { y } \right)$ . For simplicity, we denote hereafter ${ \bf y } _ { T } = { \bf U } ^ { T } { \bf y } , { \bf z } _ { T } = { \bf U } ^ { T } { \bf z } , { \bf x } _ { T } = { \bf V } ^ { T } { \bf x } , { \bf n } _ { T } = \Sigma { \bf V } ^ { T } { \bf n }$ , and $\tilde { \mathbf { x } } _ { T } = \mathbf { V } ^ { T } \tilde { \mathbf { x } }$ . Observe that with these notations, the measurements equation becomes
75
+
76
+ $$
77
+ \mathbf { y } = \mathbf { H } \mathbf { x } + \mathbf { z } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { T } \mathbf { x } + \mathbf { z } ,
78
+ $$
79
+
80
+ and thus
81
+
82
+ $$
83
+ \mathbf { U } ^ { T } \mathbf { y } = \Sigma \mathbf { V } ^ { T } \mathbf { x } + \mathbf { U } ^ { T } \mathbf { z } = \Sigma \mathbf { V } ^ { T } ( \tilde { \mathbf { x } } - \mathbf { n } ) + \mathbf { U } ^ { T } \mathbf { z } = \Sigma \mathbf { V } ^ { T } \tilde { \mathbf { x } } - \Sigma \mathbf { V } ^ { T } \mathbf { n } + \mathbf { U } ^ { T } \mathbf { z } ,
84
+ $$
85
+
86
+ where we have relied on the relation $\tilde { \mathbf { x } } = \mathbf { x } + \mathbf { n }$ . This leads to
87
+
88
+ $$
89
+ { \bf y } _ { T } = \pmb { \Sigma } \tilde { \bf x } _ { T } - { \bf n } _ { T } + { \bf z } _ { T } .
90
+ $$
91
+
92
+ In this formulation, which will aid in deriving the conditional score, our aim is to make design choices on ${ \bf n } _ { T }$ such that ${ \bf z } _ { T } - { \bf n } _ { T }$ has uncorrelated entries and is independent of $\tilde { \bf x } _ { T }$ . This brings us to the formation of the synthetic annealed noise, which is an intricate ingredient in our derivations.
93
+
94
+ We base this formation on the definition of a sequence of noise levels $\{ \sigma _ { i } \} _ { i = 1 } ^ { L + 1 }$ such that $\sigma _ { 1 } > \sigma _ { 2 } > \cdot \cdot \cdot > \sigma _ { L } > \sigma _ { L + 1 } = 0$ , where $\sigma _ { 1 }$ is high (possibly $\sigma _ { 1 } > \| \mathbf { x } \| _ { \infty } )$ and $\sigma _ { L }$ is close to zero. We require that for every $j$ such that $s _ { j } \neq 0$ , there exists $i _ { j }$ such that $\sigma _ { i _ { j } } s _ { j } < \sigma _ { 0 }$ and $\sigma _ { i _ { j } - 1 } s _ { j } > \sigma _ { 0 }$ . This implies $\forall i : \sigma _ { i } s _ { j } \neq \sigma _ { 0 }$ , which helps ease notations. SNIPS works just as well for $\sigma _ { i } s _ { j } = \sigma _ { 0 }$ .
95
+
96
+ Using $\{ \sigma _ { i } \} _ { i = 1 } ^ { L + 1 }$ , we would like to define $\left\{ \tilde { \mathbf { x } } _ { i } \right\} _ { i = 1 } ^ { L + 1 }$ , a sequence of noisy versions of $\mathbf { x }$ , where the noise level in $\tilde { \mathbf { x } } _ { i }$ is $\sigma _ { i }$ . One might be tempted to define these noise additions as independent of the measurement noise $\mathbf { z }$ . However, this option leads to a conditional score term that cannot be calculated analytically, as explained in the supplemental material. Therefore, we define these noise additions differently, as carved from $\mathbf { z }$ in a gradual fashion. To that end, we define $\tilde { \mathbf { x } } _ { L + 1 } = \mathbf { x }$ , and for every $i = L , L - 1 , \ldots , 1 \colon \tilde { \mathbf { x } } _ { i } = \tilde { \mathbf { x } } _ { i + 1 } + \pmb { \eta } _ { i }$ , where $\pmb { \eta } _ { i } \sim \mathcal { N } \left( 0 , \left( \sigma _ { i } ^ { 2 } - \sigma _ { i + 1 } ^ { 2 } \right) \mathbf { I } \right)$ . This results in $\tilde { \mathbf { x } } _ { i } = \mathbf { x } + \mathbf { n } _ { i }$ , where $\begin{array} { r } { \mathbf { n } _ { i } = \sum _ { k = i } ^ { L } \pmb { \eta } _ { k } \sim \mathcal { N } \left( 0 , \sigma _ { i } ^ { 2 } \mathbf { I } \right) } \end{array}$ .
97
+
98
+ And now we turn to define the statistical dependencies between the measurements’ noise $\mathbf { z }$ and the artificial noise vectors $\eta _ { i }$ . Since $\eta _ { i }$ and $\mathbf { z }$ are each Gaussian with uncorrelated entries, so are the components of the vectors $\pmb { \Sigma } \mathbf { V } ^ { T } \pmb { \eta } _ { i }$ , $\pmb { \Sigma } \mathbf { V } ^ { T } \mathbf { n } _ { i }$ , and $\mathbf { z } _ { T }$ . In order to proceed while easing notations, let us focus on a single entry $j$ in these three vectors, for which $s _ { j } > 0$ , and omit this index. We denote these entries as $\eta _ { T , i } , n _ { T , i }$ and $z _ { T }$ , respectively. We construct $\eta _ { T , i }$ such that
99
+
100
+ $$
101
+ \mathbb { E } \left[ \eta _ { T , i } \cdot z _ { T } \right] = \left\{ \begin{array} { l l } { \mathbb { E } \left[ \eta _ { T , i } ^ { 2 } \right] } & { \mathrm { f o r } i \geq i _ { j } } \\ { \mathbb { E } \left[ \left( z _ { T } - n _ { T , i _ { j } } \right) ^ { 2 } \right] } & { \mathrm { f o r } i = i _ { j } - 1 } \\ { 0 } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
102
+ $$
103
+
104
+ This implies that the layers of noise $\eta _ { T , L + 1 } , \dots , \eta _ { T , i _ { j } }$ are all portions of $z _ { T }$ itself, with an additional portion being contained in $\eta _ { T , i _ { j } - 1 }$ . Afterwards, $\eta _ { T , i }$ become independent of $z _ { T }$ . In the case of $s _ { j } ~ = ~ 0$ , the above relations simplify to be $E [ \eta _ { T , i } \cdot z _ { T } ] = 0$ for all $i$ , implying no statistical dependency between the given and the synthetic noises. Consequently, it can be shown that the overall noise in Equation 5 satisfies
105
+
106
+ $$
107
+ \left( \Sigma \mathbf { V } ^ { T } \mathbf { n } _ { i } - \mathbf { z } _ { \mathbf { T } } \right) _ { j } = n _ { T , i } - z _ { T } \sim \left\{ \begin{array} { l l } { \mathcal { N } \left( 0 , s _ { j } ^ { 2 } \sigma _ { i } ^ { 2 } - \sigma _ { 0 } ^ { 2 } \right) } & { \mathrm { i f ~ } \sigma _ { i } s _ { j } > \sigma _ { 0 } } \\ { \mathcal { N } \left( 0 , \sigma _ { 0 } ^ { 2 } - s _ { j } ^ { 2 } \sigma _ { i } ^ { 2 } \right) } & { \mathrm { o t h e r w i s e . } } \end{array} \right.
108
+ $$
109
+
110
+ The top option refers to high values of the annealed Langevin noise, in which, despite the possible decay caused by the singular value $s _ { j }$ , this noise is stronger than $z _ { T }$ . In this case, $n _ { T , i }$ contains all $z _ { T }$ and an additional independent portion of noise. The bottom part assumes that the annealed noise (with the influence of $s _ { j }$ ) is weaker than the measurements’ noise, and then it is fully immersed within $z _ { T }$ , with the difference being Gaussian and independent.
111
+
112
+ # 3.2 Derivation of the Conditional Score Function
113
+
114
+ The above derivations show that the noise in Equation 5 is zero-mean, Gaussian with uncorrelated entries and of known variance, and this noise is independent of $\widetilde { \mathbf { x } } _ { i }$ . Thus Equation 5 can be used conveniently for deriving the measurements part of the conditional score function. We denote $\tilde { \mathbf { x } } _ { T } = \mathbf { V } ^ { T } \tilde { \mathbf { x } } _ { i }$ , $\widetilde { \mathbf { x } } = \widetilde { \mathbf { x } } _ { i }$ , $\mathbf { n } = \mathbf { n } _ { i }$ for simplicity, and turn to calculate $\nabla _ { \tilde { \mathbf { x } } _ { T } } \log p \left( \tilde { \mathbf { x } } _ { T } | \mathbf { y } _ { T } \right)$ . We split $\tilde { \mathbf { x } } _ { T }$ into three parts: (i) $\tilde { \mathbf { x } } _ { T , 0 }$ refers to the entries $j$ for which $s _ { j } = 0$ ; (ii) $\tilde { \mathbf { x } } _ { T , < }$ corresponds to the entries $j$ for which $0 < \sigma _ { i } s _ { j } < \sigma _ { 0 }$ ; and (iii) $\tilde { \mathbf { x } } _ { T , > }$ includes the entries $j$ for which $\sigma _ { i } s _ { j } ~ > ~ \sigma _ { 0 }$ . Observe that this partition of the entries of $\tilde { \bf x } _ { T }$ is non-overlapping and fully covering. Similarly, we partition every vector $\mathbf { v } \in \mathbb { R } ^ { N }$ into $\mathbf { v } _ { 0 } , \mathbf { v } _ { < } , \mathbf { v } _ { > }$ , which are the entries of $\mathbf { v }$ corresponding to $\tilde { \bf x } _ { T , 0 } , \tilde { \bf x } _ { T , < } , \tilde { \bf x } _ { T , > }$ , respectively. Furthermore, we define $\mathbf { v } _ { \boldsymbol { \phi } } , \mathbf { v } _ { \mathcal { A } } , \mathbf { v } _ { \mathcal { P } }$ as all the entries of $\mathbf { v }$ except $\mathbf { v } _ { 0 } , \mathbf { v } _ { < } , \mathbf { v } _ { > }$ , respectively. With these definitions in place, the complete derivation of the score function is detailed in the supplemental material, and here we bring the final outcome. For $\tilde { \mathbf { x } } _ { T , 0 }$ , the score is independent of the measurements and given by
115
+
116
+ $$
117
+ \nabla _ { \tilde { \mathbf { x } } _ { T , 0 } } \log p \left( \tilde { \mathbf { x } } _ { T } | \mathbf { y } _ { T } \right) = \left( \mathbf { V } ^ { T } \nabla _ { \tilde { \mathbf { x } } } \log p \left( \tilde { \mathbf { x } } \right) \right) _ { 0 } .
118
+ $$
119
+
120
+ For the case of $\tilde { \mathbf { x } } _ { T , > }$ , the expression obtained is only measurements-dependent,
121
+
122
+ $$
123
+ \nabla _ { \tilde { \mathbf { x } } _ { T , > } } \log p \left( \tilde { \mathbf { x } } _ { T } | \mathbf { y } _ { T } \right) = \left( \Sigma ^ { T } \left( \sigma _ { i } ^ { 2 } \Sigma \Sigma ^ { T } - \sigma _ { 0 } ^ { 2 } \mathbf { I } \right) ^ { \dagger } \left( \mathbf { y } _ { T } - \Sigma \tilde { \mathbf { x } } _ { T } \right) \right) _ { > } .
124
+ $$
125
+
126
+ ![](images/1bf7bf0fdb7b5ddbb342e405094746e2ae58288ea8fabffd3390f4076c6e4553.jpg)
127
+ Figure 2: Super resolution results on LSUN bedroom [56] images (downscaling $4 : 1$ by plain averaging and adding noise with $\sigma _ { 0 } = 0 . 0 4 \mathrm { , }$ ).
128
+
129
+ Lastly, for the case of $\tilde { \mathbf { x } } _ { T , < }$ , the conditional score includes two terms – one referring to the plain (blurred) score, and the other depending on the measurements,
130
+
131
+ $$
132
+ \nabla _ { \mathbf { \tilde { x } } _ { T , < } } \log p \left( \mathbf { \tilde { x } } _ { T } | \mathbf { y } _ { T } \right) = \left( \Sigma ^ { T } \left( \sigma _ { 0 } ^ { 2 } \mathbf { I } - \sigma _ { i } ^ { 2 } \Sigma \Sigma ^ { T } \right) ^ { \dagger } \left( \mathbf { y } _ { T } - \Sigma \mathbf { \tilde { x } } _ { T } \right) \right) _ { < } + \left( \mathbf { V } ^ { T } \nabla _ { \mathbf { \tilde { x } } } \log p \left( \mathbf { \tilde { x } } \right) \right) _ { < } .
133
+ $$
134
+
135
+ As already mentioned, the full derivations of equations 7, 8, and 9 are detailed in the supplemental material. Aggregating all these results together, we obtain the following conditional score function:
136
+
137
+ $$
138
+ \begin{array} { r } { \nabla _ { \tilde { \mathbf { x } } _ { T } } \log p \left( \tilde { \mathbf { x } } _ { T } | \mathbf { y } _ { T } \right) = \Sigma ^ { T } \left| \sigma _ { 0 } ^ { 2 } \mathbf { I } - \sigma _ { i } ^ { 2 } \Sigma \Sigma ^ { T } \right| ^ { \frac { 1 } { \rho } } \left( \mathbf { y } _ { T } - \Sigma \tilde { \mathbf { x } } _ { T } \right) + \left. \left( \mathbf { V } ^ { T } \nabla _ { \tilde { \mathbf { x } } } \log p \left( \tilde { \mathbf { x } } \right) \right) \right| _ { \mathcal { X } } , } \end{array}
139
+ $$
140
+
141
+ where $( \mathbf { v } ) | _ { \ngtr }$ is the vector $\mathbf { v }$ , but with zeros in its entries that correspond to $\mathbf { v } _ { > }$ . Observe that the first term in Equation 10 contains zeros in the entries corresponding to $\tilde { \mathbf { x } } _ { T , 0 }$ , matching the above calculations. The vector $\nabla _ { \tilde { \mathbf { x } } } \log p \left( \tilde { \mathbf { x } } \right)$ can be estimated using a neural network as in [44], or using a pre-trained MMSE denoiser as in [20, 21]. All the other elements of this vector are given or can be easily obtained from $\mathbf { H }$ by calculating its SVD decomposition once at the beginning.
142
+
143
+ # 4 The Proposed Algorithm
144
+
145
+ Armed with the conditional score function in Equation 10, the Langevin dynamics algorithm can be run with a constant step size or an annealed step size as in [44], and this should converge to a sample from $p \left( \tilde { \mathbf { x } } _ { T } | \mathbf { y } _ { T } \right)$ . However, for this to perform well, one should use a very small step size, implying a devastatingly slow convergence behavior. This is mainly due to the fact that different entries of $\tilde { \bf x } _ { T }$ advance at different speeds, in accord with their corresponding singular values. As the added noise in each step has the same variance in every entry, this leads to an unbalanced signal-to-noise ratio, which considerably slows down the algorithm.
146
+
147
+ In order to mitigate this problem, we suggest using a step size vector ${ \pmb { \alpha } } _ { i } \in \mathbb { R } ^ { N }$ . We denote $\mathbf { A } _ { i } = d i a g \left( \pmb { \alpha } _ { i } \right)$ , and obtain the following update formula for a Langevin dynamics algorithm:
148
+
149
+ $$
150
+ \mathbf { V } ^ { T } \tilde { \mathbf { x } } _ { i } = \mathbf { V } ^ { T } \tilde { \mathbf { x } } _ { i - 1 } + c \cdot \mathbf { A } _ { i } \cdot \nabla \mathbf { v } ^ { T } \tilde { \mathbf { x } } _ { i } \log p \left( \mathbf { V } ^ { T } \tilde { \mathbf { x } } _ { i } | \mathbf { y } _ { T } \right) + \sqrt { 2 \cdot c } \mathbf { A } _ { i } ^ { \frac { 1 } { 2 } } \cdot \mathbf { z } _ { i } ,
151
+ $$
152
+
153
+ where the conditional score function is estimated as described in subsection 3.2, and $c$ is some constant. For the choice of the step sizes in the diagonal of $\mathbf { A } _ { i }$ , we draw inspiration from Newton’s method in optimization, which is designed to speed up convergence to local maximum points. The update formula in Newton’s method is the same as Equation 11, but without the additional noise $\mathbf { z } _ { i }$ , and with $\mathbf { A } _ { i }$ being the negative inverse Hessian of $\log p \left( \mathbf { V } ^ { T } \tilde { \mathbf { x } } _ { i } | \mathbf { y } _ { T } \right)$ . We calculate a diagonal approximation of the Hessian, and set $\mathbf { A } _ { i }$ to be its negative inverse. We also estimate the conditional score function using Equation 10 and a neural network. Note that this mixture of Langevin dynamics and Newton’s method has been suggested in a slightly different context in [43], where the Hessian was approximated using a Quasi-Newton method. In our case, we analytically calculate a diagonal approximation of the negative inverse Hessian and obtain the following:
154
+
155
+ $$
156
+ \left( \alpha _ { i } \right) _ { j } = \left\{ \begin{array} { l l } { \sigma _ { i } ^ { 2 } , } & { s _ { j } = 0 } \\ { \sigma _ { i } ^ { 2 } - \frac { \sigma _ { 0 } ^ { 2 } } { s _ { j } ^ { 2 } } , } & { \sigma _ { i } s _ { j } > \sigma _ { 0 } } \\ { \sigma _ { i } ^ { 2 } \cdot \left( 1 - s _ { j } ^ { 2 } \frac { \sigma _ { i } ^ { 2 } } { \sigma _ { 0 } ^ { 2 } } \right) , } & { 0 < \sigma _ { i } s _ { j } < \sigma _ { 0 } . } \end{array} \right.
157
+ $$
158
+
159
+ ![](images/f76bb7d49bb33b3a68815799a29373ea7f403eba8070bce309f48629298e43e9.jpg)
160
+ Figure 3: Compressive sensing results on a CelebA [27] image with an additive noise of $\sigma _ { 0 } = 0 . 1$
161
+
162
+ The full derivations for each of the three cases are detailed in the supplemental material. Using these step sizes, the update formula in Equation 11, the conditional score function in Equation 10, and a neural network s $( \tilde { \mathbf { x } } , \sigma )$ that estimates the score function $\nabla _ { \tilde { \mathbf { x } } } \log p \left( \tilde { \mathbf { x } } \right)$ ,3 we obtain a tractable iterative algorithm for sampling from $p \left( \tilde { \mathbf { x } } _ { L } \mid \mathbf { y } \right)$ , where the noise in $ { \widetilde { \mathbf { x } } } _ { L }$ is sufficiently negligible to be considered as a sampling from the ideal image manifold.
163
+
164
+ # Algorithm 1: SNIPS
165
+
166
+ Input: $\left\{ \sigma _ { i } \right\} _ { i = 1 } ^ { L } , c , \tau , \mathbf { y } , \mathbf { H } , \sigma _ { 0 }$
167
+ $\mathbf { 1 } \ \mathbf { U } , \Sigma , \mathbf { V } s { \bar { v } } d ( \mathbf { H } )$
168
+ 2 Initialize $\mathbf { x _ { 0 } }$ with random noise $U \left[ 0 , 1 \right]$
169
+ 3 for $i \gets 1$ to $L$ do
170
+ 4 $( \mathbf { A } _ { i } ) _ { 0 } \sigma _ { i } ^ { 2 } \mathbf { I }$
171
+ 5 ( A i ) < ← σ 2i ·  I − σ 2iσ 2 Σ < Σ < T 
172
+ 6 $( \mathbf { A } _ { i } ) _ { > } \sigma _ { i } ^ { 2 } \mathbf { I } - \sigma _ { 0 } ^ { 2 } \mathbf { \Sigma } \mathbf { \Sigma } _ { > } ^ { \dagger } \mathbf { \Sigma } \mathbf { \Sigma } \mathbf { \Sigma } _ { > } ^ { \dagger ^ { T } }$
173
+ 7 for t ← 1 to τ do
174
+ 8 Draw $\mathbf { z } _ { t } \sim \mathcal { N } \left( 0 , \mathbf { I } \right)$
175
+ 9 $\begin{array} { r l } & { \mathbf { d } _ { t } \xleftarrow \Sigma ^ { T } \cdot \left| \sigma _ { 0 } ^ { 2 } \mathbf { I } - \sigma _ { i } ^ { 2 } \Sigma \Sigma ^ { T } \right| ^ { \dagger } \cdot \left( \mathbf { U } ^ { T } \mathbf { y } - \Sigma \mathbf { V } ^ { T } \mathbf { x } _ { t - 1 } \right) + \left( \mathbf { V } ^ { T } \cdot \mathbf { s } \left( \mathbf { x } _ { t - 1 } , \sigma _ { i } \right) \right) \big | _ { \ng } } \\ & { \mathbf { x } _ { t } \xleftarrow \mathbf { V } \cdot \left( \mathbf { V } ^ { T } \mathbf { x } _ { t - 1 } + c \mathbf { A } _ { i } \mathbf { d } _ { t } + \sqrt { 2 c } \mathbf { A } _ { i } ^ { \frac { 1 } { 2 } } \mathbf { z } _ { t } \right) } \end{array}$
176
+ 10
177
+ 11 end
178
+ 12 $\mathbf { x } _ { 0 } \mathbf { x } _ { \tau }$
179
+ 13 end
180
+
181
+ Note that when we set $\mathbf { H } = \mathbf { \Omega } 0$ and $\sigma _ { 0 } = 0$ , implying no measurements, the above algorithm degenerates to an image synthesis, exactly as in [44]. Two other special cases of this algorithm are obtained for $\mathbf { H } = \mathbf { I }$ or $\mathbf { H } = \mathbf { I }$ with some rows removed, the first referring to denoising and the second to noisy inpainting, both cases shown in [21]. Lastly, for the choices of $\mathbf { H }$ as in [20] or [44, 46] and with $\sigma _ { 0 } = 0$ , the above algorithm collapses to a close variant of their proposed iterative methods.
182
+
183
+ # 5 Experimental Results
184
+
185
+ In our experiments we use the NCSNv2 [45] network in order to estimate the score function of the prior distribution. Three different NCSNv2 models are used, each trained separately on the training sets of: (i) images of size $6 4 \times 6 4$ pixels from the CelebA dataset [27]; (ii) images of size $1 2 8 \times 1 2 8$ pixels from LSUN [56] bedrooms dataset; and (iii) LSUN $1 2 8 \times 1 2 8$ images of towers. We demonstrate SNIPS’ capabilities on the respective test sets for image deblurring, super resolution, and compressive sensing. In each of the experiments, we run our algorithm 8 times, producing 8 samples for each input. We examine both the samples themselves and their mean, which serves as an approximation of the MMSE solution, $\mathbb { E } \left[ \mathbf { x } | \mathbf { y } \right]$ .
186
+
187
+ ![](images/0fe681d53940c46fc3dcbf035756174ac25fbeaf06344ec3bce31a956ddec79b.jpg)
188
+ Figure 4: Super resolution results on CelebA [27] images (downscaling $4 : 1$ by plain averaging and adding noise with $\sigma _ { 0 } = 0 . 1$ ).
189
+
190
+ ![](images/6f296f6b2a2fc1162ce50cccb9a0e568e4e043a1cf1bb3e7155c6118f8d3aa75.jpg)
191
+ Figure 5: Super resolution results on CelebA [27] images (downscaling $2 : 1$ by plain averaging and adding noise with $\sigma _ { 0 } = 0 . 1$ ).
192
+
193
+ For image deblurring, we use a uniform $5 \times 5$ blur kernel, and an additive white Gaussian noise with $\sigma _ { 0 } = 0 . 1$ (referring to pixel values in the range $[ 0 , 1 ] \rangle$ ). Figure 1 demonstrates the obtained results for several images taken from the CelebA dataset. As can be seen, SNIPS produces visually pleasing, diverse samples.
194
+
195
+ For super resolution, the images are downscaled using a block averaging filter, i.e., each nonoverlapping block of pixels in the original image is averaged into one pixel in the low-resolution image. We use blocks of size $2 \times 2$ or $4 \times 4$ pixels, and assume the low-resolution image to include an additive white Gaussian noise. We showcase results on LSUN and CelebA in Figures 2, 4, and 5.
196
+
197
+ For compressive sensing, we use three random projection matrices with singular values of 1, that compress the image by $2 5 \%$ , $1 2 . 5 \%$ , and $6 . 2 5 \%$ . As can be seen in Figure 3 and as expected, the more aggressive the compression, the more significant are the variations in reconstruction.
198
+
199
+ We calculate the average PSNR (peak signal-to-noise ratio) of each of the 8 samples in our experiments, as well as the PSNR of their mean, as shown in Table 1. In all the experiments, the empirical conditional mean presents an improvement of around $2 . 4 \ : \mathrm { d B }$ in PSNR, even though it is less visually appealing compared to the samples. This is consistent with the theory in [5], which states that the difference in PSNR between posterior samples and the conditional mean (the MMSE estimator) should be $3 \mathrm { d B }$ , with the MMSE estimator having poorer perceptual quality but better PSNR.
200
+
201
+ A comparison of our deblurring results to those obtained by RED [39] is detailed in the supplemental material. We show that SNIPS exhibits superior performance over RED, achieving more than $1 1 \%$ improvement in PSNR and more than $5 8 \%$ improvement in LPIPS [62], a perceptual quality metric.
202
+
203
+ # 5.1 Assessing Faithfulness to the Measurements
204
+
205
+ A valid solution to an inverse problem should satisfy two conditions: (i) It should be visually pleasing, consistent with the underlying prior distribution of images, and (ii) It should be faithful to the given measurement, maintaining the relationship as given in the problem setting. Since the prior distribution is unknown, we assess the first condition by visually observing the obtained solutions and their tendency to look realistic. As for the second condition, we perform the following computation: We degrade the obtained reconstruction $\hat { \bf x }$ by $\mathbf { H }$ , and calculate its difference from the given measurement $\mathbf { y }$ , obtaining $\mathbf { y } - \mathbf { H } \hat { \mathbf { x } }$ . According to the problem setting, this difference should be an additive white Gaussian noise vector with a standard deviation of $\sigma _ { 0 }$ . We examine this difference by calculating its empirical standard deviation, and performing the Pearson-D’Agostino [8] test of normality on it, accepting it as a Gaussian vector if the obtained p-value is greater than 0.05. We also calculate the Pearson correlation coefficient (denoted as $\rho$ ) among neighboring entries, accepting them as uncorrelated for coefficients smaller than 0.1 in absolute value. In all of our tests, the standard deviation matches $\sigma _ { 0 }$ almost exactly, the Pearson correlation coefficient satisfies $| \rho | < 0 . 1$ , and we obtain p-values greater than 0.05 in around $9 5 \%$ of the samples (across all experiments). These results empirically show that our algorithm produces valid solutions to the given inverse problems.
206
+
207
+ Table 1: PSNR results for different inverse problems on 8 images from CelebA [27]. We ran SNIPS 8 times, and obtained 8 samples. The average PSNR for each of the samples is in the first column, while the average PSNR for the mean of the 8 samples for each image is in the second one.
208
+
209
+ <table><tr><td>Problem</td><td>Sample PSNR</td><td>Mean PSNR</td></tr><tr><td>Uniform deblurring</td><td>25.54</td><td>28.01</td></tr><tr><td>Super resolution (by 2)</td><td>25.58</td><td>28.03</td></tr><tr><td>Super resolution (by 4)</td><td>21.90</td><td>24.31</td></tr><tr><td>Compressive sensing (by 25%)</td><td>25.68</td><td>28.06</td></tr><tr><td>Compressive sensing (by 12.5%)</td><td>22.34</td><td>24.67</td></tr></table>
210
+
211
+ ![](images/31b80bec3255fef5b0e8eb8f928b222f9c9b72045dbebf8254989ebe23acad3b.jpg)
212
+ Figure 6: Compressive sensing results on LSUN [56] tower images (compression by $2 5 \%$ and adding noise with $\sigma _ { 0 } = 0 . 0 4 )$ .
213
+
214
+ # 6 Conclusion and Future Work
215
+
216
+ SNIPS, presented in this paper, is a novel stochastic algorithm for solving general noisy linear inverse problems. This method is based on annealed Langevin dynamics and Newton’s method, and relies on the availability of a pre-trained Gaussian MMSE denoiser. SNIPS produces a random variety of high quality samples from the posterior distribution of the unknown given the measurements, while guaranteeing their validity with respect to the given data. This algorithm’s derivation includes an intricate choice of the injected annealed noise in the Langevin update equations, and an SVD decomposition of the degradation operator for decoupling the measurements’ dependencies. We demonstrate SNIPS’ success on image deblurring, super resolution, and compressive sensing.
217
+
218
+ Extensions of this work should focus on SNIPS’ limitations: (i) The need to deploy SVD decomposition of the degradation matrix requires a considerable amount of memory and computations, and hinders the algorithm’s scalability; (ii) The current version of SNIPS does not handle general content images, a fact that is related to the properties of the denoiser being used [41]; and (iii) SNIPS, as any other Langevin based method, requires (too) many iterations (e.g., in our super-resolution tests on CelebA, 2 minutes are required for producing 8 sample images), and means for its acceleration should be explored.
219
+
220
+ # 7 Funding Transparency Statement
221
+
222
+ This research was partially supported by the Israel Science Foundation (ISF) under Grant 335/18 and the Technion Hiroshi Fujiwara Cyber Security Research Center and the Israel Cyber Bureau. Bahjat Kawar’s scholarship was partially provided by Li Ka Shing Fellowships and the Planning and Budgeting Committee of the Israel Council for Higher Education.
223
+
224
+ # References
225
+
226
+ [1] S. Arridge, P. Maass, O. Öktem, and C.-B. Schönlieb. Solving inverse problems using datadriven models. Acta Numerica, 28:1–174, 2019.
227
+ [2] Y. Bahat and T. Michaeli. Explorable super resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2716–2725, 2020.
228
+ [3] J. Besag. Markov Chain Monte Carlo for statistical inference. Center for Statistics and the Social Sciences, 9:24–25, 2001.
229
+ [4] S. A. Bigdeli, M. Jin, P. Favaro, and M. Zwicker. Deep mean-shift priors for image restoration. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 763–772, 2017.
230
+ [5] Y. Blau and T. Michaeli. The perception-distortion tradeoff. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6228–6237, 2018.
231
+ [6] A. Buades, B. Coll, and J.-M. Morel. A non-local algorithm for image denoising. In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), volume 2, pages 60–65. IEEE, 2005.
232
+ [7] G. T. Buzzard, S. H. Chan, S. Sreehari, and C. A. Bouman. Plug-and-play unplugged: Optimization-free reconstruction using consensus equilibrium. SIAM Journal on Imaging Sciences, 11(3):2001–2020, 2018.
233
+ [8] R. D’Agostino and E. S. Pearson. Tests for departure from normality. Empirical results for the√ distributions of $b ^ { 2 }$ and $\sqrt { b }$ . Biometrika, 60(3):613–622, 1973.
234
+ [9] A. Danielyan, V. Katkovnik, and K. Egiazarian. BM3D frames and variational image deblurring. IEEE Transactions on Image Processing, 21(4):1715–1728, 2011.
235
+ [10] C. Dong, C. C. Loy, and X. Tang. Accelerating the super-resolution convolutional neural network. In European Conference on Computer Vision, pages 391–407. Springer, 2016.
236
+ [11] W. Dong, L. Zhang, G. Shi, and X. Li. Nonlocally centralized sparse representation for image restoration. IEEE Transactions on Image Processing, 22(4):1620–1630, 2012.
237
+ [12] B. Efron. Tweedie’s formula and selection bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011.
238
+ [13] M. Elad and M. Aharon. Image denoising via sparse and redundant representations over learned dictionaries. IEEE Transactions on Image Processing, 15(12):3736–3745, 2006.
239
+ [14] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, volume 27. Curran Associates, Inc., 2014.
240
+ [15] B. Guo, Y. Han, and J. Wen. AGEM: solving linear inverse problems via deep priors and sampling. Advances in Neural Information Processing Systems, 32:547–558, 2019.
241
+ [16] H. Gupta, K. H. Jin, H. Q. Nguyen, M. T. McCann, and M. Unser. CNN-based projected gradient descent for consistent CT image reconstruction. IEEE Transactions on Medical Imaging, 37(6): 1440–1453, 2018.
242
+ [17] M. Haris, G. Shakhnarovich, and N. Ukita. Deep back-projection networks for super-resolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1664–1673, 2018.
243
+ [18] J. Ho, A. Jain, and P. Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, volume 33, pages 6840–6851. Curran Associates, Inc., 2020.
244
+ [19] C. M. Hyun, H. P. Kim, S. M. Lee, S. Lee, and J. K. Seo. Deep learning for undersampled MRI reconstruction. Physics in Medicine & Biology, 63(13):135007, 2018.
245
+ [20] Z. Kadkhodaie and E. P. Simoncelli. Solving linear inverse problems using the prior implicit in a denoiser. arXiv preprint arXiv:2007.13640, 2020.
246
+ [21] B. Kawar, G. Vaksman, and M. Elad. Stochastic image denoising by sampling from the posterior distribution. arXiv preprint arXiv:2101.09552, 2021.
247
+ [22] O. Kupyn, T. Martyniuk, J. Wu, and Z. Wang. DeblurGAN-v2: deblurring (orders-of-magnitude) faster and better. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8878–8887, 2019.
248
+ [23] R. Laumont, V. De Bortoli, A. Almansa, J. Delon, A. Durmus, and M. Pereyra. Bayesian imaging using plug & play priors: When Langevin meets Tweedie. arXiv preprint arXiv:2103.04715, 2021.
249
+ [24] G. Lebanon. Probability: The Analysis of Data, volume 1, pages 104–107. CreateSpace Independent Publishing Platform, 2012.
250
+ [25] S. Lefkimmiatis. Non-local color image denoising with convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3587–3596, 2017.
251
+ [26] H. Li, Y. Yang, M. Chang, H. Feng, Z. Xu, Q. Li, and Y. Chen. SRDiff: single image superresolution with diffusion probabilistic models. arXiv e-prints, pages arXiv–2104, 2021.
252
+ [27] 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, pages 3730–3738, 2015.
253
+ [28] A. Lucas, M. Iliadis, R. Molina, and A. K. Katsaggelos. Using deep neural networks for inverse problems in imaging: beyond analytical methods. IEEE Signal Processing Magazine, 35(1): 20–36, 2018.
254
+ [29] M. T. McCann, K. H. Jin, and M. Unser. Convolutional neural networks for inverse problems in imaging: A review. IEEE Signal Processing Magazine, 34(6):85–95, 2017.
255
+ [30] T. Meinhardt, M. Moller, C. Hazirbas, and D. Cremers. Learning proximal operators: Using denoising networks for regularizing inverse imaging problems. In Proceedings of the IEEE International Conference on Computer Vision, pages 1781–1790, 2017.
256
+ [31] S. Menon, A. Damian, S. Hu, N. Ravi, and C. Rudin. PULSE: Self-supervised photo upsampling via latent space exploration of generative models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2437–2445, 2020.
257
+ [32] K. Miyasawa. An empirical Bayes estimator of the mean of a normal population. Bull. Inst. Internat. Statist., 38:181–188, 1961.
258
+ [33] G. Ohayon, T. Adrai, G. Vaksman, M. Elad, and P. Milanfar. High perceptual quality image denoising with a posterior sampling CGAN. arXiv preprint arXiv:2103.04192, 2021.
259
+ [34] S. Peng and K. Li. Generating unobserved alternatives: A case study through super-resolution and decompression. arXiv preprint arXiv:2011.01926, 2020.
260
+ [35] A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In 4th International Conference on Learning Representations, 2016.
261
+ [36] I. Ram, M. Elad, and I. Cohen. Image processing using smooth ordering of its patches. IEEE Transactions on Image Processing, 22(7):2764–2774, 2013.
262
+ [37] S. Ravishankar, J. C. Ye, and J. A. Fessler. Image reconstruction: From sparsity to data-adaptive methods and machine learning. Proceedings of the IEEE, 108(1):86–109, 2019.
263
+ [38] G. O. Roberts, R. L. Tweedie, et al. Exponential convergence of Langevin distributions and their discrete approximations. Bernoulli, 2(4):341–363, 1996.
264
+ [39] Y. Romano, M. Elad, and P. Milanfar. The little engine that could: Regularization by denoising (RED). SIAM Journal on Imaging Sciences, 10(4):1804–1844, 2017.
265
+ [40] A. Rond, R. Giryes, and M. Elad. Poisson inverse problems by the plug-and-play scheme. Journal of Visual Communication and Image Representation, 41:96–108, 2016.
266
+ [41] E. Ryu, J. Liu, S. Wang, X. Chen, Z. Wang, and W. Yin. Plug-and-play methods provably converge with properly trained denoisers. In International Conference on Machine Learning, pages 5546–5557. PMLR, 2019.
267
+ [42] C. Saharia, J. Ho, W. Chan, T. Salimans, D. J. Fleet, and M. Norouzi. Image super-resolution via iterative refinement. arXiv preprint arXiv:2104.07636, 2021.
268
+ [43] U. Simsekli, R. Badeau, T. Cemgil, and G. Richard. Stochastic Quasi-Newton Langevin Monte Carlo. In International Conference on Machine Learning, pages 642–651. PMLR, 2016.
269
+ [44] Y. Song and S. Ermon. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pages 11918–11930, 2019.
270
+ [45] Y. Song and S. Ermon. Improved techniques for training score-based generative models. In Advances in Neural Information Processing Systems, 33, 2020.
271
+ [46] 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.
272
+ [47] C. M. Stein. Estimation of the mean of a multivariate normal distribution. The annals of Statistics, pages 1135–1151, 1981.
273
+ [48] M. Suin, K. Purohit, and A. Rajagopalan. Spatially-attentive patch-hierarchical network for adaptive motion deblurring. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3606–3615, 2020.
274
+ [49] Y. Sun, B. Wohlberg, and U. S. Kamilov. An online plug-and-play algorithm for regularized image reconstruction. IEEE Transactions on Computational Imaging, 5(3):395–408, 2019.
275
+ [50] T. Tirer and R. Giryes. Image restoration by iterative denoising and backward projections. IEEE Transactions on Image Processing, 28(3):1220–1234, 2018.
276
+ [51] G. Vaksman, M. Zibulevsky, and M. Elad. Patch ordering as a regularization for inverse problems in image processing. SIAM Journal on Imaging Sciences, 9(1):287–319, 2016.
277
+ [52] G. Vaksman, M. Elad, and P. Milanfar. LIDIA: Lightweight learned image denoising with instance adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 524–525, 2020.
278
+ [53] S. V. Venkatakrishnan, C. A. Bouman, and B. Wohlberg. Plug-and-play priors for model based reconstruction. In 2013 IEEE Global Conference on Signal and Information Processing, pages 945–948. IEEE, 2013.
279
+ [54] X. Wang, K. Yu, S. Wu, J. Gu, Y. Liu, C. Dong, Y. Qiao, and C. Change Loy. ESRGAN: enhanced super-resolution generative adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, 2018.
280
+ [55] J. Yang, J. Wright, T. S. Huang, and Y. Ma. Image super-resolution via sparse representation. IEEE transactions on image processing, 19(11):2861–2873, 2010.
281
+ [56] 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.
282
+ [57] G. Yu, G. Sapiro, and S. Mallat. Solving inverse problems with piecewise linear estimators: From Gaussian mixture models to structured sparsity. IEEE Transactions on Image Processing, 21(5):2481–2499, 2011.
283
+ [58] J. Zhang and B. Ghanem. ISTA-Net: interpretable optimization-inspired deep network for image compressive sensing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1828–1837, 2018.
284
+ [59] K. Zhang, W. Zuo, Y. Chen, D. Meng, and L. Zhang. Beyond a Gaussian denoiser: Residual learning of deep CNN for image denoising. IEEE Transactions on Image Processing, 26(7): 3142–3155, 2017.
285
+ [60] K. Zhang, W. Zuo, S. Gu, and L. 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.
286
+ [61] K. Zhang, W. Zuo, and L. Zhang. FFDNet: toward a fast and flexible solution for CNN-based image denoising. IEEE Transactions on Image Processing, 27(9):4608–4622, 2018.
287
+ [62] R. Zhang, P. Isola, A. A. Efros, E. Shechtman, and O. 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.
288
+ [63] D. Zoran and Y. Weiss. From learning models of natural image patches to whole image restoration. In 2011 International Conference on Computer Vision, pages 479–486. IEEE, 2011.
md/train/B1X0mzZCW/B1X0mzZCW.md ADDED
@@ -0,0 +1,576 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FIDELITY-WEIGHTED LEARNING
2
+
3
+ Mostafa Dehghani University of Amsterdam dehghani@uva.nl
4
+
5
+ Arash Mehrjou MPI for Intelligent Systems amehrjou@tuebingen.mpg.de
6
+
7
+ Stephan Gouws Google Brain sgouws@google.com
8
+
9
+ Jaap Kamps University of Amsterdam kamps@uva.nl
10
+
11
+ Bernhard Scholkopf ¨ MPI for Intelligent Systems bs@tuebingen.mpg.de
12
+
13
+ # ABSTRACT
14
+
15
+ Training deep neural networks requires many training samples, but in practice training labels are expensive to obtain and may be of varying quality, as some may be from trusted expert labelers while others might be from heuristics or other sources of weak supervision such as crowd-sourcing. This creates a fundamental qualityversus-quantity trade-off in the learning process. Do we learn from the small amount of high-quality data or the potentially large amount of weakly-labeled data? We argue that if the learner could somehow know and take the label-quality into account when learning the data representation, we could get the best of both worlds. To this end, we propose “fidelity-weighted learning” (FWL), a semi-supervised studentteacher approach for training deep neural networks using weakly-labeled data. FWL modulates the parameter updates to a student network (trained on the task we care about) on a per-sample basis according to the posterior confidence of its label-quality estimated by a teacher (who has access to the high-quality labels). Both student and teacher are learned from the data. We evaluate FWL on two tasks in information retrieval and natural language processing where we outperform state-of-the-art alternative semi-supervised methods, indicating that our approach makes better use of strong and weak labels, and leads to better task-dependent data representations.
16
+
17
+ # 1 INTRODUCTION
18
+
19
+ The success of deep neural networks to date depends strongly on the availability of labeled data which is costly and not always easy to obtain. Usually it is much easier to obtain small quantities of high-quality labeled data and large quantities of unlabeled data. The problem of how to best integrate these two different sources of information during training is an active pursuit in the field of semi-supervised learning (Chapelle et al., 2006). However, for a large class of tasks it is also easy to define one or more so-called “weak annotators”, additional (albeit noisy) sources of weak supervision based on heuristics or “weaker”, biased classifiers trained on e.g. non-expert crowd-sourced data or data from different domains that are related. While easy and cheap to generate, it is not immediately clear if and how these additional weakly-labeled data can be used to train a stronger classifier for the task we care about. More generally, in almost all practical applications machine learning systems have to deal with data samples of variable quality. For example, in a large dataset of images only a small fraction of samples may be labeled by experts and the rest may be crowd-sourced using e.g. Amazon Mechanical Turk (Veit et al., 2017). In addition, in some applications, labels are intentionally perturbed due to privacy issues (Wainwright et al., 2012; Papernot et al., 2017).
20
+
21
+ Assuming we can obtain a large set of weakly-labeled data in addition to a much smaller training set of “strong” labels, the simplest approach is to expand the training set by including the weakly-supervised samples (all samples are equal). Alternatively, one may pretrain on the weak data and then fine-tune on observations from the true function or distribution (which we call strong data). Indeed, it has recently been shown that a small amount of expert-labeled data can be augmented in such a way by a large set of raw data, with labels coming from a heuristic function, to train a more accurate neural ranking model (Dehghani et al., 2017d). The downside is that such approaches are oblivious to the amount or source of noise in the labels.
22
+
23
+ ![](images/1b69b7a31813138afadabf804b83c9b5fe27e801d1f33369e0e1b3f602c9dd48.jpg)
24
+ Figure 1: Illustration of Fidelity-Weighted Learning: Step 1: Pre-train student on weak data, Step 2: Fit teacher to observations from the true function, and Step 3: Fine-tune student on labels generated by teacher, taking the confidence into account. Red dotted borders and blue solid borders depict components with trainable and non-trainable parameters, respectively.
25
+
26
+ In this paper, we argue that treating weakly-labeled samples uniformly (i.e. each weak sample contributes equally to the final classifier) ignores potentially valuable information of the label quality. Instead, we propose Fidelity-Weighted Learning (FWL), a Bayesian semi-supervised approach that leverages a small amount of data with true labels to generate a larger training set with confidence-weighted weakly-labeled samples, which can then be used to modulate the fine-tuning process based on the fidelity (or quality) of each weak sample. By directly modeling the inaccuracies introduced by the weak annotator in this way, we can control the extent to which we make use of this additional source of weak supervision: more for confidently-labeled weak samples close to the true observed data, and less for uncertain samples further away from the observed data.
27
+
28
+ We propose a setting consisting of two main modules. One is called the student and is in charge of learning a suitable data representation and performing the main prediction task, the other is the teacher which modulates the learning process by modeling the inaccuracies in the labels. We explain our approach in much more detail in Section 2, but at a high level it works as follows (see Figure 1): We pretrain the student network on weak data to learn an initial task-dependent data representation which we pass to the teacher along with the strong data. The teacher then learns to predict the strong data, but crucially, based on the student’s learned representation. This then allows the teacher to generate new labeled training data from unlabeled data, and in the process correct the student’s mistakes, leading to a better final data representation and better final predictor.
29
+
30
+ We introduce the proposed FWL approach in more detail in Section 2. We then present our experimental setup in Section 3 where we evaluate FWL on a toy task and two real-world tasks, namely document ranking and sentence sentiment classification. In all cases, FWL outperforms competitive baselines and yields state-of-the-art results, indicating that FWL makes better use of the limited true labeled data and is thereby able to learn a better and more meaningful task-specific representation of the data. Section 4 provides analysis of the bias-variance trade-off and the learning rate, suggesting also to view FWL from the perspective of Vapnik’s learning with privileged information (LUPI) framework (Vapnik & Izmailov, 2015). Section 5 situates FWL relative to related work, and we end the paper by drawing the main conclusions in Section 6.
31
+
32
+ # 2 FIDELITY-WEIGHTED LEARNING (FWL)
33
+
34
+ In this section, we describe our proposed FWL approach for semi-supervised learning when we have access to weak supervision (e.g. heuristics or weak annotators). We assume we are given a large set of unlabeled data samples, a heuristic labeling function called the weak annotator, and a small set of highquality samples labeled by experts, called the strong dataset, consisting of tuples of training samples $x _ { i }$ and their true labels $y _ { i }$ , i.e. $\bar { \mathcal { D } _ { s } } \bar { = } \{ ( x _ { i } , y _ { i } ) \}$ . We consider the latter to be observations from the true target function that we are trying to learn. We use the weak annotator to generate labels for the unlabeled samples. Generated labels are noisy due to the limited accuracy of the weak annotator. This gives us the weak dataset consisting of tuples of training samples $x _ { i }$ and their weak labels $\tilde { y } _ { i }$ , i.e. $\mathcal { D } _ { w } = \bar { \{ ( x _ { i } , \tilde { y } _ { i } ) \} }$ . Note that we can generate a large amount of weak training data $\mathcal { D } _ { w }$ at almost no cost using the weak annotator. In contrast, we have only a limited amount of observations from the true function, i.e. $\left| \mathcal { D } _ { s } \right| \ll \left| \mathcal { D } _ { w } \right|$ .
35
+
36
+ # Algorithm 1 Fidelity-Weighted Learning.
37
+
38
+ 1: Train the student on samples from the weakly-annotated data $D _ { w }$ .
39
+ 2: Freeze the representation-learning component $\psi ( . )$ of the student and train teacher on the strong data $D _ { s } = ( \psi ( x _ { j } ) , y _ { j } )$ . Apply teacher to unlabeled samples $x _ { t }$ to obtain soft dataset $D _ { s w } = \{ ( x _ { t } , \bar { y } _ { t } ) \}$ where $\bar { y } _ { t } = T ( x _ { t } )$ is the soft label and for each instance $x _ { t }$ , the uncertainty of its label, $\Sigma ( x _ { t } )$ , is provided by the teacher.
40
+ 3: Train the student on samples from $D _ { s w }$ with SGD and modulate the step-size $\eta _ { t }$ according to the per-sample quality estimated using the teacher (Equation 1).
41
+
42
+ Our proposed setup comprises a neural network called the student and a Bayesian function approximator called the teacher. The training process consists of three phases which we summarize in Algorithm 1 and Figure 1.
43
+
44
+ # Step 1 Pre-train the student on $\mathcal { D } _ { w }$ using weak labels generated by the weak annotator.
45
+
46
+ The main goal of this step is to learn a task dependent representation of the data as well as pretraining the student. The student function is a neural network consisting of two parts. The first part $\bar { \psi } ( . )$ learns the data representation and the second part $\phi ( . )$ performs the prediction task (e.g. classification). Therefore the overall function is $\hat { y } = \phi ( \psi ( x _ { i } ) )$ . The student is trained on all samples of the weak dataset $\mathcal { D } _ { w } = \{ ( x _ { i } , \tilde { y } _ { i } ) \}$ . For brevity, in the following, we will refer to both data sample $x _ { i }$ and its representation $\psi ( x _ { i } )$ by $x _ { i }$ when it is obvious from the context. From the self-supervised feature learning point of view, we can say that representation learning in this step is solving a surrogate task of approximating the expert knowledge, for which a noisy supervision signal is provided by the weak annotator.
47
+
48
+ Step 2 Train the teacher on the strong data $( \boldsymbol { \psi } ( x _ { j } ) , y _ { j } ) \in \mathcal { D } _ { s }$ represented in terms of the student representation $\psi ( . )$ and then use the teacher to generate a soft dataset $\mathcal { D } _ { s w }$ consisting of hsample,predicted label, confidencei for all data samples.
49
+
50
+ We use a Gaussian process as the teacher to capture the label uncertainty in terms of the student representation, estimated w.r.t the strong data. We explain the finer details of the $\mathcal { G P }$ in Appendix C, and just present the overall description here. A prior mean and co-variance function is chosen for $\mathcal { G P }$ . The learned embedding function $\bar { \psi } ( \cdot )$ in Step 1 is then used to map the data samples to dense vectors as input to the $\mathcal { G P }$ . We use the learned representation by the student in the previous step to compensate lack of data in $\mathcal { D } _ { s }$ and the teacher can enjoy the learned knowledge from the large quantity of the weakly annotated data. This way, we also let the teacher see the data through the lens of the student.
51
+
52
+ The $\mathcal { G P }$ is trained on the samples from $\mathcal { D } _ { s }$ to learn the posterior mean $m _ { \mathrm { p o s t } }$ (used to generate soft labels) and posterior co-variance $K _ { \mathrm { p o s t } } ( . , . )$ (which represents label uncertainty). We then create the soft dataset $\mathcal { D } _ { s w } = \{ ( x _ { t } , \bar { y } _ { t } ) \}$ using the posterior $\mathcal { G P }$ , input samples $x _ { t }$ from $\mathcal { D } _ { w } \cup \mathcal { D } _ { s }$ , and predicted labels $\bar { y } _ { t }$ with their associated uncertainties as computed by $T ( x _ { t } )$ and $\Sigma ( x _ { t } )$ :
53
+
54
+ $$
55
+ \begin{array} { r c l } { { T ( x _ { t } ) } } & { { = } } & { { g ( m _ { \mathrm { p o s t } } ( x _ { t } ) ) } } \\ { { \Sigma ( x _ { t } ) } } & { { = } } & { { h ( K _ { \mathrm { p o s t } } ( x _ { t } , x _ { t } ) ) } } \end{array}
56
+ $$
57
+
58
+ The generated labels are called soft labels. Therefore, we refer to $\mathcal { D } _ { s w }$ as a soft dataset. $g ( . )$ transforms the output of $\mathcal { G P }$ to the suitable output space. For example in classification tasks, $g ( . )$ would be the softmax function to produce probabilities that sum up to one. For multidimensional-output tasks where a vector of variances is provided by the $\mathcal { G P }$ , the vector $K _ { \mathrm { p o s t } } ( x _ { t } , x _ { t } )$ is passed through an aggregating function $h ( . )$ to generate a scalar value for the uncertainty of each sample. Note that we train $\mathcal { G P }$ only on the strong dataset $\mathcal { D } _ { s }$ but then use it to generate soft labels $\bar { y } _ { t } = T ( x _ { t } )$ and uncertainty $\Sigma ( x _ { t } )$ for samples belonging to $\mathcal { D } _ { s w } = \mathcal { D } _ { w } \cup \mathcal { D } _ { s }$ .
59
+
60
+ In practice, we furthermore divide the space of data into several regions and assign each region a separate $\mathcal { G P }$ trained on samples from that region. This leads to a better exploration of the data space and makes use of the inherent structure of data. The algorithm called clustered $\mathcal { G P }$ gave better results compared to a single GP. See Appendix A for the detailed description and empirical observations which makes the use of multiple $\mathcal G \mathcal P \mathbf s$ reasonable.
61
+
62
+ Step 3 Fine-tune the weights of the student network on the soft dataset, while modulating the magnitude of each parameter update by the corresponding teacher-confidence in its label.
63
+
64
+ The student network of Step 1 is fine-tuned using samples from the soft dataset $\mathcal { D } _ { s w } = \{ ( x _ { t } , \bar { y } _ { t } ) \}$ where $\bar { y } _ { t } = T ( x _ { t } )$ . The corresponding uncertainty $\Sigma ( x _ { t } )$ of each sample is mapped to a confidence value according to Equation 1 below, and this is then used to determine the step size for each iteration of the stochastic gradient descent (SGD). So, intuitively, for data points where we have true labels, the uncertainty of the teacher is almost zero, which means we have high confidence and a large step-size for updating the parameters. However, for data points where the teacher is not confident, we down-weight the training steps of the student. This means that at these points, we keep the student function as it was trained on the weak data in Step 1.
65
+
66
+ More specifically, we update the parameters of the student by training on $\mathcal { D } _ { s w }$ using SGD:
67
+
68
+ $$
69
+ \begin{array} { r c l } { { \pmb w } ^ { * } } & { = } & { \displaystyle \underset { { \pmb w } \in \mathcal { W } } { \mathrm { a r g m i n } } \frac { 1 } { N } \sum _ { ( \pmb { x } _ { t } , \bar { y } _ { t } ) \in \mathcal { D } _ { s w } } l ( \pmb { w } , \pmb { x } _ { t } , \bar { y } _ { t } ) + \mathcal { R } ( \pmb { w } ) , } \\ { { \pmb w } _ { t + 1 } } & { = } & { \pmb { w } _ { t } - \eta _ { t } \big ( \nabla l ( \pmb { w } , \pmb { x } _ { t } , \bar { y } _ { t } ) + \nabla \mathcal { R } ( \pmb { w } ) \big ) } \end{array}
70
+ $$
71
+
72
+ where $l ( \cdot )$ is the per-example loss, $\eta _ { t }$ is the total learning rate, $N$ is the size of the soft dataset $\mathcal { D } _ { s w }$ $\pmb { w }$ is the parameters of the student network, and $\mathcal { R } ( . )$ is the regularization term.
73
+
74
+ We define the total learning rate as $\eta _ { t } = \eta _ { 1 } ( t ) \eta _ { 2 } ( x _ { t } )$ , where $\eta _ { 1 } ( t )$ is the usual learning rate of our chosen optimization algorithm that anneals over training iterations, and $\eta _ { 2 } ( x _ { t } )$ is a function of the label uncertainty $\Sigma ( x _ { t } )$ that is computed by the teacher for each data point. Multiplying these two terms gives us the total learning rate. In other words, $\eta _ { 2 }$ represents the fidelity (quality) of the current sample, and is used to multiplicatively modulate $\eta _ { 1 }$ . Note that the first term does not necessarily depend on each data point, whereas the second term does. We propose
75
+
76
+ $$
77
+ \eta _ { 2 } ( x _ { t } ) = \exp [ - \beta \Sigma ( x _ { t } ) ] ,
78
+ $$
79
+
80
+ to exponentially decrease the learning rate for data point $x _ { t }$ if its corresponding soft label $\bar { y } _ { t }$ is unreliable (far from a true sample). In Equation 1, $\beta$ is a positive scalar hyper-parameter. Intuitively, small $\beta$ results in a student which listens more carefully to the teacher and copies its knowledge, while a large $\beta$ makes the student pay less attention to the teacher, staying with its initial weak knowledge. More concretely speaking, as $\beta \to 0$ student places more trust in the labels $\bar { y } _ { t }$ estimated by the teacher and the student copies the knowledge of the teacher. On the other hand, as $\beta \to \infty$ , student puts less weight on the extrapolation ability of $\mathcal { G P }$ and the parameters of the student are not affected by the correcting information from the teacher.
81
+
82
+ # 3 EXPERIMENTS
83
+
84
+ In this section, we apply FWL first to a toy problem and then to two different real tasks: document ranking and sentiment classification. The neural networks are implemented in TensorFlow (Abadi et al., 2015; Tang, 2016). GPflow (Matthews et al., 2017) is employed for developing the $\mathcal { G P }$ modules. For both tasks, we evaluate the performance of our method compared to the following baselines:
85
+
86
+ 1. WA. The weak annotator, i.e. the unsupervised method used for annotating the unlabeled data.
87
+ 2. NNW. The student trained only on weak data.
88
+ 3. $\mathbf { N N _ { S } }$ . The student trained only on strong data.
89
+ 4. $\mathbf { N N _ { S ^ { + } / W } }$ . The student trained on samples that are alternately drawn from $\mathcal { D } _ { w }$ without replacement, and $\mathcal { D } _ { s }$ with replacement. Since $\left| \mathcal { D } _ { s } \right| \ll \left| \mathcal { D } _ { w } \right|$ , it oversamples the strong data.
90
+ 5. ${ \bf N N } _ { \bf W \to S }$ . The student trained on weak dataset $\mathcal { D } _ { w }$ and fine-tuned on strong dataset $\mathcal { D } _ { s }$ .
91
+ 6. $\mathbf { N N } _ { \mathbf { W } ^ { \omega } \to \mathbf { S } }$ . The student trained on the weak data, but the step-size of each weak sample is weighted by a fixed value $0 \leq \omega \leq 1$ , and fine-tuned on strong data. As an approximation for the optimal value for $\omega$ , we have used the mean of $\eta _ { 2 }$ of our model (below).
92
+ 7. FWL unsuprep. The representation in the first step is trained in an unsupervised way1 and the student is trained on examples labeled by the teacher using the confidence scores.
93
+ 8. FWL $\backslash \Sigma$ . The student trained on the weakly labeled data and fine-tuned on examples labeled by the teacher without taking the confidence into account. This baseline is similar to (Veit et al., 2017).
94
+ 9. FWL. Our FWL model, i.e. the student trained on the weakly labeled data and fine-tuned on examples labeled by the teacher using the confidence scores.
95
+
96
+ In the following, we introduce each task and the results produced for it, more detail about the exact student network and teacher $\mathcal { G P }$ for each task are in the appendix.
97
+
98
+ ![](images/dfac384163e0e39d7d67efc7c1966a3e5bfdabd5bbf2f6a94c42fabb1021739e.jpg)
99
+ c) Fine-tuning the student based on observations from the true function. (d) Fine-tuning the student based on label/confidence from teacher.
100
+ Figure 2: Toy example: The true function we want to learn is $y = \sin ( x )$ and the weak function is $y = 2 s i n c ( x )$
101
+
102
+ # 3.1 TOY PROBLEM
103
+
104
+ We first apply FWL to a one-dimensional toy problem to illustrate the various steps. Let $f _ { t } ( x ) = \sin ( x )$ be the true function (red dotted line in Figure 2a) from which a small set of observations $\mathcal { D } _ { s } = \{ x _ { j } , y _ { j } \}$ is provided (red points in Figure 2b). These observation might be noisy, in the same way that labels obtained from a human labeler could be noisy. A weak annotator function $f _ { w } ( x ) = 2 s i n c ( \dot { x } )$ (magenta line in Figure 2a) is provided, as an approximation to $f _ { t } ( . )$ .
105
+
106
+ The task is to obtain a good estimate of $f _ { t } ( . )$ given the set $\mathcal { D } _ { s }$ of strong observations and the weak annotator function $f _ { w } ( . )$ . We can easily obtain a large set of observations $\mathcal { D } _ { w } = \{ x _ { i } , \tilde { y } _ { i } \}$ from $f _ { w } ( . )$ with almost no cost (magenta points in Figure 2a).
107
+
108
+ We consider two experiments:
109
+
110
+ 1. A neural network trained on weak data and then fine-tuned on strong data from the true function, which is the most common semi-supervised approach (Figure 2c).
111
+ 2. A teacher-student framework working by the proposed FWL approach.
112
+
113
+ As can be seen in Figure 2d, FWL by taking into account label confidence, gives a better approximation of the true hidden function. We repeated the above experiment 10 times. The average RMSE with respect to the true function on a set of test points over those 10 experiments for the student, were as follows:
114
+
115
+ 1. Student is trained on weak data (blue line in Figure 2a): 0.8406,
116
+ 2. Student is trained on weak data then fine tuned on true observations (blue line in Figure 2c): 0.5451,
117
+ 3. Student is trained on weak data, then fine tuned by soft labels and confidence information provided by the teacher (blue line in Figure 2d): 0.4143 (best).
118
+
119
+ More details of the neural network and $\mathcal { G P }$ along with the specification of the data used in the above experiment are presented in Appendix C and E.1.
120
+
121
+ # 3.2 DOCUMENT RANKING
122
+
123
+ This task is the core information retrieval problem and is challenging as the ranking model needs to learn a representation for long documents and capture the notion of relevance between queries and documents. Furthermore, the size of publicly available datasets with query-document relevance judgments is unfortunately quite small $\mathord { \sim } 2 5 0$ queries). We employ a state-of-the-art pairwise neural ranker architecture as the student (Dehghani et al., 2017d). In this model, ranking is cast as a regression task. Given each training sample $x$ as a triple of query $q$ , and two documents $d ^ { + }$ and $d ^ { - }$ , the goal is to learn a function $\mathcal { F } : \{ \bar { < } q , d ^ { + } , d ^ { - } > \} \mathbb { R }$ , which maps each data sample $x$ to a scalar output value $y$ indicating the probability of $d ^ { + }$ being ranked higher than $d ^ { - }$ with respect to $q$ .
124
+
125
+ Table 1: Performance of FWL approach and baseline methods for ranking task. IJi indicates that the improvements with respect to the baseline $_ i$ are statistically significant at the 0.05 level using the paired two-tailed t-test with Bonferroni correction.
126
+
127
+ <table><tr><td rowspan="2">Method</td><td colspan="2">Robust04</td><td colspan="2">ClueWeb</td></tr><tr><td>MAP</td><td>nDCG@20</td><td>MAP</td><td>nDCG@20</td></tr><tr><td>1</td><td>WABM25</td><td>0.250337</td><td>0.4102-37</td><td>0.102137</td><td>0.2070-37</td></tr><tr><td>2</td><td>NNw (Dehghani etal.,2017d)</td><td>0.2702137</td><td>0.4290137</td><td>0.1297137</td><td>0.2201137</td></tr><tr><td>3</td><td>NNs</td><td>0.1790</td><td>0.3519</td><td>0.0782</td><td>0.1730</td></tr><tr><td>4</td><td>NNs+/W</td><td>0.27631237</td><td>0.43301237</td><td>0.13541237</td><td>0.23191237</td></tr><tr><td>5</td><td>NNw→S</td><td>0.28101237</td><td>0.4372*1237</td><td>0.1346*1237</td><td>0.23171237</td></tr><tr><td>6</td><td>NNwω→S</td><td>0.2899123457</td><td>0.4431*123457</td><td>0.132012347</td><td>0.2309*12347</td></tr><tr><td>7</td><td>FWLunsuprep</td><td>0.2211-37</td><td>0.3700-37</td><td>0.083137</td><td>0.1964-37</td></tr><tr><td>8</td><td>FWL\Ω</td><td>0.2980123457</td><td>0.4516123457</td><td>0.1386123457</td><td>0.2340123457</td></tr><tr><td>9</td><td>FWL</td><td>0.312412345678</td><td>0.4607-12345678</td><td>0.1472*12345678</td><td>0.2453412345678</td></tr></table>
128
+
129
+ The student follows the architecture proposed in (Dehghani et al., 2017d). The first layer of the network, i.e. representation learning layer $\psi : \{ < q , d ^ { + } , d ^ { - } > \} \mathbb { R } ^ { m }$ maps each input sample to an $m$ - dimensional real-valued vector. In general, besides learning embeddings for words, function $\psi$ learns to compose word embedding based on their global importance in order to generate query/document embeddings. The representation layer is followed by a simple fullyconnected feed-forward network with a sigmoidal output unit to predict the probability of ranking $d ^ { + }$ higher than $d ^ { - }$ . The general schema of the student is illustrated in Figure 3. More details are provided in Appendix B.1.
130
+
131
+ The teacher is implemented by clustered $\mathcal { G P }$ algorithm. See Appendix C for more details.
132
+
133
+ ![](images/97ae3fab8de7809a7fd8b6bcc5d1bab3d66cde886c7306cbed33212009679576.jpg)
134
+ Figure 3: The student for the document ranking task.
135
+
136
+ The weak annotator is BM25 (Robertson & Zaragoza, 2009), a well-known unsupervised method for scoring query-document pairs based on statistics of the matched terms. More details are provided in Appendix D.1.
137
+
138
+ Description of the data with weak labels and data with true labels as well as the setup of the documentranking experiments is presented in Appendix E.2 in more details.
139
+
140
+ Results and Discussions We conducted $\mathbf { k }$ -fold cross validation on $\mathcal { D } _ { s }$ (the strong data) and report two standard evaluation metrics for ranking: mean average precision (MAP) of the top-ranked 1,000 documents and normalized discounted cumulative gain calculated for the top 20 retrieved documents $( \mathrm { n D C G } @ 2 0 )$ . Table 1 shows the performance on both datasets. As can be seen, FWL provides a significant boost on the performance over all datasets. In the ranking task, the student is designed in particular to be trained on weak annotations (Dehghani et al., 2017d), hence training the network only on weak supervision, i.e. $\mathrm { N N } _ { \mathrm { W } }$ performs better than $\mathrm { N N } _ { \mathrm { S } }$ . This can be due to the fact that ranking is a complex task requiring many training samples, while relatively few data with true labels are available.
141
+
142
+ Alternating between strong and weak data during training, i.e. $\mathrm { N N } _ { \mathrm { S } ^ { + } / \mathrm { W } }$ seems to bring little (but statistically significant) improvement. However, we can gain better results by the typical fine-tuning strategy, ${ \mathrm { N N } } _ { \mathrm { W } \to S }$ . Comparing the performance of $\mathrm { F W L } _ { u n s u p r e p }$ to FWL indicates that, first of all learning the representation of the input data downstream of the main task leads to better results compared to a task-independent unsupervised or self-supervised way. Also the dramatic drop in the performance compared to the FWL, emphasizes the importance of the preretraining the student on weakly labeled data. We can gain improvement by fine-tuning the $\mathrm { N N } _ { \mathrm { W } }$ using labels generated by the teacher without considering their confidence score, i.e. $\mathrm { F W L } \backslash \Sigma$ . This means we just augmented the fine-tuning process by generating a fine-tuning set using teacher which is better than $\mathcal { D } _ { s }$ in terms of quantity and $\mathcal { D } _ { w }$ in terms of quality. This baseline is equivalent to setting $\beta = 0$ in Equation 1. However, we see a big jump in performance when we use FWL to include the estimated label quality from the teacher, leading to the best overall results.
143
+
144
+ # 3.3 SENTIMENT CLASSIFICATION
145
+
146
+ In sentiment classification, the goal is to predict the sentiment (e.g., positive, negative, or neutral) of a sentence. Each training sample $x$ consists of a sentence $s$ and its sentiment label $\tilde { y }$ .
147
+
148
+ Table 2: Performance of the proposed FWL approach and baseline methods for sentiment classification task. IJi indicates that the improvements with respect to the baseline#i are statistically significant, at the 0.05 level using the paired two-tailed t-test, with Bonferroni correction.
149
+
150
+ <table><tr><td></td><td>Method</td><td>SemEval-14</td><td>SemEval-15</td></tr><tr><td>1</td><td>WALexicon</td><td>0.5141</td><td>0.4471</td></tr><tr><td>2</td><td>NNw</td><td>0.6719*137</td><td>0.5606^1</td></tr><tr><td>3</td><td>NNs</td><td>0.630741</td><td>0.5811^12</td></tr><tr><td>4</td><td>NNs+/W</td><td>0.703241237</td><td>0.631941237</td></tr><tr><td>5</td><td>NNw→S</td><td>0.7080*1237</td><td>0.6441^1237</td></tr><tr><td>6</td><td>NNww →S</td><td>0.716612347</td><td>0.6603123457</td></tr><tr><td>7</td><td>FWLunsuprep</td><td>0.6588 13</td><td>0.6954*123</td></tr><tr><td>8</td><td>FWL \Ω</td><td>0.7202 123457</td><td>0.6590123457</td></tr><tr><td>9</td><td>FWL</td><td>0.7470 12345678</td><td>0.6830 12345678</td></tr><tr><td>10</td><td>SemEvalBest</td><td>0.7162</td><td>0.6618</td></tr></table>
151
+
152
+ ![](images/7785c02fa208908e0b9b79a800302cce469065d3f82bb134bb08a888b0d0fb0f.jpg)
153
+ Figure 4: The student for the sentiment classification task.
154
+
155
+ The student for the sentiment classification task is a convolutional model which has been shown to perform best on the dataset we used (Deriu et al., 2017; Severyn & Moschitti, 2015a;b; Deriu et al., 2016). The first layer of the network learns the function $\psi ( . )$ which maps input sentence $s$ to a dense vector as its representation. The inputs are first passed through an embedding layer mapping the sentence to a matrix $S \in \mathbb { R } ^ { m \times | s | }$ , followed by a series of 1d convolutional layers with max-pooling. The representation layer is followed by feed-forward layers and a softmax output layer which returns the probability distribution over all three classes. Figure 4 presents the general schema of the architecture of the student. See Appendix B.2 for more details.
156
+
157
+ The teacher for this task is modeled by a $\mathcal { G P }$ . See Appendix C for more details.
158
+
159
+ The weak annotator is a simple unsupervised lexicon-based method (Hamdan et al., 2013; Kiritchenko et al., 2014), which estimate a distribution over sentiments for each sentence, based on sentiment labels of its terms. More details are provided in Appendix D.2.
160
+
161
+ Specification of the data with weak labels and data with true labels along with the detailed experimental setup are given in Appendix E.3.
162
+
163
+ Results and Discussion We report Macro-F1, the official SemEval metric, in Table 2. We see that the proposed FWL is the best performing approach.
164
+
165
+ For this task, since the amount of data with true labels are larger compared to the ranking task, the performance of $\mathrm { N N } _ { \mathrm { S } }$ is acceptable. Alternately sampling from weak and strong data gives better results. Pretraining on weak labels then fine-tuning the network on true labels, further improves the performance. Weighting the gradient updates from weak labels during pretraining and fine-tuning the network with true labels, i.e. $\mathrm { N N } _ { \mathrm { W } ^ { \omega } \mathrm { S } }$ seems to work quite well in this task. For this task, like ranking task, learning the representation in an unsupervised task independent fashion, i.e. $\mathrm { F W L } _ { u n s u p r e p }$ , does not lead to good results compared to the FWL. Similar to the ranking task, fine-tuning $\mathrm { N N } _ { \mathrm { S } }$ based on labels generated by $\mathcal { G P }$ instead of data with true labels, regardless of the confidence score, works better than standard fine-tuning.
166
+
167
+ Besides the baselines, we also report the best performing systems which are also convolution-based models (Rouvier & Favre 2016 on SemEval-14; Deriu et al. 2016 on SemEval-15). Using FWL and taking the confidence into consideration outperforms the best systems and leads to the highest reported results on both datasets.
168
+
169
+ # 4 ANALYSIS
170
+
171
+ In this section, we provide further analysis of FWL by investigating the bias-variance trade-off and the learning rate.
172
+
173
+ # 4.1 HANDLING THE BIAS-VARIANCE TRADE-OFF
174
+
175
+ As mentioned in Section 2, $\beta$ is a hyperparameter that controls the contribution of weak and strong data to the training procedure. In order to investigate its influence, we fixed everything in the model and ran the fine-tuning step with different values of $\beta \in \{ 0 . 0 , 0 . 1 , 1 . 0 , 2 . 0 , 5 . 0 \}$ in all the experiments.
176
+
177
+ ![](images/b2a92c21cac9cdbf0b90efc933aa6b9744d79eb50578f010efdf620eca9d39f6.jpg)
178
+ Figure 6: Performance of FWL and the baseline model trained on different amount of data.
179
+
180
+ ![](images/694d21f7ed6442940097ac56ef876c4f8e7c4c860615229b53f8a03963d8e107.jpg)
181
+ Figure 5 illustrates the performance on the ranking (on Robust04 dataset) and sentiment classification tasks (on SemEval14 dataset). For both sentiment classification and ranking, $\beta = 1$ gives the best results (higher scores are better). We also experimented on the toy problem with different values of $\beta$ in three cases: 1) having 10 observations from the true function (same setup as Section 3.1), marked as “Toy Data” in the plot, 2) having only 5 observations from the true function, marked as “Toy Data \*” in the plot, and 3)
182
+ Figure 5: Effect of different values for $\beta$ .
183
+
184
+ having $f ( x ) = x + 1$ as the weak function, which is an extremely bad approximator of the true function, marked as “Toy Data $\ast \ast \ast$ in the plot. For the “Toy Data” experiment, $\beta = 1$ turned out to be optimal (here, lower scores are better). However, for “Toy Data \*”, where we have an extremely small number of observations from the true function, setting $\beta$ to a higher value acts as a regularizer by relying more on weak signals, and eventually leads to better generalization. On the other hand, for “Toy Data \*\*”, where the quality of the weak annotator is extremely low, lower values of $\beta$ put more focus on the true observations. Therefore, $\beta$ lets us control the bias-variance trade-off in these extreme cases.
185
+
186
+ # 4.2 A GOOD TEACHER IS BETTER THAN MANY OBSERVATIONS
187
+
188
+ We now look at the rate of learning for the student as the amount of training data is varied. We performed two types of experiments for all tasks: In the first experiment, we use all the available strong data but consider different percentages of the entire weak dataset. In the second experiment, we fix the amount of weak data and provide the model with varying amounts of strong data. We use standard fine-tuning with similar setups as for the baseline models. Details on the experiments for the toy problem are provided in Appendix E.1.
189
+
190
+ Figure 6 presents the results of these experiments. In general, for all tasks and both setups, the student learns faster when there is a teacher. One caveat is in the case where we have a very small amount of weak data. In this case the student cannot learn a suitable representation in the first step, and hence the performance of FWL is pretty low, as expected. It is highly unlikely that this situation occurs in reality as obtaining weakly labeled data is much easier than strong data.
191
+
192
+ The empirical observation of Figure 6 that our model learns more with less data can also be seen as evidence in support of another perspective to FWL, called learning using privileged information (Vapnik & Izmailov, 2015). We elaborate more on this connection in Appendix F.
193
+
194
+ # 4.3 SENSITIVITY OF THE FWL TO THE QUALITY OF THE WEAK ANNOTATOR
195
+
196
+ Our proposed setup in FWL requires defining a so-called “weak annotator” to provide a source of weak supervision for unlabelled data. In Section 4.1 we discussed the role of parameter $\beta$ for controlling the bias-variance trade-off by trying two weak annotators for the toy problem. Now, in this section, we study how the quality of the weak annotator may affect the performance of the FWL, for the task of document ranking as a real-world problem.
197
+
198
+ To do so, besides BM25 (Robertson & Zaragoza, 2009), we use three other weak annotators:
199
+
200
+ vector space model (Salton & Yang, 1973) with binary term occurrence (BTO) weighting schema and vector space model with TF-IDF weighting schema, which are both weaker than BM25, and $\mathbf { B M } 2 5 \mathbf { + R M } 3$ (Abdul-jaleel et al., 2004) that uses RM3 as the pseudo-relevance feedback method on top of BM25, leading to better labels.
201
+
202
+ Figure 7 illustrates the performance of these four weak annotators in terms of their mean average precision (MAP) on the test data, versus the performance of FWL given the corresponding weak annotator. As it is expected, the performance of FWL depends on the quality of the employed weak annotator. The percentage of improvement of FWL over its corresponding weak annotator on the test data is also presented in Figure 7. As can be seen, the better the performance of the weak annotator is, the less the improvement of the FWL would be.
203
+
204
+ ![](images/efcf7abf8c6c1adf9e3dd3725ef5384214c99d32f8cd9afca5c5fd38c0b73ed5.jpg)
205
+ Figure 7: Performance of FWL versus performance of the corespondence weak annotator in the document ranking task, on Robust04 dataset.
206
+
207
+ # 4.4 FROM MODIFYING THE LEARNING RATE TO WEIGHTED SAMPLING
208
+
209
+ FWL provides confidence score based on the certainty associated with each generated label $\bar { y } _ { t }$ , given sample $\boldsymbol { x } _ { t } \in \mathcal { D } _ { s w }$ . We can translate the confidence score as how likely including $\left( x _ { t } , \bar { y } _ { t } \right)$ in the training set for the student model improves the performance, and rather than using this score as the multiplicative factor in the learning rate, we can use it to bias sampling procedure of mini-batches so that the frequency of training samples are proportional to the confidence score of their labels.
210
+
211
+ We design an experiment to try FWL with this setup $( \mathrm { F W L } _ { s } )$ , in which we keep the architectures of the student and the teacher and the procedure of the first two steps of the FWL fixed, but we changed the step 3 as follows: Given the soft dataset $\mathcal { D } _ { s w }$ , consisting of $x _ { t }$ , its label $\bar { y } _ { t }$ and the associated confidence score generated by the teacher, we normalize the confidence scores over all training samples and set the normalized score of each sample as its probability to be sampled. Afterward, we train the student model by mini-batches sampled from this set with respect to the probabilities associated with each sample, but without considering the original confidence scores in parameter updating. This means the more confident the teacher is about the generated label for each sample, the more chance that sample has to be seen by the student model.
212
+
213
+ ![](images/77e8b6c15d488e1f6f725a3f8df084f3de33f92eb3344822e11e5e31d448b275.jpg)
214
+ Figure 8: Performance of FWL and $\mathrm { F W L } _ { s }$ with respect to different batch of data for the task of document ranking (Robust04 dataset) and sentiment classification (SemEval14 dataset).
215
+
216
+ Figure 8 illustrates the performance of both FWL and $\mathrm { F W L } _ { s }$ trained on different amount of data sampled from $\mathcal { D } _ { s w }$ , in the document ranking and sentiment classification tasks. As can be seen, compared to FWL, the performance of $\mathrm { F W L } _ { s }$ increases rapidly in the beginning but it slows down afterward. We have looked into the sampling procedure and noticed that the confidence scores provided by the teacher form a rather skewed distribution and there is a strong bias in $\mathrm { F W L } _ { s }$ toward sampling from data points that are either in or closed to the points in $\mathcal { D } _ { s }$ , as $\mathcal { G P }$ has less uncertainty around these points and the confidence scores are high. We observed that the performance of $\mathrm { F W L } _ { s }$ gets closer to the performance of FWL after many epochs, while FWL had already a log convergence. The skewness of the confidence distribution makes $\mathrm { F W L } _ { s }$ to have a tendency for more exploitation than exploration, however, FWL has more chance to explore the input space, while it controls the effect of updates on the parameters for samples based on their merit.
217
+
218
+ # 5 RELATED WORK
219
+
220
+ In this section, we position our FWL approach relative to related work.
221
+
222
+ Learning from imperfect labels has been thoroughly studied in the literature (Frenay & Verleysen, ´ 2014). The imperfect (weak) signal can come from non-expert crowd workers, be the output of other models that are weaker (for instance with low accuracy or coverage), biased, or models trained on data from different related domains. Among these forms, in the distant supervision setup, a heuristic labeling rule (Deriu et al., 2016; Severyn & Moschitti, 2015b) or function (Dehghani et al., 2017d)
223
+
224
+ which can be relying on a knowledge base (Mintz et al., 2009; Min et al., 2013; Han & Sun, 2016) is employed to devise noisy labels.
225
+
226
+ Learning from weak data sometimes aims at encoding various forms of domain expertise or cheaper supervision from lay annotators. For instance, in the structured learning, the label space is pretty complex and obtaining a training set with strong labels is extremely expensive, hence this class of problems leads to a wide range of works on learning from weak labels (Roth, 2017). Indirect supervision is considered as a form of learning from weak labels that is employed in particular in the structured learning, in which a companion binary task is defined for which obtaining training data is easier (Chang et al., 2010; Raghunathan et al., 2016). In the response-based supervision, the model receives feedback from interacting with an environment in a task, and converts this feedback into a supervision signal to update its parameters (Roth, 2017; Clarke et al., 2010; Riezler et al., 2014). Constraint-based supervision is another form of weak supervision in which constraints that are represented as weak label distributions are taken as signals for updating the model parameters. For instance, physics-based constraints on the output (Stewart & Ermon, 2017) or output constraints on execution of logical forms (Clarke et al., 2010).
227
+
228
+ In the proposed FWL model, we can employ these approaches as the weak annotator to provide imperfect labels for the unlabeled data, however, a small amount of data with strong labels is also needed, which put our model in the class of semi-supervised models. In the semi-supervised setup, some ideas were developed to utilize weakly or even unlabeled data. For instance, the idea of self(incremental)-training (Rosenberg et al., 2005), pseudo-labeling (Lee, 2013; Hinton et al., 2014), and Co-training (Blum & Mitchell, 1998) are introduced for augmenting the training set by unlabeled data with predicted labels. Some research used the idea of self-supervised (or unsupervised) feature learning (Noroozi & Favaro, 2016; Dosovitskiy et al., 2016; Donahue et al., 2017) to exploit different labelings that are freely available besides or within the data, and to use them as intrinsic signals to learn general-purpose features. These features, that are learned using a proxy task, are then used in a supervised task like object classification/detection or description matching.
229
+
230
+ As a common approach in semi-supervised learning, the unlabeled set can be used for learning the distribution of the data. In particular for neural networks, greedy layer-wise pre-training of weights using unlabeled data is followed by supervised fine-tuning (Hinton et al., 2006; Deriu et al., 2017; Severyn & Moschitti, 2015b;a; Go et al., 2009). Other methods learn unsupervised encoding at multiple levels of the architecture jointly with a supervised signal (Ororbia II et al., 2015; Weston et al., 2012).
231
+
232
+ Alternatively, some noise cleansing methods have been proposed to remove or correct mislabeled samples (Brodley & Friedl, 1999). There are some studies showing that weak or noisy labels can be leveraged by modifying the loss function (Reed et al., 2015; Patrini et al., 2017; 2016; Vahdat, 2017) or changing the update rule to avoid imperfections of the noisy data (Malach & Shalev-Shwartz, 2017; Dehghani et al., 2017b;c).
233
+
234
+ One direction of research focuses on modeling the pattern of the noise or weakness in the labels. For instance, methods that use a generative model to correct weak labels such that a discriminative model can be trained more effectively (Ratner et al., 2016; Rekatsinas et al., 2017; Varma et al., 2017). Furthermore, methods that aim at capturing the pattern of the noise by inserting an extra layer (Goldberger & Ben-Reuven, 2017) or a separate module tries to infer better labels from noisy ones and use them to supervise the training of the network (Sukhbaatar et al., 2015; Veit et al., 2017; Dehghani et al., 2017b). Our proposed FWL can be categorized in this class as the teacher tries to infer better labels and provide certainty information which is incorporated as the update rule for the student model.
235
+
236
+ # 6 CONCLUSION
237
+
238
+ Training neural networks using large amounts of weakly annotated data is an attractive approach in scenarios where an adequate amount of data with true labels is not available, a situation which often arises in practice. In this paper, we introduced fidelity-weighted learning (FWL), a new student-teacher framework for semi-supervised learning in the presence of weakly labeled data. We applied FWL to document ranking and sentiment classification, and empirically verified that FWL speeds up the training process and improves over state-of-the-art semi-supervised alternatives.
239
+
240
+ # REFERENCES
241
+
242
+ Mart´ın Abadi et al. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
243
+
244
+ Nasreen Abdul-jaleel, James Allan, W. Bruce Croft, O Diaz, Leah Larkey, Xiaoyan Li, Mark D. Smucker, and Courtney Wade. Umass at trec 2004: Novelty and hard. In TREC-13, 2004.
245
+
246
+ Stefano Baccianella, Andrea Esuli, and Fabrizio Sebastiani. Sentiwordnet 3.0: An enhanced lexical resource for sentiment analysis and opinion mining. In LREC, volume 10, pp. 2200–2204, 2010.
247
+
248
+ Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In Proceedings of the Eleventh Annual Conference on Computational Learning Theory, COLT’ 98, pp. 92–100, 1998.
249
+
250
+ Carla E. Brodley and Mark A. Friedl. Identifying mislabeled training data. Journal of artificial intelligence research, 11:131–167, 1999.
251
+
252
+ Ming-Wei Chang, Vivek Srikumar, Dan Goldwasser, and Dan Roth. Structured output learning with indirect supervision. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 199–206, 2010.
253
+
254
+ Olivier Chapelle, Bernhard Scholkopf, and Alexander Zien. ¨ Semi-Supervised Learning. The MIT Press, 1st edition, 2006.
255
+
256
+ James Clarke, Dan Goldwasser, Ming-Wei Chang, and Dan Roth. Driving semantic parsing from the world’s response. In Proceedings of the fourteenth conference on computational natural language learning, pp. 18–27, 2010.
257
+
258
+ Gordon V. Cormack, Mark D. Smucker, and Charles L. Clarke. Efficient and effective spam filtering and re-ranking for large web datasets. Inf. Retr., 14(5):441–465, 2011.
259
+
260
+ Mostafa Dehghani, Sascha Rothe, Enrique Alfonseca, and Pascal Fleury. Learning to attend, copy, and generate for session-based query suggestion. In Proceedings of The international Conference on Information and Knowledge Management (CIKM’17), 2017a.
261
+
262
+ Mostafa Dehghani, Aliaksei Severyn, Sascha Rothe, and Jaap Kamps. Learning to learn from weak supervision by full supervision. In NIPS2017 workshop on Meta-Learning (MetaLearn 2017), 2017b.
263
+
264
+ Mostafa Dehghani, Aliaksei Severyn, Sascha Rothe, and Jaap Kamps. Avoiding your teacher’s mistakes: Training neural networks with controlled weak supervision. arXiv preprint arXiv:1711.00313, 2017c.
265
+
266
+ Mostafa Dehghani, Hamed Zamani, Aliaksei Severyn, Jaap Kamps, and W. Bruce Croft. Neural ranking models with weak supervision. In SIGIR’17, 2017d.
267
+
268
+ Jan Deriu, Maurice Gonzenbach, Fatih Uzdilli, Aurelien Lucchi, Valeria De Luca, and Martin Jaggi. Swisscheese at semeval-2016 task 4: Sentiment classification using an ensemble of convolutional neural networks with distant supervision. Proceedings of SemEval, pp. 1124–1128, 2016.
269
+
270
+ Jan Deriu, Aurelien Lucchi, Valeria De Luca, Aliaksei Severyn, Simon Muller, Mark Cieliebak, Thomas ¨ Hofmann, and Martin Jaggi. Leveraging large amounts of weakly supervised data for multi-language sentiment classification. In Proceedings of the 26th international International World Wide Web Conference (WWW’17), pp. 1045–1052, 2017.
271
+
272
+ Thomas Desautels, Andreas Krause, and Joel W. Burdick. Parallelizing exploration-exploitation tradeoffs in gaussian process bandit optimization. Journal of Machine Learning Research, 15(1): 3873–3923, 2014.
273
+
274
+ Jeff Donahue, Philipp Krahenb ¨ uhl, and Trevor Darrell. Adversarial feature learning. In ¨ ICLR2017, 2017.
275
+
276
+ Alexey Dosovitskiy, Philipp Fischer, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with exemplar convolutional neural networks. IEEE transactions on pattern analysis and machine intelligence, 38(9):1734–1747, 2016.
277
+
278
+ Benoˆıt Frenay and Michel Verleysen. Classification in the presence of label noise: a survey. ´ IEEE transactions on neural networks and learning systems, 25(5):845–869, 2014.
279
+
280
+ Alec Go, Richa Bhayani, and Lei Huang. Twitter sentiment classification using distant supervision. CS224N Project Report, Stanford, 1(12), 2009.
281
+
282
+ Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. In ICLR2017, 2017.
283
+
284
+ Hussam Hamdan, Frederic Bechet, and Patrice Bellot. Experiments with dbpedia, wordnet and ´ sentiwordnet as resources for sentiment analysis in micro-blogging. In Second Joint Conference on Lexical and Computational Semantics $( ^ { * } S E M )$ , volume 2, pp. 455–459, 2013.
285
+
286
+ Xianpei Han and Le Sun. Global distant supervision for relation extraction. In AAAI’16, pp. 2950–2956, 2016.
287
+
288
+ James Hensman, Alexander G. de G. Matthews, and Zoubin Ghahramani. Scalable variational gaussian process classification. In Proceedings of AISTATS, 2015.
289
+
290
+ Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. In NIPS 2014 Deep Learning Workshop, 2014. arXiv preprint arXiv:1503.02531.
291
+
292
+ Geoffrey E. Hinton, Simon Osindero, and Yee-Whye Teh. A fast learning algorithm for deep belief nets. Neural Comput., 18(7):1527–1554, 2006.
293
+
294
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. arXiv preprint arXiv:1412.6980.
295
+
296
+ Svetlana Kiritchenko, Xiaodan Zhu, and Saif M. Mohammad. Sentiment analysis of short informal texts. Journal of Artificial Intelligence Research, 50:723–762, 2014.
297
+
298
+ Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In Advances in neural information processing systems, pp. 3294–3302, 2015.
299
+
300
+ Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on Challenges in Representation Learning, ICML, volume 3, pp. 2, 2013.
301
+
302
+ David Lopez-Paz, Leon Bottou, Bernhard Sch ´ olkopf, and Vladimir Vapnik. Unifying distillation and ¨ privileged information. In ICLR’16, 2016. arXiv preprint arXiv:1511.03643.
303
+
304
+ Eran Malach and Shai Shalev-Shwartz. Decoupling” when to update” from” how to update”. In NIPS2017, 2017.
305
+
306
+ Alexander G. de G. Matthews, Mark van der Wilk, Tom Nickson, Keisuke. Fujii, Alexis Boukouvalas, Pablo Leon-Villagr ´ a, Zoubin Ghahramani, and James Hensman. GPflow: A Gaussian process library ´ using TensorFlow. Journal of Machine Learning Research, 18(40):1–6, 2017.
307
+
308
+ Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S. Corrado, and Jeff Dean. Distributed Representations of Words and Phrases and their Compositionality. In NIPS ’13, pp. 3111–3119, 2013.
309
+
310
+ Bonan Min, Ralph Grishman, Li Wan, Chang Wang, and David Gondek. Distant supervision for relation extraction with an incomplete knowledge base. In HLT-NAACL, pp. 777–782, 2013.
311
+
312
+ Mike Mintz, Steven Bills, Rion Snow, and Dan Jurafsky. Distant supervision for relation extraction without labeled data. In ACL, pp. 1003–1011, 2009.
313
+
314
+ Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pp. 807–814, 2010.
315
+
316
+ Preslav Nakov, Alan Ritter, Sara Rosenthal, Fabrizio Sebastiani, and Veselin Stoyanov. Semeval-2016 task 4: Sentiment analysis in twitter. Proceedings of SemEval, pp. 1–18, 2016.
317
+
318
+ Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pp. 69–84. Springer, 2016.
319
+
320
+ Alexander G. Ororbia II, C. Lee Giles, and David Reitter. Learning a deep hybrid model for semisupervised text classification. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2015.
321
+
322
+ Nicolas Papernot, Mart´ın Abadi, Ulfar Erlingsson, Ian Goodfellow, and Kunal Talwar. Semi-supervised ´ knowledge transfer for deep learning from private training data. In ICLR, 2017. arXiv preprint arXiv:1610.05755.
323
+
324
+ Greg Pass, Abdur Chowdhury, and Cayley Torgeson. A picture of search. In InfoScale ’06, 2006.
325
+
326
+ Giorgio Patrini, Frank Nielsen, Richard Nock, and Marcello Carioni. Loss factorization, weakly supervised learning and label noise robustness. In International Conference on Machine Learning, pp. 708–717, 2016.
327
+
328
+ Giorgio Patrini, Alessandro Rozza, Aditya Menon, Richard Nock, and Lizhen Qu. Making neural networks robust to label noise: a loss correction approach. In CVPR, 2017. arXiv preprint arXiv:1609.03683.
329
+
330
+ Aditi Raghunathan, Roy Frostig, John Duchi, and Percy Liang. Estimation from indirect supervision with linear moments. In International Conference on Machine Learning, pp. 2568–2577, 2016.
331
+
332
+ Alexander J. Ratner, Christopher M. De Sa, Sen Wu, Daniel Selsam, and Christopher Re. Data ´ programming: Creating large training sets, quickly. In Advances in Neural Information Processing Systems, pp. 3567–3575, 2016.
333
+
334
+ Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. In ICLR2015- Workshop, 2015.
335
+
336
+ Theodoros Rekatsinas, Xu Chu, Ihab F. Ilyas, and Christopher Re. Holoclean: Holistic data repairs ´ with probabilistic inference. PVLDB, 10(11):1190–1201, 2017.
337
+
338
+ Stefan Riezler, Patrick Simianer, and Carolin Haas. Response-based learning for grounded machine translation. In ACL (1), pp. 881–891, 2014.
339
+
340
+ Stephen Robertson and Hugo Zaragoza. The probabilistic relevance framework: $\mathrm { B m } 2 5$ and beyond. Foundations and Trends in Information Retrieval, 3(4):333–389, 2009.
341
+
342
+ Chuck Rosenberg, Martial Hebert, and Henry Schneiderman. Semi-supervised self-training of object detection models. In Seventh IEEE Workshop on Applications of Computer Vision, 2005.
343
+
344
+ Sara Rosenthal, Preslav Nakov, Svetlana Kiritchenko, Saif M. Mohammad, Alan Ritter, and Veselin Stoyanov. Semeval-2015 task 10: Sentiment analysis in twitter. In Proceedings of the 9th international workshop on semantic evaluation (SemEval 2015), pp. 451–463, 2015.
345
+
346
+ Dan Roth. Incidental supervision: Moving beyond supervised learning. In AAAI, pp. 4885–4890, 2017.
347
+
348
+ Mickael Rouvier and Benoit Favre. Sensei-lif at semeval-2016 task 4: Polarity embedding fusion for robust sentiment analysis. Proceedings of SemEval, pp. 202–208, 2016.
349
+
350
+ Gerard Salton and Chung-Shu Yang. On the specification of term values in automatic indexing. Journal of documentation, 29(4):351–372, 1973.
351
+
352
+ Aliaksei Severyn and Alessandro Moschitti. Twitter sentiment analysis with deep convolutional neural networks. In Proceedings of the 38th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 959–962. ACM, 2015a.
353
+
354
+ Aliaksei Severyn and Alessandro Moschitti. Unitn: Training deep convolutional neural network for twitter sentiment classification. In Proceedings of the 9th International Workshop on Semantic Evaluation (SemEval 2015), Association for Computational Linguistics, Denver, Colorado, pp. 464–469, 2015b.
355
+
356
+ Yirong Shen, Matthias Seeger, and Andrew Y. Ng. Fast gaussian process regression using kd-trees. In Advances in neural information processing systems, pp. 1225–1232, 2006.
357
+
358
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1): 1929–1958, 2014.
359
+
360
+ Russell Stewart and Stefano Ermon. Label-free supervision of neural networks with physics and domain knowledge. In AAAI, pp. 2576–2582, 2017.
361
+
362
+ Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. In Workshop contribution at ICLR 2015, 2015.
363
+
364
+ Yuan Tang. Tf.learn: Tensorflow’s high-level module for distributed machine learning. arXiv preprint arXiv:1612.04251, 2016.
365
+
366
+ Michalis K. Titsias. Variational learning of inducing variables in sparse gaussian processes. In International Conference on Artificial Intelligence and Statistics, pp. 567–574, 2009.
367
+
368
+ Arash Vahdat. Toward robustness against label noise in training deep discriminative neural networks. In NIPS ’17, 2017.
369
+
370
+ Vladimir Vapnik and Rauf Izmailov. Learning using privileged information: similarity control and knowledge transfer. Journal of machine learning research, 16(20232049):55, 2015.
371
+
372
+ Vladimir Vapnik and Akshay Vashist. A new learning paradigm: Learning using privileged information. Neural networks, 22(5):544–557, 2009.
373
+
374
+ Vladimir N. Vapnik. Statistical Learning Theory. Wiley-Interscience, 1998.
375
+
376
+ Paroma Varma, Bryan He, Dan Iter, Peng Xu, Rose Yu, Christopher De Sa, and Christopher Re. Socratic ´ learning: Correcting misspecified generative models using discriminative models. arXiv preprint arXiv:1610.08123, 2017.
377
+
378
+ Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In The Conference on Computer Vision and Pattern Recognition, 2017.
379
+
380
+ Martin J. Wainwright, Michael I. Jordan, and John C. Duchi. Privacy aware learning. In Advances in Neural Information Processing Systems, pp. 1430–1438, 2012.
381
+
382
+ Jason Weston, Fred´ eric Ratle, Hossein Mobahi, and Ronan Collobert. Deep learning via semi- ´ supervised embedding. In Neural Networks: Tricks of the Trade, pp. 639–655. Springer, 2012.
383
+
384
+ Andrew Gordon Wilson and Hannes Nickisch. Kernel interpolation for scalable structured gaussian processes (kiss-gp). In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, pp. 1775–1784, 2015.
385
+
386
+ # APPENDICES
387
+
388
+ We moved additional details to the appendices in order to keep the main text focused on the overall idea of the Fidelity-Weighted Learning approach. Specifically, we include further details on the clustered Gaussian process approach (Appendix A); on the student network architectures (Appendix B); on the teacher Gaussian process model (Appendix C); on the weak annotators (Appendix D); on the experimental data and setup (Appendix E); and on the connection to “learning with privileged information” (Appendix F).
389
+
390
+ # A DETAILED DESCRIPTION OF CLUSTERED GP
391
+
392
+ We suggest using several ${ \mathcal { G P } } { = } \{ G P _ { c _ { i } } \}$ to explore the entire data space more effectively. Even though inducing points and stochastic methods make $\mathcal { G P s }$ more scalable we still observed poor performance when the entire dataset was modeled by a single ${ \mathcal { G P } }$ . Therefore, the reason for using multiple $\mathcal { G P s }$ is mainly empirical inspired by (Shen et al., 2006) which is explained in the following:
393
+
394
+ We used Sparse Gaussian Process implemented in GPflow. The algorithm is scalable in the sense that it is not $O ( N ^ { 3 } )$ as original $\mathcal { G P }$ is. It introduces inducing points in the data space and defines a variational lower bound for the marginal likelihood. The variational bound can now be optimized by stochastic methods which make the algorithm applicable in large datasets. However, the tightness of the bound depends on the location of inducing points which are found through the optimization process. We empirically observed that a single $\mathcal { G P }$ does not give a satisfactory accuracy on left-out test dataset. We hypothesized that this can be due to the inability of the algorithm to find good inducing points when the number of inducing points is restricted to just a few. Then we increased the number of inducing points $M$ which trades off the scalability of the algorithm because it scales with $O ( N M ^ { 2 } )$ . Moreover, apart from scalability which is partly solved by stochastic methods, we argue that the structure of the entire space may not be explored well by a single ${ \mathcal { G P } }$ and its inducing points. We guess this can be due to the observation that our datasets are distributed in a highly sparse way within the high dimensional embedding space. We also tried to cure the problem by means of PCA to reduce input dimensions and give a denser representation, but it did not result in a considerable improvement. The results are presented in Tabel 3.
395
+
396
+ Table 3: Performance of FWL using a single $\mathcal { G P }$ , a single $\mathcal { G P }$ after applying PCA on the input data, and the clustered $\mathcal { G P }$ as the teacher.
397
+
398
+ <table><tr><td rowspan="3">Method</td><td colspan="4">Document Ranking</td><td colspan="2">Sentiment Classification</td></tr><tr><td colspan="2">Robust04</td><td colspan="2">ClueWeb</td><td>Robust04</td><td>ClueWeb</td></tr><tr><td>MAP</td><td>nDCG@20</td><td>MAP</td><td>nDCG@20</td><td>F1</td><td>F1</td></tr><tr><td>FWLgp</td><td>0.2614</td><td>0.4192</td><td>0.1205</td><td>0.2121</td><td>0.6904</td><td>0.6173</td></tr><tr><td>FWLPCA→9P</td><td>0.2864</td><td>0.4411</td><td>0.1331</td><td>0.2388</td><td>0.7022</td><td>0.6340</td></tr><tr><td>FWLClustered 9P</td><td>0.3124</td><td>0.4607</td><td>0.1472</td><td>0.2453</td><td>0.7470</td><td>0.6830</td></tr></table>
399
+
400
+ We may be able to argue that clustered $\mathcal { G P }$ makes better use of the data structure roughly close to the idea of KISS-GP (Wilson & Nickisch, 2015). In inducing point methods, it is normally assumed that $M \ll N$ $M$ is the number of inducing points and $N$ is the number of training samples) for computational and storage saving. However, we have this intuition that few number of inducing points make the model unable to explore the inherent structure of data. By employing several GPs, we were able to use a large number of inducing points even when $M > N$ $M$ is the total number of inducing points) which seemingly better exploits the structure of datasets. Because our work was not aimed to be a close investigation of GP, we considered clustered $\mathcal { G P }$ as the engineering side of the work which is a tool to give us a measure of confidence. Other tools such as a single $\mathcal { G P }$ with inducing points that form a Kronecker or Toeplitz covariance matrix are also conceivable. Therefore, we do not of course claim that we have proposed a new method of inference for GPs. Here is practical description of clustered $\mathcal { G P }$ algorithm:
401
+
402
+ Clustered $\mathcal { G P }$ : Let $N$ be the size of the dataset on which we train the teacher. Assume we allocate $K$ teachers to the entire data space. Therefore, each ${ \mathcal { G P } }$ sees a dataset of size $n { = } N / K$ . Then we use a simple clustering method (e.g. k-means) to find centroids of $K$ clusters $C _ { 1 } , C _ { 2 } , . . . , C _ { K }$ where $C _ { i }$ consists of samples $\{ x _ { i , 1 } , x _ { i , 2 } , . . . , x _ { i , n } \}$ . We take the centroid $c _ { i }$ of cluster $C _ { i }$ as the representative sample for all its content. Note that $c _ { i }$ does not necessarily belong to $\{ x _ { i , 1 } , x _ { i , 2 } , . . . , x _ { i , n } \}$ . We assign each cluster a $\mathcal { G P }$ trained by samples belonging to that cluster. More precisely, cluster $C _ { i }$ is assigned a $\mathcal { G P }$ whose data points are $\{ x _ { i , 1 } , x _ { i , 2 } , . . . , x _ { i , n } \}$ . Because there is no dependency among different clusters, we train them in parallel to speed-up the procedure more.
403
+
404
+ The pseudo-code of the clustered $\mathcal { G P }$ is presented in Algorithm 2. When the main issue is computational resources (when the number of inducing points for each $\mathcal { G P }$ is large), we can first choose the number $_ n$ which is the maximum size of the dataset on which our resources allow to train a $\mathcal { G P }$ , then find the number of clusters $K = N / n$ accordingly. The rest of the algorithm remains unchanged.
405
+
406
+ # Algorithm 2 Clustered Gaussian processes.
407
+
408
+ 1: Let $N$ be the sample size, $n$ the sample size of each cluster, $K$ the number of clusters, and $c _ { i }$ the center of cluster $_ { i }$ .
409
+ 2: Run K-means with $K$ clusters over all samples with true labels $\mathcal { D } _ { s } = \{ x _ { i } , y _ { i } \}$ .
410
+
411
+ $$
412
+ \mathrm { K - m e a n s } ( x _ { i } ) c _ { 1 } , c _ { 2 } , . . . , c _ { K }
413
+ $$
414
+
415
+ where $c _ { i }$ represents the center of cluster $C _ { i }$ containing samples $D _ { s } ^ { c _ { i } } = \{ x _ { i , 1 } , x _ { i , 2 } , . . . x _ { i , n } \}$ .
416
+
417
+ 3: Assign each of $K$ clusters a Gaussian process and train them in parallel to approximate the label of each sample.
418
+
419
+ $$
420
+ \begin{array} { r c l } { \mathcal { G P } _ { c _ { i } } ( { m } _ { \mathrm { p o s t } } ^ { c _ { i } } , K _ { \mathrm { p o s t } } ^ { c _ { i } } ) } & { = } & { \mathcal { G P } ( { m } _ { \mathrm { p r i o r } } , K _ { \mathrm { p r i o r } } ) | D _ { s } ^ { c _ { i } } = \{ ( \psi ( x _ { s , c _ { i } } ) , y _ { s , c _ { i } } ) \} } \\ { { T } _ { c _ { i } } ( x _ { t } ) } & { = } & { g ( { m } _ { \mathrm { p o s t } } ^ { c _ { i } } ( x _ { t } ) ) } \\ { \Sigma _ { c _ { i } } ( x _ { t } ) } & { = } & { h ( K _ { \mathrm { p o s t } } ^ { c _ { i } } ( x _ { t } , x _ { t } ) ) } \end{array}
421
+ $$
422
+
423
+ where ${ \mathcal G P } _ { c _ { i } }$ is trained on $\mathcal { D } _ { s } ^ { c _ { i } }$ containing samples belonging to the cluster $c _ { i }$ . Other elements are defined in Section 2
424
+
425
+ 4: Use trained teacher $T _ { c _ { i } } ( . )$ to evaluate the soft label and uncertainty for samples from $\mathcal { D } _ { s w }$ to compute $\eta _ { 2 } ( x _ { t } )$ required for step 3 of Algorithm 1. We use $T ( . )$ as a wrapper for all teachers $\{ T _ { c _ { i } } \}$ .
426
+
427
+ # B DETAILED ARCHITECTURE OF THE STUDENTS
428
+
429
+ # B.1 RANKING TASK
430
+
431
+ For the ranking task, the employed student is proposed in (Dehghani et al., 2017d). The first layer of the network models function $\psi$ that learns the representation of the input data samples, i.e. $( q , d ^ { + } , d ^ { - } )$ , and consists of three components: (1) an embedding function $\varepsilon : \mathcal { V } \to \mathbb { R } ^ { m }$ (where $\nu$ denotes the vocabulary set and $m$ is the number of embedding dimensions), (2) a weighting function $\omega : \mathcal { V } \mathbb { R }$ , and (3) a compositionality function $\Theta : ( \mathbb { R } ^ { m } , \mathbb { R } ) ^ { n } \to \mathbb { R } ^ { m }$ . More formally, the function $\psi$ is defined as:
432
+
433
+ $$
434
+ \begin{array} { r l } { \psi ( q , d ^ { + } , d ^ { - } ) = [ \odot _ { i = 1 } ^ { | q | } ( \varepsilon ( t _ { i } ^ { q } ) , \omega ( t _ { i } ^ { q } ) ) \mid \mid } & { } \\ { \odot _ { i = 1 } ^ { | d ^ { + } | } ( \varepsilon ( t _ { i } ^ { d ^ { + } } ) , \omega ( t _ { i } ^ { d ^ { + } } ) ) \mid \mid } & { } \\ { \odot _ { i = 1 } ^ { | d ^ { - } | } ( \varepsilon ( t _ { i } ^ { d ^ { - } } ) , \omega ( t _ { i } ^ { d ^ { - } } ) ) \mid , } & { } \end{array}
435
+ $$
436
+
437
+ where $t _ { i } ^ { q }$ and $t _ { i } ^ { d }$ denote the $i ^ { t h }$ term in query $q$ respectively document $d$ . The embedding function $\varepsilon$ maps each term to a dense $m$ - dimensional real value vector, which is learned during the training phase. The weighting function $\omega$ assigns a weight to each term in the vocabulary. It has been shown that $\omega$ simulates the effect of inverse document frequency (IDF), which is an important feature in information retrieval (Dehghani et al., 2017d).
438
+
439
+ The compositionality function $\odot$ projects a set of $_ n$ embedding-weighting pairs to an $m$ - dimensional representation, independent from the value of $n$ :
440
+
441
+ $$
442
+ \bigcirc _ { i = 1 } ^ { n } ( \varepsilon ( t _ { i } ) , \omega ( t _ { i } ) ) = \frac { \sum _ { i = 1 } ^ { n } \exp ( \omega ( t _ { i } ) ) \cdot \varepsilon ( t _ { i } ) } { \sum _ { j = 1 } ^ { n } \exp ( \omega ( t _ { j } ) ) } ,
443
+ $$
444
+
445
+ which is in fact the normalized weighted element-wise summation of the terms’ embedding vectors. Again, it has been shown that having global term weighting function along with embedding function improves the performance of ranking as it simulates the effect of inverse document frequency (IDF). In our experiments, we initialize the embedding function $\varepsilon$ with word2vec embeddings (Mikolov et al., 2013) pre-trained on Google News and the weighting function $\omega$ with IDF.
446
+
447
+ The representation layer is followed by a simple fully connected feed-forward network with $l$ hidden layers followed by a softmax which receives the vector representation of the inputs processed by the representation learning layer and outputs a prediction $\tilde { y }$ . Each hidden layer $z _ { k }$ in this network computes $z _ { k } = \alpha ( \bar { W _ { k } } z _ { k - 1 } + b _ { k } )$ , where $W _ { k }$ and $b _ { k }$ denote the weight matrix and the bias term corresponding to the $k ^ { t h }$ hidden layer and $\alpha ( . )$ is the non-linearity. These layers follow a sigmoid output. We employ the cross entropy loss:
448
+
449
+ $$
450
+ \mathcal { L } _ { t } = \sum _ { i \in B } [ - y _ { i } \log ( \hat { y } _ { i } ) - ( 1 - y _ { i } ) \log ( 1 - \hat { y } _ { i } ) ] ,
451
+ $$
452
+
453
+ where $B$ is a batch of data samples.
454
+
455
+ # B.2 SENTIMENT CLASSIFICATION TASK
456
+
457
+ The student for the sentiment classification task is a convolutional model which has been shown to perform best in the dataset we used (Deriu et al., 2017; Severyn & Moschitti, 2015a;b; Deriu et al., 2016). The first layer of the network learns the function $\psi$ which maps input sentence $s$ to a vector as its representation consists of an embedding function $\varepsilon : \mathcal { V } \to \mathbb { R } ^ { m }$ , where $\nu$ denotes the vocabulary set and $m$ is the number of embedding dimensions.
458
+
459
+ This function maps the sentence to a matrix $S \in \mathbb { R } ^ { m \times | s | }$ , where each column represents the embedding of a word at the corresponding position in the sentence. Matrix $S$ is passed through a convolution layer. In this layer, a set of $f$ filters is applied to a sliding window of length $h$ over $S$ to generate a feature map matrix $C$ . Each feature map $c _ { i }$ for a given filter $F$ is generated by $\begin{array} { r } { c _ { i } = \sum _ { k , j } S [ i : i + h ] _ { k , j } F _ { k , j } } \end{array}$ , where $S [ i : i + h ]$ denotes the concatenation of word vectors from position $_ { i }$ to $i + h$ . The concatenation of all $c _ { i }$ produces a feature vector $c \in \mathbb { R } ^ { | s | - h + 1 }$ . The vectors $c$ are then aggregated over all $f$ filters into a feature map matrix $C \in \mathbb { R } ^ { f \times ( | s | - h + 1 ) }$ .
460
+
461
+ We also add a bias vector $b \in R ^ { f }$ to the result of a convolution. Each convolutional layer is followed by a non-linear activation function (we use ReLU(Nair & Hinton, 2010)) which is applied element-wise. Afterward, the output is passed to the max pooling layer which operates on columns of the feature map matrix $C$ returning the largest value: $p o o l ( c _ { i } ) : \mathbb { R } ^ { 1 \times ( | s | - h + 1 ) } \to \mathbb { R }$ (see Figure 4). This architecture is similar to the state-of-the-art model for Twitter sentiment classification from Semeval 2015 and 2016 (Severyn & Moschitti, 2015b; Deriu et al., 2016).
462
+
463
+ We initialize the embedding matrix with word2vec embeddings (Mikolov et al., 2013) pretrained on a collection of 50M tweets.
464
+
465
+ The representation layer then is followed by a feed-forward layer similar to the ranking task (with different width and depth) but with softmax instead of sigmoid as the output layer which returns $\hat { y } _ { i }$ , the probability distribution over all three classes. We employ the cross entropy loss:
466
+
467
+ $$
468
+ \mathcal { L } _ { t } = \sum _ { i \in B } \sum _ { k \in K } - y _ { i } ^ { k } \log ( \hat { y } _ { i } ^ { k } ) ,
469
+ $$
470
+
471
+ where $B$ is a batch of data samples, and $K$ is a set of classes.
472
+
473
+ # C DETAILED ARCHITECTURE OF THE TEACHERS
474
+
475
+ We use Gaussian Process as the teacher in all the experiments. For each task, either regression or (multi-class) classification, in order to generate soft labels, we pass the mean of ${ \mathcal { G P } }$ through the same function $g ( . )$ that is applied on the output of the student network for that task, e.g. softmax, or sigmoid. For binary classification or one dimensional regression, $\Sigma ( x _ { t } )$ is scalar and $h ( . )$ is identity. For multi-class classification or multi-dimensional regression tasks, $h ( . )$ is an aggregation function that takes variance over several dimensions and outputs a single measure of variance. As a reasonable choice, the aggregating function $h ( . )$ in our sentiment classification task (three classes) is mean of variances over dimensions.
476
+
477
+ In the teacher, linear combinations of different kernels are used for different tasks in our experiments.
478
+
479
+ Toy Problem: We use standard Gaussian process regression2 with this kernel:
480
+
481
+ $$
482
+ k ( x _ { i } , x _ { j } ) = k _ { \mathrm { R B F } } ( x _ { i } , x _ { j } ) + k _ { \mathrm { W h i t e } } ( x _ { i } , x _ { j } )
483
+ $$
484
+
485
+ Document Ranking: We use sparse variational GP regression3 (Titsias, 2009) with this kernel:
486
+
487
+ $$
488
+ k ( x _ { i } , x _ { j } ) = k _ { \mathrm { M a t e r n 3 / 2 } } ( x _ { i } , x _ { j } ) + k _ { \mathrm { L i n e a r } } ( x _ { i } , x _ { j } ) + k _ { \mathrm { W h i t e } } ( x _ { i } , x _ { j } )
489
+ $$
490
+
491
+ Sentiment Classification: We use sparse variational GP for multiclass classification4 (Hensman et al., 2015) with the following kernel:
492
+
493
+ $$
494
+ k ( x _ { i } , x _ { j } ) = k _ { \mathrm { R B F } } \left( x _ { i } , x _ { j } \right) + k _ { \mathrm { L i n e a r } } \left( x _ { i } , x _ { j } \right) + k _ { \mathrm { W h i t e } } \left( x _ { i } , x _ { j } \right)
495
+ $$
496
+
497
+ where,
498
+
499
+ $$
500
+ { \begin{array} { r l } { k _ { \mathrm { R B F } } ( x _ { i } , x _ { j } ) = \exp \left( { \frac { \left\| x _ { i } - x _ { j } \right\| ^ { 2 } } { 2 l ^ { 2 } } } \right) } & { } \\ { k _ { \mathrm { M a t e r n 3 / 2 } } ( x _ { i } , x _ { j } ) = \left( 1 + { \frac { { \sqrt { 3 } } \left\| x _ { i } - x _ { j } \right\| } { l } } \right) \exp \left( - { \frac { { \sqrt { 3 } } \left\| x _ { i } - x _ { j } \right\| } { l } } \right) } & { } \\ { k _ { \mathrm { L i n e a r } } ( x _ { i } , x _ { j } ) = \sigma _ { 0 } ^ { 2 } + x _ { i } . x _ { j } } & { } \\ { k _ { \mathrm { W h i t e } } ( x _ { i } , x _ { j } ) = c o n s t a n t . v a l u e , } & { { \forall x _ { 1 } = x _ { 2 } \mathrm { a n d } } 0 { \mathrm { ~ o t h e r w i s e } } } \end{array} }
501
+ $$
502
+
503
+ We empirically found $l = 1$ satisfying value for the length scale of RBF and Matern3/2 kernels. We also set $\sigma _ { 0 } = 0$ to obtain a homogeneous linear kernel. The constant value of $K _ { W h i t e } ( . , . )$ determines the level of noise in the labels. This is different from the noise in weak labels. This term explains the fact that even in true labels there might be a trace of noise due to the inaccuracy of human labelers.
504
+
505
+ We set the number of clusters in the clustered $\mathcal { G P }$ algorithm for the ranking task to 50 and for the sentiment classification task to 30.
506
+
507
+ # D WEAK ANNOTATORS
508
+
509
+ # D.1 DOCUMENT RANKING
510
+
511
+ The weak annotator in the document ranking task is BM25 (Robertson & Zaragoza, 2009), a well-known unsupervised retrieval method. This method heuristically scores a given pair of query-document based on the statistics of their matched terms. In the pairwise document ranking setup, $\tilde { y } _ { i }$ for a given sample $x _ { j } = ( q , d ^ { + } , d ^ { - } )$ is the probability of document $d ^ { + }$ being ranked higher than $d ^ { - }$ $: \tilde { y } _ { i } = P _ { q , d ^ { + } , d ^ { - } } = s _ { q , d ^ { + } } / s _ { q , d ^ { + } } + s _ { q , d ^ { - } }$ , where $s _ { q , d }$ is the score obtained from the weak annotator.
512
+
513
+ # D.2 SENTIMENT CLASSIFICATION
514
+
515
+ The weak annotator for the sentiment classification task is a simple lexicon-based method (Hamdan et al., 2013; Kiritchenko et al., 2014). We use SentiWordNet03 (Baccianella et al., 2010) to assign probabilities (positive, negative and neutral) for each token in set $\mathcal { D } _ { w }$ . We use a bag-of-words model for the sentence-level probabilities (i.e. just averaging the distributions of the terms), yielding a noisy label $\tilde { y } _ { i } \in \mathbb { R } ^ { | K | }$ , where $| K | = 3$ is the number of classes. We found empirically that using soft labels from the weak annotator works better than assigning a single hard label.
516
+
517
+ # E DATA COLLECTION, PARAMETERS AND SETUP
518
+
519
+ # E.1 TOY PROBLEM
520
+
521
+ Weak/True Data In all the experiments with the toy problem, we have randomly sampled 100 data points from the weak function and 10 data points from the true function. We introduce a small amount of noise to the observation of the true function to model the noise in the human labeled data.
522
+
523
+ Setup The neural network employed in the toy problem experiments is a simple feed-forward network with the depth of 3 layers and width of 128 neurons per layer. We have used tanh as the nonlinearity for the intermediate layers and a linear output layer. As the optimizer, we used Adam (Kingma & Ba, 2015) and the initial learning rate has been set to 0.001. For the teacher in the toy problem, we fit only one $\mathcal { G P }$ on all the data points (i.e. no clustering). Also during fine-tuning, we set $\beta = 1$ .
524
+
525
+ Setup of experiments in Section 4.2 We fixed everything in the model and tried running the fine-tuning step with different values for $\beta \in \{ 0 . 0 , 0 . 1 , 1 . 0 , 2 . 0 , 5 . 0 \}$ in all the experiments. For the experiments on toy problem in Section 4.2, the reported numbers are averaged over 10 trials. In the first experiment (i.e. Figure 6a), the size of sampled data data is: $| \mathcal { D } _ { s } | = 5 0$ and $\left| \mathcal { D } _ { w } \right| = \mathrm { { 1 0 0 } }$ (Fixed) and for the second one (i.e. Figure 6a): $\left| \mathcal { D } _ { w } \right| = 1 0 0$ and $| \mathcal { D } _ { s } | = 1 0$ (fixed).
526
+
527
+ # E.2 RANKING TASK
528
+
529
+ Collections We use two standard TREC collections for the task of ad-hoc retrieval: The first collection (Robust04) consists of $5 0 0 \mathrm { k }$ news articles from different news agencies as a homogeneous collection. The second collection (ClueWeb) is ClueWeb09 Category B, a large-scale web collection with over 50 million English documents, which is considered as a heterogeneous collection. Spam documents were filtered out using the Waterloo spam scorer 5 (Cormack et al., 2011) with the default threshold $7 0 \%$ .
530
+
531
+ Data with true labels We take query sets that contain human-labeled judgments: a set of 250 queries (TREC topics 301–450 and 601–700) for the Robust04 collection and a set of 200 queries (topics 1-200) for the experiments on the ClueWeb collection. For each query, we take all documents judged as relevant plus the same number of documents judged as non-relevant and form pairwise combinations among them.
532
+
533
+ Data with weak labels We create a query set $Q$ using the unique queries appearing in the AOL query logs (Pass et al., 2006). This query set contains web queries initiated by real users in the AOL search engine that were sampled from a three-month period from March 2006 to May 2006. We applied standard pre-processing Dehghani et al. (2017d;a) on the queries: We filtered out a large volume of navigational queries containing URL substrings (“http”, “www.”, “.com”, “.net”, “.org”, “.edu”). We also removed all non-alphanumeric characters from the queries. For each dataset, we took queries that have at least ten hits in the target corpus using our weak annotator method. Applying all these steps, We collect 6.15 million queries to train on in Robust04 and 6.87 million queries for ClueWeb. To prepare the weakly labeled training set $\mathcal { D } _ { w }$ , we take the top 1,000 retrieved documents using BM25 for each query from training query set $Q$ , which in total leads to $\sim | Q | \dot { \times } 1 0 ^ { 6 }$ training samples.
534
+
535
+ Setup For the evaluation of the whole model, we conducted a 3-fold cross-validation. However, for each dataset, we first tuned all the hyper-parameters of the student in the first step on the set with true labels using batched GP bandits with an expected improvement acquisition function (Desautels et al., 2014) and kept the optimal parameters of the student fixed for all the other experiments. The size and number of hidden layers for the student is selected from $\{ 6 4 , 1 2 8 , 2 5 6 , 5 1 2 \}$ . The initial learning rate and the dropout parameter were selected from $\lbrace 1 0 ^ { - 3 } , 1 0 ^ { - 5 } \rbrace$ and $\{ 0 . 0 , 0 . 2 , 0 . 5 \}$ , respectively. We considered embedding sizes of $\{ 3 0 0 , 5 0 0 \}$ . The batch size in our experiments was set to 128. We use ReLU (Nair & Hinton, 2010) as a non-linear activation function $\alpha$ in student. We use the Adam optimizer (Kingma & Ba, 2015) for training, and dropout (Srivastava et al., 2014) as a regularization technique.
536
+
537
+ At inference time, for each query, we take the top 2,000 retrieved documents using BM25 as candidate documents and re-rank them using the trained models. We use the Indri6 implementation of BM25 with default parameters (i.e., $k _ { 1 } = 1 . 2$ , $b { = } 0 . 7 5$ , and $k _ { 3 } = 1 , 0 0 0$ ).
538
+
539
+ # E.3 SENTIMENT CLASSIFICATION TASK
540
+
541
+ Collections We test our model on the twitter message-level sentiment classification of SemEval-15 Task 10B (Rosenthal et al., 2015). Datasets of SemEval-15 subsume the test sets from previous editions of SemEval, i.e. SemEval-13 and SemEval-14. Each tweet was preprocessed so that URLs and usernames are masked.
542
+
543
+ Data with true labels We use train (9,728 tweets) and development (1,654 tweets) data from SemEval-13 for training and SemEval-13-test (3,813 tweets) for validation. To make your results comparable to the official runs on SemEval we us SemEval-14 (1,853 tweets) and SemEval-15 (2,390 tweets) as test sets (Rosenthal et al., 2015; Nakov et al., 2016).
544
+
545
+ Data with weak labels We use a large corpus containing 50M tweets collected during two months for both, training the word embeddings and creating the weakly annotated set $\mathcal { D } _ { w }$ using the lexicon-based method explained in Section 3.3.
546
+
547
+ Setup Similar to the document ranking task, we tuned hyper-parameters for the student in the first step with respect to the true labels of the validation set using batched GP bandits with an expected improvement acquisition function (Desautels et al., 2014) and kept the optimal parameters fixed for all the other experiments. The size and number of hidden layers for the classifier and is selected from $\{ 3 2 , 6 4 , 1 2 8 \}$ . We tested the model with both, 1 and 2 convolutional layers. The number of convolutional feature maps and the filter width is selected from $\{ 2 0 0 , 3 0 0 \}$ and $\{ 3 , 4 , 5 \}$ , respectively. The initial learning rate and the dropout parameter were selected from $\{ 1 E - 3 , 1 E - 5 \}$ and $\{ \mathrm { \bar { 0 } . 0 , 0 . \bar { 2 } , 0 . 5 } \}$ , respectively. We considered embedding sizes of $\lbrace 1 0 0 , 2 0 0 \rbrace$ and the batch size in these experiments was set to 64. ReLU (Nair & Hinton, 2010) is used as a non-linear activation function in student. Adam optimizer (Kingma & Ba, 2015) is used for training, and dropout (Srivastava et al., 2014) as a regularizer.
548
+
549
+ # F CONNECTION WITH VAPNIK’S LEARNING USING PRIVILEGED INFORMATION
550
+
551
+ In this section, we highlight the connections of our work with Vapnik’s learning using privileged information (LUPI) (Vapnik & Vashist, 2009; Vapnik & Izmailov, 2015). FWL makes use of information from a small set of correctly labeled data to improve the performance of a semi-supervised learning algorithm. The main idea behind LUPI comes from the fact that humans learn much faster than machines. This can be due to the role that an
552
+
553
+ Intelligent Teacher plays in human learning. In this framework, the training data is a collection of triplets
554
+
555
+ $$
556
+ \{ ( x _ { 1 } , y _ { 1 } , x _ { 1 } ^ { * } ) , . . . , ( x _ { n } , y _ { n } , x _ { n } ^ { * } ) \} { \sim } P ^ { n } ( x , y , x ^ { * } )
557
+ $$
558
+
559
+ where each $( x _ { i } , y _ { i } )$ is a pair of feature-label and $\boldsymbol { x } _ { i } ^ { * }$ is the additional information provided by an intelligent teacher to ease the learning process for the student. Additional information for each $( x _ { i } , y _ { i } )$ is available only during training time and the learning machine must only rely on $x _ { i }$ at test time. The theory of LUPI studies how to leverage such a teaching signal $\boldsymbol { x } _ { i } ^ { * }$ to outperform learning algorithms utilizing only the normal features $x _ { i }$ . For example, MRI brain images can be augmented with high-level medical or even psychological descriptions of Alzheimer’s disease to build a classifier that predicts the probability of Alzheimer’s disease from an MRI image at test time. It is known from statistical learning theory (Vapnik, 1998) that the following bound for test error is satisfied with probability $1 - \delta$ :
560
+
561
+ $$
562
+ R ( f ) \leq R _ { n } ( f ) + O { \left( { \left( \frac { | \mathcal { F } | _ { V C } - \log \sigma } { n } \right) } ^ { \alpha } \right) } ,
563
+ $$
564
+
565
+ where $R _ { n } ( f )$ denotes the training error over $n$ samples, $| \mathcal { F } | _ { V C }$ is the VC dimension of the space of functions from which $f$ is chosen, and $\alpha \in [ 0 . 5 , 1 ]$ . When the classes are not separable, $\alpha { = } 0 . 5$ i.e. the machine learns at a slow rate of $O ( n ^ { - 1 / 2 } )$ . For easier problems where classes are separable, $\alpha = 1$ resulting in a learning rate of $O ( n ^ { - 1 } )$ . The difference between these two cases is severe. The same error bound achieved for a separable problem with 10 thousand data points is only obtainable for a non-separable problem when 100 million data points are provided. This is prohibitive even when obtaining large datasets is not so costly. The theory of LUPI shows that an intelligent teacher can reduce $\alpha$ resulting in a faster learning process for the student. In this paper, we proposed a teacher-student framework for semi-supervised learning. Similar to LUPI, in FWL a student is supposed to solve the main prediction task while an intelligent teacher provides additional information to improve its learning. In addition, we first train the student network so that it obtains initial knowledge of weakly labeled data and learns a good data representation. Then the teacher is trained on truly labeled data enjoying the representation learned by the student. This extends LUPI in a way that the teacher provides privileged information that is most useful for the current state of student’s knowledge. FWL also extends LUPI by introducing several teachers each of which is specialized to correct student’s knowledge related to a specific region of the data space.
566
+
567
+ Figure 6(a) provides evidence for the assumption that privileged information in our task can accelerate the learning process of the student. It shows how the privileged information from an intelligent teacher affects the exponent $\alpha$ of the error bound in Equation 10. Figure 6(b) shows the test error for various number of samples $| \mathcal { D } _ { s } |$ with true label. As expected, In both extremes where $| \mathcal { D } _ { s } |$ is too small or too large, the performance of our model becomes close to the models without a teacher. The reason is that student has enough strong samples to learn a good model of true function. In more realistic cases where $\left| \mathcal { D } _ { s } \right| \ll \left| \mathcal { D } _ { w } \right|$ but $| \mathcal { D } _ { s } |$ is still large enough to be informative about $| \mathcal { D } _ { w } |$ , our model gives a lower test error than models without the intelligent teacher.
568
+
569
+ The theory of LUPI was first developed and proved for support vector machines by Vapnik as a method for knowledge transfer. Hinton introduced Dark knowledge as a spiritually close idea in the context of neural networks (Hinton et al., 2006). He proposed to use a large network or an ensemble of networks for training and a smaller network at test time. It turned out that compressing knowledge of a large system into a smaller system can improve the generalization ability. It was shown in (Lopez-Paz et al., 2016) that dark knowledge and LUPI can be unified under a single umbrella, called generalized distillation. The core idea of these models is machinesteaching-machines. As the name suggests, a machine is learning the knowledge embedded in another machine. In our case, student is correcting his knowledge by receiving privileged information about label uncertainty from teacher.
570
+
571
+ Our framework extends the core idea of LUPI in the following directions:
572
+
573
+ • Trainable teacher: It is often assumed that the teacher in LUPI framework has some additional true information. We show that when this extra information is not available, one can still use the LUPI setup and define an implicit teacher whose knowledge is learned from the true data. In this approach, the performance of the final student-teacher system depends on a clever answer to the following question: which information should be considered as the privileged knowledge of teacher.
574
+ • Bayesian teacher: The proposed teacher is Bayesian. It provides posterior uncertainty of the label of each sample.
575
+ • Mutual representation: We introduced module $\psi ( . )$ which learns a mutual embedding (representation) for both student and teacher. This is in particular interesting because it defines a two-way channel between teacher and student.
576
+ • Multiple teachers: We proposed a scalable method to introduce several teachers such that each teacher is specialized in a particular region of the data space.
md/train/BJ_UL-k0b/BJ_UL-k0b.md ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RECASTING GRADIENT-BASED META-LEARNING AS HIERARCHICAL BAYES
2
+
3
+ Erin Grant12, Chelsea $\mathbf { F i n n ^ { 1 2 } }$ , Sergey Levine12, Trevor Darrell12, Thomas Griffiths13
4
+
5
+ 1 Berkeley AI Research (BAIR), University of California, Berkeley
6
+ 2 Department of Electrical Engineering & Computer Sciences, University of California, Berkeley
7
+ 3 Department of Psychology, University of California, Berkeley
8
+
9
+ {eringrant,cbfinn,svlevine,trevor,tom_griffiths}@berkeley.edu
10
+
11
+ # ABSTRACT
12
+
13
+ Meta-learning allows an intelligent agent to leverage prior learning episodes as a basis for quickly improving performance on a novel task. Bayesian hierarchical modeling provides a theoretical framework for formalizing meta-learning as inference for a set of parameters that are shared across tasks. Here, we reformulate the model-agnostic meta-learning algorithm (MAML) of Finn et al. (2017) as a method for probabilistic inference in a hierarchical Bayesian model. In contrast to prior methods for meta-learning via hierarchical Bayes, MAML is naturally applicable to complex function approximators through its use of a scalable gradient descent procedure for posterior inference. Furthermore, the identification of MAML as hierarchical Bayes provides a way to understand the algorithm’s operation as a meta-learning procedure, as well as an opportunity to make use of computational strategies for efficient inference. We use this opportunity to propose an improvement to the MAML algorithm that makes use of techniques from approximate inference and curvature estimation.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ A remarkable aspect of human intelligence is the ability to quickly solve a novel problem and to be able to do so even in the face of limited experience in a novel domain. Such fast adaptation is made possible by leveraging prior learning experience in order to improve the efficiency of later learning. This capacity for meta-learning also has the potential to enable an artificially intelligent agent to learn more efficiently in situations with little available data or limited computational resources (Schmidhuber, 1987; Bengio et al., 1991; Naik & Mammone, 1992).
18
+
19
+ In machine learning, meta-learning is formulated as the extraction of domain-general information that can act as an inductive bias to improve learning efficiency in novel tasks (Caruana, 1998; Thrun & Pratt, 1998). This inductive bias has been implemented in various ways: as learned hyperparameters in a hierarchical Bayesian model that regularize task-specific parameters (Heskes, 1998), as a learned metric space in which to group neighbors (Bottou & Vapnik, 1992), as a trained recurrent neural network that allows encoding and retrieval of episodic information (Santoro et al., 2016), or as an optimization algorithm with learned parameters (Schmidhuber, 1987; Bengio et al., 1992).
20
+
21
+ The model-agnostic meta-learning (MAML) of Finn et al. (2017) is an instance of a learned optimization procedure that directly optimizes the standard gradient descent rule. The algorithm estimates an initial parameter set to be shared among the task-specific models; the intuition is that gradient descent from the learned initialization provides a favorable inductive bias for fast adaptation. However, this inductive bias has been evaluated only empirically in prior work (Finn et al., 2017).
22
+
23
+ In this work, we present a novel derivation of and a novel extension to MAML, illustrating that this algorithm can be understood as inference for the parameters of a prior distribution in a hierarchical Bayesian model. The learned prior allows for quick adaptation to unseen tasks on the basis of an implicit predictive density over task-specific parameters. The reinterpretation as hierarchical Bayes gives a principled statistical motivation for MAML as a meta-learning algorithm, and sheds light on the reasons for its favorable performance even among methods with significantly more parameters.
24
+
25
+ More importantly, by casting gradient-based meta-learning within a Bayesian framework, we are able to improve MAML by taking insights from Bayesian posterior estimation as novel augmentations to the gradient-based meta-learning procedure. We experimentally demonstrate that this enables better performance on a few-shot learning benchmark.
26
+
27
+ # 2 META-LEARNING FORMULATION
28
+
29
+ The goal of a meta-learner is to extract task-general knowledge through the experience of solving a number of related tasks. By using this learned prior knowledge, the learner has the potential to quickly adapt to novel tasks even in the face of limited data or limited computation time.
30
+
31
+ Formally, we consider a dataset $\mathcal { D }$ that defines a distribution over a family of tasks $\tau$ . These tasks share some common structure such that learning to solve a single task has the potential to aid in solving another. Each task $\tau$ defines a distribution over data points $\mathbf { x }$ , which we assume in this work to consist of inputs and either regression targets or classification labels $\mathbf { y }$ in a supervised learning problem (although this assumption can be relaxed to include reinforcement learning problems; e.g., see Finn et al., 2017). The objective of the meta-learner is to be able to minimize a task-specific performance metric associated with any given unseen task from the dataset given even only a small amount of data from the task; i.e., to be capable of fast adaptation to a novel task.
32
+
33
+ In the following subsections, we discuss two ways of formulating a solution to the meta-learning problem: gradient-based hyperparameter optimization and probabilistic inference in a hierarchical Bayesian model. These approaches were developed orthogonally, but, in Section 3.1, we draw a novel connection between the two.
34
+
35
+ # 2.1 META-LEARNING AS GRADIENT-BASED HYPERPARAMETER OPTIMIZATION
36
+
37
+ A parametric meta-learner aims to find some shared parameters $\pmb \theta$ that make it easier to find the right task-specific parameters $\phi$ when faced with a novel task. A variety of meta-learners that employ gradient methods for task-specific fast adaptation have been proposed (e.g., Andrychowicz et al., 2016; Li & Malik, 2017a;b; Wichrowska et al., 2017). MAML (Finn et al., 2017) is distinct in that it provides a gradient-based meta-learning procedure that employs a single additional parameter (the meta-learning rate) and operates on the same parameter space for both meta-learning and fast adaptation. These are necessary features for the equivalence we show in Section 3.1.
38
+
39
+ To address the meta-learning problem, MAML estimates the parameters $\pmb \theta$ of a set of models so that when one or a few batch gradient descent steps are taken from the initialization at $\pmb \theta$ given a small sample of task data $\mathbf { x } _ { j _ { 1 } } , . . . , \mathbf { x } _ { j _ { N } } \sim p _ { T _ { j } } ( \mathbf { x } )$ each model has good generalization performance on another sample $\mathbf { x } _ { j _ { N + 1 } } , . . . , \mathbf { x } _ { j _ { N + M } } \sim p \bar { \mathcal { T } _ { j } } ( \mathbf { x } )$ from the same task. The MAML objective in a maximum likelihood setting is
40
+
41
+ $$
42
+ \mathcal { L } ( \pmb { \theta } ) = \frac { 1 } { J } \sum _ { j } \left[ \frac { 1 } { M } \sum _ { m } - \log p \big ( \mathbf { x } _ { j _ { N + m } } \mid \underbrace { \pmb { \theta } - \alpha \nabla _ { \pmb { \theta } } \frac { 1 } { N } \sum _ { n } - \log p \left( \mathbf { x } _ { j _ { n } } \mid \pmb { \theta } \right) } _ { \phi _ { j } } \big ) \right]
43
+ $$
44
+
45
+ where we use $\phi _ { j }$ to denote the updated parameters after taking a single batch gradient descent step from the initialization at $\pmb { \theta }$ with step size $\alpha$ on the negative log-likelihood associated with the task $\tau _ { j }$ Note that since $\phi _ { j }$ is an iterate of a gradient descent procedure that starts from $\pmb \theta$ , each $\phi _ { j }$ is of the same dimensionality as $\pmb \theta$ . We refer to the inner gradient descent procedure that computes $\mathbf { \bar { \phi } } _ { j }$ as fast adaptation. The computational graph of MAML is given in Figure 1 (left).
46
+
47
+ # 2.2 META-LEARNING AS HIERARCHICAL BAYESIAN INFERENCE
48
+
49
+ An alternative way to formulate meta-learning is as a problem of probabilistic inference in the hierarchical model depicted in Figure 1 (right). In particular, in the case of meta-learning, each task-specific parameter $\phi _ { j }$ is distinct from but should influence the estimation of the parameters $\{ \phi _ { j ^ { \prime } } \mid j ^ { \prime } \neq j \}$ from other tasks. We can capture this intuition by introducing a meta-level parameter $\pmb \theta$ on which each task-specific parameter is statistically dependent. With this formulation, the mutual dependence of the task-specific parameters $\phi _ { j }$ is realized only through their individual dependence on the meta-level parameters $\pmb \theta$ . As such, estimating $\pmb \theta$ provides a way to constrain the estimation of each of the $\phi _ { j }$ .
50
+
51
+ ![](images/3e13a7a914b4674e914e750ae9eb6ad6346ae1c1c514ecb4748bf1c73fe61cd7.jpg)
52
+ Figure 1: (Left) The computational graph of the MAML (Finn et al., 2017) algorithm covered in Section 2.1. Straight arrows denote deterministic computations and crooked arrows denote sampling operations. (Right) The probabilistic graphical model for which MAML provides an inference procedure as described in Section 3.1. In each figure, plates denote repeated computations (left) or factorization (right) across independent and identically distributed samples.
53
+
54
+ Given some data in a multi-task setting, we may estimate $\pmb \theta$ by integrating out the task-specific parameters to form the marginal likelihood of the data. Formally, grouping all of the data from each of the tasks as $\mathbf { X }$ and again denoting by $\mathbf { x } _ { j _ { 1 } } , \dotsc , \mathbf { x } _ { j _ { N } }$ a sample from task $\tau _ { j }$ , the marginal likelihood of the observed data is given by
55
+
56
+ $$
57
+ p \left( \mathbf { X } \mid \theta \right) = \prod _ { j } \left( \int p \left( \mathbf { x } _ { j _ { 1 } } , \ldots , \mathbf { x } _ { j _ { N } } \mid \phi _ { j } \right) p \left( \phi _ { j } \mid \theta \right) \mathrm { d } \phi _ { j } \right) .
58
+ $$
59
+
60
+ Maximizing (2) as a function of $\pmb { \theta }$ gives a point estimate for $\pmb \theta$ , an instance of a method known as empirical Bayes (Bernardo & Smith, 2006; Gelman et al., 2014) due to its use of the data to estimate the parameters of the prior distribution.
61
+
62
+ Hierarchical Bayesian models have a long history of use in both transfer learning and domain adaptation (e.g., Lawrence & Platt, 2004; Yu et al., 2005; Gao et al., 2008; Daumé III, 2009; Wan et al., 2012). However, the formulation of meta-learning as hierarchical Bayes does not automatically provide an inference procedure, and furthermore, there is no guarantee that inference is tractable for expressive models with many parameters such as deep neural networks.
63
+
64
+ # 3 LINKING GRADIENT-BASED META-LEARNING & HIERARCHICAL BAYES
65
+
66
+ In this section, we connect the two independent approaches of Section 2.1 and Section 2.2 by showing that MAML can be understood as empirical Bayes in a hierarchical probabilistic model. Furthermore, we build on this understanding by showing that a choice of update rule for the taskspecific parameters $\phi _ { j }$ (i.e., a choice of inner-loop optimizer) corresponds to a choice of prior over task-specific parameters, $p ( \phi _ { j } \mid \theta )$ .
67
+
68
+ # 3.1 MODEL-AGNOSTIC META-LEARNING AS EMPIRICAL BAYES
69
+
70
+ In general, when performing empirical Bayes, the marginalization over task-specific parameters $\phi _ { j }$ in (2) is not tractable to compute exactly. To avoid this issue, we can consider an approximation that makes use of a point estimate $\hat { \phi } _ { j }$ instead of performing the integration over $\phi$ in (2). Using $\hat { \phi } _ { j }$ as an estimator for each $\phi _ { j }$ , we may write the negative logarithm of the marginal likelihood as
71
+
72
+ $$
73
+ - \log p \left( \mathbf { X } \mid \pmb { \theta } \right) \approx \sum _ { j } \left[ - \log p \left( \mathbf { x } _ { j _ { N + 1 } } , . . . \mathbf { x } _ { j _ { N + M } } \mid \hat { \phi } _ { j } \right) \right] \ .
74
+ $$
75
+
76
+ Setting $\hat { \phi } _ { j } = \pmb { \theta } + \alpha \nabla _ { \pmb { \theta } } \log p ( \mathbf { x } _ { j _ { 1 } } , \dots , \mathbf { x } _ { j _ { N } } \mid \pmb { \theta } )$ for each $j$ in (3) recovers the unscaled form of the one-step MAML objective in (1). This tells us that the MAML objective is equivalent to a maximization with respect to the meta-level parameters $\pmb { \theta }$ of the marginal likelihood $p ( \mathbf { X } \mid \pmb { \theta } )$ , where a point estimate for each task-specific parameter $\phi _ { j }$ is computed via one or a few steps of gradient descent. By taking only a few steps from the initialization at $\pmb \theta$ , the point estimate $\mathbf { \widehat { \phi } } _ { j } ^ { \star }$ trades off
77
+
78
+ <table><tr><td colspan="2">Algorithm MAML-HB()</td></tr><tr><td colspan="2">Initialize 0 randomly</td></tr><tr><td>while not converged do</td><td></td></tr><tr><td></td><td>Draw J samples Ti,...,TJ ~ pg(T)</td></tr><tr><td></td><td>Estimate Ex~pt (x)[-logp(x|0)],..,Ex~pT(x)[-logp(x |0)] using ML-.</td></tr><tr><td>Update0 ←0-β ∀θ∑jEx~pTj(x)[-logp(x|θ)]</td><td></td></tr><tr><td colspan="2">end</td></tr></table>
79
+
80
+ Algorithm 2: Model-agnostic meta-learning as hierarchical Bayesian inference. The choices of the subroutine $\mathrm { M L } - \cdot \cdot$ that we consider are defined in Subroutine 3 and Subroutine 4.
81
+
82
+ <table><tr><td>Subroutine ML-POINT (0,T) Draw N samples X1,...,XN ~ pτ(x)</td></tr><tr><td>Initialize←0</td></tr><tr><td>for k in 1,...,K do</td></tr><tr><td>Update 𝜙 ←Φ+α∀logp(x1,...,Xn|Φ)</td></tr><tr><td>end</td></tr><tr><td>Draw M samples XN+1,...,XN+M ~ PT(x) return -log p(xN+1,...,Xn+m|𝜙)</td></tr></table>
83
+
84
+ Subroutine 3: Subroutine for computing a point estimate $\hat { \phi }$ using truncated gradient descent to approximate the marginal negative log likelihood (NLL).
85
+
86
+ minimizing the fast adaptation objective $- \log p ( \mathbf { x } _ { j _ { 1 } } , \ldots , \mathbf { x } _ { j _ { N } } \mid \pmb { \theta } )$ with staying close in value to the parameter initialization $\pmb \theta$ .
87
+
88
+ We can formalize this trade-off by considering the linear regression case. Recall that the maximum a posteriori (MAP) estimate of $\phi _ { j }$ corresponds to the global mode of the posterior $p ( \phi _ { j } \mid _ { \mathbf { x } _ { j _ { 1 } } , \mathbf { \bar { \phi } } _ { \bar { \mathbf { \lambda } } \cdot \mathbf { \lambda } \cdot \mathbf { x } _ { j _ { N } } , \mathbf { \bar { \phi } } \mathbf { \phi } \mathbf { \phi } } \mathbf { \alpha } } p ( \mathbf { \alpha } _ { \mathbf { x } _ { j _ { 1 } } } , \mathbf { \beta } _ { \cdot } \mathbf { \alpha } _ { \cdot } \mathbf { \alpha } _ { \cdot } \mathbf { \alpha } _ { \mathbf { x } _ { j _ { N } } } \mid \phi _ { j } \rangle ) p ( \phi _ { j } \mid \mathbf { \bar { \phi } } \mathbf { \phi } \theta ) .$ . In the case of a linear model, early stopping of an iterative gradient descent procedure to estimate $\phi _ { j }$ is exactly equivalent to MAP estimation of $\phi _ { j }$ under the assumption of a prior that depends on the number of descent steps as well as the direction in which each step is taken. In particular, write the input examples as $\mathbf { X }$ and the vector of regression targets as $\mathbf { y }$ , omit the task index from $\phi$ , and consider the gradient descent update
89
+
90
+ $$
91
+ \begin{array} { l } { \phi _ { ( k ) } = \phi _ { ( k - 1 ) } - \alpha \nabla _ { \phi } \left[ \left\| \mathbf { y } - \mathbf { X } \phi \right\| _ { 2 } ^ { 2 } \right] _ { \phi = \phi _ { ( k - 1 ) } } } \\ { \mathbf { \phi } = \phi _ { ( k - 1 ) } - \alpha \mathbf { X } ^ { \mathrm { T } } \left( \mathbf { X } \phi _ { ( k - 1 ) } - \mathbf { y } \right) } \end{array}
92
+ $$
93
+
94
+ for iteration index $k$ and learning rate $\alpha \in \mathbb { R } ^ { + }$ . Santos (1996) shows that, starting from $\phi _ { ( 0 ) } = \theta$ , $\phi _ { ( k ) }$ in (4) solves the regularized linear least squares problem
95
+
96
+ $$
97
+ \operatorname* { m i n } \left( \lVert \mathbf { y } - \mathbf { X } \phi \rVert _ { 2 } ^ { 2 } + \lVert \pmb { \theta } - \phi \rVert _ { \mathbf { Q } } ^ { 2 } \right)
98
+ $$
99
+
100
+ with $\mathbf { Q }$ -norm defined by $\| \mathbf { z } \| _ { \mathbf { Q } } = \mathbf { z } ^ { \mathrm { T } } \mathbf { Q } ^ { - 1 } \mathbf { z }$ for a symmetric positive definite matrix $\mathbf { Q }$ that depends on the step size $\alpha$ and iteration index $k$ as well as on the covariance structure of $\mathbf { X }$ . We describe the exact form of the dependence in Section 3.2. The minimization in (5) can be expressed as a posterior maximization problem given a conditional Gaussian likelihood over $\mathbf { y }$ and a Gaussian prior over $\phi$ . The posterior takes the form
101
+
102
+ $$
103
+ p \left( \phi \mid \mathbf { X } , \mathbf { y } , \pmb { \theta } \right) \propto \mathcal { N } ( \mathbf { y } ; \mathbf { X } \phi , \mathbb { I } ) \mathcal { N } ( \phi ; \pmb { \theta } , \mathbf { Q } ) .
104
+ $$
105
+
106
+ Since $\phi _ { ( k ) }$ in (4) maximizes (6), we may conclude that $k$ iterations of gradient descent in a linear regression model with squared error exactly computes the MAP estimate of $\phi$ , given a Gaussian-noised observation model and a Gaussian prior over $\phi$ with parameters $\mu _ { 0 } = \pmb \theta$ and $\pmb { \Sigma } _ { 0 } = \mathbf { Q }$ . Therefore, in the case of linear regression with squared error, MAML is exactly empirical Bayes using the MAP estimate as the point estimate of $\phi$ .
107
+
108
+ In the nonlinear case, MAML is again equivalent to an empirical Bayes procedure to maximize the marginal likelihood that uses a point estimate for $\phi$ computed by one or a few steps of gradient descent. However, this point estimate is not necessarily the global mode of a posterior. We can instead understand the point estimate given by truncated gradient descent as the value of the mode of an implicit posterior over $\phi$ resulting from an empirical loss interpreted as a negative log-likelihood, and regularization penalties and the early stopping procedure jointly acting as priors (for similar interpretations, see Sjöberg & Ljung, 1995; Bishop, 1995; Duvenaud et al., 2016).
109
+
110
+ The exact equivalence between early stopping and a Gaussian prior on the weights in the linear case, as well as the implicit regularization to the parameter initialization the nonlinear case, tells us that every iterate of truncated gradient descent is a mode of an implicit posterior. In particular, we are not required to take the gradient descent procedure of fast adaptation that computes $\hat { \phi }$ to convergence in order to establish a connection between MAML and hierarchical Bayes. MAML can therefore be understood to approximate an expectation of the marginal negative log likelihood (NLL) for each task $\tau _ { j }$ as
111
+
112
+ $$
113
+ \mathbb { E } _ { \mathbf { x } \sim p _ { T _ { j } } ( \mathbf { x } ) } \left[ - \log p \left( \mathbf { x } \mid \pmb { \theta } \right) \right] \approx \frac { 1 } { M } \sum _ { m } - \log p \left( \mathbf { x } _ { j _ { N + m } } \mid \hat { \phi } _ { j } \right)
114
+ $$
115
+
116
+ using the point estimate $\hat { \phi } _ { j } = \pmb { \theta } + \alpha \nabla _ { \pmb { \theta } } \log p ( \mathbf { x } _ { j _ { n } } \mid \pmb { \theta } )$ for single-step fast adaptation.
117
+
118
+ The algorithm for MAML as probabilistic inference is given in Algorithm 2; Subroutine 3 computes each marginal NLL using the point estimate of $\hat { \phi }$ as just described. Formulating MAML in this way, as probabilistic inference in a hierarchical Bayesian model, motivates the interpretation in Section 3.2 of using various meta-optimization algorithms to induce a prior over task-specific parameters.
119
+
120
+ # 3.2 THE PRIOR OVER TASK-SPECIFIC PARAMETERS
121
+
122
+ From Section 3.1, we may conclude that early stopping during fast adaptation is equivalent to a specific choice of a prior over task-specific parameters, $p \bar { ( \phi _ { j } \mid \theta ) }$ . We can better understand the role of early stopping in defining the task-specific parameter prior in the case of a quadratic objective. Omit the task index from $\phi$ and $\mathbf { x }$ , and consider a second-order approximation of the fast adaptation objective $\ell ( \phi ) = - \log p ( \mathbf { x } _ { 1 } \ldots , \mathbf { x } _ { N } \mid \phi )$ about a minimum $\phi ^ { * }$ :
123
+
124
+ $$
125
+ \begin{array} { r } { \ell ( \phi ) \approx \tilde { \ell } ( \phi ) : = \frac 1 2 \| \phi - \phi ^ { * } \| _ { \ H ^ { - 1 } } ^ { 2 } + \ell ( \phi ^ { * } ) } \end{array}
126
+ $$
127
+
128
+ where the Hessian $\mathbf { H } = \nabla _ { \phi } ^ { 2 } \ell ( \phi ^ { * } )$ is assumed to be positive definite so that $\tilde { \ell }$ is bounded below. Furthermore, consider using a curvature matrix $\boldsymbol { B }$ to precondition the gradient in gradient descent, giving the update
129
+
130
+ $$
131
+ \phi _ { ( k ) } = \phi _ { ( k - 1 ) } - B \nabla _ { \phi } \tilde { \ell } \big ( \phi _ { ( k - 1 ) } \big ) \mathrm { ~ . ~ }
132
+ $$
133
+
134
+ If $\boldsymbol { B }$ is diagonal, we can identify (8) as a Newton method with a diagonal approximation to the inverse Hessian; using the inverse Hessian evaluated at the point $\phi _ { ( k - 1 ) }$ recovers Newton’s method itself. On the other hand, meta-learning the matrix $\boldsymbol { B }$ matrix via gradient descent provides a method to incorporate task-general information into the covariance of the fast adaptation prior, $p ( \phi \mid \theta )$ . For instance, the meta-learned matrix $\boldsymbol { B }$ may encode correlations between parameters that dictates how such parameters are updated relative to each other.
135
+
136
+ Formally, taking $k$ steps of gradient descent from $\phi _ { ( 0 ) } = \theta$ using the update rule in (8) gives a $\phi _ { ( k ) }$ that solves
137
+
138
+ $$
139
+ \operatorname* { m i n } \left( \lVert \phi - \phi ^ { * } \rVert _ { \mathbf { H } ^ { - 1 } } ^ { 2 } + \lVert \phi _ { ( 0 ) } - \phi \rVert _ { \mathbf { Q } } ^ { 2 } \right) \ .
140
+ $$
141
+
142
+ The minimization in (9) corresponds to taking a Gaussian prior $p ( \phi \mid \theta )$ with mean $\pmb { \theta }$ and covariance $\mathbf { Q }$ for $\mathbf { Q } = \mathbf { O } \mathbf { A } ^ { - 1 } ( ( \mathbb { I } - \mathbf { B } \mathbf { A } ) ^ { - k } - \mathbb { I } ) \breve { \mathbf { O } } ^ { \mathrm { T } }$ (Santos, 1996) where $\mathbf { B }$ is a diagonal matrix that results from a simultaneous diagonalization of $\mathbf { H }$ and $\boldsymbol { B }$ as $\mathbf { O } ^ { \mathrm { T } } \mathbf { H } \mathbf { O } = \mathrm { d i a g } ( \lambda _ { 1 } , \dots , \lambda _ { n } ) = \Lambda$ and $\mathbf { O } ^ { \mathrm { T } } { \mathcal { B } } ^ { - 1 } \mathbf { O } = \mathrm { d i a g } ( b _ { 1 } , \dots , b _ { n } ) = \mathbf { B }$ with $b _ { i } , \lambda _ { i } \geq 0$ for $i = 1 , \ldots , n$ (Theorem 8.7.1 in Golub $\&$ Van Loan, 1983). If the true objective is indeed quadratic, then, assuming the data is centered, $\mathbf { H }$ is the unscaled covariance matrix of features, $\mathbf { X } ^ { \mathrm { { T } } } \mathbf { X }$ .
143
+
144
+ # 4 IMPROVING MODEL-AGNOSTIC META-LEARNING
145
+
146
+ Identifying MAML as a method for probabilistic inference in a hierarchical model allows us to develop novel improvements to the algorithm. In Section 4.1, we consider an approach from Bayesian parameter estimation to improve the MAML algorithm, and in Section 4.2, we discuss how to make this procedure computationally tractable for high-dimensional models.
147
+
148
+ # 4.1 LAPLACE’S METHOD OF INTEGRATION
149
+
150
+ We have shown that the MAML algorithm is an empirical Bayes procedure that employs a point estimate for the mid-level, task-specific parameters in a hierarchical Bayesian model. However, the use of this point estimate may lead to an inaccurate point approximation of the integral in (2) if the posterior over the task-specific parameters, $p \big ( \phi _ { j } \mid \mathbf { x } _ { j _ { N + 1 } } , \cdot \cdot \cdot , \mathbf { x } _ { j _ { N + M } } , \pmb { \theta } \big )$ , . . . , xjN+M , θ ), is not sharply peaked at the value of the point estimate. The Laplace approximation (Laplace, 1986; MacKay, 1992b;a) is applicable in this case as it replaces a point estimate of an integral with the volume of a Gaussian centered at a mode of the integrand, thereby forming a local quadratic approximation.
151
+
152
+ We can make use of this approximation to incorporate uncertainty about the task-specific parameters into the MAML algorithm at fast adaptation time. In particular, suppose that each integrand in (2) has a mode $\boldsymbol { \phi } _ { j } ^ { * }$ at which it is locally well-approximated by a quadratic function. The Laplace approximation uses a second-order Taylor expansion of the negative log posterior in order to approximate each integral in the product in (2) as
153
+
154
+ $$
155
+ \int p \left( { \bf X } _ { j } \mid \phi _ { j } \right) p \left( \phi _ { j } \mid \theta \right) \mathrm { d } \phi _ { j } \approx p \left( { \bf X } _ { j } \mid \phi _ { j } ^ { * } \right) p \left( \phi _ { j } ^ { * } \mid \theta \right) \operatorname * { d e t } ( { \bf H } _ { j } / 2 \pi ) ^ { - \frac { 1 } { 2 } }
156
+ $$
157
+
158
+ where $\mathbf { H } _ { j }$ is the Hessian matrix of second derivatives of the negative log posterior.
159
+
160
+ Classically, the Laplace approximation uses the MAP estimate for $\boldsymbol { \phi } _ { j } ^ { * }$ , although any mode can be used as an expansion site provided the integrand is well enough approximated there by a quadratic. We use the point estimate $\hat { \phi } _ { j }$ uncovered by fast adaptation, in which case the MAML objective in (1) becomes an appropriately scaled version of the approximate marginal likelihood
161
+
162
+ $$
163
+ - \log p \left( \mathbf { X } \mid \theta \right) \approx \sum _ { j } \left[ - \log p \left( \mathbf { X } _ { j } \mid \hat { \phi } _ { j } \right) - \log p \left( \hat { \phi } _ { j } \mid \theta \right) + \frac { 1 } { 2 } \log \operatorname* { d e t } ( \mathbf { H } _ { j } ) \right] .
164
+ $$
165
+
166
+ The term $\log p ( \hat { \phi } _ { j } \mid \pmb \theta )$ results from the implicit regularization imposed by early stopping during fast adaptation, as discussed in Section 3.1. The term $\mathbf { \omega } ^ { 1 } / 2 \log \operatorname* { d e t } ( \mathbf { H } _ { j } )$ , on the other hand, results from the Laplace approximation and can be interpreted as a form of regularization that penalizes model complexity.
167
+
168
+ # 4.2 USING CURVATURE INFORMATION TO IMPROVE MAML
169
+
170
+ Using (11) as a training criterion for a neural network model is difficult due to the required computation of the determinant of the Hessian of the log posterior $\mathbf { H } _ { j }$ , which itself decomposes into a sum of the Hessian of the log likelihood and the Hessian of the log prior as
171
+
172
+ $$
173
+ \mathbf { H } _ { j } = \nabla _ { \phi _ { j } } ^ { 2 } \left[ - \log p \left( \mathbf { X } _ { j } \mid \phi _ { j } \right) \right] + \nabla _ { \phi _ { j } } ^ { 2 } \left[ - \log p \left( \phi _ { j } \mid \theta \right) \right] \ .
174
+ $$
175
+
176
+ In our case of early stopping as regularization, the prior over task-specific parameters $p ( \phi _ { j } \mid \theta )$ is implicit and thus no closed form is available for a general model. Although we may use the quadratic approximation derived in Section 3.2 to obtain an approximate Gaussian prior, this prior is not diagonal and does not, to our knowledge, have a convenient factorization. Therefore, in our experiments, we instead use a simple approximation in which the prior is approximated as a diagonal Gaussian with precision $\tau$ . We keep $\tau$ fixed, although this parameter may be cross-validated for improved performance.
177
+
178
+ <table><tr><td>Subroutine ML-LAPLACE (0,T) Draw N samples X1,...,XN ~ pτ(x)</td></tr><tr><td>Update 𝜙 ←Φ+αVlogp(x1,...,Xn|Φ) end Draw M samples XN+1,...,XN+M ~ pτ(x) Estimate quadratic curvature H return -log p(xn+1,,XN+M |Φ) + nlog det(H)</td></tr></table>
179
+
180
+ Subroutine 4: Subroutine for computing a Laplace approximation of the marginal likelihood.
181
+
182
+ Similarly, the Hessian of the log likelihood is intractable to form exactly for all but the smallest models, and furthermore, is not guaranteed to be positive definite at all points, possibly rendering the Laplace approximation undefined. To combat this, we instead seek a curvature matrix $\hat { \bf H }$ that approximates the quadratic curvature of a neural network objective function. Since it is well-known that the curvature associated with neural network objective functions is highly non-diagonal (e.g., Martens, 2016), a further requirement is that the matrix have off-diagonal terms.
183
+
184
+ Due to the difficulties listed above, we turn to second order gradient descent methods, which precondition the gradient with an inverse curvature matrix at each iteration of descent. The Fisher information matrix (Fisher, 1925) has been extensively used as an approximation of curvature, giving rise to a method known as natural gradient descent (Amari, 1998). A neural network with an appropriate choice of loss function is a probabilistic model and therefore defines a Fisher information matrix. Furthermore, the Fisher information matrix can be seen to define a convex quadratic approximation to the objective function of a probabilistic neural model (Pascanu & Bengio, 2014; Martens, 2014). Importantly for our use case, the Fisher information matrix is positive definite by definition as well as non-diagonal.
185
+
186
+ However, the Fisher information matrix is still expensive to work with. Martens & Grosse (2015) developed Kronecker-factored approximate curvature (K-FAC), a scheme for approximating the curvature of the objective function of a neural network with a block-diagonal approximation to the Fisher information matrix. Each block corresponds to a unique layer in the network, and each block is further approximated as a Kronecker product (see Van Loan, 2000) of two much smaller matrices by assuming that the second-order statistics of the input activation and the back-propagated derivatives within a layer are independent. These two approximations ensure that the inverse of the Fisher information matrix can be computed efficiently for the natural gradient.
187
+
188
+ For the Laplace approximation, we are interested in the determinant of a curvature matrix instead of its inverse. However, we may also make use of the approximations to the Fisher information matrix from K-FAC as well as properties of the Kronecker product. In particular, we use the fact that the determinant of a Kronecker product is the product of the exponentiated determinants of each of the factors, and that the determinant of a block diagonal matrix is the product of the determinants of the blocks (Van Loan, 2000). The determinants for each factor can be computed as efficiently as the inverses required by K-FAC, in $\mathcal { O } ( d ^ { 3 } )$ time for a $d$ -dimensional Kronecker factor.
189
+
190
+ We make use of the Laplace approximation and K-FAC to replace Subroutine 3, which computes the task-specific marginal NLLs using a point estimate for $\hat { \phi }$ . We call this method the Lightweight Laplace Approximation for Meta-Adaptation (LLAMA), and give a replacement subroutine in Subroutine 4.
191
+
192
+ # 5 EXPERIMENTAL EVALUATION
193
+
194
+ The goal of our experiments is to evaluate if we can use our probabilistic interpretation of MAML to generate samples from the distribution over adapted parameters, and futhermore, if our method can be applied to large-scale meta-learning problems such as miniImageNet.
195
+
196
+ ![](images/5bdf18425b1a88e41686bfb5c980d314c5b5c945c7b8c77312f705a230c570c0.jpg)
197
+ Figure 5: Our method is able to meta-learn a model that can quickly adapt to sinusoids with varying phases and amplitudes, and the interpretation of the method as hierarchical Bayes makes it practical to directly sample models from the posterior. In this figure, we illustrate various samples from the posterior of a model that is meta-trained on different sinusoids, when presented with a few datapoints (in red) from a new, previously unseen sinusoid. Note that the random samples from the posterior predictive describe a distribution of functions that are all sinusoidal and that there is increased uncertainty when the datapoints are less informative (i.e., when the datapoints are sampled only from the lower part of the range input, shown in the bottom-right example).
198
+
199
+ # 5.1 WARMUP: TOY NONLINEAR MODEL
200
+
201
+ The connection between MAML and hierarchical Bayes suggests that we should expect MAML to behave like an algorithm that learns the mean of a Gaussian prior on model parameters, and uses the mean of this prior as an initialization during fast adaptation. Using the Laplace approximation to the integration over task-specific parameters as in (10) assumes a task-specific parameter posterior with mean at the adapted parameters $\hat { \phi }$ and covariance equal to the inverse Hessian of the log posterior evaluated at the adapted parameter value. Instead of simply using this density in the Laplace approximation as an additional regularization term as in (11), we may sample parameters $\phi _ { j }$ from this density and use each set of sampled parameters to form a set of predictions for a given task.
202
+
203
+ To illustrate this relationship between MAML and hierarchical Bayes, we present a meta-dataset of sinusoid tasks in which each task involves regressing to the output of a sinusoid wave in Figure 5. Variation between tasks is obtained by sampling the amplitude uniformly from [0.1, 5.0] and the phase from $[ 0 , \pi ]$ . During training and for each task, 10 input datapoints are sampled uniformly from $[ - 1 0 . 0 , 1 0 . \dot { 0 } ]$ and the loss is the mean squared error between the prediction and the true value.
204
+
205
+ We observe in Figure 5 that our method allows us to directly sample models from the task-specific parameter distribution after being presented with 10 datapoints from a new, previously unseen sinusoid curve. In particular, the column on the right of Figure 5 demonstrates that the sampled models display an appropriate level of uncertainty when the datapoints are ambiguous (as in the bottom right).
206
+
207
+ # 5.2 LARGE-SCALE EXPERIMENT: miniIMAGENET
208
+
209
+ We evaluate LLAMA on the miniImageNet Ravi & Larochelle (2017) 1-shot, 5-way classification task, a standard benchmark in few-shot classification. miniImageNet comprises 64 training classes, 12 validation classes, and 24 test classes. Following the setup of Vinyals et al. (2016), we structure the $N$ -shot, $J$ -way classification task as follows: The model observes $N$ instances of $J$ unseen classes, and is evaluated on its ability to classify $M$ new instances within the $J$ classes.
210
+
211
+ We use a neural network architecture standard to few-shot classification (e.g., Vinyals et al., 2016; Ravi & Larochelle, 2017), consisting of 4 layers with $3 \times 3$ convolutions and 64 filters, followed by batch normalization (BN) (Ioffe & Szegedy, 2015), a ReLU nonlinearity, and $2 \times 2$ max-pooling. For the scaling variable $\beta$ and centering variable $\gamma$ of BN (see Ioffe & Szegedy, 2015), we ignore the fast adaptation update as well as the Fisher factors for K-FAC. We use Adam (Kingma & Ba, 2014) as the meta-optimizer, and standard batch gradient descent with a fixed learning rate to update the model during fast adaptation. LLAMA requires the prior precision term $\tau$ as well as an additional parameter $\eta \in \bar { \mathbb { R } } ^ { + }$ that weights the regularization term log det $\hat { \bf H }$ contributed by the Laplace approximation. We fix $\tau = 0 . 0 0 1$ and selected $\eta = { { 1 0 } ^ { - 6 } }$ via cross-validation; all other parameters are set to the values reported in Finn et al. (2017).
212
+
213
+ Table 1: One-shot classification performance on the miniImageNet test set, with comparison methods ordered by one-shot performance. All results are averaged over 600 test episodes, and we report ${ \hat { 9 } } 5 \%$ confidence intervals. ∗Results reported by Ravi & Larochelle (2017). $^ { * * } \mathrm { W e }$ report test accuracy for a comparable architecture .1∗∗∗We report test accuracy for models matching train and test “shot” and “way”.
214
+
215
+ <table><tr><td>Model</td><td colspan="2">5-way acc. (%) 1-shot</td></tr><tr><td>Fine-tuning*</td><td>28.86</td><td>士</td><td>0.54</td></tr><tr><td>Nearest Neighbor*</td><td>41.08</td><td>士</td><td>0.70</td></tr><tr><td>Matching Networks FCE (Vinyals et al., 2016)*</td><td>43.56</td><td>士</td><td>0.84</td></tr><tr><td>Meta-LearnerLSTM (Ravi &amp; Larochelle,2017)*</td><td>43.44</td><td>士</td><td>0.77</td></tr><tr><td>SNAIL (Mishra et al., 2018)**</td><td>45.1</td><td>士</td><td></td></tr><tr><td>Prototypical Networks (Snellet al.,2017)***</td><td>46.61</td><td>士</td><td>0.78</td></tr><tr><td>mAP-DLM(Triantafillou et al., 2017)</td><td>49.82</td><td>士</td><td>0.78</td></tr><tr><td>MAML (Finn et al., 2017)</td><td>48.70</td><td>士</td><td>1.84</td></tr><tr><td>LLAMA (Ours)</td><td>49.40</td><td>士</td><td>1.83</td></tr></table>
216
+
217
+ We find that LLAMA is practical enough to be applied to this larger-scale problem. In particular, our TensorFlow implementation of LLAMA trains for 60,000 iterations on one TITAN $\mathrm { X p }$ GPU in 9 hours, compared to 5 hours to train MAML. As shown in Table 1, LLAMA achieves comparable performance to the state-of-the-art meta-learning method by Triantafillou et al. (2017). While the gap between MAML and LLAMA is small, the improvement from the Laplace approximation suggests that a more accurate approximation to the marginalization over task-specific parameters will lead to further improvements.
218
+
219
+ # 6 RELATED WORK
220
+
221
+ Meta-learning and few-shot learning have a long history in hierarchical Bayesian modeling (e.g., Tenenbaum, 1999; Fei-Fei et al., 2003; Lawrence & Platt, 2004; Yu et al., 2005; Gao et al., 2008; Daumé III, 2009; Wan et al., 2012). A related subfield is that of transfer learning, which has used hierarchical Bayes extensively (e.g., Raina et al., 2006). A variety of inference methods have been used in Bayesian models, including exact inference (Lake et al., 2011), sampling methods (Salakhutdinov et al., 2012), and variational methods (Edwards & Storkey, 2017). While some prior works on hierarchical Bayesian models have proposed to handle basic image recognition tasks, the complexity of these tasks does not yet approach the kinds of complex image recognition problems that can be solved by discriminatively trained deep networks, such as the miniImageNet experiment in our evaluation (Mansinghka et al., 2013).
222
+
223
+ Recently, the Omniglot benchmark Lake et al. (2016) has rekindled interest in the problem of learning from few examples. Modern methods accomplish few-shot learning either through the design of network architectures that ingest the few-shot training samples directly (e.g., Koch, 2015; Vinyals et al., 2016; Snell et al., 2017; Hariharan & Girshick, 2017; Triantafillou et al., 2017), or formulating the problem as one of learning to learn, or meta-learning (e.g., Schmidhuber, 1987; Bengio et al., 1991; Schmidhuber, 1992; Bengio et al., 1992). A variety of inference methods have been used in Bayesian models, including exact inference (Lake et al., 2011), sampling methods (Salakhutdinov et al., 2013), and variational methods (Edwards & Storkey, 2017).
224
+
225
+ Our work bridges the gap between gradient-based meta-learning methods and hierarchical Bayesian modeling. Our contribution is not to formulate the meta-learning problem as a hierarchical Bayesian model, but instead to formulate a gradient-based meta-learner as hierarchical Bayesian inference, thus providing a way to efficiently perform posterior inference in a model-agnostic manner.
226
+
227
+ # 7 CONCLUSION
228
+
229
+ We have shown that model-agnostic meta-learning (MAML) estimates the parameters of a prior in a hierarchical Bayesian model. By casting gradient-based meta-learning within a Bayesian framework, our analysis opens the door to novel improvements inspired by probabilistic machinery.
230
+
231
+ As a step in this direction, we propose an extension to MAML that employs a Laplace approximation to the posterior distribution over task-specific parameters. This technique provides a more accurate estimate of the integral that, in the original MAML algorithm, is approximated via a point estimate. We show how to estimate the quantity required by the Laplace approximation using Kroneckerfactored approximate curvature (K-FAC), a method recently proposed to approximate the quadratic curvature of a neural network objective for the purpose of a second-order gradient descent technique.
232
+
233
+ Our contribution illuminates the road to exploring further connections between gradient-based metalearning methods and hierarchical Bayesian modeling. For instance, in this work we assume that the predictive distribution over new data-points is narrow and well-approximated by a point estimate. We may instead employ methods that make use of the variance of the distribution over task-specific parameters in order to model the predictive density over examples from a novel task.
234
+
235
+ Furthermore, it is known that the Laplace approximation is inaccurate in cases where the integral is highly skewed, or is not unimodal and thus is not amenable to approximation by a single Gaussian mode. This could be solved by using a finite mixture of Gaussians, which can approximate many density functions arbitrarily well (Sorenson & Alspach, 1971; Alspach & Sorenson, 1972). The exploration of additional improvements such as this is an exciting line of future work.
236
+
237
+ # REFERENCES
238
+
239
+ Daniel Alspach and Harold Sorenson. Nonlinear Bayesian estimation using Gaussian sum approximations. IEEE Transactions on Automatic Control, 17(4):439–448, 1972.
240
+
241
+ Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural computation, 10(2):251–276, 1998.
242
+
243
+ Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems (NIPS) 29, pp. 3981–3989, 2016.
244
+
245
+ Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Proceedings of the Conference on Optimality in Artificial and Biological Neural Networks, pp. 6–8, 1992.
246
+
247
+ Yoshua Bengio, Samy Bengio, and Jocelyn Cloutier. Learning a synaptic learning rule. In Proceedings of the International Joint Conference on Neural Networks (IJCNN), volume 2, 1991.
248
+
249
+ J.M. Bernardo and A.F.M. Smith. Bayesian Theory. Wiley Series in Probability and Statistics. John Wiley & Sons Canada, Limited, 2006.
250
+
251
+ Christopher M Bishop. Regularization and complexity control in feed-forward networks. In Proceedings of the International Conference on Artificial Neural Networks (ICANN), pp. 141–148, 1995.
252
+
253
+ Léon Bottou and Vladimir Vapnik. Local learning algorithms. Neural computation, 4(6):888–900, 1992.
254
+
255
+ Rich Caruana. Multitask learning. In Learning to learn, pp. 95–133. Springer, 1998.
256
+
257
+ Hal Daumé III. Bayesian multitask learning with latent hierarchies. In Proceedings of the 25th Conference on Uncertainty in Artificial Intelligence (UAI), pp. 135–142, 2009.
258
+
259
+ David Duvenaud, Dougal Maclaurin, and Ryan Adams. Early stopping as nonparametric variational inference. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 1070–1077, 2016.
260
+
261
+ Harrison Edwards and Amos Storkey. Towards a neural statistician. In Proceedings of the 5th International Conference on Learning Representations (ICLR), 2017.
262
+
263
+ Li Fei-Fei et al. A Bayesian approach to unsupervised one-shot learning of object categories. In Proceedings of the 9th Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1134–1141. IEEE, 2003.
264
+
265
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017.
266
+
267
+ Ronald Aylmer Fisher. Theory of statistical estimation. In Mathematical Proceedings of the Cambridge Philosophical Society, volume 22, pp. 700–725. Cambridge University Press, 1925.
268
+
269
+ Jing Gao, Wei Fan, Jing Jiang, and Jiawei Han. Knowledge transfer via multiple model local structure mapping. In Proceedings of the 14th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pp. 283–291. ACM, 2008.
270
+
271
+ Andrew Gelman, John B Carlin, Hal S Stern, David B Dunson, Aki Vehtari, and Donald B Rubin. Bayesian data analysis, volume 2. Chapman and Hall, 2014.
272
+
273
+ Gene H. Golub and Charles F. Van Loan. Matrix computations. The Johns Hopkins University Press, 1983.
274
+
275
+ Bharath Hariharan and Ross Girshick. Low-shot visual object recognition. In Proceedings of the International Conference on Computer Vision (ICCV), 2017.
276
+
277
+ Tom Heskes. Solving a huge number of similar tasks: A combination of multi-task learning and a hierarchical Bayesian approach. In Proceedings of the 15th International Conference on Machine Learning (ICML), pp. 233–241, 1998.
278
+
279
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning (ICML), pp. 448–456, 2015.
280
+
281
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations (ICLR), 2014.
282
+
283
+ Gregory Koch. Siamese neural networks for one-shot image recognition. Master’s thesis, University of Toronto, 2015.
284
+
285
+ Brenden M Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua B Tenenbaum. One shot learning of simple visual concepts. In Proceedings of the 33rd Annual Meeting of the Cognitive Science Society (CogSci), 2011.
286
+
287
+ Brenden M Lake, Tomer D Ullman, Joshua B Tenenbaum, and Samuel J Gershman. Building machines that learn and think like people. Behavioral and Brain Sciences, pp. 1–101, 2016.
288
+
289
+ Pierre Simon Laplace. Memoir on the probability of the causes of events. Statistical Science, 1(3):364–378, 1986.
290
+
291
+ Neil D Lawrence and John C Platt. Learning to learn with the informative vector machine. In Proceedings of the 21st International Conference on Machine Learning (ICML), pp. 65, 2004.
292
+
293
+ Ke Li and Jitendra Malik. Learning to optimize. In Proceedings of the 5th International Conference on Learning Representations (ICLR), 2017a.
294
+
295
+ Ke Li and Jitendra Malik. Learning to optimize neural nets. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017b.
296
+
297
+ David MacKay. A practical Bayesian framework for backpropagation networks. Neural computation, 4(3): 448–472, 1992a.
298
+
299
+ David JC MacKay. The evidence framework applied to classification networks. Neural computation, 4(5): 720–736, 1992b.
300
+
301
+ Vikash K Mansinghka, Tejas D Kulkarni, Yura N Perov, and Josh Tenenbaum. Approximate bayesian image interpretation using generative probabilistic graphics programs. In Advances in Neural Information Processing Systems, pp. 1520–1528, 2013.
302
+
303
+ James Martens. New insights and perspectives on the natural gradient method. arXiv preprint arXiv:1412.1193, 2014.
304
+
305
+ James Martens. Second-order optimization for neural networks. PhD thesis, University of Toronto, 2016.
306
+
307
+ James Martens and Roger Grosse. Optimizing neural networks with Kronecker-factored approximate curvature. In Proceedings of the 32nd International Conference on Machine Learning (ICML), pp. 2408–2417, 2015.
308
+
309
+ Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. Meta-learning with temporal convolutions. arXiv preprint arXiv:1707.03141, 2017.
310
+
311
+ Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive meta-learner. In Proceedings of the 6th International Conference on Learning Representations (ICLR), 2018.
312
+
313
+ Tsendsuren Munkhdalai and Hong Yu. Meta networks. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017.
314
+
315
+ Devang K Naik and RJ Mammone. Meta-neural networks that learn by learning. In Proceedings of the International Joint Conference on Neural Networks (IJCNN), pp. 437–442, 1992.
316
+
317
+ Razvan Pascanu and Yoshua Bengio. Revisiting natural gradient for deep networks. In Proceedings of the 4th International Conference on Learning Representations (ICLR), 2014.
318
+
319
+ Rajat Raina, Andrew $\mathrm { ~ Y ~ N ~ g ~ } _ { }$ , and Daphne Koller. Constructing informative priors using transfer learning. In Proceedings of the $2 3 r d$ International Conference on Machine Learning (ICML), pp. 713–720, 2006.
320
+
321
+ Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In Proceedings of the 5th International Conference on Learning Representations (ICLR), 2017.
322
+
323
+ Ruslan Salakhutdinov, Joshua Tenenbaum, and Antonio Torralba. One-shot learning with a hierarchical nonparametric bayesian model. In Proceedings of ICML Workshop on Unsupervised and Transfer Learning, pp. 195–206, 2012.
324
+
325
+ Ruslan Salakhutdinov, Joshua B Tenenbaum, and Antonio Torralba. Learning with hierarchical-deep models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1958–1971, 2013.
326
+
327
+ Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Meta-learning with memory-augmented neural networks. In Proceedings of the 33rd International Conference on Machine Learning (ICML), pp. 1842–1850, 2016.
328
+
329
+ Reginaldo J. Santos. Equivalence of regularization and truncated iteration for general ill-posed problems. Linear Algebra and its Applications, 236(15):25–33, 1996.
330
+ Jürgen Schmidhuber. Evolutionary principles in self-referential learning. PhD thesis, Institut für Informatik, Technische Universität München, 1987.
331
+ Jürgen Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992.
332
+ Jonas Sjöberg and Lennart Ljung. Overtraining, regularization and searching for a minimum, with application to neural networks. International Journal of Control, 62(6):1391–1407, 1995.
333
+ Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems (NIPS) 30, 2017.
334
+ Harold W Sorenson and Daniel L Alspach. Recursive Bayesian estimation using Gaussian sums. Automatica, 7 (4):465–479, 1971.
335
+ Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip H. S. Torr, and Timothy M. Hospedales. Learning to compare: Relation network for few-shot learning. CoRR, abs/1711.06025, 2017.
336
+ Joshua B Tenenbaum. A Bayesian framework for concept learning. PhD thesis, Massachusetts Institute of Technology, 1999.
337
+ Sebastian Thrun and Lorien Pratt. Learning to learn. Kluwer Academic Publishers, 1998.
338
+ Eleni Triantafillou, Richard Zemel, and Raquel Urtasun. Few-shot learning through an information retrieval lens. In Advances in Neural Information Processing Systems (NIPS) 30, 2017.
339
+ Charles F Van Loan. The ubiquitous Kronecker product. Journal of computational and applied mathematics, 123(1):85–100, 2000.
340
+ Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems (NIPS) 29, pp. 3630–3638, 2016.
341
+ Jing Wan, Zhilin Zhang, Jingwen Yan, Taiyong Li, Bhaskar D Rao, Shiaofen Fang, Sungeun Kim, Shannon L Risacher, Andrew J Saykin, and Li Shen. Sparse Bayesian multi-task learning for predicting cognitive outcomes from neuroimaging measures in Alzheimer’s disease. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 940–947. IEEE, 2012.
342
+ Olga Wichrowska, Niru Maheswaranathan, Matthew W Hoffman, Sergio Gomez Colmenarejo, Misha Denil, Nando de Freitas, and Jascha Sohl-Dickstein. Learned optimizers that scale and generalize. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017.
343
+ Kai Yu, Volker Tresp, and Anton Schwaighofer. Learning Gaussian processes from multiple tasks. In Proceedings of the 22nd International Conference on Machine Learning (ICML), pp. 1012–1019, 2005.
md/train/BJxgz2R9t7/BJxgz2R9t7.md ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING TO SOLVE CIRCUIT-SAT:AN UNSUPERVISED DIFFERENTIABLE APPROACH
2
+
3
+ Saeed Amizadeh, Sergiy Matusevych, Markus Weimer
4
+ Microsoft
5
+ Redmond, WA 98052
6
+ {saamizad,sergiym,Markus.Weimer}@microsoft.com
7
+
8
+ # ABSTRACT
9
+
10
+ Recent efforts to combine Representation Learning with Formal Methods, commonly known as Neuro-Symbolic Methods, have given rise to a new trend of applying rich neural architectures to solve classical combinatorial optimization problems. In this paper, we propose a neural framework that can learn to solve the Circuit Satisfiability problem. Our framework is built upon two fundamental contributions: a rich embedding architecture that encodes the problem structure, and an end-to-end differentiable training procedure that mimics Reinforcement Learning and trains the model directly toward solving the SAT problem. The experimental results show the superior out-of-sample generalization performance of our framework compared to the recently developed NeuroSAT method.
11
+
12
+ # 1 INTRODUCTION
13
+
14
+ Recent advances in neural network models for discrete structures have given rise to a new field in Representation Learning known as the Neuro-Symbolic methods. Generally speaking, these methods aim at marrying the classical symbolic techniques in Formal Methods and Computer Science to Deep Learning in order to benefit both disciplines. One of the most exciting outcomes of this marriage is the emergence of neural models for learning how to solve the classical combinatorial optimization problems in Computer Science. The key observation behind many of these models is that in practice, for a given class of combinatorial problems in a specific domain, the problem instances are typically drawn from a certain (unknown) distribution. Therefore if a sufficient number of problem instances are available, then in principle, Statistical Learning should be able to extract the common structures among these instances and produce meta-algorithms (or models) that would, in theory, outperform the carefully hand-crafted algorithms.
15
+
16
+ There have been two main approaches to realize this idea in practice. In the first group of methods, the general template of the solver algorithm (which is typically the greedy strategy) is directly imported from the classical heuristic search algorithm, and the Deep Learning component is only tasked to learn the optimal heuristics within this template. In combination with Reinforcement Learning, such strategy has been shown to be quite effective for various NP-complete problems – e.g. Khalil et al. (2017). Nevertheless, the resulted model is bounded by the greedy strategy, which is sub-optimal in general. The alternative is to go one step further and let Deep Learning figure out the entire solution structure from scratch. This approach is quite attractive as it allows the model not only learn the optimal (implicit) decision heuristics but also the optimal search strategies beyond the greedy strategy. However, this comes at a price: training such models can be quite challenging! To do so, a typical candidate is Reinforcement Learning (Policy Gradient, in specific), but such techniques are usually sample inefficient – e.g. Bello et al. (2016). As an alternative method for training, more recently Selsam et al. (2018) have proposed using the latent representations learned for the binary classification of the Satisfiability (SAT) problem to actually produce a neural SAT solver model. Even though using such proxy for learning a SAT solver is an interesting observation and provides us with an end-to-end differentiable architecture, the model is not directly trained toward solving a SAT problem (unlike Reinforcement Learning). As we will see later in this paper, that can indeed result in poor generalization and sub-optimal models.
17
+
18
+ In this paper, we propose a neural Circuit-SAT solver framework that effectively belongs to the second class above; that is, it learns the entire solution structure from scratch. More importantly, to train such model, we propose a training strategy that, unlike the typical Policy Gradient, is differentiable end-toend, yet it trains the model directly toward the end goal (similar to Policy Gradient). Furthermore, our proposed training strategy enjoys an Explore-Exploit mechanism for better optimization even though it is not exactly a Reinforcement Learning approach.
19
+
20
+ The other aspect of building neural models for solving combinatorial optimization problems is how the problem instance should be represented by the model. Using classical architectures like RNNs or LSTMs completely ignores the inherent structure present in the problem instances. For this very reason, there has been recently a strong push to employ structure-aware architectures such as different variations of neural graph embedding. Most neural graph embedding methodologies are based on the idea of synchronously propagating local information on an underlying (undirected) graph that represents the problem structure. The intuition behind using local information propagation for embedding comes from the fact that many original combinatorial optimization algorithms can actually be seen propagating information. In our case, since we are dealing with Boolean circuits and circuit are Directed Acyclic Graphs (DAG), we would need an embedding architecture that take into account the special architecture of DAGs (i.e. the topological order of the nodes). In particular, we note that in many DAG-structured problems (such as circuits, computational graphs, query DAGs, etc.), the information is propagated sequentially rather than synchronously, hence a justification to have sequential propagation for the embedding as well. To this end, we propose a rich embedding architecture that implements such propagation mechanism for DAGs. As we see in this paper, our proposed architecture is capable of harnessing the structural information in the input circuits. To summarize, our contributions in this work are three-fold:
21
+
22
+ (a) We propose a general, rich graph embedding architecture that implements sequential propagation for DAG-structured data.
23
+ (b) We adapt our proposed architecture to design a neural Circuit-SAT solver which is capable of harnessing structural signals in the input circuits to learn a SAT solver.
24
+ (c) We propose a training strategy for our architecture that is end-to-end differentiable, yet similar to Reinforcement Learning techniques, it directly trains our model toward solving the SAT problem with an Explore-Exploit mechanism.
25
+
26
+ The experimental results show the superior performance of our framework especially in terms of generalizing to new problem domains compared to the baseline.
27
+
28
+ # 2 RELATED WORK
29
+
30
+ Deep learning on graph-structured data has recently become a hot topic in the Machine Learning community under the general umbrella of Geometric Deep Learning Bronstein et al. (2017). Based on the assumptions they make, these models typically divide into two main categories. In the first category, the graph-structured datapoints are assumed to share the same underlying graph structure (aka the domain) and only differ based on the feature values assigned to each node or edge. The methods in this category operate in both the spatial and the frequency domains; for example, Spectral CNN Bruna et al. (2013), Graph CNN Defferrard et al. (2016), Graph Neural Network Scarselli et al. (2009) and Covariant Compositional Networks Kondor et al. (2018). In the second category on the other hand, each example in the training data has its own domain (graph structure). Since the domain is varying across datapoints, these other methods mostly operate in the spatial domain and typically can be seen as the generalization of the classical CNNs (e.g.MoNet Monti et al. (2017)) or the classical RNNs (e.g.TreeLSTM Tai et al. (2015), DAG-RNN Baldi & Pollastri (2003); Shuai et al. (2016)) or both (e.g.GGS-NN Li et al. (2015)) to the graph domain. In this paper, we extend the single layer DAG-RNN model for DAG-structured data Baldi & Pollastri (2003); Shuai et al. (2016) to the more general deep version with Gated Recurrent Units, where each layer processes the input DAG either in the forward or the backward direction.
31
+
32
+ On the other hand, the application of Machine Learning (deep learning in specific) to logic and symbolic computation has recently emerged as a bridge between Machine Learning and the classical Computer Science. While works such as Evans et al. (2018); Arabshahi et al. (2018) have shown the effectiveness of (recursive) neural networks in modeling symbolic expressions, others have taken one step further and tried to learn approximate algorithms to solve symbolic NP-complete problems Khalil et al. (2017); Bello et al. (2016); Vinyals et al. (2015). In particular, as opposed to black box methods (e.g. Bello et al. (2016); Vinyals et al. (2015)), Khalil et al. Khalil et al. (2017) have shown that by incorporating the underlying graph structure of a NP-hard problem, efficient search heuristics can be learned for the greedy search algorithm. Although working in the context of greedy search introduces an inductive bias that benefits the sample efficiency of the framework, the resulted algorithm is still bounded by the sub-optimality of the greedy search. More recently, Selsal et al. Selsam et al. (2018) have introduced the NeuroSAT framework - a deep learning model aiming at learning to solve the Boolean Satisfiability problem (SAT) from scratch without biasing it toward the greedy search. In particular, they have primarily approached the SAT problem as a binary classification problem and proposed a clustering-based post-processing analysis to find a SAT solution from the latent representations extracted from the learned classifier. Although, they have shown the empirical merits of their proposed framework, it is not clear why the proposed post-processing clusetring should find the SAT solution without being explicitly trained toward that goal. In this paper, we propose a deep learning framework for the Circuit-SAT problem (a more general form of the SAT problem), but in contrast to NeuroSAT, our model is directly trained toward finding SAT solutions without requiring to see them in the training sample.
33
+
34
+ # 3 DAG EMBEDDING
35
+
36
+ In this section, we formally formulate the problem of learning on DAG-structured data and propose a deep learning framework to approach the problem. It should be noted that even though this framework has been developed for DAGs, the underlying dataset can be a general graph as long as an explicit ordering for the nodes of each graph is available. This ordering is naturally induced by the topological sort algorithm in DAGs or can be imposed on general undirected graphs to yield DAGs.
37
+
38
+ # 3.1 NOTATIONS AND DEFINITIONS
39
+
40
+ Let $G = \langle V _ { G } , E _ { G } \rangle$ denote a Directed Acyclic Graph (DAG). We assume the the set of nodes of $G$ are ordered according to the topological sort of the DAG. For any node $v \in V _ { G }$ , $\pi _ { G } ( v )$ represents the set of direct predecessors of $v$ in $G$ . Also for a given DAG $G$ , we define the reversed DAG, $G ^ { r }$ with the same set of nodes but reversed edges. When topologically sorted, the nodes of $G ^ { r }$ appear in the reversed order of those of $G$ . Furthermore, for a given $G$ , let $\dot { \mu } _ { G } : V _ { G } \mapsto \mathbb { R } ^ { d }$ be a $d$ -dimensional vector function defined on the nodes of $G$ . We refer to $\mu _ { G }$ as a $D A G$ function – i.e. a function that is defined on a DAG. Note that the notation $\mu _ { G }$ implicitly induces the DAG structure $G$ along with the vector function defined on the DAG. Figure 1(a) shows an example DAG function with $d = 3$ . Finally, let $\mathcal { G } ^ { d }$ denote the space of all possible $d$ -dimensional functions $\mu _ { G }$ (along with their underlying graphs $G$ ). We define the parametric functional $\mathcal { F } _ { \pmb { \theta } } : \mathcal { G } ^ { d } \mapsto \mathcal { O }$ that maps any function $\mu _ { G }$ (defined on some DAG $G$ ) in $\mathcal { G } ^ { d }$ to some output space $\mathcal { O }$ .
41
+
42
+ # 3.2 THE GENERAL MODEL
43
+
44
+ The next step is to define the mathematical form of the functional $\mathcal { F } _ { \theta }$ . In this work, we propose:
45
+
46
+ $$
47
+ \mathcal { F } _ { \pmb { \theta } } ( \mu _ { G } ) = \mathcal { C } _ { \pmb { \alpha } } \bigg ( \mathcal { P } \big ( \mathcal { E } _ { \beta } ( \mu _ { G } ) \big ) \bigg )
48
+ $$
49
+
50
+ Intuitively, $\mathcal { E } _ { \beta } : \mathcal { G } ^ { d } \mapsto \mathcal { G } ^ { q }$ is the embedding function that maps the input $d$ -dimensional DAG functions into a $q$ -dimensional DAG function space. Note that the embedding function in general may transform both the underlying DAG size/structure as well as the the DAG function defined on it. In this paper, however, we assume it only transforms the DAG function and keeps the input DAG structure intact. Once the DAG is embedded into the new space, we apply the fixed pooling function $\mathcal { P } : \mathcal { G } ^ { q } \mapsto \mathcal { G } ^ { q }$ on the embedded DAG function to produce a (possibly) aggregated version of it. For example, if we are interested in DAG-level predictions, $\mathcal { P }$ can be average pooling across all nodes of the input DAG to produce a singleton DAG; whereas, in the case of node-level predictions, $\mathcal { P }$ is simply the Identity function. In this paper, we set $\mathcal { P }$ to retrieve only the sink nodes in the input DAG. Finally, the classification function $\mathcal { C } _ { \alpha } : \mathcal { G } ^ { q } \mapsto \mathcal { O }$ is applied on the aggregated DAG function to produce the final prediction output in $\mathcal { O }$ . In this work, we set $\mathcal { C } _ { \alpha }$ to be a multi-layer neural network. The tuple $\pmb \theta = \langle \pmb \alpha , \beta \rangle$ identifies all the free parameters of the model.
51
+
52
+ # 3.3 THE DAG EMBEDDING LAYER
53
+
54
+ The (supervised) embedding of graph-based data into the traditional vector spaces has been a hot topic recently in the Machine Learning community Li et al. (2015); Shuai et al. (2016); Tai et al. (2015). Many of these frameworks are based on the key idea of representing each node in the input graph by a latent vector called the node state and update these latent states via an iterative (synchronous) propagation mechanism that takes the graph structure into account. Two of these methodologies that are closely related to the proposed framework in this paper are the Gated Graph Sequence Neural Networks (GGS-NN) Li et al. (2015) and DAG Recurrent Neural Networks (DAG-RNN) Shuai et al. (2016). While GGS-NNs apply multi-level Gated Recurrent Unit (GRU) like updates in an iterative propagation scheme on general (undirected) graphs, DAG-RNNs apply simple RNN logic in a one-pass, sequential propagation mechanism from the input DAG’s source nodes to its sink nodes.
55
+
56
+ Our proposed framework is built upon the DAG-RNN framework Shuai et al. (2016) but it enriches this framework further by incorporating key ideas from GGS-NNs Li et al. (2015), Deep RNNs Pascanu et al. (2013) and sequence-to-sequence learning Sutskever et al. (2014). Before we explain our framework, it is worth noting that assiging input feature/state vectors to each node is equivalent to defining a DAG function in our framework. For the sake of notational simplicity, for the input DAG function $\mu _ { G }$ , we define the $d$ -dimensional node feature vector $\mathbf { \boldsymbol { x } } _ { v } = \mu _ { G } ( \bar { \boldsymbol { v } } )$ and the $q$ -dimensional node state vector $\boldsymbol { h _ { v } } = \delta _ { G } ( \boldsymbol { v } )$ for some unknown DAG function $\delta _ { G } : V _ { G } \mapsto \mathbb { R } ^ { q }$ . Given the node feature vectors $\scriptstyle { \mathbf { { \mathit { x } } } } _ { \mathit { v } }$ for an input DAG, the update rule for the state vector at each node is defined as:
57
+
58
+ $$
59
+ \pmb { h _ { v } } = G R U ( \pmb { x _ { v } } , \pmb { h _ { v } ^ { \prime } } ) , \mathrm { w h e r e } \pmb { h _ { v } ^ { \prime } } = \pmb { \mathcal { A } } \big ( \{ \pmb { h _ { u } } \ | \ u \in \pi ( v ) \} \big )
60
+ $$
61
+
62
+ where $G R U ( . )$ is the standard GRU Chung et al. (2014) function applied on the input vector at node $v$ and the aggregated state of its direct predecessors which in turn is computed by the aggregator function $\mathcal { A } : 2 ^ { V _ { G } ^ { \smile } } \mapsto \mathbb { R } ^ { q }$ . The aggregator function is defined as a tunable deep set function Zaheer et al. (2017) with free parameters that is invariant to the permutation of its inputs. The main difference between these proposed updates rules and the ones in DAG-RNN is in DAG-RNN, we have the simple RNN logic instead of GRU, and the aggregation logic is simply (fixed) summation.
63
+
64
+ By applying the update logic in equation 2 sequentially on the nodes of the input DAG processed in the topological sort order, we compute the state vector $h _ { v }$ for all nodes of $G$ in one pass. This would complete the one layer (forward) embedding of the input DAG function, or $\mathcal { E } _ { \beta } ( \mu _ { G } ) = \delta _ { G }$ . Note that the same way that DAG-RNNs are the generalization of RNNs on sequences to DAGs, our proposed one-layer embedding can be seen as the generalization of GRU-NNs on sequences to DAGs.
65
+
66
+ Furthermore, we introduce the reversed layers (denoted by ${ \mathcal { E } } ^ { r }$ ) that are similar to the regular forward layers except that the input DAG is processed in the reversed order. Alternatively, reversed layers can be seen as regular layers that process the reversed version of the input DAG $G ^ { r }$ ; that is, $\mathcal { E } ^ { r } ( \mu _ { G } ) \equiv$ $\mathcal { E } ( \mu _ { G ^ { r } } )$ . The main reason we have introduced reversed layers in our framework is because in the regular forward layers, the state vector for each node is only affected by the information flowing from its ancestor nodes; whereas, the information from the descendant nodes can also be highly useful for the learning task in hand. The reversed layers provide such information for the learning task. Furthermore, the introduction of reversed layers is partly motivated by the successful application of processing sequences backwards in sequence-to-sequence learning Sutskever et al. (2014). Sequences can be seen as special-case linear DAGs; as a result, reversed layers can be interpreted as the generalized version of reversing sequences.
67
+
68
+ # 3.4 DEEP-GATED DAG RECURSIVE NEURAL NETWORKS
69
+
70
+ The natural extension of the one-layer embedding is the stacked $L$ -layer version where the $i$ th layer has its own parameters $\beta _ { i }$ and output DAG function dimensionality $q _ { i }$ . Furthermore, the stacked $L$ layers can be sequentially applied $T$ times in the recurrent fashion to generate the final embedding:
71
+
72
+ $$
73
+ \begin{array} { r l } & { \mathcal { E } _ { \beta } ( \mu _ { G } ) \equiv \mathcal { E } _ { \beta } ^ { T } ( \mu _ { G } ) , \mathrm { w h e r e } \ \mathcal { E } _ { \beta } ^ { t } ( \mu _ { G } ) = \mathcal { E } _ { s t a c k } \big ( P r o j _ { H } ( \mathcal { E } _ { \beta } ^ { t - 1 } ( \mu _ { G } ) ) \big ) , \forall t \in 2 . . T } \\ & { \qquad \mathcal { E } _ { \beta } ^ { 1 } ( \mu _ { G } ) = \mathcal { E } _ { s t a c k } ( \mu _ { G } ) } \\ & { \qquad \mathrm { s . t . } \ \mathcal { E } _ { s t a c k } = \mathcal { E } _ { \beta _ { L } } \circ \mathcal { E } _ { \beta _ { L - 1 } } \circ \dots \circ \mathcal { E } _ { \beta _ { 1 } } } \end{array}
74
+ $$
75
+
76
+ where $\beta = \langle \beta _ { 1 } , . . . , \beta _ { L } , H \rangle$ is the list of the parameters and $P r o j _ { H } : \mathcal { G } ^ { q _ { L } } \mapsto \mathcal { G } ^ { d }$ is a linear projection with the projection matrix ${ \cal H } _ { d \times q _ { L } }$ that simply adjusts the output dimensionality of $\mathcal { E } _ { s t a c k }$ so it can be fed back to $\mathcal { E } _ { s t a c k }$ as the input. In our experiments, we have found that by letting $T > 1$ , we can significantly improve the accuracy of our models without introducing more trainable parameters. In practice, we fix the value of $T$ during training and increase it during testing to achieve better accuracy. Also note that the $L$ stacked layers in $\mathcal { E } _ { s t a c k }$ can be any permutation of regular and reversed layers. We refer to this proposed framework as Deep-Gated DAG Recursive Neural Networks or DG-DAGRNN for short. Figure 1(b) shows an example 2-layer DG-DAGRNN model with one forward layer followed by a reversed layer.
77
+
78
+ ![](images/c607b84872e5782753ff11c7410e74e8e99764a46d1e4a793a564acd51d6e3e3.jpg)
79
+ Figure 1: (a) A toy example input DAG function $\mu _ { G }$ , (b) a DG-DAGRNN model that processes the input in (a) using two sequential DAG embedding layers: a forward layer followed by a reverse layer. The solid red and green arrows show the flow of information within each layer while the black arrows show the feed-forward flow of information in between the layers. Also, the dotted blue arrows show the recurrent flow of information from the last embedding layer back to the first one.
80
+
81
+ # 4 APPLICATION TO THE CIRCUIT-SAT PROBLEM
82
+
83
+ The Circuit Satisfiability problem (aka Circuit-SAT) is a fundamental NP-complete problem in Computer Science. The problem is defined as follows: given a Boolean expression consists of Boolean variables, parentheses, and logical gates (specifically And $\wedge$ , Or $\vee$ and Not $\sqsupset$ ), find an assignment to the variables such that it would satisfy the original expression, aka a solution. If the expression is not satisfiable, it will be labeled as UNSAT. Moreover, when represented in the circuit format, Boolean expressions can aggregate the repetitions of the same Boolean sub-expression in the expression into one node in the circuit. This is also crucial from the learning perspective as we do not want to learn two different representations for the same Boolean sub-expression.
84
+
85
+ In this section, we apply the framework from the previous section to learn a Circuit-SAT solver merely from data. More formally, a Boolean circuit can be modeled as a DAG function $\mu _ { G }$ with each node representing either a Boolean variable or a logical gate. In particular, we have $\mu _ { G } \colon V _ { G } \mapsto \mathbb { R } ^ { 4 }$ defined as $\mu _ { G } ( v ) = \mathrm { O n e - H o t } ( t y p e ( v ) )$ , where $t y p e ( v ) \in \{ \mathbf { A n d } , \mathbf { O r } , \mathbf { N o t } , \mathbf { V a r i a b l e } \}$ . All the source nodes in a circuit $\mu _ { G }$ have type Variable. Moreover, each circuit DAG has only one sink node (the root node of the Boolean expression).
86
+
87
+ Similar to Selsam et al. (2018), we could also approach the Circuit-SAT problem from two different angles: (1) predicting the circuit satisfiability problem as a binary classification problem, and (2) solving the Circuit-SAT problem directly by generating a solution if the input circuit is indeed SAT. In Selsam et al. (2018), solving the former is the prerequisite for solving the latter. However, that is not the case in our proposed model and since we are interested to actually solve the SAT problems, we do not focus on the binary classification problem. Nevertheless, our model can be easily adapted for SAT classification, as illustrated in Appendix A.
88
+
89
+ # 4.1 NEURAL CIRCUIT-SAT SOLVER
90
+
91
+ Learning to solve SAT problems (i.e.finding a satisfying assignment) is indeed a much harder problem than SAT/UNSAT classification. In the NeuroSAT framework, Selsam et al. (2018), the authors have proposed a post-processing unsupervised procedure to decode a solution from the latent state representations of the Boolean literals. Although this approach works empirically for many SAT problems, it is not clear that it would also work for the Circuit-SAT problems. But more importantly, it is not clear why this approach should decode the SAT problems in the first place because the objective function used in Selsam et al. (2018) does not explicitly contain any component for solving SAT problems; in fact, the decoding procedure is added as a secondary analysis after training. In other words, the model is not optimized toward actually finding SAT assignments.
92
+
93
+ In contrast, in this paper, we pursue a completely different strategy for training a neural Circuit-SAT solver. In particular, using the DG-DAGRNN framework, we learn a neural functional $\mathcal { F } _ { \theta }$ on the space of circuits $\mu _ { G }$ such that given an input circuit, it would directly generate a satisfying assignment for the circuit if it is indeed SAT. Moreover, we explicitly train $\mathcal { F } _ { \theta }$ to generate SAT solutions without requiring to see any actual SAT assignment during training. Our proposed strategy for training $\mathcal { F } _ { \theta }$ is reminiscent of Policy Gradient methods in Deep Reinforcement Learning Arulkumaran et al. (2017).
94
+
95
+ The Solver Network. We start with characterizing the components of $\mathcal { F } _ { \theta }$ . First, the embedding function $\mathcal { E } _ { \beta }$ is set to be a multi-layer recursive embedding as in equation 3 with interleaving regular forward and reversed layers making sure that the last layer is a reversed layer so that we can read off the final outputs of the embedding from the Variable nodes (i.e. the sink nodes of the reversed DAG). The classification function $\mathcal { C } _ { \alpha }$ is set to be a MLP with ReLU activation function for the hidden layers and the Sigmoid activation for the output layer. The output space here encodes the soft assignment (i.e. in range $[ 0 , 1 ] )$ to the corresponding variable node in the input circuit. We also refer to $\mathcal { F } _ { \theta }$ as the solver or the policy network.
96
+
97
+ The Evaluator Network. Furthermore, for any given circuit $\mu _ { G }$ , we define the soft evaluation function $\mathcal { R } _ { G }$ as a DAG computational graph that shares the same topology $G$ with the circuit $\mu _ { G }$ except that the And nodes are replaced by the smooth min function, the Or nodes by the smooth max function and the Not nodes by $\mathcal { N } ( z ) = 1 - z$ function, where $z$ is the input to the Not node. The smooth min and max functions are defined as:
98
+
99
+ $$
100
+ S _ { m a x } ( a _ { 1 } , a _ { 2 } , . . . , a _ { n } ) = \frac { \sum _ { i = 1 } ^ { n } a _ { i } e ^ { a _ { i } / \tau } } { \sum _ { i = 1 } ^ { n } e ^ { a _ { i } / \tau } } , S _ { m i n } ( a _ { 1 } , a _ { 2 } , . . . , a _ { n } ) = \frac { \sum _ { i = 1 } ^ { n } a _ { i } e ^ { - a _ { i } / \tau } } { \sum _ { i = 1 } ^ { n } e ^ { - a _ { i } / \tau } } , I _ { m } ( a _ { 1 } , a _ { 2 } , . . . , a _ { n } ) = \frac { \sum _ { i = 1 } ^ { n } a _ { i } e ^ { - a _ { i } / \tau } } { \sum _ { i = 1 } ^ { n } e ^ { - a _ { i } / \tau } } .
101
+ $$
102
+
103
+ where $\tau \geq 0$ is the temperature. For $\tau = + \infty$ , both $S _ { m a x } ( )$ and $S _ { m i n } ( )$ are the arithmetic mean functions. As $\tau 0$ , we have $S _ { m a x } ( \ v r ) \to \mathrm { m a x } ( \ v r )$ and $S _ { m i n } ( \ l ) \mathrm { m i n } ( \ l )$ . One can also show that $\forall a = ( a _ { 1 } , . . . , a _ { n } ) : \operatorname* { m i n } ( a ) < S _ { m i n } ( \dot { a } ) < S _ { m a x } \big ($ a) < max(a). More importantly, as opposed to the $\operatorname* { m i n } ( )$ and max() functions, their smooth versions are fully differentiable w.r.t. all of their inputs.
104
+
105
+ As its name suggests, the soft evaluation function evaluates a soft assignment (i.e. in [0, 1]) to the variables of the circuit. In particular, at a low enough temperature, if for a given input assignment, $\mathcal { R } _ { G }$ yields a value strictly greater than 0.5, then that assignment (or its hard counterpart) can be seen as a satisfying solution for the circuit. We also refer to $\mathcal { R } _ { G }$ as the evaluator or the reward network. Note that the evaluator network does not have any trainable parameter.
106
+
107
+ Encoding logical expressions into neural networks is not new per se as there has been recently a push to enrich deep learning with symbolic computing Hu et al. (2016); Xu et al. (2017). What are new in our framework, however, are two folds: (a) each graph example in our dataset induces a different evaluation network as opposed to having one fixed network for the entire dataset, and (b) by encoding the logical operators as smooth min and max functions, we provide a more efficient framework for back-propagating the gradients and speeding up the learning as the result, as we will see shortly.
108
+
109
+ The Optimization. Putting the two pieces together, we define the satisfiability function $S _ { \theta } : { \mathcal { G } } \mapsto$ $[ 0 , 1 ]$ as: $S _ { \pmb \theta } ( \mu _ { G } ) = \mathcal { R } _ { G } ( \bar { \mathcal { F } } _ { \pmb \theta } ( \mu _ { G } ) )$ . Intuitively, the satisfiability function uses the solver network to produce an assignment for the input circuit and then feeds the resulted assignment to the evaluator network to see if it satisfies the circuit. We refer to the final output of $\scriptstyle { \mathcal { S } } _ { \theta }$ as the satisfiability value for the input circuit, which is a real number in [0, 1]. Having computed the satisfiability value, we define the loss function as the smooth Step function:
110
+
111
+ $$
112
+ { \mathcal { L } } ( s ) = { \frac { ( 1 - s ) ^ { \kappa } } { ( 1 - s ) ^ { \kappa } + s ^ { \kappa } } }
113
+ $$
114
+
115
+ where $s = { \cal S } _ { \theta } ( \mu _ { G } )$ and $\kappa \geq 1$ is a constant. By minimizing the loss function in equation 7, we push the solver network to produce an assignment that yields a higher satisfiability value $ { \boldsymbol { S } } _ { { \boldsymbol { \theta } } } ( { \boldsymbol { \mu } } _ { G } )$ For satisfiable circuits this would eventually result in finding a satisfiable assignment for the circuit. However, if the input circuit is UNSAT, the maximum achievable value for $\scriptstyle { \mathcal { S } } _ { \theta }$ is 0.5 as we have shown in Appendix B. In practice though, the inclusion of UNSAT circuits in the training data slows down the training process mainly because the UNSAT circuits keep confusing the solver network as it tries hard to find a SAT solution for them. For this very reason, in this scheme, we only train on SAT examples and exclude the UNSAT circuits from training. Nevertheless, if the model has enough capacity, one can still include the UNSAT examples and pursue the training as a pure unsupervised learning task since the true SAT/UNSAT labels are not used anywhere in equation 7.
116
+
117
+ Moreover, the loss function in equation 7 has a nice property of having higher gradients for satisfiability values close to 0.5 when $\kappa > 1$ (we set $\kappa = 1 0$ in our experiments). This means that the gradient vector in backpropagation is always dominated by the examples closer to the decision boundary. In practice, that would mean that the training algorithm immediately in the beginning pushes the easier examples in the training set (with satisfiability values close to 0.5) to the SAT region $( > 0 . 5 )$ with a safety margin from 0.5. As the training progresses, harder examples (with satisfiability values close to 0) start moving toward the SAT region.
118
+
119
+ As mentioned before, the proposed learning scheme in this section can be seen as a variant of Policy Gradient methods, where the solver network represents the policy function and the evaluator network acts as the reward function. The main difference here is that in our problem the mathematical form of the reward function is fully known and is differentiable so the entire pipeline can be trained using backpropagation in an end-to-end fashion to maximize the total reward over the training sample.
120
+
121
+ Exploration vs. Exploitation. The reason we use the smooth min and max functions in the evaluator network instead of the actual $\operatorname* { m i n } ( )$ and $\operatorname* { m a x } ( )$ is that in a min-max circuit, the gradient vector of the output of the circuit w.r.t. its inputs has at most one non-zero entry 1. That is, the circuit output is sensitive to only one of its inputs in the case of infinitesimal changes. For fixed input values, we refer to this input as the active input and to the path from the active input to the output as the active path. In the case of a min-max evaluator, the gradients flow back only through the active path of the evaluator network forcing the solver network to change such that it can satisfy the input circuit through its active path only. This strategy however is quite myopic and, as we observed empirically, leads to slow training and sub-optimal solutions. To avoid this effect, we use the smooth min and max functions in the evaluator network to allow the gradients to flow through all paths in the input circuit. Furthermore, in the beginning of the training we start with a high temperature value to let the model explore all paths in the input circuits for finding a SAT solution. As the training progresses, we slowly anneal the temperature toward 0 so that the model exploits more active path(s) for finding a solution. One annealing strategy is to let $\tau = t ^ { - \epsilon }$ , where $t$ is timestep and $\epsilon$ is the annealing rate. In our experiments we set $\epsilon = 0 . 4$ . It should be noted that at the test time, the smooth min and max functions are replaced by their non-smooth versions.
122
+
123
+ Prediction. Given a test circuit $\mu _ { G }$ , we evaluate $s = \mathcal { S } _ { \pmb { \theta } } ( \mu _ { G } ) = \mathcal { R } _ { G } \big ( \mathcal { F } _ { \pmb { \theta } } ( \mu _ { G } ) \big )$ . If $s > 0 . 5$ then the circuit is classified as SAT and the SAT solution is provided by $\mathcal { F } _ { \pmb { \theta } } ( \mu _ { G } )$ . Otherwise, the circuit is classified as UNSAT. This way, unlike SAT classification, we predict SAT for a given circuit only if we have already found a SAT solution for it. In other words, our model never produces false positives. We have formally proved this in Appendix B. Moreover, at the prediction time, we do not need to set the number of recurrences $T$ in equation 3 to the same value we used for training. In fact, we have observed by letting $T$ to be variable on the per example basis, we can improve the model accuracy quite significantly at the test time.
124
+
125
+ # 5 EXPERIMENTAL EVALUATION
126
+
127
+ The baseline method we have compared our framework to is the NeuroSAT model by Selsam et al. (2018). Like most classical SAT solvers, NeuroSAT assumes the input problem is given in the Conjunctive Normal Form (CNF). Even though that is a fair assumption in general, in some cases, the input does not naturally come as CNF. For instance, in hardware verification, the input problems are often in the form of circuits. One can indeed convert the circuit format into CNF in polynomial time using Tseitin transformation. However, such transformation will introduce extra variables (i.e. the derived variables) which may further complicate the problem for the SAT solver. More importantly, as a number of works in the SAT community have shown, such transformations typically lose the structural information embedded in the circuit format, which otherwise can be a rich source of information for the SAT solver, Thiffault et al. (2004); Andrews (2002); Biere (2008); Fu & Malik (2007); Velev (2007). As a result, there has been quite an effort in the classical SAT community to develop SAT solvers that directly work with the circuit format Thiffault et al. (2004); Jain & Clarke (2009). In the similar vein, our neural framework for learning a SAT solver enables us to harness such structural signals in learning by directly consuming the circuit format. That contrasts the NeuroSAT approach which cannot in principle benefit from such structural information.
128
+
129
+ Despite this clear advantage of our framework to NeuroSAT, in this paper, we assume the (raw) input problems come in CNF, just so we can make a fair comparison to NeuroSAT. Instead for our method, we propose to use pre-processing methods to convert the input CNF into circuit that has the potential of injecting structural information into the circuit structure. In particular, if available, one can in principle encode problem-specific heuristics into the structure while building the circuit. For example, if there is a variable ordering heuristic available for a specific class of SAT problems, it can be used to build that target circuit in a certain way, as discussed in Appendix C. Note that we could just consume the original CNF; after all, CNF is a (flat) circuit, too. But as we empirically observed, that would negatively affect the results, which again highlights the fact that our proposed framework has been optimized to utilize circuit structure as much as possible.
130
+
131
+ Both our method and NeuroSAT require a large training sample size for moderate size problems. The good news is both methods can effectively be trained on an infinite stream of randomly generated problems in real-world applications. However, since we ran our experiments only on one GPU with limited memory, we had to limit the training sample size for the purpose of experimentation. This in turn restricts the maximum problem sizes we could train both models on. Nevertheless, our method can generalize pretty well to out-of-sample SAT problems with much larger sizes, as shown below.
132
+
133
+ # 5.1 RANDOM $k$ -SAT
134
+
135
+ We have used the generation process proposed in the NeuroSAT paper Selsam et al. (2018) to generate random $k$ -SAT CNF pairs (with $k$ stochastically set according to the default settings in Selsam et al. (2018)). These pairs are then directly fed to NeuroSAT for training. For our method, on the other hand, we first need to convert these CNFs into circuits2. In Appendix C, we have described the details of this conversion process.
136
+
137
+ Experimental Setup: We have trained a DG-DAGRNN model (i.e. our framework) and a NeuroSAT model on a dataset of 300K SAT and UNSAT pairs generated according to the scheme proposed in Selsam et al. (2018). The number of Boolean variables in the problems in this dataset ranges from 3 to 10. We have designed both models to have roughly $\sim 1 8 0 \mathrm { K }$ tunable parameters. In particular our model has two DAG embedding layers: a forward layer followed by a reversed layer, each with the embedding dimension $q = 1 0 0$ . The classifier is a 2-layer MLP with hidden dimensionality 30. The aggregator function $\boldsymbol { \mathcal { A } } ( \cdot )$ consists of two 2-layer MLPs, each with hidden dimensionality 50. For training, we have used the Adam optimization algorithm with learning rate of $1 0 ^ { - 5 }$ , weight decay of $1 0 ^ { - \bar { 1 } 0 }$ and gradient clipping norm of 0.65. We have also applied a dropout mechanism for the aggregator function during training with the rate of $2 0 \%$ . For the NeuroSAT model, we have used the default hyper-parameter settings proposed in Selsam et al. (2018). Finally, since our model does not produce false positives, we have only included satisfiable examples in the test data for all experiments.
138
+
139
+ In-Sample Results: Once we trained the two models, the main performance metric we measure is the percentage of SAT problems in the test set that each model can actually find a SAT solution for.3 Figure 2 (Left) shows this metric on a test set from the same distribution for both our model and NeuroSAT as the number of recurrences (or propagation iterations for NeuroSAT) $T$ increases. Not surprisingly, both methods are able to decode more SAT problems as we increase $T$ . However, our method converges much faster than NeuroSAT (to a slightly smaller value). In other words, compared to NeuroSAT, our method requires smaller of number of iterations at the test time to decode SAT problems. We conjecture this is due to the fact the sequential propagation mechanism in DG-DAGRNN is more effective in decoding the structural information in the circuit format for the SAT problem than the synchronous propagation mechanism in NeuroSAT for the flat CNF.
140
+
141
+ ![](images/c58f4d0f03bb646ce981d50017f231db375fe60223fd8c34faee4630c361dd82.jpg)
142
+ Figure 2: (Left) In-Sample test results comparing between DG-DAGRNN and NeuroSAT, as the number of recurrence iterations $T$ increases. (Right) Out-of-Sample test results comparing the two methods when tested on much larger problems.
143
+
144
+ Out-of-Sample Results: Furthermore, we evaluated both trained models on test datasets drawn from different distributions than the training data with much larger number of variables (20, 40, 60 and 80 variables, in particular). We let both models iteratively run on each test dataset until the test metric converges. Figure 2 (Right) shows the test metric for both methods on these datasets after convergence. As the results demonstrate, compared to that of our method, the performance of NeuroSAT declines faster as we increase the number variables during test time, with a significant margin. In other words, our method generalizes better to out-of-sample, larger problems during the test time. We attribute this to the fact that NeuroSAT is trained toward the SAT classification problem as a proxy to learn a solver. This may result in the classifier picking up certain features that are informative for classification of in-sample examples which are, otherwise, harmful (or useless at best) for learning a solver for out-of-sample examples. Our framework, on the other hand, simply does not suffer from such problem because it is directly trained toward solving the SAT problem.
145
+
146
+ Time Complexity: We trained both our model and NeuroSAT for a day on a single GPU. To give an idea of the test time complexity, it took both our model and NeuroSAT roughly about 3s to run for 40 iterations on a single example of 20 variables. We also measured the time that it takes for a modern SAT Solver (MiniSAT here) to solve a similar example to be roughly about 0.7s in average. Despite this difference, our neural approach is way more prallelizable compared to modern solvers such that many examples can be solved concurrently in a single batch on GPU. For example, while it took MiniSAT 114min to solve a set of 10, 000 examples, it took our method only 8min to solve for the same set in a batch-processing fashion on GPU. This indeed shows another important advantage of our neural approach toward SAT solving in large-scale applications: the extreme parallelization.
147
+
148
+ # 5.2 RANDOM GRAPH $k$ -COLORING
149
+
150
+ To further evaluate the generalization performance of the trained models from the previous section, we have tested them on SAT problems coming from an entire different domain than $k$ -SAT problems. In particular, we have chosen the graph $k$ -coloring decision problem which belongs to the class of NP-complete problems. In short, given an undirected graph $G$ with $k$ color values, in graph $k$ -coloring decision problem, we seek to find a mapping from the graph nodes to the color set such that no adjacent nodes in the graph have the same color. This classical problem is reducible to SAT. Moreover, the graph topology in general contains valuable information that can be further injected into the circuit structure when preparing circuit representation for our model. Appendix D illustrates how we incorporate this information to convert instances of the graph $k$ -coloring problem into circuits. For this experiment, we have generated two different test datasets:
151
+
152
+ Dataset-1: We have generated a diverse set of random graphs with number of nodes ranging between 6 and 10 and the edge percentage of $3 7 \%$ . The random graphs are evenly generated according to six distinct distributions: Erdos-Renyi, Barabasi-Albert, Power Law, Random Regular, Watts-Strogatz and Newman-Watts-Strogatz. Each generated graph is then paired with a random color number in $2 \leq k \leq 4$ to generate a graph $k$ -coloring instance. We only keep the SAT instances in the dataset.
153
+
154
+ Dataset-2: We first generate random trees with the same number of nodes as Dataset-1. Then each tree is paired with a random color number in $2 \leq k \leq 4$ . Since the chromatic number of trees is 2, every single pair so far is SAT. Lastly, for each pair we keep adding random edges to the graph until it becomes UNSAT, then we remove the last added edge to make the instance SAT again and stop.
155
+
156
+ Even though Dataset-1 has much higher coverage in terms of different graph distributions, Dataset2 contains harder SAT examples in general, simply because in average, it contains maximally constrained instances that are still SAT. We evaluated both our method and NeuroSAT (which were both trained on $k$ -SAT-3-10) on these test datasets. Our method could solve $4 8 \%$ and $2 7 \%$ of the SAT problems in Dataset-1 and Dataset-2, respectively. However, to our surprise, the same NeuroSAT model that generated the out-of-sample results on $k$ -SAT datasets in Figure 2, could not solve any of the SAT graph $k$ -coloring problems in Dataset-1 and Dataset-2, even after 128 propagation iterations. This does not match the results reported in Selsam et al. (2018) on graph coloring. We suspect different CNF formulations for the graph $k$ -coloring problem might be the cause behind this discrepancy, which would mean that NeuroSAT is quite sensitive to the change of problem distribution. Nevertheless, the final judgment remains open up to further investigations.
157
+
158
+ In a separate effort, we tried to actually train a fresh NeuroSAT model on a larger versions of Dataset-1 and Dataset-2 which also included UNSAT examples. However, despite a significant decrease on the classification training loss, NeuroSAT failed to decode any of the SAT problems in the test sets. We attribute this behavior to the fact that NeuroSAT is dependent on learning a good SAT classifier that can capture the conceptual essence of SAT vs. UNSAT. As a result, in order to avoid learning superficial classification features, NeuroSAT restricts its training to a strict regime of SAT-UNSAT pairs, where the two examples in a pair only differ in negation of one literal. However, such strict regime can be only enforced in the random $k$ -SAT problems. For graph coloring, the closest strategy we could come up with was the one in Dataset-2, where the SAT-UNSAT examples in a pair only differ in an edge (which still translates to a couple of clauses in the CNF). This again signifies the importance of learning the solver directly rather than relying on a classification proxy.
159
+
160
+ # 6 DISCUSSION
161
+
162
+ In this paper, we proposed a neural framework for efficiently learning a Circuit-SAT solver. Our methodology relies on two fundamental contributions: (1) a rich DAG-embedding architecture that implements the sequential propagation mechanism on DAG-structured data and is capable of learning useful representations for the input circuits, and (2) an efficient training procedure that trains the DAGembedding architecture directly toward solving the SAT problem without requiring SAT/UNSAT labels in general. Our proposed training strategy is fully differentiable end-to-end and at the same time enjoys many features of Reinforcement Learning such as an Explore-Exploit mechanism and direct training toward the end goal.
163
+
164
+ As our experiments showed, the proposed embedding architecture is able to harness structural information in the input DAG distribution and as a result solve the test SAT cases in a fewer number of iterations compared to the baseline. This would also allow us to inject domain-specific heuristics into the circuit structure of the input data to obtain better models for that specific domain. Moreover, our direct training procedure as opposed to the indirect, classification-based method in NeuroSAT enables our model to generalize better to out-of-sample test cases, as demonstrated by the experiments. This superior generalization got even more expressed as we transferred the trained models to a complete new domain (i.e. graph coloring). Furthermore, we argued that not only does direct training give us superior out-of-sample generalization, but it is also essential for the problem domains where we cannot enforce the strict training regime where SAT and UNSAT cases come in pairs with almost identical structures, as proposed by Selsam et al. (2018).
165
+
166
+ Future efforts in this direction would include closely examining the SAT solver algorithm learned by our framework to see if any high-level knowledge and insight can be extracted to further aide the classical SAT solvers. Needless to say, this type of neural models have a long way to go in order to compete with industrial SAT solvers; nevertheless, these preliminary results are promising enough to motivate the community to pursue this direction.
167
+
168
+ # ACKNOWLEDGMENTS
169
+
170
+ We would like to thank Leonardo de Moura and Nikolaj Bjorner from Microsoft Research for the valuable feedback and discussions.
171
+
172
+ # REFERENCES
173
+
174
+ Peter B Andrews. An introduction to mathematical logic and type theory, volume 27. Springer Science & Business Media, 2002.
175
+
176
+ Forough Arabshahi, Sameer Singh, and Animashree Anandkumar. Combining symbolic and function evaluation expressions in neural programs. arXiv preprint arXiv:1801.04342, 2018.
177
+
178
+ Kai Arulkumaran, Marc Peter Deisenroth, Miles Brundage, and Anil Anthony Bharath. A brief survey of deep reinforcement learning. arXiv preprint arXiv:1708.05866, 2017.
179
+
180
+ Pierre Baldi and Gianluca Pollastri. The principled design of large-scale recursive neural network architectures–dag-rnns and the protein structure prediction problem. Journal of Machine Learning Research, 4(Sep):575–602, 2003.
181
+
182
+ Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. arXiv preprint arXiv:1611.09940, 2016.
183
+
184
+ Armin Biere. Picosat essentials. Journal on Satisfiability, Boolean Modeling and Computation, 4: 75–97, 2008.
185
+
186
+ Armin Biere, Marijn Heule, Hans van Maaren, and Toby Walsh. Conflict-driven clause learning sat solvers. Handbook of Satisfiability, Frontiers in Artificial Intelligence and Applications, pp. 131–153, 2009.
187
+
188
+ Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017.
189
+
190
+ Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
191
+
192
+ Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
193
+
194
+ Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3844–3852, 2016.
195
+
196
+ Richard Evans, David Saxton, David Amos, Pushmeet Kohli, and Edward Grefenstette. Can neural networks understand logical entailment? arXiv preprint arXiv:1802.08535, 2018.
197
+
198
+ Zhaohui Fu and Sharad Malik. Extracting logic circuit structure from conjunctive normal form descriptions. In VLSI Design, 2007. Held jointly with 6th International Conference on Embedded Systems., 20th International Conference on, pp. 37–42. IEEE, 2007.
199
+
200
+ Marijn JH Heule, Oliver Kullmann, Siert Wieringa, and Armin Biere. Cube and conquer: Guiding cdcl sat solvers by lookaheads. In Haifa Verification Conference, pp. 50–65. Springer, 2011.
201
+
202
+ Zhiting Hu, Xuezhe Ma, Zhengzhong Liu, Eduard Hovy, and Eric Xing. Harnessing deep neural networks with logic rules. arXiv preprint arXiv:1603.06318, 2016.
203
+
204
+ Himanshu Jain and Edmund M Clarke. Efficient sat solving for non-clausal formulas using dpll, graphs, and watched cuts. In Proceedings of the 46th Annual Design Automation Conference, pp. 563–568. ACM, 2009.
205
+
206
+ Elias Khalil, Hanjun Dai, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. In Advances in Neural Information Processing Systems, pp. 6351–6361, 2017.
207
+
208
+ Risi Kondor, Hy Truong Son, Horace Pan, Brandon Anderson, and Shubhendu Trivedi. Covariant compositional networks for learning graphs. arXiv preprint arXiv:1801.02144, 2018.
209
+
210
+ Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
211
+
212
+ Joao Marques-Silva. The impact of branching heuristics in propositional satisfiability algorithms. In Portuguese Conference on Artificial Intelligence, pp. 62–74. Springer, 1999.
213
+
214
+ Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodola, Jan Svoboda, and Michael M Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In Proc. CVPR, volume 1, pp. 3, 2017.
215
+
216
+ Matthew W Moskewicz, Conor F Madigan, Ying Zhao, Lintao Zhang, and Sharad Malik. Chaff: Engineering an efficient sat solver. In Proceedings of the 38th annual Design Automation Conference, pp. 530–535. ACM, 2001.
217
+
218
+ Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, and Yoshua Bengio. How to construct deep recurrent neural networks. arXiv preprint arXiv:1312.6026, 2013.
219
+
220
+ Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009.
221
+
222
+ Daniel Selsam, Matthew Lamm, Benedikt Bunz, Percy Liang, Leonardo de Moura, and David L Dill. Learning a sat solver from single-bit supervision. arXiv preprint arXiv:1802.03685, 2018.
223
+
224
+ Bing Shuai, Zhen Zuo, Bing Wang, and Gang Wang. Dag-recurrent neural networks for scene labeling. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3620–3629, 2016.
225
+
226
+ Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
227
+
228
+ Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075, 2015.
229
+
230
+ Christian Thiffault, Fahiem Bacchus, and Toby Walsh. Solving non-clausal formulas with dpll search. In International Conference on Principles and Practice of Constraint Programming, pp. 663–678. Springer, 2004.
231
+
232
+ Miroslav N Velev. Exploiting hierarchy and structure to efficiently solve graph coloring as sat. In Proceedings of the 2007 IEEE/ACM international conference on Computer-aided design, pp. 135–142. IEEE Press, 2007.
233
+
234
+ Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, pp. 2692–2700, 2015.
235
+
236
+ Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Van den Broeck. A semantic loss function for deep learning with symbolic knowledge. arXiv preprint arXiv:1711.11157, 2017.
237
+
238
+ Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, pp. 3394–3404, 2017.
239
+
240
+ # APPENDIX A: ADAPTING DG-DAGRNN FOR CIRCUIT-SAT CLASSIFICATION
241
+
242
+ In the classification problem, we are interested to merely classify each input circuit as SAT or UNSAT. To do so, we customize DG-DAGRNN framework as follows. The classification function $\mathcal { C } _ { \alpha }$ is set to be a MLP with ReLU activation function for the hidden layers and the Sigmoid activation for the output layer. As the result the output space $\mathcal { O }$ will become [0, 1]. The embedding function $\mathcal { E } _ { \beta }$ is set to be a multi-layer recursive embedding as in equation 3 with interleaving regular forward and reversed layers. For the classification problem, we make sure the last layer of the embedding is a forward layer so that we can read off from only one sink node (i.e. the expression root node) and feed the result to the classification function for the final prediction. Finally given a labeled training set, we minimize the standard cross-entropy loss via the end-to-end backpropagation through the entire network.
243
+
244
+ # APPENDIX B: PROOF OF NO FALSE POSITIVES
245
+
246
+ In this section, we prove that for any UNSAT input circuit $\mu _ { G }$ , the satisfiability function $ { \boldsymbol { S } } _ { { \boldsymbol { \theta } } } ( { \boldsymbol { \mu } } _ { G } )$ at the prediction time will never go beyond 0.5, and as a result, our model would never produce false positives. To prove that, first we show that thresholding the output of the evaluator network $\mathcal { R } _ { G }$ for a soft assignment $^ { a }$ is equivalent to applying the original circuit $\mu _ { G }$ to the hard assignment corresponding to $^ { a }$ :
247
+
248
+ Lemma 1. Let $\mu _ { G }$ be any $D A G$ function representing a Boolean circuit with underlying topology $G$ . Also let $\mathcal { R } _ { G }$ be the evaluator network corresponding to $\mu _ { G }$ where all the And, Or and Not gates are replaced by the $\operatorname* { m i n } ( \cdot )$ , $\operatorname* { m a x } ( { \mathord { \cdot } } )$ and $\mathcal { N } ( \cdot )$ functions, respectively. Moreover, for any soft assignment $\pmb { a } = ( a _ { 1 } , a _ { 2 } , . . . , a _ { n } ) \in [ 0 , 1 ] ^ { n }$ , let its corresponding hard assignment $\mathcal { H } ( \pmb { a } ) =$ $\left( \mathcal { H } ( a _ { 1 } ) , \mathcal { H } ( a _ { 2 } ) , . . . , \mathcal { H } ( a _ { n } ) \right)$ be obtained by thresholding at 0.5; that is, $\forall i \in 1 . . n : \mathcal { H } ( a _ { i } ) = \mathbb { I } ( a _ { i } >$ 0.5). Then we have $\mathcal { H } \big ( \mathcal { R } _ { G } ( \mathbf { { a } } ) \big ) = \mu _ { G } \big ( \mathcal { H } ( \mathbf { { a } } ) \big )$ for all soft assignments $\pmb { a } \in [ 0 , 1 ] ^ { n }$ .
249
+
250
+ Proof. Proof by induction on the number of gates $N$ in $\mu _ { G }$ : for the base case (i.e. $N = 1$ ), the circuit $\mu _ { G }$ simply consists of one gate. Depending on the type of this gate, we can have three possibilities:
251
+
252
+ $$
253
+ \begin{array} { r l } & { \mathbf { A n d } ) \ \mathcal { H } \big ( \operatorname* { m i n } ( a _ { 1 } , . . . , a _ { n } ) \big ) = \operatorname* { m i n } \big ( \mathcal { H } ( a _ { 1 } ) , . . . , \mathcal { H } ( a _ { n } ) \big ) = \mathbf { A n d } \big ( \mathcal { H } ( a _ { 1 } ) , . . . , \mathcal { H } ( a _ { n } ) \big ) } \\ & { \begin{array} { r l } { \mathbf { ( O r ) } \ \mathcal { H } \big ( \operatorname* { m a x } ( a _ { 1 } , . . . , a _ { n } ) \big ) = \operatorname* { m a x } \big ( \mathcal { H } ( a _ { 1 } ) , . . . , \mathcal { H } ( a _ { n } ) \big ) = \mathbf { O r } \big ( \mathcal { H } ( a _ { 1 } ) , . . . , \mathcal { H } ( a _ { n } ) \big ) } \\ { \mathbf { ( N o t ) } \ \mathcal { H } \big ( \mathcal { N } ( a ) \big ) = \mathcal { H } ( 1 - a ) = 1 - \mathcal { H } ( a ) = \mathbf { N o t } \big ( \mathcal { H } ( a ) \big ) } \end{array} } \end{array}
254
+ $$
255
+
256
+ Now let us assume the lemma holds for any circuit with strictly less than $N$ gates. We want to prove it also holds for any circuit $\mu _ { G }$ with $N$ gates. For the sake of simplicity, let us assume the sink node (i.e. the final gate) of $\mu _ { G }$ is an And gate (the same argument can be made for $\mathbf { o r }$ and Not gates). If the final gate has $k$ inputs and is removed from the circuit, we will end up with $k$ (possibly overlapping) sub-circuits $\mu _ { G _ { 1 } } , . . . , \mu _ { G _ { k } }$ with corresponding evaluator networks $\mathcal { R } _ { G _ { 1 } } , . . . , \mathcal { R } _ { G _ { k } }$ . We can then write:
257
+
258
+ $$
259
+ \begin{array} { r l } & { \mathcal { H } \big ( \mathcal { R } _ { G } ( a ) \big ) = \mathcal { H } \bigg ( \operatorname* { m i n } \big ( \mathcal { R } _ { G _ { 1 } } ( a ) , . . . , \mathcal { R } _ { G _ { k } } ( a ) \big ) \bigg ) = \mathbf { A } \mathbf { n d } \bigg ( \mathcal { H } \big ( \mathcal { R } _ { G _ { 1 } } ( a ) \big ) , . . . , \mathcal { H } \big ( \mathcal { R } _ { G _ { k } } ( a ) \big ) \bigg ) } \\ & { \quad \quad \quad = \mathbf { A } \mathbf { n d } \bigg ( \mu _ { G _ { 1 } } \big ( \mathcal { H } ( a ) \big ) , . . . , \mu _ { G _ { k } } \big ( \mathcal { H } ( a ) \big ) \bigg ) = \mu _ { G } \big ( \mathcal { H } ( a ) \big ) } \end{array}
260
+ $$
261
+
262
+ where the second and the third equalities come from the base and the inductive steps of the induction, respectively. □
263
+
264
+ Theorem 2. $\mu _ { G }$ is UNSAT if and only if $\mathcal { R } _ { G } ( { \pmb a } ) \le 0 . 5$ for all soft assignments $\pmb { a } \in [ 0 , 1 ] ^ { n }$ .
265
+
266
+ Proof. (If) Proof by contradiction: let us assume $\mu _ { G }$ is indeed SAT. Then there exists at least one hard assignment $\hat { \pmb { a } } \in \{ 0 , 1 \} ^ { n }$ such that $\mu _ { G } ( \hat { \pmb a } ) = 1$ . However, for hard assignment values, the $\operatorname* { m i n } ( \cdot ) , \operatorname* { m a x } ( \cdot )$ and $\mathcal { N } ( \cdot )$ functions behave exactly the same as the And, Or and Not gates, respectively. This means that for hard assignments, we have $\mu _ { G } \equiv \mathcal { R } _ { G }$ , which further yields $\mathcal { R } _ { G } ( { \hat { a } } ) = { \dot { \mu } } _ { G } ( { \hat { a } } ) = 1 > 0 . 5 .$ . This would in turn lead to a contradiction.
267
+
268
+ (Only-If) Proof by contradiction: let us assume that there exists a soft assignment $\pmb { a } \in [ 0 , 1 ] ^ { n }$ such that $\mathcal { R } _ { G } ( { \pmb a } ) > 0 . 5$ , then using Lemma 1 and the definition of $\mathcal { H } ( \cdot )$ , we will have:
269
+
270
+ $$
271
+ \mu _ { G } \big ( \mathcal { H } ( \pmb { a } ) \big ) = \mathcal { H } \big ( \mathcal { R } _ { G } ( \pmb { a } ) \big ) = \mathbb { I } \big ( \mathcal { R } _ { G } ( \pmb { a } ) > 0 . 5 \big ) = 1
272
+ $$
273
+
274
+ In other words, we have found a hard assignment $\mathcal { H } ( a )$ that satisfies the circuit $\mu _ { G }$ ; this is a contradiction. □
275
+
276
+ # APPENDIX C: CONVERTING CNF TO CIRCUIT
277
+
278
+ There are many ways one can convert a CNF to a circuit; some are optimized toward extracting structural information – e.g. Fu & Malik (2007). Here, we have taken a more intuitive and general approach based on the Cube and Conquer paradigm (Heule et al. (2011)) for solving CNF-SAT problems. In the Cube and Conquer paradigm, for a given input Boolean formula $F$ , a variable $x$ in $F$ is picked and set to TRUE once to obtain $F _ { x } ^ { + }$ and to FALSE the other time to get $F _ { x } ^ { - }$ . Now if we can find a SAT solution for either of $F _ { x } ^ { + }$ or $F _ { x } ^ { - }$ , then we also have a SAT solution for $F$ . Since neither of $F _ { x } ^ { + }$ or $F _ { x } ^ { - }$ contains $x$ , we effectively reduce the complexity of the original SAT problem by removing one variable. This process can be repeated recursively (up to a fixed level) for $F _ { x } ^ { + }$ and $\dot { F } _ { x } ^ { - }$ by picking a new variable to reduce the complexity even further. Now inspired by this paradigm, one can easily show that the following logical equivalence holds for any variable $x$ in $F$ :
279
+
280
+ $$
281
+ F \Leftrightarrow ( x \wedge F _ { x } ^ { + } ) \vee ( \neg x \wedge F _ { x } ^ { - } )
282
+ $$
283
+
284
+ And this is exactly the principle we used to convert a CNF formula $F$ into a circuit. In particular, by applying the equivalence in equation 8 recursively, up to a fixed level4, we perform the CNF to circuit conversion (Note that $\hat { F _ { x } ^ { + } }$ and $F _ { x } ^ { - }$ are also CNFs). The natural question then is in what order we should pick variables to apply equation 8. That is where the heuristic part comes into play: depending on the specific class of SAT problems we are targeting, we can incorporate a garden variety of ordering heuristics (aka the branching heuristics) in the literature – e.g. Biere et al. (2009); Heule et al. (2011); Marques-Silva (1999); Moskewicz et al. (2001). In our experiments for random $k$ -SAT problems, each time we simply pick the variable that appears in the largest number of clauses in the current CNF.
285
+
286
+ # APPENDIX D: REPRESENTING GRAPH $k$ -COLORING AS CNF AND CIRCUIT
287
+
288
+ We know from Computer Science theory that the graph $k$ -coloring problem can be reduced to the SAT problem by representing the problem as a Boolean CNF. There are many ways in the literature to do so; we have picked the Muldirect approach from Velev (2007). In particular, for a graph with $N$ nodes and maximum $k$ allowed colors, we define the Boolean variables $\boldsymbol { x } _ { i j }$ for $1 \leq i \leq N$ and $1 \leq j \leq k$ , where $x _ { i j } = 1$ indicates that the ith node is colored by the $j$ th color. Then, the CNF encoding the decision graph $k$ -coloring problem is defined as:
289
+
290
+ $$
291
+ \biggl [ \bigwedge _ { i = 1 } ^ { N } \biggl ( \bigvee _ { j = 1 } ^ { k } x _ { i j } \biggr ) \biggr ] \wedge \biggl [ \bigwedge _ { ( p , q ) \in E } \biggl ( \bigwedge _ { j = 1 } ^ { k } ( \neg x _ { p j } \vee \neg x _ { q j } ) \biggr ) \biggr ]
292
+ $$
293
+
294
+ where $E$ is the set of the graph edges. The left set of clauses in equation 9 ensure that each node of the graph takes at least one color. The right set of clauses in equation 9 enforce the constraint that the neighboring nodes cannot take the same color. As a result, any satisfiable solution to the CNF in equation 9 corresponds to at least one coloring solution for the original problem if not more. Note that in this formulation, we do not require each node to take only one color value; therefore, one SAT solution can produce multiple valid graph coloring solutions.
295
+
296
+ To generate a circuit from the above CNF, we note that the graph structure in graph coloring problem contains valuable structural information that can be potentially encoded as heuristics into the circuit structure. One such good heuristics, in particular, is the node degrees. More specifically, the most constrained variable first heuristic in Constraint Satisfaction Problems (CSPs) recommends assigning values to the most constrained variable first. In graph coloring problem, the higher the node degree, the more constrained the variables associated with that node are. Therefore, sorting the graph nodes based on their degrees would give us a meaningful variable ordering, which can be further used to build the circuit using the equivalence in equation 8, for example.
md/train/BXewfAYMmJw/BXewfAYMmJw.md ADDED
@@ -0,0 +1,448 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # COUNTERFACTUAL GENERATIVE NETWORKS
2
+
3
+ Axel Sauer1,2 & Andreas Geiger1,2
4
+ Autonomous Vision Group
5
+ 1Max Planck Institute for Intelligent Systems, Tubingen ¨ 2University of Tubingen ¨
6
+ {firstname.lastname}@tue.mpg.de
7
+
8
+ # ABSTRACT
9
+
10
+ Neural networks are prone to learning shortcuts – they often model simple correlations, ignoring more complex ones that potentially generalize better. Prior works on image classification show that instead of learning a connection to object shape, deep classifiers tend to exploit spurious correlations with low-level texture or the background for solving the classification task. In this work, we take a step towards more robust and interpretable classifiers that explicitly expose the task’s causal structure. Building on current advances in deep generative modeling, we propose to decompose the image generation process into independent causal mechanisms that we train without direct supervision. By exploiting appropriate inductive biases, these mechanisms disentangle object shape, object texture, and background; hence, they allow for generating counterfactual images. We demonstrate the ability of our model to generate such images on MNIST and ImageNet. Further, we show that the counterfactual images can improve out-of-distribution robustness with a marginal drop in performance on the original classification task, despite being synthetic. Lastly, our generative model can be trained efficiently on a single GPU, exploiting common pre-trained models as inductive biases.
11
+
12
+ # 1 INTRODUCTION
13
+
14
+ Deep neural networks (DNNs) are the main building blocks of many state-of-the-art machine learning systems that address diverse tasks such as image classification (He et al., 2016), natural language processing (Brown et al., 2020), and autonomous driving (Ohn-Bar et al., 2020). Despite the considerable successes of DNNs, they still struggle in many situations, e.g., classifying images perturbed by an adversary (Szegedy et al., 2013), or failing to recognize known objects in unfamiliar contexts (Rosenfeld et al., 2018) or from unseen poses (Alcorn et al., 2019).
15
+
16
+ Many of these failures can be attributed to dataset biases (Torralba & Efros, 2011) or shortcut learning (Geirhos et al., 2020). The DNN learns the simplest correlations and tends to ignore more complex ones. This characteristic becomes problematic when the simple correlation is spurious, i.e., not present during inference. The motivational example of (Beery et al., 2018) considers the setting of a DNN that is trained to recognize cows in images. A real-world dataset will typically depict cows on green pastures in most images. The most straightforward correlation a classifier can learn to predict the label ”cow” is hence the connection to a green, grass-textured background. Generally, this is not a problem during inference as long as the test data follows the same distribution. However, if we provide the classifier an image depicting a purple cow on the moon, the classifier should still confidently assign the label ”cow.” Thus, if we want to achieve robust generalization beyond the training data, we need to disentangle possibly spurious correlations from causal relationships.
17
+
18
+ Distinguishing between spurious and causal correlations is one of the core questions in causality research (Pearl, 2009; Peters et al., 2017; Scholkopf, 2019). One central concept in causality is the ¨ assumption of independent mechanisms (IM), which states that a causal generative process is composed of autonomous modules that do not influence each other. In the context of image classification (e.g., on ImageNet), we can interpret the generation of an image as a causal process (Kocaoglu et al., 2018; Goyal et al., 2019; Suter et al., 2019). We decompose this process into separate IMs, each controlling one factor of variation (FoV) of the image. Concretely, we consider three IMs: one generates the object’s shape, the second generates the object’s texture, and the third generates the background. With access to these IMs, we can produce counterfactual images, i.e., images of unseen combinations of FoVs. We can then train an ensemble of invariant classifiers on the generated counterfactual images, such that every classifier relies on only a single one of those factors. The main idea is illustrated in Figure 1. By exploiting concepts from causality, this paper links two previously distinct domains: disentangled generative models and robust classification. This allows us to scale our experiments beyond small toy datasets typically used in either domain. The main contributions of our work are as follows:
19
+
20
+ ![](images/e5fa5a9ed594f410c306e0b5058ab9647763c3466035ea204b26215511d96a9e.jpg)
21
+ Figure 1: Out-of-Domain (OOD) Classification. A classifier focuses on all factors of variation (FoV) in an image. For OOD data, this can be problematic: a FoV might be a spurious correlation, hence, impairing the classifier’s performance. An ensemble, e.g., a classifier with a common backbone and multiple heads, each head invariant to all but one FoV, increases OOD robustness.
22
+
23
+ • We present an approach for generating high-quality counterfactual images with direct control over shape, texture, and background. Supervision is only provided by the class label and certain inductive biases we impose on the learning problem. We demonstrate the usefulness of the generated counterfactual images for the downstream task of image classification on both MNIST and ImageNet. Our model improves the classifier’s out-of-domain robustness while only marginally degrading its overall accuracy. • We show that our generative model demonstrates interesting emerging properties, such as generating high-quality binary object masks and unsupervised image inpainting.
24
+
25
+ We release our code at https://github.com/autonomousvision/counterfactual generative networks
26
+
27
+ # 2 STRUCTURAL CAUSAL MODELS FOR IMAGE GENERATION
28
+
29
+ In this section, we first introduce our ideas on a conceptual level. Concretely, we form a connection between the areas of causality, disentangled representation learning, and invariant classifiers, and highlight that domain randomization (Tobin et al., 2017) is a particular instance of these ideas. In section 3, we will then formulate a concrete model that implements these ideas for image classification. Our goals are two-fold: (i) We aim at generating counterfactual images with previously unseen combinations like a cat with elephant texture or the proverbial ”bull in a china shop.” (ii) We utilize these images to train a classifier invariant to chosen factors of variation.
30
+
31
+ In the following, we first formalize the problem setting we address. Second, we describe how we can address this setting by structuring a generator network as a structural causal model (SCM). Third, we show how to use the SCM for training robust classifiers.
32
+
33
+ # 2.1 PROBLEM SETTING
34
+
35
+ Consider a dataset comprised of (high-dimensional) observations $\mathbf { x }$ (e.g. images), and corresponding labels $y$ (e.g. classes). A common assumption is that each $\mathbf { x }$ can be described by lower-dimensional, semantically meaningful factors of variation $\mathbf { z }$ (e.g., color or shape of objects in the image). If we can disentangle these factors, we are able to control their influence on the classifier’s decision. In the disentanglement literature, the factors are often assumed to be statistically independent, i.e., $\mathbf { z }$ is distributed according to $p ( \mathbf { z } ) = \Pi _ { i = 1 } ^ { n } ( z _ { i } )$ (Locatello et al., 2018). However, assuming independence is problematic because certain factors might be correlated in the training data, or the combination of some factors may not exist. Consider the colored MNIST dataset (Kim et al., 2019), where both the digit’s color and its shape correspond to the label. The simplest decision rule a classifier can learn is to count the number of pixels of a specific color value; no notion of the digit’s shape is required. This kind of correlation is not limited to constructed datasets – classifiers trained on ImageNet (Deng et al., 2009) strongly rely on texture for classification, significantly more than on the object’s shape (Geirhos et al., 2018). While texture or color is a powerful classification cue, we do not want the classifier to ignore shape information completely. Therefore, we advocate a generative viewpoint. However, simply training, e.g., a disentangled VAE (Higgins et al., 2017) on this dataset, does not allow for generating data points of unseen combinations – the VAE cannot generate green zeros if all zeros in the training data are red (see Appendix A for a visualization). We therefore propose a novel generative model which enables full control over several FoVs relevant for classification. We then train a classifier on these images while randomizing all factors but one. The classifier focuses on the non-randomized factor and becomes invariant wrt. the randomized ones.
36
+
37
+ # 2.2 STRUCTURAL CAUSAL MODELS
38
+
39
+ In representation learning, it is commonly assumed that a potentially complex function $f$ generates images from a small set of high-level semantic variables (e.g., position or color of objects) (Bengio et al., 2013). Most previous work (Goyal et al., 2019; Suter et al., 2019) imposes no restrictions on $f$ , i.e., a neural network is trained to map directly from a low-dimensional latent space to images. We follow the argument that rather than training a monolithic network to map from a latent space to images, the mapping should be decomposed into several functions. Each of these functions is autonomous, e.g., we can modify the background of an image while keeping all other aspects of the image unchanged. These demands coincide with the concept of structural causal models (SCMs) and independent mechanisms (IMs). An SCM ${ \mathfrak C }$ is defined as a collection of $d$ (structural) assignments
40
+
41
+ $$
42
+ S _ { j } : = f _ { j } \left( \mathbf { P A } _ { j } , U _ { j } \right) , \quad j = 1 , \ldots , d
43
+ $$
44
+
45
+ where each random variable $S _ { j }$ is a function of its parents $\mathbf { P A } _ { j } \subseteq \{ S _ { 1 } , \ldots , S _ { d } \} \setminus \{ S _ { j } \}$ and a noise variable $U _ { j }$ . The noise variables $U _ { 1 } , \ldots , U _ { d }$ are jointly independent. The functions $f _ { i }$ are independent mechanisms, intervening on one mechanism $f _ { j }$ does not change the other mechanisms $\{ f _ { 1 } , \cdot \cdot \cdot , f _ { d } \} \backslash \{ f _ { j } \}$ . The $\operatorname { S C M } { \mathfrak { C } }$ defines a unique distribution over the variables $\mathbf { S } = ( S _ { 1 } , \ldots , S _ { d } )$ which is referred to as the entailed distribution $P _ { \mathbf { S } } ^ { \mathfrak { C } }$ . If one or more structural assignments are replaced, i.e., $S _ { k } : = \tilde { f } ( \tilde { \mathbf { P } } \mathbf { \tilde { A } } _ { k } , \tilde { U } _ { k } )$ , this is called an intervention. We consider the case of atomic changes to the intervention distribution P C;do(Sk:=a)S , where the do refers to the intervention. A interventions, when thorough review of these concepts can be found in (Peters et al., 2017). Our goal is to represent $\tilde { f } ( \tilde { \mathbf { P A } _ { k } } , \tilde { U } _ { k } )$ puts a point mass on a real value . The entailed distribution then the image generation process with an SCM. If we learn a sensible set of IMs, we can intervene on a subset of them and generate interventional images $\mathbf { x } _ { I V }$ . These images were not part of the training data $\mathbf { x }$ as they are generated from the intervention distribution $P _ { \mathbf { S } } ^ { \bar { \mathfrak { C } } ; d o ( S _ { k } : = a ) }$ . To generate a set of counterfactual images , we fix the noise and randomly draw $a$ , hence answering counterfactual questions such as ”How would this image look like with a different background?”. In our case, $a$ corresponds to a class label that we provide as input, denoted as $y _ { C F }$ in the following.
46
+
47
+ # 2.3 TRAINING AN INVARIANT CLASSIFIER
48
+
49
+ To train an invariant classifier, we generate counterfactual images $\mathbf { x } _ { C F }$ , by intervening on all $f _ { j }$ simultaneously. Towards this goal, we draw labels uniformly from the set of possible labels $\mathcal { V }$ for each $f _ { j }$ , i.e., each IM is conditioned on a different label. We denote the domain of images generated by all possible label permutations as $\mathcal { X } _ { \mathcal { C F } }$ . The task of the invariant classifier $r : \mathcal { X } _ { \mathcal { C } \mathcal { F } } \to \mathcal { Y } _ { C F , k }$ is then to predict the label $_ { \mathbf { y } _ { C F , k } }$ that was provided to one specific IM $f _ { k }$ – rendering $r$ invariant wrt. all other IMs. This type of invariance is reminiscent of the idea of domain randomization (Tobin et al., 2017). Here, the goal is to solve a robotics task while randomizing all task-irrelevant attributes. The randomization improves the performance of the learned policy in the real-world. In domain randomization, we commonly assume access to the true generative model (the simulator). This assumption is not feasible if we do not have access to this model. Similar connections of causality and data augmentation have been made in (Ilse et al., 2020). It is also possible to train on interventional images $\mathbf { x } _ { I V }$ , i.e., generating a single image per sampled noise vector. Empirically, we find that counterfactual images improve performance over interventional ones. We hypothesize that counterfactuals provide a more stable signal.
50
+
51
+ # 3 COUNTERFACTUAL GENERATIVE NETWORKS
52
+
53
+ In this section, we apply our ideas outlined above to the particular problem of image classification. Our goal is to decompose the image generation process into several IMs. In image classification, there is generally one principal object in the image. Hence, we assume three IMs for this specific task: object shape, object texture, and background. Our goal is to train the generator consisting of these mechanisms in an end-to-end manner. The inherent structure of the model allows us to generate meaningful counterfactuals by construction. In the following, we describe the inductive biases we use (network architectures, losses, pre-trained models) and how to train the invariant classifier. We refer to the entire generative model using IMs as a Counterfactual Generative Network (CGN).
54
+
55
+ ![](images/96098ef4d86c378ff1dd04f7d3b65fe7700d8a19cf49db82b47d9ccb3c94adad.jpg)
56
+ Figure 2: Counterfactual Generative Network (CGN). Here, we illustrate the architecture used for the ImageNet experiments. The CGN is split into four mechanisms, the shape mechanism $f _ { s h a p e }$ , the texture mechanism $f _ { t e x t }$ , the background mechanism $f _ { b g }$ , and the composer $C$ . Components with trainable parameters are blue, components with fixed parameters are green. The primary supervision is provided by an unconstrained conditional GAN (cGAN) via the reconstruction loss $\mathcal { L } _ { r e c }$ . The cGAN is only used for training, as indicated by the dotted lines. Each mechanism takes as input the noise vector u (sampled from a spherical Gaussian) and the label $y$ (drawn uniformly from the set of possible labels $\mathcal { V }$ ) and minimizes its respective loss $\mathcal { L } _ { s h a p e }$ , $\mathcal { L } _ { t e x t }$ , and $\mathcal { L } _ { b g . }$ ). To generate a set of counterfactual images, we sample $\mathbf { u }$ and then independently sample $y$ for each mechanism.
57
+
58
+ # 3.1 INDEPENDENT MECHANISMS
59
+
60
+ We assume the causal structure to be known, and consider three learned IMs for generating shape, texture, and background, respectively. The only difference between the MNIST variants and ImageNet is the background mechanism. For the MNIST variants, we can simplify the SCM to include a second texture mechanism instead of a dedicated background mechanism. There is no need for a globally coherent background in the MNIST setting. An explicit formulation of both SCM is shown in Appendix B. In both cases, the learned IMs feed into another, fixed, IM: the composer. An overview of our CGN is shown in Figure 2. All IM-specific losses are optimized jointly end-to-end. For the experiments on ImageNet, we initialize each IM backbone with weights from a pre-trained BigGAN-deep-256 (Brock et al., 2018), the current state-of-the-art for conditional image generation. BigGAN has been trained as a single monolithic function; hence, it cannot generate images of only texture or only background, since these would be outside of the training domain.
61
+
62
+ Composition Mechanism. The function of the composer is not learned but defined analytically. For this work, we build on common assumptions from compositional image synthesis (Yang et al., 2017) and deploy a simple image formation model. Given the generated masks, textures and backgrounds, we composite the image ${ \bf x } _ { g e n }$ using alpha blending, denoted as $C$ :
63
+
64
+ $$
65
+ \mathbf { x } _ { g e n } = C ( \mathbf { m } , \mathbf { f } , \mathbf { b } ) = \mathbf { m } \odot \mathbf { f } + ( 1 - \mathbf { m } ) \odot \mathbf { b }
66
+ $$
67
+
68
+ where $\mathbf { m }$ is the mask (or alpha map), f is the foreground, and $\mathbf { b }$ is the background. The operator $\odot$ denotes elementwise multiplication. While, in general, IMs may be stochastic (Eq. 1), we did not find this to be necessary for the composer; therefore, we leave this mechanism deterministic. This fixed composition is a strong inductive bias in itself – the generator needs to generate realistic images through this bottleneck. To optimize the composite image, we could use an adversarial loss between real and composite images. While applicable to simple datasets such as MNIST, we found that an adversarial approach does not scale well to more complex datasets like ImageNet. To get a stronger and more stable supervisory signal, we, therefore, use an unconstrained, conditional GAN (cGAN) to generate pseudo-ground-truth images $\mathbf { x } _ { g t }$ from noise $\mathbf { u }$ and label $y$ . We feed the same $\mathbf { u }$ and $y$ into the IMs to generate ${ \bf x } _ { g e n }$ and minimize a reconstruction loss $\mathcal { L } _ { r e c } ( \mathbf { x } _ { g t } , \mathbf { x } _ { g e n } )$ . We find a combination of L1 loss and perceptual loss (Johnson et al., 2016) to work well. Note that during training, we utilize the same noise $\mathbf { u }$ and label $y$ to reconstruct the image generated by the cGAN. However, at inference time, we generate counterfactual images by randomizing both $\mathbf { u }$ and $y$ separately per mechanism.
69
+
70
+ Shape Mechanism. We model the shape using a binary mask predicted by shape IM $f _ { s h a p e }$ , where 0 corresponds to the background and 1 to the object. Effectively, this mechanism implements foreground segmentation. The loss is comprised of two terms: $\mathcal { L } _ { b i n a r y }$ and $\mathcal { L } _ { m a s k }$ . $\mathcal { L } _ { b i n a r y }$ is the pixelwise binary entropy of the mask; hence, minimizing it forces the output to be close to either 0 or 1. $\mathcal { L } _ { m a s k }$ prohibits trivial solutions, i.e., masks with all 0’s or 1’s that are outside of a defined interval (see Appendix C for details). As we utilize a BigGAN backbone for our ImageNet-Experiments, we need to extract a binary mask from the backbone’s output. Therefore, we add a pre-trained U2-Net (Qin et al., 2020) as a head on top of the BigGAN backbone. The U2-Net was trained for salient object detection on DUTS-TR (10553 images) (Wang et al., 2017). Hence, it is class agnostic; it generates an object mask for a salient object in the image. While the U2-Net presents a strong bias towards binary object masks, it does not fully solve the task at hand as it captures non-class specific parts (e.g., parts of trees in an elephant-class picture, see Figure 5). By fine-tuning the BigGAN backbone, we learn to generate images of the relevant part with exaggerated features to increase saliency. We refer to these as pre-masks ˜m.
71
+
72
+ Texture Mechanism. The texture mechanism $f _ { t e x t }$ is responsible for generating the foreground object’s appearance, while not capturing any object shape or background cues. For MNIST, we use an architectural bias – an additional layer before the final output. This layer spatially divides its input into patches and randomly rearranges them, similar to a shuffled sliding puzzle. This conceptually simple idea does not work on ImageNet, as we want to preserve local object structure, e.g., the position of an eye. We, therefore, sample patches from the full composite image and concatenate them into a grid. We denote this patch grid as pg. The patches are sampled from regions where the mask values are highest (hence, the object is likely located). We then minimize a perceptual loss between the foreground f (the output of $f _ { t e x t , }$ ) and the patchgrid: $\mathcal { L } _ { t e x t } ( \mathbf { f } , \mathbf { p } \mathbf { g } )$ . Over training, the background gradually transforms into object texture, resulting in texture maps, as shown in Figure 5. More details can be found in Appendix C.
73
+
74
+ Background Mechanism. The background mechanism $f _ { b g }$ needs to capture the background’s global structure while the object must be removed and inpainted realistically. However, we found that we cannot use standard inpainting techniques because classical methods (Barnes et al., 2009) slow down training too much, and deep learning methods (Liu et al., 2018) do not work well on synthetic data because of the domain shift. Instead, we exploit the same U2-Net as used for the shape mechanism $f _ { s h a p e }$ . Again, we feed the output of the BigGAN backbone through the U2-Net with fixed weights. However, this time, we minimize the predicted saliency. Over the progress of training, this leads to the object shrinking and finally disappearing, while the model learns to inpaint the object region (see Figure 5 and Appendix E). We refer to this loss as $\mathcal { L } _ { b g }$ . We attribute this loss’s success mainly the powerful pre-trained backbone network. BigGAN is already able to generate objects on realistic backgrounds; it only needs to unlearn the object generation.
75
+
76
+ # 3.2 GENERATING COUNTERFACTUALS TO TRAIN CLASSIFIERS
77
+
78
+ After training our CGN, each IM network has learned a class-conditional distribution over shapes, textures, or backgrounds. By randomizing the label input $y$ and noise $\mathbf { u }$ of each network, we can generate counterfactual images. The number of possible combinations is the number of classes to the power of the number of IM’s. For ImageNet, this is $1 0 0 0 ^ { 3 }$ . The amount of possible images is even larger since we learn distributions, i.e., we can generate a nearly unlimited variety of shapes, textures, and backgrounds, per class. We train on both real and counterfactual images. For MNIST, more counterfactual images always increase the test domain results; see the ablation study in Appendix A.3. On Imagenet, we provide evenly sized batches of real and counterfactual images; i.e., we use a ratio of 1. A ratio below 1 leads to inferior performance; a ratio above 1 leads to longer training times without an increase in performance. Similar results were reported for training on BigGAN samples in Ravuri & Vinyals (2019).
79
+
80
+ ![](images/b1cfbd31cda2e127f02929147331bd6f6c4aca3050e9fb106e31a2a100f0ce49.jpg)
81
+ Figure 3: MNISTs. Left: Samples of the different MNIST variations (for brevity, we show only the first four classes). Right: Counterfactual samples generated by our CGN. Note that the CGN learned class-conditional distributions, i.e., it generates varying shapes, colors, and textures.
82
+
83
+ # 4 EXPERIMENTS
84
+
85
+ Our experiments aim to answer the following questions: (i) Does our approach reliably learn the disentangled IMs on datasets of different complexity? (ii) Which inductive biases are necessary to achieve this? (iii) Do counterfactual images enable training invariant classifiers? We first apply our approach to different versions of MNIST: colored-, double-colored- and Wildlife-MNIST (details about their generation are in Appendix A.2). The label is encoded in the digit shape, foreground color or texture, and the background color or texture, see Figure 3. Our work focuses on a setting where the spurious signal is a strong predictor of the label; hence we assume a correlation strength of at least $90 \%$ between signal and label in our simulated environments. This assumption is in line with latest related work on visual bias (Goyal et al., 2019; Wang et al., 2020), which considers a strong correlation to be above $9 5 \ \%$ . We then scale our approach to ImageNet and demonstrate that we can improve the robustness of ImageNet classifiers. Implementation details about architectures, loss parameters, and hyperparameters can be found in Appendix C.
86
+
87
+ # 4.1 DOES OUR APPROACH LEARN THE DISENTANGLED INDEPENDENT MECHANISMS?
88
+
89
+ Standard metrics like the Inception Score (IS) (Salimans et al., 2016) are not applicable since the counterfactual images are outside of the natural image domain. We thus focus on qualitative results in this section. For a quantitative analysis, we refer the reader to Section 4.3 where we analyze the accuracy, robustness, and invariance of classifiers trained on the generated counterfactual data.
90
+
91
+ MNISTs. The generated counterfactual images are shown in Figure 3 (right). None of the counterfactual combinations were present in the training data. We can see that CGN successfully generates high-quality counterfactuals. The results on Wildlife MNIST are surprisingly good, considering that the object texture is only observable on the relatively thin digits. Nevertheless, the texture IM learns to generate realistic textures. All experiments on MNIST are done without pre-training any network.
92
+
93
+ ImageNet. As shown in Figure 4, our CGN generates counterfactuals of high visual fidelity. We train a single CGN for all 1000 classes. We also find an unexpected benefit of our approach. In some instances, the composite images eliminate structural artifacts of the original BigGAN images, such as surplus legs, as shown in Figure 5. We hypothesize that $f _ { s h a p e }$ learns a general shape concept per class, resulting in outliers, like elephants with eight legs, being smoothed out. We show more samples, individual IM outputs, and interpolations in Appendix D. The CGN can fail to produce high-quality texture maps for very small objects, e.g., for a bird high up in the sky, the texture map will still show large portions of the sky. Also, in some instances, a residue of the object is left on the background, e.g., a dog snout. For generating counterfactual images, this is not a problem as a different object will cover the residue. Lastly, the enforced constraints can lead to a reduction in realism of the composite images $\mathbf { x _ { g e n } }$ compared to the original BigGAN samples. We show examples and propose solutions for these problems in Appendix F.
94
+
95
+ # 4.2 WHICH INDUCTIVE BIASES ARE NEEDED TO ACHIEVE DISENTANGLEMENT?
96
+
97
+ We employ two kinds of biases: pre-training of modules and IM-specific losses. We find that pretraining is not necessary for our experiments on MNIST. However, when scaling to ImageNet, powerful pre-trained models are key for achieving good results. Furthermore, this allows to train the whole CGN on a single NVIDIA GTX 1080Ti within 12 hours, in contrast to BigGAN, which was trained on a Google TPU v3 Pod with 512 cores for up to 48 hours. To investigate each loss’ influence, we disable one loss at a time and measure its influence on the quality of the composite images. The composite images are on the image manifold, hence, we can calculate their Inception score (IS). As we train with pseudo ground truth, the performance of the unconstrained BigGAN is a natural upper bound. The used model reaches an IS of 202.9. To measure if the CGN collapsed during training, we monitor the mean value of the generated mask $\mu _ { m a s k }$ . A $\mu _ { m a s k }$ close to 1 means that $f _ { t e x t }$ is not training. Instead, it generates the output of the pre-trained BigGAN, hence, a mask of 1’s trivially minimizes the reconstruction loss $\mathcal { L } _ { r e c } ( \mathbf { x } _ { g t } , \mathbf { x } _ { g e n } )$ . The same is true for $\mu _ { m a s k }$ close to 0 and $f _ { b g }$ . The results in Table 1 indicate that each loss is necessary, and jointly optimizing all of them end-to-end is needed for a high IS without a collapse of $\mu _ { m a s k }$ . Removing $\mathcal { L } _ { s h a p e }$ , leads to bad quality masks (non-binary, only partially capturing the object). This results in a low IS since object texture and background get mixed in the composited image. Not using either $\mathcal { L } _ { t e x t }$ or $\mathcal { L } _ { b g }$ results in a high IS (as the output is close to the original BigGAN output), but a collapse of $\mu _ { m a s k }$ . The mechanisms do not disentangle their respective signal. Finally, disabling $\mathcal { L } _ { r e c }$ leads to a very low IS, since the IMs can optimize their respective loss without any constraint on the composite image. We show the evolution and collapse of the masks over training in Appendix G.
98
+
99
+ ![](images/f80588a958dd382179a1dc49b7511d48aa07c0919d90b679f15a2122b185b4fa.jpg)
100
+
101
+ ![](images/121952e9c12f27977974cd896d1add8b5081fe061888cc3f3fa39113a5d74421.jpg)
102
+ Figure 4: ImageNet Counterfactuals. The CGN successfully learns the disentangled shape, texture, and background mechanisms, and enables the generation of numerous permutations thereof.
103
+ Figure 5: Individual IM Outputs over Training. We show pre-masks ˜m, masks m, foregrounds f, and backgrounds b. The arrows indicate the beginning and end of the training. The initial output of the pre-trained models is gradually transformed while the composite image only marginally changes.
104
+
105
+ # 4.3 DO COUNTERFACTUAL IMAGES ENABLE TRAINING OF INVARIANT CLASSIFIERS?
106
+
107
+ The following experiments investigate if we can instill invariance into a classifier. We perform experiments on the MNIST variants, a cue-conflict dataset, and an OOD version of ImageNet.
108
+
109
+ MNIST Classification. In the training domain, shapes, colors, and textures are correlated with the class label. In the test domain, only the shapes correspond to the correct class. We compare to current approaches for training invariant classifiers: IRM (Arjovsky et al., 2019) and Learning-not-to-learn (LNTL) (Kim et al., 2019). For a detailed description we refer to Appendix C. Original $+ \ C G N$ is additionally trained on counterfactual data to predict the input labels of the shape IM. Original $^ +$ $G A N$ is a baseline that is trained on real and generated, non-counterfactual samples. IRM considers a signal to be causal if it is stable across several environments. We train IRM on 2 environments (90 $\%$ and $100 \%$ correlation) or 5 environments $90 \%$ , $9 2 . 5 ~ \%$ , $95 \%$ , $9 7 . 5 \ \%$ , and $100 \%$ correlation). LNTL considers color to be spurious, whereas we assume (complementary) that shapes are causal. Alternatively, we can follow the same assumption as IRM with an additional causal identification step, see Appendix H. The results in Table 2 confirm that training on counterfactual data leads to classifiers that are invariant to the spurious signals. We hypothesize that the difference between environments may be hard to pick up for IRM, especially if only a few are available. We find that we can further improve IRM’s performance by adding more environments. However, continually increasing the number of environments is an unrealistic premise and only feasible in simulated environments. Our results indicate that LNTL and IRM have trouble scaling to more complex data.
110
+
111
+ Table 1: Loss Ablation Study. We turn off one loss at a time. Values indicating mask collapse are red.
112
+
113
+ <table><tr><td>Lshape</td><td>Ltext</td><td>Lbg</td><td>Lrec</td><td>IS个</td><td>μmask</td></tr><tr><td>X</td><td></td><td></td><td></td><td>85.9</td><td>0.2±0.2%</td></tr><tr><td>√</td><td>×</td><td>√</td><td>√</td><td>198.4</td><td>0.9 ±0.1 %</td></tr><tr><td>√</td><td>√</td><td>×</td><td>√</td><td>195.6</td><td>0.1±0.1 %</td></tr><tr><td>√</td><td>√</td><td>√</td><td>X</td><td>38.39</td><td>0.3±0.2%</td></tr><tr><td></td><td></td><td>√</td><td>√</td><td>130.2</td><td>0.3±0.2%</td></tr><tr><td colspan="4">BigGAN (Upper Bound)</td><td>202.9</td><td>-</td></tr></table>
114
+
115
+ Table 2: MNISTs Classification. In the test set, colors and textures are randomized, only the digit’s shape corresponds to the class label. Random performance is at $1 0 \%$ .
116
+
117
+ <table><tr><td></td><td colspan="2">colored MNIST</td><td colspan="2">double-colored MNIST</td><td colspan="2">Wildlife MNIST</td></tr><tr><td></td><td>Train Acc 个</td><td>Test Acc 介</td><td>Train Acc 个</td><td>Test Acc 介</td><td>Train Acc 介</td><td>Test Acc ↑</td></tr><tr><td>Original</td><td>99.5%</td><td>35.9 %</td><td>100.0%</td><td>10.3 %</td><td>100.0 %</td><td>10.1 %</td></tr><tr><td>IRM(2 Envs)</td><td>99.6%</td><td>59.8 %</td><td>100.0%</td><td>67.7%</td><td>99.9 %</td><td>11.3 %</td></tr><tr><td>IRM (5 Envs)</td><td>-</td><td>-</td><td>99.9%</td><td>78.9 %</td><td>99.8%</td><td>76.8%</td></tr><tr><td>LNTL</td><td>99.3%</td><td>81.8 %</td><td>98.7%</td><td>69.9 %</td><td>99.9 %</td><td>11.5 %</td></tr><tr><td>Original + GAN</td><td>99.8 %</td><td>40.7 %</td><td>100.0%</td><td>10.8 %</td><td>100.0 %</td><td>10.4 %</td></tr><tr><td>Original + CGN</td><td>99.7%</td><td>95.1 %</td><td>97.4 %</td><td>89.0 %</td><td>99.2 %</td><td>85.7 %</td></tr></table>
118
+
119
+ Table 3: Shape vs. Texture. We can control the classifier’s shape or texture preference.
120
+
121
+ <table><tr><td>Trained on</td><td>Shape Bias</td><td>top-1 IN Acc 个</td><td>top-5 IN Acc 介</td></tr><tr><td>IN</td><td>21.39 %</td><td>76.13 %</td><td>92.86 %</td></tr><tr><td>SIN</td><td>81.37 %</td><td>60.18 %</td><td>82.62 %</td></tr><tr><td>IN + SIN</td><td>34.65 %</td><td>74.59 %</td><td>90.03 %</td></tr><tr><td>IN + CGN/Shape</td><td>54.82 %</td><td></td><td></td></tr><tr><td>IN + CGN/Text</td><td>16.67 %</td><td>73.98 %</td><td>91.71 %</td></tr><tr><td>IN + CGN/Bg</td><td>22.89 %</td><td></td><td></td></tr></table>
122
+
123
+ <table><tr><td></td><td colspan="3">Top-1 Test Accuracies</td></tr><tr><td>Trained on</td><td>IN-9个</td><td>Mixed-Same 价</td><td>Mixed-Rand 介</td><td>BG-Gap ↓</td></tr><tr><td>IN</td><td>95.6%</td><td>86.2%</td><td>78.9%</td><td>7.3%</td></tr><tr><td>SIN</td><td>89.2%</td><td>73.1 %</td><td>63.7%</td><td>9.4 %</td></tr><tr><td>IN + SIN</td><td>94.7%</td><td>85.9%</td><td>78.5%</td><td>7.4 %</td></tr><tr><td>Mixed-Rand</td><td>73.3%</td><td>71.5%</td><td>71.3%</td><td>0.2%</td></tr><tr><td>IN + CGN</td><td>94.2 %</td><td>83.4%</td><td>80.1%</td><td>3.3%</td></tr></table>
124
+
125
+ Table 4: Accuracies on IN-9. The reported accuracies are all obtained using a Resnet-50.
126
+
127
+ Texture vs. Shape Bias. The Cue Conflict dataset consists of images generated using iterative style transfer (Gatys et al., 2015) between a texture and a content image. A high shape bias corresponds to classification according to the content label and vice versa for texture. Their approach is trained on stylized ImageNet (SIN), either as a drop-in for ImageNet (IN) or as augmentation. We use a classifier ensemble, i.e., a classifier with a common backbone and multiple heads, each head invariant to all but one FoV. We average the predicted log-probabilies of each head for the final output of the ensemble. We conduct all experiments using a Resnet-50 architecture. As shown in Table 3, we can influence the individual bias of each classifier head without significant degradation in the ensemble’s performance.
128
+
129
+ Invariance over Backgrounds. Xiao et al. (2020) propose the BG-Gap to measure a classifier’s dependence on the background signal. Based on ImageNet-9 (IN-9), a subset of ImageNet with 9 coarse-grained classes, they build synthetic datasets. For Mixed-Rand, the backgrounds are randomized, while the object remains unchanged, hence background an class are decorrelated. For Mixed-Same they sample class-consistent backgrounds. The BG-Gap is the difference in performance between the two. Training on IN or SIN does not make it possible to disentangle and omit the background signal, as shown in Table 4. Directly training on Mixed-Rand leads to a drop in performance on the original data which might be due to the smaller training dataset. We can generate unlimited data of this type, hence, we are able to reduce the gap while achieving high accuracy on IN-9. However, a gap to a fully invariant classifier remains. We partially attribute this to the general remaining domain gap between generated and real images.
130
+
131
+ # 5 RELATED WORK
132
+
133
+ Our work is related to disentangled representation learning and the training of invariant classifiers.
134
+
135
+ Disentangled Representation Learning. A recent line of work in image synthesis aims to learn disentangled features for controlling the image generation process (Chen et al., 2016; Higgins et al., 2017; Liao et al., 2020). The challenge of the task is that the underlying factors can be highly correlated. Closely related to our work is (Li et al., 2020), which aims to disentangle background, shape, pose, and texture, using object bounding boxes for supervision. Their methods assumes images of a single object category (e.g. birds). We scale our approach to all classes of ImageNet which enables us to generate inter-class counterfactuals. A recent research direction explores the discovery of interpretable directions in GANs trained on ImageNet (Plumerault et al., 2020; Voynov & Babenko, 2020; Peebles et al., 2020). These approaches do not allow for generating counterfactual images. Kocaoglu et al. (2018) train two separate generative models, one generating binary feature labels (mustache, young), the other generating images conditioned on these labels. Their model can create images of previously unseen combinations of attributes, e.g., women with mustaches. This approach assumes a data set with fine-grained labels; hence it would not be suited to our application since labels for high-level concepts like shape are hard to obtain. Besserve et al. (2019) also leverage the idea of independent mechanisms to discover modularity in pre-trained generative models. Their approach does not allow for direct control of image attributes. Lastly, methods for causal generative modeling utilizing competing experts (von Kugelgen et al., 2020) have been demonstrated on toy ¨ datasets only. Further, none of the works above aim to use the generated images to improve upon a downstream task such as image classification.
136
+
137
+ Invariant Classification. Current approaches do not take an underlying causal model into account. Instead, they rely on different assumptions. Arjovsky et al. (2019) assume that the training data is collected into separate environments (e.g. different measurement circumstances). Correlations that are stable across environments are considered to be causal. Kim et al. (2019) aim to learn features that are uninformative of a given bias (spurious) signal. As mentioned above, attaining labels for shape or texture is expensive and not straight-forward. A recent strand of work is concerned with data augmentation for improving invariance against spurious correlations. Shetty et al. (2020) propose to train object detectors on generated semantic adversarial data, effectively reducing the texture dependency of their model. Their finding is in line with (Geirhos et al., 2018) that proposes to transfer the style of paintings onto images and use them for data augmentation. These approaches, however, do not allow to choose the specific signal we want invariance for, e.g., the background. The use of counterfactual data has been previously explored in natural language inference (Kaushik et al., 2020) and visual question answering (Teney et al., 2020).
138
+
139
+ # 6 DISCUSSION
140
+
141
+ We assume that an image can be neatly distinguished into a class foreground and background throughout this work. This assumption breaks once we consider more complex scenes with different object instances or for tasks without a clear foreground-background distinction, e.g., in medical images. The composition mechanism is a powerful bias, and crucial to making our model work. In other domains, equally strong biases may need to be identified to enable learning the SCM. An exciting research direction is to explore different configurations of IMs to tackle these challenges.
142
+
143
+ The additional constraints that we enforce during the CGN training lead to a reduced realism, as evidenced by the lower IS. We also find that our generated images can significantly influence a classifier’s preference, but their quality is not high enough to improve performance on ImageNet. However, even state-of-the-art generative models (with higher IS) are not good enough yet to generate data for training competitive ImageNet classifiers (Ravuri & Vinyals, 2019).
144
+
145
+ Lastly, in our experiments, we assume the causal structure to be known. This assumption is substantially stronger than the ones in more general standard disentanglement frameworks (Chen et al., 2016; Higgins et al., 2017). A possible extension to our work could leverage causal discovery to isolate IMs in a domain-agnostic manner, e.g., via meta-learning (Bengio et al., 2020). On the other hand, the definition of a causal structure and the approximation through IMs may be a principled way to integrate domain knowledge into a machine learning system, The need for better interfaces to integrate domain knowledge has recently been highlighted in (D’Amour et al., 2020).
146
+
147
+ # 7 CONCLUSION
148
+
149
+ In this work, we apply ideas from causality to generative modeling and the training of invariant classifiers. We structure a generative network into independent mechanisms to generate counterfactual images useful for training classifiers. With the use of several inductive biases, we demonstrate our approach on various MNIST variants as well as ImageNet. Our ideas are orthogonal to advances in generative modeling - with advances therein, our obtained results will further improve.
150
+
151
+ # ACKNOWLEDGMENTS
152
+
153
+ We acknowledge the financial support by the BMWi in the project KI Delta Learning (project number 19A19013O). Andreas Geiger was supported by the ERC Starting Grant LEGO-3D (850533). We would like to thank Yiyi Lao, Michael Niemeyer, and Elie Aljalbout for comments on an earlier paper draft and Songyou Peng, Michael Oechsle, and Kashyap Chitta for last-minute proofreading. We would also like to thank Vanessa Sauer for her general support and constructive criticism on the generated counterfactuals in earlier stages.
154
+
155
+ # REFERENCES
156
+
157
+ Michael A Alcorn, Qi Li, Zhitao Gong, Chengfei Wang, Long Mai, Wei-Shinn Ku, and Anh Nguyen. Strike (with) a pose: Neural networks are easily fooled by strange poses of familiar objects. In CVPR, 2019.
158
+
159
+ Martin Arjovsky, Leon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. ´ arXiv preprint arXiv:1907.02893, 2019.
160
+
161
+ Connelly Barnes, Eli Shechtman, Adam Finkelstein, and Dan B Goldman. Patchmatch: A randomized correspondence algorithm for structural image editing. In ACM TOG, 2009.
162
+
163
+ Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In ECCV, 2018.
164
+
165
+ Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. TPAMI, 2013.
166
+
167
+ Yoshua Bengio, Tristan Deleu, Nasim Rahaman, Rosemary Ke, Sebastien Lachapelle, Olexa Bila- ´ niuk, Anirudh Goyal, and Christopher Pal. A meta-transfer objective for learning to disentangle causal mechanisms. In ICLR, 2020.
168
+
169
+ Michel Besserve, Arash Mehrjou, Remy Sun, and Bernhard Sch ´ olkopf. Counterfactuals uncover the ¨ modular structure of deep generative models. In ICLR, 2019.
170
+
171
+ Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. In ICLR, 2018.
172
+
173
+ Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
174
+
175
+ Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In NeurIPS, 2016.
176
+
177
+ M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, , and A. Vedaldi. Describing textures in the wild. In CVPR, 2014.
178
+
179
+ Alexander D’Amour, Katherine Heller, Dan Moldovan, Ben Adlam, Babak Alipanahi, Alex Beutel, Christina Chen, Jonathan Deaton, Jacob Eisenstein, Matthew D. Hoffman, Farhad Hormozdiari, Neil Houlsby, Shaobo Hou, Ghassen Jerfel, Alan Karthikesalingam, Mario Lucic, Yian Ma, Cory McLean, Diana Mincu, Akinori Mitani, Andrea Montanari, Zachary Nado, Vivek Natarajan, Christopher Nielson, Thomas F. Osborne, Rajiv Raman, Kim Ramasamy, Rory Sayres, Jessica Schrouff, Martin Seneviratne, Shannon Sequeira, Harini Suresh, Victor Veitch, Max Vladymyrov, Xuezhi Wang, Kellie Webster, Steve Yadlowsky, Taedong Yun, Xiaohua Zhai, and D. Sculley. Underspecification presents challenges for credibility in modern machine learning. arXiv preprint arXiv:2011.03395, 2020.
180
+
181
+ Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
182
+
183
+ Leon A Gatys, Alexander S Ecker, and Matthias Bethge. A neural algorithm of artistic style. arXiv preprint arXiv:1508.06576, 2015.
184
+
185
+ Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. In ICLR, 2018.
186
+
187
+ Robert Geirhos, Jorn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel,¨ Matthias Bethge, and Felix A Wichmann. Shortcut learning in deep neural networks. arXiv preprint arXiv:2004.07780, 2020.
188
+
189
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NeurIPS, 2014.
190
+
191
+ Yash Goyal, Amir Feder, Uri Shalit, and Been Kim. Explaining classifiers with causal concept effect (CACE). arXiv preprint arXiv:1907.07165, 2019.
192
+
193
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
194
+
195
+ Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In ICLR, 2017.
196
+
197
+ Maximilian Ilse, Jakub M Tomczak, and Patrick Forre. Designing data augmentation for simulating ´ interventions. arXiv preprint arXiv:2005.01856, 2020.
198
+
199
+ Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016.
200
+
201
+ Divyansh Kaushik, Eduard Hovy, and Zachary C Lipton. Learning the difference that makes a difference with counterfactually-augmented data. In ICLR, 2020.
202
+
203
+ Byungju Kim, Hyunwoo Kim, Kyungsu Kim, Sungjin Kim, and Junmo Kim. Learning not to learn: Training deep neural networks with biased data. In CVPR, 2019.
204
+
205
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
206
+
207
+ Murat Kocaoglu, Christopher Snyder, Alexandros G Dimakis, and Sriram Vishwanath. Causalgan: Learning causal implicit generative models with adversarial training. In ICLR, 2018.
208
+
209
+ Yuheng Li, Krishna Kumar Singh, Utkarsh Ojha, and Yong Jae Lee. Mixnmatch: Multifactor disentanglement and encoding for conditional image generation. In CVPR, 2020.
210
+
211
+ Yiyi Liao, Katja Schwarz, Lars Mescheder, and Andreas Geiger. Towards unsupervised learning of generative models for 3d controllable image synthesis. In CVPR, 2020.
212
+
213
+ Guilin Liu, Fitsum A Reda, Kevin J Shih, Ting-Chun Wang, Andrew Tao, and Bryan Catanzaro. Image inpainting for irregular holes using partial convolutions. In ECCV, 2018.
214
+
215
+ Francesco Locatello, Stefan Bauer, Mario Lucic, Sylvain Gelly, Bernhard Scholkopf, and Olivier ¨ Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In ICML, 2018.
216
+
217
+ Eshed Ohn-Bar, Aditya Prakash, Aseem Behl, Kashyap Chitta, and Andreas Geiger. Learning situational driving. In CVPR, 2020.
218
+
219
+ Judea Pearl. Causality. Cambridge University Press, 2009.
220
+
221
+ William Peebles, John Peebles, Jun-Yan Zhu, Alexei A. Efros, and Antonio Torralba. The hessian penalty: A weak prior for unsupervised disentanglement. In ECCV, 2020.
222
+
223
+ Jonas Peters, Dominik Janzing, and Bernhard Scholkopf. ¨ Elements of causal inference. The MIT Press, 2017.
224
+
225
+ Antoine Plumerault, Herve Le Borgne, and C ´ eline Hudelot. Controlling generative models with ´ continuous factors of variations. In ICLR, 2020.
226
+
227
+ Xuebin Qin, Zichen Zhang, Chenyang Huang, Masood Dehghan, Osmar R Zaiane, and Martin Jagersand. U2-net: Going deeper with nested u-structure for salient object detection. Pattern Recognition, 2020.
228
+
229
+ Suman Ravuri and Oriol Vinyals. Seeing is not necessarily believing: Limitations of biggans for data augmentation. In ICLR Workshop LLD, 2019.
230
+
231
+ Amir Rosenfeld, Richard Zemel, and John K Tsotsos. The elephant in the room. arXiv preprint arXiv:1808.03305, 2018.
232
+
233
+ Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In NeurIPS, 2016.
234
+
235
+ Bernhard Scholkopf. Causality for machine learning. ¨ arXiv preprint arXiv:1911.10500, 2019.
236
+
237
+ Rakshith Shetty, Mario Fritz, and Bernt Schiele. Towards automated testing and robustification by semantic adversarial data generation. In ECCV, 2020.
238
+
239
+ Raphael Suter, Djordje Miladinovic, Bernhard Scholkopf, and Stefan Bauer. Robustly disentangled ¨ causal mechanisms: Validating deep representations for interventional robustness. In ICML, 2019.
240
+
241
+ Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
242
+
243
+ Damien Teney, Ehsan Abbasnedjad, and Anton van den Hengel. Learning what makes a difference from counterfactual examples and gradient supervision. In ECCV, 2020.
244
+
245
+ Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In IROS, 2017.
246
+
247
+ Antonio Torralba and Alexei A Efros. Unbiased look at dataset bias. In CVPR, 2011.
248
+
249
+ Julius von Kugelgen, Ivan Ustyuzhaninov, Peter Gehler, Matthias Bethge, and Bernhard Sch ¨ olkopf.¨ Towards causal generative scene models via competition of experts. In ICLR Workshop CLDM, 2020.
250
+
251
+ Andrey Voynov and Artem Babenko. Unsupervised discovery of interpretable directions in the gan latent space. arXiv preprint arXiv:2002.03754, 2020.
252
+
253
+ Lijun Wang, Huchuan Lu, Yifan Wang, Mengyang Feng, Dong Wang, Baocai Yin, and Xiang Ruan. Learning to detect salient objects with image-level supervision. In CVPR, 2017.
254
+
255
+ Zeyu Wang, Klint Qinami, Ioannis Christos Karakozis, Kyle Genova, Prem Nair, Kenji Hata, and Olga Russakovsky. Towards fairness in visual recognition: Effective strategies for bias mitigation. In CVPR, 2020.
256
+
257
+ 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.
258
+
259
+ Jianwei Yang, Anitha Kannan, Dhruv Batra, and Devi Parikh. Lr-gan: Layered recursive generative adversarial networks for image generation. arXiv preprint arXiv:1703.01560, 2017.
260
+
261
+ # APPENDIX A MNIST VARIANTS
262
+
263
+ # A.1 VARIATIONAL AUTOENCODERS ON COLORED MNIST
264
+
265
+ Figure 6 shows the latent space of a $\beta$ -VAE (Higgins et al., 2017) trained on colored MNIST. The VAE disentangles the data into different clusters present in the data. However, the axes do not correspond to color and shape, i.e., color and shape vary when traversing one latent. We used only two latent dimensions for visualization purposes; the problem is not resolved by adding more dimensions. The same behaviour can be observed for unconstrained GANs (Goodfellow et al., 2014), as a GAN also approximates the training distribution.
266
+
267
+ ![](images/ed465749fd0e3825bbf1f6a1a2a435b05f8ea10a2bf3071d89b0e7c1d6778b0c.jpg)
268
+ Figure 6: Colored MNIST. (left) Examples of data points. (right) Training a disentangled VAE with two latent dimensions on colored MNIST.
269
+
270
+ # A.2 MNISTS GENERATION
271
+
272
+ Colored MNIST. This dataset was proposed by Kim et al. (2019). They select ten distinct colors and assign each of them to a class. For each training image, they sample a color from a normal distribution with the class color as the mean. In the test set, the colors are randomly assigned. The variance $\sigma$ of the normal distribution can be used to control the amount of bias. We evaluate on the hardest, i.e., most biased, setting with $\sigma = 0 . 0 2$ .
273
+
274
+ Double-Colored MNIST. We follow the same procedure as for colored MNIST. We additionally encode the class label in the background color.
275
+
276
+ Wildlife MNIST. To build a version of MNIST closer to an ImageNet setting, we add a texture bias to the data. We follow the same procedure as for double-colored MNIST. We take textures from (Cimpoi et al., 2014) and use ten images of the texture class ”striped” to encode the label in the foreground. Similarly, we encode the label in the background with textures of the texture class ”veiny.” We do not add noise to texture to add stochasticity. Instead, we sample a $3 2 \mathrm { x } 3 2 $ patch from the larger texture image. The textures are multi-modal; hence, these patches can look quite different.
277
+
278
+ # A.3 ABLATION STUDIES
279
+
280
+ In Figure 7, we study the effects of the number of counterfactual data points on the test accuracy. We increase the amount of counterfactual data while the amount of real data is fixed (50k for MNIST). We also ablate the amount of counterfactual drawn per sampled noise $u$ . We find that the higher the number of counterfactual data points, the better. Also, it is advantageous to draw several counterfactuals per $u$ . Our intuition is that several counterfactuals provide a more stable signal of the non-spurious factor.
281
+
282
+ ![](images/b2c10e801b393cc80a5c8b85c3a59bdc9baacfb6f9b7b738c9a2f4e8e6c27a57.jpg)
283
+ Figure 7: MNIST Ablation Study. To improve visibility, we start with $1 0 ^ { 4 }$ counterfactual data points, below the performance is marginally better than the fully biased baseline. The CF ratio indicates how many counterfactuals we generate per sampled noise. For colored MNIST, the maximum CF ratio is ten as there are only ten possible colors per shape.
284
+
285
+ # APPENDIX B CAUSAL STRUCTURES
286
+
287
+ The two SCM’s are as follows:
288
+
289
+ # MNISTs
290
+
291
+ # ImageNet
292
+
293
+ $$
294
+ \begin{array} { r } { \mathbf { M } : = f _ { s h a p e } ( Y _ { 1 } , U _ { 1 } ) } \\ { \mathbf { F } : = f _ { t e x t , 1 } ( Y _ { 2 } , U _ { 2 } ) } \\ { \mathbf { B } : = f _ { t e x t , 2 } ( Y _ { 3 } , U _ { 3 } ) } \\ { \mathbf { X _ { g e n } } : = C ( \mathbf { M } , \mathbf { F } , \mathbf { B } ) } \end{array}
295
+ $$
296
+
297
+ $$
298
+ \begin{array} { c } { { \bf M } : = f _ { s h a p e } ( Y _ { 1 } , U _ { 1 } ) } \\ { { \bf F } : = f _ { t e x t } ( Y _ { 2 } , U _ { 2 } ) } \\ { { \bf B } : = f _ { b g } ( Y _ { 3 } , U _ { 3 } ) } \\ { { \bf X _ { g e n } } : = C ( { \bf M } , { \bf F } , { \bf B } ) } \end{array}
299
+ $$
300
+
301
+ where $\mathbf { M }$ is the mask, $\mathbf { F }$ is the foreground, $\mathbf { B }$ is the background, $U _ { j }$ is the exogenous noise, $Y _ { j }$ is the class label, $\mathbf { X } _ { \mathbf { g e n } }$ is the generated image, and $f _ { j }$ and $C$ are the independent mechanisms.
302
+
303
+ # APPENDIX C IMPLEMENTATION DETAILS
304
+
305
+ # C.1 SHAPE LOSS DETAILS
306
+
307
+ The full shape loss is as follows:
308
+
309
+ $$
310
+ \begin{array} { l } { \mathcal { L } _ { s h a p e } ( f _ { s } ) = \mathcal { L } _ { b i n a r y } ( f _ { s } ) + \mathcal { L } _ { m a s k } ( f _ { s } ) } \\ { = \mathbb { E } _ { p ( \mathbf { u } , y ) } \left[ \displaystyle \sum _ { i = 1 } ^ { N } - m _ { i } \log _ { 2 } ( m _ { i } ) - ( 1 - m _ { i } ) * \log _ { 2 } ( 1 - m _ { i } ) \right] } \\ { \displaystyle \qquad + \mathbb { E } _ { p ( \mathbf { u } , y ) } \left[ \operatorname* { m a x } \left( 0 , \tau - \frac { 1 } { N } \displaystyle \sum _ { i = 1 } ^ { N } m _ { i } \right) + \operatorname* { m a x } \left( 0 , \frac { 1 } { N } \displaystyle \sum _ { i = 1 } ^ { N } m _ { i } - \tau \right) \right] } \end{array}
311
+ $$
312
+
313
+ where $\mathcal { L } _ { b i n a r y }$ is the pixel-wise binary entropy, $\mathcal { L } _ { m a s k }$ is the mask loss, $\mathbf { m } = f _ { s h a p e } ( \mathbf { u } , y )$ is the mask generated by $f _ { s h a p e }$ and $\tau$ is a scalar threshold. $\mathcal { L } _ { b i n a r y }$ enforces the output to be close to either 0 or 1. $\mathcal { L } _ { m a s k }$ prohibits trivial solutions, i.e., masks with all 0’s or $1 { \mathrm { : } } \mathrm { s }$ , that are outside the interval defined by $\tau$ . We set $\tau = 0 . 1$ in all experiments. A $\tau$ of 0.1 means that $\mu _ { m a s k }$ is forced to be in the interval of [0.1, 0.9] – the main object should occupy more than $1 0 \%$ and less than $9 0 \%$ of the image.
314
+
315
+ # C.2 TEXTURE LOSS DETAILS
316
+
317
+ The sampling procedure for $\mathcal { L } _ { t e x t }$ is as follows: we sample 36 patches of size $1 5 \times 1 5$ from the regions where the mask is closest to 1. Out of these 36 patches, we build a $6 \times 6$ patch grid. Finally, we upscale the grid to the full $2 5 6 \times 2 5 6$ resolution; we denote this grid as pg. We then minimize a perceptual loss between the foreground f (the output of $f _ { t e x t . }$ ) and the patchgrid: $\mathcal { L } _ { t e x t } ( \mathbf { f } , \mathbf { p } \mathbf { g } )$ .
318
+
319
+ # C.3 CGN TRAINING ON IMAGENET.
320
+
321
+ Training Settings. For training the CGN, we jointly optimize the following loss:
322
+
323
+ $$
324
+ \begin{array} { l } { { \mathcal { L } = \mathcal { L } _ { r e c } + \mathcal { L } _ { s h a p e } + \lambda _ { 5 } \mathcal { L } _ { t e x t } + \lambda _ { 6 } \mathcal { L } _ { b g } } } \\ { { \phantom { \mathcal { L } = \mathcal { L } _ { { L } } } } } \\ { { \phantom { \mathcal { L } = \mathcal { L } _ { { L } e c } + \lambda _ { 2 } \mathcal { L } _ { p e r c } + \lambda _ { 3 } \mathcal { L } _ { b i n a r y } + \lambda _ { 4 } \mathcal { L } _ { m a s k } + \lambda _ { 5 } \mathcal { L } _ { t e x t } + \lambda _ { 6 } \mathcal { L } _ { b g } } } } \end{array}
325
+ $$
326
+
327
+ We use the following lambdas: $\lambda _ { 1 } = 1 0 0 , \lambda _ { 2 } = 5 , \lambda _ { 3 } = 3 0 0 , \lambda _ { 4 } = 5 0 0 , \lambda _ { 5 } = 5 , \lambda _ { 6 } = 2 0 0 0$ . For the optimization we use Adam (Kingma & Ba, 2014), and set the learning rate of $f _ { s h a p e }$ to 8e-6, and for both $f _ { t e x t }$ and $f _ { b g }$ to 1e-5. We do not use real data for training the CGN so we do not need to any data loading. We sample a single image from BigGAN and the CGN and accumulate the loss gradients for 4000 steps before taking a gradient step. Accumulating large pseudo-batches proved crucial for high-quality gradients, confirming the observations of (Brock et al., 2018). Further, using a batch size of one makes it possible to train on a single GPU. For the perceptual losses, i.e., $\mathcal { L } _ { p e r c }$ and $\mathcal { L } _ { t e x t }$ , we use pre-trained VGG16 with batch normalization layers. We calculate the style reconstruction loss (Johnson et al., 2016) of the features after the first four max-pooling layers.
328
+
329
+ We use the pre-trained BigGAN models from https://github.com/huggingface/ pytorch-pretrained-BigGAN. We experiment with different values for the truncation value of the truncated normal distribution used to sample the input noise. However, we find it does not impact the performance of the CGN. Also, a low value leads to worse performance of the trained classifiers; hence, we leave the truncation value at 1.
330
+
331
+ Hyperparameter Search. We measure the Inception score (IS) during training and the mean value of the masks $\mu _ { m a s k }$ to detect mask collapse. We also observe the generated images for a fixed noise vector; see the outputs in Figure 5. Our overall objective is a high IS and a stable $\mu _ { m a s k }$ . Further, we aim for high-quality output of all IMs (Masks: binary, capture only class-specific parts; Textures: no background/global shape visible, Background: no trace of foreground objects visible). We observe these outputs for several classes during optimization. The hyperparameters can be tuned mostly independently from each other, i.e., a better lambda for the mask loss does not influence the quality of the texture maps much.
332
+
333
+ # C.4 CLASSIFIER TRAINING
334
+
335
+ MNIST. We use the same CNN architecture for all experiments and approaches. For IRM, we produce versions of double-colored MNIST and Wildlife MNIST with different degree of correlation between the label and the foreground colors/textures and background colors/textures. We then train IRM on 2 environments $90 \%$ and $100 \%$ correlation) or 5 environments $90 \%$ , $9 2 . 5 \%$ , $9 5 \%$ , $9 7 . 5 \%$ , and $100 \%$ correlation). We schedule the gradient norm penalty weight, starting from 0, then linearly increasing it over the training episodes. We find the scheduling to be crucial for IRM to converge and achieve good performance.
336
+
337
+ ImageNet. We use a ResNet-50 from PyTorch torchvision. We share the weight up to the last layer as a common backbone and add three fully-connected heads (shape, texture, background). Each of the heads is provided its respective label when training on the counterfactual images. On the real images, we average the logits of all heads. This approach allows the single classifiers to focus on its assigned FoV while the ensemble performs well overall. Similarly to the experiments by (Geirhos et al., 2018), we begin the training with pre-trained weights from ImageNet. We train for 70 episodes with Stochastic Gradient Descent using a batch size of 512. Of the 512 images, 256 are real images, 256 are counterfactual images. We find that an even ratio between real and counterfactual images leads to the best results in terms of optimization stability and performance. We use a momentum of 0.9, weight decay (1e-4), and a learning rate of 0.1, multiplied by a factor of 0.001 after 30 and 60 epochs.
338
+
339
+ # APPENDIX D MORE SAMPLES AND INTERPOLATIONS
340
+
341
+ # D.1 INDIVIDUAL IM OUTPUTS FOR DIFFERENT CLASS TYPES
342
+
343
+ In the following we illustrate the individual outputs of each IM for different classes. In each figure, we show from top to bottom: pre-masks ˜m, masks m, texture maps f, backgrounds b, and composite images ${ \bf x } _ { g e n }$ . For all shown outputs, we set the truncation parameter for the noise to 0.5.
344
+
345
+ ![](images/a726550bd8943b5a6da699319e761992de36d1174b21906786f20414a3d409e1.jpg)
346
+ Figure 8: IM Outputs for ’jay’. From top to bottom: $\tilde { \mathbf { m } } , \mathbf { m } , \mathbf { f } , \mathbf { b } , \mathbf { x } _ { g e n }$ .
347
+
348
+ ![](images/2ef6468f6968992e29b0881e055cbfb1dd547189adc991b8b207c8388e1b32ee.jpg)
349
+ Figure 9: IM Outputs for ’wallaby’. From top to bottom: $\tilde { \mathbf { m } } , \mathbf { m } , \mathbf { f } , \mathbf { b } , \mathbf { x } _ { g e n }$ .
350
+
351
+ ![](images/ff8846d919104cdf6e6490b0687f4319bf94b5a310bb866850f88bdb1f3772fe.jpg)
352
+ Figure 10: IM Outputs for ’king penguin’. From top to bottom: ˜m, m, f , b, xgen.
353
+
354
+ ![](images/781dea76d37f3aeef072ed869b8ef70856df599dfd16bc5837689549e24eef56.jpg)
355
+ Figure 11: IM Outputs for ’vizsla’. From top to bottom: $\tilde { \mathbf { m } } , \mathbf { m } , \mathbf { f } , \mathbf { b } , \mathbf { x } _ { g e n }$ .
356
+
357
+ ![](images/7ddca73eb8fc4b7b5c440d2af2927120f3d79eca2d01c29767ac3bbfe379bbaf.jpg)
358
+ Figure 12: IM Outputs for ’barn’. From top to bottom: ˜m, m, f , b, ${ \bf x } _ { g e n }$ .
359
+
360
+ ![](images/807199a77858629c8aa7651c15af649edba3b6997abdd03bbc799da9bb6e8a23.jpg)
361
+ Figure 13: IM Outputs for ’speedboat’. From top to bottom: ˜m, m, f , b, ${ \bf x } _ { g e n }$ .
362
+
363
+ ![](images/953ee35f7fe66fd2d27b31c3f6362f93356e1b14c1efb50a6a87405f9e48273c.jpg)
364
+ Figure 14: IM Outputs for ’viaduct’. From top to bottom: $\tilde { \mathbf { m } } , \mathbf { m } , \mathbf { f } , \mathbf { b } , \mathbf { x } _ { g e n }$ .
365
+
366
+ ![](images/30134a87478d49668a530ae4edfd78c7ac192c351b65211e9fc7e98b0c0072ed.jpg)
367
+ Figure 15: IM Outputs for ’cauliflower’. From top to bottom: ˜m, m, f , b, xgen.
368
+
369
+ ![](images/1a01bf5e7adf44b1af992af33432d5050742066c93e79c49b7ac6373b0f71044.jpg)
370
+ Figure 16: IM Outputs for ’bell pepper’. From top to bottom: ˜m, m, f , b, xgen.
371
+
372
+ ![](images/dcedcc002e51cedbfd64a8cf8d454671ae4d2f5a496a05d599b3599355720fee.jpg)
373
+ Figure 17: IM Outputs for ’strawberry’. From top to bottom: $\mathbf { \tilde { n } } , \mathbf { m } , \mathbf { f } , \mathbf { b } , \mathbf { x } _ { g e n }$ .
374
+
375
+ ![](images/02cbc05ef6161cc89c79089211af170f6f202ce5236e96be18d2aa0a80405cb1.jpg)
376
+ Figure 18: IM Outputs for ’geyser’. From top to bottom: $\tilde { \mathbf { m } } , \mathbf { m } , \mathbf { f } , \mathbf { b } , \mathbf { x } _ { g e n }$ .
377
+
378
+ ![](images/d7ea937311b25b09a8360e026912a2b212969ad2d34d903d7794f92d2abf9b9c.jpg)
379
+ Figure 19: IM Outputs for ’agaric’. From top to bottom: $\tilde { \mathbf { m } } , \mathbf { m } , \mathbf { f } , \mathbf { b } , \mathbf { x } _ { g e n }$ .
380
+
381
+ ![](images/d17c5360c449b5dfd80d7c4b9ff684ac457e35dcac78f58761e8f42a0f9b028b.jpg)
382
+ Figure 20: Interpolating Shapes. We interpolate between $u$ and $y$ pairs.
383
+
384
+ jack-o'- lantern
385
+
386
+ monarch butterfly
387
+
388
+ ![](images/2196d2765b0db06e8315e10abbd533f9e305b6ecef172a191076be9b4879ea10.jpg)
389
+ Figure 21: Interpolating Textures. We interpolate between $u$ and $y$ pairs.
390
+
391
+ ![](images/9b3f8d1df132c88f3add58bfbfa20cb62b252fb874b69b60ba5e06d883fbe557.jpg)
392
+ Figure 22: Interpolating Backgrounds. We interpolate between $u$ and $y$ pairs.
393
+
394
+ # D.3 MORE COUNTERFACTUAL SAMPLES
395
+
396
+ ![](images/f208fa0cd4b34c5c09390be75bcd73fcef4adda55aef56d9edb8a084e5a80749.jpg)
397
+ Figure 23: MNIST Counterfactuals. From Left to Right: colored, double-colored-, and Wildlife MNIST.
398
+
399
+ ![](images/8618f3392f54df2de489b1b1159370e8690a6272cbc14fd38ba32c9c9ca7c20b.jpg)
400
+
401
+ ![](images/62ee59fe95f92de5fd192baa77450abd9d659a0474b4935bb2c228f2229cca1f.jpg)
402
+
403
+ Figure 24: ImageNet Counterfactuals. Top: Counterfactual Images. Bottom: ImageNet labels.
404
+
405
+ <table><tr><td rowspan=1 colspan=1>Row</td><td rowspan=1 colspan=1>Column</td><td rowspan=1 colspan=1>Shape</td><td rowspan=1 colspan=1>Texture</td><td rowspan=1 colspan=1>Background</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>offshore rig</td><td rowspan=1 colspan=1>ambulance</td><td rowspan=1 colspan=1>breakwater</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>mushroom</td><td rowspan=1 colspan=1>sand viper</td><td rowspan=1 colspan=1>ostrich</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>snowmobile</td><td rowspan=1 colspan=1>French Loaf</td><td rowspan=1 colspan=1>Arabian camel</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>katamaran</td><td rowspan=1 colspan=1>cheetah</td><td rowspan=1 colspan=1> garden spider</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>bald eagle</td><td rowspan=1 colspan=1>strawberry</td><td rowspan=1 colspan=1>spike</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>triumphal arc</td><td rowspan=1 colspan=1>standard poodle</td><td rowspan=1 colspan=1>bullfrog</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>forklift</td><td rowspan=1 colspan=1>theater curtain</td><td rowspan=1 colspan=1>valley</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>whine bottle</td><td rowspan=1 colspan=1>pill bottle</td><td rowspan=1 colspan=1>alp</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1> pirate ship</td><td rowspan=1 colspan=1>trench coat</td><td rowspan=1 colspan=1>beaver</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>submarine</td><td rowspan=1 colspan=1>race car</td><td rowspan=1 colspan=1>hay</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>wood rabbit</td><td rowspan=1 colspan=1> jack-o&#x27;-lantern</td><td rowspan=1 colspan=1>water ouzel</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1> teapot</td><td rowspan=1 colspan=1>military uniform</td><td rowspan=1 colspan=1>baseball</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr></table>
406
+
407
+ In the following we illustrate the individual outputs of each IM over the course of training. In each figure, we show from top to bottom: pre-masks ˜m, masks m, texture maps f, backgrounds b, and composite images ${ \bf x } _ { g e n }$ .
408
+
409
+ ![](images/5e983ca31a5c9fe82c419fc44222dec0a7f11646ac9f92641915b89626cc63b5.jpg)
410
+ Figure 25: IM Outputs over Training for ’dalmatian’ The arrows indicate the beginning and end of the training.
411
+
412
+ ![](images/d5b1e1e3cb1a98171d5ad98330070b28d20a4a4d9c94db2fe95cb12486620abb.jpg)
413
+ Figure 26: IM Outputs over Training for ’cauliflower’ The arrows indicate the beginning and end of the training.
414
+
415
+ ![](images/9646160ff9ceb8a5ef74c06c1e00beff64805db8ce93e4c4ecaa171ae38bacdb.jpg)
416
+ Figure 27: IM Outputs over Training for ’castle’ The arrows indicate the beginning and end of the training.
417
+
418
+ ![](images/8279076015204fade1772909d39e58976ddfe047d92332f1ded6150892ff4b42.jpg)
419
+ Figure 28: IM Outputs over Training for ’ringtailed lemur’ The arrows indicate the beginning and end of the training.
420
+
421
+ ![](images/4869e317c99f56cf30a4892dc72b1386f6b5dd72cdbee248cd6ad45c9b269dcd.jpg)
422
+ Figure 29: IM Outputs over Training for ’mushroom’ The arrows indicate the beginning and end of the training.
423
+
424
+ ![](images/3f9c327c7cf1065327fecf2aae2c7d345c8e639213a9f2f7caeda834dbc87bba.jpg)
425
+ Figure 30: Texture-Background Entanglement. For relatively small objects, the texture maps can still show traces of the background. A possible remedy would be to choose the patch size for $\mathcal { L } _ { t e x t }$ dependent on the relative object size.
426
+
427
+ ![](images/43a6776fb0a5591d7984aa43f2957d0ad493e1f281a4f26ffdafa77d84f38b30.jpg)
428
+ Figure 31: Background Residues. Especially for large objects, i.e., where large regions need to be in-painted, there can be faint artifacts visible. For the composite images, this is not a problem as an object will cover the residue.
429
+
430
+ ![](images/d840304061e7922037dc6afcfb53868798a836d974540dbdbb1e2108efc3bfc0.jpg)
431
+ Figure 32: Reduced Realism. As evidence by the lower IS, the generated images $x _ { g e n }$ are generally lower in realism. This reduced realism is due to the constraints that we enforce and the simplified composition mechanism. A solution might be to add a shallow refinement network after the composer.
432
+
433
+ # APPENDIX G COLLAPSING MASKS
434
+
435
+ ![](images/084316d6e69bb5d78bd263eb76cf2925ee59e115d5ffd6403f54ef98cf4eff2c.jpg)
436
+ Figure 33: Masks when disabling different losses. From left to right: the beginning of training, training without $\mathcal { L } _ { s h a p e }$ , training without $\mathcal { L } _ { t e x t }$ , training without $\mathcal { L } _ { b g }$ , training with all losses. The third and fourth columns show the collapse of the masks, as described in section 4.2.
437
+
438
+ # APPENDIX H CGN AUGMENTATION WITH IRM ASSUMPTIONS
439
+
440
+ We can drop the assumption of a priori knowledge of the causal signal and follow the same assumption as IRM: several environments with varying correlations, an invariant signal is considered causal. In the following, we train a CGN on double-colored MNIST. We then generate counterfactual data to train three classifiers:
441
+
442
+ • Shape classifier (SC): invariant wrt. object color and background color • Object color classifier (OCC): invariant wrt. object shape and background color • Background color classifier (BCC): one invariant wrt. object shape and object color
443
+
444
+ We can measure their respective performance in the environments used to train IRM. In these environments, only the shape is stably correlated with the label; the foreground and background color vary in their degree of correlation. Based on the results in Table 5, we can determine the shape to be the causal signal as only the test accuracy of SC is stable across environments.
445
+
446
+ <table><tr><td>Degree of Correlation</td><td>Accuracy SC[%]</td><td>Accuracy OCC[%]</td><td>Accuracy ] BCC[%]</td></tr><tr><td>90 %</td><td>85.05 ± 0.12</td><td>58.72 ± 0.67</td><td>82.47 ± 0.13</td></tr><tr><td>95 %</td><td>85.08 ± 0.07</td><td>62.69 ± 0.58</td><td>87.96 ± 0.12</td></tr><tr><td>100 %</td><td>85.14 ± 0.10</td><td>65.05 ± 1.32</td><td>90.16 ± 0.13</td></tr></table>
447
+
448
+ Table 5: Test Accuracy on double-colored MNIST. We report the mean and standard deviation over three random seeds.
md/train/Byx1VnR9K7/Byx1VnR9K7.md ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TRAJECTORY VAE FOR MULTI-MODAL IMITATION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We address the problem of imitating multi-modal expert demonstrations in sequential decision making problems. In many practical applications, for example video games, behavioural demonstrations are readily available that contain multi-modal structure not captured by typical existing imitation learning approaches. For example, differences in the observed players’ behaviours may be representative of different underlying playstyles.
8
+
9
+ In this paper, we use a generative model to capture different emergent playstyles in an unsupervised manner, enabling the imitation of a diverse range of distinct behaviours. We utilise a variational autoencoder to learn an embedding of the different types of expert demonstrations on the trajectory level, and jointly learn a latent representation with a policy. In experiments on a range of 2D continuous control problems representative of Minecraft environments, we empirically demonstrate that our model can capture a multi-modal structured latent space from the demonstrated behavioural trajectories.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Imitation learning has become successful in a wide range of sequential decision making problems, in which the goal is to mimic expert behaviour given demonstrations (Ziebart et al., 2008; Wang et al., 2017; Li et al., 2017; D’Este et al., 2003). Compared with reinforcement learning, imitation learning does not require access to a reward function – a key advantage in domains where rewards are not naturally or easily obtained. Instead, the agent learns a behavioural policy implicitly through demonstrated trajectories.
14
+
15
+ Expert demonstrations are typically assumed to be provided by a human demonstrator and generally can vary from person to person, e.g., according to their personality, experience and skill at the task. Therefore, when capturing demonstrations from multiple humans, observed behaviours may be distinctly different due to multi-modal structure caused by differences between demonstrators. Variations like these, which are very common in video games where players often cluster into distinct play styles, are typically not modelled explicitly as the structure of these differences is not known a priori but instead emerge over time as part of the changing meta-game.
16
+
17
+ In this paper, we propose Trajectory Variational Autoencoder (T-VAE) a deep generative model that learns a structured representation of the latent features of human demonstrations that result in diverse behaviour, enabling the imitation of different types of emergent behaviour. In particular, we use a Variational Autoencoder (VAE) to maximise the Evidence Lower Bound (ELBO) of the log likelihood of the expert demonstrations on the trajectory level where the policy is directly learned from optimising the ELBO. Not only can our model reconstruct expert demonstrations, but we empirically demonstrate it learns a meaningful latent representation of distinct emergent variances in the observed trajectories.
18
+
19
+ # 2 RELATED WORK
20
+
21
+ Popular imitation learning methods include behavior cloning (BC) (Pomerleau, 1991), which is a supervised learning method that learns a policy from expert demonstration of state-action pairs. However, this approach assumes independent observations which is not the case for sequential decision making problems, as future observations depend on previous actions. It has been shown that BC cannot generalise well to unseen observations (Ross & Bagnell, 2010). Ross et al. (2011) proposed a new iterative algorithm, which trains a stationary deterministic policy with no regret learning in an online setting to overcome this issue. Torabi et al. (2018) also improve behaviour cloning with a two-phase approach where the agent first learns an inverse dynamics model via interacting with the environment in a self-supervised fashion, and then use the model to infer missing actions given expert demonstrations. An alternative approach is Apprenticeship Learning (AC) (Abbeel & Ng, 2004), which uses inverse reinforcement learning to infer a reward function from expert trajectories. However, it suffers from expensive computation due to the requirement of repeatedly performing reinforcement learning from tabula-rasa to convergence. Whilst each of these methods has had successful applications, none are able to capture multi-modal structure in the demonstration data representative of underlying emergent differences in playstyle.
22
+
23
+ More recently, the learning of a latent space for imitation learning has been studied in the literature. Generative Adversarial Imitation Learning (GAIL) (Ho & Ermon, 2016) learns a latent space of demonstrations with a Generative Adverserial Network (GAN) (Goodfellow et al., 2014) like approach which is inherently mode-seeking and does not explicitly model multi-modal structure in the demonstrations. This limitation was addressed by (Li et al., 2017), who built on the GAIL framework to infer a latent structure of expert demonstrations enabling imitation of diverse behaviours. Similarly, (Wang et al., 2017) combined a VAE with a GAN architecture to imitate diverse behaviours. However, these methods require interacting with the environment and rollouts of the policy whilst learning. For comparison we note our method does not need access to the environment simulator during training and is computationally cheaper, as the policy is learned simply by gradient descent using a fixed dataset of trajectories. Additionally, whilst the aim in GAIL is to keep the agent behaviour close to the expert’s state distribution, our model can serve as an alternative approach to capturing state sequence structure.
24
+
25
+ In work more closely related to our approach, (Co-Reyes et al., 2018) have also proposed a Variational Auto encoder (VAE) (Kingma & Welling, 2013) that embeds the expert demonstration on the trajectory level which showed promising results. However their approach only encodes the trajectories of the states whereas ours encodes both the state and action trajectories, which also allows us to learn the policy directly from the probabilistic model rather than adding a penalty term to the ELBO. Rabinowitz et al. (2018) also learns an interpretable representation of the latent space in a hierarchical way, but their focus is more on representing the mental states of other agents and is different from our goal of imitating diverse emergent behaviours.
26
+
27
+ # 3 METHODS
28
+
29
+ # 3.1 PRELIMINARIES
30
+
31
+ Let the tuple $( S , { \mathcal { A } } , P , r , I )$ denote the infinite-horizon Markov Decision Processes $( M D P )$ with: $s$ the state space, $\mathcal { A }$ the action space, $P$ the transition probability distribution, $r$ the reward function and $I$ the distribution of the initial state $s _ { 0 }$ . Let $\pi _ { E } : S \times A \to [ 0 , 1 ]$ denote the expert policy which we do not know, under which expert trajectories $\tau$ of states and actions are generated from, i.e., $s _ { 0 } \sim I , a _ { t } \sim \pi _ { E } ( a _ { t } | s _ { t } ) , s _ { t + 1 } \sim \bar { P } ( s _ { t + 1 } | a _ { t } , s _ { t } )$ . The goal of imitation learning is to learn a policy $\pi$ that best explains the trajectories without knowledge of the reward signal $r$ .
32
+
33
+ # 3.2 TRAJECTORY VAE (T-VAE)
34
+
35
+ Given $N$ demonstrated trajectories $\{ \tau ^ { ( i ) } \} _ { i = 1 } ^ { N }$ of states and actions, where each $\begin{array} { r l } { \tau ^ { ( i ) } } & { { } = } \end{array}$ $\{ ( s _ { t } ^ { ( i ) } , a _ { t } ^ { ( i ) } ) \} _ { t = 1 } ^ { T _ { i } }$ t )} it=1 , where $T _ { i }$ is the length of trajectory $\tau ^ { ( i ) }$ . The marginal likelihood of the set $\begin{array} { r } { \log p _ { \theta } \big ( \tau ^ { ( 1 ) } , \cdot \cdot \cdot , \tau ^ { ( N ) } \big ) = \sum _ { i = 1 } ^ { N } \log p _ { \theta } \big ( \tau ^ { ( i ) } \big ) } \end{array}$ the marginal likelihoods of each individual trajectory. We use a latent variable model and assume the prior Rather than a VAE which is applied on the data point $z$
36
+ level, we use a VAE on the trajectory level (which consists of a time sequence of data points), as shown in Figure 1a. We call our model Trajectory $V A E \left( T – V A E \right)$ .
37
+
38
+ ![](images/c6ffb7f9335a673833f680a4ac208af0d3cac62fa7bd060c704ff6de4ac94a86.jpg)
39
+
40
+ # 3.2.1 ENCODER NETWORK
41
+
42
+ We encode whole trajectories into the latent space in order to embed useful features of different behaviours and extract distinguishing features which differ from trajectory to trajectory. Note that the latent $z$ is therefore a single variable rather than a sequence that depends on $t$ . In order to utilise all information, we encode both the states and actions, i.e., $q _ { \phi } ( z | \tau ^ { ( i ) } ) = q _ { \phi } ( z | \{ ( s _ { t } ^ { ( i ) } , a _ { t } ^ { ( i ) } ) \} _ { t = 1 } ^ { T _ { i } } )$ We assume that the approximate posterior $\boldsymbol { q } _ { \phi } \big ( \boldsymbol { z } \big | \tau ^ { ( i ) } \big )$ has a Gaussian distribution, whose mean and log variance parameters are constructed as follows (and illustrated in the top half of Figure 1b): 1) concatenate states with actions at each time step $[ s _ { t } , a _ { t } ]$ ; 2) feed the sequence into a bidirectional LSTM; 3)mean-pool over the outputs along the time horizon $( T ^ { ( i ) } ) ; 4 )$ ) pass through two separate fully connected layers.
43
+
44
+ # 3.2.2 DECODER NETWORK
45
+
46
+ The decoder $p ( \tau ^ { ( i ) } | z )$ can be decomposed as
47
+
48
+ $$
49
+ p _ { \theta } ( \tau ^ { ( i ) } | z ) = p _ { \theta _ { S D } } ( \{ s _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } | z ) p _ { \theta _ { P D } } ( \{ a _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } | z , \{ s _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } )
50
+ $$
51
+
52
+ where we call $p _ { \theta _ { S D } } ( \{ s _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } | z )$ the state decoder and $p _ { \theta _ { P D } } ( \{ a _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } | z , \{ s _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } )$ the policy decoder. Instead of having a separate policy decoder and control it to be consistent with the state decoder (as proposed by (Co-Reyes et al., 2018)), T-VAE models the policy and state decoder jointly and enables consistency inherently. Note that the state decoder does not depend on the policy and therefore during training, we do not need to interact with the environment nor conduct rollouts of the policy, making the learning process simpler and computationally relatively cheap.
53
+
54
+ For the state decoder, we assume Gaussian distribution on each $s _ { t } ^ { ( i ) }$ where the variance is fixed and the mean $\hat { s } _ { t } ^ { ( i ) }$ is computed recursively. At time $t < = T ^ { ( i ) }$ , we concatenate $\hat { s } _ { t } ^ { ( i ) }$ with the latent $z$ to form [ˆs(i)t , which is fed into a LSTM cell, the output is then fed into a fully connected layer to produce $\hat { s } _ { t + 1 } ^ { ( i ) }$ . The fully connected layers guarantee that the dimensionality is preserved ( $\hat { s } _ { t }$ has the same dimension as $s _ { t }$ ).
55
+
56
+ For the action decoder, we assume Gaussian distribution over $a _ { t }$ for continuous actions and Multinomial/Bernoulli distributions for discrete actions. The variational parameter to be learned $\hat { a } _ { t + 1 } ^ { ( i ) }$ is therefore the mean and the logits vector in the two cases respectively. Similarly as the state decoder, $\hat { a } _ { t + 1 } ^ { ( i ) }$ is generated recursively from $[ \hat { a } _ { t } ^ { ( i ) } , \hat { s } _ { t } ^ { ( i ) } , z ]$ which is fed into a LSTM followed by a fully connected layer. Continuous actions are output at this stage, or an additional softmax/sigmoid activation function is applied to the output to generate discrete actions. If the action space consists of a mixture of continuous and discrete actions, we assume the actions are independent conditional on the states and latent variable, and the policy decoder can be factored as the product. An illustration of the entire model can be found in figure 1b with the bottom half representative of the decoder network.
57
+
58
+ # 3.2.3 VARIATIONAL BOUND
59
+
60
+ The marginal likelihood for each trajectory can be written as
61
+
62
+ $$
63
+ \log p _ { \theta } ( \tau ^ { ( i ) } ) = D _ { K L } \big ( q _ { \phi } ( z | \tau ^ { ( i ) } ) | | p _ { \theta } ( z | \tau ^ { ( i ) } ) \big ) + \mathcal { L } ( \theta , \phi ; \tau ^ { ( i ) } )
64
+ $$
65
+
66
+ where $D _ { K L }$ represents the KL divergence between the approximate posterior and the true posterior, and $\mathcal { L } ( \theta , \phi ; \tau ^ { ( i ) } )$ is the variational lower bound of the marginal likelihood of $\tau ^ { ( i ) }$ which is decomposed into 3 terms: the $L 2$ reconstruction loss for the state decoder, the $L 2$ or cross entropy/sigmoid reconstruction loss for the policy decoder and a KL divergence between the posterior and prior distribution of the latent variable $z$ . Formally:
67
+
68
+ $$
69
+ \begin{array} { r l } & { \mathcal { L } ( \theta , \phi ; \tau ^ { ( i ) } ) = \mathbf { E } _ { q _ { \phi } ( z | \tau ^ { ( i ) } ) } [ - \log q _ { \phi } ( z | \tau ^ { ( i ) } ) + \log p _ { \theta } ( \tau ^ { ( i ) } , z ) ] } \\ & { = \mathbf { E } _ { q _ { \phi } ( z | \tau ^ { ( i ) } ) } [ \log p _ { \theta } ( \tau ^ { ( i ) } | z ) ] - D _ { K L } ( q _ { \phi } ( z | \tau ^ { ( i ) } ) | p _ { \theta } ( z ) ) } \\ & { = \mathbf { E } _ { q _ { \phi } ( z | \tau ^ { ( i ) } ) } [ \log p _ { \theta } ( \{ s _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } | z ) + \log p _ { \theta } ( \{ a _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } | \{ s _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } , z ) ] - D _ { K L } ( q _ { \phi } ( z | \tau ^ { ( i ) } ) | p _ { \theta } ( z ) ) } \end{array}
70
+ $$
71
+
72
+ As $\log p _ { \theta } ( \tau ^ { ( i ) } ) \geq \mathcal { L } ( \theta , \phi ; \tau ^ { ( i ) } )$ , the encoder and decoder network parameters can then be optimised with stochastic gradient descent.
73
+
74
+ # 3.3 GENERATING TRAJECTORIES
75
+
76
+ After learning the latent representaspace; 2) using the state decoder ate trajectories by: 1) sampling a to decode the trajectory of stat $z$ $p _ { \theta _ { S D } } ( \{ s _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } | z )$ $\{ s _ { t } \} _ { t = 1 } ^ { T } ; 3 )$ applying the policy decoder $p _ { \theta _ { P D } } ( \{ a _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } | z , \{ s _ { t } ^ { ( i ) } \} _ { t = 1 } ^ { T } )$ to decode a sequence of $\{ a _ { t } \} _ { t = 1 } ^ { T }$ . In other words, all of the actions are predicted before the agent interacting with the environment. This may not be desired if the environment is noisy or the episode does not have a fixed length. Instead, one can use a rolling window to predict the trajectories for the next $n$ steps and refit the model with the new observation every $n$ steps, until the episode ends. We will discuss in more details the effect of the rolling window size $n$ later in section 4.3.
77
+
78
+ # 4 EXPERIMENT
79
+
80
+ # 4.1 2D NAVIGATION EXAMPLE
81
+
82
+ ![](images/a9ce54c9604aae1af40f078988b65db1bc31b4579dffe4e17765555503861a8e.jpg)
83
+ Figure 2: (a) Ground truth for test set; (b) reconstructed test set from state decoder; (c) reconstructed test set from policy decoder and (d) learned latent space for test set, each point in the latent space represents a trajectory.
84
+
85
+ We first apply our model to a 2D navigation example with 3 types of trajectories representative of players moving towards different goal locations. This experiment confirms our approach can detect and imitate multi-modal structure demonstrations, and learns a meaningful and consistent latent representation. Starting from $( 0 , 0 )$ , the state space consists of the 2D (continuous) coordinates and the action is the angle along which to move a fixed distance $( = 1 )$ ). The time horizon is fixed to be 100.
86
+
87
+ In Figure 2, the ground truth trajectories are given in (a), and we reconstruct the trajectories through the state decoder and the policy decoder in (b) and (c) respectively. It can be seen that they are consistent with each other and represent the test set well. The latent embedding can be found in (d), where we can clearly identify 3 clusters corresponding to the 3 types of trajectories.
88
+
89
+ Figure 3 shows interpolations as we navigate through the latent space, i.e. we sample a 4 by 4 grid in the latent space, and generate trajectories using the state decoder and the policy decoder. We can see that the T-VAE shows consistent behaviour as we interpolate in the latent space. This confirms that our approach can detect and imitate latent structure, and that it learns a meaningful latent representation that captures the main dimensions of variation.
90
+
91
+ ![](images/c6b1af3d7ac9fc3327547433821968ee3c652b1d36210e36f695f3d2e7bf40a7.jpg)
92
+ Figure 3: Intepolation of latent space for (a) state decoder; and (b) policy decoder. It can be observed that the top left corner, top right corner and bottom right corner behave like the red, blue and green type of trajectories respectively and the bottom left corner has a mixed behaviour.
93
+
94
+ # 4.2 2D CIRCLE EXAMPLE
95
+
96
+ ![](images/577aa3609a206332aed2b9a1b0b0d39c654f8874a0be2b56eeecabfb77cd5be7.jpg)
97
+ Figure 4: (a):Ground truth of trajectories on the test set; (b): reconstructed trajectories with state decoder; (c) reconstructed trajectories with policy decoder; (d) 2D latent space.
98
+
99
+ We next apply our model to another 2D example, designed to replicate the experimental setting in Figure 1 of Li et al. (2017). There are three types of circles (in the figures these are coloured in red, blue and green) as shown in Figure 4a. The agent starts from $( 0 , 0 )$ , the observation consists of the continuous 2D coordinates and the action is the relative angle towards which the agent moves. The reconstructed test set using state decoder and policy decoder, and visualisations of the 2D latent space can be found in Figure 4.
100
+
101
+ These results show that when the sequence length is not fixed (as in the previous example), T-VAE is still able to produce consistency between the state and policy decoders and learn latent features that underpins different behaviours. Furthermore, as figure 1 in Li et al. (2017) already showed that both behaviour cloning and GAIL fail at this task whereas InfoGAIL and now T-VAE perform well, it seems that using a latent representation to capture long term dependency is crucial in this example.
102
+
103
+ # 4.3 ZOMBIE ATTACK SCENARIO
104
+
105
+ Finally, we evaluate our model on a simplified 2D Minecraft-like environment. This set of experiments show that T-VAE is able to capture long-term dependencies, model mixed action space, and the performance is improved when using a rolling window during prediction. In each episode, the agent needs to reach a goal. There is a zombie moving towards the agent and there are two types of demonstrated expert behaviour: the ”attacking” behaviour where the agent moves to the zombie and attacks it before going to the goal, or the ”avoiding” behaviour where the agent avoids the zombie and reaches the goal. The initial position of the agent and the goal are kept fixed whereas the initial position of the zombie is sampled uniformly at random. The observation space consists of the distance and angle to the goal and the zombie respectively, and there are two types of actions: 1) the angle along which the agent moves by a fixed step size $_ { ( = 0 . 5 ) }$ , and 2) a Bernoulli variable indicating whether to attack the zombie in a given timestep or not, which is very sparse and typically only equals to 1 once for the ’attacking’ behaviour. Thus, this experiment setup exemplifies a mixed continuous-discrete action space. Episodes end when the agent reaches the goal or the number of time steps reaches the maximum number allowed, which is defined to be the maximum sequence length in the training set (30).
106
+
107
+ Figure 5 shows the ground truth and reconstruction of the two types of behaviours on the test set, and Figure 6 shows the learned latent space. We also provide animations: https: //youtu.be/fvcJbYnRND8 and ’avoiding’ ’region’https://youtu.be/DAruY-Dd9z8. These show test time behaviour where we randomly sample from the posterior distribution of the latent variable $z$ in the latent space corresponding to the ’attacking’ cluster.
108
+
109
+ To examine the diversity of the generated behaviour, we randomly select a latent $z$ in the ’attacking’ and ’avoiding’ clusters in Figure 6a and generate 1000 trajectories. The histogram for different statistics are displayed in Figure 7, where the top and bottom rows represent ’attacking’ and ’avoiding’ behaviour respectively. We can see a clear differentiation between these two different latent variables. Although the agent does not always succeed in killing the zombie, as shown in Figure 7b, the closest distances to the zombie (shown in Figure 7d) are almost all within the demonstrated range, meaning that the agent moves to the zombie but attacked at slightly different timing.
110
+
111
+ Results comparing with different rolling window length can be found in Figure 8. For the attacking agent, each episode is a success if the zombie is dead and the agent reaches the goal. For the avoiding agent, each episode is a success if the agent reaches the goal and is beyond the zombie’s attacking range. It can be seen that for small rolling window lengths, the performance is worse for ’attacking’ agent, since the model fails to capture long-term dependencies but provided a sufficient window length diverse behaviours can be imitated.
112
+
113
+ # 5 CONCLUSION
114
+
115
+ In this paper, we proposed a new method – Trajectory Variational Autoencoder $( T - V A E ) -$ for imitation learning that is designed to capture latent multi-modal structure in demonstrated behaviour. Our approach encodes trajectories of state-action pairs and learns latent representations with a VAE on the trajectory level.
116
+
117
+ T-VAE encourages consistency between the state and action decoders, helping avoid compound errors that are common in simpler behavioural cloning approaches to imitation learning. We demonstrate that this approach successfully avoids compound errors in several tasks that require long-term consistency and generalisation.
118
+
119
+ Our model is successful in generating diverse behaviours and learning a policy directly from a probabilistic model. It is simple to train and gives promising results in a range of tasks, including a zombie task that requires generalisation given a moving opponent as well as a mixed continuousdiscrete action space.
120
+
121
+ ![](images/216875a50ab4e46ec02cd9bee31cfb0b3d421f8c47b6c15dc04d61ac54e7065b.jpg)
122
+ Figure 5: (a) Ground truth and (b) reconstruction (b) for the zombie attack scenario. The agent starts at $( 0 , 0 )$ , the goal is positioned at $( 5 , 5 )$ , and the zombie starts at a random location and moves towards the agent.
123
+
124
+ ![](images/0bdbb6715ab8b2ef6e9959c455362d38400214a6c8b7ed8da766363d78fea3da.jpg)
125
+ Figure 6: Latent representation of the zombie example which is clearly structured. The red and blue points represent the attacking or avoiding behaviour. We also encode partial trajectories before and after the zombie is dead for the ’attacking’ agents, which are plotted in purple and green respectively.
126
+
127
+ ![](images/630f296f6260548d0d16ce0f7cc5bbe4f62a6007d481480f648e2eb5cdaecae2.jpg)
128
+ Figure 7: Top row and bottom row display the results of the trajectories generating from the ’attacking’ and ’avoiding’ cluster respectively. The first and second column show whether the agent attacks the zombie and whether the zombie is dead in the episode, the difference is sometimes agents attacks the zombie but are not in the attacking range so that the zombie does not die. The third and fourth column show the closest distance to the goal and the zombie in each episode. The agent reaches the goal when the distance to it is $< 0 . 5$ which is indicated by the red dash line (successful).
129
+
130
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2> goals reached</td><td rowspan=1 colspan=2> success rate</td><td rowspan=1 colspan=1>dead zombie</td></tr><tr><td rowspan=1 colspan=1>n</td><td rowspan=1 colspan=1> attack</td><td rowspan=1 colspan=1>avoid</td><td rowspan=1 colspan=1> attack</td><td rowspan=1 colspan=1> avoid</td><td rowspan=1 colspan=1> attack</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>84.30%</td><td rowspan=1 colspan=1>90.50%</td><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=1>53.00%</td><td rowspan=1 colspan=1>0%</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>89.50%</td><td rowspan=1 colspan=1>90.70%</td><td rowspan=1 colspan=1>20.50%</td><td rowspan=1 colspan=1>52.00%</td><td rowspan=1 colspan=1>28.40%</td></tr><tr><td rowspan=1 colspan=1>15</td><td rowspan=1 colspan=1>91%</td><td rowspan=1 colspan=1>99.50%</td><td rowspan=1 colspan=1>62.90%</td><td rowspan=1 colspan=1>38.70%</td><td rowspan=1 colspan=1>71.50%</td></tr></table>
131
+
132
+ Figure 8: Comparison of performance in the zombie attack scenario with varying window length.
133
+
134
+ A wide range of future work can be built upon ours. For example, bootstrapping reinforcement learning with these initial policies to improve beyond demonstrated behaviour provided an additional reward signal whilst aiming to maintain the diversity in behaviours.
135
+
136
+ # REFERENCES
137
+
138
+ Pieter Abbeel and Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ . Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 1. ACM, 2004.
139
+
140
+ John D Co-Reyes, YuXuan Liu, Abhishek Gupta, Benjamin Eysenbach, Pieter Abbeel, and Sergey Levine. Self-consistent trajectory autoencoder: Hierarchical reinforcement learning with trajectory embeddings. arXiv preprint arXiv:1806.02813, 2018.
141
+
142
+ Claire D’Este, Mark O’Sullivan, and Nicholas Hannah. Behavioural cloning and robot control. In Robotics and Applications, pp. 179–182, 2003.
143
+
144
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
145
+
146
+ Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In Advances in Neural Information Processing Systems, pp. 4565–4573, 2016.
147
+
148
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
149
+
150
+ Yunzhu Li, Jiaming Song, and Stefano Ermon. Infogail: Interpretable imitation learning from visual demonstrations. In Advances in Neural Information Processing Systems, pp. 3812–3822, 2017.
151
+
152
+ Dean A Pomerleau. Efficient training of artificial neural networks for autonomous navigation. Neural Computation, 3(1):88–97, 1991.
153
+
154
+ Neil C Rabinowitz, Frank Perbet, H Francis Song, Chiyuan Zhang, SM Eslami, and Matthew Botvinick. Machine theory of mind. arXiv preprint arXiv:1802.07740, 2018.
155
+
156
+ Stephane Ross and Drew Bagnell. Efficient reductions for imitation learning. In ´ Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 661–668, 2010.
157
+
158
+ Stephane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured ´ prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627–635, 2011.
159
+
160
+ Faraz Torabi, Garrett Warnell, and Peter Stone. Behavioral cloning from observation. arXiv preprint arXiv:1805.01954, 2018.
161
+
162
+ Ziyu Wang, Josh S Merel, Scott E Reed, Nando de Freitas, Gregory Wayne, and Nicolas Heess. Robust imitation of diverse behaviors. In Advances in Neural Information Processing Systems, pp. 5320–5329, 2017.
163
+
164
+ Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, volume 8, pp. 1433–1438. Chicago, IL, USA, 2008.
md/train/Byx91R4twB/Byx91R4twB.md ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ADVERSARIAL VIDEO GENERATION ON COMPLEX DATASETS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Generative models of natural images have progressed towards high fidelity samples by the strong leveraging of scale. We attempt to carry this success to the field of video modeling by showing that large Generative Adversarial Networks trained on the complex Kinetics-600 dataset are able to produce video samples of substantially higher complexity and fidelity than previous work. Our proposed model, Dual Video Discriminator GAN (DVD-GAN), scales to longer and higher resolution videos by leveraging a computationally efficient decomposition of its discriminator. We evaluate on the related tasks of video synthesis and video prediction, and achieve new state-of-the-art Fréchet Inception Distance for prediction for Kinetics600, as well as state-of-the-art Inception Score for synthesis on the UCF-101 dataset, alongside establishing a strong baseline for synthesis on Kinetics-600.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ ![](images/adc877926138740958977e4f86b2fcca873d05c1b6527e19d41a8b97e5d1037c.jpg)
12
+ Figure 1: Selected frames from videos generated by a DVD-GAN trained on Kinetics-600 at $2 5 6 \times 2 5 6$ , $1 2 8 \times 1 2 8$ , and $6 4 \times 6 4$ resolutions (top to bottom).
13
+
14
+ Modern deep generative models can produce realistic natural images when trained on high-resolution and diverse datasets (Brock et al., 2019; Karras et al., 2018; Kingma & Dhariwal, 2018; Menick & Kalchbrenner, 2019; Razavi et al., 2019). Generation of natural video is an obvious further challenge for generative modeling, but one that is plagued by increased data complexity and computational requirements. For this reason, much prior work on video generation has revolved around relatively simple datasets, or tasks where strong temporal conditioning information is available.
15
+
16
+ We focus on the tasks of video synthesis and video prediction (defined in Section 2.1), and aim to extend the strong results of generative image models to the video domain. Building upon the state-of-the-art BigGAN architecture (Brock et al., 2019), we introduce an efficient spatio-temporal decomposition of the discriminator which allows us to train on Kinetics-600 – a complex dataset of natural videos an order of magnitude larger than other commonly used datasets. The resulting model, Dual Video Discriminator GAN (DVD-GAN), is able to generate temporally coherent, high-resolution videos of relatively high fidelity (Figure 1).
17
+
18
+ ![](images/a2dfb8515504437c7e53d843cc7ee19db4164b306149b5ece9aabdf44ecdcd57.jpg)
19
+ Figure 2: Generated video samples with interesting behavior. In raster-scan order: a) On-screen generated text with further lines appearing.. b) Zooming in on an object. c) Colored detail from a pen being left on paper. d) A generated camera change and return.
20
+
21
+ Our contributions are as follows:
22
+
23
+ • We propose DVD-GAN – a scalable generative model of natural video which produces high-quality samples at resolutions up to $2 5 6 \times 2 5 6$ and lengths up to 48 frames. • We achieve state of the art for video synthesis on UCF-101 and prediction on Kinetics-600. • We establish class-conditional video synthesis on Kinetics-600 as a new benchmark for generative video modeling, and report DVD-GAN results as a strong baseline.
24
+
25
+ # 2 BACKGROUND
26
+
27
+ # 2.1 VIDEO SYNTHESIS AND PREDICTION
28
+
29
+ The exact formulation of the video generation task can differ in the type of conditioning signal provided. At one extreme lies unconditional video synthesis where the task is to generate any video following the training distribution. Another extreme is occupied by strongly-conditioned models, including generation conditioned on another video for content transfer (Bansal et al., 2018; Zhou et al., 2019), per-frame segmentation masks (Wang et al., 2018a), or pose information (Walker et al., 2017; Villegas et al., 2017b; Yang et al., 2018). In the middle ground there are tasks which are more structured than unconditional generation, and yet are more challenging from a modeling perspective than strongly-conditional generation (which gets a lot of information about the generated video through its input). The objective of class-conditional video synthesis is to generate a video of a given category (e.g., “riding a bike”) while future video prediction is concerned with generation of continuing video given initial frames. These problems differ in several aspects, but share a common requirement of needing to generate realistic temporal dynamics, and in this work we focus on these two problems.
30
+
31
+ # 2.2 GENERATIVE ADVERSARIAL NETWORKS
32
+
33
+ Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) are a class of generative models defined by a minimax game between a Discriminator $\mathcal { D }$ and a Generator $\mathcal { G }$ . The original objective was proposed by Goodfellow et al. (2014), and many improvements have since been suggested, mostly targeting improved training stability (Arjovsky et al., 2017; Zhang et al., 2018; Brock et al., 2019; Gulrajani et al., 2017; Miyato et al., 2018). We use the hinge formulation of the objective (Lim & Ye, 2017; Brock et al., 2019) which is optimized by gradient descent $\overset { \cdot } { \rho }$ is the elementwise ReLU function):
34
+
35
+ $$
36
+ \mathcal D \colon \operatorname* { m i n } _ { \mathcal D } \underset { x \sim d a t a ( x ) } { \mathbb { E } } \left[ \rho ( 1 - \mathcal D ( x ) ) \right] + \underset { z \sim p ( z ) } { \mathbb { E } } \left[ \rho ( 1 + \mathcal D ( \mathcal { G } ( z ) ) ) \right] , \quad \mathcal G \colon \operatorname* { m a x } _ { \mathcal G } \underset { z \sim p ( z ) } { \mathbb { E } } \left[ \mathcal D ( \mathcal { G } ( z ) ) \right] .
37
+ $$
38
+
39
+ GANs have well-known limitations including a tendency towards limited diversity in generated samples (a phenomenon known as mode collapse) and the difficulty of quantitative evaluation due
40
+
41
+ to the lack of an explicit likelihood measure over the data. Despite these downsides, GANs have produced some of the highest fidelity samples across many visual domains (Karras et al., 2018; Brock et al., 2019).
42
+
43
+ # 2.3 KINETICS-600
44
+
45
+ Kinetics is a large dataset of 10-second high-resolution YouTube clips (Kay et al., 2017; DeepMind, 2018) originally created for the task of human action recognition. We use the second iteration of the dataset, Kinetics-600 (Carreira et al., 2018), which consists of 600 classes with at least 600 videos per class for a total of around 500,000 videos.1 Kinetics videos are diverse and unconstrained, which allows us to train large models without being concerned with the overfitting that occurs on small datasets with fixed objects interacting in specified ways (Ebert et al., 2017; Blank et al., 2005). Among prior work, the closest dataset (in terms of subject and complexity) which is consistently used is UCF-101 (Soomro et al., 2012). We focus on Kinetics-600 because of its larger size (almost $5 0 \mathrm { x }$ more videos than UCF-101) and its increased diversity (600 instead of 101 classes – not to mention increased intra-class diversity). Nevertheless for comparison with prior art we train on UCF-101 and achieve a state-of-the-art Inception Score there. Kinetics contains many artifacts expected from YouTube, including cuts (as in Figure 2d), title screens and visual effects. Except when specifically described, we choose frames with stride 2 (meaning we skip every other frame). This allows us to generate videos with more complexity without incurring higher computational cost.
46
+
47
+ To the best of our knowledge we are the first to consider generative modelling of the entirety of the Kinetics video dataset2, although a small subset of Kinetics consisting of 4,000 selected and stabilized videos (via a SIFT $^ +$ RANSAC procedure) has been used in at least two prior papers (Li et al., 2018; Balaji et al., 2018). Due to the heavy pre-processing and stabilization present, as well as the sizable reduction in dataset size (two orders of magnitude) we do not consider these datasets comparable to the full Kinetics-600 dataset.
48
+
49
+ # 2.4 EVALUATION METRICS
50
+
51
+ Designing metrics for measuring the quality of generative models (GANs in particular) is an active area of research (Sajjadi et al., 2018; Barratt & Sharma, 2018). In this work we report the two most commonly used metrics, Inception Score (IS) (Salimans et al. (2016)) and Fréchet Inception Distance (FID) (Heusel et al., 2017). The standard instantiation of these metrics is intended for generative image models, and uses an Inception model (Szegedy et al., 2016) for image classification or feature extraction. For videos, we use the publicly available Inflated 3D Convnet (I3D) network trained on Kinetics-600 (Carreira & Zisserman, 2017). Our Fréchet Inception Distance is therefore very similar to the Fréchet Video Distance (FVD) (Unterthiner et al., 2018), although our implementation is different and more aligned with the original FID metric.3 More details are in Appendix A.4.
52
+
53
+ # 3 DUAL VIDEO DISCRIMINATOR GAN
54
+
55
+ Our primary contribution is Dual Video Discriminator GAN (DVD-GAN), a generative video model of complex human actions built upon the state-of-the-art BigGAN architecture (Brock et al., 2019) while introducing scalable, video-specific generator and discriminator architectures. An overview of the DVD-GAN architecture is given in Figure 3 and a detailed description is in Appendix A.2. Unlike some of the prior work, our generator contains no explicit priors for foreground, background or motion (optical flow); instead, we rely on a high-capacity neural network to learn this in a data-driven manner. While DVD-GAN contains sequential components (RNNs), it is not autoregressive in time or in space. In other words, the pixels of each frame do not directly depend on other pixels in the video, as would be the case for auto-regressive models or models generating one frame at a time.
56
+
57
+ Generating long and high resolution videos is a heavy computational challenge: individual samples from Kinetics-600 (just 10 seconds long) contain upwards of 16 million pixels which need to be generated in a consistent fashion. This is a particular challenge to the discriminator. For example, a generated video might contain an object which leaves the field of view and incorrectly returns with a different color. Here, the ability to determine this video is generated is only possible by comparing two different spatial locations across two (potentially distant) frames. Given a video with length $T$ , height $H$ , and width $W$ , discriminators that process the entire video would have to process all $H \times W \times T$ pixels – limiting the size of the model and the size of the videos being generated.
58
+
59
+ ![](images/c630e03b69f5632cb0f1b4fcdd5e6cbe2329d6a917d9c2f34800c987129c3f4f.jpg)
60
+ ResNet Block Figure 3: Simplified architecture diagram of $\mathcal { G }$ (left) and $\mathcal { D } _ { S } / \mathcal { D } _ { T }$ Block (right). More details in A.2.
61
+
62
+ # 3.1 DUAL DISCRIMINATORS
63
+
64
+ DVD-GAN tackles this scale problem by using two discriminators: a Spatial Discriminator $\mathcal { D } _ { S }$ and a Temporal Discriminator $\mathcal { D } _ { T }$ . $\mathcal { D } _ { S }$ critiques single frame content and structure by randomly sampling $k$ full-resolution frames and judging them individually. We use $k = 8$ and discuss this choice in Section 4.3. $\mathcal { D } _ { S }$ ’s final score is the sum of the per-frame scores. The temporal discriminator $\mathcal { D } _ { T }$ must provide $\mathcal { G }$ with the learning signal to generate movement (something not evaluated by $\mathcal { D } _ { S }$ ). To make the model scalable, we apply a spatial downsampling function $\phi ( \cdot )$ to the whole video and feed its output to $\mathcal { D } _ { T }$ . We choose $\phi$ to be $2 \times 2$ average pooling, and discuss alternatives in Section 4.3. This results in an architecture where the discriminators do not process the entire video’s worth of pixels, $\mathcal { D } _ { S }$ processes only resolution, this $k \times H \times W$ pixels and umber of p $\mathcal { D } _ { T }$ only to pr $T \times \frac { H } { 2 } \times \frac { W } { 2 }$ . For a 48 frame video ato from 786432 to 327680: $1 2 8 \times 1 2 8$
65
+ a $5 8 \%$ reduction. Despite this decomposition, the discriminator objective is still able to penalize almost all inconsistencies which would be penalized by a discriminator judging the entire video. $\mathcal { D } _ { T }$ judges any temporal discrepancies across the entire length of the video, and $\mathcal { D } _ { S }$ can judge any high resolution details. The only detail the DVD-GAN discriminator objective is unable to reflect is the temporal evolution of pixels within a $2 \times 2$ window. We have however not noticed this affecting the generated samples in practice. DVD-GAN’s $\mathcal { D } _ { S }$ is similar to the per-frame discriminator $\mathcal { D } _ { I }$ in MoCoGAN (Tulyakov et al., 2018). However MoCoGAN’s analog of $\mathcal { D } _ { T }$ looks at full resolution videos, whereas $\mathcal { D } _ { S }$ is the only source of learning signal for high-resolution details in DVD-GAN. For this reason, $\mathcal { D } _ { S }$ is essential when $\phi$ is not the identity, unlike in MoCoGAN where the additional per-frame discriminator is less crucial.
66
+
67
+ # 3.2 RELATED WORK
68
+
69
+ Generative video modeling is a widely explored problem which includes work on VAEs (Babaeizadeh et al., 2018; Denton & Fergus, 2018; Lee et al., 2018; Hsieh et al., 2018) and recurrent models (Wang et al., 2018b; Finn et al., 2016; Wang et al., 2018c; Byeon et al., 2018), auto-regressive models (Ranzato et al., 2014; Srivastava et al., 2015; Kalchbrenner et al., 2017; Weissenborn et al., 2019), normalizing flows (Kumar et al., 2019), and GANs (Mathieu et al., 2015; Vondrick et al., 2016; Saito et al., 2017; Saito & Saito, 2018). Much prior work considers decompositions which model the texture and spatial consistency of objects separately from their temporal dynamics. One approach is to split $\mathcal { G }$ into foreground and background models (Vondrick et al., 2016; Spampinato et al., 2018), while another considers explicit or implicit optical flow or motion in either $\mathcal { G }$ or $\mathcal { D }$ (Saito et al., 2017; Ohnishi et al., 2018). Other methods decompose the generator (or encoder) to treat concepts like pose, content and motion separately from one another (Denton et al., 2017; Villegas et al., 2017a). Similar to DVD-GAN, MoCoGAN (Tulyakov et al., 2018) discriminates individual frames in addition to a discriminator which operates on fixed-length $K$ -frame slices of the whole video (where $K < T$ ). Though this potentially reduces the number of pixels to discriminate to $( H \times W ) + ( K \times H \times W )$ , Tulyakov et al. (2018) describes discriminating sliding windows, which increases the total number of pixels. Other models follow this approach by discriminating groups of frames (Xie et al., 2018; Sun et al., 2018; Balaji et al., 2018).
70
+
71
+ ![](images/4f9ff19b1e94ddb46e0d5406dc6163bf997b04b74c8e7e25c020f5ada2cc9adf.jpg)
72
+ Figure 4: Each row is the first frame of 15 videos from a random class, all from the same checkpoint. The classes are: cooking scallops, changing wheel (not on bike), calculating, dribbling basketball.
73
+
74
+ ![](images/5108ab2cac78a011bdcfb9ec2f0d5b527d89d5f08bdbbf3f3f367b127993cbdd.jpg)
75
+ Figure 5: All 48 frames (in raster-scan order) from a $6 4 \times 6 4$ sample from watermelon cutting class.
76
+
77
+ TGANv2 (Saito & Saito, 2018) proposes “adaptive batch reduction” for efficient training, an operation which randomly samples subsets of videos within a batch and temporal subwindows within each video. This operation is applied throughout TGANv2’s $\mathcal { G }$ , with heads projecting intermediate feature maps directly to pixel space before applying batch reduction, and corresponding discriminators evaluating these lower resolution intermediate outputs. An effect of this choice is that TGANv2 discriminators only evaluate full-length videos at very low resolution. We show in Figure 6 that a similar reduction in DVD-GAN’s resolution when judging full videos leads to a loss in performance. We expect further reduction (towards the resolution at which TGANv2 evaluates the entire length of video) to lead to further degradation of DVD-GAN’s quality. Furthermore, this method is not easily adapted towards models with large batch sizes divided across a number of accelerators, with only a small batch size per replica.
78
+
79
+ # 4 EXPERIMENTS AND ANALYSIS
80
+
81
+ A detailed description of our training setup is in Appendix A.3. Each DVD-GAN was trained on TPU pods (Google, 2018) using between 32 and 512 replicas with an Adam (Kingma & Ba, 2014) optimizer. Video Synthesis models are trained for around 300,000 learning steps, whilst Video Prediction models are trained for up to 1,000,000 steps. Most models took between 12 and 96 hours to train.
82
+
83
+ # 4.1 VIDEO SYNTHESIS
84
+
85
+ Our primary results concern the problem of Video Synthesis. We provide our results for the UCF-101 and Kinetics-600 datasets. With Kinetics-600 emerging as a new benchmark for generative video modelling, our results establish a strong baseline for future work.
86
+
87
+ # 4.1.1 KINETICS-600 RESULTS
88
+
89
+ Table 1: FID/IS for DVD-GAN on Kinetics-600 Video Synthesis. We present the scores of the model taken at the point in training when the best FID was attained. The "No Truncation" columns contain the scores obtained without the truncation trick. The "With Truncation" columns contain the scores obtained at the truncation level which results in the best Inception Score.
90
+
91
+ <table><tr><td>(#Frames /Resolution)</td><td colspan="2">No Truncation FID (↓) IS (↑)</td><td colspan="2">With Truncation FID (↓) IS (↑)</td></tr><tr><td>12/64 × 64</td><td>0.85</td><td>53.81</td><td>7.13</td><td>187.23</td></tr><tr><td>12/128 × 128</td><td>1.16</td><td>77.45</td><td>13.04</td><td>246.18</td></tr><tr><td>12/256 × 256</td><td>2.05</td><td>62.78</td><td>10.17</td><td>162.44</td></tr><tr><td>48/64 × 64</td><td>13.75</td><td>104.09</td><td>47.86</td><td>264.12</td></tr><tr><td>48/128 × 128</td><td>28.44</td><td>81.41</td><td>45.79</td><td>188.32</td></tr></table>
92
+
93
+ In Table 1 we show the main result of this paper: benchmarks for Class-Conditional Video Synthesis on Kinetics-600. In this regime, we train a single DVD-GAN on all classes of Kinetics-600, supplying per-sample class information to both $\mathcal { G }$ and $\mathcal { D }$ . We consider a range of resolutions and video lengths, and measure Inception Score and Fréchet Inception Distance (FID) for each (as described in Section 2.4). We further measure each model along a truncation curve, which we carry out by calculating FID and IS statistics while varying the standard deviation of the latent vectors between 0 and 1. There is no prior work with which to quantitatively compare these results (for comparative experiments see Section 4.1.2 and Section 4.2.1), but we believe these samples to show a level of fidelity not yet achieved in datasets as complex as Kinetics-600 (see samples from each row in Appendix D.1). Because all videos are resized for the I3D network (to $2 2 4 \times 2 2 4 )$ ), it is meaningful to compare metrics across equal length videos at different resolutions. Neither IS nor FID are comparable across videos of different lengths, and should be treated as separate metrics.
94
+
95
+ Generating longer and larger videos is a more challenging modeling problem, which is conveyed by the metrics (in particular, comparing 12-frame videos across $6 4 \times 6 4$ , $1 2 8 \times 1 2 8$ and $2 5 6 \times 2 5 6$ resolutions). Nevertheless, DVD-GAN is able to generate plausible videos at all resolutions and with length spanning up to 4 seconds (48 frames). As can be seen in Appendix D.1, smaller videos display high quality textures, object composition and movement. At higher resolutions, generating coherent objects becomes more difficult (movement consists of a much larger number of pixels), but high-level details of the generated scenes are still extremely coherent, and textures (even complicated ones like a forest backdrop in Figure 1a) are generated well. It is further worth noting that the 48-frame models do not see more high resolution frames than the 12-frame model (due to the fixed choice of $k = 8$ described in Section 3.1), yet nevertheless learn to generate high resolution images.
96
+
97
+ # 4.1.2 VIDEO SYNTHESIS ON UCF-101
98
+
99
+ We further verify our results by testing the same model on UCF-101 (Soomro et al., 2012), a smaller dataset of 13,320 videos of human actions across 101 classes that has previously been used for video synthesis and prediction (Saito et al., 2017; Saito & Saito, 2018; Tulyakov et al., 2018). Our model produces samples with an IS of 27.38, significantly outperforming the state of the art (see Table 2 for quantitative comparison and Appendix B.1 for more details).
100
+
101
+ Table 2: IS on UCF-101 without class conditioning.
102
+
103
+ <table><tr><td>Method</td><td>IS (↑)</td></tr><tr><td>VGAN (Vondrick et al., 2016)</td><td>8.31 ± .09</td></tr><tr><td>TGAN (Saito et al., 2017)</td><td>11.85 ± .07</td></tr><tr><td>MoCoGAN (Tulyakov et al., 2018)</td><td>12.42 ± .03</td></tr><tr><td>ProgressiveVGAN (Acharya et al., 2018)</td><td>14.56 ± .05</td></tr><tr><td>TGANv2 (Saito &amp; Saito,2018)</td><td>24.34 ± .35</td></tr><tr><td>DVD-GAN (ours)</td><td>27.38 ± 0.53</td></tr></table>
104
+
105
+ Table 3: FVD on BAIR.
106
+
107
+ <table><tr><td>Method</td><td>FVD (↓)</td></tr><tr><td>SVP-FP CDNA</td><td>315.5</td></tr><tr><td>SV2P</td><td>296.5 262.5</td></tr><tr><td>SAVP</td><td>116.4</td></tr><tr><td>DVD-GAN-FP (ours)</td><td>109.8</td></tr><tr><td>Video Transformer</td><td>94±2</td></tr></table>
108
+
109
+ Table 4: DVD-GAN-FP’s FVD scores on Video Prediction for 16 frames of Kinetics-600 without frame skipping. The final row represents a Video Synthesis model generating 16 frames.
110
+
111
+ <table><tr><td>Method</td><td>Training Set FVD (↓)</td><td>Test Set FVD (↓)</td></tr><tr><td>Video Transformer (Weissenborn et al.,2019)</td><td></td><td>170±5</td></tr><tr><td>DVD-GAN-FP</td><td>68.66 ± 0.78</td><td>69.15 ± 1.16</td></tr><tr><td>DVD-GAN</td><td>32.3 ± 0.82</td><td>31.1 ± 0.56</td></tr></table>
112
+
113
+ # 4.2 FUTURE VIDEO PREDICTION
114
+
115
+ Future Video Prediction is the problem of generating a sequence of frames which directly follow from one (or a number) of initial conditioning frames. Both this and video synthesis require $\mathcal { G }$ to learn to produce realistic scenes and temporal dynamics, however video prediction further requires $\mathcal { G }$ to analyze the conditioning frames and discover elements in the scene which will evolve over time. In this section, we use the Fréchet Video Distance exactly as Unterthiner et al. (2018): using the logits of an I3D network trained on Kinetics-400 as features. This allows for direct comparison to prior work. Our model, DVD-GAN-FP (Frame Prediction), is slightly modified to facilitate the changed problem, and details of these changes are given in Appendix A.5.
116
+
117
+ # 4.2.1 FRAME-CONDITIONAL KINETICS
118
+
119
+ For direct comparison with concurrent work on autoregressive video models (Weissenborn et al., 2019) we consider the generation of 11 frames of Kinetics-600 at $6 4 \times 6 4$ resolution conditioned on 5 frames, where the videos for training are not taken with any frame skipping. We show results for all these cases in Table 4. Our frame-conditional model DVD-GAN- ${ \pmb F } { \pmb P }$ outperforms the prior work on frame-conditional prediction for Kinetics. The final row labeled DVD-GAN corresponds to 16-frame class-conditional Video Synthesis samples, generated without frame conditioning and without frame skipping. The FVD of this video synthesis model is notably better.
120
+
121
+ On the one hand, we hypothesize that the synthesis model has an easier generative task: it can choose to generate (relatively) simple samples for each class, rather than be forced to continue frames taken from videos which are class outliers, or contain more complicated details. On the other hand, a certain portion of the FID/FVD metric undoubtedly comes from the distribution of objects and backgrounds present in the dataset, and so it seems that the prediction model should have a handicap in the metric by being given the ground truth distribution of backgrounds and objects with which to continue videos. The synthesis model’s improved performance on this task seems to indicate that the advantage of being able to select videos to generate is greater than the advantage of having a ground truth distribution of starting frames. This result is un-intuitive, as the frame conditional model has access to strictly more information about the data distribution it is trying to recover compared to the synthesis model (despite the fact that the two models are being trained by an identical objective). This experiment favors the synthesis model for FVD, but we highlight that other models or other metrics might produce the opposite ordering.
122
+
123
+ ![](images/329ac23a7eb4e35037e2a45da62a239de0af7a5ed97b9145e0822c627cb65e8d.jpg)
124
+ Figure 6: The effect of $\phi$ in $\mathcal { D } _ { T }$ (left two) and $k$ in $\mathcal { D } _ { S }$ (right two). FID is similar for any choice of $\phi$ , while IS declines as downsampling increases. Increasing $k$ improves both with diminishing returns.
125
+
126
+ # 4.2.2 BAIR ROBOT PUSHING
127
+
128
+ We further test future video prediction on the single-class BAIR Robot Pushing Dataset (Ebert et al., 2017), a dataset of stationary videos of a robot arm moving around a set of changing objects. In order for direct comparison with previous results reported in Unterthiner et al. (2018), we consider generating 15 frames conditioned on a single starting frame. Like on prediction with Kinetics, we report FVD exactly as in Unterthiner et al. (2018), with ground truth statistics and conditioning frames taken from the 256-video dev set. Results are reported in Table 3. Scores are taken from Unterthiner et al. (2018). DVD-GAN-FP outperforms all prior adversarial models trained on this dataset, but performs slightly worse than Video Transformer, a concurrently developed autoregressive model Weissenborn et al. (2019). Samples from DVD-GAN-FP on BAIR are given in Figure 9.
129
+
130
+ # 4.3 DUAL DISCRIMINATOR INPUT
131
+
132
+ We analyze several choices for $k$ (the number of frames per sample in the input to $\mathcal { D } _ { S }$ ) and $\phi$ (the downsampling function for $\mathcal { D } _ { T }$ ). We expect setting $\phi$ to the identity or $k = T$ to result in the best model, but we are interested in the maximally compressive $k$ and $\phi$ that reduce discriminator input size (and the amount of computation), while still producing a high quality generator. For $\phi$ , we consider: $2 \times 2$ and $4 \times 4$ average pooling, the identity (no downsampling), as well as a $\phi$ which takes a random half-sized crop of the input video (as in Saito & Saito (2018)). Results can be seen in Figure 6. For each ablation, we train three identical DVD-GANs with different random initializations on 12-frame clips of Kinetics-600 at $6 4 \times 6 4$ resolution for 100,000 steps. We report mean and standard deviation (via the error bars) across each group for the whole training period. For $k$ , we consider 1, 2, 8 and 10 frames. We see diminishing effect as $k$ increases, so settle on $k = 8$ . We note the substantially reduced IS of $4 \times 4$ downsampling as opposed to $2 \times 2$ , and further note that taking half-sized crops (which results in the same number of pixels input to $\mathcal { D } _ { T }$ as $2 \times 2$ pooling) is also notably worse.
133
+
134
+ # 5 CONCLUSION
135
+
136
+ We approached the challenging problem of modeling natural video by introducing a GAN capable of capturing the complexity of a large video dataset. We showed that on UCF-101 and frame-conditional Kinetics-600 it quantitatively achieves the new state of the art, alongside qualitatively producing video synthesis samples with high complexity and diversity. We further wish to emphasize the benefit of training generative models on large and complex video datasets, such as Kinetics-600, and envisage the strong baselines we established on this dataset with DVD-GAN will be used as a reference point by the generative modeling community moving forward. While much remains to be done before realistic videos can be consistently generated in an unconstrained setting, we believe DVD-GAN is a step in that direction.
137
+
138
+ # REFERENCES
139
+
140
+ Dinesh Acharya, Zhiwu Huang, Danda Pani Paudel, and Luc Van Gool. Towards high resolution video generation with progressive growing of sliced Wasserstein GANs. arXiv:1810.02419, 2018.
141
+
142
+ Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. arXiv:1701.07875, 2017.
143
+
144
+ Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. ICLR, 2018.
145
+
146
+ Yogesh Balaji, Martin Renqiang Min, Bing Bai, Rama Chellappa, and Hans Peter Graf. Tfgan: Improving conditioning for text-to-video synthesis. 2018.
147
+
148
+ Nicolas Ballas, Li Yao, Chris Pal, and Aaron Courville. Delving deeper into convolutional networks for learning video representations. arXiv:1511.06432, 2015.
149
+
150
+ Aayush Bansal, Shugao Ma, Deva Ramanan, and Yaser Sheikh. Recycle-GAN: Unsupervised video retargeting. In ECCV, September 2018.
151
+
152
+ Shane Barratt and Rishi Sharma. A note on the Inception Score. arXiv:1801.01973, 2018.
153
+
154
+ Moshe Blank, Lena Gorelick, Eli Shechtman, Michal Irani, and Ronen Basri. Actions as space-time shapes. In ICCV, 2005.
155
+
156
+ Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. ICLR, 2019.
157
+
158
+ Wonmin Byeon, Qin Wang, Rupesh Kumar Srivastava, and Petros Koumoutsakos. Contextvp: Fully context-aware video prediction. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 753–769, 2018.
159
+
160
+ Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? A new model and the Kinetics dataset. In ICCV, 2017.
161
+
162
+ Joao Carreira, Eric Noland, Andras Banki-Horvath, Chloe Hillier, and Andrew Zisserman. A short note about Kinetics-600. arXiv:1808.01340, 2018.
163
+
164
+ Harm De Vries, Florian Strub, Jérémie Mary, Hugo Larochelle, Olivier Pietquin, and Aaron C Courville. Modulating early visual processing by language. In NeurIPS, 2017.
165
+
166
+ DeepMind, 2018. Kinetics. https://deepmind.com/research/open-source/ open-source-datasets/kinetics/. Accessed: 2019.
167
+
168
+ Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. ICML, 2018.
169
+
170
+ Emily L Denton et al. Unsupervised learning of disentangled representations from video. In Advances in neural information processing systems, pp. 4414–4423, 2017.
171
+
172
+ Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. In ICLR, 2017.
173
+
174
+ Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. arXiv:1710.05268, 2017.
175
+
176
+ Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Advances in neural information processing systems, pp. 64–72, 2016.
177
+
178
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NeurIPS, 2014.
179
+
180
+ Google, 2018. Cloud tpu. https://cloud.google.com/tpu/. Accessed: 2019.
181
+
182
+ Google, 2019. Fvd. https://github.com/google-research/google-research/ tree/master/frechet_video_distance. Accessed: 2019.
183
+
184
+ Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of Wasserstein GANs. In NeurIPS, 2017.
185
+
186
+ 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 NeurIPS, 2017.
187
+
188
+ Jun-Ting Hsieh, Bingbin Liu, De-An Huang, Li Fei-Fei, and Juan Carlos Niebles. Learning to decompose and disentangle representations for video prediction. In NeurIPS. 2018.
189
+
190
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv:1502.03167, 2015.
191
+
192
+ Nal Kalchbrenner, Aäron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. In ICML, 2017.
193
+
194
+ Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. arXiv:1812.04948, 2018.
195
+
196
+ Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, Mustafa Suleyman, and Andrew Zisserman. The Kinetics human action video dataset. arXiv:1705.06950, 2017.
197
+
198
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014.
199
+
200
+ Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In NeurIPS, 2018.
201
+
202
+ Manoj Kumar, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, and Durk Kingma. VideoFlow: A flow-based generative model for video. arXiv:1903.01434, 2019.
203
+
204
+ Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv:1804.01523, 2018.
205
+
206
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv:1607.06450, 2016.
207
+
208
+ Yitong Li, Martin Renqiang Min, Dinghan Shen, David Carlson, and Lawrence Carin. Video generation from text. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
209
+
210
+ Jae Hyun Lim and Jong Chul Ye. Geometric GAN. arXiv:1705.02894, 2017.
211
+
212
+ Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. arXiv:1511.05440, 2015.
213
+
214
+ Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. In ICLR, 2019.
215
+
216
+ Takeru Miyato and Masanori Koyama. cGANs with projection discriminator. arXiv:1802.05637, 2018.
217
+
218
+ Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. arXiv:1802.05957, 2018.
219
+
220
+ Katsunori Ohnishi, Shohei Yamamoto, Yoshitaka Ushiku, and Tatsuya Harada. Hierarchical video generation from orthogonal information: Optical flow and texture. In AAAI, 2018.
221
+
222
+ Marc’Aurelio Ranzato, Arthur Szlam, Joan Bruna, Michaël Mathieu, Ronan Collobert, and Sumit Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv:1412.6604, 2014.
223
+
224
+ Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with VQ-VAE-2. arXiv preprint arXiv:1906.00446, 2019.
225
+
226
+ Masaki Saito and Shunta Saito. TGANv2: Efficient training of large models for video generation with multiple subsampling layers. arXiv:1811.09245, 2018.
227
+
228
+ Masaki Saito, Eiichi Matsumoto, and Shunta Saito. Temporal generative adversarial nets with singular value clipping. In ICCV, 2017.
229
+
230
+ Mehdi SM Sajjadi, Olivier Bachem, Mario Lucic, Olivier Bousquet, and Sylvain Gelly. Assessing generative models via precision and recall. In NeurIPS, 2018.
231
+
232
+ Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. In NeurIPS, 2016.
233
+
234
+ Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv:1312.6120, 2013.
235
+
236
+ Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. UCF101: A dataset of 101 human actions classes from videos in the wild. arXiv:1212.0402, 2012.
237
+
238
+ Concetto Spampinato, Sergio Palazzo, P D’Oro, Francesca Murabito, Daniela Giordano, and M Shah. VOS-GAN: Adversarial learning of visual-temporal dynamics for unsupervised dense prediction in videos. arXiv:1803.09092, 2018.
239
+
240
+ Nitish Srivastava, Elman Mansimov, and Ruslan Salakhutdinov. Unsupervised learning of video representations using LSTMs. In ICML, 2015.
241
+
242
+ Ximeng Sun, Huijuan Xu, and Kate Saenko. A two-stream variational adversarial network for video generation. arXiv:1812.01037, 2018.
243
+
244
+ Ilya Sutskever, James Martens, and Geoffrey E Hinton. Generating text with recurrent neural networks. In ICML, 2011.
245
+
246
+ Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the Inception architecture for computer vision. In CVPR, 2016.
247
+
248
+ Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton. Chainer: a next-generation open source framework for deep learning. In Workshop on Systems for ML and Open Source Software at NeurIPS, 2015.
249
+
250
+ Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3D convolutional networks. In ICCV, 2015.
251
+
252
+ Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. MoCoGAN: Decomposing motion and content for video generation. In CVPR, 2018.
253
+
254
+ Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv:1607.08022, 2016.
255
+
256
+ Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges. arXiv:1812.01717, 2018.
257
+
258
+ Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. arXiv preprint arXiv:1706.08033, 2017a.
259
+
260
+ Ruben Villegas, Jimei Yang, Yuliang Zou, Sungryull Sohn, Xunyu Lin, and Honglak Lee. Learning to generate long-term future via hierarchical prediction. In ICML, 2017b.
261
+
262
+ Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In NeurIPS, 2016.
263
+
264
+ Jacob Walker, Kenneth Marino, Abhinav Gupta, and Martial Hebert. The pose knows: Video forecasting by generating pose futures. In ICCV, 2017.
265
+
266
+ Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Guilin Liu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Video-to-video synthesis. arXiv:1808.06601, 2018a.
267
+
268
+ Yunbo Wang, Zhifeng Gao, Mingsheng Long, Jianmin Wang, and Philip S Yu. Predrnn $^ { + + }$ : Towards a resolution of the deep-in-time dilemma in spatiotemporal predictive learning. arXiv preprint arXiv:1804.06300, 2018b.
269
+
270
+ ![](images/2b82b8c12420384304cdce1e87dfb74e91a7c033b4b1bdbba1c564101dc5acd8.jpg)
271
+ Figure 7: The residual blocks for $\mathcal { G }$ and $\mathcal { D } _ { S } / \mathcal { D } _ { T }$ . See Figure 3 for the icons and A.2 for more detail.
272
+
273
+ Yunbo Wang, Lu Jiang, Ming-Hsuan Yang, Li-Jia Li, Mingsheng Long, and Li Fei-Fei. Eidetic 3d lstm: A model for video prediction and beyond. 2018c.
274
+
275
+ Dirk Weissenborn, Oscar Täckström, and Jakob Uszkoreit. Scaling autoregressive video models. arXiv:1906.02634, 2019.
276
+
277
+ Yuxin Wu and Kaiming He. Group normalization. In ECCV, 2018.
278
+
279
+ You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. tempoGAN: A temporally coherent, volumetric GAN for super-resolution fluid flow. TOG, 2018.
280
+
281
+ Ceyuan Yang, Zhe Wang, Xinge Zhu, Chen Huang, Jianping Shi, and Dahua Lin. Pose guided human video generation. In ECCV, 2018.
282
+
283
+ Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. arXiv:1805.08318, 2018.
284
+
285
+ Yipin Zhou, Zhaowen Wang, Chen Fang, Trung Bui, and Tamara L Berg. Dance dance generation: Motion transfer for internet videos. arXiv:1904.00129, 2019.
286
+
287
+ # A EXPERIMENT METHODOLOGY
288
+
289
+ # A.1 DATASET PROCESSING
290
+
291
+ For all datasets we randomly shuffle the training set for each model replica independently. Experiments on the BAIR Robot Pushing dataset are conducted in the native resolution of $6 4 \times 6 4$ , where for UCF-101 we operate at a (downsampled) $1 2 8 \times 1 2 8$ resolution. This is done by a bilinear resize such that the video’s smallest dimension is mapped to 128 pixels while maintaining aspect ratio (144 for UCF-101). From this we take a random 128-pixel crop along the other dimension. We use the same procedure to construct datasets of different resolutions for Kinetics-600. All three datasets contain videos with more frames than we generate, so we take a random sequence of consecutive frames from the resized output. For UCF-101, we augmented the dataset by randomly performing left-right flips with probability 0.5.
292
+
293
+ # A.2 ARCHITECTURE DESCRIPTION
294
+
295
+ Our model adopts many architectural choices from Brock et al. (2019) including our nomenclature for describing network width, which is determined by the product of a channel multiplier $c h$ with a constant for each layer in the network. The layer-wise constants for $\mathcal { G }$ are [8, 8, 8, 4, 2] for $6 4 \times 6 4$ videos and $[ 8 , 8 , 8 , 4 , 2 , 1 ]$ for $1 2 8 \times 1 2 8$ . The width of the $i$ -th layer is given by the product of $c h$ and the $i$ -th constant and all layers prior to the residual network in $\mathcal { G }$ use the initial layer’s multiplier and we refer to the product of that and $c h$ as $c h _ { 0 }$ . ch in DVD-GAN is 128 for videos with $6 4 \times 6 4$ resolution and 96 otherwise. The corresponding $c h$ lists for both $\mathcal { D } _ { T }$ and $\mathcal { D } _ { S }$ are [2, 4, 8, 16, 16] for $6 4 \times 6 4$ resolution and $[ 1 , 2 , 4 , 8 , 1 6 , 1 6 ]$ for $1 2 8 \times 1 2 8$ .
296
+
297
+ The input to $\mathcal { G }$ consists of a Gaussian latent noise $z \sim \mathcal { N } ( 0 , I )$ and a learned linear embedding $e ( y )$ of the desired class $y$ . Both inputs are 120-dimensional vectors. $\mathcal { G }$ starts by computing an affine transformation of $[ z ; e ( y ) ]$ to a $[ 4 , 4 , c h _ { 0 } ]$ -shaped tensor (in Figure 3 this is represented as a $1 \times 1$ convolution). $[ z ; e ( y ) ]$ is used as the input to all class-conditional Batch Normalization layers throughout $\mathcal { G }$ (the gray line in Figure 7).
298
+
299
+ This is then treated as the input (at each frame we would like to generate) to a Convolutional Gated Recurrent Unit (Ballas et al., 2015; Sutskever et al., 2011) whose update rule for input $x _ { t }$ and previous output $h _ { t - 1 }$ is given by the following:
300
+
301
+ $$
302
+ \begin{array} { r l } & { r = \sigma ( W _ { r } \star _ { 3 } \left[ h _ { t - 1 } ; x _ { t } \right] + b _ { r } ) } \\ & { u = \sigma ( W _ { u } \star _ { 3 } \left[ h _ { t - 1 } ; x _ { t } \right] + b _ { u } ) } \\ & { c = \rho ( W _ { c } \star _ { 3 } \left[ x _ { t } ; r \odot h _ { t - 1 } \right] + b _ { c } ) } \\ & { h _ { t } = u \odot h _ { t - 1 } + ( 1 - u ) \odot c } \end{array}
303
+ $$
304
+
305
+ In these equations $\sigma$ and $\rho$ are the elementwise sigmoid and ReLU functions respectively, the $\star _ { n }$ operator represents a convolution with a kernel of size $n \times n$ , and the $\odot$ operator is an elementwise multiplication. Brackets are used to represent a feature concatenation. This RNN is unrolled once per frame. The output of this RNN is processed by two residual blocks (whose architecture is given by Figure 7). The time dimension is combined with the batch dimension here, so each frame proceeds through the blocks independently. The output of these blocks has width and height dimensions which are doubled (we skip upsampling in the first block). This is repeated a number of times, with the output of one $\mathrm { R N N } +$ residual group fed as the input to the next group, until the output tensors have the desired spatial dimensions. We do not reduce over the time dimension when calculating Batch Normalization statistics. This prevents the network from utilizing the Batch Normalization layers to pass information between timesteps.
306
+
307
+ The spatial discriminator $\mathcal { D } _ { S }$ functions almost identically to BigGAN’s discriminator, though an overview of the residual blocks is given in Figure 7 for completeness. A score is calculated for each of the uniformly sampled $k$ frames (we default to $k = 8$ ) and the $\mathcal { D } _ { S }$ output is the sum over per-frame scores. The temporal discriminator $\mathcal { D } _ { T }$ has a similar architecture, but pre-processes the real or generated video with a $2 \times 2$ average-pooling downsampling function $\phi$ . Furthermore, the first two residual blocks of $\mathcal { D } _ { T }$ are 3-D, where every convolution is replaced with a 3-D convolution with a kernel size of $3 \times 3 \times 3$ . The rest of the architecture follows BigGAN (Brock et al., 2019).
308
+
309
+ # A.3 TRAINING DETAILS
310
+
311
+ Sampling from DVD-GAN is very efficient, as the core of the generator architecture is a feed-forward convolutional network: two $6 4 \times 6 4$ 48-frame videos can be sampled in less than $1 5 0 \mathrm { m s }$ on a single TPU core. The dual discriminator $\mathcal { D }$ is updated twice for every update of $\mathcal { G }$ (Heusel et al., 2017) and we use Spectral Normalization (Zhang et al., 2018) for all weight layers (approximated by the first singular value) and orthogonal initialization of weights (Saxe et al., 2013). Sampling is carried out using the exponential moving average of $\mathcal { G }$ ’s weights, which is accumulated with decay $\gamma = 0 . 9 9 9 9$ starting after 20,000 training steps. The model is optimized using Adam (Kingma & Ba, 2014) with batch size 512 and a learning rate of $1 \cdot 1 0 ^ { - 4 }$ and $5 { \cdot } \bar { 1 } 0 ^ { - 4 }$ for $\mathcal { G }$ and $\mathcal { D }$ respectively. Class conditioning in $\mathcal { D }$ (Miyato & Koyama, 2018) is projection-based whereas $\mathcal { G }$ relies on class-conditional Batch Normalization (Ioffe & Szegedy, 2015; De Vries et al., 2017; Dumoulin et al., 2017): equivalent to standard Batch Normalization without a learned scale and offset, followed by an elementwise affine transformation where each parameter is a function of the noise vector and class conditioning.
312
+
313
+ # A.4 FID FOR KINETICS-600 SYNTHESIS
314
+
315
+ The FID we use for Synthesis on Kinetics-600 is calculated exactly as Fréchet Video Distance (Unterthiner et al., 2018) except that we use a different feature network: an I3D trained on Kinetics-600 (as opposed to the network trained on Kinetics-400 in FVD) and features from the final hidden layer instead of the logits. This metric can be implemented as a small change from the publically available FVD code (Google, 2019) by changing the name of the TF-Hub module to ’https://tfhub.dev/deepmind/i3d-kinetics-600/1’ and loading the tensor named ’RGB/inception_i3d/Logits/AvgPool3D’ from the resulting graph.
316
+
317
+ # A.5 ARCHITECTURE EXTENSION TO VIDEO PREDICTION
318
+
319
+ In order to provide results on future video prediction problems we describe a simple modification to DVD-GAN to facilitate the added conditioning. A diagram of the extended model is in Figure 8.
320
+
321
+ ![](images/1c5bc638de65612842638e42398458dcab82dea60e25561b2716a14decf2930c.jpg)
322
+ Figure 8: An architecture diagram describing the changes for the frame conditional model.
323
+
324
+ ![](images/972300bd4a0636857f606053d10d2722bb8de63b94b1ab68e1bfd6cd6e6dcd20.jpg)
325
+ Figure 9: Three video samples from a prediction model trained on the BAIR robot pushing dataset. Each row is a separate video, the leftmost column is a (true) conditioning frame.
326
+
327
+ Given $C$ conditioning frames, our modified DVD-GAN- $F P$ passes each frame separately through a deep residual network identical to $\mathcal { D } _ { S }$ . The (near) symmetric design of $\mathcal { G }$ and $\mathcal { D } _ { S }$ ’s residual blocks mean that each output from a $\mathcal { D }$ -style residual block has a corresponding intermediate tensor in $\mathcal { G }$ of the same spatial resolution. After each block the resulting features for each conditioning frame are stacked in the channel dimension and passed through a $3 \times 3$ convolution and ReLU activation. The resulting tensor is used as the initial state for the Convolutional GRU in the corresponding block in $\mathcal { G }$ . Note that the frame conditioning stack reduces spatial resolution while $\mathcal { G }$ increases resolution. Therefore the smallest features of the conditioning frames (which have been through the most layers) are input earliest in $\mathcal { G }$ and the larger features (which have been through less processing) are input to $\mathcal { G }$ towards the end. $\mathcal { D } _ { T }$ operates on the concatenation of the conditioning frames and the output of $\mathcal { G }$ , meaning that it does not receive any extra information detailing that the first $C$ frames are special. However to reduce wasted computation we do not sample the first $C$ frames for $\mathcal { D } _ { S }$ on real or generated data. This technically means that $D _ { S }$ will never see the first few frames from real videos at full resolution, but this was not an issue in our experiments. Finally, our video prediction variant does not condition on any class information, allowing us to directly compare with prior art. This is achieved by settling the class id of all samples to 0.
328
+
329
+ # B FURTHER EXPERIMENTS
330
+
331
+ # B.1 UCF-101
332
+
333
+ UCF-101 (Soomro et al., 2012) is a dataset of 13,320 videos of human actions across 101 classes that has previously been used for video synthesis and prediction (Saito et al., 2017; Saito & Saito, 2018; Tulyakov et al., 2018). In this case, DVD-GAN is not conditioned on class labels to make our results comparable with prior work. This is achieved by setting the class labels of all input samples to 0. We report Inception Score (IS) calculated with a C3D network (Tran et al., 2015)
334
+
335
+ ![](images/c66d3fb6922fc73f34e3f6b3729820b31c64bc1e26c4f66335ba2d99192c76d3.jpg)
336
+ Figure 10: The first frames of interpolations between UCF-101 samples. Each row is a separate interpolation. Contrast with samples in Appendix D.2.
337
+
338
+ for quantitative comparison with prior work.4 This evaluation is performed by re-scaling the video to $1 2 8 \times 1 2 8$ , normalizing the input features based on mean statistics of the ground truth dataset, then taking a $1 1 2 \times 1 1 2$ center crop and applying C3D. Our model produces samples with an IS of 27.38, significantly outperforming the state of the art (see Table 2). The DVD-GAN architecture on UCF-101 is identical to the model used for Kinetics, and is trained on 16-frame $1 2 8 \times 1 2 8$ clips from UCF-101.
339
+
340
+ The lack of class information does hurt the performance of DVD-GAN, and training on UCF-101 with class labels leads to an improved model with an Inception Score of 32.97. This is directly comparable to Conditional TGAN Saito et al. (2017) which achieved an IS of 15.83 and is close to the IS reported for the ground truth data ( 34.49). However we note than many more recent video generation papers do not test in this regime. It is worth mentioning that our improved score is, at least partially, due to memorization of the training data. In Figure 10 we show interpolation samples from our best UCF-101 model. Like interpolations in Appendix D.2, we sample 2 latents (left and rightmost columns) and show samples from the linear interpolation in latent space along each row. Here we show 4 such interpolations (the first frame from each video). Unlike Kinetics-600 interpolations, which smoothly transition from one sample to the other, we see abrupt jumps in the latent space between highly distinct samples, and little intra-video diversity between samples in each group. It can be further seen that some generated samples highly correlate with samples from the training set.
341
+
342
+ We show this both as a failure of the Inception Score metric, the commonly reported value for classconditional video synthesis on UCF-101, but also as strong signal that UCF-101 is not a complex or diverse enough dataset to facilitate interesting video generation. Each class is relatively small, and reuse of clips from shared underlying videos means that the intra-class diversity can be restricted to just a handful of videos per class. This suggests the need for larger, more diverse and challenging datasets for generative video modelling, and we believe that Kinetics-600 provides a better benchmark for this task.
343
+
344
+ # C MISCELLANEOUS EXPERIMENTS
345
+
346
+ Here we detail a number of modifications or miscellaneous results we experimented with which did not produce a conclusive result.
347
+
348
+ • We experimented with several variations of normalization which do not require calculating statistics over a batch of data. Group Normalization (Wu & He, 2018) performed best, almost on a par with (but worse than) Batch Normalization. We further tried Layer Normalization (Lei Ba et al., 2016), Instance Normalization (Ulyanov et al., 2016), and no normalization, but found that these significantly underperformed Batch Normalization.
349
+
350
+ • We found that removing the final Batch Normalization in $\mathcal { G }$ , which occurs after the ResNet and before the final convolution, caused a catastrophic failure in learning. Interestingly, just removing the Batch Normalization layers within $\mathcal { G }$ ’s residual blocks still led to good (though slightly worse) generative models. In particular, variants without Batch Normalization in the residual blocks often achieve significantly higher IS (up to 110.05 for $6 4 \times 6 4 ~ 1 2$ frame samples – twice normal). But these models had substantially worse FID scores (1.22 for the aforementioned model) – and produced qualitatively worse video samples.
351
+
352
+ • Early variants of DVD-GAN contained Batch Normalization which normalized over all frames of all batch elements. This gave $\mathcal { G }$ an extra channel to convey information across time. It took advantage of this, with the result being a model which required batch statistics in order to produce good samples. We found that the version which normalizes over timesteps independently worked just as well and without the dependence on statistics.
353
+
354
+ • Models based on the residual blocks of BigGAN-deep trained faster (in wall clock time) but slower with regards to metrics, and struggled to reach the accuracy of models based on BigGAN’s residual blocks.
355
+
356
+ D GENERATED SAMPLES
357
+
358
+ It is difficult to accurately convey complicated generated video through still frames. Where provided, we recommend readers view the generated videos themselves via the provided links. We refer to videos within these batches by row/column number where the video in the 0th row and column is in the top left corner.
359
+
360
+ D.1 SYNTHESIS SAMPLES
361
+
362
+ ![](images/94ff8771d2779ba74349cf5c682a7c411890625c34fccd663ccff2f8dadacbfc.jpg)
363
+ Figure 11: The first frames from a random batch of samples from DVD-GAN trained on 12 frames of $6 4 \times 6 4$ Kinetics-600. Full samples at https://drive.google.com/file/d/ 155F1lkHA5fMAd7k4W3CQvTsi1eKQDhGb/view?usp $^ { 1 = }$ sharing.
364
+
365
+ ![](images/ba4ac0ed5a88b2078f70859d40fd357a2be1a1ebc52c488c347b482e7845eb98.jpg)
366
+ Figure 12: The first frames from a random batch of samples from DVD-GAN trained on 48 frames of $6 4 \times 6 4$ Kinetics-600. Full samples at https://drive.google.com/file/d/ 1FjOQYdUuxPXvS8yeOhXdPQMapUQaklLi/view?usp $^ { 1 = }$ sharing.
367
+
368
+ ![](images/b955570d7e0b96214e40ad222dd8865698a3a930c1eac584e86f5182deb65aca.jpg)
369
+ Figure 13: The first frames from a random batch of samples from DVD-GAN trained on 12 frames of $1 2 8 \times 1 2 8$ Kinetics-600. Full samples at https://drive.google.com/file/ d/165Yxuvvu3viOy-39LhhSDGtczbWphj_i/view?usp $\mid =$ sharing
370
+
371
+ ![](images/d7bf35390195b9b19ead1dbb085b7bb784ca5644655d4df1fd3f9e784d2c1c8e.jpg)
372
+ Figure 14: The first frames from a random batch of samples from DVD-GAN trained on 48 frames of $1 2 8 \times 1 2 8$ Kinetics-600. Full samples at https://drive.google.com/file/ d/1P8SsWEGP6tEGPPNPH-iVycOlN6vpIgE8/view?usp $\mid =$ sharing. The sample in row 1, column 5 is a stereotypical example of a degenerate sample occasionally produced by DVD-GAN.
373
+
374
+ ![](images/1c617b1d9318ce41a070702225dab76601a5204b981f05962fe6381dad922e97.jpg)
375
+ Figure 15: The first frames from a random batch of samples from DVD-GAN trained on 12 frames of $2 5 6 \times 2 5 6$ Kinetics-600. Full samples at https://drive.google.com/file/ d/1RGRVKCpVaG8z3p9GBCamRk4apiIR7jUc/view?usp $^ { 1 = }$ sharing.
376
+
377
+ ![](images/91b71faf533db6ba61443412baec9781b80a516fa2acfefdc635e2f55ea46d31.jpg)
378
+ Figure 16: The first frames from a random batch of samples from DVD-GAN trained on UCF-101. Full samples at https://drive.google.com/file/d/ 1VVLF3bQLyfKtIiSxaKWKq5qFRHmv5EVW/view?usp $^ { 1 = }$ sharing.
379
+
380
+ # D.2 INTERPOLATION SAMPLES
381
+
382
+ We expect $\mathcal { G }$ to produce samples of higher quality from latents near the mean of the distribution (zero). This is the idea behind the Truncation Trick (Brock et al., 2019). Like BigGAN, we find that DVD-GAN is amenable to truncation. We also experiment with interpolations in the latent space and in the class embedding. In both cases, interpolations are evidence that $\mathcal { G }$ has learned a relatively smooth mapping from the latent space to real videos: this would be impossible for a network that has only memorized the training data, or which is only capable of generating a few exemplars per class. Note that while all latent vectors along an interpolation are valid (and therefore $\mathcal { G }$ should produce a reasonable sample), at no point during training is $\mathcal { G }$ asked to generate a sample halfway between two classes. Nevertheless $\mathcal { G }$ is able to interpolate between even very distinct classes.
383
+
384
+ ![](images/f318244709131bb46a8a172452daa8bb6c9d396662f3498e437390bf38aee8e1.jpg)
385
+ Figure 17: An example intra-class interpolation. Each column is a separate video (the vertical axis is the time dimension). The left and rightmost columns are randomly sampled latent vectors and are generated under a shared class. Columns in between represent videos generated under the same class across the linear interpolation between the two random samples. Note the smooth transition between videos at all six timesteps displayed here.
386
+
387
+ ![](images/046de18f772d7dd241b13bc673a77bf8afc09dfd94c3ce1faa2cf5ef6578aed4.jpg)
388
+ Figure 18: An example of class interpolation. As before, each column is a sequence of timesteps of a single video. Here, we sample a single latent vector, and the left and rightmost columns represent generating a video of that latent under two different classes. Columns in between represent videos of that same latent generated across an interpolation of the class embedding. Even though at no point has DVD-GAN been trained on data under an interpolated class, it nevertheless produces reasonable samples.
md/train/H1cKvl-Rb/H1cKvl-Rb.md ADDED
@@ -0,0 +1,403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # UCB EXPLORATION VIA $Q$ -ENSEMBLES
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We show how an ensemble of $Q ^ { * }$ -functions can be leveraged for more effective exploration in deep reinforcement learning. We build on well established algorithms from the bandit setting, and adapt them to the $Q$ -learning setting. We propose an exploration strategy based on upper-confidence bounds (UCB). Our experiments show significant gains on the Atari benchmark.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep reinforcement learning seeks to learn mappings from high-dimensional observations to actions. Deep $Q$ -learning (Mnih et al. (2015)) is a leading technique that has been used successfully, especially for video game benchmarks. However, fundamental challenges remain, for example, improving sample efficiency and ensuring convergence to high quality solutions. Provably optimal solutions exist in the bandit setting and for small MDPs, and at the core of these solutions are exploration schemes. However these provably optimal exploration techniques do not extend to deep RL in a straightforward way.
12
+
13
+ Bootstrapped DQN (Osband et al. (2016)) is a previous attempt at adapting a theoretically verified approach to deep RL. In particular, it draws inspiration from posterior sampling for reinforcement learning (PSRL, Osband et al. (2013); Osband and Van Roy (2016)), which has near-optimal regret bounds. PSRL samples an MDP from its posterior each episode and exactly solves $Q ^ { * }$ , its optimal $Q$ -function. However, in high-dimensional settings, both approximating the posterior over MDPs and solving the sampled MDP are intractable. Bootstrapped DQN avoids having to establish and sample from the posterior over MDPs by instead approximating the posterior over $Q ^ { * }$ . In addition, bootstrapped DQN uses a multi-headed neural network to represent the $Q$ -ensemble. While the authors proposed bootstrapping to estimate the posterior distribution, their empirical findings show best performance is attained by simply relying on different initializations for the different heads, not requiring the sampling-with-replacement process that is prescribed by bootstrapping.
14
+
15
+ In this paper, we design new algorithms that build on the $Q$ -ensemble approach from Osband et al. (2016). However, instead of using posterior sampling for exploration, we construct uncertainty estimates from the $Q$ -ensemble. Specifically, we first propose the Ensemble Voting algorithm where the agent takes action by a majority vote from the $Q$ -ensemble. Next, we propose the UCB exploration strategy. This strategy is inspired by established UCB algorithms in the bandit setting and constructs uncertainty estimates of the $Q$ -values. In this strategy, agents are optimistic and take actions with the highest UCB. We demonstrate that our algorithms significantly improve performance on the Atari benchmark.
16
+
17
+ # 2 BACKGROUND
18
+
19
+ # 2.1 NOTATION
20
+
21
+ We model reinforcement learning as a Markov decision process (MDP). We define an MDP as $( S , A , T , R , p _ { 0 } , \gamma )$ , in which both the state space $s$ and action space $\mathcal { A }$ are discrete, $T : S \times \mathcal { A } \times \mathcal { S } \mapsto$ $\mathbb { R } _ { + }$ is the transition distribution, $R : S \times \mathcal { A } \mapsto \mathbb { R }$ is the reward function, assumed deterministic given the state and action, and $\gamma \in ( 0 , 1 ]$ is a discount factor, and $p _ { 0 }$ is the initial state distribution. We denote a transition experience as $\tau = ( s , a , r , s ^ { \prime } )$ where $s ^ { \prime } \sim T ( s ^ { \prime } | s , a )$ and $r = R ( s , a )$ . A policy $\pi : { \mathcal { S } } \mapsto A$ specifies the action taken after observing a state. We denote the $Q$ -function for policy $\pi$ as $\begin{array} { r } { Q ^ { \pi } ( s , a ) : = \mathbb E _ { \pi } \big [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } | s _ { 0 } = s , a _ { 0 } = a \big ] } \end{array}$ where $r _ { t } = R ( s _ { t } , a _ { t } )$ . The optimal $Q ^ { * }$ -function
22
+
23
+ corresponds to taking the optimal policy
24
+
25
+ $$
26
+ Q ^ { \ast } ( s , a ) : = \operatorname* { s u p } _ { \pi } Q ^ { \pi } ( s , a )
27
+ $$
28
+
29
+ and satisfies the Bellman equation
30
+
31
+ $$
32
+ Q ^ { * } ( s , a ) = \mathbb { E } _ { s ^ { \prime } \sim T ( \cdot \mid s , a ) } \big [ r + \gamma \cdot \operatorname* { m a x } _ { a ^ { \prime } } Q ^ { * } ( s ^ { \prime } , a ^ { \prime } ) \big ] .
33
+ $$
34
+
35
+ # 2.2 EXPLORATION IN REINFORCEMENT LEARNING
36
+
37
+ A notable early optimality result in reinforcement learning was the proof by Watkins and Dayan Watkins (1989); Watkins and Dayan (1992) that an online $Q$ -learning algorithm is guaranteed to converge to the optimal policy, provided that every state is visited an infinite number of times. However, the convergence of Watkins’ Q-learning can be prohibitively slow in MDPs where $\epsilon$ - greedy action selection explores state space randomly. Later work developed reinforcement learning algorithms with provably fast (polynomial-time) convergence (Kearns and Singh (2002); Brafman and Tennenholtz (2002); Strehl et al. (2006)). At the core of these provably-optimal learning methods is some exploration strategy, which actively encourages the agent to visit novel state-action pairs. For example, R-MAX optimistically assumes that infrequently-visited states provide maximal reward, and delayed $Q$ -learning initializes the $Q$ -function with high values to ensure that each state-action is chosen enough times to drive the value down.
38
+
39
+ Since the theoretically sound RL algorithms are not computationally practical in the deep RL setting, deep RL implementations often use simple exploration methods such as $\epsilon$ -greedy and Boltzmann exploration, which are often sample-inefficient and fail to find good policies. One common approach of exploration in deep RL is to construct an exploration bonus, which adds a reward for visiting state-action pairs that are deemed to be novel or informative. In particular, several prior methods define an exploration bonus based on a density model or dynamics model. Examples include VIME by Houthooft et al. (2016), which uses variational inference on the forward-dynamics model, and Tang et al. (2016), Bellemare et al. (2016), Ostrovski et al. (2017), Fu et al. (2017). While these methods yield successful exploration in some problems, a major drawback is that this exploration bonus does not depend on the rewards, so the exploration may focus on irrelevant aspects of the environment, which are unrelated to reward.
40
+
41
+ # 2.3 BAYESIAN REINFORCEMENT LEARNING
42
+
43
+ Earlier works on Bayesian reinforcement learning include Dearden et al. (1998; 1999). Dearden et al. (1998) studied Bayesian $Q$ -learning in the model-free setting and learned the distribution of $Q ^ { * }$ - values through Bayesian updates. The prior and posterior specification relied on several simplifying assumptions, some of which are not compatible with the MDP setting. Dearden et al. (1999) took a model-based approach that updates the posterior distribution of the MDP. The algorithm samples from the MDP posterior multiple times and solving the $Q ^ { * }$ values at every step. This approach is only feasible for RL problems with very small state space and action space. Strens (2000) proposed posterior sampling for reinforcement learning (PSRL). PSRL instead takes a single sample of the MDP from the posterior in each episode and solves the $Q ^ { * }$ values. Recent works including Osband et al. (2013) and Osband and Van Roy (2016) established near-optimal Bayesian regret bounds for episodic RL. Sorg et al. (2012) models the environment and constructs exploration bonus from variance of model parameters. These methods are experimented on low dimensional problems only, because the computational cost of these methods is intractable for high dimensional RL.
44
+
45
+ # 2.4 BOOTSTRAPPED DQN
46
+
47
+ Inspired by PSRL, but wanting to reduce computational cost, prior work developed approximate methods. Osband et al. (2014) proposed randomized least-square value iteration for linearly-parameterized value functions. Bootstrapped DQN Osband et al. (2016) applies to $Q$ -functions parameterized by deep neural networks. Bootstrapped DQN (Osband et al. (2016)) maintains a $Q$ -ensemble, represented by a multi-head neural net structure to parameterize $K \in \mathbb { N } _ { + }$ $Q$ -functions. This multi-head structure shares the convolution layers but includes multiple “heads”, each of which defines a $Q$ -function $Q _ { k }$ .
48
+
49
+ Bootstrapped DQN diversifies the $Q$ -ensemble through two mechanisms. The first mechanism is independent initialization. The second mechanism applies different samples to train each $Q$ -function.
50
+
51
+ These $Q$ -functions can be trained simultaneously by combining their loss functions with the help of a random mask $m _ { \tau } \in \mathbb { R } _ { + } ^ { K }$ C
52
+
53
+ $$
54
+ L = \sum _ { \tau \in { \cal B } _ { \mathrm { m i n i } } } \sum _ { k = 1 } ^ { K } m _ { \tau } ^ { k } \cdot ( Q ^ { k } ( s , a ; \theta ) - y _ { \tau } ^ { Q _ { k } } ) ^ { 2 } ,
55
+ $$
56
+
57
+ where $y _ { \tau } ^ { Q _ { k } }$ is the target of the $k$ th $Q$ -function. Thus, the transition $\tau$ updates $Q _ { k }$ only if $m _ { \tau } ^ { k }$ is nonzero. To avoid the overestimation issue in DQN, bootstrapped DQN calculates the target value $y _ { \tau } ^ { Q _ { k } }$ using the approach of Double DQN (Van Hasselt et al. (2016)), such that the current $Q _ { k } ( \cdot ; \theta _ { t } )$ network determines the optimal action and the target network $Q _ { k } \big ( \cdot ; \theta ^ { - } \big )$ estimates the value
58
+
59
+ $$
60
+ y _ { \tau } ^ { Q _ { k } } = r + \gamma \operatorname* { m a x } _ { a } Q ^ { k } ( s ^ { \prime } , \operatorname * { a r g m a x } _ { a } Q _ { k } ( s ^ { \prime } , a ; \theta _ { t } ) ; \theta ^ { - } ) .
61
+ $$
62
+
63
+ In their experiments on Atari games, Osband et al. (2016) set the mask $m _ { \tau } = ( 1 , \ldots , 1 )$ such that all $\left\{ Q _ { k } \right\}$ are trained with the same samples and their only difference is initialization. Bootstrapped DQN picks one $Q _ { k }$ uniformly at random at the start of an episode and follows the greedy action $a _ { t } = \operatorname { a r g m a x } _ { a } Q _ { k } ( s _ { t } , a )$ for the whole episode.
64
+
65
+ # 3 ENSEMBLE VOTING
66
+
67
+ Ignoring computational costs, the ideal Bayesian approach to reinforcement learning is to maintain a posterior over the MDP. However, with limited computation and model capacity, it is more tractable to maintain a posterior of the $Q ^ { * }$ -function. This motivates using a $Q$ -ensemble as a particle filter-based approach to approximate the posterior over $Q ^ { * }$ -function and we display our first proposed method, Ensemble Voting, in Algorithm 1.
68
+
69
+ Each $Q _ { k }$ in the $Q$ -ensemble $\{ Q _ { k } \} _ { k = 1 } ^ { K }$ is parametrized with a deep neural network whose parameters are initialized independently at the start of training. Each $Q _ { k }$ proposes an action that maximizes the $Q$ -value according to $Q _ { k }$ at every time step and the agent chooses the action by a majority vote
70
+
71
+ $$
72
+ a _ { t } = \mathop { \mathrm { M a j o r i t y } } \mathrm { V o t e } ( \{ \operatorname { a r g m a x } Q _ { k } ( s _ { t } , a ) \} _ { k = 1 } ^ { K } ) .
73
+ $$
74
+
75
+ At each learning interval, a minibatch of transitions is sampled from the replay buffer and each $Q _ { k }$ takes a Bellman update based on this minibatch. For stability, Algorithm 1 also uses a target network for each $Q _ { k }$ as in Double DQN in the batched update.
76
+
77
+ We point out that the difference among the parameters of the $Q$ -ensemble $\left\{ Q _ { k } \right\}$ comes only from the independent random initialization. The deep neural network parametrization of the $Q$ -ensemble introduces nonconvexity into the objective function of Bellman update, so the $Q$ -ensemble $\left\{ Q _ { k } \right\}$ do not converge to the same $Q$ -function during training even though they are trained with the same minibatches at every update. We also experimented with bagging by updating each $Q _ { k }$ using an independently drawn minibatch. However, bagging led to inferior learning performance. This phenomenon that that bagging deteriorates the performance of deep ensembles is also observed in supervised learning settings. Lee et al. (2015) observed that supervised learning trained with deep ensembles with random initializations perform better than bagging for deep ensembles. Lakshminarayanan et al. (2016) used deep ensembles for uncertainty estimates and also observed that bagging deteriorated performance in their experiments.
78
+
79
+ Lu and Van Roy (2017) develop ensemble sampling for bandit problems with deep neural network parametrized policies and the theoretical justification. We derive a posterior update rule for the $Q ^ { * }$ function and approximations to the posterior update using ensembles in Appendix C. We note that in bootstrapped DQN, ensemble voting is applied for evaluation while Algorithm 1 uses ensemble voting during learning. In the experiments (Sec. 5), we demonstrate that Algorithm 1 is superior to bootstrapped DQN. The action choice of Algorithm 1 is exploitation only. In the next section, we propose our UCB exploration strategy.
80
+
81
+ # Algorithm 1 Ensemble Voting
82
+
83
+ 1: Input: $K \in \mathbb { N } _ { + }$ copies of independently initialized $Q ^ { * }$ -functions $\{ Q _ { k } \} _ { k = 1 } ^ { K }$ .
84
+ 2: Let $B$ be a replay buffer storing transitions for training
85
+ 3: for each episode do do
86
+ 4: Obtain initial state from environment $s _ { 0 }$
87
+ 5: for step $t = 1 , \dots$ until end of episode do
88
+ 6: Pick an action according to $\hat { a } _ { t } = \mathrm { M a j o r i t y V o t e } ( \{ \operatorname { a r g m a x } _ { a } Q _ { k } ( s _ { t } , a ) \} _ { k = 1 } ^ { K } )$
89
+ 7: Execute $a _ { t }$ . Receive state $s _ { t + 1 }$ and reward $r _ { t }$ from the environment
90
+ 8: Add $\left( { { s _ { t } } , { a _ { t } } , { r _ { t } } , { s _ { t + 1 } } } \right)$ to replay buffer $B$
91
+ 9: At learning interval, sample random minibatch and update $\left\{ Q _ { k } \right\}$
92
+ 10: end for
93
+ 11: end for
94
+
95
+ # 4 UCB EXPLORATION STRATEGY USING $Q$ -ENSEMBLES
96
+
97
+ In this section, we propose optimism-based exploration by adapting the UCB algorithms (Auer et al. (2002); Audibert et al. (2009)) from the bandit setting. The UCB algorithms maintain an upper-confidence bound for each arm, such that the expected reward from pulling each arm is smaller than this bound with high probability. At every time step, the agent optimistically chooses the arm with the highest UCB. Auer et al. (2002) constructed the UCB based on empirical reward and the number of times each arm is chosen. Audibert et al. (2009) incorporated the empirical variance of each arm’s reward into the UCB, such that at time step $t$ , an arm $A _ { t }$ is pulled according to
98
+
99
+ $$
100
+ A _ { t } = \underset { i } { \operatorname { a r g m a x } } \left\{ \hat { r } _ { i , t } + c _ { 1 } \cdot \sqrt { \frac { \hat { V } _ { i , t } \log ( t ) } { n _ { i , t } } } + c _ { 2 } \cdot \frac { \log ( t ) } { n _ { i , t } } \right\}
101
+ $$
102
+
103
+ where $\hat { r } _ { i , t }$ and $\hat { V } _ { i , t }$ are the empirical reward and variance of arm $i$ at time $t$ , $n _ { i , t }$ is the number of times arm $i$ has been pulled up to time $t$ , and $c _ { 1 } , c _ { 2 }$ are positive constants.
104
+
105
+ We extend the intuition of UCB algorithms to the RL setting. Using the outputs of the $\left\{ Q _ { k } \right\}$ functions, we construct a UCB by adding the empirical standard deviation $\tilde { \sigma } ( s _ { t } , a )$ of $\{ Q _ { k } ( s _ { t } , a ) \} _ { k = 1 } ^ { K }$ to the empirical mean $\tilde { \mu } ( s _ { t } , a )$ of $\{ Q _ { k } ( s _ { t } , a ) \} _ { k = 1 } ^ { K }$ . The agent chooses the action that maximizes this UCB
106
+
107
+ $$
108
+ a _ { t } \in \mathop { \operatorname { a r g m a x } } _ { a } \left\{ \tilde { \mu } ( s _ { t } , a ) + \lambda \cdot \tilde { \sigma } ( s _ { t } , a ) \right\} ,
109
+ $$
110
+
111
+ where $\lambda \in \mathbb { R } _ { + }$ is a hyperparameter.
112
+
113
+ We present Algorithm 2, which incorporates the UCB exploration. The hyperparemeter $\lambda$ controls the degrees of exploration. In Section 5, we compare the performance of our algorithms on Atari games using a consistent set of parameters.
114
+
115
+ # Algorithm 2 UCB Exploration with $Q$ -Ensembles
116
+
117
+ 1: Input: Value function networks $Q$ with $K$ outputs $\{ Q _ { k } \} _ { k = 1 } ^ { K }$ . Hyperparameter $\lambda$ .
118
+ 2: Let $B$ be a replay buffer storing experience for training.
119
+ 3: for each episode do
120
+ 4: Obtain initial state from environment $s _ { 0 }$
121
+ 5: for step $t = 1 , \dots$ until end of episode do
122
+ 6: Pick an action according to $\begin{array} { r } { \grave { a _ { t } } \in \mathrm { a r g m a x } _ { a } \left\{ \tilde { \mu } ( s _ { t } , a ) + \lambda \cdot \tilde { \sigma } ( s _ { t } , a ) \right\} } \end{array}$
123
+ 7: Receive state $s _ { t + 1 }$ and reward $r _ { t }$ from environment, having taken action $a _ { t }$
124
+ 8: Add $\left( { { s _ { t } } , { a _ { t } } , { r _ { t } } , { s _ { t + 1 } } } \right)$ to replay buffer $B$
125
+ 9: At learning interval, sample random minibatch and update $\left\{ Q _ { k } \right\}$
126
+ 10: end for
127
+ 11: end for
128
+
129
+ # 5 EXPERIMENT
130
+
131
+ In this section, we conduct experiments to answer the following questions:
132
+
133
+ 1. does Ensemble Voting, Algorithm 1, improve upon existing algorithms including Double DQN and bootstrapped DQN?
134
+ 2. is the proposed UCB exploration strategy of Algorithm 2 effective in improving learning compared to Algorithm 1, Double DQN and bootstrapped DQN?
135
+ 3. how does UCB exploration compare with prior exploration methods such as the count-based exploration method of Bellemare et al. (2016)?
136
+
137
+ We evaluate the algorithms on each Atari game of the Arcade Learning Environment (Bellemare et al. (2013)). We use the multi-head neural net architecture of Osband et al. (2016). We fix the common hyperparameters of all algorithms based on a well-tuned double DQN implementation, which uses the Adam optimizer (Kingma and Ba (2014)), different learning rate and exploration schedules compared to Mnih et al. (2015). Appendix A tabulates the hyperparameters. The number of $\left\{ Q _ { k } \right\}$ functions is $K = 1 0$ . Experiments are conducted on the OpenAI Gym platform (Brockman et al. (2016)) and trained with 40 million frames and 2 trials on each game.
138
+
139
+ We take the following directions to evaluate the performance of our algorithms:
140
+
141
+ 1. we compare Algorithm 1 against Double DQN and bootstrapped DQN,
142
+ 2. we isolate the impact of UCB exploration by comparing Algorithm 2 with $\lambda = 0 . 1$ , denoted as ucb exploration, against Algorithm 1, Double DQN, and bootstrapped DQN.
143
+ 3. we compare Algorithm 1 and Algorithm 2 with the count-based exploration method of Bellemare et al. (2016).
144
+ 4. we aggregate the comparison according to different categories of games, to understand when our methods are suprior.
145
+
146
+ Figure 1 compares the normalized learning curves of all algorithms across Atari games. Overall, Ensemble Voting, Algorithm 1, outperforms both Double DQN and bootstrapped DQN. With exploration, ucb exploration improves further by outperforming Ensemble Voting.
147
+
148
+ In Appendix B, we tabulate detailed results that compare our algorithms, Ensemble Voting and ucb exploration, against prior methods. In Table 2, we tabulate the maximal mean reward in 100 consecutive episodes for Ensemble Voting, ucb exploration, bootstrapped DQN and Double DQN. Without exploration, Ensemble Voting already achieves higher maximal mean reward than both Double DQN and bootstrapped DQN in a majority of Atari games. Ensemble Voting performs better than Double DQN in 37 games out of the total 49 games evaluated, better than bootstrapped DQN in 41 games. ucb exploration achieves the highest maximal mean reward among these four algorithms in 30 games out of the total 49 games evaluated. Specifically, ucb exploration performs better than Double DQN in 38 out of 49 games evaluated, better than bootstrapped DQN in 45 games, and better than Ensemble Voting in 35 games. Figure 2 displays the learning curves of these five algorithms on a set of six Atari games. Ensemble Voting outperforms Double DQN and bootstrapped DQN. ucb exploration outperforms Ensemble Voting.
149
+
150
+ In Table 3, we compare our proposed methods with the count-based exploration method ${ \bf A } 3 { \bf C } +$ of Bellemare et al. (2016) based on their published results of ${ \bf A } 3 { \bf C } +$ trained with 200 million frames. We point out that even though our methods were trained with only 40 million frames, much less than ${ \bf A } 3 { \bf C } +$ ’s 200 million frames, UCB exploration achieves the highest average reward in 28 games, Ensemble Voting in 10 games, and ${ \bf A } 3 { \bf C } +$ in 10 games. Our approach outperforms ${ \bf A } 3 { \bf C } +$ .
151
+
152
+ Finally to understand why and when the proposed methods are superior, we aggregate the comparison results according to four categories: Human Optimal, Score Explicit, Dense Reward, and Sparse Reward. These categories follow the taxonomy in Table 1 of Ostrovski et al. (2017). Out of all games evaluated, 23 games are Human Optimal, 8 are Score Explicit, 8 are Dense Reward, and 5 are Sparse Reward. The comparison results are tabulated in Table 4, where we see ucb exploration achieves top performance in more games than Ensemble Voting, Double DQN, and Bootstrapped DQN in the categories of Human Optimal, Score Explicit, and Dense Reward. In Sparse Reward, both ucb exploration and Ensemble Voting achieve best performance in 2 games out of total of 5. Thus, we conclude that ucb exploration improves prior methods consistently across different game categories within the Arcade Learning Environment.
153
+
154
+ ![](images/755944a1fbb499ae90c0dbc15edc278a059fe19214caa71c8855f17a85eb8094.jpg)
155
+ Figure 1: Comparison of algorithms in normalized learning curve. The normalized learning curve is calculated as follows: first, we normalize learning curves for all algorithms in the same game to the interval [0, 1]; next, average the normalized learning curve from all games for each algorithm.
156
+
157
+ ![](images/187b14c9628fc4f8130883728517c533abd226a73264ac629bbd4c497df9fc9f.jpg)
158
+ Figure 2: Comparison of UCB Exploration and Ensemble Voting against Double DQN and Bootstrapped DQN.
159
+
160
+ # 6 CONCLUSION
161
+
162
+ We proposed a $Q$ -ensemble approach to deep $Q$ -learning, a computationally practical algorithm inspired by Bayesian reinforcement learning that outperforms Double DQN and bootstrapped DQN, as evaluated on Atari. The key ingredient is the UCB exploration strategy, inspired by bandit algorithms. Our experiments show that the exploration strategy achieves improved learning performance on the majority of Atari games.
163
+
164
+ # REFERENCES
165
+
166
+ Jean-Yves Audibert, Rémi Munos, and Csaba Szepesvári. Exploration–exploitation tradeoff using variance estimates in multi-armed bandits. Theor. Comput. Sci., 410(19):1876–1902, 2009.
167
+
168
+ Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Mach. Learn., 47(2-3):235–256, 2002.
169
+
170
+ Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In NIPS, pages 1471–1479, 2016.
171
+
172
+ Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. J. Artif. Intell. Res., 47:253–279, 2013.
173
+
174
+ Ronen I Brafman and Moshe Tennenholtz. R-max-a general polynomial time algorithm for nearoptimal reinforcement learning. J. Mach. Learn. Res., 3(Oct):213–231, 2002.
175
+
176
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym. arXiv preprint arXiv:1606.01540, 2016.
177
+
178
+ Richard Dearden, Nir Friedman, and Stuart Russell. Bayesian Q-learning. In AAAI/IAAI, pages 761–768, 1998.
179
+
180
+ Richard Dearden, Nir Friedman, and David Andre. Model based Bayesian exploration. In UAI, pages 150–159, 1999.
181
+
182
+ Justin Fu, John D Co-Reyes, and Sergey Levine. EX2: Exploration with exemplar models for deep reinforcement learning. arXiv preprint arXiv:1703.01260, 2017.
183
+
184
+ Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. VIME: Variational information maximizing exploration. In NIPS, pages 1109–1117, 2016.
185
+
186
+ Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Mach. Learn., 49(2-3):209–232, 2002.
187
+
188
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
189
+
190
+ Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. arXiv preprint arXiv:1612.01474, 2016.
191
+
192
+ Stefan Lee, Senthil Purushwalkam, Michael Cogswell, David Crandall, and Dhruv Batra. Why M heads are better than one: Training a diverse ensemble of deep networks. arXiv preprint arXiv:1511.06314, 2015.
193
+
194
+ Xiuyuan Lu and Benjamin Van Roy. Ensemble sampling. 2017.
195
+
196
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
197
+
198
+ Ian Osband and Benjamin Van Roy. Why is posterior sampling better than optimism for reinforcement learning. arXiv preprint arXiv:1607.00215, 2016.
199
+
200
+ Ian Osband, Dan Russo, and Benjamin Van Roy. (More) efficient reinforcement learning via posterior sampling. In NIPS, pages 3003–3011, 2013.
201
+
202
+ Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via randomized value functions. arXiv preprint arXiv:1402.0635, 2014.
203
+ Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped DQN. In NIPS, pages 4026–4034, 2016.
204
+ Georg Ostrovski, Marc G Bellemare, Aaron van den Oord, and Remi Munos. Count-based exploration with neural density models. arXiv preprint arXiv:1703.01310, 2017.
205
+ Jonathan Sorg, Satinder Singh, and Richard L Lewis. Variance-based rewards for approximate bayesian reinforcement learning. arXiv preprint arXiv:1203.3518, 2012.
206
+ Alexander L Strehl, Lihong Li, Eric Wiewiora, John Langford, and Michael L Littman. Pac model-free reinforcement learning. In ICML, pages 881–888. ACM, 2006.
207
+ Malcolm Strens. A Bayesian framework for reinforcement learning. In ICML, pages 943–950, 2000.
208
+ Yi Sun, Faustino Gomez, and Jürgen Schmidhuber. Planning to be surprised: Optimal Bayesian exploration in dynamic environments. In ICAGI, pages 41–51. Springer, 2011.
209
+ Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. # Exploration: A study of count-based exploration for deep reinforcement learning. arXiv preprint arXiv:1611.04717, 2016.
210
+ Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double Qlearning. In AAAI, pages 2094–2100, 2016.
211
+ Christopher JCH Watkins and Peter Dayan. Q-learning. Mach. Learn., 8(3-4):279–292, 1992.
212
+ Christopher John Cornish Hellaby Watkins. Learning from delayed rewards. PhD thesis, University of Cambridge England, 1989.
213
+
214
+ # A HYPERPARAMETERS
215
+
216
+ We tabulate the hyperparameters in our well-tuned implementation of double DQN in Table 1:
217
+
218
+ Table 1: Double DQN hyperparameters. These hyperparameters are selected based on performances of seven Atari games: Beam Rider, Breakout, Pong, Enduro, Qbert, Seaquest, and Space Invaders. $I n t e r p ( \cdot , \cdot )$ is linear interpolation between two values.
219
+
220
+ <table><tr><td colspan="4">value</td></tr><tr><td>hyperparameter total training frames</td><td>40 million</td><td>descriptions</td><td>Length of training for each game.</td></tr><tr><td>minibatch size</td><td colspan="3">32</td></tr><tr><td>replay buffer size</td><td>1000000</td><td>parameter update.</td><td>The number of most recent frames</td></tr><tr><td>agent history length</td><td colspan="3">4</td></tr><tr><td></td><td></td><td>length.</td><td>concatenated as input to the Q net- work. Total number of iterations = total training frames /agent history</td></tr><tr><td>target network update10000 frequency</td><td colspan="3"></td></tr><tr><td>discount factor</td><td colspan="3">0.99</td></tr><tr><td>action repeat</td><td colspan="3">4</td></tr><tr><td>update frequency 4</td><td colspan="3"></td></tr><tr><td>optimizer</td><td colspan="2">Adam</td><td>Optimizer for parameter updates.</td></tr><tr><td>β1 0.9</td><td colspan="3">Adam optimizer parameter.</td></tr><tr><td>β</td><td colspan="2">0.99</td><td>Adam optimizer parameter.</td></tr><tr><td>E 10-4</td><td colspan="2"></td><td>Adam optimizer parameter.</td></tr><tr><td>learning rate schedule 2</td><td>10-4 Interp(10-4,5 * 10-5) 5*10-5</td><td>t≤106 otherwise t&gt;5*106</td><td>Learning rate for Adam optimizer, as a function of iteration t.</td></tr><tr><td>exploration schedule</td><td>Interp(1,0.1) Interp(0.1,0.01) 0.01</td><td colspan="2">t&lt;106 otherwise Probability of random action in e- t&gt;5*106</td></tr><tr><td></td><td></td><td colspan="2">greedy exploration, as a function of the iteration t . Number of uniform random ac- tions taken before learning starts.</td></tr><tr><td>replay start size</td><td colspan="3">50000</td></tr></table>
221
+
222
+ # B RESULTS TABLES
223
+
224
+ <table><tr><td colspan="4"></td><td rowspan="2">UCB-Exploration</td></tr><tr><td></td><td>Bootstrapped DQN</td><td>DoubleDQN</td><td>Ensemble Voting 2282.8</td></tr><tr><td>Alien</td><td>1445.1</td><td>2059.7</td><td></td><td>2817.6</td></tr><tr><td>Amidar</td><td>430.58</td><td>667.5</td><td>683.72</td><td>663.8</td></tr><tr><td>Assault</td><td>2519.06</td><td>2820.61</td><td>3213.58</td><td>3702.76</td></tr><tr><td>Asterix</td><td>3829.0</td><td>7639.5</td><td>8740.0</td><td>8732.0</td></tr><tr><td>Asteroids</td><td>1009.5</td><td>1002.3</td><td>1149.3</td><td>1007.8</td></tr><tr><td>Atlantis</td><td>1314058.0</td><td>1982677.0</td><td>1786305.0</td><td>2016145.0</td></tr><tr><td>Bank Heist</td><td>795.1</td><td>789.9</td><td>869.4</td><td>906.9</td></tr><tr><td>Battle Zone</td><td>26230.0</td><td>24880.0</td><td>27430.0</td><td>26770.0</td></tr><tr><td>Beam Rider</td><td>8006.58</td><td>7743.74</td><td>7991.9</td><td>9188.26</td></tr><tr><td>Bowling</td><td>28.62</td><td>30.92</td><td>32.92</td><td>38.06</td></tr><tr><td>Boxing</td><td>85.91</td><td>94.07</td><td>94.47</td><td>98.08</td></tr><tr><td>Breakout</td><td>400.22</td><td>467.45</td><td>426.78</td><td>411.31</td></tr><tr><td>Centipede</td><td>5328.77</td><td>5177.51</td><td>6153.28</td><td>6237.18</td></tr><tr><td>Chopper Command</td><td>2153.0</td><td>3260.0</td><td>3544.0</td><td>3677.0</td></tr><tr><td>Crazy Climber</td><td>110926.0</td><td>124456.0</td><td>126677.0</td><td>127754.0</td></tr><tr><td>Demon Attack</td><td>9811.45</td><td>23562.55</td><td>30004.4</td><td>59861.9</td></tr><tr><td>Double Dunk</td><td>-10.82</td><td>-14.58</td><td>-11.94</td><td>-4.08</td></tr><tr><td>Enduro</td><td>1314.31</td><td>1439.59</td><td>1999.88</td><td>2752.55</td></tr><tr><td>Fishing Derby</td><td>21.89</td><td>23.69</td><td>30.02</td><td>29.71</td></tr><tr><td>Freeway</td><td>33.57</td><td>32.93</td><td>33.92</td><td>33.96</td></tr><tr><td>Frostbite</td><td>1284.8</td><td>529.2</td><td>1196.0</td><td>1903.0</td></tr><tr><td>Gopher</td><td>7652.2</td><td>12030.0</td><td>10993.2</td><td>12910.8</td></tr><tr><td>Gravitar</td><td>227.5</td><td>279.5</td><td>371.5</td><td>318.0</td></tr><tr><td>Ice Hockey</td><td>-4.62</td><td>-4.63</td><td>-1.73</td><td>-4.71</td></tr><tr><td>Jamesbond</td><td>594.5</td><td>594.0</td><td>602.0</td><td>710.0</td></tr><tr><td>Kangaroo</td><td>8186.0</td><td>7787.0</td><td>8174.0</td><td>14196.0</td></tr><tr><td>Krull</td><td>8537.52</td><td>8517.91</td><td>8669.17</td><td>9171.61</td></tr><tr><td>Kung Fu Master</td><td>24153.0</td><td>32896.0</td><td>30988.0</td><td>31291.0</td></tr><tr><td>Montezuma Revenge</td><td>2.0</td><td>4.0</td><td>1.0</td><td>4.0</td></tr><tr><td>Ms Pacman</td><td>2508.7</td><td>2498.1</td><td>3039.7</td><td>3425.4</td></tr><tr><td>Name This Game</td><td>8212.4</td><td>9806.9</td><td>9255.1</td><td>9570.5</td></tr><tr><td>Pitfall</td><td>-5.99</td><td>-7.57</td><td>-3.37</td><td>-1.47</td></tr><tr><td>Pong</td><td>21.0</td><td>20.67</td><td>21.0</td><td>20.95</td></tr><tr><td>Private Eye</td><td>1815.19</td><td>788.63</td><td>1845.28</td><td>1252.01</td></tr><tr><td>Qbert</td><td>10557.25</td><td>6529.5</td><td>12036.5</td><td>14198.25</td></tr><tr><td>Riverraid</td><td>11528.0</td><td>11834.7</td><td>12785.8</td><td>15622.2</td></tr><tr><td>Road Runner</td><td>52489.0</td><td>49039.0</td><td>54768.0</td><td>53596.0</td></tr><tr><td>Robotank</td><td>21.03</td><td>29.8</td><td>31.83</td><td>41.04</td></tr><tr><td>Seaquest</td><td>9320.7</td><td>18056.4</td><td>20458.6</td><td>24001.6</td></tr><tr><td>Space Invaders</td><td>1549.9</td><td>1917.5</td><td>1890.8</td><td>2626.55</td></tr><tr><td>Star Gunner</td><td>20115.0</td><td>52283.0</td><td>41684.0</td><td>47367.0</td></tr><tr><td>Tennis</td><td>-15.11</td><td>-14.04</td><td>-11.63</td><td>-7.8</td></tr><tr><td>Time Pilot</td><td>5088.0</td><td>5548.0</td><td>6153.0</td><td>6490.0</td></tr><tr><td>Tutankham</td><td>167.47</td><td>223.43</td><td>208.61</td><td>200.76</td></tr><tr><td>Up N Down</td><td>9049.1</td><td>11815.3</td><td>19528.3</td><td>19827.3</td></tr><tr><td>Venture</td><td>115.0</td><td>96.0</td><td>78.0</td><td>67.0</td></tr><tr><td>Video Pinball</td><td>364600.85</td><td>374686.89</td><td>343380.29</td><td>372564.11</td></tr><tr><td>Wizard Of Wor</td><td>2860.0</td><td>3877.0</td><td>5451.0</td><td>5873.0</td></tr><tr><td>Zaxxon</td><td>592.0</td><td>8903.0</td><td>3901.0</td><td>3695.0</td></tr><tr><td>Times best</td><td>1</td><td>7</td><td>9</td><td>30</td></tr></table>
225
+
226
+ Table 2: Comparison of maximal mean rewards achieved by agents. Maximal mean reward is calculated in a window of 100 consecutive episodes. Bold denotes the highest value in each row.
227
+
228
+ <table><tr><td colspan="2">Ensemble Voting</td><td>UCB-Exploration</td><td>A3C+</td></tr><tr><td>Alien</td><td>2282.8</td><td>2817.6</td><td>1848.33</td></tr><tr><td>Amidar</td><td>683.72</td><td>663.8</td><td>964.77</td></tr><tr><td>Assault</td><td>3213.58</td><td>3702.76</td><td>2607.28</td></tr><tr><td>Asterix</td><td>8740.0</td><td>8732.0</td><td>7262.77</td></tr><tr><td>Asteroids</td><td>1149.3</td><td>1007.8</td><td>2257.92</td></tr><tr><td>Atlantis</td><td>1786305.0</td><td>2016145.0</td><td>1733528.71</td></tr><tr><td>Bank Heist</td><td>869.4</td><td>906.9</td><td>991.96</td></tr><tr><td>Battle Zone</td><td>27430.0</td><td>26770.0</td><td>7428.99</td></tr><tr><td>Beam Rider</td><td>7991.9</td><td>9188.26</td><td>5992.08</td></tr><tr><td>Bowling</td><td>32.92</td><td>38.06</td><td>68.72</td></tr><tr><td>Boxing</td><td>94.47</td><td>98.08</td><td>13.82</td></tr><tr><td>Breakout</td><td>426.78</td><td>411.31</td><td>323.21</td></tr><tr><td>Centipede</td><td>6153.28</td><td>6237.18</td><td>5338.24</td></tr><tr><td>Chopper Command</td><td>3544.0</td><td>3677.0</td><td>5388.22</td></tr><tr><td>Crazy Climber</td><td>126677.0</td><td>127754.0</td><td>104083.51</td></tr><tr><td>Demon Attack</td><td>30004.4</td><td>59861.9</td><td>19589.95</td></tr><tr><td>Double Dunk</td><td>-11.94</td><td>-4.08</td><td>-8.88</td></tr><tr><td>Enduro</td><td>1999.88</td><td>2752.55</td><td>749.11</td></tr><tr><td>Fishing Derby</td><td>30.02</td><td>29.71</td><td>29.46</td></tr><tr><td>Freeway</td><td>33.92</td><td>33.96</td><td>27.33</td></tr><tr><td>Frostbite</td><td>1196.0</td><td>1903.0</td><td>506.61</td></tr><tr><td>Gopher</td><td>10993.2</td><td>12910.8</td><td>5948.40</td></tr><tr><td>Gravitar</td><td>371.5</td><td>318.0</td><td>246.02</td></tr><tr><td>Ice Hockey</td><td>-1.73</td><td>-4.71</td><td>-7.05</td></tr><tr><td>Jamesbond</td><td>602.0</td><td>710.0</td><td>1024.16</td></tr><tr><td>Kangaroo</td><td>8174.0</td><td>14196.0</td><td>5475.73</td></tr><tr><td>Krull</td><td>8669.17</td><td>9171.61</td><td>7587.58</td></tr><tr><td>Kung Fu Master</td><td>30988.0</td><td>31291.0</td><td>26593.67</td></tr><tr><td>Montezuma Revenge</td><td>1.0</td><td>4.0</td><td>142.50</td></tr><tr><td>Ms Pacman</td><td>3039.7</td><td>3425.4</td><td>2380.58</td></tr><tr><td>Name This Game</td><td>9255.1</td><td>9570.5</td><td>6427.51</td></tr><tr><td>Pitfall</td><td>-3.37</td><td>-1.47</td><td>-155.97</td></tr><tr><td>Pong</td><td>21.0</td><td>20.95</td><td>17.33</td></tr><tr><td>Private Eye</td><td>1845.28</td><td>1252.01</td><td>100.0</td></tr><tr><td>Qbert</td><td>12036.5</td><td>14198.25</td><td>15804.72</td></tr><tr><td>Riverraid</td><td>12785.8</td><td>15622.2</td><td>10331.56</td></tr><tr><td>Road Runner</td><td>54768.0</td><td>53596.0</td><td>49029.74</td></tr><tr><td>Robotank</td><td>31.83</td><td>41.04</td><td>6.68</td></tr><tr><td>Seaquest</td><td>20458.6</td><td>24001.6</td><td>2274.06</td></tr><tr><td>Space Invaders</td><td>1890.8</td><td>2626.55</td><td>1466.01</td></tr><tr><td> Star Gunner</td><td>41684.0</td><td>47367.0</td><td>52466.84</td></tr><tr><td>Tennis</td><td>-11.63</td><td>-7.8</td><td>-20.49</td></tr><tr><td>Time Pilot</td><td>6153.0</td><td>6490.0</td><td>3816.38</td></tr><tr><td>Tutankham</td><td>208.61</td><td>200.76</td><td>132.67</td></tr><tr><td>Up N Down</td><td>19528.3</td><td>19827.3</td><td>8705.64</td></tr><tr><td>Venture</td><td>78.0</td><td>67.0</td><td>0.00</td></tr><tr><td>Video Pinball</td><td>343380.29</td><td>372564.11</td><td>35515.92</td></tr><tr><td>Wizard Of Wor</td><td>5451.0</td><td>5873.0</td><td>3657.65</td></tr><tr><td>Zaxxon</td><td>3901.0</td><td>3695.0</td><td>7956.05</td></tr><tr><td>Times Best</td><td>10</td><td>28</td><td>10</td></tr></table>
229
+
230
+ Table 3: Comparison of Ensemble Voting, UCB Exploration, both trained with 40 million frames and ${ \bf A } 3 { \bf C } +$ of Bellemare et al. (2016), trained with 200 million frames
231
+
232
+ <table><tr><td>Category</td><td>Total</td><td>Bootstrapped DQN</td><td>Double DQN</td><td>Ensemble Voting</td><td>UCB-Exploration</td></tr><tr><td>Human Optimal</td><td>23</td><td>0</td><td>3</td><td>5</td><td>15</td></tr><tr><td>Score Explicit</td><td>8</td><td>0</td><td>2</td><td>1</td><td>5</td></tr><tr><td>Dense Reward</td><td>8</td><td>0</td><td>1</td><td>1</td><td>6</td></tr><tr><td>Sparse Reward</td><td>5</td><td>1</td><td>0</td><td>2</td><td>2</td></tr></table>
233
+
234
+ Table 4: Comparison of each method across different game categories. The Atari games are separated into four categories: human optimal, score explicit, dense reward, and sparse reward. In each row, we present the number of games in this category, the total number of games where each algorithm achieves the optimal performance according to Table 2. The game categories follow the taxonomy in Table 1 of Ostrovski et al. (2017)
235
+
236
+ # C APPROXIMATING BAYESIAN $Q$ -LEARNING WITH $Q$ -ENSEMBLES
237
+
238
+ In this section, we first derive a posterior update formula for the $Q ^ { * }$ -function under full exploration assumption and this formula turns out to depend on the transition Markov chain. Next, we approximate the posterior update with $Q$ -ensembles $\{ { \bar { Q } } _ { k } \}$ and demonstrate that the Bellman equation emerges as the approximate update rule for each $Q _ { k }$ .
239
+
240
+ # C.1 POSTERIOR UPDATE FOR THE $Q ^ { * }$ -FUNCTION
241
+
242
+ An MDP is specified by the transition probability $T$ and the reward function $R$ . Unlike prior works outlined in Section 2.3 which learned the posterior of the MDP, we will consider the joint distribution over $( Q ^ { * } , T )$ . Note that $R$ can be recovered from $Q ^ { * }$ given $T$ . So $( Q ^ { * } , T )$ determines a unique MDP. In this section, we assume that the agent samples $( s , a )$ according to a fixed distribution. The corresponding reward $r$ and next state $s ^ { \prime }$ given by the MDP append to $( s , a )$ to form a transition ${ \boldsymbol \tau } = ( s , a , r , s ^ { \prime } )$ , for updating the posterior of $( Q ^ { * } , T )$ . Recall that the $Q ^ { * }$ -function satisfies the Bellman equation
243
+
244
+ $$
245
+ Q ( s , a ) = r + \mathbb { E } _ { s ^ { \prime } \sim T ( \cdot | s , a ) } \left[ \gamma \operatorname* { m a x } _ { a ^ { \prime } } Q ( s ^ { \prime } , a ^ { \prime } ) \right] .
246
+ $$
247
+
248
+ Denote the joint prior distribution as $p ( Q ^ { * } , T )$ and the posterior as $\tilde { p }$ . We apply Bayes’ formula to expand the posterior:
249
+
250
+ $$
251
+ \begin{array} { r l } & { \tilde { p } ( Q ^ { * } , T | \tau ) = \frac { p ( \tau | Q ^ { * } , T ) \cdot p ( Q ^ { * } , T ) } { Z ( \tau ) } } \\ & { \qquad = \frac { p ( Q ^ { * } , T ) \cdot p ( s ^ { \prime } | Q ^ { * } , T , ( s , a ) ) \cdot p ( r | Q ^ { * } , T , ( s , a , s ^ { \prime } ) ) \cdot p ( s , a ) } { Z ( \tau ) } , } \end{array}
252
+ $$
253
+
254
+ where $Z ( \tau )$ is a normalizing constant and the second equality is because $s$ and $a$ are sampled randomly from $s$ and $\mathcal { A }$ . Next, we calculate the two conditional probabilities in (1). First,
255
+
256
+ $$
257
+ p ( s ^ { \prime } | Q ^ { * } , T , ( s , a ) ) = p ( s ^ { \prime } | T , ( s , a ) ) = T ( s ^ { \prime } | s , a ) ,
258
+ $$
259
+
260
+ where the first equality is because given $T$ , $Q ^ { * }$ does not influence the transition. Second,
261
+
262
+ $$
263
+ \begin{array} { r l } & { p ( r | Q ^ { * } , T , ( s , a , s ^ { \prime } ) ) = p ( r | Q ^ { * } , T , ( s , a ) ) } \\ & { \phantom { p s p a c e } = \mathbb { 1 } _ { \{ Q ^ { * } ( s , a ) = r + \gamma \cdot \mathbb { E } _ { s ^ { \prime \prime } \sim T ( \cdot \cdot \vert s , a ) } \operatorname* { m a x } _ { a ^ { \prime } } Q ^ { * } ( s ^ { \prime \prime } , a ^ { \prime } ) \} } } \\ & { \phantom { p s p a c e } : = \mathbb { 1 } ( Q ^ { * } , T ) , } \end{array}
264
+ $$
265
+
266
+ where $\mathbb { 1 } _ { \{ \cdot \} }$ is the indicator function and in the last equation we abbreviate it as $\mathbb { 1 } ( Q ^ { * } , T )$ . Substituting (2) and (3) into (1), we obtain the joint posterior of $Q ^ { * }$ and $T$ after observing an additional randomly sampled transition $\tau$
267
+
268
+ $$
269
+ \tilde { p } ( Q ^ { * } , T | \tau ) = \frac { p ( Q ^ { * } , T ) \cdot T ( s ^ { \prime } | s , a ) \cdot p ( s , a ) } { Z ( \tau ) } \cdot \mathbb { 1 } ( Q ^ { * } , T ) .
270
+ $$
271
+
272
+ # C.2 APPROXIMATIONS WITH $Q$ -ENSEMBLES
273
+
274
+ The exact $Q ^ { * }$ -posterior update (4) is intractable in high-dimensional RL due to the large space of $( Q ^ { * } , T )$ . Thus, we make several approximations to the $Q ^ { * }$ -posterior update. First, we approximate the prior of $Q ^ { * }$ by sampling $K \in \mathbb { N } _ { + }$ independently initialized $Q ^ { * }$ -functions $\{ Q _ { k } \} _ { k = 1 } ^ { K }$ . Next, we update them as more transitions are sampled. The resulting $\left\{ Q _ { k } \right\}$ approximate samples drawn from the posterior. The agent chooses the action by taking a majority vote from the actions determined by each $Q _ { k }$ .
275
+
276
+ We derive the update rule for $\left\{ Q _ { k } \right\}$ after observing a new transition $\tau = ( s , a , r , s ^ { \prime } )$ . At iteration $i$ , given $Q ^ { * } = Q _ { k , i } ( \cdot ; \theta _ { k } )$ parametrized by $\theta _ { k }$ the joint probability of $( Q ^ { * } , T )$ factors into
277
+
278
+ $$
279
+ p ( Q _ { k , i } , T ) = p ( Q ^ { * } , T | Q ^ { * } = Q _ { k , i } ) = p ( T | Q _ { k , i } ) .
280
+ $$
281
+
282
+ Substitute (5) into (4) and we obtain the corresponding posterior for each $Q _ { k , i + 1 }$ at iteration $i + 1$ as
283
+
284
+ $$
285
+ \begin{array} { r l r } { { \tilde { p } ( Q _ { k , i + 1 } , T | \tau ) = \frac { p ( T | Q _ { k , i } ) \cdot T ( s ^ { \prime } | s , a ) \cdot p ( s , a ) } { Z ( \tau ) } \cdot \mathbb { 1 } ( Q _ { k , i + 1 } , T ) . } } \\ & { } & { \tilde { p } ( Q _ { k , i + 1 } | \tau ) = \int _ { T } \tilde { p } ( Q _ { k , i + 1 } , T | \tau ) \mathrm { d } T = p ( s , a ) \cdot \int _ { T } \tilde { p } ( T | Q _ { k , i } , \tau ) \cdot \mathbb { 1 } ( Q _ { k , i + 1 } , T ) \mathrm { d } T . } \end{array}
286
+ $$
287
+
288
+ We update $Q _ { k , i }$ to $Q _ { k , i + 1 }$ according to
289
+
290
+ $$
291
+ Q _ { k , i + 1 } \operatorname * { a r g m a x } _ { Q _ { k , i + 1 } } \tilde { p } ( Q _ { k , i + 1 } | \tau ) .
292
+ $$
293
+
294
+ We first derive a lower bound of the the posterior $\tilde { p } ( Q _ { k , i + 1 } | \tau )$ :
295
+
296
+ $$
297
+ \begin{array} { r l r } { { \operatorname { i } ( Q _ { k , i + 1 } \lvert \tau \rangle = p ( s , a ) \cdot \mathbb { E } _ { T \sim \tilde { p } ( T \lvert Q _ { k , i } , \tau ) } \mathbb { 1 } ( Q _ { k , i + 1 } , T ) } } \\ & { = p ( s , a ) \cdot \mathbb { E } _ { T \sim \tilde { p } ( T \lvert Q _ { k , i } , \tau ) } \underset { c \to + \infty } { \operatorname { i m } } \exp ( - c [ Q _ { k , i + 1 } ( s , a ) - r - \gamma \mathbb { E } _ { s ^ { \prime \prime } \sim T ( \cdot \lvert s , a ) } \underset { a ^ { \prime } } { \operatorname { m a x } } Q _ { k , i + 1 } ( s ^ { \prime \prime } , a ^ { \prime } ) ] ^ { 2 } ) } \\ & { = p ( s , a ) \cdot \underset { c \to + \infty } { \operatorname* { i m } } \mathbb { E } _ { T \sim \tilde { p } ( T \lvert Q _ { k , i } , \tau ) } \exp ( - c [ Q _ { k , i + 1 } ( s , a ) - r - \gamma \mathbb { E } _ { s ^ { \prime \prime } \sim T ( \cdot \lvert s , a ) } \underset { a ^ { \prime } } { \operatorname { m a x } } Q _ { k , i + 1 } ( s ^ { \prime \prime } , a ^ { \prime } ) ] ^ { 2 } ) } \\ & { \geq p ( s , a ) \cdot \underset { c \to + \infty } { \operatorname* { i m } } \exp ( - c \mathbb { E } _ { T \sim \tilde { p } ( T \lvert Q _ { k , i } , \tau ) } [ Q _ { k , i + 1 } ( s , a ) - r - \gamma \mathbb { E } _ { s ^ { \prime \prime } \sim T ( \cdot \lvert s , a ) } \underset { a ^ { \prime } } { \operatorname { m a x } } Q _ { k , i + 1 } ( s ^ { \prime \prime } , a ^ { \prime } ) ] ^ { 2 } ) } \\ & { = p ( s , a ) \cdot \underset { c \to + \infty } { \operatorname* { l i m } } \underset { c \to \tau ( \tau \lvert Q _ { k , i } , \tau ) } { \operatorname* { i m } } [ Q _ { k , i + 1 } ( s , a ) - r - \gamma \mathbb { E } _ { s ^ { \prime \prime } \sim T ( \cdot \lvert s , a ) } \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { k , i + 1 } ( s ^ { \prime \prime } , a ^ { \prime } ) ] ^ { 2 } } \\ & = p ( s , a ) \cdot \mathbb { E } _ { T \sim \tilde { p } ( T \lvert Q _ { k , i } , \tau ) } [ Q _ k , \end{array}
298
+ $$
299
+
300
+ where we apply a limit representation of the indicator function in the third equation. The fourth equation is due to the bounded convergence theorem. The inequality is Jensen’s inequality. The last equation (9) replaces the limit with an indicator function.
301
+
302
+ A sufficient condition for (8) is to maximize the lower-bound of the posterior distribution in (9) by ensuring the indicator function in (9) to hold. We can replace (8) with the following update
303
+
304
+ $$
305
+ Q _ { k , i + 1 } \underset { Q _ { k , i + 1 } } { \mathrm { a r g m i n } } \mathbb { E } _ { T \sim \tilde { p } ( T | Q _ { k , i } , \tau ) } [ Q _ { k , i + 1 } ( s , a ) - ( r + \gamma \cdot \mathbb { E } _ { s ^ { \prime \prime } \sim T ( \cdot | s , a ) } \operatorname* { m a x } _ { a ^ { \prime } } Q _ { k , i + 1 } ( s ^ { \prime \prime } , a ^ { \prime } ) ) ] ^ { 2 } .
306
+ $$
307
+
308
+ However, (10) is not tractable because the expectation in (10) is taken with respect to the posterior $\tilde { p } ( T | Q _ { k , i } , \tau )$ of the transition $T$ . To overcome this challenge, we approximate the posterior update by reusing the one-sample next state $s ^ { \prime }$ from $\tau$ . Solving the exact minimal for each $Q _ { k , i + 1 }$ is impractical, thus we take a gradient step on $Q _ { k , i + 1 }$ according to the following gradient
309
+
310
+ $$
311
+ \theta _ { k } \theta _ { k } + \eta \cdot ( Q _ { k } ( s , a ; \theta _ { k } ) - ( r + \gamma \cdot \operatorname* { m a x } _ { a ^ { \prime } } Q _ { k } ( s ^ { \prime } , a ^ { \prime } ; \theta _ { k } ) ) ) \nabla _ { \theta _ { k } } Q _ { k } ( s , a ; \theta _ { k } ) ,
312
+ $$
313
+
314
+ where $\eta$ is the step size. Instead of updating $Q _ { k }$ after each transition, we use an experience replay buffer $B$ to store observed transitions and sample a minibatch $B _ { \mathrm { m i n i } }$ of transitions $( s , a , r , s ^ { \prime } )$ for each update. In this case, the batched update of each $Q _ { k , i }$ to $Q _ { k , i + 1 }$ becomes a standard Bellman update
315
+
316
+ $$
317
+ \theta _ { k } \gets \theta _ { k } + \eta \cdot \mathbb { E } _ { ( s , a , r , s ^ { \prime } ) \in B _ { \operatorname* { m i n } } } \big [ \big ( Q _ { k } \big ( s , a ; \theta _ { k } \big ) - \big ( r + \gamma \cdot \operatorname* { m a x } _ { a ^ { \prime } } Q _ { k } \big ( s ^ { \prime } , a ^ { \prime } ; \theta _ { k } \big ) \big ) \big ) \nabla _ { \theta _ { k } } Q _ { k } \big ( s , a ; \theta _ { k } \big ) \big ] .
318
+ $$
319
+
320
+ # D INFOGAIN EXPLORATION
321
+
322
+ In this section, we also studied an “InfoGain” exploration bonus, which encourages agents to gain information about the $Q ^ { * }$ -function and examine its effectiveness. We found it had some benefits on top of Ensemble Voting, but no uniform additional benefits once already using Q-ensembles on top of Double DQN. We describe the approach and our experimental findings.
323
+
324
+ Similar to Sun et al. (2011), we define the information gain from observing an additional transition $\tau _ { n }$ as
325
+
326
+ $$
327
+ H _ { \tau _ { t } | \tau _ { 1 } , \dots , \tau _ { n - 1 } } = D _ { K L } ( \tilde { p } ( Q ^ { * } | \tau _ { 1 } , \dots , \tau _ { n } ) | | \tilde { p } ( Q ^ { * } | \tau _ { 1 } , \dots , \tau _ { n - 1 } ) )
328
+ $$
329
+
330
+ where $\tilde { p } ( Q ^ { * } | \tau _ { 1 } , \dots , \tau _ { n } )$ is the posterior distribution of $Q ^ { * }$ after observing a sequence of transitions $\left( \tau _ { 1 } , \dots , \tau _ { n } \right)$ . The total information gain is
331
+
332
+ $$
333
+ H _ { \tau _ { 1 } , \dots , \tau _ { N } } = \sum _ { n = 1 } ^ { N } H _ { \tau _ { n } | \tau _ { 1 } , \dots , \tau _ { n - 1 } } .
334
+ $$
335
+
336
+ Our Ensemble Voting, Algorithm 1, does not maintain the posterior $\tilde { p }$ , thus we cannot calculate (11) explicitly. Instead, inspired by Lakshminarayanan et al. (2016), we define an InfoGain exploration bonus that measures the disagreement among $\left\{ Q _ { k } \right\}$ . Note that
337
+
338
+ $$
339
+ H _ { \tau _ { 1 } , \dots , \tau _ { N } } + \mathsf { H } ( \tilde { p } ( Q ^ { * } | \tau _ { 1 } , \dots , \tau _ { N } ) ) = \mathsf { H } ( p ( Q ^ { * } ) ) ,
340
+ $$
341
+
342
+ where $\mathsf { H } ( \cdot )$ is the entropy. If $H _ { \tau _ { 1 } , \dots , \tau _ { N } }$ is small, then the posterior distribution has high entropy and high residual information. Since $\left\{ Q _ { k } \right\}$ are approximate samples from the posterior, high entropy of the posterior leads to large discrepancy among $\left\{ Q _ { k } \right\}$ . Thus, the exploration bonus is monotonous with respect to the residual information in the posterior $\mathsf { H } ( \tilde { p } ( Q ^ { * } | \tau _ { 1 } , \dots , \tau _ { N } ) )$ . We first compute the Boltzmann distribution for each $Q _ { k }$
343
+
344
+ $$
345
+ P _ { \mathsf { T } , k } ( a | s ) = \frac { \exp \left( Q _ { k } ( s , a ) / \mathsf { T } \right) } { \sum _ { a ^ { \prime } } \exp \left( Q _ { k } ( s , a ^ { \prime } ) / \mathsf { T } \right) } ,
346
+ $$
347
+
348
+ where $\mathsf T > 0$ is a temperature parameter. Next, calculate the average Boltzmann distribution
349
+
350
+ $$
351
+ P _ { \mathsf { T } , \mathrm { a v g } } = \frac { 1 } { K } \cdot \sum _ { k = 1 } ^ { K } P _ { \mathsf { T } , k } ( a | s ) .
352
+ $$
353
+
354
+ The InfoGain exploration bonus is the average KL-divergence from $\{ P _ { \mathsf { T } , k } \} _ { k = 1 } ^ { K }$ to $P _ { \mathrm { { T , a v g } } }$
355
+
356
+ $$
357
+ b _ { \mathsf { T } } ( s ) = \frac { 1 } { K } \cdot \sum _ { k = 1 } ^ { K } \mathrm { D } _ { K L } [ P _ { \mathsf { T } , k } | | P _ { \mathsf { T } , \mathrm { a v g } } ] .
358
+ $$
359
+
360
+ The modified reward is
361
+
362
+ $$
363
+ \hat { r } ( s , a , s ^ { \prime } ) = r ( s , a ) + \rho \cdot b \tau ( s ) ,
364
+ $$
365
+
366
+ where $\rho \in \mathbb { R } _ { + }$ is a hyperparameter that controls the degree of exploration.
367
+
368
+ The exploration bonus $b _ { \mathsf { T } } ( s _ { t } )$ encourages the agent to explore where $\left\{ Q _ { k } \right\}$ disagree. The temperature parameter $\top$ controls the sensitivity to discrepancies among $\{ Q _ { k } \}$ . When $\mathsf { T } \to + \infty$ , $\{ P _ { \top , k } \}$ converge to the uniform distribution on the action space and $b _ { \mathsf { T } } ( s ) \to 0$ . When $\top$ is small, the differences among $\left\{ Q _ { k } \right\}$ are magnified and $b _ { \mathsf { T } } ( s )$ is large.
369
+
370
+ We display Algorithrim 3, which incorporates our InfoGain exploration bonus into Algorithm 2. The hyperparameters $\lambda$ , $\top$ and $\rho$ vary for each game.
371
+
372
+ # Algorithm 3 UCB + InfoGain Exploration with $Q$ -Ensembles
373
+
374
+ 1: Input: Value function networks $Q$ with $K$ outputs $\{ Q _ { k } \} _ { k = 1 } ^ { K }$ . Hyperparameters $\tau , \lambda$ , and $\rho$ .
375
+ 2: Let $B$ be a replay buffer storing experience for training.
376
+ 3: for each episode do
377
+ 4: Obtain initial state from environment $s _ { 0 }$
378
+ 5: for step $t = 1 , \dots$ until end of episode do
379
+ 6: Pick an action according to $\begin{array} { r } { \grave { a _ { t } } \in \mathrm { a r g m a x } _ { a } \left\{ \tilde { \mu } ( s _ { t } , a ) + \lambda \cdot \tilde { \sigma } ( s _ { t } , a ) \right\} } \end{array}$
380
+ 7: Receive state $s _ { t + 1 }$ and reward $r _ { t }$ from environment, having taken action $a _ { t }$
381
+ 8: Calculate exploration bonus $b _ { \mathsf { T } } ( s _ { t } )$ according to (12)
382
+ 9: Add $( s _ { t } , a _ { t } , r _ { t } + \rho \cdot b _ { \mathsf { T } } ( s _ { t } ) , s _ { t + 1 } )$ to replay buffer $B$
383
+ 10: At learning interval, sample random minibatch and update $\left\{ Q _ { k } \right\}$
384
+ 11: end for
385
+ 12: end for
386
+
387
+ ![](images/939ce04cb216d1efd18ae513f715268a3148f6d9a0bb94bd5582028e5311ce05.jpg)
388
+ Figure 3: Comparison of all algorithms in normalized curve. The normalized learning curve is calculated as follows: first, we normalize learning curves for all algorithms in the same game to the interval [0, 1]; next, average the normalized learning curve from all games for each algorithm.
389
+
390
+ # D.1 PERFORMANCE OF UCB $^ +$ INFOGAIN EXPLORATION
391
+
392
+ We demonstrate the performance of the combined UCB+InfoGain exploration in Figure 3 and Figure 3. We augment the previous figures in Section 5 with the performance of ucb+infogain exploration, where we set $\lambda = 0 . 1 , \rho = 1$ , and ${ \mathsf T } = 1$ in Algorithm 3.
393
+
394
+ Figure 3 shows that combining UCB and InfoGain exploration does not lead to uniform improvement in the normalized learning curve.
395
+
396
+ At the individual game level, Figure 3 shows that the impact of InfoGain exploration varies. UCB exploration achieves sufficient exploration in games including Demon Attack and Kangaroo and Riverraid, while InfoGain exploration further improves learning on Enduro, Seaquest, and Up N Down. The effect of InfoGain exploration depends on the choice of the temperature $\top$ . The optimal temperature parameter varies across games. In Figure 5, we display the behavior of ucb+infogain exploration with different temperature values. Thus, we see the InfoGain exploration bonus, tuned with the appropriate temperature parameter, can lead to improved learning for games that require extra exploration, such as ChopperCommand, KungFuMaster, Seaquest, UpNDown.
397
+
398
+ ![](images/298f295b77aa13e16d25b06d19768431fd0cd7bebf49664568a091f6ffef1383.jpg)
399
+ Figure 4: Comparison of algorithms against Double DQN and bootstrapped DQN.
400
+
401
+ ![](images/bb37003bba1e0413ac880ed76c095033248f764b2a5e78eee9d9c0b3878a47c9.jpg)
402
+ D.2 UCB $^ +$ INFOGAIN EXPLORATION WITH DIFFERENT TEMPERATURES
403
+ Figure 5: Comparison of UCB+InfoGain exploration with different temperatures versus UCB exploration.
md/train/HJlA0C4tPS/HJlA0C4tPS.md ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A PROBABILISTIC FORMULATION OF UNSUPERVISED TEXT STYLE TRANSFER
2
+
3
+ Junxian $\mathbf { H e } ^ { * }$ , Xinyi Wang∗, Graham Neubig Carnegie Mellon University {junxianh,xinyiw1,gneubig}@cs.cmu.edu
4
+
5
+ Taylor Berg-Kirkpatrick University of California San Diego tberg@eng.ucsd.edu
6
+
7
+ # ABSTRACT
8
+
9
+ We present a deep generative model for unsupervised text style transfer that unifies previously proposed non-generative techniques. Our probabilistic approach models non-parallel data from two domains as a partially observed parallel corpus. By hypothesizing a parallel latent sequence that generates each observed sequence, our model learns to transform sequences from one domain to another in a completely unsupervised fashion. In contrast with traditional generative sequence models (e.g. the HMM), our model makes few assumptions about the data it generates: it uses a recurrent language model as a prior and an encoder-decoder as a transduction distribution. While computation of marginal data likelihood is intractable in this model class, we show that amortized variational inference admits a practical surrogate. Further, by drawing connections between our variational objective and other recent unsupervised style transfer and machine translation techniques, we show how our probabilistic view can unify some known non-generative objectives such as backtranslation and adversarial loss. Finally, we demonstrate the effectiveness of our method on a wide range of unsupervised style transfer tasks, including sentiment transfer, formality transfer, word decipherment, author imitation, and related language translation. Across all style transfer tasks, our approach yields substantial gains over state-of-the-art non-generative baselines, including the state-of-the-art unsupervised machine translation techniques that our approach generalizes. Further, we conduct experiments on a standard unsupervised machine translation task and find that our unified approach matches the current state-of-the-art.1
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Text sequence transduction systems convert a given text sequence from one domain to another. These techniques can be applied to a wide range of natural language processing applications such as machine translation (Bahdanau et al., 2015), summarization (Rush et al., 2015), and dialogue response generation (Zhao et al., 2017). In many cases, however, parallel corpora for the task at hand are scarce. Therefore, unsupervised sequence transduction methods that require only non-parallel data are appealing and have been receiving growing attention (Bannard & Callison-Burch, 2005; Ravi & Knight, 2011; Mizukami et al., 2015; Shen et al., 2017; Lample et al., 2018; 2019). This trend is most pronounced in the space of text style transfer tasks where parallel data is particularly challenging to obtain (Hu et al., 2017; Shen et al., 2017; Yang et al., 2018). Style transfer has historically referred to sequence transduction problems that modify superficial properties of text – i.e. style rather than content.2 We focus on a standard suite of style transfer tasks, including formality transfer (Rao & Tetreault, 2018), author imitation (Xu et al., 2012), word decipherment (Shen et al., 2017), sentiment transfer (Shen et al., 2017), and related language translation (Pourdamghani & Knight, 2017). General unsupervised translation has not typically been considered style transfer, but for the purpose of comparison we also conduct evaluation on this task (Lample et al., 2017).
14
+
15
+ Recent work on unsupervised text style transfer mostly employs non-generative or non-probabilistic modeling approaches. For example, Shen et al. (2017) and Yang et al. (2018) design adversarial discriminators to shape their unsupervised objective – an approach that can be effective, but often introduces training instability. Other work focuses on directly designing unsupervised training objectives by incorporating intuitive loss terms (e.g. backtranslation loss), and demonstrates state-ofthe-art performance on unsupervised machine translation (Lample et al., 2018; Artetxe et al., 2019) and style transfer (Lample et al., 2019). However, the space of possible unsupervised objectives is extremely large and the underlying modeling assumptions defined by each objective can only be reasoned about indirectly. As a result, the process of designing such systems is often heuristic.
16
+
17
+ In contrast, probabilistic models (e.g. the noisy channel model (Shannon, 1948)) define assumptions about data more explicitly and allow us to reason about these assumptions during system design. Further, the corresponding objectives are determined naturally by principles of probabilistic inference, reducing the need for empirical search directly in the space of possible objectives. That said, classical probabilistic models for unsupervised sequence transduction (e.g. the HMM or semi-HMM) typically enforce overly strong independence assumptions about data to make exact inference tractable (Knight et al., 2006; Ravi & Knight, 2011; Pourdamghani & Knight, 2017). This has restricted their development and caused their performance to lag behind unsupervised neural objectives on complex tasks. Luckily, in recent years, powerful variational approximation techniques have made it more practical to train probabilistic models without strong independence assumptions (Miao & Blunsom, 2016; Yin et al., 2018). Inspired by this, we take a new approach to unsupervised style transfer.
18
+
19
+ We directly define a generative probabilistic model that treats a non-parallel corpus in two domains as a partially observed parallel corpus. Our model makes few independence assumptions and its true posterior is intractable. However, we show that by using amortized variational inference (Kingma & Welling, 2013), a principled probabilistic technique, a natural unsupervised objective falls out of our modeling approach that has many connections with past work, yet is different from all past work in specific ways. In experiments across a suite of unsupervised text style transfer tasks, we find that the natural objective of our model actually outperforms all manually defined unsupervised objectives from past work, supporting the notion that probabilistic principles can be a useful guide even in deep neural systems. Further, in the case of unsupervised machine translation, our model matches the current state-of-the-art non-generative approach.
20
+
21
+ # 2 UNSUPERVISED TEXT STYLE TRANSFER
22
+
23
+ We first overview text style transfer, which aims to transfer a text (typically a single sentence or a short paragraph – for simplicity we refer to simply “sentences” below) from one domain to another while preserving underlying content. For example, formality transfer (Rao & Tetreault, 2018) is the task of transforming the tone of text from informal to formal without changing its content. Other examples include sentiment transfer (Shen et al., 2017), word decipherment (Knight et al., 2006), and author imitation (Xu et al., 2012). If parallel examples were available from each domain (i.e. the training data is a bitext consisting of pairs of sentences from each domain), supervised techniques could be used to perform style transfer (e.g. attentional Seq2Seq (Bahdanau et al., 2015) and Transformer (Vaswani et al., 2017)). However, for most style transfer problems, only non-parallel corpora (one corpus from each domain) can be easily collected. Thus, work on style transfer typically focuses on the more difficult unsupervised setting where systems must learn from non-parallel data alone.
24
+
25
+ The model we propose treats an observed non-parallel text corpus as a partially observed parallel corpus. Thus, we introduce notation for both observed text inputs and those that we will treat as latent variables. Specifically, we let $X = \{ x ^ { ( 1 ) } , x ^ { ( 2 ) } , \cdot \cdot \cdot , x ^ { ( \bar { m } ) } \}$ represent observed data from domain $\mathcal { D } _ { 1 }$ , while we let $Y = \{ y ^ { ( m + 1 ) } , y ^ { ( m + \overset { \cdot } { 2 } ) } , \cdot \cdot \cdot , y ^ { ( n ) } \}$ represent observed data from domain $\mathcal { D } _ { 2 }$ . Corresponding indices represent parallel sentences. Thus, none of the observed sentences share indices. In our model, we introduce latent sentences to complete the parallel corpus. Specifically, $\bar { X } = \{ \bar { x } ^ { ( m + 1 ) } , \bar { x } ^ { ( m + 2 ) } , \cdot \cdot \cdot , \bar { x } ^ { ( n ) } \}$ represents the set of latent parallel sentences in $\mathcal { D } _ { 1 }$ , while $\bar { Y } = \{ \bar { y } ^ { ( 1 ) } , \bar { y } ^ { ( 2 ) } , \cdot \cdot \cdot , \bar { y } ^ { ( m ) } \}$ represents the set of latent parallel sentences in $\mathcal { D } _ { 2 }$ . Then the goal of unsupervised text transduction is to infer these latent variables conditioned the observed non-parallel corpora; that is, to learn $p ( { \bar { y } } | x )$ and $p ( { \bar { x } } | y )$ .
26
+
27
+ ![](images/41384ec1945473ca58fdedb371d1e2b9339b296d94ddeac4f8b18385ad392414.jpg)
28
+ Figure 1: Proposed graphical model for style transfer via bitext completion. Shaded circles denote the observed variables and unshaded circles denote the latents. The generator is parameterized as an encoder-decoder architecture and the prior on the latent variable is a pretrained language model.
29
+
30
+ # 3 THE DEEP LATENT SEQUENCE MODEL
31
+
32
+ First we present our generative model of bitext, which we refer to as a deep latent sequence model.
33
+ We then describe unsupervised learning and inference techniques for this model class.
34
+
35
+ # 3.1 MODEL STRUCTURE
36
+
37
+ Directly modeling $p ( { \bar { y } } | x )$ and $p ( { \bar { x } } | y )$ in the unsupervised setting is difficult because we never directly observe parallel data. Instead, we propose a generative model of the complete data that defines a joint likelihood, $p ( X , { \bar { X } } , Y , { \bar { Y } } )$ . In order to perform text transduction, the unobserved halves can be treated as latent variables: they will be marginalized out during learning and inferred via posterior inference at test time.
38
+
39
+ Our model assumes that each observed sentence is generated from an unobserved parallel sentence in the opposite domain, as depicted in Figure 1. Specifically, each sentence $\boldsymbol { x } ^ { ( i ) }$ in domain $\mathcal { D } _ { 1 }$ is generated as follows: First, a latent sentence $\bar { y } ^ { ( i ) }$ in domain $\mathcal { D } _ { 2 }$ is sampled from a prior, $p _ { { D _ { 2 } } } ( \bar { y } ^ { ( i ) } )$ . Then, $x ^ { ( i ) }$ is sampled conditioned on $\bar { y } ^ { ( i ) }$ from a transduction model, $p ( \boldsymbol { x } ^ { ( i ) } | \bar { y } ^ { ( i ) } )$ . Similarly, each observed sentence $y ^ { ( j ) }$ in domain $\mathcal { D } _ { 2 }$ is generated conditioned on a latent sentence, $\bar { x } ^ { ( j ) }$ , in domain $\mathcal { D } _ { 1 }$ via the opposite transduction model, $p ( \boldsymbol { y } ^ { ( j ) } | \bar { x } ^ { ( j ) } )$ , and prior, $p _ { \mathcal { D } _ { 1 } } ( \bar { x } ^ { ( j ) } )$ . We let $\theta _ { x | \bar { y } }$ and $\theta _ { y | \bar { x } }$ represent the parameters of the two transduction distributions respectively. We assume the prior distributions are pretrained on the observed data in their respective domains and therefore omit their parameters for simplicity of notation. Together, this gives the following joint likelihood:
40
+
41
+ $$
42
+ p ( X , \bar { X } , Y , \bar { Y } ; \theta _ { x | \bar { y } } , \theta _ { y | \bar { x } } ) = \left( \prod _ { i = 1 } ^ { m } p \big ( x ^ { ( i ) } | \bar { y } ^ { ( i ) } ; \theta _ { x | \bar { y } } \big ) p _ { \mathcal { D } _ { 2 } } \big ( \bar { y } ^ { ( i ) } \big ) \right) \left( \prod _ { j = m + 1 } ^ { n } p \big ( y ^ { ( j ) } | \bar { x } ^ { ( j ) } ; \theta _ { y | \bar { x } } \big ) p _ { \mathcal { D } _ { 1 } } \big ( \bar { x } ^ { ( j ) } \big ) \right)
43
+ $$
44
+
45
+ The log marginal likelihood of the data, which we will approximate during training, is:
46
+
47
+ $$
48
+ \log p ( X , Y ; \theta _ { x | \bar { y } } , \theta _ { y | \bar { x } } ) = \log \sum _ { \bar { X } } \sum _ { \bar { Y } } p ( X , \bar { X } , Y , \bar { Y } ; \theta _ { x | \bar { y } } , \theta _ { y | \bar { x } } )
49
+ $$
50
+
51
+ Note that if the two transduction models share no parameters, the training problems for each observed domain are independent. Critically, we introduce parameter sharing through our variational inference procedure, which we describe in more detail in Section 3.2.
52
+
53
+ Architecture: Since we would like to be able to model a variety of transfer tasks, we choose a parameterization for our transduction distributions that makes no independence assumptions. Specifically, we employ an encoder-decoder architecture based on the standard attentional Seq2Seq model which has been shown to be successful across various tasks (Bahdanau et al., 2015; Rush et al., 2015). Similarly, our prior distributions for each domain are parameterized as recurrent language models which, again, make no independence assumptions. In contrast, traditional unsupervised generative sequence models typically make strong independence assumptions to enable exact inference (e.g. the HMM makes a Markov assumption on the latent sequence and emissions are one-to-one). Our model is more flexible, but exact inference via dynamic programming will be intractable. We address this problem in the next section.
54
+
55
+ ![](images/465557888fae2116dee1e4e4dd348b9e4d1230bed6a6f3b67479bcd78b680d54.jpg)
56
+ Figure 2: Depiction of amortized variational approximation. Distributions $q ( { \bar { y } } | x )$ and $q ( { \bar { x } } | y )$ represent inference networks that approximate the model’s true posterior. Critically, parameters are shared between the generative model and inference networks to tie the learning problems for both domains.
57
+
58
+ # 3.2 LEARNING
59
+
60
+ Ideally, learning should directly optimize the log data likelihood, which is the marginal of our model shown in Eq. 2. However, due to our model’s neural parameterization which does not factorize, computing the data likelihood cannot be accomplished using dynamic programming as can be done with simpler models like the HMM. To overcome the intractability of computing the true data likelihood, we adopt amortized variational inference (Kingma & Welling, 2013) in order to derive a surrogate objective for learning, the evidence lower bound (ELBO) on log marginal likelihood3 :
61
+
62
+ $$
63
+ \begin{array} { r l } & { \log p ( X , Y ; \theta _ { x | \bar { y } } , \theta _ { y | \bar { x } } ) } \\ & { \ge \mathcal { L } _ { \mathrm { E L B O } } ( X , Y ; \theta _ { x | \bar { y } } , \theta _ { y | \bar { x } } , \phi _ { \bar { x } | y } , \phi _ { \bar { y } | x } ) } \\ & { = \sum _ { i } \Big [ \mathbb { E } _ { q ( \bar { y } | x ^ { ( i ) } ; \phi _ { \bar { y } | x } ) } [ \log p ( x ^ { ( i ) } | \bar { y } ; \theta _ { x | \bar { y } } ) ] - D _ { \mathrm { K L } } \big ( q ( \bar { y } | x ^ { ( i ) } ; \phi _ { \bar { y } | x } ) | | p _ { \mathcal { D } _ { 2 } } ( \bar { y } ) \big ) \Big ] } \\ & { + \sum _ { j } \underbrace { \Big [ \mathbb { E } _ { q ( \bar { x } | y ^ { ( j ) } ; \phi _ { \bar { x } | y } ) } [ \log p ( y ^ { ( j ) } | \bar { x } ; \theta _ { y | \bar { x } } ) ] } _ { \mathrm { R e c o n s t u c i o n ~ l i k e l i h o o d } } - \underbrace { D _ { \mathrm { K L } } \big ( q ( \bar { x } | y ^ { ( j ) } ; \phi _ { \bar { x } | y } ) \big ) | p _ { \bar { D } _ { 1 } } ( \bar { x } ) \big ) } _ { \mathrm { K L ~ r e g u l a r i z e r } } \Big ] } \end{array}
64
+ $$
65
+
66
+ The surrogate objective introduces $q ( \bar { y } | x ^ { ( i ) } ; \phi _ { \bar { y } | x } )$ and $q ( \bar { x } | y ^ { ( j ) } ; \phi _ { \bar { x } | y } )$ , which represent two separate inference network distributions that approximate the model’s true posteriors, $p ( \bar { y } | x ^ { ( i ) } ; \theta _ { x | \bar { y } } )$ and $p ( \bar { x } | y ^ { ( j ) } ; \theta _ { y | \bar { x } } )$ , respectively. Learning operates by jointly optimizing the lower bound over both variational and model parameters. Once trained, the variational posterior distributions can be used directly for style transfer. The KL terms in Eq. 3, that appear naturally in the ELBO objective, can be intuitively viewed as regularizers that use the language model priors to bias the induced sentences towards the desired domains. Amortized variational techniques have been most commonly applied to continuous latent variables, as in the case of the variational autoencoder (VAE) (Kingma & Welling, 2013). Here, we use this approach for inference over discrete sequences, which has been shown to be effective in related work on a semi-supervised task (Miao & Blunsom, 2016).
67
+
68
+ Inference Network and Parameter Sharing: Note that the approximate posterior on one domain aims to learn the reverse style transfer distribution, which is exactly the goal of the generative distribution in the opposite domain. For example, the inference network $\bar { q } ( \bar { y } | x ^ { ( i ) } ; \phi _ { \bar { y } | x } )$ and the generative distribution $p ( y | \bar { x } ^ { ( i ) } ; \theta _ { y | \bar { x } } )$ both aim to transform $\mathcal { D } _ { 1 }$ to $\mathcal { D } _ { 2 }$ . Therefore, we use the same architecture for each inference network as used in the transduction models, and tie their parameters: $\phi _ { \bar { x } | y } = \theta _ { x | \bar { y } } , \phi _ { \bar { y } | x } = \theta _ { y | \bar { x } }$ . This means we learn only two encoder-decoders overall – which are parameterized by $\theta _ { x | \bar { y } }$ and $\theta _ { y | \bar { x } }$ respectively – to represent two directions of transfer. In addition to reducing the number of learnable parameters, this parameter tying couples the learning problems for both domains and allows us to jointly learn from the full data. Moreover, inspired by recent work that builds a universal Seq2Seq model to translate between different language pairs (Johnson et al., 2017), we introduce further parameter tying between the two directions of transduction: the same encoder is employed for both $x$ and $y$ , and a domain embedding $c$ is provided to the same decoder to specify the transfer direction, as shown in Figure 2. Ablation analysis in Section 5.3 suggests that parameter sharing is important to achieve good performance.
69
+
70
+ Approximating Gradients of ELBO: The reconstruction and KL terms in Eq. 3 still involve intractable expectations due to the marginalization over the latent sequence, thus we need to approximate their gradients. Gumbel-softmax (Jang et al., 2017) and REINFORCE (Sutton et al., 2000) are often used as stochastic gradient estimators in the discrete case. Since the latent text variables have an extremely large domain, we find that REINFORCE-based gradient estimates result in high variance. Thus, we use the Gumbel-softmax straight-through estimator to backpropagate gradients from the KL terms.4 However, we find that approximating gradients of the reconstruction loss is much more challenging – both the Gumbel-softmax estimator and REINFORCE are unable to outperform a simple stop-gradient method that does not back-propagate the gradient of the latent sequence to the inference network. This confirms a similar observation in previous work on unsupervised machine translation (Lample et al., 2018). Therefore, we use greedy decoding without recording gradients to approximate the reconstruction term.5 Note that the inference networks still receive gradients from the prior through the KL term, and their parameters are shared with the decoders which do receive gradients from reconstruction. We consider this to be the best empirical compromise at the moment.
71
+
72
+ Initialization. Good initialization is often necessary for successful optimization of unsupervised learning objectives. In preliminary experiments, we find that the encoder-decoder structure has difficulty generating realistic sentences during the initial stages of training, which usually results in a disastrous local optimum. This is mainly because the encoder-decoder is initialized randomly and there is no direct training signal to specify the desired latent sequence in the unsupervised setting. Therefore, we apply a self-reconstruction loss $\mathcal { L } _ { \mathrm { r e c } }$ at the initial epochs of training. We denote the output the encoder as $e ( \cdot )$ and the decoder distribution as $p _ { \mathrm { d e c } }$ , then
73
+
74
+ $$
75
+ \mathcal { L } _ { \mathrm { { r e c } } } = - \alpha \cdot \sum _ { i } [ p _ { \mathrm { d e c } } ( e ( x ^ { ( i } ) , c _ { x } ) ] - \alpha \cdot \sum _ { j } [ p _ { \mathrm { d e c } } ( e ( y ^ { ( j } ) , c _ { y } ) ] ,
76
+ $$
77
+
78
+ $\alpha$ decays from 1.0 to 0.0 linearly in the first $k$ epochs. $k$ is a tunable parameter and usually less than 3 in all our experiments.
79
+
80
+ # 4 CONNECTION TO RELATED WORK
81
+
82
+ Our probabilistic formulation can be connected with recent advances in unsupervised text transduction methods. For example, back translation loss (Sennrich et al., 2016) plays an important role in recent unsupervised machine translation (Artetxe et al., 2018; Lample et al., 2018; Artetxe et al., 2019) and unsupervised style transfer systems (Lample et al., 2019). In order to incorporate back translation loss the source language $x$ is translated to the target language $y$ to form a pseudo-parallel corpus, then a translation model from $y$ to $x$ can be learned on this pseudo bitext just as in supervised setting. While back translation was often explained as a data augmentation technique, in our probabilistic formulation it appears naturally with the ELBO objective as the reconstruction loss term.
83
+
84
+ Some previous work has incorporated a pretrained language models into neural semi-supervised or unsupervised objectives. He et al. (2016) uses the log likelihood of a pretrained language model as the reward to update a supervised machine translation system with policy gradient. Artetxe et al. (2019) utilize a similar idea for unsupervised machine translation. Yang et al. (2018) employed a similar approach, but interpret the LM as an adversary, training the generator to fool the LM. We show how our ELBO objective is connected with these more heuristic LM regularizers by expanding the KL loss term (assume $x$ is observed):
85
+
86
+ $$
87
+ D _ { \mathrm { K L } } ( q ( \bar { y } | x ) | | p _ { \mathcal { D } _ { 2 } } ( \bar { y } ) ) = - H _ { q } - \mathbb { E } _ { q } [ \log p _ { \mathcal { D } _ { 2 } } ( \bar { y } ) ] ,
88
+ $$
89
+
90
+ Note that the loss used in previous work does not include the negative entropy term, $- H _ { q }$ . Our objective results in this additional “regularizer”, the negative entropy of the transduction distribution, $- H _ { q }$ . Intuitively, $- H _ { q }$ helps avoid a peaked transduction distribution, preventing the transduction from constantly generating similar sentences to satisfy the language model. In experiments we will show that this additional regularization is important and helps bypass bad local optima and improve performance. These important differences with past work suggest that a probabilistic view of the unsupervised sequence transduction may provide helpful guidance in determining effective training objectives.
91
+
92
+ # 5 EXPERIMENTS
93
+
94
+ We test our model on five style transfer tasks: sentiment transfer, word substitution decipherment, formality transfer, author imitation, and related language translation. For completeness, we also evaluate on the task of general unsupervised machine translation using standard benchmarks.
95
+
96
+ We compare with the unsupervised machine translation model (UNMT) which recently demonstrated state-of-the-art performance on transfer tasks such as sentiment and gender transfer (Lample et al., 2019).6 To validate the effect of the negative entropy term in the KL loss term Eq. 5, we remove it and train the model with a back-translation loss plus a language model negative log likelihood loss (which we denote as $_ { \mathrm { B T + N L L } }$ ) as an ablation baseline. For each task, we also include strong baseline numbers from related work if available. For our method we select the model with the best validation ELBO, and for UNMT or $_ { \mathrm { B T + N L L } }$ we select the model with the best back-translation loss. Complete model configurations and hyperparameters can be found in Appendix A.1.
97
+
98
+ # 5.1 DATASETS AND EXPERIMENT SETUP
99
+
100
+ Word Substitution Decipherment. Word decipherment aims to uncover the plain text behind a corpus that was enciphered via word substitution where word in the vocabulary is mapped to a unique type in a cipher dictionary (Dou & Knight, 2012; Shen et al., 2017; Yang et al., 2018). In our formulation, the model is presented with a non-parallel corpus of English plaintext and the ciphertext. We use the data in (Yang et al., 2018) which provides 200K sentences from each domain. While previous work (Shen et al., 2017; Yang et al., 2018) controls the difficulty of this task by varying the percentage of words that are ciphered, we directly evaluate on the most difficult version of this task $- 1 0 0 \%$ of the words are enciphered (i.e. no vocabulary sharing in the two domains). We select the model with the best unsupervised reconstruction loss, and evaluate with BLEU score on the test set which contains 100K parallel sentences. Results are shown in Table 2.
101
+
102
+ Sentiment Transfer. Sentiment transfer is a task of paraphrasing a sentence with a different sentiment while preserving the original content. Evaluation of sentiment transfer is difficult and is still an open research problem (Mir et al., 2019). Evaluation focuses on three aspects: attribute control, content preservation, and fluency. A successful system needs to perform well with respect to all three aspects. We follow prior work by using three automatic metrics (Yang et al., 2018; Lample et al., 2019): classification accuracy, self-BLEU (BLEU of the output with the original sentence as the reference), and the perplexity (PPL) of each system’s output under an external language model. We pretrain a convolutional classifier (Kim, 2014) to assess classification accuracy, and use an LSTM language model pretrained on each domain to compute the PPL of system outputs.
103
+
104
+ We use the Yelp reviews dataset collected by Shen et al. (2017) which contains 250K negative sentences and 380K positive sentences. We also use a small test set that has 1000 human-annotated parallel sentences introduced in Li et al. (2018). We denote the positive sentiment as domain $\mathcal { D } _ { 1 }$ and the negative sentiment as domain $\mathcal { D } _ { 2 }$ . We use Self-BLEU and BLEU to represent the BLEU score of the output against the original sentence and the reference respectively. Results are shown in Table 1.
105
+
106
+ Formality Transfer. Next, we consider a harder task of modifying the formality of a sequence. We use the GYAFC dataset (Rao & Tetreault, 2018), which contains formal and informal sentences from two different domains. In this paper, we use the Entertainment and Music domain, which has about 52K training sentences, 5K development sentences, and 2.5K test sentences. This dataset actually contains parallel data between formal and informal sentences, which we use only for evaluation. We follow the evaluation of sentiment transfer task and test models on three axes. Since the test set is a parallel corpus, we only compute reference BLEU and ignore self-BLEU. We use $\mathcal { D } _ { 1 }$ to denote formal text, and $\mathcal { D } _ { 2 }$ to denote informal text. Results are shown in Table 1.
107
+
108
+ Table 1: Results on the sentiment transfer, author imitation, and formality transfer. We list the PPL of pretrained LMs on the test sets of both domains. We only report Self-BLEU on the sentiment task to compare with existing work.
109
+
110
+ <table><tr><td>Task</td><td>Model</td><td>Acc.</td><td>BLEU</td><td>Self-BLEU</td><td>PPLD1</td><td>PPLD2</td></tr><tr><td rowspan="7">Sentiment</td><td>Test Set</td><td>-</td><td>-</td><td>-</td><td>31.97</td><td>21.87</td></tr><tr><td>Shen et al. (2017)</td><td>79.50</td><td>6.80</td><td>12.40</td><td>50.40</td><td>52.70</td></tr><tr><td>Hu et al. (2017)</td><td>87.70</td><td>-</td><td>65.60</td><td>115.60</td><td>239.80</td></tr><tr><td>Yang et al. (2018)</td><td>83.30</td><td>13.40</td><td>38.60</td><td>30.30</td><td>42.10</td></tr><tr><td>UNMT</td><td>87.17</td><td>16.99</td><td>44.88</td><td>26.53</td><td>35.72</td></tr><tr><td>BT+NLL</td><td>88.36</td><td>12.36</td><td>31.48</td><td>8.75</td><td>12.82</td></tr><tr><td>Ours</td><td>87.90</td><td>18.67</td><td>48.38</td><td>27.75</td><td>35.61</td></tr><tr><td rowspan="4">AuthorImitation</td><td>Test Set</td><td>-</td><td>-</td><td>-</td><td>132.95</td><td>85.25</td></tr><tr><td>UNMT</td><td>80.23</td><td>7.13</td><td>=</td><td>40.11</td><td>39.38</td></tr><tr><td>BT+NLL</td><td>76.98</td><td>10.80</td><td>=</td><td>61.70</td><td>65.51</td></tr><tr><td>Ours</td><td>81.43</td><td>10.81</td><td>=</td><td>49.62</td><td>44.86</td></tr><tr><td rowspan="4">Formality</td><td>Test Set</td><td>-</td><td>-</td><td>-</td><td>71.30</td><td>135.50</td></tr><tr><td>UNMT</td><td>78.06</td><td>16.11</td><td>-</td><td>26.70</td><td>10.38</td></tr><tr><td>BT+NLL</td><td>82.43</td><td>8.57</td><td></td><td>6.57</td><td>8.21</td></tr><tr><td>Ours</td><td>80.46</td><td>18.54</td><td>-</td><td>22.65</td><td>17.23</td></tr></table>
111
+
112
+ Author Imitation. Author imitation is the task of paraphrasing a sentence to match another author’s style. The dataset we use is a collection of Shakespeare’s plays translated line by line into modern English. It was collected by $\mathrm { X u }$ et al. $( 2 0 1 2 ) ^ { 7 }$ and used in prior work on supervised style transfer (Jhamtani et al., 2017). This is a parallel corpus and thus we follow the setting in the formality transfer task. We use $\mathcal { D } _ { 1 }$ to denote modern English, and $\mathcal { D } _ { 2 }$ to denote Shakespeare-style English. Results are shown in Table 1.
113
+
114
+ Related Language Translation. Next, we test our method on a challenging related language translation task (Pourdamghani & Knight, 2017; Yang et al., 2018). This task is a natural test bed for unsupervised sequence transduction since the goal is to preserve the meaning of the source sentence while rewriting it into the target language. For our experiments, we choose Bosnian (bs) and Serbian (sr) as the related language pairs. We follow Yang et al. (2018) to report BLEU-1 score on this task since BLEU-4 score is close to zero. Results are shown in Table 2.
115
+
116
+ Unsupervised MT. In order to draw connections with a related work on general unsupervised machine translation, we also evaluate on the WMT’16 German English translation task. This task is substantially more difficult than the style transfer tasks considered so far. We compare with the state-of-the-art UNMT system using the existing implementation from the XLM codebase,8 and implement our approach in the same framework with XLM initialization for fair comparison. We train both systems on 5M non-parallel sentences from each language. Results are shown in Table 2.
117
+
118
+ In Tables 1 we also list the PPL of the test set under the external LM for both the source and target domain. PPL of system outputs should be compared to PPL of the test set itself because extremely low PPL often indicates that the generated sentences are short or trivial.
119
+
120
+ Table 2: BLEU for decipherment, related language translation (Sr-Bs), and general unsupervised translation (En-De).
121
+
122
+ <table><tr><td>Model</td><td>Decipher</td><td>Sr-Bs</td><td>Bs-Sr</td><td>En-De</td><td>De-En</td></tr><tr><td>Shen et al. (2017)</td><td>50.8</td><td>1</td><td>-</td><td></td><td>1</td></tr><tr><td>Yang et al. (2018)</td><td>49.3</td><td>31.0</td><td>33.4</td><td>1</td><td>-</td></tr><tr><td>UNMT</td><td>76.4</td><td>31.4</td><td>33.4</td><td>26.5</td><td>32.2</td></tr><tr><td>BT+NLL</td><td>78.0</td><td>29.6</td><td>31.4</td><td>-</td><td>-</td></tr><tr><td>Ours</td><td>78.4</td><td>36.2</td><td>38.3</td><td>26.9</td><td>32.0</td></tr></table>
123
+
124
+ # 5.2 RESULTS
125
+
126
+ Tables 1 and 2 demonstrate some general trends. First, UNMT is able to outperform
127
+
128
+ other prior methods in unsupervised text style transfer, such as (Yang et al., 2018; Hu et al., 2017; Shen et al., 2017). The performance improvements of UNMT indicate that flexible and powerful architectures are crucial (prior methods generally do not have an attention mechanism). Second, our model achieves comparable classification accuracy to UNMT but outperforms it in all style transfer tasks in terms of the reference-BLEU, which is the most important metric since it directly measures the quality of the final generations against gold parallel data. This indicates that our method is both effective and consistent across many different tasks. Finally, the $_ { \mathrm { B T + N L L } }$ baseline is sometimes quite competitive, which indicates that the addition of a language model alone can be beneficial. However, our method consistently outperforms the simple $_ { \mathrm { B T + N L L } }$ method, which indicates the effectiveness of the additional entropy regularizer in Eq. 5 that is the byproduct of our probabilistic formulation.
129
+
130
+ Next, we examine the PPL of the system outputs under pretrained domain LMs, which should be evaluated in comparison with the PPL of the test set itself. For both the sentiment transfer and the formality transfer tasks in Table 1, $_ { \mathrm { B T + N L L } }$ achieves extremely low PPL, lower than the PPL of the test corpus in the target domain. After a close examination of the output, we find that it contains many repeated and overly simple outputs. For example, the system generates many examples of “I love this place” when transferring negative to positive sentiment (see Appendix A.3 for examples). It is not surprising that such a trivial output has low perplexity, high accuracy, and low BLEU score. On the other hand, our system obtains reasonably competitive PPL, and our approach achieves the highest accuracy and higher BLEU score than the UNMT baseline.
131
+
132
+ # 5.3 FURTHER ABLATIONS AND ANALYSIS
133
+
134
+ Parameter Sharing. We also conducted an experiment on the word substitution decipherment task, where we remove parameter sharing (as explained in Section 3.2) between two directions of transduction distributions, and optimize two encoder-decoder instead. We found that the model only obtained an extremely low BLEU score and failed to generate any meaningful outputs.
135
+
136
+ Performance vs. Domain Divergence. Figure 3 plots the relative improvement of our method over UNMT with respect to accuracy of a naive Bayes’ classifier trained to predict the domain of test sentences. Tasks with high classification accuracy likely have more divergent domains. We can see that for decipherment and en-de translation, where the domains have different vocabularies and thus are easily distinguished, our method yields a smaller gain over UNMT This likely indicates that the (discrimination) regularization effect of the LM priors is less importan or necessary when the two domains are very different.
137
+
138
+ ![](images/6aa4e4f10b2de0917d9d783c828a8253cd750d1fcca6b0c6f71251a7ffedc9ff.jpg)
139
+ Figure 3: Improvement over UNMT vs. classification accuracy.
140
+
141
+ Why does the proposed model outperform UNMT? Finally, we examine in detail the output of our model and UNMT for the author imitation task. We pick this task because the reference outputs for the test set are provided, aiding analysis. Examples shown in Table 3 demonstrate that UNMT tends to make overly large changes to the source so that the original meaning is lost, while our method is better at preserving the content of the source sentence. Next, we quantitatively examine the outputs from UNMT and our method by comparing the F1 measure of words bucketed by their syntactic tags. We use the open-sourced compare-mt tool (Neubig et al., 2019), and the results are shown in Figure 4. Our system has outperforms UNMT in all word categories. In particular, our system is much better at generating nouns, which likely leads to better content preservation.
142
+
143
+ Table 3: Examples for author imitation task
144
+
145
+ <table><tr><td>Methods</td><td>Shakespeare to Modern</td></tr><tr><td>Source</td><td>Not to his father&#x27;s .</td></tr><tr><td>Reference</td><td>Not to his father&#x27;s house.</td></tr><tr><td>UNMT</td><td>Not to his brother .</td></tr><tr><td>Ours</td><td>Not to his father&#x27;s house .</td></tr><tr><td>Source</td><td>Send thy man away .</td></tr><tr><td>Reference</td><td>Send your man away.</td></tr><tr><td>UNMT</td><td>Send an excellent word .</td></tr><tr><td>Ours</td><td>Send your man away.</td></tr><tr><td>Source</td><td>Why should you fall into so deep an O ?</td></tr><tr><td>Reference</td><td>Why should you fall into so deep a moan ?</td></tr><tr><td>UNMT</td><td>Why should you carry so nicely,but have your legs ?</td></tr><tr><td>Ours</td><td>Why should you fall into so deep a sin ?</td></tr></table>
146
+
147
+ ![](images/77998449f70906451fe5613ae7e9933a82e30c20a2ca545eabe27b26da8c75ef.jpg)
148
+ Figure 4: Word F1 score by POS tag.
149
+
150
+ Table 4: Comparison of gradient approximation on the sentiment transfer task.
151
+
152
+ <table><tr><td>Method</td><td>train ELBO个</td><td>test ELBO个</td><td>Acc.</td><td>BLEUr</td><td>BLEUs</td><td>PPLD1</td><td>PPLD2</td></tr><tr><td>Sample-based</td><td>-3.51</td><td>-3.79</td><td>87.90</td><td>13.34</td><td>33.19</td><td>24.55</td><td>25.67</td></tr><tr><td>Greedy</td><td>-2.05</td><td>-2.07</td><td>87.90</td><td>18.67</td><td>48.38</td><td>27.75</td><td>35.61</td></tr></table>
153
+
154
+ Table 5: Comparison of gradient propagation method on the sentiment transfer task.
155
+
156
+ <table><tr><td>Method</td><td>train ELBO↑</td><td>test ELBO个</td><td>Acc.</td><td>BLEUr</td><td>BLEUs</td><td>PPLD1</td><td>PPLD2</td></tr><tr><td>Gumbel Softmax</td><td>-2.96</td><td>-2.98</td><td>81.30</td><td>16.17</td><td>40.47</td><td>22.70</td><td>23.88</td></tr><tr><td>REINFORCE</td><td>-6.07</td><td>-6.48</td><td>95.10</td><td>4.08</td><td>9.74</td><td>6.31</td><td>4.08</td></tr><tr><td>Stop Gradient</td><td>-2.05</td><td>-2.07</td><td>87.90</td><td>18.67</td><td>48.38</td><td>27.75</td><td>35.61</td></tr></table>
157
+
158
+ Greedy vs. Sample-based Gradient Approximation. In our experiments, we use greedy decoding from the inference network to approximate the expectation required by ELBO, which is a biased estimator. The main purpose of this approach is to reduce the variance of the gradient estimator during training, especially in the early stages when the variance of sample-based approaches is quite high. As an ablation experiment on the sentiment transfer task we compare greedy and sample-based gradient approximations in terms of both train and test ELBO, as well as task performance corresponding to best test ELBO. After the model is fully trained, we find that the sample-based approximation has low variance. With a single sample, the standard deviation of the EBLO is less than 0.3 across 10 different test repetitions. All final reported ELBO values are all computed with this approach, regardless of whether the greedy approximation was used during training. The reported ELBO values are the evidence lower bound per word. Results are shown in Table 4, where the sampling-based training underperforms on both ELBO and task evaluations.
159
+
160
+ # 5.4 COMPARISON OF GRADIENT PROPAGATION METHODS
161
+
162
+ As noted above, to stabilize the training process, we stop gradients from propagating to the inference network from the reconstruction loss. Does this approach indeed better optimize the actual probabilistic objective (i.e. ELBO) or only indirectly lead to improved task evaluations? In this section we use sentiment transfer as an example task to compare different methods for propagating gradients and evaluate both ELBO and task evaluations.
163
+
164
+ Specifically, we compare three different methods:
165
+
166
+ • Stop Gradient: The gradients from reconstruction loss are not propagated to the inference network. This is the method we use in all previous experiments.
167
+ • Gumbel Softmax (Jang et al., 2017): Gradients from the reconstruction loss are propagated to the inference network with the straight-through Gumbel estimator.
168
+ • REINFORCE (Sutton et al., 2000): Gradients from reconstruction loss are propagated to the inference network with ELBO as a reward function. This method has been used in previous work for semi-supervised sequence generation (Miao & Blunsom, 2016; Yin et al., 2018), but often suffers from instability issues.
169
+
170
+ We report the train and test ELBO along with task evaluations in Table 5, and plot the learning curves on validation set in Figure 5.9 While being much simpler, we show that the stop-gradient trick produces superior ELBO over Gumbel Softmax and REINFORCE. This result suggests that stopping gradient helps better optimize the likelihood objective under our probabilistic formulation in comparison with other optimization techniques that propagate gradients, which is counter-intuitive. A likely explanation is that as a gradient estimator, while clearly biased, stop-gradient has substantially reduced variance. In comparison with other techniques that offer reduced bias but extremely high variance when applied to our model class (which involves discrete sequences as latent variables), stop-gradient actually leads to better optimization of our objective because it achieves better balance of bias and variance overall.
171
+
172
+ ![](images/d795400be20ee935fa9f0e734c9f8151789443d1144ec02f23fde88102bcb2d4.jpg)
173
+ Figure 5: ELBO on the validation set v.s. the number training steps.
174
+
175
+ # 6 CONCLUSION
176
+
177
+ We propose a probabilistic generative forumalation that unites past work on unsupervised text style transfer. We show that this probabilistic formulation provides a different way to reason about unsupervised objectives in this domain. Our model leads to substantial improvements on five text style transfer tasks, yielding bigger gains when the styles considered are more difficult to distinguish.
178
+
179
+ # ACKNOWLEDGEMENT
180
+
181
+ The work of Junxian He and Xinyi Wang is supported by the DARPA GAILA project (award HR00111990063) and the Tang Family Foundation respectively. The authors would like to thank Zichao Yang for helpful feedback about the project.
182
+
183
+ # REFERENCES
184
+
185
+ Mikel Artetxe, Gorka Labaka, Eneko Agirre, and Kyunghyun Cho. Unsupervised neural machine translation. In Proceedings of ICLR, 2018.
186
+
187
+ Mikel Artetxe, Gorka Labaka, and Eneko Agirre. An effective approach to unsupervised machine translation. arXiv preprint arXiv:1902.01313, 2019.
188
+
189
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of ICLR, 2015.
190
+
191
+ Colin Bannard and Chris Callison-Burch. Paraphrasing with bilingual parallel corpora. In Proceedings of ACL, 2005.
192
+
193
+ Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. In Proceedings of ConNLL, 2016.
194
+
195
+ Qing Dou and Kevin Knight. Dependency-based decipherment for resource-limited machine translation. Proceedings of EMNLP, 2012.
196
+
197
+ Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tie-Yan Liu, and Wei-Ying Ma. Dual learning for machine translation. In Proceedings of NeurIPS, 2016.
198
+
199
+ Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Toward controlled generation of text. In Proceedings of ICML, 2017.
200
+
201
+ Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. In Proceedings of ICLR, 2017.
202
+
203
+ Harsh Jhamtani, Varun Gangal, Edward Hovy, and Eric Nyberg. Shakespearizing modern language using copy-enriched sequence-to-sequence models. Proceedings of EMNLP, 2017.
204
+
205
+ Melvin Johnson, Mike Schuster, Quoc V Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viégas, Martin Wattenberg, Greg Corrado, et al. Google’s multilingual neural machine translation system: Enabling zero-shot translation. Transactions of the Association for Computational Linguistics, 2017.
206
+
207
+ Yoon Kim. Convolutional neural networks for sentence classification. In Proceedings of EMNLP, 2014.
208
+
209
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
210
+
211
+ Kevin Knight, Anish Nair, Nishit Rathod, and Kenji Yamada. Unsupervised analysis for decipherment problems. In Proceedings of the COLING/ACL 2006 Main Conference Poster Sessions, pp. 499– 506, 2006.
212
+
213
+ Guillaume Lample, Alexis Conneau, Ludovic Denoyer, and Marc’Aurelio Ranzato. Unsupervised machine translation using monolingual corpora only. arXiv preprint arXiv:1711.00043, 2017.
214
+
215
+ Guillaume Lample, Myle Ott, Alexis Conneau, Ludovic Denoyer, and Marc’Aurelio Ranzato. Phrasebased & neural unsupervised machine translation. arXiv preprint arXiv:1804.07755, 2018.
216
+
217
+ Guillaume Lample, Sandeep Subramanian, Eric Smith, Ludovic Denoyer, Marc’Aurelio Ranzato, and Y-Lan Boureau. Multiple-attribute text rewriting. In Proceedings of ICLR, 2019.
218
+
219
+ Juncen Li, Robin Jia, He He, and Percy Liang. Delete, retrieve, generate: A simple approach to sentiment and style transfer. arXiv preprint arXiv:1804.06437, 2018.
220
+
221
+ Yishu Miao and Phil Blunsom. Language as a latent variable: Discrete generative models for sentence compression. In Proceedings of EMNLP, 2016.
222
+
223
+ Ronen Mir, Bjarke Felbo, Nick Obradovich, and Iyad Rahwan. Evaluating style transfer for text. In Proceedings of NAACL, 2019.
224
+
225
+ Masahiro Mizukami, Graham Neubig, Sakriani Sakti, Tomoki Toda, and Satoshi Nakamura. Linguistic individuality transformation for spoken language. In Natural Language Dialog Systems and Intelligent Assistants. 2015.
226
+
227
+ Graham Neubig, Zi-Yi Dou, Junjie Hu, Paul Michel, Danish Pruthi, and Xinyi Wang. compare-mt: A tool for holistic comparison of language generation systems. In Meeting of the North American Chapter of the Association for Computational Linguistics (NAACL) Demo Track, Minneapolis, USA, June 2019. URL http://arxiv.org/abs/1903.07926.
228
+
229
+ Nima Pourdamghani and Kevin Knight. Deciphering related languages. Proceedings of EMNLP, 2017.
230
+
231
+ Sudha Rao and Joel Tetreault. Dear sir or madam, may i introduce the gyafc dataset: Corpus, benchmarks and metrics for formality style transfer. arXiv preprint arXiv:1803.06535, 2018.
232
+
233
+ Sujith Ravi and Kevin Knight. Deciphering foreign language. In Proceedings of ACL, 2011.
234
+
235
+ Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In Proceedings of EMNLP, 2015.
236
+
237
+ Rico Sennrich, Barry Haddow, and Alexandra Birch. Improving neural machine translation models with monolingual data. In Proceedings of ACL, 2016.
238
+
239
+ Claude Elwood Shannon. A mathematical theory of communication. Bell system technical journal, 27(3):379–423, 1948.
240
+
241
+ Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi Jaakkola. Style transfer from non-parallel text by cross-alignment. In Proceeings of NIPS, 2017.
242
+
243
+ Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Proceedings of NeurIPS, 2000.
244
+
245
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of NeurIPS, 2017.
246
+
247
+ Wei Xu, Alan Ritter, William B. Dolan, Ralph Grishman, and Cherry Colin. Paraphrasing for style. COLING, 2012.
248
+
249
+ Zichao Yang, Zhiting Hu, Chris Dyer, Eric P Xing, and Taylor Berg-Kirkpatrick. Unsupervised text style transfer using language models as discriminators. In Proceedings of NeurIPS, 2018.
250
+
251
+ Pengcheng Yin, Chunting Zhou, Junxian He, and Graham Neubig. Structvae: Tree-structured latent variable models for semi-supervised semantic parsing. In Proceedings of ACL, 2018.
252
+
253
+ Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. Learning discourse-level diversity for neural dialog models using conditional variational autoencoders. In Proceedings of ACL, 2017.
254
+
255
+ # A APPENDIX
256
+
257
+ # A.1 MODEL CONFIGURATIONS.
258
+
259
+ We adopt the following attentional encoder-decoder architecture for UNMT, $_ { \mathrm { B T + N L L } }$ , and our method across all the experiments:
260
+
261
+ • We use word embeddings of size 128.
262
+ • We use 1 layer LSTM with hidden size of 512 as both the encoder and decoder.
263
+ • We apply dropout to the readout states before softmax with a rate of 0.3.
264
+ • Following Lample et al. (2019), we add a max pooling operation over the encoder hidden states before feeding it to the decoder. Intuitively the pooling window size would control how much information is preserved during transduction. A window size of 1 is equivalent to standard attention mechanism, and a large window size corresponds to no attention. See Appendix A.2 for how to select the window size. There is a noise function for UNMT baseline in its denoising autoencoder loss (Lample et al., 2017; 2019), which is critical for its success. We use the default noise function and noise hyperparameters in Lample et al. (2017) when running the UNMT model. For $_ { \mathrm { B T + N L L } }$ and our method we found that adding the extra noise into the self-reconstruction loss (Eq. 4) is only helpful when the two domains are relatively divergent (decipherment and related language translation tasks) where the language models play a less important role. Therefore, we add the default noise from UNMT to Eq. 4 for decipherment and related language translation tasks only, and do not use any noise for sentiment, author imitation, and formality tasks.
265
+
266
+ # A.2 HYPERPARAMETER TUNING.
267
+
268
+ We vary pooling windows size as $\{ 1 , 5 \}$ , the decaying patience hyperparameter $k$ for selfreconstruction loss (Eq. 4) as $\{ 1 , 2 , 3 \}$ . For the baseliens UNMT and $_ { \mathrm { B T + N L L } }$ , we also try the option of not annealing the self-reconstruction loss at all as in the unsupervised machine translation task (Lample et al., 2018). We vary the weight $\lambda$ for the NLL term $_ \mathrm { B T + N L L } )$ or the KL term (our method) as $\{ 0 . 0 0 1 , 0 . 0 1 , 0 . 0 3 , 0 . 0 5 , 0 . 1 \}$ .
269
+
270
+ # A.3 SENTIMENT TRANSFER EXAMPLE OUTPUTS
271
+
272
+ We list some examples of the sentiment transfer task in Table 6. Notably, the $_ { \mathrm { B T + N L L } }$ method tends to produce extremely short and simple sentences.
273
+
274
+ # A.4 REPETITIVE EXAMPLES OF BT $^ +$ NLL
275
+
276
+ In Section 5 we mentioned that the baseline $_ { \mathrm { B T + N L L } }$ has a low perplexity for some tasks because it tends to generate overly simple and repetitive sentences. From Table 1 we see that two representative tasks are sentiment transfer and formatliy transfer. In Appendix A.3 we have demonstrated some examples for sentiment transfer, next we show some repetitive samples of $_ { \mathrm { B T + N L L } }$ in Table 7.
277
+
278
+ Table 6: Random Sentiment Transfer Examples
279
+
280
+ <table><tr><td>Methods</td><td>negative to positive</td></tr><tr><td>Original</td><td>the cake portion was extremely light and a bit dry .</td></tr><tr><td>UNMT</td><td>the cake portion was extremely light and a bit spicy .</td></tr><tr><td>BT+NLL</td><td>the cake portion was extremely light and a bit dry .</td></tr><tr><td>Ours</td><td>the cake portion was extremely light and a bit fresh .</td></tr><tr><td>Original</td><td>the “ chicken ” strip were paper thin oddly flavored strips .</td></tr><tr><td>UNMT</td><td>the“ chicken ”were extra crispy noodles were fresh and incredible .</td></tr><tr><td>BT+NLL</td><td>the service was great .</td></tr><tr><td>Ours</td><td>the“ chicken ”strip were paper sweet &amp; juicy flavored .</td></tr><tr><td>Original</td><td>if i could give them a zero star review i would !</td></tr><tr><td>UNMT</td><td> if i could give them a zero star review i would !</td></tr><tr><td>BT+NLL</td><td>i love this place .</td></tr><tr><td>Ours</td><td>i love the restaurant and give a great review i would !</td></tr><tr><td></td><td>positive to negative</td></tr><tr><td>Original</td><td> great food,staff is unbelievably nice .</td></tr><tr><td>UNMT BT+NLL</td><td>no ,food is n&#x27;t particularly friendly .</td></tr><tr><td>Ours</td><td>i will not be back .</td></tr><tr><td></td><td>no apologies,staff is unbelievably poor .</td></tr><tr><td>Original</td><td>my wife and i love coming here !</td></tr><tr><td>UNMT</td><td>my wife and i do n&#x27;t come here !</td></tr><tr><td>BT+NLL</td><td>i will not be back.</td></tr><tr><td>Ours</td><td>my wife and i walked out the last time .</td></tr><tr><td>Original</td><td>my wife and i love coming here !</td></tr><tr><td>UNMT</td><td>my wife and i do n&#x27;t come here !</td></tr><tr><td>BT+NLL</td><td>i will not be back .</td></tr><tr><td>Ours</td><td>my wife and i walked out the last time .</td></tr><tr><td>Original</td><td>the premier hookah lounge of las vegas !</td></tr><tr><td>UNMT</td><td>the worst museum of las vegas !</td></tr><tr><td>BT+NLL</td><td>the worst frame shop of las vegas !</td></tr><tr><td>Ours</td><td>the hallways scam lounge of las vegas !</td></tr></table>
281
+
282
+ Table 7: Repetitive examples of $\mathrm { B T + N L L }$ baseline on Formality transfer.
283
+
284
+ <table><tr><td>Original</td><td>Transferred</td></tr><tr><td colspan="2">formal to informal</td></tr><tr><td>I like Rhythm and Blue music .</td><td>I like her and I don&#x27;t know .</td></tr><tr><td>There&#x27;s nothing he needs to change .</td><td>I don&#x27;t know,but Idon&#x27;t know .</td></tr><tr><td>Ienjoy watching my companion attempt to role @-@ play with them.</td><td>Idon&#x27;tknow,but Idon&#x27;t know.</td></tr><tr><td>Iam watching it right now</td><td>Idon&#x27;t know,but Idon&#x27;t know .</td></tr><tr><td>That is the key point,that you fell asleep .</td><td>I don&#x27;t know,but Idon&#x27;t know.</td></tr><tr><td colspan="2">informal to formal</td></tr><tr><td>its a great source just download it .</td><td>I do not know,but Ido not know .</td></tr><tr><td>Happy Days,it was the coolest !</td><td>I do not know,butIdo not know.</td></tr><tr><td>I used to play flute but once I started sax,I got hooked .</td><td>I do not know,butIdo not know.</td></tr><tr><td>The word you are looking foris.... strengths</td><td>The word you are looking for is :)</td></tr><tr><td>Plus you can tell she really cared about her crew .</td><td>Plus you can tell she really cared about her crew.</td></tr></table>
md/train/HkeryxBtPB/HkeryxBtPB.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/HyesB2RqFQ/HyesB2RqFQ.md ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BRIDGING HMMS AND RNNS THROUGH ARCHITECTURAL TRANSFORMATIONS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ A distinct commonality between HMMs and RNNs is that they both learn hidden representations for sequential data. In addition, it has been noted that the backward computation of the Baum-Welch algorithm for HMMs is a special case of the back-propagation algorithm used for neural networks (Eisner (2016)). Do these observations suggest that, despite their many apparent differences, HMMs are a special case of RNNs? In this paper, we investigate a series of architectural transformations between HMMs and RNNs, both through theoretical derivations and empirical hybridization, to answer this question. In particular, we investigate three key design factors—independence assumptions between the hidden states and the observation, the placement of softmax, and the use of non-linearity—in order to pin down their empirical effects. We present a comprehensive empirical study to provide insights on the interplay between expressivity and interpretability with respect to language modeling and parts-of-speech induction.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Sequence is a common structure among many forms of naturally occurring data, including speech, text, video, and DNA. As such, sequence modeling has long been a core research problem across several fields of machine learning and AI. By far the most widely used approach for decades is the Hidden Markov Models of Baum & Eagon (1967); Jelinek et al. (1975), which assumes a sequence of discrete latent variables to generate a sequence of observed variables. When the latent variables are unobserved, unsupervised training of HMMs can be performed via the Baum-Welch algorithm (which, in turn, is based on the forward-backward algorithm), as a special case of ExpectationMaximization (EM) (Dempster et al. (1977)). Importantly, the discrete nature of the latent variables has the benefit of interpretability, as they recover contextual clustering of the output variables.
12
+
13
+ In contrast, Recurrent Neural Networks (RNNs), introduced later in the form of Jordan (1986) and Elman (1990) networks, assume continuous latent representations. Notably, unlike the hidden states of HMMs, there is no probabilistic interpretation of the hidden states of RNNs, regardless of their many different architectural variants (e.g. LSTMs of Hochreiter & Schmidhuber (1997), GRUs of Cho et al. (2014) and RANs of Lee et al. (2017)).
14
+
15
+ Despite their many apparent differences, both HMMs and RNNs model hidden representations for sequential data. At the heart of both models are: a state at time $t$ , a transition function $f : h _ { t - 1 } \to h _ { t }$ in latent space, and an emission function $g \ : \ h _ { t } \ \to \ x _ { t }$ . In addition, it has been noted that the backward computation in the Baum-Welch algorithm is a special case of back-propagation for neural networks (Eisner (2016)). Therefore, a natural question arises as to the fundamental relationship between HMMs and RNNs. Might HMMs be a special case of RNNs?
16
+
17
+ In this paper, we investigate a series of architectural transformations between HMMs and RNNs— both through theoretical derivations and empirical hybridization. In particular, we demonstrate that the forward marginal inference for an HMM—accumulating forward probabilities to compute the marginal emission and hidden state distributions at each time step—can be reformulated as equations for computing an RNN cell. In addition, we investigate three key design factors—independence assumptions between the hidden states and the observation, the placement of soft- max, and the use of non-linearity—in order to pin down their empirical effects.
18
+
19
+ Trans/Emit:
20
+
21
+ ![](images/57b8662677ea3422292eb7995e0d6de1f148536dd21a00c23ba11f9ff30ba49e.jpg)
22
+ Figure 1: Above each of the models we indicate the type of transition and emission cells used. H for HMM, R for RNN/Elman and F is a novel Fusion defined in $\ S 3 . 3$ . It is particularly important to understanding this work to track when a vector is a distribution (resides in a simplex) versus in the unit cube (e.g. after a sigmoid non-linearity). These cases are indicated by $\boldsymbol { \hat { \mathbf { \mathit { c } } } } _ { i }$ and $\mathrm { \ddot { ‰} }$ , respectively.
23
+
24
+ Our work is supported by several earlier works such as Wessels & Omlin (2000) and $\mathrm { W u }$ et al. (2016) that have also noted the connection between RNNs and HMMs (see $^ { \ S 7 }$ for more detailed discussion). Our contribution is to provide the first thorough theoretical investigation into the model variants, carefully controlling for every design choices, along with comprehensive empirical analysis over the spectrum of possible hybridization between HMMs and RNNs.
25
+
26
+ We find that the key elements to better performance of the HMMs are the use of a sigmoid instead of softmax linearity in the recurrent cell, and the use of an unnormalized output distribution matrix in the emission computation. On the other hand, multiplicative integration of the previous hidden state and input embedding, and intermediate normalizations in the cell computation are less consequential. We also find that HMM outperforms other RNNs variants for unsupervised prediction of the next POS tag, demonstrating the advantages of discrete bottlenecks for increased interpretability.
27
+
28
+ The rest of the paper is structured as follows. First, we present in §2 the derivation of HMM marginal inference as a special case of RNN computation. Next in $\ S 3$ , we explore a gradual transformation of HMMs into RNNs. In $\ S 4$ , we present the reverse transformation of Elman RNNs back to HMMs. Finally, building on these continua, we provide empirical analysis in $\ S 5$ and $\ S 6$ to pin point the empirical effects of varying design choices over the possible hybridization between HMMs and RNNs. We discuss related work in $^ { \ S 7 }$ and conclude in $\ S 8$ .
29
+
30
+ # 2 FORMULATING HMMS AS RECURRENT NEURAL NETWORKS
31
+
32
+ We start by defining HMMs as sequence models, together with the forward-backward algorithm which is used for inference. Then we show that, by rewriting the forward algorithm, the computation can be viewed as updating a hidden state at each time step by feeding the previous word prediction, and then computing the next word distribution, similar to the way RNNs are structured. The resulting architecture corresponds to the first cell in Figure 1.
33
+
34
+ # 2.1 MODEL DEFINITION
35
+
36
+ Let $\mathbf { x } ^ { ( 1 : n ) } = \{ \mathbf { x } ^ { ( 1 ) } , \ldots , \mathbf { x } ^ { ( n ) } \}$ be a sequence of random variables, where each $\mathbf { X }$ is drawn from a vocabulary $\mathbb { V }$ of size $v$ , and an instance $\mathbf { X }$ is represented as an integer $w$ or a one-hot vector ${ e ^ { ( w ) } }$ , where $w$ corresponds to an index in $\mathbb { V }$ . 1 We also define a corresponding sequence of hidden variables $\mathbf { h } ^ { ( 1 : n ) } = \{ \mathbf { h } ^ { ( 1 ) } , \ldots , \mathbf { h } ^ { ( n ) } \}$ , where $\mathtt { h } \in \{ 1 , 2 , \dots m \}$ . The distribution $P ( \mathbf { x } )$ is defined by
37
+
38
+ marginalizing over $\mathbf { h }$ , and factorizes as follows:
39
+
40
+ $$
41
+ P ( \mathbf { x } ) = \sum _ { \mathbf { h } } P ( \mathbf { x } , \mathbf { h } ) = \sum _ { \mathbf { h } } P ( \mathbf { h } ^ { ( 1 ) } ) p ( \mathbf { x } ^ { ( 1 ) } | \mathbf { h } ^ { ( 1 ) } ) \prod _ { i = 2 } ^ { n } P ( \mathbf { h } ^ { ( i ) } | \mathbf { h } ^ { ( i - 1 ) } ) P ( \mathbf { x } ^ { ( i ) } | \mathbf { h } ^ { ( i ) } )
42
+ $$
43
+
44
+ We define the hidden state distribution, referred to as the transition distribution, as
45
+
46
+ $$
47
+ \begin{array} { r l } & { P ( \mathrm { h } ^ { ( i ) } | \mathrm { h } ^ { ( i - 1 ) } = l ) = \mathrm { s o f t m a x } ( W _ { l , : } + b ) , W \in \mathbb R ^ { m \times m } , \boldsymbol { b } \in \mathbb R ^ { m } } \\ & { \qquad P ( \mathrm { h } ^ { ( 1 ) } ) = \mathrm { s o f t m a x } ( \displaystyle \sum _ { l } W _ { l , : } ^ { \top } + b ) , } \end{array}
48
+ $$
49
+
50
+ and the emission (output) distribution as
51
+
52
+ $$
53
+ p ( \mathbf { x } ^ { ( i ) } | \mathbf { h } ^ { ( i ) } = k ) = \mathrm { s o f t m a x } ( \mathbf { { E } } _ { k , : } + d ) , E \in \mathbb { R } ^ { m \times v } , d \in \mathbb { R } ^ { v } .
54
+ $$
55
+
56
+ # 2.2 INFERENCE
57
+
58
+ Inference for HMMs (marginalizing over the hidden states to compute the observed sequence probabilities) is performed with the forward-backward algorithm. The backward algorithm is equivalent to automatically differentiating the forward algorithm Eisner (2016). Therefore, while traditional HMM implementations had to implement both the forward and backward algorithm, and train the model with the EM algorithm, we only implement the forward algorithm in standard deep learning software, and perform end-to-end minibatched SGD training, efficiently parallelized on the GPU.
59
+
60
+ Let $\pmb { w } = \{ w ^ { ( 1 ) } , \dots , w ^ { ( n ) } \}$ be the observed sequence, and $\mathbf { \Delta } _ { w } ( i )$ the one-hot representation of $w ^ { ( i ) }$ The forward probabilities $\textbf { \em a }$ are defined recurrently (i.e., sequentially recursively) as
61
+
62
+ $$
63
+ \begin{array} { l } { { \displaystyle a _ { k } ^ { ( i ) } = P ( { \bf h } ^ { ( i ) } = k , { \bf x } ^ { ( 1 : i ) } = w ^ { ( 1 : i ) } ) } , \ ~ } \\ { { \displaystyle ~ = P ( { \bf x } ^ { ( i ) } = w ^ { ( i ) } | { \bf h } ^ { ( i ) } = k ) \sum _ { l = 1 } ^ { m } a _ { l } ^ { ( i - 1 ) } P ( { \bf h } ^ { ( i ) } = k | { \bf h } ^ { ( i - 1 ) } = l ) } . } \end{array}
64
+ $$
65
+
66
+ This can be rewritten by defining
67
+
68
+ $$
69
+ \begin{array} { r l } & { \mathbf { \boldsymbol { \mathsf { c } } } ^ { ( i ) } = P ( \mathsf { h } ^ { ( i ) } | \mathbf { \boldsymbol { \mathsf { x } } } ^ { ( 1 : i - 1 ) } = \boldsymbol { \mathsf { \pmb { w } } } ^ { ( 1 : i - 1 ) } ) , } \\ & { \mathbf { \boldsymbol { \mathsf { s } } } ^ { ( i ) } = P ( \mathsf { h } ^ { ( i ) } | \mathbf { \boldsymbol { \mathsf { x } } } ^ { ( 1 : i ) } = \boldsymbol { \mathsf { w } } ^ { ( 1 : i ) } ) , } \\ & { \mathbf { \boldsymbol { \mathsf { x } } } ^ { ( i ) } = P ( \mathbf { \boldsymbol { \mathsf { x } } } ^ { ( i ) } = \boldsymbol { \mathsf { w } } ^ { ( i ) } | \mathbf { \boldsymbol { \mathsf { x } } } ^ { ( 1 : i - 1 ) } = \boldsymbol { \mathsf { w } } ^ { ( 1 : i ) } ) , } \end{array}
70
+ $$
71
+
72
+ and substituting $\textbf { \em a }$ , so that equation 6 is rewritten as (left below) or if expressed directly in terms of the parameters used to define the distributions with vectorized computations (right below):
73
+
74
+ $$
75
+ \begin{array} { r l r l } & { c _ { k } ^ { ( i ) } = \displaystyle \sum _ { l = 1 } ^ { m } s _ { l } ^ { ( i - 1 ) } P ( { \bf h } ^ { ( i ) } = k | { \bf h } ^ { ( i - 1 ) } = l ) , \quad } & & { c ^ { ( i ) } = \mathrm { s o f t m a x } _ { \mathrm { r o w s } } ( W ) ^ { \top } s ^ { ( i - 1 ) } , } \\ & { } & & \\ & { } & & { e ^ { ( i ) } = \mathrm { s o f t m a x } _ { \mathrm { r o w s } } ( E ) { \pmb w } ^ { ( i ) } , } \\ & { x ^ { ( i ) } = \displaystyle \sum _ { k = 1 } ^ { m } P ( { \bf x } ^ { ( i ) } = w ^ { ( i ) } | { \bf h } ^ { ( i ) } = k ) c _ { k } ^ { ( i ) } , \quad } & & { x ^ { ( i ) } = e ^ { ( i ) ^ { \top } } c ^ { ( i ) } , } \\ & { } & & \\ & { s _ { k } ^ { ( i ) } = \displaystyle \frac { 1 } { x ^ { ( i ) } } P ( { \bf x } ^ { ( i ) } = w ^ { ( i ) } | { \bf h } ^ { ( i ) } = k ) c _ { k } ^ { ( i ) } . \quad } & & { s ^ { ( i ) } = \displaystyle \frac { 1 } { x ^ { ( i ) } } e ^ { ( i ) } \circ c ^ { ( i ) } . } \end{array}
76
+ $$
77
+
78
+ Here $\mathbf { \Delta } _ { w } ( i )$ used as a one-hot vector, and the bias vectors $^ { b }$ and $^ d$ are omitted for clarity. Note that the computation of $\mathbf { \boldsymbol { s } } ^ { ( i ) }$ can be delayed until time step $i + 1$ . The computation step can therefore be
79
+
80
+ rewritten to let $^ c$ be the recurrent vector (equivalent logspace formulations presented on the right): 2
81
+
82
+ $$
83
+ \begin{array} { r l r l } & { e ^ { ( i - 1 ) } = \mathrm { s o f t m a x } _ { \mathrm { r o w s } } ( E ) w ^ { ( i - 1 ) } , } & & { = \mathrm { l o g s o f t m a x } _ { \mathrm { r o w s } } ( E ) w ^ { ( i - 1 ) } , } \\ & { s ^ { ( i - 1 ) } = \mathrm { n o r m a l i z e } ( e ^ { ( i - 1 ) } \circ c ^ { ( i - 1 ) } ) , } & & { = \mathrm { s o f t m a x } ( e ^ { ( i - 1 ) } + c ^ { ( i - 1 ) } ) , } \\ & { \pmb { c } ^ { ( i ) } = \mathrm { s o f t m a x } _ { \mathrm { r o w s } } ( W ) ^ { \top } \pmb { s } ^ { ( i - 1 ) } , } & & { = \mathrm { l o g } ( \mathrm { s o f t m a x } _ { \mathrm { r o w s } } ( W ) ^ { \top } \pmb { s } ^ { ( i - 1 ) } ) , } \\ & { e ^ { ( i ) } = \mathrm { s o f t m a x } _ { \mathrm { r o w s } } ( E ) \pmb { w } ^ { ( i ) } , } & & { = \mathrm { l o g s o f t m a x } _ { \mathrm { r o w s } } ( E ) \pmb { w } ^ { ( i ) } , } \\ & { \pmb { x } ^ { ( i ) } = e ^ { ( i ) ^ { \top } } \pmb { c } ^ { ( i ) } , } & & { = \mathrm { l o g s u m e x p } ( e ^ { ( i ) } + c ^ { ( i ) } ) . } \end{array}
84
+ $$
85
+
86
+ This can be viewed as a step of a recurrent neural network with tied input and output embeddings: Equation 14 embeds the previous prediction, equations 15 and 16, the transition step, updates the hidden state $^ c$ , corresponding to the cell of a RNN, and equations 17 and 18, the emission step, computes the output next word probability.
87
+
88
+ We can now compare this formulation against the definition of a Elman RNN with tied embeddings and a sigmoid non-linearity. These equations correspond to the first and last cells in Figure 1. The Elman RNN has the same parameters, except for an additional input matrix $U \in \mathbb { R } ^ { m \times m }$ .
89
+
90
+ $$
91
+ \begin{array} { l } { { \pmb { c } } ^ { ( i ) } = \sigma ( { \pmb { W } } { \pmb { c } } ^ { ( i - 1 ) } + { \pmb { U } } { \pmb { e } } ^ { ( i - 1 ) } ) , } \\ { { \pmb { x } } ^ { ( i ) } = \mathrm { s o f t m a x } ( { \pmb { E } } { \pmb { c } } ^ { ( i ) } ) { \pmb { w } } ^ { ( i ) } . } \end{array}
92
+ $$
93
+
94
+ # 3 TRANSFORMING AN HMM TOWARDS AN RNN
95
+
96
+ Having established the relation between HMMs and RNNs, we propose a number of models that we hypothesize have intermediate expressiveness between HMMs and RNNs. The architecture transformations can be seen in the first 3 cells in Figure 1. We will evaluate these model variants empirically, and also investigate their interpretability.
97
+
98
+ # 3.1 CONDITIONING TRANSITION PROBABILITY ON PREVIOUS WORD
99
+
100
+ By relaxing the independence assumption of the HMM transition probability distribution we can increase the expressiveness of the HMM “cell” by modelling more complex interactions between the fed word and the hidden state.
101
+
102
+ # Tensor-based feeding:
103
+
104
+ Following Tran et al. (2016) we define the transition distribution as
105
+
106
+ $$
107
+ P ( \mathbf { h } ^ { ( i ) } | \mathbf { h } ^ { ( i - 1 ) } = l , \mathbf { x } ^ { ( i - 1 ) } = w ) = \mathrm { s o f t m a x } ( \pmb { W } _ { l , : } e ^ { ( i - 1 ) } + \pmb { B } _ { l , : } ) ,
108
+ $$
109
+
110
+ where $\pmb { \mathsf { W } } \in \mathbb { R } ^ { m \times m \times m } , \pmb { B } \in \mathbb { R } ^ { m \times m }$
111
+
112
+ # Addition-based feeding:
113
+
114
+ As the tensor-based methods increases the number of parameters considerably, we also propose an additive version:
115
+
116
+ $$
117
+ P ( \mathbf { h } ^ { ( i ) } | \mathbf { h } ^ { ( i - 1 ) } = l , \mathbf { x } ^ { ( i - 1 ) } = w ) = \mathrm { s o f t m a x } ( W _ { l , : } + U e ^ { ( i - 1 ) } + b ) ,
118
+ $$
119
+
120
+ where $W \in \mathbb { R } ^ { m \times m } , U \in \mathbb { R } ^ { m \times m } , b \in \mathbb { R } ^ { m }$
121
+
122
+ # Gating-based feeding:
123
+
124
+ Finally we propose a more expressive model where interaction is controlled via a gating mechanism and the feeding step uses unnormalized embeddings (this does not violate the HMM factorization):
125
+
126
+ $$
127
+ \begin{array} { c } { e ^ { ' ( i - 1 ) } = E \pmb { w } ^ { ( i - 1 ) } , } \\ { \pmb { f } ^ { i } = \sigma ( U e ^ { ' ( i - 1 ) } + \pmb { b } ) , } \\ { P ( \mathbf { h } ^ { ( i ) } | \mathbf { h } ^ { ( i - 1 ) } = l , \mathbf { x } ^ { ( i - 1 ) } = w ) = \mathrm { s o f t m a x } ( W _ { l , : } \circ \pmb { f } ^ { ( i ) } ) , } \end{array}
128
+ $$
129
+
130
+ where $U \in \mathbb { R } ^ { m \times m } , \boldsymbol { b } \in \mathbb { R } ^ { m } , W \in \mathbb { R } ^ { m \times m }$
131
+
132
+ # 3.2 DELAYED SOFTMAXES
133
+
134
+ Another way to make HMMs more expressive is to relax their independence assumptions through delaying when vectors are normalized to probability distributions by applying the softmax function.
135
+
136
+ # Delayed transition softmax
137
+
138
+ The computation of the recurrent vector $\pmb { c } ^ { ( i ) } = P ( \mathbf { h } ^ { ( i ) } | \mathbf { x } ^ { ( 1 : i - 1 ) } )$ is replaced with
139
+
140
+ $$
141
+ \pmb { c } ^ { ( i ) } = \mathrm { s o f t m a x } ( \pmb { W } \pmb { s } ^ { ( i - 1 ) } ) .
142
+ $$
143
+
144
+ Both $^ c$ and $\pmb { s }$ are still valid probability distributions, but the independence assumption in the distribution over $\mathrm { h } ^ { ( i ) }$ no longer holds.
145
+
146
+ # Delayed emission softmax
147
+
148
+ A further transformation is to delay the emission softmax until after multiplication with the hidden vector. This effectively replaces the HMM’s emission computation with that of the RNN:
149
+
150
+ $$
151
+ \boldsymbol { x } ^ { ( i ) } = \mathrm { s o f t m a x } ( E \boldsymbol { c } ^ { ( i ) } ) \boldsymbol { w } ^ { ( i ) } .
152
+ $$
153
+
154
+ This formulation breaks the independence assumption that the output distribution is only conditioned on the hidden state assignment. Instead it can be viewed as taking the expectation over the (unnormalized) embeddings with respect to the state distribution $^ c$ , then softmaxed $\mathbf { H } \mathbf { R }$ in Fig 1).
155
+
156
+ # 3.3 SIGMOID NON-LINEARITY
157
+
158
+ We can go further towards RNNs and replace the softmax in the transition by a sigmoid non-linearity. The sigmoid is placed in the same position as the delayed softmax. The recurrent state $^ c$ is no longer a distribution so the output has to be renormalized so the emission still computes a distribution:
159
+
160
+ $$
161
+ \begin{array} { l } { { \pmb { c } } ^ { ( i ) } = \mathrm { s i g m o i d } ( { \pmb { W } } { \pmb { s } } ^ { ( i - 1 ) } ) , } \\ { { \pmb { x } } ^ { ( i ) } = { \pmb { e } } ^ { ( i ) ^ { \top } } \mathrm { n o r m a l i z e } ( { \pmb { c } } ^ { ( i ) } ) . } \end{array}
162
+ $$
163
+
164
+ This model could also be combined with a delayed emission softmax - which we’ll see makes it closer to an Elman RNN. This model is indicated as $\mathbf { F }$ for fusion in Figure 1
165
+
166
+ # 4 TRANSFORMING AN RNN TOWARDS AN HMM
167
+
168
+ Analogously to making the HMM more similar to Elman RNNs, we can make Elman networks more similar to HMMs. Examples of these transformations can be seen in the last 2 cells in Figure 1.
169
+
170
+ # 4.1 HMM EMISSION
171
+
172
+ First, we use the Elman cell with an HMM emission. This requires the hidden state be a distribution, thus we consider two options. One is to replace the sigmoid non-linearity with the softmax function:
173
+
174
+ $$
175
+ \begin{array} { r l } & { \pmb { c } ^ { ( i ) } = \mathrm { s o f t m a x } ( \pmb { W } \pmb { c } ^ { ( i - 1 ) } + \pmb { U } \pmb { e } ^ { ( i - 1 ) } ) } \\ & { \pmb { x } ^ { ( i ) } = ( \mathrm { s o f t m a x } ( \pmb { E } ) \pmb { w } ^ { ( i ) } ) ^ { \top } \pmb { c } ^ { ( i ) } . } \end{array}
176
+ $$
177
+
178
+ This model is depicted as $\textbf { R H }$ in Figure 1. The second formulation is to keep the sigmoid nonlinearity, but normalize the hidden state output in the emission computation:
179
+
180
+ $$
181
+ \begin{array} { r l } & { \pmb { c } ^ { ( i ) } = \sigma ( \pmb { W } \pmb { c } ^ { ( i - 1 ) } + \pmb { U } \pmb { e } ^ { ( i - 1 ) } ) } \\ & { \pmb { x } ^ { ( i ) } = ( \mathrm { s o f t m a x } ( \pmb { E } ) \pmb { w } ^ { ( i ) } ) ^ { \top } \mathrm { n o r m a l i z e } ( \pmb { c } ^ { ( i ) } ) . } \end{array}
182
+ $$
183
+
184
+ # 4.2 MULTIPLICATIVE INTEGRATION
185
+
186
+ In the HMM cell, the integration of the previous recurrent state and the input embedding is modelled through an element-wise product instead of adding affine transformations of the two vectors. We can modify the Elman cell to do a similar multiplicative integration:3
187
+
188
+ $$
189
+ \pmb { c } ^ { ( i ) } = \sigma ( ( W \pmb { c } ^ { ( i - 1 ) } ) \circ ( U \pmb { e } ^ { ( i - 1 ) } ) ) )
190
+ $$
191
+
192
+ Or, using a single transformation matrix:
193
+
194
+ $$
195
+ \pmb { c } ^ { ( i ) } = \sigma ( \pmb { W } ( \pmb { c } ^ { ( i - 1 ) } \circ e ^ { ( i - 1 ) } ) )
196
+ $$
197
+
198
+ # 4.3 SOFTMAX NON-LINEARITY
199
+
200
+ Finally, and most extreme, we experiment with replacing the sigmoid non-linearity with a softmax:
201
+
202
+ $$
203
+ \pmb { c } ^ { ( i ) } = \mathrm { s o f t m a x } ( \pmb { W } \pmb { c } ^ { ( i - 1 ) } + \pmb { U } \pmb { e } ^ { ( i - 1 ) } )
204
+ $$
205
+
206
+ And a more flexible variant, where the softmax is applied only to compute the emission distribution, while the sigmoid non-linearity is still applied to recurrent state:
207
+
208
+ $$
209
+ \begin{array} { r l } & { \pmb { c } ^ { ( i ) } = ( \pmb { W \sigma } ( \pmb { c } ^ { ( i - 1 ) } ) + \pmb { U e } ^ { ( i - 1 ) } ) } \\ & { \pmb { x } ^ { ( i ) } = \mathrm { s o f t m a x } ( \pmb { E } \mathrm { s o f t m a x } ( \pmb { c } ^ { ( i ) } ) \pmb { w } ^ { ( i ) } ) . } \end{array}
210
+ $$
211
+
212
+ # 5 LANGUAGE MODELING EXPERIMENTS
213
+
214
+ Our formulations investigate a series of small architectural changes to HMMs and Elman cells. In particular, these changes raise questions about the expressivity and importance of (1) normalization within the recurrence and (2) independence assumptions during emission. In this section, we analyze the effects of these changes quantitatively via a standard language modeling benchmark.
215
+
216
+ # 5.1 SETUP
217
+
218
+ We follow the standard PTB language modeling setup Chelba & Jelinek (1998); Mikolov et al. (2011). We work with one-layer models to enable a direct comparison between RNNs and HMMs and a budget of 10 million parameters (typically corresponding to hidden state sizes of around 900). Models are trained with batched backpropagation through time (35 steps). Input and output embeddings are tied in all models.
219
+
220
+ Models are optimized with a grid search over optimizer parameters for two strategies: $\mathrm { S G D ^ { 4 } }$ and AMSProp. AMSProp is based on the optimization setup proposed by Melis et al. (2017).5
221
+
222
+ # 5.2 RESULTS
223
+
224
+ We see from the results in Table 1 (also depicted in Figure 2) that the HMM models perform significantly worse than the Elman network, as expected. Interestingly, many of the HMM variants that in principle have more expressivity or weaker independence assumptions do not perform better than the vanilla HMM. This includes delaying the transition or emission softmax, and most of the feeding models. The exception is the gated feeding model, which does substantially better, showing that Table 2gating is an effective way of incorporating more context into the transition matrix. Using a sigmoid Perplexity PTB UPOSnon-linearity before the output of the HMM cell (instead of a softmax) does improve performance (by $4 4 \mathrm { p p l } $ 288.15 45.16 61.66), and combining that with delaying the emission softmax gives a substantial improvement (almost another $1 0 0 \mathrm { p p l }$ 142.31 42.09 52.41), making it much closer to some of the RNN variants.
225
+
226
+ Table 1: Language Modeling Perplexity for our baseline and transformed models.5 4 284.59 225.366 5 287 207.95
227
+
228
+ <table><tr><td>Model</td><td>dev ppl</td><td>Model</td><td>dev ppl</td></tr><tr><td>HMM</td><td></td><td>Elman</td><td></td></tr><tr><td></td><td>284.59</td><td>-softmax,HMMemission</td><td>313.84</td></tr><tr><td>- Tensor feeding</td><td>288.15</td><td>-HMM emission</td><td>312.63</td></tr><tr><td>- Addition feeding</td><td>288.62</td><td>- softmax non-linearity</td><td>207.95</td></tr><tr><td>- Gated feeding</td><td>243.51</td><td>- normalize before emit</td><td>225.36</td></tr><tr><td>-Delayed transition softmax</td><td>284.59</td><td>- multiplicative (single matrix)</td><td>107.45</td></tr><tr><td>-Delayed emission softmax</td><td>287.00</td><td>- multiplicative</td><td>100.71</td></tr><tr><td>-Delayed transition and emission softmax</td><td>293.72</td><td></td><td>87.27</td></tr><tr><td>- Sigmoid non-linearity</td><td>240.91</td><td></td><td></td></tr><tr><td>- Sigmoid non-linearity,delayed emission softmax</td><td>142.31</td><td>LSTM</td><td>80.61</td></tr></table>
229
+
230
+ ![](images/c4b26ac64456719fce9b2c5a93981e316de3301ec22c05f2c75459cfa887607c.jpg)
231
+ Figure 2: This plot shows how perplexities change under our transformations, and which lead the models to converge and pass each other.
232
+
233
+ 207.95 36.68 48.5487.27 44.97 54.59We also evaluate variants of Elman RNNs: Just replacing the sigmoid non-linearity with the softmax 80.61 function leads to a substantial drop in performance $\mathrm { ( 1 2 0 ~ p p l ) }$ 55.08, although it still performs better than the HMM variants where the recurrent state is a distribution. Another way to investigate the effect of the softmax is to normalize the hidden state output just before applying the emission function, while keeping the sigmoid non-linearity: This performs somewhat worse than the softmax non-linearity, Table 2-1 PTB UPOSwhich indicates that it is significant whether the input to the emission function is normalized or softPerplexity PTB UPOSmaxed before multiplying with the (emission) embedding matrix. As a comparison for how much 288.15 45.16 61.66the softmax non-linearity acts as a bottleneck, a neural bigram model outperforms these approaches, 142.31 obtaining 177 validation perplexity on this same setup.
234
+
235
+ 207.95 36.68 48.54Replacing the RNN emission function with that of an HMM leads to even worse performance than 87.27 44.97 54.5980.61 45.75 55.08the HMM: Using a softmax non-linearity or a sigmoid followed by normalization does not make a significant difference. Using multiplicative integration leads to only a small drop in performance 25 50 125 200 275 3compared to a vanilla Elman RNN, and doing so with a single transformation matrix (making it comparable to what an RNN is doing) leads to only a small further drop. In contrast, preliminary experiments showed that the second transformation matrix is crucial in the performance of the vanilla Elman network.
236
+
237
+ In our experimental setup an LSTM performs only slightly better than the Elman network (80 vs 87 perplexity). While more extensive hyperparameter tuning Melis et al. (2017) or more sophisticated optimization and regularization techniques Merity et al. (2017) would likely improve performance, that is not the goal of this evaluation.
238
+
239
+ ![](images/23eab0de6949949e7364c9835bef1c628e3d3746cb3f3ef857fe9acc538ffabf.jpg)
240
+ Figure 3: Tagging accuracies (right) are plotted against perplexities from Table 1. We see a somewhat quadratic relationship.
241
+
242
+ <table><tr><td>Model</td><td>PTB</td><td>UPOS</td></tr><tr><td>HMM</td><td></td><td></td></tr><tr><td></td><td>52.36</td><td>68.23</td></tr><tr><td>- Tensor feeding</td><td>45.16</td><td>61.66</td></tr><tr><td>- Gated feeding</td><td>44.62</td><td>59.64</td></tr><tr><td>- Sigmoid non-linearity - Sigmoid non-linearity with</td><td>31.82</td><td>44.13</td></tr><tr><td>delayed emission softmax</td><td>42.09</td><td>52.41</td></tr><tr><td>Elman</td><td></td><td></td></tr><tr><td>- softmax,HMM emission</td><td>30.86</td><td>45.85</td></tr><tr><td>- softmax non-linearity</td><td>36.68</td><td>48.54</td></tr><tr><td>1</td><td>44.97</td><td>54.59</td></tr><tr><td>LSTM</td><td>45.75</td><td>55.08</td></tr></table>
243
+
244
+ Table 2: Tagging accuracies for several representative models. Accuracy is calculated by converting $p ( w )$ to $p ( t )$ according to WSJ tag distributions.
245
+
246
+ # 6 SYNTACTIC EVALUATION
247
+
248
+ A strength of HMM bottlenecks is forcing the model to produce an interpretable hidden representation. A classic example of this property is part-of-speech tag induction. It is therefore natural to ask whether changes in the architecture of our models correlate with their ability to discover syntactic properties. We evaluate this by analyzing the models implicitly predicted tag distribution at each time step. Specifically, while no model is likely to predict the correct next word, we assume the HMMs errors will preserve basic tag-tag patterns of the language, and that this may not be true for RNNs. We test this by computing the accuracy of predicting the tag of the word in the sequence out of the next word distribution. None of the models were trained to perform this task.
249
+
250
+ First, we compute a tag distribution $p ( t | w )$ for every word in the training portion of the Penn Treebank. Next, we multiply this value by the model’s $p ( w ) = \widehat { x } _ { i }$ , and sum across the vocabulary. This provides us the model’s distribution over tags at the given time $p ( t ) _ { i }$ . We compare the most likely marginal tag against the ground truth to compute a tagging accuracy. This evaluation rewards models which place their emission probability mass predominantly on words of the correct part-of-speech. We compute this metric across both the full PTB tagset and the universal tags of Petrov et al. (2012).
251
+
252
+ The HMM allows for Viterbi decoding which allows us to compute $p ( t | \mathrm { m a x } _ { \mathrm { d i m } } ( c _ { i } ) )$ . The more distributed the models’ representations are, the more the tag distribution given the max dimension will differ from the complete marginal. For HMMs with distributional hidden states the maximum dimension provided the best performance. In contrast, Elman models perform best when conditioned on the full hidden state. Results are shown in Table 2 and plotted against perplexity in Figure 3.6
253
+
254
+ # 7 RELATED WORK
255
+
256
+ Recently, a number of recent papers have identified variants of gated RNNs which are simpler than LSTMs but perform competitively or satisfy properties that LSTMs lack. Foerster et al. (2017) proposed RNNs without recurrent non-linearities to improve interpretability. Balduzzi & Ghifary (2016) proposed gated RNN variants with type constraints. Peng et al. (2018) identified a class of RNNs called rational recurrences, in which the hidden states can be computed by WFSAs.
257
+
258
+ Another strand of recent work proposed neural models that learn discrete, interpretable structure: Yang et al. (2017) introduced a mixture of softmax model where the output distribution is conditioned on discrete latent variable. Shen et al. (2017) proposed a language model that jointly learns unsupervised syntactic (tree) structure, while Tran et al. (2016) used neural hidden Markov models for Part-of-Speech induction. Wiseman et al. (2018) and Wang et al. (2017) proposed models for segmental structure over sequences, while neural transduction models with discrete latent alignments have also been proposed Yu et al. (2016).
259
+
260
+ # 8 CONCLUSION
261
+
262
+ In this work, we presented a theoretical and empirical investigation into the model variants over the spectrum of possible hybridization between HMMs and RNNs. By carefully controlling for every design choices, we provide new insights into several factors including independence assumptions, the placement of softmax, and the use of nonliniarity and how these choices influence the interplay between expressiveness and interpretability. Comprehensive empirical results demonstrate that the key elements to better performance of the HMM are the use of a sigmoid instead of softmax linearity in the recurrent cell, and the use of an unnormalized output distribution matrix in the emission computation. Multiplicative integration of the previous hidden state and input embedding, and intermediate normalizations in the cell computation are less consequential. We also find that HMM outperforms other RNNs variants in a next POS tag prediction task, which demonstrates the advantages of models with discrete bottlenecks in increased interpretability.
263
+
264
+ # REFERENCES
265
+
266
+ David Balduzzi and Muhammad Ghifary. Strongly-typed recurrent neural networks. CoRR, abs/1602.02218, 2016. URL http://arxiv.org/abs/1602.02218.
267
+
268
+ Leonard E. Baum and J. A. Eagon. An inequality with applications to statistical estimation for probabilistic functions of markov processes and to a model for ecology. Bulletin of the American Mathematical Society, 73(3):360 – 363, 1967.
269
+
270
+ Ciprian Chelba and Frederick Jelinek. Exploiting syntactic structure for language modeling. In Proceedings of the 36th Annual Meeting of the Association for Computational Linguistics and 17th International Conference on Computational Linguistics, Volume 1, pp. 225–231, Montreal, Quebec, Canada, August 1998. Association for Computational Linguistics. doi: 10.3115/980845. 980882. URL http://www.aclweb.org/anthology/P98-1035.
271
+
272
+ Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734, Doha, Qatar, October 2014. Association for Computational Linguistics.
273
+
274
+ A Dempster, N Laird, and D Rubin. Maximum likelihood from incomplete data via the em algorithm. 01 1977.
275
+
276
+ Jason Eisner. Inside-outside and forward-backward algorithms are just backprop (tutorial paper). In Proceedings of the Workshop on Structured Prediction for NLP, pp. 1–17, Austin, TX, November 2016. Association for Computational Linguistics. URL http://aclweb.org/ anthology/W16-5901.
277
+
278
+ J Elman. Finding structure in time. 14(2):179–211, 06 1990.
279
+
280
+ Jakob N Foerster, Justin Gilmer, Jascha Sohl-Dickstein, Jan Chorowski, and David Sussillo. Input switched affine networks: An rnn architecture designed for interpretability. In International Conference on Machine Learning, pp. 1136–1145, 2017.
281
+
282
+ Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT Press, 2016.
283
+
284
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
285
+
286
+ Frederick Jelinek, Lalit R. Bahl, and Robert L Mercer. Design of a linguistic statistical decoder for the recognition of continuous speech. IEEE Transactions on Information Theory, 21(3):250–256, May 1975.
287
+
288
+ Michael I Jordan. Serial order: A parallel distributed processsing approach. Technical report, University of California, San Diego, 1986.
289
+
290
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
291
+
292
+ Kenton Lee, Omer Levy, and Luke S Zettlemoyer. Recurrent additive networks. arXiv preprint arXiv:1705.07393, 05 2017.
293
+
294
+ Gabor Melis, Chris Dyer, and Phil Blunsom. On the state of the art of evaluation in neural language ´ models. arXiv preprint arXiv:1707.05589, 2017.
295
+
296
+ Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing LSTM language models. CoRR, abs/1708.02182, 2017. URL http://arxiv.org/abs/1708. 02182.
297
+
298
+ Toma´s Mikolov, Anoop Deoras, Stefan Kombrink, Luk ˇ a´s Burget, and Jan ˇ Cernock ˇ y. Empirical \` evaluation and combination of advanced language modeling techniques. In Twelfth Annual Conference of the International Speech Communication Association, 2011.
299
+
300
+ Hao Peng, Roy Schwartz, Sam Thomson, and Noah A. Smith. Rational recurrences. In Proc. of EMNLP, 2018.
301
+
302
+ Slav Petrov, Dipanjan Das, and Ryan McDonald. A universal part-of-speech tagset. In Proceedings of the Eighth International Conference on Language Resources and Evaluation (LREC-2012), pp. 2089–2096, Istanbul, Turkey, 05 2012.
303
+
304
+ Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. 2018.
305
+
306
+ Yikang Shen, Zhouhan Lin, Chin-Wei Huang, and Aaron C. Courville. Neural language modeling by jointly learning syntax and lexicon. CoRR, abs/1711.02013, 2017. URL http://arxiv. org/abs/1711.02013.
307
+
308
+ Ke M. Tran, Yonatan Bisk, Ashish Vaswani, Daniel Marcu, and Kevin Knight. Unsupervised neural hidden markov models. In Proceedings of the Workshop on Structured Prediction for NLP, pp. 63–71, Austin, TX, November 2016. Association for Computational Linguistics. URL http: //aclweb.org/anthology/W16-5907.
309
+
310
+ Chong Wang, Yining Wang, Po-Sen Huang, Abdelrahman Mohamed, Dengyong Zhou, and Li Deng. Sequence modeling via segmentations. arXiv preprint arXiv:1702.07463, 2017.
311
+
312
+ T Wessels and Christian W Omlin. Refining hidden markov models with recurrent neural networks. In Proceedings of the IEEE-INNS-ENNS International Joint Conference on Neural Networks, volume 2, pp. 271–276. IEEE, 2000.
313
+
314
+ Sam Wiseman, Stuart M Schieber, and Alexander M Rush. Learning neural templates for text generation. arXiv preprint arXiv:1808.10122, 08 2018.
315
+
316
+ Yuhuai Wu, Saizheng Zhang, Ying Zhang, Yoshua Bengio, and Ruslan R Salakhutdinov. On multiplicative integration with recurrent neural networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 2856–2864. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/ 6215-on-multiplicative-integration-with-recurrent-neural-networks. pdf.
317
+
318
+ Zhilin Yang, Zihang Dai, Ruslan Salakhutdinov, and William W Cohen. Breaking the softmax bottleneck: A high-rank rnn language model. arXiv preprint arXiv:1711.03953, 2017.
319
+
320
+ Lei Yu, Jan Buys, and Phil Blunsom. Online segment to segment neural transduction. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1307–1316, Austin, Texas, November 2016. Association for Computational Linguistics. URL https:// aclweb.org/anthology/D16-1138.
md/train/KOk7mUGspN9/KOk7mUGspN9.md ADDED
@@ -0,0 +1,571 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # On the Fundamental Trade-offs in Learning Invariant Representations
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ 1 Many applications of representation learning, such as privacy-preservation, al
11
+ 2 gorithmic fairness and domain adaptation, desire explicit control over semantic
12
+ 3 information being discarded. This goal is often formulated as satisfying two po
13
+ 4 tentially competing objectives: maximizing utility for predicting a target attribute
14
+ 5 while simultaneously being independent or invariant with respect to a known seman
15
+ 6 tic attribute. In this paper, we identify and determine two fundamental trade-offs
16
+ 7 between utility and semantic dependence induced by the statistical dependencies
17
+ 8 between the data and its corresponding target and semantic attributes. We derive
18
+ 9 closed-form solutions for the global optima of the underlying optimization prob
19
+ 10 lems under mild assumptions, which in turn yields closed formulae for the exact
20
+ 11 trade-offs. We also derive empirical estimates of the trade-offs and show their
21
+ 12 convergence to the corresponding population counterparts. Finally, we numeri
22
+ 13 cally quantify the trade-offs on representative problems and compare the solutions
23
+ 14 achieved by baseline representation learning algorithms.
24
+
25
+ # 15 1 Introduction
26
+
27
+ 16 Real-world applications of representation learning algorithms often have to contend with objectives
28
+ 17 beyond predictive performance. These include cost functions pertaining to, invariance (e.g., to
29
+ 18 photometric or geometric variations), semantic independence (e.g., w.r.t to age or race for face
30
+ 19 recognition systems), privacy (e.g., mitigating leakage of sensitive information [1]), algorithmic
31
+ 20 fairness (e.g., demographic parity [2]), and generalization across multiple domains [3], to name a few.
32
+ 21 At its core, the underlying goal of the aforementioned formulations of representation learning is to
33
+ 22 satisfy two competing objectives, extracting as much information necessary to predict a target label
34
+ 23 $\textbf { { y } }$ (e.g., face identity) while intentionally and permanently suppressing information pertaining to a
35
+ 24 desired semantic attribute $\pmb { s }$ (e.g., age, gender or race). When $\textbf { { y } }$ is independent of $\pmb { s }$ , one can learn a
36
+ 25 representation that is independent of $\pmb { s }$ with no loss of performance, i.e., no trade-off exists between
37
+ 26 the two objectives. However, when the two attributes $\textbf { { y } }$ and $\pmb { s }$ are correlated, attaining semantic
38
+ 27 independence will necessarily reduce the performance of the target predictor, i.e., there is a trade-off
39
+ 28 between the two objectives. The trade-off is unknown yet is important for understanding the limits of
40
+ 29 existing and future representation learning algorithms that involve semantic independence constraints.
41
+ 30 Let $z = f ( { \pmb x } )$ be a representation of input data $_ { \textbf { \em x } }$ , and $f ( \cdot )$ be the encoder (see Fig 1(a)). Invariant
42
+ 31 learning requires that prediction of the target label, ${ \widehat { \pmb { y } } } = g _ { Y } ( z )$ be independent of a semantic attribute
43
+ 32 $\pmb { s }$ i.e., $\boldsymbol { \widehat { y } } \perp \perp \boldsymbol { s }$ for all possible downstream target predictors $\overset { \cdot } { g _ { Y } ( \cdot ) }$ . This independence condition is
44
+ 33 satisfied if and only if (iff), the representation $_ z$ is independent of $\pmb { s }$ i.e., $z \perp \perp s$ . Therefore, Invariant
45
+ 34 representation learning (IRL) seeks to optimize two objectives: i) the degree of dependence between
46
+ 35 data representation $_ z$ and semantic attribute $\pmb { s }$ , and ii) target task utility. These two objectives can be
47
+ 36 combined into one, with a parameter $\tau$ controlling the trade-off.
48
+ 37 In this paper, we identify and analytically determine two fundamental trade-offs in the invariant
49
+ 38 representation learning setting introduced above, namely Data Space Trade-Off and Label Space
50
+ 39 Trade-Off. These trade-offs are illustrated in Figure 1 (b) and formally defined next.
51
+ 40 Definition 1. Data Space Trade-Off arises from the statistical dependence between the target attribute
52
+ 41 $\textbf { { y } }$ and the semantic attribute $\pmb { s }$ conditioned on the given input data $_ { \textbf { \em x } }$ . When the learner’s hypothesis
53
+ 42 class contains all Borel-measurable functions1 we have:
54
+
55
+ ![](images/4b41f619b913d0b024a06e9ffd146496a768341a1e6fc6bf1f8d3e1e0ad4349a.jpg)
56
+ Figure 1: (a): Generic frame work of invariant representation learning (IRL) where attributes $\pmb { s }$ and $\textbf { { y } }$ are caused by a latent factor $\textbf { \em a }$ and are not marginally independent. Under this setting, IRL seeks a representation $z = f ( { \pmb x } )$ that contains enough information for downstream target predictor $g _ { Y } ( \cdot )$ while being independent of the semantic attribute $\pmb { s }$ . Consequently, the prediction ${ \widehat { \pmb { y } } } = g _ { Y } ( z )$ will also be independent of $\pmb { s }$ for any downstream predictor $g _ { Y } ( \bar { \cdot } )$ . (b): We identify and determine two different fundamental trade-offs between utility (i.e., the performance of target task predictor) and dependence measure $\deg ( z , s )$ by an optimal learner in the hypothesis class of Borel-measurable functions. Trade-off $\mathbf { L }$ is induced by the joint distribution of the labels $p _ { y s }$ . Trade-off $\mathbf { D }$ is induced by the joint distribution of the data $p _ { { \pmb x } { \pmb y } { \pmb s } }$ . Trade-off $\mathbf { F }$ is a relaxed version of trade-off $\mathbf { D }$ obtained by either using a surrogate measure of dependence, e.g., adversarial learning [3] or from a constrained hypothesis class [4], or from using sub-optimal optimization algorithms.
57
+
58
+ $$
59
+ \operatorname* { i n f } _ { f ( \cdot ) \mathrm { ~ m e a s u r a b l e } } \Big \{ ( 1 - \tau ) \operatorname* { i n f } _ { g _ { Y } ( \cdot ) \mathrm { ~ m e a s u r a b l e } } \mathbb { E } _ { x , y } \Big [ \mathcal { L } _ { Y } \Big ( g _ { Y } \big ( f ( x ) ) , y \Big ) \Big ] + \tau \mathrm { d e p } ( f ( x ) , s ) \Big \} .
60
+ $$
61
+
62
+ 43 where $f ( \cdot )$ is the encoder that extracts representation $_ z$ from $_ { \textbf { \em x } }$ , $g _ { Y } ( \cdot )$ predicts $\widehat { \pmb { y } }$ from the repre
63
+ 44 sentation $_ z$ , $\mathcal { L } _ { Y } ( \cdot , \cdot )$ is the loss for the desired task of predicting the task label $\textbf { { y } }$ . The function
64
+ 45 $\mathrm { d e p } ( \cdot , \cdot ) \geq 0$ is a parametric or non-parametric measure of statistical dependence i.e., $\mathrm { d e p } ( q , r ) = 0$
65
+ 46 means $\pmb q$ and $\mathbfit { \Delta } \mathbf { r }$ are independent, and $\mathrm { d e p } ( q , r ) > 0$ means $\pmb q$ and $\pmb { r }$ are dependent with larger values
66
+ 47 indicating greater degrees of dependence. The scalar $\tau \in [ 0 , 1 )$ is a hyper-parameter that controls
67
+ 48 the trade-off between the two objectives, with $\tau = 0$ being the standard approach that enforces no
68
+ 49 independence to the attribute $\pmb { s }$ , while $\tau 1$ enforces representation $_ z$ to be independent of $\pmb { s }$ .
69
+ 50 Including all measurable functions in the hypothesis class of the encoder $f ( \cdot )$ and target predic
70
+ 51 tor $g _ { Y } ( \cdot )$ ensures that the best possible trade-off is included within the feasible solution space.
71
+ 52 For example, when $\tau = 0$ and $\bar { \mathcal { L } } _ { Y } ( \cdot , \cdot )$ is the mean-squared error, the optimal Bayes estimator,
72
+ 53 $g _ { Y } ( f ( \pmb { x } ) ) = \mathbb { E } _ { \pmb { y } } [ \pmb { y } | \pmb { x } ]$ is reachable. This definition corresponds to the trade-off $\mathbf { D }$ in Figure 1 (b).
73
+ 54 Definition 2. Label Space Trade- $O f f$ arises by ignoring the data $_ { \textbf { \em x } }$ and is purely determined by the
74
+ 55 statistical dependence between the target feature $\textbf { { y } }$ and the semantic attribute $\pmb { s }$ . Such a trade-off can
75
+ 56 be defined as:
76
+
77
+ $$
78
+ \operatorname* { i n f } _ { z \in L ^ { 2 } } \Big \{ ( 1 - \tau ) \operatorname* { i n f } _ { g _ { Y } ( \cdot ) \mathrm { ~ m e a s u r a b l e } } \mathbb { E } _ { x , y } \Big [ \mathcal { L } _ { Y } \big ( g _ { Y } ( z ) , y \big ) \Big ] + \tau \deg ( z , s \big ) \Big \} ,
79
+ $$
80
+
81
+ where 57 $L ^ { 2 }$ is the space of all random vectors with finite second-order moment (i.e., $\mathbb { E } _ { z } [ \| z \| ^ { 2 } ] < \infty$ ) 58 on the same probability space in which the joint variable $( s , y )$ comes from.
82
+
83
+ 59 This definition corresponds to the optimal trade-off obtained by an ideal representation $_ { z }$ that is not
84
+ 60 constrained by the learnability of the encoder $f ( \cdot )$ . For example, if $\tau = 0$ , the ideal representation
85
+ 61 $_ z$ is perfectly aligned with the target label $\textbf { { y } }$ i.e., $z = y$ and $g _ { Y } ( \cdot )$ is the identity function, perfect
86
+ 62 prediction of target attribute is feasible. Therefore, this trade-off corresponds to the best trade-off that
87
+ 63 any combination of data $_ { \textbf { \em x } }$ and learnable encoder $f ( \cdot )$ can aspire to. This definition corresponds to
88
+ 64 the trade-off $\mathbf { L }$ in Figure 1 (b), and it necessarily dominates the Data Space Trade-Off D.
89
+ 65 Contributions: i) Identify two fundamental trade-offs in invariant representation learning. ii) Obtain
90
+ 66 closed-form solution for the corresponding optimization problems, and consequently determine the
91
+ 67 trade-offs exactly. iii) Provide consistent empirical closed-form solution for the representations that
92
+ 68 achieve optimal trade-offs. iv) Numerically quantify the trade-offs defined here and compare them to
93
+ 69 those obtained by existing solutions.
94
+ 70 Implications: i) Our closed-form empirical estimators for the optimal representations lend themselves
95
+ 71 to practical invariant representation learning algorithms. ii) Theoretically elucidating and empirically
96
+ 72 quantifying the intrinsic limits of invariant representations will enable researchers and practitioners
97
+ 73 alike to identify the feasible and infeasible solution space for the trade-offs and lead to informed
98
+ 74 development and deployment of optimal IRL methods. iii) Our theoretical analysis sheds light on the
99
+ 75 utility-semantic independence trade-off, the role of statistical dependency between target label $\textbf { { y } }$ , the
100
+ 76 semantic attribute $\pmb { s }$ , and the input data $_ { \textbf { \em x } }$ , and the hypothesis class adopted for the learners.
101
+
102
+ # 77 2 Related Work
103
+
104
+ 78 Trade-Offs in Representation Learning: While there are abundant empirical approaches for the
105
+ 79 representation learning applications considered in this paper, to the best of our knowledge, there
106
+ 80 is no prior work that exactly characterizes and empirically quantifies the trade-offs inherent to
107
+ 81 representation learning with semantic independence constraints.
108
+ 82 Prior work primarily sought to either obtain lower or upper bounds or characterize the extreme
109
+ 83 points of the trade-off in specific contexts such as fair representation learning. For instance, [5]
110
+ 84 uses information theoretic tools and characterizes the utility-fairness trade-off in terms of a lower
111
+ 85 bounds when both $\textbf { { y } }$ and $\pmb { s }$ are binary labels. Later [6] provided both upper and lower bound for the
112
+ 86 binary labels. By leveraging Chernoff bound [7] proposed a construction method to generate an ideal
113
+ 87 representation beyond input data to achieve perfect fairness while maintaining the best performance
114
+ 88 on target task for equalized odds. In the case of categorical features, a lower bound on utility-fairness
115
+ 89 trade-off has been provided by [8]. The notion of Pareto optimality was used by [9] to minimize
116
+ 90 the maximum possible error among sensitive attributes where both target and sensitive features are
117
+ 91 categorical. In contrast to this body of work, our trade-off analysis is applicable to multi-dimensional
118
+ 92 discrete and/or continuous attributes where we find the exact optimal trade-offs.
119
+ 93 The only prior work that investigates fundamental trade-offs in a general setting where both $\textbf { { y } }$ and $\pmb { s }$
120
+ 94 can be continuous or discrete features, are [4] and [10]. [4] considers only linear dependence between
121
+ 95 the representation and semantic attribute and proposed a closed-form solution for the utility-fairness
122
+ 96 trade-off. Even though [10] considers non-linear dependencies, optimal losses have been derived only
123
+ 97 for the extremes of the trade-off (i.e., $\tau 0$ and $\tau 1$ ). In a more general setting where $0 < \tau < 1$
124
+ 98 [10] only provides a lower bound on utility-invariance trade-off through information plane analysis.
125
+ 99 In contrast to the foregoing, we take a functional analysis approach and utilize covariance operator
126
+ 100 based measures of dependence that account for all non-linear dependence relations. We exactly
127
+ 101 characterize and quantify the utility-invariance trade-offs, while also providing a means to empirically
128
+ 102 estimate the encoder that achieves said optimal trade-off. Lastly, in addition to the Data Space
129
+ 103 Trade-Off, we also introduce and determine the Label Space Trade-Off which is the ideal trade-off
130
+ 104 that any unrestricted learning algorithm can aspire to.
131
+ 105 Invariant, Fair, Privacy-Preserving Representation Learning: The basic idea of representation
132
+ 106 learning that discards unwanted semantic information has been explored under different contexts like
133
+ 107 invariant, fair, or privacy-preserving learning. In domain adaptation [11, 12, 13], the goal is to learn
134
+ 108 features that are independent of the data domain. In fair learning [14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
135
+ 109 2, 24, 25, 26, 27, 4], the goal is to discard the demographic information that leads to unfair outcomes.
136
+ 110 Similarly, there is a growing interest in mitigating unintended leakage of private information from
137
+ 111 data representations [28, 29, 1, 30, 31]. A vast majority of this body of work is empirical in nature.
138
+ 112 These methods implicitly look for a single or more points in the trade-off between utility and fairness
139
+ 113 and do not explicitly seek to characterize the whole trade-off front. Overall, these approaches are
140
+ 114 not concerned (or aware) about the feasibility and limitations on the utility-invariance trade-off. In
141
+ 115 contrast, this paper determines the fundamental theoretical limits of controlling independence to
142
+ 116 semantic attributes, and proposes practical learning algorithms that achieve this limit.
143
+ 117 Adversarial Representation Learning: Most practical approaches for learning fair, invariant, do
144
+ 118 main adaptive or privacy-preserving representations discussed above are based on adversarial repre
145
+ 119 sentation learning (ARL). This learning problem is typically formulated as,
146
+
147
+ $$
148
+ \operatorname* { i n f } _ { f \in \mathcal { H } _ { x } } \Big \{ ( 1 - \tau ) \operatorname* { i n f } _ { g \mathrm { y } \in \mathcal { H } _ { y } } \mathbb { E } _ { \mathbf { x } , y } \Big [ \mathcal { L } _ { Y } \Big ( g _ { Y } \big ( f ( x ) \big ) , y \Big ) \Big ] - \tau \operatorname* { i n f } _ { g _ { S } \in \mathcal { H } _ { s } } \mathbb { E } _ { \mathbf { x } , s } \Big [ \mathcal { L } _ { S } \Big ( g _ { S } \big ( f ( x ) \big ) , s \Big ) \Big ] \Big \} ,
149
+ $$
150
+
151
+ 120 where $\mathcal { L } _ { S } ( \cdot , \cdot )$ is the loss function of a hypothetical adversary $g _ { S } ( \cdot )$ who intends to extract the semantic
152
+ 121 attribute $\pmb { s }$ through the best predictor within the hypothesis class $\mathcal { H } _ { s }$ . ARL is a special case of the Data
153
+ 122 Space Trade-Off in (1) where the negative loss of the adversary, $- \operatorname* { i n f } _ { g _ { S } \in \mathcal { H } _ { s } } \mathbb { E } _ { { \pmb x } , s } \Big [ { \mathscr L } _ { S } \Big ( g _ { S } \big ( f ( { \pmb x } ) \big ) , s \Big ) \Big ]$
154
+ 123 plays the role of $\mathrm { d e p } ( f ( \pmb { x } ) , \pmb { s } )$ . However, this form of adversarial learning suffers from a fundamental
155
+ 124 drawback as also noted in [32, 33]. The measure of dependence induced by ARL does not account
156
+ 125 for all modes of non-linear dependence between $\pmb { s }$ and the representation $_ z$ . The next theorem states
157
+ 126 this observation precisely,
158
+ 127 Theorem 1. 2 Let $\mathcal { H } _ { s }$ contain all Borel-measurable functions and $\mathcal { L } _ { S } ( \cdot , \cdot )$ be mean squared error
159
+ 128 (MSE) loss. Then,
160
+
161
+ $$
162
+ z \in \arg \operatorname* { s u p } \left\{ \operatorname* { i n f } _ { \substack { g _ { S } \in \mathcal { H } _ { s } } } \mathbb { E } _ { \pmb { x } , s } \Big [ \mathcal { L } _ { S } \Big ( g _ { S } ( z ) , \pmb { s } \Big ) \Big ] \right\} \Leftrightarrow \mathbb { E } [ \pmb { s } | z ] = \mathbb { E } [ \pmb { s } ] .
163
+ $$
164
+
165
+ 129 This theorem implies that an optimal adversary does not necessarily lead to a representation $_ { z }$ that
166
+ 130 is statistically independent of $\pmb { s }$ (i.e., $p ( s | z ) \stackrel { } { = } p ( s ) \rangle$ ), but rather leads to $\pmb { s }$ being mean independent
167
+ 131 of representation $_ z$ i.e., independence with respect to first order moment only. In other words,
168
+ 132 adversarially learned measure of dependence is not a complete measure of dependence and hence
169
+ 133 does not account for all modes of non-linear dependence between two random variables. As such, ARL
170
+ 134 is inherently incapable of attaining the trade-offs achievable by complete measures of dependence.
171
+
172
+ # 35 3 Theoretical Results
173
+
174
+ # 3.1 Problem Setting
175
+
176
+ 137 Consider the probability space $( \Omega , \mathcal { F } , \mathbb { P } )$ , where $\Omega$ is the sample space, $\mathcal { F }$ is a $\sigma -$ algebra on $\Omega$ , and
177
+ 138 $\mathbb { P }$ is a probability measure on $\mathcal { F }$ . We assume that the joint random vector $( { \pmb x } , { \pmb y } , { \pmb s } )$ , containing the
178
+ 139 input data $\pmb { x } \in \mathbb { R } ^ { d _ { x } }$ , the target label $\boldsymbol { y } \in \mathbb { R } ^ { d _ { \boldsymbol { y } } }$ and the sensitive attribute $\boldsymbol { s } \in \mathbb { R } ^ { d _ { s } }$ , is a random vector
179
+ 140 on $( \Omega , { \mathcal { F } } )$ with joint distribution $\mathbf { \nabla } _ { p _ { x y s } }$ .
180
+ 141 Assumption 1. We assume that the encoder consists of $r$ functions in an $L _ { 2 }$ -universal RKHS
181
+ 142 $( \mathcal { H } _ { \pmb { x } } , k _ { \pmb { x } } ( \cdot , \cdot ) )$ (e.g., Gaussian kernel), where $L _ { 2 }$ −universality guarantees that $\mathcal { H } _ { x }$ can approximate
182
+ 143 any Borel-measurable function with arbitrary precision [34].
183
+
184
+ 144 Now, the representation vector $_ z$ can be expressed as
185
+
186
+ $$
187
+ \begin{array} { r } { z = f ( \pmb { x } ) : = \left[ f _ { 1 } ( \pmb { x } ) , \cdots , f _ { r } ( \pmb { x } ) \right] ^ { T } \in \mathbb { R } ^ { r } , \quad f _ { j } ( \cdot ) \in \mathcal { H } _ { \pmb { x } } \forall j = 1 , \ldots , r . } \end{array}
188
+ $$
189
+
190
+ 145 where $r$ is the dimensionality of the representation $_ z$ . As discussed in Corollary 5.1, unlike common
191
+ 146 practice where it is chosen arbitrarily, $r$ itself is an object of interest for optimization. We consider a
192
+ 147 general scenario where both $\textbf { { y } }$ and $\pmb { s }$ can be continuous or discrete, or one of $\textbf { { y } }$ or $\pmb { s }$ is continuous
193
+ 148 while the other is discrete. To do this, we substitute3 the target loss, inf $\mathbb { E } _ { { \pmb x } , { \pmb y } } [ { \mathcal { L } } _ { Y } ( g _ { Y } ( { \pmb z } ) , { \pmb y } ) ]$ in (1)
194
+ gY
195
+ 149 with the negative of a non-parametric measure of dependence i.e., $- \mathrm { d e p } ( z , y )$ . Furthermore, in
196
+
197
+ $$
198
+ \pmb { x } \overbrace { ( \underbrace { f ( \cdot ) } ) } ^ { \iint ( \underbrace { \longrightarrow ( \mathbb { C } \mathrm { o v } ( f ( \pmb { x } ) , \beta _ { y } ( \pmb { y } ) ) ) } _ { \beta } + \underbrace { ( \beta _ { y } ( \cdot ) ) } _ { \beta } + \textbf { { y } } ) } ^ { \iint ( \mathbb { C } \mathrm { o v } ( f ( \pmb { x } ) , \beta _ { y } ( \pmb { y } ) ) ) + ( \beta _ { y } ( \cdot ) ) + \textbf { \delta } ^ { y } }
199
+ $$
200
+
201
+ 150 unsupervised settings, when there is no target attribute $\textbf { { y } }$ , the target dependence $\mathrm { d e p } ( z , y )$ can be
202
+ 151 replaced with $\mathrm { d e p } ( z , \boldsymbol { x } )$ , which implicitly forces the representation $_ { z }$ to retain as much information
203
+ 152 as is necessary for reconstructing the input data $_ { \textbf { \em x } }$ . This scenario is of practical interest when a data
204
+ 153 producer aims to provide a representation of data that is independent of a desired semantic attribute
205
+ 154 for any arbitrary downstream task.
206
+ 155 We start by designing $\deg ( z , s )$ , and $\mathrm { d e p } ( z , y )$ follows similarly. A key desiderata of dependence
207
+ 156 measures is that they should be able to account for all possible non-linear dependence relations
208
+ 157 between the random variables (or vectors). Examples of such measures include information theoretic
209
+ 158 measures such as mutual information (e.g., MINE [36]) or covariance operator based measures such
210
+ 159 as Hilbert-Schmidt Independence Criterion [37], Constrained Covariance [38] and Kernel Canonical
211
+ 160 Correlation [39]. The underlying principle behind the latter class of dependence measures is that
212
+ 161 finite dimensional spaces with non-linear dependencies behave as linearly dependent spaces when
213
+ 162 mapped appropriately to higher dimensional spaces. In this paper we adopt the covariance operator
214
+ 163 based measures as our choice of dependence measure for analytical tractability.
215
+ 164 Principally, $_ { z }$ and $\pmb { s }$ are independent iff $\mathbb { C } \mathrm { o v } ( \alpha ( \pmb { z } ) , \beta _ { s } ( \pmb { s } ) )$ is zero for all $\alpha ( \cdot )$ and $\beta _ { s } ( \cdot )$ belong
216
+ 165 ing to some universal RKHSs [38]. Since $z ~ = ~ f ( x )$ and $f ( \cdot ) \ \in \ \mathcal { H } _ { x }$ , $\mathbb { C } \mathrm { o v } ( \alpha ( \pmb { z } ) , \beta _ { s } ( \pmb { s } ) ) \ =$
217
+ 166 $\mathbb { C } \mathrm { { \bar { o v } } } ( \alpha ( \pmb { f } ( \pmb { x } ) ) , \beta _ { s } ( \pmb { s } ) )$ , which necessitates application of a kernel on top of another kernel. This
218
+ 167 limits the analytical tractability of our solution. However, as we argue below, it is almost sufficient to
219
+ 168 consider transformation on $\pmb { s }$ , only, in which case it reduces to $\mathbb { C } \mathrm { o } \bar { \mathbf { v } } ( \pmb { f } ( \pmb { x } ) , \beta _ { s } ( \pmb { s } ) )$ . Let $( \mathcal { H } _ { s } , k _ { s } ( \cdot , \cdot ) )$
220
+ 169 and $( \mathcal { H } _ { \boldsymbol { y } } , k _ { \boldsymbol { y } } ( \cdot , \cdot ) )$ be separable4 RKHSs of functions defined on $\mathbb { R } ^ { d _ { s } }$ and $\mathbb { R } ^ { d _ { y } }$ , respectively. Consider
221
+ 170 the bi-linear functional,
222
+
223
+ $$
224
+ h ( \cdot , \cdot ) : \mathscr { H } _ { \pmb { x } } \times \mathscr { H } _ { s } \mathbb { R } , h _ { j } ( f _ { j } , \beta _ { s } ) : = \mathbb { C } \mathrm { o v } _ { \pmb { x } , s } ( f _ { j } ( \pmb { x } ) , \beta _ { s } ( \pmb { s } ) ) .
225
+ $$
226
+
227
+ 171 Assumption 2. We assume in the rest of this paper that the positive definite kernel functions are
228
+ 172 bounded, i.e.,
229
+
230
+ $$
231
+ \mathbb { E } _ { x } [ k _ { x } ( x , x ) ] < \infty , \quad \mathbb { E } _ { s } [ k _ { s } ( s , s ) ] < \infty , \quad \mathrm { a n d } \quad \mathbb { E } _ { y } [ k _ { y } ( y , y ) ] < \infty .
232
+ $$
233
+
234
+ 173 The assumptions in (6) guarantee that $h ( \cdot , \cdot )$ in (5) is bounded [40] and therefore, invoking Riesz
235
+ 174 representation theorem [41], there exists a unique and bounded linear operator $\Sigma _ { s x }$ , such that
236
+
237
+ $$
238
+ h ( f , \beta _ { s } ) = \mathbb { C } \mathsf { o v } _ { \pmb { x } , s } ( f ( \pmb { x } ) , \beta _ { s } ( \pmb { s } ) ) = \langle \beta _ { s } , \Sigma _ { s \pmb { x } } f \rangle _ { \mathscr { H } _ { s } } \quad \forall f \in \mathscr { H } _ { \pmb { x } } , \forall \beta _ { s } \in \mathscr { H } _ { s } .
239
+ $$
240
+
241
+ Based on 175 $h ( \cdot , \cdot )$ , we define the linear operator $h _ { f , s } : { \mathcal { H } } _ { s } \to { \mathbb { R } } ^ { r }$ as
242
+
243
+ $$
244
+ \begin{array} { r } { h _ { \pmb { f } , \mathscr { s } } ( \beta _ { \mathscr { s } } ) : = \left[ \begin{array} { c } { \mathbb { C } \mathrm { o v } _ { \pmb { x } , \mathscr { s } } ( f _ { 1 } ( \pmb { x } ) , \beta _ { \mathscr { s } } ( \pmb { s } ) ) } \\ { \vdots } \\ { \mathbb { C } \mathrm { o v } _ { \pmb { x } , \mathscr { s } } ( f _ { r } ( \pmb { x } ) , \beta _ { \mathscr { s } } ( \pmb { s } ) ) } \end{array} \right] = \left[ \begin{array} { c } { \langle \beta _ { \mathscr { s } } , \sum _ { \pmb { s } \pmb { x } } f _ { 1 } \rangle _ { \mathscr { H } _ { s } } } \\ { \vdots } \\ { \langle \beta _ { \mathscr { s } } , \sum _ { \pmb { s } \pmb { x } } f _ { r } \rangle _ { \mathscr { H } _ { s } } } \end{array} \right] . } \end{array}
245
+ $$
246
+
247
+ 176 The operator $h _ { f , s }$ captures all modes of non-linear dependence, since the distribution of a low
248
+ 177 dimensional projection of high-dimensional data is approximately normal [42], [43]. In other words,
249
+ 178 we assume that $\bar { ( } f ( \pmb { x } ) , \beta _ { s } ( \pmb { s } ) \bar { ) }$ is an approximately Gaussian random vector.
250
+ 179 Among the different dependence measures that have been defined through the covariance operator
251
+ 180 we adopt the Hilbert-Schmidt Independence Criterion (HSIC) [37] which is defined as the Hilbert
252
+ 181 Schmidt norm (HS-norm) of the covariance operator,
253
+
254
+ $$
255
+ \mathrm { d e p } ( z , s ) : = \| h _ { f , s } \| _ { \mathrm { H S } } ^ { 2 } = \sum _ { \beta _ { s } \in \mathcal { U } _ { s } } \| h _ { f , s } ( \beta _ { s } ) \| _ { 2 } ^ { 2 } { = } \sum _ { \beta _ { s } \in \mathcal { U } _ { s } } \sum _ { j = 1 } ^ { r } h ^ { 2 } ( f _ { j } , \beta _ { s } )
256
+ $$
257
+
258
+ 182 where $\mathcal { U } _ { s }$ is a countable orthonormal basis set for $\mathcal { H } _ { s }$ . Note that, based on this definition, if the
259
+ 183 distribution $( f ( \pmb { x } ) , \beta _ { s } ( \pmb { s } ) )$ fails to be a normal distribution, we end up measuring mean dependency
260
+ 184 of $z = f ( x )$ from $\pmb { s }$ which is still much stronger than the linear dependency between $_ z$ and $\pmb { s }$ [44].
261
+ 185 Even under this assumption, empirically (Section 4) we observe that trade-offs we obtain significantly
262
+ 186 dominate those from existing invariant representation learning algorithms.
263
+
264
+ 187 The following Lemma introduces a well-defined population expression for $\deg ( z , s )$ in (8).
265
+
266
+ # Lemma 2.
267
+
268
+ $$
269
+ \begin{array} { r l r } { \mathrm { d e p } ( z , s ) } & { = } & { \displaystyle \sum _ { j = 1 } ^ { r } \Big \lbrace \mathbb { E } _ { \alpha , s , \alpha ^ { \prime } , s ^ { \prime } } \Big [ f _ { j } ( \alpha ) f _ { j } ( \pmb { x } ^ { \prime } ) k _ { s } ( s , s ^ { \prime } ) \Big ] + \mathbb { E } _ { \alpha } \big [ f _ { j } ( \pmb { x } ) \big ] \mathbb { E } _ { \pmb { x } ^ { \prime } } \big [ f _ { j } ( \pmb { x } ^ { \prime } ) \big ] \mathbb { E } _ { s , s ^ { \prime } } \big [ k _ { s } ( s , s ^ { \prime } ) \big ] } \\ & { } & { - 2 \mathbb { E } _ { \alpha , s } \Big [ f _ { j } ( \pmb { x } ) \mathbb { E } _ { \pmb { x } ^ { \prime } } \big [ f _ { j } ( \pmb { x } ^ { \prime } ) \big ] \mathbb { E } _ { \pmb { y } ^ { \prime } } \big [ k _ { s } ( s , s ^ { \prime } ) \big ] \Big ] \Big \rbrace } \end{array}
270
+ $$
271
+
272
+ where 188 $( { \pmb x } , { \pmb s } )$ and $( { \pmb x } ^ { \prime } , s ^ { \prime } )$ are independently drawn from the joint distribution $p _ { x s }$ .
273
+
274
+ 89 In practice, it is necessary to empirically estimate $\deg ( z , s )$ , since the population distributions are
275
+ 90 typically unknown in most real-world scenarios.
276
+ 191 Definition 3. Let $D = \{ ( \pmb { x } _ { 1 } , \pmb { s } _ { 1 } , \pmb { y } _ { 1 } ) , \cdot \cdot \cdot , ( \pmb { x } _ { n } , \pmb { s } _ { n } , \pmb { y } _ { n } ) \}$ be the training data, containing $n$ i.i.d.
277
+ 192 realizations from the joint distribution $p _ { x s y }$ . Using, the representer theorem [45], it follows that
278
+ 193 $\pmb { f } ( \pmb { x } ) = \Theta _ { E } { [ k _ { x } ( x _ { 1 } , \pmb { x } ) , \allowbreak \cdot \cdot \cdot , k _ { x } ( x _ { n } , \pmb { x } ) ] } ^ { T }$ , where $\boldsymbol { \Theta } \in \mathbb { R } ^ { r \times n }$ is a free parameter matrix.
279
+
280
+ 194 Lemma 3. Let an empirical estimation of covariance be
281
+
282
+ $$
283
+ \mathbb { C } \mathrm { o v } _ { \boldsymbol { x } , s } ( f _ { j } ( \boldsymbol { x } ) , \beta _ { s } ( \boldsymbol { s } ) ) \approx \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f _ { j } ( \boldsymbol { x } _ { i } ) \beta _ { s } ( \boldsymbol { s } _ { i } ) - \frac { 1 } { n ^ { 2 } } \sum _ { i = 1 } ^ { n } \sum _ { k = 1 } ^ { n } f _ { j } ( \boldsymbol { x } _ { i } ) \beta _ { s } ( \boldsymbol { s } _ { k } ) .
284
+ $$
285
+
286
+ 195 Then, the empirical estimator of $\deg ( z , s )$ is given by
287
+
288
+ $$
289
+ \mathrm { d e p } ^ { \mathrm { e m p } } ( z , s ) \quad : = \quad \frac { 1 } { n ^ { 2 } } \big \| \Theta K _ { x } H L _ { s } \big \| _ { F } ^ { 2 } ,
290
+ $$
291
+
292
+ 196 where $K _ { x } , K _ { s } \in \mathbb { R } ^ { n \times n }$ are Gram matrices corresponding to $\mathcal { H } _ { x }$ and $\mathcal { H } _ { s }$ , respectively, ${ \textbf { \em H } } =$
293
+ 197 $\textstyle I - { \frac { 1 } { n } } \mathbf { 1 } \mathbf { 1 } ^ { T }$ , and $\mathbf { \boldsymbol { L _ { s } } }$ is a full column-rank matrix in which $\bar { \pmb { L } } _ { s } \pmb { L } _ { s } ^ { T } = \pmb { K } _ { s }$ (Cholesky factorization).
294
+ 198 This empirical estimator in (9) has a bias of $\mathcal { O } ( n ^ { - 1 } )$ and a convergence rate of $\mathcal { O } ( n ^ { - 1 / 2 } )$ .
295
+
296
+ The population and empirical dependence measures between $_ z$ and $\textbf { { y } }$ i.e., $\mathrm { d e p } ( z , y )$ and $\mathrm { d e p } ^ { \mathrm { e m p } } ( z , y )$ , respectively, can be defined and obtained similarly.
297
+
298
+ # 3.2 Trade-Off D
299
+
300
+ 202 We now turn to the the optimization problem corresponding to the trade-off $\mathbf { D }$ in (1). Recall that
301
+ 203 $z = f ( x )$ is $r$ -dimensional, where the dimensionality $r$ is a free variable. A common desiderata of
302
+ 204 learned representations is that of compactness [46] in order to avoid learning representations with
303
+ 205 redundant information where different dimensions are highly correlated with each other. Therefore,
304
+ 206 going beyond the assumption that each component of $f ( \cdot )$ (i.e., $f _ { j } ( \cdot ) ) ,$ ) belongs to a $L _ { 2 }$ −universal
305
+ 207 RKHS $\mathcal { H } _ { x }$ , we impose additional constraints on the representation. Specifically, we constrain the
306
+ 208 search space of the encoder $f ( \cdot )$ to learn a disentangled representation [46] as follows,
307
+
308
+ $$
309
+ \begin{array} { r } { \mathcal { A } _ { r } : = \Big \{ \Big ( f _ { 1 } ( \cdot ) , \cdot \cdot \cdot , f _ { r } ( \cdot ) \Big ) \Big | f _ { i } , f _ { j } \in \mathcal { H } _ { \pmb { x } } , \mathbb { C } \mathrm { o v } _ { \pmb { x } } ( f _ { i } ( \pmb { x } ) , f _ { j } ( \pmb { x } ) ) + \gamma \langle f _ { i } , f _ { j } \rangle _ { \mathcal { H } _ { \pmb { x } } } = \delta _ { i , j } \Big \} , } \end{array}
310
+ $$
311
+
312
+ 209 where the regularization term $\gamma \langle f _ { i } , f _ { j } \rangle _ { \mathcal { H } _ { x } }$ , encourages orthogonality and boundedness, which in turn
313
+ 210 forces the representation to be compact or non-redundant. Such disentangled representations have
314
+ 211 been studied in the context of independent component analysis (ICA) [39]. Now, the optimization
315
+ 212 problem in (1) reduces to,
316
+
317
+ $$
318
+ \operatorname* { s u p } _ { f \in \mathcal { A } _ { r } } \Big \{ J ( f ( x ) ) : = ( 1 - \tau ) \deg ( f ( x ) , y ) - \tau \deg ( f ( x ) , s ) \Big \} , \quad 0 \leq \tau < 1 ,
319
+ $$
320
+
321
+ where as justified earlier the target loss function in213 f $_ { Y } \mathbb { E } _ { { \pmb x } , { \pmb y } } [ { \mathcal { L } } _ { Y } ( f _ { T } ( { \pmb f } ( { \pmb x } ) ) , { \pmb y } ) ]$ is substituted by 214 $- \mathrm { d e p } ( f ( \pmb { x } ) , \pmb { y } )$ . Fortunately, the above optimization problem lends itself to a closed-form solu215 tion as given by the next theorem.
322
+
323
+ 216 Theorem 4. A solution5 to the optimization problem in (11) is the eigenfunctions corresponding to $r$
324
+ 217 largest eigenvalues of the following generalized problem
325
+
326
+ $$
327
+ \begin{array} { r } { \left( ( 1 - \tau ) \Sigma _ { y x } ^ { * } \Sigma _ { y x } - \tau \Sigma _ { s x } ^ { * } \Sigma _ { s x } \right) f = \lambda \Sigma _ { x x } f , } \end{array}
328
+ $$
329
+
330
+ where 218 $\Sigma _ { s x }$ and $\Sigma _ { y x }$ are the covariance operators defined in (7), and $\Sigma _ { s x } ^ { * }$ and $\Sigma _ { y x } ^ { * }$ are the adjoint 19 operators of $\Sigma _ { s x }$ and $\Sigma _ { y x }$ , respectively.
331
+
332
+ Remark. If the trade-off parameter $\tau = 0$ (i.e., no semantic independence constraint is imposed), the solution in Theorem 4 resembles a supervised version of ICA in [39] which is essentially a kernelized dimensionality reduction supervised by the target attribute $\textbf { { y } }$ . On the other hand, if $\tau 1$ (i.e., utility is ignored and only semantic independence is considered), the solution in Theorem 4 is the eigenfunctions corresponding to the negative eigenvalues of $\Sigma _ { s x } ^ { * } \Sigma _ { s x }$ , which are the directions that are least explanatory of the semantic attribute $\pmb { s }$ .
333
+
334
+ 226 An empirical version of (11) is the following optimization problem
335
+
336
+ $$
337
+ \operatorname* { s u p } _ { f \in { \mathcal A } _ { r } } \Big \{ J ^ { \mathrm { e m p } } ( f ( x ) ) : = ( 1 - \tau ) { \mathrm { d e p } } ^ { \mathrm { e m p } } ( f ( x ) , y ) - \tau { \mathrm { d e p } } ^ { \mathrm { e m p } } ( f ( x ) , s ) \Big \} , \quad 0 \leq \tau < 1
338
+ $$
339
+
340
+ where de ${ \mathfrak { p } } ^ { \mathrm { e m p } } ( f ( { \pmb x } ) , { \pmb s } )$ and $\log ^ { \mathrm { e m p } } ( f ( x ) , y )$ are given in (9).
341
+
342
+ 228 Theorem 5. Consider the Cholesky factorization $K _ { x } = L _ { x } L _ { x } ^ { T }$ , where $\scriptstyle L _ { x }$ is a full column-rank
343
+ 229 matrix. A solution to (13) is
344
+
345
+ $$
346
+ \pmb { f } ^ { \mathrm { o p t } } = \Theta ^ { \mathrm { o p t } } \Big [ k _ { x } ( x _ { 1 } , \cdot ) , \cdot \cdot \cdot , k _ { x } ( x _ { n } , \cdot ) \Big ] ^ { T }
347
+ $$
348
+
349
+ where 230 $\Theta ^ { \mathrm { o p t } } = U ^ { T } ( L _ { x } ) ^ { \dag }$ and the columns of $U$ are eigenvectors corresponding to $r$ largest eigenval231 ues, $\lambda _ { 1 } , \cdots , \lambda _ { r }$ of the following generalized problem,
350
+
351
+ $$
352
+ \Big ( L _ { x } ^ { T } \big ( ( 1 - \tau ) \tilde { K } _ { y } - \tau \tilde { K } _ { s } \big ) L _ { x } \Big ) u = \lambda \Big ( L _ { x } ^ { T } H L _ { x } + n \gamma I \Big ) u
353
+ $$
354
+
355
+ where 32 $\gamma$ is the regularization parameter from (10) and the supremum value of (13) is $\textstyle \sum _ { j = 1 } ^ { r } \lambda _ { j }$
356
+
357
+ 233 Corollary 5.1. Embedding Dimensionality: A useful corollary of Theorem 5 is optimal embedding
358
+ 234 dimensionality:
359
+
360
+ $$
361
+ \arg \operatorname* { s u p } _ { r } \left\{ \operatorname* { s u p } _ { f \in A _ { r } } \Big \{ J ^ { \mathrm { e m p } } ( f ( x ) ) : = ( 1 - \tau ) \mathrm { d e p } ^ { \mathrm { e m p } } ( f ( x ) , y ) - \tau \mathrm { d e p } ^ { \mathrm { e m p } } ( f ( x ) , s ) \Big \} \right\} ,
362
+ $$
363
+
364
+ 235 which is the number of positive eigenvalues of the generalized eigenvalue problem in (14). To
365
+ 236 intuitively examine this result, consider two extreme cases: i) If there is no semantic independence
366
+ 237 constraint (i.e., $\tau = 0$ ), adding more dimensions to the optimum $r$ will not harm the representation
367
+ 238 power of $_ z$ . ii) If we only care about semantic independence and ignore the target task (i.e., $\tau 1$ ),
368
+ 239 the optimal $r$ would be equal to zero, indicating that a null representation is the best for discarding all
369
+ 240 semantic information. In this case, adding more dimension to $_ { z }$ will necessarily violate the semantic
370
+ 241 independence constraint. More discussion can be found in the supplementary material.
371
+ 242 In the following Theorem, we prove that the empirical solution converges to its population counterpart.
372
+ 243 Theorem 6. Assume that $k _ { s } ( \cdot , \cdot )$ and $k _ { y } ( \cdot , \cdot )$ are bounded by one and $f _ { k } ^ { 2 } ( { \pmb x } _ { i } )$ is bounded by $M$ for
373
+ 244 any $k = 1 , \ldots , r$ and $i = 1 , \ldots , n$ for which $\pmb { f } = ( f _ { 1 } , \dots , f _ { r } ) \in \mathcal { A } _ { r }$ . For any $n > 1$ and $0 < \delta < 1$
374
+ 245 with probability at least $1 - \delta$ , we have
375
+
376
+ $$
377
+ \Big | \operatorname* { s u p } _ { f \in A _ { r } } J ( f ( { \pmb x } ) ) - \operatorname* { s u p } _ { { \pmb f } \in A _ { r } } J ^ { \mathrm { e m p } } ( { \pmb f } ( { \pmb x } ) ) \Big | \leq r M \sqrt { \frac { \log ( 6 / \delta ) } { a ^ { 2 } n } } + \mathcal { O } \left( \frac { 1 } { n } \right) ,
378
+ $$
379
+
380
+ 246 where $0 . 2 2 \leq a \leq 1$ is a constant.
381
+
382
+ 5The term ’solution’ in any optimization problem in this paper refers to a global optima.
383
+
384
+ 248 We recall that label space trade-off arises when the representation $_ { z }$ is ideal and is free to be designed
385
+ 249 optimally i.e., it does not necessarily depend on the input data $_ { \textbf { \em x } }$ or the encoder’s hypothesis class.
386
+ 250 However, we assume that the representation $_ z$ is a direct effect of the target and sensitive variables $_ y$
387
+ 251 and $\pmb { s }$ ). Following [47], we use an additive noise model as
388
+
389
+ $$
390
+ \pmb { z } = \pmb { f } _ { L } ( \pmb { y } , \pmb { s } ) + \pmb { e } , \quad \pmb { e } \perp \pmb { y } , \pmb { e } \perp \pmb { s }
391
+ $$
392
+
393
+ 252 where $\pmb { f } _ { L } ( \cdot , \cdot ) \ : \ \mathbb { R } ^ { d _ { y } } \times \mathbb { R } ^ { d _ { s } } \ \mathbb { R } ^ { r }$ is a Borel-measurable function. Following Section 3.1,
394
+ 253 we deploy $- \mathrm { d e p } ( z , y )$ , defined similar to $\deg ( z , s )$ in (8), as a proxy for the loss function
395
+ 254 $\operatorname* { i n f } _ { g _ { Y } \in \mathcal { H } _ { y } } \mathbb { E } _ { { \pmb x } , { \pmb y } } [ \mathcal { L } _ { T } ( g _ { T } ( { \pmb z } ) , { \pmb y } ) ]$ . Recall that, the desired optimization problem is given in (2). Instead
396
+ 255 of directly optimizing over $z \in L ^ { 2 }$ , we optimize over all Borel-measurable functions $f _ { L } ( \cdot , \cdot )$ by
397
+ 256 ignoring $e$ since it is independent of both $\textbf { { y } }$ and $\pmb { s }$ :
398
+
399
+ $$
400
+ \operatorname* { s u p } _ { \pmb { f } _ { L } \in A _ { r } ( \pmb { y } , s ) } \Big \{ ( 1 - \tau ) \mathrm { d e p } ( \pmb { f } _ { L } ( \pmb { y } , s ) , \pmb { y } ) - \tau \mathrm { d e p } ( \pmb { f } _ { L } ( \pmb { y } , s ) , \pmb { s } ) \Big \} ,
401
+ $$
402
+
403
+ where $\scriptstyle A _ { r } ( y , s )$ is defined similar to $\mathcal { A } _ { r }$ in (10) by using $( y , s )$ instead of $_ { \textbf { \em x } }$ in the definition. Recall that $\scriptstyle A _ { r } ( y , s )$ ensures that $_ { z }$ will not contain highly correlated (entangled) dimensions, and thus be minimally redundant or maximally compact.
404
+
405
+ Remark. The optimization problem in (16) and its empirical counterpart can be solved similar to that of trade-off $\mathbf { D }$ in Theorems 5 and 6 where $_ { \textbf { \em x } }$ is replaced with $( y , s )$ .
406
+
407
+ # 3.4 Trade-Off F
408
+
409
+ Here we define and discuss the trade-off achievable by practical realizations of representation learning algorithms with either fairness, invariance or semantic independence constraints.
410
+
411
+ Definition 4. Feasible Space Trade-Off arises from the statistical dependence between the target feature $\textbf { { y } }$ and the sensitive attribute $\pmb { s }$ conditioned on the given input data $_ { \textbf { \em x } }$ , the choice of hypothesis class for the learners involved, and the choice of dependence measure adopted. This setting can be formalized as,
412
+
413
+ $$
414
+ \operatorname* { i n f } _ { f \in \mathcal { H } _ { x } } \Big \{ ( 1 - \tau ) \operatorname* { i n f } _ { g _ { Y } \in \mathcal { H } _ { y } } \mathbb { E } _ { \mathbf { x } , y } \Big [ \mathcal { L } _ { Y } \Big ( g _ { Y } \big ( f ( x ) ) , y \Big ) \Big ] + \tau \widetilde { \deg } ( f ( x ) , s ) \Big \} , \quad 0 \leq \tau < 1 ,
415
+ $$
416
+
417
+ 269 where $\mathcal { H } _ { x }$ and $\mathcal { H } _ { y }$ are the hypothesis class for the encoder network and target predictor, respectively,
418
+ 270 $\mathcal { L } _ { Y } ( \cdot , \cdot )$ denotes the loss function of target task, and $\widetilde { \mathrm { d e p } } ( f ( \pmb { x } ) , s )$ is a parametric or non-parametric
419
+ 271 surrogate measure of dependency quantifying the dependency between representation vector $z =$
420
+ 272 $f ( { \pmb x } )$ and the sensitive attribute $\pmb { s }$ .
421
+ 273 This setting corresponds to the trade-off $\mathbf { F }$ in Figure 1(b), and is necessarily dominated by the
422
+ 274 Data Space Trade-Off D. Multiple factors may lead to such sub-optimal trade-offs. These include,
423
+ 275 hypothesis classes that are not universal RKHSs (e.g., [4] considered the case where $\mathcal { H } _ { x }$ is universal,
424
+ 276 but $\mathcal { H } _ { s }$ and $\mathcal { H } _ { y }$ are linear RKHSs), the surrogate dependence measure $\widetilde { \mathrm { d e p } } ( f ( \pmb { x } ) , s )$ does not account
425
+ 277 for all non-linear dependencies (e.g., [3, 2, 21, 4] which consider adversarially learned dependence
426
+ 278 measures), sub-optimal optimization of (17) in terms of achieving only local optima but not the
427
+ 279 global optima (e.g., when the hypothesis class is deep neural networks that are optimized through
428
+ 280 stochastic gradient descent, or through stochastic gradient descent-ascent in the case of adversarial
429
+ 281 representation learning[3, 21, 2]), and combinations thereof.
430
+
431
+ # 282 4 Numerical Estimation of Trade-Offs
432
+
433
+ 283 In this section, we demonstrate the practical utility of the analytical results developed in the paper
434
+ 284 and validate our theoretical insights. For this purpose, we design an illustrative toy example that
435
+ 285 conforms to the setting studied in the paper and numerically quantify the trade-offs that we introduced.
436
+ 286 Experimental validation on more tasks can be found in the supplementary material.
437
+
438
+ 287 Consider the following Gaussian mixture model from which we generate 4000, 2000, and 2000
439
+
440
+ $$
441
+ v = [ v _ { 1 } , v _ { 2 } ] \sim \frac { 1 } { 2 } \Big ( X ( m , \Sigma ) + \mathcal { N } ( m ^ { \prime } , \Sigma ) \Big ) , \quad m = [ 0 , 1 ] , m ^ { \prime } = [ 1 , 1 ] , \Sigma = \mathrm { d i a g } ( 0 . 1 ^ { 2 } , 0 . 1 ^ { 2 } )
442
+ $$
443
+
444
+ ![](images/cb476a91659ba082677b8fbf209c2a8ac5d8549e7de8aa8c20de3ea4b19a3a9b.jpg)
445
+ Figure 3: (a): A mixture of two Gaussians which generates the input data as ${ \mathbf { \boldsymbol { x } } } = \boldsymbol { v } _ { 1 }$ , the sensitive attribute as $\begin{array} { r } { \pmb { s } = v _ { 1 } ^ { 3 } } \end{array}$ , and the target attribute as $\pmb { y } = [ \widetilde { v } _ { 1 } , v _ { 2 } ^ { 3 } ]$ . (b): Two fundamental trade-offs, $\mathbf { L }$ and $\mathbf { D }$ , together with two baseline feasible trade-offs $\mathbf { F }$ , ARL optimized with SGDA [21] and global optima of ARL with a linear RKHS [4]. (c), (d): The learned embedding for $\tau = 0$ and $\tau = 0 . 5$ , respectively. An invariant representation should collapse $v _ { 1 }$ i.e., the two colors should fully overlap with each other in the embedding. The overlap is partial for $\tau = 0 . 5$ and as $\tau 1$ , the optimal representation is zero.
446
+
447
+ 288 independent samples for training, validation and testing, respectively. Figure 3(a) shows the test
448
+ 289 samples where the samples generated with $_ { m }$ and $m ^ { \prime }$ are in blue and red, respectively. The input data
449
+ 290 $_ { \textbf { \em x } }$ is set to $v _ { 1 }$ (the first entry of $\textbf { { v } }$ ), the sensitive attribute $\pmb { s }$ is $v _ { 1 } ^ { 3 }$ , and the target attribute $\textbf { { y } }$ is $[ v _ { 1 } , v _ { 2 } ^ { 3 } ]$
450
+ 291 In this problem both input data and target attribute are dependent on the sensitive attribute. We choose
451
+ 292 all three RKHS $\mathcal { H } _ { x }$ , $\mathcal { H } _ { y }$ , and $\mathcal { H } _ { s }$ to be Gaussian, which is a universal RKHS. The optimal $_ z$ is learned
452
+ 293 for the trade-off $\mathbf { D }$ through the closed-form solution in Theorem 5 for different invariance parameter
453
+ 294 values $\tau$ in $[ 0 , 1 )$ . Then, this optimal embedding is fed to a target task predictor which is a multi-layer
454
+ 295 perceptron (MLP) with two hidden layers, and 4, 8 neurons and optimize the mean-squared error
455
+ 296 (MSE). The $\mathbf { X }$ -axis is a normalized version of the dependence measure used in our optimization, while
456
+ 297 the y-axis quantifies utility normalized to $[ 0 , 1 ]$ as $\exp ( - \mathrm { \mathbf { M } S E ) }$ . The same procedure is implemented
457
+ 298 for trade-off $\mathbf { L }$ , except that the input data is $\textbf { { v } }$ , instead of $_ { \textbf { \em x } }$ . These trade-offs are shown in Figure 3(b).
458
+ 299 We choose the input data to be $\textbf { { v } }$ instead of $( y , s )$ for trade-off $\mathbf { L }$ since $( y , s )$ is fully generated from
459
+ 300 $\textbf { { v } }$ and therefore, $\textbf { { v } }$ perfectly explains $( y , s )$ . For $\tau = 0$ and $\tau = 0 . 5$ , the optimal embeddings are
460
+ 301 illustrated in Figure 3, (c) and (d), respectively. Since the sensitive attribute is only related to $v _ { 1 }$ ,
461
+ 302 an invariant embedding should collapse the corresponding dimension and cause the two colors to
462
+ 303 overlap with each other.
463
+ 304 We make the following observations, (a) Trade-off $\mathbf { L }$ dominates trade-off $\mathbf { D }$ as expected. (b) The
464
+ 305 trade-offs $\mathbf { F }$ obtained by the baselines are dominated by trade-off $\mathbf { D }$ . Adversarial representation
465
+ 306 learning [3, 21, 2] uses sub-optimal optimization (SGDA), while Spectral-ARL [4] uses a global
466
+ 307 optimum solution but restricts the hypothesis class in (3) to linear RKHS. As such, the baselines are
467
+ 308 unable to match the global optimal solution of (13), and (c) At $\tau = 0 . 5$ the embedding does indeed
468
+ 309 collapse $v _ { 1 }$ to an extent leading to partial overlap between the two mixtures.
469
+
470
+ # 310 5 Conclusions and Societal Impact
471
+
472
+ 311 This paper developed the theoretical underpinnings for identifying and determining the fundamental
473
+ 312 trade-offs and limits of representation learning under competing objectives. These trade-offs included
474
+ 313 i) label space trade-off which is solely induced by the statistical relation between target task and
475
+ 314 semantic attribute; ii) data space trade-off which is due to the statistical dependence between the
476
+ 315 input data and both target and semantic attributes. Further, we found closed-from solutions for the
477
+ 316 global optima, both the population and empirical versions, for the underlying optimization problems,
478
+ 317 and thus quantify the trade-offs exactly. Our results shed light on the regions of the trade-off that are
479
+ 318 feasible or impossible to achieve by learning algorithms. Numerical results suggest that commonly
480
+ 319 used adversarial representation learning based techniques are unable to reach the optimal trade-offs.
481
+ 320 The theoretical results in this paper are useful for algorithmic fairness, privacy-preservation, and
482
+ 321 domain generalization applications of representation learning. Such systems are being widely
483
+ 322 deployed in a variety of practical applications: search engines, social media, law enforcement,
484
+ 323 healthcare, consumer devices, financial and judicial risk assessments, face analysis, and many more.
485
+ 324 Therefore, providing theoretical limits of performance is critically important for informed framing
486
+ 325 of regulatory policies, deployment of such solutions, and gaining societal trust. As such, we do not
487
+ 326 anticipate any adverse societal impacts from this work.
488
+
489
+ [1] P. Roy and V. N. Boddeti, “Mitigating information leakage in image representations: A maximum entropy approach,” in IEEE Conference on Computer Vision and Pattern Recognition, 2019.
490
+ [2] D. Madras, E. Creager, T. Pitassi, and R. Zemel, “Learning adversarially fair and transferable representations,” arXiv preprint arXiv:1802.06309, 2018.
491
+ [3] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky, “Domain-adversarial training of neural networks,” The Journal of Machine Learning Research, vol. 17, no. 1, pp. 2096–2030, 2016.
492
+ [4] B. Sadeghi, R. Yu, and V. Boddeti, “On the global optima of kernelized adversarial representation learning,” in IEEE International Conference on Computer Vision, pp. 7971–7979, 2019.
493
+ [5] H. Zhao and G. J. Gordon, “Inherent tradeoffs in learning fair representations,” arXiv preprint arXiv:1906.08386, 2019.
494
+ [6] D. McNamara, C. S. Ong, and R. C. Williamson, “Costs and benefits of fair representation learning,” in AAAI/ACM Conference on AI, Ethics, and Society, pp. 263–270, 2019.
495
+ [7] S. Dutta, D. Wei, H. Yueksel, P.-Y. Chen, S. Liu, and K. Varshney, “Is there a trade-off between fairness and accuracy? a perspective using mismatched hypothesis testing,” in International Conference on Machine Learning, pp. 2803–2813, PMLR, 2020.
496
+ [8] H. Zhao, J. Chi, Y. Tian, and G. J. Gordon, “Trade-offs and guarantees of adversarial representation learning for information obfuscation,” arXiv preprint arXiv:1906.07902, 2019.
497
+ [9] N. Martinez, M. Bertran, and G. Sapiro, “Minimax pareto fairness: A multi objective perspective,” in International Conference on Machine Learning, pp. 6755–6764, PMLR, 2020.
498
+ [10] H. Zhao, C. Dan, B. Aragam, T. S. Jaakkola, G. J. Gordon, and P. Ravikumar, “Fundamental limits and tradeoffs in invariant representation learning,” arXiv preprint arXiv:2012.10713, 2020.
499
+ [11] Y. Ganin and V. Lempitsky, “Unsupervised domain adaptation by backpropagation,” in International Conference on Machine Learning, 2015.
500
+ [12] E. Tzeng, J. Hoffman, K. Saenko, and T. Darrell, “Adversarial discriminative domain adaptation,” in IEEE Conference on Computer Vision and Pattern Recognition, 2017.
501
+ [13] H. Zhao, S. Zhang, G. Wu, J. M. Moura, J. P. Costeira, and G. J. Gordon, “Adversarial multiple source domain adaptation,” Advances in Neural Information Processing Systems, vol. 31, pp. 8559–8570, 2018.
502
+ [14] C. Dwork, M. Hardt, T. Pitassi, O. Reingold, and R. Zemel, “Fairness through awareness,” in Innovations in Theoretical Computer Science Conference, pp. 214–226, 2012.
503
+ [15] S. Ruggieri, “Using t-closeness anonymity to control for non-discrimination.,” Trans. Data Priv., vol. 7, no. 2, pp. 99–129, 2014.
504
+ [16] M. Feldman, S. A. Friedler, J. Moeller, C. Scheidegger, and S. Venkatasubramanian, “Certifying and removing disparate impact,” in ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 259–268, 2015.
505
+ [17] F. Calmon, D. Wei, B. Vinzamuri, K. N. Ramamurthy, and K. R. Varshney, “Optimized preprocessing for discrimination prevention,” in Advances in Neural Information Processing Systems, pp. 3992–4001, 2017.
506
+ [18] R. Zemel, Y. Wu, K. Swersky, T. Pitassi, and C. Dwork, “Learning fair representations,” in International Conference on Machine Learning, pp. 325–333, 2013.
507
+ [19] H. Edwards and A. Storkey, “Censoring representations with an adversary,” arXiv preprint arXiv:1511.05897, 2015.
508
+ [20] A. Beutel, J. Chen, Z. Zhao, and E. H. Chi, “Data decisions and theoretical implications when adversarially learning fair representations,” arXiv preprint arXiv:1707.00075, 2017.
509
+ [21] Q. Xie, Z. Dai, Y. Du, E. Hovy, and G. Neubig, “Controllable invariance through adversarial feature learning,” in Advances in Neural Information Processing Systems, pp. 585–596, 2017.
510
+ [22] B. H. Zhang, B. Lemoine, and M. Mitchell, “Mitigating unwanted biases with adversarial learning,” in AAAI/ACM Conference on AI, Ethics, and Society, 2018.
511
+ [23] J. Song, P. Kalluri, A. Grover, S. Zhao, and S. Ermon, “Learning controllable fair representations,” in International Conference on Artificial Intelligence and Statistics (AISTATS), 2019.
512
+ [24] M. Bertran, N. Martinez, A. Papadaki, Q. Qiu, M. Rodrigues, G. Reeves, and G. Sapiro, “Adversarially learned representations for information obfuscation and inference,” in International Conference on Machine Learning, 2019.
513
+ [25] E. Creager, D. Madras, J.-H. Jacobsen, M. A. Weis, K. Swersky, T. Pitassi, and R. Zemel, “Flexibly fair representation learning by disentanglement,” in International Conference on Machine Learning (ICML), 2019.
514
+ [26] F. Locatello, G. Abbati, T. Rainforth, S. Bauer, B. Schölkopf, and O. Bachem, “On the fairness of disentangled representations,” in Advances in Neural Information Processing Systems, pp. 14611–14624, 2019.
515
+ [27] J. Mary, C. Calauzenes, and N. El Karoui, “Fairness-aware learning for continuous attributes and treatments,” in International Conference on Machine Learning, pp. 4382–4391, PMLR, 2019.
516
+ [28] J. Hamm, “Minimax filter: Learning to preserve privacy from inference attacks,” The Journal of Machine Learning Research, vol. 18, no. 1, pp. 4704–4734, 2017.
517
+ [29] M. Coavoux, S. Narayan, and S. B. Cohen, “Privacy-preserving neural representations of text,” arXiv preprint arXiv:1808.09408, 2018.
518
+ [30] T. Xiao, Y.-H. Tsai, K. Sohn, M. Chandraker, and M.-H. Yang, “Adversarial learning of privacy-preserving and task-oriented representations,” in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, pp. 12434–12441, 2020.
519
+ [31] M. Dusmanu, J. L. Schönberger, S. N. Sinha, and M. Pollefeys, “Privacy-preserving visual feature descriptors through adversarial affine subspace embedding,” in IEEE Conference on Computer Vision and Pattern Recognition, 2021.
520
+ [32] E. Adeli, Q. Zhao, A. Pfefferbaum, E. V. Sullivan, L. Fei-Fei, J. C. Niebles, and K. M. Pohl, “Representation learning with statistical independence to mitigate bias,” in IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 2513–2523, 2021.
521
+ [33] V. Grari, O. E. Hajouji, S. Lamprier, and M. Detyniecki, “Learning unbiased representations via re’nyi minimization,” arXiv preprint arXiv:2009.03183, 2020.
522
+ [34] B. K. Sriperumbudur, K. Fukumizu, and G. R. Lanckriet, “Universality, characteristic kernels and rkhs embedding of measures.,” Journal of Machine Learning Research, vol. 12, no. 7, 2011.
523
+ [35] D. Greenfeld and U. Shalit, “Robust learning with the hilbert-schmidt independence criterion,” in International Conference on Machine Learning, pp. 3759–3768, PMLR, 2020.
524
+ [36] M. I. Belghazi, A. Baratin, S. Rajeshwar, S. Ozair, Y. Bengio, A. Courville, and D. Hjelm, “Mutual information neural estimation,” in International Conference on Machine Learning, pp. 531–540, PMLR, 2018.
525
+ [37] A. Gretton, O. Bousquet, A. Smola, and B. Schölkopf, “Measuring statistical dependence with hilbert-schmidt norms,” in International Conference on Algorithmic Learning Theory, pp. 63–77, Springer, 2005.
526
+ [38] A. Gretton, R. Herbrich, A. Smola, O. Bousquet, and B. Schölkopf, “Kernel methods for measuring independence,” Journal of Machine Learning Research, vol. 6, no. Dec, pp. 2075– 2129, 2005.
527
+ [39] F. R. Bach and M. I. Jordan, “Kernel independent component analysis,” Journal of Machine Learning Research, vol. 3, no. Jul, pp. 1–48, 2002.
528
+ [40] K. Fukumizu, F. R. Bach, and A. Gretton, “Statistical consistency of kernel canonical correlation analysis.,” Journal of Machine Learning Research, vol. 8, no. 2, 2007.
529
+ [41] E. Kreyszig, Introductory functional analysis with applications, vol. 1. wiley New York, 1978.
530
+ [42] P. Diaconis and D. Freedman, “Asymptotics of graphical projection pursuit,” The Annals of Statistics, pp. 793–815, 1984.
531
+ [43] P. Hall and K.-C. Li, “On almost linearity of low dimensional projections from high dimensional data,” The Annals of Statistics, pp. 867–889, 1993.
532
+ [44] A. Rényi, “On measures of dependence,” Acta Mathematica Academiae Scientiarum Hungarica, vol. 10, no. 3-4, pp. 441–451, 1959.
533
+ [45] J. Shawe-Taylor, N. Cristianini, et al., Kernel methods for pattern analysis. Cambridge university press, 2004.
534
+ [46] Y. Bengio, A. Courville, and P. Vincent, “Representation learning: A review and new perspectives,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 35, no. 8, pp. 1798–1828, 2013.
535
+ [47] J. M. Mooij, J. Peters, D. Janzing, J. Zscheischler, and B. Schölkopf, “Distinguishing cause from effect using observational data: methods and benchmarks,” The Journal of Machine Learning Research, vol. 17, no. 1, pp. 1103–1204, 2016.
536
+
537
+ # 440 Checklist
538
+
539
+ 1. For all authors...
540
+
541
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See Section 3.2 and Section 3.3. Particularly, see Theorem 4 and Theorem 5.
542
+ (b) Did you describe the limitations of your work? [Yes] See the discussion above equation (5) and below equation (8).
543
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A] See Section 5.
544
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
545
+
546
+ 2. If you are including theoretical results...
547
+
548
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 3.1. Particularly, see Assumption 1 and Assumption 2 and discussion above equation (5) and below equation (8).
549
+ (b) Did you include complete proofs of all theoretical results? [Yes] See supplementary material for the proofs of all Lemmas and Theorems.
550
+
551
+ 3. If you ran experiments...
552
+
553
+ (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 supplementary material.
554
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4 and supplementary material.
555
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Only one of the baseline methods, ARL, requires running multiple times with different random seeds. The error bar of ARL results is given in supplementary material.
556
+ (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] This paper is not about computational complexity and/or execution time.
557
+
558
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
559
+
560
+ (a) If your work uses existing assets, did you cite the creators? [Yes] See supplementary material for the citation to the publicly available repository that we used.
561
+ (b) Did you mention the license of the assets? [N/A]
562
+ (c) Did you include any new assets either in the supplemental material or as a URL? [N/A] We are not using any new assets.
563
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
564
+
565
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
566
+
567
+ 5. If you used crowdsourcing or conducted research with human subjects...
568
+
569
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
570
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
571
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/S1Q79heRW/S1Q79heRW.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # UNSUPERVISED LEARNING OF ENTAILMENT-VECTOR WORD EMBEDDINGS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Entailment vectors are a principled way to encode in a vector what information is known and what is unknown. They are designed to model relations where one vector should include all the information in another vector, called entailment. This paper investigates the unsupervised learning of entailment vectors for the semantics of words. Using simple entailment-based models of the semantics of words in text (distributional semantics), we induce entailment-vector word embeddings which outperform the best previous results for predicting entailment between words, in unsupervised and semi-supervised experiments on hyponymy.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Modelling entailment, is a fundamental issue in the semantics of natural language, and there has been a lot of interest in modelling entailment using vector-space representations. But, until recently, unsupervised models such as word embeddings have performed surprisingly poorly at detecting entailment Weeds et al. (2014); Shwartz et al. (2017), not beating a frequency baseline Weeds et al. (2014). Entailment is the relation of information inclusion, meaning that $y$ entails $x$ if and only if everything that is known given $x$ is also known given $y$ . As such, representations which support entailment need to encode not just what information is known, but also what information is unknown. The results on lexical entailment seem to indicate that standard word embeddings, such as Word2Vec, do not reflect the relative abstractness of words, and in this sense do not reflect how much information is left unspecified by a word.
12
+
13
+ In contrast with the majority of the work in this area, which simply uses existing vector-space embeddings of words in their models of entailment, recent work has addressed this issue by proposing new vector-space models which are specifically designed to capture entailment. In particular, Vilnis & McCallum (2015) use variances to represent the uncertainty in values in a continuous space, and Henderson & Popa (2016) use probabilities to represent uncertainty about a discrete space. We will refer to the latter as the “entailment-vectors” framework. In this work, we use this framework from Henderson & Popa (2016) to develop new entailment-based models for the unsupervised learning of word embeddings, and demonstrate that these embeddings achieve unprecedented results in predicting entailment between words.
14
+
15
+ Our unsupervised models use the distribution of words in a large text corpus to induce vector-space representations of the meaning of words. This approach to word meaning is called distributional semantics. The distributional semantic hypothesis (Harris, 1954) says that the meaning of a word is reflected in the distribution of text contexts which it appears in. Many methods (e.g. (Deerwester et al., 1990; Schutze, 1993; Mikolov et al., 2013a) and this paper) have been proposed for inducing ¨ vector representations of the meaning of words (word embeddings) from the distribution of wordcontext pairs found in large corpora of text.
16
+
17
+ In the framework of Henderson & Popa (2016), each dimension of the vector-space represents something that might be known, and continuous vectors represent probabilities of these features being known or unknown. Henderson & Popa (2016) illustrate their framework by proposing a reinterpretation of existing Word2Vec (Mikolov et al., 2013a) word embeddings which maps them into entailment vectors, which in turn successfully predict entailment between words (hyponymy). To motivate this reinterpretation of existing word embeddings, they propose a model of distributional semantics and argue that the Word2Vec training objective approximates the training objective of this distributional semantic model given the mapping.
18
+
19
+ In this paper, we implement this distributional semantic model and train new word embeddings using the exact objective. Based on our analysis of this model, we propose that this implementation can be done in several ways, including the one which motivates Henderson & Popa (2016)’s reinterpretation of Word2Vec embeddings. In each case, training results in entailment vector embeddings, which directly encode what is known and unknown given a word, and thus do not require any reinterpretation to predict hyponymy.
20
+
21
+ To model the semantic relationship between a word and its context, the distributional semantic model postulates a latent pseudo-phrase vector for the unified semantics of the word and its neighbouring context word. This latent vector must entail the features in both words’ vectors and must be consistent with a prior over semantic vectors, thereby modelling the redundancy and consistency between the semantics of two neighbouring words.
22
+
23
+ Based on our analysis of this entailment-based distributional semantic model, we hypothesise that the word embeddings suggested by Henderson & Popa (2016) are in fact not the best way to extract information about the semantics of a word from this model. They propose using a vector which represents the evidence about known features given the word (henceforth called the likelihood vectors). We propose to instead use a vector which represents the posterior distribution of known features for a phrase containing only the word. This posterior vector includes both the evidence from the word and its indirect consequences via the constraints imposed by the prior. Our efficient implementation of this model allows us to test this hypothesis by outputting either the likelihood vectors or the posterior vectors as word embeddings.
24
+
25
+ To evaluate these word embeddings, we predict hyponymy between words, in both an unsupervised and semi-supervised setting. Given the word embeddings for two words, we measure whether they are a hypernym-hyponym pair using an entailment operator from (Henderson & Popa, 2016) applied to the two embeddings. We find that using the likelihood vectors performs as well as reinterpreting Word2Vec embeddings, confirming the claims of equivalence by Henderson & Popa (2016). But we also find that using the posterior vectors performs significantly better, confirming our hypothesis that posterior vectors are better, and achieving the best published results on this benchmark dataset. In addition to these unsupervised experiments, we evaluate in a semi-supervised setting and find a similar pattern of results, again achieving state-of-the-art performance.
26
+
27
+ In the rest of this paper, section 2 presents the formal framework we use for modelling entailment in a vector space, the distributional semantic models, and how these are used to predict hyponymy. Section 3 discusses additional related work, and then section 4 presents the empirical evaluation on hyponymy detection, in both unsupervised and semi-supervised experiments. Some additional analysis of the induced vectors is presented in section 4.4.
28
+
29
+ # 2 DISTRIBUTIONAL SEMANTIC ENTAILMENT
30
+
31
+ Distributional semantics uses the distribution of contexts in which a word occurs to induce the semantics of the word (Harris, 1954; Deerwester et al., 1990; Schutze, 1993). The Word2Vec model ¨ (Mikolov et al., 2013a) introduced a set of refinements and computational optimisations of this idea which allowed the learning of vector-space embeddings for words from very large corpora with very good semantic generalisation. Henderson & Popa (2016) motivate their reinterpretation the Word2Vec Skipgram (Mikolov et al., 2013a) distributional semantic model with an entailment-based model of the semantic relationship between a word and its context words. We start by explaining our interpretation of the distributional semantic model proposed by Henderson & Popa (2016), and then propose our alternative models.
32
+
33
+ Henderson & Popa (2016) postulate a latent vector $y$ which is the consistent unification of the features of the middle word $x _ { e } ^ { \prime }$ and the neighbouring context word $x _ { e }$ , illustrated on the left in figure 1.1 We can think of the latent vector $y$ as representing the semantics of a pseudo-phrase consisting of the two words. The unification requirement is defined as requiring that $y$ entail both words, written $y \Rightarrow x _ { e } ^ { \prime }$ and ${ y } \Rightarrow x _ { e }$ . The consistency requirement is defined as $y$ satisfying a prior $\theta ( y )$ , which embodies all the the constraints and correlations between features in the vector. This approach models the relationship between the semantics of a word and its context as being redundant and consistent.
34
+
35
+ ![](images/2e409103eb26df57b85087dde2856086923e32a2453e6248891724d852ffcf69.jpg)
36
+ Figure 1: The distributional semantic model of a word and its context (left), and its approximation in the word2hyp models (right).
37
+
38
+ If $x _ { e } ^ { \prime }$ and $x _ { e }$ share features, then it will be easier for $y$ to satisfy both $y \Rightarrow x _ { e } ^ { \prime }$ and $y { \Rightarrow } x _ { e }$ . If the features of $x _ { e } ^ { \prime }$ and $x _ { e }$ are consistent, then it will be easier for $y$ to satisfy the prior $\theta ( y )$ .
39
+
40
+ # 2.1 THE REINTERPRETATION OF WORD2VEC
41
+
42
+ Henderson & Popa (2016) formalise the above model using their entailment-vectors framework. This framework models distributions over discrete vectors where a 1 in position $i$ means feature $i$ is known and a 0 means it is unknown. Entailment $y \Rightarrow x$ requires that the 1s in $x$ are a subset of the 1s in $y$ , so $1 \Rightarrow 1$ , $0 { \Rightarrow } 0$ and $1 { \Rightarrow } 0$ , but $0 { \neq } 1$ . Distributions over these discrete vectors are represented as continuous vectors of log-odds $X$ , so $P ( x _ { i } { = } 1 ) = \sigma ( X _ { i } )$ , where $\sigma$ is the logistic sigmoid. The probability of entailment $y \Rightarrow x$ between two such “entailment vectors” $Y , X$ can be measured using the operator $\bigcirc$ :2
43
+
44
+ $$
45
+ \begin{array} { c } { { \log P ( y { \Rightarrow } x \mid Y , X ) \approx } } \\ { { Y { \otimes } X \equiv \sigma ( - Y ) \cdot \log \sigma ( - X ) } } \end{array}
46
+ $$
47
+
48
+ For each feature $i$ in the vector, it calculates the expectation according to $P ( y _ { i } )$ that, either $y _ { i } { = } 1$ and thus the log-probability is zero, or $y _ { i } { = } 0$ and thus the log-probability is $\log P ( x _ { i } { = } 0 )$ (noting that $\sigma ( - X _ { i } ) = ( 1 - \sigma ( X _ { i } ) ) \approx P ( x _ { i } { = } 0 ) )$ .
49
+
50
+ Henderson & Popa (2016) formalise the model on the left in figure 1 by first inferring the optimal latent vector distribution $Y$ (equation (3)), and then scoring how well the entailment and prior constraints have been satisfied (equation (2)).
51
+
52
+ $$
53
+ \begin{array} { r l } & { \underset { Y } { \operatorname* { m a x } } \big ( E _ { Y , X _ { e } ^ { \prime } , X _ { e } } \log P ( y \Rightarrow x _ { e } ^ { \prime } , y \Rightarrow x _ { e } , y ) \big ) } \\ & { \quad \approx Y \otimes X _ { e } ^ { \prime } + Y \otimes X _ { e } + ( - \sigma ( - Y ) ) \cdot \theta ( Y ) } \end{array}
54
+ $$
55
+
56
+ where
57
+
58
+ $$
59
+ Y = - \log \sigma ( - X _ { e } ^ { \prime } ) + - \log \sigma ( - X _ { e } ) + \theta ( Y )
60
+ $$
61
+
62
+ where $E _ { Y , X _ { e } ^ { \prime } , X _ { e } }$ is the expectation over the distribution defined by the log-odds vectors $Y , X _ { e } ^ { \prime } , X _ { e }$ , and log and $\sigma$ are applied componentwise. The term $\theta ( Y )$ is used to indicate the net effect of the prior on the vector $Y$ . Note that, in the formula (3) for inferring $Y$ , the contribution $- \log \sigma ( - X )$ of each word vector is also a component of the definition of $Y \odot X$ from equation (1). In this way, the score for measuring how well the entailment has been satisfied is using the same approximation as used in the inference to satisfy the entailment constraint. This function $- \log \sigma ( - X )$ is a nonnegative transform of $X$ , as shown in figure 2. Intuitively, for an entailed vector $x$ , we only care about the probability that $x _ { i } { = } 1$ (positive log-odds $X _ { i }$ ), because that constrains the entailing vector $y$ to have $y _ { i } { = } 1$ (adding to the log-odds $Y _ { i }$ ).
63
+
64
+ The above model cannot be mapped directly to the Word2Vec model because Word2Vec has no way to model the prior $\theta ( Y )$ . On the other hand, the Word2Vec model postulates two vectors for every word, compared to one in the above model. Henderson & Popa (2016) propose an approximation to the above model which incorporates the prior into one of the two vectors, resulting in each word having one vector $X _ { e }$ as above plus another vector $X _ { p }$ with the prior incorporated.
65
+
66
+ $$
67
+ X _ { p } \approx - \log \sigma ( - X _ { e } ) + \theta ( Y )
68
+ $$
69
+
70
+ ![](images/7431319ff0ba44d4033a6901d56a88b7a22ee12a3ce07fa20460fac547eb6697.jpg)
71
+ Figure 2: The function $- \log \sigma ( - X )$ used in inference and the $\bigcirc$ operator, versus $X$
72
+
73
+ Both vectors $X _ { e }$ and $X _ { p }$ are parameters of the model, which need to be learned. Thus, there is no need to explicitly model the prior, thereby avoiding the need to choose a particular form for the prior $\theta$ , which in general may be very complex.
74
+
75
+ This gives us the following score for how well the constraints of this model can be satisfied.
76
+
77
+ $$
78
+ \begin{array} { r l } & { \underset { Y } { \operatorname* { m a x } } \big ( E _ { Y , X _ { e } ^ { \prime } , X _ { p } } \log P ( y \Rightarrow x _ { e } ^ { \prime } , y \Rightarrow x _ { e } , y ) \big ) } \\ & { \quad \approx Y \otimes X _ { e } ^ { \prime } + ( - \sigma ( - Y ) ) \cdot X _ { p } } \end{array}
79
+ $$
80
+
81
+ where
82
+
83
+ $$
84
+ Y = - \log \sigma ( - X _ { e } ^ { \prime } ) + X _ { p }
85
+ $$
86
+
87
+ In (Henderson & Popa, 2016), score (5) is only used to provide a reinterpretation of Word2Vec word embeddings. They show that a transformation of the vectors output by Word2Vec (“W2V u.d.
88
+
89
+ # 2.2 NEW DISTRIBUTIONAL SEMANTIC MODELS
90
+
91
+ In this paper, we implement distributional semantic models based on score (5) and use them to train new word embeddings. We call these models the Word2Hyp models, because they are based on Word2Vec but are designed to predict hyponymy.
92
+
93
+ To motivate our models, we provide a better understanding of the model behind score (5). In particular, we note that although we want $X _ { p }$ to approximate the effects $\theta ( Y )$ of the prior as in equation 4, in fact $X _ { p }$ is only dependent on one of the two words, and thus can only incorporate the portion of $\theta ( Y )$ which arises from that one word. Thus, a better understanding of $X _ { p }$ is provided by equation (7).
94
+
95
+ $$
96
+ X _ { p } \approx - \log \sigma ( - X _ { e } ) + \theta ( X _ { p } )
97
+ $$
98
+
99
+ In this framework, equation (7) is exactly the same formula as would be used to infer the vector for a single-word phrase (analogously to equation (3)).
100
+
101
+ This interpretation of the approximate model in equation 5 is given on the right side of figure 1. As shown, $X _ { p }$ is interpreted as the posterior vector for a single-word phrase, which incorporates the likelihood and the prior for that word. In contrast, $X _ { e } ^ { \prime }$ is just the likelihood, which provides the evidence about the features of $Y$ from the other word, without including the indirect consequences of this information. This model, as argued above, approximates the model on the left side in Figure 1. But the grey part of the figure does not need to be explicitly modelled because $X _ { p }$ is trained directly.
102
+
103
+ This interpretation suggests that the posterior vector $X _ { p }$ should be a better reflection of the semantics of the word than the likelihood vector $X _ { e }$ , since it includes both the direct evidence for some features and their indirect consequences for other features. We test this hypothesis empirically in Section 4.
104
+
105
+ To implement our distributional semantic models, we define new versions of the Word2Vec code (Mikolov et al., 2013a;b). The Word2Vec code trains two vectors for each word, where negative sampling is applied to one of these vectors, and the other is the output vector. This applies to both the Skipgram and CBOW versions of training. Both versions also use a dot product between vectors to try to predict whether the example is a positive or negative sample. We simply replace this dot product with score (5) directly in the Word2Vec code, leaving the rest of the algorithm unchanged. We make this change in one of two ways, one where the output vector corresponds to the likelihood vector $X _ { e }$ , and one where the output vector corresponds to the posterior vector $X _ { p }$ . We will refer to the model where $X _ { p }$ is output as the “posterior” model, and the model where $X _ { e }$ is output as the “likelihood” model. Both these methods can be applied to both the Skipgram and CBOW models, giving us four different models to evaluate.
106
+
107
+ # 2.3 MODELLING HYPONYMY
108
+
109
+ The proposed distributional semantic models output a word embedding vector for every word in the vocabulary, which are directly interpretable as entailment vectors in the entailment-vectors framework. Thus, to predict lexical entailment between two words, we can simply apply the $\bigcirc$ operator to their vectors, to get an approximation of the log-probability of entailment.
110
+
111
+ We evaluate these entailment predictions on hyponymy detection. Hyponym-hypernym pairs should have associated embeddings $Y , X$ which have a higher entailment scores $Y \odot X$ than other pairs. We rank the word pairs by the entailment scores for their embeddings, and evaluate this ranked list against the gold hyponymy annotations. We evaluate on hyponymy detection because it reflects a direct form of lexical entailment; the semantic features of a hypernym (e.g. “animal”) should be included in the semantic features of the hyponym (e.g. “cat”). Other forms of lexical entailment would benefit from some kind of reasoning or world knowledge, which we leave to future work on compositional models.
112
+
113
+ # 3 RELATED WORK
114
+
115
+ In this paper we propose a distributional semantic model which is based on entailment. Most of the work on modelling entailment with vector space embeddings has simply used distributional semantic vectors within a model of entailment, and is therefore not directly relevant here. See (Shwartz et al., 2017) for a comprehensive review of such measures. Shwartz et al. (2017) evaluate these measures as unsupervised models of hyponymy detection and run experiments on a number of hyponymy datasets. We report their best comparable result in Table 1.
116
+
117
+ Vilnis & McCallum (2015) propose an unsupervised model of entailment in a vector space, and evaluate it on hyponymy detection. Instead of representing words as a point in a vector space, they represent words as a Gaussian distribution over points in a vector space. The variance of this distribution in a given dimension indicates the extent to which the dimension’s feature is unknown, so they use KL-divergence to detect hyponymy relations. Although this model has a nice theoretical motivation, the word representations are more complex and training appears to be more computationally expensive than the method proposed here. We empirically compare our models to their hyponymy detection accuracy and find equivalent results.
118
+
119
+ The semi-supervised model of Kruszewski et al. (2015) learns a discrete Boolean vector space for predicting hyponymy. But they do not propose any unsupervised method for learning these vectors.
120
+
121
+ Weeds et al. (2014) report hyponymy detection results for a number of unsupervised and semisupervised models. They propose a semi-supervised evaluation methodology where the words in the training and test sets are disjoint, so that the supervised component must learn about the unsupervised vector space and not about the individual words. Following Henderson & Popa (2016), we replicate their experimental setup in our evaluations, for both unsupervised and semi-supervised models, and compare to the best results among the models evaluated by Weeds et al. (2014), Shwartz et al. (2017) and Henderson & Popa (2016).
122
+
123
+ # 4 EVALUATION OF WORD EMBEDDINGS
124
+
125
+ We evaluate on hyponymy detection in both a fully unsupervised setup and a semi-supervised setup. In the semi-supervised setup, we use labelled hyponymy data to train a linear mapping from the unsupervised vector space to a new vector space with the objective of correctly predicting hyponymy relations in the new vector space. This prediction is done with the same (or equivalent) entailment operator as for the unsupervised experiments (called “map $\bigcirc$ ” in Table 2).
126
+
127
+ Table 1: Hyponymy detection accuracies $( 5 0 \% A c c )$ and average precision $( A \nu e P r e c )$ , in the unsupervised experiments. For the accuracies, \* marks a significant improvement over the higher rows.
128
+
129
+ <table><tr><td>embeddings</td><td>operator</td><td>50% Acc AvePrec</td></tr><tr><td>Weeds et.al., 2014 Shwartz et.al., 2017</td><td></td><td>58% 1 44.1% 1</td></tr><tr><td>W2V GoogleNews</td><td>u.d.</td><td>64.5%* 1</td></tr><tr><td>W2V CBOW W2H Skip likelihood</td><td>u.d. ② ③</td><td>53.2% 55.2% 59.5% 57.8%</td></tr><tr><td>W2H CBOW] likelihood</td><td>③</td><td>61.8% 66.4%</td></tr><tr><td>W2V Skip</td><td>u.d.</td><td>62.1% 67.6%</td></tr><tr><td>W2H CBOW</td><td>posterior ③</td><td>68.1%* 70.8%</td></tr><tr><td>W2H [Skip</td><td>posterior 国</td><td>69.6% 68.9%</td></tr></table>
130
+
131
+ We replicate the experimental setup of Weeds et al. (2014), using their selection of hyponymhypernym pairs from the BLESS dataset (Baroni & Lenci, 2011), which consists of noun-noun pairs, including $50 \%$ positive hyponymy pairs plus $50 \%$ negative pairs consisting of some other hyponymy pairs reversed, some pairs in other semantic relations, and some random pairs. As in (Weeds et al., 2014), our semi-supervised experiments use ten-fold cross validation, where each fold has items removed from the training set if they contain a word that also occurs in the testing set.
132
+
133
+ The word embedding vectors which we train have 200 dimensions and were trained using our Word2Hyp modification of the Word2Vec code (with default settings), trained on a corpus of half a billion words of Wikipedia. We also replicate the approach of Henderson & Popa (2016) by training Word2Vec embeddings on this data.
134
+
135
+ To quantify performance on hyponymy detection, for each model we rank the list of pairs according to the score given by the model, and report two measures of performance for this ranked lists. The “ $50 \%$ Acc” measure treats the first half of the list as labelled positive and the second half as labelled negative. This is motivated by the fact that we know a priori that the proportion of positive examples has been artificially set to (approximately) $50 \%$ . Average precision is a measure of the accuracy for ranked lists, used in Information Retrieval and advocated as a measure of hyponymy detection by Vilnis & McCallum (2015). For each positive example, precision is measured at the threshold just below that example, and these precision scores are averaged over positive examples. For cross validation, we average over the union of positive examples in all the test sets. Both these measures are reported (when available) in Tables 1 and 2.
136
+
137
+ # 4.1 UNSUPERVISED HYPONYMY DETECTION
138
+
139
+ The first set of experiments evaluate the different embeddings in their unsupervised models of hyponymy detection. Results are shown in Table 1. Our principal point of comparison is the best results from (Henderson & Popa, 2016) (called “W2V GoogleNews” in Table 1). They use the preexisting publicly available GoogleNews word embeddings, which were trained with the Word2Vec software on 100 billion words of the GoogleNews dataset, and have 300 dimensions. To provide a more direct comparison, we replicate the model of Henderson & Popa (2016) but using the same embedding training setup as for our Word2Hyp model (“W2V Skip”). Both cases use their proposed reinterpretation of these vectors for predicting entailment $( ^ { 6 } u . d . \odot ^ { 7 } )$ . We also report the best results from Weeds et al. (2014) and the best comparable results from (Shwartz et al., 2017). For our proposed Word2Hyp distributional semantic models (“W2H”), we report results for the four combinations of using the CBOW or Skipgram (“Skip”) model to train the likelihood or posterior vectors.
140
+
141
+ The two Word2Hyp models with likelihood vectors perform slightly better than the best unsupervised model of Weeds et al. (2014), but similarly. The reinterpretation of Word2Vec vectors (“W2V GoogleNews $u . d . \odot ^ { \ ' } )$ ) performs significantly better, but when the same method is applied to the smaller Wikipedia corpus (“W2V Skip $u . d . \odot ^ { \ ' } ,$ ), this difference all but disappears. This confirms the hypothesis of Henderson & Popa (2016) that the reinterpretation of Word2Vec vectors and the likelihood vectors from Word2Hyp are approximately equivalent.
142
+
143
+ Table 2: Hyponymy detection accuracies $50 \%$ Acc) and average precision (Ave Prec), in the semisupervised experiments.
144
+
145
+ <table><tr><td rowspan=1 colspan=2>embeddings operator</td><td rowspan=1 colspan=1>50% AccAvePrec</td></tr><tr><td rowspan=1 colspan=2>Weeds et.al., 2014</td><td rowspan=1 colspan=1>75% 1</td></tr><tr><td rowspan=1 colspan=2>W2VGoogleNews map①</td><td rowspan=1 colspan=1>80.1% 1</td></tr><tr><td rowspan=2 colspan=2>W2VSkip map③W2H【CBOW】/ likelihoodmap②W2VCBOW map②W2HSkip likelihoodmap①W2HSkip posteriormap③W2HCBOW posteriormap③</td><td rowspan=2 colspan=1>81.9% 88.3%83.3% 90.3%84.6% 91.5%84.8% 90.9%85.5% 91.3%86.0% 92.8%</td></tr><tr><td rowspan=1 colspan=1>map②map①</td></tr></table>
146
+
147
+ However, even with this smaller corpus, using the proposed posterior vectors from the Word2Hyp model are significantly more accurate than the reinterpretation of Word2Vec vectors. This confirms the hypothesis that the posterior vectors from the Word2Hyp model are a better model of the semantics of a word than the likelihood vectors suggested by Henderson & Popa (2016).
148
+
149
+ Using the CBOW model or the Skipgram model makes only a small difference. The average precision score shows the same pattern as the accuracy.
150
+
151
+ To allow a direct comparison to the model of Vilnis & McCallum (2015), we also evaluated the unsupervised models on the hyponymy data from (Baroni et al., 2012), which is not as carefully designed to evaluate hyponymy as the (Weeds et al., 2014) data. Both the likelihood and posterior vectors of the Word2Hyp CBOW model achieved average precision $( 8 1 \% , 8 0 \% )$ which is not significantly different from the best model of Vilnis & McCallum (2015) $( 8 0 \% )$ .
152
+
153
+ # 4.2 SEMI-SUPERVISED HYPONYMY DETECTION
154
+
155
+ The semi-supervised experiments train a linear mapping from each unsupervised vector space to a new vector space, where the entailment operator $\bigcirc$ is used to predict hyponymy (“map $\odot ^ { \prime \prime }$ ).
156
+
157
+ The semi-supervised results (shown in Table 2)3 no longer show an advantage of GoogleNews vectors over Wikipedia vectors for the reinterpretation of Word2Vec vectors. And the advantage of posterior vectors over the likelihood vectors is less pronounced. However, the two posterior vectors still perform much better than all the previously proposed models, achieving $86 \%$ accuracy and nearly $93 \%$ average precision. These semi-supervised results confirm the results from the unsupervised experiments, that Word2Vec embeddings and Word2Hyp likelihood embeddings perform similarly, but that using the posterior vectors of the Word2Hyp model perform better.
158
+
159
+ # 4.3 TRAINING TIMES
160
+
161
+ Because the similarity measure in equation 5 is more complex than a simple dot product, training a new distributional semantic model is slower than with the original Word2Vec code. In our experiments, training took about 8 times longer for the CBOW model and about 15 times longer for the Skipgram model. This meant that Word2Hyp CBOW trained about 8 times faster than Word2Hyp Skipgram. As in the Word2Vec code, we used a quadrature approximation (i.e. a look-up table) to speed up the computation of the sigmoid function, and we added the same technique for computing the log-sigmoid function.
162
+
163
+ # 4.4 DISCUSSION
164
+
165
+ The relative success of our distributional semantic models at unsupervised hyponymy detection indicates that they are capturing some aspects of lexical entailment. But the gap between the unsupervised and semi-supervised results indicates that other features are also being captured. This is not surprising, since many other factors influence the co-occurrence statistics of words.
166
+
167
+ Table 3: Ranking of the abstractness $( \mathbf { 0 } \otimes X )$ of frequent words from the hyponymy dataset, using Word2Hyp-Skipgram-posterior embeddings.
168
+
169
+ <table><tr><td colspan="2">most abstract</td><td colspan="2">least abstract</td></tr><tr><td>something</td><td>necessity</td><td></td><td>fork</td></tr><tr><td>anything</td><td>sense</td><td>hockey</td><td>&#x27;housing</td></tr><tr><td>end</td><td>back</td><td>republican</td><td>elm</td></tr><tr><td>inside</td><td>saw</td><td>hull</td><td>primate</td></tr><tr><td>good</td><td>:</td><td>cricket</td><td>fur</td></tr></table>
170
+
171
+ To get a better understanding of these word embeddings, we ranked them by degree of abstractness. Table 3 shows the most abstract and least abstract frequent words that occur in the hyponymy data. To measure abstractness, we used our best unsupervised embeddings and measured how well they are entailed by the zero log-odds vector, which represents a uniform half probability of knowing each feature. For a vector to be entailed by the zero vector, it must be that its features are mostly probably unknown. The less you know given a word, the more abstract it is.
172
+
173
+ An initial ranking found that six of the top ten abstract words had frequency less than 300 in the Wikipedia data, but none of the ten least abstract terms were infrequent. This indicates a problem with the current method, since infrequent words are generally very specific (as was the case for these low-frequency words, submissiveness, implementer, overdraft, ruminant, warplane, and londoner). Although this is an interesting characteristic of the method, the terms themselves seem to be noise, so we rank only terms with frequency greater than 300.
174
+
175
+ The most abstract terms in table 3 include some clearly semantically abstract terms, in particular something and anything are ranked highest. Others may be affected by lexical ambiguity, since the model does not disambiguate words by part-of-speech (such as end, good, sense, back, and saw). The least abstract terms are mostly very semantically specific, but it is indicative that this list includes primate, which is an abstract term in Zoology but presumably occurs in very specific contexts in Wikipedia.
176
+
177
+ # 5 CONCLUSIONS
178
+
179
+ In this paper, we propose unsupervised methods for efficiently training word embeddings which capture semantic entailment. This work builds on the work of Henderson & Popa (2016), who propose the entailment-vectors framework for modelling entailment in a vector-space, and a distributional semantic model for reinterpreting Word2Vec word embeddings. Our contribution differs from theirs in that we provide a better understanding of their distributional semantic model, we choose different vectors in the model to use as word embeddings, and we train new word embeddings using our modification of the Word2Vec code. Empirical results on unsupervised and semi-supervised hyponymy detection confirm that the model’s likelihood vectors, which Henderson & Popa (2016) suggest to use, do indeed perform equivalently to their reinterpretation of Word2Vec vectors. But these experiments also show that the model’s posterior vectors, which we propose to use, perform significantly better, outperforming all previous results on this benchmark dataset.
180
+
181
+ The success of these unsupervised models demonstrates that the proposed distributional semantic models are effective at extracting information about lexical entailment from the redundancy and consistency of words with their contexts in large text corpora. The use of the entailment-vectors framework to efficiently model entailment relations has been crucial to this success. This result suggests future work using the entailment-vectors framework in unsupervised models that leverage other distributional evidence about semantics, particularly in models of compositional semantics. The merger of word embeddings with compositional semantics to get representation learning for larger units of text is currently an important challenge in the semantics of natural language, and the work presented in this paper makes a significant contribution towards solving it.
182
+
183
+ # REFERENCES
184
+
185
+ Marco Baroni and Alessandro Lenci. How we blessed distributional semantic evaluation. In Proceedings of the GEMS 2011 Workshop on GEometrical Models of Natural Language Semantics,
186
+
187
+ GEMS ’11, pp. 1–10. Association for Computational Linguistics, 2011. ISBN 978-1-937284-16- 9. URL http://dl.acm.org/citation.cfm?id=2140490.2140491.
188
+
189
+ Marco Baroni, Raffaella Bernardi, Ngoc-Quynh Do, and Chung-chieh Shan. Entailment above the word level in distributional semantics. In Proceedings of the 13th Conference of the European Chapter of the Association for Computational Linguistics (EACL), pp. 23–32, Avignon, France, 2012. Association for Computational Linguistics. URL http://www.aclweb.org/ anthology/E12-1004.
190
+
191
+ Scott Deerwester, Susan T. Dumais, George W. Furnas, Thomas K. Landauer, and Richard Harshman. Indexing by latent semantic analysis. Journal of the American Society for Information Science, 41(6):391–407, 1990.
192
+
193
+ Zellig S. Harris. Distributional structure. ${ ; i \zeta W O R D ; / i \zeta }$ , 10(2-3):146–162, 1954. doi: 10.1080/ 00437956.1954.11659520. URL http://dx.doi.org/10.1080/00437956.1954. 11659520.
194
+
195
+ James Henderson and Diana Popa. A vector space for distributional semantics for entailment. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2052–2062, Berlin, Germany, August 2016. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P16-1193.
196
+
197
+ Germn Kruszewski, Denis Paperno, and Marco Baroni. Deriving boolean structures from distributional vectors. Transactions of the Association for Computational Linguistics, 3:375–388, 2015. ISSN 2307-387X. URL https://tacl2013.cs.columbia.edu/ojs/index.php/ tacl/article/view/616.
198
+
199
+ Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. CoRR, abs/1301.3781, 2013a. URL http://arxiv.org/abs/ 1301.3781.
200
+
201
+ Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In C.J.C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K.Q. Weinberger (eds.), Advances in Neural Information Processing Systems 26, pp. 3111–3119. Curran Associates, Inc., 2013b. URL http://papers.nips.cc/paper/ 5021-distributed-representations-of-words-and-phrases-and-their-compositionalit pdf.
202
+
203
+ Hinrich Schutze. Word space. In ¨ Advances in Neural Information Processing Systems 5, pp. 895– 902. Morgan Kaufmann, 1993.
204
+
205
+ Vered Shwartz, Enrico Santus, and Dominik Schlechtweg. Hypernyms under siege: Linguisticallymotivated artillery for hypernymy detection. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pp. 65–75, Valencia, Spain, April 2017. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/E17-1007.
206
+
207
+ Luke Vilnis and Andrew McCallum. Word representations via Gaussian embedding. In Proceedings of the International Conference on Learning Representations 2015 (ICLR), 2015. URL http: //arxiv.org/abs/1412.6623.
208
+
209
+ Julie Weeds, Daoud Clarke, Jeremy Reffin, David Weir, and Bill Keller. Learning to distinguish hypernyms and co-hyponyms. In Proceedings of COLING 2014, the 25th International Conference on Computational Linguistics: Technical Papers, pp. 2249–2259, Dublin, Ireland, 2014. Dublin City University and Association for Computational Linguistics. URL http: //www.aclweb.org/anthology/C14-1212.
md/train/S1fQSiCcYm/S1fQSiCcYm.md ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # UNDERSTANDING AND IMPROVING INTERPOLATION IN AUTOENCODERS VIA AN ADVERSARIAL REGULARIZER
2
+
3
+ David Berthelot∗ Google Brain dberth@google.com
4
+
5
+ Colin Raffel∗
6
+ Google Brain
7
+ craffel@gmail.com
8
+ Aurko Roy
9
+ Google Brain
10
+ aurkor@google.com
11
+ Ian Goodfellow
12
+ Google Brain
13
+ goodfellow@google.com
14
+
15
+ # ABSTRACT
16
+
17
+ Autoencoders provide a powerful framework for learning compressed representations by encoding all of the information needed to reconstruct a data point in a latent code. In some cases, autoencoders can “interpolate”: By decoding the convex combination of the latent codes for two datapoints, the autoencoder can produce an output which semantically mixes characteristics from the datapoints. In this paper, we propose a regularization procedure which encourages interpolated outputs to appear more realistic by fooling a critic network which has been trained to recover the mixing coefficient from interpolated data. We then develop a simple benchmark task where we can quantitatively measure the extent to which various autoencoders can interpolate and show that our regularizer dramatically improves interpolation in this setting. We also demonstrate empirically that our regularizer produces latent codes which are more effective on downstream tasks, suggesting a possible link between interpolation abilities and learning useful representations.
18
+
19
+ # 1 INTRODUCTION
20
+
21
+ One goal of unsupervised learning is to uncover the underlying structure of a dataset without using explicit labels. A common architecture used for this purpose is the autoencoder, which learns to map datapoints to a latent code from which the data can be recovered with minimal information loss. Typically, the latent code is lower dimensional than the data, which indicates that autoencoders can perform some form of dimensionality reduction. For certain architectures, the latent codes have been shown to disentangle important factors of variation in the dataset which makes such models useful for representation learning (Chen et al., 2016a; Higgins et al., 2017). In the past, they were also used for pre-training other networks by being trained on unlabeled data and then being stacked to initialize a deep network (Bengio et al., 2007; Vincent et al., 2010). More recently, it was shown that imposing a prior on the latent space allows autoencoders to be used for probabilistic or generative modeling (Kingma & Welling, 2014; Rezende et al., 2014; Makhzani et al., 2015).
22
+
23
+ In some cases, autoencoders have shown the ability to interpolate. Specifically, by mixing codes in latent space and decoding the result, the autoencoder can produce a semantically meaningful combination of the corresponding datapoints. Interpolation has been frequently reported as a qualitative experimental result in studies about autoencoders (Dumoulin et al., 2016; Bowman et al., 2015; Roberts et al., 2018; Mescheder et al., 2017; Mathieu et al., 2016; Ha & Eck, 2018) and latent-variable generative models in general (Dinh et al., 2016; Radford et al., 2015; van den Oord et al., 2016). The ability to interpolate can be useful in its own right e.g. for creative applications (Carter & Nielsen, 2017). However, it also indicates that the autoencoder can “extrapolate” beyond the training data and has learned a latent space with a particular structure. Specifically, if interpolating between two points in latent space produces a smooth semantic warping in data space, this suggests that nearby points in latent space are semantically similar. A visualization of this idea is shown in fig. 1, where a smooth interpolation between a “2” and a “9” suggests that the 2 is surrounded by semantically similar points, i.e. other 2s. This property may suggest that an autoencoder which interpolates well could also provide a good learned representation for downstream tasks because similar points are clustered. If the interpolation is not smooth, there may be “discontinuities” in latent space which could result in the representation being less useful as a learned feature. This connection between interpolation and a “flat” data manifold has been explored in the context of unsupervised representation learning (Bengio et al., 2013b) and regularization (Verma et al., 2018).
24
+
25
+ ![](images/5630761622d92221bde976e9ee4da80f4d47ac78ed0050620eafd2c13a506e28.jpg)
26
+ Figure 1: Successful interpolation suggests that semantically similar points may be clustered together in latent space.
27
+
28
+ ![](images/611fdc6f66b401e9eaa12590a538cddbffa0dc1156d6e0afd94a714f10b7e1a2.jpg)
29
+ Figure 2: Adversarially Constrained Autoencoder Interpolation (ACAI). A critic network is fed interpolants and reconstructions and tries to predict the interpolation coefficient $\alpha$ corresponding to its input (with $\alpha = 0$ for reconstructions). The autoencoder is trained to fool the critic into outputting $\alpha = 0$ for interpolants.
30
+
31
+ Given the widespread use of interpolation as a qualitative measure of autoencoder performance, we believe additional investigation into the connection between interpolation and representation learning is warranted. Our goal in this paper is threefold: First, we introduce a regularization strategy with the specific goal of encouraging improved interpolations in autoencoders (section 2); second, we develop a synthetic benchmark where the slippery concept of a “semantically meaningful interpolation” is quantitatively measurable (section 3.1) and evaluate common autoencoders on this task (section 3.2); and third, we confirm the intuition that good interpolation can result in a useful representation by showing that the improved interpolation ability produced by our regularizer elicits improved representation learning performance on downstream tasks (section 4). We also make our codebase available1 which provides a unified implementation of many common autoencoders including our proposed regularizer.
32
+
33
+ # 2 AN ADVERSARIAL REGULARIZER FOR IMPROVING INTERPOLATIONS
34
+
35
+ Autoencoders, also called auto-associators (Bourlard & Kamp, 1988), consist of the following structure: First, an input $x \in \mathbb { R } ^ { d _ { x } }$ is passed through an “encoder” $z = f _ { \boldsymbol { \theta } } ( x )$ parametrized by $\theta$ to obtain a latent code $z \in \mathbb { R } ^ { d _ { z } }$ . The latent code is then passed through a “decoder” $\hat { x } = g _ { \phi } ( z )$ parametrized by $\phi$ to produce an approximate reconstruction $\hat { \boldsymbol { x } } \in \mathbb { R } ^ { d _ { x } }$ of the input $x$ . We consider the case where $f _ { \theta }$ and $g _ { \phi }$ are implemented as multi-layer neural networks. The encoder and decoder are trained simultaneously (i.e. with respect to $\theta$ and $\phi$ ) to minimize some notion of distance between the input $x$ and the output $\hat { x }$ , for example the squared $L _ { 2 }$ distance $\| x - { \hat { x } } \| ^ { 2 }$ .
36
+
37
+ Interpolating using an autoencoder describes the process of using the decoder $g _ { \phi }$ to decode a mixture of two latent codes. Typically, the latent codes are combined via a convex combination, so that interpolation amounts to computing $\hat { x } _ { \alpha } = g _ { \phi } ( \alpha z _ { 1 } + ( 1 - \alpha ) z _ { 2 } )$ for some $\alpha \in [ 0 , 1 ]$ where $z _ { 1 } = f _ { \theta } ( x _ { 1 } )$ and $z _ { 2 } = f _ { \theta } ( x _ { 2 } )$ are the latent codes corresponding to data points $x _ { 1 }$ and $x _ { 2 }$ . We also experimented with spherical interpolation which has been used in settings where the latent codes are expected to have spherical structure (Huszar, 2017; White, 2016; Roberts et al., 2018), but found it made no ´ discernible difference in practice for any autoencoder we studied. Ideally, adjusting $\alpha$ from 0 to 1 will produce a sequence of realistic datapoints where each subsequent $\hat { x } _ { \alpha }$ is progressively less semantically similar to $x _ { 1 }$ and more semantically similar to $x _ { 2 }$ . The notion of “semantic similarity” is problem-dependent and ill-defined; we discuss this further in section 3.
38
+
39
+ 2.1 ADVERSARIALLY CONSTRAINED AUTOENCODER INTERPOLATION (ACAI)
40
+
41
+ As mentioned above, a high-quality interpolation should have two characteristics: First, that intermediate points along the interpolation are indistinguishable from real data; and second, that the intermediate points provide a semantically smooth morphing between the endpoints. The latter characteristic is hard to enforce because it requires defining a notion of semantic similarity for a given dataset, which is often hard to explicitly codify. So instead, we propose a regularizer which encourages interpolated datapoints to appear realistic, or more specifically, to appear indistinguishable from reconstructions of real datapoints. We find empirically that this constraint results in realistic and smooth interpolations in practice (section 3.1) in addition to providing improved performance on downstream tasks (section 4).
42
+
43
+ To enforce this constraint we introduce a critic network (Goodfellow et al., 2014) which is fed interpolations of existing datapoints (i.e. $\hat { x } _ { \alpha }$ as defined above). Its goal is to predict $\alpha$ from $\hat { x } _ { \alpha }$ , i.e. to predict the mixing coefficient used to generate its input. When training the model, for each pair of training data points we randomly sample a value of $\alpha$ to produce $\hat { x } _ { \alpha }$ . In order to resolve the ambiguity between predicting $\alpha$ and $1 - \alpha$ , we constrain $\alpha$ to the range $[ 0 , 0 . 5 ]$ when feeding $\hat { x } _ { \alpha }$ to the critic. In contrast, the autoencoder is trained to fool the critic to think that $\alpha$ is always zero. This is achieved by adding an additional term to the autoencoder’s loss to optimize its parameters to fool the critic. In a loose sense, the critic can be seen as approximating an “adversarial divergence” (Liu et al., 2017; Arora et al., 2017) between reconstructions and interpolants which the autoencoder tries to minimize.
44
+
45
+ Formally, let $d _ { \omega } ( x )$ be the critic network, which for a given input produces a scalar value. The critic is trained to minimize
46
+
47
+ $$
48
+ \mathcal { L } _ { d } = \| d _ { \omega } ( \hat { x } _ { \alpha } ) - \alpha \| ^ { 2 } + \| d _ { \omega } ( \gamma x + ( 1 - \gamma ) \hat { x } ) \| ^ { 2 }
49
+ $$
50
+
51
+ where, as above, $\hat { x } _ { \alpha } = g _ { \phi } ( \alpha f _ { \theta } ( x _ { 1 } ) + ( 1 - \alpha ) f _ { \theta } ( x _ { 2 } ) )$ , $\hat { x } = g _ { \phi } ( f _ { \theta } ( x ) )$ for some $x$ (not necessarily $x _ { 1 }$ or $x _ { 2 }$ ), and $\gamma$ is a scalar hyperparameter. The first term trains the critic to recover $\alpha$ from $\hat { x } _ { \alpha }$ . The second term serves as a regularizer with two functions: First, it enforces that the critic consistently outputs 0 for non-interpolated inputs; and second, by interpolating between $x$ and $\hat { x }$ (the autoencoder’s reconstruction of $x$ ) in data space it ensures the critic is exposed to realistic data even when the autoencoder’s reconstructions are poor. We found the second term was not crucial for our approach, but helped stabilize the convergence of the autoencoder and allowed us to use consistent hyperparameters and architectures across all datasets and experiments. The autoencoder’s loss function is modified by adding a regularization term:
52
+
53
+ $$
54
+ \mathcal { L } _ { f , g } = \Vert x - g _ { \phi } ( f _ { \theta } ( x ) ) \Vert ^ { 2 } + \lambda \Vert d _ { \omega } ( \hat { x } _ { \alpha } ) \Vert ^ { 2 }
55
+ $$
56
+
57
+ where $\lambda$ is a scalar hyperparameter which controls the weight of the regularization term. Note that the regularization term is effectively trying to make the critic output 0 regardless of the value of $\alpha$ , thereby “fooling” the critic into thinking that an interpolated input is non-interpolated (i.e., having $\alpha = 0$ ). The parameters $\theta$ and $\phi$ are optimized with respect to $\mathcal { L } _ { f , g }$ (which gives the autoencoder access to the critic’s gradients) and $\omega$ is optimized with respect to $\mathcal { L } _ { d }$ . We refer to the use of this regularizer as Adversarially Constrained Autoencoder Interpolation (ACAI). A diagram of the ACAI is shown in fig. 2. Assuming an effective critic, the autoencoder successfully “wins” this adversarial game by producing interpolated points which are indistinguishable from reconstructed data. We find in practice that encouraging this behavior also produces semantically smooth interpolations and improved representation learning performance, which we demonstrate in the following sections. Our loss function is similar to the one used in the Least Squares Generative Adversarial Network (Mao et al., 2017) in the sense that they both measure the distance between a critic’s output and a scalar using a squared L2 loss. However, they are substantially different in that ours is used as a regularizer for autoencoders rather than for generative modeling and our critic attempts to regress the interpolation coefficient $\alpha$ instead of a fixed scalar hyperparameter.
58
+
59
+ Note that the only thing ACAI encourages is that interpolated points appear realistic. The critic only ever sees a single reconstruction or interpolant at a time; it is never fed real datapoints or latent vectors. It therefore will only be able to successfully recover $\alpha$ if the quality of the autoencoder’s output degrades consistently across an interpolation as a function of $\alpha$ (as seen, for example, in fig. 3a where interpolated points become successively blurrier and darker). ACAI’s primary purpose is to discourage this behavior. In doing so, it may implicitly modify the structure of the latent space learned by the autoencoder, but ACAI itself does not directly impose a specific structure. Our goal in introducing ACAI is to test whether simply encouraging better interpolation behavior produces a better representation for downstream tasks. Further, in contrast with the standard Generative Adversarial Network (GAN) setup (Goodfellow et al., 2014), ACAI does not distinguish between “real” and “fake” data; rather, it simply attempts to regress the interpolation coefficient $\alpha$ . Furthermore, GANs are a generative modeling technique, not a representation learning technique; in this paper, we focus on autoencoders and their ability to learn useful representations.
60
+
61
+ # 3 AUTOENCODERS, AND HOW THEY INTERPOLATE
62
+
63
+ How can we measure whether an autoencoder interpolates effectively and whether our proposed regularization strategy achieves its stated goal? As mentioned in section 2, defining interpolation relies on the notion of “semantic similarity” which is a vague and problem-dependent concept. For example, a definition of interpolation along the lines of $^ { \mathrm { \infty } } \alpha z _ { 1 } \mathrm { ~ + ~ } ( 1 - \mathrm { \bar { \alpha } } ) z _ { 2 }$ should map to $\alpha x _ { 1 } \bar { + } ( 1 - \alpha ) { x _ { 2 } } ^ { \bar { \gamma } }$ is overly simplistic because interpolating in “data space” often does not result in realistic datapoints – in images, this corresponds to simply fading between the pixel values of the two images. Instead, we might hope that our autoencoder smoothly morphs between salient characteristics of $x _ { 1 }$ and $x _ { 2 }$ , even when they are dissimilar. Put another way, we might hope that decoded points along the interpolation smoothly traverse the underlying manifold of the data instead of simply interpolating in data space. However, we rarely have access to the underlying data manifold. To make this problem more concrete, we introduce a simple benchmark task where the data manifold is simple and known a priori which makes it possible to quantify interpolation quality. We then evaluate the ability of various common autoencoders to interpolate on our benchmark. Finally, we test ACAI on our benchmark and show that it exhibits dramatically improved performance and qualitatively superior interpolations.
64
+
65
+ # 3.1 AUTOENCODING LINES
66
+
67
+ Given that the concept of interpolation is difficult to pin down, our goal is to define a task where a “correct” interpolation between two datapoints is unambiguous and well-defined. This will allow us to quantitatively evaluate the extent to which different autoencoders can successfully interpolate. Towards this goal, we propose the task of autoencoding $3 2 \times 3 2$ grayscale images of lines. We consider 16-pixel-long lines beginning from the center of the image and extending outward at an angle $\Lambda \in [ 0 , 2 \pi ]$ (or put another way, lines are radii of the circle circumscribed within the image borders). An example of 16 such images is shown in fig. 4a (appendix A.1). In this task, the data manifold can be defined entirely by a single variable: $\Lambda$ . We can therefore define a valid interpolation from $x _ { 1 }$ to $x _ { 2 }$ as one which smoothly and linearly adjusts $\Lambda$ from the angle of the line in $x _ { 1 }$ to the angle in $x _ { 2 }$ . We further require that the interpolation traverses the shortest path possible along the data manifold. We provide some concrete examples of good and bad interpolations, shown and described in appendix A.1.
68
+
69
+ On any dataset, our desiderata for a successful interpolation are that intermediate points look realistic and provide a semantically meaningful morphing between its endpoints. On this synthetic lines dataset, we can formalize these notions as specific evaluation metrics, which we describe in detail in appendix A.2. To summarize, we propose two metrics: Mean Distance and Smoothness. Mean Distance measures the average distance between interpolated points and “real” datapoints. Smoothness measures whether the angles of the interpolated lines follow a linear trajectory between the angle of the start and endpoint. Both of these metrics are simple to define due to our construction of a dataset where we exactly know the data distribution and manifold; we provide a full definition and justification in appendix A.2. A perfect alignment would achieve 0 for both scores; larger values indicate a failure to generate realistic interpolated points or produce a smooth interpolation respectively. By choosing a synthetic benchmark where we can explicitly measure the quality of an interpolation, we can confidently evaluate different autoencoders on their interpolation abilities.
70
+
71
+ To evaluate an autoencoder on the synthetic lines task, we randomly sample line images during training and compute our evaluation metrics on a separate randomly-sampled test set of images. Note that we never train any autoencoder explicitly to produce an optimal interpolation; “good” interpolation is an emergent property which occurs only when the architecture, loss function, training procedure, etc. produce a suitable latent space.
72
+
73
+ Table 1: Scores achieved by different autoencoders on the synthetic line benchmark (lower is better).
74
+
75
+ <table><tr><td>Metric</td><td>Baseline</td><td>Denoising</td><td>VAE</td><td>AAE</td><td>VQ-VAE</td><td>ACAI</td></tr><tr><td>Mean Distance ( (×10-3)</td><td>6.88±0.21</td><td>4.21±0.32</td><td>1.21±0.17</td><td>3.26±0.19</td><td>5.41±0.49</td><td>0.24±0.01</td></tr><tr><td>Smoothness</td><td>0.44±0.04</td><td>0.66±0.02</td><td>0.49±0.13</td><td>0.14±0.02</td><td>0.77±0.02</td><td>0.10±0.01</td></tr></table>
76
+
77
+ ![](images/ec36ffc7cb437f33fb80e7cef44a912d2b91f3875e4be808b7576abc3083aa00.jpg)
78
+ Figure 3: Interpolations on the synthetic lines benchmark produced by (a) baseline auto-encoder, (b) denoising autoencoder, (c) Variational Autoencoder, (d) Adversarial Autoencoder, (e) Vector Quantized Variational Autoencoder, (f) Adversarially Constrained Autoencoder Interpolation (our model). While we only show one example here, the behavior of each autoencoder was generally similar for all interpolations. A more comprehensive measure of interpolation behavior is given in table 1.
79
+
80
+ # 3.2 AUTOENCODERS
81
+
82
+ In this section, we describe various common autoencoder structures and objectives and try them on the lines task. Our goal is to quantitatively evaluate the extent to which standard autoencoders exhibit useful interpolation behavior. Our results, which we describe below, are summarized in table 1.
83
+
84
+ Base Model Perhaps the most basic autoencoder structure is one which simply maps input datapoints through a “bottleneck” layer whose dimensionality is smaller than the input. In this setup, $f _ { \theta }$ and $g _ { \phi }$ are both neural networks which respectively map the input to a deterministic latent code $z$ and then back to a reconstructed input. Typically, $f _ { \theta }$ and $g _ { \phi }$ are trained simultaneously with respect to $\| x - { \hat { x } } \| ^ { 2 }$ . We will use this framework as a baseline for experimentation for all of the autoencoder variants discussed below. In particular, for our base model and all of the other autoencoders we will use the model architecture and training procedure described in appendix B. As a short summary, our encoder consists of a stack of convolutional and average pooling layers, whereas the decoder consists of convolutional and nearest-neighbor upsampling layers. For experiments on the synthetic “lines” task, we use a latent dimensionality of 64. Note that, because the data manifold is effectively onedimensional, we might expect autoencoders to be able to model this dataset using a one-dimensional latent code; however, using a larger latent code reflects the realistic scenario where the latent space is larger than necessary. After training our baseline autoencoder, we achieved a Mean Distance score which was the worst (highest) of all of the autoencoders we studied, though the Smoothness was on par with various other approaches. In general, we observed some reasonable interpolations when using the baseline model, but found that the intermediate points on the interpolation were typically not realistic as seen in the example interpolation in fig. 3a.
85
+
86
+ Denoising Autoencoder An early modification to the standard autoencoder setup was proposed by Vincent et al. (2010), where instead of feeding $x$ into the autoencoder, a corrupted version $\tilde { x } \sim q ( \tilde { x } | x )$ is sampled from the conditional probability distribution $q ( \tilde { x } | x )$ and is fed into the autoencoder instead. The autoencoder’s goal remains to produce $\hat { x }$ which minimizes $\| x - { \hat { x } } \| ^ { 2 }$ . One justification of this approach is that the corrupted inputs should fall outside of the true data manifold, so the autoencoder must learn to map points from outside of the data manifold back onto it. This provides an implicit way of defining and learning the data manifold via the coordinate system induced by the latent space.
87
+
88
+ While various corruption procedures $q ( \tilde { x } | x )$ have been used such as masking and salt-and-pepper noise, in this paper we consider the simple case of additive isotropic Gaussian noise where $\tilde { x } \sim$ ${ \mathcal { N } } ( x , \sigma ^ { 2 } I )$ and $\sigma$ is a hyperparameter. After tuning $\sigma$ , we found simply setting $\sigma = 1 . 0$ to work best. Interestingly, we found the denoising autoencoder often produced “data-space” interpolation (as seen in fig. 3b) when interpolating in latent space. This resulted in comparatively poor Mean Distance and Smoothness scores.
89
+
90
+ Variational Autoencoder The Variational Autoencoder (VAE) (Kingma & Welling, 2014; Rezende et al., 2014) introduces the constraint that the latent code $z$ is a random variable distributed according to a prior distribution $p ( z )$ . The encoder $f _ { \theta }$ can then be considered an approximation to the posterior $p ( z | x )$ . Then, the decoder $g _ { \phi }$ is taken to parametrize the likelihood $p ( x \bar { | } \bar { z } )$ ; in all of our experiments, we consider $x$ to be Bernoulli distributed. The latent distribution constraint is enforced by an additional loss term which measures the KL divergence between approximate posterior and prior. VAEs then use log-likelihood for the reconstruction loss (cross-entropy in the case of Bernoulli-distributed data), which results in the following combined loss function: $- \mathbb { E } [ \log g _ { \phi } ( z ) ] + \mathrm { K L } ( f _ { \theta } ( x ) | | p ( z ) )$ where the expectation is taken with respect to $z \sim f _ { \theta } ( x )$ and $\mathrm { K L } ( \cdot | | \cdot )$ is the KL divergence. Minimizing this loss function can be considered maximizing a lower bound (the “ELBO”) on the likelihood of the training set, producing a likelihood-based generative model which allows novel data points to be sampled by first sampling $z \sim p ( z )$ and then computing $g _ { \phi } ( z )$ . A common choice is to let $q ( z | x )$ be a diagonalcovariance Gaussian, in which case backpropagation through sampling from $q ( z | x )$ is feasible via the “reparametrization trick” which replaces $\bar { z } \sim \mathcal { N } ( \mu , \bar { \sigma I } )$ with $\epsilon \sim \mathcal { N } ( 0 , I ) , z = \mu + \sigma \odot \epsilon$ where $\bar { \mu } , \sigma \in \mathbb { R } ^ { d _ { z } }$ are the predicted mean and standard deviation produced by $f _ { \theta }$ . Various modified objectives (Higgins et al., 2017; Zhao et al., 2017), improved prior distributions (Kingma et al., 2016; Tomczak & Welling, 2016; 2017) and improved model architectures (Sønderby et al., 2016; Chen et al., 2016b; Gulrajani et al., 2016) have been proposed to better the VAE’s performance on downstream tasks, but in this paper we solely consider the “vanilla” VAE objective and prior described above applied to our baseline autoencoder structure.
91
+
92
+ When trained on the lines benchmark, we found the VAE was able to effectively model the data distribution (see samples, fig. 5 in appendix C) and accurately reconstruct inputs. In interpolations produced by the VAE, intermediate points tend to look realistic, but the angle of the lines do not follow a smooth or short path (fig. 3c). This resulted in a very good Mean Distance score but a very poor Smoothness score. Contrary to expectations, this suggests that desirable interpolation behavior may not follow from an effective generative model of the data distribution.
93
+
94
+ Adversarial Autoencoder The Adversarial Autoencoder (AAE) (Makhzani et al., 2015) proposes an alternative way of enforcing structure on the latent code. Instead of minimizing a KL divergence between the distribution of latent codes and a prior distribution, a critic network is trained in tandem with the autoencoder to predict whether a latent code comes from $f _ { \theta }$ or from the prior $p ( z )$ . The autoencoder is simultaneously trained to reconstruct inputs (via a standard reconstruction loss) and to “fool” the critic. The autoencoder is allowed to backpropagate gradients through the critic’s loss function, but the autoencoder and critic parameters are optimized separately. This effectively computes an “adversarial divergence” between the latent code distribution and the chosen prior. This framework was later generalized and referred to as the “Wasserstein Autoencoder” (Tolstikhin et al., 2017) One advantage of this approach is that it allows for an arbitrary prior (as opposed to those which have a tractable KL divergence). The disadvantages are that the AAE no longer has a probabilistic interpretation and involves optimizing a minimax game, which can cause instabilities.
95
+
96
+ Using the AAE requires choosing a prior, a critic structure, and a training scheme for the critic. For simplicity, we also used a spherical Gaussian prior for the AAE. We experimented with various architectures for the critic, and found the best performance with a critic which consisted of two dense layers, each with 100 units and a leaky ReLU nonlinearity. We found it satisfactory to simply use the same optimizer and learning rate for the critic as was used for the autoencoder. On our lines benchmark, the AAE typically produced smooth interpolations, but exhibited degraded quality in the middle of interpolations (fig. 3d). This behavior produced the best Smoothness score among existing autoencoders, but a relatively poor Mean Distance score.
97
+
98
+ Vector Quantized Variational Autoencoder (VQ-VAE) The Vector Quantized Variational Autoencoder (VQ-VAE) was introduced by (van den Oord et al., 2017) as a way to train discrete-latent autoencoders using a learned codebook. In the VQ-VAE, the encoder $f _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ produces a continuous hidden representation $z \in \mathbb { R } _ { z } ^ { d }$ which is then mapped to $z _ { q }$ , its nearest neighbor in a “codebook” $\{ e _ { j } \in \mathbb { R } ^ { d _ { z } } , j \in 1 , \ldots , K \}$ . $z _ { q }$ is then passed to the decoder for reconstruction. The encoder is trained to minimize the reconstruction loss using the straight-through gradient estimator (Bengio et al., 2013a), together with a commitment loss term $\beta \parallel z - \operatorname { s g } ( z _ { q } ) \parallel$ (where $\beta$ is a scalar hyperparameter) which encourages encoder outputs to move closer to their nearest codebook entry. Here sg denotes the stop gradient operator, i.e. $\ \operatorname { s g } ( x ) = x$ in the forward pass, and $\operatorname { s g } ( x ) = 0$ in the backward pass. The codebook entries $e _ { j }$ are updated as an exponential moving average (EMA) of the continuous latents $z$ that map to them at each training iteration. The VQ-VAE training procedure using this EMA update rule can be seen as performing the $K$ -means or the hard Expectation Maximization (EM) algorithm on the latent codes (Roy et al., 2018).
99
+
100
+ We perform interpolation in the VQ-VAE by interpolating continuous latents, mapping them to their nearest codebook entries, and decoding the result. Assuming sufficiently large codebook, a semantically “smooth” interpolation may be possible. On the lines task, we found that this procedure produced poor interpolations. Ultimately, many entries of the codebook were mapped to unrealistic datapoints, and the interpolations resembled those of the baseline autoencoder.
101
+
102
+ Adversarially Constrained Autoencoder Interpolation Finally, we turn to evaluating our proposed adversarial regularizer for improving interpolations. For simplicity, on the lines benchmark we found it sufficient to use a critic architecture which was equivalent to the encoder (as described in appendix B). To produce a single scalar value from its output, we computed the mean of its final layer activations. For the hyperparameters $\lambda$ and $\gamma$ we found values of 0.5 and 0.2 to achieve good results, though the performance was not very sensitive to their values. We use these values for the coefficients for all of our experiments. Finally, we trained the critic using the same optimizer and hyperparameters as the autoencoder.
103
+
104
+ We found dramatically improved performance on the lines benchmark when using ACAI – it achieved the best Mean Distance and Smoothness score among the autoencoders we considered. When inspecting the resulting interpolations, we found it occasionally chose a longer path than necessary but typically produced “perfect” interpolation behavior as seen in fig. 3f. This provides quantitative evidence ACAI is successful at encouraging realistic and smooth interpolations.
105
+
106
+ # 3.3 INTERPOLATIONS ON REAL DATA
107
+
108
+ We have so far only discussed results on our synthetic lines benchmark. We also provide example reconstructions and interpolations produced by each autoencoder for MNIST (LeCun, 1998), SVHN (Netzer et al., 2011), and CelebA (Liu et al., 2015) in appendix D. For each dataset, we trained autoencoders with latent dimensionalities of 32 and 256. Since we do not know the underlying data manifold for these datasets, no metrics are available to evaluate performance and we can only make qualitative judgments as to the reconstruction and interpolation quality. We find that most autoencoders produce “blurrier” images with $d _ { z } = 3 2$ but generally give smooth interpolations regardless of the latent dimensionality. The exception to this observation was the VQ-VAE which seems generally to work better with $d _ { z } = 3 2$ and occasionally even diverged for $d _ { z } = 2 5 6$ (see e.g. fig. 9e). This may be due to the nearest-neighbor discretization (and gradient estimator) failing in high dimensions. Across datasets, we found the VAE and denoising autoencoder typically produced more blurry interpolations. AAE and ACAI generally produced realistic interpolations, even between dissimilar datapoints (for example, in fig. 7 bottom). The baseline model often effectively interpolated in data space.
109
+
110
+ # 4 IMPROVED REPRESENTATION LEARNING
111
+
112
+ We have so far solely focused on measuring the interpolation abilities of different autoencoders. Now, we turn to the question of whether improved interpolation is associated with improved performance on downstream tasks. Specifically, we will evaluate whether using our proposed regularizer results in latent space representations which provide better performance in supervised learning and clustering. Put another way, we seek to test whether improving interpolation results in a latent representation which has disentangled important factors of variation (such as class identity) in the dataset. To answer this question, we ran classification and clustering experiments using the learned latent spaces of different autoencoders on the MNIST (LeCun, 1998), SVHN (Netzer et al., 2011), and CIFAR-10 (Krizhevsky, 2009) datasets.
113
+
114
+ Table 2: Single-layer classifier accuracy achieved by different autoencoders.
115
+
116
+ <table><tr><td>Dataset</td><td>dz</td><td>Baseline</td><td>Denoising</td><td>VAE</td><td>AAE</td><td>VQ-VAE</td><td>ACAI</td></tr><tr><td rowspan="2">MNIST</td><td>32</td><td>94.90±0.14</td><td>96.00±0.27</td><td>96.56±0.31</td><td>70.74±3.27</td><td>97.50±0.18</td><td>98.25±0.11</td></tr><tr><td>256</td><td>93.94±0.13</td><td>98.51±0.04</td><td>98.74±0.14</td><td>90.03±0.54</td><td>97.25±1.42</td><td>99.00±0.08</td></tr><tr><td rowspan="2">SVHN</td><td>32</td><td>26.21±0.42</td><td>25.15±0.78</td><td>29.58±3.22</td><td>23.43±0.79</td><td>24.53±1.33</td><td>34.47±1.14</td></tr><tr><td>256</td><td>22.74±0.05</td><td>77.89±0.35</td><td>66.30±1.06</td><td>22.81±0.24</td><td>44.94±20.42</td><td>85.14±0.20</td></tr><tr><td rowspan="2">CIFAR-10</td><td>256</td><td>47.92±0.20</td><td>53.78±0.36</td><td>47.49±0.22</td><td>40.65±1.45</td><td>42.80±0.44</td><td>52.77±0.45</td></tr><tr><td>1024</td><td>51.62±0.25</td><td>60.65±0.14</td><td>51.39±0.46</td><td>42.86±0.88</td><td>16.22±12.44</td><td>63.99±0.47</td></tr></table>
117
+
118
+ Table 3: Clustering accuracy for using K-Means on the latent space of different autoencoders (left) and previously reported methods (right). On the right, “Data” refers to performing K-Means directly on the data and DEC, RIM, and IMSAT are the methods proposed in (Xie et al., 2016; Krause et al., 2010; Hu et al., 2017) respectively. Results marked \* are excerpted from (Hu et al., 2017) and \*\* are from (Xie et al., 2016).
119
+
120
+ <table><tr><td>Dataset</td><td>dz</td><td>Baseline</td><td>Denoising</td><td>VAE</td><td>AAE</td><td>VQ-VAE</td><td>ACAI</td><td>Data</td><td>DEC</td><td>RIM</td><td>IMSAT</td></tr><tr><td>MNIST</td><td>32 256</td><td>77.56 53.70</td><td>82.59 70.89</td><td>75.74 83.44</td><td>79.19 81.00</td><td>82.39 96.80</td><td>94.38 96.17</td><td>53.2*</td><td>84.3**</td><td>58.5*</td><td>98.4*</td></tr><tr><td>SVHN</td><td>32 256</td><td>19.38 15.62</td><td>17.91 31.49</td><td>16.83 11.36</td><td>17.35 13.59</td><td>15.19 18.84</td><td>20.86 24.98</td><td>17.9*</td><td>11.9*</td><td>26.8*</td><td>57.3*</td></tr></table>
121
+
122
+ Single-Layer Classifier A common method for evaluating the quality of a learned representation (such as the latent space of an autoencoder) is to use it as a feature representation for a simple, one-layer classifier (i.e. logistic regression) trained on a supervised learning task (Coates et al., 2011). The justification for this evaluation procedure is that a learned representation which has effectively disentangled class identity will allow the classifier to obtain reasonable performance despite its simplicity. To test different autoencoders in this setting, we trained a separate single-layer classifier in tandem with the autoencoder using the latent representation as input. We did not optimize autoencoder parameters with respect to the classifier’s loss, which ensures that we are measuring unsupervised representation learning performance. We repeated this procedure for latent dimensionalities of 32 and 256 (MNIST and SVHN) and 256 and 1024 (CIFAR-10).
123
+
124
+ Our results are shown in table 2. In all settings, using ACAI instead of the baseline autoencoder upon which it is based produced significant gains – most notably, on SVHN with a latent dimensionality of 256, the baseline achieved an accuracy of only $2 2 . 7 4 \%$ whereas ACAI achieved $8 5 . 1 4 \%$ . In general, we found the denoising autoencoder, VAE, and ACAI obtained significantly higher performance compared to the remaining models. On MNIST and SVHN, ACAI achieved the best accuracy by a significant margin; on CIFAR-10, the performance of ACAI and the denoising autoencoder was similar. By way of comparison, we found a single-layer classifier applied directly to (flattened) image pixels achieved an accuracy of $9 2 . 3 1 \%$ , $2 3 . 4 8 \%$ , and $3 9 . 7 0 \%$ on MNIST, SVHN, and CIFAR-10 respectively, so classifying using the representation learned by ACAI provides a huge benefit.
125
+
126
+ Clustering If an autoencoder groups points with common salient characteristics close together in latent space without observing any labels, it arguably has uncovered some important structure in the data in an unsupervised fashion. A more difficult test of an autoencoder is therefore clustering its latent space, i.e. separating the latent codes for a dataset into distinct groups without using any labels. To test the clusterability of the latent spaces learned by different autoencoders, we simply apply K-Means clustering (MacQueen, 1967) to the latent codes for a given dataset. Since K-Means uses Euclidean distance, it is sensitive to each dimension’s relative variance. We therefore used PCA whitening on the latent space learned by each autoencoder to normalize the variance of its dimensions prior to clustering. K-Means can exhibit highly variable results depending on how it is initialized, so for each autoencoder we ran K-Means 1,000 times from different random initializations and chose the clustering with the best objective value on the training set. For evaluation, we adopt the methodology of Xie et al. (2016); Hu et al. (2017): Given that the dataset in question has labels (which are not used for training the model, the clustering algorithm, or choice of random initialization), we can cluster the data into $C$ distinct groups where $C$ is the number of classes in the dataset. We then compute the “clustering accuracy”, which is simply the accuracy corresponding to the optimal one-to-one mapping of cluster IDs and classes (Xie et al., 2016).
127
+
128
+ Our results are shown in table 3. On both MNIST and SVHN, ACAI achieved the best or second-best performance for both $d _ { z } = 3 2$ and $d _ { z } = 2 5 6$ . We do not report results on CIFAR-10 because all of the autoencoders we studied achieved a near-random clustering accuracy. Previous efforts to evaluate clustering performance on CIFAR-10 use learned feature representations from a convolutional network trained on ImageNet (Hu et al., 2017) which we believe only indirectly measures unsupervised learning capabilities.
129
+
130
+ # 5 CONCLUSION
131
+
132
+ In this paper, we have provided an in-depth perspective on interpolation in autoencoders. We proposed Adversarially Constrained Autoencoder Interpolation (ACAI), which uses a critic to encourage interpolated datapoints to be more realistic. To make interpolation a quantifiable concept, we proposed a synthetic benchmark and showed that ACAI substantially outperformed common autoencoder models. This task also yielded unexpected insights, such as that a VAE which has effectively learned the data distribution might not interpolate. We also studied the effect of improved interpolation on downstream tasks, and showed that ACAI led to improved performance for feature learning and unsupervised clustering. These findings confirm our intuition that improving the interpolation abilities of a baseline autoencoder can also produce a better learned representation for downstream tasks. However, we emphasize that we do not claim that good interpolation always implies a good representation – for example, the AAE produced smooth and realistic interpolations but fared poorly in our representations learning experiments and the denoising autoencoder had low-quality interpolations but provided a useful representation.
133
+
134
+ In future work, we are interested in investigating whether our regularizer improves the performance of autoencoders other than the standard “vanilla” autoencoder we applied it to. In this paper, we primarily focused on image datasets due to the ease of visualizing interpolations, but we are also interested in applying these ideas to non-image datasets.
135
+
136
+ # REFERENCES
137
+
138
+ Sanjeev Arora, Rong Ge, Yingyu Liang, Tengyu Ma, and Yi Zhang. Generalization and equilibrium in generative adversarial nets (gans). In International Conference on Machine Learning, 2017.
139
+
140
+ Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In Advances in neural information processing systems, 2007.
141
+
142
+ Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients through ´ stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013a.
143
+
144
+ Yoshua Bengio, Gregoire Mesnil, Yann Dauphin, and Salah Rifai. Better mixing via deep representa- ´ tions. In International Conference on Machine Learning, 2013b.
145
+
146
+ Herve Bourlard and Yves Kamp. Auto-association by multilayer perceptrons and singular value ´ decomposition. Biological cybernetics, 59(4-5), 1988.
147
+
148
+ Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015.
149
+
150
+ Shan Carter and Michael Nielsen. Using artificial intelligence to augment human intelligence. Distill, 2017. https://distill.pub/2017/aia.
151
+
152
+ Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. InfoGAN: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in neural information processing systems, pp. 2172–2180, 2016a.
153
+
154
+ Xi Chen, Diederik P. Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016b.
155
+
156
+ Adam Coates, Andrew $\mathrm { N g }$ , and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, 2011.
157
+
158
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
159
+
160
+ Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Olivier Mastropietro, Alex Lamb, Martin Arjovsky, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016.
161
+
162
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, 2014.
163
+
164
+ Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. PixelVAE: A latent variable model for natural images. arXiv preprint arXiv:1611.05013, 2016.
165
+
166
+ David Ha and Douglas Eck. A neural representation of sketch drawings. In Sixth International Conference on Learning Representations, 2018.
167
+
168
+ Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-VAE: Learning basic visual concepts with a constrained variational framework. In Fifth International Conference on Learning Representations, 2017.
169
+
170
+ Weihua Hu, Takeru Miyato, Seiya Tokui, Eiichi Matsumoto, and Masashi Sugiyama. Learning discrete representations via information maximizing self augmented training. arXiv preprint arXiv:1702.08720, 2017.
171
+
172
+ Ferenc Huszar. Gaussian distributions are soap bubbles. ´ inFERENCe, 2017.
173
+
174
+ Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Third International Conference on Learning Representations, 2014.
175
+
176
+ Diederik P. Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in Neural Information Processing Systems, 2016.
177
+
178
+ Andreas Krause, Pietro Perona, and Ryan G. Gomes. Discriminative clustering by regularized information maximization. In Advances in neural information processing systems, 2010.
179
+
180
+ Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
181
+
182
+ Yann LeCun. The mnist database of handwritten digits. 1998.
183
+
184
+ Shuang Liu, Olivier Bousquet, and Kamalika Chaudhuri. Approximation and convergence properties of generative adversarial learning. In Advances in Neural Information Processing Systems, 2017.
185
+
186
+ Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015.
187
+
188
+ Andrew L. Maas, Awni Y. Hannun, and Andrew Y. Ng. Rectifier nonlinearities improve neural network acoustic models. In International Conference on Machine Learning, 2013.
189
+
190
+ James MacQueen. Some methods for classification and analysis of multivariate observations. In Proceedings of 5th Berkeley Symposium on Mathematical Statistics and Probability, 1967.
191
+
192
+ Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
193
+
194
+ Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In IEEE International Conference on Computer Vision, 2017.
195
+
196
+ Michael F. Mathieu, Junbo Jake Zhao, Aditya Ramesh, Pablo Sprechmann, and Yann LeCun. Disentangling factors of variation in deep representation using adversarial training. In Advances in Neural Information Processing Systems, 2016.
197
+
198
+ Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. Adversarial variational bayes: Unifying variational autoencoders and generative adversarial networks. arXiv preprint arXiv:1701.04722, 2017.
199
+
200
+ Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, 2011.
201
+
202
+ Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and checkerboard artifacts. Distill, 2016. URL http://distill.pub/2016/deconv-checkerboard.
203
+
204
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
205
+
206
+ Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014.
207
+
208
+ Adam Roberts, Jesse Engel, Colin Raffel, Curtis Hawthorne, and Douglas Eck. A hierarchical latent vector model for learning long-term structure in music. arXiv preprint arXiv:1803.05428, 2018.
209
+
210
+ Aurko Roy, Ashish Vaswani, Arvind Neelakantan, and Niki Parmar. Theory and experiments on vector quantized autoencoders. arXiv preprint arXiv:1805.11063, 2018.
211
+
212
+ Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in Neural Information Processing Systems, 2016.
213
+
214
+ Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein auto-encoders. In Fifth International Conference on Learning Representations, 2017.
215
+
216
+ Jakub M. Tomczak and Max Welling. Improving variational auto-encoders using householder flow. arXiv preprint arXiv:1611.09630, 2016.
217
+
218
+ Jakub M. Tomczak and Max Welling. Vae with a vampprior. arXiv preprint arXiv:1705.07120, 2017.
219
+
220
+ Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in Neural Information Processing Systems, 2016.
221
+
222
+ Aaron van den Oord, Oriol Vinyals, et al. Neural discrete representation learning. In Advances in Neural Information Processing Systems, pp. 6309–6318, 2017.
223
+
224
+ Vikas Verma, Alex Lamb, Christopher Beckham, Aaron Courville, Ioannis Mitliagkis, and Yoshua Bengio. Manifold mixup: Encouraging meaningful on-manifold interpolation as a regularizer. arXiv preprint arXiv:1806.05236, 2018.
225
+
226
+ Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. Journal of Machine Learning Research, 11, 2010.
227
+
228
+ Tom White. Sampling generative networks: Notes on a few effective techniques. arXiv preprint arXiv:1609.04468, 2016.
229
+
230
+ Junyuan Xie, Ross Girshick, and Ali Farhadi. Unsupervised deep embedding for clustering analysis. In International conference on machine learning, pp. 478–487, 2016.
231
+
232
+ Shengjia Zhao, Jiaming Song, and Stefano Ermon. InfoVAE: Information maximizing variational autoencoders. arXiv preprint arXiv:1706.02262, 2017.
233
+
234
+ ![](images/8ad93aefd87dcaa05eb84f1109f9c8f406de2bea636705b07a2b75aadbe8716f.jpg)
235
+ Figure 4: Examples of data and interpolations from our synthetic lines dataset. (a) 16 random samples from the dataset. (b) A perfect interpolation from $\Lambda = { ^ { 1 1 \pi } } / { _ { 1 4 } }$ to 0. (c) Interpolating in data space rather than “semantic” or latent space. Clearly, interpolating in this way produces points not on the data manifold. (d) An interpolation which abruptly changes from one image to the other, rather than smoothly changing. (e) A smooth interpolation which takes a longer path from the start to end point than necessary. (f) An interpolation which takes the correct path but where intermediate points are not realistic.
236
+
237
+ # A LINE BENCHMARK
238
+
239
+ # A.1 EXAMPLE INTERPOLATIONS
240
+
241
+ Some example data and interpolations for our synthetic lines benchmark are shown in fig. 4. Full discussion of this benchmark is available in section 3.1.
242
+
243
+ # A.2 EVALUATION METRICS
244
+
245
+ We define our Mean Distance and Smoothness metrics as follows: Let $x _ { 1 }$ and $x _ { 2 }$ be two input images we are interpolating between and
246
+
247
+ $$
248
+ \hat { x } _ { n } = g _ { \phi } \left( \frac { n - 1 } { N - 1 } z _ { 1 } + \left( 1 - \frac { n - 1 } { N - 1 } \right) z _ { 2 } \right)
249
+ $$
250
+
251
+ be the decoded point corresponding to mixing $x _ { 1 }$ and $x _ { 2 }$ ’s latent codes using coefficient $\alpha = { \mathfrak { n } } - 1 / { \mathfrak { N } } - 1$ The images $\hat { x } _ { n } , n \in \{ 1 , \ldots , N \}$ then comprise a length- $N$ interpolation between $x _ { 1 }$ and $x _ { 2 }$ . To produce our evaluation metrics, we first find the closest true datapoint (according to cosine distance) for each of the $N$ intermediate images along the interpolation. Finding the closest image among all possible line images is infeasible; instead we first generate a size- $D$ collection of line images $\mathcal { D }$ with corresponding angles $\Lambda _ { q } , q \in \{ 1 , \ldots , D \}$ spaced evenly between 0 and $2 \pi$ . Then, we match each image in the interpolation to a real datapoint by finding
252
+
253
+ $$
254
+ \begin{array} { c } { { C _ { n , q } = 1 - \frac { { \hat { x } _ { n } } { \mathcal { D } _ { q } } } { \| \hat { x } _ { n } \| \| { \mathcal { D } _ { q } } \| } } } \\ { { q _ { n } ^ { \star } = \arg \underset { q } { \operatorname* { m i n } } C _ { n , q } } } \end{array}
255
+ $$
256
+
257
+ for $n \in \{ 1 , \ldots , N \}$ , where $C _ { n , q }$ is the cosine distance between ${ \hat { x } } _ { n }$ and the $q$ th entry of $\mathcal { D }$ . To capture the notion of “intermediate points look realistic”, we compute
258
+
259
+ $$
260
+ \operatorname { M e a n } \operatorname { D i s t a n c e } ( \left\{ { \hat { x } } _ { 1 } , { \hat { x } } _ { 2 } , \ldots , { \hat { x } } _ { N } \right\} ) = { \frac { 1 } { N } } \sum _ { n = 1 } ^ { N } C _ { n , q _ { n } ^ { \star } }
261
+ $$
262
+
263
+ We now define a perfectly smooth interpolation to be one which consists of lines with angles which linearly move from the angle of $\mathcal { D } _ { q _ { 1 } ^ { \star } }$ to that of $\mathcal { D } _ { \boldsymbol { q } _ { N } ^ { \star } }$ . Note that if, for example, the interpolated lines go from $\Lambda _ { q _ { 1 } ^ { \star } } = \pi / 1 0$ to $\Lambda _ { q _ { N } ^ { \star } } = { } ^ { 1 9 \pi } / 1 0$ then the angles corresponding to the shortest path will have a discontinuity from 0 to $2 \pi$ . To avoid this, we first “unwrap” the angles $\{ \Lambda _ { q _ { 1 } ^ { \star } } , \ldots , \Lambda _ { q _ { N } ^ { \star } } \}$ by removing discontinuities larger than $\pi$ by adding multiples of $\pm 2 \pi$ when the absolute difference between $\Lambda _ { q _ { n - 1 } ^ { \star } }$ and $\Lambda _ { { q } _ { n } ^ { \star } }$ is greater than $\pi$ to produce the angle sequence $\{ \tilde { \Lambda } _ { q _ { 1 } ^ { \star } } , \ldots , \tilde { \Lambda } _ { q _ { N } ^ { \star } } \}$ .2 Then, we define a measure of smoothness as
264
+
265
+ $$
266
+ \mathrm { S m o o t h n e s s } \big ( \big \{ \hat { x } _ { 1 } , \hat { x } _ { 2 } , . . . , \hat { x } _ { N } \big \} \big ) = \frac { 1 } { \vert \tilde { \Lambda } _ { q _ { 1 } ^ { * } } - \tilde { \Lambda } _ { q _ { N } ^ { * } } \vert } \operatorname* { m a x } _ { n \in \{ 1 , . . . , N - 1 \} } \Big ( \tilde { \Lambda } _ { q _ { n + 1 } ^ { * } } - \tilde { \Lambda } _ { q _ { n } ^ { * } } \Big ) - \frac { 1 } { N - 1 }
267
+ $$
268
+
269
+ In other words, we measure the how much larger the largest change in (normalized) angle is compared to the minimum possible value $\left( { } ^ { 1 } / ( N { - } 1 ) \right)$ .
270
+
271
+ By way of example, figs. 4b, 4d and 4e would all achieve Mean Distance scores near zero and figs. 4c and 4f would achieve larger Mean Distance scores. Figures 4b and 4f would achieve Smoothness scores near zero, figs. 4c and 4d have poor Smoothness, and fig. $_ { 4 \mathrm { e } }$ is in between.
272
+
273
+ # B BASE MODEL ARCHITECTURE AND TRAINING PROCEDURE
274
+
275
+ All of the autoencoder models we studied in this paper used the following architecture and training procedure: The encoder consists of blocks of two consecutive $3 \times 3$ convolutional layers followed by $2 \times 2$ average pooling. All convolutions (in the encoder and decoder) are zero-padded so that the input and output height and width are equal. The number of channels is doubled before each average pooling layer. Two more $3 \times 3$ convolutions are then performed, the last one without activation and the final output is used as the latent representation. All convolutional layers except for the final use a leaky ReLU nonlinearity (Maas et al., 2013). For experiments on the synthetic “lines” task, the convolution-average pool blocks are repeated 4 times until we reach a latent dimensionality of 64. For subsequent experiments on real datasets (section 4), we repeat the blocks 3 times, resulting in a latent dimensionality of 256.
276
+
277
+ The decoder consists of blocks of two consecutive $3 \times 3$ convolutional layers with leaky ReLU nonlinearities followed by $2 \times 2$ nearest neighbor upsampling (Odena et al., 2016). The number of channels is halved after each upsampling layer. These blocks are repeated until we reach the target resolution $3 2 \times 3 2$ in all experiments). Two more $3 \times 3$ convolutions are then performed, the last one without activation and with a number of channels equal to the number of desired colors.
278
+
279
+ All parameters are initialized as zero-mean Gaussian random variables with a standard deviation of $1 / \sqrt { \tan \_ { - } \mathrm { i n } ( 1 + 0 . 2 ^ { 2 } ) }$ set in accordance with the leaky ReLU slope of 0.2. Models are trained on $2 ^ { 2 4 }$ samples in batches of size 64. Parameters are optimized with Adam (Kingma & Welling, 2014) with a learning rate of 0.0001 and default values for $\beta _ { 1 } , \beta _ { 2 }$ , and $\epsilon$ .
280
+
281
+ # C VAE SAMPLES ON THE LINE BENCHMARK
282
+
283
+ In fig. 5, we show some samples from our VAE trained on the synthetic line benchmark. The VAE generally produces realistic samples and seems to cover the data distribution well, despite the fact that it does not produce high-quality interpolations (fig. 3c).
284
+
285
+ # D INTERPOLATION EXAMPLES ON REAL DATA
286
+
287
+ In this section, we provide a series of figures (figs. 6 to 11) showing interpolation behavior for the different autoencoders we studied. Further discussion of these results is available in section 3.3
288
+
289
+ ![](images/011b1d5ca5a163871496158859d0e142b9e53ddb0eae4efef60407763041d635.jpg)
290
+ Figure 5: Samples from a VAE trained on the lines dataset described in section 3.1.
291
+
292
+ ![](images/db363f651bed0df99d894ff8748b176860a5645e01396365f1bbaccac330a733.jpg)
293
+ Figure 6: Example interpolations on MNIST with a latent dimensionality of 32 for (a) Baseline, (b) Denoising, (c) VAE, (d) AAE, (e) VQ-VAE, (f) ACAI autoencoders.
294
+
295
+ ![](images/2efdc3a2b3e2b708fcdafcc88768f0d53ebfd36bbc3051aecfbd180d1f170ce1.jpg)
296
+ Figure 7: Example interpolations on MNIST with a latent dimensionality of 256 for (a) Baseline, (b) Denoising, (c) VAE, (d) AAE, (e) VQ-VAE, (f) ACAI autoencoders.
297
+
298
+ ![](images/47de7ca907daaf8fc9e0bdbadba83520b961226907f1b5076ae26acedb1b1e9c.jpg)
299
+ Figure 8: Example interpolations on SVHN with a latent dimensionality of 32 for (a) Baseline, (b) Denoising, (c) VAE, (d) AAE, (e) VQ-VAE, (f) ACAI autoencoders.
300
+
301
+ ![](images/d6ad7a3f626f887a67a272b156817696c598021ea8e689ebd4cd30406740f6d4.jpg)
302
+ Figure 9: Example interpolations on SVHN with a latent dimensionality of 256 for (a) Baseline, (b) Denoising, (c) VAE, (d) AAE, (e) VQ-VAE, (f) ACAI autoencoders.
303
+
304
+ ![](images/4c48de8b1f74145157c8b8b7cfe6d11bfa33d99734117c359409d43734b2424d.jpg)
305
+ Figure 10: Example interpolations on CelebA with a latent dimensionality of 32 for (a) Baseline, (b) Denoising, (c) VAE, (d) AAE, (e) VQ-VAE, (f) ACAI autoencoders.
306
+
307
+ ![](images/63948b88054bf695f2323771a5e64557140ff80440ce0329caa06dd514cc8482.jpg)
308
+ Figure 11: Example interpolations on CelebA with a latent dimensionality of 256 for (a) Baseline, (b) Denoising, (c) VAE, (d) AAE, (e) VQ-VAE, (f) ACAI autoencoders.
md/train/SJAr0QFxe/SJAr0QFxe.md ADDED
@@ -0,0 +1,452 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DEMYSTIFYING RESNET
2
+
3
+ # Jiantao Jiao, Yanjun Han, Tsachy Weissman
4
+
5
+ Sihan Li
6
+ Department of Electronic Engineering
7
+ Tsinghua University
8
+ Beijing 100084, China
9
+ lisihan13@mails.tsinghua.edu.cn
10
+ Department of Electrical Engineering
11
+ Stanford University
12
+ Stanford, CA 94305, USA
13
+ {jiantao,yjhan,tsachy}@stanford.edu
14
+
15
+ # ABSTRACT
16
+
17
+ We provide a theoretical explanation for the great performance of ResNet via the study of deep linear networks and some nonlinear variants. We show that with or without nonlinearities, by adding shortcuts that have depth two, the condition number of the Hessian of the loss function at the zero initial point is depthinvariant, which makes training very deep models no more difficult than shallow ones. Shortcuts of higher depth result in an extremely flat (high-order) stationary point initially, from which the optimization algorithm is hard to escape. The 1- shortcut, however, is essentially equivalent to no shortcuts. Extensive experiments are provided accompanying our theoretical results. We show that initializing the network to small weights with 2-shortcuts achieves significantly better results than random Gaussian (Xavier) initialization, orthogonal initialization, and shortcuts of deeper depth, from various perspectives ranging from final loss, learning dynamics and stability, to the behavior of the Hessian along the learning process.
18
+
19
+ # 1 INTRODUCTION
20
+
21
+ Residual network (ResNet) was first proposed in He et al. (2015a) and extended in He et al. (2016). It followed a principled approach to add shortcut connections every two layers to a VGG-style network (Simonyan & Zisserman, 2014). The new network becomes easier to train, and achieves both lower training and test errors. Using the new structure, He et al. (2015a) managed to train a network with 1001 layers, which was virtually impossible before. Unlike Highway Network (Srivastava et al., 2015a;b) which not only has shortcut paths but also borrows the idea of gates from LSTM (Sainath et al., 2013), ResNet does not have gates. Later He et al. (2016) found that by keeping a clean shortcut path, residual networks will perform even better.
22
+
23
+ Many attempts have been made to improve ResNet to a further extent. “ResNet in ResNet” (Targ et al., 2016) adds more convolution layers and data paths to each layer, making it capable of representing several types of residual units. “ResNets of ResNets” (Zhang et al., 2016) construct multilevel shortcut connections, which means there exist shortcuts that skip multiple residual units. Wide Residual Networks (Zagoruyko & Komodakis, 2016) makes the residual network shorter but wider, and achieves state of the art results on several datasets while using a shallower network. Moreover, some existing models are also reported to be improved by shortcut connections, including Inceptionv4 (Szegedy et al., 2016), in which shortcut connections make the deep network easier to train.
24
+
25
+ Why are residual networks so easy to train? He et al. (2015a) suggests that layers in residual networks are learning residual mappings, making them easier to represent identity mappings, which prevents the networks from degradation when the depths of the networks increase. However, Veit et al. (2016) claims that ResNets are actually ensembles of shallow networks, which means they do not solve the problem of training deep networks completely.
26
+
27
+ We propose a theoretical explanation for the great performance of ResNet. We concur with He et al. (2015a) that the key contribution of ResNet should be some special structure of the loss function that makes training very deep models no more difficult than shallow ones. Analysis, however, seems non-trivial. Quoting He et al. (2015a):
28
+
29
+ “Deeper non-bottleneck ResNets (e.g., Fig. 5 left) also gain accuracy from increased depth (as shown on CIFAR-10), but are not as economical as the bottleneck ResNets. So the usage of bottleneck designs is mainly due to practical considerations. We further note that the degradation problem of plain nets is also witnessed for the bottleneck designs.
30
+
31
+ Their empirical observations are inspiring. First, the 1-shortcuts mentioned in the first paragraph do not work. Second, noting that the non-bottleneck ResNets have 2-shortcuts, but the bottleneck ResNets use 3-shortcuts, one sees that shortcuts with depth three also do not work. Hence, a reasonable theoretical explanation must be able to distinguish the 2-shortcut from shortcuts of other depths, and clearly demonstrate why the 2-shortcuts are special and are able to ease the optimization process so significantly for deep models, while shortcuts of other depths may not do the job.
32
+
33
+ Aiming at explaining the performance of 2-shortcuts, we need to eliminate other variables that may contribute to the success of ResNet. Indeed, one may argue that the deep structure of ResNet may give it better representation power (lower approximation error), which contributes to lower training errors. To eliminate this effect, we focus on deep linear networks, where deeper models do not have better approximation properties. The special role of 2-shortcuts naturally arises in the study.
34
+
35
+ # 2 MAIN RESULTS
36
+
37
+ Our work reveals that non-degenerate depth-invariant initial condition numbers, a unique property of residual networks with 2-shortcuts, contributed to the success of ResNet. In fact, in a linear network that will be defined rigorously later, the condition number of Hessian of the Frobenius loss function at the zero initial point is
38
+
39
+ $$
40
+ \operatorname { c o n d } ( H ) = { \sqrt { \operatorname { c o n d } ( ( \Sigma ^ { X X } - \Sigma ^ { Y X } ) ^ { T } ( \Sigma ^ { X X } - \Sigma ^ { Y X } ) ) } } ,
41
+ $$
42
+
43
+ which is independent of the number of layers. Here $\Sigma ^ { X X }$ and $\Sigma ^ { Y X }$ denote the input-input and the output-input correlation matrices, defined in Section 3.3. The condition number of a possibly non-PSD matrix is defined as:
44
+
45
+ Definition 1. The condition number of a matrix $A$ is defined as
46
+
47
+ $$
48
+ \operatorname { c o n d } ( A ) = \frac { \sigma _ { \operatorname* { m a x } } ( A ) } { \sigma _ { \operatorname* { m i n } } ( A ) } ,
49
+ $$
50
+
51
+ where $\sigma _ { \mathrm { m a x } } ( A )$ and $\sigma _ { \mathrm { m i n } } ( A )$ are the maximum and minimum of singular values of $A$ . In particular, if $A$ is normal, i.e. $A ^ { T } A \stackrel { \cdot } { = } A A ^ { T }$ , the definition can be simplified to 1
52
+
53
+ $$
54
+ \mathrm { c o n d } ( A ) = { \frac { | \lambda ( A ) | _ { \operatorname* { m a x } } } { | \lambda ( A ) | _ { \operatorname* { m i n } } } } ,
55
+ $$
56
+
57
+ where $| \lambda ( A ) | _ { \mathrm { m a x } }$ and $| \lambda ( A ) | _ { \mathrm { m i n } }$ are the maximum and minimum of the absolute values of eigenvalues of $A$ .
58
+
59
+ Moreover, the zero initial point for ResNet with 2-shortcuts is in fact a so-called strict saddle point (Ge et al., 2015), which are proved to be easy to escape from.
60
+
61
+ Why shortcuts of other depths do not work? We show that the Hessian at the zero initial point for the 1-shortcut ResNet has condition number growing unboundedly for deep nets. As is well known in convex optimization theory, large condition numbers can have enormous adversarial impact on the convergence of first order methods (Nemirovski, 2005). Hence, it is quite clear that starting training at a point with a huge condition number would make the algorithm very difficult to escape from the initial point, making 1-shortcut ResNet no better than conventional approaches.
62
+
63
+ For shortcuts with depth deeper than two, the Hessian at the zero initial point is a zero matrix, making it a higher-order stationary point. Intuitively, the higher order the stationary point is, the harder it is to escape from it. Indeed, it is supported both in theory (Anandkumar & Ge, 2016) and by our experiments.
64
+
65
+ One may still ask: why are we interested in the Hessian at the zero initial point? It is because in order for the outputs of deep neural networks not explode, the singular values of the mapping of each layer are not supposed to be deviating too much from one. Indeed, it is because it is extremely challenging to keep Qnum of layersi=1 λi from exploding or vanishing without keeping all of the λi having unit norm. However, by design ResNet with shortcuts already have an identity mapping every few layers, which forces the mappings inside the shortcuts to have small operator norms. Hence, analyzing the network at zero initial point gives a decent characterization of the searching environment of the optimization algorithm.
66
+
67
+ Our results also shows that the form of Hessian is more important than the existance of nonlinearities when training the networks. The behaviors of the networks we studied are consistent across both linear and nonlinear structures, where networks with clearer Hessians are much easier to achieve lower training errors.
68
+
69
+ On the other hand, our experiments reveal that orthogonal initialization (Saxe et al., 2013) is suboptimal. Although better than Xavier initialization (Glorot & Bengio, 2010), the initial condition numbers of the networks still explode as the networks become deeper, which means the networks are still initialized on “bad” submanifolds that are hard to optimize using gradient descent.
70
+
71
+ # 3 MODEL
72
+
73
+ # 3.1 DEEP LINEAR NETWORKS
74
+
75
+ Deep linear networks are feed-forward neural networks that only contain linear units, which means their input-output mappings are simply linear transformations. Apparently, increasing their depths will not affect the representational power of the networks. However, linear networks with depth deeper than one show nonlinear dynamics of training (Saxe et al., 2013). As a result, analyzing the training of deep linear networks gives us a better understanding of the training of non-linear networks.
76
+
77
+ Much theoretical work has been done on deep linear networks. Kawaguchi (2016) extended the work of Choromanska et al. (2015a;b) and proved that with few assumptions, every local minimum point in deep linear networks is a global minimum point. This means that the difficulties in the training of deep linear networks mostly come from saddle points on the loss surfaces, which are also the main causes of slow learning in nonlinear networks (Pascanu et al., 2014).
78
+
79
+ Saxe et al. (2013) studied the dynamics of training using gradient descent. They found that for a special class of initial conditions, which could be obtained from greedy layerwise pre-training, the training time for a deep linear network with an infinity depth can still be finite. Furthermore, they found that by setting the initial weights to random orthogonal matrices (produced by performing QR or SVD decompositions on random Gaussian matrices), the network will still have a depth independent learning time. They argue that it is caused by the eigenvalue and singular value spectra of the end-to-end linear transformation. When using orthogonal initialization, the overall transformation is an orthogonal matrix, which has all the singular values equal to 1. In the meantime, when using scaled Gaussian initialization, most of the singular values are close to zero, making the network unsuitable for backpropagating errors. However, this explanation is not sufficient to prove that the training difficulty of orthogonal initialized networks is depth-invariant. It only gives us an intuition on why orthogonal initialization performs better than scaled Gaussian initialization.
80
+
81
+ Thus, we use deep linear networks to study the effect of shortcut connections. After adding the shortcuts, the overall model is still linear and the global minimum does not change.
82
+
83
+ # 3.2 NETWORK STRUCTURE
84
+
85
+ We first generalize a linear network by adding shortcuts to it to make it a linear residual network. We organize the network into $R$ residual units. The $r$ -th residual unit consists of $L _ { r }$ layers whose
86
+
87
+ weights are $W ^ { r , 1 } , \ldots , W ^ { r , L _ { r } - 1 }$ , denoted as the transformation path, as well as a shortcut $S ^ { r }$ connecting from the first layer to the last one, denoted as the shortcut path. The input-output mapping can be written as
88
+
89
+ $$
90
+ y = \prod _ { r = 1 } ^ { R } ( \prod _ { l = 1 } ^ { L _ { r } - 1 } W ^ { r , l } + S ^ { r } ) x = W x ,
91
+ $$
92
+
93
+ where $x \in \mathbb { R } ^ { d _ { x } } , y \in \mathbb { R } ^ { d _ { y } } , W \in \mathbb { R } ^ { d _ { y } \times d _ { x } }$ . Here if $b \_ { a }$ , $\textstyle \prod _ { i = a } ^ { b } W ^ { i }$ denotes $W ^ { b } W ^ { ( b - 1 ) } \cdot \cdot \cdot W ^ { ( a + 1 ) } W ^ { a }$ , otherwise it denotes an identity mapping. The matrix $W$ represents the combination of all the linear transformations in the network. Note that by setting all the shortcuts to zeros, the network will go back to a $\begin{array} { r } { ( \sum _ { r } ( L _ { r } - 1 ) + 1 ) } \end{array}$ -layer plain linear network.
94
+
95
+ Instead of analyzing the general form, we concentrate on a special kind of linear residual networks, where all the residual units are the same.
96
+
97
+ Definition 2. A linear residual network is called an $n$ -shortcut linear network if
98
+
99
+ 1. its layers have the same dimension (so that $d _ { x } = d _ { y }$ );
100
+ 2. its shortcuts are identity matrices;
101
+ 3. its shortcuts have the same depth $n$ .
102
+
103
+ The input-output mapping for such a network becomes
104
+
105
+ $$
106
+ y = \prod _ { r = 1 } ^ { R } ( \prod _ { l = 1 } ^ { n } W ^ { r , l } + I _ { d _ { x } } ) x = W x ,
107
+ $$
108
+
109
+ where $W ^ { r , l } \in \mathbb { R } ^ { d _ { x } \times d _ { x } }$ .
110
+
111
+ Then we add some activation functions to the networks. We concentrate on the case where activation functions are on the transformation paths, which is also the case in the latest ResNet (He et al., 2016).
112
+
113
+ Definition 3. An $n$ -shortcut linear network becomes an $n$ -shortcut network if element-wise activation functions $\sigma _ { \mathrm { p r e } } ( x ) , \sigma _ { \mathrm { m i d } } ( x ) , \sigma _ { \mathrm { p o s t } } ( x )$ are added at the transformation paths, where on a transformation path, $\sigma _ { \mathrm { p r e } } ( x )$ is added before the first weight matrix, $\sigma _ { \mathrm { m i d } } ( x )$ is added between two weight matrixes and $\sigma _ { \mathrm { p o s t } } ( x )$ is added after the last weight matrix.
114
+
115
+ $$
116
+ \sqrt { - \frac { p r e } { ( \ p r e ) } \psi _ { \psi } ^ { 1 } ( \ m i d ) \psi _ { \psi } ^ { 2 } ( \ m s t ) } ^ { \gamma } =
117
+ $$
118
+
119
+ Figure 1: An example of different position for nonlinearities in a residual unit of a 2-shortcut network.
120
+
121
+ Note that $n$ -shortcut linear networks are special cases of $n$ -shortcut networks, where all the activation functions are identity mappings.
122
+
123
+ # 3.3 OPTIMIZATION
124
+
125
+ We denote the collection of all the variable weight parameters in an $n$ -shortcut linear network as w. Consider $m$ training samples $\{ x ^ { \mu } , y ^ { \mu } \} , \mu = 1 , \ldots , m$ . Using Frobenius loss, for an $n$ -shortcut linear network, we define the loss function as follows:
126
+
127
+ $$
128
+ L ( \mathbf { w } ) = \frac { 1 } { 2 m } \sum _ { \mu = 1 } ^ { m } \lVert y ^ { \mu } - W x ^ { \mu } \rVert _ { 2 } ^ { 2 } = \frac { 1 } { 2 m } \lVert Y - W X \rVert _ { F } ^ { 2 } ,
129
+ $$
130
+
131
+ where $x ^ { \mu } , y ^ { \mu }$ are the $\mu$ -th columns of $X , Y$ , and $\left\| \cdot \right\| _ { F }$ denotes the Frobenius norm. Using gradient descent with learning rate $\alpha$ , we have the weights updating rules as
132
+
133
+ $$
134
+ \Delta W ^ { r , l } = \alpha ( W _ { \mathrm { a f t e r } } ^ { r } W _ { \mathrm { a f t e r } } ^ { r , l } ) ^ { T } ( \Sigma ^ { Y X } - W \Sigma ^ { X X } ) ( W _ { \mathrm { b e f o r e } } ^ { r , l } W _ { \mathrm { b e f o r e } } ^ { r } ) ^ { T } ,
135
+ $$
136
+
137
+ where $\Sigma ^ { X X }$ and $\Sigma ^ { Y X }$ denote the input-input and the output-input correlation matrices, defined as
138
+
139
+ $$
140
+ \begin{array} { l } { { \displaystyle \Sigma ^ { X X } = \frac { 1 } { m } \sum _ { \mu = 1 } ^ { m } x ^ { \mu } ( x ^ { \mu } ) ^ { T } } } \\ { { \displaystyle \Sigma ^ { Y X } = \frac { 1 } { m } \sum _ { \mu = 1 } ^ { m } y ^ { \mu } ( x ^ { \mu } ) ^ { T } . } } \end{array}
141
+ $$
142
+
143
+ Here $W _ { \mathrm { b e f o r e } } ^ { r } , W _ { \mathrm { a f t e r } } ^ { r }$ denote the linear mappings before and after the $r$ -th residual unit, $W _ { \mathrm { b e f o r e } } ^ { r , l } , W _ { \mathrm { a f t e r } } ^ { r , l }$ denote the linear mappings before and after $W ^ { r , l }$ within the transformation path of the $r$ -th residual unit. In other words, the overall transformation can be represented as
144
+
145
+ $$
146
+ y = W _ { \mathrm { a f t e r } } ^ { r } ( W _ { \mathrm { a f t e r } } ^ { r , l } W ^ { r , l } W _ { \mathrm { b e f o r e } } ^ { r , l } + I _ { d _ { x } } ) W _ { \mathrm { b e f o r e } } ^ { r } x .
147
+ $$
148
+
149
+ # 4 THEORETICAL STUDY
150
+
151
+ # 4.1 INITIAL POINT PROPERTIES
152
+
153
+ Before we analyze the initial point properties of $n$ -shortcut networks, we have to choose the way to initialize them. ResNet uses MSRA initialization (He et al., 2015b). It is a kind of scaled Gaussian initialization that tries to keep the variances of signals along a transformation path, which is also the idea behind Xavier initialization (Glorot & Bengio, 2010). However, because of the shortcut paths, the output variance of the entire network will actually explode as the network becomes deeper. Batch normalization units partly solved this problem in ResNet, but still they cannot prevent the large output variance in a deep network.
154
+
155
+ A simple idea is to zero initialize all the weights, so that the output variances of residual units stay the same along the network. It is worth noting that as found in He et al. (2015a), the deeper ResNet has smaller magnitudes of layer responses. This phenomenon has been confirmed in our experiments. As illustrated in Figure 2 and Figure 3, the deeper a residual network is, the small its average Frobenius norm of weight matrixes is, both during the traning process and when the training ends. Also, Hardt & Ma (2016) proves that if all the weight matrixes have small norms, a linear residual network will have no critical points other than the global optimum.
156
+
157
+ All these evidences indicate that zero is spacial in a residual network: as the network becomes deeper, the training tends to end up around it. Thus, we are looking into the Hessian at zero. As the zero is a saddle point, in our experiments we use zero initialization with small random perturbations to escape from it. We first Xavier initialize the weight matrixes, and then multiply a small constant (0,01) to them.
158
+
159
+ We begin with the definition of $k$ -th order stationary point.
160
+
161
+ Definition 4. Suppose function $f ( x )$ admits $k$ -th order Taylor expansion at point $x _ { 0 }$ . We say that the point $x _ { 0 }$ is a $k$ -th order stationary point of $f ( x )$ if the corresponding $k$ -th order Taylor expansion of $f ( x )$ at $x = x _ { 0 }$ is a constant: $f ( \dot { x } ) \dot { = } f ( x _ { 0 } ) \dot { + } o ( \| x - x _ { 0 } \| _ { 2 } ^ { k } )$ .
162
+
163
+ Now we state our main theorem, whose proof can be found in Appendix A.
164
+
165
+ Theorem 1. Assume that $\sigma _ { \mathrm { m i d } } ( 0 ) = \sigma _ { \mathrm { p o s t } } ( 0 ) = 0$ and all of $\sigma _ { \mathrm { p r e } } ^ { ( k ) } ( 0 ) , \sigma _ { \mathrm { m i d } } ^ { ( k ) } ( 0 ) , \sigma _ { \mathrm { p o s t } } ^ { ( k ) } ( 0 ) , 1 \le k \le$ exist. For the loss function of an $n$ -shortcut network, at point zero,
166
+
167
+ 1. if $n \geq 2$ , it is an $( n - 1 ) t h$ -order stationary point. In particular, if $n \geq 3$ , the Hessian is $a$ zero matrix;
168
+
169
+ ![](images/beaf7b5c60eed4a22b5d4e41c424deddc2d59d92d4b8390a36b17fc0e3c7670c.jpg)
170
+ Figure 2: The average Frobenius norms of ResNets of different depths during the training process. The pre-ResNet implementation in https://github.com/facebook/fb.resnet.torch is used. The learning rate is initialized to 0.1, decreased to 0.01 at the $8 1 ^ { \mathrm { s t } }$ epoch (marked with circles) and decreased to 0.001 at the $1 2 2 ^ { \mathrm { n d } }$ epoch (marked with triangles). Each model is trained for 200 epochs.
171
+
172
+ ![](images/ceffb377ed6bcd64337887c300ae05f7c7ac5ec53bc70681c7e91661a0c31384.jpg)
173
+ Figure 3: The average Frobenius norms of 2-shortcut networks of different depths during the training process when zero initialized. Left: Without nonlinearities. Right: With ReLUs at mid positions.
174
+
175
+ 2. if $n = 2$ , the Hessian can be written as
176
+
177
+ $$
178
+ H = \left[ \begin{array} { c c c c c } { \mathbf { 0 } } & { A ^ { T } } & & & \\ { A } & { \mathbf { 0 } } & & & \\ & & { \mathbf { 0 } } & { A ^ { T } } & \\ & & & { A } & { \mathbf { 0 } } & \\ & & & & { \ddots } \end{array} \right] ,
179
+ $$
180
+
181
+ whose condition number is
182
+
183
+ $$
184
+ \mathrm { c o n d } ( H ) = \sqrt { \mathrm { c o n d } \big ( \big ( \Sigma ^ { X \sigma _ { \mathrm { p r e } } ( X ) } - \Sigma ^ { Y \sigma _ { \mathrm { p r e } } ( X ) } \big ) ^ { T } \big ( \Sigma ^ { X \sigma _ { \mathrm { p r e } } ( X ) } - \Sigma ^ { Y \sigma _ { \mathrm { p r e } } ( X ) } \big ) \big ) } ,
185
+ $$
186
+
187
+ where $A$ only depends on the training set and the activation functions. Except for degenerate cases, it is $a$ strict saddle point (Ge et al., 2015).
188
+
189
+ 3. if $n = 1$ , the Hessian can be written as
190
+
191
+ $$
192
+ H = { \left[ \begin{array} { l l l l l } { B } & { A ^ { T } } & { A ^ { T } } & { \cdots } & { A ^ { T } } \\ { A } & { B } & { A ^ { T } } & { \cdots } & { A ^ { T } } \\ { A } & { A } & { B } & & { \vdots } \\ { \vdots } & { \vdots } & & { \ddots } & { A ^ { T } } \\ { A } & { A } & { \cdots } & { A } & { B } \end{array} \right] }
193
+ $$
194
+
195
+ where $A , B$ only depend on the training set and the activation functions.
196
+
197
+ Theorem 1 shows that the condition numbers of 2-shortcut networks are depth-invariant with a nice structure of eigenvalues. Indeed, the eigenvalues of the Hessian $H$ at the zero initial point are multiple copies of $\pm { \sqrt { \mathrm { e i g s } ( A ^ { T } A ) } }$ , and the number of copies is equal to the number of shortcut connections.
198
+
199
+ The Hessian at zero initial point for the 1-shortcut linear network follows block Toeplitz structure, which has been well studied in the literature. In particular, its condition number tends to explode as the number of layers increase (Gray, 2006).
200
+
201
+ The assumptions hold for most activation functions including tanh, symmetric sigmoid and ReLU (Nair & Hinton, 2010). Note that although ReLU does not have derivatives at zero, one may do a local polynomial approximation to yield $\bar { \sigma } ^ { ( k ) } , 1 \le k \le \operatorname* { m a x } ( n - 1 , 2 )$ .
202
+
203
+ To get intuitive explanations of the theorems, imagine changing parameters in an $n$ -shortcut network. One has to change at least $n$ parameters to make any difference in the loss. So zero is an $( n - 1 ) \operatorname { t h } .$ - order stationary point. Notice that the higher the order of a stationary point, the more difficult for a first order method to escape from it.
204
+
205
+ On the other hand, if $n = 2$ , one will have to change two parameters in the same residual unit but different weight matrices to affect the loss, leading to a clear block diagonal Hessian.
206
+
207
+ # 4.2 LEARNING DYNAMICS
208
+
209
+ To understand Equation (7) better, we can take $n$ -shortcut linear networks to two extremes. First, when $n = 1$ , let $\bar { V } ^ { r , 1 } = W ^ { r , 1 } + I _ { d _ { x } } , r = 1 , \ldots , R - 1$ . As $I _ { d _ { x } }$ is a constant, we have
210
+
211
+ $$
212
+ \Delta V ^ { r , 1 } = \alpha \big ( \prod _ { r ^ { \prime } = r + 1 } ^ { R - 1 } V ^ { r ^ { \prime } , 1 } \big ) ^ { T } \big ( \Sigma ^ { Y X } - ( \prod _ { r ^ { \prime } = 1 } ^ { R - 1 } V ^ { r ^ { \prime } , 1 } ) \Sigma ^ { X X } \big ) ( \prod _ { r ^ { \prime } = 1 } ^ { r - 1 } V ^ { r ^ { \prime } , 1 } ) ^ { T } ,
213
+ $$
214
+
215
+ which can be seen as a linear network with identity initialization, a special case of orthogonal initialization, if the original 1-shortcut network is zero initialized.
216
+
217
+ On the other side, if the number of shortcut connections $R = 1$ , the shortcut will only change the distribution of the output training set from $Y$ to $Y - X$ . These two extremes are illustrated in Figure 4
218
+
219
+ ![](images/b6ad27a7d095370272a40d30d782876e04f599d80639bba16381a8d37e154f78.jpg)
220
+ Figure 4: Equivalents of two extremes of $n$ -shortcut linear networks. 1-shortcut linear networks are equivalent to linear networks with identity initialization, while skip-all shortcuts will only change the effective dataset outputs.
221
+
222
+ # 4.3 LEARNING RESULTS
223
+
224
+ The optimal weights of an $n$ -shortcut linear network can be easily computed via least squares, which leads to
225
+
226
+ $$
227
+ W = Y X ^ { T } ( X X ^ { T } ) ^ { - 1 } = \Sigma ^ { Y X } ( \Sigma ^ { X X } ) ^ { - 1 } ,
228
+ $$
229
+
230
+ and the minimum of the loss function is
231
+
232
+ $$
233
+ L _ { \operatorname* { m i n } } = \frac { 1 } { 2 m } \| Y - \Sigma ^ { Y X } ( \Sigma ^ { X X } ) ^ { - 1 } X \| _ { F } ^ { 2 } ,
234
+ $$
235
+
236
+ where $\left\| \cdot \right\| _ { F }$ denotes the Frobenius norm and $( \Sigma ^ { X X } ) ^ { - 1 }$ denotes any kind of generalized inverse of $\Sigma ^ { X X }$ . So given a training set, we can pre-compute its $L _ { \mathrm { m i n } }$ and use it to evaluate any $n$ -shortcut linear network.
237
+
238
+ # 5 EXPERIMENTS
239
+
240
+ We compare networks with Xavier initialization (Glorot & Bengio, 2010), networks with orthogonal initialization (Saxe et al., 2013) and 2-shortcut networks with zero initialization. The training dynamics of 1-shortcut networks are similar to that of linear networks with orthogonal initialization in our experiments. Setup details can be found in Appendix B.
241
+
242
+ # 5.1 INITIAL POINT
243
+
244
+ We first compute the initial condition numbers for different kinds of linear networks with different depths.
245
+
246
+ As can be seen in Figure 5, 2-shortcut linear networks have constant condition numbers as expected. On the other hand, when using Xavier or orthogonal initialization in linear networks, the initial condition numbers will go to infinity as the depths become infinity, making the networks hard to train. This also explains why orthogonal initialization is helpful for a linear network, as its initial condition number grows slower than the Xavier initialization.
247
+
248
+ # 5.2 LEARNING DYNAMICS
249
+
250
+ Having a good beginning does not guarantee an easy trip on the loss surface. In order to depict the loss surfaces encountered from different initial points, we plot the maxima and $1 0 ^ { \mathrm { t h } }$ percentiles (instead of minima, as they are very unstable) of the absolute values of Hessians eigenvalues at different losses.
251
+
252
+ As shown in Figure 6 and Figure 7, the condition numbers of 2-shortcut networks at different losses are always smaller, especially when the loss is large. Also, notice that the condition numbers roughly evolved to the same value for both orthogonal and 2-shortcut linear networks. This may be explained by the fact that the minimizers, as well as any point near them, have similar condition numbers.
253
+
254
+ ![](images/e7fd6d2242db1b2949e02ba010cb7e5cb5d9c549740871ede39a2991a1117cb8.jpg)
255
+ Figure 5: Initial condition numbers of Hessians for different linear networks as the depths of the networks increase. Means and standard deviations are estimated based on 10 runs.
256
+
257
+ ![](images/e491de132755164c6b09e1268f561d391860e12cc863ba5a0230cb1de6d43673.jpg)
258
+ Figure 6: Maxima and $1 0 ^ { \mathrm { t h } }$ percentiles of absolute values of eigenvalues at different losses when the depth is 16. For each run, eigenvalues at different losses are calculated using linear interpolation.
259
+
260
+ ![](images/ba43372fef7c3f9396fae16676451e3cdd27147ecb5a9938f72a36666ccac965.jpg)
261
+ Figure 7: Maxima and $1 0 ^ { \mathrm { t h } }$ percentiles of absolute values of eigenvalues at different losses when the depth is 16. Eigenvalues at different losses are calculated using linear interpolation.
262
+
263
+ Another observation is the changes of negative eigenvalues ratios. Index (ratio of negative eigenvalues) is an important characteristic of a critical point. Usually for the critical points of a neural network, the larger the loss the larger the index (Dauphin et al., 2014). In our experiments, the index of a 2-shortcut network is always smaller, and drops dramatically at the beginning, as shown in Figure 8, left. This might make the networks tend to stop at low critical points.
264
+
265
+ ![](images/0f8f47ef870bf1849218165268309fb3a477f94337f8f5859b3d68f17569a922.jpg)
266
+ Figure 8: Left: ratio of negative eigenvalues at different losses when the depth is 16. For each run, indexes at different losses are calculated using linear interpolation. Right: the dynamics of gradient and index of a 2-shortcut linear network in a single run. The gradient reaches its maximum while the index drops dramatically, indicating moving toward negative curvature directions.
267
+
268
+ This is because the initial point is near a saddle point, thus it tends to go towards negative curvature directions, eliminating some negative eigenvalues at the beginning. This phenomenon matches the observation that the gradient reaches its maximum when the index drops dramatically, as shown in Figure 8, right.
269
+
270
+ # 5.3 LEARNING RESULTS
271
+
272
+ We run different networks for 1000 epochs using different learning rates at log scale, and compare the average final losses of the optimal learning rates.
273
+
274
+ ![](images/64bafd2db8aa80844103d468a5de18786ce11bc7a0ffb813b0996a44b26f1092.jpg)
275
+ Figure 9: Left: Optimal Final losses of different linear networks. Right: Corresponding optimal learning rates. When the depth is 96, the final losses of Xavier with different learning rates are basically the same, so the optimal learning rate is omitted as it is very unstable.
276
+
277
+ Figure 9 shows the results for linear networks. Just like their depth-invariant initial condition numbers, the final losses of 2-shortcut linear networks stay close to optimal as the networks become deeper. Higher learning rates can also be applied, resulting in fast learning in deep networks.
278
+
279
+ Then we add ReLUs to the mid positions of the networks. To make a fair comparison, the numbers of ReLU units in different networks are the same when the depths are the same, so 1-shortcut and 3-shortcut networks are omitted. The result is shown in Figure 10.
280
+
281
+ ![](images/1428f5f735a5850cd487815f64fb147c4ee07c34d8c8ff465fceef3b2c47cf17.jpg)
282
+ Figure 10: Left: Optimal Final losses of different networks with ReLUs in mid positions. Right: Corresponding optimal learning rates. Note that as it is hard to compute the minimum losses with ReLUs, we plot the $\log _ { 1 0 }$ (final loss) instead of $\log _ { 1 0 }$ (final loss − optimal loss). When the depth is 64, the final losses of Xavier-ReLU and orthogonal-ReLU with different learning rates are basically the same, so the optimal learning rates are omitted as they are very unstable.
283
+
284
+ Note that because of the nonlinearities, the optimal losses vary for different networks with different depths. It is usually thought that deeper networks can represent more complex models, leading to smaller optimal losses. However, our experiments show that linear networks with Xavier or orthogonal initialization have difficulties finding these optimal points, while 2-shortcut networks find these optimal points easily as they did without nonlinear units.
285
+
286
+ # 6 FUTURE DIRECTIONS
287
+
288
+ Further studies should concentrate on the behavior of shortcut connections on convolution networks, as well as the influences of batch normalization units (Ioffe & Szegedy, 2015) in ResNet. Meanwhile, it would be very interesting to extend the insights obtained in this paper to recurrent neural networks such as LSTM (Sainath et al., 2013).
289
+
290
+ # REFERENCES
291
+
292
+ Anima Anandkumar and Rong Ge. Efficient approaches for escaping higher order saddle points in non-convex optimization. arXiv preprint arXiv:1602.05908, 2016.
293
+
294
+ Chris Bishop. Exact calculation of the hessian matrix for the multilayer perceptron. Neural Computation, 4(4):494–501, 1992.
295
+
296
+ Anna Choromanska, Mikael Henaff, Michael Mathieu, Gerard Ben Arous, and Yann LeCun. The ´ loss surfaces of multilayer networks. In AISTATS, 2015a.
297
+
298
+ Anna Choromanska, Yann LeCun, and Gerard Ben Arous. Open problem: The landscape of the ´ loss surfaces of multilayer networks. In Proceedings of The 28th Conference on Learning Theory, COLT 2015, Paris, France, July 3, volume 6, pp. 1756–1760, 2015b.
299
+
300
+ Yann N Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In Advances in neural information processing systems, pp. 2933–2941, 2014.
301
+
302
+ Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle pointsonline stochastic gradient for tensor decomposition. In Proceedings of The 28th Conference on Learning Theory, pp. 797–842, 2015.
303
+
304
+ Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Aistats, volume 9, pp. 249–256, 2010.
305
+
306
+ Robert M Gray. Toeplitz and circulant matrices: A review. now publishers inc, 2006.
307
+
308
+ Moritz Hardt and Tengyu Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016.
309
+
310
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015a.
311
+
312
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1026–1034, 2015b.
313
+
314
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. arXiv preprint arXiv:1603.05027, 2016.
315
+
316
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
317
+
318
+ Kenji Kawaguchi. Deep learning without poor local minima. arXiv preprint arXiv:1605.07110, 2016.
319
+
320
+ Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 807–814, 2010.
321
+
322
+ Arkadi Nemirovski. Efficient methods in convex programming. 2005.
323
+
324
+ Razvan Pascanu, Yann N Dauphin, Surya Ganguli, and Yoshua Bengio. On the saddle point problem for non-convex optimization. arXiv preprint arXiv:1405.4604, 2014.
325
+
326
+ T.N. Sainath, O. Vinyals, A. Senior, and H. Sak. Convolutional, Long short-term memory, fully connected deep neural networks. Journal of Chemical Information and Modeling, 53(9):1689– 1699, 2013. ISSN 1098-6596. doi: 10.1017/CBO9781107415324.004.
327
+
328
+ Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013.
329
+
330
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
331
+
332
+ Rupesh K Srivastava, Klaus Greff, and Jurgen Schmidhuber. Training very deep networks. In ¨ Advances in neural information processing systems, pp. 2377–2385, 2015a.
333
+
334
+ Rupesh Kumar Srivastava, Klaus Greff, and Jurgen Schmidhuber. Highway networks. ¨ arXiv preprint arXiv:1505.00387, 2015b.
335
+
336
+ Christian Szegedy, Sergey Ioffe, and Vincent Vanhoucke. Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning. feb 2016. URL http://arxiv.org/abs/ 1602.07261.
337
+
338
+ Sasha Targ, Diogo Almeida, and Kevin Lyman. Resnet in resnet: Generalizing residual architectures. arXiv preprint arXiv:1603.08029, 2016.
339
+
340
+ Andreas Veit, Michael Wilber, and Serge Belongie. Residual networks are exponential ensembles of relatively shallow networks. arXiv preprint arXiv:1605.06431, 2016.
341
+
342
+ Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
343
+
344
+ Ke Zhang, Miao Sun, Tony X Han, Xingfang Yuan, Liru Guo, and Tao Liu. Residual networks of residual networks: Multilevel residual networks. arXiv preprint arXiv:1608.02908, 2016.
345
+
346
+ # A PROOFS OF THEOREMS
347
+
348
+ Definition 5. The elements in Hessian of an $n$ -shortcut network is defined as
349
+
350
+ $$
351
+ H _ { \mathrm { i n d } ( w _ { 1 } ) , \mathrm { i n d } ( w _ { 2 } ) } = \frac { \partial ^ { 2 } L } { \partial w _ { 1 } \partial w _ { 2 } } ,
352
+ $$
353
+
354
+ where $L$ is the loss function, and the indices $\operatorname { i n d } ( \cdot )$ is ordered lexicographically following the four indices $( r , l , j , i )$ of the weight variable $\underset { \cdot } { w _ { i , j } ^ { r , l } }$ . In other words, the priority decreases along the index of shortcuts, index of weight matrix inside shortcuts, index of column, and index of row.
355
+
356
+ Note that the collection of all the weight variables in the $n$ -shortcut network is denoted as w. We study the behavior of the loss function in the vicinity of ${ \bf w } = { \bf 0 }$ .
357
+
358
+ Lemma 1. Assume that $w _ { 1 } \ = \ w _ { i _ { 1 } , j _ { 1 } } ^ { r _ { 1 } , l _ { 1 } } , \cdot \cdot \cdot , w _ { N } \ = \ w _ { i _ { N } , j _ { N } } ^ { r _ { N } , l _ { N } }$ are $N$ parameters of an $n$ -shortcut network. If ∂ L∂w1···∂wN $\begin{array} { r } { I f \frac { \partial ^ { 2 } L } { \partial w _ { 1 } \cdots \partial w _ { N } } \bigg | _ { \mathbf { w } = \mathbf { 0 } } } \end{array}$ is nonzero, there exists $r$ and $k _ { 1 } , \cdots , k _ { n }$ such that $r _ { k _ { m } } = r a n d l _ { k _ { m } } = m$ for $m = 1 , \cdots , n$ .
359
+
360
+ Proof. Assume there does not exist such $r$ and $k _ { 1 } , \cdots , k _ { n }$ , then for all the shortcut units $r =$ $1 , \cdots , R$ , there exists a weight matrix $l$ such that none of $w _ { 1 } , \cdots , w _ { N }$ is in $W ^ { r , l }$ , so all the transformation paths are zero, which means $W = I _ { d _ { x } }$ . Then $\left. \frac { \partial ^ { 2 } L } { \partial w _ { 1 } \cdots \partial w _ { N } } \right| _ { { \bf w } = { \bf 0 } } = 0$ , leading to a contradiction. □
361
+
362
+ Lemma 2. Assume that $w _ { 1 } = w _ { i _ { 1 } , j _ { 1 } } ^ { r _ { 1 } , l _ { 1 } } , w _ { 2 } = w _ { i _ { 2 } , j _ { 2 } } ^ { r _ { 2 } , l _ { 2 } } , r _ { 1 } \le r _ { 2 }$ . Let $L _ { 0 } ( w _ { 1 } , w _ { 2 } )$ denotes the loss function with all the parameters except 0 $w _ { 1 }$ and $w _ { 2 }$ set to $O _ { ; }$ , $w _ { 1 } ^ { \prime } = w _ { i _ { 1 } , j _ { 1 } } ^ { 1 , l _ { 1 } } , w _ { 2 } ^ { \prime } = w _ { i _ { 2 } , j _ { 2 } } ^ { 1 + \mathbb { 1 } ( r _ { 1 } \neq r _ { 2 } ) , l _ { 2 } }$ . Then $\begin{array} { r } { \frac { \partial ^ { 2 } L _ { 0 } ( w _ { 1 } , w _ { 2 } ) } { \partial w _ { 1 } \partial w _ { 2 } } | _ { ( w _ { 1 } , w _ { 2 } ) = 0 } = \frac { \partial ^ { 2 } L _ { 0 } ( w _ { 1 } ^ { \prime } , w _ { 2 } ^ { \prime } ) } { \partial w _ { 1 } ^ { \prime } \partial w _ { 2 } ^ { \prime } } | _ { ( w _ { 1 } ^ { \prime } , w _ { 2 } ^ { \prime } ) = 0 } . } \end{array}$
363
+
364
+ Proof. As all the residual units expect unit $r _ { 1 }$ and $r _ { 2 }$ are identity transformations, reordering residual units while preserving the order of units $r _ { 1 }$ and $r _ { 2 }$ will not affect the overall transformation, i.e. $L _ { 0 } ( w _ { 1 } , w _ { 2 } ) | _ { w _ { 1 } = a , w _ { 2 } = b } ~ = ~ L _ { 0 } ^ { \prime } ( w _ { 1 } ^ { \prime } , w _ { 2 } ^ { \prime } ) | _ { w _ { 1 } ^ { \prime } = a , w _ { 2 } ^ { \prime } = b }$ . So $\frac { \partial ^ { 2 } L _ { 0 } ( w _ { 1 } , w _ { 2 } ) } { \partial w _ { 1 } \partial w _ { 2 } } | _ { ( w _ { 1 } , w _ { 2 } ) = { \bf 0 } } =$ $\frac { \partial ^ { 2 } L _ { 0 } ( w _ { 1 } ^ { \prime } , w _ { 2 } ^ { \prime } ) } { \partial w _ { 1 } ^ { \prime } \partial w _ { 2 } ^ { \prime } } \big | _ { ( w _ { 1 } ^ { \prime } , w _ { 2 } ^ { \prime } ) = { \bf 0 } }$ . □
365
+
366
+ Proof of Theorem 1. Now we can prove Theorem 1 with the help of the previously established lemmas.
367
+
368
+ 1. Using Lemma 1, for an $n$ -shortcut network, at zero, all the $k$ -th order partial derivatives of the loss function are zero, where $k$ ranges from 1 to $n - 1$ . Hence, the initial point zero is a $( n - 1 )$ th-order stationary point of the loss function.
369
+
370
+ 2. Consider the Hessian in $n = 2$ case. Using Lemma 1 and Lemma 2, the form of Hessian can be directly written as Equation (11), as illustrated in Figure 11.
371
+
372
+ So we have
373
+
374
+ $$
375
+ \mathrm { e i g s } ( H ) = \mathrm { e i g s } ( \left[ { \bf 0 } \quad A ^ { T } \right] ) = \pm \sqrt { \mathrm { e i g s } ( A ^ { T } A ) } .
376
+ $$
377
+
378
+ Thus $\operatorname { c o n d } ( H ) = { \sqrt { \operatorname { c o n d } ( A ^ { T } A ) } }$ , which is depth-invariant. Note that the dimension of $A$ is $d _ { x } ^ { 2 } \times d _ { x } ^ { 2 }$ .
379
+
380
+ To get the expression of $A$ , consider two parameters that are in the same residual unit but different weight matrices, i.e. $w _ { 1 } = w _ { i _ { 1 } , j _ { 1 } } ^ { r , 2 } , w _ { 2 } = w _ { i _ { 2 } , j _ { 2 } } ^ { r , 1 }$ .
381
+
382
+ ![](images/963e9a8de93364de78d221fd32e403c39d4e55d5d393094e5790d48bdff4c5ee.jpg)
383
+ Figure 11: The Hessian in $n = 2$ case. It follows from Lemma 1 that only off-diagonal subblocks in each diagonal block, i.e., the blocks marked in orange (slash) and blue (chessboard), are non-zero. From Lemma 2, we conclude the translation invariance and that all blocks marked in orange (slash) (resp. blue (chessboard)) are the same. Given that the Hessian is symmetric, the blocks marked in blue and orange are transposes of each other, and thus it can be directly written as Equation (11).
384
+
385
+ If $j _ { 1 } = i _ { 2 }$ , we have
386
+
387
+ $$
388
+ \begin{array} { l } { { A _ { ( j _ { 1 } - 1 ) d _ { x } + i _ { 1 } , ( j _ { 2 } - 1 ) d _ { x } + i _ { 2 } } = \displaystyle \frac { \partial ^ { 2 } { \cal L } } { \partial w _ { 1 } \partial w _ { 2 } } \Big | _ { { \bf w } = { \bf 0 } } } } \\ { { \phantom { A } = \displaystyle \frac { \partial ^ { 2 } \sum _ { \mu = 1 } ^ { m } \frac { 1 } { 2 m } ( y _ { i _ { 1 } } ^ { \mu } - x _ { i _ { 1 } } ^ { \mu } - \sigma _ { \mathrm { p o s t } } ( w _ { 1 } \sigma _ { \mathrm { m i d } } ( w _ { 2 } \sigma _ { \mathrm { p r e } } ( x _ { j _ { 2 } } ^ { \mu } ) ) ) ) ^ { 2 } } { \partial w _ { 1 } \partial w _ { 2 } } \Big | _ { { \bf w } = { \bf 0 } } } } \\ { { \phantom { A } = \displaystyle \frac { \sigma _ { \mathrm { m i d } } ^ { \prime } ( 0 ) \sigma _ { \mathrm { p o s t } } ^ { \prime } ( 0 ) } { m } \sum _ { \mu = 1 } ^ { m } \sigma _ { \mathrm { p r e } } ( x _ { j _ { 2 } } ^ { \mu } ) ( x _ { i _ { 1 } } ^ { \mu } - y _ { i _ { 1 } } ^ { \mu } ) . } } \end{array}
389
+ $$
390
+
391
+ Else, we have $A _ { ( j _ { 1 } - 1 ) d _ { x } + i _ { 1 } , ( j _ { 2 } - 1 ) d _ { x } + i _ { 2 } } = 0 .$
392
+
393
+ Noting that $A _ { ( j _ { 1 } , \ldots , 1 ) d _ { x } + i _ { 1 } , ( j _ { 2 } - 1 ) d _ { x } + i _ { 2 } }$ in fact only depends on the two indices $i _ { 1 } , j _ { 2 }$ (with a small difference depending on whether $\begin{array} { r l r } { j _ { 1 } } & { { } = } & { i _ { 2 } ) } \end{array}$ , we make a $d _ { x } \mathrm { ~ ~ \times ~ }$ $d _ { x }$ matrix with rows indexed by $i _ { 1 }$ and columns indexed by $j _ { 2 }$ , and the entry at $( i _ { 1 } , j _ { 2 } )$ equal to $A _ { ( j _ { 1 } - 1 ) d _ { x } + i _ { 1 } , ( j _ { 2 } - 1 ) d _ { x } + i _ { 2 } }$ . Apparently, this matrix is equal to $\sigma _ { \mathrm { m i d } } ^ { \prime } ( 0 ) \sigma _ { \mathrm { p o s t } } ^ { \prime } ( 0 ) \bigl ( \Sigma ^ { X \sigma _ { \mathrm { p r e } } ( X ) } - \Sigma ^ { Y \sigma _ { \mathrm { p r e } } ( X ) } \bigr )$ when $j _ { 1 } ~ = ~ i _ { 2 }$ , and equal to the zero matrix when $j _ { 1 } \neq i _ { 2 }$ .
394
+
395
+ To simplify the expression of $A$ , we rearrange the columns of $A$ by a permutation matrix, i.e.
396
+
397
+ $$
398
+ A ^ { \prime } = A P ,
399
+ $$
400
+
401
+ where $P _ { i j } = 1$ if and only if $\begin{array} { r } { i = ( ( j - 1 ) \bmod d _ { x } ) d _ { x } + \lceil \frac { j } { d _ { x } } \rceil } \end{array}$ . Basically it permutes the $i$ -th column of $A$ to the $j$ -th column.
402
+
403
+ Then we have
404
+
405
+ $$
406
+ A = \sigma _ { \mathrm { m i d } } ^ { \prime } ( 0 ) \sigma _ { \mathrm { p o s t } } ^ { \prime } ( 0 ) \left[ \begin{array} { l l l l } { \Sigma ^ { X \sigma _ { \mathrm { p r e } } ( X ) } - \Sigma ^ { Y \sigma _ { \mathrm { p r e } } ( X ) } } & & & \\ & & { \ddots } & & \\ & & & { \Sigma ^ { X \sigma _ { \mathrm { p r e } } ( X ) } - \Sigma ^ { Y \sigma _ { \mathrm { p r e } } ( X ) } } \end{array} \right] P ^ { T } .
407
+ $$
408
+
409
+ So the eigenvalues of $H$ becomes
410
+
411
+ $$
412
+ \begin{array} { r } { \mathrm { e i g s } ( H ) = \pm \sigma _ { \mathrm { m i d } } ^ { \prime } ( 0 ) \sigma _ { \mathrm { p o s t } } ^ { \prime } ( 0 ) \sqrt { \mathrm { e i g s } \big ( ( \Sigma ^ { X \sigma _ { \mathrm { p r e } } } ( X ) - \Sigma ^ { Y \sigma _ { \mathrm { p r e } } } ( X ) \big ) T \big ( \Sigma ^ { X \sigma _ { \mathrm { p r e } } } ( X ) - \Sigma ^ { Y \sigma _ { \mathrm { p r e } } } ( X ) \big ) \big ) } , } \end{array}
413
+ $$
414
+
415
+ which leads to Equation (12).
416
+
417
+ 3. Now consider the Hessian in the $n = 1$ case. Using Lemma 2, the form of Hessian can be directly written as Equation (13).
418
+
419
+ To get the expressions of $A$ and $B$ in $\sigma _ { \mathrm { p r e } } ( x ) = \sigma _ { \mathrm { p o s t } } ( x ) = x$ case, consider two parameters that are in the same residual units, i.e. $w _ { 1 } = w _ { i _ { 1 } , j _ { 1 } } ^ { r , 1 } , w _ { 2 } = w _ { i _ { 2 } , j _ { 2 } } ^ { r , 1 }$ .
420
+
421
+ We have
422
+
423
+ $$
424
+ \begin{array} { r l } { B _ { ( j _ { 1 } - 1 ) d _ { x } + i _ { 1 } , ( j _ { 2 } - 1 ) d _ { x } + i _ { 2 } } = \frac { \partial ^ { 2 } { \cal L } } { \partial w _ { 1 } \partial w _ { 2 } } \Big | _ { { \bf w } = { \bf 0 } } } & { { } } \\ { \quad \quad } & { { } = \left\{ \begin{array} { l l } { \frac { 1 } { m } \sum _ { \mu = 1 } ^ { m } x _ { j _ { 1 } } ^ { \mu } x _ { j _ { 2 } } ^ { \mu } } & { i _ { 1 } = i _ { 2 } } \\ { 0 } & { i _ { 1 } \ne i _ { 2 } } \end{array} \right. } \end{array}
425
+ $$
426
+
427
+ Rearrange the order of variables using $P$ , we have
428
+
429
+ $$
430
+ \boldsymbol { B } = \boldsymbol { P } \left[ \begin{array} { l l l } { \boldsymbol { \Sigma } ^ { X X } } & & \\ & { \boldsymbol { \cdot } } & \\ & & { \boldsymbol { \cdot } \boldsymbol { \cdot } } \\ & & & { \boldsymbol { \Sigma } ^ { X X } } \end{array} \right] \boldsymbol { P } ^ { T } .
431
+ $$
432
+
433
+ Then consider two parameters that are in different residual units, i.e. $w _ { 1 } = w _ { i _ { 1 } , j _ { 1 } } ^ { r _ { 1 } , 1 } , w _ { 2 } =$
434
+ $w _ { i _ { 2 } , j _ { 2 } } ^ { r _ { 2 } , 1 } , r _ { 1 } > r _ { 2 }$ .
435
+
436
+ We have
437
+
438
+ $$
439
+ \begin{array} { l l } { { A _ { ( j _ { 1 } - 1 ) d _ { x } + i _ { 1 } , ( j _ { 2 } - 1 ) d _ { x } + i _ { 2 } } = \displaystyle \frac { \partial ^ { 2 } { \cal L } } { \partial w _ { 1 } \partial w _ { 2 } } \Big | _ { { \bf w } = { \bf 0 } } } } \\ { { \ } } \\ { { \quad = \left\{ \begin{array} { l l } { { \frac { 1 } { m } \sum _ { \mu = 1 } ^ { m } ( x _ { i _ { 1 } } ^ { \mu } - y _ { i _ { 1 } } ^ { \mu } ) x _ { j _ { 2 } } ^ { \mu } + x _ { j _ { 1 } } ^ { \mu } x _ { j _ { 2 } } ^ { \mu } } } & { { j _ { 1 } = i _ { 2 } , i _ { 1 } = i _ { 2 } } } \\ { { \frac { 1 } { m } \sum _ { \mu = 1 } ^ { m } ( x _ { i _ { 1 } } ^ { \mu } - y _ { i _ { 1 } } ^ { \mu } ) x _ { j _ { 2 } } ^ { \mu } } } & { { j _ { 1 } = i _ { 2 } , i _ { 1 } \neq i _ { 2 } } } \\ { { \frac { 1 } { m } \sum _ { \mu = 1 } ^ { m } x _ { j _ { 1 } } ^ { \mu } x _ { j _ { 2 } } ^ { \mu } } } & { { j _ { 1 } \neq i _ { 2 } , i _ { 1 } = i _ { 2 } } } \\ { { 0 } } & { { j _ { 1 } \neq i _ { 2 } , i _ { 1 } \neq i _ { 2 } } } \end{array} \right. } } \end{array}
440
+ $$
441
+
442
+ In the same way, we can rewrite $A$ as
443
+
444
+ $$
445
+ \boldsymbol { A } = \left[ \begin{array} { l l l } { \boldsymbol { \Sigma } ^ { X X } - \boldsymbol { \Sigma } ^ { Y X } } & & \\ & { \boldsymbol { \cdot } } & \\ & & { \boldsymbol { \cdot } \boldsymbol { \cdot } } & \\ & & { \boldsymbol { \Sigma } ^ { X X } - \boldsymbol { \Sigma } ^ { Y X } } \end{array} \right] \boldsymbol { P } ^ { T } + \boldsymbol { B } .
446
+ $$
447
+
448
+ # B EXPERIMENT SETUP
449
+
450
+ We took the experiments on whitened versions of MNIST. 10 greatest principal components are kept for the dataset inputs. The dataset outputs are represented using one-hot encoding. The network was trained using gradient descent. For every epoch, the Hessians of the networks were calculated using the method proposed in (Bishop, 1992). As the $| \lambda | _ { \operatorname* { m i n } }$ of Hessian is usually very unstable, we calculated $\frac { | \lambda | _ { \operatorname* { m a x } } } { | \lambda | _ { ( 0 . 1 ) } }$ to represent condition number instead, where $| \lambda | _ { ( 0 . 1 ) }$ is the $1 0 ^ { \mathrm { t h } }$ percentile of the absolute values of eigenvalues.
451
+
452
+ As pre, mid or post positions are not defined in linear networks without shortcuts, when comparing Xavier or orthogonal initialized linear networks to 2-shortcut networks, we added ReLUs at the same positions in linear networks as in 2-shortcuts networks.
md/train/SylKikSYDH/SylKikSYDH.md ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # COMPRESSIVE TRANSFORMERS FOR LONG-RANGE SEQUENCE MODELLING
2
+
3
+ Jack W. Rae∗∗ † ‡ Anna Potapenko\*† Siddhant M. Jayakumar† Chloe Hillier†
4
+
5
+ Timothy P. Lillicrap†‡
6
+
7
+ # ABSTRACT
8
+
9
+ We present the Compressive Transformer, an attentive sequence model which compresses past memories for long-range sequence learning. We find the Compressive Transformer obtains state-of-the-art language modelling results in the WikiText-103 and Enwik8 benchmarks, achieving $1 7 . 1 \ \mathrm { p p l }$ and 0.97 bpc respectively. We also find it can model high-frequency speech effectively and can be used as a memory mechanism for RL, demonstrated on an object matching task. To promote the domain of long-range sequence learning, we propose a new openvocabulary language modelling benchmark derived from books, PG-19.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Humans have a remarkable ability to remember information over long time horizons. When reading a book, we build up a compressed representation of the past narrative, such as the characters and events that have built up the story so far. We can do this even if they are separated by thousands of words from the current text, or long stretches of time between readings. During daily life, we make use of memories at varying time-scales: from locating the car keys, placed in the morning, to recalling the name of an old friend from decades ago. These feats of memorisation are not achieved by storing every sensory glimpse throughout one’s lifetime, but via lossy compression. We aggressively select, filter, or integrate input stimuli based on factors of surprise, perceived danger, or repetition — amongst other signals (Richards and Frankland, 2017).
14
+
15
+ Memory systems in artificial neural networks began with very compact representations of the past. Recurrent neural networks (RNNs, Rumelhart et al. (1986)) learn to represent the history of observations in a compressed state vector. The state is compressed because it uses far less space than the history of observations — the model only preserving information that is pertinent to the optimization of the loss. The LSTM (Hochreiter and Schmidhuber, 1997) is perhaps the most ubiquitous RNN variant; it uses learned gates on its state vector to determine what information is stored or forgotten from memory.
16
+
17
+ However since the LSTM, there has been great benefit discovered in not bottlenecking all historical information in the state, but instead in keeping past activations around in an external memory and attending to them. The Transformer (Vaswani et al., 2017) is a sequence model which stores the hidden activation of every time-step, and integrates this information using an attention operator (Bahdanau et al., 2014). The Transformer will thus represent the past with a tensor (depth $\times$ memory size $\times$ dimension) of past observations that is, in practice, an order of magnitude larger than an LSTM’s hidden state. With this granular memory, the Transformer has brought about a step-change in state-of-the-art performance, within machine translation (Vaswani et al., 2017), language modelling (Dai et al., 2019; Shoeybi et al., 2019), video captioning (Zhou et al., 2018), and a multitude of language understanding benchmarks (Devlin et al., 2018; Yang et al., 2019) amongst others.
18
+
19
+ One drawback in storing everything is the computational cost of attending to every time-step and the storage cost of preserving this large memory. Several works have focused on reducing the computational cost of attention with sparse access mechanisms (Rae et al., 2016; Child et al., 2019;
20
+
21
+ Sukhbaatar et al., 2019; Lample et al., 2019). However sparse attention does not solve the storage problem, and often requires custom sparse kernels for efficient implementation. Instead we look back to the notion of compactly representing the past. We show this can be built with simple dense linear-algebra components, such as convolutions, and can reduce both the space and compute cost of our models.
22
+
23
+ We propose the Compressive Transformer, a simple extension to the Transformer which maps past hidden activations (memories) to a smaller set of compressed representations (compressed memories). The Compressive Transformer uses the same attention mechanism over its set of memories and compressed memories, learning to query both its short-term granular memory and longer-term coarse memory. We observe this improves the modelling of text, achieving state-of-the-art results in character-based language modelling — 0.97 bpc on Enwik8 from the Hutter Prize (Hutter, 2012) — and word-level language modelling — 17.1 perplexity on WikiText-103 (Merity et al., 2016). Specifically, we see the Compressive Transformer improves the modelling of rare words.
24
+
25
+ We show the Compressive Transformer works not only for language, but can also model the waveform of high-frequency speech with a trend of lower likelihood than the TransformerXL and Wavenet (Oord et al., 2016) when trained over 400,000 steps. We also show the Compressive Transformer can be used as a memory component within an RL agent, IMPALA (Espeholt et al., 2018), and can successfully compress and make use of past observations.
26
+
27
+ Furthermore we present a new book-level language-modelling benchmark PG-19, extracted from texts in Project Gutenberg1, to further promote the direction of long-context sequence modelling. This is over double the size of existing LM benchmarks and contains text with much longer contexts.
28
+
29
+ # 2 RELATED WORK
30
+
31
+ There have been a variety of recent attempts to extend the range of attention, particularly in the Transformer, or to replace the attention operation with something less expensive. Wu et al. (2019) show that a convolution-like operator that runs in linear time can actually exceed the performance of the quadratic-time self-attention layer in the Transformer at sentence-to-sentence translation and sentence-level language modelling. However such a mechanism inhibits the flow of information across a large number of time-steps for a given layer, and has not shown to be beneficial for longrange sequence modelling.
32
+
33
+ Dai et al. (2019) propose the TransformerXL, which keeps past activations around in memory. They also propose a novel relative positional embedding scheme which they see outperforms the Transformer’s original absolute positional system. Our model incorporates both of these ideas, the use of a memory to preserve prior activations and their relative positional embedding scheme.
34
+
35
+ The Sparse Transformer (Child et al., 2019) uses fixed sparse attention masks to attend to roughly√ $\sqrt { n }$ locations in memory. This approach still requires keeping all memories around during training, however with careful re-materialization of activations and custom kernels, the authors are able to train the model with a reasonable budget of memory and compute. When run on Enwik8, the much larger attention window of 8, 000 improves model performance, but overall it does not significantly outperform a simpler TransformerXL with a much smaller attention window.
36
+
37
+ The use of dynamic attention spans is explored in Sukhbaatar et al. (2019). Different attention heads can learn to have shorter or longer spans of attention — and they observe this achieves state-ofthe-art in character-based language modelling. This idea could easily be combined with our contribution — a compressive memory. However an efficient implementation is not possible on current dense-linear-algebra accelerators, such as Google’s TPUs, due to the need for dynamic and sparse computation. Our approach builds on simple dense linear algebra components, such as convolutions.
38
+
39
+ # 3 MODEL
40
+
41
+ We present the Compressive Transformer, a long-range sequence model which compacts past activations into a compressed memory2. The Compressive Transformer is a variant of the Transformer (Vaswani et al., 2017), a deep residual network which only uses attention to propagate information over time (namely multi-head attention). We build on the ideas of the TransformerXL (Dai et al., 2019) which maintains a memory of past activations at each layer to preserve a longer history of context. The TransformerXL discards past activations when they become sufficiently old (controlled by the size of the memory). The key principle of the Compressive Transformer is to compress these old memories, instead of discarding them, and store them in an additional compressed memory.
42
+
43
+ ![](images/0acd7690aaac7bffb9eb11c081c43adc68daad2cbdc94c5997f547d73d2d83e7.jpg)
44
+ Figure 1: The Compressive Transformer keeps a fine-grained memory of past activations, which are then compressed into coarser compressed memories. The above model has three layers, a sequence length ${ n _ { s } = 3 }$ , memory size ${ n _ { m } } = 6$ , compressed memory size $n _ { c m } = 6$ . The highlighted memories are compacted, with a compression function $f _ { c }$ per layer, to a single compressed memory — instead of being discarded at the next sequence. In this example, the rate of compression $c = 3$ .
45
+
46
+ # 3.1 DESCRIPTION
47
+
48
+ We define $n _ { m }$ and $n _ { c m }$ to be the number of respective memory and compressive memory slots in the model per layer. The overall input sequence $\mathcal { S } = x _ { 1 } , x _ { 2 } , \dotsc , x _ { | s | }$ represents input observations (e.g. tokens from a book). These are split into fixed-size windows of size $n _ { s }$ for the model to process in parallel. The model observes $\mathbf { x } = x _ { t } , \ldots , x _ { t + n _ { s } }$ at time $t$ , which we refer to as the sequence (e.g. in Figure 1). As the model moves to the next sequence, its $n _ { s }$ hidden activations are pushed into a fixed-sized FIFO memory (like the TransformerXL) of size $n _ { m }$ . The oldest $n _ { s }$ activations in memory are evicted, but unlike the TransformerXL we do not discard them. Instead we apply a compression operation, $f _ { c } : \mathbf { R } ^ { n _ { s } \times d } \mathbf { R } ^ { \lfloor \frac { n _ { s } } { c } \rfloor \times d }$ , mapping the $n _ { s }$ oldest memories to $\lfloor \frac { n _ { s } } { c } \rfloor$ compressed memories which we then store in a secondary FIFO compressed memory of size $n _ { c m }$ . $d$ denotes the hidden size of activations and $c$ refers to the compression rate, a higher value indicates more coarse-grained compressed memories. The overall temporal range of the model becomes $l \times \left( n _ { s } + n _ { m } + c * n _ { c m } \right)$ , where $l$ is the number of layers — as discussed in Supplementary Section A. The full architecture is described in Algorithm 1.
49
+
50
+ # Algorithm 1 Compressive Transformer
51
+
52
+ At time zero
53
+ 1: $\mathbf { m _ { 0 } } \gets \mathbf { 0 }$ // Initialize memory to zeros $( l \times n _ { m } \times d )$
54
+ 2: $\mathbf { c m _ { 0 } } \gets \mathbf { 0 }$ // Initialize compressed memory to zeros $( l \times n _ { c m } \times d )$
55
+ At time t
56
+ 3: $\mathbf { h } ^ { ( 1 ) } \mathbf { x W _ { e m b } }$ // Embed input sequence $( n _ { s } \times d )$
57
+ 4: for layer $i = 1 , 2 , \ldots , l$ do
58
+ 5: mem(i) ← concat(cm(i)t , m(i)t ) $I / \left( \left( n _ { c m } + n _ { m } \right) \times d \right)$
59
+ 6: $\tilde { \mathbf { a } } ^ { ( \mathbf { i } ) } \gets$ multihead attention(i)(h(i), mem(i)t ) // MHA over both mem types $( n _ { s } \times d )$
60
+ 7: a(i) ← layer norm(˜a(i) + h(i)) // Regular skip $^ +$ layernorm $( n _ { c m } \times d )$
61
+ 8: $\mathbf { o l d . m e m ^ { ( i ) } \gets m _ { t } ^ { ( i ) } } [ : n _ { s } ]$ // Oldest memories to be forgotten $( n _ { s } \times d )$
62
+ 9: new $\mathbf { c m } ^ { ( \mathbf { i } ) } \gets f _ { c } ^ { ( i ) } ( \mathbf { o l d . m e m ^ { ( \mathbf { i } ) } } )$ // Compress oldest memories by factor $c \left( \left\lfloor { \frac { n _ { s } } { c } } \right\rfloor \times d \right)$
63
+ 10: $\mathbf { m _ { t + 1 } ^ { ( i ) } } \gets \mathrm { c o n c a t } ( \mathbf { m _ { t } ^ { ( i ) } } , \mathbf { h ^ { ( i ) } } ) [ - n _ { m } \cdot ]$ // Update memory $( n _ { m } \times d )$
64
+ 11: $\mathbf { c m _ { t } ^ { ( i ) } } \gets \mathrm { c o n c a t } ( \mathbf { c m _ { t } ^ { ( i ) } } , \mathbf { n e w . c m ^ { ( i ) } } ) [ - n _ { c m } :$ :] // Update compressed memory $( n _ { c m } \times d )$
65
+ 12: $\mathbf { h } ^ { ( \mathbf { i } + 1 ) } \gets \mathrm { l a y e r . n o r m } ( \mathrm { m l p } ^ { ( i ) } ( \mathbf { a } ^ { ( \mathbf { i } ) } ) + \mathbf { a } ^ { ( \mathbf { i } ) } )$ // Mixing MLP $( n _ { s } \times d )$
66
+
67
+ # Algorithm 2 Attention-Reconstruction Loss
68
+
69
+ <table><tr><td colspan="3">1: Lattn ←0</td></tr><tr><td>2:</td><td>for layeri=1,2,...,l do</td><td></td></tr><tr><td>3:</td><td>h(i) ← stop-gradient(h(i))</td><td>// Stop compression grads from passing...</td></tr><tr><td>4:</td><td>old_mem(i)← stop-gradient(old_mem(i))</td><td>//..into transformer network.</td></tr><tr><td>5:</td><td>Q,K,V ← stop-gradient(attention params at layer i)// Re-use attention weight matrices.</td><td></td></tr><tr><td>6:</td><td>def attn(h,m) ← σ((hQ) (mK))(mV)</td><td>// Use content-based attention (no relative).</td></tr><tr><td>7:</td><td>new_cm(i) ← f(𝑖)(old_mem(i))</td><td>// Compression network (to be optimized).</td></tr><tr><td>8:</td><td>Lattn ← Lattn + |lttn(h(i),old-mem(i)) -attn(h(i),new_cm(i)|l2</td><td></td></tr></table>
70
+
71
+ # 3.2 COMPRESSION FUNCTIONS AND LOSSES
72
+
73
+ For choices of compression functions $f _ { c }$ we consider (1) max/mean pooling, where the kernel and stride is set to the compression rate $c$ ; (2) 1D convolution also with kernel & stride set to $c$ ; (3) dilated convolutions; (4) most-used where the memories are sorted by their average attention (usage) and the most-used are preserved. The pooling is used as a fast and simple baseline. The mostused compression scheme is inspired from the garbage collection mechanism in the Differentiable Neural Computer (Graves et al., 2016) where low-usage memories are erased. The convolutional compression functions contain parameters which require training.
74
+
75
+ One can train the compression network using gradients from the loss; however for very old memories this requires backpropagating-through-time (BPTT) over long unrolls. As such we also consider some local auxiliary compression losses. We consider an auto-encoding loss where we reconstruct the original memories from the compressed memories $\mathcal { L } ^ { a e } = | | \mathbf { o l d . m e m ^ { ( i ) } } - g ( \mathbf { n e w . c m ^ { ( i ) } } ) | | _ { 2 }$ , where $\overline { { g } } \ : \ \mathbb { R } ^ { \frac { n _ { s } } { c } \times d } \ \ \mathbb { R } ^ { n _ { s } \times d }$ is learned. This is a lossless compression objective — it attempts to retain all information in memory. We also consider an attention-reconstruction loss described in Algorithm 2 which reconstructs the content-based attention over memory, with content-based attention over the compressed memories. This is a lossy objective, as information that is no longer attended to can be discarded, and we found this worked best. We stop compression loss gradients from passing into the main network as this prevents learning. Instead the Transformer optimizes the task objective and the compression network optimizes the compression objective conditioned on task-relevant representations; there is no need to mix the losses with a tuning constant.
76
+
77
+ # 4 PG-19 BENCHMARK
78
+
79
+ As models begin to incorporate longer-range memories, it is important to train and benchmark them on data containing larger contexts. Natural language in the form of text provides us with a vast repository of data containing long-range dependencies, that is easily accessible. We propose a new language modelling benchmark, PG-19, using text from books extracted from Project Gutenberg 3. We select Project Gutenberg books which were published over 100 years old, i.e. before 1919 (hence the name PG-19) to avoid complications with international copyright, and remove short texts. The dataset contains 28, 752 books, or $1 1 G B$ of text — which makes it over double the size of BookCorpus and Billion Word Benchmark.
80
+
81
+ # 4.1 RELATED DATASETS
82
+
83
+ The two most benchmarked word-level language modelling datasets either stress the modelling of stand-alone sentences (Billion Word Benchmark from Chelba et al. (2013)) or the modelling of a small selection of short news articles (Penn Treebank processed by Mikolov et al. (2010)). Merity et al. (2016) proposed the WikiText-103 dataset, which contains text from a high quality subset of English-language wikipedia articles. These articles are on average 3, 600 words long. This dataset has been a popular recent LM benchmark due to the potential to exploit longer-range dependencies (Grave et al., 2016; Rae et al., 2018; Bai et al., 2018b). However recent Transformer models, such as the TransformerXL (Dai et al., 2019) appear to be able to exploit temporal dependencies on the order of several thousand words. This motivates a larger dataset with longer contexts.
84
+
85
+ Table 1: Comparison to existing popular language modelling benchmarks.
86
+
87
+ <table><tr><td></td><td>Avg. length (words)</td><td>Train Size</td><td>Vocab</td><td>Type</td></tr><tr><td>1B Word</td><td>27</td><td>4.15GB</td><td>793K</td><td>News (sentences)</td></tr><tr><td>Penn Treebank</td><td>355</td><td>5.1MB</td><td>10K</td><td>News (articles)</td></tr><tr><td>WikiText-103</td><td>3.6K</td><td>515MB</td><td>267K</td><td>Wikipedia (articles)</td></tr><tr><td>PG-19</td><td>69K</td><td>10.9GB</td><td>(open)</td><td>Books</td></tr></table>
88
+
89
+ Books are a natural choice of long-form text, and provide us with stylistically rich and varied natural language. Texts extracted from books have been used for prior NLP benchmarks; such as the Children’s Book Test (Hill et al., 2015) and LAMBADA (Paperno et al., 2016). These benchmarks use text from Project Gutenberg, an online repository of books with expired US copyright, and BookCorpus (Zhu et al., 2015), a prior dataset of $1 1 K$ unpublished (at time of authorship) books. CBT and LAMBADA contain extracts from books, with a specific task of predicting held-out words. In the case of LAMBADA the held-out word is specifically designed to be predictable for humans with access to the full textual context — but difficult to guess with only a local context.
90
+
91
+ CBT and LAMBADA are useful for probing the linguistic intelligence of models, but are not ideal for training long-range language models from scratch as they truncate text extracts to at most a couple of paragraphs, and discard a lot of the books’ text. There has been prior work on training models on book data using BookCorpus directly (e.g. BERT from Devlin et al. (2018)) however BookCorpus is no longer distributed due to licensing issues, and the source of data is dynamically changing — which makes exact benchmarking difficult over time.
92
+
93
+ The NarrativeQA Book Comprehension Task (Kocisk ˇ y et al., 2018) uses Project Gutenberg texts \` paired with Wikipedia articles, which can be used as summaries. Due to the requirement of needing a corresponding summary, NarrativeQA contains a smaller selection of books: 1,527 versus the 28,752 books in PG-19. However it is reasonable that PG-19 may be useful for pre-training book summarisation models.
94
+
95
+ # 4.2 STATISTICS
96
+
97
+ A brief comparison of PG-19 to other LM datasets can be found in Table 1. We intentionally do not limit the vocabulary by unk-ing rare words, and release the dataset as an open-vocabulary benchmark. To compare models we propose to continue measuring the word-level perplexity. This can still be computed for any chosen character-based, byte-based or subword-based scheme. To do this, one calculates the total cross-entropy loss $\begin{array} { r } { L = - \dot { \sum } _ { t } \log ( p _ { t } | p _ { < t } ) } \end{array}$ over the given validation or test subset using a chosen tokenization scheme, and then one normalizes this value by the number of words: $L / n _ { w o r d s }$ where $n _ { w o r d s }$ is the total number of words in the given subset, taken from Table 2. The word-level perplexity is thus $e ^ { L / n _ { w o r d s } }$ . For sake of model comparisons, it is important to use the exact number of words computed in Table 2 as the normalisation constant.
98
+
99
+ Alongside quantitative analyses, we build an LDA topic model (Blei et al., 2003) for a qualitative inspection of the text. We present key words for several topics in the Supplementary Table 10. These topics include art, education, naval exploration, geographical description, war, ancient civilisations, and more poetic topics concerning the human condition — love, society, religion, virtue etc. This contrasts to the more objective domains of Wikipedia and news corpora.
100
+
101
+ # 5 EXPERIMENTS
102
+
103
+ We optimised all models with Adam (Kingma and Ba, 2014). We used a learning rate schedule with a linear warmup from 1e-6 to 3e-4 and a cosine decay back down to 1e- $\mathbf { \nabla \cdot } n \mathbf { 6 }$ . For characterbased LM we used 4, 000 warmup steps with 100, 000 decay steps, and for word-based LM we used 16, 000 warmup steps with 500, 000 decay steps. We found that decreasing the optimisation update frequency helped (see Section 5.5.1), namely we only applied parameter updates every 4 steps after $6 0 , 0 0 0$ iterations. However we found the models would optimise well for a range of warmup/warmdown values. We clipped the gradients to have a norm of at most 0.1, which was crucial to successful optimisation.
104
+
105
+ Table 2: PG-19 statistics split by subsets.
106
+
107
+ <table><tr><td></td><td>Train</td><td>Valid.</td><td>Test</td></tr><tr><td>#books</td><td>28.602</td><td>50</td><td>100</td></tr><tr><td># words</td><td>1,973,136,207</td><td>3,007,061</td><td>6,966,499</td></tr></table>
108
+
109
+ Table 3: Eval. perplexities on PG-19.
110
+
111
+ <table><tr><td></td><td>Valid.</td><td>Test</td></tr><tr><td>36L TransformerXL</td><td>45.5</td><td>36.3</td></tr><tr><td>36L Compressive Transf.</td><td>43.4</td><td>33.6</td></tr></table>
112
+
113
+ Table 4: State-of-the-art results on Enwik8.
114
+
115
+ <table><tr><td>Model 7L LSTM(Graves,2013)</td><td>BPC 1.67</td></tr><tr><td>LN HyperNetworks Ha et al. (2016) LN HM-LSTM Chung et al. (2016) ByteNet (Kalchbrenner et al.,2016) RHN Zilly et al. (2017) mLSTM Krause et al. (2016) 64L Transf. Al-Rfou et al. (2019) 24L TXL (Dai et al.,2019) Sparse Transf.(Child et al.,2019) Adaptive Transf. (Sukhbaatar et al.,2019)</td><td>1.34 1.32 1.31 1.27 1.24 1.06 0.99 0.991 0.98</td></tr><tr><td>24L TXL (ours) 24L Compressive Transformer</td><td>0.98 0.97</td></tr></table>
116
+
117
+ Table 5: Compression approaches on Enwik8.
118
+
119
+ <table><tr><td>Compression fn</td><td>Compression loss</td><td>BPC</td></tr><tr><td>Conv</td><td>BPTT</td><td>0.996</td></tr><tr><td>Max Pooling</td><td>N/A</td><td>0.986</td></tr><tr><td>Conv</td><td>Auto-encoding</td><td>0.984</td></tr><tr><td>Mean Pooling</td><td>N/A</td><td>0.982</td></tr><tr><td>Most-used</td><td>N/A</td><td>0.980</td></tr><tr><td>Dilated conv</td><td>Attention</td><td>0.977</td></tr><tr><td>Conv</td><td>Attention</td><td>0.973</td></tr></table>
120
+
121
+ # 5.1 PG-19
122
+
123
+ We benchmark the Compressive Transformer against the TransformerXL on the newly proposed PG19 books dataset. Because it is open-vocabulary, we train a subword vocabulary of size 32000 with SubwordTextEncoder from the tfds package in TensorFlow and use the dataset statistics to compute word-level perplexity, as described in Section 4.2. We train a 36 layer Compressive Transformer with a window size of 512, both memory and compressed memory size of 512, and compression rate $C =$ 2. We compare this to a 36 layer TransformerXL trained with window size 512 and attention window 1024. The model was trained on 256 TPUv3 cores with a total batch size of 512 and converged after processing around 100 billion subword tokens. We display the results in Table 3 where we see the Compressive Transformer obtains a test perplexity of 33.6 versus the TransformerXL’s 36.3. Despite the dataset size, it is clearly a challenging domain. This can suit as a first baseline on the proposed long-range language modelling benchmark. We show samples from this model in Supplementary Section F. The model is able to generate long-form narrative of varying styles: from character dialogue, first person diary entries, to descriptive third-person text.
124
+
125
+ # 5.2 ENWIK8
126
+
127
+ We compare the TransformerXL and the Compressive Transformer on the standard character-level language modelling benchmark Enwiki8 taken from the Hutter Prize (Hutter, 2012), which contains 100M bytes of unprocessed Wikipedia text. We select the first 90MB for training, 5MB for validation, and the latter 5MB for testing — as per convention. We train 24-layer models with a sequence window size of 768. During training, we set the TransformerXL’s memory size to 2304, and for the Compressive Transformer we use memory of size 768 and compressed memory of size 1152 with compression rate $C = 3$ . During evaluation, we increased the TransformerXL memory size to 4096 and the compressed memory in our model to 3072 (after sweeping over the validation set), obtaining the numbers reported in Table 4. We show the effect of scaling the compressed memory size and evaluation performance in Supplementary Section C. The proposed model achieves the new state-of-the-art on this dataset with 0.97 bits-per-character.
128
+
129
+ We compare compression functions and the use of auxiliary losses in Table 5. We sweep over compression rates of 2, 3, and 4 and report results with the best performing value for each row. BPTT signifies that no auxiliary compression loss was used to train the network other than the overall training loss. To feed gradients into the compression function we unrolled the model over double the sequence length and halved the batch size to fit the larger unroll into memory.
130
+
131
+ Table 6: Validation and test perplexities on WikiText-103.
132
+
133
+ <table><tr><td></td><td>Valid.</td><td>Test</td></tr><tr><td>LSTM (Graves et al., 2014)</td><td></td><td>48.7</td></tr><tr><td>Temporal CNN (Bai et al.,2018a)</td><td>=</td><td>45.2</td></tr><tr><td>GCNN-14 (Dauphin et al.,2016)</td><td>=</td><td>37.2</td></tr><tr><td>Quasi-RNN Bradbury et al. (2016)</td><td>32</td><td>33</td></tr><tr><td>RMC (Santoro et al., 2018)</td><td>30.8</td><td>31.9</td></tr><tr><td>LSTM+Hebb. (Rae et al., 2018)</td><td>29.0</td><td>29.2</td></tr><tr><td>Transformer (Baevski and Auli,2019)</td><td>-</td><td>18.7</td></tr><tr><td>18L TransformerXL,M=384 (Dai et al.,2019)</td><td>-</td><td>18.3</td></tr><tr><td>18L TransformerXL,M=1024(ours)</td><td>=</td><td>18.1</td></tr><tr><td>18L Compressive Transformer,M=1024</td><td>16.0</td><td>17.1</td></tr></table>
134
+
135
+ # 5.3 WIKITEXT-103
136
+
137
+ We train an eighteen-layered Compressive Transformer on the closed-vocabulary word-level language modelling benchmark WikiText-103, which contains articles from Wikipedia. We train the model with a compressed memory size, memory size, and a sequence window size all equal to 512. We trained the model over 64 Tensor Processing Units (TPU) v3 with a batch size of 2 per core — making for a total batch size of 128. The model converged in a little over 12 hours. We found the single-layer convolution worked best, with a compression rate of $c = 4$ . This model obtained 17.6 perplexity on the test set. By tuning the memory size over the validation set — setting the memory size to 500, and compressed memory size to 1, 500 — we obtain 17.1 perplexity. This is 1.2 perplexity points over prior state of the art, and means the model places a $\approx 5 \%$ higher probability on the correct word over the prior SotA TransformerXL.
138
+
139
+ It is worth noting that in Table 6 we do not list methods that use additional training data, or that make use of test-time labels to continue training the model on the test set (known as dynamic evaluation (Graves, 2013)). If we incorporate a very naive dynamic evaluation approach of loading a model checkpoint and continuing training over one epoch of the test set, then we obtain a test perplexity of 16.1. This is slightly better than the published 16.4 from Krause et al. (2019) — which uses a more sophisticated dynamic evaluation approach on top of the TransformerXL. However in most settings, one does not have access to test-time labels — and thus we do not focus on this setting. Furthermore there has been great progress in showing that more data equates to much better language modelling; Shoeybi et al. (2019) find a large transformer 8B-parameter transformer trained on 170GB of text obtains 10.7 word-level perplexity on WikiText-103. However it is not clear to what extent the WikiText-103 test set may be leaked inside these larger training corpora. For clarity of model comparisons, we compare to published results trained on the WikiText-103 training set.
140
+
141
+ We break perplexity down by word frequency in Table 7 and see the Compressive Transformer makes only a small modelling improvement for frequent words $( 2 . 6 \%$ over the TransformerXL baseline) but obtains a much larger improvement of $\approx 2 0 \%$ for infrequent words. Furthermore, we see $\mathbf { 1 0 X }$ improvement in modelling rare words over the prior state-of-the-art LSTM language model published in 2018 — which demonstrates the rate of progress in this area.
142
+
143
+ # 5.4 COMPRESSIBILITY OF LAYERS
144
+
145
+ We can use compression to better understand the model’s mode of operation. We inspect how compressible Transformer’s activations are as they progress through higher layers in the network. One may expect representations to become more difficult to compress at higher layers, if more semantic information is represented there. We monitor the compression loss at each layer of our best-performing Compressive Transformer models trained on Enwik8 and WikiText-103 and display these in Supplementary Section B Figure 6. We note that the compression loss is about one order of magnitude higher for word-level language modelling (WikiText-103) over character-level langauge modelling (Enwik8). Furthermore the first layer of the Transformer is highly compressible. However there is not a clear trend of compression cost increasing with layer depth.
146
+
147
+ Table 7: WikiText-103 test perplexity broken down by word frequency buckets. The most frequent bucket is words which appear in the training set more than 10, 000 times, displayed on the left. For reference, a uniform model would have perplexity $| V | = 2 . 6 e 5$ for all frequency buckets. \*LSTM comparison from Rae et al. (2018)
148
+
149
+ <table><tr><td></td><td>&gt;10K</td><td>1K-10K</td><td>100-1K</td><td>&lt;100</td><td>All</td></tr><tr><td>LSTM*</td><td>12.1</td><td>219</td><td>1,197</td><td>9,725</td><td>36.4</td></tr><tr><td>TransformerXL(ours)</td><td>7.8</td><td>61.2</td><td>188</td><td>1,123</td><td>18.1</td></tr><tr><td>Compressive Transformer</td><td>7.6</td><td>55.9</td><td>158</td><td>937</td><td>17.1</td></tr><tr><td>Relative gain over TXL</td><td>2.6%</td><td>9.5%</td><td>21%</td><td>19.9%</td><td>5.8%</td></tr></table>
150
+
151
+ ![](images/91df5905b3cf9156b5c7b63213402e2aaf75a6c641a804dccf9a8f9fec4a3a8d.jpg)
152
+ Figure 2: Attention weight on Enwik8. Average attention weight from the sequence over the compressed memory (oldest), memory, and sequence (newest) respectively. The sequence self-attention is causally masked, so more attention is placed on earlier elements in the sequence. There is an increase in attention at the transition from memory to compressed memory.
153
+
154
+ ![](images/0c169d95a9819eba8789424d7e7a0246e84e7fc6301d76f70dcb4d65a634b4eb.jpg)
155
+ Figure 3: Learning rate analysis. Reducing the learning rate (e.g. to zero) during training (on Enwik8) harms training performance. Reducing the frequency of optimisation updates (effectively increasing the batch size) is preferable.
156
+
157
+ # 5.5 ATTENTION
158
+
159
+ We inspect where the network is attending to on average, to determine whether it is using its compressed memory. We average the attention weight over a sample of 20, 000 sequences from a trained model on Enwik8. We aggregate the attention into eighteen buckets, six for each of the compressed memory, memory, and sequence respectively. We set the size of the sequence, memory and compressed memory all to be 768. We plot this average attention weight per bucket in Figure 2 with a $1 \sigma$ standard error. We see most of the attention is placed on the current sequence; with a greater weight placed on earlier elements of the sequence due to the causal self-attention mechanism which masks future attention weights. We also observe there is an increase in attention from the oldest activations stored in the regular memory, to the activations stored in the compressed memory. This goes against the trend of older memories being accessed less frequently — and gives evidence that the network is learning to preserve salient information.
160
+
161
+ # 5.5.1 OPTIMISATION SCHEDULE
162
+
163
+ We make an observation about an interesting but undesirable meta-learning phenomenon during long-context training. When the learning rate is tuned to be much smaller (or set to zero) during training, performance degrades drastically both for the TransformerXL and the Compressive Transformer. This is displayed in Figure 3.
164
+
165
+ Usually we consider distributional shift from the training data to the test data, but we can also observe a shift in the model when transferring from a training to evaluation mode (even when the model is evaluated on the training data). In this case, this is due to the online updating of parameters whilst processing long contiguous articles. We would like the model to generalise well to scenarios where it is not continuously optimised. Updating the parameters only at article boundaries (and then resetting the state) could be one solution for long-range memory models, but this would slow down learning significantly.
166
+
167
+ Instead, we propose reducing the frequency of optimisation updates during training. We find this allows for the best of both worlds — fast initial learning with frequent updates, and better generalisation near the end of training with less frequent updates (e.g. every 4 steps). Reducing the optimisation frequency increases the effective batch size, which has also been shown to be preferable to learning rate decay in image modelling (Smith et al., 2018). We observed a final performance improvement in our TransformerXL baseline on Enwik8, from 0.995 — which approximately replicates the published result — to 0.984 — which matches the most recent SotA architecture. We note, the additional space and compute cost of accumulating gradients is negligible across iterations, so there was no performance regression in using this scheme.
168
+
169
+ # 5.6 SPEECH
170
+
171
+ We train the Compressive Transformer on the waveform of speech to assess its performance on different modalities. Speech is interesting because it is sampled at an incredibly high frequency, but we know it contains a lot of information on the level of phonemes and entire phrases.
172
+
173
+ To encourage long-term reasoning, we refrain from conditioning the model on speaker identity or text features, but focus on unconditional speech modelling. We train the model on 24.6 hours of 24kHz North American speech data. We chunk the sequences into windows of size 3840, roughly 80ms of audio, and compare a 20-layer Compressive Transformer to a 20-layer TransformerXL and a 30-layer WaveNet model (Oord et al., 2016) — a state-of-the-art audio generative model used to serve production speech synthesis applications at Google (Oord et al., 2018). All networks have approximately 40M parameters, as WaveNet is more parameter-efficient per layer. We train each network with 32 V100 GPUs, and a batch size of 1 per core (total batch size of 32) using synchronous training.
174
+
175
+ WaveNet processes an entire chunk in parallel, however the TransformerXL and Compressive Transformer are trained with a window size of 768 and a total memory size of 1, 568 (for the Compressive Transformer we use 768 memory $+ 7 6 8$ compressed). We thus unroll the model over the sequence. Despite this sequential unroll, the attention-based models train at only half the speed of WaveNet. We see the test-set negative-log-likelihood in Figure 4, and observe that a Compressive Transformer with a compression rate of 4 is able to outperform the TransformerXL and maintain a slim advantage over WaveNet. However we only trained models for at most one week (with 32GPUs) and it would be advantageous to continue training until full convergence — before definitive conclusions are made.
176
+
177
+ # 5.7 REINFORCEMENT LEARNING
178
+
179
+ Compression is a good fit for video input sequences because subsequent frames have high mutual information. Here we do not test out the Compressive Transformer on video, but progress straight to a reinforcement learning agent task that receives a video stream of visual observations — but must ultimately learn to use its memory to reason over a policy.
180
+
181
+ We test the Compressive Transformer as a drop-in replacement to an LSTM in the IMPALA setup (Espeholt et al., 2018). Otherwise, we use the same training framework and agent architecture as described in the original work with a fixed learning rate of 1.5e-5 and entropy cost coefficient of 2e-3. We test the Compressive Transformer on a challenging memory task within the DMLab-30 (Beattie et al., 2016) domain, rooms select nonmatching object. This requires the agent to explore a room in a visually rich 3D environment and remember the object present. The agent can then advance to a second room where it must select the object not present in the original room. This necessitates that the agent both remember events far in the past, and also learn to efficiently reason about them.
182
+
183
+ We fix both the memory and compressed memory sizes to 64. In Figure 5, we present results for a range of compression rates, averaged over 3 seeds. We see that the best performing agents endowed with the Compressive Transformer are able to solve the task to human-level. We note that the model with compression rate 1 is unable to learn the task to the same proficiency. The speed of learning and stability seem to increase proportionally with higher rates of compression (up to a limit) – i.e.
184
+
185
+ ![](images/42afd920bfbb3132ee3f0bccc130234e666d527c199fd0bd2f67885c2d8766e7.jpg)
186
+ Figure 4: Speech Modelling. We see the Compressive Transformer is able to obtain competitive results against the state-of-the-art WaveNet in the modelling of raw speech sampled at $2 4 \mathrm { k H z }$ .
187
+
188
+ ![](images/73b459f5476814831f88dbae381c01075c186cec825da44f6a778c19c5f94da1.jpg)
189
+ Figure 5: Vision and RL. We see the Compressive Transformer integrates visual information across time within an IMPALA RL agent, trained on an object matching task.
190
+
191
+ the effective memory window of the agent – and we find compression rate 4 to once again be the best performing. We see this as a promising sign that the architecture is able to efficiently learn, and suitably use, compressed representations of its visual input and hope to test this more widely in future work.
192
+
193
+ # 6 CONCLUSION
194
+
195
+ In this paper we explore the notion of compression as a means of extending the temporal receptive field of Transformer-based sequence models. We see a benefit to this approach in the domain of text, with the Compressive Transformer outperforming existing architectures at long-range language modelling. To continue innovation in this area, we also propose a new book-level LM benchmark, PG-19. This may be used to compare long-range language models, or to pre-train on other longrange reasoning language tasks, such as NarrativeQA (Kocisk ˇ y et al., 2018). \`
196
+
197
+ We see the idea of compressive memories is applicable not only to the modality of text, but also audio, in the form of modelling the waveform of speech, and vision, within a reinforcement-learning agent trained on a maze-like memory task. In both cases, we compare to very strong baselines (Wavenet (Oord et al., 2016) and IMPALA (Espeholt et al., 2018)).
198
+
199
+ The main limitation of this work is additional complexity, if the task one wishes to solve does not contain long-range reasoning then the Compressive Transformer is unlikely to provide additional benefit. However as a means of scaling memory and attention, we do think compression is a simpler approach to dynamic or sparse attention — which often requires custom kernels to make efficient. One can build effective compression modules from simple neural network components, such as convolutions. The compression components are immediately efficient to run on GPUs and TPUs.
200
+
201
+ Memory systems for neural networks began as compressed state representations within RNNs. The recent wave of progress using attention-based models with deep and granular memories shows us that it is beneficial to refrain from immediately compressing the past. However we hypothesise that more powerful models will contain a mixture of granular recent memories and coarser compressed memories. Future directions could include the investigation of adaptive compression rates by layer, the use of long-range shallow memory layers together with deep short-range memory, and even the use of RNNs as compressors. Compressive memories should not be forgotten about just yet.
202
+
203
+ # ACKNOWLEDGEMENTS
204
+
205
+ We thank Chris Dyer, Felix Gimeno, and Koray Kavukcuoglu for reviewing the manuscript. We thank Peter Dayan, Adam Santoro, Jacob Menick, Emilio Parisotto, Hyunjik Kim, Simon Osindero, Sergey Bartunov, David Raposo, and Daan Wierstra for ideas regarding model design. We thank Yazhe Li and Aaron Van de Oord for their help and advice in instrumenting speech modelling experiments. Finally, we thank our wider DeepMind colleagues for supporting this project with stimulating discussions, engineering infrastructure, and positive reinforcement signals.
206
+
207
+ REFERENCES
208
+ R. Al-Rfou, D. Choe, N. Constant, M. Guo, and L. Jones. Character-level language modeling with deeper self-attention. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 3159–3166, 2019.
209
+ A. Baevski and M. Auli. Adaptive input representations for neural language modeling. arXiv preprint arXiv:1809.10853, 2019.
210
+ D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
211
+ S. Bai, J. Z. Kolter, and V. Koltun. Convolutional sequence modeling revisited, 2018a. URL https://openreview.net/forum?id $_ { \cdot } =$ rk8wKk-R-.
212
+ S. Bai, J. Z. Kolter, and V. Koltun. Trellis networks for sequence modeling. arXiv preprint arXiv:1810.06682, 2018b.
213
+ C. Beattie, J. Z. Leibo, D. Teplyashin, T. Ward, M. Wainwright, H. Kuttler, A. Lefrancq, S. Green, ¨ V. Valdes, A. Sadik, J. Schrittwieser, K. Anderson, S. York, M. Cant, A. Cain, A. Bolton, S. Gaffney, ´ H. King, D. Hassabis, S. Legg, and S. Petersen. Deepmind lab. CoRR, abs/1612.03801, 2016. URL http://arxiv.org/abs/1612.03801.
214
+ D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent dirichlet allocation. J. Mach. Learn. Res., 3:993–1022, Mar. 2003. ISSN 1532-4435.
215
+ J. Bradbury, S. Merity, C. Xiong, and R. Socher. Quasi-recurrent neural networks. arXiv preprint arXiv:1611.01576, 2016.
216
+ C. Chelba, T. Mikolov, M. Schuster, Q. Ge, T. Brants, P. Koehn, and T. Robinson. One billion word benchmark for measuring progress in statistical language modeling. arXiv preprint arXiv:1312.3005, 2013.
217
+ R. Child, S. Gray, A. Radford, and I. Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
218
+ J. Chung, S. Ahn, and Y. Bengio. Hierarchical multiscale recurrent neural networks. arXiv preprint arXiv:1609.01704, 2016.
219
+ Z. Dai, Z. Yang, Y. Yang, W. W. Cohen, J. Carbonell, Q. V. Le, and R. Salakhutdinov. Transformerxl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
220
+ Y. N. Dauphin, A. Fan, M. Auli, and D. Grangier. Language modeling with gated convolutional networks. arXiv preprint arXiv:1612.08083, 2016.
221
+ J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
222
+ L. Espeholt, H. Soyer, R. Munos, K. Simonyan, V. Mnih, T. Ward, Y. Doron, V. Firoiu, T. Harley, I. Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. In International Conference on Machine Learning, pages 1406–1415, 2018.
223
+ E. Grave, A. Joulin, and N. Usunier. Improving neural language models with a continuous cache. arXiv preprint arXiv:1612.04426, 2016.
224
+ A. Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
225
+ A. Graves, G. Wayne, and I. Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
226
+ A. Graves, G. Wayne, M. Reynolds, T. Harley, I. Danihelka, A. Grabska-Barwinska, S. G. Col-´ menarejo, E. Grefenstette, T. Ramalho, J. Agapiou, et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471, 2016.
227
+ D. Ha, A. Dai, and Q. V. Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
228
+ F. Hill, A. Bordes, S. Chopra, and J. Weston. The goldilocks principle: Reading children’s books with explicit memory representations. arXiv preprint arXiv:1511.02301, 2015. S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997.
229
+ A. Holtzman, J. Buys, M. Forbes, and Y. Choi. The curious case of neural text degeneration. arXiv preprint arXiv:1904.09751, 2019.
230
+ M. Hutter. The human knowledge compression contest. URL http://prize. hutter1. net, 6, 2012. N. Kalchbrenner, L. Espeholt, K. Simonyan, A. v. d. Oord, A. Graves, and K. Kavukcuoglu. Neural machine translation in linear time. arXiv preprint arXiv:1610.10099, 2016.
231
+ D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
232
+ T. Kocisk ˇ y, J. Schwarz, P. Blunsom, C. Dyer, K. M. Hermann, G. Melis, and E. Grefenstette. The \` narrativeqa reading comprehension challenge. Transactions of the Association for Computational Linguistics, 6:317–328, 2018.
233
+ B. Krause, L. Lu, I. Murray, and S. Renals. Multiplicative lstm for sequence modelling. arXiv preprint arXiv:1609.07959, 2016.
234
+ B. Krause, E. Kahembwe, I. Murray, and S. Renals. Dynamic evaluation of transformer language models. CoRR, abs/1904.08378, 2019. URL http://arxiv.org/abs/1904.08378. G. Lample, A. Sablayrolles, M. Ranzato, L. Denoyer, and H. Jegou. Large memory layers with ´ product keys. arXiv preprint arXiv:1907.05242, 2019.
235
+ S. Merity, C. Xiong, J. Bradbury, and R. Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
236
+ T. Mikolov, M. Karafiat, L. Burget, J. ´ Cernock ˇ y, and S. Khudanpur. Recurrent neural network \` based language model. In Eleventh Annual Conference of the International Speech Communication Association, 2010.
237
+ A. Oord, Y. Li, I. Babuschkin, K. Simonyan, O. Vinyals, K. Kavukcuoglu, G. Driessche, E. Lockhart, L. Cobo, F. Stimberg, et al. Parallel wavenet: Fast high-fidelity speech synthesis. In International Conference on Machine Learning, pages 3915–3923, 2018.
238
+ A. v. d. Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
239
+ D. Paperno, G. Kruszewski, A. Lazaridou, Q. Pham, R. Bernardi, S. Pezzelle, M. Baroni, G. Boleda, R. Fernandez, K. Erk, et al. The lambada dataset: Word prediction requiring a broad discourse ´ context. Association for Computational Linguistics, 2016.
240
+ J. Rae, J. J. Hunt, I. Danihelka, T. Harley, A. W. Senior, G. Wayne, A. Graves, and T. Lillicrap. Scaling memory-augmented neural networks with sparse reads and writes. In Advances in Neural Information Processing Systems, pages 3621–3629, 2016.
241
+ J. W. Rae, C. Dyer, P. Dayan, and T. P. Lillicrap. Fast parametric learning with activation memorization. arXiv preprint arXiv:1803.10049, 2018.
242
+ B. A. Richards and P. W. Frankland. The persistence and transience of memory. Neuron, 94(6): 1071–1084, 2017.
243
+ D. E. Rumelhart, G. E. Hinton, and R. J. Williams. Learning representations by back-propagating errors. Nature, 323(6088):533, 1986.
244
+ A. Santoro, R. Faulkner, D. Raposo, J. Rae, M. Chrzanowski, T. Weber, D. Wierstra, O. Vinyals, R. Pascanu, and T. Lillicrap. Relational recurrent neural networks. In Advances in Neural Information Processing Systems, pages 7299–7310, 2018.
245
+ M. Shoeybi, M. Patwary, R. Puri, P. LeGresley, J. Casper, and B. Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism, 2019.
246
+ S. Smith, P. jan Kindermans, C. Ying, and Q. V. Le. Don’t decay the learning rate, increase the batch size. 2018. URL https://openreview.net/pdf?id ${ . } = { }$ B1Yy1BxCZ. S. Sukhbaatar, E. Grave, P. Bojanowski, and A. Joulin. Adaptive attention span in transformers. arXiv preprint arXiv:1905.07799, 2019.
247
+ A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998–6008, 2017.
248
+ F. Wu, A. Fan, A. Baevski, Y. N. Dauphin, and M. Auli. Pay less attention with lightweight and dynamic convolutions. arXiv preprint arXiv:1901.10430, 2019.
249
+ Z. Yang, Z. Dai, Y. Yang, J. Carbonell, R. Salakhutdinov, and Q. V. Le. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237, 2019.
250
+ L. Zhou, Y. Zhou, J. J. Corso, R. Socher, and C. Xiong. End-to-end dense video captioning with masked transformer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8739–8748, 2018.
251
+ Y. Zhu, R. Kiros, R. Zemel, R. Salakhutdinov, R. Urtasun, A. Torralba, and S. Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision, pages 19–27, 2015. J. G. Zilly, R. K. Srivastava, J. Koutn´ık, and J. Schmidhuber. Recurrent highway networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 4189– 4198. JMLR. org, 2017.
252
+
253
+ # A TEMPORAL RANGE OF THE COMPRESSIVE TRANSFORMER
254
+
255
+ The TransformerXL with a memory of size $n$ has a maximum temporal range of $l \times n$ with an attention cost of $\mathcal { O } ( n _ { s } ^ { 2 } + n _ { s } n )$ (see Dai et al. (2019) for a detailed discussion). The Compressive Transformer now has a maximum temporal range of $l \times \left( n _ { s } + n _ { m } + c * n _ { c m } \right)$ with an attention cost of $\mathcal { O } ( n _ { s } ^ { 2 } + n _ { s } ( n _ { m } + n _ { c m } ) )$ . For example, setting $n _ { c m } = n _ { m } = n / 2$ and $c = 3$ we obtain a maximum temporal range that is two times greater than the TransformerXL with an identical attention cost. Thus if we can learn in the $c > 1$ compressed setting, the temporal range of the model can be significantly increased.
256
+
257
+ # B COMPRESSION ACROSS LAYERS
258
+
259
+ We inspect the compression loss broken down by the layer index, to investigate whether there is a trend in network depth with how compressible the representations are. The compression loss here refers to the attention-reconstruction attention loss. We plot this for a 24 layer trained model on Enwik8, and an 18 layer model trained on WikiText-103. The compression loss for characterbased language modelling is about one order of magnitude lower than that of word-level language modelling. The first layer’s representations are highly compressible, however from then on there is no fixed trend. Some non-contiguous layers have a very similar compression loss (e.g. 4 & 6, 5 & 7) which suggests information is being routed from these layer pairs via the skip connection.
260
+
261
+ ![](images/ac86293c4cd4f466d587bbab8a7c5a4cb730e28f0ff5a8d8b0ff0bd03f5b3baf.jpg)
262
+ Figure 6: Model analysis. Compression loss broken down by layer.
263
+
264
+ # C COMPARISON OF COMPRESSED MEMORY SIZES
265
+
266
+ We compare the best test perplexity obtained for the Compressive Transformer trained on WikiText103 and Enwik8 across a range of compressed memory sizes. For both models, the best model used a 1D convolution compression network with a compression rate of 3. The Enwik8 model was trained with an embedding size of 1024, 8 attention heads, 24 layers, an mlp hidden size of 3072, a sequence window size of 768, and a memory size of 768. We see the best compressed memory size is 3, 072 in this sweep, facilitating a total attention window of 3840. The WikiText-103 model was trained with an embedding size of 1024, adaptive inputs using the same parameters as (Sukhbaatar et al., 2019), 16 attention heads, 18 layers, an mlp hidden size of 4096, a sequence window of size 512 and a memory of size 512. The best compressed memory size is 1536 resulting in a total attention window of c. 2048.
267
+
268
+ <table><tr><td>Compressed Memory Size Enwik8 BPC</td><td>512 1.01</td><td>1024 0.99</td><td>2048 0.98</td><td>3072 0.97</td><td>4096 1.00</td></tr></table>
269
+
270
+ Table 8: Compressed memory size vs test performance for Enwik8
271
+
272
+ Table 9: Compressed memory size vs test performance for WikiText-103
273
+
274
+ <table><tr><td>Compressed Memory Size</td><td>256</td><td>512</td><td>1024</td><td>1536</td><td>2048</td></tr><tr><td>WikiText-103 Perplexity</td><td>18.2</td><td>17.9</td><td>17.6</td><td>17.1</td><td>17.7</td></tr></table>
275
+
276
+ # D PG-19 PREPROCESSING
277
+
278
+ The raw texts from the Gutenberg project were minimally pre-processed by removing boilerplate license text. We then also replaced discriminatory words with a unique $\langle \mathrm { D W x } \rangle$ token using the Ofcom list of discriminatory words 4.
279
+
280
+ # E PG-19 TOPICS
281
+
282
+ We present top-words for some of the topics on the PG-19 corpus. These were generated with LDA topic model (Blei et al., 2003).
283
+
284
+ Table 10: Examples of top topics on PG-19 corpus.
285
+
286
+ <table><tr><td>Geography</td><td>War</td><td>Civilisations</td><td>Human Condition</td><td>Naval</td><td>Education</td><td>Art</td></tr><tr><td>water</td><td>people</td><td>roman</td><td>love</td><td>island</td><td>work</td><td>poet</td></tr><tr><td>river</td><td>emperor</td><td>rome</td><td>religion</td><td>ship</td><td>school</td><td>music</td></tr><tr><td>feet</td><td>war</td><td>greek</td><td>religious</td><td>sea</td><td>life</td><td>one</td></tr><tr><td>miles</td><td> army</td><td>city</td><td>life</td><td>men</td><td>children</td><td>poetry</td></tr><tr><td>north</td><td>death</td><td>gods</td><td>moral</td><td>captain</td><td>may</td><td>work</td></tr><tr><td>south</td><td>battle</td><td>king</td><td>human</td><td>coast</td><td>social</td><td>literature</td></tr><tr><td>mountains</td><td>city</td><td>first</td><td>society</td><td>land</td><td>child</td><td>art</td></tr><tr><td>sea</td><td>soldiers</td><td>caesar</td><td>man</td><td>great</td><td>education</td><td>great</td></tr><tr><td>lake</td><td>power</td><td>great</td><td>virtue</td><td>found</td><td>conditions</td><td>poem</td></tr><tr><td>rock</td><td>thousand</td><td>romans</td><td> nature</td><td>islands</td><td>well</td><td>written</td></tr><tr><td>mountain</td><td>arms</td><td>athens</td><td>marriage</td><td>shore</td><td> study</td><td>english</td></tr><tr><td>country</td><td>empire</td><td>greece</td><td>women</td><td>voyage</td><td>best</td><td>author</td></tr><tr><td>valley</td><td>upon</td><td>temple</td><td>christian</td><td>vessels</td><td>years</td><td>play</td></tr><tr><td>ice</td><td>country</td><td>son</td><td>age</td><td>time</td><td>possible</td><td>genius</td></tr><tr><td>west</td><td>time</td><td>egypt</td><td>law</td><td>english</td><td>class</td><td>style</td></tr></table>
287
+
288
+ # F PG-19 SAMPLES
289
+
290
+ We show a few different samples from the Compressive Transformer trained on PG-19. We use Nucleus Sampling with $p = 0 . 9 8$ (Holtzman et al., 2019). We choose extracts of books from the test set as prefixes. We see the model is able to continue in the style of the text, creating artificial dialogue or descriptive text, and remembering the names of characters over hundreds of words.
291
+
292
+ As the Compressive Transformer is trained without state resetting, it is actually slightly out of sample when provided with the (relatively) short contexts. This is because its memory and compressed memory may be still empty (whereas they are always full during training). However we see a trend of the samples usually improving towards the end.
293
+
294
+ # Context from Baby Mine by Maragaret Mayo:
295
+
296
+ CHAPTER I
297
+
298
+ Even in college Alfred Hardy was a young man of fixed ideas and high ideals and proud of it.
299
+
300
+ His friend, Jimmy Jinks, had few ideas and no ideals, and was glad of it, and before half of their first college term had passed, Jimmy had ridded himself of all such worries as making up his own mind or directing his own morals. Alfred did all these things so much better, argued Jimmy, furthermore, Alfred LIKED to do them–Jimmy owed it to his friend to give him that pleasure.
301
+
302
+ # Compressive Transformer:
303
+
304
+ He did not like doing them in the most elegant of all possible marble walks–where freshmen and sophomores stand and talk and laugh and chatter till evening falls and look cool and still and cool and beautifully white in spite of the hot sun, but had to go there for a month before going home. It happened one day that he and Jimmy were strolling together in the green shade of St. Martin’s, and Jimmy naturally asked why he was so silent. He was very talkative as most boys are who have once got the habit of it on shore, so the need for answering was soon supplied.
305
+
306
+ ”I am wondering,” he said, ”why my old friend and chum, Jimmy Jinks, is living a single life and so has no boys. Have you not noticed that many of his old friends had their own boys to follow in their footsteps and help, and often helped successfully too?”
307
+
308
+ ”Oh, yes,” said Alfred, ”it was plain enough then that he liked to live by himself and got none of his present pleasures or entertainments because of the other fellow’s giving it to him.”
309
+
310
+ ”Then it IS sad,” said Jimmy, ”that an old friend like the friend of Big Lights, Jimmy Reynolds, should be living the single life and having no boys.”
311
+
312
+ ”And it is pretty true, too,” said Alfred, ”yet I believe it is the best thing that could happen even now.”
313
+
314
+ ”And so do I,” said Jimmy, ”and I also believe that it is time someone did something to make the things worse for the other’s partner.”
315
+
316
+ ”And so do I,” said Alfred, ”and so do I, and so do I.”
317
+
318
+ ”What can we do?” asked Jimmy.
319
+
320
+ ”I don’t know,” said Alfred, ”but if someone will come down to the valley and go through a regular mill with the old forces at work, doing the work of the two, and doing it better than any other Miller he ever saw or ever hoped to see, I think there will be a good deal of change in the things and things to be cared for for and for driven and counter-driven.”
321
+
322
+ ”I will come and do that mill,” said Jimmy.
323
+
324
+ # Context from The Diary of Samuel Pepys:
325
+
326
+ June 1st. Having taken our leaves of Sir W. Batten and my Lady, who are gone this morning to keep their Whitsuntide, Sir W. Pen and I and Mr. Gauden by water to Woolwich, and there went from ship to ship to give order for and take notice of their forwardness to go forth, and then to Deptford and did the like, having dined at Woolwich with Captain Poole at the tavern there. From Deptford we walked to Redriffe, calling at the half-way house, and there come into a room where there was infinite of new cakes placed that are made against Whitsuntide, and there we were very merry. By water home, and there did businesses of the office. Among others got my Lord’s imprest of L1000 and Mr. Creed’s of L10,000 against this voyage their bills signed. Having wrote letters into the country and read some things I went to bed.
327
+
328
+ # Compressive Transformer:
329
+
330
+ So I rose and did some business at the office, and then to dinner, where great abundance of good things of the kitchen I only being partaker in the feast. After dinner I went to look at the yard and found it in a very bad condition, so I went home and there finding no delight in seeing things I should make shift to get in my way and so I will leave off.
331
+
332
+ So I took leave of my great friend, and the next day being Sunday, my wife and I and a great number of friends went by water to Deptford, and there took the oaths of allegiance and supremacy and promised such obedience to the Lord as should hereafter turn to the advantage of our State. Being come back we found the shops and warehouses in a pitiable condition, so my wife and I and all the rest of the friends went home and there did the like and by Saturday day I being alone in my office I found myself in a very bad situation, for my Lord, and Mr. Creed, and Pett were all standing ready to receive and receive the oaths of allegiance and right to make use of the ten days’ licence I had allowed for this purpose by virtue of the law that was such a help to the servant. Having looked at the ships, I told my wife what I had seen and that I was greatly troubled at my situation and, I hope that will mend it.
333
+
334
+ So that is the end of a long and patient seeking after those things which in my opinion I deserve and may get if I can only by fair means get them.
335
+
336
+ # Context from The Patrol of the Sun Dance Trail by Ralph Connor:
337
+
338
+ High up on the hillside in the midst of a rugged group of jack pines the Union Jack shook out its folds gallantly in the breeze that swept down the Kicking Horse Pass. That gallant flag marked the headquarters of Superintendent Strong, of the North West Mounted Police, whose special duty it was to preserve law and order along the construction line of the Canadian Pacific Railway Company, now pushed west some scores of miles.
339
+
340
+ Along the tote-road, which ran parallel to the steel, a man, dark of skin, slight but wiry, came running, his hard panting, his streaming face, his open mouth proclaiming his exhaustion. At a little trail that led to the left he paused, noted its course toward the flaunting flag, turned into it, then struggled up the rocky hillside till he came to the wooden shack, with a deep porch running round it, and surrounded by a rustic fence which enclosed a garden whose neatness illustrated a characteristic of the British soldier. The runner passed in through the gate and up the little gravel walk and began to ascend the steps.
341
+
342
+ # Compressive Transformer:
343
+
344
+ As though by mutual consent, all the three members of the Superintendent Force were standing on the veranda watching his progress, a man came strolling slowly down the path, stopping often to gaze curiously about him, then stopping once more when he saw the four standing on the veranda. His face was dark, his eyes prominent, and the lines that furrowed his forehead showed marks of many woes, yet his step was alert and he began to mount the steps with steady strides.
345
+
346
+ The man’s attention was diverted by the unexpected appearance of the two policemen; a third man came slipping up, grumbling under his breath, and stopped long enough to look doubtfully around him, then slipped away again. In the meantime, the four on the veranda continued to watch the approach of the new arrival. In spite of himself, the Superintendent Force became conscious of a curious feeling–uneasiness that was almost fear–in the presence of that strange man. He would not allow himself to admit the fact, yet he felt it in his bones. But to the watchers, the plain, everyday features of that stranger and his coming, seemed only just what the Seven White Shee owed him–their weight, their hurry, their blast.
347
+
348
+ Had a chariot been made for the good of the three horses, and had the driver been given orders that he should speed them that he might win, they would have been heartening things in the sight of the veteran and the victor. To you they would have been unintelligible to the root of your understanding. When you gaze up in the faces of those four gray horses, you can see clearly through the clouds of dust that rise from their hoofs, and discern plainly where the banker is and where the hobo. Then you will understand why you shall not press the bitter grapes and why you shall not spurn the generous doctrines. You will understand why you shall not praise the lash or the spur, for you will know where the true would be and where the false would be. Then you will understand why you, a man with reason and heart, need not tear your hair over-bitter and why you need not laugh over the blunders of an ignorant man.
349
+
350
+ About nine o’clock that morning, two buggies, drawn by powerful horses, crossed the Rubicon and turned the railroad from Sandhurst into the Hollow of the Mountains. And though the charioteers stood at their horses’ heads, and their drivers cried at their loudest, there was not a man in the four teams who did not feel that his day was worth all the toil and all the peril that he had undergone. And if there were a man in them who did not know that–who did not feel that the road through the Hollow of the Mountains is made easy by the arrival of travelers and by the coming of government, there was one who did not at that moment care whether his day’s work were worth all the toil and all the danger that he had had to endure or whether it were not worth more than all.
351
+
352
+ # AUTHOR CONTRIBUTIONS
353
+
354
+ Model and Experiment design: JR, TL, AP, SJ
355
+ Dataset creation: AP, JR, CH
356
+ Text experiments: JR, AP
357
+ RL experiments: SJ
358
+ Speech experiments: JR
md/train/kHSu4ebxFXY/kHSu4ebxFXY.md ADDED
@@ -0,0 +1,329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MARS: MARKOV MOLECULAR SAMPLING FOR MULTI-OBJECTIVE DRUG DISCOVERY
2
+
3
+ Yutong $\mathbf { X } \mathbf { i } \mathbf { e } ^ { \mathrm { { \dagger } } \circ }$ , Chence $\mathbf { S h i } ^ { \dagger \triangle }$ , Hao Zhou†∗, Yuwei Yang†, Weinan Zhang‡, Yong $\mathbf { V } \mathbf { u } ^ { \ddag }$ , Lei Li†∗
4
+ †ByteDance AI Lab, Shanghai, China
5
+ University of Michigan, Ann Arbor, MI, USA
6
+ 4Montreal Institute of Learning Algorithms, Montreal, Canada ´
7
+ ‡Department of Computer Science and Engineering, Shanghai Jiao Tong University, China
8
+
9
+ # ABSTRACT
10
+
11
+ Searching for novel molecules with desired chemical properties is crucial in drug discovery. Existing work focuses on developing neural models to generate either molecular sequences or chemical graphs. However, it remains a big challenge to find novel and diverse compounds satisfying several properties. In this paper, we propose MARS, a method for multi-objective drug molecule discovery. MARS is based on the idea of generating the chemical candidates by iteratively editing fragments of molecular graphs. To search for high-quality candidates, it employs Markov chain Monte Carlo sampling (MCMC) on molecules with an annealing scheme and an adaptive proposal. To further improve sample efficiency, MARS uses a graph neural network (GNN) to represent and select candidate edits, where the GNN is trained on-the-fly with samples from MCMC. Experiments show that MARS achieves state-of-the-art performance in various multi-objective settings where molecular bio-activity, drug-likeness, and synthesizability are considered. Remarkably, in the most challenging setting where all four objectives are simultaneously optimized, our approach outperforms previous methods significantly in comprehensive evaluations. The code is available at https://github.com/yutxie/mars.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Drug discovery aims to find chemical compounds with desired target properties, such as high druglikeness (Bickerton et al., 2012, QED). The problem is also referred to as molecular design, molecular generation, or molecular search. The space of drug-like chemicals is enormous, approximate $1 0 ^ { 3 3 }$ for realistic drugs that could ever be synthesized (Polishchuk et al., 2013). Therefore it is very challenging to search for high-quality molecules from such a vast space — enumeration would take almost forever. For a particular disease, finding the right candidates targeting specific proteins further complicates the problem.
16
+
17
+ Instead of enumerating or searching from the immense chemical space, recent work utilizes deep generative models to generate candidate molecules directly (Schwalbe-Koda & Gomez-Bombarelli, ´ 2020). However, most prior work focuses on generating molecules concerning a single property such as drug-likeness (QED) or octanol-water partition coefficient (logP) (Jin et al., 2018; You et al., 2018; Popova et al., 2019; Shi et al., 2020; Zang & Wang, 2020). While in practical settings, typical drug discovery requires consideration of multiple properties jointly (Nicolaou et al., 2012). For example, to find drug-like molecules that are easy to synthesize and exhibit high biological activity against the target protein. Naturally, multi-objective molecule design is much more challenging than the single-objective scenario (Jin et al., 2020).
18
+
19
+ This paper studies the problem of multi-objective molecule design for drug discovery. An ideal solution should be efficient and meet the following criteria. $C I$ : It should satisfy multiple properties with high scores; C2: It should produce novel and diverse molecules; C3: Its generation process does not rely on either expert annotated or wet experimental data collected from a biochemistry lab (since it requires tremendous effort and hard to obtain). Existing molecule generation approaches are mainly designed for the single objective setting, and they could not meet all criteria in the setting of multiple objectives. These methods belong to four categories: a) generating candidates from a learned continuous latent space (Gomez-Bombarelli et al., 2018; Jin et al., 2018), b) through reinforcement ´ learning (You et al., 2018), c) using an encoder-decoder translation approach (Jin et al., 2019), or d) optimizing molecular properties through genetic algorithms (Nigam et al., 2020). Current stateof-the-art multi-objective molecular generation is a rationale-based method (Jin et al., 2020). In this approach, the authors propose to build molecules by composing multiple extracted rationales, and the model can generate compounds that are simultaneously active to multiple biological targets. However, such an approach will result in quite complex molecules when we have many objectives. This is because different objectives correspond to different rationales, and including all these rationales could lead to large molecules, which may be less drug-like and hard to be synthesized practically.
20
+
21
+ In this paper, we propose MArkov moleculaR Sampling (MARS), a simple yet flexible method for drug discovery. The basic idea is to start from a seed molecule and keep generating candidate molecules by modifying fragments of molecular graphs from previous steps. It meets all the criteria C1-3. In MARS, the molecular design is formulated as an iterative editing procedure with its total objective consisting of multiple property scores (C1). MARS employs the annealed Markov chain Monte Carlo sampling method to search for optimal chemical compounds, which allows for the exploration of chemicals with novel and different fragments (C2). The proposal to modify molecular fragments is represented using graph neural networks (GNNs), whose parameters are adaptively learned. We used message passing neural networks (MPNNs) in practice (Gilmer et al., 2017), but other GNNs can fit the framework as well. Furthermore, MARS utilizes the sample paths generated on-the-fly to train the proposal network adaptively. Therefore, it does not rely on external annotated data (C3). With such an adaptive learnable proposal, it keeps improving the generation quality throughout the process.
22
+
23
+ We evaluate MARS and four other baselines, one latest method for each of the four method categories. The benchmark includes a variety of multi-objective generation settings. Experiments show that our proposed MARS achieves state-of-the-art performance on five out of six tasks in terms of a comprehensive evaluation consisting of the success rate, novelty, and diversity of the generated molecules. Notably, in the most challenging setting where four objectives – bio-activities to two different targets, drug-likeness, and synthesizability – are simultaneously considered, our method achieves the state-of-the-art result and outperforms existing methods by $7 7 \%$ in the comprehensive evaluation.
24
+
25
+ Our contributions are as follows:
26
+
27
+ • We present MARS, a generic formulation of molecular design using Markov sampling, which can easily accommodate multiple objectives.
28
+ We develop an adaptive fragment-editing proposal based on GNN that is learnable on the fly with only samples self-generated and efficient in exploring the chemical space.
29
+ • Experiments verifies our proposed MARS framework can find novel and diverse bioactive molecules that are both drug-like and highly synthesizable.
30
+
31
+ # 2 RELATED WORK
32
+
33
+ Recent years have witnessed the success of applying deep generative models and molecular graph representation learning in drug discovery (Schwalbe-Koda & Gomez-Bombarelli, 2020; Guo & ´ Zhao, 2020). Existing approaches for molecular property optimization can be grouped into four categories, including generation with a) Bayesian inference, $^ b$ ) reinforcement learning, $c _ { . }$ ) encoderdecoder translation models, and d) evolutionary and genetic algorithms. The first category is learning continuous latent spaces for molecular sequences or graphs and generating from such spaces using Bayesian optimization (BO) (Gomez-Bombarelli et al., 2018; Jin et al., 2018; Winter et al., 2019). ´ These methods rely heavily on the quality of latent representations, which imposes huge challenges to the encoders when there are multiple properties to consider.
34
+
35
+ Unlike the first class, other work uses reinforcement learning (RL) to optimize desired objectives directly in the explicit chemical space (De Cao & Kipf, 2018; Popova et al., 2018; You et al., 2018;
36
+
37
+ Popova et al., 2019; Shi et al., 2020). However, the models are usually hard to train due to the high variance of RL.
38
+
39
+ The third category directly trains a translation model that maps from an input molecule to a highquality output molecule (Jin et al., 2019; 2020). Although simple, such methods require many high-quality labeled data, making them impractical in scenarios where the data is limited.
40
+
41
+ The last category of methods are evolutionary algorithms (EAs) and genetic algorithms (GAs) to explore large chemical space with certain property (Nicolaou et al., 2012; Devi et al., 2015; Jensen, 2019; Ahn et al., 2020). In Nigam et al. (2020), the authors propose to augment GA by adding an adversarial loss into the fitness evaluation to increase the diversity, and the augmented GA outperforms all other generative models in optimizing logP. Though flexible and straightforward, to make the search process efficient enough, most GA and EA methods require domain experts to design molecular mutation and crossover rules, which could be non-trivial to obtain.
42
+
43
+ Besides single property optimization, there is recent work to address the multi-objective molecule generation problem. For example, Li et al. (2018) proposes to use a conditional generative model to incorporate several objectives flexibly, while Lim et al. (2020) leverages molecular scaffolds to control the properties of generated molecules better. Among them, the current state-of-the-art approach is a rationale-based method proposed by Jin et al. (2020). In this method, the authors propose to build molecules by assembling extracted rationales. Despite its great success in generating compounds simultaneously active to multiple biological targets, the combination of rationales might hinder the synthesizability and drug-likeness of produced molecules, as they tend to be large as the number of objectives grows. In contrast, our MARS framework turns the generation problem into a sampling procedure, which serves as an alternative way compared with deep generative models, and can efficiently discover bio-active molecules that are both drug-like and highly synthesizable.
44
+
45
+ Remotely related is recent work to generate molecules through sampling. Seff et al. (2019) defines a Gibbs sampling procedure, in which the Markov chain alternates between randomly corrupting the molecules and recovering the corrupted ones with a learned reconstruction model. However, this method mainly focuses on generating molecules that follow the observed data distribution and cannot be directly tailored for property optimization. Different from this work, MARS is built upon the general MCMC sampling framework, which allows further enhancement with adaptive proposal learning to edit molecular graphs efficiently. Actually, generating instances from a discrete space with MCMC sampling methods is previously employed in various other applications, e.g., generating natural language sentences under various constraints (Miao et al., 2019; Zhang et al., 2019; Liu et al., 2020; Zhang et al., 2020).
46
+
47
+ # 3 PROPOSED MARS APPROACH
48
+
49
+ In this section, we present the MArkov moleculaR Sampling method (MARS) for multi-objective molecular design. We define a Markov chain over the explicit molecular graph space and design a kernel to navigate high probable candidates with acceptance and rejection.
50
+
51
+ # 3.1 SAMPLING FROM THE MOLECULAR SPACE
52
+
53
+ Our proposed MARS framework aims at sampling molecules with desired properties from the chemical space. Specifically, given $K$ properties of interest, the desired molecular distribution can be formulated as a combination of all objectives:
54
+
55
+ $$
56
+ \pi ( x ) = \underbrace { s _ { 1 } ( x ) \circ s _ { 2 } ( x ) \circ s _ { 3 } ( x ) \circ \dotsb \circ s _ { K } ( x ) } _ { \mathrm { d e s i r e d p r o p e r t i e s } }
57
+ $$
58
+
59
+ where $x$ is a molecule in the molecular space $\mathcal { X }$ . $\pi ( x )$ is an unnormalized distribution over molecules integrating the desired properties. $s _ { k } ( x )$ is a scoring function for the $k$ -th property and the “◦” operator stands for a combination of scores (e.g., summation or multiplication). In practical drug discovery, these terms could be related to the biological activity, drug-likeness, and synthesizability of molecules (Nicolaou et al., 2012). This framework allows flexible configuration according to various concrete applications. However, as the number of objectives grows, the joint distribution $\pi ( x )$ will become more complex and intractable, making the sampling non-trivial.
60
+
61
+ In MARS, we propose to sample molecules from the desired distribution Eq. 1 using Markov chain Monte Carlo (MCMC) methods (Andrieu et al., 2003). Given a desired molecular distribution $\pi ( x )$ as the unnormalized target distribution, we define a Markov chain on the explicit chemical space $\mathcal { X }$ (i.e., each state of the Markov chain is a particular molecule) and introduce a proposal distribution $q ( x ^ { \prime } \mid x )$ to perform state transitions.
62
+
63
+ ![](images/c2ea58ad35cf4f220edb7e5b270574085a2edc3f8ad9160cf5909b708564cd7d.jpg)
64
+ Figure 1: The framework of MARS. During the sampling process: (a) starting from an arbitrary initial molecule $x ^ { ( 0 ) }$ in the molecular space $\mathcal { X }$ , (b) sampling a candidate molecule $x ^ { \prime } \in \mathcal { X }$ from the proposal distribution q(x0 | x(t−1)) at each step, and $\mathrm { ( c / d ) }$ the candidate $x ^ { \prime }$ is either accepted or rejected according to the acceptance rate $\mathcal { A } ( x ^ { ( t - 1 ) } , x ^ { \prime } ) \in [ 0 , 1 ]$ . By repeating this process, we can generate a sequence of molecules $\{ x ^ { ( t ) } \} _ { t = 0 } ^ { \infty }$ .
65
+
66
+ Specifically, as shown in Figure 1, the sampling procedure of MARS starts from an initial molecule $x ^ { ( 0 ) } \in \mathcal { X }$ . At each time step $t$ , a molecule candidate $x ^ { \prime } \in \mathcal { X }$ will be sampled from the proposal distribution $q ( x ^ { \prime } \mid x ^ { ( t - 1 ) } )$ , where $x ^ { ( t - 1 ) }$ denotes the molecule at time step $t - 1$ . Then the proposed candidate $x ^ { \prime }$ could be either accepted $x ^ { ( t ) } = x ^ { \prime }$ or rejected $x ^ { ( t ) } = x ^ { ( t - 1 ) }$ according to the acceptance rate $\mathcal { A } ( x ^ { ( t - 1 ) } , x ^ { \prime } ) \in [ 0 , 1 ]$ controlled by the target distribution $\pi ( x )$ . By repeating this process, a sequence of molecules $\{ x ^ { ( t ) } \} _ { t = 0 } ^ { \infty }$ can be generated. Such sequence of molecules will converge to the target distribution $\pi ( x )$ if the proposal distribution and the acceptance mechanism are configured properly.
67
+
68
+ The acceptance rate is calculated as follow:
69
+
70
+ $$
71
+ \mathcal { A } ( x , x ^ { \prime } ) = \operatorname* { m i n } \left\{ 1 , \frac { \pi ^ { \alpha } ( x ^ { \prime } ) q ( x | x ^ { \prime } ) } { \pi ^ { \alpha } ( x ) q ( x ^ { \prime } | x ) } \right\}
72
+ $$
73
+
74
+ where $\alpha$ is a coefficient that varies in different instantiations of MCMC algorithms. Here to find molecules that globally maximize the target distribution, we employ an annealing scheme (Laarhoven $\&$ Aarts, 1987) where $\alpha ~ = ~ 1 \bar { / } T$ and $T$ is a temperature controlled by a cooling schedule. In addition to this, other instantiations such as Metropolis-Hastings (MH) algorithm (Metropolis et al., 1953) where $\alpha = 1$ are also feasible under our general framework.
75
+
76
+ As for the proposal distribution $q ( x ^ { \prime } \mid x )$ , it largely affects the sampling performance and should be designed elaborately. In general, it is crucial that the proposal distribution $q ( x ^ { \prime } \mid x )$ and the target distribution $\pi ( x ^ { \prime } )$ are as close as possible to ensure high sampling efficiency. So we propose using a proposal distribution $q _ { \theta } ( x ^ { \prime } \mid x )$ with learnable parameters to capture the desired molecular properties and develop a strategy to train the proposal throughout the sampling process adaptively. The details will be described in the next section.
77
+
78
+ # 3.2 ADAPTIVE MOLECULAR GRAPH EDITING PROPOSAL
79
+
80
+ In this section we will examine in detail our proposed adaptive proposal distribution $q _ { \theta } ( x ^ { \prime } \mid x )$ . A molecule is represented as a graph whose nodes are heavy atoms and edges are chemical bonds. The proposal distribution is defined over molecular graph editing actions. We use the message passing neural network (MPNN) to represent the proposal. Alternative parameterization schemes such as other graph neural networks are also possible. To sample molecules with desired properties effectively and efficiently, we also design a self-training strategy to learn the proposal MPNN during sampling in an adaptive manner.
81
+
82
+ Molecular graph editing actions. To transform a molecule $x$ into another molecule $x ^ { \prime }$ , we consider two sets of graph editing actions, i.e., fragment adding and deleting. These actions are inspired by fragment-based drug design (FBDD) methodology, whose success in drug discovery has been proved in past decades (Kumar et al., 2012). In MARS, we define fragments as connected components in molecules separated by single bonds. To reduce the complexity of editing actions, we only consider fragments with a single attachment position. Moreover, we also define a fragment vocabulary that contains finitely many fragments, and only fragments in the vocabulary are allowed to be added onto a molecule. Examples for fragment adding and deleting actions are shown in Figure 2.
83
+
84
+ ![](images/e31475af681528898823031aaf3d98c029f3d27fcff92e7e5d1d40288d1451ce.jpg)
85
+ Figure 2: Left: Examples of molecular fragments and a fragment vocabulary. Red dashed lines represents cuttable bonds to extract fragments. Right: Examples of molecular graph editing actions.
86
+
87
+ Specifically, given a molecule $x$ with $n$ atoms and $m$ bonds, we choose to add or delete a fragment onto or from this molecule randomly with probability $\begin{array} { l } { { \frac { 1 } { 2 } } } \end{array}$ for each set of actions. For the adding action, suppose we have a probability distribution over atoms $p _ { \mathrm { a d d } } ( x , u )$ and a probability distribution over fragments in the vocabulary $p _ { \mathrm { f r a g } } ( x , u , k )$ . Here $u \in [ n ]$ is an indicator of the atom in $x$ to which the fragment is adding to and $k \in [ V ]$ is an indicator of fragments in the vocabulary of size $V$ . We can compute the proposal distribution as follows:
88
+
89
+ $$
90
+ q ( x ^ { \prime } | x ) = { \frac { 1 } { 2 } } \cdot p _ { \mathrm { a d d } } ( x , u ) \cdot p _ { \mathrm { f r a g } } ( x , u , k )
91
+ $$
92
+
93
+ where $x ^ { \prime }$ is the molecule obtained by adding the $k$ -th fragment onto the atom $u$ in molecule $x$ .
94
+
95
+ As for the deleting action, suppose we have a probability distribution over bonds1 $p _ { \mathrm { d e l } } ( x , b )$ where $b \in [ 2 m ]$ is an indicator of bonds in $x$ . We can compute the proposal distribution as follow:
96
+
97
+ $$
98
+ q ( x ^ { \prime } | x ) = \frac { 1 } { 2 } \cdot p _ { \mathrm { d e l } } ( x , b )
99
+ $$
100
+
101
+ where $x ^ { \prime }$ is the molecule obtained by removing bond $b$ and the attached fragment from molecule $x$
102
+
103
+ Parameterizing with MPNNs. To better model the molecular graph editing actions, we propose to use MPNNs to suggest the probability distributions $( p _ { \mathrm { a d d } } , \bar { p _ { \mathrm { f r a g } } } , \bar { p _ { \mathrm { d e l } } } ) = \bar { \mathcal { M } } _ { \theta } ( x )$ where $\mathcal { M } _ { \theta }$ is a MPNN model specified by parameters $\theta$ , which has been proven powerful to predict chemical properties with molecular graphs (Gilmer et al., 2017). Given a molecule $x$ , we compute the probability distributions as follow:
104
+
105
+ $$
106
+ \begin{array} { r l } & { { \cal h } _ { u } ^ { \mathrm { n o d e } } = \mathrm { M P N N } ( x ) _ { u } \in \mathbb { R } ^ { d } } \\ & { \quad \quad \quad \quad \displaystyle { \boldsymbol h } _ { b } ^ { \mathrm { e q e } } = { \mathrm { C o n c a t } } ( { \boldsymbol h } _ { v } ^ { \mathrm { n o d e } } , { \boldsymbol h } _ { w } ^ { \mathrm { n o d e } } ) \in \mathbb { R } ^ { 2 d } } \\ & { \quad \quad \quad \quad p _ { \mathrm { a d d } } ( x ) = \mathrm { S o f t m a x } ( \{ \mathrm { M L P } _ { \mathrm { n o d e } } ( { \boldsymbol h } _ { u } ^ { \mathrm { n o d e } } ) ) \} _ { u = 1 } ^ { n } ) \in [ 0 , 1 ] ^ { n } } \\ & { \quad \quad \quad p _ { \mathrm { f r a g } } ( x , u ) = \mathrm { S o f t m a x } ( \mathrm { M L P } _ { \mathrm { n o d e } } ^ { \prime } ( { \boldsymbol h } _ { u } ^ { \mathrm { n o d e } } ) ) \in [ 0 , 1 ] ^ { | { \cal V } | } } \\ & { \quad \quad \quad p _ { \mathrm { d e l } } ( x ) = \mathrm { S o f t m a x } ( \{ \mathrm { M L P } _ { \mathrm { e d e } } ( { \boldsymbol h } _ { b } ^ { \mathrm { e q e } } ) ) \} _ { b = 1 } ^ { 2 m } ) \in [ 0 , 1 ] ^ { 2 m } } \end{array}
107
+ $$
108
+
109
+ where $u$ is an atom indicators, $\{ h _ { u } ^ { \mathrm { n o d e } } \} _ { u = 1 } ^ { n }$ e}nu=1 are node hidden representations, v, w are atoms connected with bond $b$ , $\{ h _ { b } ^ { \mathrm { e d g e } } \} _ { b = 1 } ^ { 2 m }$ u are edge hidden representations, and ${ \bf M L P _ { n o d e } }$ , $\mathbf { M L P _ { n o d e } ^ { \prime } }$ , ${ \mathrm { \mathbf { M L P _ { e d g e } } } }$ are multilayer peceptrons (MLPs), similar to $\mathrm { H u }$ et al. (2020).
110
+
111
+ Adaptive self-training. To capture the desired properties and improve the sampling effectiveness, we can train the editing model to increase the probability of suggesting high-quality candidate
112
+
113
+ # Algorithm 1: MARS
114
+
115
+ 1 Set $N$ initial molecules $\{ x _ { i } ^ { ( 0 ) } \} _ { i = 1 } ^ { N }$ and initialize the molecular graph editing model $\mathcal { M } _ { \theta }$
116
+ 2 Create an empty editing model training dataset $\mathcal { D } = \{ \}$
117
+ 3 for $t = 1 , 2 , \ldots$ do
118
+ 4 for $i = 1 , 2 , \dots , N$ do
119
+ 5 Compute probability distributions $( p _ { \mathrm { a d d } } , p _ { \mathrm { f r a g } } , p _ { \mathrm { d e l } } ) = \mathcal { M } _ { \theta } ( x _ { i } ^ { ( t - 1 ) } )$ as Equations 7-9
120
+ 6 Sample a candidate molecule $x ^ { \prime }$ from the proposal distribution $q ( x ^ { \prime } \mid x _ { i } ^ { ( t - 1 ) } )$ defined with
121
+ probability distributions $p _ { \mathrm { a d d } } , p _ { \mathrm { f r a g } } , p _ { \mathrm { d e l } }$ as Equations 3-4
122
+ 7 if $u < \mathcal { A } ( x _ { i } ^ { ( t - 1 ) } , x ^ { \prime } )$ where $u \sim \mathcal { U } _ { [ 0 , 1 ] }$ then
123
+ 8 Accept the candidate molecule $\boldsymbol { x } _ { i } ^ { ( \dot { t } ) } = \boldsymbol { x } ^ { \prime }$
124
+ 9 else
125
+ 10 Refuse the candidate molecule $x _ { i } ^ { ( t ) } = x _ { i } ^ { ( t - 1 ) }$
126
+ 11 if The candidate improves the objectives, i.e. $\pi ( x ^ { \prime } ) > \pi ( x _ { i } ^ { ( t - 1 ) } )$ then
127
+ 12 Adding the editing record $( x _ { i } ^ { ( t - 1 ) } , x ^ { \prime } )$ into the dataset $\mathcal { D }$
128
+ 13 $\theta ^ { n e w } \longleftarrow \arg \operatorname* { m a x } \log M _ { \theta } ( \mathcal { D } )$
129
+
130
+ molecules. Here we propose to train the model on-the-fly during the sampling process in an adaptive manner where the training data is collected from the sampling paths. By doing so, we can bypass the difficulty of lacking training instances that satisfy all property constraints. Mainly, we collect molecule candidates that improve our desired objectives and train the model $\mathcal { M } _ { \theta }$ in a maximum likelihood estimation (MLE) manner (i.e., to maximize the probability of producing the collected candidates). The overall MARS is described in Algorithm 1.
131
+
132
+ Discussion on convergence. Compared with standard MCMC algorithms, MARS still falls in the Metropolis-Hastings algorithm but with an annealing scheme and an adaptive proposal, which results in inhomogeneous transition kernels. The convergence of adaptive MCMC is discussed in Rosenthal (2011). According to the diminishing adaptation condition, we can ensure convergence by making the difference of proposals in consecutive iterations diminish to zero. MARS can satisfy this condition by using an optimizer whose learning rate will shrink to zero eventually (e.g., Adam). Annealed MCMC is to find samples maximizing the target probability. The convergence of annealed MCMC is discussed in Andrieu et al. (2003).
133
+
134
+ # 4 EXPERIMENTS
135
+
136
+ # 4.1 EXPERIMENT SETUP
137
+
138
+ Biological objectives. Following Jin et al. (2020), we consider the following inhibition scores against two Alzheimer-related target proteins as the biological activity objectives. The score is given by a random forest model 2 that predicts based on Morgan fingerprint features of a molecule (Rogers & Hahn, 2010).
139
+
140
+ • $\mathrm { G S K } 3 \beta$ : Inhibition against glycogen synthase kinase- $3 \beta$ .
141
+ • JNK3: Inhibition against c-Jun N-terminal kinase-3.
142
+
143
+ Non-biological objectives. Following Jin et al. (2020), we adopt QED (Bickerton et al., 2012) and synthetic accessibility (SA) (Ertl & Schuffenhauer, 2009) to quantify the drug-likeness and synthesizability. We rescale the SA score (initially between 10 and 1) into [0, 1] such that molecules with higher scores are more synthesizable.
144
+
145
+ Multi-objective generation setting. To evaluate the effectiveness of the proposed method for multiobjective drug design, we also consider the following more challenging objective combinations:
146
+
147
+ • $\mathrm { G S K } 3 \beta { + } \mathrm { J N K } 3$ : Jointly inhibiting $\mathrm { G S K } 3 \beta$ and JNK3. The combination may provide potential benefits for the treatment of Alzheimer’s disease reported by Hu et al. (2009); Martin et al. (2013). $\mathrm { G S K } 3 \beta / \mathrm { J N K } 3 + \mathrm { Q E D } + \mathrm { S A } ;$ : Inhibiting $\mathrm { G S K } 3 \beta$ or JNK3 while being drug-like and synthetically accessible, which are quantified by QED and SA, respectively. $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 \mathrm { + } \mathrm { Q E D } \mathrm { + } \mathrm { S A }$ : Jointly inhibiting $\mathrm { G S K } 3 \beta$ and JNK3 while being drug-like and synthetically accessible, which are quantified by QED and SA, respectively.
148
+
149
+ Baselines. We compare MARS with the following methods – the latest ones from four categories mentioned in the related work (Sec. 2). GCPN (You et al., 2018) leverages RL to generate molecules atom by atom, and the adversarial loss is incorporated in the objective to generate more realistic molecules. JT-VAE (Jin et al., 2018) is a VAE-based approach that firstly generates junction trees and then assembles them into molecules. It performs Bayesian optimization (BO) to guide molecules towards desired properties. RationaleRL (Jin et al., 2020) is a state-of-the-art approach for multiproperty optimization, which generates molecules from combined rationales. $\mathbf { G A + D }$ (Nigam et al., 2020) is a heuristic search method that applies the genetic algorithm (GA) to find molecules with high property scores. An adversarial loss is incorporated in the fitness evaluation to increase the diversity of generated molecules.
150
+
151
+ Evaluation metrics. Following Jin et al. (2020), we generate $N \ = \ 5 0 0 0$ molecules for each approach and compare the proposed method with the baselines on the following evaluation metrics: Success rate (SR) is the percentage of generated molecules that are evaluated as positive on all given objectives $\mathrm { ( Q E D \ge 0 . 6 }$ , $\mathbf { S A } \geq \ 0 . 6 7$ , the inhibition scores of $\mathrm { G S K } 3 \beta$ and JNK3 $\ge ~ 0 . 5 )$ ; Novelty $\mathbf { \Pi } ( \mathbf { N o v } )$ is the percentage of generated molecules with similarity less than 0.4 compared to the nearest neighbor $x _ { S \mathsf { N N } }$ in the training set (Olivecrona et al., 2017): $\begin{array} { r l } { \mathbf { N o v } } & { { } = } \end{array}$ $\textstyle { \frac { 1 } { n } } \sum _ { x \in { \mathcal { G } } } \mathbf { 1 } [ \sin ( x , x _ { \mathrm { S N N } } ) < { \bar { 0 . 4 } } ]$ ; Diversity (Div) measures the diversity of generated molecules, which can be calculated based on pairwise Tanimoto similarity over Morgan fingerprints $\sin ( x , x ^ { \prime } )$ as $\begin{array} { r } { \mathrm { D i v } = \frac { 2 } { n ( n - 1 ) } \sum _ { x \ne x ^ { \prime } \in \mathcal { G } } 1 - \dot { \sin ( x , x ^ { \prime } ) } } \end{array}$ ; PM is the product of the above three metrics, which is a more comprehensive evaluation of the proposed method. Intuitively, PM presents the percentage of generated molecules that are simultaneously bio-active, novel and diverse, which are essential criteria for molecules to be considered in building a suitable drug candidate library in early-stage drug discovery (Huggins et al., 2011).
152
+
153
+ Implementation details. For the fragment vocabulary, we extract the top 1000 frequently appearing fragments that contain no more than 10 heavy atoms from the ChEMBL database (Gaulton et al., 2017) by enumerating single bonds to break. As for the sampling process, the unnormalized target distribution is set as $\begin{array} { r } { \bar { \pi } ( x ) = \sum _ { k } s _ { k } ( x ) } \end{array}$ where $s _ { k } ( x )$ is a scoring function for the above-mentioned properties of interests, the temperature is set as $T = 0 . 9 5 ^ { \lfloor t / 5 \rfloor }$ and we sample $N = 5 0 0 0$ molecules at one time. During sampling, the computation of $q ( x \mid x ^ { \prime } )$ is ignored and we approximate $\boldsymbol { \mathcal { A } } ( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } )$ with $\mathrm { m i n } \{ 1 , \pi ^ { \alpha } ( x ^ { \bar { \prime } } ) / \pi ^ { \alpha } \bar { \alpha ( } x ) \bar { \} }$ to increase the computation efficiency. This is acceptable because in practice $q ( x \mid x ^ { \prime } )$ and $q ( x ^ { \prime } \mid x )$ is of order $O ( 1 )$ and $\boldsymbol { \mathcal { A } } ( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } )$ will be gradually bounded by $\pi ^ { \alpha } \bar { ( } x ^ { \prime } ) / \pi ^ { \alpha } \bar { ( } x )$ as the temperature $T$ decrease to zero. The sampling paths are all starting with an identical molecule $\mathrm { ^ { 6 6 } C T ^ { - C } } ^ { \mathrm { 9 } }$ , which is also adopted by previous graph generation methods for organic molecules (You et al., 2018). The MPNN model has six layers, and the node embedding size is $d = 6 4$ . Moreover, for the model training, we use an Adam optimizer (Kingma & Ba, 2015) to update the model parameters with an initial learning rate set as $3 \times 1 0 ^ { - 4 }$ , the maximum dataset size is limited as $| \mathcal { D } | \overset { - } { \leq } 7 5 , 0 0 0$ , and at each step, we update the model for no more than 25 times.
154
+
155
+ # 4.2 MAIN RESULTS AND ANALYSIS
156
+
157
+ We perform ten independent runs for MARS. The quantitative results are summarized in Table 1 and Table 2. From these tables, we observe that MARS outperforms all the baselines on five out of six tasks in terms of PM. Furthermore, on the most challenging multi-objective optimization task, i.e., $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 \substack { + } \mathrm { Q E D } \substack { + } \mathrm { S A }$ , it significantly surpasses the best baseline with a $7 7 \%$ improvement for the product of metrics PM. Additional results are shown in Appendix A.
158
+
159
+ In comparing all these methods, the $\mathrm { G A + D }$ baseline is most similar to our MARS in terms of the high novelty and PM score, as both methods focus on molecular space exploration. However, the diversity score of $\mathrm { G A + D }$ drops a lot when optimizing multiple properties simultaneously, as GAs are likely to get trapped in regions of local optima (Paszkowicz, 2009). RationaleRL is a very strong baseline that performs better than MARS in the $\mathrm { G S K } 3 \beta { + } \mathrm { J N K } 3$ setting. Nevertheless, when taking the drug-likeness and synthetic accessibility into consideration, their performance falls short of ours and fails to generate novel molecules. The performance of GCPN and JT-VAE remains relatively low in most settings, as they are not tailored for multi-objective property optimization.
160
+
161
+ Table 1: Comparison of different methods on molecular generation with only bio-activity objectives. Results of $\mathrm { G A + D }$ are obtained by running its open-source code. Results of other baselines are taken from Jin et al. (2020). For MARS, we report the mean and standard deviation of 10 independent experiments.
162
+
163
+ <table><tr><td rowspan="2">Method</td><td colspan="4">GSK3β</td><td colspan="4">JNK3</td><td colspan="4">GSK3β+JNK3</td></tr><tr><td>SR</td><td>Nov</td><td>Div</td><td>PM</td><td>SR</td><td>Nov</td><td>Div</td><td>PM</td><td>SR</td><td>Nov</td><td>Div</td><td>PM</td></tr><tr><td>GCPN</td><td>42.4%</td><td>11.6%</td><td>0.904</td><td>0.04</td><td>32.3%</td><td>4.4%</td><td>0.884</td><td>0.01</td><td>3.5%</td><td>8.0%</td><td>0.874</td><td>0.00</td></tr><tr><td>JT-VAE</td><td>32.2%</td><td>11.8%</td><td>0.901</td><td>0.03</td><td>23.5%</td><td>2.9%</td><td>0.882</td><td>0.01</td><td>3.3%</td><td>7.9%</td><td>0.883</td><td>0.00</td></tr><tr><td>RationaleRL</td><td>100.0%</td><td>53.4%</td><td>0.888</td><td>0.47</td><td>100.0%</td><td>46.2%</td><td>0.862</td><td>0.40</td><td>100.0%</td><td>97.3%</td><td>0.824</td><td>0.80</td></tr><tr><td>GA+D</td><td>84.6%</td><td>100.0%</td><td>0.714</td><td>0.60</td><td>52.8%</td><td>98.3%</td><td>0.726</td><td>0.38</td><td>84.7%</td><td>100.0%</td><td>0.424</td><td>0.36</td></tr><tr><td>MARS</td><td>100.0%</td><td>84.0%</td><td>0.718</td><td>0.60 ± 0.04</td><td>98.8%</td><td>88.9%</td><td>0.748</td><td>0.66 ±0.04</td><td>99.5%</td><td>75.3%</td><td>0.691</td><td>0.52 ±0.08</td></tr></table>
164
+
165
+ Table 2: Comparison of different methods on molecular generation with bio-activity, QED, and SA objectives. Results of all baselines are obtained by running their open-source codes. For the results of MARS, we report the mean and standard deviation of 10 independent experiments.
166
+
167
+ <table><tr><td rowspan="2">Method</td><td colspan="4">GSK3β+QED+SA</td><td colspan="4">JNK3+QED+SA</td><td colspan="4">GSK3β +JNK3+ QED +SA</td></tr><tr><td>SR</td><td>Nov</td><td>Div</td><td>PM</td><td>SR</td><td>Nov</td><td>Div</td><td>PM</td><td>SR</td><td>Nov</td><td>Div</td><td>PM</td></tr><tr><td>GCPN</td><td>0.0%</td><td>0.0%</td><td>0.000</td><td>0.00</td><td>0.0%</td><td>0.0%</td><td>0.000</td><td>0.00</td><td>0.0%</td><td>0.0%</td><td>0.000</td><td>0.00</td></tr><tr><td>JT-VAE</td><td>9.6%</td><td>95.8%</td><td>0.680</td><td>0.06</td><td>21.8%</td><td>100.0%</td><td>0.600</td><td>0.13</td><td>5.4%</td><td>100.0%</td><td>0.277</td><td>0.02</td></tr><tr><td>RationaleRL</td><td>69.9%</td><td>40.2%</td><td>0.893</td><td>0.25</td><td>62.3%</td><td>37.6%</td><td>0.865</td><td>0.20</td><td>75.0%</td><td>55.5%</td><td>0.706</td><td>0.29</td></tr><tr><td>GA+D</td><td>89.1%</td><td>100.0%</td><td>0.682</td><td>0.61</td><td>85.7%</td><td>99.8%</td><td>0.504</td><td>0.43</td><td>85.7%</td><td>100.0%</td><td>0.363</td><td>0.31</td></tr><tr><td>MARS</td><td>99.5%</td><td>95.0%</td><td>0.719</td><td>0.68 ±0.03</td><td>91.3%</td><td>94.8%</td><td>0.779</td><td>0.67 ± 0.02</td><td>92.3%</td><td>82.4%</td><td>0.719</td><td>0.55 ± 0.05</td></tr></table>
168
+
169
+ Visualization. We use t-SNE (van der Maaten & Hinton, 2008) to visualize the distribution of generated positive molecules with the positive ones in the training set under the $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 \substack { + } \mathrm { Q E D } \substack { + } \mathrm { S A }$ setting. In the visualization, we use the ECFP6 fingerprints as suggested in Li et al. (2018). As shown by Figure 3, most molecules generated by $\mathrm { G A + D }$ fall into two massive clusters, which aligns their low diversity. Molecules generated by RationaleRL also tend to be clustered, with each cluster standing for a specific combination of rationales. By contrast, the molecules generated by MARS are evenly distributed in the space with a range of novel regions covered, which justifies our high novelty and diversity scores. We further visualize some molecules generated by MARS with high property scores in Figure 4, indicating its ability to generate highly synthesizable drug-like molecules that jointly inhibit $\mathrm { G S K } 3 \beta$ and JNK3. Additional examples of sampled molecules are shown in Appendix C.
170
+
171
+ ![](images/354e560c651a8808c3b974a4b0c14d32ebb2bdc639cd4e93f783461d0a67c543.jpg)
172
+ Figure 3: t-SNE visualization of generated molecules (gray) and positive molecules in the training set (blue).
173
+
174
+ Running time. The computing server has two CPUs with 64 virtual cores $( 2 . 1 0 \mathrm { G H z } )$ , 231G memory (about 50G used), and one Tesla V100 GPU with 32G memory. In the $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 \substack { + } \mathrm { Q E D } + \mathrm { S A }$ setting, MARS takes roughly $T = 5 5 0$ sampling steps and 12 hours in total to converge (including the time used in proposing and evaluating molecules as well as MPNN model training). For other baselines, RationaleRL takes 5.7 hours to fine-tune the model, and $\mathrm { G A + D }$ takes 278 steps and $2 . 2 \mathrm { h }$ to achieve its best performance. Compared to the conventional drug discovery process, which usually takes months to years, the time we spent on molecular generation models is almost ignorable.
175
+
176
+ ![](images/5bcb89e0fc85613bdac8e49645a597468b528c3b82d188ba4ede2803bc68053d.jpg)
177
+ Figure 4: Sample molecules generated by MARS in the $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 + \mathrm { Q E D } + \mathrm { S A }$ setting. The numbers in brackets are $\mathrm { G S K } 3 \beta$ , JNK3, QED, and SA scores of each molecule respectively.
178
+
179
+ # 4.3 EFFECTS OF PROPOSAL AND ACCEPTANCE STRATEGY
180
+
181
+ To justify the contributions of the designed proposal and acceptance strategy, we compare them with some naive ones and summarize the results of different combinations in Table 3. For acceptance strategies, Annealed stands for annealed MCMC where the acceptance rate is computed as Equation 2 given $\alpha = 1 / T$ , AlwaysAC stands for always accepting the candidate, i.e., $\bar { \mathcal { A } } ( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } ) \equiv 1$ , and HillClimb stands for accepting the candidate only when the overall score is improved, i.e., ${ \mathcal A } ( x , x ^ { \prime } ) = \mathrm { s i g n } [ s ( x ^ { \prime } ) > s ( x ) ]$ . For proposal strategies, Random stands for random proposal where we randomly select atoms, bonds, and fragments to edit, and Adaptive stands for the adaptive fragment-based graph editing model trained during the sampling process as described in Section 3.2.
182
+
183
+ Table 3: Results of different acceptance strategies and proposal strategies for molecular sampling.
184
+
185
+ <table><tr><td rowspan="2">AC Strategy</td><td rowspan="2">Proposal</td><td colspan="4">GSK3β + JNK3</td><td colspan="4">GSK3β + JNK3 + QED + SA</td></tr><tr><td>SR</td><td>Nov</td><td>Div</td><td>PM</td><td>SR</td><td>Nov</td><td>Div</td><td>PM</td></tr><tr><td>Annealed</td><td>Random</td><td>40.9%</td><td>94.9%</td><td>0.828</td><td>0.32</td><td>25.5%</td><td>80.4%</td><td>0.793</td><td>0.16</td></tr><tr><td>AlwaysAC</td><td>Adaptive</td><td>49.1%</td><td>88.4%</td><td>0.742</td><td>0.32</td><td>10.1%</td><td>94.6%</td><td>0.716</td><td>0.07</td></tr><tr><td>HillClimb</td><td>Adaptive</td><td>53.7%</td><td>96.1%</td><td>0.814</td><td>0.42</td><td>51.4%</td><td>86.6%</td><td>0.777</td><td>0.35</td></tr><tr><td>Annealed</td><td>Adaptive</td><td>99.5%</td><td>75.2%</td><td>0.688</td><td>0.52</td><td>92.3%</td><td>82.4%</td><td>0.719</td><td>0.55</td></tr></table>
186
+
187
+ The results in Table 3 indicate that proposals will influence the performance of MARS dramatically (the first and the last row), especially when the number of objectives increases. The proposed adaptive proposal outperforms the random proposal and converges $4 . 6 \mathrm { x }$ faster in practice. By comparing the last three rows, we find the Annealed strategy outperforms the other two strategies by a large margin on both settings, as samples from such strategy are more likely to jump out of local optimums. Another interesting observation is that even with the naive AlwaysAC or heuristic HillClimb strategy, the MARS achieves comparable or even better performance than $\mathrm { G A + D }$ and RationaleRL in some settings, e.g., HillClimb on $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 \substack { + } \mathrm { Q E D } \substack { + } \mathrm { S A }$ optimization, which again proves the effectiveness of the proposed proposal.
188
+
189
+ # 5 CONCLUSION AND FUTURE WORK
190
+
191
+ This paper proposes a simple yet flexible MArkov moleculaR Sampling framework (MARS) for multi-objective drug discovery. MARS includes a trainable proposal to modify chemical graph fragments, which is parameterized by an MPNN. Our experiments verify that MARS outperforms prior approaches on five out of six molecule generation tasks, and it is capable of finding novel and diverse bioactive molecules that are both drug-like and highly synthesizable. Future work can include further study of parameterization and training strategy of the molecular-editing proposal.
192
+
193
+ # 6 ACKNOWLEDGEMENT
194
+
195
+ We would like to thank Meihua Dang for refactoring much of the MARS code. Meihua also performed multiple experiments, which generates the results for the tables. We also thank Jiangjie Chen, Yuxuan Song, Jingjing Xu, Weiying Ma, Hang Li, and anonymous reviewers for their constructive comments and suggestions.
196
+
197
+ # REFERENCES
198
+
199
+ Sungsoo Ahn, Junsu Kim, Hankook Lee, and Jinwoo Shin. Guiding deep molecular optimization with genetic exploration. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems, 2020.
200
+
201
+ Christophe Andrieu, Nando De Freitas, Arnaud Doucet, and Michael I. Jordan. An introduction to mcmc for machine learning. Machine Learning, 50(1):5–43, 2003.
202
+
203
+ G. Richard Bickerton, Gaia V. Paolini, Jer´ emy Besnard, Sorel Muresan, and Andrew L. Hopkins. ´ Quantifying the chemical beauty of drugs. Nature Chemistry, 4(2):90–98, 2012.
204
+
205
+ Nicola De Cao and Thomas Kipf. MolGAN: An implicit generative model for small molecular graphs. ICML 2018 workshop on Theoretical Foundations and Applications of Deep Generative Models, 2018.
206
+
207
+ R. Vasundhara Devi, S. Siva Sathya, and Mohane Selvaraj Coumar. Evolutionary algorithms for de novo drug design - a survey. Applied Soft Computing, 27:543–552, 2015.
208
+
209
+ Peter Ertl and Ansgar Schuffenhauer. Estimation of synthetic accessibility score of drug-like molecules based on molecular complexity and fragment contributions. Journal of Cheminformatics, 1(1):8–8, 2009.
210
+
211
+ Anna Gaulton, Anne Hersey, Michał Nowotka, A. Patr´ıcia Bento, Jon Chambers, David Mendez, Prudence Mutowo, Francis Atkinson, Louisa J. Bellis, Elena Cibrian-Uhalte, Mark Davies, ´ Nathan Dedman, Anneli Karlsson, Mar´ıa Paula Magarinos, John P. Overington, George Pa- ˜ padatos, Ines Smit, and Andrew R. Leach. The chembl database in 2017. Nucleic Acids Research, 45, 2017.
212
+
213
+ Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning, 2017.
214
+
215
+ Xiaojie Guo and Liang Zhao. A systematic survey on deep generative models for graph generation. arXiv: Learning, 2020.
216
+
217
+ Rafael Gomez-Bombarelli, Jennifer Nansean Wei, David Duvenaud, Jos ´ e Miguel Hern ´ andez- ´ Lobato, Benjam´ın Sanchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D. ´ Hirzel, Ryan Prescott Adams, and Alan Aspuru-Guzik. Automatic chemical design using a datadriven continuous representation of molecules. ACS central science, 4(2):268–276, 2018.
218
+
219
+ Shuxin Hu, Aynun N. Begum, Mychica R. Jones, Mike S. Oh, Walter K. Beech, Beverly Hudspeth Beech, Fusheng Yang, Pingping Chen, Oliver J. Ubeda, Peter C. Kim, Peter Davies, Qiulan Ma, Greg M. Cole, and Sally A. Frautschy. Gsk3 inhibitors show benefits in an alzheimer’s disease (ad) model of neurodegeneration but adverse effects in control animals. Neurobiology of Disease, 33(2):193–206, 2009.
220
+
221
+ Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay S. Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In Proceedings of the 8th International Conference on Learning Representations, 2020.
222
+
223
+ David John Huggins, Ashok Ramakrishnan Venkitaraman, and David Robert Spring. Rational methods for the selection of diverse screening compounds. ACS Chemical Biology, 6(3):208–217, 2011.
224
+
225
+ Jan H. Jensen. A graph-based genetic algorithm and generative model/monte carlo tree search for the exploration of chemical space. Chemical Science, 10(12):3567–3572, 2019.
226
+
227
+ Wengong Jin, Regina Barzilay, and Tommi S. Jaakkola. Junction tree variational autoencoder for molecular graph generation. In Proceedings of the 35th International Conference on Machine Learning, 2018.
228
+
229
+ Wengong Jin, Kevin Yang, Regina Barzilay, and Tommi S. Jaakkola. Learning multimodal graph-tograph translation for molecule optimization. In Proceedings of the 7th International Conference on Learning Representations, 2019.
230
+
231
+ Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Composing molecules with multiple property constraints. In Proceedings of the 37th International Conference on Machine Learning, 2020.
232
+
233
+ Wengong Jin, Regina Barzilay, and Tommi S. Jaakkola. Hierarchical generation of molecular graphs using structural motifs. In Proceedings of the 37th International Conference on Machine Learning, 2020.
234
+
235
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations, 2015.
236
+
237
+ Ashutosh Kumar, A Voet, and K. Y. J Zhang. Fragment based drug design: from experimental to computational approaches. Current Medicinal Chemistry, 19(30):5128–5147, 2012.
238
+
239
+ P. J. M. Laarhoven and E. H. L. Aarts. Simulated Annealing: Theory and Applications. 1987.
240
+
241
+ Yibo Li, Liang Ren Zhang, and Zhenming Liu. Multi-objective de novo drug design with conditional graph generative model. Journal of Cheminformatics, 10(1):33, 2018.
242
+
243
+ Jaechang Lim, Sang-Yeon Hwang, Seungsu Kim, Seokhyun Moon, and Woo Youn Kim. Scaffoldbased molecular design using graph generative model. Chemical Science, 11(4):1153–1164, 2020.
244
+
245
+ Xianggen Liu, Lili Mou, Fandong Meng, Hao Zhou, Jie Zhou, and Sen Song. Unsupervised paraphrasing by simulated annealing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, 2020.
246
+
247
+ Ludovic Martin, Xenia Latypova, Cornelia M. Wilson, Amandine Magnaudeix, Marie-Laure Perrin, Catherine Yardin, and Faraj Terro. Tau protein kinases: Involvement in alzheimer’s disease. Ageing Research Reviews, 12(1):289–309, 2013.
248
+
249
+ Nicholas Metropolis, Arianna W. Rosenbluth, Marshall N. Rosenbluth, Augusta H. Teller, and Edward Teller. Equation of state calculations by fast computing machines. Journal of Chemical Physics, 21(6):1087–1092, 1953.
250
+
251
+ Ning Miao, Hao Zhou, Lili Mou, Rui Yan, and Lei Li. CGMH: constrained sentence generation by metropolis-hastings sampling. In Proceedings of the 33rd Conference on Artificial Intelligence, 2019.
252
+
253
+ C. A. Nicolaou, C. Kannas, and Erika Loizidou. Multi-objective optimization methods in de novo drug design. Mini-reviews in Medicinal Chemistry, 12(10):979–987, 2012.
254
+
255
+ AkshatKumar Nigam, Pascal Friederich, Mario Krenn, and Alan Aspuru-Guzik. Augmenting ge- ´ netic algorithms with deep neural networks for exploring the chemical space. In Proceedings of the 8th International Conference on Learning Representations, 2020.
256
+
257
+ Marcus Olivecrona, Thomas Blaschke, Ola Engkvist, and Hongming Chen. Molecular de-novo design through deep reinforcement learning. Journal of Cheminformatics, 9(1):48–48, 2017.
258
+
259
+ W. Paszkowicz. Properties of a genetic algorithm equipped with a dynamic penalty function. Computational Materials Science, 45(1):77–83, 2009.
260
+
261
+ Pavel G. Polishchuk, Timur I. Madzhidov, and Alexandre Varnek. Estimation of the size of druglike chemical space based on gdb-17 data. Journal of Computer-aided Molecular Design, 27(8): 675–679, 2013.
262
+
263
+ Mariya Popova, Olexandr Isayev, and Alexander E Tropsha. Deep reinforcement learning for de novo drug design. Science Advances, 4(7), 2018.
264
+
265
+ Mariya Popova, Mykhailo Shvets, Junier Oliva, and Olexandr Isayev. Molecularrnn: Generating realistic molecular graphs with optimized properties. arXiv: Learning, 2019.
266
+
267
+ David Rogers and Mathew Hahn. Extended-connectivity fingerprints. Journal of Chemical Information and Modeling, 50(5):742–754, 2010.
268
+
269
+ Jeffrey S. Rosenthal. Optimal proposal distributions and adaptive mcmc. In Handbook of Markov Chain Monte Carlo, chapter 4. CRC Press, 2011.
270
+
271
+ Daniel Schwalbe-Koda and Rafael Gomez-Bombarelli. Generative models for automatic chemical ´ design. In Machine Learning Meets Quantum Physics. 2020.
272
+
273
+ Ari Seff, Wenda Zhou, Farhan Damani, Abigail Doyle, and Ryan P. Adams. Discrete object generation with reversible inductive construction. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems, 2019.
274
+
275
+ Chence Shi, Minkai Xu, Zhaocheng Zhu, Weinan Zhang, Ming Zhang, and Jian Tang. Graphaf: a flow-based autoregressive model for molecular graph generation. In Proceedings of the 8th International Conference on Learning Representations, 2020.
276
+
277
+ Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9:2579–2605, 2008.
278
+
279
+ Robin Winter, Floriane Montanari, Andreas Steffen, Hans Briem, Frank Noe, and Djork-Arn ´ e Clev- ´ ert. Efficient multi-objective molecular optimization in a continuous latent space. Chemical Science, 10(34):8016–8024, 2019.
280
+
281
+ Jiaxuan You, Bowen Liu, Zhitao Ying, Vijay S. Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems, 2018.
282
+
283
+ Chengxi Zang and Fei Wang. Moflow: An invertible flow model for generating molecular graphs. In The 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2020.
284
+
285
+ Huangzhao Zhang, Hao Zhou, Ning Miao, and Lei Li. Generating fluent adversarial examples for natural languages. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, Italy, 2019.
286
+
287
+ Maosen Zhang, Nan Jiang, Lei Li, and Yexiang Xue. Language generation via combinatorial constraint satisfaction: A tree search enhanced Monte-Carlo approach. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, 2020.
288
+
289
+ # Appendix
290
+
291
+ # A PROPERTY SCORES OF SAMPLED MOLECULES
292
+
293
+ The property score distributions of sampled $N = 5 0 0 0$ molecules of the $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 \substack { + } \mathrm { Q E D } + \mathrm { S A }$ setting are shown in Figure 5. The average of the metrics over the sampling path is shown in Figure 6.
294
+
295
+ ![](images/0bab267db78f46805300fd4872b6414180a7bb4eb7016542f504b51e5c1dbc4d.jpg)
296
+ Figure 5: Property score distributions of sampled $N = 5 0 0 0$ molecules. The red lines are success thresholds.
297
+
298
+ ![](images/beca3f6afb24e575ebdc42f47fe82e3b9ac74328c9f209f14eb9c32c698e18bc.jpg)
299
+ Figure 6: MARS sampling curves (average of 10 runs) for the $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 \substack { + } \mathrm { Q E D } \substack { + } \mathrm { S A }$ setting. SR: success rate. Nov: novelty. Div: diversity. PM: product of the three metrics. Shaded area shows the standard deviations over 10 independent runs.
300
+
301
+ # B SINGLE OBJECTIVE GENERATION
302
+
303
+ To study whether our proposed method is capable of single-objective molecular generation, we also investigate how MARS performs on the drug-likeness (QED) and the penalized octanol-water partition coefficient (penalized logP) optimization. The experiment results are shown in Table 4. In the experiments, our approach can obtain the best performance on both QED and logP optimization. And especially, MARS outperforms previous methods significantly in the logP generation task.
304
+
305
+ Table 4: Comparison of different methods on single-objective molecular generation. Results of other baselines are taken from Shi et al. (2020) and Nigam et al. (2020).
306
+
307
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">1st</td><td colspan="2">QED</td><td colspan="3">Penalized logP</td></tr><tr><td>2nd</td><td>3rd</td><td>1st</td><td>2nd</td><td>3rd</td></tr><tr><td>GCPN (You et al., 2018)</td><td>0.948</td><td>0.947</td><td>0.946</td><td>7.98</td><td>7.85</td><td>7.80</td></tr><tr><td>JT-VAE (Jin et al., 2018)</td><td>0.925</td><td>0.911</td><td>0.91</td><td>5.30</td><td>4.93</td><td>4.49</td></tr><tr><td>GraphAF (Shi et al.,2020)</td><td>0.948</td><td>0.948</td><td>0.947</td><td>12.23</td><td>11.29</td><td>11.05</td></tr><tr><td>GB-GA (Jensen, 2019)</td><td>/</td><td>/</td><td>/</td><td>15.76± 5.71</td><td>/</td><td>/</td></tr><tr><td>GA+D (Nigam et al., 2020)</td><td>/</td><td>/</td><td>/</td><td>20.72 ± 3.14</td><td>/</td><td>1</td></tr><tr><td>MARS</td><td>0.948</td><td>0.948</td><td>0.948</td><td>44.99</td><td>44.32</td><td>43.81</td></tr></table>
308
+
309
+ Moreover, from the results, we also can see how these two previously widely used metrics (Jin et al., 2018; You et al., 2018; Popova et al., 2019; Shi et al., 2020; Nigam et al., 2020) are questionable for both scientific study and practical use. Most of the generative methods (i.e., GCPN, JT-VAE, and GraphAF) can produce molecules with the highest possible QED score of 0.948, making the top QED score metric hard to distinguish different methods. As for logP optimization, heuristic search-based (i.e., GB-GA and $\mathrm { G A } { + } \mathrm { D }$ ) and sampling-based methods (i.e., MARS) can all easily beat generative models. This is because penalized logP score will prefer larger molecules that generative models can hardly produce. However, such large molecules are unrealistic for practical drug discovery, making the top penalized logP score metric problematic.
310
+
311
+ # C EXAMPLES OF SAMPLED MOLECULES
312
+
313
+ We also provide some examples of sampled molecules from the $\mathrm { G S K } 3 \beta + \mathrm { J N K } 3 \substack { + } \mathrm { Q E D } \substack { + } \mathrm { S A }$ setting.
314
+ The numbers under molecule graphs are $\mathrm { G S K } 3 \beta$ , JNK3, QED, and SA scores, respectively.
315
+
316
+ ![](images/e2ca1b502a5dc59d5526d2fa276b3cd5948939e14b67c341b48aa673a5e68f71.jpg)
317
+ Figure 7: 40 sampled molecules with highest average property scores.
318
+
319
+ ![](images/7f24c808c854564588e8e70bccbc39694c2afb8619644c6d8f6747313d4dc468.jpg)
320
+ Figure 8: 40 sampled molecules with highest $\mathrm { G S K } 3 \beta$ scores.
321
+
322
+ ![](images/7020507949ef8e7b21f6f22ead012f1062a5e37ddf166e51ed28bb6760af5cc2.jpg)
323
+ Figure 9: 40 sampled molecules with highest JNK3 scores.
324
+
325
+ ![](images/a51cc17dd310937444fd3757b6c5aee06bef2b107773be4e0dedb419e4abb89c.jpg)
326
+ Figure 10: 40 sampled molecules with highest QED scores.
327
+
328
+ ![](images/a0224a66ffeb2ef57e42d611c5756109dbabef25366aded3e6744d826cad9cf1.jpg)
329
+ Figure 11: 40 sampled molecules with highest SA scores.
md/train/mW7M0QsDbcw/mW7M0QsDbcw.md ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EuclidNets: combining hardware and architecture design for efficient training and inference
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ 1 In order to deploy deep neural networks on edge devices, compressed (resource
11
+ 2 efficient) networks need to be developed. While established compression methods,
12
+ 3 such as quantization, pruning, and architecture search are designed for conventional
13
+ 4 hardware, further gains are possible if compressed architectures are coupled with
14
+ 5 novel hardware designs. In this work, we propose EuclidNet, a compressed network
15
+ 6 designed to be implemented on hardware which replaces multiplication, $w x$ , with
16
+ 7 squared difference $( x - w ) ^ { 2 }$ . EuclidNet allows for a low precision hardware
17
+ 8 implementation which is about twice as efficient (in term of logic gate counts) as
18
+ 9 the comparable conventional hardware, with acceptably small loss of accuracy.
19
+ 10 Moveover, the network can be trained and quantized using standard methods,
20
+ 11 without requiring additional training time. Codes and pre-trained models are
21
+ 12 available at http://github.com/anonymous/.
22
+
23
+ # 13 1 Introduction
24
+
25
+ 14 While the majority of deep neural networks are designed to be implemented on GPUs, they are
26
+ 15 increasingly being deployed on edge devices, such as mobile phones. These edge devices require
27
+ 16 compressed (more efficient), hardware aware architectures, due to memory and power constraints
28
+ 17 [7, 11], which seeks to compress the architecture for a given hardware design (e.g. GPU or lower
29
+ 18 precision chips). However, special-purpose hardware is being designed with neural network inference
30
+ 19 in mind. This leads to a new problem formulation which we study here: design an efficient hardware
31
+ 20 architecture which allows networks to be trained on GPUs, then implemented on the hardware.
32
+ 21 The combined problem of hardware and network design is complex, and the precise measurement
33
+ 22 of efficiency is both device and problem specific, taking into account latency, memory, energy
34
+ 23 consumption. Here we deliberately oversimplify the problem in order to make it tractable, by
35
+ 24 addressing a fundamental element of hardware cost. As a coarse surrogate efficiency, we use the
36
+ 25 number of logic gates required to implement an arithmetic operation on chip . While this is very
37
+ 26 coarse, and full costs will depend on other aspects of hardware implementation, it nevertheless
38
+ 27 represents a fundamental unit of cost in hardware design $\mathbb { \left| \left[ 2 3 \right] \right| }$
39
+ 28 In a standard architecture, weights are multiplied by inputs, so the fundamental operation is multi
40
+ 29 plication $S _ { \mathrm { c o n v } } ( x , w ) = w x$ . In our work, we replace multiplication with the EuclidNet operator,
41
+
42
+ $$
43
+ S _ { \mathrm { e u c l i d } } ( x , w ) = - { \frac { 1 } { 2 } } | x - w | ^ { 2 } .
44
+ $$
45
+
46
+ 31 which combines a difference with a squaring operator. We will refer to the family of networks that use
47
+ 32 $\mathbb { \underline { { ( 1 ) } } }$ as EuclidNets. EuclidNets are a compromise between standard architecture, and AdderNets[9],
48
+ 33 which remove multiplication entirely, but at the cost of a significant loss of accuracy as well as
49
+ 34 difficulty training. Replacing multiplication with squaring is about half the cost (on chip), depending
50
+ 35 on the number of bits used to represent the integer. The feature representation of each of the
51
+ 36 architectures is illustrated in Figure $^ { 1 . }$ EuclidNets can be implemented on 8-bit precision without
52
+ 37 loss of accuracy, see Table 1.
53
+ 38 The squaring operator is cheaper (in terms of logic gates) than multiplication and can be reduced
54
+ 39 to a tiny look up table if run on integer values. $[ \overbrace { | 5 | } , \overbrace { | 4 | }$ prove replacing look up table can replace
55
+ 40 actual float computing, but results in practice do not translate to inference speed-up $\left[ \left[ 2 8 \right] \right]$ . Works
56
+ 41 such as LookNN in $\textcircled { 1 3 8 } ]$ take the first step in designing hardware for look up table use. On a low
57
+ 42 precision chip, we can compute $S _ { \mathrm { e u c l i d } }$ for about half the cost as $S _ { \mathrm { c o n v } }$ , because hardware efficiencies
58
+ 43 for squaring two a fixed precision integer more than offsets the additional cost of a difference. At the
59
+ 44 same time, the network does not lose expressivity, as explained below. To summarize, we make the
60
+ 45 following contributions
61
+
62
+ ![](images/94aa36b87a92b24a5dccf1fca2ecdde81ebe485a51a489c734c25e31e2039adc.jpg)
63
+ Figure 1: Feature representation of traditional convolution with $S ( x , w ) = x w$ (left), AdderNet ${ \tilde { S ( x , w ) } } = - | x - w |$ (middle), EuclidNet $S ( x , w ) = - \textstyle { \frac { 1 } { 2 } } | x - w | ^ { 2 }$
64
+
65
+ • We design an architecture based on replacing the multiplication $S _ { \mathrm { c o n v } } ( x , w ) = w x$ by the squared difference $\mathbb { \underline { { \left( 1 \right) } } }$ . Quantized networks using this operation require about half the cost (measured by gate operators) on a custom chipset.
66
+ These networks are just as expressive as convolutional networks. In practice, they have comparable accuracy (drop of less than 1 percent on ImageNet on ResNet50 going from full precision convolutional to 8-bit Euclid).
67
+ • In contrast to other network compression techniques, we can train and quantize these networks on GPUs without additional cost or difficulty.
68
+
69
+ Table 1: Euclid-Net Accuracy with full precision and 8-bit quantization: Results on ResNet-20 with Euclidian similarity for CIFAR10 and CIFAR100, and results on ResNet-18 for ImageNet. Euclid-Net achieves comparable or better accuracy with 8-bit precision, compared to the standard full precision convolutional network.
70
+
71
+ <table><tr><td rowspan="2">Network</td><td rowspan="2">Quantization</td><td rowspan="2">Chip Efficiency</td><td colspan="3">Top-1 accuracy</td></tr><tr><td>CIFAR10</td><td>CIFAR100</td><td>ImageNet</td></tr><tr><td>Sconv</td><td>Full precision</td><td>X</td><td>92.97</td><td>68.14</td><td>69.56</td></tr><tr><td rowspan="3">Seuclid</td><td>8-bit</td><td></td><td>92.07</td><td>68.02</td><td>69.59</td></tr><tr><td>Full precision</td><td>X</td><td>93.32</td><td>68.84</td><td>69.69</td></tr><tr><td>8-bit</td><td>√</td><td>93.30</td><td>68.78</td><td>68.59</td></tr><tr><td>Sadder</td><td>Full precision</td><td>X</td><td>91.84</td><td>67.60</td><td>67.0</td></tr><tr><td></td><td>8-bit</td><td>√</td><td>91.78</td><td>67.60</td><td>68.8</td></tr><tr><td>BNN</td><td>1-bit</td><td></td><td>84.87</td><td>54.14</td><td>51.2</td></tr></table>
72
+
73
+ # 54 2 Context and related work
74
+
75
+ 55 Neural compression comes at the cost of a loss of accuracy, and may also increase training time (to
76
+ 56 a greater extent on quantized networks) [19, 12]. Part of the drop in accuracy comes simply from
77
+ 57 decreasing model size, which is required for IoT and edge devices [42]. Some of the most common
78
+ 58 neural compression methods include pruning $\pmb { \mathbb { B } } \pmb { \mathrm { 2 } } \|$ , quantization $\left[ \left[ 2 1 \right] \right]$ , knowledge distillation $\pm \pmb { \left[ \sqrt { 2 4 } \right] }$ , and
79
+ 59 efficient design [27, 25, 47, 41]. Here we focus on a small, unorganized sub-field of compression,
80
+ 60 that optimizes mathematical operations in the network. This approach can be combined successfully
81
+ 61 with common other compression methods like quantization [44].
82
+
83
+ The most natural approach is low bit quantization $\pmb { \left[ \left[ 2 1 \right] \right] }$ . The inference gains improves with lowering bit size, at the cost of accuracy drop and longer training. In the extreme case of binary networks, operations have negligible cost at inference but exhibits a considerable accuracy drop $\dot { \left\| 2 6 \right\| }$ .
84
+
85
+ 65 Knowledge distillation $[ [ 2 4 ]$ consists of transferring information form a larger teacher network to a
86
+ 66 smaller student network. The idea is easily extended by thinking of information transfer between
87
+ 67 different similarity measures, which $\textcircled { \lVert { 4 4 } \rVert }$ explore in the context of AdderNets. Knowledge distillation
88
+ 68 is an uncommon training procedure and requires extra implementation effort. EuclidNet keeps the
89
+ 69 accuracy without knowledge distillation. We suggest a straightforward training using a smooth
90
+ 70 transition between common convlotution and Euclid operation.
91
+
92
+ # 71 3 Network architecture and similarity operators
93
+
94
+ 72 Consider an intermediate layer of a neural network with input $\boldsymbol { x } ~ \in ~ \mathbb { R } ^ { H \times W \times { c _ { \mathrm { i n } } } }$ and output
95
+ 73 $\begin{array} { r c l } { y } & { \in } & { \mathbb { R } ^ { H \times W \times { c _ { \mathrm { o u t } } } } } \end{array}$ where $H , W$ 2 are the dimensions of the input feature, and $c _ { \mathrm { i n } } , c _ { \mathrm { o u t } }$ the num
96
+ 74 ber of input and output channels, respectively. For a standard convolutional network, represent the
97
+ 75 transformation from input to output via weights $w ~ \in ~ \mathbb { R } ^ { d \times d \times c _ { \mathrm { i n } } \times c _ { \mathrm { o u t } } }$ as
98
+
99
+ $$
100
+ y _ { m n l } = \sum _ { i = m } ^ { m + d } \sum _ { j = n } ^ { r + d } \sum _ { k = 0 } ^ { c _ { \mathrm { i n } } } x _ { i j k } w _ { i j k l }
101
+ $$
102
+
103
+ Setting $d = 1$ recovers the fully-connected layer. We can abstract the multiplication of the weights $w _ { i j k l }$ by $x _ { i j k l }$ in the equation above by using a similarity measure $S : \mathbb { R } \times \mathbb { R } \to \mathbb { R }$ . The convolutional layer corresponds to
104
+
105
+ $$
106
+ S _ { \mathrm { c o n v } } ( x , w ) = x w .
107
+ $$
108
+
109
+ 76 In our work, we replace $S _ { \mathrm { c o n v } }$ with $S _ { \mathrm { e u c l i d } }$ , given by $( 1 )$ . A number of works have also replaced the
110
+ 77 multiplication operator in a neural network. The most relevant work is the AdderNet of $\blacktriangleleft$ , which
111
+ 78 instead uses
112
+
113
+ $$
114
+ S _ { \mathrm { a d d e r } } ( x , w ) = - | x - w | .
115
+ $$
116
+
117
+ 79 replacing multiplication by the absolute value of the difference. This operation can be implemented
118
+ 80 very efficiently on a custom chipset: subtraction and absolute value of a different of $n$ -bit integers
119
+ 81 cost order $n$ gate operations, compared to order $n ^ { 2 }$ for multiplication $S _ { \mathrm { c o n v } } ( x , w ) = x w$ . However,
120
+ 82 AdderNet comes with a significant loss in accuracy, and is difficult to train.
121
+
122
+ # 83 3.1 Other Measures of similarity in neural network architectures
123
+
124
+ 84 The idea of replacing multiplication operations to save resources within the context of neural networks
125
+ 85 dates back to 1990s. Equally motivated by computational speed-up and hardware requirement
126
+ 86 minimization, $\mathbb { \ m }$ define perceptrons that use the synapse similarity,
127
+
128
+ $$
129
+ S _ { \mathrm { s y n a p s e } } ( x , w ) = \operatorname { s i g n } ( x ) \cdot \operatorname { s i g n } ( w ) \cdot \operatorname { m i n } ( | x | , | w | ) ,
130
+ $$
131
+
132
+ 87 which is cheaper than multiplication.
133
+
134
+ 88 Although $( 4 )$ has not been experimented with in modern models and datasets, $\pmb { \Vert 2 \Vert }$ introduced a slight
135
+ 89 variation, the multiplication-free operator,
136
+
137
+ $$
138
+ S _ { \mathrm { m f o } } ( x , w ) = \operatorname { s i g n } ( x ) \cdot \operatorname { s i g n } ( w ) \cdot ( | x | + | w | ) ) .
139
+ $$
140
+
141
+ 90 Note that both $\textcircled{4}$ and $\textcircled{5}$ induce the $l _ { 1 }$ -norm. $[ \beta 2 ]$ explains that the updated design choice allows
142
+ 91 contributions from both operands $x$ and $w$ . $\mathbb { M }$ studies the similarity in image classification on
143
+ 92 CIFAR10. Other applications of $( 5 )$ include [4, 36].
144
+
145
+ [46] further combines this similarity with a bit-shift, and claims an improved accuracy with negligible added cost. However, the plotted results for AdderNet appear lower than those reported in [9].
146
+
147
+ 95 Another follow-up work uses knowledge distillation to further improve the accuracy of AdderNets
148
+ 96 [44].
149
+ 97 Instead of simply replacing the similarity on the summation, there is also the possibility to replace the
150
+ 98 full expression on $( { \dot { 2 } } )$ . [30, 31] approximate the activation of a given layer with an exponential term.
151
+ 99 Unfortunately, it only leads to speed-up in certain cases and, in particular, it does not improve CPU
152
+ 100 inference time. Reported accuracy on benchmark problems is also lower than the typical baseline.
153
+ 101 In a recent work, $\pmb { \Vert 3 4 \Vert }$ used three layer morphological neural networks for image classification.
154
+ 102 Morphological neural networks were introduced in 1990s by [15, 40] and use the notion of erosion
155
+ 103 and dilation to replace $\textcircled{2}$ :
156
+
157
+ $$
158
+ \begin{array} { r l } & { \mathrm { E r o s i o n } ( x , w ) = \underset { j } { \mathrm { m i n } } S ( x _ { j } , w _ { j } ) = \underset { j } { \mathrm { m i n } } ( x _ { j } - w _ { j } ) , } \\ & { \mathrm { D i l a t i o n } ( x , w ) = \underset { j } { \mathrm { m a x } } S ( x _ { j } , w _ { j } ) = \underset { j } { \mathrm { m a x } } ( x _ { j } + w _ { j } ) . } \end{array}
159
+ $$
160
+
161
+ 104 The authors propose two methods of stacking layers to expand networks, but admit the possibility of
162
+ 105 over-fitting and difficult training issues, casting doubt on scalability of the method.
163
+
164
+ # 4 Theoretical Results for EuclidNets
165
+
166
+ # 4.1 Expressivity of the EuclidNet network
167
+
168
+ Networks using the EuclidNet operation as just as expressive as those using multiplication, thanks to the polarization identity,
169
+
170
+ $$
171
+ S _ { \mathrm { c o n v } } ( x , w ) = S _ { \mathrm { e u c l i d } } ( x , w ) - S _ { \mathrm { e u c l i d } } ( x , 0 ) - S _ { \mathrm { e u c l i d } } ( 0 , w )
172
+ $$
173
+
174
+ which means that any multiplication operation can be expressed using only Euclid operation
175
+
176
+ # 111 4.2 Logic Gate Cost for EuclidNet compared to ConvNet (multipication)
177
+
178
+ 112 The above similarity may not come across immediately as an improved choice on the cost of
179
+ 113 convolutions. It requires personalized hardware to obtain gains in inference speed like the other
180
+ 114 similarities. For example, in a typical architecture, the cost of addition is very close to multiplication,
181
+ 115 and squaring is usually not considered distinctly from multiplication $\pmb { \mathbb { B } } \pmb { \mathbb { 0 } }$ Table III]. Hence, first we
182
+ 116 discuss what these gains are theoretically. As for training, unlike other competitors such as AdderNet
183
+ 117 that embodies a considerable slow training, we implement the Euclid similarity in a way that is only
184
+ 118 slightly slower than $S _ { \mathrm { c o n v } }$ .
185
+ 119 Here we provide a brief theoretical analysis of
186
+ 120 basic binary operations on custom hardware that
187
+ 121 is optimized for model inference. Assuming
188
+ 122 equal cost between AND, XOR and OR gates,
189
+ 123 we first compute the cost of gate-level integer
190
+ 124 operations, defined in Appendix A.1. See Fig
191
+ 125 ure 2
192
+ 126 The following formula gives the gate count of
193
+ 127 $n$ -bit operations:
194
+
195
+ $$
196
+ \begin{array} { r } { S _ { \mathrm { c o n v } } = 6 n ^ { 2 } - 8 n + 3 } \\ { S _ { \mathrm { e u c l i d } } = 3 n ^ { 2 } + n / 2 - 3 } \end{array}
197
+ $$
198
+
199
+ 128 (with a minor modification to the second for
200
+ 129 mula to $3 n ^ { 2 } + n / 2 - 3 / 2$ when $n$ is odd), refer
201
+ 130 to Table A.4.
202
+ 131 The hardware implementation of an $n$ -bit adder
203
+ 132 is implemented using one half-adder and $n - 1$
204
+ 133 full-adders. A half-adder circuit is made up of 1
205
+ 134 XOR gate and 1 AND gate, while the full-adder circuit requires 2 XOR gates, 2 AND gates and 1 OR
206
+ 135 gate. Therefore, the cost of an $n$ bit addition is $5 n - 3$ .
207
+ 136 There are $n ^ { 2 }$ AND gates for $n$ -bit element wise multiplications. A common architecture usually
208
+ 137 include $( n - 1 )$ $n$ -bit adders besides the $n ^ { 2 }$ AND gates. One $n$ -bit adders is composed of one
209
+ 138 half-adder and $n - 1$ full-adders. Hence the cost of multiplication is $6 n ^ { 2 } - 8 n + 3$ .
210
+ 139 In the case of squaring, there are less AND gates representing element-wise multiplication. We
211
+ 140 consider two different cases: i) if $n$ is even the cost of squaring is $3 n ^ { 2 } - { \frac { 9 } { 2 } } n$ ii) if $n$ is odd, the cost
212
+ 141 of squaring is $3 n ^ { 2 } - { \frac { 9 } { 2 } } n + { \frac { 3 } { 2 } }$ ,
213
+
214
+ ![](images/5a3fef00d1b9c5be4b1b764a616b202e83e2b4cadf0f0dc1ea7372d4c43ed1b5.jpg)
215
+ Figure 2: Comparison of the number of logic gates $y$ -axis) as a function of the number of bits $x$ -axis) EuclidNet compared with the standard ConvNet.
216
+
217
+ Table 2: Time (seconds) and maximum training batch-size that can fit in a signle GPU Tesla V100- SXM2-32GB, during ImageNet training. In parenthesis is the slowdown with respect to the $S _ { c o n v }$ baseline. We do not show times for AdderNet, which is much slower than both, because it is not implemented in CUDA
218
+
219
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Method</td><td colspan="2">Maximum Batch-size</td><td colspan="2">Time per step</td></tr><tr><td>power of 2</td><td>integer</td><td>Training</td><td>Testing</td></tr><tr><td rowspan="2">ResNet-18</td><td>Sconv</td><td>1024</td><td>1439</td><td>0.149</td><td>0.066</td></tr><tr><td>Seuclid</td><td>512</td><td>869 (1.7×)</td><td>0.157 (1.1×)</td><td>0.133 (2x)</td></tr><tr><td rowspan="2">ResNet-50</td><td>Sconv</td><td>256</td><td>371</td><td>0.182</td><td>0.145</td></tr><tr><td>Seuclid</td><td>128</td><td>248 (1.5×)</td><td>0.274 (1.5×)</td><td>0.160 (1.1×)</td></tr></table>
220
+
221
+ # 5 Training EuclidNets
222
+
223
+ 143 Training EuclidNets are much easier compared with other competitors such as AdderNets. This
224
+ 144 makes EuclidNet attractive for complex tasks such as image segmentation, and object detection
225
+ 145 where training compressed networks are challenging and causes large accuracy drop. However,
226
+ 146 EuclidNets are more expensive than AdderNets on floating points, but their quantization behavior
227
+ 147 unlike AdderNets resembles traditional convolution to a great extent. In another words EuclidNets
228
+ 148 are easiy to quantize.
229
+
230
+ 149 While training a network, it is more appropriate to use the identity
231
+
232
+ $$
233
+ S _ { \mathrm { e u c l i d } } ( x , w ) = - { \frac { x ^ { 2 } } { 2 } } - { \frac { w ^ { 2 } } { 2 } } + x w ,
234
+ $$
235
+
236
+ 150 and use this equation while training EuclidNets on GPUs which are optimized for inner product.
237
+ 151 Therefore training EuclidNets doesn’t require additional CUDA core $| \overline { { \mathsf { B } 5 } } | |$ implementation unlike
238
+ 152 AdderNets. The official implementation of AdderNet $\bigstar \bigstar$ reflects order of $2 0 \times$ slower training than
239
+ 153 the traditional convolution on Pytorch. This is specially problematic for large networks and complex
240
+ 154 tasks that even traditional convolution training takes few days or even weeks. EuclidNet training
241
+ 155 is $2 \times$ in the worst case and their implementation is natural in deep learning frameworks such as
242
+ 156 PyTorch and Tensorflow.
243
+ 157 A common method in training neural networks is fine-tuning, initializing with weights trained on
244
+ 158 different data but with a similar nature. Here, we introduce the idea of using a weight initialization
245
+ 159 from a model trained on a related similarity.
246
+ 160 Rather than training from scratch, we wish to fine-tune EuclidNet starting from accurate CNN weights.
247
+ 161 This is achieved by an “architecture homotopy" where we change hyperparameters to convert a regular
248
+ 162 convolution to an Euclid operation
249
+
250
+ $$
251
+ S ( x , w ; \lambda _ { k } ) = x w - \lambda _ { k } \frac { x ^ { 2 } + w ^ { 2 } } { 2 } , \qquad \mathrm { w i t h } \lambda _ { k } = \lambda _ { 0 } + \frac { 1 - \lambda _ { 0 } } { n } \cdot k ,
252
+ $$
253
+
254
+ 163 where $n$ is the total number of epochs and $0 < \lambda _ { 0 } < 1$ is the initial transition phase. Note that
255
+ 164 $S ( x , w , 0 ) = S _ { \mathrm { c o n v } } ( x , w )$ and $S ( x , w , 1 ) = S _ { \mathrm { e u c l i d } } ( x , w )$ and equation $\perp$ is the convex combination
256
+ 165 of the two similarities. One may interpret $\lambda _ { k }$ as a schedule for the homotopy parameter, similar to
257
+ 166 how a schedule is defined for the learning rate in training a deep network. We found that a linear
258
+ 167 schedule above is effective empirically.
259
+ 168 Transformations like $( 7 )$ are commonly used in scientific computing $\mathbb { \left[ 3 \right] }$ . The idea of using homotopy
260
+ 169 in training neural networks can be traced back to $\mathbb { [ \sum ] }$ . Recently, homotopy was used in deep learning
261
+ 170 in the context of activation functions $\mathbb { B } \mathbb { Z } \mathbb { B } \mathbb { B } \mathbb { B } \mathbb { B } \mathbb { B } \mathbb { I }$ , loss functions $\pmb { \mathbb { D } } \pmb { \mathbb { 0 } }$ , compression $\mathbb { \ m }$ and transfer
262
+ 171 learning $\textcircled { 6 }$ . Here, we use homotopy in the context of transforming network operations.
263
+ 172 Fine-tuning method in $( 7 )$ is inspired by continuation methods in partial differential equations.
264
+ 173 Assume $S$ is a solution for a differential equation with the initial condition $S ( x , 0 ) = S _ { 0 } ( x )$ . In
265
+ 174 certain situations, solving this differential equation for $S ( x , t )$ and then evaluating at $t = 1$ might be
266
+ 175 simpler than solving directly for $S _ { 1 }$ . One may think of this homotopy method as an evolving neural
267
+ 176 network over time. At time zero the neural network consists of regular convolutional layers, but at
268
+ 177 time one transforms to Euclidean layers.
269
+ 178 The homotopy method can be interpreted as a sort of of knowledge distillation. Whereas knowledge
270
+ 179 distillation methods tries to match a student network to a teacher network, the homotopy can be seen
271
+ 180 as a slow transformation from the teacher network into a student network. Figure $3$ shows a scheme
272
+ 181 of the idea. Curiously, problems that have been solved with homotopic approaches have also been
273
+ 182 tackled by knowledge distillation. For example, removing blocks or layers from a network [24, 10]
274
+ 183 along with transfer learning [45, 6].
275
+
276
+ ![](images/1600983d3146f89a0b6b0be5adecf7d4052aa226ed8ae2bda1fb2890bf327ac7.jpg)
277
+ Figure 3: Training schema of EuclidNet using Homotopy, i.e. transitioning from traditional convolution $S ( x , w ) = x w$ towards EuclidNet $\begin{array} { r } { S ( x , \overline { { w } } ) = - \frac { 1 } { 2 } | \overline { { x } } - w | ^ { 2 } } \end{array}$ through equation $\textcircled { 7 }$ .
278
+
279
+ # 6 Experiments
280
+
281
+ We consider try our proposed method on image classification task. Future work could be extended to other domains of application such as natural language and speech.
282
+
283
+ # 6.1 CIFAR10
284
+
285
+ First, we consider the CIFAR10 dataset, consisting of $3 2 \times 3 2$ RGB images with 10 possible classifications $\mathbb { \left| \left[ 2 9 \right] \right| }$ . We normalize and augment the dataset with random crop and random horizontal flip. We consider two ResNet models $\bar { \lVert 2 2 \rVert }$ , ResNet-20 and ResNet-32.
286
+
287
+ 191 We train EuclidNet using the optimizer from $\pmb { \Vert }$ , which we will refer to as AdderSGD, to evaluate
288
+ 192 EuclidNet under a similar setup. We use initial learning rate 0.1 with cosine decay, momentum 0.9
289
+ 193 and weight decay $5 \times 1 0 ^ { - 4 }$ . We follow $\pmb { \Vert \mathscr { Q } \Vert }$ in setting the learning-rate scaling parameter $\eta$ . However,
290
+ 194 we use a batch-size of 128 for memory reasons. For traditional convlution network, we use the same
291
+ 195 hyper-parameters with stochastic gradient descent optimizer.
292
+
293
+ In Table $3$ we provide the details of classification accuracy. We consider two different weight initialization for EuclidNets. First, we initialize randomly and second, we initialize from weights pre-trained on a convolutional network. The accuracy for EuclidNets is approximately the same as for a standard ResNet. We see that for CIFAR10 training from scratch achieves even a higher accuracy, while initializing with convolution network and using linear Homotopy training improves it even further.
294
+
295
+ 202 During training, EuclidNets are unstable, despite careful choice of the optimizer. In Figure 4
296
+ 203 we compare with training the corresponding convolutional network. Fine-tuning directly from
297
+ 204 convolutional weights is more stable than training from scratch as expected. However, accuracy is
298
+ 205 lower but the convergence is faster when we use homotopy training and the accuracy is improved.
299
+ 206 Pre-trained convolution weights are commonly available in the most of neural compression tasks, so
300
+ 207 initializing EuclidNets with pre-trained convolution is more natural and preferable.
301
+
302
+ Table 3: Results on CIFAR10. The initial learning rate is adjusted for non-random initialization.
303
+
304
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Similarity</td><td rowspan="2">Initialization</td><td rowspan="2">Homotopy</td><td rowspan="2">Epochs</td><td colspan="2">Top-1 accuracy</td></tr><tr><td>CIFAR10</td><td>CIFAR100</td></tr><tr><td rowspan="4">ResNet-20</td><td>Sconv</td><td>Random</td><td>None</td><td>400</td><td>92.97</td><td>69.29</td></tr><tr><td rowspan="3">Seuclid</td><td>Random</td><td>None</td><td>450</td><td>93.00</td><td>68.84</td></tr><tr><td>Conv</td><td>None</td><td>100</td><td>90.45</td><td>64.62</td></tr><tr><td></td><td>Linear</td><td>100</td><td>93.32</td><td>68.84</td></tr><tr><td rowspan="4">ResNet-32</td><td>Sconv</td><td>Random</td><td>None</td><td>400</td><td>93.93</td><td>71.07</td></tr><tr><td rowspan="3">Seuclid</td><td>Random</td><td>None</td><td>450</td><td>93.28</td><td>71.22</td></tr><tr><td>Conv</td><td>None</td><td>150</td><td>91.28</td><td>66.58</td></tr><tr><td></td><td>Linear</td><td>100</td><td>92.62</td><td>68.42</td></tr></table>
305
+
306
+ Table 4: Full precision results on ResNet-20 for CIFAR10 for different multiplication-free similarities.
307
+
308
+ <table><tr><td>Similarity</td><td>Sconv</td><td>Seuclid</td><td>Sadder</td><td>Smfo</td><td>Ssynapse</td></tr><tr><td>Accuracy</td><td>92.97</td><td>93.00</td><td>91.84</td><td>82.05</td><td>73.08</td></tr></table>
309
+
310
+ EuclidNets are not only faster to train compared with other competitors, but also stand superior in terms of accuracy. AdderNet performs slightly worse but is much slower to train. The accuracy is significantly lower for the synapse and the multiplication-free operator. In Table $^ 4$ we record top-1 accuracy obtained in which AdderNet results are borrowed from $[ \textcircled { 4 4 } ]$ , that use knowledge distillation to close the gap with the full precision but still falls short compared with EuclidNet.
311
+
312
+ Training a quantized $S _ { \mathrm { e u c l i d } }$ is very similar similar to convolution. This allows a wider use of such networks for lower resource devices. Quantization of the Euclid model to 8bits keeps accuracy drop within the range of one percent [43] similar to traditional convolution so they are like convolution when run on lower bits. Table 1 shows 8-bit quantization of EuclidNet where the accuracy drop remains negligible. Similar to traditional convolution, EuclidNets on CIFAR100 exhibit a larger accuracy drop compared to CIFAR10, probably due to the complexity of the classification problem.
313
+
314
+ ![](images/5136ec52cbdd940b128a0f6e874f525ea0a4431d1bc086662045a1d087dbed67.jpg)
315
+ Figure 4: Evolution of testing accuracy during training of ResNet-20 on CIFAR10, initialized with random weights, or initialized from convolution pre-trained network. Initializing from a pretrained convolution network speeds up the convergence. EuclidNet is harder to train compared with convolution network when both initialized from random weights.
316
+
317
+ # 6.2 ImageNet
318
+
319
+ Next, we consider EuclidNet classifier built on ImageNet, a more challenging task ImageNet [16]. We train our baseline with standard augmentations of random resized crop and horizontal flip and normalization. We consider ResNet-18 and ResNet-50 models. Hyper-parameters tuning follows Section 6.1.
320
+
321
+ 237 Table 5 shows top-1 and top-5 classification accuracies. The accuracy from while EuclidNet is trained
322
+ 238 from scratch is lower, showing the importance of homotopy training. We believe that the accuracy
323
+ 239 drop with no homotopy is the difficulty of tuning training hyper-parameters for a large dataset such as
324
+ 240 ImageNet. Even though hyper-parameters that achieve equivalent accuracy from random initialization
325
+ 241 exist, they are too difficult to find. It is much easier to use the existing hyperparameters of traditional
326
+ 242 convolution, and transfer the geometry through homotopy training.
327
+
328
+ Table 5: Full precision results on ImageNet. Best result for each model is in bold.
329
+
330
+ <table><tr><td>Model</td><td>Similarity</td><td>Initialization</td><td>Homotopy</td><td>Epochs</td><td>Top-1 Accuracy</td><td>Top-5 Accuracy</td></tr><tr><td rowspan="6">ResNet-18</td><td>Sconv</td><td>Random</td><td>None</td><td>90</td><td>69.56</td><td>89.09</td></tr><tr><td></td><td>Random</td><td>None None</td><td>90 90</td><td>64.93</td><td>86.46</td></tr><tr><td rowspan="4">Seuclid</td><td rowspan="4">Conv</td><td></td><td></td><td>68.52</td><td>88.79</td></tr><tr><td>Linear</td><td>10</td><td>65.36</td><td>86.71</td></tr><tr><td></td><td>60</td><td>69.21</td><td>89.13</td></tr><tr><td></td><td>90</td><td>69.69</td><td>89.38</td></tr><tr><td rowspan="6">ResNet-50</td><td>Sconv</td><td>Random Random</td><td>None</td><td>90</td><td>75.49</td><td>92.51</td></tr><tr><td rowspan="5">Seuclid</td><td></td><td>None</td><td>90</td><td>37.89</td><td>63.99</td></tr><tr><td>Conv</td><td>None</td><td>90</td><td>75.12</td><td>92.50</td></tr><tr><td rowspan="3"></td><td rowspan="3">Linear</td><td>10</td><td>70.66 74.93</td><td>90.10 92.52</td></tr><tr><td>60 90</td><td>75.64</td><td></td></tr><tr><td></td><td></td><td>92.86</td></tr></table>
331
+
332
+ # 243 7 Conclusion
333
+
334
+ 244 Euclid networks are obtained from typical neural models by replacing multiplication in convolutional
335
+ 245 layers by the Euclidean similarity. They are designed to be implemented on a custom designed low
336
+ 246 precision chipset, with the idea that subtraction and squaring can be implemented using approximately
337
+ 247 half the logic gates, compared to multiplication.
338
+
339
+ 8 While other efficient architectures can be difficult to train in low precision, EuclideNets are easily 49 trained in low precisions. EuclidNets can be initialized with weights trained on the correspondent 0 ConvNet to save training time, so on may regard them as a fine tuning convolutiuonal networks for a cheaper inference. The homotopy method further improves training in such scenarios and training 52 using this method sometimes surpass regular convolution accuracy. Future work may focus on 3 developing hardware that can realize the expected inference time losses and try similar experiments on down stream vision tasks like object detection and segmentation.
340
+
341
+ # 7.1 Limitations
342
+
343
+ While gate counts provide a fundamental method for assessing the cost of a chip, they are a crude estimate, and the real costs (in terms of power usage, inference time, and memory) of a chipset and architecture combination are much more complex to estimate. True final costs can require a hardware simulator or implementation. At the same time, the gate count provides a first approximation to the cost, and the fact that we can train and match accuracy in eight bit precision is promising.
344
+
345
+ # 7.2 Societal Impact
346
+
347
+ Deep Neural Network inference is costly in terms of power usage. If we can design and implement efficient architectures, this will reduce the societal cost of running these models on edge devices.
348
+
349
+ # References
350
+
351
+ 265 [1] Arman Afrasiyabi, Diaa Badawi, Baris Nasir, Ozan Yildi, Fatios T Yarman Vural, and A Enis Çetin.
352
+ 266 Non-euclidean vector product for neural networks. In 2018 IEEE International Conference on Acoustics,
353
+ 267 Speech and Signal Processing (ICASSP), pages 6862–6866. IEEE, 2018.
354
+ 268 [2] C. E. Akba¸s, A. Bozkurt, A. E. Çetin, R. Çetin-Atalay, and A. Üner. Multiplication-free neural networks.
355
+ 269 In 2015 23nd Signal Processing and Communications Applications Conference (SIU), pages 2416–2418,
356
+ 270 2015.
357
+ 271 [3] Eugene L Allgower and Kurt Georg. Introduction to numerical continuation methods. SIAM, 2003.
358
+
359
+ [4] Diaa Badawi, Ece Akhan, Ma’en Mallah, Ay¸segül Üner, Rengül Çetin-Atalay, and A Enis Çetin. Multiplication free neural network for cancer stem cell detection in h-and-e stained liver images. In Compressive Sensing VI: From Diverse Modalities to Big Data Analytics, volume 10211, page 102110C. International Society for Optics and Photonics, 2017. [5] Shumeet Baluja, David Marwood, Michele Covell, and Nick Johnston. No multiplication? no floating point? no problem! training networks for efficient inference. arXiv preprint arXiv:1809.09244, 2018. [6] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41–48, 2009.
360
+ [7] Hadjer Benmeziane, Kaoutar El Maghraoui, Hamza Ouarnoughi, Smail Niar, Martin Wistuba, and Naigang Wang. A comprehensive survey on hardware-aware neural architecture search. arXiv preprint arXiv:2101.09336, 2021. [8] Zhangjie Cao, Mingsheng Long, Jianmin Wang, and Philip S Yu. Hashnet: Deep learning to hash by continuation. In Proceedings of the IEEE international conference on computer vision, pages 5608–5617, 2017. [9] Hanting Chen, Yunhe Wang, Chunjing Xu, Boxin Shi, Chao Xu, Qi Tian, and Chang Xu. Addernet: Do we really need multiplications in deep learning? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1468–1477, 2020.
361
+ [10] Qipin Chen and Wenrui Hao. An efficient homotopy training algorithm for neural networks. 2019.
362
+ [11] Yu Cheng, Duo Wang, Pan Zhou, and Tao Zhang. A survey of model compression and acceleration for deep neural networks. arXiv preprint arXiv:1710.09282, 2017.
363
+ [12] Yu Cheng, Duo Wang, Pan Zhou, and Tao Zhang. Model compression and acceleration for deep neural networks: The principles, progress, and challenges. IEEE Signal Processing Magazine, 35(1):126–136, 2018.
364
+ [13] J Chow, L Udpa, and SS Udpa. Homotopy continuation methods for neural networks. In 1991., IEEE International Sympoisum on Circuits and Systems, pages 2483–2486. IEEE, 1991.
365
+ [14] Michele Covell, David Marwood, Shumeet Baluja, and Nick Johnston. Table-based neural units: Fully quantizing networks for multiply-free inference. arXiv preprint arXiv:1906.04798, 2019.
366
+ [15] Jennifer L Davidson and Gerhard X Ritter. Theory of morphological neural networks. In Digital Optical Computing II, volume 1215, pages 378–388. International Society for Optics and Photonics, 1990.
367
+ [16] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009.
368
+ [17] Radu Dogaru and Leon O Chua. The comparative synapse: A multiplication free approach to neurofuzzy classifiers. IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications, 46(11):1366–1371, 1999.
369
+ [18] Farnoush Farhadi, Vahid Nia, and Andrea Lodi. Activation adaptation in neural networks. In Proceedings of the 9th International Conference on Pattern Recognition Applications and Methods - Volume 1: ICPRAM,, pages 249–257. INSTICC, SciTePress, 2020.
370
+ [19] Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
371
+ [20] Caglar Gulcehre, Marcin Moczulski, Francesco Visin, and Yoshua Bengio. Mollifying networks. arXiv preprint arXiv:1608.04980, 2016.
372
+ [21] Yunhui Guo. A survey on methods and theories of quantized neural networks. arXiv preprint arXiv:1808.04752, 2018.
373
+ [22] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. corr abs/1512.03385 (2015), 2015.
374
+ [23] John L Hennessy and David A Patterson. Computer architecture: a quantitative approach. Elsevier, 2011.
375
+ [24] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
376
+ [25] Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
377
+ [26] Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. 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.
378
+ [27] Forrest N Iandola, Song Han, Matthew W Moskewicz, Khalid Ashraf, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with $5 0 \mathrm { x }$ fewer parameters and< 0.5 mb model size. arXiv preprint arXiv:1602.07360, 2016.
379
+ [28] Martin Kersner. Convolutional network without multiplication operation, Mar 2019.
380
+ [29] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
381
+ [30] Elena Limonova, Daniil Alfonso, Dmitry Nikolaev, and Vladimir V Arlazarov. Resnet-like architecture with low hardware requirements. arXiv preprint arXiv:2009.07190, 2020.
382
+ [31] Elena Limonova, Daniil Matveev, Dmitry Nikolaev, and Vladimir V Arlazarov. Bipolar morphological neural networks: convolution without multiplication. In Twelfth International Conference on Machine Vision (ICMV 2019), volume 11433, page 114333J. International Society for Optics and Photonics, 2020.
383
+ [32] Maen Mallah. Multiplication free neural networks. PhD thesis, Bilkent University, 2018.
384
+ [33] Hossein Mobahi. Training recurrent neural networks by diffusion. arXiv preprint arXiv:1601.04114, 2016.
385
+ [34] Ranjan Mondal, Sanchayan Santra, and Bhabatosh Chanda. Dense morphological network: An universal function approximator, 2019.
386
+ [35] NVIDIA, Péter Vingelmann, and Frank H.P. Fitzek. Cuda, release: 10.2.89, 2020.
387
+ [36] Hongyi Pan, Diaa Badawi, Xi Zhang, and Ahmet Enis Cetin. Additive neural network for forest fire detection. Signal, Image and Video Processing, pages 1–8, 2019.
388
+ [37] Harsh Nilesh Pathak and Randy Paffenroth. Parameter continuation methods for the optimization of deep neural networks. In 2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA), pages 1637–1643. IEEE, 2019.
389
+ [38] Mohammad Samragh Razlighi, Mohsen Imani, Farinaz Koushanfar, and Tajana Rosing. Looknn: Neural network with no multiplication. In Design, Automation & Test in Europe Conference & Exhibition (DATE), 2017, pages 1775–1780. IEEE, 2017.
390
+ [39] Russell Reed. Pruning algorithms-a survey. IEEE transactions on Neural Networks, 4(5):740–747, 1993.
391
+ [40] Gerhard X Ritter and Peter Sussner. An introduction to morphological neural networks. In Proceedings of 13th International Conference on Pattern Recognition, volume 4, pages 709–717. IEEE, 1996.
392
+ [41] Mingxing Tan and Quoc V Le. Efficientnet: Rethinking model scaling for convolutional neural networks. arXiv preprint arXiv:1905.11946, 2019.
393
+ [42] Carole-Jean Wu, David Brooks, Kevin Chen, Douglas Chen, Sy Choudhury, Marat Dukhan, Kim Hazelwood, Eldad Isaac, Yangqing Jia, Bill Jia, et al. Machine learning at facebook: Understanding inference at the edge. In 2019 IEEE International Symposium on High Performance Computer Architecture (HPCA), pages 331–344. IEEE, 2019.
394
+ [43] Hao Wu, Patrick Judd, Xiaojie Zhang, Mikhail Isaev, and Paulius Micikevicius. Integer quantization for deep learning inference: Principles and empirical evaluation, 2020.
395
+ [44] Yixing Xu, Chang Xu, Xinghao Chen, Wei Zhang, Chunjing Xu, and Yunhe Wang. Kernel based progressive distillation for adder neural networks. arXiv preprint arXiv:2009.13044, 2020.
396
+ [45] Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4133–4141, 2017.
397
+ [46] Haoran You, Xiaohan Chen, Yongan Zhang, Chaojian Li, Sicheng Li, Zihao Liu, Zhangyang Wang, and Yingyan Lin. Shiftaddnet: A hardware-inspired deep network. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
398
+
399
+ [47] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6848–6856, 2018.
400
+
401
+ # Checklist
402
+
403
+ 1. For all authors...
404
+
405
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
406
+ (b) Did you describe the limitations of your work? [Yes] , see subsection 7.1.
407
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] , see subsection 7.2.
408
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
409
+
410
+ 2. If you are including theoretical results...
411
+
412
+ (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]
413
+
414
+ 3. If you ran experiments...
415
+
416
+ (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]
417
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
418
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] . It was too costly to train multiple times, we just ran once.
419
+ (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] , but we gave standard training details in section 6.
420
+
421
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
422
+
423
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
424
+ (b) Did you mention the license of the assets? [N/A]
425
+ (c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
426
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
427
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
428
+
429
+ 5. If you used crowdsourcing or conducted research with human subjects...
430
+
431
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
432
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
433
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/rJxgknCcK7/rJxgknCcK7.md ADDED
@@ -0,0 +1,317 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FFJORD: FREE-FORM CONTINUOUS DYNAMICS FOR SCALABLE REVERSIBLE GENERATIVE MODELS
2
+
3
+ Will Grathwohl∗†‡ , Ricky T. Q. Chen∗†, Jesse Bettencourt†, Ilya Sutskever‡ , David Duvenaud†
4
+
5
+ # ABSTRACT
6
+
7
+ Reversible generative models map points from a simple distribution to a complex distribution through an easily invertible neural network. Likelihood-based training of these models requires restricting their architectures to allow cheap computation of Jacobian determinants. Alternatively, the Jacobian trace can be used if the transformation is specified by an ordinary differential equation. In this paper, we use Hutchinson’s trace estimator to give a scalable unbiased estimate of the logdensity. The result is a continuous-time invertible generative model with unbiased density estimation and one-pass sampling, while allowing unrestricted neural network architectures. We demonstrate our approach on high-dimensional density estimation, image generation, and variational inference, improving the state-ofthe-art among exact likelihood methods with efficient sampling.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Reversible generative models use cheaply invertible neural networks to transform samples from a fixed base distribution. Examples include NICE (Dinh et al., 2014), Real NVP (Dinh et al., 2017), and Glow (Kingma & Dhariwal, 2018). These models are easy to sample from, and can be trained by maximum likelihood using the change of variables formula. However, this requires placing awkward restrictions on their architectures, such as partitioning dimensions or using rank one weight matrices, in order to avoid an $\mathcal { O } ( D ^ { 3 } )$ cost determinant computation.
12
+
13
+ Recently, Chen et al. (2018) introduced continuous normalizing flows (CNF), defining the mapping from latent variables to data using ordinary differential equations (ODE). In their model, the likelihood can be computed using trace operations costing only $\mathcal { O } ( D ^ { 2 } )$ . This allows a more flexible, but still restricted, family of network architectures to be used.
14
+
15
+ Extending this work, we introduce an unbiased stochastic estimator of the likelihood that has $\mathcal { O } ( D )$ time cost, allowing completely unrestricted architectures. Furthermore, we have implemented GPU-based adaptive ODE solvers to train and evaluate these models on modern hardware. We call our approach Free-form Jacobian of
16
+
17
+ ![](images/a3ee11ba6739d7a93b9f3874d4b4484510a3bd876d2128620a72649eb1edf2e9.jpg)
18
+ Figure 1: FFJORD transforms a simple base distribution at $t _ { 0 }$ into the target distribution at $t _ { 1 }$ by integrating over learned continuous dynamics.
19
+
20
+ Reversible Dynamics (FFJORD). Figure 1 shows FFJORD smoothly transforming a Gaussian distribution into a multi-modal distribution.
21
+
22
+ # 2 BACKGROUND: GENERATIVE MODELS AND CHANGE OF VARIABLES
23
+
24
+ In contrast to directly parameterizing a normalized distribution (e.g. Oord et al. (2016); Germain et al. (2015)), the change of variables formula allows one to specify a complex normalized distribution $p _ { \mathbf { x } } ( \mathbf { x } )$ implicitly by warping a normalized base distribution $p _ { \mathbf { z } } ( \mathbf { z } )$ through an invertible function $f : \mathbb { R } ^ { D } \overset { \cdot } { } \mathbb { R } ^ { D }$ . Given a random variable $\mathbf { z } \sim p _ { \mathbf { z } } ( \mathbf { z } )$ the log density of ${ \bf x } = f ( { \bf z } )$ follows
25
+
26
+ $$
27
+ \log p _ { \mathbf { x } } ( \mathbf { x } ) = \log p _ { \mathbf { z } } ( \mathbf { z } ) - \log \operatorname* { d e t } \left| \frac { \partial f ( \mathbf { z } ) } { \partial \mathbf { z } } \right|
28
+ $$
29
+
30
+ where $\partial f ( \mathbf { z } ) / \partial \mathbf { z }$ is the Jacobian of $f$ . In general, computing the log determinant has a time cost of $\mathcal { O } ( D ^ { 3 } )$ . Much work has gone into developing restricted neural network architectures which make computing the Jacobian’s determinant more tractable. These approaches broadly fall into three categories:
31
+
32
+ Normalizing flows. By restricting the functional form of $f$ , various determinant identities can be exploited (Rezende & Mohamed, 2015; Berg et al., 2018). These models cannot be trained as generative models from data because they do not have a tractable inverse $f ^ { - 1 }$ . However, they are useful for specifying approximate posteriors for variational inference (Kingma & Welling, 2014).
33
+
34
+ Autoregressive transformations. By using an autoregressive model and specifying an ordering of the dimensions, the Jacobian of $f$ is enforced to be lower triangular (Kingma et al., 2016; Oliva et al., 2018). These models excel at density estimation for tabular datasets (Papamakarios et al., 2017), but require $D$ sequential evaluations of $f$ to invert, which is prohibitive when $D$ is large.
35
+
36
+ Partitioned transformations. Partitioning the dimensions and using affine transformations makes the determinant of the Jacobian cheap to compute, and the inverse $\breve { f } ^ { - 1 }$ computable with the same cost as $f$ (Dinh et al., 2014; 2017). This method allows the use of convolutional architectures, excelling at density estimation for image data (Dinh et al., 2017; Kingma & Dhariwal, 2018).
37
+
38
+ Throughout this work, we refer to reversible generative models as those which use the change of variables to transform a base distribution to the model distribution while maintaining both efficient density estimation and efficient sampling capabilities using a single pass of the model.
39
+
40
+ # 2.1 OTHER GENERATIVE MODELS
41
+
42
+ There exist several approaches to generative modeling approaches which do not use the change of variables equation for training. Generative adversarial networks (GANs) (Goodfellow et al., 2014) use large, unrestricted neural networks to transform samples from a fixed base distribution. Lacking a closed-form likelihood, an auxiliary discriminator model must be trained to estimate divergences or density ratios in order to provide a training signal. Autoregressive models (Germain et al., 2015; Oord et al., 2016) directly specify the joint distribution $p ( \mathbf { x } )$ as a sequence of explicit conditional distributions using the product rule. These models require at least $\mathcal { O } ( D )$ evaluations to sample from. Variational autoencoders (VAEs) (Kingma & Welling, 2014) use an unrestricted architecture to explicitly specify the conditional likelihood $p ( x | z )$ , but can only efficiently provide a stochastic lower bound on the marginal likelihood $p ( x )$ .
43
+
44
+ # 2.2 CONTINUOUS NORMALIZING FLOWS
45
+
46
+ Chen et al. (2018) define a generative model for data $\mathbf { x } \in \mathbb { R } ^ { D }$ similar to those based on (1), but replace the warping function with an integral of continuous-time dynamics. The generative process first samples from a base distribution ${ \bf z } _ { 0 } \sim p _ { z _ { 0 } } ( { \bf z } _ { 0 } )$ . Then, given an ODE whose dynamics are defined by the parametric function $\partial \mathbf { z } ( t ) / \partial t = f ( \mathbf { z } ( t ) , t ; \theta )$ , we solve the initial value problem with $\mathbf { z } ( t _ { 0 } ) = \dot { \mathbf { z } } _ { 0 }$ to obtain a data sample ${ \mathbf x } = { \mathbf z } ( t _ { 1 } )$ . These models are called Continous Normalizing Flows (CNF). The change in log-density under this model follows a second differential equation, called the instantaneous change of variables formula (Chen et al., 2018):
47
+
48
+ $$
49
+ \frac { \partial \log p ( { \bf z } ( t ) ) } { \partial t } = - \mathrm { T r } \left( \frac { \partial f } { \partial { \bf z } ( t ) } \right) .
50
+ $$
51
+
52
+ We can compute total change in log-density by integrating across time:
53
+
54
+ $$
55
+ \log p ( \mathbf { z } ( t _ { 1 } ) ) = \log p ( \mathbf { z } ( t _ { 0 } ) ) - \int _ { t _ { 0 } } ^ { t _ { 1 } } \operatorname { T r } \left( { \frac { \partial f } { \partial \mathbf { z } ( t ) } } \right) d t .
56
+ $$
57
+
58
+ <table><tr><td colspan="2">Method</td><td rowspan="2">Train on data</td><td rowspan="2">One-pass Sampling</td><td rowspan="2">Exact/Unbiased Log- likelihood</td><td rowspan="2">Free- form Jacobian</td></tr><tr><td colspan="2"></td></tr><tr><td rowspan="4"></td><td>Variational Autoencoders</td><td></td><td></td><td>X</td><td>√</td></tr><tr><td>Generative Adversarial Nets</td><td></td><td>√</td><td>×</td><td>√</td></tr><tr><td>Likelihood-based Autoregressive</td><td></td><td>×</td><td>√</td><td>×</td></tr><tr><td>Normalizing Flows</td><td>X</td><td>√</td><td></td><td>X</td></tr><tr><td rowspan="3">o auegg 2aaiber</td><td>Reverse-NF,MAF, TAN</td><td></td><td>X</td><td></td><td>X</td></tr><tr><td>NICE,Real NVP, Glow, Planar CNF</td><td></td><td>√</td><td></td><td>X</td></tr><tr><td>FFJORD</td><td></td><td>「</td><td></td><td></td></tr></table>
59
+
60
+ Given a datapoint x, we can compute both the point $\mathbf { z } _ { 0 }$ which generates $\mathbf { x }$ , as well as $\log p ( \mathbf { x } )$ under the model by solving the combined initial value problem:
61
+
62
+ which integrates the combined dynamics of $z ( t )$ and the log-density of the sample backwards in time from $t _ { 1 }$ to $t _ { 0 }$ . We can then compute $\log p ( \mathbf { x } )$ using the solution of (4) and adding $\log p _ { z _ { 0 } } ( { \bf z } _ { 0 } )$ . The existence and uniqueness of (4) require that $f$ and its first derivatives be Lipschitz continuous (Khalil, 2002), which can be satisfied in practice using neural networks with smooth Lipschitz activations, such as softplus or tanh.
63
+
64
+ # 2.2.1 BACKPROPAGATING THROUGH ODE SOLUTIONS WITH THE ADJOINT METHOD
65
+
66
+ CNFs are trained to maximize (3). This objective involves the solution to an initial value problem with dynamics parameterized by $\theta$ . For any scalar loss function which operates on the solution to an initial value problem
67
+
68
+ $$
69
+ L ( \mathbf { z } ( t _ { 1 } ) ) = L \left( \int _ { t _ { 0 } } ^ { t _ { 1 } } f ( \mathbf { z } ( t ) , t ; \theta ) d t \right)
70
+ $$
71
+
72
+ then Pontryagin (1962) shows that its derivative takes the form of another initial value problem
73
+
74
+ $$
75
+ \frac { d L } { d \theta } = - \int _ { t _ { 1 } } ^ { t _ { 0 } } \left( \frac { \partial L } { \partial \mathbf { z } ( t ) } \right) ^ { T } \frac { \partial f ( \mathbf { z } ( t ) , t ; \theta ) } { \partial \theta } d t .
76
+ $$
77
+
78
+ The quantity $- { \partial L } / { \partial { \bf z } ( t ) }$ is known as the adjoint state of the ODE. Chen et al. (2018) use a black-box ODE solver to compute ${ \bf z } ( t _ { 1 } )$ , and then a separate call to a solver to compute (6) with the initial value ${ \partial L } / { \partial { \bf z } ( t _ { 1 } ) }$ . This approach is a continuous-time analog to the backpropgation algorithm (Rumelhart et al., 1986; Andersson, 2013) and can be combined with gradient-based optimization to fit the parameters $\theta$ by maximum likelihood.
79
+
80
+ # 3 SCALABLE DENSITY EVALUATION WITH UNRESTRICTED ARCHITECTURES
81
+
82
+ Switching from discrete-time dynamics to continuous-time dynamics reduces the primary computational bottleneck of normalizing flows from $\mathcal { O } ( D ^ { 3 } )$ to $\mathcal { O } ( D ^ { 2 } )$ , at the cost of introducing a numerical ODE solver. This allows the use of more expressive architectures. For example, each layer of the original normalizing flows model of Rezende & Mohamed (2015) is a one-layer neural network with only a single hidden unit. In contrast, the instantaneous transformation used in planar continuous normalizing flows (Chen et al., 2018) is a one-layer neural network with many hidden units. In this section, we construct an unbiased estimate of the log-density with $\mathcal { O } ( D )$ cost, allowing completely unrestricted neural network architectures to be used.
83
+
84
+ # 3.1 UNBIASED LINEAR-TIME LOG-DENSITY ESTIMATION
85
+
86
+ In general, computing $\operatorname { T r } \left( { \partial f } / { \partial \mathbf { z } ( t ) } \right)$ exactly costs $\mathcal { O } ( D ^ { 2 } )$ , or approximately the same cost as $D$ evaluations of $f$ , since each entry of the diagonal of the Jacobian requires computing a separate derivative of $f$ (Griewank & Walther, 2008). However, there are two tricks that can help. First, vector-Jacobian products ${ \pmb v } ^ { T } \frac { \partial f } { \partial { \bf z } }$ can be computed for approximately the same cost as evaluating $f$ using reverse-mode automatic differentiation. Second, we can get an unbiased estimate of the trace of a matrix by taking a double product of that matrix with a noise vector:
87
+
88
+ $$
89
+ \operatorname { T r } ( A ) = \mathbb { E } _ { p ( \epsilon ) } [ \epsilon ^ { T } A \epsilon ] .
90
+ $$
91
+
92
+ The above equation holds for any $D$ -by- $D$ matrix $A$ and distribution $p ( \epsilon )$ over $D$ -dimensional vectors such that $\mathbb { E } [ \boldsymbol { \epsilon } ] = 0$ and $\mathrm { C o v } ( \epsilon ) = I$ . The Monte Carlo estimator derived from (7) is known as Hutchinson’s trace estimator (Hutchinson, 1989; Adams et al., 2018).
93
+
94
+ To keep the dynamics deterministic within each call to the ODE solver, we can use a fixed noise vector $\epsilon$ for the duration of each solve without introducing bias:
95
+
96
+ $$
97
+ \begin{array} { r l } & { \log p ( \mathbf { z } ( t _ { 1 } ) ) = \log p ( \mathbf { z } ( t _ { 0 } ) ) - \int _ { t _ { 0 } } ^ { t _ { 1 } } \operatorname { T r } \left( \frac { \partial f } { \partial \mathbf { z } ( t ) } \right) d t } \\ & { \qquad = \log p ( \mathbf { z } ( t _ { 0 } ) ) - \int _ { t _ { 0 } } ^ { t _ { 1 } } \mathbb { E } _ { p ( \epsilon ) } \left[ \epsilon ^ { T } \frac { \partial f } { \partial \mathbf { z } ( t ) } \epsilon \right] d t } \\ & { \qquad = \log p ( \mathbf { z } ( t _ { 0 } ) ) - \mathbb { E } _ { p ( \epsilon ) } \left[ \int _ { t _ { 0 } } ^ { t _ { 1 } } \epsilon ^ { T } \frac { \partial f } { \partial \mathbf { z } ( t ) } \epsilon d t \right] } \end{array}
98
+ $$
99
+
100
+ Typical choices of $p ( \epsilon )$ are a standard Gaussian or Rademacher distribution (Hutchinson, 1989).
101
+
102
+ # 3.1.1 REDUCING VARIANCE WITH BOTTLENECK CAPACITY
103
+
104
+ Often, there exist bottlenecks in the architecture of the dynamics network, i.e. hidden layers whose width $H$ is smaller than the dimensions of the input $D$ . In such cases, we can reduce the variance of Hutchinson’s estimator by using the cyclic property of trace. Since the variance of the estimator for $\operatorname { T r } ( A )$ grows asymptotic to $| | \bar { A | | } _ { F } ^ { 2 }$ (Hutchinson, 1989), we suspect that having fewer dimensions should help reduce variance. If we view the dynamics as a composition of two functions $f = g \circ h ( \mathbf { z } )$ then we observe
105
+
106
+ $$
107
+ \operatorname { T r } \underbrace { \left( { \frac { \partial f } { \partial \mathbf { z } } } \right) } _ { D \times D } = \operatorname { T r } \underbrace { \left( { \frac { \partial g } { \partial h } } { \frac { \partial h } { \partial \mathbf { z } } } \right) } _ { D \times D } = \operatorname { T r } \underbrace { \left( { \frac { \partial h } { \partial \mathbf { z } } } { \frac { \partial g } { \partial h } } \right) } _ { H \times H } = \mathbb { E } _ { p ( \epsilon ) } \left[ \epsilon ^ { T } { \frac { \partial h } { \partial \mathbf { z } } } { \frac { \partial g } { \partial h } } \epsilon \right] .
108
+ $$
109
+
110
+ When $f$ has multiple hidden layers, we choose $H$ to be the smallest dimension. This bottleneck trick can reduce the norm of the matrix which may also help reduce the variance of the trace estimator. As introducing a bottleneck limits our model capacity, we do not use this trick in our experiments. However this trick can reduce variance when a bottleneck is used, as shown in our ablation studies.
111
+
112
+ # 3.2 FFJORD: A CONTINUOUS-TIME REVERSIBLE GENERATIVE MODEL
113
+
114
+ Our complete method uses the dynamics defined in (2) and the efficient log-likelihood estimator of (8) to produce the first scalable and reversible generative model with an unconstrained Jacobian. We call this method Free-Form Jacobian of Reversible Dyanamics (FFJORD). Pseudo-code of our method is given in Algorithm 1, and Table 1 summarizes the capabilities of our model compared to other recent generative modeling approaches.
115
+
116
+ Assuming the cost of evaluating $f$ is on the order of $\mathcal { O } ( D H )$ where $D$ is the dimensionality of the data and $H$ is the size of the largest hidden layer in $f$ , then the cost of computing the likelihood in models with repeated use of invertible transformations (1) is $\mathcal { O } ( ( D H + \bar { D ^ { 3 } } ) L )$ where $L$ is the number of transformations used. For CNF, this reduces to ${ \mathcal O } ( ( D H + D ^ { 2 } ) \hat { L } )$ for CNFs, where $\hat { L }$ is the number of evaluations of $f$ used by the ODE solver. With FFJORD, this reduces further to $\mathcal { O } ( ( D H + D ) \hat { L } )$ .
117
+
118
+ <table><tr><td colspan="2">Algorithm1 Unbiased stochastic log-density estimation using the FFJORD model Require: dynamics fe,start time to,stop time t1,data samples x,data dimension D.</td></tr><tr><td>∈ ← sample_unit_variance(x.shape) function faug([zt, log pt],t):</td><td>&gt; Sample E outside of the integral &gt;Augment f with log-density dynamics.</td></tr><tr><td>ft←fo(z(t),t) Taf</td><td>Evaluate neural network</td></tr><tr><td>g←εT zlz(t)</td><td> Compute vector-Jacobian product with automatic differentiation</td></tr><tr><td>Tr= ge return [ft,-Tr]</td><td> Unbiased estimateof Tr() with eTOfe</td></tr><tr><td>end function [zo,△logp] ←odeint(faug,[x,0],to,t1)</td><td>&gt; Concatenate dynamics of state and log-density Solve theODE St fug([z(t),lgp(z(t)),t)t</td></tr></table>
119
+
120
+ # 4 EXPERIMENTS
121
+
122
+ We demonstrate FFJORD on a variety of density estimation tasks, and for approximate inference in variational autoencoders (Kingma & Welling, 2014). Experiments were conducted using a suite of GPU-based ODE-solvers and an implementation of the adjoint method for backpropagation1. In all experiments the RungeKutta 4(5) algorithm with the tableau from Shampine (1986) was used to solve the ODEs. We ensure tolerance is set low enough so numerical error is negligible; see Appendix C.
123
+
124
+ We used Hutchinson’s trace estimator (7) during training and the exact trace when reporting test results. This was done in all experiments except for our density estimation models trained on MNIST and CIFAR10 where computing the exact Jacobian trace was too expensive.
125
+
126
+ ![](images/ab8bf16b71e4f4d69d040ce6a540697db00a6b4a08e459f7fbc52bea5bcf8b06.jpg)
127
+ Figure 2: Comparison of trained Glow, planar CNF, and FFJORD models on 2-dimensional distributions, including multi-modal and discontinuous densities.
128
+
129
+ The dynamics of FFJORD are defined by a neural network $f$ which takes as input the current state $\mathbf { z } ( t ) \in \mathbb { R } ^ { D }$ and the current time $t \in \mathbb { R }$ . We experimented with several ways to incorporate $t$ as an input to $f$ , such as hyper-networks, but found that simply concatenating $t$ on to ${ \bf z } ( t )$ at the input to every layer worked well and was used in all of our experiments.
130
+
131
+ # 4.1 DENSITY ESTIMATION ON TOY 2D DATA
132
+
133
+ We first train on 2 dimensional data to visualize the model and the learned dynamics.2 In Figure 2, we show that by warping a simple isotropic Gaussian, FFJORD can fit both multi-modal and even discontinuous distributions. The number of evaluations of the ODE solver is roughly 70-100 on all datasets, so we compare against a Glow model with 100 discrete layers.
134
+
135
+ The learned distributions of both FFJORD and Glow can be seen in Figure 2. Interestingly, we find that Glow learns to stretch the unimodal base distribution into multiple modes but has trouble modeling the areas of low probability between disconnected regions. In contrast, FFJORD is capable of modeling disconnected modes and can also learn convincing approximations of discontinuous density functions (middle row in Figure 2). Since the main benefit of FFJORD is the ability to train with deeper dynamics networks, we also compare against planar CNF (Chen et al., 2018) which can
136
+
137
+ ![](images/fac29854af968af5e276b62f3dccd72d8cf66f74c5f18de98ca150c65f578941.jpg)
138
+ Figure 3: Samples and data from our image models. MNIST on left, CIFAR10 on right.
139
+
140
+ <table><tr><td></td><td>POWER</td><td>GAS</td><td>HEPMASS</td><td>MINIBOONE</td><td>BSDS300</td><td>MNIST</td><td>CIFAR10</td></tr><tr><td>Real NVP</td><td>-0.17</td><td>-8.33</td><td>18.71</td><td>13.55</td><td>-153.28</td><td>1.06*</td><td>3.49*</td></tr><tr><td>Glow</td><td>-0.17</td><td>-8.15</td><td>18.92</td><td>11.35</td><td>-155.07</td><td>1.05*</td><td>3.35*</td></tr><tr><td>FFJORD</td><td>-0.46</td><td>-8.59</td><td>14.92</td><td>10.43</td><td>-157.40</td><td>0.99* (1.05†)</td><td>3.40*</td></tr><tr><td>MADE</td><td>3.08</td><td>-3.56</td><td>20.98</td><td>15.59</td><td>-148.85</td><td>2.04</td><td>5.67</td></tr><tr><td>MAF</td><td>-0.24</td><td>-10.08</td><td>17.70</td><td>11.75</td><td>-155.69</td><td>1.89</td><td>4.31</td></tr><tr><td>TAN</td><td>-0.48</td><td>-11.19</td><td>15.12</td><td>11.01</td><td>-157.03</td><td>-</td><td>-</td></tr><tr><td>MAF-DDSF</td><td>-0.62</td><td>-11.96</td><td>15.09</td><td>8.86</td><td>-157.73</td><td>-</td><td>-</td></tr></table>
141
+
142
+ Table 2: Negative log-likehood on test data for density estimation models; lower is better. In nats for tabular data and bits/dim for MNIST and CIFAR10. \*Results use multi-scale convolutional architectures. †Results use a single flow with a convolutional encoder-decoder architecture.
143
+
144
+ be viewed as a single hidden layer network. Without the benefit of a flexible network, planar CNF is unable to model complex distributions.
145
+
146
+ # 4.2 DENSITY ESTIMATION ON REAL DATA
147
+
148
+ We perform density estimation on five tabular datasets preprocessed as in Papamakarios et al. (2017) and two image datasets; MNIST and CIFAR10. When reproducing Glow, we use the same configurations for Real NVP as Papamakarios et al. (2017) and add invertible fully connected layer between all coupling layers. On the tabular datasets, FFJORD performs the best out of reversible models by a wide margin but is outperformed by recent autoregressive models. Of those, FFJORD outperforms MAF (Papamakarios et al., 2017) on all but one dataset and manages to outperform TAN Oliva et al. (2018) on the MINIBOONE dataset. These models require $\mathcal { O } ( D )$ sequential computations to sample from while the best performing method, MAF-DDSF (Huang et al., 2018), cannot be sampled from without resorting to correlated or expensive sampling algorithms such as MCMC.
149
+
150
+ On MNIST we find that FFJORD can model the data as effectively as Glow and Real NVP using only a single flow defined by a single neural network. This is in contrast to Glow and Real NVP which must compose many flows to achieve similar performance. When we use multiple flows in a multiscale architecture (like those used by Glow and Real NVP) we obtain better performance on MNIST and comparable performance to Glow on CIFAR10. Notably, FFJORD is able to achieve this performance while using less than $2 \%$ as many parameters as Glow. We also note that Glow uses a learned base distribution whereas FFJORD and Real NVP use a fixed Gaussian. A summary of our results on density estimation can be found in Table 2 and samples can be seen in Figure 3. Full details on architectures used, our experimental procedure, and additional samples can be found in Appendix B.1.
151
+
152
+ In general, our approach is slower than competing methods, but we find the memory-efficiency of the adjoint method allows us to use much larger batch sizes than those methods. On the tabular datasets we used a batch sizes up to 10,000 and on the image datasets we used a batch size of 900.
153
+
154
+ # 4.3 VARIATIONAL AUTOENCODER
155
+
156
+ We compare FFJORD to other normalizing flows for use in variational inference. We train a VAE (Kingma & Welling, 2014) on four datasets using a FFJORD flow and compare to VAEs with no flow, Planar Flows (Rezende & Mohamed, 2015), Inverse Autoregressive Flow (IAF) (Kingma
157
+
158
+ <table><tr><td></td><td>MNIST</td><td>Omniglot</td><td>Frey Faces</td><td>Caltech Silhouettes</td></tr><tr><td>No Flow</td><td>86.55 ± .06</td><td>104.28 ± .39</td><td>4.53 ± .02</td><td>110.80 ± .46</td></tr><tr><td>Planar IAF</td><td>86.06 ± .31 84.20 ± .17</td><td>102.65 ± .42</td><td>4.40 ± .06</td><td>109.66 ± .42 111.58 ± .38</td></tr><tr><td></td><td></td><td>102.41 ± .04</td><td>4.47 ± .05</td><td></td></tr><tr><td>Sylvester</td><td>83.32 ± .06</td><td>99.00 ± .04</td><td>4.45 ± .04</td><td>104.62 ± .29</td></tr><tr><td>FFJORD</td><td>82.82 ± .01</td><td>98.33 ± .09</td><td>4.39 ± .01</td><td>104.03 ± .43</td></tr></table>
159
+
160
+ Table 3: Negative ELBO on test data for VAE models; lower is better. In nats for all datasets except Frey Faces which is presented in bits per dimension. Mean/stdev are estimated over 3 runs.
161
+
162
+ et al., 2016), and Sylvester normalizing flows (Berg et al., 2018). To provide a fair comparison, our encoder/decoder architectures and learning setup exactly mirror those of Berg et al. (2018).
163
+
164
+ In VAEs it is common for the encoder network to also output the parameters of the flow as a function of the input $\mathbf { x }$ . With FFJORD, we found this led to differential equations which were too difficult to integrate numerically. Instead, the encoder network outputs a low-rank update to a global weight matrix and an input-dependent bias vector. When used in recognition nets, neural network layers defining the dynamics inside FFJORD take the form
165
+
166
+ $$
167
+ \mathrm { l a y e r } ( h ; \mathbf { x } , W , b ) = \sigma \left( \left( \underbrace { W } _ { D _ { o u t } \times D _ { i n } } + \underbrace { \hat { U } ( \mathbf { x } ) } _ { D _ { o u t } \times k } \underbrace { \hat { V } ( \mathbf { x } ) } _ { D _ { i n } \times k } ^ { T } \right) h + \underbrace { b } _ { D _ { o u t } \times 1 } + \underbrace { \hat { b } ( \mathbf { x } ) } _ { D _ { o u t } \times 1 } \right)
168
+ $$
169
+
170
+ where $h$ is the input to the layer, $\sigma$ is an element-wise activation function, $D _ { i n }$ and $D _ { o u t }$ are the input and output dimension of this layer, and ${ \hat { U } } ( \mathbf { x } ) , { \hat { V } } ( \mathbf { x } ) , { \hat { b } } ( \mathbf { x } )$ are input-dependent parameters returned from an encoder network. A full description of the model architectures used and our experimental setup can be found in Appendix B.2.
171
+
172
+ On every dataset tested, FFJORD outperforms all other competing normalizing flows. A summary of our variational inference results can be found in Table 3.
173
+
174
+ # 5 ANALYSIS AND DISCUSSION
175
+
176
+ We performed a series of ablation experiments to gain a better understanding of the proposed model.
177
+
178
+ # 5.1 FASTER TRAINING WITH BOTTLENECK TRICK
179
+
180
+ We plotted the training losses on MNIST using an encoder-decoder architecture (see Appendix B.1 for details). Loss during training is plotted in Figure 4, where we use the trace estimator directly on the $D \times D$ Jacobian, or we use the bottleneck trick to reduce the dimension to $H \times H$ . Interestingly, we find that while the bottleneck trick (9) can lead to faster convergence when the trace is estimated using a Gaussian-distributed $\epsilon$ , we did not observe faster convergence when using a Rademacherdistributed $\epsilon$ .
181
+
182
+ ![](images/a5a4104a81a527db90fb5a4bf2e1e69de73b82219692f93512d6220935d9f7d7.jpg)
183
+ Figure 4: The variance of our model’s log-density estimator can be reduced using neural network architectures with a bottleneck layer, speeding up training.
184
+
185
+ # 5.2 NUMBER OF FUNCTION EVALUATIONS VS. DATA DIMENSION
186
+
187
+ The full computational cost of integrating the instantaneous change of variables (2) is $\mathcal { O } ( D H \widehat { L } )$ where $D$ is dimensionality of the data, $H$ is the size of the hidden state, and $\widehat { L }$ is the number of function evaluations (NFE) that the adaptive solver uses to integrate the ODE. In general, each evaluation of the model is $\mathcal { O } ( D H )$ and in practice, $H$ is typically chosen to be close to $D$ . Since the general form of the discrete change of variables equation (1) requires $\mathcal { O } ( D ^ { 3 } )$ -cost, one may wonder whether the number of evaluations $\widehat { L }$ depends on $D$ .
188
+
189
+ We train VAEs using FFJORD flows with increasing latent dimension $D$ . The NFE throughout training is shown in Figure 5. In all models, we find that the NFE increases throughout training, but converges to the same value, independent of $D$ . We conjecture that the number of evaluations is not dependent on the dimensionality of the data but the complexity of its distribution, or more specifically, how difficult it is to transform its density into the base distribution.
190
+
191
+ # 5.3 SINGLE-SCALE VS. MULTI-SCALE FFJORD
192
+
193
+ Crucial to the scalability of Real NVP and Glow is the multiscale architecture originally proposed in Dinh et al. (2017). We compare a single-scale encoder-decoder style FFJORD with a multiscale FFJORD on the MNIST dataset where both models have a comparable number of parameters and plot the total NFE–in both forward and backward passes–against the loss achieved in Figure 6. We find that while the single-scale model uses approximately one half as many function evaluations as the multiscale model, it is not able to achieve the same performance as the multiscale model.
194
+
195
+ ![](images/0062858e8272d5676ba867e22f6633ff8e78e21441e692e039bb10cf152dc6a7.jpg)
196
+ Figure 5: NFE used by the adaptive ODE solver is approximately independent of data-dimension. Lines are smoothed using a Gaussian filter.
197
+
198
+ ![](images/1cd2619e51c02801395209923fba96f688f591bcf13f63fef7f5450530a63d78.jpg)
199
+ Figure 6: For image data, a single FFJORD flow can achieve near performance to multi-scale architecture while using half the number of evaluations.
200
+
201
+ # 6 SCOPE AND LIMITATIONS
202
+
203
+ Number of function evaluations can be prohibitive. The number of function evaluations required to integrate the dynamics is not fixed ahead of time, and is a function of the data, model architecture, and model parameters. This number tends to grow as the models trains and can become prohibitively large, even when memory stays constant due to the adjoint method. Various forms of regularization such as weight decay and spectral normalization (Miyato et al., 2018) can be used to reduce the this quantity, but their use tends to hurt performance slightly.
204
+
205
+ Limitations of general-purpose ODE solvers. In theory, our model can approximate any differential equation (given mild assumptions based on existence and uniqueness of the solution), but in practice our reliance on general-purpose ODE solvers restricts us to non-stiff differential equations that can be efficiently solved. ODE solvers for stiff dynamics exist, but they evaluate $f$ many more times to achieve the same error. We find that a small amount of weight decay regularizes the ODE to be sufficiently non-stiff.
206
+
207
+ # 7 CONCLUSION
208
+
209
+ We have presented FFJORD, a reversible generative model for high-dimensional data which can compute exact log-likelihoods and can be sampled from efficiently. Our model uses continuoustime dynamics to produce a generative model which is parameterized by an unrestricted neural network. All required quantities for training and sampling can be computed using automatic differentiation, Hutchinson’s trace estimator, and black-box ODE solvers. Our model stands in contrast to other methods with similar properties which rely on restricted, hand-engineered neural network architectures. We demonstrated that this additional flexibility allows our approach to achieve on-par or improved performance on density estimation and variational inference.
210
+
211
+ We believe there is much room for further work exploring and improving this method. FFJORD is empirically slower to evaluate than other reversible models like Real NVP or Glow, so we are interested specifically in ways to reduce the number of function evaluations used by the ODE-solver without hurting predictive performance. Advancements like these will be crucial in scaling this method to even higher-dimensional datasets.
212
+
213
+ # 8 ACKNOWLEDGEMENTS
214
+
215
+ We thank Yulia Rubanova and Roger Grosse for helpful discussions.
216
+
217
+ # REFERENCES
218
+
219
+ R. P. Adams, J. Pennington, M. J. Johnson, J. Smith, Y. Ovadia, B. Patton, and J. Saunderson. Estimating the Spectral Density of Large Implicit Matrices. ArXiv e-prints, February 2018.
220
+
221
+ Joel Andersson. A general-purpose software framework for dynamic optimization. PhD thesis, 2013.
222
+
223
+ Rianne van den Berg, Leonard Hasenclever, Jakub M Tomczak, and Max Welling. Sylvester normalizing flows for variational inference. arXiv preprint arXiv:1803.05649, 2018.
224
+
225
+ Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. Neural ordinary differential equations. Advances in Neural Information Processing Systems, 2018.
226
+
227
+ Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: Non-linear independent components estimation. International Conference on Learning Representations Workshop, 2014.
228
+
229
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. International Conference on Learning Representations, 2017.
230
+
231
+ Mathieu Germain, Karol Gregor, Iain Murray, and Hugo Larochelle. Made: Masked autoencoder for distribution estimation. In International Conference on Machine Learning, pp. 881–889, 2015.
232
+
233
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
234
+
235
+ Andreas Griewank and Andrea Walther. Evaluating derivatives: principles and techniques of algorithmic differentiation, volume 105. Siam, 2008.
236
+
237
+ Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. International Conference on Machine Learning, 2018.
238
+
239
+ M.F. Hutchinson. A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. 18:1059–1076, 01 1989.
240
+
241
+ H.K. Khalil. Nonlinear Systems. Pearson Education. Prentice Hall, 2002.
242
+
243
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, 2015.
244
+
245
+ Diederik P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. Advances in Neural Information Processing Systems, 2018.
246
+
247
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. International Conference on Learning Representations, 2014.
248
+
249
+ Diederik P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in Neural Information Processing Systems, pp. 4743–4751, 2016.
250
+
251
+ Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. International Conference on Learning Representations, 2018.
252
+
253
+ Junier B Oliva, Avinava Dubey, Barnabas P ´ oczos, Jeff Schneider, and Eric P Xing. Transformation ´ autoregressive networks. International Conference on Machine Learning, 2018.
254
+
255
+ Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. International Conference on Machine Learning, 2016.
256
+
257
+ George Papamakarios, Iain Murray, and Theo Pavlakou. Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems, pp. 2338–2347, 2017.
258
+
259
+ Lev Semenovich Pontryagin. Mathematical theory of optimal processes. Routledge, 1962.
260
+
261
+ Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. International Conference on Machine Learning, 2015.
262
+
263
+ David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Nature, 323(6088):533, 1986.
264
+
265
+ Lawrence F Shampine. Some practical Runge-Kutta formulas. Mathematics of Computation, 46 (173):135–150, 1986.
266
+
267
+ # APPENDIX A QUALITATIVE SAMPLES
268
+
269
+ Samples from our FFJORD models trained on MNIST and CIFAR10 can be found in Figure 7.
270
+
271
+ ![](images/7069f2c96885024f26e2483d05fa76cd504e9adeaf9540d42653e6f44943d89f.jpg)
272
+ Figure 7: Samples and data from our image models. MNIST on left, CIFAR10 on right.
273
+
274
+ # APPENDIX B EXPERIMENTAL DETAILS AND ADDITIONAL RESULTS
275
+
276
+ # B.1 DENSITY ESTIMATION
277
+
278
+ On the tabular datasets we performed a grid-search over network architectures. We searched over models with 1, 2, 5, or 10 flows with 1, 2, 3, or 4 hidden layers per flow. Since each dataset has a different number of dimensions, we searched over hidden dimensions equal to 5, 10, or 20 times the data dimension (hidden dimension multiplier in Table 4). We tried both the tanh and softplus nonlinearities. The best performing models can be found in the Table 4.
279
+
280
+ On the image datasets we experimented with two different model architectures; a single flow with an encoder-decoder style architecture and a multiscale architecture composed of multiple flows.
281
+
282
+ While they were able to fit MNIST and obtain competitive performance, the encoder-decoder architectures were unable to fit more complicated image datasets such as CIFAR10 and Street View House Numbers. The architecture for MNIST which obtained the results in Table 2 was composed of four convolutional layers with $6 4 \to 6 4 \to 1 2 8 \to 1 2 8$ filters and down-sampling with strided convolutions by two every other layer. There are then four transpose-convolutional layers who’s filters mirror the first four layers and up-sample by two every other layer. The softplus activation function is used in every layer.
283
+
284
+ The multiscale architectures were inspired by those presented in Dinh et al. (2017). We compose multiple flows together interspersed with “squeeze” operations which down-sample the spatial resolution of the images and increase the number of channels. These operations are stacked into a “scale block” which contains $N$ flows, a squeeze, then $N$ flows. For MNIST we use 3 scale blocks and for CIFAR10 we use 4 scale blocks and let $N = 2$ for both datasets. Each flow is defined by 3 convolutional layers with 64 filters and a kernel size of 3. The softplus nonlinearity is used in all layers.
285
+
286
+ Both models were trained with the Adam optimizer (Kingma & Ba, 2015). We trained for 500 epochs with a learning rate of .001 which was decayed to .0001 after 250 epochs. Training took place on six GPUs and completed after approximately five days.
287
+
288
+ # B.2 VARIATIONAL AUTOENCODER
289
+
290
+ Our experimental procedure exactly mirrors that of Berg et al. (2018). We use the same 7-layer encoder and decoder, learning rate (.001), optimizer (Adam Kingma & Ba (2015)), batch size (100), and early stopping procedure (stop after 100 epochs of no validaiton improvment). The only difference was in the nomralizing flow used in the approximate posterior.
291
+
292
+ We performed a grid-search over neural network architectures for the dynamics of FFJORD. We searched over networks with 1 and 2 hidden layers and hidden dimension 512, 1024, and 2048. We used flows with 1, 2, or 5 steps and wight matrix updates of rank 1, 20, and 64. We use the softplus activation function for all datasets except for Caltech Silhouettes where we used tanh. The best performing models can be found in the Table 5. Models were trained on a single GPU and training took between four hours and three days depending on the dataset.
293
+
294
+ <table><tr><td>Dataset</td><td>nonlinearity</td><td>#layers</td><td>hidden dim multiplier</td><td># flow steps</td><td>batchsize</td></tr><tr><td>POWER</td><td>tanh</td><td>3</td><td>10</td><td>5</td><td>10000</td></tr><tr><td>GAS</td><td>tanh</td><td>3</td><td>20</td><td>5</td><td>1000</td></tr><tr><td>HEPMASS</td><td>softplus</td><td>2</td><td>10</td><td>10</td><td>10000</td></tr><tr><td>MINIBOONE</td><td>softplus</td><td>2</td><td>20</td><td>1</td><td>1000</td></tr><tr><td>BSDS300</td><td> softplus</td><td>3</td><td>20</td><td>2</td><td>10000</td></tr></table>
295
+
296
+ Table 4: Best performing model architectures for density estimation on tabular data with FFJORD.
297
+
298
+ Table 5: Best performing model architectures for VAEs with FFJORD.
299
+
300
+ <table><tr><td>Dataset</td><td>nonlinearity</td><td># layers</td><td>hidden dimension</td><td>#flow steps</td><td>rank</td></tr><tr><td>MNIST</td><td>softplus</td><td>2</td><td>1024</td><td>2</td><td>64</td></tr><tr><td>Omniglot</td><td>softplus</td><td>2</td><td>512</td><td>5</td><td>20</td></tr><tr><td>Frey Faces</td><td>softplus</td><td>2</td><td>512</td><td>2</td><td>20</td></tr><tr><td>Caltech</td><td>tanh</td><td>1</td><td>2048</td><td>1</td><td>20</td></tr></table>
301
+
302
+ B.3 STANDARD DEVIATIONS FOR TABULAR DENSITY ESTIMATION
303
+
304
+ <table><tr><td></td><td>POWER</td><td>GAS</td><td>HEPMASS</td><td>MINIBOONE</td><td>BSDS300</td></tr><tr><td>Real NVP</td><td>-0.17 ± 0.01</td><td>-8.33 ± 0.14</td><td>18.71 ± 0.02</td><td>13.55 ± 0.49</td><td>-153.28 ± 1.78</td></tr><tr><td>Glow</td><td>-0.17 ± 0.01</td><td>-8.15 ± 0.40</td><td>18.92 ± 0.08</td><td>11.35 ± 0.07</td><td>-155.07 ± 0.03</td></tr><tr><td>FFJORD</td><td>-0.46 ± 0.01</td><td>-8.59 ±0.12</td><td>14.92 ± 0.08</td><td>10.43 ± 0.04</td><td>-157.40 ± 0.19</td></tr><tr><td>MADE</td><td>3.08 ± 0.03</td><td>-3.56 ± 0.04</td><td>20.98 ± 0.02</td><td>15.59 ± 0.50</td><td>-148.85 ± 0.28</td></tr><tr><td>MAF</td><td>-0.24 ± 0.01</td><td>-10.08 ± 0.02</td><td>17.70 ± 0.02</td><td>11.75 ± 0.44</td><td>-155.69 ± 0.28</td></tr><tr><td>TAN</td><td>-0.48 ± 0.01</td><td>-11.19 ± 0.02</td><td>15.12 ± 0.02</td><td>11.01 ± 0.48</td><td>-157.03 ± 0.07</td></tr><tr><td>MAF-DDSF</td><td>-0.62 ± 0.01</td><td>-11.96 ± 0.33</td><td>15.09 ± 0.40</td><td>8.86 ± 0.15</td><td>-157.73 ± 0.04</td></tr></table>
305
+
306
+ Table 6: Negative log-likehood on test data for density estimation models. Means/stdev over 3 runs. Real NVP, MADE, MAF, TAN, and MAF-DDSF results on are taken from Huang et al. (2018). In reproducing Glow, we were able to get comparable results to the reported Real NVP by removing the invertible fully connected layers.
307
+
308
+ # APPENDIX C NUMERICAL ERROR FROM THE ODE SOLVER
309
+
310
+ ODE solvers are numerical integration methods so there is error inherent in their outputs. Adaptive solvers (like those used in all of our experiments) attempt to predict the errors that they accrue and modify their step-size to reduce their error below a user set tolerance. It is important to be aware of this error when we use these solvers for density estimation as the solver outputs the density that we report and compare with other methods. When tolerance is too low, we run into machine precision errors. Similarly when tolerance is too high, errors are large, our training objective becomes biased and we can run into divergent training dynamics.
311
+
312
+ Since a valid probability density function integrates to one, we take a model trained on Figure 1 and numerically find the area under the curve using Riemann sum and a very fine grid. We do this for a range of tolerance values and show the resulting error in Figure 8. We set both atol and rtol to the same tolerance.
313
+
314
+ ![](images/02e88a1805109d6d2399eee267e1694fbcf917ec7e51dd627a734ef15382389d.jpg)
315
+ Figure 8: Numerical integration shows that the density under the model does integrate to one given sufficiently low tolerance. Both log and non-log plots are shown.
316
+
317
+ The numerical error follows the same order as the tolerance, as expected. During training, we find that the error becomes non-negligible when using tolerance values higher than $\bar { 1 0 } ^ { - 5 }$ . For most of our experiments, we set tolerance to $1 0 ^ { - 5 }$ as that gives reasonable performance while requiring few number of evaluations. For the tabular experiments, we use atol $= 1 0 ^ { - 8 }$ and $\mathtt { r t o l } \mathtt { = } 1 0 ^ { - 6 }$ .
md/train/yWd42CWN3c/yWd42CWN3c.md ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Combining Recurrent, Convolutional, and Continuous-time Models with Linear State-Space Layers
2
+
3
+ Albert $\mathbf { G } \mathbf { u } ^ { \dagger }$ , Isys Johnson‡, Karan Goel†, Khaled Saab∗, Tri Dao†, Atri Rudra‡, Christopher Ré†
4
+
5
+ † Department of Computer Science, Stanford University ∗ Department of Electrical Engineering, Stanford University ‡ Department of Computer Science and Engineering, University at Buffalo, SUNY {albertgu,knrg,ksaab,trid}@stanford.edu, chrismre@cs.stanford.edu {isysjohn,atri}@buffalo.edu
6
+
7
+ # Abstract
8
+
9
+ Recurrent neural networks (RNNs), temporal convolutions, and neural differential equations (NDEs) are popular families of deep learning models for time-series data, each with unique strengths and tradeoffs in modeling power and computational efficiency. We introduce a simple sequence model inspired by control systems that generalizes these approaches while addressing their shortcomings. The Linear State-Space Layer (LSSL) maps a sequence $u \mapsto y$ by simply simulating a linear continuous-time state-space representation ${ \dot { x } } = A x + B u , y = C x + D u$ Theoretically, we show that LSSL models are closely related to the three aforementioned families of models and inherit their strengths. For example, they generalize convolutions to continuous-time, explain common RNN heuristics, and share features of NDEs such as time-scale adaptation. We then incorporate and generalize recent theory on continuous-time memorization to introduce a trainable subset of structured matrices $A$ that endow LSSLs with long-range memory. Empirically, stacking LSSL layers into a simple deep neural network obtains state-of-the-art results across time series benchmarks for long dependencies in sequential image classification, real-world healthcare regression tasks, and speech. On a difficult speech classification task with length-16000 sequences, LSSL outperforms prior approaches by 24 accuracy points, and even outperforms baselines that use handcrafted features on $1 0 0 \mathrm { x }$ shorter sequences.
10
+
11
+ # 1 Introduction
12
+
13
+ A longstanding challenge in machine learning is efficiently modeling sequential data longer than a few thousand time steps. The usual paradigms for designing sequence models involve recurrence (e.g. RNNs), convolutions (e.g. CNNs), or differential equations (e.g. NDEs), which each come with tradeoffs. For example, RNNs are a natural stateful model for sequential data that require only constant computation/storage per time step, but are slow to train and suffer from optimization difficulties (e.g., the "vanishing gradient problem" [39]), which empirically limits their ability to handle long sequences. CNNs encode local context and enjoy fast, parallelizable training, but are not sequential, resulting in more expensive inference and an inherent limitation on the context length. NDEs are a principled mathematical model that can theoretically address continuous-time problems and long-term dependencies [37], but are very inefficient.
14
+
15
+ Ideally, a model family would combine the strengths of these paradigms, providing properties like parallelizable training (convolutional), stateful inference (recurrence) and time-scale adaptation (differential equations), while handling very long sequences in a computationally efficient way. Several recent works have turned to this question. These include the CKConv, which models a continuous convolution kernel [44]; several ODE-inspired RNNs, such as the UnICORNN [47]; the LMU, which speeds up a specific linear recurrence using convolutions [12, 58]; and HiPPO [24], a generalization of the LMU that introduces a theoretical framework for continuous-time memorization. However, these model families come at the price of reduced expressivity: intuitively, a family that is both convolutional and recurrent should be more restrictive than either.
16
+
17
+ ![](images/ea61b96555207397a42570dc9e353cb2fe433bafb6a857f9f99af2dbe77cad26.jpg)
18
+ Figure 1: (Three views of the LSSL) A Linear State Space Layer layer is a map $u _ { t } \ \in \ \mathbb { R } \ \to \ y _ { t } \ \in \ \mathbb { R }$ , where each feature $u _ { t } \mapsto y _ { t }$ is defined by discretizing a state-space model $A , B , C , D$ with a parameter $\Delta t$ The underlying state space model defines a discrete recurrence through combining the state matrix $A$ and timescale $\Delta t$ into a transition matrix $\overline { { A } }$ . (Left) As an implicit continuous model, irregularly-spaced data can be handled by discretizing the same matrix $A$ using a different timescale $\Delta t$ . (Center) As a recurrent model, inference can be performed efficiently by computing the layer timewise (i.e., one vertical slice at a time $( u _ { t } , x _ { t } , y _ { t } ) , ( u _ { t + 1 } , x _ { t + 1 } , y _ { t + 1 } ) , \dots )$ , by unrolling the linear recurrence. (Right) As a convolutional model, training can be performed efficiently by computing the layer depthwise in parallel (i.e., one horizontal slice at a time $( u _ { t } ) _ { t \in [ L ] } , ( y _ { t } ) _ { t \in [ L ] } , \dots . )$ , by convolving with a particular filter.
19
+
20
+ Our first goal is to construct an expressive model family that combines all 3 paradigms while preserving their strengths. The Linear State-Space Layer (LSSL) is a simple sequence model that maps a 1-dimensional function or sequence $u ( t ) \mapsto y ( t )$ through an implicit state $x ( t )$ by simulating a linear continuous-time state-space representation in discrete-time
21
+
22
+ $$
23
+ \begin{array} { l } { \dot { \boldsymbol { x } } ( t ) = \boldsymbol { A } \boldsymbol { x } ( t ) + \boldsymbol { B } \boldsymbol { u } ( t ) } \\ { \boldsymbol { y } ( t ) = \boldsymbol { C } \boldsymbol { x } ( t ) + \boldsymbol { D } \boldsymbol { u } ( t ) , } \end{array}
24
+ $$
25
+
26
+ where $A$ controls the evolution of the system and $B , C , D$ are projection parameters. The LSSL can be viewed as an instantiation of each family, inheriting their strengths (Fig. 1):
27
+
28
+ • LSSLs are recurrent. If a discrete step-size $\Delta t$ is specified, the LSSL can be discretized into a linear recurrence using standard techniques, and simulated during inference as a stateful recurrent model with constant memory and computation per time step. • LSSLs are convolutional. The linear time-invariant systems defined by $( 1 ) + ( 2 )$ are known to be explicitly representable as a continuous convolution. Moreover, the discrete-time version can be parallelized during training using convolutions [12, 44]. • LSSLs are continuous-time. The LSSL itself is a differential equation. As such, it can perform unique applications of continuous-time models, such as simulating continuous processes, handling missing data [45], and adapting to different timescales.
29
+
30
+ Surprisingly, we show that LSSLs do not sacrifice expressivity, and in fact generalize convolutions and RNNs. First, classical results from control theory imply that all 1-D convolutional kernels can be approximated by an LSSL [59]. Additionally, we provide two results relating RNNs and ODEs that may be of broader interest, e.g. showing that some RNN architectural heuristics (such as gating mechanisms) are related to the step-size $\Delta t$ and can actually be derived from ODE approximations. As corollaries of these results, we show that popular RNN methods are special cases of LSSLs.
31
+
32
+ The generality of LSSLs does come with tradeoffs. In particular, we describe and address two challenges that naive LSSL instantiations face when handling long sequences: (i) they inherit the limitations of both RNNs and CNNs at remembering long dependencies, and (ii) choosing the state matrix $A$ and timescale $\Delta t$ appropriately are critical to their performance, yet learning them is computationally infeasible. We simultaneously address these challenges by specializing LSSLs using a carefully chosen class of structured matrices $A$ , such that (i) these matrices generalize prior work on continuous-time memory [24] and mathematically capture long dependencies with respect to a learnable family of measures, and (ii) with new algorithms, LSSLs with these matrices $A$ can be theoretically sped up under certain computation models, even while learning the measure $A$ and timescale $\Delta t$ .
33
+
34
+ We empirically validate that LSSLs are widely effective on benchmark datasets and very long time series from healthcare sensor data, images, and speech.
35
+
36
+ • On benchmark datasets, LSSLs obtain SoTA over recent RNN, CNN, and NDE-based methods across sequential image classification tasks (e.g., by over $10 \%$ accuracy on sequential CIFAR) and healthcare regression tasks with length-4000 time series (by up to $80 \%$ reduction in RMSE). • To showcase the potential of LSSLs to unlock applications with extremely long sequences, we introduce a new sequential CelebA classification task with length-38000 sequences. A small LSSL comes within 2.16 accuracy points of a specialized ResNet-18 vision architecture that has $1 0 \mathrm { x }$ more parameters and is trained directly on images. • Finally, we test LSSLs on a difficult dataset of high-resolution speech clips, where usual speech pipelines pre-process the signals to reduce the length by $1 0 0 \mathrm { x }$ . When training on the raw length16000 signals, the LSSL not only (i) outperforms previous methods by over 20 accuracy points in 1/5 the training time, but (ii) outperforms all baselines that use the pre-processed length-160 sequences, overcoming the limitations of hand-crafted feature engineering.
37
+
38
+ # Summary of Contributions
39
+
40
+ • We introduce Linear State-Space Layers (LSSLs), a simple sequence-to-sequence transformation that shares the modeling advantages of recurrent, convolutional, and continuous-time methods. Conversely, we show that RNNs and CNNs can be seen as special cases of LSSLs (Section 3).
41
+
42
+ • We prove that a structured subclass of LSSLs can learn representations that solve continuous-time memorization, allowing it to adapt its measure and timescale (Section 4.1). We also provide new algorithms for these LSSLs, showing that they can be sped up computationally under an arithmetic complexity model Section 4.2.
43
+
44
+ • Empirically, we show that LSSLs stacked into a deep neural network are widely effective on time series data, even (or especially) on extremely long sequences (Section 5).
45
+
46
+ # 2 Technical Background
47
+
48
+ We summarize the preliminaries on differential equations that are necessary for this work. We first introduce two standard approximation schemes for differential equations that we will use to convert continuous-time models to discrete-time, and will be used in our results on understanding RNNs. We give further context on the step size or timescale $\Delta t$ , which is a particularly important parameter involved in this approximation process. Finally, we provide a summary of the HiPPO framework for continuous-time memorization [24], which will give us a mathematical tool for constructing LSSLs that can address long-term dependencies.
49
+
50
+ Approximations of differential equations. Any differential equation ${ \dot { x } } ( t ) = f ( t , x ( t ) )$ has an equivalent integral equation $\begin{array} { r } { x ( t ) = x ( t _ { 0 } ) + \int _ { t _ { 0 } } ^ { t } f ( s , x ( s ) ) d s } \end{array}$ . This can be numerically solved by storing some approximation for $x$ , and keeping it fixed inside $f ( t , x )$ while iterating the equation. For example, Picard iteration is often used to prove the existence of solutions to ODEs by iterating the equation $\begin{array} { r } { x _ { i + 1 } ( t ) : = x _ { i } ( t _ { 0 } ) + \int _ { t _ { 0 } } ^ { t } f ( s , x _ { i } ( s ) ) d s } \end{array}$ . In other words, it finds a sequence of functions $x _ { 0 } ( t ) , x _ { 1 } ( t ) , \ldots$ that approximate the solution $x ( t )$ of the integral equation.
51
+
52
+ Discretization. On the other hand, for a desired sequence of discrete times $t _ { i }$ , approximations to $x ( t _ { 0 } ) , x ( t _ { 1 } ) , \ldots$ can be found by iterating the equation $\begin{array} { r } { x ( t _ { i + 1 } ) = x ( t _ { i } ) + \int _ { t _ { i } } ^ { t _ { i + 1 } } f ( s , x ( s ) ) d s } \end{array}$ Different ways of approximating the RHS integral lead to different discretization schemes. We single out a discretization method called the generalized bilinear transform (GBT) which is specialized to linear ODEs of the form (1). Given a step size $\Delta t$ , the GBT update is
53
+
54
+ $$
55
+ x ( t + \Delta t ) = ( I - \alpha \Delta t \cdot A ) ^ { - 1 } ( I + ( 1 - \alpha ) \Delta t \cdot A ) x ( t ) + \Delta t ( I - \alpha \Delta t \cdot A ) ^ { - 1 } B \cdot u ( t ) .
56
+ $$
57
+
58
+ Three important cases are: $\alpha = 0$ becomes the classic Euler method which is simply the first-order approximation $x ( t + \Delta t ) = x ( t ) + \Delta t \cdot x ^ { \prime } ( t )$ ; $\alpha = 1$ is called the backward Euler method; and $\begin{array} { r } { \dot { \alpha } = \frac { 1 } { 2 } } \end{array}$ is called the bilinear method, which preserves the stability of the system [61].
59
+
60
+ In Section 3.2 we will show that the backward Euler method and Picard iteration are actually related to RNNs. On the other hand, the bilinear discretization will be our main method for computing accurate discrete-time approximations of our continuous-time models. In particular, define $\overline { { A } }$ and $\overline { B }$ to be the matrices appearing in (3) for $\begin{array} { r } { \alpha = \frac { 1 } { 2 } } \end{array}$ . Then the discrete-time state-space model is
61
+
62
+ $$
63
+ \begin{array} { l } { { x _ { t } = \overline { { A } } x _ { t - 1 } + \overline { { B } } u _ { t } } } \\ { { y _ { t } = C x _ { t } + D u _ { t } . } } \end{array}
64
+ $$
65
+
66
+ $\Delta t$ as a timescale. In most models, the length of dependencies they can capture is roughly proportional to $\frac { 1 } { \Delta t }$ . Thus we also refer to the step size $\Delta t$ as a timescale. This is an intrinsic part of converting a continuous-time ODE into a discrete-time recurrence, and most ODE-based RNN models have it as an important and non-trainable hyperparameter [24, 47, 58]. On the other hand, in Section 3.2 we show that the gating mechanism of classical RNNs is a version of learning $\Delta t$ . Moreover when viewed as a CNN, the timescale $\Delta t$ can be viewed as controlling the width of the convolution kernel (Section 3.2). Ideally, all ODE-based sequence models would be able to automatically learn the proper timescales.
67
+
68
+ Continuous-time memory. Consider an input function $u ( t )$ , a fixed probability measure $\omega ( t )$ , and a sequence of $N$ basis functions such as polynomials. At every time $t$ , the history of $u$ before time $t$ can be projected onto this basis, which yields a vector of coefficients $\boldsymbol { x } ( t ) \in \mathbb { R } ^ { \tilde { N } }$ that represents an optimal approximation of the history of $u$ with respect to the provided measure $\omega$ . The map taking the function $u ( t ) \in \mathbb { R }$ to coefficients $\boldsymbol { x } ( t ) \in \mathbb { R } ^ { N }$ is called the High-Order Polynomial Projection Operator (HiPPO) with respect to the measure $\omega$ . In special cases such as the uniform measure $\omega = \mathbb { I } \{ [ 0 , 1 ] \}$ and the exponentially-decaying measure $\omega ( t ) = \exp ( - t )$ , Gu et al. [24] showed that $x ( t )$ satisfies a differential equation ${ \dot { x } } ( t ) = A ( t ) x ( t ) + B ( t ) u ( t )$ (i.e., (1)) and derived closed forms for the matrix $A$ . Their framework provides a principled way to design memory models handling long dependencies; however, they prove only these few special cases.
69
+
70
+ # 3 Linear State-Space Layers (LSSL)
71
+
72
+ We define our main abstraction, a model family that generalizes recurrence and convolutions. Section 3.1 first formally defines the LSSL, then discusses how to compute it with multiple views. Conversely, Section 3.2 shows that LSSLs are related to mechanisms of the most popular RNNs.
73
+
74
+ # 3.1 Different Views of the LSSL
75
+
76
+ Given a fixed state space representation $A , B , C , D$ , an LSSL is the sequence-to-sequence mapping defined by discretizing the linear state-space model (1) and (2).
77
+
78
+ Concretely, an LSSL layer has parameters $A , B , C , D$ , and $\Delta t$ . It operates on an input $\boldsymbol { u } \in \mathbb { R } ^ { L \times H }$ represefeature equence of length defines a sequenc $L$ h timestep has an , which is combin $H$ -dimensional fea with a timescale vector. Eachto define an $h \in [ H ]$ $( u _ { t } ^ { ( h ) } ) _ { t \in [ L ] }$ $\Delta t _ { h }$ output $\boldsymbol { y } ^ { ( h ) } \in \mathbb { R } ^ { L }$ via the discretized state-space model (4)+(5).
79
+
80
+ Computationally, the discrete-time LSSL can be viewed in multiple ways (Fig. 1).
81
+
82
+ As a recurrence. The recurrent state $\boldsymbol { x } _ { t - 1 } \in \mathbb { R } ^ { H \times N }$ carries the context of all inputs before time $t$ The current state $x _ { t }$ and output $y _ { t }$ can be computed by simply following equations $( 4 ) + ( 5 )$ . Thus the LSSL is a recurrent model with efficient and stateful inference, which can consume a (potentially unbounded) sequence of inputs while requiring fixed computation/storage per time step.
83
+
84
+ As a convolution. For simplicity let the initial state be $x _ { - 1 } = 0$ . Then $( 4 ) + ( 5 )$ explicitly yields
85
+
86
+ $$
87
+ y _ { k } = C \left( \overline { { A } } \right) ^ { k } \overline { { B } } u _ { 0 } + C \left( \overline { { A } } \right) ^ { k - 1 } \overline { { B } } u _ { 1 } + \cdot \cdot \cdot + C \overline { { A } } \overline { { B } } u _ { k - 1 } + \overline { { B } } u _ { k } + D u _ { k } .
88
+ $$
89
+
90
+ Then $y$ is simply the (non-circular) convolution $y = \mathcal { K } _ { L } ( \overline { { A } } , \overline { { B } } , C ) \ast u + D u$ , where
91
+
92
+ $$
93
+ { \mathcal { K } } _ { L } ( A , B , C ) = \left( C A ^ { i } B \right) _ { i \in [ L ] } \in \mathbb { R } ^ { L } = ( C B , C A B , \ldots , C A ^ { L - 1 } B ) .
94
+ $$
95
+
96
+ Thus the LSSL can be viewed as a convolutional model where the entire output $y \in \mathbb { R } ^ { H \times L }$ can be computed at once by a convolution, which can be efficiently implemented with three FFTs.
97
+
98
+ The computational bottleneck. We make a note that the bottleneck of (i) the recurrence view is matrix-vector multiplication (MVM) by the discretized state matrix $\overline { { A } }$ when simulating (4), and (ii) the convolutional view is computing the Krylov function $\kappa _ { L }$ (7). Throughout this section we assumed the LSSL parameters were fixed, which means that $\overline { { A } }$ and $\mathcal { K } _ { L } ( A , B , C )$ can be cached for efficiency. However, learning the parameters $\overline { { A } }$ and $\Delta t$ would involve repeatedly re-computing these, which is infeasible in practice. We revisit and solve this problem in Section 4.2.
99
+
100
+ # 3.2 Expressivity of LSSLs
101
+
102
+ For a model to be both recurrent and convolutional, one might expect it to be limited in other ways. Indeed, while [12, 44] also observe that certain recurrences can be replaced with a convolution, they note that it is not obvious if convolutions can be replaced by recurrences. Moreover, while the LSSL is a linear recurrence, popular RNN models are nonlinear sequence models with activation functions between each time step. We now show that LSSLs surprisingly do not have limited expressivity.
103
+
104
+ Convolutions are LSSLs. A well-known fact about state-space systems $( 1 ) + ( 2 )$ is that the output $y$ is related to the input $u$ by a convolution $\begin{array} { r } { y ( t ) = \int h ( \tau ) u ( \bar { t } - \tau ) \dot { d } \tau } \end{array}$ with the impulse response $h$ of the system. Conversely, a convolutional filter $h$ that is a rational function of degree $N$ can be represented by a state-space model of size $N$ [59]. Thus, an arbitrary convolutional filter $h$ can be approximated by a rational function (e.g., by Padé approximants) and represented by an LSSL.
105
+
106
+ In the particular case of LSSLs with HiPPO matrices (Sections 2 and 4.1), there is another intuitive interpretation of how LSSL relate to convolutions. Consider the special case when $A$ corresponds to a uniform measure (in the literature known as the LMU [58] or HiPPO-LegT [24] matrix). Then for a fixed $d t$ , equation (1) is simply memorizing the input within sliding windows of $\frac { 1 } { \Delta t }$ elements, and equation (2) extracts features from this window. Thus the LSSL can be interpreted as automatically learning convolution filters with a learnable kernel width.
107
+
108
+ RNNs are LSSLs. We show two results about RNNs that may be of broader interest. Our first result says that the ubiquitous gating mechanism of RNNs, commonly perceived as a heuristic to smooth optimization [28], is actually the analog of a step size or timescale $\Delta t$ .
109
+
110
+ Lemma 3.1. A (1-D) gated recurrence $x _ { t } = ( 1 - \sigma ( z ) ) x _ { t - 1 } + \sigma ( z ) u _ { t }$ , where $\sigma$ is the sigmoid function and $z$ is an arbitrary expression, can be viewed as the $G B T ( \alpha = 1 ,$ ) (i.e., backwards-Euler) discretization of a 1-D linear ODE ${ \dot { x } } ( t ) = - x ( t ) + u ( t )$ .
111
+
112
+ Proof. Applying a discretization requires a positive step size $\Delta t$ . The simplest way to parameterize a positive function is via the exponential function $\Delta t = \exp ( z )$ applied to any expression $z$ . Substituting this into (3) with $A = - 1 , B = 1 , \alpha = 1$ exactly produces the gated recurrence. □
113
+
114
+ While Lemma 3.1 involves approximating continuous systems using discretization, the second result is about approximating them using Picard iteration (Section 2). Roughly speaking, each layer of a deep linear RNN can be viewed as successive Picard iterates $x _ { 0 } ( t ) , x _ { 1 } ( t ) , \ldots$ approximating a function $x ( t )$ defined by a non-linear ODE. This shows that we do not lose modeling power by using linear instead of non-linear recurrences, and that the nonlinearity can instead be “moved” to the depth direction of deep neural networks to improve speed without sacrificing expressivity.
115
+
116
+ Lemma 3.2. (Infinitely) deep stacked LSSL layers of order $N = 1$ with position-wise non-linear functions can approximate any non-linear ODE $\dot { x } ( t ) = - x + f ( t , x ( t ) )$ .
117
+
118
+ We note that many of the most popular and effective RNN variants such as the LSTM [28], GRU [14], QRNN [5], and SRU [33], involve a hidden state $\boldsymbol { x } _ { t } \in \mathbb { R } ^ { H }$ that involves independently “gating” the $H$ hidden units. Applying Lemma 3.1, they actually also approximate an ODE of the form in Lemma 3.2. Thus LSSLs and these popular RNN models can be seen to all approximate the same type of underlying continuous dynamics, by using Picard approximations in the depth direction and discretization (gates) in the time direction. Appendix C gives precise statements and proofs.
119
+
120
+ # 3.3 Deep LSSLs
121
+
122
+ The basic LSSL is defined as a sequence-to-sequence map from $\mathbb { R } ^ { L } \to \mathbb { R } ^ { L }$ on 1D sequences of length $L$ , parameterized by parameters $A \in \mathbb { R } ^ { \tilde { N } \times N } , B \in \hat { \mathbb { R } } ^ { N \times 1 } , C \in \mathbb { R } ^ { 1 \times N } , D \in \mathbb { R } ^ { 1 \times \hat { 1 } } , \Delta t \in \mathbb { R } .$ Given an input sequence with hidden dimension $H$ (in other words a feature dimension greater than 1), we simply broadcast the parameters $B , C , D , \Delta t$ with an extra dimension $H$ . Each of these $H$ copies is learned independently, so that there are $H$ different versions of a 1D LSSL processing each of the input features independently. Overall, the standalone LSSL layer is a sequence-to-sequence map with the same interface as standard sequence model layers such as RNNs, CNNs, and Transformers.
123
+
124
+ The full LSSL architecture in a deep neural network is defined similarly to standard sequence models such as deep ResNets and Transformers, involving stacking LSSL layers connected with normalization layers and residual connections. Full architecture details are described in Appendix B, including the initialization of $A$ and $\Delta t$ , computational details, and other architectural details.
125
+
126
+ # 4 Combining LSSLs with Continuous-time Memorization
127
+
128
+ In Section 3 we introduced the LSSL model and showed that it shares the strengths of convolutions and recurrences while also generalizing them. We now discuss and address its main limitations, in particular handling long dependencies (Section 4.1) and efficient computation (Section 4.2).
129
+
130
+ # 4.1 Incorporating Long Dependencies into LSSLs
131
+
132
+ The generality of LSSLs means they can inherit the issues of recurrences and convolutions at addressing long dependencies (Section 1). For example, viewed as a recurrence, repeated multiplication by $\overline { { A } }$ could suffer from the vanishing gradients problem [39, 44]. We confirm empirically that LSSLs with random state matrices $A$ are actually not effective (Section 5.4) as a generic sequence model.
133
+
134
+ However, one advantage of these mathematical continuous-time models is that they are theoretically analyzable, and specific $A$ matrices can be derived to address this issue. In particular, the HiPPO framework (Section 2) describes how to memorize a function in continuous time with respect to a measure $\omega$ [24]. This operator mapping a function to a continuous representation of its past is denoted hippo $( \omega )$ , and was shown to have the form of equation (1) in three special cases. However, these matrices are non-trainable in the sense that no other $A$ matrices were known to be hippo operators.
135
+
136
+ To address this, we theoretically resolve the open question from [24], showing that hippo $( \omega )$ for any measure $\omega ^ { \mathrm { ~ 1 ~ } }$ results in (1) with a structured matrix $A$ .
137
+
138
+ Theorem 1 (Informal). For an arbitrary measure $\omega$ , the optimal memorization operator hippo $( \omega )$ has the form ${ \dot { x } } ( t ) = A x ( t ) + B u ( t )$ (1) for $a$ low recurrence-width (LRW) [17] state matrix A.
139
+
140
+ For measures covering the classical orthogonal polynomials (OPs) [52] (in particular, corresponding to Jacobi and Laguerre polynomials), there is even more structure.
141
+
142
+ Corollary 4.1. For $\omega$ corresponding to the classical $O P s ,$ , hippo $( \omega )$ is 3-quasiseparable.
143
+
144
+ Although beyond the scope of this section, we mention that LRW matrices are a type of structured matrix that have linear MVM [17]. In Appendix $\mathrm { D }$ we define this class and prove Theorem 1. Quasi
145
+
146
+ separable matrices are a related class of structured matrices with additional algorithmic properties.
147
+ We define these matrices in Definition 4 and prove Corollary 4.1 in Appendix D.3.
148
+
149
+ Theorem 1 tells us that a LSSL that uses a state matrix $A$ within a particular class of structured matrices would carry the theoretical interpretation of continuous-time memorization. Ideally, we would be able to automatically learn the best $A$ within this class; however, this runs into computational challenges which we address next (Section 4.2). For now, we define the LSSL-fixed or LSSL-f to be one where the $A$ matrix is fixed to one of the HiPPO matrices prescribed by [24].
150
+
151
+ # 4.2 Theoretically Efficient Algorithms for the LSSL
152
+
153
+ Although $A$ and $\Delta t$ are the most critical parameters of an LSSL which govern the state-space (c.f. Section 4.1) and timescale (Sections 2 and 3.2), they are not feasible to train in a naive LSSL. In particular, Section 3.1 noted that it would require efficient matrix-vector multiplication (MVM) and Krylov function (7) for $\overline { { A } }$ to compute the recurrent and convolutional views, respectively. However, the former seems to involve a matrix inversion (3), while the latter seems to require powering $\overline { { A } }$ up $L$ times.
154
+
155
+ In this section, we show that the same restriction of $A$ to the class of quasiseparable (Corollary 4.1), which gives an LSSL the ability to theoretically remember long dependencies, simultaneously grants it computational efficiency.
156
+
157
+ First of all, it is known that quasiseparable matrices have efficient (linear-time) MVM [40]. We show that they also have fast Krylov functions, allowing efficient training with convolutions.
158
+
159
+ Theorem 2. For any $k$ -quasiseparable matrix $A$ (with constant $k$ ) and arbitrary $B , C _ { i }$ , the Krylov function $\mathcal { K } _ { L } ( A , B , C )$ can be computed in quasi-linear time and space $\tilde { O } ( N + L )$ and logarithmic depth (i.e., is parallelizable). The operation count is in an exact arithmetic model, not accounting for bit complexity or numerical stability.
160
+
161
+ We remark that Theorem 2 is non-obvious. To illustrate, it is easy to see that unrolling (7) for a general matrix $A$ takes time $L N ^ { 2 }$ . Even if $A$ is extremely structured with linear computation, it requires $L N$ operations and linear depth. The depth can be reduced with the squaring technique (batch multiply by ${ \bar { A } } , A ^ { 2 } , A ^ { 4 } , \ldots )$ , but this then requires $L N$ intermediate storage. In fact, the algorithm for Theorem 2 is quite sophisticated (Appendix E) and involves a divide-and-conquer recursion over matrices of polynomials, using the observation that (7) is related to the power series $C ( I - A x ) ^ { - 1 } B$ .
162
+
163
+ Unless specified otherwise, the full LSSL refers to an LSSL with $A$ satisfying Corollary 4.1. In conclusion, learning within this structured matrix family simultaneously endows LSSLs with longrange memory through Theorem 1 and is theoretically computationally feasible through Theorem 2. We note the caveat that Theorem 2 is over exact arithmetic and not floating point numbers, and thus is treated more as a proof of concept that LSSLs can be computationally efficient in theory. We comment more on the limitations of the LSSL in Section 6.
164
+
165
+ # 5 Empirical Evaluation
166
+
167
+ We test LSSLs empirically on a range of time series datasets with sequences from length 160 up to 38000 (Sections 5.1 and 5.2), where they substantially improve over prior work. We additionally validate the computational and modeling benefits of LSSLs from generalizing all three main model families (Section 5.3), and analyze the benefits of incorporating principled memory representations that can be learned (Section 5.4).
168
+
169
+ Baselines. Our tasks have extensive prior work and we evaluate against previously reported best results. We highlight our primary baselines, three very recent works explicitly designed for long sequences: CKConv (a continuous-time CNN) [44], UnICORNN (an ODE-inspired RNN) [47], and Neural Controlled/Rough Differential Equations (NCDE/NRDE) (a sophisticated NDE) [31, 37]. These are the only models we are aware of that have experimented with sequences of length ${ \mathrm { > } } 1 0 \mathrm { k }$ .
170
+
171
+ # 5.1 Image and Time Series Benchmarks
172
+
173
+ Table 1: (Pixel-by-pixel image classification.) (Top) our methods. (Middle) recurrent baselines. (Bottom) convolutional $^ +$ other baselines.
174
+
175
+ <table><tr><td>Model</td><td>sMNIST</td><td>pMNIST</td><td>sCIFAR</td></tr><tr><td>LSSL</td><td>99.53</td><td>98.76</td><td>84.65</td></tr><tr><td>LSSL-fixed</td><td>99.50</td><td>98.60</td><td>81.97</td></tr><tr><td>LipschitzRNN</td><td>99.4</td><td>96.3</td><td>64.2</td></tr><tr><td>LMUFFT[12]</td><td>-</td><td>98.49</td><td>-</td></tr><tr><td>UNIcoRNN [47]</td><td>=</td><td>98.4</td><td>1</td></tr><tr><td>HiPPO-RNN [24]</td><td>98.9</td><td>98.3</td><td>61.1</td></tr><tr><td>URGRU [25]</td><td>99.27</td><td>96.51</td><td>74.4</td></tr><tr><td>IndRNN [34]</td><td>99.0</td><td>96.0</td><td>1</td></tr><tr><td>Dilated RNN [8]</td><td>98.0</td><td>96.1</td><td>=</td></tr><tr><td>r-LSTM [56]</td><td>98.4</td><td>95.2</td><td>72.2</td></tr><tr><td>CKConv [44]</td><td>99.32</td><td>98.54</td><td>63.74</td></tr><tr><td>TrellisNet [4]</td><td>99.20</td><td>98.13</td><td>73.42</td></tr><tr><td>TCN [3]</td><td>99.0</td><td>97.2</td><td>1</td></tr><tr><td>Transformer [56]</td><td>98.9</td><td>97.9</td><td>62.2</td></tr></table>
176
+
177
+ Table 2: (Vital signs prediction.) RMSE for predicting respiratory rate (RR), heart rate (HR), and blood oxygen (SpO2). \* indicates our own runs to complete results for the strongest baselines.
178
+
179
+ <table><tr><td>Model</td><td>RR</td><td>HR</td><td>SpO2</td></tr><tr><td>LSSL</td><td>0.350</td><td>0.432</td><td>0.141</td></tr><tr><td>LSSL-fixed</td><td>0.378</td><td>0.561</td><td>0.221</td></tr><tr><td>UnICORNN [47]</td><td>1.06</td><td>1.39</td><td>0.869*</td></tr><tr><td>coRNN [47]</td><td>1.45</td><td>1.81</td><td>-</td></tr><tr><td>CKConv</td><td>1.214*</td><td>2.05*</td><td>1.051*</td></tr><tr><td>NRDE [37]</td><td>1.49</td><td>2.97</td><td>1.29</td></tr><tr><td>IndRNN [47]</td><td>1.47</td><td>2.1</td><td>-</td></tr><tr><td>expRNN [47]</td><td>1.57</td><td>1.87</td><td>-</td></tr><tr><td>LSTM</td><td>2.28</td><td>10.7</td><td>=</td></tr><tr><td>Transformer</td><td>2.61*</td><td>12.2*</td><td>3.02*</td></tr><tr><td>XGBoost [55]</td><td>1.67</td><td>4.72</td><td>1.52</td></tr><tr><td>Random Forest [55]</td><td>1.85</td><td>5.69</td><td>1.74</td></tr><tr><td>Ridge Regress. [55]</td><td>3.86</td><td>17.3</td><td>4.16</td></tr></table>
180
+
181
+ Table 3: (Sequential CelebA Classification.)
182
+
183
+ <table><tr><td colspan="2">LSSL-f ResNet</td></tr><tr><td>Att.</td><td>78.89 81.35</td></tr><tr><td>MSO 92.36</td><td>93.92</td></tr><tr><td>Smil.</td><td>90.95 92.89</td></tr><tr><td>WL</td><td>90.57 93.25</td></tr></table>
184
+
185
+ We test on the sequential MNIST, permuted MNIST, and sequential CIFAR tasks (Table 1), popular benchmarks which were originally designed to test the ability of recurrent models to capture long-term dependencies of length up to 1k [2]. LSSL sets SoTA on sCIFAR by more than 10 points. We note that all results were achieved with at least 5x fewer parameters than the previous SoTA (Appendix F).
186
+
187
+ We additionally use the BDIMC healthcare datasets (Table 2), a suite of widely studied time series regression problems of length 4000 on estimating vital signs. LSSL reduces RMSE by more than two-thirds on all datasets.
188
+
189
+ # 5.2 Speech and Image Classification for Very Long Time Series
190
+
191
+ Raw speech is challenging for ML models due to high-frequency sampling resulting in very long sequences. Traditional systems involve complex pipelines that require feeding mixed-and-matched hand-crafted features into DNNs [42]. Table 4 reports results for the Speech Commands (SC) dataset [31] for classification of 1-second audio clips. Few methods have made progress on the raw speech signal, instead requiring pre-processing with standard mel-frequency cepstrum coefficients (MFCC). By contrast, LSSL sets SoTA on this dataset while training on the raw signal. We note that MFCC extracts sliding window frequency coefficients and thus is related to the coefficients $x ( t )$ defined by LSSL-f (Section 2, Section 4.1, [24], Appendix D). Consequently, LSSL may be interpreted as automatically learning MFCC-type features in a trainable basis.
192
+
193
+ To stress-test the LSSL’s ability to handle extremely long sequences, we create a challenging new sequential-CelebA task, where we classify $1 7 8 \times 2 1 8$ images $\mathbf { \mu } = 3 8 0 0 0$ -length sequences for 4 facial attributes: Attractive (Att.), Mouth Slightly Open (MSO), Smiling (Smil.), Wearing Lipstick (WL) [36]. We chose the 4 most class-balanced attributes to avoid well-known problems with class imbalance. LSSL-f comes close to matching the performance of a specialized ResNet-18 image classification architecture that has $1 0 \times$ the parameters (Table 3). We emphasize we are the first to demonstrate that this is possible to do with a generic sequence model.
194
+
195
+ # 5.3 Advantages of Recurrent, Convolutional, and Continuous-time Models
196
+
197
+ We validate that the generality of LSSLs endows it with the strengths of all three families.
198
+
199
+ Convergence Speed. As a recurrent and NDE model that incorporates new theory for continuoustime memory (Section 4.1), the LSSL has strong inductive bias for sequential data, and converges rapidly to SoTA results on our benchmarks. With its convolutional view, training can be parallelized and it is also computationally efficient in practice. Table 5 compares the time it takes the LSSL-f to achieve SoTA, in either sample (measured by epochs) or computational (measured by wall clock) complexity. In all cases, LSSLs reached the target in a fraction of the time of the previous model.
200
+
201
+ Table 4: (Raw Speech Classification; Timescale Shift.) (Top): Raw signals (length 16000); $1 f$ indicates test-time change in sampling rate by a factor of $f$ . (Bottom): Pre-processed MFCC features used in prior work (length 161). $\pmb { \chi }$ denotes computationally infeasible.
202
+
203
+ <table><tr><td></td><td>LSSL</td><td>LSSL-f</td><td>CKConv</td><td>UnICORNN</td><td>N(C/R)DE</td><td>ODE-RNN [45]</td><td>GRU-ODE [16]</td></tr><tr><td>1→1</td><td>95.87</td><td>90.64</td><td>71.66</td><td>11.02</td><td>16.49</td><td>X</td><td>X</td></tr><tr><td>1</td><td>88.66</td><td>78.01</td><td>65.96</td><td>11.07</td><td>15.12</td><td>X</td><td>X</td></tr><tr><td>MFCC</td><td>93.58</td><td>92.55</td><td>95.3</td><td>90.64</td><td>89.8</td><td>65.9</td><td>47.9</td></tr></table>
204
+
205
+ Table 5: (Modeling and Computational Benefits of LSSLs.) In each benchmark category, we compare the number of epochs (ep.) it takes a LSSL-f to reach the previous SoTA (PSoTA) results as well as a near-SoTA target. We also report the wall clock time it took to reach PSoTA relative to the previous best model.
206
+
207
+ <table><tr><td></td><td colspan="3">Permuted MNIST</td><td colspan="3">BDIMC Heart Rate</td><td colspan="3">Speech Commands RAW</td></tr><tr><td></td><td>98% Acc.</td><td>PSoTA</td><td>Time</td><td>1.5 RMSE</td><td>PSoTA</td><td>Time</td><td>65% Acc.</td><td>PSoTA</td><td>Time</td></tr><tr><td>LSSL-fixed</td><td>16 ep.</td><td>104 ep.</td><td>0.19×</td><td>9ep.</td><td>10 ep.</td><td>0.07×</td><td>9ep.</td><td>10 ep.</td><td>0.14×</td></tr><tr><td>CKConv</td><td>118ep.</td><td>200ep.</td><td>1.0×</td><td>X</td><td>X</td><td>X</td><td>188 ep.</td><td>280ep.</td><td>1.0×</td></tr><tr><td>UnICORNN</td><td>75 ep.</td><td>×</td><td>×</td><td>116 ep.</td><td>467 ep.</td><td>1.0×</td><td>X</td><td>×</td><td>X</td></tr></table>
208
+
209
+ Timescale Adaptation. Table 4 also reports the results of continuous-time models that are able to handle unique settings such as missing data in time series, or test-time shift in timescale (we note that this is a realistic problem, e.g., when deployed healthcare models are tested on EEG signals that are sampled at a different rate [48, 49]). We note that many of these baselines were custom designed for such settings, which is of independent interest. On the other hand, LSSLs perform timescale adaptation by simply changing its $\Delta t$ values at inference time, while still outperforming the performance of prior methods with no shift. Additional results on the CharacterTrajectories dataset from prior work [31, 44] are in Appendix F, where LSSL is competitive with the best baselines.
210
+
211
+ # 5.4 LSSL Ablations: Learning the Memory Dynamics and Timescale
212
+
213
+ We demonstrate that the $\Delta t$ and $A$ parameters, which LSSLs are able to automatically learn in contrast to prior work, are indeed critical to the performance of these continuous-time models. We note that learning $\Delta t$ adds only $O ( H )$ parameters and learning $A$ adds $O ( N )$ parameters, adding less than $1 \%$ parameter count compared to the base models with $O ( H N )$ parameters.
214
+
215
+ Memory dynamics $A$ . We validate that vanilla LSSLs suffer from the modeling issues described in Section 4. We tested that LSSLs with random $A$ matrices (normalized appropriately) perform very poorly (e.g., $62 \%$ on pMNIST). Further, we note the consistent increase in performance from LSSL-f to LSSL despite the negligible parameter difference. These ablations show that (i) incorporating the theory of Theorem 1 is actually necessary for LSSLs, and (ii) further training the structured $A$ is additionally helpful, which can be interpreted as learning the measure for memorization (Section 4.1).
216
+
217
+ Timescale $\Delta t$ . Section 3.2 showed that LSSL’s ability to learn $\Delta t$ is its direct generalization of the critical gating mechanism of popular RNNs, which previous ODE-based RNN models [12, 24, 47, 58] cannot learn. We note that on sCIFAR, LSSL-f with poorly-specified $\Delta t$ gets only $4 9 . 3 \%$ accuracy. Additional results in Appendix F show that learning $\Delta t$ alone provides an orthogonal boost to learning $A$ , and visualizes the noticeable change in $\Delta t$ over the course of training.
218
+
219
+ # 6 Discussion
220
+
221
+ In this work we introduced a simple and principled model (LSSL) inspired by a fundamental representation of physical systems. We showed theoretically and empirically that it generalizes and inherits the strengths of the main families of modern time series models, that its main limitations of long-term memory can be resolved with new theory on continuous-time memorization, and that it is empirically effective on difficult tasks with very long sequences.
222
+
223
+ Related work. The LSSL is related to several rich lines of work on recurrent, convolutional, and continuous-time models, as well as sequence models addressing long dependencies. Appendix A provides an extended related work connecting these topics.
224
+
225
+ Tuning. Our models are very simple, consisting of identical L(inear)SSL layers with simple positionwise non-linear modules between layers (Appendix B). Our models were able to train at much higher learning rates than baselines and were not sensitive to hyperparameters, of which we did light tuning primarily on learning rate and dropout. In contrast to previous baselines [4, 31, 44], we did not use hyperparameters for improving stability and regularization such as weight decay, gradient clipping, weight norm, input dropout, etc. While the most competitive recent works introduce at least one hyperparameter of critical importance (e.g. depth and step size [37], $\alpha$ and $\Delta t$ [47], $\omega _ { 0 }$ [44]) that are difficult to tune, the LSSL-fixed has only $\Delta t$ , which the full LSSL can even learn automatically (at the expense of speed).
226
+
227
+ Limitations. Sections 1 and 3 and Fig. 1 mention that a potential benefit of having the recurrent representation of LSSLs may endow it with efficient inference. While this is theoretically possible, this work did not experiment on any applications that leverage this. Follow-up work showed that it is indeed possible in practice to speed up some applications at inference time.
228
+
229
+ Theorem 2’s algorithm is sophisticated (Appendix D) and was not implemented in the first version of this work. A follow-up to this paper found that it is not numerically stable and thus not usable on hardware. Thus the algorithmic contributions in Theorem 2 serve the purpose of a proof-of-concept that fast algorithms for the LSSL do exist in other computation models (i.e., arithmetic operations instead of floating point operations), and leave an open question as to whether fast, numerically stable, and practical algorithms for the LSSL exist.
230
+
231
+ As described in Appendix B, by freezing the $A$ matrix and $\Delta t$ timescale, the LSSL-fixed is able to be computed much faster than the full LSSL, and is comparable to prior models in practice (Table 5). However, beyond computational complexity, there is also a consideration of space efficiency. Both the LSSL and LSSL-fixed suffer from a large amount of space overhead (described in Appendix B) – using $O ( N L )$ instead of $O ( L )$ space when working on a 1D sequence of length $L$ – that essentially stems from using the latent state representation of dimension $N$ . Consequently, the LSSL can be space inefficient and we used multi-GPU training for our largest experiments (speech and high resolution images, Tables 3 and 4).
232
+
233
+ These fundamental issues with computation and space complexity were revisited and resolved in follow-up work to this paper, where a new state space model (the Structured State Space) provided a new parameterization and algorithms for state spaces.
234
+
235
+ Conclusion and future work. Modern deep learning models struggle in applications with very long temporal data such as speech, videos, and medical time-series. We hope that our conceptual and technical contributions can lead to new capabilities with simple, principled, and less engineered models. We note that our pixel-level image classification experiments, which use no heuristics (batch norm, auxiliary losses) or extra information (data augmentation), perform similar to early convnet models with vastly more parameters, and is in the spirit of recent attempts at unifying data modalities with a generic sequence model [18]. Our speech results demonstrate the possibility of learning better features than hand-crafted processing pipelines used widely in speech applications. We are excited about potential downstream applications, such as training other downstream models on top of pre-trained state space features.
236
+
237
+ # Acknowledgments
238
+
239
+ We thank Arjun Desai, Ananya Kumar, Laurel Orr, Sabri Eyuboglu, Dan Fu, Mayee Chen, Sarah Hooper, Simran Arora, and Trenton Chang for helpful feedback on earlier drafts. We thank David Romero and James Morrill for discussions and additional results for baselines used in our experiments. This work was done with the support of Google Cloud credits under HAI proposals 540994170283 and 578192719349. AR and IJ are supported under NSF grant CCF-1763481. KS is supported by the Wu Tsai Neuroscience Interdisciplinary Graduate Fellowship. We gratefully acknowledge the support of NIH under No. U54EB020405 (Mobilize), NSF under Nos. CCF1763315 (Beyond Sparsity), CCF1563078 (Volume to Velocity), and 1937301 (RTML); ONR under No. N000141712266 (Unifying Weak Supervision); ONR N00014-20-1-2480: Understanding and Applying Non-Euclidean Geometry in Machine Learning; N000142012275 (NEPTUNE); the Moore Foundation, NXP, Xilinx,
240
+
241
+ LETI-CEA, Intel, IBM, Microsoft, NEC, Toshiba, TSMC, ARM, Hitachi, BASF, Accenture, Ericsson, Qualcomm, Analog Devices, the Okawa Foundation, American Family Insurance, Google Cloud, Salesforce, Total, the HAI-AWS Cloud Credits for Research program, the Stanford Data Science Initiative (SDSI), and members of the Stanford DAWN project: Facebook, Google, and VMWare. The Mobilize Center is a Biomedical Technology Resource Center, funded by the NIH National Institute of Biomedical Imaging and Bioengineering through Grant P41EB027060. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views, policies, or endorsements, either expressed or implied, of NIH, ONR, or the U.S. Government.
242
+
243
+ # References
244
+
245
+ [1] George B. (George Brown) Arfken, Hans Jürgen Weber, and Frank E Harris. Mathematical methods for physicists : a comprehensive guide / George B. Arfken, Hans J. Weber, Frank E. Harris. Academic Press, Amsterdam, 7th ed. edition, 2013. ISBN 0-12-384654-4.
246
+ [2] Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In The International Conference on Machine Learning (ICML), pages 1120–1128, 2016.
247
+ [3] Shaojie Bai, J Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271, 2018.
248
+ [4] Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Trellis networks for sequence modeling. In The International Conference on Learning Representations (ICLR), 2019.
249
+ [5] James Bradbury, Stephen Merity, Caiming Xiong, and Richard Socher. Quasi-recurrent neural networks. arXiv preprint arXiv:1611.01576, 2016.
250
+ [6] John Charles Butcher and Nicolette Goodwin. Numerical methods for ordinary differential equations, volume 2. Wiley Online Library, 2008.
251
+ [7] Bo Chang, Minmin Chen, Eldad Haber, and Ed H Chi. Antisymmetricrnn: A dynamical system view on recurrent neural networks. In International Conference on Learning Representations, 2019.
252
+ [8] Shiyu Chang, Yang Zhang, Wei Han, Mo Yu, Xiaoxiao Guo, Wei Tan, Xiaodong Cui, Michael Witbrock, Mark Hasegawa-Johnson, and Thomas S Huang. Dilated recurrent neural networks. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
253
+ [9] Zhengping Che, Sanjay Purushotham, Kyunghyun Cho, David Sontag, and Yan Liu. Recurrent neural networks for multivariate time series with missing values. Scientific reports, 8(1):1–12, 2018.
254
+ [10] Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In Advances in neural information processing systems, pages 6571–6583, 2018.
255
+ [11] T. S. Chihara. An introduction to orthogonal polynomials. Dover Books on Mathematics. Dover Publications, 2011. ISBN 9780486479293.
256
+ [12] Narsimha Chilkuri and Chris Eliasmith. Parallelizing legendre memory unit training. The International Conference on Machine Learning (ICML), 2021.
257
+ [13] François Chollet. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1251–1258, 2017.
258
+ [14] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
259
+
260
+ [15] Jared Quincy Davis, Albert Gu, Tri Dao, Krzysztof Choromanski, Christopher Ré, Percy Liang, and Chelsea Finn. Catformer: Designing stable transformers via sensitivity analysis. In The International Conference on Machine Learning (ICML), 2021.
261
+
262
+ [16] Edward De Brouwer, Jaak Simm, Adam Arany, and Yves Moreau. Gru-ode-bayes: Continuous modeling of sporadically-observed time series. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
263
+
264
+ [17] Christopher De Sa, Albert Gu, Rohan Puttagunta, Christopher Ré, and Atri Rudra. A twopronged progress in structured dense matrix vector multiplication. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1060–1079. SIAM, 2018.
265
+
266
+ [18] 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.
267
+
268
+ [19] Y. Eidelman and I. Gohberg. On a new class of structured matrices. Integral Equations and Operator Theory, 34, 1999.
269
+
270
+ [20] N Benjamin Erichson, Omri Azencot, Alejandro Queiruga, Liam Hodgkinson, and Michael W Mahoney. Lipschitz recurrent neural networks. In International Conference on Learning Representations, 2021.
271
+
272
+ [21] Karl J Friston, Lee Harrison, and Will Penny. Dynamic causal modelling. Neuroimage, 19(4): 1273–1302, 2003.
273
+
274
+ [22] Ken-ichi Funahashi and Yuichi Nakamura. Approximation of dynamical systems by continuous time recurrent neural networks. Neural networks, 6(6):801–806, 1993.
275
+
276
+ [23] Gene H Golub and Charles F Van Loan. Matrix computations, volume 3. JHU press, 2013.
277
+
278
+ [24] Albert Gu, Tri Dao, Stefano Ermon, Atri Rudra, and Christopher Ré. Hippo: Recurrent memory with optimal polynomial projections. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips. cc/paper/2020/hash/102f0bb6efb3a6128a3c750dd16729be-Abstract.html.
279
+
280
+ [25] Albert Gu, Caglar Gulcehre, Tom Le Paine, Matt Hoffman, and Razvan Pascanu. Improving the gating mechanism of recurrent neural networks. In The International Conference on Machine Learning (ICML), 2020.
281
+
282
+ [26] Ramin Hasani, Mathias Lechner, Alexander Amini, Lucas Liebenwein, Max Tschaikowski, Gerald Teschl, and Daniela Rus. Closed-form continuous-depth models. arXiv preprint arXiv:2106.13898, 2021.
283
+
284
+ [27] Ramin Hasani, Mathias Lechner, Alexander Amini, Daniela Rus, and Radu Grosu. Liquid time-constant networks. In Proceedings of the AAAI Conference on Artificial Intelligence, 2021.
285
+
286
+ [28] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
287
+
288
+ [29] Ian D Jordan, Piotr Aleksander Sokół, and Il Memming Park. Gated recurrent units viewed through the lens of continuous time dynamical systems. Frontiers in computational neuroscience, page 67, 2021.
289
+
290
+ [30] Anil Kag, Ziming Zhang, and Venkatesh Saligrama. Rnns incrementally evolving on an equilibrium manifold: A panacea for vanishing and exploding gradients? In International Conference on Learning Representations, 2020.
291
+
292
+ [31] Patrick Kidger, James Morrill, James Foster, and Terry Lyons. Neural controlled differential equations for irregular time series. arXiv preprint arXiv:2005.08926, 2020.
293
+
294
+ [32] Mathias Lechner and Ramin Hasani. Learning long-term dependencies in irregularly-sampled time series. arXiv preprint arXiv:2006.04418, 2020.
295
+ [33] Tao Lei, Yu Zhang, Sida I Wang, Hui Dai, and Yoav Artzi. Simple recurrent units for highly parallelizable recurrence. arXiv preprint arXiv:1709.02755, 2017.
296
+ [34] Shuai Li, Wanqing Li, Chris Cook, Ce Zhu, and Yanbo Gao. Independently recurrent neural network (IndRNN): Building a longer and deeper RNN. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5457–5466, 2018.
297
+ [35] Liyuan Liu, Xiaodong Liu, Jianfeng Gao, Weizhu Chen, and Jiawei Han. Understanding the difficulty of training transformers. The International Conference on Machine Learning (ICML), 2020.
298
+ [36] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In ICCV, pages 3730–3738. IEEE Computer Society, 2015. ISBN 978-1-4673-8391-2. URL http://dblp.uni-trier.de/db/conf/iccv/iccv2015.html#LiuLWT15.
299
+ [37] James Morrill, Cristopher Salvi, Patrick Kidger, James Foster, and Terry Lyons. Neural rough differential equations for long time series. The International Conference on Machine Learning (ICML), 2021.
300
+ [38] Murphy Yuezhen Niu, Lior Horesh, and Isaac Chuang. Recurrent neural networks in the eye of differential equations. arXiv preprint arXiv:1904.12933, 2019.
301
+ [39] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International conference on machine learning, pages 1310–1318, 2013.
302
+ [40] Clément Pernet. Computing with quasiseparable matrices. In Proceedings of the ACM on International Symposium on Symbolic and Algebraic Computation, pages 389–396, 2016.
303
+ [41] KB Petersen and MS Pedersen. The matrix cookbook, version 20121115. Technical Univ. Denmark, Kongens Lyngby, Denmark, Tech. Rep, 3274, 2012.
304
+ [42] M. Ravanelli, T. Parcollet, and Y. Bengio. The pytorch-kaldi speech recognition toolkit. In In Proc. of ICASSP, 2019.
305
+ [43] David W Romero, Robert-Jan Bruintjes, Jakub M Tomczak, Erik J Bekkers, Mark Hoogendoorn, and Jan C van Gemert. Flexconv: Continuous kernel convolutions with differentiable kernel sizes. arXiv preprint arXiv:2110.08059, 2021.
306
+ [44] David W Romero, Anna Kuzina, Erik J Bekkers, Jakub M Tomczak, and Mark Hoogendoorn. Ckconv: Continuous kernel convolution for sequential data. arXiv preprint arXiv:2102.02611, 2021.
307
+ [45] Yulia Rubanova, Tian Qi Chen, and David K Duvenaud. Latent ordinary differential equations for irregularly-sampled time series. In Advances in Neural Information Processing Systems, pages 5321–5331, 2019.
308
+ [46] T. Konstantin Rusch and Siddhartha Mishra. Coupled oscillatory recurrent neural network (cornn): An accurate and (gradient) stable architecture for learning long time dependencies. In International Conference on Learning Representations, 2021.
309
+ [47] T Konstantin Rusch and Siddhartha Mishra. Unicornn: A recurrent model for learning very long time dependencies. The International Conference on Machine Learning (ICML), 2021.
310
+ [48] Khaled Saab, Jared Dunnmon, Christopher Ré, Daniel Rubin, and Christopher Lee-Messer. Weak supervision as an efficient approach for automated seizure detection in electroencephalography. NPJ Digital Medicine, 3(1):1–12, 2020.
311
+ [49] Vinit Shah, Eva Von Weltin, Silvia Lopez, James Riley McHugh, Lillian Veloso, Meysam Golmohammadi, Iyad Obeid, and Joseph Picone. The Temple University hospital seizure detection corpus. Frontiers in neuroinformatics, 12:83, 2018.
312
+ [50] Jie Shen, Tao Tang, and Li-Lian Wang. Orthogonal Polynomials and Related Approximation Results, pages 47–140. Springer Berlin Heidelberg, Berlin, Heidelberg, 2011. ISBN 978- 3-540-71041-7. doi: 10.1007/978-3-540-71041-7_3. URL https://doi.org/10.1007/ 978-3-540-71041-7_3.
313
+ [51] Victor Shoup. A computational introduction to number theory and algebra. Cambridge university press, 2009.
314
+ [52] G. Szegö. Orthogonal Polynomials. Number v.23 in American Mathematical Society colloquium publications. American Mathematical Society, 1967. ISBN 9780821889527.
315
+ [53] G. Szego.˝ Orthogonal Polynomials. American Mathematical Society: Colloquium publications. American Mathematical Society, 1975. ISBN 9780821810231.
316
+ [54] Corentin Tallec and Yann Ollivier. Can recurrent neural networks warp time? In The International Conference on Learning Representations (ICLR), 2018.
317
+ [55] Chang Wei Tan, Christoph Bergmeir, Francois Petitjean, and Geoffrey I Webb. Time series extrinsic regression. Data Mining and Knowledge Discovery, pages 1–29, 2021. doi: https: //doi.org/10.1007/s10618-021-00745-9.
318
+ [56] Trieu H Trinh, Andrew M Dai, Minh-Thang Luong, and Quoc V Le. Learning longer-term dependencies in RNNs with auxiliary losses. In The International Conference on Machine Learning (ICML), 2018.
319
+ [57] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
320
+ [58] Aaron Voelker, Ivana Kajic, and Chris Eliasmith. Legendre memory units: Continuous-time ´ representation in recurrent neural networks. In Advances in Neural Information Processing Systems, pages 15544–15553, 2019.
321
+ [59] Robert L Williams, Douglas A Lawrence, et al. Linear state-space control systems. Wiley Online Library, 2007.
322
+ [60] Max A Woodbury. Inverting modified matrices. Memorandum report, 42:106, 1950.
323
+ [61] Guofeng Zhang, Tongwen Chen, and Xiang Chen. Performance recovery in digital implementation of analogue systems. SIAM journal on control and optimization, 45(6):2207–2223, 2007.
324
+ [62] Huaguang Zhang, Zhanshan Wang, and Derong Liu. A comprehensive review of stability analysis of continuous-time recurrent neural networks. IEEE Transactions on Neural Networks and Learning Systems, 25(7):1229–1262, 2014.
parse/dev/03RLpj-tc_/03RLpj-tc__layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eeedd6cca83cbaa841ab29c846b1b445e5604aef5e12539299f3d6e202e31b49
3
+ size 2045322
parse/dev/03RLpj-tc_/03RLpj-tc__origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f4b9178904a125468e99b815b708b3a06a81705b800610edbb725868a646ac0
3
+ size 1816996
parse/dev/03RLpj-tc_/03RLpj-tc__span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b108872063c886f6fcbf89b922ed080bf45f779c59dcf1a20dad48900951eeaa
3
+ size 2054359
parse/dev/09hVcSDkea/09hVcSDkea_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72a9367591c4b1945ab93bc8b69d82db3c6dabe9f489ac48a38aca2586944492
3
+ size 2399760
parse/dev/09hVcSDkea/09hVcSDkea_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ad7094f8420750a46ac96ae1629b0f6382fb421bac536e93a52abfdd3f3dd54
3
+ size 2209817
parse/dev/09hVcSDkea/09hVcSDkea_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2af9eda42ede887a10d00adbf5497f24f164a4d3774594680d579ba92066f3fa
3
+ size 2397142
parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2885da2570d6ff4a3bd137b01bca7d7f8d6085ac661b595657dd419cce081c7
3
+ size 2135036
parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c05f1f88c4fbf54f453529416ffd3a8a245f32e0b6a1daa2f0ea3e34c5157a5
3
+ size 1921401
parse/dev/0U0C2pXfTZl/0U0C2pXfTZl_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7685e0e6033336c0c341db0894e6f2e6119a61acba8e82dc752081c5db0e6f01
3
+ size 2136179
parse/dev/1PL1NIMMrw/1PL1NIMMrw_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a4941ef9890d89559cd0d35256e53c8960f4c9d2c5b0b98f9c48a63e83f584f
3
+ size 10685335
parse/dev/1PL1NIMMrw/1PL1NIMMrw_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cedb0e04e7794e86f16dd474c3410062734796509169acee9be60979b3ce1d07
3
+ size 10426953
parse/dev/1PL1NIMMrw/1PL1NIMMrw_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de3acdd14aad14ad517d4bdf05c5c506576f2c71dff469c1b4ab384fe5f1e45b
3
+ size 10686068
parse/dev/1W0z96MFEoH/1W0z96MFEoH_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:269456de2e30afe24916a71a3732f7cb8545a78dd9f20c806f90a300eb445583
3
+ size 1277893
parse/dev/1W0z96MFEoH/1W0z96MFEoH_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ded1e1d1d4bd246542781b72c4cd31728111c4830e20fe9018bb057f9a92706
3
+ size 1108715
parse/dev/1W0z96MFEoH/1W0z96MFEoH_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97a6d6ebb54a9b2bb9cf887933c11560aa63930167aed6cb9b88663554a498da
3
+ size 1277624
parse/dev/1YEF6TA8Di/1YEF6TA8Di_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a486918017faacf687c577840fc8915a9e5d14291791ef173cd75cce603858f7
3
+ size 738238
parse/dev/1YEF6TA8Di/1YEF6TA8Di_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a2657470f143429c6e3b5baa39ef3d426ff7a4417aebd70e7e09007cd18606d
3
+ size 510980
parse/dev/1YEF6TA8Di/1YEF6TA8Di_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe69de7ea2c84844edc953ca15d0375dd1906d945093507cf2958641729a488b
3
+ size 750340
parse/dev/1qvx610Cu7/1qvx610Cu7_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2f0d113c402901a6c490c7d942b70718f61bc68cee6cbc94745860247bbb113
3
+ size 1128318
parse/dev/1qvx610Cu7/1qvx610Cu7_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ef2ea7bf7c909d27b68df3a6846e431dab488789104a42e4f1d85fc97f2db9c
3
+ size 916360
parse/dev/1qvx610Cu7/1qvx610Cu7_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5aa4a3d477326ec19a5e43ca338c2e63cea646d8201fac9ad56c35c1b23012a6
3
+ size 1140656
parse/dev/4hturzLcKX/4hturzLcKX_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1300a499c64ce06b1c8c7545e32acd7644637de4540b937b0af853446b3c200
3
+ size 1601580
parse/dev/4hturzLcKX/4hturzLcKX_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f00fa197cf0dc2ec5fd2b5d89993ec16eb691e84a7fcbb15696216390ed64e4b
3
+ size 1340882
parse/dev/4hturzLcKX/4hturzLcKX_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4a8bdba1612040c55b968d983fd351dfc3ddb5a3a61482a875863eabdc1de0f
3
+ size 1610344
parse/dev/6UtOXn1LwNE/6UtOXn1LwNE_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afc5afbee68f61af04e5092eee85975e122926905deecfabe0293306ac233ce7
3
+ size 2525866
parse/dev/6UtOXn1LwNE/6UtOXn1LwNE_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fabae1d5183225437fca9a880db62458aa608a531d6c3e5309fc798b02bbba37
3
+ size 2197056