ZHANGYUXUAN-zR commited on
Commit
dcdd658
·
verified ·
1 Parent(s): 7563d9f

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 +212 -0
  2. parse/dev/-ltZ1uw8ZE7/-ltZ1uw8ZE7.md +409 -0
  3. parse/dev/-ltZ1uw8ZE7/-ltZ1uw8ZE7_content_list.json +0 -0
  4. parse/dev/-ltZ1uw8ZE7/-ltZ1uw8ZE7_middle.json +0 -0
  5. parse/dev/-ltZ1uw8ZE7/-ltZ1uw8ZE7_model.json +0 -0
  6. parse/dev/0RDcd5Axok/0RDcd5Axok_content_list.json +1922 -0
  7. parse/dev/0RDcd5Axok/0RDcd5Axok_model.json +0 -0
  8. parse/dev/EcGGFkNTxdJ/EcGGFkNTxdJ_middle.json +0 -0
  9. parse/dev/Kwm8I7dU-l5/Kwm8I7dU-l5.md +441 -0
  10. parse/dev/Kwm8I7dU-l5/Kwm8I7dU-l5_content_list.json +0 -0
  11. parse/dev/Kwm8I7dU-l5/Kwm8I7dU-l5_middle.json +0 -0
  12. parse/dev/Kwm8I7dU-l5/Kwm8I7dU-l5_model.json +0 -0
  13. parse/dev/RwzFNbJ3Ez/RwzFNbJ3Ez.md +484 -0
  14. parse/dev/RwzFNbJ3Ez/RwzFNbJ3Ez_model.json +0 -0
  15. parse/dev/RzXb6a3H3rs/RzXb6a3H3rs_middle.json +0 -0
  16. parse/dev/RzXb6a3H3rs/RzXb6a3H3rs_model.json +0 -0
  17. parse/dev/UpN2wfrLec/UpN2wfrLec.md +316 -0
  18. parse/dev/UpN2wfrLec/UpN2wfrLec_content_list.json +1716 -0
  19. parse/dev/UpN2wfrLec/UpN2wfrLec_middle.json +0 -0
  20. parse/dev/UpN2wfrLec/UpN2wfrLec_model.json +0 -0
  21. parse/dev/Vx1JadlOIt/Vx1JadlOIt.md +296 -0
  22. parse/dev/Vx1JadlOIt/Vx1JadlOIt_middle.json +0 -0
  23. parse/dev/Vx1JadlOIt/Vx1JadlOIt_model.json +0 -0
  24. parse/dev/bgAS1ZvveZ/bgAS1ZvveZ_model.json +0 -0
  25. parse/dev/dLL4KXzKUpS/dLL4KXzKUpS_middle.json +0 -0
  26. parse/dev/dLL4KXzKUpS/dLL4KXzKUpS_model.json +0 -0
  27. parse/dev/e2M4CNa-UOS/e2M4CNa-UOS.md +495 -0
  28. parse/dev/e2M4CNa-UOS/e2M4CNa-UOS_content_list.json +1012 -0
  29. parse/dev/e2M4CNa-UOS/e2M4CNa-UOS_middle.json +0 -0
  30. parse/dev/e2M4CNa-UOS/e2M4CNa-UOS_model.json +0 -0
  31. parse/dev/fcO9Cgn-X-R/fcO9Cgn-X-R.md +344 -0
  32. parse/dev/fcO9Cgn-X-R/fcO9Cgn-X-R_content_list.json +1868 -0
  33. parse/dev/fcO9Cgn-X-R/fcO9Cgn-X-R_middle.json +0 -0
  34. parse/dev/fcO9Cgn-X-R/fcO9Cgn-X-R_model.json +0 -0
  35. parse/dev/hX5Ia-ION8Y/hX5Ia-ION8Y.md +379 -0
  36. parse/dev/hX5Ia-ION8Y/hX5Ia-ION8Y_content_list.json +1967 -0
  37. parse/dev/hX5Ia-ION8Y/hX5Ia-ION8Y_middle.json +0 -0
  38. parse/dev/xm6YD62D1Ub/xm6YD62D1Ub.md +464 -0
  39. parse/dev/xm6YD62D1Ub/xm6YD62D1Ub_content_list.json +0 -0
  40. parse/train/1toB0Fo9CZy/1toB0Fo9CZy_layout.pdf +3 -0
  41. parse/train/1toB0Fo9CZy/1toB0Fo9CZy_origin.pdf +3 -0
  42. parse/train/1toB0Fo9CZy/1toB0Fo9CZy_span.pdf +3 -0
  43. parse/train/5SST78xEh4A/5SST78xEh4A_layout.pdf +3 -0
  44. parse/train/5SST78xEh4A/5SST78xEh4A_origin.pdf +3 -0
  45. parse/train/5SST78xEh4A/5SST78xEh4A_span.pdf +3 -0
  46. parse/train/63pC59XOZLZ/63pC59XOZLZ_layout.pdf +3 -0
  47. parse/train/63pC59XOZLZ/63pC59XOZLZ_origin.pdf +3 -0
  48. parse/train/63pC59XOZLZ/63pC59XOZLZ_span.pdf +3 -0
  49. parse/train/68B1ezcffDc/68B1ezcffDc_layout.pdf +3 -0
  50. parse/train/68B1ezcffDc/68B1ezcffDc_origin.pdf +3 -0
.gitattributes CHANGED
@@ -5137,3 +5137,215 @@ parse/train/r1gBOxSFwr/r1gBOxSFwr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5137
  parse/train/r1gBOxSFwr/r1gBOxSFwr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5138
  parse/train/r1gBOxSFwr/r1gBOxSFwr_span.pdf filter=lfs diff=lfs merge=lfs -text
5139
  parse/train/HJgXCV9xx/HJgXCV9xx_origin.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5137
  parse/train/r1gBOxSFwr/r1gBOxSFwr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5138
  parse/train/r1gBOxSFwr/r1gBOxSFwr_span.pdf filter=lfs diff=lfs merge=lfs -text
5139
  parse/train/HJgXCV9xx/HJgXCV9xx_origin.pdf filter=lfs diff=lfs merge=lfs -text
5140
+ parse/train/QWIvzSQaX5/QWIvzSQaX5_span.pdf filter=lfs diff=lfs merge=lfs -text
5141
+ parse/train/QWIvzSQaX5/QWIvzSQaX5_layout.pdf filter=lfs diff=lfs merge=lfs -text
5142
+ parse/train/rJgSk04tDH/rJgSk04tDH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5143
+ parse/train/rJgSk04tDH/rJgSk04tDH_span.pdf filter=lfs diff=lfs merge=lfs -text
5144
+ parse/train/rJgSk04tDH/rJgSk04tDH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5145
+ parse/train/Syxwsp4KDB/Syxwsp4KDB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5146
+ parse/train/Syxwsp4KDB/Syxwsp4KDB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5147
+ parse/train/Syxwsp4KDB/Syxwsp4KDB_span.pdf filter=lfs diff=lfs merge=lfs -text
5148
+ parse/train/Skxuk1rFwB/Skxuk1rFwB_span.pdf filter=lfs diff=lfs merge=lfs -text
5149
+ parse/train/Skxuk1rFwB/Skxuk1rFwB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5150
+ parse/train/Skxuk1rFwB/Skxuk1rFwB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5151
+ parse/train/S1Jhfftgx/S1Jhfftgx_span.pdf filter=lfs diff=lfs merge=lfs -text
5152
+ parse/train/S1Jhfftgx/S1Jhfftgx_origin.pdf filter=lfs diff=lfs merge=lfs -text
5153
+ parse/train/S1Jhfftgx/S1Jhfftgx_layout.pdf filter=lfs diff=lfs merge=lfs -text
5154
+ parse/train/Byx9p2EtDH/Byx9p2EtDH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5155
+ parse/train/Byx9p2EtDH/Byx9p2EtDH_span.pdf filter=lfs diff=lfs merge=lfs -text
5156
+ parse/train/Byx9p2EtDH/Byx9p2EtDH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5157
+ parse/train/HJeVnCEKwH/HJeVnCEKwH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5158
+ parse/train/HJeVnCEKwH/HJeVnCEKwH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5159
+ parse/train/HJeVnCEKwH/HJeVnCEKwH_span.pdf filter=lfs diff=lfs merge=lfs -text
5160
+ parse/train/kLwjnXCh2hm/kLwjnXCh2hm_span.pdf filter=lfs diff=lfs merge=lfs -text
5161
+ parse/train/kLwjnXCh2hm/kLwjnXCh2hm_layout.pdf filter=lfs diff=lfs merge=lfs -text
5162
+ parse/train/kLwjnXCh2hm/kLwjnXCh2hm_origin.pdf filter=lfs diff=lfs merge=lfs -text
5163
+ parse/train/OqtLIabPTit/OqtLIabPTit_span.pdf filter=lfs diff=lfs merge=lfs -text
5164
+ parse/train/OqtLIabPTit/OqtLIabPTit_layout.pdf filter=lfs diff=lfs merge=lfs -text
5165
+ parse/train/OqtLIabPTit/OqtLIabPTit_origin.pdf filter=lfs diff=lfs merge=lfs -text
5166
+ parse/train/eLfqMl3z3lq/eLfqMl3z3lq_span.pdf filter=lfs diff=lfs merge=lfs -text
5167
+ parse/train/eLfqMl3z3lq/eLfqMl3z3lq_origin.pdf filter=lfs diff=lfs merge=lfs -text
5168
+ parse/train/eLfqMl3z3lq/eLfqMl3z3lq_layout.pdf filter=lfs diff=lfs merge=lfs -text
5169
+ parse/train/1toB0Fo9CZy/1toB0Fo9CZy_span.pdf filter=lfs diff=lfs merge=lfs -text
5170
+ parse/train/1toB0Fo9CZy/1toB0Fo9CZy_layout.pdf filter=lfs diff=lfs merge=lfs -text
5171
+ parse/train/1toB0Fo9CZy/1toB0Fo9CZy_origin.pdf filter=lfs diff=lfs merge=lfs -text
5172
+ parse/train/rygrBhC5tQ/rygrBhC5tQ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5173
+ parse/train/rygrBhC5tQ/rygrBhC5tQ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5174
+ parse/train/rygrBhC5tQ/rygrBhC5tQ_span.pdf filter=lfs diff=lfs merge=lfs -text
5175
+ parse/train/HJzgZ3JCW/HJzgZ3JCW_origin.pdf filter=lfs diff=lfs merge=lfs -text
5176
+ parse/train/HJzgZ3JCW/HJzgZ3JCW_span.pdf filter=lfs diff=lfs merge=lfs -text
5177
+ parse/train/HJzgZ3JCW/HJzgZ3JCW_layout.pdf filter=lfs diff=lfs merge=lfs -text
5178
+ parse/train/enoVQWLsfyL/enoVQWLsfyL_origin.pdf filter=lfs diff=lfs merge=lfs -text
5179
+ parse/train/enoVQWLsfyL/enoVQWLsfyL_layout.pdf filter=lfs diff=lfs merge=lfs -text
5180
+ parse/train/enoVQWLsfyL/enoVQWLsfyL_span.pdf filter=lfs diff=lfs merge=lfs -text
5181
+ parse/train/BJlS634tPr/BJlS634tPr_span.pdf filter=lfs diff=lfs merge=lfs -text
5182
+ parse/train/BJlS634tPr/BJlS634tPr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5183
+ parse/train/BJlS634tPr/BJlS634tPr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5184
+ parse/train/Byj54-bAW/Byj54-bAW_origin.pdf filter=lfs diff=lfs merge=lfs -text
5185
+ parse/train/Byj54-bAW/Byj54-bAW_span.pdf filter=lfs diff=lfs merge=lfs -text
5186
+ parse/train/Byj54-bAW/Byj54-bAW_layout.pdf filter=lfs diff=lfs merge=lfs -text
5187
+ parse/train/ByZmGjkA-/ByZmGjkA-_span.pdf filter=lfs diff=lfs merge=lfs -text
5188
+ parse/train/ByZmGjkA-/ByZmGjkA-_origin.pdf filter=lfs diff=lfs merge=lfs -text
5189
+ parse/train/ByZmGjkA-/ByZmGjkA-_layout.pdf filter=lfs diff=lfs merge=lfs -text
5190
+ parse/train/HJxFrs09YQ/HJxFrs09YQ_span.pdf filter=lfs diff=lfs merge=lfs -text
5191
+ parse/train/HJxFrs09YQ/HJxFrs09YQ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5192
+ parse/train/HJxFrs09YQ/HJxFrs09YQ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5193
+ parse/train/MSXDyfli9vy/MSXDyfli9vy_span.pdf filter=lfs diff=lfs merge=lfs -text
5194
+ parse/train/MSXDyfli9vy/MSXDyfli9vy_layout.pdf filter=lfs diff=lfs merge=lfs -text
5195
+ parse/train/MSXDyfli9vy/MSXDyfli9vy_origin.pdf filter=lfs diff=lfs merge=lfs -text
5196
+ parse/train/rygkk305YQ/rygkk305YQ_span.pdf filter=lfs diff=lfs merge=lfs -text
5197
+ parse/train/rygkk305YQ/rygkk305YQ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5198
+ parse/train/rygkk305YQ/rygkk305YQ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5199
+ parse/train/RSU17UoKfJF/RSU17UoKfJF_span.pdf filter=lfs diff=lfs merge=lfs -text
5200
+ parse/train/RSU17UoKfJF/RSU17UoKfJF_layout.pdf filter=lfs diff=lfs merge=lfs -text
5201
+ parse/train/RSU17UoKfJF/RSU17UoKfJF_origin.pdf filter=lfs diff=lfs merge=lfs -text
5202
+ parse/train/dOcQK-f4byz/dOcQK-f4byz_span.pdf filter=lfs diff=lfs merge=lfs -text
5203
+ parse/train/dOcQK-f4byz/dOcQK-f4byz_origin.pdf filter=lfs diff=lfs merge=lfs -text
5204
+ parse/train/dOcQK-f4byz/dOcQK-f4byz_layout.pdf filter=lfs diff=lfs merge=lfs -text
5205
+ parse/train/68B1ezcffDc/68B1ezcffDc_origin.pdf filter=lfs diff=lfs merge=lfs -text
5206
+ parse/train/68B1ezcffDc/68B1ezcffDc_layout.pdf filter=lfs diff=lfs merge=lfs -text
5207
+ parse/train/68B1ezcffDc/68B1ezcffDc_span.pdf filter=lfs diff=lfs merge=lfs -text
5208
+ parse/train/HJx7l309Fm/HJx7l309Fm_span.pdf filter=lfs diff=lfs merge=lfs -text
5209
+ parse/train/HJx7l309Fm/HJx7l309Fm_origin.pdf filter=lfs diff=lfs merge=lfs -text
5210
+ parse/train/HJx7l309Fm/HJx7l309Fm_layout.pdf filter=lfs diff=lfs merge=lfs -text
5211
+ parse/train/Hk4fpoA5Km/Hk4fpoA5Km_layout.pdf filter=lfs diff=lfs merge=lfs -text
5212
+ parse/train/Hk4fpoA5Km/Hk4fpoA5Km_origin.pdf filter=lfs diff=lfs merge=lfs -text
5213
+ parse/train/Hk4fpoA5Km/Hk4fpoA5Km_span.pdf filter=lfs diff=lfs merge=lfs -text
5214
+ parse/train/HJeqhA4YDS/HJeqhA4YDS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5215
+ parse/train/HJeqhA4YDS/HJeqhA4YDS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5216
+ parse/train/HJeqhA4YDS/HJeqhA4YDS_span.pdf filter=lfs diff=lfs merge=lfs -text
5217
+ parse/train/HJsjkMb0Z/HJsjkMb0Z_span.pdf filter=lfs diff=lfs merge=lfs -text
5218
+ parse/train/HJsjkMb0Z/HJsjkMb0Z_origin.pdf filter=lfs diff=lfs merge=lfs -text
5219
+ parse/train/HJsjkMb0Z/HJsjkMb0Z_layout.pdf filter=lfs diff=lfs merge=lfs -text
5220
+ parse/train/F8whUO8HNbP/F8whUO8HNbP_layout.pdf filter=lfs diff=lfs merge=lfs -text
5221
+ parse/train/F8whUO8HNbP/F8whUO8HNbP_origin.pdf filter=lfs diff=lfs merge=lfs -text
5222
+ parse/train/F8whUO8HNbP/F8whUO8HNbP_span.pdf filter=lfs diff=lfs merge=lfs -text
5223
+ parse/train/WsfXFxqZXRO/WsfXFxqZXRO_span.pdf filter=lfs diff=lfs merge=lfs -text
5224
+ parse/train/WsfXFxqZXRO/WsfXFxqZXRO_layout.pdf filter=lfs diff=lfs merge=lfs -text
5225
+ parse/train/WsfXFxqZXRO/WsfXFxqZXRO_origin.pdf filter=lfs diff=lfs merge=lfs -text
5226
+ parse/train/VD_ozqvBy4W/VD_ozqvBy4W_span.pdf filter=lfs diff=lfs merge=lfs -text
5227
+ parse/train/VD_ozqvBy4W/VD_ozqvBy4W_layout.pdf filter=lfs diff=lfs merge=lfs -text
5228
+ parse/train/VD_ozqvBy4W/VD_ozqvBy4W_origin.pdf filter=lfs diff=lfs merge=lfs -text
5229
+ parse/train/ryCM8zWRb/ryCM8zWRb_layout.pdf filter=lfs diff=lfs merge=lfs -text
5230
+ parse/train/ryCM8zWRb/ryCM8zWRb_span.pdf filter=lfs diff=lfs merge=lfs -text
5231
+ parse/train/ryCM8zWRb/ryCM8zWRb_origin.pdf filter=lfs diff=lfs merge=lfs -text
5232
+ parse/train/HJgcvJBFvB/HJgcvJBFvB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5233
+ parse/train/HJgcvJBFvB/HJgcvJBFvB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5234
+ parse/train/HJgcvJBFvB/HJgcvJBFvB_span.pdf filter=lfs diff=lfs merge=lfs -text
5235
+ parse/train/HJNJws0cF7/HJNJws0cF7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5236
+ parse/train/HJNJws0cF7/HJNJws0cF7_layout.pdf filter=lfs diff=lfs merge=lfs -text
5237
+ parse/train/HJNJws0cF7/HJNJws0cF7_span.pdf filter=lfs diff=lfs merge=lfs -text
5238
+ parse/train/SkxxIs0qY7/SkxxIs0qY7_layout.pdf filter=lfs diff=lfs merge=lfs -text
5239
+ parse/train/SkxxIs0qY7/SkxxIs0qY7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5240
+ parse/train/SkxxIs0qY7/SkxxIs0qY7_span.pdf filter=lfs diff=lfs merge=lfs -text
5241
+ parse/train/LZDiWaC9CGL/LZDiWaC9CGL_layout.pdf filter=lfs diff=lfs merge=lfs -text
5242
+ parse/train/LZDiWaC9CGL/LZDiWaC9CGL_origin.pdf filter=lfs diff=lfs merge=lfs -text
5243
+ parse/train/LZDiWaC9CGL/LZDiWaC9CGL_span.pdf filter=lfs diff=lfs merge=lfs -text
5244
+ parse/train/nQxCYIFk7Rz/nQxCYIFk7Rz_layout.pdf filter=lfs diff=lfs merge=lfs -text
5245
+ parse/train/nQxCYIFk7Rz/nQxCYIFk7Rz_origin.pdf filter=lfs diff=lfs merge=lfs -text
5246
+ parse/train/nQxCYIFk7Rz/nQxCYIFk7Rz_span.pdf filter=lfs diff=lfs merge=lfs -text
5247
+ parse/train/Bke96sC5tm/Bke96sC5tm_layout.pdf filter=lfs diff=lfs merge=lfs -text
5248
+ parse/train/Bke96sC5tm/Bke96sC5tm_origin.pdf filter=lfs diff=lfs merge=lfs -text
5249
+ parse/train/Bke96sC5tm/Bke96sC5tm_span.pdf filter=lfs diff=lfs merge=lfs -text
5250
+ parse/train/crAi7c41xTh/crAi7c41xTh_span.pdf filter=lfs diff=lfs merge=lfs -text
5251
+ parse/train/crAi7c41xTh/crAi7c41xTh_layout.pdf filter=lfs diff=lfs merge=lfs -text
5252
+ parse/train/crAi7c41xTh/crAi7c41xTh_origin.pdf filter=lfs diff=lfs merge=lfs -text
5253
+ parse/train/lR4aaWCQgB/lR4aaWCQgB_span.pdf filter=lfs diff=lfs merge=lfs -text
5254
+ parse/train/lR4aaWCQgB/lR4aaWCQgB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5255
+ parse/train/lR4aaWCQgB/lR4aaWCQgB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5256
+ parse/train/rygBVTVFPB/rygBVTVFPB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5257
+ parse/train/rygBVTVFPB/rygBVTVFPB_span.pdf filter=lfs diff=lfs merge=lfs -text
5258
+ parse/train/rygBVTVFPB/rygBVTVFPB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5259
+ parse/train/SJgIPJBFvH/SJgIPJBFvH_span.pdf filter=lfs diff=lfs merge=lfs -text
5260
+ parse/train/SJgIPJBFvH/SJgIPJBFvH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5261
+ parse/train/SJgIPJBFvH/SJgIPJBFvH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5262
+ parse/train/SyX0IeWAW/SyX0IeWAW_span.pdf filter=lfs diff=lfs merge=lfs -text
5263
+ parse/train/SyX0IeWAW/SyX0IeWAW_origin.pdf filter=lfs diff=lfs merge=lfs -text
5264
+ parse/train/SyX0IeWAW/SyX0IeWAW_layout.pdf filter=lfs diff=lfs merge=lfs -text
5265
+ parse/train/bEoxzW_EXsa/bEoxzW_EXsa_origin.pdf filter=lfs diff=lfs merge=lfs -text
5266
+ parse/train/bEoxzW_EXsa/bEoxzW_EXsa_span.pdf filter=lfs diff=lfs merge=lfs -text
5267
+ parse/train/bEoxzW_EXsa/bEoxzW_EXsa_layout.pdf filter=lfs diff=lfs merge=lfs -text
5268
+ parse/train/SJgVHkrYDH/SJgVHkrYDH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5269
+ parse/train/SJgVHkrYDH/SJgVHkrYDH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5270
+ parse/train/SJgVHkrYDH/SJgVHkrYDH_span.pdf filter=lfs diff=lfs merge=lfs -text
5271
+ parse/train/ryxO3gBtPB/ryxO3gBtPB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5272
+ parse/train/ryxO3gBtPB/ryxO3gBtPB_span.pdf filter=lfs diff=lfs merge=lfs -text
5273
+ parse/train/ryxO3gBtPB/ryxO3gBtPB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5274
+ parse/train/SJ3dBGZ0Z/SJ3dBGZ0Z_origin.pdf filter=lfs diff=lfs merge=lfs -text
5275
+ parse/train/SJa9iHgAZ/SJa9iHgAZ_span.pdf filter=lfs diff=lfs merge=lfs -text
5276
+ parse/train/SJa9iHgAZ/SJa9iHgAZ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5277
+ parse/train/SJa9iHgAZ/SJa9iHgAZ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5278
+ parse/train/jlchsFOLfeF/jlchsFOLfeF_origin.pdf filter=lfs diff=lfs merge=lfs -text
5279
+ parse/train/jlchsFOLfeF/jlchsFOLfeF_layout.pdf filter=lfs diff=lfs merge=lfs -text
5280
+ parse/train/jlchsFOLfeF/jlchsFOLfeF_span.pdf filter=lfs diff=lfs merge=lfs -text
5281
+ parse/train/rk8wKk-R-/rk8wKk-R-_origin.pdf filter=lfs diff=lfs merge=lfs -text
5282
+ parse/train/rk8wKk-R-/rk8wKk-R-_layout.pdf filter=lfs diff=lfs merge=lfs -text
5283
+ parse/train/rk8wKk-R-/rk8wKk-R-_span.pdf filter=lfs diff=lfs merge=lfs -text
5284
+ parse/train/uIMwuJHfuLM/uIMwuJHfuLM_origin.pdf filter=lfs diff=lfs merge=lfs -text
5285
+ parse/train/uIMwuJHfuLM/uIMwuJHfuLM_span.pdf filter=lfs diff=lfs merge=lfs -text
5286
+ parse/train/uIMwuJHfuLM/uIMwuJHfuLM_layout.pdf filter=lfs diff=lfs merge=lfs -text
5287
+ parse/train/_SKUm2AJpvN/_SKUm2AJpvN_origin.pdf filter=lfs diff=lfs merge=lfs -text
5288
+ parse/train/_SKUm2AJpvN/_SKUm2AJpvN_span.pdf filter=lfs diff=lfs merge=lfs -text
5289
+ parse/train/_SKUm2AJpvN/_SKUm2AJpvN_layout.pdf filter=lfs diff=lfs merge=lfs -text
5290
+ parse/train/BkevoJSYPB/BkevoJSYPB_span.pdf filter=lfs diff=lfs merge=lfs -text
5291
+ parse/train/BkevoJSYPB/BkevoJSYPB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5292
+ parse/train/BkevoJSYPB/BkevoJSYPB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5293
+ parse/train/SJlh8CEYDB/SJlh8CEYDB_origin.pdf filter=lfs diff=lfs merge=lfs -text
5294
+ parse/train/SJlh8CEYDB/SJlh8CEYDB_span.pdf filter=lfs diff=lfs merge=lfs -text
5295
+ parse/train/SJlh8CEYDB/SJlh8CEYDB_layout.pdf filter=lfs diff=lfs merge=lfs -text
5296
+ parse/train/SJgCEpVtvr/SJgCEpVtvr_span.pdf filter=lfs diff=lfs merge=lfs -text
5297
+ parse/train/SJgCEpVtvr/SJgCEpVtvr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5298
+ parse/train/SJgCEpVtvr/SJgCEpVtvr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5299
+ parse/train/Esd7tGH3Spl/Esd7tGH3Spl_span.pdf filter=lfs diff=lfs merge=lfs -text
5300
+ parse/train/Esd7tGH3Spl/Esd7tGH3Spl_origin.pdf filter=lfs diff=lfs merge=lfs -text
5301
+ parse/train/Esd7tGH3Spl/Esd7tGH3Spl_layout.pdf filter=lfs diff=lfs merge=lfs -text
5302
+ parse/train/HklXn1BKDH/HklXn1BKDH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5303
+ parse/train/HklXn1BKDH/HklXn1BKDH_span.pdf filter=lfs diff=lfs merge=lfs -text
5304
+ parse/train/HklXn1BKDH/HklXn1BKDH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5305
+ parse/train/5SST78xEh4A/5SST78xEh4A_layout.pdf filter=lfs diff=lfs merge=lfs -text
5306
+ parse/train/5SST78xEh4A/5SST78xEh4A_origin.pdf filter=lfs diff=lfs merge=lfs -text
5307
+ parse/train/5SST78xEh4A/5SST78xEh4A_span.pdf filter=lfs diff=lfs merge=lfs -text
5308
+ parse/train/63pC59XOZLZ/63pC59XOZLZ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5309
+ parse/train/63pC59XOZLZ/63pC59XOZLZ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5310
+ parse/train/63pC59XOZLZ/63pC59XOZLZ_span.pdf filter=lfs diff=lfs merge=lfs -text
5311
+ parse/train/HfpNVDg3ExA/HfpNVDg3ExA_layout.pdf filter=lfs diff=lfs merge=lfs -text
5312
+ parse/train/HfpNVDg3ExA/HfpNVDg3ExA_span.pdf filter=lfs diff=lfs merge=lfs -text
5313
+ parse/train/HfpNVDg3ExA/HfpNVDg3ExA_origin.pdf filter=lfs diff=lfs merge=lfs -text
5314
+ parse/train/Hklso24Kwr/Hklso24Kwr_span.pdf filter=lfs diff=lfs merge=lfs -text
5315
+ parse/train/Hklso24Kwr/Hklso24Kwr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5316
+ parse/train/Hklso24Kwr/Hklso24Kwr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5317
+ parse/train/YTWGvpFOQD-/YTWGvpFOQD-_span.pdf filter=lfs diff=lfs merge=lfs -text
5318
+ parse/train/YTWGvpFOQD-/YTWGvpFOQD-_layout.pdf filter=lfs diff=lfs merge=lfs -text
5319
+ parse/train/YTWGvpFOQD-/YTWGvpFOQD-_origin.pdf filter=lfs diff=lfs merge=lfs -text
5320
+ parse/train/rJgUfTEYvH/rJgUfTEYvH_span.pdf filter=lfs diff=lfs merge=lfs -text
5321
+ parse/train/rJgUfTEYvH/rJgUfTEYvH_origin.pdf filter=lfs diff=lfs merge=lfs -text
5322
+ parse/train/rJgUfTEYvH/rJgUfTEYvH_layout.pdf filter=lfs diff=lfs merge=lfs -text
5323
+ parse/train/eoTy4ihL0W/eoTy4ihL0W_layout.pdf filter=lfs diff=lfs merge=lfs -text
5324
+ parse/train/eoTy4ihL0W/eoTy4ihL0W_origin.pdf filter=lfs diff=lfs merge=lfs -text
5325
+ parse/train/eoTy4ihL0W/eoTy4ihL0W_span.pdf filter=lfs diff=lfs merge=lfs -text
5326
+ parse/train/eEn8KTtJOx/eEn8KTtJOx_origin.pdf filter=lfs diff=lfs merge=lfs -text
5327
+ parse/train/eEn8KTtJOx/eEn8KTtJOx_layout.pdf filter=lfs diff=lfs merge=lfs -text
5328
+ parse/train/eEn8KTtJOx/eEn8KTtJOx_span.pdf filter=lfs diff=lfs merge=lfs -text
5329
+ parse/train/HkgSk2A9Y7/HkgSk2A9Y7_span.pdf filter=lfs diff=lfs merge=lfs -text
5330
+ parse/train/HkgSk2A9Y7/HkgSk2A9Y7_layout.pdf filter=lfs diff=lfs merge=lfs -text
5331
+ parse/train/HkgSk2A9Y7/HkgSk2A9Y7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5332
+ parse/train/Ic9vRN3VpZ/Ic9vRN3VpZ_origin.pdf filter=lfs diff=lfs merge=lfs -text
5333
+ parse/train/Ic9vRN3VpZ/Ic9vRN3VpZ_span.pdf filter=lfs diff=lfs merge=lfs -text
5334
+ parse/train/Ic9vRN3VpZ/Ic9vRN3VpZ_layout.pdf filter=lfs diff=lfs merge=lfs -text
5335
+ parse/train/f4jw35Vrk6d/f4jw35Vrk6d_layout.pdf filter=lfs diff=lfs merge=lfs -text
5336
+ parse/train/f4jw35Vrk6d/f4jw35Vrk6d_span.pdf filter=lfs diff=lfs merge=lfs -text
5337
+ parse/train/f4jw35Vrk6d/f4jw35Vrk6d_origin.pdf filter=lfs diff=lfs merge=lfs -text
5338
+ parse/train/I-VfjSBzi36/I-VfjSBzi36_origin.pdf filter=lfs diff=lfs merge=lfs -text
5339
+ parse/train/I-VfjSBzi36/I-VfjSBzi36_layout.pdf filter=lfs diff=lfs merge=lfs -text
5340
+ parse/train/I-VfjSBzi36/I-VfjSBzi36_span.pdf filter=lfs diff=lfs merge=lfs -text
5341
+ parse/train/_eXwwWOyqT_/_eXwwWOyqT__layout.pdf filter=lfs diff=lfs merge=lfs -text
5342
+ parse/train/_eXwwWOyqT_/_eXwwWOyqT__origin.pdf filter=lfs diff=lfs merge=lfs -text
5343
+ parse/train/_eXwwWOyqT_/_eXwwWOyqT__span.pdf filter=lfs diff=lfs merge=lfs -text
5344
+ parse/train/B1xmOgrFPS/B1xmOgrFPS_layout.pdf filter=lfs diff=lfs merge=lfs -text
5345
+ parse/train/B1xmOgrFPS/B1xmOgrFPS_origin.pdf filter=lfs diff=lfs merge=lfs -text
5346
+ parse/train/B1xmOgrFPS/B1xmOgrFPS_span.pdf filter=lfs diff=lfs merge=lfs -text
5347
+ parse/train/rylrdxHFDr/rylrdxHFDr_origin.pdf filter=lfs diff=lfs merge=lfs -text
5348
+ parse/train/rylrdxHFDr/rylrdxHFDr_span.pdf filter=lfs diff=lfs merge=lfs -text
5349
+ parse/train/rylrdxHFDr/rylrdxHFDr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5350
+ parse/train/SJeS16EKPr/SJeS16EKPr_layout.pdf filter=lfs diff=lfs merge=lfs -text
5351
+ parse/train/SJeS16EKPr/SJeS16EKPr_span.pdf filter=lfs diff=lfs merge=lfs -text
parse/dev/-ltZ1uw8ZE7/-ltZ1uw8ZE7.md ADDED
@@ -0,0 +1,409 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VARIATIONAL IMBALANCED REGRESSION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Existing regression models tend to fall short in both accuracy and uncertainty estimation when the label distribution is imbalanced. In this paper, we propose a probabilistic deep learning model, dubbed variational imbalanced regression (VIR), which not only performs well in imbalanced regression but naturally produces reasonable uncertainty estimation as a byproduct. Different from typical variational autoencoders assuming I.I.D. representations (a data point’s representation is not directly affected by other data points), our VIR borrows data with similar regression labels to compute the latent representation’s variational distribution; furthermore, different from deterministic regression models producing point estimates, VIR predicts the entire normal-inverse-gamma distributions and modulates the associated conjugate distributions to impose probabilistic reweighting on the imbalanced data, thereby providing better uncertainty estimation. Experiments in several real-world datasets show that our VIR can outperform state-of-the-art imbalanced regression models in terms of both accuracy and uncertainty estimation.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep regression models are currently the state of the art in making predictions in a continuous label space and have a wide range of successful applications in computer vision (Yin et al., 2021), natural language processing (Jiang et al., 2020), etc. However, these models fail however when the label distribution in training data is imbalanced. For example, in visual age estimation (Moschoglou et al., 2017), where a model infers the age of a person given her visual appearance, models are typically trained on imbalanced datasets with overwhelmingly more images of younger adults, leading to poor regression accuracy for images of children or elderly people (Yang et al., 2021). Such unreliability in imbalanced regression settings motivates the need for both improving performance for the minority in the presence of imbalanced data and, more importantly, providing reasonable uncertainty estimation to inform practitioners on how reliable the predictions are (especially for the minority where accuracy is lower).
12
+
13
+ Existing methods for deep imbalanced regression (DIR) only focus on improving the accuracy of deep regression models by smoothing the label distribution and reweighting data with different labels (Yang et al., 2021). On the other hand, methods that provide uncertainty estimation for deep regression models operates under the balance-data assumption and therefore do not work well in the imbalanced setting (Amini et al., 2020; Mi et al., 2022; Charpentier et al., 2022).
14
+
15
+ To simultaneously cover these two desiderata, we propose a probabilistic deep imbalanced regression model, dubbed variational imbalanced regression (VIR). Different from typical variational autoencoders assuming I.I.D. representations (a data point’s representation is not directly affected by other data points), our VIR assumes Neighboring and Identically Distributed (N.I.D.) and borrows data with similar regression labels to compute the latent representation’s variational distribution. Specifically, VIR first encodes a data point into a probabilistic representation and then mix it with neighboring representations (i.e., representations from data with similar regression labels) to produce its final probabilistic representation; VIR is therefore particularly useful for minority data as it can borrow probabilistic representations from data with similar labels (and naturally weigh them using our probabilistic model) to counteract data sparsity. Furthermore, different from deterministic regression models producing point estimates, VIR predicts the entire normal-inverse-gamma distributions and modulates the associated conjugate distributions by the importance weight computed from the smoothed label distribution to impose probabilistic reweighting on the imbalanced data. This allows the negative log likelihood to naturally put more focus on the minority data, thereby balancing the accuracy for data with different regression labels. Our VIR framework is compatible with any deep regression models and can be trained end to end.
16
+
17
+ We summarize our contributions as below:
18
+
19
+ 1. While previous work has studied imbalanced regression and uncertainty estimation separately, none of them has considered uncertainty estimation in the imbalanced setting. We identify the problem of probabilistic deep imbalanced regression as well as two desiderata, balanced accuracy and uncertainty estimation, for the problem.
20
+ 2. We propose VIR to simultaneously cover these two desiderata and achieve state-of-the-art performance compared to existing methods.
21
+ 3. As a byproduct, we also provide strong baselines for benchmarking high-quality uncertainty estimation and promising prediction performance on imbalanced datasets.
22
+
23
+ # 2 RELATED WORK
24
+
25
+ Variational Autoencoder. Variational autoencoder (VAE) (Kingma & Welling, 2014) is an unsupervised learning model that aims to infer probabilistic representations from data. However, as shown in Figure 1, VAE typically assumes I.I.D. representations, where a data point’s representation is not directly affected by other data points. In contrast, our VIR borrows data with similar regression labels to compute the latent representation’s variational distribution.
26
+
27
+ Imbalanced Regression. Imbalanced regression is underexplored in the machine learning community. Most existing methods for imbalanced regression are direct extensions of the SMOTE algorithm (Chawla et al., 2002), a commonly used algorithm for imbalanced classification, where data from the minority classes is over-sampled. These algorithms usually synthesize augmented data for the minority regression labels by either interpolating both inputs and labels (Torgo et al., 2013) or adding Gaussian noise (Branco et al., 2017; 2018).
28
+
29
+ ![](images/b7be9b38e271a8ff4b76dc20993db4bfe22725bec030a1bdd965140b6cd76526.jpg)
30
+ Figure 1: Comparison on inference networks between typical VAE (Kingma & Welling, 2014) and our VIR. In VAE (left), a data point’s latent representation (i.e. z) is affected only by itself, while in VIR (right), neighbors participate to modulate the final representation.
31
+
32
+ Such algorithms fail to the distance in continuous label space and fall short in handling highdimensional data (e.g., images and text). Recently, DIR (Yang et al., 2021) addresses these issues by applying kernel density estimation to smooth and reweight data on the continuous label distribution, achieving state-of-the-art performance. However, DIR only focuses on improving the accuracy, especially for the data with minority labels, and therefore does not provide uncertainty estimation, which is crucial to assess the predictions’ reliability. Ren et al. (2022) focuses on re-balancing the mean squared error (MSE) loss for imbalanced regression, and Gong et al. (2022) introduces ranking similarity for improving deep imbalanced regression. In contrast, our VIR provides a principled probabilistic approach to simultaneously achieve these two desiderata, not only improving upon DIR in terms of performance but also producing reasonable uncertainty estimation as a much-needed byproduct to assess model reliability. There is also related work on imbalanced classification (Deng et al., 2021), which is related to our work but focusing on classification rather than regression.
33
+
34
+ Uncertainty Estimation in Regression. There has been renewed interest in uncertainty estimation in the context of deep regression models (Kendall & Gal, 2017; Kuleshov et al., 2018; Song et al., 2019; Zelikman et al., 2020; Amini et al., 2020; Mi et al., 2022; van Amersfoort et al., 2021; Liu et al., 2020; Gal & Ghahramani, 2016; Stadler et al., 2021; Snoek et al., 2019; Heiss et al., 2022). Most existing methods either directly predict the variance of the output distribution as the estimated uncertainty (Kendall & Gal, 2017; Zhang et al., 2019; Amini et al., 2020) or rely on post-hoc confidence interval calibration (Kuleshov et al., 2018; Song et al., 2019; Zelikman et al., 2020). Meanwhile, Posterior Networks methods Charpentier et al. (2020; 2022); Stadler et al. (2021) consider conjugate distribution, pseudo-count interpretations, posterior updates, and variational losses for fast and high-quality uncertainty estimation. Closest to our work is Deep Evidential Regression (DER) (Amini et al., 2020), which attempts to estimate both aleatoric and epistemic uncertainty (Kendall & Gal, 2017; Hüllermeier & Waegeman, 2019) on regression tasks by training the neural networks to directly infer the parameters of the evidential distribution, thereby producing uncertainty measures. While Posterior Networks Charpentier et al. (2020; 2022) are designed for general classification/regression tasks and achieve promising performance, they do not explicitly consider imbalance in regression tasks, which is the focus of this paper. DER (Amini et al., 2020) is designed for the data-rich regime and therefore fails to reasonably estimate the uncertainty if the data is imbalanced; for data with minority labels, DER (Amini et al., 2020) tends produce unstable distribution parameters, leading to poor uncertainty estimation (as shown in Sec. 4). In contrast, our proposed VIR explicitly handles data imbalance in the continuous label space to avoid such instability; VIR does so by modulating both the representations and the output conjugate distribution parameters according to the imbalanced label distribution, allowing training/inference to proceed as if the data is balance and leading to better performance as well as uncertainty estimation (as shown in Sec. 4).
35
+
36
+ # 3 METHOD
37
+
38
+ In this section we introduce the problem setting, provide an overview of our VIR, and then describe details on each of VIR’s key components.
39
+
40
+ # 3.1 PROBLEM SETTINGS
41
+
42
+ Assuming an imbalanced dataset in continuous space $\{ \mathbf { x } _ { i } , y _ { i } \} _ { i = 1 } ^ { N }$ where $N$ is the total number of data points, $\mathbf { x } _ { i } ~ \in ~ \mathbb { R } ^ { d }$ is the input, and $y _ { i } \in \mathcal { V } \subset \mathbb { R }$ is the corresponding label from a continuous label space $\mathcal { V }$ . In practice, $\mathcal { V }$ is partitioned into $\mathbf { B }$ equal-interval bins $[ y ^ { ( 0 ) } , y ^ { ( 1 ) } ) , [ y ^ { ( 2 ) } , y ^ { ( 2 ) } ) , . . . , [ \hat { y } ^ { ( B - 1 ) } , y ^ { ( B ) } )$ , with slight notation overload. To directly compare with baselines, we use the same grouping index for target value $b \in \ B$ as in (Yang et al., 2021).
43
+
44
+ We denote representations as $\mathbf { z } _ { i }$ , and use $\left( \widetilde { \mathbf { z } } _ { i } ^ { \mu } , \widetilde { \mathbf { z } } _ { i } ^ { \Sigma } \right) ^ { \sim } =$ $q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ; \theta )$ e e to denote the probabilistic representations for input $\mathbf { x } _ { i }$ generated by a probabilistic encoder parameterized by $\theta$ . Similarly we use $( \widehat { y } _ { i } , \widehat { s } _ { i } )$ to denote the mean b band variance of the predictive distribution generated by a probabilistic predictor $p _ { \boldsymbol { \theta } } ( y _ { i } | \mathbf { z } )$ . Furthermore, we denote $\bar { \bf z }$ as the mean of representation $\mathbf { z } _ { i }$ in each bins (i.e., letting $\begin{array} { r } { \bar { \bf z } = \frac { 1 } { N _ { b } } \sum _ { i = 1 } ^ { N _ { b } } { \bf z } _ { i } } \end{array}$ in a bin with $N _ { b }$ data points).
45
+
46
+ # 3.2 METHOD OVERVIEW
47
+
48
+ In order to achieve both desiderata in probabilistic deep imbalanced regression (i.e., performance improvement and uncertainty estimation), our proposed variational imbalanced regression (VIR) operates on both the encoder $q _ { \phi } ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { \tilde { N } } )$ and the predictor $p _ { \theta } ( y _ { i } | \mathbf { z } _ { i } )$ .
49
+
50
+ ![](images/c4921b658189decfd8e43d9639b54fdb52e400aefc64428e1305230cfbc2288c.jpg)
51
+ Figure 2: Overview of our VIR method. Left: The inference model infers the latent representations given input x’s in the neighborhood. Right: The generative model reconstructs the input and predicts the label distribution (including the associated uncertainty) given the latent representation.
52
+
53
+ Typical VAE (Kingma & Welling, 2014) lower-bounds input $\mathbf { x } _ { i }$ ’s marginal likelihood; in contrast, VIR lower-bounds the marginal likelihood of input $\mathbf { x } _ { i }$ and labels $y _ { i }$ :
54
+
55
+ $$
56
+ \begin{array} { r } { \log p _ { \theta } ( \mathbf { x } _ { i } , y _ { i } ) = \mathcal { D } _ { K \mathcal { L } } \big ( q _ { \phi } ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } ) | | p _ { \theta } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } , y _ { i } ) \big ) + \mathcal { L } ( \theta , \phi ; \mathbf { x } _ { i } , y _ { i } ) . } \end{array}
57
+ $$
58
+
59
+ Note that our variational distribution $q _ { \phi } ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } )$ (1) does not conditions on labels $y _ { i }$ , since the task is to predict $y _ { i }$ and (2) conditions on all (neighboring) inputs $\{ { \mathbf { x } } _ { i } \} _ { i = 1 } ^ { N }$ rather than just $\mathbf { x } _ { i }$ . The second term $\mathcal { L } ( \boldsymbol { \theta } , \phi ; { \mathbf { x } } _ { i } , y _ { i } )$ is VIR’s evidence lower bound (ELBO), which is defined as:
60
+
61
+ $$
62
+ \begin{array} { r } { \mathcal { L } ( \theta , \phi ; \mathbf { x } _ { i } , y _ { i } ) = \underbrace { { \mathbb { E } } _ { q } \left[ \log p _ { \theta } ( \mathbf { x } _ { i } | \mathbf { z } _ { i } ) \right] } _ { \mathcal { L } _ { i } ^ { \mathcal { D } } } + \underbrace { { \mathbb { E } } _ { q } \left[ \log p _ { \theta } ( y _ { i } | \mathbf { z } _ { i } ) \right] } _ { \mathcal { L } _ { i } ^ { \mathcal { P } } } - \underbrace { \mathcal { D } _ { K \mathcal { L } } ( q _ { \phi } ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } ) | | p _ { \theta } ( \mathbf { z } _ { i } ) ) } _ { \mathcal { L } _ { i } ^ { K \mathcal { L } } } . } \end{array}
63
+ $$
64
+
65
+ where the $p _ { \theta } ( \mathbf { z } _ { i } )$ is the standard Gaussian prior $\mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ , following typical VAE (Kingma & Welling, 2014), and the expectation is taken over $q _ { \phi } ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } )$ , which infers $\mathbf { z } _ { i }$ by borrowing data with similar regression labels to produce the balanced probabilistic representations, which is beneficial especially for the minority (see Sec. 3.3 for details).
66
+
67
+ Different from typical regression models which produce only point estimates for $y _ { i }$ , our VIR’s predictor, $p _ { \theta } ( y _ { i } | \mathbf { z } _ { i } )$ , directly produces the parameters of the entire NIG distribution for $y _ { i }$ and further imposes probabilistic reweighting on the imbalanced data, thereby producing balanced predictive distributions (more details in Sec. 3.4).
68
+
69
+ # 3.3 CONSTRUCTING $q ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } )$
70
+
71
+ To cover both desiderata, one needs to (1) produce balanced representations to improve performance for the data with minority labels and (2) produce probabilistic representations to naturally obtain reasonable uncertainty estimation for each model prediction. To learn such balanced probabilistic representations, we construct the encoder of our VIR (i.e., $q _ { \phi } ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } ) )$ by (1) first encoding a data point into a probabilistic representation, (2) computing probabilistic statistics from neighboring representations (i.e., representations from data with similar regression labels), and (3) producing the final representations via probabilistic whitening and recoloring using the obtained statistics.
72
+
73
+ Probabilistic Representations. We first encode each data point into a probabilistic representation. Note that this is in contrast to existing work (Yang et al., 2021) that uses deterministic representations. We assume that each encoding $\mathbf { z } _ { i }$ is a Gaussian distribution with parameters $\{ \mathbf { z } _ { i } ^ { \mu } , \mathbf { z } _ { i } ^ { \Sigma } \}$ , which are generated from the last layer in the deep neural network.
74
+
75
+ From I.I.D. to Neighboring and Identically Distributed (N.I.D.). Typical VAE (Kingma & Welling, 2014) is an unsupervised learning model that aims to learn a variational representation from latent space to reconstruct the original inputs under the I.I.D. assumption; that is, in VAE, the latent value (i.e., $\mathbf { z } _ { i }$ ) is generated from its own input $\mathbf { x } _ { i }$ . This I.I.D. assumption works well for data with majority labels, but significantly harms performance for data with minority labels. To address this problem, we replace the I.I.D. assumption with the N.I.D. assumption; specifically, VIR’s variational latent representations still follow Gaussian distributions (i.e., $\bar { \mathcal { N } } ( \mathbf { z } _ { i } ^ { \mu } , \mathbf { z } _ { i } ^ { \Sigma } )$ , but these distributions will be first calibrated using data with neighboring labels. For a data point $\left( \mathbf { x } _ { i } , y _ { i } \right)$ where $y _ { i }$ is in the $b ^ { \prime }$ th bin, i.e., $y _ { i } \in [ y ^ { ( b - 1 ) } , y ^ { ( b ) } )$ , we compute $q ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } ) \triangleq \mathcal { N } ( \mathbf { z } _ { i } ; \widetilde \mathbf { z } _ { i } ^ { \mu } , \widetilde \mathbf { z } _ { i } ^ { \Sigma } )$ as
76
+
77
+ Mean and Covariance of Initial $\mathbf { z } _ { i }$ : ${ \bf z } _ { i } ^ { \mu } , { \bf z } _ { i } ^ { \Sigma } = \mathcal { T } ( { \bf x } _ { i } )$ ,
78
+
79
+ Smoothed Statistics of Bin $^ { b }$ ’s Statistics: $\widetilde { \mu } _ { b } ^ { \mu } , \widetilde { \mu } _ { b } ^ { \Sigma } , \widetilde { \Sigma } _ { b } ^ { \mu } , \widetilde { \Sigma } _ { b } ^ { \Sigma } = { \cal S } ( \{ \mu _ { b } ^ { \mu } , \mu _ { b } ^ { \Sigma } , \Sigma _ { b } ^ { \mu } , \Sigma _ { b } ^ { \Sigma } \} _ { b = 1 } ^ { B } ) ,$
80
+
81
+ Mean and Covariance of Final $\mathbf { z } _ { i }$ : $\widetilde { \mathbf { z } } _ { i } ^ { \mu } , \widetilde { \mathbf { z } } _ { i } ^ { \Sigma } = \mathcal { F } ( \mathbf { z } _ { i } ^ { \mu } , \mathbf { z } _ { i } ^ { \Sigma } , \mu _ { b } ^ { \mu } , \mu _ { b } ^ { \Sigma } , \boldsymbol { \Sigma } _ { b } ^ { \mu } , \boldsymbol { \Sigma } _ { b } ^ { \Sigma } , \widetilde { \mu } _ { b } ^ { \mu } , \widetilde { \mu } _ { b } ^ { \Sigma } , \widetilde { \boldsymbol { \Sigma } } _ { b } ^ { \mu } , \widetilde { \boldsymbol { \Sigma } } _ { b } ^ { \Sigma } ) .$ where the details of functions $\boldsymbol { \mathcal { T } } ( \cdot )$ $) , A ( \cdot ) , S ( \cdot )$ , and $\mathcal F ( \cdot )$ are described below.
82
+
83
+ Function $\boldsymbol { \mathcal { T } } ( \cdot )$ : From Deterministic to Probabilistic Statistics. Different from deterministic statistics in (Yang et al., 2021), our VIR’s encoder uses probabilistic statistics (i.e., statistics of statistics). Specifically, VIR treats $\mathbf { z } _ { i }$ as a distribution with the mean and covariance $( \mathbf { z } _ { i } ^ { \mu } , \mathbf { z } _ { i } ^ { \Sigma } ) = \mathcal { T } ( \mathbf { x } _ { i } )$ rather than a deterministic vector. As a result, all the deterministic statistics, $\pmb { \mu } _ { b }$ , $\Sigma _ { b }$ , $\widetilde { \mu } _ { b }$ , and $\widetilde { \Sigma } _ { b }$ are replaced by distributions with the means and covariances, $( \mu _ { b } ^ { \mu } , \mu _ { b } ^ { \Sigma } )$ , $( \Sigma _ { b } ^ { \mu } , \Sigma _ { b } ^ { \Sigma } )$ , $( \widetilde { \mu } _ { b } ^ { \mu } , \widetilde { \mu } _ { b } ^ { \Sigma } )$ , and $( \widetilde { \pmb { \Sigma } } _ { b } ^ { \mu } , \widetilde { \pmb { \Sigma } } _ { b } ^ { \Sigma } )$ , respectively (more details in the following three paragraphs on $\boldsymbol { \mathcal { A } } ( \cdot ) , \boldsymbol { S } ( \cdot )$ , and $\mathcal F ( \cdot )$ ).
84
+
85
+ Function $\boldsymbol { \mathcal { A } } ( \cdot )$ : Statistics of the current Bin $b$ ’s Statistics. As part of our probabilistic overall statistics, the probabilistic overall mean becomes a distribution with the mean (letting ${ \pmb { \mu } } _ { b } = { \bar { \bf z } }$ ) and covariance (assuming diagonal covariance):
86
+
87
+ $$
88
+ \begin{array} { r } { { \pmb \mu } _ { b } ^ { \mu } = \mathbb { E } [ \bar { \mathbf { z } } ] = \frac { 1 } { N _ { b } } \sum _ { i = 1 } ^ { N _ { b } } \mathbf { z } _ { i } ^ { \mu } , \mu _ { b } ^ { \Sigma } = \mathbb { V } [ \bar { \mathbf { z } } ] = \frac { 1 } { N _ { b } ^ { 2 } } \sum _ { i = 1 } ^ { N _ { b } } \mathbf { z } _ { i } ^ { \Sigma } . } \end{array}
89
+ $$
90
+
91
+ Similarly, our probabilistic overall covariance becomes a matrix-variate distribution (Gupta & Nagar, 2018) with the mean:
92
+
93
+ $$
94
+ { \pmb { \Sigma } } _ { b } ^ { \mu } = \frac { 1 } { N _ { b } } \sum _ { i = 1 } ^ { N _ { b } } ( { \bf z } _ { i } - { \bar { \bf z } } ) ^ { 2 } = \frac { 1 } { N _ { b } } \sum _ { i = 1 } ^ { N _ { b } } \Big [ { \bf z } _ { i } ^ { \Sigma } + ( { \bf z } _ { i } ^ { \mu } ) ^ { 2 } - \Big ( [ { \pmb { \mu } } _ { b } ^ { \Sigma } ] _ { i } + ( [ { \pmb { \mu } } _ { b } ^ { \mu } ] _ { i } ) ^ { 2 } \Big ) \Big ] ,
95
+ $$
96
+
97
+ since $\mathbb { E } [ \bar { \mathbf { z } } ] = \mu _ { b } ^ { \mu }$ and $\mathbb { V } [ \bar { \mathbf { z } } ] = \mu _ { b } ^ { \Sigma }$ . Note that the covariance of $\Sigma _ { b }$ , i.e., $\Sigma _ { b } ^ { \Sigma }$ , involves computing the fourth-order moments, which is computationally prohibitive. Therefore in practice, we directly set $\Sigma _ { b } ^ { \Sigma }$ to zero for simplicity; empirically we observe that such simplified treatment already achieves promising performance improvement upon the state of the art.
98
+
99
+ Function $\boldsymbol { \mathcal { S } } ( \cdot )$ : Neighboring Data and Smoothed Statistics. Next, we can borrow data with neighboring labels (from neighboring label bins) to compute the smoothed statistics of the current bin $b$ by applying a symmetric kernel $k ( \cdot , \cdot )$ (e.g., Gaussian, Laplacian, and Triangular kernels). Specifically, the probabilistic smoothed mean and covariance are (assuming diagonal covariance):
100
+
101
+ $$
102
+ \begin{array} { r } { \widetilde { \mu } _ { b } ^ { \mu } = \sum _ { b ^ { \prime } \in \mathcal { B } } k ( y _ { b } , y _ { b ^ { \prime } } ) \mu _ { b ^ { \prime } } ^ { \mu } , \widetilde { \mu } _ { b } ^ { \Sigma } = \sum _ { b ^ { \prime } \in \mathcal { B } } k ^ { 2 } ( y _ { b } , y _ { b ^ { \prime } } ) \mu _ { b ^ { \prime } } ^ { \Sigma } , \widetilde { \Sigma } _ { b } ^ { \mu } = \sum _ { b ^ { \prime } \in \mathcal { B } } k ( y _ { b } , y _ { b ^ { \prime } } ) \Sigma _ { b ^ { \prime } } . } \end{array}
103
+ $$
104
+
105
+ Function $\mathcal F ( \cdot )$ : Probabilistic Whitening and Recoloring. We develop a probabilistic version of the whitening and re-coloring procedure (Sun et al., 2016) used in (Yang et al., 2021). Specifically, we produce the final probabilistic representation $\{ \widetilde { \mathbf { z } } _ { i } ^ { \mu } , \widetilde { \mathbf { z } } _ { i } ^ { \Sigma } \}$ for each data point as:
106
+
107
+ $$
108
+ \widetilde { \mathbf { z } } _ { i } ^ { \mu } = ( \mathbf { z } _ { i } ^ { \mu } - \boldsymbol { \mu } _ { b } ^ { \mu } ) \cdot \sqrt { \frac { \widetilde { \mathbf { \boldsymbol { \Sigma } } } _ { b } ^ { \mu } } { \boldsymbol { \Sigma } _ { b } ^ { \mu } } } + \widetilde { \boldsymbol { \mu } } _ { b } ^ { \mu } , \quad \widetilde { \mathbf { z } } _ { i } ^ { \Sigma } = ( \mathbf { z } _ { i } ^ { \Sigma } + \boldsymbol { \mu } _ { b } ^ { \Sigma } ) \cdot \sqrt { \frac { \widetilde { \mathbf { \boldsymbol { \Sigma } } } _ { b } ^ { \mu } } { \boldsymbol { \Sigma } _ { b } ^ { \mu } } } + \widetilde { \boldsymbol { \mu } } _ { b } ^ { \Sigma } .
109
+ $$
110
+
111
+ Inspired by (Yang et al., 2021), we keep updating the probabilistic overall statistics, $\{ \pmb { \mu } _ { b } ^ { \mu } , \pmb { \mu } _ { b } ^ { \Sigma } , \pmb { \Sigma } _ { b } \}$ , and the probabilistic smoothed statistics, $\{ \widetilde { \mu } _ { b } ^ { \mu } , \widetilde { \mu } _ { b } ^ { \Sigma } \}$ , cross different epochs. The probabilistic representation $\{ \widetilde { \mathbf { z } } _ { i } ^ { \mu } , \widetilde { \mathbf { z } } _ { i } ^ { \Sigma } \}$ are then re-parameterized (Kingma & Welling, 2014) into the final representation $\mathbf { z } _ { i }$ e e, and passed into the final layer (discussed in Sec. 3.4) to generate the prediction and uncertainty estimation. Note that the computation of statistics from multiple $\mathbf { x }$ ’s is only needed during training. During testing, VIR directly uses these statistics and therefore does not need to re-compute them.
112
+
113
+ # 3.4 CONSTRUCTING $p ( y _ { i } | \mathbf { z } _ { i } )$
114
+
115
+ Our VIR’s predictor $p ( y _ { i } | \mathbf { z } _ { i } ) \triangleq \mathcal { N } ( y _ { i } ; \widehat { y } _ { i } , \widehat { s } _ { i } )$ predicts both the mean and variance for $y _ { i }$ by first b bpredicting the NIG distribution and then marginalizing out the latent variables. It is motivated by the following observations on label distribution smoothing (LDS) in (Yang et al., 2021) and deep evidental regression (DER) in (Amini et al., 2020), as well as intuitions on effective counts in conjugate distributions.
116
+
117
+ LDS’s Limitations in Our Probabilistic Imbalanced Regression Setting. The motivation of LDS (Yang et al., 2021) is that the empirical label distribution can not reflect the real label distribution in an imbalanced dataset with a continuous label space; consequently, reweighting methods for imbalanced regression fail due to these inaccurate label densities. By applying a smoothing kernel on the empirical label distribution, LDS tries to recover the effective label distribution, with which reweighting methods can obtain ‘better’ weights to improve imbalanced regression. However, in our probabilistic imbalanced regression, one needs to consider both (1) the performance for the data with minority labels and (2) uncertainty estimation for each model. However, LDS only focuses on improving the accuracy, especially for the data with minority labels, and therefore does not provide uncertainty estimation, which is crucial to assess the predictions’ reliability.
118
+
119
+ DER’s limitations in Our Probabilistic Imbalanced Regression Setting. In DER (Amini et al., 2020), the predicted labels with their correspond uncertainties are produced by the representation of the posterior parameters in Normal Inverse Gamma (NIG) distribution $N I G ( \gamma , \nu , \alpha , \beta )$ , while the model is trained via minimizing the negative log-likelihood (NLL) of a Student-t distribution:
120
+
121
+ $$
122
+ \begin{array} { r } { \mathcal { L } _ { i } ^ { D E R } = \frac { 1 } { 2 } \log ( \frac { \pi } { \nu } ) + ( \alpha + \frac { 1 } { 2 } ) \log ( ( y _ { i } - \gamma ) ^ { 2 } \nu + \Omega ) - \alpha \log ( \Omega ) + \log ( \frac { \Gamma ( \alpha ) } { \Gamma ( \alpha + \frac { 1 } { 2 } ) } ) , } \end{array}
123
+ $$
124
+
125
+ where $\Omega = 2 \beta ( 1 + \nu )$ . It is therefore nontrivial to properly incorporate a reweighting mechanism into the NLL. One straightforward approach is to directly reweight $\mathcal { L } _ { i } ^ { D E R }$ for different data points $( x _ { i } , y _ { i } )$ . However, this contradicts the formulation of NIG and often leads to poor performance, as we verify in Sec. 4.
126
+
127
+ Intuition of Pseudo-Counts for VIR. To properly incorporate different reweighting methods, our VIR relies on the intuition of pseudo-counts (pseudo-observations) in conjugate distributions (Bishop, 2006). Assuming Gaussian likelihood, the conjugate distributions would be an NIG distribution (Bishop, 2006), i.e., $( \mu , \Sigma ) \sim N I G ( \gamma , \nu , \alpha , \beta )$ , which means:
128
+
129
+ $$
130
+ \mu \sim { \mathcal N } ( \gamma , \Sigma / \nu ) , ~ \Sigma \sim \Gamma ^ { - 1 } ( \alpha , \beta ) ,
131
+ $$
132
+
133
+ where $\Gamma ^ { - 1 } ( \alpha , \beta )$ is an inverse gamma distribution. With a NIG prior distribution $N I G ( \gamma _ { 0 } , \nu _ { 0 } , \alpha _ { 0 } , \beta _ { 0 } )$ , the posterior distribution of the NIG after observing $n$ real data points are:
134
+
135
+ $$
136
+ \begin{array} { r } { \gamma _ { n } = \frac { \gamma _ { 0 } \nu _ { 0 } + n \Psi } { \nu _ { n } } , \quad \nu _ { n } = \nu _ { 0 } + n , \quad \alpha _ { n } = \alpha _ { 0 } + \frac { n } { 2 } , \quad \beta _ { n } = \beta _ { 0 } + \frac { 1 } { 2 } ( \gamma _ { 0 } ^ { 2 } \nu _ { 0 } ) + \Phi , } \end{array}
137
+ $$
138
+
139
+ where $\boldsymbol \Psi = \bar { \mathbf x }$ and $\begin{array} { r } { \Phi = \frac 1 2 ( \sum _ { i } \mathbf { x } _ { i } ^ { 2 } - \gamma _ { n } ^ { 2 } \nu _ { n } ) } \end{array}$ . Here $\nu _ { 0 }$ and $\alpha _ { 0 }$ can be interpreted as virtual observations, i.e., pseudo-counts or pseudo-observations that contribute to the posterior distribution. Overall, the mean of posterior distribution above can be interpreted as an estimation from $\left( 2 \alpha _ { 0 } + n \right)$ observations, with $2 \alpha _ { 0 }$ virtual observations and $n$ real observations. Similarly, the variance can be interpreted an estimation from $( \nu + n )$ observations. This intuition is crucial in developing the predictor of our VIR.
140
+
141
+ From Pseudo-Counts to Balanced Predictive Distributions. Based on the intuition above, we construct our predictor (i.e., $p ( y _ { i } | \mathbf { z } _ { i } ) )$ by (1) generating the parameters in the posterior distribution of NIG, (2) computing re-weighted parameters by imposing the importance weights obtained from LDS, and (3) producing the final prediction with corresponding uncertainty estimation.
142
+
143
+ Based on Eqn. 7, we feed the final representation $\{ { \mathbf { z } } _ { i } \} _ { i = 1 } ^ { N }$ generated from the Sec. 3.3 (Eqn. 5) into a linear layer to output the intermediate parameters $n _ { i } , \Psi _ { i } , \Phi _ { i }$ for data point $\left( \mathbf { x } _ { i } , y _ { i } \right)$ :
144
+
145
+ $$
146
+ n _ { i } , \Psi _ { i } , \Phi _ { i } = \mathcal G ( \mathbf { z } _ { i } ) , \quad \mathbf { z } _ { i } \sim q ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } ) = \mathcal N ( \mathbf { z } _ { i } ; \widetilde { \mathbf { z } } _ { i } ^ { \mu } , \widetilde { \mathbf { z } } _ { i } ^ { \Sigma } )
147
+ $$
148
+
149
+ We then apply the importance weights $\begin{array} { r } { \sum _ { b ^ { \prime } \in B } k ( y _ { b } , y _ { b ^ { \prime } } ) \big ) ^ { - \frac { 1 } { 2 } } } \end{array}$ calculated from the smoothed label distribution to the pseudo-count $n _ { i }$ to produce the re-weighted parameters of posterior distribution of NIG. Along with the pre-defined prior parameters $( \gamma _ { 0 } , \nu _ { 0 } , \alpha _ { 0 } , \beta _ { 0 } )$ , we are able to compute the parameters of posterior distribution $N I G ( \gamma _ { i } , \nu _ { i } , \alpha _ { i } , \beta _ { i } )$ for $\left( \mathbf { x } _ { i } , y _ { i } \right)$ :
150
+
151
+ $$
152
+ \begin{array} { r l } & { \gamma _ { i } ^ { * } = \frac { \gamma _ { 0 } \nu _ { 0 } + \big ( \sum _ { b ^ { \prime } \in B } k ( y _ { b } , y _ { b ^ { \prime } } ) \big ) ^ { - \frac { 1 } { 2 } } \cdot n _ { i } \Psi _ { i } } { \nu _ { n } ^ { * } } , \quad \nu _ { i } ^ { * } = \nu _ { 0 } + \big ( \sum _ { b ^ { \prime } \in B } k ( y _ { b } , y _ { b ^ { \prime } } ) \big ) ^ { - \frac { 1 } { 2 } } \cdot n _ { i } , } \\ & { \alpha _ { i } ^ { * } = \alpha _ { 0 } + \big ( \sum _ { b ^ { \prime } \in B } k ( y _ { b } , y _ { b ^ { \prime } } ) \big ) ^ { - \frac { 1 } { 2 } } \cdot \frac { n _ { i } } { 2 } , \quad \beta _ { i } ^ { * } = \beta _ { 0 } + \frac { 1 } { 2 } ( \gamma _ { 0 } ^ { 2 } \nu _ { 0 } ) + \Phi _ { i } . } \end{array}
153
+ $$
154
+
155
+ Based on the NIG posterior distribution, we can then compute final prediction and uncertainty estimation as
156
+
157
+ $$
158
+ \begin{array} { r } { \widehat { y } _ { i } = \gamma _ { i } ^ { * } , \widehat { s } _ { i } = \frac { \beta _ { i } ^ { * } } { \nu _ { i } ^ { * } ( \alpha _ { i } ^ { * } - 1 ) } . } \end{array}
159
+ $$
160
+
161
+ We use an objective function similar to Eqn. 6, but with different definitions of $( \gamma , \nu , \alpha , \beta )$ , to optimize our VIR model:
162
+
163
+ $$
164
+ \begin{array} { r } { \mathcal { L } _ { i } ^ { \mathcal { P } } = \mathbb { E } _ { q _ { \phi } ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } ) } \left[ \frac { 1 } { 2 } \log ( \frac { \pi } { \nu _ { i } ^ { * } } ) + ( \alpha _ { i } ^ { * } + \frac { 1 } { 2 } ) \log ( ( y _ { i } - \gamma _ { i } ^ { * } ) ^ { 2 } \nu _ { n } ^ { * } + \Omega ) - \alpha _ { i } ^ { * } \log ( \omega _ { i } ^ { * } ) + \log ( \frac { \Gamma ( \alpha _ { i } ^ { * } ) } { \Gamma ( \alpha _ { i } ^ { * } + \frac { 1 } { 2 } ) } ) \right] , } \end{array}
165
+ $$
166
+
167
+ where $\omega _ { i } ^ { * } = 2 \beta _ { i } ^ { * } ( 1 + \nu _ { i } ^ { * } )$ . Note that $\mathcal { L } _ { i } ^ { \mathcal { P } }$ is part of the ELBO in Eqn. 1. Similar to (Amini et al., 2020), we use an additional regularization term to achieve better accuracy1:
168
+
169
+ $$
170
+ \mathcal { L } _ { i } ^ { \mathcal { R } } = \left( \nu + 2 \alpha \right) \cdot | y _ { i } - \widehat { y } _ { i } | .
171
+ $$
172
+
173
+ $\mathcal { L } _ { i } ^ { \mathcal { P } }$ and $\mathcal { L } _ { i } ^ { \mathcal { R } }$ together constitute the objective function for learning the predictor $p ( \mathbf { y } _ { i } | \mathbf { z } _ { i } )$
174
+
175
+ # 3.5 FINAL OBJECTIVE FUNCTION
176
+
177
+ Putting together Sec. 3.3 and Sec. 3.4, our final objective function (to minimize) for VIR is:
178
+
179
+ $$
180
+ \begin{array} { r } { \mathcal { L } ^ { \mathcal { V I R } } = \sum _ { i = 1 } ^ { N } \mathcal { L } _ { i } ^ { \mathcal { V I R } } , \quad \mathcal { L } _ { i } ^ { \mathcal { V I R } } = \lambda \mathcal { L } _ { i } ^ { \mathcal { R } } - \mathcal { L } ( \boldsymbol { \theta } , \boldsymbol { \phi } ; \mathbf { x } _ { i } , y _ { i } ) = \lambda \mathcal { L } _ { i } ^ { \mathcal { R } } - \mathcal { L } _ { i } ^ { \mathcal { P } } - \mathcal { L } _ { i } ^ { \mathcal { D } } + \mathcal { L } _ { i } ^ { K \mathcal { L } } , } \end{array}
181
+ $$
182
+
183
+ where $\mathcal { L } ( \theta , \phi ; \mathbf { x } _ { i } , y _ { i } ) = \mathcal { L } _ { i } ^ { \mathcal { P } } + \mathcal { L } _ { i } ^ { \mathcal { D } } - \mathcal { L } _ { i } ^ { \mathcal { K L } }$ is the ELBO in Eqn. 1. $\lambda$ adjusts the importance of the additional regularizer and the ELBO, and thus lead to a better result both on accuracy and uncertainty estimation.
184
+
185
+ # 3.6 DISCUSSION ON I.I.D. AND N.I.D. ASSUMPTIONS
186
+
187
+ Generalization Error, Bias, and Variance. We could analyze the generalization error of our VIR by bounding the generalization with the sum of three terms: (a) the bias of our estimator, (2) the variance of our estimator, (3) model complexity. Essentially VIR uses the N.I.D. assumption increases our estimator’s bias, but significantly reduces its variance in the imbalanced setting. Since the model complexity is kept the same (using the same backbone neural network) as the baselines, N.I.D. will lead to a lower generalization error (see more discussion in Sec. A of the Appendix).
188
+
189
+ # 4 RESULTS
190
+
191
+ Datasets. In this work, we evaluate our methods in terms of prediction accuracy and uncertainty estimation on two imbalanced datasets2, AgeDB (Moschoglou et al., 2017), IMDB-WIKI (Rothe et al., 2018). We follow the preprocessing procedures in DIR (Yang et al., 2021). Details for label density distributions and levels of imbalance are discussed in DIR (Yang et al., 2021).
192
+
193
+ AgeDB-DIR: We use AgeDB-DIR constructed in DIR (Yang et al., 2021), which contains 12.2K images for training and 2.1K images for validation and testing. The maximum age in this dataset is 101 and the minimum age is 0, and the number of images per bin varies between 1 and 353.
194
+
195
+ IMDB-WIKI-DIR: We use IMDB-WIKI-DIR constructed in DIR (Yang et al., 2021), which contains 191.5K training images and 11.0K validation and testing images. The maximum age is 186 and minimum age is 0; the maximum bin density is 7149, and minimum bin density is 1.
196
+
197
+ STS-B-DIR: We use STS-B-DIR constructed in DIR (Yang et al., 2021), which contains 5.2K pairs of training sentences and 1.0K pairs for validation and testing. This dataset is a collection of sentence pairs generated from news headlines, video captions, etc. Each pair is annotated by multiple annotators with a similarity score between 0 and 5.
198
+
199
+ Baselines. We use ResNet-50 (He et al., 2016) as our backbone network, and we describe the baselines below.
200
+
201
+ Vanilla: We use the term VANILLA to denote a plain model without adding any approaches.
202
+
203
+ Synthetic-Sample-Based Methods: Various existing imbalanced regression methods are also included as baselines; these include SMOTER (Torgo et al., 2013) and SMOGN (Branco et al., 2017). Furthermore, following DIR (Yang et al., 2021), in IMDB-WIKI-DIR, we also include another two methods: MIXUP (Zhang et al., 2018) and M-MIXUP (Verma et al., 2019).
204
+
205
+ Cost-Sensitive Reweighting: As shown in DIR (Yang et al., 2021), the square-root weighting variant (SQINV) baseline (i.e. $\begin{array} { r } { \big ( \sum _ { b ^ { \prime } \in B } k ( y _ { b } , y _ { b ^ { \prime } } ) \big ) ^ { - \frac { 1 } { 2 } } . } \end{array}$ ) always outperforms Vanilla. Therefore, for simplicity and fair comparison, all our experiments (for both baselines and VIR) use SQINV weighting. To use SQINV in VIR, one simply needs to use the symmetric kernel $k ( \cdot , \cdot )$ described in Sec. 3.3. To use SQINV in DER, we replace the final layer in DIR (Yang et al., 2021) with the DER layer (Amini et al., 2020) to produce the predictive distributions.
206
+
207
+ Evaluation Metrics - Accuracy. We follow the evaluation metrics in (Yang et al., 2021) to evaluate the accuracy of our proposed methods; these include Mean Absolute Error (MAE), Mean Squared Error (MSE), and Geometric Mean (GM). The formulas for these metrics are as follows:
208
+
209
+ $$
210
+ \begin{array} { r } { \mathtt { M A E } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } | y _ { i } - \widehat { y } _ { i } | , \mathtt { M S E } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } ( y _ { i } - \widehat { y } _ { i } ) ^ { 2 } , \mathtt { G M } = \Big [ \prod _ { i = 1 } ^ { N } | y _ { i } - \widehat { y } _ { i } | \Big ] ^ { \frac { 1 } { N } } . } \end{array}
211
+ $$
212
+
213
+ Evaluation Metrics - Uncertainty Estimation. We use typical evaluation metrics for uncertainty estimation in regression problems to evaluate our produced uncertainty estimation; these include Negative Log Likelihood (NLL), Area Under Sparsification Error (AUSE). Eqn. 8 shows the formula for NLL, and more details regarding to AUSE can be found in $\mathrm { I l g }$ et al., 2018).
214
+
215
+ Evaluation Process. Following (Liu et al., 2019; Yang et al., 2021), for a data sample $x _ { i }$ with its label $y _ { i }$ which falls into the target bins $b _ { i }$ , we divide the label space into three disjoint subsets: many-shot region $\{ b _ { i } \in \mathcal { B } \mid y _ { i } \in b _ { i } \& \ \left| y _ { i } \right| > 1 0 0 \}$ , medium-shot region $\{ b _ { i } \in B \mid y _ { i } \in b _ { i }$ & $2 0 \leq | y _ { i } | \leq$ $1 0 0 \}$ , and few-shot region $\{ b _ { i } \in B \mid y _ { i } \in b _ { i } \& \ \left| y _ { i } \right| < 2 0 \}$ , where $| \cdot |$ denotes the cardinality of the set. We report results on the overall test set and these subsets with the accuracy metrics discussed above.
216
+
217
+ Implementation Details. We use ResNet-50 (He et al., 2016) for all experiments in AgeDB-DIR and IMDB-WIKI-DIR. We use the Adam optimizer (Kingma & Ba, 2015) to train all models for 100 epochs, with same learning rate and decay by 0.1 and the 60-th and 90-th epoch, respectively. In order to determine the optimal batch size for training, we try different batch sizes and achieve the same conclusion as the DIR paper, i.e., the optimal batch size is 256 when other hyperparameters are fixed. Therefore, we stick to the batch size of 256 through out the experiments in the paper. Meanwhile, we use the same hyperparameters as in DIR (Yang et al., 2021).
218
+
219
+ Table 1: Evaluation results of accuracy on AgeDB-DIR.
220
+
221
+ <table><tr><td>Metrics</td><td colspan="4">MSE↓</td><td colspan="4">MAE↓</td><td colspan="4">GM↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>Al</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>VANILLA (Yang et al.,2021)</td><td>101.28</td><td>78.40</td><td>131.17</td><td>256.32</td><td>7.79</td><td>6.70</td><td>9.42</td><td>13.98</td><td>5.18</td><td>4.53</td><td>6.75</td><td>11.54</td></tr><tr><td>DEEP ENSEMBLE (Lakshminarayanan et al., 2017)</td><td>100.94</td><td>79.30</td><td>129.95</td><td>249.18</td><td>7.73</td><td>6.62</td><td>9.37</td><td>13.90</td><td>4.87</td><td>4.37</td><td>6.50</td><td>11.35</td></tr><tr><td>SMOTER (Torgo et al.,2013)</td><td>114.34</td><td>93.35</td><td>129.89</td><td>244.57</td><td>8.16</td><td>7.39</td><td>8.65</td><td>12.28</td><td>5.21</td><td>4.65</td><td>5.69</td><td>8.49</td></tr><tr><td>SMOGN (Branco et al.,2017)</td><td>117.29</td><td>101.36</td><td>133.86</td><td>232.90</td><td>8.26</td><td>7.64</td><td>9.01</td><td>12.09</td><td>5.36</td><td>4.90</td><td>6.19</td><td>8.44</td></tr><tr><td>SQINV (Yang etal.,2021)</td><td>104.76</td><td>92.67</td><td>127.04</td><td>205.16</td><td>7.92</td><td>7.42</td><td>8.80</td><td>11.46</td><td>5.03</td><td>4.81</td><td>5.72</td><td>8.23</td></tr><tr><td>DER (Amini et al.,2020)</td><td>106.81</td><td>91.32</td><td>122.45</td><td>209.76</td><td>8.11</td><td>7.36</td><td>9.03</td><td>12.69</td><td>5.31</td><td>4.65</td><td>6.48</td><td>10.52</td></tr><tr><td>FDS (Yang et al.,2021)</td><td>109.78</td><td>93.99</td><td>124.96</td><td>216.97</td><td>8.12</td><td>7.52</td><td>8.68</td><td>12.25</td><td>5.13</td><td>4.80</td><td>5.97</td><td>8.85</td></tr><tr><td>LDS (Yang et al., 2021)</td><td>102.22</td><td>83.62</td><td>128.73</td><td>204.64</td><td>7.67</td><td>6.98</td><td>8.86</td><td>10.89</td><td>4.85</td><td>4.39</td><td>5.80</td><td>7.45</td></tr><tr><td>LDS +FDS (Yang et al., 2021)</td><td>102.16</td><td>86.99</td><td>128.04</td><td>199.18</td><td>7.82</td><td>7.19</td><td>9.08</td><td>11.24</td><td>5.01</td><td>4.56</td><td>6.10</td><td>7.02</td></tr><tr><td>FDS + RANKSIM (Gong et al., 2022)</td><td>83.51</td><td>71.99</td><td>99.14</td><td>149.05</td><td>7.02</td><td>6.49</td><td>7.84</td><td>9.68</td><td>4.53</td><td>4.13</td><td>5.37</td><td>6.89</td></tr><tr><td>LDS + FDS + RANKSIM(Gong et al.,2022)</td><td>84.96</td><td>74.27</td><td>93.64</td><td>161.92</td><td>7.03</td><td>6.54</td><td>7.68</td><td>9.92</td><td>4.45</td><td>4.07</td><td>5.23</td><td>6.35</td></tr><tr><td>LDS + FDS + DER (Yang et al.,2021; Amini et al., 2020)</td><td>112.62</td><td>94.21</td><td>140.03</td><td>210.72</td><td>8.18</td><td>7.44</td><td>9.52</td><td>11.45</td><td>5.30</td><td>4.75</td><td>6.74</td><td>7.68</td></tr><tr><td>VIR (OURS)</td><td>86.89</td><td>77.69</td><td>96.55</td><td>145.76</td><td>7.14</td><td>6.67</td><td>7.70</td><td>9.52</td><td>4.58</td><td>4.27</td><td>5.09</td><td>6.31</td></tr><tr><td>OURS VS. VANILLA</td><td>+14.39</td><td>+0.71</td><td>+34.62</td><td>+110.56</td><td>+0.65</td><td>+0.03</td><td>+1.72</td><td>+4.46</td><td>+0.60</td><td>+0.26</td><td>+1.66</td><td>+5.23</td></tr><tr><td>OURS VS. SQINV</td><td>+17.87</td><td>+14.98</td><td>+30.49</td><td>+59.40</td><td>+0.78</td><td>+0.75</td><td>+1.10</td><td>+1.94</td><td>+0.45</td><td>+0.54</td><td>+0.63</td><td>+1.92</td></tr><tr><td>OURS VS. DER</td><td>+19.92</td><td>+13.63</td><td>+25.90</td><td>+64.00</td><td>+0.97</td><td>+0.69</td><td>+1.33</td><td>+3.17</td><td>+0.73</td><td>+0.38</td><td>+1.39</td><td>+4.21</td></tr><tr><td>OURS VS. LDS + FDS (SOTA IN DIR)</td><td>+15.27</td><td>+9.30</td><td>+31.49</td><td>+53.42</td><td>+0.68</td><td>+0.52</td><td>+1.38</td><td>+1.72</td><td>+0.43</td><td>+0.29</td><td>+1.01</td><td>+0.71</td></tr></table>
222
+
223
+ We use PyTorch to implement our method. For fair comparison, we implemented a PyTorch version for the official TensorFlow implementation of DER(Amini et al., 2020). To make sure we can obtain the reasonable uncertainty estimations, we restrict the range for $\alpha$ to $[ 1 . 5 , \infty )$ instead of $[ 1 . 0 , \infty )$ in DER. Besides, in the activation function SoftPlus, we set the hyperparameter beta to 0.1. As discussed in Sec. 3.4, we implement a layer which produces the parameters $n , \Psi , \Omega$ . We assign 2 as the minimum number for $n$ , and use the same hyperparameter settings for activation function for DER layer.
224
+
225
+ To search for a combination hyperparameters of prior distribution $\{ \gamma _ { 0 } , \nu _ { 0 } , \alpha _ { 0 } , \beta _ { 0 } \}$ for NIG, we combine grid search method and random search method (Bergstra & Bengio, 2012) to select the best hyperparameters. We first intuitively assign a value and a proper range with some step sizes which correspond to the hyperparameters, then, we apply grid search to search for the best combination for the hyperparameters on prior distributions. After locating a smaller range for each hyperparameters, we use random search to search for better combinations, if it exists. In the end, we find our best hyperparameter combinations for NIG prior distributions.
226
+
227
+ # 4.1 RESULTS FOR IMBALANCED REGRESSION ACCURACY
228
+
229
+ We report the accuracy of different methods in Table 1 and Table 2 for AgeDB-DIR and IMDB-WIKIDIR, respectively3. In both tables, we can conclude that our methods outperform the baselines in their categories. For ablation studies, see Table 5 and Table 6 of the Appendix. Note that to ensure fair and solid comparison, we re-run the DIR methods based on our machine and software settings4.
230
+
231
+ Overall Performance. As shown in the last category (i.e., last four rows) of both tables, our proposed method’s best variants compare favorably against the state of the art including DIR variants (Yang et al., 2021) and DER (Amini et al., 2020), especially on the imbalanced data samples (i.e., in the few-shot columns). This verifies the effectiveness of our methods in terms of overall performance.
232
+
233
+ # 4.2 RESULTS FOR IMBALANCED REGRESSION UNCERTAINTY ESTIMATION
234
+
235
+ Different from DIR (Yang et al., 2021) which only focuses on accuracy, we create a new benchmark for uncertainty estimation in imbalanced regression. Table 3 and Table 4 show the results on uncertainty estimation for two datasets AgeDB-DIR and IMDB-WIKI-DIR, respectively. Note that most baselines from Table 1 and Table 2 are deterministic methods (as opposed to probabilistic methods like ours) and cannot provide uncertainty estimation; therefore they are not applicable here. To show the superiority of our VIR model, we create a strongest baseline by concatenating the DIR variants $\mathrm { ( L D S + F D S ) }$ ) with the DER (Amini et al., 2020).
236
+
237
+ Table 2: Evaluation results of accuracy on IMDB-WIKI-DIR.
238
+
239
+ <table><tr><td>Metrics</td><td colspan="4">MSE↓</td><td colspan="4">MAE↓</td><td colspan="4">GM↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>VANILLA (Yang et al.,2021)</td><td>135.48</td><td>107.01</td><td>352.02</td><td>973.73</td><td>7.99</td><td>7.18</td><td>14.88</td><td>26.72</td><td>4.51</td><td>4.12</td><td>10.46</td><td>21.40</td></tr><tr><td>MIXUP (Zhang et al.,2018)</td><td>141.11</td><td>109.13</td><td>389.95</td><td>1037.98</td><td>8.22</td><td>7.29</td><td>16.23</td><td>28.11</td><td>4.68</td><td>4.22</td><td>12.28</td><td>23.55</td></tr><tr><td>M-MIXUP (Verma et al., 2019)</td><td>137.45</td><td>108.33</td><td>363.72</td><td>957.53</td><td>8.22</td><td>7.39</td><td>15.24</td><td>26.70</td><td>4.80</td><td>4.39</td><td>10.85</td><td>21.86</td></tr><tr><td>SMOTER (Torgo et al., 2013)</td><td>138.75</td><td>111.55</td><td>346.09</td><td>935.89</td><td>8.14</td><td>7.42</td><td>14.15</td><td>25.28</td><td>4.64</td><td>4.30</td><td>9.05</td><td>19.46</td></tr><tr><td>SMOGN (Branco et al.,2017)</td><td>136.09</td><td>109.15</td><td>339.09</td><td>944.20</td><td>8.03</td><td>7.30</td><td>14.02</td><td>25.93</td><td>4.63</td><td>4.30</td><td>8.74</td><td>20.12</td></tr><tr><td>SQINV (Yang et al., 2021)</td><td>134.36</td><td>111.23</td><td>308.63</td><td>834.08</td><td>7.87</td><td>7.24</td><td>12.44</td><td>22.76</td><td>4.47</td><td>4.22</td><td>7.25</td><td>15.10</td></tr><tr><td>DER (Amini et al.,020)</td><td>133.81</td><td>107.51</td><td>332.90</td><td>916.18</td><td>7.85</td><td>7.18</td><td>13.35</td><td>24.12</td><td>4.47</td><td>4.18</td><td>8.18</td><td>15.18</td></tr><tr><td>FDS (Yang et al., 2021)</td><td>131.93</td><td>107.76</td><td>311.29</td><td>880.32</td><td>7.80</td><td>7.20</td><td>12.64</td><td>23.20</td><td>4.39</td><td>4.16</td><td>7.04</td><td>13.42</td></tr><tr><td>LDS (Yang et al.,2021)</td><td>133.93</td><td>109.70</td><td>320.26</td><td>830.81</td><td>7.91</td><td>7.30</td><td>13.02</td><td>22.41</td><td>4.48</td><td>4.22</td><td>7.72</td><td>13.75</td></tr><tr><td>LDS + FDS (Yang et al., 2021)</td><td>136.72</td><td>112.76</td><td>322.50</td><td>811.83</td><td>8.08</td><td>7.47</td><td>13.21</td><td>22.54</td><td>4.66</td><td>4.39</td><td>8.01</td><td>14.33</td></tr><tr><td>LDS + FDS + DER (Yang et al.,2021; Amini et al.,2020)</td><td>120.86</td><td>97.75</td><td>297.64</td><td>873.10</td><td>7.24</td><td>6.64</td><td>11.87</td><td>23.44</td><td>3.93</td><td>3.69</td><td>6.64</td><td>16.00</td></tr><tr><td>VIR(OURS)</td><td>119.60</td><td>99.25</td><td>298.85</td><td>809.34</td><td>7.23</td><td>6.66</td><td>11.90</td><td>21.78</td><td>3.90</td><td>3.68</td><td>6.51</td><td>13.34</td></tr><tr><td>OURS VS. VANILLA</td><td>+15.88</td><td>+7.76</td><td>+53.17</td><td>+164.39</td><td>+0.76</td><td>+0.52</td><td>+2.98</td><td>+4.94</td><td>+0.61</td><td>+0.44</td><td>+3.95</td><td>+8.06</td></tr><tr><td>OURS VS. SQINV</td><td>+14.76</td><td>+11.98</td><td>+9.78</td><td>+24.74</td><td>+0.64</td><td>+0.58</td><td>+0.54</td><td>+0.98</td><td>+0.57</td><td>+0.54</td><td>+0.74</td><td>+1.76</td></tr><tr><td>OURS VS.DER</td><td>+14.21</td><td>+8.26</td><td>+34.05</td><td>+106.84</td><td>+0.62</td><td>+0.52</td><td>+1.45</td><td>+2.34</td><td>+0.57</td><td>+0.50</td><td>+1.67</td><td>+1.84</td></tr><tr><td>OURS VS.LDS + FDS (SOTA IN DIR)</td><td>+17.12</td><td>+13.51</td><td>+23.65</td><td>+2.49</td><td>+0.85</td><td>+0.81</td><td>+1.31</td><td>+0.76</td><td>+0.76</td><td>+0.71</td><td>+1.50</td><td>+0.99</td></tr></table>
240
+
241
+ Table 3: Uncertainty estimation results on AgeDB-DIR.
242
+
243
+ <table><tr><td>Metrics</td><td></td><td colspan="3">NLL↓</td><td></td><td colspan="3">AUSE↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>DEEP ENSEMBLE (Lakshminarayanan et al., 2017)</td><td>5.311</td><td>4.031</td><td>6.726</td><td>8.523</td><td>0.541</td><td>0.626</td><td>0.466</td><td>0.483</td></tr><tr><td>DER (Amini et al., 2020)</td><td>3.936</td><td>3.768</td><td>3.865</td><td>4.421</td><td>0.590</td><td>0.449</td><td>0.468</td><td>0.500</td></tr><tr><td>LDS + FDS + DER (Yang et al., 2021; Amini et al., 2020)</td><td>3.794</td><td>3.699</td><td>3.969</td><td>4.214</td><td>0.463</td><td>0.260</td><td>0.392</td><td>0.617</td></tr><tr><td>VIR (OURS)</td><td>3.703</td><td>3.598</td><td>3.805</td><td>4.196</td><td>0.437</td><td>0.474</td><td>0.319</td><td>0.413</td></tr><tr><td>OURS VS. DER</td><td></td><td>|+0.064 +0.071 +0.060 +0.225|+0.153 +0.026 +0.007 +0.036</td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
244
+
245
+ Results show that VIR outperform the baselines in all few-shot metrics. In some categories, VIR may not perform better in the overall, many-shot and median shot metrics, but the gap tends to be minimal. Note that our proposed methods mainly focus on the imbalanced setting, therefore we also
246
+
247
+ focus on the few-shot metrics. Lastly, comparing our model variant with the best performance against the baseline (DER), we can conclude that our methods successfully improve uncertainty estimation in the probabilistic imbalanced regression setting.
248
+
249
+ We also observe that the improvements of the uncertainty estimation on IMDB-WIKI are larger than those on Age-DB. We suspect that this because IMDB-WIKI contains much more training, validating and testing data, therefore enjoying more stable
250
+
251
+ Table 4: Uncertainty estimation results on IMDB-WIKI-DIR.
252
+
253
+ <table><tr><td>Metrics</td><td colspan="4">NLL↓</td><td colspan="4">AUSE↓</td></tr><tr><td>Shot</td><td>Al</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>DER (Amini et al.,2020)</td><td>3.850</td><td>3.699</td><td>4.997</td><td>6.638</td><td>0.813</td><td>0.802</td><td>0.650</td><td>0.541</td></tr><tr><td>LDS +FDS + DER (Yang et al.,2021; Amini et al.,020)</td><td>3.683</td><td>3.602</td><td>4.391</td><td>5.697</td><td>0.784</td><td>0.670</td><td>0.455</td><td>0.483</td></tr><tr><td>VIR(OURS)</td><td>3.652</td><td>3.568</td><td>4.419</td><td>5.560</td><td>0.622</td><td>0.645</td><td>0.511</td><td>0.374</td></tr><tr><td>OURS VS.DER</td><td></td><td></td><td>|+0.198 +0.131 +0.578 +1.078|+0.191 +0.157 +0.202 +0.167</td><td></td><td></td><td></td><td></td><td></td></tr></table>
254
+
255
+ uncertainty estimation improvements brought by VIR compared to those in Age-DB.
256
+
257
+ # 5 CONCLUSION
258
+
259
+ We identify the problem of probabilistic deep imbalanced regression, which aims to both improve accuracy and obtain reasonable uncertainty estimation in imbalanced regression. We propose VIR, which can use any deep regression models as backbone networks. VIR borrows data with similar regression labels to produce the probabilistic representations and modulates the conjugate distributions to impose probabilistic reweighting on imbalanced data. Furthermore, we create new benchmarks for uncertainty estimation on imbalanced regression. Experiments show that our methods outperform state-of-the-art imbalanced regression models in terms of both accuracy and uncertainty estimation. Future work may include (1) improving VIR by better approximating variance of the variances in probability distributions, and (2) developing novel approaches that can achieve stable performance even on imbalanced data with limited sample size, and (3) exploring techniques such as mixture density networks (Bishop, 1994) to enable multi-modality in the latent distribution, thereby further improving the performance.
260
+
261
+ # REFERENCES
262
+
263
+ Alexander Amini, Wilko Schwarting, Ava Soleimany, and Daniela Rus. Deep evidential regression. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
264
+
265
+ James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. J. Mach. Learn. Res., 13:281–305, 2012.
266
+
267
+ Christopher M. Bishop. Mixture density networks. Technical report, 1994.
268
+
269
+ Christopher M Bishop. Pattern recognition and machine learning. springer, 2006.
270
+
271
+ Paula Branco, Luís Torgo, and Rita P. Ribeiro. SMOGN: a pre-processing approach for imbalanced regression. In First International Workshop on Learning with Imbalanced Domains: Theory and Applications, LIDTA@PKDD/ECML 2017, 22 September 2017, Skopje, Macedonia, volume 74 of Proceedings of Machine Learning Research, pp. 36–50. PMLR, 2017.
272
+
273
+ Paula Branco, Luís Torgo, and Rita P. Ribeiro. REBAGG: resampled bagging for imbalanced regression. In Second International Workshop on Learning with Imbalanced Domains: Theory and Applications, LIDTA@ECML/PKDD 2018, Dublin, Ireland, September 10, 2018, volume 94 of Proceedings of Machine Learning Research, pp. 67–81. PMLR, 2018.
274
+
275
+ Bertrand Charpentier, Daniel Zügner, and Stephan Günnemann. Posterior Network: Uncertainty Estimation without OOD Samples via Density-Based Pseudo-Counts. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
276
+
277
+ Bertrand Charpentier, Oliver Borchert, Daniel Zügner, Simon Geisler, and Stephan Günnemann. Natural Posterior Network: Deep Bayesian Predictive Uncertainty for Exponential Family Distributions. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022.
278
+
279
+ Nitesh V Chawla, Kevin W Bowyer, Lawrence O Hall, and W Philip Kegelmeyer. Smote: synthetic minority over-sampling technique. Journal of artificial intelligence research, 16:321–357, 2002.
280
+
281
+ Zongyong Deng, Hao Liu, Yaoxing Wang, Chenyang Wang, Zekuan Yu, and Xuehong Sun. PML: progressive margin loss for long-tailed age classification. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021, 2021.
282
+
283
+ Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, volume 48 of JMLR Workshop and Conference Proceedings, pp. 1050–1059. JMLR.org, 2016.
284
+
285
+ Yu Gong, Greg Mori, and Frederick Tung. RankSim: Ranking Similarity Regularization for Deep Imbalanced Regression. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 7634–7649. PMLR, 2022.
286
+
287
+ Arjun K Gupta and Daya K Nagar. Matrix variate distributions, volume 104. CRC Press, 2018.
288
+
289
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 770–778. IEEE Computer Society, 2016.
290
+
291
+ Jakob Heiss, Jakob Weissteiner, Hanna S. Wutte, Sven Seuken, and Josef Teichmann. NOMU: Neural Optimization-based Model Uncertainty. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 8708–8758. PMLR, 2022.
292
+
293
+ Eyke Hüllermeier and Willem Waegeman. Aleatoric and epistemic uncertainty in machine learning: A tutorial introduction. CoRR, abs/1910.09457, 2019.
294
+
295
+ Eddy Ilg, Özgün cCiccek, Silvio Galesso, Aaron Klein, Osama Makansi, Frank Hutter, and Thomas Brox. Uncertainty estimates and multi-hypotheses networks for optical flow. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss (eds.), Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part VII, volume 11211 of Lecture Notes in Computer Science, pp. 677–693. Springer, 2018.
296
+
297
+ Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Tuo Zhao. SMART: robust and efficient fine-tuning for pre-trained natural language models through principled regularized optimization. In Dan Jurafsky, Joyce Chai, Natalie Schluter, and Joel R. Tetreault (eds.), Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pp. 2177–2190. Association for Computational Linguistics, 2020.
298
+
299
+ Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? arXiv preprint arXiv:1703.04977, 2017.
300
+
301
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
302
+
303
+ Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun (eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
304
+
305
+ Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression. In International Conference on Machine Learning, pp. 2796–2804. PMLR, 2018.
306
+
307
+ Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 6402–6413, 2017.
308
+
309
+ Jeremiah Liu, Zi Lin, Shreyas Padhy, Dustin Tran, Tania Bedrax Weiss, and Balaji Lakshminarayanan. Simple and Principled Uncertainty Estimation with Deterministic Deep Learning via Distance Awareness. In Advances in Neural Information Processing Systems, volume 33. Curran Associates, Inc., 2020.
310
+
311
+ Ziwei Liu, Zhongqi Miao, Xiaohang Zhan, Jiayun Wang, Boqing Gong, and Stella X. Yu. Large-scale long-tailed recognition in an open world. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 2537–2546. Computer Vision Foundation / IEEE, 2019.
312
+
313
+ Lu Mi, Hao Wang, Yonglong Tian, and Nir Shavit. Training-free uncertainty estimation for neural networks. In AAAI, 2022.
314
+
315
+ Stylianos Moschoglou, Athanasios Papaioannou, Christos Sagonas, Jiankang Deng, Irene Kotsia, and Stefanos Zafeiriou. Agedb: The first manually collected, in-the-wild age database. In 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops, CVPR Workshops 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 1997–2005, 2017.
316
+
317
+ Jiawei Ren, Mingyuan Zhang, Cunjun Yu, and Ziwei Liu. Balanced MSE for Imbalanced Visual Regression. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022, New Orleans, LA, USA, June 18-24, 2022, pp. 7916–7925. IEEE, 2022.
318
+
319
+ Rasmus Rothe, Radu Timofte, and Luc Van Gool. Deep expectation of real and apparent age from a single image without facial landmarks. Int. J. Comput. Vis., 126(2-4):144–157, 2018.
320
+
321
+ Jasper Snoek, Yaniv Ovadia, Emily Fertig, Balaji Lakshminarayanan, Sebastian Nowozin, D. Sculley, Joshua V. Dillon, Jie Ren, and Zachary Nado. Can you trust your model’s uncertainty? Evaluating predictive uncertainty under dataset shift. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 13969–13980, 2019.
322
+
323
+ Hao Song, Tom Diethe, Meelis Kull, and Peter Flach. Distribution calibration for regression. In International Conference on Machine Learning, pp. 5897–5906. PMLR, 2019.
324
+
325
+ Maximilian Stadler, Bertrand Charpentier, Simon Geisler, Daniel Zügner, and Stephan Günnemann. Graph Posterior Network: Bayesian Predictive Uncertainty for Node Classification. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 18033–18048, 2021.
326
+
327
+ Baochen Sun, Jiashi Feng, and Kate Saenko. Return of frustratingly easy domain adaptation. In Dale Schuurmans and Michael P. Wellman (eds.), Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, February 12-17, 2016, Phoenix, Arizona, USA, pp. 2058–2065. AAAI Press, 2016.
328
+
329
+ Luís Torgo, Rita P. Ribeiro, Bernhard Pfahringer, and Paula Branco. SMOTE for regression. In Luís Correia, Luís Paulo Reis, and José Cascalho (eds.), Progress in Artificial Intelligence - 16th Portuguese Conference on Artificial Intelligence, EPIA 2013, Angra do Heroísmo, Azores, Portugal, September 9-12, 2013. Proceedings, volume 8154 of Lecture Notes in Computer Science, pp. 378–389. Springer, 2013.
330
+
331
+ Joost van Amersfoort, Lewis Smith, Andrew Jesson, Oscar Key, and Yarin Gal. Improving Deterministic Uncertainty Estimation in Deep Learning for Classification and Regression. CoRR, abs/2102.11409, 2021.
332
+
333
+ Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, David Lopez-Paz, and Yoshua Bengio. Manifold mixup: Better representations by interpolating hidden states. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 6438–6447. PMLR, 2019.
334
+
335
+ Yuzhe Yang, Kaiwen Zha, Ying-Cong Chen, Hao Wang, and Dina Katabi. Delving into deep imbalanced regression. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 11842–11851. PMLR, 2021.
336
+
337
+ Wei Yin, Jianming Zhang, Oliver Wang, Simon Niklaus, Long Mai, Simon Chen, and Chunhua Shen. Learning to recover 3d scene shape from a single image. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021, pp. 204–213. Computer Vision Foundation / IEEE, 2021.
338
+
339
+ Eric Zelikman, Christopher Healy, Sharon Zhou, and Anand Avati. Crude: calibrating regression uncertainty distributions empirically. arXiv preprint arXiv:2005.12496, 2020.
340
+
341
+ Hongyi Zhang, Moustapha Cissé, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
342
+
343
+ Zizhao Zhang, Adriana Romero, Matthew J Muckley, Pascal Vincent, Lin Yang, and Michal Drozdzal. Reducing uncertainty in undersampled mri reconstruction with active acquisition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2049–2058, 2019.
344
+
345
+ # A DISCUSSION ON I.I.D. AND N.I.D. ASSUMPTIONS
346
+
347
+ Generalization Error, Bias, and Variance. We could analyze the generalization error of our VIR by bounding the generalization with the sum of three terms: (a) the bias of our estimator, (2) the variance of our estimator, (3) model complexity. Essentially VIR uses the N.I.D. assumption increases our estimator’s bias, but significantly reduces its variance in the imbalanced setting. Since the model complexity is kept the same (using the same backbone neural network) as the baselines, N.I.D. will lead to a lower generalization error.
348
+
349
+ Variance of Estimators in Imbalanced Settings. In the imbalanced setting, one typically use inverse weighting to produced an unbiased estimator (i.e., making the first term of the aforementioned bound zero). However, for data with extremely low density, its inverse would be extremely large, therefore leading to a very large variance for the estimator. Our VIR replaces I.I.D. with N.I.D. to “smooth out” such singularity, and therefore significantly lowers the variance of the estimator (i.e., making the second term of the aforementioned bound smaller), and ultimately lowers the generalization error.
350
+
351
+ # B ADDITIONAL EXPERIMENT RESULTS
352
+
353
+ # B.1 ABLATION STUDY ON VIR
354
+
355
+ In this section, we include ablation studies to verify that our VIR can outperform its counterparts in DIR (i.e., smoothing on the latent space) and DER (i.e., NIG distribution layers).
356
+
357
+ Ablation Study on $q ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } )$ . To verify the effectiveness of VIR’s encoder $q ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } )$ , we replace VIR’s predictor $p ( y _ { i } | \mathbf { z } _ { i } )$ with a linear layer (as in DIR). Table 5 shows that compared to its counterpart, FDS (Yang et al., 2021), our encoderonly VIR still leads to a considerable
358
+
359
+ Table 5: Ablation study on AgeDB-DIR in terms of accuracy.
360
+
361
+ <table><tr><td>Metrics</td><td colspan="4">MSE↓</td><td colspan="4">MAE↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>FDS (Yang et al.,2021)</td><td>109.78</td><td>93.99</td><td>124.96</td><td>216.97</td><td>8.12</td><td>7.52</td><td>8.68</td><td>12.25</td></tr><tr><td>ENCODER-ONLY VIR (OURS)</td><td>95.99</td><td>81.89</td><td>121.78</td><td>157.92</td><td>7.57</td><td>6.97</td><td>8.72</td><td>10.03</td></tr><tr><td>DER (Amini et al., 2020)</td><td>106.81</td><td>91.32</td><td>122.45</td><td>209.76</td><td>8.11</td><td>7.36</td><td>9.03</td><td>12.69</td></tr><tr><td>PREDICTOR-ONLY VIR(OURS)</td><td>88.96</td><td>74.79</td><td>95.85</td><td>203.76</td><td>7.28</td><td>6.68</td><td>7.76</td><td>11.63</td></tr></table>
362
+
363
+ improvements even without generating the NIG distribution, therefore verifying the effectiveness of our VIR’s $q ( \mathbf { z } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } )$ .
364
+
365
+ Ablation Study on $p ( y _ { i } | \mathbf { z } _ { i } )$ . To verify the effectiveness of VIR’s predictor $p ( y _ { i } | \mathbf { z } _ { i } )$ , we replace VIR’s encoder $q ( \mathbf { \dot { z } } _ { i } | \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N } )$ with a simple deterministic encoder as in DER (Amini et al., 2020). Table 5 and Table 6 show that compared to DER, the counter
366
+
367
+ Table 6: Ablation study on AgeDB-DIR in terms of uncertainty estimation.
368
+
369
+ <table><tr><td>Metrics</td><td colspan="4">NLL↓</td><td colspan="4">AUSE↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>Al</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>DER Amini et al. (2020)</td><td>3.936</td><td>3.768</td><td>3.865</td><td>4.421</td><td>0.590</td><td>0.449</td><td>0.468</td><td>0.500</td></tr><tr><td>PREDICTOR-ONLY VIR (OURS)</td><td>3.887</td><td>3.755</td><td>3.854</td><td>4.394</td><td>0.443</td><td>0.387</td><td>0.390</td><td>0.407</td></tr></table>
370
+
371
+ part of VIR’s predictor, our VIR’s predictor still outperforms than DER, demonstrating its effectiveness; this verifies our claim (Sec. 3.4) that directly reweighting DER breaks NIG and leads to poor performance.
372
+
373
+ # B.2 RESULT ON STS-B-DIR DATASET
374
+
375
+ In this section, we report the accuracy and uncertainty evaluation on STS-B-DIR (more details for the dataset is in DIR (Yang et al., 2021)). From Table 7, Table 8, and Table 9 below, we can conclude
376
+
377
+ Table 7: Evaluation results of accuracy on STS-B-DIR.
378
+
379
+ <table><tr><td>Metrics</td><td colspan="4">MSE↓</td><td colspan="4">MAE↓</td><td colspan="4">GM↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>INV</td><td>1.031</td><td>0.930</td><td>1.426</td><td>1.152</td><td>0.825</td><td>0.783</td><td>1.004</td><td>0.850</td><td>0.567</td><td>0.537</td><td>0.744</td><td>0.535</td></tr><tr><td>DIR(YANG ET AL, 2021)</td><td>1.000</td><td>0.912</td><td>1.368</td><td>1.055</td><td>0.812</td><td>0.772</td><td>0.989</td><td>0.809</td><td>0.560</td><td>0.535</td><td>0.739</td><td>0.477</td></tr><tr><td>DIR + DER (YANG ET AL.,2021; AMINI ET AL., 2020)</td><td>1.007</td><td>0.880</td><td>1.535</td><td>1.086</td><td>0.812</td><td>0.757</td><td>1.046</td><td>0.842</td><td>0.558</td><td>0.518</td><td>0.765</td><td>0.574</td></tr><tr><td>VIR (OURS)</td><td>0.895</td><td>0.799</td><td>1.309</td><td>0.919</td><td>0.760</td><td>0.718</td><td>0.960</td><td>0.732</td><td>0.509</td><td>0.493</td><td>0.669</td><td>0.377</td></tr></table>
380
+
381
+ that our model also outperforms all baselines in terms of both accuracy metrics and uncertainty estimation metrics in this NLP dataset; this verifies the superiority of our model for NLP datasets.
382
+
383
+ Table 8: Evaluation results of accuracy on STS-B-DIR.
384
+
385
+ <table><tr><td>Metrics</td><td colspan="4">Pearson↑</td><td colspan="4">Spearman ↑</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>INV</td><td>0.718</td><td>0.701</td><td>0.612</td><td>0.705</td><td>0.723</td><td>0.678</td><td>0.530</td><td>0.685</td></tr><tr><td>DIR(YANG ET AL.,2021)</td><td>0.732</td><td>0.711</td><td>0.646</td><td>0.742</td><td>0.731</td><td>0.672</td><td>0.519</td><td>0.739</td></tr><tr><td>DIR + DER(YANG ET AL., 2021; AMINI ET AL., 2020)</td><td>0.729</td><td>0.714</td><td>0.635</td><td>0.731</td><td>0.730</td><td>0.680</td><td>0.526</td><td>0.699</td></tr><tr><td>VIR (OURS)</td><td>0.765</td><td>0.740</td><td>0.663</td><td>0.770</td><td>0.770</td><td>0.713</td><td>0.534</td><td>0.770</td></tr></table>
386
+
387
+ Table 9: Uncertainty estimation results on STS-B-DIR.
388
+
389
+ <table><tr><td>Metrics</td><td colspan="4">NLL↓</td><td colspan="4">AUSE↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>Al</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>DIR + DER(YANG ET AL., 2021; AMINI ET AL., 2020)</td><td>2.561</td><td>2.514</td><td>2.880</td><td>2.358</td><td>0.672</td><td>0.581</td><td>0.609</td><td>0.615</td></tr><tr><td>VIR (OURS)</td><td>1.996</td><td>1.810</td><td>2.754</td><td>2.152</td><td>0.591</td><td>0.575</td><td>0.602</td><td>0.510</td></tr></table>
390
+
391
+ # B.3 DIFFERENCE BETWEEN DIR’S AND OUR REPRODUCED RESULTS
392
+
393
+ To reproduce the results on AgeDB, we use exactly the same settings as in DIR’s code (Yang et al., 2021) (i.e., by directly running their code on our machines without modifying hyperparameters). for each model in DIR we report, we use five different random seeds to produce five results. We then report the performance by taking the average of them. Table 10 and Table 11 show the example for SQINV and LDS+FDS on AgeDB-DIR. From the table we can see that under our hardware and software environments, the SQINV model and LDS $^ { + }$ FDS model (SOTA in DIR) could not perform as well as it is reported in DIR Yang et al. (2021), therefore for fair comparison, we use our replicated performance rather than theirs.
394
+
395
+ Table 10: Results of running SQINV for 5 different random seeds on AgeDB.
396
+
397
+ <table><tr><td>Metrics</td><td colspan="4">MSE↓</td><td colspan="4">MAE↓</td><td colspan="4">GM↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>SQINv 1</td><td>107.02</td><td>90.71</td><td>131.5</td><td>193.39</td><td>8.04</td><td>7.40</td><td>9.01</td><td>11.33</td><td>5.15</td><td>4.73</td><td>8.81</td><td>8.22</td></tr><tr><td>SQINV 2</td><td>111.55</td><td>93.43</td><td>141.03</td><td>209.17</td><td>8.12</td><td>7.47</td><td>9.17</td><td>11.58</td><td>5.21</td><td>4.85</td><td>5.75</td><td>8.25</td></tr><tr><td>SQINv 3</td><td>114.33</td><td>96.83</td><td>134.56</td><td>223.86</td><td>8.21</td><td>7.59</td><td>9.01</td><td>11.81</td><td>5.17</td><td>4.74</td><td>5.85</td><td>8.27</td></tr><tr><td>SQINV 4</td><td>106.24</td><td>91.81</td><td>120.26</td><td>203.78</td><td>7.94</td><td>7.39</td><td>8.58</td><td>11.39</td><td>5.06</td><td>4.74</td><td>5.41</td><td>7.66</td></tr><tr><td>SQINv5</td><td>104.73</td><td>90.24</td><td>127.33</td><td>208.05</td><td>7.99</td><td>7.47</td><td>8.98</td><td>11.49</td><td>5.07</td><td>4.79</td><td>5.68</td><td>7.98</td></tr><tr><td>SQINV AVG</td><td>108.77</td><td>92.60</td><td>130.94</td><td>207.65</td><td>8.06</td><td>7.46</td><td>8.95</td><td>11.52</td><td>5.13</td><td>4.77</td><td>6.30</td><td>8.08</td></tr><tr><td>SQINV STD</td><td>12.89</td><td>5.67</td><td>48.46</td><td>96.71</td><td>0.01</td><td>0.01</td><td>0.04</td><td>0.03</td><td>0.01</td><td>0.01</td><td>1.60</td><td>0.05</td></tr><tr><td>SQINV RESULTS FROM(YANG ET AL., 2021)</td><td>105.14</td><td>87.21</td><td>127.66</td><td>212.30</td><td>7.81</td><td>7.16</td><td>8.80</td><td>11.20</td><td>4.99</td><td>4.57</td><td>5.73</td><td>7.77</td></tr></table>
398
+
399
+ # B.4 ABLATION STUDY ON λ
400
+
401
+ In this section, we include ablation studies on the $\lambda$ in our objective function. For $\lambda \in$ $\{ 1 0 . 0 , 1 . 0 , 0 . 1 , 0 . 0 1 , 0 . 0 0 1 \}$ , we run our VIR model on the AgeDB dataset. Table 12 shows the results. We can conclude that when $\lambda = 0 . 1$ , our model achieves the best performance.
402
+
403
+ Table 11: Results of running LDS+FDS for 5 different random seeds on AgeDB.
404
+
405
+ <table><tr><td>Metrics</td><td colspan="4">MSE↓</td><td colspan="4">MAE↓</td><td colspan="4">GM↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>LDS+FDS 1</td><td>104.33</td><td>88.67</td><td>128.99</td><td>194.06</td><td>7.87</td><td>7.26</td><td>8.97</td><td>10.88</td><td>5.02</td><td>4.60</td><td>5.87</td><td>7.51</td></tr><tr><td>LDS+FDS 2</td><td>104.59</td><td>94.63</td><td>125.60</td><td>200.14</td><td>7.98</td><td>7.44</td><td>8.77</td><td>11.16</td><td>5.00</td><td>4.71</td><td>5.62</td><td>7.81</td></tr><tr><td>LDS+FDS 3</td><td>110.17</td><td>95.97</td><td>123.24</td><td>208.11</td><td>8.07</td><td>7.54</td><td>8.71</td><td>11.41</td><td>5.09</td><td>4.73</td><td>5.71</td><td>7.48</td></tr><tr><td>LDS+FDS 4</td><td>102.68</td><td>98.20</td><td>126.41</td><td>201.16</td><td>8.02</td><td>7.50</td><td>8.82</td><td>11.34</td><td>5.08</td><td>4.63</td><td>5.74</td><td>7.56</td></tr><tr><td>LDS+FDS 5</td><td>105.77</td><td>91.07</td><td>127.00</td><td>185.85</td><td>7.93</td><td>7.35</td><td>8.80</td><td>10.96</td><td>5.07</td><td>4.74</td><td>5.52</td><td>7.73</td></tr><tr><td>LDS+FDS AVG</td><td>105.51</td><td>93.71</td><td>126.25</td><td>197.86</td><td>7.97</td><td>7.42</td><td>8.81</td><td>11.15</td><td>5.05</td><td>4.68</td><td>5.69</td><td>7.62</td></tr><tr><td>LDS+FDS STD</td><td>6.41</td><td>11.70</td><td>3.52</td><td>55.97</td><td>0.01</td><td>0.01</td><td>0.01</td><td>0.04</td><td>0.01</td><td>0.03</td><td>0.01</td><td>0.02</td></tr><tr><td>LDS+FDS RESULTS FROM(YANG ET AL.,2021)</td><td>99.46</td><td>84.10</td><td>112.20</td><td>209.27</td><td>7.55</td><td>7.01</td><td>8.24</td><td>10.79</td><td>4.72</td><td>4.36</td><td>5.45</td><td>6.79</td></tr></table>
406
+
407
+ Table 12: Ablation study on $\lambda$ for VIR on AgeDB-DIR
408
+
409
+ <table><tr><td>Metrics</td><td colspan="4">MSE↓</td><td colspan="4">MAE↓</td><td colspan="4">NLL↓</td></tr><tr><td>Shot</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td><td>All</td><td>Many</td><td>Med.</td><td>Few</td></tr><tr><td>入=10.0</td><td>104.31</td><td>91.01</td><td>116.43</td><td>196.35</td><td>7.88</td><td>7.38</td><td>8.42</td><td>11.13</td><td>3.827</td><td>3.733</td><td>4.140</td><td>4.407</td></tr><tr><td>入=1.0</td><td>104.10</td><td>87.28</td><td>128.26</td><td>196.12</td><td>7.83</td><td>7.21</td><td>8.81</td><td>10.89</td><td>3.848</td><td>3.738</td><td>4.041</td><td>4.356</td></tr><tr><td>入=0.1</td><td>86.28</td><td>76.87</td><td>101.57</td><td>132.90</td><td>7.19</td><td>6.75</td><td>7.97</td><td>9.19</td><td>3.785</td><td>3.694</td><td>3.963</td><td>4.151</td></tr><tr><td>入=0.01</td><td>86.86</td><td>76.58</td><td>99.95</td><td>147.82</td><td>7.12</td><td>6.69</td><td>7.72</td><td>9.59</td><td>3.887</td><td>3.797</td><td>4.007</td><td>4.401</td></tr><tr><td>入=0.001</td><td>87.25</td><td>74.13</td><td>104.78</td><td>162.64</td><td>7.13</td><td>6.64</td><td>7.92</td><td>9.63</td><td>3.980</td><td>3.868</td><td>4.161</td><td>4.546</td></tr></table>
parse/dev/-ltZ1uw8ZE7/-ltZ1uw8ZE7_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/-ltZ1uw8ZE7/-ltZ1uw8ZE7_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/-ltZ1uw8ZE7/-ltZ1uw8ZE7_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/0RDcd5Axok/0RDcd5Axok_content_list.json ADDED
@@ -0,0 +1,1922 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "TOWARDS A UNIFIED VIEW OF PARAMETER-EFFICIENT TRANSFER LEARNING ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 735,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Junxian $\\mathbf { H e } ^ { * }$ Carnegie Mellon University junxianh@cs.cmu.edu ",
17
+ "bbox": [
18
+ 184,
19
+ 170,
20
+ 370,
21
+ 212
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Chunting Zhou∗ Carnegie Mellon University chuntinz@cs.cmu.edu ",
28
+ "bbox": [
29
+ 625,
30
+ 170,
31
+ 813,
32
+ 212
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Xuezhe Ma University of Southern California xuezhema@isi.edu ",
39
+ "bbox": [
40
+ 184,
41
+ 233,
42
+ 406,
43
+ 275
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Taylor Berg-Kirkpatrick UC San Diego tberg@eng.ucsd.edu ",
50
+ "bbox": [
51
+ 426,
52
+ 233,
53
+ 602,
54
+ 275
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Graham Neubig Carnegie Mellon University gneubig@cs.cmu.edu ",
61
+ "bbox": [
62
+ 624,
63
+ 233,
64
+ 808,
65
+ 275
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "ABSTRACT ",
72
+ "text_level": 1,
73
+ "bbox": [
74
+ 454,
75
+ 313,
76
+ 544,
77
+ 327
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "Fine-tuning large pretrained language models on downstream tasks has become the de-facto learning paradigm in NLP. However, conventional approaches finetune all the parameters of the pretrained model, which becomes prohibitive as the model size and the number of tasks grow. Recent work has proposed a variety of parameter-efficient transfer learning methods that only fine-tune a small number of (extra) parameters to attain strong performance. While effective, the critical ingredients for success and the connections among the various methods are poorly understood. In this paper, we break down the design of state-of-the-art parameter-efficient transfer learning methods and present a unified framework that establishes connections between them. Specifically, we re-frame them as modifications to specific hidden states in pretrained models, and define a set of design dimensions along which different methods vary, such as the function to compute the modification and the position to apply the modification. Through comprehensive empirical studies across machine translation, text summarization, language understanding, and text classification benchmarks, we utilize the unified view to identify important design choices in previous methods. Furthermore, our unified framework enables the transfer of design elements across different approaches, and as a result we are able to instantiate new parameter-efficient fine-tuning methods that tune less parameters than previous methods while being more effective, achieving comparable results to fine-tuning all parameters on all four tasks.1 ",
84
+ "bbox": [
85
+ 233,
86
+ 344,
87
+ 764,
88
+ 622
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "1 INTRODUCTION ",
95
+ "text_level": 1,
96
+ "bbox": [
97
+ 176,
98
+ 650,
99
+ 336,
100
+ 666
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Transfer learning from pre-trained language models (PLMs) is now the prevalent paradigm in natural language processing, yielding strong performance on many tasks (Peters et al., 2018; Devlin et al., 2019; Qiu et al., 2020). The most common way to adapt general-purpose PLMs to downstream tasks is to fine-tune all the model parameters (full fine-tuning). However, this results in a separate copy of fine-tuned model parameters for each task, which is prohibitively expensive when serving models that perform a large number of tasks. This issue is particularly salient with the ever-increasing size of PLMs, which now range from hundreds of millions (Radford et al., 2019; Lewis et al., 2020) to hundreds of billions (Brown et al., 2020) or even trillions of parameters (Fedus et al., 2021). ",
107
+ "bbox": [
108
+ 174,
109
+ 683,
110
+ 825,
111
+ 795
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "To mitigate this issue, a few lightweight alternatives have been proposed to update only a small number of extra parameters while keeping most pretrained parameters frozen. For example, adapter tuning (Houlsby et al., 2019) inserts small neural modules called adapters to each layer of the pretrained network and only the adapters are trained at fine-tuning time. Inspired by the success of prompting methods that control PLMs through textual prompts (Brown et al., 2020; Liu et al., 2021a), prefix tuning (Li & Liang, 2021) and prompt tuning (Lester et al., 2021) prepend an additional $l$ tunable prefix tokens to the input or hidden layers and only train these soft prompts when fine-tuning on downstream tasks. More recently, Hu et al. (2021) learn low-rank matrices to approximate parameter updates. We illustrate these methods in Figure 1. These approaches have all been reported to demonstrate comparable performance to full fine-tuning on different sets of tasks, often through updating less than $1 \\%$ of the original model parameters. Besides parameter savings, parameter-efficient tuning makes it possible to quickly adapt to new tasks without catastrophic forgetting (Pfeiffer et al., 2021) and often exhibits superior robustness in out-of-distribution evaluation (Li & Liang, 2021). ",
118
+ "bbox": [
119
+ 174,
120
+ 801,
121
+ 823,
122
+ 886
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "image",
128
+ "img_path": "images/817d3636b1fd3352037dfcc37df9a02d25048bdc48931d091e4c6fddbc6d0118.jpg",
129
+ "image_caption": [
130
+ "Figure 1: Illustration of the transformer architecture and several state-of-the-art parameter-efficient tuning methods. We use blocks with dashed borderlines to represent the added modules by those methods. "
131
+ ],
132
+ "image_footnote": [],
133
+ "bbox": [
134
+ 174,
135
+ 116,
136
+ 490,
137
+ 327
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "image",
143
+ "img_path": "images/ed2872e8987c3789fd45b53e042a8d249dbe4d22df5d13958ff5aee7ae6ba30f.jpg",
144
+ "image_caption": [
145
+ "Figure 2: Performance of different methods on the XSum (Narayan et al., 2018) summarization task. The number of fine-tuned parameters is relative to the tuned parameters in full fine-tuning. "
146
+ ],
147
+ "image_footnote": [],
148
+ "bbox": [
149
+ 532,
150
+ 119,
151
+ 802,
152
+ 324
153
+ ],
154
+ "page_idx": 1
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "",
159
+ "bbox": [
160
+ 174,
161
+ 410,
162
+ 825,
163
+ 507
164
+ ],
165
+ "page_idx": 1
166
+ },
167
+ {
168
+ "type": "text",
169
+ "text": "However, we contend that the important ingredients that contribute to the success of these parameterefficient tuning methods are poorly understood, and the connections between them are still unclear. In this paper, we aim to answer three questions: (1) How are these methods connected? (2) Do these methods share design elements that are essential for their effectiveness, and what are they? (3) Can the effective ingredients of each method be transferred to others to yield more effective variants? ",
170
+ "bbox": [
171
+ 174,
172
+ 515,
173
+ 823,
174
+ 583
175
+ ],
176
+ "page_idx": 1
177
+ },
178
+ {
179
+ "type": "text",
180
+ "text": "In order to answer these questions, we first derive an alternative form of prefix tuning that reveals prefix tuning’s close connections with adapters (§3.1). Based on this we then devise a unified framework that frames the aforementioned methods as different ways to modify the hidden representations of frozen PLMs (§3.2). Our unified framework decomposes previous methods along a shared set of design dimensions, such as the function used to perform the modification, the position in which to impose this modification, and how to integrate the modification. This framework allows us to transfer design choices across approaches to propose new variants such as adapters with multiple heads (§3.3). In experiments, we first show that existing parameter-efficient tuning methods still lag behind full fine-tuning on higher-resource and challenging tasks (§4.2), as exemplified in Figure 2. Then we utilize the unified framework to identify critical design choices and validate the proposed variants empirically (§4.3-4.6). Our experiments on four NLP benchmarks covering text summarization, machine translation (MT), text classification, and general language understanding, demonstrate that the proposed variant uses less parameters than existing methods while being more effective, matching full fine-tuning results on all four tasks. ",
181
+ "bbox": [
182
+ 173,
183
+ 590,
184
+ 825,
185
+ 785
186
+ ],
187
+ "page_idx": 1
188
+ },
189
+ {
190
+ "type": "text",
191
+ "text": "2 PRELIMINARIES ",
192
+ "text_level": 1,
193
+ "bbox": [
194
+ 176,
195
+ 814,
196
+ 338,
197
+ 830
198
+ ],
199
+ "page_idx": 1
200
+ },
201
+ {
202
+ "type": "text",
203
+ "text": "2.1 RECAP OF THE TRANSFORMER ARCHITECTURE ",
204
+ "text_level": 1,
205
+ "bbox": [
206
+ 174,
207
+ 853,
208
+ 542,
209
+ 866
210
+ ],
211
+ "page_idx": 1
212
+ },
213
+ {
214
+ "type": "text",
215
+ "text": "The transformer model (Vaswani et al., 2017) is now the workhorse architecture behind most stateof-the-art PLMs. In this section we recap the equations of this model for completeness. Transformer models are composed of $L$ stacked blocks, where each block (Figure 1) contains two types of sub",
216
+ "bbox": [
217
+ 176,
218
+ 882,
219
+ 823,
220
+ 924
221
+ ],
222
+ "page_idx": 1
223
+ },
224
+ {
225
+ "type": "text",
226
+ "text": "layers: multi-head self-attention and a fully connected feed-forward network (FFN).2 The conventional attention function maps queries $\\boldsymbol { Q } \\in \\mathbb { R } ^ { n \\times d _ { k } }$ and key-value pairs $\\pmb { K } \\in \\mathbb { R } ^ { m \\times d _ { k } } , \\pmb { V } \\in \\mathbb { R } ^ { m \\times d _ { v } }$ ",
227
+ "bbox": [
228
+ 173,
229
+ 103,
230
+ 820,
231
+ 132
232
+ ],
233
+ "page_idx": 2
234
+ },
235
+ {
236
+ "type": "equation",
237
+ "img_path": "images/15299331db8ef09694fe081540d4f93bbab6da1345a0b6935d59910e0aa8dfe3.jpg",
238
+ "text": "$$\n\\mathrm { A t t n } ( Q , K , V ) = \\mathrm { s o f t m a x } \\big ( \\frac { Q K ^ { T } } { \\sqrt { d _ { k } } } \\big ) V ,\n$$",
239
+ "text_format": "latex",
240
+ "bbox": [
241
+ 367,
242
+ 136,
243
+ 629,
244
+ 171
245
+ ],
246
+ "page_idx": 2
247
+ },
248
+ {
249
+ "type": "text",
250
+ "text": "where $n$ and $m$ are the number of queries and key-value pairs respectively. Multi-head attention performs the attention function in parallel over $N _ { h }$ heads, where each head is separately parameterized by $W _ { q } ^ { ( i ) }$ , $\\boldsymbol { W } _ { k } ^ { ( i ) }$ , $W _ { v } ^ { ( i ) } \\in \\mathbb { R } ^ { d \\times d _ { h } }$ to project inputs to queries, keys, and values. Given a sequence of $m$ vectors $C \\in \\mathbb { R } ^ { m \\times d }$ over which we would like to perform attention and a query vector $\\pmb { x } \\in \\mathbb { R } ^ { d }$ , multi-head attention (MHA) computes the output on each head and concatenates them:3 ",
251
+ "bbox": [
252
+ 173,
253
+ 174,
254
+ 825,
255
+ 250
256
+ ],
257
+ "page_idx": 2
258
+ },
259
+ {
260
+ "type": "equation",
261
+ "img_path": "images/b4207abc5dbe958fa42175659003fde26b9c44e9d3358993a78afc32d25b4733.jpg",
262
+ "text": "$$\n\\mathrm { M H A } ( C , { \\pmb x } ) = \\mathrm { C o n c a t } ( \\mathrm { h e a d } _ { 1 } , \\cdots , \\mathrm { h e a d } _ { \\mathrm { h } } ) { \\pmb W } _ { o } , \\ \\mathrm { h e a d } _ { \\mathrm { i } } = \\mathrm { A t t n } ( { \\pmb x } { \\pmb W } _ { q } ^ { ( i ) } , C { \\pmb W } _ { k } ^ { ( i ) } , C { \\pmb W } _ { v } ^ { ( i ) } ) ,\n$$",
263
+ "text_format": "latex",
264
+ "bbox": [
265
+ 186,
266
+ 253,
267
+ 789,
268
+ 276
269
+ ],
270
+ "page_idx": 2
271
+ },
272
+ {
273
+ "type": "text",
274
+ "text": "where $W _ { o } \\in \\mathbb { R } ^ { d \\times d }$ . $d$ is the model dimension, and in MHA $d _ { h }$ is typically set to $d / N _ { h }$ to save parameters, which indicates that each attention head is operating on a lower-dimensional space. The other important sublayer is the fully connected feed-forward network (FFN) which consists of two linear transformations with a ReLU activation function in between: ",
275
+ "bbox": [
276
+ 174,
277
+ 280,
278
+ 825,
279
+ 337
280
+ ],
281
+ "page_idx": 2
282
+ },
283
+ {
284
+ "type": "equation",
285
+ "img_path": "images/91465fc942a612d822db153689232aaafecdb1971dc32ba7922da75d199c8dca.jpg",
286
+ "text": "$$\n\\mathrm { F F N } ( \\pmb { x } ) = \\mathrm { R e L U } ( \\pmb { x } \\pmb { W } _ { 1 } + \\pmb { b } _ { 1 } ) \\pmb { W } _ { 2 } + \\pmb { b } _ { 2 } ,\n$$",
287
+ "text_format": "latex",
288
+ "bbox": [
289
+ 361,
290
+ 342,
291
+ 635,
292
+ 359
293
+ ],
294
+ "page_idx": 2
295
+ },
296
+ {
297
+ "type": "text",
298
+ "text": "where $W _ { 1 } \\in \\mathbb { R } ^ { d \\times d _ { m } }$ , $W _ { 2 } \\in \\mathbb { R } ^ { d _ { m } \\times d }$ . Transformers typically use a large $d _ { m }$ , e.g. $d _ { m } = 4 d$ . Finally, a residual connection is used followed by layer normalization (Ba et al., 2016). ",
299
+ "bbox": [
300
+ 168,
301
+ 363,
302
+ 823,
303
+ 392
304
+ ],
305
+ "page_idx": 2
306
+ },
307
+ {
308
+ "type": "text",
309
+ "text": "2.2 OVERVIEW OF PREVIOUS PARAMETER-EFFICIENT TUNING METHODS ",
310
+ "text_level": 1,
311
+ "bbox": [
312
+ 176,
313
+ 407,
314
+ 694,
315
+ 422
316
+ ],
317
+ "page_idx": 2
318
+ },
319
+ {
320
+ "type": "text",
321
+ "text": "Below and in Figure 1, we introduce several state-of-the-art parameter-efficient tuning methods. \nUnless otherwise specified, they only tune the added parameters while the PLM’s are frozen. ",
322
+ "bbox": [
323
+ 174,
324
+ 434,
325
+ 823,
326
+ 463
327
+ ],
328
+ "page_idx": 2
329
+ },
330
+ {
331
+ "type": "text",
332
+ "text": "Adapters (Houlsby et al., 2019): The adapter approach inserts small modules (adapters) between transformer layers. The adapter layer generally uses a down-projection with $W _ { \\mathrm { d o w n } } \\ \\in \\ \\mathbb { R } ^ { d \\times r }$ to project the input $^ { h }$ to a lower-dimensional space specified by bottleneck dimension $r$ , followed by a nonlinear activation function $f ( \\cdot )$ , and a up-projection with $W _ { \\mathsf { u p } } \\in \\mathbb { R } ^ { r \\times d }$ . These adapters are surrounded by a residual connection, leading to a final form: ",
333
+ "bbox": [
334
+ 173,
335
+ 468,
336
+ 825,
337
+ 539
338
+ ],
339
+ "page_idx": 2
340
+ },
341
+ {
342
+ "type": "equation",
343
+ "img_path": "images/d051c5840ac628806d97ea98a2dc823b86c10625a3c67375d4f75bab612e1628.jpg",
344
+ "text": "$$\nh h + f ( h W _ { \\mathrm { d o w n } } ) W _ { \\mathrm { u p } } .\n$$",
345
+ "text_format": "latex",
346
+ "bbox": [
347
+ 406,
348
+ 542,
349
+ 589,
350
+ 560
351
+ ],
352
+ "page_idx": 2
353
+ },
354
+ {
355
+ "type": "text",
356
+ "text": "Houlsby et al. (2019) places two adapters sequentially within one layer of the transformer, one after the multi-head attention and one after the FFN sub-layer. Pfeiffer et al. (2021) have proposed a more efficient adapter variant that is inserted only after the FFN “add & layer norm” sub-layer. ",
357
+ "bbox": [
358
+ 173,
359
+ 565,
360
+ 825,
361
+ 608
362
+ ],
363
+ "page_idx": 2
364
+ },
365
+ {
366
+ "type": "text",
367
+ "text": "Prefix Tuning (Li & Liang, 2021): Inspired by the success of textual prompting methods (Liu et al., 2021a), prefix tuning prepends $l$ tunable prefix vectors to the keys and values of the multihead attention at every layer. Specifically, two sets of prefix vectors $P _ { k } , \\dot { P } _ { v } \\in \\mathbb R ^ { l \\times d }$ are concatenated with the original key $\\kappa$ and value $V$ . Then multi-head attention is performed on the new prefixed keys and values. The computation of ${ \\mathrm { h e a d } } _ { i }$ in Eq. 2 becomes: ",
368
+ "bbox": [
369
+ 173,
370
+ 613,
371
+ 825,
372
+ 684
373
+ ],
374
+ "page_idx": 2
375
+ },
376
+ {
377
+ "type": "equation",
378
+ "img_path": "images/3b583e4542c85d5a77c153f9671be5620121202770b5f0460f1bd76e61784b91.jpg",
379
+ "text": "$$\n\\mathrm { h e a d } _ { i } = \\mathrm { A t t n } ( \\pmb { x } \\pmb { W } _ { q } ^ { ( i ) } , \\mathrm { c o n c a t } ( \\pmb { P } _ { k } ^ { ( i ) } , \\pmb { C } \\pmb { W } _ { k } ^ { ( i ) } ) , \\mathrm { c o n c a t } ( \\pmb { P } _ { v } ^ { ( i ) } , \\pmb { C } \\pmb { W } _ { v } ^ { ( i ) } ) ) ,\n$$",
380
+ "text_format": "latex",
381
+ "bbox": [
382
+ 266,
383
+ 688,
384
+ 728,
385
+ 710
386
+ ],
387
+ "page_idx": 2
388
+ },
389
+ {
390
+ "type": "text",
391
+ "text": "$P _ { k }$ and $P _ { v }$ are split into $N _ { h }$ head vectors respectively and $P _ { k } ^ { ( i ) } , P _ { v } ^ { ( i ) } \\in \\mathbb R ^ { l \\times d / N _ { h } }$ denote the $i$ -th head vector. Prompt-tuning (Lester et al., 2021) simplifies prefix-tuning by only prepending to the input word embeddings in the first layer; similar work also includes $\\mathrm { \\bf P }$ -tuning (Liu et al., 2021b). ",
392
+ "bbox": [
393
+ 174,
394
+ 715,
395
+ 825,
396
+ 761
397
+ ],
398
+ "page_idx": 2
399
+ },
400
+ {
401
+ "type": "text",
402
+ "text": "LoRA (Hu et al., 2021): LoRA injects trainable low-rank matrices into transformer layers to approximate the weight updates. For a pre-trained weight matrix $W \\in \\mathbb { R } ^ { d \\times k }$ , LoRA represents its update with a low-rank decomposition $W + \\Delta W = W + W _ { \\mathrm { d o w n } } W _ { \\mathrm { u p } }$ , where $W _ { \\mathrm { d o w n } } \\in \\mathbb { R } ^ { \\hat { d } \\times r }$ , $W _ { \\mathrm { u p } } \\in$ $\\mathbb { R } ^ { r \\times k }$ are tunable parameters. LoRA applies this update to the query and value projection matrices $\\left( W _ { q } , W _ { v } \\right)$ in the multi-head attention sub-layer, as shown in Figure 1. For a specific input $_ { \\textbf { \\em x } }$ to the linear projection in multi-head attention, LoRA modifies the projection output $^ { h }$ as: ",
403
+ "bbox": [
404
+ 173,
405
+ 767,
406
+ 825,
407
+ 853
408
+ ],
409
+ "page_idx": 2
410
+ },
411
+ {
412
+ "type": "equation",
413
+ "img_path": "images/089f93b64428c027bf2a950afbf1f0c71a98197bfdbfdd26d5231d9173a4f135.jpg",
414
+ "text": "$$\nh h + s \\cdot x W _ { \\mathrm { d o w n } } W _ { \\mathrm { u p } } ,\n$$",
415
+ "text_format": "latex",
416
+ "bbox": [
417
+ 408,
418
+ 858,
419
+ 588,
420
+ 876
421
+ ],
422
+ "page_idx": 2
423
+ },
424
+ {
425
+ "type": "image",
426
+ "img_path": "images/0cae0143a371d3d20d802c7754661581469a23b2c5a99fc1b9f5bba922f4f87f.jpg",
427
+ "image_caption": [
428
+ "Figure 3: Graphical illustration of existing methods and the proposed variants. “PLM module” represents a certain sublayer of the PLM (e.g. attention or FFN) that is frozen. “Scaled PA” denotes scaled parallel adapter. We do not include multi-head parallel adapter here to save space. "
429
+ ],
430
+ "image_footnote": [],
431
+ "bbox": [
432
+ 173,
433
+ 98,
434
+ 820,
435
+ 199
436
+ ],
437
+ "page_idx": 3
438
+ },
439
+ {
440
+ "type": "text",
441
+ "text": "where $s \\geq 1$ is a tunable scalar hyperparameter.4 ",
442
+ "bbox": [
443
+ 173,
444
+ 252,
445
+ 491,
446
+ 267
447
+ ],
448
+ "page_idx": 3
449
+ },
450
+ {
451
+ "type": "text",
452
+ "text": "Others: Other parameter-efficient tuning methods include BitFit (Ben Zaken et al., 2021), which only fine-tunes bias vectors in the pre-trained model, and diff-pruning (Guo et al., 2021), which learns a sparse parameter update vector. ",
453
+ "bbox": [
454
+ 173,
455
+ 273,
456
+ 826,
457
+ 316
458
+ ],
459
+ "page_idx": 3
460
+ },
461
+ {
462
+ "type": "text",
463
+ "text": "3 BRIDGING THE GAP – A UNIFIED VIEW ",
464
+ "text_level": 1,
465
+ "bbox": [
466
+ 174,
467
+ 335,
468
+ 537,
469
+ 352
470
+ ],
471
+ "page_idx": 3
472
+ },
473
+ {
474
+ "type": "text",
475
+ "text": "We first derive an equivalent form of prefix tuning to establish its connection with adapters. We then propose a unified framework for parameter-efficient tuning that includes several state-of-the-art methods as instantiations. ",
476
+ "bbox": [
477
+ 173,
478
+ 368,
479
+ 825,
480
+ 410
481
+ ],
482
+ "page_idx": 3
483
+ },
484
+ {
485
+ "type": "text",
486
+ "text": "3.1 A CLOSER LOOK AT PREFIX TUNING ",
487
+ "text_level": 1,
488
+ "bbox": [
489
+ 174,
490
+ 426,
491
+ 472,
492
+ 441
493
+ ],
494
+ "page_idx": 3
495
+ },
496
+ {
497
+ "type": "text",
498
+ "text": "Eq. 5 describes the mechanism of prefix tuning which changes the attention module through prepending $l$ learnable vectors to the original attention keys and values. Here, we derive an equivalent form of Eq. 5 and provide an alternative view of prefix tuning:5 ",
499
+ "bbox": [
500
+ 173,
501
+ 452,
502
+ 823,
503
+ 496
504
+ ],
505
+ "page_idx": 3
506
+ },
507
+ {
508
+ "type": "equation",
509
+ "img_path": "images/8ef42e61f3f24f6dff976b460e696011d571e0cf7e273a9d7d42598b0f57144f.jpg",
510
+ "text": "$$\n\\begin{array} { r l } & { \\mathrm { h e a d } = \\mathrm { A t } \\mathrm { t n } ( x W _ { q } , \\mathrm { c o n c a t } ( P _ { k } , C W _ { k } ) , \\mathrm { c o n c a t } ( P _ { v } , C W _ { v } ) ) } \\\\ & { \\ = \\mathrm { s o f t m a x } \\big ( x W _ { q } \\mathrm { c o n c a t } ( P _ { k } , C W _ { k } ) ^ { \\top } \\big ) \\Big [ \\begin{array} { l } { P _ { v } } \\\\ { C W _ { v } } \\end{array} \\Big ] } \\\\ & { \\ = ( 1 - \\lambda ( \\pmb { x } ) ) \\mathrm { s o f t m a x } ( { \\pmb x } W _ { q } W _ { k } ^ { \\top } C ^ { \\top } ) C W _ { v } + \\lambda ( { \\pmb x } ) \\mathrm { s o f t m a x } ( { \\pmb x } W _ { q } P _ { k } ^ { \\top } ) P _ { v } } \\\\ & { \\ = ( 1 - \\lambda ( \\pmb { x } ) ) \\underbrace { \\mathrm { A t t n } ( { \\pmb x } W _ { q } , C W _ { k } , C W _ { v } ) } _ { \\mathrm { s t a n d a r d a t e n t i o n } } + \\lambda ( \\pmb { x } ) \\underbrace { \\mathrm { A t t n } ( { \\pmb x } W _ { q } , P _ { k } , P _ { v } ) } _ { \\mathrm { i n d e p e n d e n t o f } C } , } \\end{array}\n$$",
511
+ "text_format": "latex",
512
+ "bbox": [
513
+ 250,
514
+ 500,
515
+ 746,
516
+ 611
517
+ ],
518
+ "page_idx": 3
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "where $\\lambda ( { \\pmb x } )$ is a scalar that represents the sum of normalized attention weights on the prefixes: ",
523
+ "bbox": [
524
+ 169,
525
+ 616,
526
+ 792,
527
+ 631
528
+ ],
529
+ "page_idx": 3
530
+ },
531
+ {
532
+ "type": "equation",
533
+ "img_path": "images/64b10e3182022eabd7ae3d8dd60a2f0cae8790691bb51604f897bb0d6bf3728b.jpg",
534
+ "text": "$$\n\\lambda ( \\pmb { x } ) = \\frac { \\sum _ { i } \\exp ( \\pmb { x } \\pmb { W _ { q } } \\pmb { P } _ { k } ^ { \\top } ) _ { i } } { \\sum _ { i } \\exp ( \\pmb { x } \\pmb { W _ { q } } \\pmb { P } _ { k } ^ { \\top } ) _ { i } + \\sum _ { j } \\exp ( \\pmb { x } \\pmb { W _ { q } } \\pmb { W } _ { k } ^ { \\top } \\pmb { C } ^ { \\top } ) _ { j } } .\n$$",
535
+ "text_format": "latex",
536
+ "bbox": [
537
+ 308,
538
+ 636,
539
+ 689,
540
+ 675
541
+ ],
542
+ "page_idx": 3
543
+ },
544
+ {
545
+ "type": "text",
546
+ "text": "Note that the first term in Eq. 7, $\\mathrm { A t t n } ( x W _ { q } , C W _ { k } , C W _ { v } )$ , is the original attention without prefixes, whereas the second term is a position-wise modification independent of $C$ . Eq. 7 gives an alternative view of prefix tuning that essentially applies a position-wise modification to the original head attention output $^ { h }$ through linear interpolation: ",
547
+ "bbox": [
548
+ 174,
549
+ 679,
550
+ 825,
551
+ 737
552
+ ],
553
+ "page_idx": 3
554
+ },
555
+ {
556
+ "type": "equation",
557
+ "img_path": "images/649caf7eb49868967eb23e03d6682dac9585b1e77a503e63210bf71549b3ac19.jpg",
558
+ "text": "$$\n\\begin{array} { r } { \\pmb { h } ( 1 - \\lambda ( \\pmb { x } ) ) \\pmb { h } + \\lambda ( \\pmb { x } ) \\Delta \\pmb { h } , \\quad \\Delta \\pmb { h } : = \\mathrm { s o f t m a x } ( \\pmb { x } \\pmb { W } _ { q } \\pmb { P } _ { k } ^ { \\top } ) \\pmb { P } _ { v } . } \\end{array}\n$$",
559
+ "text_format": "latex",
560
+ "bbox": [
561
+ 284,
562
+ 742,
563
+ 714,
564
+ 761
565
+ ],
566
+ "page_idx": 3
567
+ },
568
+ {
569
+ "type": "text",
570
+ "text": "The Connection with Adapters: We define $W _ { 1 } { = } W _ { q } P _ { k } ^ { \\top }$ , $W _ { 2 } { = } P _ { v }$ , $f \\colon$ =softmax, and rewrite Eq. 9: ",
571
+ "bbox": [
572
+ 173,
573
+ 773,
574
+ 823,
575
+ 791
576
+ ],
577
+ "page_idx": 3
578
+ },
579
+ {
580
+ "type": "equation",
581
+ "img_path": "images/e48ece8aaeae6c4520b396dbfbfa85c3cac2a8997db2274fc247664c93254df9.jpg",
582
+ "text": "$$\n\\begin{array} { r } { \\pmb { h } ( 1 - \\lambda ( \\pmb { x } ) ) \\pmb { h } + \\lambda ( \\pmb { x } ) f ( \\pmb { x } \\pmb { W } _ { 1 } ) \\pmb { W } _ { 2 } , } \\end{array}\n$$",
583
+ "text_format": "latex",
584
+ "bbox": [
585
+ 366,
586
+ 796,
587
+ 630,
588
+ 814
589
+ ],
590
+ "page_idx": 3
591
+ },
592
+ {
593
+ "type": "text",
594
+ "text": "which reaches a very similar form to the adapter function in Eq. 4, except that prefix tuning is performing weighted addition while the adapter one is unweighted.6 Figure 3b demonstrates the computation graph of prefix tuning from this view, which allows for abstraction of prefix tuning as a plug-in module like adapters. Further, we note that $W _ { 1 } \\in \\mathbb { R } ^ { d _ { h } \\times l }$ and $W _ { 2 } \\in \\mathbb { R } ^ { l ^ { \\cdot } \\times d _ { h } }$ are lowrank matrices when $l$ is small, and thus they function similarly to the $W _ { \\mathrm { d o w n } }$ and $W _ { \\mathrm { u p } }$ matrices in adapters. This view also suggests that the number of prefix vectors, $l$ , plays a similar role to the bottleneck dimension $r$ in adapters: they both represent the rank limitation of computing the modification vector $\\Delta h$ . Thus we also refer $l$ as the bottleneck dimension. Intuitively, the rank limitation implies that $\\Delta h$ is a linear combination of the same $l$ (or $\\leq l$ ) basis vectors for any $_ { \\textbf { \\em x } }$ . ",
595
+ "bbox": [
596
+ 174,
597
+ 819,
598
+ 825,
599
+ 847
600
+ ],
601
+ "page_idx": 3
602
+ },
603
+ {
604
+ "type": "table",
605
+ "img_path": "images/b28a62ed2483e98fd1f71cf0f6114593aa0a48ba96f113edaec0cb39d5a64ea2.jpg",
606
+ "table_caption": [
607
+ "Table 1: Parameter-efficient tuning methods decomposed along the defined design dimensions. Here, for clarity, we directly write the adapter nonlinear function as ReLU which is commonly used. The bottom part of the table exemplifies new variants by transferring design choices of existing approaches. "
608
+ ],
609
+ "table_footnote": [],
610
+ "table_body": "<table><tr><td>Method</td><td>△h functional form</td><td>insertion form</td><td>modified representation</td><td>composition function</td></tr><tr><td colspan=\"5\">Existing Methods</td></tr><tr><td>Prefix Tuning</td><td> softmax(xWqPT)Pu</td><td>parallel</td><td>head attn</td><td>h←(1-λ)h+λ△h</td></tr><tr><td>Adapter</td><td>ReLU(hWdown)Wup</td><td>sequential</td><td>ffn/attn</td><td>h←h+△h</td></tr><tr><td>LoRA</td><td>xWdownWup</td><td>parallel</td><td>attn key/val</td><td>h←h+s·△h</td></tr><tr><td colspan=\"5\">Proposed Variants</td></tr><tr><td>Parallel adapter</td><td>ReLU(hWdown)Wup</td><td>parallel</td><td>ffn/attn</td><td>h←h+△h</td></tr><tr><td>Muti-head parallel adapter</td><td>ReLU(hWdown)Wup</td><td>parallel</td><td>head attn</td><td>h←h+△h</td></tr><tr><td>Scaled parallel adapter</td><td>ReLU(hWdown)Wup</td><td>parallel</td><td>ffn/attn</td><td>h←h+s·△h</td></tr></table>",
611
+ "bbox": [
612
+ 174,
613
+ 143,
614
+ 825,
615
+ 262
616
+ ],
617
+ "page_idx": 4
618
+ },
619
+ {
620
+ "type": "text",
621
+ "text": "",
622
+ "bbox": [
623
+ 173,
624
+ 281,
625
+ 825,
626
+ 378
627
+ ],
628
+ "page_idx": 4
629
+ },
630
+ {
631
+ "type": "text",
632
+ "text": "The Difference from Adapters: In addition to the gating variable $\\lambda$ , we emphasize three differences between prefix tuning and adapters. (1) As demonstrated in Figure 3, prefix tuning uses $_ { \\textbf { \\em x } }$ , the input of the PLM layer, to compute $\\Delta h$ , while adapters use $^ { h }$ , the output of the PLM layer. Thus, prefix tuning can be thought of as a “parallel” computation to the PLM layer, whereas the typical adapter is “sequential” computation. (2) Adapters are more flexible with respect to where they are inserted than prefix tuning: adapters typically modify attention or FFN outputs, while prefix tuning only modifies the attention output of each head. Empirically, this makes a large difference as we will show in $\\ S 4 . 4$ . (3) Eq. 10 applies to each attention head, while adapters are always single-headed, which makes prefix tuning more expressive: head attention is of dimension $d / \\dot { N _ { h } }$ – basically we have full rank updates to each attention head if $l \\geq d / N _ { h }$ , but we only get full-rank updates to the whole attention output with adapters if $r \\geq d$ . Notably, prefix tuning is not adding more parameters than adapters when ${ \\dot { l } } = r$ .7 We empirically validate such multi-head influence in $\\ S 4 . 4$ . ",
633
+ "bbox": [
634
+ 174,
635
+ 386,
636
+ 825,
637
+ 551
638
+ ],
639
+ "page_idx": 4
640
+ },
641
+ {
642
+ "type": "text",
643
+ "text": "3.2 THE UNIFIED FRAMEWORK ",
644
+ "text_level": 1,
645
+ "bbox": [
646
+ 176,
647
+ 573,
648
+ 405,
649
+ 587
650
+ ],
651
+ "page_idx": 4
652
+ },
653
+ {
654
+ "type": "text",
655
+ "text": "Inspired by the connections between prefix tuning and adapters, we propose a general framework that aims to unify several state-of-the-art parameter-efficient tuning methods. Specifically, we cast them as learning a modification vector $\\Delta h$ , which is applied to various hidden representations. Formally, we denote the hidden representation to be directly modified as $^ { h }$ , and the direct input to the PLM sub-module that computes $^ { h }$ as $_ { \\textbf { \\em x } }$ (e.g. $^ { h }$ and $_ { \\textbf { \\em x } }$ can be the attention output and input respectively). To characterize this modification process, we define a set of design dimensions, and different methods can be instantiated by varying values along these dimensions. We detail the design dimensions below, and illustrate how adapters, prefix tuning, and LoRA fall along them in Table 1: ",
656
+ "bbox": [
657
+ 174,
658
+ 601,
659
+ 825,
660
+ 713
661
+ ],
662
+ "page_idx": 4
663
+ },
664
+ {
665
+ "type": "text",
666
+ "text": "Functional Form is the specific function that computes $\\Delta h$ . We have detailed the functional form for adapters, prefix tuning, and LoRA in Eq. 4, 6, and 10 respectively. The functional forms of all these methods are similar with a proj down nonlinear $\\to \\mathsf { p r o j }$ up architecture, while “nonlinear” degenerates to the identity function in LoRA. ",
667
+ "bbox": [
668
+ 174,
669
+ 719,
670
+ 825,
671
+ 776
672
+ ],
673
+ "page_idx": 4
674
+ },
675
+ {
676
+ "type": "text",
677
+ "text": "Modified Representation indicates which hidden representation is directly modified.8 ",
678
+ "bbox": [
679
+ 174,
680
+ 782,
681
+ 738,
682
+ 797
683
+ ],
684
+ "page_idx": 4
685
+ },
686
+ {
687
+ "type": "text",
688
+ "text": "Insertion Form is how the added module is inserted into the network. As mentioned in the previous section and shown in Figure 3, traditionally adapters are inserted at a position in a sequential manner, where both the input and output are $^ { h }$ . Prefix tuning and LoRA – although not originally described in this way – turn out to be equivalent to a parallel insertion where $_ { \\textbf { \\em x } }$ is the input. ",
689
+ "bbox": [
690
+ 174,
691
+ 804,
692
+ 825,
693
+ 859
694
+ ],
695
+ "page_idx": 4
696
+ },
697
+ {
698
+ "type": "text",
699
+ "text": "Composition Function is how the modified vector $\\Delta h$ is composed with the original hidden representation $^ { h }$ to form the new hidden representation. For example, adapters perform simple additive composition, prefix tuning uses a gated additive composition as shown in Eq. 10, and LoRA scales $\\Delta h$ by a constant factor and adds it to the original hidden representation as in Eq. 6. ",
700
+ "bbox": [
701
+ 174,
702
+ 103,
703
+ 823,
704
+ 159
705
+ ],
706
+ "page_idx": 5
707
+ },
708
+ {
709
+ "type": "text",
710
+ "text": "We note that many other methods not present in Table 1 fit into this framework as well. For example, prompt tuning modifies the head attention in the first layer in a way similar to prefix tuning, and various adapter variants (Pfeiffer et al., 2021; Mahabadi et al., 2021) can be represented in a similar way as adapters. Critically, the unified framework allows us to study parameter-efficient tuning methods along these design dimensions, identify the critical design choices, and potentially transfer design elements across approaches, as in the following section. ",
711
+ "bbox": [
712
+ 174,
713
+ 166,
714
+ 825,
715
+ 250
716
+ ],
717
+ "page_idx": 5
718
+ },
719
+ {
720
+ "type": "text",
721
+ "text": "3.3 TRANSFERRING DESIGN ELEMENTS ",
722
+ "text_level": 1,
723
+ "bbox": [
724
+ 178,
725
+ 265,
726
+ 464,
727
+ 279
728
+ ],
729
+ "page_idx": 5
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "Here, and in Figure 3, we describe just a few novel methods that can be derived through our unified view above by transferring design elements across methods: (1) Parallel Adapter is the variant by transferring the parallel insertion of prefix tuning into adapters. Interestingly, while we motivate the parallel adapter due to its similarity to prefix tuning, concurrent work (Zhu et al., 2021) independently proposed this variant and studied it empirically; (2) Multi-head Parallel Adapter is a further step to make adapters more similar to prefix tuning: we apply parallel adapters to modify head attention outputs as prefix tuning. This way the variant improves the capacity for free by utilizing the multi-head projections as we discuss in $\\ S 3 . 1$ . (3) Scaled Parallel Adapter is the variant by transferring the composition and insertion form of LoRA into adapters, as shown in Figure 3e. ",
734
+ "bbox": [
735
+ 174,
736
+ 290,
737
+ 825,
738
+ 415
739
+ ],
740
+ "page_idx": 5
741
+ },
742
+ {
743
+ "type": "text",
744
+ "text": "Our discussion and formulation so far raise a few questions: Do methods varying the design elements above exhibit distinct properties? Which design dimensions are particularly important? Do the novel methods described above yield better performance? We answer these questions next. ",
745
+ "bbox": [
746
+ 176,
747
+ 422,
748
+ 825,
749
+ 464
750
+ ],
751
+ "page_idx": 5
752
+ },
753
+ {
754
+ "type": "text",
755
+ "text": "4 EXPERIMENTS ",
756
+ "text_level": 1,
757
+ "bbox": [
758
+ 176,
759
+ 486,
760
+ 326,
761
+ 502
762
+ ],
763
+ "page_idx": 5
764
+ },
765
+ {
766
+ "type": "text",
767
+ "text": "4.1 GENERAL SETUP ",
768
+ "text_level": 1,
769
+ "bbox": [
770
+ 176,
771
+ 516,
772
+ 333,
773
+ 531
774
+ ],
775
+ "page_idx": 5
776
+ },
777
+ {
778
+ "type": "text",
779
+ "text": "Datasets: We study four downstream tasks: (1) XSum (Narayan et al., 2018) is an English summarization dataset where models predict a summary given a news article; (2) English to Romanian translation using the WMT 2016 en-ro dataset (Bojar et al., 2016); (3) MNLI (Williams et al., 2018) is an English natural language inference dataset where models predict whether one sentence entails, contradicts, or is neutral to another. (4) SST2 (Socher et al., 2013) is an English sentiment classification benchmark where models predict whether a sentence’s sentiment is positive or negative. ",
780
+ "bbox": [
781
+ 174,
782
+ 542,
783
+ 825,
784
+ 626
785
+ ],
786
+ "page_idx": 5
787
+ },
788
+ {
789
+ "type": "text",
790
+ "text": "Setup: We use ${ \\tt B A R T } _ { \\tt L A R G E }$ (Lewis et al., 2020) and a multilingual version of it, mBARTLARGE (Liu et al., 2020a), as the underlying pretrained models for XSum and en-ro translation respectively, and we use RoBERTaBASE (Liu et al., 2019) for MNLI and SST2. We vary the bottleneck dimension within $\\{ 1 , 3 0 , 2 0 0 , 5 1 2 , 1 0 2 4 \\}$ if needed.9 We mainly study adapters, prefix tuning (prefix), and LoRA which greatly outperform bitfit and prompt tuning in our experiments. In the analysis sections $( \\ S 4 . 3 – 4 . 5 )$ we insert adapters either at the attention or FFN layers for easier analysis, but include the results of inserting at both places in the final comparison (§4.6). We re-implement these methods based on their respective public code.10 We use the huggingface transformers library (Wolf et al., 2020) for our implementation. Complete setup details can be found in Appendix A. ",
791
+ "bbox": [
792
+ 174,
793
+ 633,
794
+ 825,
795
+ 758
796
+ ],
797
+ "page_idx": 5
798
+ },
799
+ {
800
+ "type": "text",
801
+ "text": "Evaluation: We report ROUGE $1 / 2 / \\mathrm { L }$ scores (R-1/2/L, Lin (2004)) on the XSum test set, BLEU scores (Papineni et al., 2002) on the en-ro test set, and accuracy on the MNLI and SST2 dev set. For MNLI and SST2, we take the median of five random runs. We also report the number of tuned parameters relative to that in full fine-tuning (#params). ",
802
+ "bbox": [
803
+ 174,
804
+ 765,
805
+ 825,
806
+ 821
807
+ ],
808
+ "page_idx": 5
809
+ },
810
+ {
811
+ "type": "text",
812
+ "text": "Number of Tunable Parameters: BART and mBART have an encoder-decoder structure that has three types of attention: encoder self-attention, decoder self-attention, and decoder cross-attention. RoBERTa only has encoder self-attention. For each attention sub-layer, the number of parameters used of each method is: (1) prefix tuning prepends $l$ vectors to the keys and values and uses $2 \\times l \\times d$ parameters; (2) adapter has $W _ { \\mathrm { d o w n } }$ and $W _ { \\mathrm { u p } }$ thus uses $2 \\times r \\times d$ parameters; (3) LoRA employs a pair of $W _ { \\mathrm { d o w n } }$ and $W _ { \\mathrm { u p } }$ for query and value projections, hence uses $4 \\times r \\times d$ parameters. For the adapter modification at ffn, it uses $2 \\times r \\times d$ parameters which is the same as adapter at attention. Therefore, for a specific value of $r$ or $l$ , prefix tuning uses the same number of parameters as adapters, while LoRA uses more parameters. More details can be found in Appendix B. ",
813
+ "bbox": [
814
+ 174,
815
+ 829,
816
+ 821,
817
+ 871
818
+ ],
819
+ "page_idx": 5
820
+ },
821
+ {
822
+ "type": "image",
823
+ "img_path": "images/bfd47b7ac5dcc585f8293ecd8c4a66c357d735ee263aa3622fc820936609f5be.jpg",
824
+ "image_caption": [
825
+ "Figure 4: Performance of previous state-of-the-art parameterefficient tuning methods on $\\bar { \\mathrm { X S u m } }$ (left) and en-ro (right). "
826
+ ],
827
+ "image_footnote": [],
828
+ "bbox": [
829
+ 173,
830
+ 114,
831
+ 558,
832
+ 261
833
+ ],
834
+ "page_idx": 6
835
+ },
836
+ {
837
+ "type": "table",
838
+ "img_path": "images/2be889d74237c1555787a7c44f92253980d2236397ebd647588409b5e5f62eb7.jpg",
839
+ "table_caption": [
840
+ "Table 2: Accuracy on the dev set of MNLI and SST2. MAM Adapter is proposed in $\\ S 4 . 6$ . Bitfit numbers are from Ben Zaken et al. (2021). "
841
+ ],
842
+ "table_footnote": [],
843
+ "table_body": "<table><tr><td>Method (# params)</td><td>MNLI</td><td>SST2</td></tr><tr><td>Full-FT (100%)</td><td>87.6±.4</td><td>94.6±.4 93.7</td></tr><tr><td>Bitfit (0.1 %) Prefix (0.5%) LoRA (0.5%) Adapter (0.5%)</td><td>84.7 86.3±.4 87.2±.4 87.2±.2</td><td>94.0±.1 94.2±.2 94.2±.1</td></tr><tr><td colspan=\"3\">MAM Adapter (0.5%) 87.4±.3 94.2±.3</td></tr></table>",
844
+ "bbox": [
845
+ 588,
846
+ 185,
847
+ 797,
848
+ 282
849
+ ],
850
+ "page_idx": 6
851
+ },
852
+ {
853
+ "type": "table",
854
+ "img_path": "images/dca06a014081f54d894a2ba4c0aed826ca5d7d5c7e868147bf469cfcded10223.jpg",
855
+ "table_caption": [
856
+ "Table 3: Comparison of different insertion forms for adapters, i.e. sequential adapter (SA) and parallel adapter (PA). We include the results of prefix tuning as a reference point. "
857
+ ],
858
+ "table_footnote": [],
859
+ "table_body": "<table><tr><td>Method</td><td># params</td><td>XSum (R-1/2/L)</td><td>MT (BLEU)</td></tr><tr><td>Prefix,l=200</td><td>3.6%</td><td>43.40/20.46/35.51</td><td>35.6</td></tr><tr><td>SA (attn), r=200</td><td>3.6%</td><td>42.01/19.30/34.40</td><td>35.3</td></tr><tr><td>SA (ffn),r=200</td><td>2.4%</td><td>43.21/19.98/35.08</td><td>35.6</td></tr><tr><td>PA (attn), r=200</td><td>3.6%</td><td>43.58/20.31/35.34</td><td>35.6</td></tr><tr><td>PA (ffn),r=200</td><td>2.4%</td><td>43.93/20.66/35.63</td><td>36.4</td></tr></table>",
860
+ "bbox": [
861
+ 189,
862
+ 352,
863
+ 537,
864
+ 444
865
+ ],
866
+ "page_idx": 6
867
+ },
868
+ {
869
+ "type": "table",
870
+ "img_path": "images/dc702ee3077619be3b01a1dc0d94ca4c45755440c068f489489ac840181210d7.jpg",
871
+ "table_caption": [
872
+ "Table 4: Results on en-ro dataset. "
873
+ ],
874
+ "table_footnote": [],
875
+ "table_body": "<table><tr><td>Method</td><td># params MT (BLEU)</td></tr><tr><td>PA (attn),r=200 Prefix,l=200</td><td>3.6% 35.6 3.6% 35.6</td></tr><tr><td>MH PA (attn),r=200</td><td>3.6% 35.8</td></tr><tr><td>Prefix,l=30</td><td>0.1% 35.2</td></tr><tr><td>-gating,l=30</td><td>0.1% 34.9</td></tr><tr><td>PA (ffn),r=30</td><td>0.1% 33.0</td></tr><tr><td>PA (attn),r=30 MH PA (attn),r=30</td><td>0.1% 33.7 0.1% 35.3</td></tr></table>",
876
+ "bbox": [
877
+ 571,
878
+ 325,
879
+ 813,
880
+ 444
881
+ ],
882
+ "page_idx": 6
883
+ },
884
+ {
885
+ "type": "text",
886
+ "text": "",
887
+ "bbox": [
888
+ 174,
889
+ 454,
890
+ 825,
891
+ 537
892
+ ],
893
+ "page_idx": 6
894
+ },
895
+ {
896
+ "type": "text",
897
+ "text": "4.2 THE RESULTS OF EXISTING METHODS ",
898
+ "text_level": 1,
899
+ "bbox": [
900
+ 176,
901
+ 554,
902
+ 482,
903
+ 569
904
+ ],
905
+ "page_idx": 6
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "We first overview the results of existing methods on the four tasks. As shown in Figure 4 and Table 2, while existing methods can achieve competitive performance on MNLI and SST2 by tuning fewer than $1 \\%$ parameters, a large gap is still present if we add $5 \\%$ parameters in XSum and en-ro. The gap remains significant even though we increase the relative parameter size to $> 1 0 \\%$ . Even larger gaps have been observed in Raffel et al. (2020) on high-resource MT tasks. This shows that many methods that claimed comparable results to full fine-tuning on the GLUE benchmark with an encoder-only model (Guo et al., 2021; Ben Zaken et al., 2021; Mahabadi et al., 2021), or on relatively simple generation benchmarks such as E2E (Novikova et al., 2017) with an encoder-decoder model (Li & Liang, 2021), may not generalize well to other standard benchmarks. The influencing factors could be complicated including the number of training samples, task complexity, or model architecture. We thus advocate for future research on this line to report results on more diverse benchmarks to exhibit a more complete picture of their performance profile. Below, our analysis will mainly focus on the XSum and en-ro datasets to better distinguish different design choices. We note that these two benchmarks are relatively high-resource performed with an encoder-decoder model (BART), while we will discuss the results on MNLI and SST2 with an encoder-only model (RoBERTa) in $\\ S 4 . 6$ . ",
910
+ "bbox": [
911
+ 174,
912
+ 580,
913
+ 825,
914
+ 787
915
+ ],
916
+ "page_idx": 6
917
+ },
918
+ {
919
+ "type": "text",
920
+ "text": ".3 WHICH INSERTION FORM – SEQUENTIAL OR PARALLEL? ",
921
+ "text_level": 1,
922
+ "bbox": [
923
+ 184,
924
+ 804,
925
+ 606,
926
+ 819
927
+ ],
928
+ "page_idx": 6
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "We first study the insertion form design dimension, comparing the proposed parallel adapter (PA) variant to the conventional sequential adapter (SA) over both the attention (att) and FFN modification. We also include prefix tuning as a reference point. As shown in Table 3, prefix tuning, which uses parallel insertion, outperforms attention sequential adapters. Further, the parallel adapter is able to beat sequential adapters in all cases,11 with PA (ffn) outperforming SA (ffn) by $1 . 7 \\mathrm { R } \\mathrm { - } 2$ points on ",
933
+ "bbox": [
934
+ 174,
935
+ 830,
936
+ 823,
937
+ 900
938
+ ],
939
+ "page_idx": 6
940
+ },
941
+ {
942
+ "type": "image",
943
+ "img_path": "images/08efaea948e4b8e31896a063d3d9ff883d744e25c54932f026083a5374a43c9f.jpg",
944
+ "image_caption": [
945
+ "Figure 5: Results on XSum (left) and en-ro (right). PA represents parallel adapter. Blue and red markers apply modifications at attention and FFN sub-layers respectively (best viewed in color). "
946
+ ],
947
+ "image_footnote": [],
948
+ "bbox": [
949
+ 189,
950
+ 103,
951
+ 772,
952
+ 223
953
+ ],
954
+ "page_idx": 7
955
+ },
956
+ {
957
+ "type": "text",
958
+ "text": "XSum and 0.8 BLEU points on en-ro respectively. Given the superior results of parallel adapters over sequential adapters, we focus on parallel adapter results in following sections. ",
959
+ "bbox": [
960
+ 174,
961
+ 260,
962
+ 821,
963
+ 287
964
+ ],
965
+ "page_idx": 7
966
+ },
967
+ {
968
+ "type": "text",
969
+ "text": "4.4 WHICH MODIFIED REPRESENTATION – ATTENTION OR FFN? ",
970
+ "text_level": 1,
971
+ "bbox": [
972
+ 174,
973
+ 305,
974
+ 638,
975
+ 319
976
+ ],
977
+ "page_idx": 7
978
+ },
979
+ {
980
+ "type": "text",
981
+ "text": "Setup: We now study the effect of modifying different representations. We mainly compare attention and FFN modification. For easier analysis we categorize methods that modifies any hidden representations in the attention sub-layer (e.g. the head output, query, etc) as modifying the attention module. We compare parallel adapters at attention and FFN and prefix tuning. We also transfer the FFN modification to LoRA to have a LoRA (ffn) variant for a complete comparison. Specifically, we use LoRA to approximate the parameter updates for the FFN weights $\\dot { W _ { 1 } } \\in \\mathbb { R } ^ { d \\times \\dot { d _ { m } } }$ and $\\pmb { W } _ { 2 } \\in \\mathbb { R } ^ { d _ { m } \\times d }$ . In this case $W _ { \\mathrm { u p } }$ in LoRA for $W _ { 1 }$ (similar for $W _ { \\mathrm { d o w n } }$ of $W _ { 2 }$ ) would have dimensions of $r \\times d _ { m }$ , where $d _ { m } = 4 d$ as described in $\\ S 2 . 1$ . Thus we typically use smaller $r$ for LoRA (ffn) than other methods to match their overall parameter size in later experiments. ",
982
+ "bbox": [
983
+ 173,
984
+ 330,
985
+ 825,
986
+ 457
987
+ ],
988
+ "page_idx": 7
989
+ },
990
+ {
991
+ "type": "text",
992
+ "text": "Results: As shown in Figure 5, any method with FFN modification outperforms all the methods with attention modification in all cases (the red markers are generally above all the blue ones, the only exception is ffn-PA with $2 . 4 \\%$ params), often with fewer parameters. Second, the same method applied at FFN always improves over its attention counterpart. For example, LoRA (ffn) improves LoRA (attn) by 1 R-2 points on XSum. We also highlight that prefix tuning does not keep improving when we further increase the capacity, which is also observed in Li & Liang (2021). These results suggest that FFN modification can utilize the added parameters more effectively than attention, no matter what the functional form or composition function is. We hypothesize that this is because the FFN learns task-specific textual patterns (Geva et al., 2021), while attention learns pairwise positional interactions which do not require large capacity for adapting to new tasks. ",
993
+ "bbox": [
994
+ 173,
995
+ 463,
996
+ 825,
997
+ 602
998
+ ],
999
+ "page_idx": 7
1000
+ },
1001
+ {
1002
+ "type": "text",
1003
+ "text": "Is the story different when we use $0 . 1 \\%$ parameters? In $\\ S 3 . 1$ we reason that prefix tuning is more expressive than adapters (attn), which, however, is not reflected in Figure 5. We conjecture that this is because multi-head attention is only superior when the parameter budget is small. To validate this hypothesis, we compare prefix tuning to parallel adapters when they add $0 . 1 \\%$ of the pretrained parameters. To ablate the impact of the composition function, we also report the results of removing the gating in prefix tuning as $h + \\Delta h$ . We include the results of the multi-head parallel adapter variant (MH PA) described in $\\ S 3 . 3$ . As shown in Table 4, the multi-head methods – prefix tuning and MH PA (attn) – outperform all others by at least 1.6 BLEU points when using $0 . 1 \\%$ of the parameters. Surprisingly, reducing $l$ from 200 to 30 only causes 0.4 BLEU loss for prefix tuning while PA (attn) loses 1.9 points. The gating composition function in prefix tuning slightly helps the results by 0.3 points. We highlight that the MH parallel adapter improves the single-headed version by 1.6 points, which again verifies the effectiveness of the multi-head formulation. ",
1004
+ "bbox": [
1005
+ 174,
1006
+ 609,
1007
+ 825,
1008
+ 775
1009
+ ],
1010
+ "page_idx": 7
1011
+ },
1012
+ {
1013
+ "type": "text",
1014
+ "text": "Combining the results in Figure 5 and Table 4, we conclude that modifying head attention shows the best results when the parameter budget is very small, while the FFN can better utilize modifications at larger capacities. This suggests that it may be effective to allocate a larger parameter budget to FFN modification instead of treating attention and FFN equally as in Houlsby et al. (2019). ",
1015
+ "bbox": [
1016
+ 174,
1017
+ 782,
1018
+ 825,
1019
+ 839
1020
+ ],
1021
+ "page_idx": 7
1022
+ },
1023
+ {
1024
+ "type": "text",
1025
+ "text": "4.5 WHICH COMPOSITION FUNCTION? ",
1026
+ "text_level": 1,
1027
+ "bbox": [
1028
+ 176,
1029
+ 856,
1030
+ 455,
1031
+ 869
1032
+ ],
1033
+ "page_idx": 7
1034
+ },
1035
+ {
1036
+ "type": "text",
1037
+ "text": "We have presented three composition functions in $\\ S 3 . 2$ : simple addition (adapter), gated addition (prefix tuning) and scaled addition (LoRA). As it is unnatural to incorporate the exact gated addition into methods whose functional form does not use softmax, we examine the other two by ablating on LoRA and comparing with the proposed scaled parallel adapter (Scaled PA), we constrain modified representation to be FFN since it is generally more effective as shown in $\\ S 4 . 4$ ",
1038
+ "bbox": [
1039
+ 176,
1040
+ 882,
1041
+ 823,
1042
+ 922
1043
+ ],
1044
+ "page_idx": 7
1045
+ },
1046
+ {
1047
+ "type": "table",
1048
+ "img_path": "images/f586b789e71f4c2f99ed5106b7d47d4f035cf46bc1368a7ee339eb982a339215.jpg",
1049
+ "table_caption": [
1050
+ "Table 6: Comparison of various parameter-efficient tuning methods and the proposed variants. “†” are results copied from Lewis et al. (2020) and Liu et al. (2020b). We could not reproduce exactly the same full finetuning numbers with the same hyperparameters or even searching them. The reason may be the different libraries which the training code is based on – full fine-tuning is very sensitive to training hyperparameters. For the most performant methods we run with 3 random seeds and report mean and standard deviation. "
1051
+ ],
1052
+ "table_footnote": [],
1053
+ "table_body": "<table><tr><td>Method</td><td># params</td><td>XSum (R-1/2/L)</td><td>MT (BLEU)</td></tr><tr><td>Full fine-tuning+</td><td>100%</td><td>45.14/22.27/37.25</td><td>37.7</td></tr><tr><td>Full fine-tuning (our run)</td><td>100%</td><td>44.81/21.94/36.83</td><td>37.3</td></tr><tr><td>Bitfit (Ben Zaken et al., 2021)</td><td>0.1%</td><td>40.64/17.32/32.19</td><td>26.4</td></tr><tr><td>Prompt tuning (Lester et al., 2021)</td><td>0.1%</td><td>38.91/15.98/30.83</td><td>21.0</td></tr><tr><td>Prefix tuning (Li&amp; Liang,2021),l=200</td><td>3.6%</td><td>43.40/20.46/35.51</td><td>35.6</td></tr><tr><td>Pfeiffer adapter (Pfeiffer et al.,2021),r=600</td><td>7.2%</td><td>44.03/20.89/35.89±.13/.10/.08</td><td>36.9±.1</td></tr><tr><td>LoRA (ffn),r=102</td><td>7.2%</td><td>44.53/21.29/36.28±.14/.07/.10</td><td>36.8±.3</td></tr><tr><td>Parallel adapter (PA,ffn),r=1024</td><td>12.3%</td><td>44.71/21.41/36.41±.16/.17/.16</td><td>37.2±.1</td></tr><tr><td>PA (attn,r=30) + PA (ffn,r=512)</td><td>6.7%</td><td>44.29/21.06/36.12±.31/.19/.18</td><td>37.2±.1</td></tr><tr><td>Prefix tuning (attn,l=3O) + LoRA (ffn,r=102)</td><td>6.7%</td><td>44.84/21.71/36.77±.07/.05/.03</td><td>37.0±.1</td></tr><tr><td>MAM Adapter (our variant, l=30,r=512)</td><td>6.7%</td><td>45.06/21.90/36.87±.08/01/.04</td><td>37.5±.1</td></tr></table>",
1054
+ "bbox": [
1055
+ 189,
1056
+ 170,
1057
+ 808,
1058
+ 349
1059
+ ],
1060
+ "page_idx": 8
1061
+ },
1062
+ {
1063
+ "type": "text",
1064
+ "text": "",
1065
+ "bbox": [
1066
+ 176,
1067
+ 358,
1068
+ 818,
1069
+ 386
1070
+ ],
1071
+ "page_idx": 8
1072
+ },
1073
+ {
1074
+ "type": "text",
1075
+ "text": "Table 5 reports the results on XSum. We set $r$ as 512 for adapters and 102 for LoRA so that their tuned parameter sizes are the same. We select $s$ based on the R-2 score on the dev set. We observe that LoRA $s = 4$ ) performs better than parallel adapter. However, the advantage disappears if we remove the scaling by setting $s ~ = ~ 1$ . Through plugging the composition function of LoRA into parallel adapter, the resulted Scaled PA improves the vanilla parallel adapter by 0.56 ROUGE-2 points. We also experiment with a learned scalar which does not give better results. Therefore, we conclude that the scaling composition function is better than the vanilla additive one while being easily applicable. ",
1076
+ "bbox": [
1077
+ 174,
1078
+ 386,
1079
+ 516,
1080
+ 553
1081
+ ],
1082
+ "page_idx": 8
1083
+ },
1084
+ {
1085
+ "type": "table",
1086
+ "img_path": "images/5e6da241c881465525b4a45c36e16ee3be4d24fb4a3a6f5ec4c1fc5c60f42e1c.jpg",
1087
+ "table_caption": [
1088
+ "Table 5: Results on XSum when using different composition functions. The modified representation is FFN. The bottleneck dimension $\\bar { r } = 5 1 2$ for (Scaled) PA and $r = 1 0 2$ for LoRA. "
1089
+ ],
1090
+ "table_footnote": [],
1091
+ "table_body": "<table><tr><td>Method (# params)</td><td>XSum (R-1/2/LSum)</td></tr><tr><td>LoRA (6.1%), s=4</td><td>44.59/21.31/36.25</td></tr><tr><td>LoRA (6.1%), s=1</td><td>44.17/20.83/35.74</td></tr><tr><td>PA (6.1%)</td><td>44.35/20.98/35.98</td></tr><tr><td>Scaled PA (6.1%), s=4</td><td>44.85/21.54/36.58</td></tr><tr><td>Scaled PA(6.1%),trainable s</td><td>44.56/21.31/36.29</td></tr></table>",
1092
+ "bbox": [
1093
+ 534,
1094
+ 452,
1095
+ 825,
1096
+ 541
1097
+ ],
1098
+ "page_idx": 8
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "",
1103
+ "bbox": [
1104
+ 174,
1105
+ 553,
1106
+ 759,
1107
+ 565
1108
+ ],
1109
+ "page_idx": 8
1110
+ },
1111
+ {
1112
+ "type": "text",
1113
+ "text": "4.6 AN EFFECTIVE INTEGRATION BY TRANSFERRING FAVORABLE DESIGN ELEMENTS ",
1114
+ "text_level": 1,
1115
+ "bbox": [
1116
+ 173,
1117
+ 582,
1118
+ 784,
1119
+ 597
1120
+ ],
1121
+ "page_idx": 8
1122
+ },
1123
+ {
1124
+ "type": "text",
1125
+ "text": "We first highlight three findings in previous sections: (1) Scaled parallel adapter is the best variant to modify FFN; (2) FFN can better utilize modification at larger capacities; and (3) modifying head attentions like prefix tuning can achieve strong performance with only $0 . 1 \\%$ parameters. Inspired by them, we mix and match the favorable designs behind these findings: specifically, we use prefix tuning with a small bottleneck dimension $\\mathit { l } \\ : = \\ : 3 0 $ ) at the attention sub-layers and allocate more parameter budgets to modify FFN representation using the scaled parallel adapter $( r = 5 1 2$ ). Since prefix tuning can be viewed as a form of adapter in our unified framework, we name this variant as Mix-And-Match adapter (MAM Adapter). In Table 6, we compare MAM adapter with various parameter-efficient tuning methods. For completeness, we also present results of other combination versions in Table 6: using parallel adapters at both attention and FFN layers and combining prefix tuning (attn) with LoRA (ffn) – both of these combined versions can improve over their respective prototypes. However, MAM Adapter achieves the best performance on both tasks and is able to match the results of our full fine-tuning by only updating $6 . 7 \\%$ of the pre-trained parameters. In Table 2, we present the results of MAM Adapter on MNLI and SST2 as well, where MAM Adapter achieves comparable results to full fine-tuning by adding only $0 . 5 \\%$ of pretrained parameters. ",
1126
+ "bbox": [
1127
+ 174,
1128
+ 608,
1129
+ 825,
1130
+ 816
1131
+ ],
1132
+ "page_idx": 8
1133
+ },
1134
+ {
1135
+ "type": "text",
1136
+ "text": "5 DISCUSSION ",
1137
+ "text_level": 1,
1138
+ "bbox": [
1139
+ 176,
1140
+ 835,
1141
+ 310,
1142
+ 852
1143
+ ],
1144
+ "page_idx": 8
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "We provide a unified framework for several performant parameter-tuning methods, which enables us to instantiate a more effective model that matches the performance of full fine-tuning method through transferring techniques across approaches. We hope our work can provide insights and guidance for future research on parameter-efficient tuning. ",
1149
+ "bbox": [
1150
+ 176,
1151
+ 868,
1152
+ 823,
1153
+ 924
1154
+ ],
1155
+ "page_idx": 8
1156
+ },
1157
+ {
1158
+ "type": "text",
1159
+ "text": "ETHICS STATEMENT ",
1160
+ "text_level": 1,
1161
+ "bbox": [
1162
+ 176,
1163
+ 102,
1164
+ 343,
1165
+ 118
1166
+ ],
1167
+ "page_idx": 9
1168
+ },
1169
+ {
1170
+ "type": "text",
1171
+ "text": "Our work proposes a method for efficient fine-tuning of pre-trained models, in particular language models. Pre-trained language models have a wide variety of positive applications, such as the applications to summarization, translation, or language understanding described in our paper. At the same time, there are a number of ethical concerns with language models in general, including concerns regarding the generation of biased or discriminative text (Bordia & Bowman, 2019), the leakage of private information from training data (Carlini et al., 2020), and environmental impact of training or tuning them (Strubell et al., 2019). ",
1172
+ "bbox": [
1173
+ 174,
1174
+ 133,
1175
+ 825,
1176
+ 231
1177
+ ],
1178
+ "page_idx": 9
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "Our method attempts to train language models making minimal changes to their pre-existing parameters. While it is an interesting research question whether parameter-efficient fine-tuning methods exacerbate, mitigate, or make little change to issues such as bias or information leakage, to our knowledge no previous work has examined this topic. It is an interesting avenue for future work. ",
1183
+ "bbox": [
1184
+ 174,
1185
+ 238,
1186
+ 825,
1187
+ 294
1188
+ ],
1189
+ "page_idx": 9
1190
+ },
1191
+ {
1192
+ "type": "text",
1193
+ "text": "With respect to environmental impact, the methods proposed in this paper add a small number of extra parameters and components to existing models, and thus they have a nominal negative impact on training and inference time – for example, the final MAM Adapter needs $1 0 0 \\% - 1 5 0 \\%$ training time of full fine-tuning in our four benchmarks since parameter-efficient tuning typically needs more epochs to converge; the inference time is roughly the same as the model obtained by full fine-tuning. On the other hand, as the methods proposed in this paper may obviate the need for full fine-tuning, this may also significantly reduce the cost (in terms of memory/deployed servers) of serving models. Notably, the great majority of the experimentation done for this paper was performed on a data center powered entirely by renewable energy. ",
1194
+ "bbox": [
1195
+ 174,
1196
+ 301,
1197
+ 825,
1198
+ 426
1199
+ ],
1200
+ "page_idx": 9
1201
+ },
1202
+ {
1203
+ "type": "text",
1204
+ "text": "REPRODUCIBILITY STATEMENT ",
1205
+ "text_level": 1,
1206
+ "bbox": [
1207
+ 176,
1208
+ 445,
1209
+ 436,
1210
+ 460
1211
+ ],
1212
+ "page_idx": 9
1213
+ },
1214
+ {
1215
+ "type": "text",
1216
+ "text": "In addition to the setup description in $\\ S 4 . 1$ , we have detailed the complete experiments setup such as batch size, optimizer, learning rates in Appendix A. Besides, we have publicized our source code. These resources should be sufficient to reproduce results of the paper. ",
1217
+ "bbox": [
1218
+ 176,
1219
+ 477,
1220
+ 825,
1221
+ 518
1222
+ ],
1223
+ "page_idx": 9
1224
+ },
1225
+ {
1226
+ "type": "text",
1227
+ "text": "ACKNOWLEDGEMENT ",
1228
+ "text_level": 1,
1229
+ "bbox": [
1230
+ 176,
1231
+ 539,
1232
+ 357,
1233
+ 553
1234
+ ],
1235
+ "page_idx": 9
1236
+ },
1237
+ {
1238
+ "type": "text",
1239
+ "text": "We thank the anonymous reviewers for their comments. This work was supported in part by the CMU-Portugal MAIA Project, a Baidu PhD Fellowship for Junxian He, and a CMU Presidential Fellowship for Chunting Zhou. ",
1240
+ "bbox": [
1241
+ 174,
1242
+ 569,
1243
+ 825,
1244
+ 611
1245
+ ],
1246
+ "page_idx": 9
1247
+ },
1248
+ {
1249
+ "type": "text",
1250
+ "text": "REFERENCES ",
1251
+ "text_level": 1,
1252
+ "bbox": [
1253
+ 176,
1254
+ 631,
1255
+ 285,
1256
+ 646
1257
+ ],
1258
+ "page_idx": 9
1259
+ },
1260
+ {
1261
+ "type": "text",
1262
+ "text": "Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. ",
1263
+ "bbox": [
1264
+ 173,
1265
+ 661,
1266
+ 823,
1267
+ 690
1268
+ ],
1269
+ "page_idx": 9
1270
+ },
1271
+ {
1272
+ "type": "text",
1273
+ "text": "Elad Ben Zaken, Shauli Ravfogel, and Yoav Goldberg. Bitfit: Simple parameter-efficient fine-tuning for transformer-based masked language-models. arXiv e-prints, pp. arXiv–2106, 2021. ",
1274
+ "bbox": [
1275
+ 173,
1276
+ 696,
1277
+ 825,
1278
+ 727
1279
+ ],
1280
+ "page_idx": 9
1281
+ },
1282
+ {
1283
+ "type": "text",
1284
+ "text": "Ondˇrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, et al. Findings of the 2016 conference on machine translation. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, 2016. ",
1285
+ "bbox": [
1286
+ 173,
1287
+ 732,
1288
+ 826,
1289
+ 789
1290
+ ],
1291
+ "page_idx": 9
1292
+ },
1293
+ {
1294
+ "type": "text",
1295
+ "text": "Shikha Bordia and Samuel R. Bowman. Identifying and reducing gender bias in word-level language models. In Proceedings of the 2019 NAACL: Student Research Workshop, 2019. ",
1296
+ "bbox": [
1297
+ 174,
1298
+ 796,
1299
+ 820,
1300
+ 825
1301
+ ],
1302
+ "page_idx": 9
1303
+ },
1304
+ {
1305
+ "type": "text",
1306
+ "text": "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. ",
1307
+ "bbox": [
1308
+ 174,
1309
+ 832,
1310
+ 821,
1311
+ 875
1312
+ ],
1313
+ "page_idx": 9
1314
+ },
1315
+ {
1316
+ "type": "text",
1317
+ "text": "Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, et al. Extracting training data from large language models. arXiv preprint arXiv:2012.07805, 2020. ",
1318
+ "bbox": [
1319
+ 176,
1320
+ 882,
1321
+ 823,
1322
+ 924
1323
+ ],
1324
+ "page_idx": 9
1325
+ },
1326
+ {
1327
+ "type": "text",
1328
+ "text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL, 2019. ",
1329
+ "bbox": [
1330
+ 171,
1331
+ 103,
1332
+ 823,
1333
+ 133
1334
+ ],
1335
+ "page_idx": 10
1336
+ },
1337
+ {
1338
+ "type": "text",
1339
+ "text": "William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv preprint arXiv:2101.03961, 2021. ",
1340
+ "bbox": [
1341
+ 173,
1342
+ 142,
1343
+ 821,
1344
+ 171
1345
+ ],
1346
+ "page_idx": 10
1347
+ },
1348
+ {
1349
+ "type": "text",
1350
+ "text": "Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. Transformer feed-forward layers are key-value memories. In Proceedings of EMNLP, 2021. ",
1351
+ "bbox": [
1352
+ 173,
1353
+ 181,
1354
+ 820,
1355
+ 212
1356
+ ],
1357
+ "page_idx": 10
1358
+ },
1359
+ {
1360
+ "type": "text",
1361
+ "text": "Demi Guo, Alexander M Rush, and Yoon Kim. Parameter-efficient transfer learning with diff pruning. In Proceedings of ACL, 2021. ",
1362
+ "bbox": [
1363
+ 174,
1364
+ 220,
1365
+ 821,
1366
+ 251
1367
+ ],
1368
+ "page_idx": 10
1369
+ },
1370
+ {
1371
+ "type": "text",
1372
+ "text": "Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of ICCV, 2015. ",
1373
+ "bbox": [
1374
+ 173,
1375
+ 260,
1376
+ 823,
1377
+ 290
1378
+ ],
1379
+ "page_idx": 10
1380
+ },
1381
+ {
1382
+ "type": "text",
1383
+ "text": "Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In Proceedings of ICML, 2019. ",
1384
+ "bbox": [
1385
+ 173,
1386
+ 299,
1387
+ 826,
1388
+ 342
1389
+ ],
1390
+ "page_idx": 10
1391
+ },
1392
+ {
1393
+ "type": "text",
1394
+ "text": "Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021. ",
1395
+ "bbox": [
1396
+ 173,
1397
+ 352,
1398
+ 825,
1399
+ 395
1400
+ ],
1401
+ "page_idx": 10
1402
+ },
1403
+ {
1404
+ "type": "text",
1405
+ "text": "Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of ICLR, 2015. ",
1406
+ "bbox": [
1407
+ 171,
1408
+ 405,
1409
+ 825,
1410
+ 435
1411
+ ],
1412
+ "page_idx": 10
1413
+ },
1414
+ {
1415
+ "type": "text",
1416
+ "text": "Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. In Proceedings of EMNLP, 2021. ",
1417
+ "bbox": [
1418
+ 173,
1419
+ 444,
1420
+ 821,
1421
+ 474
1422
+ ],
1423
+ "page_idx": 10
1424
+ },
1425
+ {
1426
+ "type": "text",
1427
+ "text": "Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of ACL, 2020. ",
1428
+ "bbox": [
1429
+ 173,
1430
+ 483,
1431
+ 825,
1432
+ 540
1433
+ ],
1434
+ "page_idx": 10
1435
+ },
1436
+ {
1437
+ "type": "text",
1438
+ "text": "Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of ACL, 2021. ",
1439
+ "bbox": [
1440
+ 174,
1441
+ 550,
1442
+ 823,
1443
+ 580
1444
+ ],
1445
+ "page_idx": 10
1446
+ },
1447
+ {
1448
+ "type": "text",
1449
+ "text": "Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, 2004. ",
1450
+ "bbox": [
1451
+ 171,
1452
+ 590,
1453
+ 823,
1454
+ 619
1455
+ ],
1456
+ "page_idx": 10
1457
+ },
1458
+ {
1459
+ "type": "text",
1460
+ "text": "Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021a. ",
1461
+ "bbox": [
1462
+ 174,
1463
+ 628,
1464
+ 823,
1465
+ 672
1466
+ ],
1467
+ "page_idx": 10
1468
+ },
1469
+ {
1470
+ "type": "text",
1471
+ "text": "Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. GPT understands, too. arXiv:2103.10385, 2021b. ",
1472
+ "bbox": [
1473
+ 173,
1474
+ 683,
1475
+ 821,
1476
+ 712
1477
+ ],
1478
+ "page_idx": 10
1479
+ },
1480
+ {
1481
+ "type": "text",
1482
+ "text": "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. ",
1483
+ "bbox": [
1484
+ 173,
1485
+ 722,
1486
+ 826,
1487
+ 765
1488
+ ],
1489
+ "page_idx": 10
1490
+ },
1491
+ {
1492
+ "type": "text",
1493
+ "text": "Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 2020a. ",
1494
+ "bbox": [
1495
+ 174,
1496
+ 775,
1497
+ 823,
1498
+ 819
1499
+ ],
1500
+ "page_idx": 10
1501
+ },
1502
+ {
1503
+ "type": "text",
1504
+ "text": "Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726–742, 2020b. doi: 10.1162/tacl a 00343. URL https://aclanthology.org/2020.tacl-1.47. ",
1505
+ "bbox": [
1506
+ 174,
1507
+ 828,
1508
+ 825,
1509
+ 885
1510
+ ],
1511
+ "page_idx": 10
1512
+ },
1513
+ {
1514
+ "type": "text",
1515
+ "text": "Rabeeh Karimi Mahabadi, James Henderson, and Sebastian Ruder. Compacter: Efficient low-rank hypercomplex adapter layers. In Proceedings of NeurIPS, 2021. ",
1516
+ "bbox": [
1517
+ 174,
1518
+ 895,
1519
+ 821,
1520
+ 924
1521
+ ],
1522
+ "page_idx": 10
1523
+ },
1524
+ {
1525
+ "type": "text",
1526
+ "text": "Shashi Narayan, Shay B. Cohen, and Mirella Lapata. Don’t give me the details, just the summary! Topic-aware convolutional neural networks for extreme summarization. In Proceedings of EMNLP, 2018. ",
1527
+ "bbox": [
1528
+ 174,
1529
+ 103,
1530
+ 825,
1531
+ 145
1532
+ ],
1533
+ "page_idx": 11
1534
+ },
1535
+ {
1536
+ "type": "text",
1537
+ "text": "Jekaterina Novikova, Ondˇrej Dusek, and Verena Rieser. The E2E dataset: New challenges for ˇ end-to-end generation. In Proceedings of the 18th Annual SIGdial Meeting on Discourse and Dialogue, pp. 201–206, Saarbrucken, Germany, August 2017. doi: 10.18653/v1/W17-5525. ¨ ",
1538
+ "bbox": [
1539
+ 176,
1540
+ 155,
1541
+ 823,
1542
+ 198
1543
+ ],
1544
+ "page_idx": 11
1545
+ },
1546
+ {
1547
+ "type": "text",
1548
+ "text": "Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of ACL, 2002. ",
1549
+ "bbox": [
1550
+ 173,
1551
+ 205,
1552
+ 820,
1553
+ 236
1554
+ ],
1555
+ "page_idx": 11
1556
+ },
1557
+ {
1558
+ "type": "text",
1559
+ "text": "Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of NAACL, 2018. ",
1560
+ "bbox": [
1561
+ 173,
1562
+ 243,
1563
+ 823,
1564
+ 273
1565
+ ],
1566
+ "page_idx": 11
1567
+ },
1568
+ {
1569
+ "type": "text",
1570
+ "text": "Jonas Pfeiffer, Aishwarya Kamath, Andreas Ruckl ¨ e, Kyunghyun Cho, and Iryna Gurevych. Adapter- ´ Fusion: Non-destructive task composition for transfer learning. In Proceedings of EACL, 2021. ",
1571
+ "bbox": [
1572
+ 176,
1573
+ 281,
1574
+ 823,
1575
+ 311
1576
+ ],
1577
+ "page_idx": 11
1578
+ },
1579
+ {
1580
+ "type": "text",
1581
+ "text": "Xipeng Qiu, Tianxiang Sun, Yige Xu, Yunfan Shao, Ning Dai, and Xuanjing Huang. Pre-trained models for natural language processing: A survey. Science China Technological Sciences, 2020. ",
1582
+ "bbox": [
1583
+ 174,
1584
+ 319,
1585
+ 823,
1586
+ 349
1587
+ ],
1588
+ "page_idx": 11
1589
+ },
1590
+ {
1591
+ "type": "text",
1592
+ "text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 2019. ",
1593
+ "bbox": [
1594
+ 173,
1595
+ 357,
1596
+ 823,
1597
+ 387
1598
+ ],
1599
+ "page_idx": 11
1600
+ },
1601
+ {
1602
+ "type": "text",
1603
+ "text": "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 2020. ",
1604
+ "bbox": [
1605
+ 176,
1606
+ 395,
1607
+ 823,
1608
+ 438
1609
+ ],
1610
+ "page_idx": 11
1611
+ },
1612
+ {
1613
+ "type": "text",
1614
+ "text": "Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\\mathrm { ~ Y ~ N ~ g ~ } _ { }$ and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of EMNLP, 2013. ",
1615
+ "bbox": [
1616
+ 174,
1617
+ 446,
1618
+ 821,
1619
+ 489
1620
+ ],
1621
+ "page_idx": 11
1622
+ },
1623
+ {
1624
+ "type": "text",
1625
+ "text": "Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in NLP. In Proceedings of ACL, 2019. ",
1626
+ "bbox": [
1627
+ 173,
1628
+ 498,
1629
+ 823,
1630
+ 527
1631
+ ],
1632
+ "page_idx": 11
1633
+ },
1634
+ {
1635
+ "type": "text",
1636
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of NeurIPS, 2017. ",
1637
+ "bbox": [
1638
+ 174,
1639
+ 536,
1640
+ 823,
1641
+ 578
1642
+ ],
1643
+ "page_idx": 11
1644
+ },
1645
+ {
1646
+ "type": "text",
1647
+ "text": "Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of NAACL, 2018. ",
1648
+ "bbox": [
1649
+ 173,
1650
+ 588,
1651
+ 823,
1652
+ 617
1653
+ ],
1654
+ "page_idx": 11
1655
+ },
1656
+ {
1657
+ "type": "text",
1658
+ "text": "Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick ´ von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Transformers: State-of-the-art natural language processing. In Proceedings of EMNLP: System Demonstrations, 2020. ",
1659
+ "bbox": [
1660
+ 173,
1661
+ 626,
1662
+ 823,
1663
+ 695
1664
+ ],
1665
+ "page_idx": 11
1666
+ },
1667
+ {
1668
+ "type": "text",
1669
+ "text": "Yaoming Zhu, Jiangtao Feng, Chengqi Zhao, Mingxuan Wang, and Lei Li. Serial or parallel? plugable adapter for multilingual machine translation. arXiv preprint arXiv:2104.08154, 2021. ",
1670
+ "bbox": [
1671
+ 173,
1672
+ 704,
1673
+ 821,
1674
+ 733
1675
+ ],
1676
+ "page_idx": 11
1677
+ },
1678
+ {
1679
+ "type": "text",
1680
+ "text": "A EXPERIMENTS ",
1681
+ "text_level": 1,
1682
+ "bbox": [
1683
+ 176,
1684
+ 102,
1685
+ 331,
1686
+ 118
1687
+ ],
1688
+ "page_idx": 12
1689
+ },
1690
+ {
1691
+ "type": "text",
1692
+ "text": "A.1 SETUPS ",
1693
+ "bbox": [
1694
+ 174,
1695
+ 138,
1696
+ 272,
1697
+ 154
1698
+ ],
1699
+ "page_idx": 12
1700
+ },
1701
+ {
1702
+ "type": "table",
1703
+ "img_path": "images/0ba334a0921a08a0c6a1b31b1f0b22359bad748b65df0e005d128bc6735499b0.jpg",
1704
+ "table_caption": [
1705
+ "Table 7: Dataset Statistics of the four tasks. "
1706
+ ],
1707
+ "table_footnote": [],
1708
+ "table_body": "<table><tr><td>Dataset</td><td>#train</td><td>#dev</td><td>#test</td></tr><tr><td>XSum</td><td>204,045</td><td>113,332</td><td>113,334</td></tr><tr><td>WMT16 en-ro</td><td>610,320</td><td>1,999</td><td>1,999</td></tr><tr><td>MNLI</td><td>392,702</td><td>9815</td><td>9832</td></tr><tr><td>SST-2</td><td>67,349</td><td>872</td><td>1,821</td></tr></table>",
1709
+ "bbox": [
1710
+ 328,
1711
+ 207,
1712
+ 665,
1713
+ 292
1714
+ ],
1715
+ "page_idx": 12
1716
+ },
1717
+ {
1718
+ "type": "text",
1719
+ "text": "We implement all the parameter-efficient tuning methods using the huggingface transformers library (Wolf et al., 2020). We use BARTLARGE(Lewis et al., 2020) and mBARTLARGE (Liu et al., 2020b) (mBART-cc25) for the summarization and machine translation tasks respectively, and we use RoBERTaBASE (Liu et al., 2019) for MNLI and SST2. BARTLARGE and mBARTLARGE have the same encoder-decoder architectures. mBARTLARGE is pre-trained on 25 languages. We use their public checkpoints from the transformers library in experiments. For MT and classifications tasks, the max token lengths of training data are set to be 150 and 512 respectively. For XSum, we set the max length of source articles to be 512 and the max length of the target summary to be 128. The detailed dataset statistics is present in Table 7. In our summarization experiments, we only use 1600 examples for validation to save time. ",
1720
+ "bbox": [
1721
+ 174,
1722
+ 310,
1723
+ 825,
1724
+ 450
1725
+ ],
1726
+ "page_idx": 12
1727
+ },
1728
+ {
1729
+ "type": "text",
1730
+ "text": "While we vary the bottleneck dimension within $\\{ 1 , 3 0 , 5 1 2 , 1 0 2 4 \\}$ as mentioned in $\\ S 4 . 1$ , we test bottleneck dimension 1024 only when the modified representation is FFN, because the training of prefix tuning does not fit into 48GB GPU memory when $l = 1 0 2 4$ . While other methods do not have memory issues, we keep the bottleneck dimension of attention modification at most 512 to have a relatively fair comparison with prefix tuning. For LoRA we always tune its scaling hyperparameters $s$ on the dev set. ",
1731
+ "bbox": [
1732
+ 174,
1733
+ 457,
1734
+ 825,
1735
+ 540
1736
+ ],
1737
+ "page_idx": 12
1738
+ },
1739
+ {
1740
+ "type": "text",
1741
+ "text": "A.2 TRAINING AND EVALUATION ",
1742
+ "text_level": 1,
1743
+ "bbox": [
1744
+ 176,
1745
+ 564,
1746
+ 419,
1747
+ 578
1748
+ ],
1749
+ "page_idx": 12
1750
+ },
1751
+ {
1752
+ "type": "text",
1753
+ "text": "We present some training hyperparameters of parameter-efficient tuning methods in Table 8. For all the tasks, we train with the Adam optimizer (Kingma & Ba, 2015), and use a polynomial learning rate scheduler that linearly decays the learning rate throughout training. We set the warm up steps of learning rate to be 0 for both MT and summarization tasks, and for the classification tasks, learning rate is linearly warmed up from 0 for the first $6 \\%$ of the total training steps before decay. For full fine-tuning we set these training hyperparameters following Lewis et al. (2020) (XSum), Liu et al. (2020b) (en-ro), and (Liu et al., 2019) (MNLI and SST2). We also did hyperparameter search in the full fine-tuning case to try to reproduce their results. We set dropout rate to be 0.1 for all the tasks. We use ROUGE-2 and perplexity as the validation metrics for summarization and MT respectively. ",
1754
+ "bbox": [
1755
+ 174,
1756
+ 592,
1757
+ 825,
1758
+ 718
1759
+ ],
1760
+ "page_idx": 12
1761
+ },
1762
+ {
1763
+ "type": "text",
1764
+ "text": "For MT and text summarization, we use beam search for decoding and set the number of beams to be 6 and 5 following previous work (Li & Liang, 2021; Liu et al., 2020b). The min and max generation lengths for summarization and MT are set to be (10, 60) and (1, 200) respectively. ",
1765
+ "bbox": [
1766
+ 174,
1767
+ 724,
1768
+ 825,
1769
+ 767
1770
+ ],
1771
+ "page_idx": 12
1772
+ },
1773
+ {
1774
+ "type": "text",
1775
+ "text": "A.3 OTHER EXPERIMENTAL DETAILS ",
1776
+ "text_level": 1,
1777
+ "bbox": [
1778
+ 178,
1779
+ 790,
1780
+ 446,
1781
+ 804
1782
+ ],
1783
+ "page_idx": 12
1784
+ },
1785
+ {
1786
+ "type": "text",
1787
+ "text": "Prefix Tuning: Following Li & Liang (2021), we reparameterize the prefix vectors by a MLP network which is composed of a small embedding matrix and a large feedforward neural network. This is conducive for learning due to the shared parameters across all layers. ",
1788
+ "bbox": [
1789
+ 174,
1790
+ 818,
1791
+ 823,
1792
+ 861
1793
+ ],
1794
+ "page_idx": 12
1795
+ },
1796
+ {
1797
+ "type": "text",
1798
+ "text": "LoRA: LoRA and adapter employ different parameter initialization methods: LoRA uses a random Kaiming uniform (He et al., 2015) initialization for $W _ { \\mathrm { d o w n } }$ and zero for $W _ { \\mathrm { u p } }$ (LoRA init), while adapters use the same initialization as BERT (Devlin et al., 2019). We found it beneficial to use the same initialization method as LoRA in scaled PA. ",
1799
+ "bbox": [
1800
+ 174,
1801
+ 867,
1802
+ 823,
1803
+ 922
1804
+ ],
1805
+ "page_idx": 12
1806
+ },
1807
+ {
1808
+ "type": "table",
1809
+ "img_path": "images/846d59878d68877f969b500dac028638d0a5b16b4d6e3366752d799d1a1f64ab.jpg",
1810
+ "table_caption": [
1811
+ "Table 8: Training hyperparameters of parameter-efficient tuning methods on the four tasks. lr and ls represents learning rate and label smoothing respectively. "
1812
+ ],
1813
+ "table_footnote": [],
1814
+ "table_body": "<table><tr><td>Tasks</td><td>lr</td><td>batch size</td><td>ls</td><td> max grad norm</td><td> weight decay</td><td> train steps</td></tr><tr><td>XSum</td><td>5e-5</td><td>64 sents</td><td>0.1</td><td>0.1</td><td>0.01</td><td>100K</td></tr><tr><td>enro MT</td><td>5e-5</td><td>16384 tokens</td><td>0.1</td><td>1.0</td><td>0.01</td><td>50K</td></tr><tr><td>MNLI/SST2</td><td>1e-4</td><td>32 sents</td><td>0</td><td>1.0</td><td>0.1</td><td>10 epochs</td></tr></table>",
1815
+ "bbox": [
1816
+ 189,
1817
+ 137,
1818
+ 803,
1819
+ 210
1820
+ ],
1821
+ "page_idx": 13
1822
+ },
1823
+ {
1824
+ "type": "text",
1825
+ "text": "B COMPUTATION OF TUNABLE PARAMETERS ",
1826
+ "text_level": 1,
1827
+ "bbox": [
1828
+ 174,
1829
+ 234,
1830
+ 565,
1831
+ 251
1832
+ ],
1833
+ "page_idx": 13
1834
+ },
1835
+ {
1836
+ "type": "table",
1837
+ "img_path": "images/70a3e92d41bd5b1ec4a272f6b67b0465e4c5daf6117d24371899744c0722df6e.jpg",
1838
+ "table_caption": [
1839
+ "Table 9: Number of attention or FFN sublayers in each layer of the pre-trained models. "
1840
+ ],
1841
+ "table_footnote": [],
1842
+ "table_body": "<table><tr><td>BART/mBARTLARGE RoBERTaBASE</td><td></td></tr><tr><td>Nattn</td><td></td></tr><tr><td>Nfn</td><td>1</td></tr></table>",
1843
+ "bbox": [
1844
+ 179,
1845
+ 321,
1846
+ 436,
1847
+ 371
1848
+ ],
1849
+ "page_idx": 13
1850
+ },
1851
+ {
1852
+ "type": "table",
1853
+ "img_path": "images/c0d3f7292300c639fc8c751c9d455d68c81d02592a786ed0007a1728a0fcb0ca.jpg",
1854
+ "table_caption": [
1855
+ "Table 10: Number of parameters used at each sub-layer for different methods. "
1856
+ ],
1857
+ "table_footnote": [],
1858
+ "table_body": "<table><tr><td></td><td>Nattn</td><td>N</td></tr><tr><td>Prefix Tuning</td><td>2ld</td><td>一</td></tr><tr><td>Adapter variants</td><td>2rd</td><td>2rd</td></tr><tr><td>LoRA</td><td></td><td>2 × 2rd=4rd 2×(rd+4dr)=10rd</td></tr></table>",
1859
+ "bbox": [
1860
+ 462,
1861
+ 308,
1862
+ 810,
1863
+ 372
1864
+ ],
1865
+ "page_idx": 13
1866
+ },
1867
+ {
1868
+ "type": "text",
1869
+ "text": "We compute the number of tunable parameters based on where the tunable module is inserted into and how it is parameterized. The pretrained-models for summarization or MT have an encoderdecoder structure and each has $L$ layers, whereas RoBERTaBASE for classification tasks only has $L$ encoder layers. To simplify the computation of tunable parameters, we compute the sum of parameter used in one encoder layer and one decoder layer as the parameter overhead of one single layer of the pre-trained encoder-decoder model. Each layer has $N _ { \\mathrm { a t t n } }$ sub-layers and $N _ { \\mathrm { { f f n } } }$ sublayers. For the encoder-decoder models, $N _ { \\mathrm { a t t n } } = 3$ : the encoder self-attention, the decoder selfattention and the decoder cross-attention. For the classification tasks, $\\mathtt { R o B E R T a } _ { \\mathtt { B A S E } }$ only has the encoder self-attention, thus $N _ { \\mathrm { a t t n } } ~ = ~ 1$ . We present the number of attention and ffn sub-layers for different pre-trained models in Table 10. For modifications applied at the attention sub-layers, the number of tunable parameters is computed by $| \\Theta | _ { \\mathrm { a t t n } } = \\bar { N } _ { \\mathrm { W } } ^ { \\mathrm { a t t n } } \\times N _ { \\mathrm { a t t n } } \\times L$ , where $N _ { \\mathrm { W } } ^ { \\mathrm { a t t n } }$ denotes the number of parameters $W _ { \\mathrm { d o w n } }$ or $W _ { \\mathrm { u p , } }$ ) used for one attention sub-layer. Similarly, the number of tunable parameters for the FFN sub-layers is computed by $\\vert \\Theta \\vert _ { \\mathrm { f f n } } = N _ { \\mathrm { W } } ^ { \\mathrm { f f n } } \\times N _ { \\mathrm { f f n } } \\times$ $L$ . In Table 10, we show the number of parameters for one sub-layer. As we have explained in $\\ S 4 . 4$ , LoRA approximates the update of each weight matrix with a pair of $W _ { \\mathrm { d o w n } }$ and $W _ { \\mathrm { u p } }$ , thus LoRA typically uses more parameters with the same $r$ as other methods. Finally, the total number of tunable parameters for prefix tuning, adapter variants and LoRA is $| \\Theta | = | \\Theta | _ { \\mathrm { a t t n } } + | \\Theta | _ { \\mathrm { f n } }$ as applicable. Prompt tuning prepends $l$ tunable vectors at the input layer and uses $l \\times d$ number of parameters. Using MBART/BART as an example, we present the number of parameters used by several representative methods throughout our paper in Table 11, where adapter variants include sequential adapter, parallel adapter, scaled adapter and multi-head adapter. ",
1870
+ "bbox": [
1871
+ 173,
1872
+ 381,
1873
+ 826,
1874
+ 674
1875
+ ],
1876
+ "page_idx": 13
1877
+ },
1878
+ {
1879
+ "type": "table",
1880
+ "img_path": "images/bf1f2c4fbf0d03088ae09a67d8175765c5927430618c1e6c84ee752a7ebb01fd.jpg",
1881
+ "table_caption": [
1882
+ "Table 11: Number of tunable parameters of various parameter-efficient tuning methods with BART/MBART models $L = 1 2$ ) as an example. "
1883
+ ],
1884
+ "table_footnote": [],
1885
+ "table_body": "<table><tr><td>Method</td><td>number of parameters</td></tr><tr><td>Prompt Tuning</td><td>lxd</td></tr><tr><td>Prefix Tuning (attn)</td><td>2ld×3×12</td></tr><tr><td>Adapter variants (attn)</td><td>2rd×3×12</td></tr><tr><td>Adapter variants (ffn)</td><td>2rd ×2×12</td></tr><tr><td>LoRA (attn)</td><td>4rd×3×12</td></tr><tr><td>LoRA (ffn)</td><td>10rd ×2×12</td></tr><tr><td>MAM Adapter (our proposed model)</td><td>)2ld×3×12+2rd×2×12</td></tr></table>",
1886
+ "bbox": [
1887
+ 256,
1888
+ 723,
1889
+ 738,
1890
+ 852
1891
+ ],
1892
+ "page_idx": 13
1893
+ },
1894
+ {
1895
+ "type": "text",
1896
+ "text": "C FULL RESULTS ON DIFFERENT BOTTLENECK DIMENSIONS ",
1897
+ "text_level": 1,
1898
+ "bbox": [
1899
+ 171,
1900
+ 878,
1901
+ 696,
1902
+ 895
1903
+ ],
1904
+ "page_idx": 13
1905
+ },
1906
+ {
1907
+ "type": "table",
1908
+ "img_path": "images/48b5db3956ac0e7f5ba107d05714f722771626ac6ba3466e02322f78b7a0070e.jpg",
1909
+ "table_caption": [
1910
+ "Table 12: Performance on the test sets of abstractive summarization (XSum) and WMT EN-RO translation. "
1911
+ ],
1912
+ "table_footnote": [],
1913
+ "table_body": "<table><tr><td>Method</td><td># params (%) XSum (R-1/2/L)</td><td>MTBLEU</td></tr><tr><td colspan=\"3\">Modified Representation: : attention</td></tr><tr><td>Prefix Tuning,r = 200</td><td>3.6 43.40/20.46/35.51 9.2</td><td>35.6</td></tr><tr><td>Prefix Tuning,r = 512</td><td>43.29/20.40/35.37</td><td>35.1</td></tr><tr><td>LoRA,r= 200</td><td>43.09/20.29/35.37</td><td>36.2</td></tr><tr><td>Sequential Adapter,r = 200</td><td>42.01/19.30/34.40</td><td>35.3</td></tr><tr><td>Sequential Adapter,r = 512</td><td>41.05/18.87/33.71</td><td>34.7</td></tr><tr><td>Parallel Adapter,r = 200</td><td>43.58/20.31/35.34</td><td>35.6</td></tr><tr><td>Parallel Adapter,r = 512</td><td>43.99/20.83/35.77</td><td>36.2</td></tr><tr><td colspan=\"3\">Modified Representation: FFN</td></tr><tr><td>LoRA,r = 102</td><td>44.59/21.31/36.25</td><td>36.5</td></tr><tr><td>Sequential Adapter,r = 200</td><td>2.4 43.21/19.98/35.08</td><td>35.6</td></tr><tr><td>Sequential Adapter,r = 512</td><td>6.1 43.72/20.75/35.64</td><td>36.3</td></tr><tr><td>Sequential Adapter,r = 1024</td><td>12.3 43.95/21.00/35.90</td><td>36.7</td></tr><tr><td>Parallel Adapter,r = 200</td><td>2.4 43.93/20.66/35.63</td><td>36.4</td></tr><tr><td>Parallel Adapter,r = 512</td><td>6.1 44.35/20.98/35.98</td><td>37.1</td></tr><tr><td>Parallel Adapter,r = 1024</td><td>12.3 44.53/21.24/36.23</td><td>37.3</td></tr></table>",
1914
+ "bbox": [
1915
+ 243,
1916
+ 405,
1917
+ 754,
1918
+ 641
1919
+ ],
1920
+ "page_idx": 14
1921
+ }
1922
+ ]
parse/dev/0RDcd5Axok/0RDcd5Axok_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/EcGGFkNTxdJ/EcGGFkNTxdJ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Kwm8I7dU-l5/Kwm8I7dU-l5.md ADDED
@@ -0,0 +1,441 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GRAPH-GUIDED NETWORK FOR IRREGULARLY SAMPLED MULTIVARIATE TIME SERIES
2
+
3
+ Xiang Zhang
4
+ Harvard University
5
+ xiang_zhang@hms.harvard.edu
6
+ Marko Zeman
7
+ University of Ljubljana
8
+ marko.zeman@fri.uni-lj.si
9
+
10
+ # Marinka Zitnik
11
+
12
+ Theodoros Tsiligkaridis MIT Lincoln Laboratory ttsili@ll.mit.edu
13
+
14
+ Harvard University marinka@hms.harvard.edu
15
+
16
+ # ABSTRACT
17
+
18
+ In many domains, including healthcare, biology, and climate science, time series are irregularly sampled with varying time intervals between successive readouts and different subsets of variables (sensors) observed at different time points. Here, we introduce RAINDROP, a graph neural network that embeds irregularly sampled and multivariate time series while also learning the dynamics of sensors purely from observational data. RAINDROP represents every sample as a separate sensor graph and models time-varying dependencies between sensors with a novel message passing operator. It estimates the latent sensor graph structure and leverages the structure together with nearby observations to predict misaligned readouts. This model can be interpreted as a graph neural network that sends messages over graphs that are optimized for capturing time-varying dependencies among sensors. We use RAINDROP to classify time series and interpret temporal dynamics on three healthcare and human activity datasets. RAINDROP outperforms state-of-the-art methods by up to $1 1 . 4 \%$ (absolute F1-score points), including techniques that deal with irregular sampling using fixed discretization and set functions. RAINDROP shows superiority in diverse setups, including challenging leave-sensor-out settings.
19
+
20
+ # 1 INTRODUCTION
21
+
22
+ Multivariate time series are prevalent in a variety of domains, including healthcare, space science, cyber security, biology, and finance (Ravuri et al., 2021; Sousa et al., 2020; Sezer et al., 2020; Fawaz et al., 2019). Practical issues often exist in collecting sensor measurements that lead to various types of irregularities caused by missing observations, such as saving costs, sensor failures, external forces in physical systems, medical interventions, to name a few (Choi et al., 2020). While temporal machine learning models typically assume fully observed and fixed-size inputs, irregularly sampled time series raise considerable challenges (Shukla & Marlin, 2021; Hu et al., 2021). For example, observations of different sensors might not be aligned, time intervals among adjacent observations are different across sensors, and different samples have different numbers of observations for different subsets of sensors recorded at different time points (Horn et al., 2020; Wang et al., 2011).
23
+
24
+ Prior methods for dealing with irregularly sampled time series involve filling in missing values using interpolation, kernel methods, and probabilistic approaches (Schafer & Graham, 2002). However, the absence of observations can be informative on its own (Little & Rubin, 2014) and thus imputing missing observations is not necessarily beneficial (Agniel et al., 2018). While modern techniques involve recurrent neural network architectures (e.g., RNN, LSTM, GRU) (Cho et al., 2014) and transformers (Vaswani et al., 2017), they are restricted to regular sampling or assume aligned measurements across modalities. For misaligned measurements, existing methods tend to rely on a two-stage approach that first imputes missing values to produce a regularly-sampled dataset and then optimizes a model of choice for downstream performance. This decoupled approach does not fully exploit informative missingness patterns or deal with irregular sampling, thus producing suboptimal performance (Wells et al., 2013; Li & Marlin, 2016). Thus, recent methods circumvent the imputation stage and directly model irregularly sampled time series (Che et al., 2018; Horn et al., 2020).
25
+
26
+ Previous studies (Wu et al., 2021; Li et al., 2020a; Zhang et al., 2019) have noted that inter-sensor correlations bring rich information in modeling time series. However, only few studies consider relational structure of irregularly sampled time series, and those which do have limited ability in capturing inter-sensor connections (Wu et al., 2021; Shukla & Marlin, 2018). In contrast, we integrate recent advances in graph neural networks to take advantage of relational structure among sensors. We learn latent graphs from multivariate time series and model time-varying inter-sensor dependencies through neural message passing, establishing graph neural networks as a way to model sample-varying and time-varying structure in complex time series.
27
+
28
+ Present work. To address the characteristics of irregularly sampled time series, we propose to model temporal dynamics of sensor dependencies and how those relationships evolve over time. Our intuitive assumption is that the observed sensors can indicate how the unobserved sensors currently behave, which can further improve the representation learning of irregular multivariate time series. We develop RAINDROP1, a graph neural network that leverages relational structure to embed and classify irregularly sampled multivariate time series. RAINDROP takes samples as input, each sample containing multiple sensors and each sensor consisting of irregularly recorded observations (e.g., in clinical data, an individual patient’s state of health is recorded at irregular time intervals with different subsets of sensors observed at different times). RAINDROP model is inspired by how raindrops hit a surface at varying times and create ripple effects that propagate through the surface. Mathematically, in RAINDROP, observations (i.e., raindrops) hit a sensor graph (i.e., surface) asynchronously and at irregular time intervals. Every observation is processed by passing messages to neighboring sensors (i.e., creating ripples), taking into account the learned sensor dependencies (Figure 1). As such, RAINDROP can handle misaligned observations, varying time gaps, arbitrary numbers of observations, and produce multi-scale embeddings via a novel hierarchical attention.
29
+
30
+ ![](images/65ae7002640b9f8a2920a60a94856e3da175b04ae431d66826e61e5e7b92f047.jpg)
31
+ Figure 1: The RAINDROP approach. For sample $\boldsymbol { S } _ { i }$ , sensor $u$ is recorded at time $t _ { 1 }$ as value $\boldsymbol { x } _ { i , u } ^ { t _ { 1 } }$ , triggering a propagation and transformation of neural messages along edges of $\boldsymbol { S } _ { i }$ ’s sensor dependency graph.
32
+
33
+ We represent dependencies with a separate sensor graph for every sample wherein nodes indicate sensors and edges denote relationships between them. Sensor graphs are latent in the sense that graph connectivity is learned by RAINDROP purely from observational time series. In addition to capturing sensor dependencies within each sample, RAINDROP i) takes advantage of similarities between different samples by sharing parameters when calculating attention weights, and ii) considers importance of sequential sensor observations via temporal attention.
34
+
35
+ RAINDROP adaptively estimates observations based on both neighboring readouts in the temporal domain and similar sensors as determined by the connectivity of optimized sensor graphs. We compare RAINDROP to five state-of-the-art methods on two healthcare datasets and an activity recognition dataset across three experimental settings, including a setup where a subset of sensors in the test set is malfunctioning (i.e., have no readouts at all). Experiments show that RAINDROP outperforms baselines on all datasets with an average AUROC improvement of $3 . 5 \%$ in absolute points on various classification tasks. Further, RAINDROP improves prior work by a $9 . 3 \%$ margin (absolute points in accuracy) when varying subsets of sensors malfunction.
36
+
37
+ # 2 RELATED WORK
38
+
39
+ Our work here builds on time-series representation learning and notions of graph neural networks and attempts to resolve them by developing a single, unified approach for analysis of complex time series.
40
+
41
+ Learning with irregularly sampled multivariate time series. Irregular time series are characterized by varying time intervals between adjacent observations (Zerveas et al., 2021; Tipirneni &
42
+
43
+ Reddy, 2021; Chen et al., 2020). In a multivariate case, irregularity means that observations can be misaligned across different sensors, which can further complicate the analysis. Further, because of a multitude of sampling frequencies and varying time intervals, the number of observations can also vary considerably across samples (Fang & Wang, 2020; Kidger et al., 2020). Predominant downstream tasks for time series are classification (i.e., predicting a label for a given sample, e.g., Tan et al. (2020); Ma et al. (2020)) and forecasting (i.e., anticipating future observations based on historical observations, e.g., Wu et al. (2020a)). The above mentioned characteristics create considerable challenges for models that expect well-aligned and fixed-size inputs (Shukla & Marlin, 2020). An intuitive way to deal with irregular time series is to impute missing values and process them as regular time series (Mikalsen et al., 2021; Li & Marlin, 2020; Shan & Oliva, 2021). However, imputation methods can distort the underlying distribution and lead to unwanted distribution shifts. To this end, recent methods directly learn from irregularly sampled time series (Chen et al., 2018). For example, Che et al. (2018) develop a decay mechanism based on gated recurrent units (GRU-D) and binary masking to capture long-range temporal dependencies. SeFT (Horn et al., 2020) takes a set-based approach and transforms irregularly sampled time series datasets into sets of observations modeled by set functions insensitive to misalignment. mTAND (Shukla & Marlin, 2021) leverages a multi-time attention mechanism to learn temporal similarity from non-uniformly collected measurements and produce continuous-time embeddings. IP-Net (Shukla & Marlin, 2018) and $D G M ^ { 2 }$ (Wu et al., 2021) adopt imputation to interpolate irregular time series against a set of reference points using a kernel-based approach. The learned inter-sensor relations are static ignoring sample-specific and time-specific characteristics. In contrast with the above methods, RAINDROP leverages dynamic graphs to address the characteristics of irregular time series and produce high-quality representations.
44
+
45
+ Learning with graphs and neural message passing. There has been a surge of interest in applying neural networks to graphs, leading to the development of graph embeddings (Zhou et al., 2020; Li et al., 2021), graph neural networks (Wu et al., 2020b), and message passing neural networks (Gilmer et al., 2017). To address the challenges of irregular time series, RAINDROP specifies a message passing strategy to exchange neural message along edges of sensor graphs and deal with misaligned sensor readouts (Riba et al., 2018; Nikolentzos et al., 2020; Galkin et al., 2020; Fey et al., 2020; Lin et al., 2018; Zhang et al., 2020). In particular, RAINDROP considers message passing on latent sensor graphs, each graph describing a different sample (e.g., patient, Figure 1), and it specifies a message-passing network with learnable adjacency matrices. The key difference with the predominant use of message passing is that RAINDROP uses it to estimate edges (dependencies) between sensors rather than applying it on a fixed, apriori-given graph. To the best of our knowledge, prior work did not utilize sensor dependencies for irregularly sampled time series. While prior work used message passing for regular time series (Wang et al., 2020; Wu et al., 2020c; Kalinicheva et al., 2020; Zha et al., 2022), its utility for irregularly sampled time series has not yet been studied.
46
+
47
+ # 3 RAINDROP
48
+
49
+ Let $\mathcal { D } = \{ ( S _ { i } , y _ { i } ) \ | \ i = 1 , \ldots , N \}$ denote an irregular time series dataset with $N$ labeled samples (Figure 2). Every sample $\boldsymbol { S } _ { i }$ is an irregular multivariate time series with a corresponding label $y _ { i } \in \{ 1 , \ldots , C \}$ , indicating which of the $C$ classes $s _ { i }$ is associated with. Each sample contains $M$ non-uniformly measured sensors that are denoted as $u , v$ , etc. RAINDROP can also work on samples with only a subset of active sensors (see Sec. 4.1). Each sensor is given by a sequence of observations ordered by time. For sensor $u$ in sample $s _ { i }$ , we denote a single observation as a tuple $( t , x _ { i , u } ^ { t } )$ , meaning that sensor $u$ was recorded with value $x _ { i , u } ^ { t } \in \mathbb { R }$ at timestamp $t \in \mathbb { R } ^ { + }$ . We omit sample index $i$ and sensor index $u$ in timestamp $t$ . Sensor observations are irregularly recorded, meaning that time intervals between successive observations can vary across sensors. For sensor $u$ in sample $s _ { i }$ , we use $\mathcal { T } _ { i , u }$ to denote the set of timestamps that $u$ , or at least one of $u$ ’s $L$ -hop neighbors ( $L$ is the number of layers in RAINDROP’s message passing) is recorded. We use $| |$ and $_ T$ to denote concatenation and transpose, respectively. We omit layer index $l \in \{ 1 , \ldots , L \}$ for simplicity when clear from the text.
50
+
51
+ Problem (Representation learning for irregularly sampled multivariate time series). A dataset $\mathcal { D }$ of irregularly sampled multivariate time series is given, where each sample $s _ { i }$ has multiple sensors and each sensor has a variable number of observations. RAINDROP learns a function $f : S _ { i } \to z _ { i }$ that maps $s _ { i }$ to a fixed-length representation $z _ { i }$ suitable for downstream task of interest, such as classification. Using learned $z _ { i }$ , RAINDROP can predict label $\hat { y } _ { i } \in \{ 1 , \ldots , C \}$ for $S _ { i }$ .
52
+
53
+ RAINDROP learns informative embeddings for irregularly samples time series. The learned embeddings capture temporal patterns of irregular observations and explicitly consider varying dependencies between sensors. While we focus on time-series classification in this work, the proposed method can be easily extended to broader applications such as regression, clustering and generation tasks.
54
+
55
+ # 3.1 OVERVIEW OF RAINDROP
56
+
57
+ RAINDROP aims to learn a fixed-dimensional embedding $z _ { i }$ for a given sample $S _ { i }$ and predict the associated label $\hat { y } _ { i }$ . To this end, it generates sample embeddings using a hierarchical architecture composed of three levels to model observations (sensor readouts), sensors, and whole samples (Figure 2). Without loss of generality, we describe RAINDROP’s procedure as if observations arrive one at a time (one sensor is observed at time $t$ and other sensors do not have observations). If there are multiple observations at the same time, RAINDROP can effortlessly process them in parallel.
58
+
59
+ RAINDROP first constructs a graph for every sample where nodes represent sensors and edges indicate relations between sensors (Sec. 3.2). We use $\mathcal { G } _ { i }$ to denote the sensor graph for sample $\boldsymbol { S } _ { i }$ and $e _ { i , u v }$ to represent the weight of a directed edge from sensor $u$ to sensor $v$ in $\mathcal { G } _ { i }$ . Sensor graphs are automatically optimized considering sample-wise and time-wise specificity.
60
+
61
+ The key idea of RAINDROP is to borrow information from $u$ ’s neighbors based on estimated relationships between $u$ and other sensors. This is achieved via message passing carried out on $s _ { i }$ ’s dependency graph and initiated at node $u$ in the graph. When an observation $( t , x _ { i , u } ^ { t } )$ is recorded for sample $s _ { i }$ at time $t$ , RAINDROP first embeds the observation at active sensor $u$ (i.e., sensor whose value was recorded) and then propagates messages (i.e., the observation embeddings) from $u$ to neighboring sensors along edges in sensor dependency graph $\mathcal { G } _ { i }$ . As a result, recording the value of $u$ can affect $u$ ’s embedding as well as embeddings of other sensors that related to $u$ (Sec. 3.3). Finally, RAINDROP generates sensor embeddings by aggregating all observation embeddings for each sensor (across all timestamps) using temporal attention weights (Sec. 3.4). At last, RAINDROP embeds sample $S _ { i }$ based on sensor embeddings (Sec. 3.5) and feeds the sample embedding into a downstream predictor.
62
+
63
+ ![](images/56d4b90d153d62d37f265be881e861653abd60d00d48c21843da4884c31ce7ba.jpg)
64
+ Figure 2: Hierarchical structure of irregular multivariate time series dataset. RAINDROP embeds individual observations considering inter-sensor dependencies (Sec. 3.3), aggregates them into a sensor embedding using temporal attention (Sec. 3.4), and finally integrates sensor embeddings into a sample embedding (Sec. 3.5).
65
+
66
+ # 3.2 CONSTRUCTING SENSOR DEPENDENCY GRAPHS
67
+
68
+ We build a directed weighted graph $\mathcal { G } _ { i } = \{ \boldsymbol { \nu } , \mathcal { E } _ { i } \}$ for every sample $s _ { i }$ and refer to it as the sensor dependency graph for $S _ { i }$ . Nodes $\nu$ represent sensors and edges $\mathcal { E } _ { i }$ describe dependencies between sensors in sample $s _ { i }$ that RAINDROP infers. As we show in experiments, RAINDROP can be directly used with samples that only contain a subset of sensors in $\nu$ . We denote edge from $u$ to $v$ as a triplet $( u , e _ { i , u v } , v )$ , where $e _ { i , u v } \in [ 0 , 1 ]$ represents the strength of relationship between sensors $u$ and $v$ in sample $s _ { i }$ . Edge $( u , e _ { i , u v } , v )$ describes the relationship between $u$ and $v$ : when $u$ receives an observation, it will send a neural message to $v$ following edge $e _ { i , u v }$ . If $e _ { i , u v } = 0$ , there is no exchange of neural information between $u$ and $v$ , indicating that the two sensors are unrelated. We assume that the importance of $u$ to $v$ is different than the importance of $v$ to $u$ , and so we treat sensor dependency graphs as directed, i.e., $e _ { i , u v } \neq e _ { i , v u }$ . All graphs are initialized as fully-connected graphs (i.e., $e _ { i , u v } = 1$ for any $u , v$ and $s _ { i }$ ) and edge weights $e _ { i , u v }$ are updated following Eq. 3 during model training. If available, it is easy to integrate additional domain knowledge into graph initialization.
69
+
70
+ # 3.3 GENERATING EMBEDDINGS OF INDIVIDUAL OBSERVATIONS
71
+
72
+ Let $u$ indicate active sensor at time $t \in \mathcal { T } _ { i , u }$ , i.e., sensor whose value $x _ { i , u } ^ { t }$ is observed at $t$ , and let $u$ be connected to $v$ through edge $( u , e _ { i , u v } , v )$ . We next describe how to produce observation embeddings $h _ { i , u } ^ { t } \in \mathbb { R } ^ { d _ { h } }$ and $h _ { i , v } ^ { t } \in \mathbb { R } ^ { d _ { h } }$ for sensors $u$ and $v$ , respectively (Figure 3a). We omit layer index $l$ and note that the proposed strategy applies to any number of layers.
73
+
74
+ ![](images/12eb70529d7fbe2e13a09e234141c56087a8f82c55d5d8d7e61dc32e2b3ba35a.jpg)
75
+ Figure 3: (a) RAINDROP generates observation embedding $\boldsymbol { h } _ { i , u } ^ { t }$ based on observed value $x _ { i , u } ^ { t }$ at $t$ , passes message to neighbor sensors such as $v$ , and generates $h _ { i , v } ^ { t }$ through inter-sensor dependencies. The $\alpha _ { i , u v } ^ { t }$ denotes a time-specific attention weight, calculated based on time representation $\mathbf { \Delta } _ { p _ { i } ^ { t } } ^ { \mathbf { \Delta } _ { t } ^ { t } }$ and weight vector $\mathbf { \nabla } _ { \mathbf { \boldsymbol { r } } _ { v } }$ . Edge weight $e _ { i , u v }$ is shared by all timestamps. (b) An illustration of generating sensor embedding. Apply the message passing in (a) to all timestamps and produce corresponding observation embeddings. We aggregate arbitrary number of observation embeddings into a fixed-length sensor embedding $z _ { i , v }$ while paying distinctive attentions to different observatupdates edge weight $e _ { i , u v } ^ { ( l ) }$ We independently apply tbased on the edge weight $e _ { i , u v } ^ { ( l - 1 ) }$ cessin from procedure to all sensors. (c) RAINDROPprevious layer and the learned inter-sensor attention weights in all time steps. We explicitly show layer index $l$
76
+
77
+ Embedding an observation of an active sensor. Let $u$ denote an active sensor whose value has just been observed as $x _ { i , u } ^ { t }$ . For sufficient expressive power (Velickovi ˇ c et al. ´ , 2018), we map observation $x _ { i , u } ^ { t }$ to a high-dimensional space using a nonlinear transformation: $\pmb { h } _ { i , u } ^ { t } = \sigma ( x _ { i , u } ^ { t } \pmb { R } _ { u } )$ . We use sensorspecific transformations because values recorded at different sensors can follow different distributions, which is achieved by trainable weight vectors $\scriptstyle { \boldsymbol { R _ { u } } }$ depending on what sensor is activated (Li et al., 2020b). Alternatives, such as a multilayer perceptron, can be considered to transform $x _ { i , u } ^ { t }$ into $h _ { i , u } ^ { t }$ . As $h _ { i , u } ^ { t }$ represents information brought on by observing $x _ { i , u } ^ { t }$ , we regard $h _ { i , u } ^ { t }$ as the embedding of $u$ ’s observation at $t$ . Sensor-specific weight vectors $\scriptstyle { \boldsymbol { R _ { u } } }$ are shared across samples.
78
+
79
+ Passing messages along sensor dependency graphs. For sensors that are not active at timestamp $t$ but are neighbors of the active sensor $u$ in the sensor dependency graph $\mathcal { G } _ { i }$ , RAINDROP uses relationships between $u$ and those sensors to estimate observation embeddings for them. We proceed by describing how RAINDROP generates observation embedding $h _ { i , v } ^ { t }$ for sensor $v$ assuming $v$ is a neighbor of $u$ in $\mathcal { G } _ { i }$ . Given $h _ { i , u } ^ { t }$ and edge $( u , e _ { i , u v } , v )$ , we first calculate inter-sensor attention weight $\alpha _ { i , u v } ^ { t } \in [ 0 , 1 ]$ , representing how important $u$ is to $v$ via the following equation:
80
+
81
+ $$
82
+ \begin{array} { r } { \alpha _ { i , u v } ^ { t } = \sigma ( \boldsymbol { h } _ { i , u } ^ { t } { D [ \boldsymbol { r } _ { v } | | \boldsymbol { p } _ { i } ^ { t } ] ^ { T } } ) , } \end{array}
83
+ $$
84
+
85
+ where $\pmb { r } _ { v } \in \mathbb { R } ^ { d _ { r } }$ is a trainable weight vector that is specific to the sensor receiving the message $( i . e . , h _ { i , u } ^ { t } )$ . Vector $\mathbf { \Delta } _ { \mathbf { \boldsymbol { r } } _ { v } }$ allows the model to learn distinct attention weights for different edges going out from the same sensor $u$ . Further, $\pmb { p } _ { i } ^ { t } \in \mathbb { R } ^ { d _ { t } }$ is the time representation obtained by converting a 1-dimensional timestamp $t$ into a multi-dimensional vector $\mathbf { \Delta } _ { p _ { i } ^ { t } } ^ { t }$ by passing $t$ through a series of trigonometric functions (Horn et al., 2020). See Appendix A.1 for details. RAINDROP uses $\mathbf { \Delta } _ { p _ { i } ^ { t } } ^ { t }$ to calculate attention weights that are sensitive to time. Finally, $_ { D }$ is a trainable weight matrix mapping $h _ { i , u } ^ { t }$ from $d _ { h }$ dimensions to $\left( d _ { r } + d _ { t } \right)$ dimensions. Taken this together, we can estimate the embedding $h _ { i , v } ^ { t }$ for $u$ ’s neighbor $v$ as follows:
86
+
87
+ $$
88
+ \begin{array} { r } { \pmb { h } _ { i , v } ^ { t } = \sigma ( \pmb { h } _ { i , u } ^ { t } \pmb { w } _ { u } \pmb { w } _ { v } ^ { T } \alpha _ { i , u v } ^ { t } \boldsymbol { e } _ { i , u v } ) , } \end{array}
89
+ $$
90
+
91
+ where $\boldsymbol { w } _ { u } , \boldsymbol { w } _ { v } \in \mathbb { R } ^ { d _ { h } }$ are trainable weight vectors shared across all samples. The ${ \pmb w } _ { \pmb u }$ is specific to active sensor $u$ and ${ \pmb w } _ { v }$ is specific to neighboring sensor $v$ . In the above equation, $e _ { i , u v }$ denotes edge weight shared across all timestamps. The above message passing describes the processing of a single observation at a single timestamp. In case multiple sensors are active at time $t$ and connected with $v$ we normalize $\alpha _ { i , u v } ^ { t }$ (with softmax function) across active sensors and aggregate messages at $v$ .
92
+
93
+ Overall, RAINDROP produces observation embedding $h _ { i , v } ^ { t }$ for sensor $v$ through its relational connection with $u$ , even though there is no direct measurement of $v$ at time $t$ . These message passing operations are performed to adaptively and dynamically estimate missing observations in the embedding space based on recorded information and learned graph structure.
94
+
95
+ Updating sensor dependency graphs. We describe the update of edge weights and prune of graph structures in the situation that stacks multiple RAINDROP layers (Figure 3). Here we explicitly show layer index $l$ because multiple layers are involved in the computation. As no prior knowledge is assumed, we initialize the graph as all sensors connected with each other. However, the fully connected edges may bridge sensors that should be independent, which will introduce spurious correlations and prevent the model from paying attention to the truly important connections. Addressing this issue, RAINDROP automatically updates edge weights and prunes out less important edges. Based on the aggregated temporal influence driven by the inter-sensor attention weights $\alpha _ { i , u v } ^ { ( l ) , t }$ , we update edge weights e(l)i,uv in each layer $l \in \{ 1 , \ldots , L \}$ by:
96
+
97
+ $$
98
+ e _ { i , u v } ^ { ( l ) } = \frac { e _ { i , u v } ^ { ( l - 1 ) } } { \lvert \mathcal { T } _ { i , u } \rvert } \sum _ { t \in \mathcal { T } _ { i , u } } \alpha _ { i , u v } ^ { ( l ) , t } ,
99
+ $$
100
+
101
+ where $\mathcal { T } _ { i , u }$ denotes the set of all timestamps where there is message passes from $u$ to $v$ . In particular, we set e(0)i,uv $e _ { i , u v } ^ { ( 0 ) } = 1$ in the initialization of graph structures. We use $L = 2$ in all our experiments. In every layer, we order the estimated values $e _ { i , u v } ^ { ( l ) }$ for all edges in sample $s _ { i }$ and prune bottom $K \%$ edges with smallest edge weights (Yang et al., 2021). Pruned edges are not re-added in later layers.
102
+
103
+ # 3.4 GENERATING SENSOR EMBEDDINGS
104
+
105
+ Next we describe how to aggregate observation embeddings into sensor embeddings $z _ { i , v }$ , taking sensor $v$ as an example (Figure 3b). Previous step (Sec. 3.3) generates observation embeddings for every timestamp when either $v$ or $v$ ’s neighbor is observed. The observation embeddings at different timestamps have unequal importance to the the sensor embedding (Zerveas et al., 2021). We use the temporal attention weight (scalar) $\beta _ { i , v } ^ { t }$ to represent the importance of observation embedding at $t$ . We use $\mathcal { T } _ { i , v } = \{ t _ { 1 } , t _ { 2 } , \ldots , t _ { T } \}$ to denote all the timestamps when a readout is observed in $v$ (we can directly generate $h _ { i , v } ^ { t } )$ ) or in $v$ ’s neighbor (we can generate $h _ { i , v } ^ { t }$ through message passing). The $\beta _ { i , v } ^ { t }$ is the corresponding element of vector $\beta _ { i , v }$ which include the temporal attention weights at all timestamps $t \in \mathcal { T } _ { i , v }$ .
106
+
107
+ We use temporal self-attention to calculate $\beta _ { i , v }$ , which is different from the standard self-attention (Hu et al., 2020; Yun et al., 2019). The standard dot-product self-attention generates an attention matrix with dimension of $T \times T$ (where $T = | \mathcal { T } _ { i , v } |$ can vary across samples) that has an attention weight for each pair of observation embeddings. In our case, we only need a single attention vector where each element denotes the temporal attention weight of an observation embedding when generating the sensor embedding. Thus, we modify the typical self-attention model to fit our case: using a trainable $\pmb { s } \in \mathbb { R } ^ { T \times 1 }$ to map the self-attention matrix $( \mathbb { R } ^ { T \times T } )$ to $T$ -dimensional vector $\beta _ { i , v }$ $( \mathbb { R } ^ { T \times 1 } )$ through matrix product (Appendix A.2).
108
+
109
+ The following steps describe how to generate sensor embeddings. We first concatenate observation embedding $\bar { h _ { i , v } ^ { t } }$ with time representation $\mathbf { \Delta } _ { p _ { i } ^ { t } } ^ { t }$ to include information of timestamp. Then, we stack the concatenated embeddings $[ h _ { i , v } ^ { t } | | p _ { i } ^ { t } ]$ for all $t \in \mathcal { T } _ { i , v }$ into a matrix $H _ { i , v }$ . The $H _ { i , v }$ contains all information of observations and timestamps for sensor $v$ . We calculate $\beta _ { i , v } ^ { t }$ through:
110
+
111
+ $$
112
+ \beta _ { i , v } = \mathrm { s o f t m a x } \left( \frac { Q _ { i , v } K _ { i , v } ^ { T } } { \sqrt { d _ { k } } } \pmb { s } \right) ,
113
+ $$
114
+
115
+ where $Q _ { i , v }$ and $K _ { i , v }$ are two intermediate matrices that are derived from the stacked observation embeddings. In practice, $Q _ { i , v } = H _ { i , v } W _ { Q }$ and ${ \pmb { K } } _ { i , v } = { \pmb { H } } _ { i , v } { \pmb { W } } _ { K }$ are linearly mapped from $H _ { i , v }$
116
+
117
+ parameterized by $W _ { Q }$ and $W _ { K }$ , respectively (Vaswani et al., 2017). The $\sqrt { d _ { k } }$ is a scaling factor where $d _ { k }$ is the dimension after linear mapping. Based on the learned temporal attention weights $\beta _ { i , v } ^ { t }$ , we calculate sensor embedding $z _ { i , v }$ through:
118
+
119
+ $$
120
+ z _ { i , v } = \sum _ { t \in \mathcal { T } _ { i , v } } ( \beta _ { i , v } ^ { t } [ \pmb { h } _ { i , v } ^ { t } | | \pmb { p } _ { i } ^ { t } ] \pmb { W } ) ,
121
+ $$
122
+
123
+ where weight matrix $W$ is a linear projector shared by all sensors and samples. It is worth to mention that all attention weights (such as $\bar { \alpha } _ { i , u v } ^ { t }$ and $\beta _ { i , v . }$ ) can be multi-head. In this work, we describe the model in the context of single head for brevity.
124
+
125
+ Using attentional aggregation, RAINDROP can learn a fixed-length sensor embedding for arbitrary number of observations. Meanwhile, RAINDROP is capable of focusing on the most informative observation embeddings. We process all observation embeddings as a whole instead of sequentially, which allows parallel computation for faster training and also mitigates the performance drop caused by modeling long dependencies sequentially. In the case of sensors with very large number of observations, we can reduce the length of time series by subsampling or splitting a long series into multiple short series.
126
+
127
+ # 3.5 GENERATING SAMPLE EMBEDDINGS
128
+
129
+ Finally, for sample $s _ { i }$ , we aggregate sensor embeddings $z _ { i , v }$ (Eq. 5) across all sensors to obtain an embedding $z _ { i } \in \mathbb { R } ^ { d _ { z } }$ through a readout function $g$ as follows: $z _ { i } = g ( z _ { i , v } \mid v = 1 , 2 , . . . , M )$ (such as concatenation). When a sample contains a large number of sensors, RAINDROP can seamlessly use a set-based readout function such as averaging aggregation (Appendix A.3). Given an input sample $s _ { i }$ , RAINDROP’s strategy outlined in Sec. 3.2-3.5 produces a sample embedding $z _ { i }$ that can be further optimized for downstream tasks.
130
+
131
+ # 3.6 IMPLEMENTATION AND PRACTICAL CONSIDERATIONS
132
+
133
+ Loss function. RAINDROP’s loss function is formulated as: $\mathcal { L } = \mathcal { L } _ { \mathrm { C E } } + \lambda \mathcal { L } _ { r }$ , where $\begin{array} { l l } { { \mathcal { L } } _ { r } } & { = } \end{array}$ $\begin{array} { r } { \frac { 1 } { M ^ { 2 } } \sum _ { u , v \in \mathcal { V } } \sum _ { i , j \in \mathcal { V } } | | e _ { i , u v } - e _ { j , u v } | | _ { 2 } / ( N - 1 ) ^ { 2 } } \end{array}$ , where $\mathcal { L } _ { \mathrm { C E } }$ is cross entropy and $\mathcal { L } _ { r }$ is a regularizer to encourage the model to learn similar sensor dependency graphs for similar samples. The $\mathcal { L } _ { r }$ measures averaged Euclidean distance between edge weights across all samples pairs, in all sensor pairs (including self-connections). The $\lambda$ is a user-defined coefficient. Practically, as $N$ can be large, we calculate $\mathcal { L } _ { r }$ only for samples in a batch.
134
+
135
+ Downstream tasks. If a sample has auxiliary attributes (e.g., a patient’s demographics) that do not change over time, we can project the attribute vector to a $d _ { a }$ -dimensional vector $\mathbf { a } _ { i }$ with a fullyconnected layer and concatenate it with the sample embedding, getting $[ z _ { i } | | a _ { i } ]$ . At last, we feed $[ z _ { i } | | a _ { i } ]$ (or only $z _ { i }$ if $\mathbf { a } _ { i }$ is not available) into a neural classifier $\varphi : \mathbb { R } ^ { d _ { z } + d _ { a } } \{ 1 , \ldots , C \}$ . In our experiments, $\varphi$ is a 2-layer fully-connected network with $C$ neurons at the output layer returning prediction $\hat { y } _ { i } \stackrel { \cdot } { = } \varphi ( [ \pmb { z } _ { i } | | \dot { \pmb { a } _ { i } } ] )$ for sample $\boldsymbol { S } _ { i }$ .
136
+
137
+ Sensor dependencies. While modeling sensor dependencies, we involve observation embedding $( h _ { i , u } ^ { t }$ , Eq. 1) of each sample in the calculation of attention weights. Similarly, to model time-wise specificity in graph structures, we consider time information $( \pmb { p } _ { i } ^ { t }$ , Eq. 1) when measuring $\alpha _ { i , u v } ^ { t }$ RAINDROP can capture similar graph structures across samples from three aspects (Appendix A.4): (1) the initial graphs are the same in all samples; (2) the parameters in message passing $\mathbf { \mathcal { R } } _ { u }$ ; ${ \pmb w } _ { \pmb u }$ $\pmb { w } _ { v }$ , Eq. 2), inter-sensor attention weights calculation ( $_ { x }$ , Eq. 1), and temporal attention weights calculation (s, Eq. 4; $W$ , Eq. 5) are shared by all samples; (3) we encourage the model to learn similar graph structures by adding a penalty to disparity of structures $( \mathcal { L } _ { r } )$ .
138
+
139
+ Scalability. RAINDROP is efficient because embeddings can be learned in parallel. In particular, processing of observation embeddings is independent across timestamps. Similarly, sensor embeddings can be processed independently across different sensors (Figure 3). While the complexity of temporal self-attention calculation grows quadratically with the number of observations, it can be practically implemented using highly-optimized matrix multiplication.
140
+
141
+ # 4 EXPERIMENTS
142
+
143
+ Datasets. Below we briefly overview healthcare and human activity datasets. (1) P19 (Reyna et al., 2020) includes 38,803 patients that are monitored by 34 sensors. Each patient is associated with a binary label representing the occurrence of sepsis. (2) P12 (Goldberger et al., 2000) records temporal measurements of 36 sensors of 11,988 patients in the first 48-hour stay in ICU. The samples are labeled based on hospitalization length. (3) PAM (Reiss & Stricker, 2012) contains 5,333 segments from 8 activities of daily living that are measured by 17 sensors. Details are in Appendix A.5.
144
+
145
+ Baselines. We compare RAINDROP with five state-of-the-art baselines: Transformer (Vaswani et al., 2017), Trans-mean, GRU-D (Che et al., 2018), SeFT (Horn et al., 2020), and mTAND (Shukla & Marlin, 2021). The Trans-mean is an imputation method combining transformer architecture with commonly used average interpolation (i.e., missing values are replaced by average observations in each sensor). The mTAND (Shukla & Marlin, 2021) method has been shown to outperform numerous recurrent models including RNN-Impute (Che et al., 2018), RNN-Simple, and Phased-LSTM (Neil et al., 2016), along with ordinary differential equations (ODE)-based models such as LATENT-ODE and ODE-RNN (Chen et al., 2018). For this reason, we compare with mTAND and do not report comparison with those techniques in this paper. Even though, to better show the superiority of RAINDROP, we provide extensive comparison with popular approaches, such as $\mathrm { D G M ^ { 2 } }$ -O (Wu et al., 2021) and MTGNN (Wu et al., 2020c), that are designed for forecasting tasks. Further details are in Table 1 and Appendix A.11. Details on hyperparameter selection and baselines are in Appendix A.6, and evaluation metrics are presented in Appendix A.7.
146
+
147
+ # 4.1 RESULTS ACROSS DIVERSE EVALUATION SETTINGS
148
+
149
+ Setting 1: Classic time series classification. Setup. We randomly split the dataset into training $( 8 0 \% )$ , validation $( 1 0 \% )$ , and test $( 1 0 \% )$ set. The indices of these splits are fixed across all methods. Results. As shown in Table 1, RAINDROP obtains the best performance across three benchmark datasets, suggesting its strong performance for time series classification. In particular, in binary classification (P19 and P12), RAINDROP outperforms the strongest baselines by $5 . 3 \%$ in AUROC and $4 . 8 \%$ in AUPRC on average. In a more challenging 8-way classification on the PAM dataset, RAINDROP outperforms existing approaches by $5 . 7 \%$ in accuracy and $5 . 5 \%$ in F1 score. Further exploratory analyses and benchmarking results are shown in Appendix A.9-A.10.
150
+
151
+ Table 1: Method benchmarking on irregularly sampled time series classification (Setting 1).
152
+
153
+ <table><tr><td rowspan="2">Methods</td><td colspan="2">P19</td><td colspan="2">P12</td><td colspan="4">PAM</td></tr><tr><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>Accuracy</td><td>Precision</td><td>Recall</td><td>F1 score</td></tr><tr><td>Transformer</td><td>83.2 ± 1.3</td><td>47.6±3.8</td><td>65.1 ± 5.6</td><td>95.7 ±1.6</td><td>83.5±1.5</td><td>84.8 ±1.5</td><td>86.0 ± 1.2</td><td>85.0 ± 1.3</td></tr><tr><td>Trans-mean</td><td>84.1 ± 1.7</td><td>47.4 ± 1.4</td><td>66.8±4.2</td><td>95.9 ± 1.1</td><td>83.7±2.3</td><td>84.9 ± 2.6</td><td>86.4 ± 2.1</td><td>85.1 ± 2.4</td></tr><tr><td>GRU-D</td><td>83.9 ±1.7</td><td>46.9 ± 2.1</td><td>67.2 ±3.6</td><td>95.9 ± 2.1</td><td>83.3 ±1.6</td><td>84.6 ±1.2</td><td>85.2 ± 1.6</td><td>84.8 ± 1.2</td></tr><tr><td>SeFT</td><td>78.7 ± 2.4</td><td>31.1 ± 2.8</td><td>66.8 ±0.8</td><td>96.2 ±0.2</td><td>67.1 ± 2.2</td><td>70.0 ± 2.4</td><td>68.2 ±1.5</td><td>68.5 ±1.8</td></tr><tr><td>mTAND</td><td>80.4 ±1.3</td><td>32.4 ±1.8</td><td>65.3 ±1.7</td><td>96.5 ±1.2</td><td>74.6 ± 4.3</td><td>74.3 ± 4.0</td><td>79.5 ± 2.8</td><td>76.8 ± 3.4</td></tr><tr><td>IP-Net</td><td>84.6 ±1.3</td><td>38.1 ± 3.7</td><td>72.5± 2.4</td><td>96.7 ± 0.3</td><td>74.3 ± 3.8</td><td>75.6 ± 2.1</td><td>77.9 ± 2.2</td><td>76.6± 2.8</td></tr><tr><td>DGM²-0</td><td>86.7 ± 3.4</td><td>44.7 ± 11.7</td><td>71.2 ± 2.5</td><td>96.9 ± 0.4</td><td>82.4± 2.3</td><td>85.2 ±1.2</td><td>83.9 ± 2.3</td><td>84.3 ± 1.8</td></tr><tr><td>MTGNN</td><td>81.9 ± 6.2</td><td>39.9 ± 8.9</td><td>67.5 ± 3.1</td><td>96.4± 0.7</td><td>83.4 ±1.9</td><td>85.2 ±1.7</td><td>86.1 ± 1.9</td><td>85.9 ± 2.4</td></tr><tr><td>RAINDROP</td><td>87.0 ± 2.3</td><td>51.8 ± 5.5</td><td>72.1 ± 1.3</td><td>97.0 ± 0.4</td><td>88.5 ± 1.5</td><td>89.9 ± 1.5</td><td>89.9 ± 0.6</td><td>89.8 ± 1.0</td></tr></table>
154
+
155
+ Setting 2: Leave-fixed-sensors-out. Setup. RAINDROP can compensate for missing sensor observations by exploiting dependencies between sensors. To this end, we test whether RAINDROP can achieve good performance when a subset of sensors are completely missing. This setting is practically relevant in situations when, for example, sensors fail or are unavailable. We select a fraction of sensors and hide all their observations in both validation and test sets (training samples are not changed). In particular, we leave out the most informative sensors as defined by information gain analysis (Appendix A.8). The left-out sensors are fixed across samples and models. Results. We report results taking PAM as an example. In Table 2 (left block), we observe that RAINDROP achieves top performance in 18 out of 20 settings when the number of left-out sensors goes from $10 \%$ to $50 \%$ With the increased amount of missing data, RAINDROP yield greater performance improvements. RAINDROP outperforms baselines by up to $2 4 . 9 \%$ in accuracy, $5 0 . 3 \%$ in precision, $2 9 . 3 \%$ in recall, and $4 2 . 8 \%$ in F1 score.
156
+
157
+ Setting 3: Leave-random-sensors-out. Setup. Setting 3 is similar to Setting 2 except that left-out sensors are randomly selected in each sample instead of being fixed. In each test sample, we select a subset of sensors and regard them as missing by replacing all of their observations with zeros. Results. We provide results for the PAM dataset in Table 2 (right block). We find that RAINDROP achieves better performance than baselines in 16 out of 20 settings and that Trans-mean and GRU-D are the strongest competitors. Further, we evaluated RAINDROP in another setting where the model is trained on one group of samples (e.g., females) and tested on another group not seen during training (e.g., males). Experimental setup and results are detailed in Appendix A.13.
158
+
159
+ Table 2: Classification performance on samples with a fixed set of left-out sensors (Setting 2) or random missing sensors (Setting 3) on the PAM dataset. Results for P19 dataset (Settings 2-3) are shown in Appendix A.12.
160
+
161
+ <table><tr><td rowspan="2">Missing sensor ratio</td><td rowspan="2">Methods</td><td colspan="4">PAM (Setting 2: leave-fixed-sensors-out)</td><td colspan="4">PAM(Setting 3: leave-random-sensors-out)</td></tr><tr><td>Accuracy</td><td>Precision</td><td>Recall</td><td>F1 score</td><td>Accuracy</td><td>Precision</td><td>Recall</td><td>F1 score</td></tr><tr><td rowspan="6">10%</td><td>Transformer</td><td>60.3± 2.4</td><td>57.8 ± 9.3</td><td>59.8± 5.4</td><td>57.2 ±8.0</td><td>60.9 ± 12.8</td><td>58.4 ± 18.4</td><td>59.1 ± 16.2</td><td>56.9 ±18.9</td></tr><tr><td>Trans-mean</td><td>60.4 ± 11.2</td><td>61.8 ± 14.9</td><td>60.2 ±13.8</td><td>58.0 ±15.2</td><td>62.4 ± 3.5</td><td>59.6± 7.2</td><td>63.7 ±8.1</td><td>62.7 ± 6.4</td></tr><tr><td>GRU-D</td><td>65.4 ± 1.7</td><td>72.6 ± 2.6</td><td>64.3 ± 5.3</td><td>63.6±0.4</td><td>68.4± 3.7</td><td>74.2 ± 3.0</td><td>70.8 ± 4.2</td><td>72.0 ±3.7</td></tr><tr><td>SeFT</td><td>58.9 ±2.3</td><td>62.5 ± 1.8</td><td>59.6±2.6</td><td>59.6 ± 2.6</td><td>40.0 ± 1.9</td><td>40.8± 3.2</td><td>41.0 ±0.7</td><td>39.9 ± 1.5</td></tr><tr><td>mTAND</td><td>58.8 ±2.7</td><td>59.5± 5.3</td><td>64.4 ± 2.9</td><td>61.8 ± 4.1</td><td>53.4 ± 2.0</td><td>54.8 ± 2.7</td><td>57.0 ± 1.9</td><td>55.9 ± 2.2</td></tr><tr><td>RAINDROP</td><td>77.2 ± 2.1</td><td>82.3 ± 1.1</td><td>78.4 ±1.9</td><td>75.2 ± 3.1</td><td>76.7 ± 1.8</td><td>79.9 ± 1.7</td><td>77.9 ± 2.3</td><td>78.6 ±1.8</td></tr><tr><td rowspan="6">20%</td><td>Transformer</td><td>63.1 ± 7.6</td><td>71.1 ± 7.1</td><td>62.2±8.2</td><td>63.2±8.7</td><td>62.3 ± 11.5</td><td>65.9 ± 12.7</td><td>61.4 ± 13.9</td><td>61.8 ± 15.6</td></tr><tr><td>Trans-mean</td><td>61.2 ± 3.0</td><td>74.2 ± 1.8</td><td>63.5 ± 4.4</td><td>64.1 ± 4.1</td><td>56.8 ± 4.1</td><td>59.4 ± 3.4</td><td>53.2 ±3.9</td><td>55.3 ±3.5</td></tr><tr><td>GRU-D</td><td>64.6 ± 1.8</td><td>73.3 ± 3.6</td><td>63.5± 4.6</td><td>64.8± 3.6</td><td>64.8 ± 0.4</td><td>69.8±0.8</td><td>65.8± 0.5</td><td>67.2 ± 0.0</td></tr><tr><td>SeFT</td><td>35.7 ±0.5</td><td>42.1 ± 4.8</td><td>38.1 ± 1.3</td><td>35.0±2.2</td><td>34.2 ± 2.8</td><td>34.9 ± 5.2</td><td>34.6 ± 2.1</td><td>33.3 ±2.7</td></tr><tr><td>mTAND</td><td>33.2±5.0</td><td>36.9 ± 3.7</td><td>37.7 ± 3.7</td><td>37.3 ± 3.4</td><td>45.6 ± 1.6</td><td>49.2 ± 2.1</td><td>49.0 ± 1.6</td><td>49.0 ± 1.0</td></tr><tr><td>RAINDROP</td><td>66.5± 4.0</td><td>72.0 ± 3.9</td><td>67.9 ±5.8</td><td>65.1 ± 7.0</td><td>71.3 ± 2.5</td><td>75.8 ± 2.2</td><td>72.5± 2.0</td><td>73.4 ± 2.1</td></tr><tr><td rowspan="6">30%</td><td>Transformer</td><td>31.6 ± 10.0</td><td>26.4 ± 9.7</td><td>24.0 ±10.0</td><td>19.0 ± 12.8</td><td>52.0 ± 11.9</td><td>55.2 ±15.3</td><td>50.1 ± 13.3</td><td>48.4 ± 18.2</td></tr><tr><td>Trans-mean</td><td>42.5±8.6</td><td>45.3 ± 9.6</td><td>37.0 ± 7.9</td><td>33.9 ±8.2</td><td>65.1 ± 1.9</td><td>63.8 ± 1.2</td><td>67.9 ± 1.8</td><td>64.9 ± 1.7</td></tr><tr><td>GRU-D</td><td>45.1 ± 2.9</td><td>51.7 ± 6.2</td><td>42.1 ± 6.6</td><td>47.2 ± 3.9</td><td>58.0±2.0</td><td>63.2 ± 1.7</td><td>58.2 ± 3.1</td><td>59.3±3.5</td></tr><tr><td>SeFT</td><td>32.7 ± 2.3</td><td>27.9 ± 2.4</td><td>34.5± 3.0</td><td>28.0 ± 1.4</td><td>31.7 ± 1.5</td><td>31.0 ± 2.7</td><td>32.0 ± 1.2</td><td>28.0 ±1.6</td></tr><tr><td>mTAND</td><td>27.5 ± 4.5</td><td>31.2 ± 7.3</td><td>30.6± 4.0</td><td>30.8 ± 5.6</td><td>34.7 ± 5.5</td><td>43.4 ± 4.0</td><td>36.3 ± 4.7</td><td>39.5 ± 4.4</td></tr><tr><td>RAINDROP</td><td>52.4± 2.8</td><td>60.9 ± 3.8</td><td>51.3 ± 7.1</td><td>48.4 ± 1.8</td><td>60.3 ±3.5</td><td>68.1 ± 3.1</td><td>60.3 ±3.6</td><td>61.9 ± 3.9</td></tr><tr><td rowspan="6">40%</td><td>Transformer</td><td>23.0±3.5</td><td>7.4 ± 6.0</td><td>14.5 ± 2.6</td><td>6.9 ± 2.6</td><td>43.8 ± 14.0</td><td>44.6 ± 23.0</td><td>40.5 ±15.9</td><td>40.2 ± 20.1</td></tr><tr><td>Trans-mean</td><td>25.7± 2.5</td><td>9.1 ± 2.3</td><td>18.5 ± 1.4</td><td>9.9 ± 1.1</td><td>48.7 ± 2.7</td><td>55.8± 2.6</td><td>54.2 ± 3.0</td><td>55.1 ± 2.9</td></tr><tr><td>GRU-D</td><td>46.4 ± 2.5</td><td>64.5 ± 6.8</td><td>42.6 ± 7.4</td><td>44.3 ± 7.9</td><td>47.7 ± 1.4</td><td>63.4 ± 1.6</td><td>44.5± 0.5</td><td>47.5± 0.0</td></tr><tr><td>SeFT</td><td>26.3 ± 0.9</td><td>29.9 ± 4.5</td><td>27.3 ± 1.6</td><td>22.3 ± 1.9</td><td>26.8 ± 2.6</td><td>24.1 ± 3.4</td><td>28.0 ±1.2</td><td>23.3±3.0</td></tr><tr><td>mTAND</td><td>19.4 ± 4.5</td><td>15.1 ± 4.4</td><td>20.2 ±3.8</td><td>17.0 ± 3.4</td><td>23.7 ±1.0</td><td>33.9 ± 6.5</td><td>26.4 ± 1.6</td><td>29.3 ± 1.9</td></tr><tr><td>RAINDROP</td><td>52.5±3.7</td><td>53.4± 5.6</td><td>48.6 ± 1.9</td><td>44.7 ± 3.4</td><td>57.0 ± 3.1</td><td>65.4 ± 2.7</td><td>56.7 ± 3.1</td><td>58.9 ± 2.5</td></tr><tr><td rowspan="6">50%</td><td>Transformer</td><td>21.4 ± 1.8</td><td>2.7 ±0.2</td><td>12.5 ± 0.4</td><td>4.4 ± 0.3</td><td>43.2 ± 2.5</td><td>52.0± 2.5</td><td>36.9 ± 3.1</td><td>41.9 ± 3.2</td></tr><tr><td>Trans-mean</td><td>21.3 ± 1.6</td><td>2.8 ±0.4</td><td>12.5 ± 0.7</td><td>4.6±0.2</td><td>46.4 ± 1.4</td><td>59.1 ± 3.2</td><td>43.1 ± 2.2</td><td>46.5 ± 3.1</td></tr><tr><td>GRU-D</td><td>37.3 ± 2.7</td><td>29.6± 5.9</td><td>32.8±4.6</td><td>26.6±5.9</td><td>49.7 ± 1.2</td><td>52.4±0.3</td><td>42.5 ± 1.7</td><td>47.5 ± 1.2</td></tr><tr><td>SeFT</td><td>24.7 ± 1.7</td><td>15.9 ± 2.7</td><td>25.3±2.6</td><td>18.2 ± 2.4</td><td>26.4 ± 1.4</td><td>23.0 ±2.9</td><td>27.5± 0.4</td><td>23.5± 1.8</td></tr><tr><td>mTAND</td><td>16.9 ± 3.1</td><td>12.6 ± 5.5</td><td>17.0 ± 1.6</td><td>13.9 ± 4.0</td><td>20.9 ± 3.1</td><td>35.1 ± 6.1</td><td>23.0±3.2</td><td>27.7 ± 3.9</td></tr><tr><td>RAINDROP</td><td>46.6 ± 2.6</td><td>44.5 ± 2.6</td><td>42.4 ± 3.9</td><td>38.0±4.0</td><td>47.2 ± 4.4</td><td>59.4 ± 3.9</td><td>44.8±5.3</td><td>47.6± 5.2</td></tr></table>
162
+
163
+ # 4.2 ABLATION STUDY AND VISUALIZATION OF OPTIMIZED SENSOR GRAPHS
164
+
165
+ Ablation study. Considering the PAM dataset and a typical setup (Setting 1), we conduct an ablation study to evaluate how much various RAINDROP’s components contribute towards its final performance. We examine the following components: inter-sensor dependencies (further decomposed into weights including $e _ { i , u v }$ , $\mathbf { \Delta } _ { \mathbf { \boldsymbol { r } } _ { v } }$ , $\mathbf { \Delta } _ { p _ { i } ^ { t } } ^ { t }$ , and $\alpha _ { i , u v } ^ { \bar { t } } )$ , temporal attention, and sensor-level concatenation. We show in Appendix A.14 (Table 7) that all model components are necessary and that regularization $\mathcal { L } _ { r }$ contributes positively to RAINDROP’s performance.
166
+
167
+ Visualizing sensor dependency graphs. We investigate whether samples with the same labels get more similar sensor dependency graphs than samples with different labels. To this end, we visualize inter-sensor dependencies (P19; Setting 1) and explore them. Figure 4 shows distinguishable patterns between graphs of negative and positive samples, indicating that RAINDROP can extract relationships that are specific to downstream sample labels. Further differential analysis provides insights that can inform early detection of sepsis from P19 clinical data. Details are in Appendix A.15.
168
+
169
+ # 5 CONCLUSION
170
+
171
+ We introduce RAINDROP, a graph-guided network for irregularly sampled time series. RAINDROP learns a distinct sensor dependency graph for every sample capturing time-varying dependencies between sensors. The ability to leverage graph structure gives RAINDROP unique capability to naturally handle misaligned observations, non-uniform time intervals between successive observations, and sensors with varying numbers of recorded observations. Our findings have implications for using message passing as a way to leverage relational information in multivariate time series.
172
+
173
+ # ACKNOWLEDGMENTS
174
+
175
+ This material is based upon work supported by the Under Secretary of Defense for Research and Engineering under Air Force Contract No. FA8702-15-D-0001. M.Z. is supported, in part, by NSF under nos. IIS-2030459 and IIS-2033384, Harvard Data Science Initiative, Amazon Research Award, Bayer Early Excellence in Science Award, AstraZeneca Research, and Roche Alliance with Distinguished Scientists Award. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the funders. The authors declare that there are no conflict of interests.
176
+
177
+ # REPRODUCIBILITY STATEMENT
178
+
179
+ We ensure the reproducibility of our work by clearly presenting the model and providing publicly accessible code and data. For all datasets used in this work, we share downloadable links to the raw sources and processed and ready-to-run datasets with the research community through this link: https://github.com/mims-harvard/Raindrop. We specify all training details (e.g., preprocessing, data splits, hyperparameters, sensor selection) in the main text and Appendix. Python implementation of RAINDROP and all baseline methods is available at the aforementioned link. Detailed description of data, scripts, and configurations along with examples of usage are also provided.
180
+
181
+ # ETHICS STATEMENT
182
+
183
+ The ability of RAINDROP to learn robust information about sensors’ representations and dependencies creates new opportunities for applications, where time series are predominant, e.g., in healthcare, biology, and finance. In all these fields, especially in healthcare applications, our method should be used with caution. Although our model can gain valuable insights from time series, users must consider the limitations of machine-guided predictions. As with all data-driven solutions, our model may make biased predictions. In the case of biomedical data, biases can exist within the data itself, which can be, for example, caused by considering demographic attributes, such as age, weight, and gender, that might correlate with protected/regulated attributes. When target classes are highly imbalanced, our model can mitigate the issues by upsampling minority classes in every processed batch.
184
+
185
+ All datasets in this paper are publicly available and are not associated with any privacy or security concern. Further, all data are anonymized to guard against breaching patients’ protected health information. We followed PhysioNet privacy policy and guidelines (https://archive.physionet.org/ privacy.shtml) when experimenting with P12 and P19 datasets.
186
+
187
+ # REFERENCES
188
+
189
+ Denis Agniel, Isaac S Kohane, and Griffin M Weber. Biases in electronic health record data due to processes within the healthcare system: retrospective observational study. British Medical Journal, 361, 2018.
190
+
191
+ 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.
192
+
193
+ Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In NeurIPS, 2018.
194
+
195
+ Zekai Chen, E Jiaze, Xiao Zhang, Hao Sheng, and Xiuzheng Cheng. Multi-task time series forecasting with shared attention. In ICDM Workshop, pp. 917–925, 2020.
196
+
197
+ Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. 2014.
198
+
199
+ Edward Choi, Zhen Xu, Yujia Li, Michael Dusenberry, Gerardo Flores, Emily Xue, and Andrew Dai. Learning the graphical structure of electronic health records with graph convolutional transformer. In AAAI, volume 34, pp. 606–613, 2020.
200
+
201
+ Federico Errica, Davide Bacciu, and Alessio Micheli. Graph mixture density networks. In ICML, pp. 3025–3035, 2021.
202
+
203
+ Chenguang Fang and Chen Wang. Time series data imputation: A survey on deep learning approaches. arXiv:2011.11347, 2020.
204
+
205
+ Hassan Ismail Fawaz, Germain Forestier, Jonathan Weber, Lhassane Idoumghar, and Pierre-Alain Muller. Deep learning for time series classification: a review. Data Mining and Knowledge Discovery, 33(4):917–963, 2019.
206
+
207
+ Matthias Fey, Jan-Gin Yuen, and Frank Weichert. Hierarchical inter-message passing for learning on molecular graphs. arXiv:2006.12179, 2020.
208
+
209
+ Mikhail Galkin, Priyansh Trivedi, Gaurav Maheshwari, Ricardo Usbeck, and Jens Lehmann. Message passing for hyper-relational knowledge graphs. arXiv:2009.10847, 2020.
210
+
211
+ Prakhar Ganesh, Yao Chen, Xin Lou, Mohammad Ali Khan, Yin Yang, Hassan Sajjad, Preslav Nakov, Deming Chen, and Marianne Winslett. Compressing large-scale transformer-based models: A case study on bert. Transactions of the Association for Computational Linguistics, 9:1061–1080, 2021.
212
+
213
+ Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In ICML, pp. 1263–1272. PMLR, 2017.
214
+
215
+ Ary L. Goldberger, Luis A. Nunes Amaral, L Glass, Jeffrey M. Hausdorff, Plamen Ch. Ivanov, Roger G. Mark, Joseph E. Mietus, George B. Moody, Chung-Kang Peng, and Harry Eugene Stanley. PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation, 101 23:E215–20, 2000.
216
+
217
+ Max Horn, Michael Moor, Christian Bock, Bastian Rieck, and Karsten Borgwardt. Set functions for time series. pp. 4303–4313, 2020.
218
+
219
+ Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In CVPR, pp. 7132–7141, 2018.
220
+
221
+ Wenjie Hu, Yang Yang, Ziqiang Cheng, Carl Yang, and Xiang Ren. Time-series event prediction with evolutionary state graph. In WSDM, pp. 580–588, 2021.
222
+
223
+ Ziniu Hu, Yuxiao Dong, Kuansan Wang, and Yizhou Sun. Heterogeneous graph transformer. In The Web Conference, pp. 2704–2710, 2020.
224
+
225
+ Ekaterina Kalinicheva, Dino Ienco, Jérémie Sublime, and Maria Trocan. Unsupervised change detection analysis in satellite image time series using deep learning combined with graph-based approaches. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 13:1450–1466, 2020.
226
+
227
+ Patrick Kidger, James Morrill, James Foster, and Terry Lyons. Neural controlled differential equations for irregular time series. arXiv:2005.08926, 2020.
228
+
229
+ Byung-Hoon Kim, Jong Chul Ye, and Jae-Jin Kim. Learning dynamic graph representation of brain connectome with spatio-temporal attention. arXiv:2105.13495, 2021.
230
+
231
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014.
232
+
233
+ Liying Li, Yang Liu, Tongquan Wei, and Xin Li. Exploring inter-sensor correlation for missing data estimation. In IECON, pp. 2108–2114. IEEE, 2020a.
234
+
235
+ Michelle M Li, Kexin Huang, and Marinka Zitnik. Representation learning for networks in biology and medicine: Advancements, challenges, and opportunities. arXiv:2104.04883, 2021.
236
+
237
+ S. C.-X. Li and B. M. Marlin. A scalable end-to-end gaussian process adapter for irregularly sampled time series classification. In NIPS, pp. 1804–1812, 2016.
238
+
239
+ Steven Cheng-Xian Li and Benjamin Marlin. Learning from irregularly-sampled time series: A missing data perspective. In ICML, pp. 5937–5946. PMLR, 2020.
240
+
241
+ Xiaoxue Li, Yanmin Shang, Yanan Cao, Yangxi Li, Jianlong Tan, and Yanbing Liu. Type-aware anchor link prediction across heterogeneous networks based on graph attention network. In AAAI, volume 34, pp. 147–155, 2020b.
242
+
243
+ Wu Lin, Nicolas Hubacher, and Mohammad Emtiyaz Khan. Variational message passing with structured inference networks. ICLR, 2018.
244
+
245
+ R. J. Little and D. B. Rubin. Statistical Analysis with Missing Data. John Wiley & Sons, 3 edition, 2014.
246
+
247
+ Qianli Ma, Sen Li, and Garrison Cottrell. Adversarial joint-learning recurrent neural network for incomplete time series classification. TPAMI, 2020.
248
+
249
+ Karl Øyvind Mikalsen, Cristina Soguero-Ruiz, Filippo Maria Bianchi, Arthur Revhaug, and Robert Jenssen. Time series cluster kernels to exploit informative missingness and incomplete label information. Pattern Recognition, 115:107896, 2021.
250
+
251
+ Daniel Neil, Michael Pfeiffer, and Shih-Chii Liu. Phased lstm: accelerating recurrent network training for long or event-based sequences. In NIPS, pp. 3889–3897, 2016.
252
+
253
+ Giannis Nikolentzos, Antoine Tixier, and Michalis Vazirgiannis. Message passing attention networks for document understanding. In AAAI, volume 34, pp. 8544–8551, 2020.
254
+
255
+ S Ravuri, K Lenc, M Willson, D Kangin, R Lam, P Mirowski, M Athanassiadou, S Kashem, S Madge, R Prudden, et al. Skillful precipitation nowcasting using deep generative models of radar, arxiv. Nature, 597:672–677, 2021.
256
+
257
+ Attila Reiss and Didier Stricker. Introducing a new benchmarked dataset for activity monitoring. In ISWC, pp. 108–109, 2012.
258
+
259
+ Matthew A Reyna, Christopher S Josef, Russell Jeter, Supreeth P Shashikumar, M Brandon Westover, Shamim Nemati, Gari D Clifford, and Ashish Sharma. Early prediction of sepsis from clinical data: The physionet/computing in cardiology challenge 2019. Critical Care Medicine, 48(2):210–217, 2020.
260
+
261
+ Pau Riba, Andreas Fischer, Josep Lladós, and Alicia Fornés. Learning graph distances with message passing neural networks. In ICPR, pp. 2239–2244. IEEE, 2018.
262
+
263
+ J. L. Schafer and J. W. Graham. Missing data: Our view of the state of the art. Psychological Methods, 7(2), 2002.
264
+
265
+ Omer Berat Sezer, Mehmet Ugur Gudelek, and Ahmet Murat Ozbayoglu. Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Applied Soft Computing, 90:106181, 2020.
266
+
267
+ Siyuan Shan and Junier B Oliva. Nrtsi: Non-recurrent time series imputation for irregularly-sampled data. arXiv:2102.03340, 2021.
268
+
269
+ Paul Shannon, Andrew Markiel, Owen Ozier, Nitin S Baliga, Jonathan T Wang, Daniel Ramage, Nada Amin, Benno Schwikowski, and Trey Ideker. Cytoscape: a software environment for integrated models of biomolecular interaction networks. Genome Research, 13(11):2498–2504, 2003.
270
+
271
+ Satya Narayan Shukla and Benjamin Marlin. Interpolation-prediction networks for irregularly sampled time series. In ICLR, 2018.
272
+
273
+ Satya Narayan Shukla and Benjamin Marlin. Multi-time attention networks for irregularly sampled time series. In ICLR, 2021.
274
+
275
+ Satya Narayan Shukla and Benjamin M Marlin. A survey on principles, models and methods for learning from irregularly sampled time series. 2020.
276
+
277
+ Rafael T Sousa, Lucas A Pereira, and Anderson S Soares. Improving irregularly sampled time series learning with dense descriptors of time. arXiv:2003.09291, 2020.
278
+
279
+ Qingxiong Tan, Mang Ye, Baoyao Yang, Siqi Liu, Andy Jinhua Ma, Terry Cheuk-Fung Yip, Grace Lai-Hung Wong, and PongChi Yuen. DATA-GRU: Dual-attention time-aware gated recurrent unit for irregular multivariate time series. In AAAI, volume 34, pp. 930–937, 2020.
280
+
281
+ Sindhu Tipirneni and Chandan K Reddy. Self-supervised transformer for multivariate clinical time-series with missing values. arXiv:2107.14293, 2021.
282
+
283
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, pp. 5998–6008, 2017.
284
+
285
+ Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph attention networks. In ICLR, 2018.
286
+
287
+ Xiaoyang Wang, Yao Ma, Yiqi Wang, Wei Jin, Xin Wang, Jiliang Tang, Caiyan Jia, and Jian Yu. Traffic flow prediction via spatial temporal graph neural network. In The Web Conference 2020, pp. 1082–1092, 2020.
288
+
289
+ Zhen Wang, Yang Zhang, Ai Jiang, Ji Zhang, Zhao Li, Jun Gao, Ke Li, and Chenhao Lu. Dama-net: A novel predictive model for irregularly asynchronously and sparsely sampled multivariate time series. In ICML’W, 2011.
290
+
291
+ B. J. Wells, K. M. Chagin, A. S. Nowacki, and M. W. Kattan. Strategies for handling missing data in electronic health record derived data. EGEMS, 1(3), 2013.
292
+
293
+ Sifan Wu, Xi Xiao, Qianggang Ding, Peilin Zhao, Ying Wei, and Junzhou Huang. Adversarial sparse transformer for time series forecasting. In NeurIPS, volume 33, 2020a.
294
+
295
+ Yinjun Wu, Jingchao Ni, Wei Cheng, Bo Zong, Dongjin Song, Zhengzhang Chen, Yanchi Liu, Xuchao Zhang, Haifeng Chen, and Susan Davidson. Dynamic gaussian mixture based deep generative model for robust forecasting on sparse multivariate time series. In AAAI, 2021.
296
+
297
+ Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 32(1):4–24, 2020b.
298
+
299
+ Zonghan Wu, Shirui Pan, Guodong Long, Jing Jiang, Xiaojun Chang, and Chengqi Zhang. Connecting the dots: Multivariate time series forecasting with graph neural networks. In KDD, pp. 753–763, 2020c.
300
+
301
+ Jianing Yang, Yongxin Wang, Ruitao Yi, Yuying Zhu, Azaan Rehman, Amir Zadeh, Soujanya Poria, and Louis-Philippe Morency. Mtag: Modal-temporal attention graph for unaligned human multimodal language sequences. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 1009–1021, 2021.
302
+
303
+ Seongjun Yun, Minbyul Jeong, Raehyun Kim, Jaewoo Kang, and Hyunwoo J Kim. Graph transformer networks. In NeurIPS, volume 32, pp. 11983–11993, 2019.
304
+
305
+ George Zerveas, Srideepika Jayaraman, Dhaval Patel, Anuradha Bhamidipaty, and Carsten Eickhoff. A transformer-based framework for multivariate time series representation learning. In KDD, pp. 2114–2124, 2021.
306
+
307
+ Daochen Zha, Kwei-Herng Lai, Kaixiong Zhou, and Xia Hu. Towards similarity-aware time-series classification. SDM, 2022.
308
+
309
+ Chuxu Zhang, Dongjin Song, Yuncong Chen, Xinyang Feng, Cristian Lumezanu, Wei Cheng, Jingchao Ni, Bo Zong, Haifeng Chen, and Nitesh V Chawla. A deep neural network for unsupervised anomaly detection and diagnosis in multivariate time series data. In AAAI, volume 33, pp. 1409–1416, 2019.
310
+
311
+ Li Zhang, Dan Xu, Anurag Arnab, and Philip HS Torr. Dynamic graph message passing networks. In CVPR, pp. 3726–3735, 2020.
312
+
313
+ Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. AI Open, 1:57–81, 2020.
314
+
315
+ # A APPENDIX
316
+
317
+ # A.1 ENCODING TIMESTAMPS
318
+
319
+ For a given time value $t$ , we pass it to trigonometric functions with the frequency of 10,000 (Vaswani et al., 2017) and generate time representation $\boldsymbol { p } ^ { t } \in \mathbf { R } ^ { \xi }$ (omit sample index $i$ for brevity) through (Horn et al., 2020):
320
+
321
+ $$
322
+ p _ { 2 k } ^ { t } = \sin ( \frac { t } { 1 0 0 0 0 ^ { 2 k / \xi } } ) , \quad p _ { 2 k + 1 } ^ { t } = \cos ( \frac { t } { 1 0 0 0 0 ^ { 2 k / \xi } } ) ,
323
+ $$
324
+
325
+ where $\xi$ is the expected dimension. In this work, we set $\xi = 1 6$ in all experimental settings for all models. Please note, we encode the time value which is a continuous timestamp, instead of time position which is a discrete integer indicating the order of observation in time series.
326
+
327
+ # A.2 ADDITIONAL INFORMATION ON THE CALCULATION OF TEMPORAL ATTENTION WEIGHT
328
+
329
+ The Eq. 4 describes how we learn the temporal attention weights vector $\beta _ { i , v }$ for sensor $v$ , following the self-attention formalism. Different from the standard self-attention mechanism that generates an self-attention matrix, we generate a temporal attention weight vector. The reason is that we only need an attention weight vector (instead of a matrix) to aggregate the observation embeddings into a single sensor embedding through weighted sum.
330
+
331
+ In the standard self-attention matrix, each element denotes the dependency of an observation embedding on another observation embedding. Similarly, each row describes the dependencies of an observation embedding on all other observation embeddings (all the observations belong to the same sensor). Our intuition is to aggregate a row in the self-attention matrix into a scalar that denotes the importance of the observation embedding to the whole sensor embedding.
332
+
333
+ In practice, we apply the weighted aggregation, parameterized by $\pmb { s }$ , to every row in the self-attention matrix and concatenate the generated scalars into an attention vector. Next, we give a concrete example to specifically describe the meaning of $\pmb { s }$ . Each row, $j$ , of the self-attention matrix captures relationships of observation embedding $h _ { i , v } ^ { t _ { j } }$ to all observation embeddings $\{ h _ { i , v } ^ { t _ { k } } : k = 1 , . . . , T \}$ Then, using the learnable weight vector $\pmb { s }$ , these correlations between observations are aggregated across time to obtain temporal importance weight $\beta _ { i , v } ^ { t _ { j } }$ . The $\beta _ { i , v } ^ { t _ { j } }$ represents the importance of the corresponding observation to the whole sensor embedding.
334
+
335
+ # A.3 ADDITIONAL INFORMATION ON SAMPLE EMBEDDING
336
+
337
+ As we generate sample embedding by concatenating all sensor embeddings, the sample embedding could be relatively long when there is a large number of sensors. To alleviate this issue, on one hand, we can reduce the dimension of sample embeddings by adding a neural layer (such as a simple fully-connected layer) after the concatenation. On the other hand, when the number of sensors is super large, our model is flexible and can effortlessly switch the concatenation to other readout functions (such as averaging aggregation): this will naturally solve the problem of long vectors. We empirically show that concatenation works better than averaging in our case. We see a boost in the AUROC score by $0 . 6 \%$ using concatenation instead of averaging for generating sample embeddings(P19; Setting 1).
338
+
339
+ # A.4 ADDITIONAL INFORMATION ON SAMPLE SIMILARITIES
340
+
341
+ In this work, we assume all samples share some common characteristics to some extent. When modeling the similarities across samples, we do not consider the situation where the samples are similar within latent groups and different across groups.
342
+
343
+ Our study focuses on the question of irregularity rather than the question of distribution shifts in time series. To this end, in our experiments, we first rigorously benchmark Raindrop using a standard evaluating setup (Setting 1, which is classification of irregular time series). This is the only setup that most existing methods consider (e.g., Shukla & Marlin (2021); Che et al. (2018)) and we want to make sure our comparisons are fair. In order to provide a more rigorous assessment of Raindrop’s performance, we also consider more challenging setups in our experiments (i.e., Settings 2-4) when the dataset is evaluated in a non-standard manner and the split is informed by a select data attribute.
344
+
345
+ Table 3: Dataset statistics. The ‘#-timestamps’ refers to the number of all sampling timestamps measured in this dataset. The ‘#-classes’ means the number of categories in dataset labels. The ’Static info’ indicates if sample’s static attributes (e.g., height and weight) are available. The ‘missing ratio’ denotes the ratio between the number of missing observations and the number of all possible observations if the dataset is fully-observed.
346
+
347
+ <table><tr><td>Datasets</td><td>#-samples</td><td>#-sensors</td><td>#-timestamps</td><td>#-classes</td><td>Static info</td><td>Missing ratio (%)</td></tr><tr><td>P19</td><td>38,803</td><td>34</td><td>60</td><td>2</td><td>True</td><td>94.9</td></tr><tr><td>P12</td><td>11,988</td><td>36</td><td>215</td><td>2</td><td>True</td><td>88.4</td></tr><tr><td>PAM</td><td>5,333</td><td>17</td><td>600</td><td>8</td><td>False</td><td>60.0</td></tr></table>
348
+
349
+ Our results on Setting 1 are consistent with those on Settings 2-4. Results on harder Settings 2-4 show that Raindrop can perform comparably better than baselines. Results across these diverse settings increase our confidence that Raindrop is quite flexible and widely applicable.
350
+
351
+ # A.5 FURTHER DETAILS ON DATASETS
352
+
353
+ P19: PhysioNet Sepsis Early Prediction Challenge 2019. P19 dataset (Reyna et al., 2020) contains 38,803 patients and each patient is monitored by 34 irregularly sampled sensors including 8 vital signs and 26 laboratory values. The original dataset has 40,336 patients, we remove the samples with too short or too long time series, remaining 38,803 patients (the longest time series of the patient has more than one and less than 60 observations). Each patient is associated with a static vector indicating attributes: age, gender, time between hospital admission and ICU admission, ICU type, and ICU length of stay (days). Each patient has a binary label representing occurrence of sepsis within the next 6 hours. The dataset is highly imbalanced with only ${ \sim } 4 \%$ positive samples.
354
+
355
+ P12: PhysioNet Mortality Prediction Challenge 2012. P12 dataset (Goldberger et al., 2000) includes 11,988 patients (samples), after removing 12 inappropriate samples following (Horn et al., 2020). Each patient contains multivariate time series with 36 sensors (excluding weight), which are collected in the first 48-hour stay in ICU. Each sample has a static vector with 9 elements including age, gender, etc. Each patient is associated with a binary label indicating length of stay in ICU, where negative label means hospitalization is not longer than 3 days and positive label marks hospitalization is longer than 3 days. P12 is imbalanced with ${ \sim } 9 3 \%$ positive samples.
356
+
357
+ PAM: PAMAP2 Physical Activity Monitoring. PAM dataset (Reiss & Stricker, 2012) measures daily living activities of 9 subjects with 3 inertial measurement units. We modify it to suit our scenario of irregular time series classification. We excluded the ninth subject due to short length of sensor readouts. We segment the continuous signals into samples with the time window of 600 and the overlapping rate of $50 \%$ . PAM originally has 18 activities of daily life. We exclude the ones associated with less than 500 samples, remaining 8 activities. After modification, PAM dataset contains 5,333 segments (samples) of sensory signals. Each sample is measured by 17 sensors and contains 600 continuous observations with the sampling frequency $1 0 0 ~ \mathrm { H z }$ . To make time series irregular, we randomly remove $60 \%$ of observations. To keep fair comparison, the removed observations are randomly selected but kept the same for all experimental settings and approaches. PAM is labelled by 8 classes where each class represents an activity of daily living. PAM does not include static attributes and the samples are approximately balanced across all 8 categories.
358
+
359
+ To feed given data into neural networks, we set the input as zero if no value was measured. In highly imbalanced datasets (P19 and P12) we perform batch minority class upsampling, which means that every processed batch has the same number of positive and negative class samples. The dataset statistics including sparse ratio are provided in Table 3.
360
+
361
+ # A.6 FURTHER DETAILS ON MODEL HYPERPARAMETERS
362
+
363
+ Baseline hyperparameters. The implementation of baselines follows the corresponding papers including SeFT (Horn et al., 2020), GRU-D (Che et al., 2018), and mTAND (Shukla & Marlin, 2021). We follow the settings of Transformer baseline in (Horn et al., 2020) while implementing Transformer in our work. For average imputation in Trans-mean, we replace the missing values by the global mean value of observations in the sensor (Shukla & Marlin, 2020). We use batch size of
364
+
365
+ 128 and learning rate of 0.0001. Note that we upsample the minority class in each batch to make the batch balance (64 positive samples and 64 negative samples in each batch).
366
+
367
+ The chosen hyperparameters are the same across datasets (P19, P12, PAM), models (both baselines and RAINDROP), and experimental settings. Remarkably, we found that all the baselines make dummy predictions (classify all testing samples as the majority label) on PAM in Setting 2-3 while RAINDROP makes reasonable predictions. For the comparison to make sense (i.e., the baselines can make meaningful predictions), we use learning rate of 0.001 for baselines on PAM. GRU-D has 49 layers while other models have 2 layers. We run all models for 20 epochs, store the parameters that obtain the highest AUROC in the validation set, and use it to make predictions for testing samples. We use the Adam algorithm for gradient-based optimization (Kingma & Ba, 2014).
368
+
369
+ RAINDROP hyperparameters. Next, we report the setting of unique hyperparameters in our RAINDROP. In the generation of observation embedding, we set $\scriptstyle { \boldsymbol { R _ { u } } }$ as a 4-dimensional vector, thus the produced observation embedding has 4 dimensions. The dimensions of time representation $p ^ { t }$ and $\mathbf { \Delta } _ { \mathbf { \boldsymbol { r } } _ { v } }$ are both 16. The trainable weight matrix $_ { D }$ has shape of $4 \times 3 2$ . The dimensions of ${ \pmb w } _ { \pmb u }$ and $\mathbf { \Delta } _ { w _ { v } }$ are the same as the number of sensors: 34 in P19, 36 in P12, and 17 in PAM. We set the number of RAINDROP layers $L$ as 2 while the first layer prunes edges and the second layer does not. We set the proportion of edge pruning as $50 \%$ $( \mathrm { K } { = } 5 0 )$ ), which means we remove half of the existing edges that have the lowest weights. The $d _ { k }$ is set to 20, while the shape of $W$ is $2 0 \times 2 0$ . All the activation functions, without specific clarification, are sigmoid functions. The $d _ { a }$ is set equal to the number of sensors. The first layer of $\varphi$ has 128 neurons while the second layer has $C$ neurons (i.e., 2 for P19 and P12; 8 for PAM). We set $\lambda = 0 . 0 2$ to adjust $\mathcal { L } _ { r }$ regularization scale. All the preprocessed datasets and implementation codes are made available online. Further details are available through RAINDROP’s code and dataset repository.
370
+
371
+ Readout function. Here we discuss the selection of readout function $g$ in section 3.5. Our preliminary experiments show that concatenation outperforms other popular aggregation functions such as averaging (Errica et al., 2021) and squeeze-excitation readout function (Kim et al., 2021; Hu et al., 2018). While any of those aggregation functions can be considered, we used concatenation throughout all experiments in this manuscript.
372
+
373
+ # A.7 PERFORMANCE METRICS
374
+
375
+ Since P19 and P12 datasets are imbalanced, we use the Area Under a ROC Curve (AUROC) and Area Under Precision-Recall Curve (AUPRC) to measure performance. As the PAM dataset is nearly balanced, we also report accuracy, precision, recall and F1 score. We report mean and standard deviation values over 5 independent runs. Model parameters that achieve the best AUROC value on the validation set are used for test set.
376
+
377
+ # A.8 FURTHER DETAILS ON SETUP DETAILS FOR SETTING 2
378
+
379
+ In Setting 2, the selected missing sensors are fixed across different models and chosen in the following way. First, we calculate the importance score for each sensor and rank them in a descending order. The importance score is based on information gain, which we calculate with feeding the observations into a Random Forest classifier with 20 decision trees. In particular, we treat each sample as only having one sensor, then feed the single sensor into random forest classifier and record the AUROC. The higher AUROC indicates the sensor provides higher information gain. When we have sensors ranked by their AUROC values, we choose the first $n$ sensors (the ones with highest AUROC values) and replace all observations in these sensors by zeros in all samples in validation and test set. The number of missing sensors is defined indirectly from the user with the sensors’ missing ratio which ranges from 0.1 to 0.5.
380
+
381
+ # A.9 ADDITIONAL INFORMATION ON MISSING PATTERN
382
+
383
+ This work propose RAINDROP which is a novel solution for irregularity in multivariate time series through inter-sensor dependencies. RAINDROP is not in conflict with other solutions (such as missing pattern and temporal decay) for irregularity. However, as the missing pattern is widely discussed in modelling incomplete time series (Che et al., 2018), we explore how to combine the advantages of relational structures and missing pattern. We adopt mask matrix as a proxy of missing pattern as in Che et al. (2018). Taking the architecture of RAINDROP, we concatenate the observation $x _ { i , u } ^ { t }$ with a binary mask indicator $b _ { i , u } ^ { t }$ as input. The indicator $b _ { i , u } ^ { t }$ is set as 1 when there is an observation of sensor $i$ at time $t$ and set as 0 otherwise. All the experimental settings and hyperparameters are the same as in RAINDROP (P19; Setting 1). The experimental results show that taking advantage of missing pattern can slightly boost the AUROC by $1 . 2 \%$ and AUPRC by $0 . 9 \%$ in P19. This empirically shed the light for future research on integrating multiple characteristics in representation of irregularly time series.
384
+
385
+ # A.10 COMPARISON BETWEEN TEMPORAL ATTENTION AND LSTM
386
+
387
+ We conduct extensive experiments to compare the effectiveness of temporal attention and LSTM. To this end, we replace the temporal attention in sensor embedding generation (Eq 4-5) in RAINDROP by LSTM layer which processes all observation embeddings sequentially. We use zero padding to convert the irregular observations into fixed-length time series so the data can be fed into LSTM architecture. We regard the last output of LSTM as generated sensor embedding. The number of LSTM cells equal to the dimension of observation embedding. All the model structures are identical except in the part of temporal attention and LSTM. We keep all experimental settings (P19; Setting 1) and hyperparameter selections the same. The experimental results show that the temporal self-attention outperform LSTM by $1 . 8 \%$ (AUROC) and additionally saved $49 \%$ of the training time. One potential reason is that the self-attention mechanism avoids recursion and allows parallel computation and also reduces performance degradation caused by long-term dependencies (Ganesh et al., 2021; Vaswani et al., 2017).
388
+
389
+ # A.11 ADDITIONAL INFORMATION ON METHOD BENCHMARKING
390
+
391
+ Taking experimental Setting 1 (i.e., classic time series classification) as an example, we conduct extensive experiments to compare Raindrop with ODE-RNN (Chen et al., 2020), $\mathrm { D G } \mathbf { \bar { M } } ^ { 2 }$ -O (Wu et al., 2021), EvoNet (Hu et al., 2021), and MTGNN (Wu et al., 2020c). As IP-Net (Shukla & Marlin, 2018) and mTAND (Shukla & Marlin, 2021) are from the same authors, we only compare with mTAND which is the latest model. For the baselines, we follow the settings as provided in their public codes. For methods, which cannot deal with irregular data (e.g., EvoNet and MTGNN), we first impute the missing data using mean imputation and then feed data into the model. For forecasting models (e.g., MTGNN) which are strictly not comparable with the proposed classification model, we formulate the task as a single-step forecasting, concatenate the learned representations from all sensors and feed into a fully-connected layer (work as classifier) to make prediction, and use cross-entropy to quantify the loss.
392
+
393
+ # A.12 RESULTS FOR P19 (SETTINGS 2-3)
394
+
395
+ Here we report the experimental results for P19 in Setting 2 (Table 4) and Setting 3 (Table 5).
396
+
397
+ Table 4: Classification on samples with fixed missing sensors (P19; Setting 2)
398
+
399
+ <table><tr><td rowspan="3">Models</td><td colspan="10">Missing ratio</td></tr><tr><td colspan="2">0%</td><td colspan="2">10%</td><td colspan="2">20%</td><td colspan="2">30%</td><td colspan="2">40%</td><td colspan="2">50%</td></tr><tr><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td></tr><tr><td>Transformer</td><td>83.2 ± 1.3</td><td>47.6 ± 3.8</td><td>77.4 ± 3.5</td><td>38.2 ± 4.2</td><td>75.7 ± 3.4</td><td>35.2 ± 5.4</td><td>75.1 ± 3.5</td><td>35.5 ± 4.4</td><td>75.3 ± 3.5</td><td>36.2 ± 4.2</td><td>74.9 ± 3.1</td><td>35.5±5.0</td></tr><tr><td>Trans-mean</td><td>84.1 ± 1.7</td><td>47.4 ± 1.4</td><td>79.2 ± 2.7</td><td>40.6 ± 5.7</td><td>79.8 ± 2.5</td><td>38.3 ± 2.8</td><td>76.9 ± 2.4</td><td>37.5 ± 5.9</td><td>76.4 ± 2.0</td><td>36.3 ±5.8</td><td>74.1 ± 2.3</td><td>41.3 ± 4.7</td></tr><tr><td>GRU-D</td><td>83.9 ± 1.7</td><td>46.9 ± 2.1</td><td>79.6± 2.2</td><td>37.4 ± 2.5</td><td>77.5 ± 3.1</td><td>36.5± 4.6</td><td>76.6 ± 2.9</td><td>35.1 ± 2.4</td><td>74.6 ± 2.7</td><td>35.9±2.7</td><td>74.1 ± 2.9</td><td>33.2 ± 3.8</td></tr><tr><td>SeFT</td><td>78.7 ± 2.4</td><td>31.1 ± 2.8</td><td>77.3 ± 2.4</td><td>25.5 ± 2.3</td><td>63.5± 2.0</td><td>14.0 ± 1.1</td><td>62.3 ± 2.1</td><td>12.9 ± 1.2</td><td>57.8± 1.7</td><td>9.8 ± 1.1</td><td>56.0 ± 3.1</td><td>7.8±1.3</td></tr><tr><td>mTAND</td><td>80.4 ± 1.3</td><td>32.4 ± 1.8</td><td>79.7 ± 2.2</td><td>29.0 ± 4.3</td><td>77.8 ± 1.9</td><td>25.3 ± 2.4</td><td>77.7 ± 1.9</td><td>27.8 ± 2.6</td><td>79.4 ± 2.0</td><td>32.1 ± 2.1</td><td>77.3 ± 2.1</td><td>27.0 ± 2.5</td></tr><tr><td>RAINDROP</td><td>87.0 ± 2.3</td><td>51.8± 5.5</td><td>84.3 ± 2.5</td><td>46.1 ± 3.5</td><td>81.9 ± 2.1</td><td>45.2 ± 6.4</td><td>81.4 ± 2.1</td><td>43.7 ± 7.2</td><td>81.8±2.2</td><td>44.9 ± 6.6</td><td>79.7 ± 1.9</td><td>43.8 ± 5.6</td></tr></table>
400
+
401
+ Table 5: Classification on samples with random missing sensors (P19; Setting 3)
402
+
403
+ <table><tr><td rowspan="3">Models</td><td colspan="10">Missing ratio</td></tr><tr><td colspan="2">0%</td><td colspan="2">10%</td><td colspan="2">20%</td><td colspan="2">30%</td><td colspan="2">40%</td><td colspan="2">50%</td></tr><tr><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td></tr><tr><td>Transformer</td><td>83.2 ± 1.3</td><td>47.6 ± 3.8</td><td>82.2 ±2.7</td><td>46.8 ± 3.5</td><td>81.6± 3.5</td><td>42.5 ±8.5</td><td>81.3 ± 3.1</td><td>42.1 ± 4.5</td><td>80.2 ±2.9</td><td>41.9 ± 6.8</td><td>79.2 ± 1.9</td><td>43.7 ± 3.7</td></tr><tr><td>Trans-mean</td><td>84.1 ± 1.7</td><td>47.4 ± 1.4</td><td>82.5± 3.7</td><td>44.7 ± 6.8</td><td>81.7± 2.0</td><td>45.9 ± 3.6</td><td>81.2 ± 2.2</td><td>43.2 ± 6.3</td><td>80.2 ± 1.7</td><td>41.5 ± 4.8</td><td>79.8 ± 3.1</td><td>39.3 ± 5.1</td></tr><tr><td>GRU-D</td><td>83.9 ± 1.7</td><td>46.9 ± 2.1</td><td>81.2 ± 3.4</td><td>46.4 ± 2.7</td><td>78.6 ± 4.1</td><td>43.3 ± 2.4</td><td>76.3 ± 2.5</td><td>28.5 ± 2.1</td><td>74.2 ± 2.7</td><td>29.6± 3.1</td><td>74.6 ± 3.5</td><td>26.5± 4.2</td></tr><tr><td>SeFT</td><td>78.7 ± 2.4</td><td>31.1 ± 2.8</td><td>76.8±2.2</td><td>28.3± 2.5</td><td>77.0± 2.2</td><td>24.1 ± 2.4</td><td>75.2 ± 2.2</td><td>22.5±3.0</td><td>73.6± 2.7</td><td>18.3±3.2</td><td>72.6 ± 2.5</td><td>15.7 ± 1.9</td></tr><tr><td>mTAND</td><td>80.4 ± 1.3</td><td>32.4 ± 1.8</td><td>75.2± 2.5</td><td>24.5 ± 2.4</td><td>74.4 ± 3.5</td><td>24.6± 3.5</td><td>74.2 ± 3.2</td><td>22.6 ± 2.3</td><td>74.1 ± 2.6</td><td>23.1± 3.6</td><td>73.9 ± 3.7</td><td>24.6 ± 3.7</td></tr><tr><td>RAINDROP</td><td>87.0 ± 2.3</td><td>51.8 ± 5.5</td><td>85.5± 2.1</td><td>50.2±5.5</td><td>83.5±3.2</td><td>47.4± 7.0</td><td>83.1 ±1.5</td><td>48.2 ±4.7</td><td>82.6 ± 1.7</td><td>48.0 ±5.5</td><td>80.9 ± 2.4</td><td>45.2 ± 6.9</td></tr></table>
404
+
405
+ Table 6: Comparison of results when excluding dependency graph in RAINDROP (P19; Setting 4). The results are the same as in Table 8 except the row of ‘RAINDROP w/o graph’, where we do not consider inter-sensor dependencies and set all sensors as independent in the dependency graph.
406
+
407
+ <table><tr><td rowspan="3">Model</td><td colspan="8">Generalizing to a new patient group</td></tr><tr><td colspan="2">Train: Young→ Test: Old</td><td colspan="2">Train: Old→Test: Young</td><td colspan="2">Train: Male → Test: Female</td><td colspan="2">Train: Female → Test: Male</td></tr><tr><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td></tr><tr><td>Transformer</td><td>76.2 ± 0.7</td><td>30.5±4.8</td><td>76.5 ± 1.1</td><td>33.7 ± 5.7</td><td>77.8 ± 1.1</td><td>26.0±6.2</td><td>75.2 ± 1.0</td><td>30.3 ± 5.5</td></tr><tr><td>Trans-mean</td><td>80.6 ±1.4</td><td>39.8 ± 4.2</td><td>78.4 ±1.1</td><td>35.8±2.9</td><td>80.2 ± 1.7</td><td>32.1 ± 1.9</td><td>76.4±0.8</td><td>32.5±3.3</td></tr><tr><td>GRU-D</td><td>76.5 ± 1.7</td><td>29.5 ± 2.3</td><td>79.6 ±1.7</td><td>35.2 ± 4.6</td><td>78.5 ± 1.6</td><td>31.9 ± 4.8</td><td>76.3 ±2.5</td><td>31.1 ± 2.6</td></tr><tr><td>SeFT</td><td>77.5 ± 0.7</td><td>26.6 ± 1.2</td><td>78.9 ±1.0</td><td>32.7 ±2.7</td><td>78.6 ±0.6</td><td>31.1 ± 1.2</td><td>76.9 ± 0.5</td><td>26.4 ± 1.1</td></tr><tr><td>mTAND</td><td>79.0 ±0.8</td><td>28.8± 2.3</td><td>79.4±0.6</td><td>29.8 ±1.2</td><td>78.0 ±0.9</td><td>26.5 ±1.7</td><td>78.9 ±1.2</td><td>29.2 ± 2.0</td></tr><tr><td>RAINDROP W/o graph</td><td>80.5 ± 1.1</td><td>31.6 ± 2.1</td><td>78.5±0.9</td><td>36.7 ±2.7</td><td>81.3 ±1.5</td><td>36.8±1.7</td><td>77.5 ± 1.9</td><td>33.4 ± 2.6</td></tr><tr><td>RAINDROP</td><td>83.2 ± 1.6</td><td>43.6 ± 4.7</td><td>82.0 ± 4.4</td><td>44.3 ± 3.6</td><td>85.0 ± 1.4</td><td>45.2 ± 2.9</td><td>81.2 ± 3.8</td><td>40.7 ± 2.9</td></tr></table>
408
+
409
+ Table 7: Results of ablation study on the PAM dataset (Setting 1).
410
+
411
+ <table><tr><td colspan="2">RAINDROP Model</td><td>Accuracy</td><td>Precision</td><td>Recall</td><td>F1 score</td></tr><tr><td colspan="2">W/o weights vector Ru</td><td>81.1 ± 2.6</td><td>81.9 ± 2.4</td><td>80.1 ± 1.6</td><td>81.6± 2.1</td></tr><tr><td rowspan="3">W/o inter-sensor dependency</td><td>W/o ei,uv</td><td>82.6± 1.2</td><td>82.9± 1.6</td><td>84.3± 1.4</td><td>83.8± 1.7</td></tr><tr><td>W/oru W/op</td><td>86.5 ± 2.4</td><td>83.3 ± 1.9</td><td>82.6± 1.5</td><td>82.9 ± 1.4</td></tr><tr><td>Wloau</td><td>79.8 ± 2.7 85.2 ± 2.5</td><td>80.1 ± 3.6 86.4 ± 2.7</td><td>80.6 ± 1.7 84.5 ± 2.9</td><td>80.2 ± 2.9 85.6 ± 2.9</td></tr><tr><td colspan="2">W/o temporal attention</td><td>81.5 ± 1.9</td><td>84.6± 1.7</td><td>83.9 ± 2.5</td><td></td></tr><tr><td colspan="2">W/o sensor level concatenation</td><td>84.4 ± 2.1</td><td>86.7± 1.1</td><td>85.2± 1.9</td><td>84.2 ± 2.2</td></tr><tr><td colspan="2">W/o regularization term Lr</td><td>87.3 ± 2.9</td><td>88.6± 3.4</td><td>87.1± 2.8</td><td>85.8± 2.6</td></tr><tr><td colspan="2">Full RAINDROP</td><td>88.5±1.5</td><td>89.9±1.5</td><td>89.9±0.6</td><td>87.6 ± 3.1 89.8±1.0</td></tr></table>
412
+
413
+ A.13 EVALUATION ON GROUP-WISE TIME SERIES CLASSIFICATION
414
+
415
+ To understand whether RAINDROP can adaptively adjust its structure and generalize well to other groups of samples which were not observed while training the model. In this setting we split the data into two groups, based on a specific static attribute. The first split attribute is age, where we classify people into young $\mathit { \Theta } _ { \mathrm { . } } < 6 5$ years) and old $\geq 6 5$ years) groups. We also split patients into male and female by gender attribute. Given the split attribute, we use one group as a train set and randomly split the other group into equally sized validation and test set.
416
+
417
+ Taking P19 as an example, we present the classification results when the training and testing samples are from different groups. As shown in Table 8, RAINDROP achieves the best results over all of the four given cross-group scenarios. For instance, RAINDROP claims large margins (with $4 . 8 \%$ i n AUROC and $1 3 . 1 \%$ in AUPRC absolute improvement) over the second best model while training on males and testing on female patients.
418
+
419
+ Although RAINDROP is not designed to address domain adaptation explicitly, the results show that RAINDROP performs better than baselines when transferring from one group of samples to another. One reason for our good performance is that the learned inter-sensor weights and dependency graphs are sample-specific and their learning is based on the sample’s observations. Thus, the proposed RAINDROP has the power, to some extent, to adaptively learn the inter-sensor dependencies based on the test sample’s measurements. RAINDROP is not generalizing to new groups, but generalizing to new samples, which leads to a good performance even though our model is not designed for domain adaptation. We validate the reason empirically. We remove the inter-sensor dependencies (set all sensors isolated in the dependency graph; set all $\underset { - , } { \alpha _ { i , u v } ^ { t } }$ and $e _ { i , u v } ^ { t }$ as 0) in RAINDROP and evaluate the model in group-wise time series classification. The experimental results show that the performance drops a lot when excluding dependency graphs and message passing in RAINDROP (Table 6). Without inter-sensor dependencies our model is on par with other baselines and does not outperform them by a large margin.
420
+
421
+ ![](images/007c1e0a374020f33047538d0e94782457ad396cfa80dccc9fe0d7e8d422c6c5.jpg)
422
+ Figure 4: Learned structure for negative and positive samples (P19; Setting 1). The nodes numbered from 0 to 33 denote 34 sensors used in P19 (sensor names are listed in Appendix A.15). To make the visualized structures easier to understand, we use darker green to denote higher weight value and yellow to denote lower weight value. We can observe distinguishable patterns across two learned sensor dependency graphs, indicating RAINDROP is able to adaptively learn graph structures that are sensitive to the classification task. For example, we find that the nodes 1 (pulse oximetry), 5 (diastolic BP), and 12 (partial pressure of carbon dioxide from arterial blood) have lower weights in negative samples.
423
+
424
+ Table 8: Classification results when train and test samples originate from different groups (P19).
425
+
426
+ <table><tr><td rowspan="3">Model</td><td colspan="8">Generalizing to anew patient group</td></tr><tr><td colspan="2">Train: Young → Test: Old</td><td colspan="2">Train: Old → Test: Young</td><td colspan="2">Train: Male → Test: Female</td><td colspan="2">Train: Female → Test: Male</td></tr><tr><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td></tr><tr><td>Transformer</td><td>76.2± 0.7</td><td>30.5± 4.8</td><td>76.5 ± 1.1</td><td>33.7±5.7</td><td>77.8 ± 1.1</td><td>26.0±6.2</td><td>75.2 ±1.0</td><td>30.3±5.5</td></tr><tr><td>Trans-mean</td><td>80.6 ± 1.4</td><td>39.8±4.2</td><td>78.4 ±1.1</td><td>35.8±2.9</td><td>80.2±1.7</td><td>32.1 ± 1.9</td><td>76.4 ±0.8</td><td>32.5±3.3</td></tr><tr><td>GRU-D</td><td>76.5 ± 1.7</td><td>29.5±2.3</td><td>79.6 ±1.7</td><td>35.2± 4.6</td><td>78.5±1.6</td><td>31.9 ± 4.8</td><td>76.3 ± 2.5</td><td>31.1 ± 2.6</td></tr><tr><td>SeFT</td><td>77.5 ± 0.7</td><td>26.6±1.2</td><td>78.9 ±1.0</td><td>32.7±2.7</td><td>78.6±0.6</td><td>31.1 ± 1.2</td><td>76.9 ± 0.5</td><td>26.4 ± 1.1</td></tr><tr><td>mTAND</td><td>79.0±0.8</td><td>28.8±2.3</td><td>79.4±0.6</td><td>29.8± 1.2</td><td>78.0±0.9</td><td>26.5±1.7</td><td>78.9 ± 1.2</td><td>29.2 ± 2.0</td></tr><tr><td>RAINDROP</td><td>83.2 ± 1.6</td><td>43.6± 4.7</td><td>82.0 ± 4.4</td><td>44.3 ± 3.6</td><td>85.0 ± 1.4</td><td>45.2 ± 2.9</td><td>81.2± 3.8</td><td>40.7± 2.9</td></tr></table>
427
+
428
+ # A.14 FURTHER DETAILS ON ABLATION STUDY
429
+
430
+ We provide ablation study, taking PAM at Setting 1 as an example, in Table 7. In the setup of ‘W/o sensor level concatenation’, we take the average of all sensor embeddings (in stead of concatenating them together) to obtain sample embedding. Experimental results show that the full RAINDROP model achieves the best performance, indicating every component or designed structure is useful to the model. For example, we find that excluding inter-sensor attention weights $\alpha _ { i , u v } ^ { t }$ will cause a decrease of $3 . 9 \%$ in accuracy while excluding edge weights $e _ { i , u v }$ (i.e., dependency graphs) will drop the accuracy by $7 . 1 \%$ .
431
+
432
+ # A.15 VISUALIZATION OF INTER-SENSOR DEPENDENCY GRAPHS LEARNED BY RAINDROP
433
+
434
+ We visualize the learned inter-sensor dependencies (i.e., $e _ { i , u v }$ before the averaging operation in Eq. 3) on P19 in early sepsis prediction. The visualizations are implemented with Cytoscape (Shannon et al., 2003). The data shown are for testing set of P19 including 3,881 samples (3708 negative and 173 positive). As RAINDROP learns the specific graph for each sample, we take average of all positive samples and visualize it in Figure $^ { 4 \mathrm { b } }$ ; and visualize the average of all negative samples in Figure 4b. As we take average, the edges with weights smaller than 0.1 (means they rarely appear in graphs) are ignored. The averaged edge weights range from 0.1 to 1. We initialize all sample graphs as complete graph that has $1 , 1 5 6 = 3 4 \times 3 4$ edges, then prune out $50 \%$ of them in training phase, remaining 578 edges. The 34 nodes in figures denote 34 sensors measured in P19, as listed https://physionet.org/content/challenge-2019/1.0.0/. We list the sensor names here: 0: HR; 1: O2Sat; 2: Temp; 3: SBP; 4: MAP; 5: DBP; 6: Resp; 7: EtCO2; 8: BaseExcess; 9: HCO3; 10: FiO2; 11: pH; 12: PaCO2; 13: SaO2; 14: AST; 15: BUN; 16: Alkalinephos; 17: Calcium; 18: Chloride; 19: Creatinine; 20: Bilirubin_direct; 21: Glucose; 22: Lactate; 23: Magnesium; 24: Phosphate; 25: Potassium; 26: Bilirubin_total; 27: TroponinI; 28: Hct; 29: Hgb; 30: PTT; 31: WBC; 32: Fibrinogen; 33: Platelets.
435
+
436
+ ![](images/72ee3d159466a288b91041899e5822b2925c7ba60ac18f270ac17093e64b45b3.jpg)
437
+ Figure 5: Differential structure of dependency graphs between positive and negative samples. The edges are directed. We select the top 50 edges with largest difference (in absolute value) between two patterns. The edges are colored by the divergences. The darker color denotes the connection is more crucial to classification task. Node 0 is not included in this figure as it is not connected with any sensor. We can infer that the heart rate is stable whether the patient will get sepsis or not. Moreover, we can see the edge from node 3 (systolic BP) to node 13 (Oxygen saturation from arterial blood) and the connection from node 6 (Respiration rate) to node 25 (Potassium) are informative for distinguishing sample classes.
438
+
439
+ We also visualize the differential inter-sensor connections between the learned dependency graphs from patients who are likely to have sepsis and the graphs from patients who are unlikely to suffer from sepsis. Based on the aggregated graph structures of positive and negative samples, we calculate the divergence between two groups of patients and report the results in Figure 5. In detail, we sort edges by the absolute difference of edge weights across negative and positive samples. On top of the visualization of the 50 most distinctive edges, we can have a series of concrete insights. For example, the dependency between node 6 (Respiration rate) to node 25 (Potassium) is important to the early prediction of sepsis. Note these data-driven observations could be biased and still need confirmation and future analysis from healthcare professionals. The edges in both Figure 4 and Figure 5 are directed. The edge arrows might be difficult to recognize due to the small figure size. We will provide high-resolution figures to our public repository.
440
+
441
+ Furthermore, we statistically measure the similarities across samples within the same class and dissimilarities across samples from different classes. Specifically, for every sample, we calculate: 1) the average Euclidean distance between its dependency graph and the dependency graphs of all samples from the same class; 2) the average distance with all samples from the different classes. The P19 dataset has 38,803 samples including 1,623 positive samples and 37,180 negative samples. For a fair comparison, we randomly select 1,623 samples from the negative cohort, then mixed them with an equal number of positive samples to measure the averaged Euclidean distances intra- and inter-classes. We select the cohort for 5 independent times with replacement. We find that the distance $( ( 8 . 6 \pm 1 . 7 ) \times 1 0 ^ { - 5 } )$ among dependency graphs of positive samples is smaller than the distance $( \left( 1 2 . 9 \pm 3 . 1 \right) \times 1 0 ^ { - 5 } ,$ ) across samples. The results show that the learned dependency graphs are similar within the same class and dissimilar across classes, which demonstrates RAINDROP can learn label-sensitive dependency graphs.
parse/dev/Kwm8I7dU-l5/Kwm8I7dU-l5_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Kwm8I7dU-l5/Kwm8I7dU-l5_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Kwm8I7dU-l5/Kwm8I7dU-l5_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RwzFNbJ3Ez/RwzFNbJ3Ez.md ADDED
@@ -0,0 +1,484 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SELFCHECKGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models
2
+
3
+ Potsawee Manakul, Adian Liusie, Mark J. F. Gales ALTA Institute, Department of Engineering, University of Cambridge pm574@cam.ac.uk, al826@cam.ac.uk, mjfg@eng.cam.ac.uk
4
+
5
+ # Abstract
6
+
7
+ Generative Large Language Models (LLMs) such as GPT-3 are capable of generating highly fluent responses to a wide variety of user prompts. However, LLMs are known to hallucinate facts and make non-factual statements which can undermine trust in their output. Existing fact-checking approaches either require access to the output probability distribution (which may not be available for systems such as ChatGPT) or external databases that are interfaced via separate, often complex, modules. In this work, we propose "SelfCheckGPT", a simple sampling-based approach that can be used to fact-check the responses of black-box models in a zero-resource fashion, i.e. without an external database. SelfCheckGPT leverages the simple idea that if an LLM has knowledge of a given concept, sampled responses are likely to be similar and contain consistent facts. However, for hallucinated facts, stochastically sampled responses are likely to diverge and contradict one another. We investigate this approach by using GPT-3 to generate passages about individuals from the WikiBio dataset, and manually annotate the factuality of the generated passages. We demonstrate that SelfCheckGPT can: i) detect non-factual and factual sentences; and ii) rank passages in terms of factuality. We compare our approach to several baselines and show that our approach has considerably higher AUC-PR scores in sentence-level hallucination detection and higher correlation scores in passage-level factuality assessment compared to grey-box methods.1
8
+
9
+ # 1 Introduction
10
+
11
+ Large Language Models (LLMs) such as GPT-3 (Brown et al., 2020) and PaLM (Chowdhery et al., 2022) are capable of generating fluent and realistic responses to a variety of user prompts. They have been used in many applications such as automatic tools to draft reports, virtual assistants and summarization systems. Despite the convincing and realistic nature of LLM-generated texts, a growing concern with LLMs is their tendency to hallucinate facts. It has been widely observed that models can confidently generate fictitious information, and worryingly there are few, if any, existing approaches to suitably identify LLM hallucinations.
12
+
13
+ ![](images/cb5b8e1a0741e26960754843b50e591e6f027e4dc52a21d2076b47ba9a079266.jpg)
14
+ Figure 1: SelfCheckGPT with Prompt. Each LLM-generated sentence is compared against stochastically generated responses with no external database. A comparison method can be, for example, through LLM prompting as shown above.
15
+
16
+ A possible approach of hallucination detection is to leverage existing intrinsic uncertainty metrics to determine the parts of the output sequence that the system is least certain of (Yuan et al., 2021; Fu et al., 2023). However, uncertainty metrics such as token probability or entropy require access to token-level probability distributions, information which may not be available to users for example when systems are accessed through limited external APIs. An alternate approach is to leverage fact-verification approaches, where evidence is retrieved from an external database to assess the veracity of a claim (Thorne et al., 2018; Guo et al., 2022). However, facts can only be assessed relative to the knowledge present in the database. Additionally, hallucinations are observed over a wide range of tasks beyond pure fact verification (Kryscinski et al., 2020; Maynez et al., 2020).
17
+
18
+ In this paper, we propose SelfCheckGPT, a sampling-based approach that can detect whether responses generated by LLMs are hallucinated or factual. To the best of our knowledge, SelfCheckGPT is the first work to analyze model hallucination of general LLM responses, and is the first zero-resource hallucination detection solution that can be applied to black-box systems. The motivating idea of SelfCheckGPT is that when an LLM has been trained on a given concept, the sampled responses are likely to be similar and contain consistent facts. However, for hallucinated facts, stochastically sampled responses are likely to diverge and may contradict one another. By sampling multiple responses from an LLM, one can measure information consistency between the different responses and determine if statements are factual or hallucinated. Since SelfCheckGPT only leverages sampled responses, it has the added benefit that it can be used for black-box models, and it requires no external database. Five variants of SelfCheckGPT for measuring informational consistency are considered: BERTScore, question-answering, $n$ -gram, NLI, and LLM prompting. Through analysis of annotated articles generated by GPT-3, we show that SelfCheckGPT is a highly effective hallucination detection method that can even outperform greybox methods, and serves as a strong first baseline for an increasingly important problem of LLMs.
19
+
20
+ # 2 Background and Related Work
21
+
22
+ # 2.1 Hallucination of Large Language Models
23
+
24
+ Hallucination has been studied in text generation tasks, including summarization (Huang et al., 2021) and dialogue generation (Shuster et al., 2021), as well as in a variety of other natural language generation tasks (Ji et al., 2023). Self-consistency decoding has shown to improve chain-of-thought prompting performance on complex reasoning tasks (Wang et al., 2023). Further, Liu et al. (2022) introduce a hallucination detection dataset, however, texts are obtained by perturbing factual texts and thus may not reflect true LLM hallucination.
25
+
26
+ Recently, Azaria and Mitchell (2023) trained a multi-layer perception classifier where an LLM’s hidden representations are used as inputs to predict the truthfulness of a sentence. However, this approach is a white-box approach that uses the internal states of the LLM, which may not be available through API calls, and requires labelled data for supervised training. Another recent approach is self-evaluation (Kadavath et al., 2022), where an LLM is prompted to evaluate its previous prediction, e.g., to predict the probability that its generated response/answer is true.
27
+
28
+ # 2.2 Sequence Level Uncertainty Estimation
29
+
30
+ Token probabilities have been used as an indication of model certainty. For example, OpenAI’s GPT-3 web interface allows users to display token probabilities (as shown in Figure 2), and further uncertainty estimation approaches based on aleatoric and epistemic uncertainty have been studied for autoregressive generation (Xiao and Wang, 2021; Malinin and Gales, 2021). Additionally, conditional language model scores have been used to evaluate properties of texts (Yuan et al., 2021; Fu et al., 2023). Recently, semantic uncertainty has been proposed to address uncertainty in free-form generation tasks where probabilities are attached to concepts instead of tokens (Kuhn et al., 2023).
31
+
32
+ ![](images/7f901ce3f147814de99104bb70cc498151c6324518852cd270c1a5c521c4cfda.jpg)
33
+ Figure 2: Example of OpenAI’s GPT-3 web interface with output token-level probabilities displayed.
34
+
35
+ # 2.3 Fact Verification
36
+
37
+ Existing fact-verification approaches follow a multi-stage pipeline of claim detection, evidence retrieval and verdict prediction (Guo et al., 2022; Zhong et al., 2020). Such methods, however, require access to external databases and can have considerable inference costs.
38
+
39
+ # 3 Grey-Box Factuality Assessment
40
+
41
+ This section will introduce methods that can be used to determine the factuality of LLM responses in a zero-resource setting when one has full access to output distributions.2 We will use ‘factual’ to define when statements are grounded in valid information, i.e. when hallucinations are avoided, and ‘zero-resource’ when no external database is used.
42
+
43
+ # 3.1 Uncertainty-based Assessment
44
+
45
+ To understand how the factuality of a generated response can be determined in a zero-resource setting, we consider LLM pre-training. During pretraining, the model is trained with next-word prediction over massive corpora of textual data. This gives the model a strong understanding of language (Jawahar et al., 2019; Raffel et al., 2020), powerful contextual reasoning (Zhang et al., 2020), as well as world knowledge (Liusie et al., 2023). Consider the input "Lionel Messi is a _". Since Messi is a world-famous athlete who may have appeared multiple times in pre-training, the LLM is likely to know who Messi is. Therefore given the context, the token "footballer" may be assigned a high probability while other professions such as "carpenter" may be considered improbable. However, for a different input such as "John Smith is a _", the system will be unsure of the continuation which may result in a flat probability distribution. During inference, this is likely to lead to a non-factual word being generated.
46
+
47
+ This insight allows us to understand the connection between uncertainty metrics and factuality. Factual sentences are likely to contain tokens with higher likelihood and lower entropy, while hallucinations are likely to come from positions with flat probability distributions with high uncertainty.
48
+
49
+ # Token-level Probability
50
+
51
+ Given the LLM’s response $R$ , let $i$ denote the $i$ -th sentence in $R , j$ denote the $j$ -th token in the $i$ -th sentence, $J$ is the number of tokens in the sentence, and $p _ { i j }$ be the probability of the word generated by the LLM at the $j$ -th token of the $i$ -th sentence. Two probability metrics are used:
52
+
53
+ $$
54
+ \begin{array} { l } { \displaystyle \mathrm { A v g } ( - \log p ) = - \frac { 1 } { J } \sum _ { j } \log p _ { i j } } \\ { \displaystyle \mathrm { M a x } ( - \log p ) = \operatorname* { m a x } _ { j } ( - \log p _ { i j } ) } \end{array}
55
+ $$
56
+
57
+ $\mathbf { M a x } ( - \log p )$ measures the sentence’s likelihood by assessing the least likely token in the sentence.
58
+
59
+ # Entropy
60
+
61
+ The entropy of the output distribution is:
62
+
63
+ $$
64
+ \mathcal { H } _ { i j } = - \sum _ { \tilde { w } \in \mathcal { W } } p _ { i j } ( \tilde { w } ) \log p _ { i j } ( \tilde { w } )
65
+ $$
66
+
67
+ where $p _ { i j } ( \tilde { w } )$ is the probability of the word $\tilde { w }$ being generated at the $j$ -th token of the $i$ -th sentence, and $\mathcal { W }$ is the set of all possible words in the vocabulary. Similar to the probability-based metrics, two entropy-based metrics are used:
68
+
69
+ $$
70
+ \operatorname { A v g } ( \mathcal { H } ) = \frac { 1 } { J } \sum _ { j } \mathcal { H } _ { i j } ; \quad \operatorname { M a x } ( \mathcal { H } ) = \operatorname* { m a x } _ { j } ( \mathcal { H } _ { i j } )
71
+ $$
72
+
73
+ # 4 Black-Box Factuality Assessment
74
+
75
+ A drawback of grey-box methods is that they require output token-level probabilities. Though this may seem a reasonable requirement, for massive LLMs only available through limited API calls, such token-level information may not be available (such as with ChatGPT). Therefore, we consider black-box approaches which remain applicable even when only text-based responses are available.
76
+
77
+ # Proxy LLMs
78
+
79
+ A simple approach to approximate the grey-box approaches is by using a proxy LLM, i.e. another LLM that we have full access to, such as LLaMA (Touvron et al., 2023). A proxy LLM can be used to approximate the output token-level probabilities of the black-box LLM generating the text. In the next section, we propose SelfCheckGPT, which is also a black-box approach.
80
+
81
+ # 5 SelfCheckGPT
82
+
83
+ SelfCheckGPT is our proposed black-box zeroresource hallucination detection scheme, which operates by comparing multiple sampled responses and measuring consistency.
84
+
85
+ Notation: Let $R$ refer to an LLM response drawn from a given user query. SelfCheckGPT draws a further $N$ stochastic LLM response samples $\{ S ^ { 1 } , S ^ { 2 } , . . . , S ^ { n } , . . . , S ^ { N } \}$ using the same query, and then measures the consistency between the response and the stochastic samples. We design SelfCheckGPT to predict the hallucination score of the $i$ -th sentence, $\boldsymbol { S } ( i )$ , such that $S ( i ) \in [ 0 . 0 , 1 . 0 ]$ where ${ \cal S } ( i ) 0 . 0$ if the $i$ -th sentence is grounded in valid information and ${ \cal S } ( i ) 1 . 0$ if the $i$ -th sentence is hallucinated.3 The following subsections will describe each of the SelfCheckGPT variants.
86
+
87
+ # 5.1 SelfCheckGPT with BERTScore
88
+
89
+ Let $\textstyle B ( . , . )$ denote the BERTScore between two sentences. SelfCheckGPT with BERTScore finds the average BERTScore of the $i$ -th sentence with the most similar sentence from each drawn sample:
90
+
91
+ $$
92
+ S _ { \mathrm { B E R T } } ( i ) = 1 - \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \operatorname* { m a x } _ { k } \left( \mathcal { B } ( r _ { i } , s _ { k } ^ { n } ) \right)
93
+ $$
94
+
95
+ where $r _ { i }$ repr ents the $i$ -th sente e in $R$ and $s _ { k } ^ { n }$ $k$ $n$ $S ^ { n }$ This way if the information in a sentence appears in many drawn samples, one may assume that the information is factual, whereas if the statement appears in no other sample, it is likely a hallucination. In this work, RoBERTa-Large (Liu et al., 2019) is used as the backbone of BERTScore.
96
+
97
+ # 5.2 SelfCheckGPT with Question Answering
98
+
99
+ We also consider using the automatic multiplechoice question answering generation (MQAG) framework (Manakul et al., 2023) to measure consistency for SelfCheckGPT. MQAG assesses consistency by generating multiple-choice questions over the main generated response, which an independent answering system can attempt to answer while conditioned on the other sampled responses. If questions on consistent information are queried, the answering system is expected to predict similar answers. MQAG consists of two stages: question generation G and question answering A. For the sentence $r _ { i }$ in the response $R$ , we draw questions $q$ and options $\mathbf { o }$ :
100
+
101
+ $$
102
+ { q , \mathbf { o } } \sim P _ { \mathtt { G } } ( q , \mathbf { o } | r _ { i } , R )
103
+ $$
104
+
105
+ The answering stage A selects the answers:
106
+
107
+ $\frac { N _ { \mathrm { n } } } { N _ { \mathrm { m } } + N _ { \mathrm { n } } }$ . To take into account the answerability of generated questions, we show in Appendix B that we can modify the inconsistency score by applying soft-counting, resulting in:
108
+
109
+ $$
110
+ \mathcal { S } _ { \mathrm { Q A } } ( i , q ) = \frac { \gamma _ { 2 } ^ { N _ { \mathrm { n } } ^ { \prime } } } { \gamma _ { 1 } ^ { N _ { \mathrm { n } } ^ { \prime } } + \gamma _ { 2 } ^ { N _ { \mathrm { n } } ^ { \prime } } }
111
+ $$
112
+
113
+ where $N _ { \mathtt { m } } ^ { \prime } =$ the effective match count, $N _ { \mathbf { n } } ^ { \prime } =$ the effective mismatch count, with $\gamma _ { 1 }$ and $\gamma _ { 2 }$ defined in Appendix B.1. Ultimately, SelfCheckGPT with QA is the average of inconsistency scores across $q$
114
+
115
+ $$
116
+ S _ { \mathrm { Q A } } ( i ) = \mathbb { E } _ { q } \left[ S _ { \mathrm { Q A } } ( i , q ) \right]
117
+ $$
118
+
119
+ # 5.3 SelfCheckGPT with n-gram
120
+
121
+ Given samples $\{ S ^ { 1 } , . . . , S ^ { N } \}$ generated by an LLM, one can use the samples to create a new language model that approximates the LLM. In the limit as $N$ gets sufficiently large, the new language model will converge to the LLM that generated the responses. We can therefore approximate the LLM’s token probabilities using the new language model.
122
+
123
+ In practice, due to time and/or cost constraints, there can only be a limited number of samples $N$ . Consequently, we train a simple $n$ -gram model using the samples $\{ S ^ { 1 } , . . . , S ^ { N } \}$ as well as the main response $R$ (which is assessed), where we note that including $R$ can be considered as a smoothing method where the count of each token in $R$ is increased by 1. We then compute the average of the log-probabilities of the sentence in response $R$ ,
124
+
125
+ $$
126
+ \mathcal { S } _ { n \mathrm { - g r a m } } ^ { \mathrm { A v g } } ( i ) = - \frac { 1 } { J } \sum _ { j } \log \tilde { p } _ { i j }
127
+ $$
128
+
129
+ where $\tilde { p } _ { i j }$ is the probability (of the $j$ -th token of the $i$ -th sentence) computed using the $n$ -gram model. Similar to the grey-box approach, we can also use the maximum of the negative log probabilities,
130
+
131
+ $$
132
+ \begin{array} { r } { a _ { R } = \underset { k } { \arg \operatorname* { m a x } } \left[ P _ { \mathrm { A } } ( o _ { k } | q , R , \mathbf { o } ) \right] } \\ { a _ { S ^ { n } } = \underset { k } { \arg \operatorname* { m a x } } \left[ P _ { \mathrm { A } } ( o _ { k } | q , S ^ { n } , \mathbf { o } ) \right] } \end{array}
133
+ $$
134
+
135
+ We compare whether $a _ { R }$ is equal to $a _ { S ^ { n } }$ for each sample in $\{ S ^ { 1 } , . . . , S ^ { N } \}$ , yielding #matches $N _ { \mathtt { m } }$ and #not-matches $N _ { \mathbf { n } }$ . A simple inconsistency score for the $i$ -th sentence and question $q$ based on the match/not-match counts is defined: $S _ { \mathrm { Q A } } ( i , q ) =$
136
+
137
+ $$
138
+ S _ { n \mathrm { - g r a m } } ^ { \mathrm { M a x } } ( i ) = \operatorname* { m a x } _ { j } ( - \log \tilde { p } _ { i j } )
139
+ $$
140
+
141
+ # 5.4 SelfCheckGPT with NLI
142
+
143
+ Natural Language Inference (NLI) determines whether a hypothesis follows a premise, classified into either entailment/neutral/contradiction. NLI measures have been used to measure faithfulness in summarization, where Maynez et al. (2020) use a textual entailment classifier trained on MNLI (Williams et al., 2018) to determine if a summary contradicts a context or not. Inspired by NLI-based summary assessment, we consider using the NLI contradiction score as a SelfCheckGPT score.
144
+
145
+ For SelfCheck-NLI, we use DeBERTa-v3-large (He et al., 2023) fine-tuned to MNLI as the NLI model. The input for NLI classifiers is typically the premise concatenated to the hypothesis, which for our methodology is the sampled passage $S ^ { n }$ concatenated to the sentence to be assessed $r _ { i }$ Only the logits associated with the ‘entailment’ and ‘contradiction’ classes are considered,
146
+
147
+ $$
148
+ P ( \mathrm { c o n t r a d i c t } | r _ { i } , S ^ { n } ) = \frac { \exp ( z _ { c } ) } { \exp ( z _ { e } ) + \exp ( z _ { c } ) }
149
+ $$
150
+
151
+ where $z _ { e }$ and $z _ { c }$ are the logits of the ‘entailment’ and ‘contradiction’ classes, respectively. This normalization ignores the neutral class and ensures that the probability is bounded between 0.0 and 1.0. The SelfCheckGPT with NLI score for each sample $S ^ { n }$ is then defined as,
152
+
153
+ $$
154
+ \mathcal { S } _ { \mathrm { N L I } } ( i ) = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } P ( \mathrm { c o n t r a d i c t } | r _ { i } , S ^ { n } )
155
+ $$
156
+
157
+ # 5.5 SelfCheckGPT with Prompt
158
+
159
+ LLMs have recently been shown to be effective in assessing information consistency between a document and its summary in zero-shot settings (Luo et al., 2023). Thus, we query an LLM to assess whether the $i$ -th sentence is supported by sample $S ^ { n }$ (as the context) using the following prompt.
160
+
161
+ Context: {}
162
+ Sentence: {}
163
+ Is the sentence supported by the context above?
164
+ Answer Yes or No:
165
+
166
+ Initial investigation showed that GPT-3 (textdavinci-003) will output either Yes or $N o 9 8 \%$ of the time, while any remaining outputs can be set to N/A. The output from prompting when comparing the $i$ -th sentence against sample $S ^ { n }$ is converted to score $\boldsymbol { x } _ { i } ^ { n }$ through the mapping {Yes: 0.0, No: 1.0, N/A: 0.5}. The final inconsistency score is then calculated as:
167
+
168
+ $$
169
+ S _ { \mathrm { { P r o m p t } } } ( i ) = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } x _ { i } ^ { n }
170
+ $$
171
+
172
+ SelfCheckGPT-Prompt is illustrated in Figure 1. Note that our initial investigations found that less capable models such as GPT-3 (text-curie-001) or LLaMA failed to effectively perform consistency assessment via such prompting.
173
+
174
+ # 6 Data and Annotation
175
+
176
+ As, currently, there are no standard hallucination detection datasets available, we evaluate our hallucination detection approaches by 1) generating synthetic Wikipedia articles using GPT-3 on the individuals/concepts from the WikiBio dataset (Lebret et al., 2016); 2) manually annotating the factuality of the passage at a sentence level; 3) evaluating the system’s ability to detect hallucinations.
177
+
178
+ WikiBio is a dataset where each input contains the first paragraph (along with tabular information) of Wikipedia articles of a specific concept. We rank the WikiBio test set in terms of paragraph length and randomly sample 238 articles from the top $20 \%$ of longest articles (to ensure no very obscure concept is selected). GPT-3 (text-davinci-003) is then used to generate Wikipedia articles on a concept, using the prompt "This is a Wikipedia passage about {concept}:". Table 1 provides the statistics of GPT-3 generated passages.
179
+
180
+ Table 1: The statistics of WikiBio GPT-3 dataset where the number of tokens is based on the OpenAI GPT-2 tokenizer.
181
+
182
+ <table><tr><td>#Passages</td><td>#Sentences</td><td>#Tokens/passage</td></tr><tr><td>238</td><td>1908</td><td>184.7±36.9</td></tr></table>
183
+
184
+ We then annotate the sentences of the generated passages using the guidelines shown in Figure 3 such that each sentence is classified as either:
185
+
186
+ • Major Inaccurate (Non-Factual, 1): The sentence is entirely hallucinated, i.e. the sentence is unrelated to the topic.
187
+
188
+ • Minor Inaccurate (Non-Factual, 0.5): The sentence consists of some non-factual information, but the sentence is related to the topic.
189
+
190
+ • Accurate (Factual, 0): The information presented in the sentence is accurate.
191
+
192
+ Of the 1908 annotated sentences, 761 $( 3 9 . 9 \% )$ of the sentences were labelled major-inaccurate, 631 $( 3 3 . 1 \% )$ minor-inaccurate, and 516 $( 2 7 . 0 \% )$ accurate. 201 sentences in the dataset had annotations from two different annotators. To obtain a single label for this subset, if both annotators agree, then the agreed label is used. However, if there is disagreement, then the worse-case label is selected (e.g., {minor inaccurate, major inaccurate} is mapped to major inaccurate). The inter-annotator agreement, as measured by Cohen’s $\kappa$ (Cohen, 1960), has $\kappa$ values of 0.595 and 0.748, indicating moderate and substantial agreement (Viera et al., 2005) for the 3-class and 2-class scenarios, respectively.4
193
+
194
+ ![](images/e8dabeb060075a7ae0131b9109e3c4d97a5c84971c8014294136e1df318e4f60.jpg)
195
+ Figure 3: Flowchart of our annotation process
196
+
197
+ Furthermore, passage-level scores are obtained by averaging the sentence-level labels in each passage. The distribution of passage-level scores is shown in Figure 4, where we observe a large peak at $+ 1 . 0$ . We refer to the points at this peak as total hallucination, which occurs when the information of the response is unrelated to the real concept and is entirely fabricated by the LLM.
198
+
199
+ ![](images/bb178fe14e4c1003916087e0f24691c7d0ddb9a095b037ec96711ef288c7382c.jpg)
200
+ Figure 4: Document factuality scores histogram plot
201
+
202
+ # 7 Experiments
203
+
204
+ The generative LLM used to generate passages for our dataset is GPT-3 (text-davinci-003), the stateof-the-art system at the time of creating and annotating the dataset. To obtain the main response, we set the temperature to 0.0 and use standard beam search decoding. For the stochastically generated samples, we set the temperature to 1.0 and generate
205
+
206
+ $N { = } 2 0$ samples. For the proxy LLM approach, we use LLaMA (Touvron et al., 2023), one of the bestperforming open-source LLMs currently available. For SelfCheckGPT-Prompt, we consider both GPT3 (which is the same LLM that is used to generate passages) as well as the newly released ChatGPT (gpt-3.5-turbo). More details about the systems in SelfCheckGPT and results using other proxy LLMs can be found in the appendix.
207
+
208
+ # 7.1 Sentence-level Hallucination Detection
209
+
210
+ First, we investigate whether our hallucination detection methods can identify the factuality of sentences. In detecting non-factual sentences, both major-inaccurate labels and minor-inaccurate labels are grouped together into the non-factual class, while the factual class refers to accurate sentences. In addition, we consider a more challenging task of detecting major-inaccurate sentences in passages that are not total hallucination passages, which we refer to as non-factual∗.5 Figure 5 and Table 2 show the performance of our approaches, where the following observations can be made:
211
+
212
+ 1) LLM’s probabilities $p$ correlate well with factuality. Our results show that probability measures (from the LLM generating the texts) are strong baselines for assessing factuality. Factual sentences can be identified with an AUC-PR of 53.97, significantly better than the random baseline of 27.04, with the AUC-PR for hallucination detection also increasing from 72.96 to 83.21. This supports the hypothesis that when the LLMs are uncertain about generated information, generated tokens often have higher uncertainty, paving a promising direction for hallucination detection approaches. Also, the probability $p$ measure performs better than the entropy $\mathcal { H }$ measure of top-5 tokens.
213
+
214
+ 2) Proxy LLM perform noticeably worse than LLM (GPT-3). The results of proxy LLM (based on LLaMA) show that the entropy $\mathcal { H }$ measures outperform the probability measures. This suggests that using richer uncertainty information can improve factuality/hallucination detection performance, and that previously the entropy of top-5 tokens is likely to be insufficient. In addition, when using other proxy LLMs such as GPT-NeoX or OPT-30B, the performance is near that of the random baseline. We believe this poor performance occurs as different LLMs have different generating patterns, and so even common tokens may have a low probability in situations where the response is dissimilar to the generation style of the proxy LLM. We note that a weighted conditional LM score such as BARTScore (Yuan et al., 2021) could be incorporated in future investigations.
215
+
216
+ ![](images/710ef9b6d6347dd6e28c921f71968a44791746d28d67117d2eaf91f0cc24a310.jpg)
217
+
218
+ Figure 5: PR-Curve of detecting non-factual and factual sentences in the GPT-3 generated WikiBio passages.
219
+ Table 2: AUC-PR for sentence-level detection tasks. Passage-level ranking performances are measured by Pearson correlation coefficient and Spearman’s rank correlation coefficient w.r.t. human judgements. The results of other proxy LLMs, in addition to LLaMA, can be found in the appendix. †GPT-3 API returns the top-5 tokens’ probabilities, which are used to compute entropy.
220
+
221
+ <table><tr><td rowspan="2">Method</td><td colspan="3">Sentence-level (AUC-PR)</td><td rowspan="2">Passage-level (Corr.) Pearson Spearman</td></tr><tr><td>NonFact</td><td>NonFact*</td><td>Factual</td></tr><tr><td>Random</td><td>72.96</td><td>29.72</td><td>27.04</td><td></td></tr><tr><td colspan="5"> GPT-3 (text-davinci-003)&#x27;s probabilities (LLM, grey-box)</td></tr><tr><td>Avg(-logp)</td><td>83.21</td><td>38.89 53.97</td><td>57.04</td><td>53.93</td></tr><tr><td>Avg(H)t</td><td>80.73</td><td>37.09</td><td>52.07 55.52</td><td>50.87</td></tr><tr><td>Max(-logp)</td><td>87.51</td><td>35.88</td><td>50.46 57.83</td><td>55.69</td></tr><tr><td>Max(H)t</td><td>85.75</td><td>32.43</td><td>50.27 52.48</td><td>49.55</td></tr><tr><td colspan="5"> LLaMA-30B&#x27;s probabilities (Proxy LLM, black-box)</td></tr><tr><td>Avg(-logp)</td><td>75.43</td><td>30.32 41.29</td><td>21.72</td><td>20.20</td></tr><tr><td>Avg(H)</td><td>80.80</td><td>39.01</td><td>42.97 33.80</td><td>39.49</td></tr><tr><td>Max(-logp)</td><td>74.01</td><td>27.14 31.08</td><td>-22.83</td><td>-22.71</td></tr><tr><td>Max(H)</td><td>80.92</td><td>37.32 37.90</td><td>35.57</td><td>38.94</td></tr><tr><td colspan="5"> SelfCheckGPT (black-box)</td></tr><tr><td>w/BERTScore</td><td>81.96</td><td>45.96</td><td>44.23</td><td>58.18</td><td>55.90</td></tr><tr><td>w/ QA</td><td>84.26</td><td>40.06</td><td>48.14</td><td>61.07</td><td>59.29</td></tr><tr><td>w/ Unigram (max)</td><td>85.63</td><td>41.04</td><td>58.47</td><td>64.71</td><td>64.91</td></tr><tr><td>w/ NLI</td><td>92.50</td><td>45.17</td><td>66.08</td><td>74.14</td><td>73.78</td></tr><tr><td>w/ Prompt</td><td>93.42</td><td>53.19</td><td>67.09</td><td>78.32</td><td>78.30</td></tr></table>
222
+
223
+ 3) SelfCheckGPT outperforms grey-box approaches. It can be seen that SelfCheckGPTPrompt considerably outperforms the grey-box approaches (including GPT-3’s output probabilities) as well as other black-box approaches. Even other variants of SelfCheckGPT, including BERTScore, QA, and $n$ -gram, outperform the grey-box approaches in most setups. Interestingly, despite being the least computationally expensive method, SelfCheckGPT with unigram (max) works well across different setups. Essentially, when assessing a sentence, this method picks up the token with the lowest occurrence given all the samples. This suggests that if a token only appears a few times (or once) within the generated samples $( N { = } 2 0 )$ ), it is likely non-factual.
224
+
225
+ 4) SelfCheckGPT with $n$ -gram. When investigating the $n$ -gram performance from 1-gram to 5-gram, the results show that simply finding the least likely token/n-gram is more effective than computing the average $n$ -gram score of the sentence, details in appendix Table 7. Additionally, as $n$ increases, the performance of SelfCheckGPT with $n$ -gram (max) drops.
226
+
227
+ 5) SelfCheckGPT with NLI. The NLI-based method outperforms all black-box and grey-box baselines, and its performance is close to the performance of the Prompt method. As SelfCheckGPT with Prompt can be computationally heavy, SelfCheckGPT with NLI could be the most practical method as it provides a good trade-off between performance and computation.
228
+
229
+ ![](images/a987398f00db96a439e461cfebff3a11cb21b5eb98dbb49a3cc57d0f07fee3fd.jpg)
230
+ Figure 6: Scatter plot of passage-level scores where Y-axis $=$ Method scores, X-axis $=$ Human scores. Correlations are reported in Table 2. The scatter plots of other SelfCheckGPT variants are provided in Figure 10 in the appendix.
231
+
232
+ # 7.2 Passage-level Factuality Ranking
233
+
234
+ Previous results demonstrate that SelfCheckGPT is an effective approach for predicting sentencelevel factuality. An additional consideration is whether SelfCheckGPT can also be used to determine the overall factuality of passages. Passagelevel factuality scores are calculated by averaging the sentence-level scores over all sentences.
235
+
236
+ $$
237
+ S _ { \mathrm { p a s s a g e } } = { \frac { 1 } { | R | } } \sum _ { i } S ( i )
238
+ $$
239
+
240
+ where $s ( i )$ is the sentence-level score, and $| R |$ is the number of sentences in the passage. Since human judgement is somewhat subjective, averaging the sentence-level labels would lead to ground truths with less noise. Note that for $\operatorname { A v g } ( - \log p )$ and $\operatorname { A v g } ( { \mathcal { H } } )$ , we compute the average over all tokens in a passage. Whereas for $\mathbf { M a x } ( - \log p )$ and $\operatorname { M a x } ( \mathcal { H } )$ , we first take the maximum operation over tokens at the sentence level, and we then average over all sentences following Equation 12.
241
+
242
+ Our results in Table 2 and Figure 6 show that all SelfCheckGPT methods correlate far better with human judgements than the other baselines, including the grey-box probability and entropy methods. SelfCheckGPT-Prompt is the best-performing method, achieving the highest Pearson correlation of 78.32. Unsurprisingly, the proxy LLM approach again achieves considerably lower correlations.
243
+
244
+ # 7.3 Ablation Studies
245
+
246
+ # External Knowledge (instead of SelfCheck)
247
+
248
+ If external knowledge is available, one can measure the informational consistency between the LLM response and the information source. In this experiment, we use the first paragraph of each concept that is available in WikiBio.6
249
+
250
+ Table 3: The performance when using SelfCheckGPT samples versus external stored knowledge.
251
+
252
+ <table><tr><td>Method</td><td>Sent-lvl AUC-PR NoFac NoFac*</td><td></td><td>Fact</td><td>Passage-lvl Pear. Spear.</td></tr><tr><td>SelfCk-BERT</td><td>81.96</td><td>45.96</td><td>44.23</td><td>58.18 55.90</td></tr><tr><td>WikiBio+BERT</td><td>81.32</td><td>40.62</td><td>49.15</td><td>58.71 55.80</td></tr><tr><td>SelfCk-QA</td><td>84.26</td><td>40.06</td><td>48.14</td><td>61.07 59.29</td></tr><tr><td>WikiBio+QA</td><td>84.18</td><td>45.40</td><td>52.03</td><td>57.26 53.62</td></tr><tr><td>SelfCk-1gm</td><td>85.63</td><td>41.04</td><td>58.47</td><td>64.71 64.91</td></tr><tr><td>WikiBio+1gm</td><td>80.43</td><td>31.47</td><td>40.53</td><td>28.67 26.70</td></tr><tr><td>SelfCk-NLI</td><td>92.50</td><td>45.17</td><td>66.08</td><td>74.14 73.78</td></tr><tr><td>WikiBio+NLI</td><td>91.18</td><td>48.14</td><td>71.61</td><td>78.84 80.00</td></tr><tr><td>SelfCk-Prompt</td><td>93.42</td><td>53.19</td><td>67.09</td><td>78.30</td></tr><tr><td>WikiBio+Prompt</td><td>93.59</td><td>65.26</td><td>73.11</td><td>78.32 85.90 86.11</td></tr></table>
253
+
254
+ Our findings in Table 3 show the following. First, SelfCheckGPT with BERTScore/QA, using selfsamples, can yield comparable or even better performance than when using the reference passage. Second, SelfCheckGPT with $n$ -gram shows a large performance drop when using the WikiBio passages instead of self-samples. This failure is attributed to the fact that the WikiBio reference text alone is not sufficient to train an $n$ -gram model. Third, in contrast, SelfCheckGPT with NLI/Prompt can benefit considerably when access to retrieved information is available. Nevertheless, in practice, it is infeasible to have an external database for every possible use case of LLM generation.
255
+
256
+ # The Impact of the Number of Samples
257
+
258
+ Although sample-based methods are expected to perform better when more samples are drawn, this has higher computational costs. Thus, we investigate performance as the number of samples is varied. Our results in Figure 7 show that the performance of SelfCheckGPT increases smoothly as more samples are used, with diminishing gains as more samples are generated. SelfCheckGPT with $n$ -gram requires the highest number of samples before its performance reaches a plateau.
259
+
260
+ ![](images/9ea7ff6a53429fc6454bab47de0e19df579c00b2fb4370dd39088e8833ad5a1a.jpg)
261
+ Figure 7: The performance of SelfCheckGPT methods on ranking passages (Spearman’s) versus the number of samples.
262
+
263
+ # The Choice of LLM for SelfCheckGPT-Prompt
264
+
265
+ We investigate whether the LLM generating the text can self-check its own text. We conduct this ablation using a reduced set of the samples $( N { = } 4 )$
266
+
267
+ Table 4: Comparison of GPT-3 (text-davinci-003) and ChatGPT (gpt-3.5.turbo) as the prompt-based text evaluator in SelfCheckGPT-Prompt. †Taken from Table 2 for comparison.
268
+
269
+ <table><tr><td>Text-Gen</td><td>SelfCk-Prompt</td><td>N</td><td>Pear.</td><td>Spear.</td></tr><tr><td>GPT-3</td><td>ChatGPT</td><td>20</td><td>78.32</td><td>78.30</td></tr><tr><td>GPT-3</td><td>ChatGPT</td><td>4</td><td>76.47</td><td>76.41</td></tr><tr><td>GPT-3</td><td>GPT-3</td><td>4</td><td>73.11</td><td>74.69</td></tr><tr><td colspan="2">+ SelfCheck w/ unigram (max)</td><td>20</td><td>64.71</td><td>64.91</td></tr><tr><td colspan="2">+ SelfCheck w/ NLI</td><td>20</td><td>74.14</td><td>73.78</td></tr></table>
270
+
271
+ The results in Table 4 show that GPT-3 can selfcheck its own text, and is better than the unigram method even when using only 4 samples. However, ChatGPT shows a slight improvement over GPT-3 in evaluating whether the sentence is supported by the context. More details are in Appendix C.
272
+
273
+ # 8 Conclusions
274
+
275
+ This paper is the first work to consider the task of hallucination detection for general large language model responses. We propose SelfCheckGPT, a zero-resource approach that is applicable to any black-box LLM without the need for external resources, and demonstrate the efficacy of our method. SelfCheckGPT outperforms a range of considered grey-box and black-box baseline detection methods at both the sentence and passage levels, and we further release an annotated dataset for GPT-3 hallucination detection with sentencelevel factuality labels.
276
+
277
+ # Limitations
278
+
279
+ In this study, the 238 GPT-3 generated texts were predominantly passages about individuals in the WikiBio dataset. To further investigate the nature of LLM’s hallucination, this study could be extended to a wider range of concepts, e.g., to also consider generated texts about locations and objects. Further, this work considers factuality at the sentence level, but we note that a single sentence may consist of both factual and non-factual information. For example, the following work by Min et al. (2023) considers a fine-grained factuality evaluation by decomposing sentences into atomic facts. Finally, SelfCheckGPT with Prompt, which was convincingly the best selfcheck method, is quite computationally heavy. This might lead to impractical computational costs, which could be addressed in future work to be made more efficient.
280
+
281
+ # Ethics Statement
282
+
283
+ As this work addresses the issue of LLM’s hallucination, we note that if hallucinated contents are not detected, they could lead to misinformation.
284
+
285
+ # Acknowledgments
286
+
287
+ This work is supported by Cambridge University Press & Assessment (CUP&A), a department of The Chancellor, Masters, and Scholars of the University of Cambridge, and the Cambridge Commonwealth, European & International Trust. We would like to thank the anonymous reviewers for their helpful comments.
288
+
289
+ # References
290
+
291
+ Amos Azaria and Tom Mitchell. 2023. The internal state of an llm knows when its lying. arXiv preprint arXiv:2304.13734.
292
+
293
+ Iz Beltagy, Matthew E. Peters, and Arman Cohan. 2020. Longformer: The long-document transformer.
294
+
295
+ Sidney Black, Stella Biderman, Eric Hallahan, Quentin Anthony, Leo Gao, Laurence Golding, Horace He, Connor Leahy, Kyle McDonell, Jason Phang, Michael Pieler, Usvsn Sai Prashanth, Shivanshu Purohit, Laria Reynolds, Jonathan Tow, Ben Wang, and Samuel Weinbach. 2022. GPT-NeoX-20B: An opensource autoregressive language model. In Proceedings of BigScience Episode #5 – Workshop on Challenges & Perspectives in Creating Large Language Models, pages 95–136, virtual+Dublin. Association for Computational Linguistics.
296
+
297
+ Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901.
298
+
299
+ Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. 2022. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311.
300
+
301
+ Jacob Cohen. 1960. A coefficient of agreement for nominal scales. Educational and Psychological Measurement, 20:37 – 46.
302
+
303
+ Jinlan Fu, See-Kiong Ng, Zhengbao Jiang, and Pengfei Liu. 2023. Gptscore: Evaluate as you desire.
304
+
305
+ Zhijiang Guo, Michael Schlichtkrull, and Andreas Vlachos. 2022. A survey on automated fact-checking. Transactions of the Association for Computational Linguistics, 10:178–206.
306
+
307
+ Pengcheng He, Jianfeng Gao, and Weizhu Chen. 2023. DeBERTav3: Improving deBERTa using ELECTRAstyle pre-training with gradient-disentangled embedding sharing. In The Eleventh International Conference on Learning Representations.
308
+
309
+ Yichong Huang, Xiachong Feng, Xiaocheng Feng, and Bing Qin. 2021. The factual inconsistency problem in abstractive text summarization: A survey.
310
+
311
+ Ganesh Jawahar, Benoît Sagot, and Djamé Seddah. 2019. What does BERT learn about the structure of language? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3651–3657, Florence, Italy. Association for Computational Linguistics.
312
+
313
+ Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea
314
+
315
+ Madotto, and Pascale Fung. 2023. Survey of hallucination in natural language generation. ACM Comput. Surv., 55(12).
316
+
317
+ Saurav Kadavath, Tom Conerly, Amanda Askell, Tom Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zac Hatfield Dodds, Nova DasSarma, Eli Tran-Johnson, et al. 2022. Language models (mostly) know what they know. arXiv preprint arXiv:2207.05221.
318
+
319
+ Wojciech Kryscinski, Bryan McCann, Caiming Xiong, and Richard Socher. 2020. Evaluating the factual consistency of abstractive text summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9332–9346, Online. Association for Computational Linguistics.
320
+
321
+ Lorenz Kuhn, Yarin Gal, and Sebastian Farquhar. 2023. Semantic uncertainty: Linguistic invariances for uncertainty estimation in natural language generation. In The Eleventh International Conference on Learning Representations.
322
+
323
+ Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. 2017. RACE: Large-scale ReAding comprehension dataset from examinations. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 785– 794, Copenhagen, Denmark. Association for Computational Linguistics.
324
+
325
+ Rémi Lebret, David Grangier, and Michael Auli. 2016. Generating text from structured data with application to the biography domain. CoRR, abs/1603.07771.
326
+
327
+ Tianyu Liu, Yizhe Zhang, Chris Brockett, Yi Mao, Zhifang Sui, Weizhu Chen, and Bill Dolan. 2022. A token-level reference-free hallucination detection benchmark for free-form text generation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6723–6737, Dublin, Ireland. Association for Computational Linguistics.
328
+
329
+ Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692.
330
+
331
+ Adian Liusie, Vatsal Raina, and Mark Gales. 2023. “world knowledge” in multiple choice reading comprehension. In Proceedings of the Sixth Fact Extraction and VERification Workshop (FEVER), pages 49–57, Dubrovnik, Croatia. Association for Computational Linguistics.
332
+
333
+ Zheheng Luo, Qianqian Xie, and Sophia Ananiadou. 2023. Chatgpt as a factual inconsistency evaluator for abstractive text summarization. arXiv preprint arXiv:2303.15621.
334
+
335
+ Andrey Malinin and Mark Gales. 2021. Uncertainty estimation in autoregressive structured prediction. In International Conference on Learning Representations.
336
+
337
+ Potsawee Manakul, Adian Liusie, and Mark JF Gales. 2023. MQAG: Multiple-choice question answering and generation for assessing information consistency in summarization. arXiv preprint arXiv:2301.12307.
338
+
339
+ Joshua Maynez, Shashi Narayan, Bernd Bohnet, and Ryan McDonald. 2020. On faithfulness and factuality in abstractive summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1906–1919, Online. Association for Computational Linguistics.
340
+
341
+ Sewon Min, Kalpesh Krishna, Xinxi Lyu, Mike Lewis, Wen-tau Yih, Pang Wei Koh, Mohit Iyyer, Luke Zettlemoyer, and Hannaneh Hajishirzi. 2023. Factscore: Fine-grained atomic evaluation of factual precision in long form text generation. arXiv preprint arXiv:2305.14251.
342
+
343
+ Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485–5551.
344
+
345
+ Vatsal Raina and Mark Gales. 2022. Answer uncertainty and unanswerability in multiple-choice machine reading comprehension. In Findings of the Association for Computational Linguistics: ACL 2022, pages 1020–1034, Dublin, Ireland. Association for Computational Linguistics.
346
+
347
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383–2392, Austin, Texas. Association for Computational Linguistics.
348
+
349
+ Kurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela, and Jason Weston. 2021. Retrieval augmentation reduces hallucination in conversation. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 3784–3803, Punta Cana, Dominican Republic. Association for Computational Linguistics.
350
+
351
+ James Thorne, Andreas Vlachos, Oana Cocarascu, Christos Christodoulopoulos, and Arpit Mittal. 2018. The Fact Extraction and VERification (FEVER) shared task. In Proceedings of the First Workshop on Fact Extraction and VERification (FEVER).
352
+
353
+ Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
354
+
355
+ Anthony J Viera, Joanne M Garrett, et al. 2005. Understanding interobserver agreement: the kappa statistic. Fam med, 37(5):360–363.
356
+
357
+ Ben Wang and Aran Komatsuzaki. 2021. GPT-J6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/ mesh-transformer-jax.
358
+
359
+ Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2023. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations.
360
+
361
+ Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112–1122, New Orleans, Louisiana. Association for Computational Linguistics.
362
+
363
+ Yijun Xiao and William Yang Wang. 2021. On hallucination and predictive uncertainty in conditional language generation. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2734–2744, Online. Association for Computational Linguistics.
364
+
365
+ Weizhe Yuan, Graham Neubig, and Pengfei Liu. 2021. Bartscore: Evaluating generated text as text generation. Advances in Neural Information Processing Systems, 34:27263–27277.
366
+
367
+ Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. 2022. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068.
368
+
369
+ Zhuosheng Zhang, Yuwei Wu, Hai Zhao, Zuchao Li, Shuailiang Zhang, Xi Zhou, and Xiang Zhou. 2020. Semantics-aware bert for language understanding. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9628–9635.
370
+
371
+ Wanjun Zhong, Jingjing Xu, Duyu Tang, Zenan Xu, Nan Duan, Ming Zhou, Jiahai Wang, and Jian Yin. 2020. Reasoning over semantic-level graph for fact checking. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6170–6180, Online. Association for Computational Linguistics.
372
+
373
+ # A Models and Implementation
374
+
375
+ # A.1 Entropy
376
+
377
+ The entropy of the output distribution is implemented as follows,
378
+
379
+ $$
380
+ \begin{array} { r } { \mathcal { H } _ { i j } = 2 ^ { - \sum _ { \tilde { w } \in \mathcal { W } } p _ { i j } \left( \tilde { w } \right) \log _ { 2 } p _ { i j } \left( \tilde { w } \right) } } \end{array}
381
+ $$
382
+
383
+ where $\mathcal { W }$ is the set of all possible words in the vocabulary.
384
+
385
+ # A.2 Proxy LLMs
386
+
387
+ The proxy LLMs considered are LLaMA-{7B, 13B, 30B} (Touvron et al., 2023), OPT- $\{ 1 2 5 \mathrm { m }$ , 1.3B, 13B, 30B} (Zhang et al., 2022), GPT-J-6B (Wang and Komatsuzaki, 2021) and GPT-NeoX20B (Black et al., 2022).
388
+
389
+ # A.3 SelfCheckGPT’s Systems
390
+
391
+ Question Answering: The generation systems G1 and G2 are T5-Large fine-tuned to SQuAD (Rajpurkar et al., 2016) and RACE (Lai et al., 2017), respectively. The answering system A is Longformer (Beltagy et al., 2020) fine-tuned to the RACE dataset. The answerability system U is also Longformer, but fine-tuned to SQuAD2.0.
392
+
393
+ LLM for Prompting: We consider two LLMs, GPT-3 (text-davinci-003) and ChatGPT (gpt-3.5- turbo) We note that during the data creation and annotation, GPT-3 (text-davinci-003) was the stateof-the-art LLM available; hence, GPT-3 was used as the main LLM generating WikiBio passages.
394
+
395
+ # B SelfCheckGPT with QA
396
+
397
+ Previous work showed that implementing question generation (in Equation 2) with two generators (G1 generates the question and associated answer, and G2 generates distractors) yields higher-quality distractors (Manakul et al., 2023). Thus, a two-stage generation is adopted in this work as follows:
398
+
399
+ $$
400
+ q , a \sim P _ { \mathtt { G 1 } } ( q , a | r _ { i } ) ; \bullet _ { \mathtt { V } _ { a } } \sim P _ { \mathtt { G 2 } } ( \mathbf { o } _ { \backslash a } | q , a , R )
401
+ $$
402
+
403
+ where $\mathbf { o } = \{ a , \mathbf { o } _ { \backslash a } \} = \{ o _ { 1 } , . . . , o _ { 4 } \}$ . In addition, to filter out bad (unanswerable) questions, we define an answerability score (Raina and Gales, 2022):
404
+
405
+ $$
406
+ \alpha = P _ { \mathrm { U } } ( { \mathrm { a n s w e r a b l e } } | q , { \mathrm { c o n t e x t } } )
407
+ $$
408
+
409
+ where the context is either the response $R$ or sampled passages $S ^ { n }$ , and $\alpha 0 . 0$ for unanswerable and $\alpha 1 . 0$ for answerable. We use $\alpha$ to filter out unanswerable questions which have $\alpha$ lower than a threshold. Next, we derive how Bayes’ theorem can be applied to take into account the number of answerable/unanswerable questions.
410
+
411
+ # B.1 SelfCheckGPT-QA with Bayes
412
+
413
+ Let $P ( \mathrm { F } )$ denote the probability of the $i$ -th sentence being non-factual, and $P ( \mathrm { T } )$ denote the probability of the $i$ -th sentence being factual. For a question $q$ the probability of $i$ -th sentence being non-factual given a set of matched answers $L _ { \mathtt { m } }$ and a set of not-matched answers $L _ { \mathtt { n } }$ is:
414
+
415
+ $$
416
+ \begin{array} { r l r } { { P ( \mathrm { F } | L _ { \mathfrak { n } } , L _ { \mathfrak { n } } ) } } \\ & { = \frac { P ( L _ { \mathfrak { n } } , L _ { \mathfrak { n } } | \mathrm { F } ) P ( \mathrm { F } ) } { P ( L _ { \mathfrak { n } } , L _ { \mathfrak { n } } | \mathrm { F } ) P ( \mathrm { F } ) + P ( L _ { \mathfrak { n } } , L _ { \mathfrak { n } } | \mathrm { T } ) P ( \mathrm { T } ) } } \\ & { = \frac { P ( L _ { \mathfrak { n } } , L _ { \mathfrak { n } } | \mathrm { F } ) } { P ( L _ { \mathfrak { n } } , L _ { \mathfrak { n } } | \mathrm { F } ) + P ( L _ { \mathfrak { n } } , L _ { \mathfrak { n } } | \mathrm { T } ) } } & \end{array}
417
+ $$
418
+
419
+ where we assume the sentence is equally likely to be False or True, i.e. $P ( \mathbf { F } ) = P ( \mathbf { T } )$ . The probability of observing $L _ { \mathtt { m } } , L _ { \mathtt { n } }$ when the sentence is False (non-factual):
420
+
421
+ $$
422
+ \begin{array} { l } { { \displaystyle P ( L _ { \mathfrak { n } } , L _ { \mathfrak { n } } | \mathrm { F } ) } } \\ { { \displaystyle ~ = \prod _ { a \in L _ { \mathfrak { n } } } P ( a = a _ { R } | F ) \prod _ { a ^ { \prime } \in L _ { \mathfrak { n } } } P ( a ^ { \prime } \neq a _ { R } | F ) } } \\ { { \displaystyle ~ = ( 1 - \beta _ { 1 } ) ^ { N _ { \mathfrak { n } } } ( \beta _ { 1 } ) ^ { N _ { \mathfrak { n } } } } } \end{array}
423
+ $$
424
+
425
+ and probability of observing $L _ { \mathtt { m } } , L _ { \mathtt { n } }$ when the sentence is True (factual):
426
+
427
+ $$
428
+ \begin{array} { l } { { \displaystyle P ( L _ { \tt m } , L _ { \tt n } | { \bf T } ) } } \\ { { \displaystyle ~ = \prod _ { a \in L _ { \tt m } } P ( a = a _ { r } | T ) \prod _ { a ^ { \prime } \in L _ { \tt n } } P ( a ^ { \prime } \not = a _ { r } | T ) } } \\ { { \displaystyle ~ = ( \beta _ { 2 } ) ^ { N _ { \tt m } } ( 1 - \beta _ { 2 } ) ^ { N _ { \tt n } } } } \end{array}
429
+ $$
430
+
431
+ where $N _ { \mathtt { m } }$ and $N _ { \mathbf { n } }$ are the number of matched answers and the number of not-matched answers, respectively. Hence, we can simplify Equation 16:
432
+
433
+ $$
434
+ P ( \mathrm { F } | L _ { \mathfrak { m } } , L _ { \mathfrak { n } } ) = \frac { \gamma _ { 2 } ^ { N _ { \mathfrak { n } } } } { \gamma _ { 1 } ^ { N _ { \mathfrak { n } } } + \gamma _ { 2 } ^ { N _ { \mathfrak { n } } } }
435
+ $$
436
+
437
+ where $\begin{array} { r } { \gamma _ { 1 } = \frac { \beta _ { 2 } } { 1 - \beta _ { 1 } } } \end{array}$ and $\begin{array} { r } { \gamma _ { 2 } = \frac { \beta _ { 1 } } { 1 - \beta _ { 2 } } } \end{array}$ . Lastly, instead of rejecting samples having an answerability score below a threshold,7 we find empirically that softcounting (defined below) improves the detection performance. We set both $\beta _ { 1 }$ and $\beta _ { 2 }$ to 0.8.
438
+
439
+ $$
440
+ N _ { \mathfrak { n } } ^ { \prime } = \sum _ { n { \mathrm { ~ s . t . ~ } } a _ { n } \in L _ { \mathfrak { n } } } \alpha _ { n } ; \ N _ { \mathfrak { n } } ^ { \prime } = \sum _ { n { \mathrm { ~ s . t . ~ } } a _ { n } \in L _ { \mathfrak { n } } } \alpha _ { n }
441
+ $$
442
+
443
+ where $\alpha _ { n } = P _ { \mathrm { U } } ( { \mathrm { a n s w e r a b l e } } | q , S ^ { n } )$ . Therefore, the SelfCheckGPT with QA score, ${ \mathcal { S } } _ { \mathrm { Q A } }$ , is:
444
+
445
+ $$
446
+ \mathcal { S } _ { \mathrm { Q A } } = P ( \mathrm { F } | L _ { \mathfrak { n } } , L _ { \mathfrak { n } } ) = \frac { \gamma _ { 2 } ^ { N _ { \mathfrak { n } } ^ { \prime } } } { \gamma _ { 1 } ^ { N _ { \mathfrak { n } } ^ { \prime } } + \gamma _ { 2 } ^ { N _ { \mathfrak { n } } ^ { \prime } } }
447
+ $$
448
+
449
+ In Table 5, we show empically that applying Bayes’ theorem and soft counting $\alpha$ (in Equation 20) improves the performance of the SelfCheckGPT with QA method.
450
+
451
+ Table 5: Performance of SelfCheckGPT-QA’s variants.
452
+
453
+ <table><tr><td rowspan="2">Varaint</td><td colspan="3">Sentence-lvl</td><td colspan="2">Passage-lvl</td></tr><tr><td>NoF</td><td>NoF*</td><td>Fact</td><td>PCC</td><td>SCC</td></tr><tr><td>SimpleCount</td><td>83.97</td><td>40.07</td><td>47.78</td><td>57.39</td><td>55.15</td></tr><tr><td>+ Bayes</td><td>83.04</td><td>38.58</td><td>47.41</td><td>56.43</td><td>55.03</td></tr><tr><td>+ Bayes + α</td><td>84.26</td><td>40.06</td><td>48.14</td><td>61.07</td><td>59.29</td></tr></table>
454
+
455
+ # C SelfCheckGPT with Prompt
456
+
457
+ We use the prompt template provided in the main text (in Section 5.5) for both GPT-3 (text-davinci003) and ChatGPT (gpt-3.5-turbo). For ChatGPT, a standard system message "You are a helpful assistant." is used in setting up the system.
458
+
459
+ At the time of conducting experiments, the API costs per 1,000 tokens are $\$ 0.020$ for GPT-3 and $\$ 0.002$ for ChatGPT. The estimated costs for running the models to answer Yes/No on all 1908 sentences and 20 samples are around $\$ 200$ for GPT-3 and $\$ 20$ for ChatGPT. Given the cost, we conduct the experiments on 4 samples when performing the ablation about LLM choice for SelfCheckGPTPrompt (Section 7.3). Table 6 shows the breakdown of predictions made by GPT-3 and ChatGPT.
460
+
461
+ Table 6: Breakdown of predictions made by GPT-3/ChatGPT when prompted to answer Yes(supported)/No(not-supported).
462
+
463
+ <table><tr><td>ChatGPT</td><td rowspan="2">Yes</td><td rowspan="2">No</td></tr><tr><td>GPT-3</td></tr><tr><td>Yes</td><td>3179</td><td>1038</td></tr><tr><td>No</td><td>367</td><td>3048</td></tr></table>
464
+
465
+ Table 7: The performance using different $n$ -gram models in the SelfCheckGPT with $_ n$ -gram method.
466
+
467
+ <table><tr><td rowspan="2">n-gram</td><td colspan="3">Sent-lvl AUC-PR</td><td colspan="2">Passage-lvl</td></tr><tr><td>NoFac</td><td>NoFac*</td><td>Fact</td><td>Pear.</td><td>Spear.</td></tr><tr><td colspan="6"> Avg(-logp)</td></tr><tr><td>1-gram</td><td rowspan="4">81.52 82.94 83.56</td><td rowspan="4">40.33 44.38</td><td rowspan="4">41.76 53.99</td><td>40.68 58.84</td><td>39.22</td></tr><tr><td>2-gram</td><td>52.81</td><td>58.11</td></tr><tr><td>3-gram</td><td>44.64 43.55</td><td>62.21 63.00</td></tr><tr><td>4-gram 83.80 5-gram 83.45</td><td>54.25 53.98</td><td>61.98 63.64 60.68 62.96</td></tr><tr><td colspan="6">42.31</td></tr><tr><td>Max(-logp) 1-gram</td><td>85.63</td><td>41.04</td><td>58.47</td><td>64.71</td><td>64.91</td></tr><tr><td>2-gram</td><td>85.26</td><td>39.29</td><td>58.29</td><td>62.48</td><td>66.04</td></tr><tr><td>3-gram</td><td>84.97</td><td>37.10</td><td>57.08</td><td>57.34</td><td>60.49</td></tr><tr><td>4-gram</td><td>84.49</td><td>36.37</td><td>55.96</td><td>55.77</td><td>57.25</td></tr><tr><td>5-gram</td><td>84.12</td><td>36.19</td><td>54.89</td><td>54.84</td><td>55.97</td></tr></table>
468
+
469
+ ![](images/9652737ce0d395cd83b4b18ed2b87bbb10af6b710d410c3a6c2d797b5da2b6a2.jpg)
470
+ Figure 8: The performance of SelfCheckGPT methods on sentence-level non-factual detection (AUC-PR) versus the number of samples. This Figure extends the passage-level results in Figure 7.
471
+
472
+ ![](images/e05cf974dc3a38ec8f172156a1ed9ac9aeadaf040fd21b5fe0e9556107c827e8.jpg)
473
+ Figure 9: Passage-level ranking performance of the Avg $\mathcal { H } )$ method using proxy LLM where the sizes are: LLaMA $\scriptstyle = \{ 7 \mathrm { B }$ , 13B, 30B}, $\bar { \mathrm { O P T } } { = } \{ 1 2 5 \mathrm { m }$ , 1.3B, 13B, 30B}, GPT- $\scriptstyle \mathbf { J } = 6 \mathbf { B }$ , $\mathrm { N e o X } { = } 2 0 \mathrm { B }$ . The full results are provided in Table 8.
474
+
475
+ # D Additional Experimental Results
476
+
477
+ Here, we provide experimental results that are complementary to those presented in the main paper.
478
+
479
+ ![](images/b7d3c26f859d8ae31a62ff0ec3cbd1ace56a5bb4c3ea8edfb087b4e0f44b6f2e.jpg)
480
+ Figure 10: Scatter plot of passage-level scores where Y-axis $=$ Method scores, X-axis $=$ Human scores. Correlations are reported in Table 2. This figure provides results in addition to Figure 6.
481
+
482
+ Table 8: AUC-PR for Detecting Non-Factual and Factual Sentences in the GPT-3 generated WikiBio passages. Passage-level PCC and SCC with LLMs used to assess GPT-3 responses. This table is an extension to Table 2.
483
+
484
+ <table><tr><td rowspan="2">LLM</td><td rowspan="2">Size</td><td colspan="3">Sentence-level (AUC-PR)</td><td colspan="2">Passage-level (Corr.)</td></tr><tr><td>NonFact</td><td>NonFact*</td><td>Factual</td><td>Pearson</td><td>Spearman</td></tr><tr><td>Random</td><td></td><td>72.96</td><td>29.72</td><td>27.04</td><td></td><td></td></tr><tr><td colspan="7"> Avg(-logp) Method</td></tr><tr><td>LLaMA</td><td>30B</td><td>75.43</td><td>30.32</td><td>41.29</td><td>21.72</td><td>20.20</td></tr><tr><td>LLaMA</td><td>13B</td><td>74.16</td><td>30.01</td><td>37.36</td><td>13.33</td><td>12.89</td></tr><tr><td>LLaMA</td><td>7B</td><td>71.69</td><td>27.87</td><td>31.30</td><td>-2.71</td><td>-2.59</td></tr><tr><td>OPT</td><td>30B</td><td>67.70</td><td>24.43</td><td>25.04</td><td>-32.07</td><td>-31.45</td></tr><tr><td>NeoX</td><td>20B</td><td>69.00</td><td>24.38</td><td>26.18</td><td>-31.79</td><td>-34.15</td></tr><tr><td>OPT</td><td>13B</td><td>67.46</td><td>24.39</td><td>25.20</td><td>-33.05</td><td>-32.79</td></tr><tr><td>GPT-J</td><td>6B</td><td>67.51</td><td>24.28</td><td>24.26</td><td>-38.80</td><td>-40.05</td></tr><tr><td>OPT</td><td>1.3B</td><td>66.19</td><td>24.47</td><td>23.47</td><td>-35.20</td><td>-38.95</td></tr><tr><td>OPT</td><td>125m</td><td>66.63</td><td>25.31</td><td>23.07</td><td>-30.38</td><td>-37.54</td></tr><tr><td colspan="7"> Avg(H) Method</td></tr><tr><td>LLaMA</td><td>30B</td><td>80.80</td><td>39.01</td><td>42.97</td><td>33.80</td><td>39.49</td></tr><tr><td>LLaMA</td><td>13B</td><td>80.63</td><td>38.98</td><td>40.59</td><td>29.43</td><td>33.12</td></tr><tr><td>LLaMA</td><td>7B</td><td>78.67</td><td>37.22</td><td>33.81</td><td>19.44</td><td>21.79</td></tr><tr><td>OPT</td><td>30B</td><td>77.13</td><td>33.67</td><td>29.55</td><td>-0.43</td><td>3.43</td></tr><tr><td>NeoX</td><td>20B</td><td>77.40</td><td>32.78</td><td>30.13</td><td>5.41</td><td>7.43</td></tr><tr><td>OPT</td><td>13B</td><td>76.93</td><td>33.71</td><td>29.68</td><td>0.25</td><td>1.39</td></tr><tr><td>GPT-J</td><td>6B</td><td>76.15</td><td>33.29</td><td>28.30</td><td>-2.50</td><td>-1.37</td></tr><tr><td>OPT</td><td>1.3B</td><td>74.05</td><td>31.91</td><td>26.33</td><td>-10.59</td><td>-10.00</td></tr><tr><td>OPT</td><td>125m</td><td>71.51</td><td>30.88</td><td>25.36</td><td>-14.16</td><td>-13.76</td></tr><tr><td colspan="7">Max(-logp) Method</td></tr><tr><td>LLaMA</td><td>30B</td><td>74.01</td><td>27.14</td><td>31.08</td><td>-22.83</td><td>-22.71</td></tr><tr><td>LLaMA</td><td>13B</td><td>71.12</td><td>26.78</td><td>28.82</td><td>-34.93</td><td>-31.70</td></tr><tr><td>LLaMA</td><td>7B</td><td>69.57</td><td>25.91</td><td>26.54</td><td>-42.57</td><td>-38.24</td></tr><tr><td>OPT</td><td>30B</td><td>67.32</td><td>24.40</td><td>24.32</td><td>-49.51</td><td>-45.50</td></tr><tr><td>NeoX</td><td>20B</td><td>67.51</td><td>23.88</td><td>24.82</td><td>-47.96</td><td>-44.54</td></tr><tr><td>OPT</td><td>13B</td><td>67.36</td><td>24.67</td><td>24.46</td><td>-50.15</td><td>-44.42</td></tr><tr><td>GPT-J</td><td>6B</td><td>67.58</td><td>23.94</td><td>23.93</td><td>-51.23</td><td>-47.68</td></tr><tr><td>OPT</td><td>1.3B</td><td>68.16</td><td>25.85</td><td>24.66</td><td>-45.60</td><td>-42.39</td></tr><tr><td>OPT</td><td>125m</td><td>69.23</td><td>27.66</td><td>24.14</td><td>-39.22</td><td>-37.18</td></tr><tr><td colspan="7">Max(H) Method</td></tr><tr><td>LLaMA</td><td>30B</td><td>80.92</td><td>37.32</td><td>37.90</td><td>35.57</td><td>38.94</td></tr><tr><td>LLaMA</td><td>13B</td><td>80.98</td><td>37.94</td><td>36.01</td><td>32.07</td><td>34.01</td></tr><tr><td>LLaMA</td><td>7B</td><td>79.65</td><td>35.57</td><td>31.32</td><td>22.10</td><td>22.53</td></tr><tr><td>OPT</td><td>30B</td><td>76.58</td><td>33.44</td><td>29.31</td><td>1.63</td><td>6.41</td></tr><tr><td>NeoX</td><td>20B</td><td>76.98</td><td>31.96</td><td>29.13</td><td>5.97</td><td>9.31</td></tr><tr><td>OPT</td><td>13B</td><td>76.26</td><td>32.81</td><td>29.25</td><td>1.42</td><td>2.82</td></tr><tr><td>GPT-J</td><td>6B</td><td>75.30</td><td>32.51</td><td>28.13</td><td>-2.14</td><td>1.41</td></tr><tr><td>OPT</td><td>1.3B</td><td>73.79</td><td>31.42</td><td>26.38</td><td>-9.84</td><td>-9.80</td></tr><tr><td>OPT</td><td>125m</td><td>71.32</td><td>31.65</td><td>25.36</td><td>-18.05</td><td>-17.37</td></tr></table>
parse/dev/RwzFNbJ3Ez/RwzFNbJ3Ez_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RzXb6a3H3rs/RzXb6a3H3rs_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RzXb6a3H3rs/RzXb6a3H3rs_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/UpN2wfrLec/UpN2wfrLec.md ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Language Is Not All You Need: Aligning Perception with Language Models
2
+
3
+ Shaohan Huang∗, Li Dong∗, Wenhui Wang∗, Yaru Hao∗, Saksham Singhal∗, Shuming Ma∗ Tengchao Lv, Lei Cui, Owais Khan Mohammed, Barun Patra, Qiang Liu, Kriti Aggarwal Zewen Chi, Johan Bjorck, Vishrav Chaudhary, Subhojit Som, Xia Song, Furu Wei† Microsoft https://github.com/microsoft/unilm
4
+
5
+ # Abstract
6
+
7
+ A big convergence of language, multimodal perception, action, and world modeling is a key step toward artificial general intelligence. In this work, we introduce KOSMOS-1, a Multimodal Large Language Model (MLLM) that can perceive general modalities, learn in context (i.e., few-shot), and follow instructions (i.e., zero-shot). Specifically, we train KOSMOS-1 from scratch on web-scale multimodal corpora, including arbitrarily interleaved text and images, image-caption pairs, and text data. We evaluate various settings, including zero-shot, few-shot, and multimodal chain-of-thought prompting, on a wide range of tasks without any gradient updates or finetuning. Experimental results show that KOSMOS-1 achieves impressive performance on (i) language understanding, generation, and even OCR-free NLP (directly fed with document images), (ii) perception-language tasks, including multimodal dialogue, image captioning, visual question answering, and (iii) vision tasks, such as image recognition with descriptions (specifying classification via text instructions). We also show that MLLMs can benefit from cross-modal transfer, i.e., transfer knowledge from language to multimodal, and from multimodal to language. In addition, we introduce a dataset of Raven IQ test, which diagnoses the nonverbal reasoning capability of MLLMs.
8
+
9
+ # 1 Introduction: From LLMs to MLLMs
10
+
11
+ Large language models (LLMs) have successfully served as a general-purpose interface across various natural language tasks [1]. The LLM-based interface can be adapted to a task as long as we are able to transform the input and output into texts. For example, the input of the summarization task is a document and the output is its summary. So we can feed the input document into the language model and then produce the generated summary.
12
+
13
+ Despite the successful applications in natural language processing, it is still struggling to natively use LLMs for multimodal data, such as image, and audio. Being a basic part of intelligence, multimodal perception is a necessity to achieve artificial general intelligence, in terms of knowledge acquisition and grounding to the real world. More importantly, unlocking multimodal input [2, 3, 4, 5, 6, 7] greatly widens the applications of language models to more high-value areas, such as multimodal machine learning, document intelligence, and robotics.
14
+
15
+ In this work, we introduce KOSMOS-1, a Multimodal Large Language Model (MLLM) that can perceive general modalities, follow instructions (i.e., zero-shot learning), and learn in context (i.e., few-shot learning). The goal is to align perception with LLMs, so that the models are able to see and talk. To be specific, we follow METALM [3] to train the KOSMOS-1 model from scratch. As shown in Figure 1, a Transformer-based language model is regarded as the general-purpose interface, and perception modules are docked with the language model. We train the model on web-scale multimodal corpora, i.e., text data, arbitrarily interleaved images and texts, and image-caption pairs. In addition, we calibrate the instruction-following capability across modalities by transferring language-only data.
16
+
17
+ ![](images/8e3232a1c4f23f7b25cb3ce3da7195272b497bbf8c8cfd492e0f378fc617ec3b.jpg)
18
+ Figure 1: KOSMOS-1 is a multimodal large language model (MLLM) that is capable of perceiving multimodal input, following instructions, and performing in-context learning for not only language tasks but also multimodal tasks. In this work, we align vision with large language models (LLMs), advancing the trend of going from LLMs to MLLMs.
19
+
20
+ The KOSMOS-1 model natively supports language, perception-language, and vision tasks. In addition to various natural language tasks, the KOSMOS-1 models natively handle a wide range of perceptionintensive tasks, spanning visual dialogue, visual explanation, visual question answering, image captioning, simple math equation, OCR, and zero-shot image classification with descriptions. We also build an IQ test benchmark following Raven’s Progressive Matrices [8, 9], which evaluates the capability of nonverbal reasoning for MLLMs. The examples show that the native support of multimodal perception enables new opportunities to apply LLMs to new tasks. Moreover, we show that MLLMs achieve better commonsense reasoning performance compared with LLMs, which indicates cross-modal transfer helps knowledge acquisition.
21
+
22
+ The key takeaways are as follows:
23
+
24
+ From LLMs to MLLMs. Properly handling perception is a necessary step toward artificial general intelligence. The capability of perceiving multimodal input is critical to LLMs. First, multimodal perception enables LLMs to acquire commonsense knowledge beyond text descriptions. Second, aligning perception with LLMs opens the door to new tasks, such as robotics, and document intelligence. Third, the capability of perception unifies various APIs, as graphical user interfaces are the most natural and unified way to interact with. For example, MLLMs can directly read the screen or extract numbers from receipts. We train the KOSMOS-1 models on web-scale multimodal corpora, which ensures that the model robustly learns from diverse sources. We not only use a large-scale text corpus but also mine high-quality image-caption pairs and arbitrarily interleaved image and text documents from the web.
25
+
26
+ Language models as general-purpose interfaces. Following the philosophy proposed in METALM [3], we regard language models as a universal task layer. Because of the open-ended output space, we are able to unify various task predictions as texts. Moreover, natural-language instructions and action sequences (such as programming language) can be well handled by language models. LLMs also serve as basic reasoners [10], which is complementary to perception modules on complex tasks. So it is natural to align world, action, and multimodal perception with the general-purpose interface, i.e., language models.
27
+
28
+ New capabilities of MLLMs. Apart from the capabilities found in previous LLMs [1, 11], MLLMs enable new usages and possibilities. First, we can conduct zero- and few-shot multimodal learning by using natural language instructions and demonstration examples. Second, we observe promising signals of nonverbal reasoning by evaluating the Raven IQ test, which measures the fluid reasoning ability of humans. Third, MLLMs naturally support multi-turn interactions for general modalities, such as multimodal dialogue.
29
+
30
+ # 2 KOSMOS-1: A Multimodal Large Language Model
31
+
32
+ KOSMOS-1 is a multimodal language model that can perceive general modalities, follow instructions, learn in context, and generate outputs. Given the previous context, the model learns to generate texts in an auto-regressive manner. Specifically, the backbone of KOSMOS-1 is a Transformer-based causal language model. Apart from text, other modalities are embedded and fed into the language model. The Transformer decoder serves as a general-purpose interface to multimodal input. We train KOSMOS-1 on multimodal corpora, including monomodal data, cross-modal paired data, and interleaved multimodal data. Once the models are trained, we can directly evaluate the models in zero-shot and few-shot settings on both language tasks and multimodal tasks.
33
+
34
+ # 2.1 Input Representation
35
+
36
+ The Transformer decoder perceives general modalities in a unified way. For input format, we flatten input as a sequence decorated with special tokens. Specifically, we use $\mathtt { < s > }$ and $< / { \mathsf { s } } { \mathsf { > } }$ to denote startand end-of-sequence. The special tokens <image> and </image> indicate the beginning and end of encoded image embeddings. For example, $\ " < \mathsf { s } >$ document $< / { \mathsf { s } } > ^ { , , }$ is a text input, and $\ " < \mathsf { s } >$ paragraph <image> Image Embedding </image> paragraph $< / { \mathsf { s } } > ^ { , \mathsf { \curlyeq } }$ is an interleaved image-text input.
37
+
38
+ An embedding module is used to encode both text tokens and other input modalities into vectors. Then the embeddings are fed into the decoder. For text tokens, we use a lookup table to map them into embeddings. For the modalities of continuous signals (e.g., image, and audio), it is also feasible to represent inputs as discrete code and then regard them as “foreign languages” [4, 12]. In this work, following [3], we employ a vision encoder as the embedding module for input images. In addition, Resampler [5] is used as an attentive pooling mechanism to reduce the number of image embeddings.
39
+
40
+ # 2.2 Multimodal Large Language Models (MLLMs)
41
+
42
+ After obtaining the embeddings of an input sequence, we feed them into the Transformer-based decoder. The left-to-right causal model processes the sequence in an auto-regressive manner, which produces the next token by conditioning on past timesteps. The causal masking is used to mask out future information. A softmax classifier upon Transformer is used to generate tokens over the vocabulary.
43
+
44
+ MLLMs serve as general-purpose interfaces [3] that can perform interactions with both natural language and multimodal input. The framework is flexible to handle various data types, as long as we can represent input as vectors. MLLMs combine the best of two worlds. First, the language models naturally inherit the capabilities of in-context learning and instruction following. Second, perception is aligned with language models by training on multimodal corpora.
45
+
46
+ The implementation is based on the library TorchScale [13], which is designed for large-scale model training. Compared with the standard Transformer architecture, we include the following modifications: We use MAGNETO [14], a Transformer variant, as the backbone architecture and XPOS [15] relative position encoding for better long-context modeling.
47
+
48
+ # 2.3 Multimodal Training Data
49
+
50
+ The models are trained on web-scale multimodal corpora. The training datasets consist of text corpora, image-caption pairs, and interleaved data of images and texts.
51
+
52
+ Text Corpora We train our model with The Pile [16] and Common Crawl (CC). The Pile is a massive English text dataset built for training large-scale language models. We exclude data splits from GitHub, arXiv, Stack Exchange, and PubMed Central. We also include the Common Crawl snapshots (2020-50 and 2021-04) datasets, CC-Stories, and RealNews datasets [17, 18].
53
+
54
+ Image-Caption Pairs The image-caption pairs are constructed from several datasets, including English LAION-2B [19], LAION-400M [20], COYO-700M [21], and Conceptual Captions [22, 23].
55
+
56
+ English LAION-2B, LAION-400M, and COYO-700M are collected from web pages of the Common Crawl web data by extracting image sources and the corresponding alt-text. Conceptual Captions are also from internet web pages.
57
+
58
+ Interleaved Image-Text Data We collect interleaved multimodal data from the Common Crawl snapshot, which is a publicly available archive of web pages. We use a filtering process to select about 71 millions web pages from the original 2 billions web pages in the snapshot. We then extract the text and images from the HTML of each selected web page.
59
+
60
+ # 2.4 Training Objective
61
+
62
+ The KOSMOS-1 training is conducted on web-scale multimodal corpora, including monomodal data (e.g., text corpus), cross-modal paired data (e.g., image-caption pairs), and interleaved multimodal data (e.g., documents of arbitrarily interleaved images and texts). To be specific, we use monomodal data for representation learning. For example, language modeling with text data pretrains instruction following, in-context learning, and various language tasks. Moreover, cross-modal pairs and interleaved data learn to align the perception of general modalities with language models. Interleaved data also naturally fit in the multimodal language modeling task. We present more details of training data collection in the supplemental material.
63
+
64
+ The models are trained with the next-token prediction task, i.e., learning to generate the next token depending on the previous context. The training objective is to maximize the log-likelihood of tokens in examples. Notice that only discrete tokens, such as text tokens, are accounted for in the training loss. Multimodal language modeling is a scalable way to train the models. More importantly, the emergence of various capabilities makes the training task favorable for downstream applications.
65
+
66
+ # 3 Experiments
67
+
68
+ # 3.1 Training Setup
69
+
70
+ We train KOSMOS-1 with 1.6 billion parameters using a mix of text corpora, image-caption pairs, and interleaved data. We use Magneto’s initialization for optimization stability and a pretrained CLIP ViT-L/14 model for image representation. The model is trained for $3 0 0 \mathrm { k }$ steps using a batch size of 1.2 million tokens and the AdamW optimizer. We adopt a learning rate warm-up and decay schedule, and use SentencePiece for tokenization.
71
+
72
+ To improve instruction-following capabilities, we perform language-only instruction tuning using Unnatural Instructions [24] and FLANv2 [25] datasets. This tuning process is conducted as language modeling, and improvements transfer across modalities. More details about hyperparameters can be found in the supplemental material.
73
+
74
+ Table 1 summarizes the corresponding datasets and what capabilities we would like to evaluate. We evaluate different capabilities related to language, perception-language and vision.
75
+
76
+ # 3.2 Perception-Language Tasks
77
+
78
+ Image Captioning Table 2a shows the captioning performance on COCO [39] Karpathy test split and Flickr30k [40] test set. KOSMOS-1 achieves remarkable results in zero-shot setting on two image captioning datasets. Specifically, our model achieves a CIDEr score of 67.1 on the Flickr30k dataset, compared to 60.6 and 61.5 for the Flamingo-3B and Flamingo-9B models, respectively. Notably, our model is able to accomplish this feat with a smaller size of 1.6B, compared to Flamingo models. This demonstrates our model’s superiority in zero-shot image captioning.
79
+
80
+ Visual Question Answering Table 2b reports the visual question answering results on VQAv2 [41] and VizWiz [42]. We show that KOSMOS-1 can better handle the diversity and complexity of the VizWiz dataset. KOSMOS-1 achieves higher accuracy and robustness than Flamingo-3B and Flamingo-9B models on zero-shot settings. In addition, our model is competitive with Flamingo on the VQAv2 dataset.
81
+
82
+ <table><tr><td>Dataset</td><td>Task description</td><td>Metric</td><td>Zero-shot</td><td>Few-shot</td></tr><tr><td colspan="5">Language tasks</td></tr><tr><td>StoryCloze [26]</td><td>Commonsense reasoning</td><td>Accuracy</td><td></td><td></td></tr><tr><td>HellaSwag [27]</td><td>Commonsense NLI</td><td>Accuracy</td><td></td><td></td></tr><tr><td>Winograd [28]</td><td>Word ambiguity</td><td>Accuracy</td><td></td><td></td></tr><tr><td>Winogrande [29]</td><td>Word ambiguity</td><td>Accuracy</td><td></td><td></td></tr><tr><td>PIQA [30]</td><td>Physical commonsense</td><td>Accuracy</td><td></td><td></td></tr><tr><td>BoolQ[31]</td><td>Question answering</td><td>Accuracy</td><td></td><td></td></tr><tr><td>CB [32]</td><td>Textual entailment</td><td>Accuracy</td><td></td><td>vvνvvvvv</td></tr><tr><td>COPA [33]</td><td>Causal reasoning</td><td>Accuracy</td><td></td><td></td></tr><tr><td>Rendered SST-2 [34]</td><td>OCR-free sentiment classification</td><td>Accuracy</td><td></td><td></td></tr><tr><td>HatefulMemes [35]</td><td>OCR-free meme classification</td><td>ROC AUC</td><td></td><td></td></tr><tr><td colspan="5">Cross-modal transfer</td></tr><tr><td>RelativeSize [36]</td><td>Commonsense reasoning (object size)</td><td>Accuracy</td><td>√</td><td></td></tr><tr><td>MemoryColor [37]</td><td>Commonsense reasoning (object color)</td><td>Accuracy</td><td>√</td><td></td></tr><tr><td>ColorTerms [38]</td><td>Commonsense reasoning (object color)</td><td>Accuracy</td><td>√</td><td></td></tr><tr><td colspan="5">Nonverbal reasoning tasks</td></tr><tr><td>IQ Test</td><td>Raven&#x27;s Progressive Matrices</td><td>Accuracy</td><td>√</td><td></td></tr><tr><td colspan="5">Perception-language tasks</td></tr><tr><td>COCO Caption [39]</td><td>Image captioning</td><td>CIDEr, etc.</td><td></td><td></td></tr><tr><td>Flicker30k [40]</td><td>Image captioning</td><td>CIDEr, etc.</td><td></td><td></td></tr><tr><td>VQAv2 [41]</td><td>Visual question answering</td><td>VQA acc.</td><td></td><td>&lt;&lt;vv</td></tr><tr><td>VizWiz[42]</td><td>Visual question answering</td><td>VQA acc.</td><td></td><td></td></tr><tr><td>WebSRC[43]</td><td>Web page question answering</td><td>F1 score</td><td></td><td></td></tr><tr><td colspan="5">Vision tasks</td></tr><tr><td>CUB [44]</td><td>Zero-shot image classification with descriptions</td><td>Accuracy</td><td></td><td></td></tr></table>
83
+
84
+ Table 1: We evaluate the capabilities of KOSMOS-1 on language, perception-language, and vision tasks under both zero- and few-shot learning settings.
85
+
86
+ # 3.3 IQ Test: Nonverbal Reasoning
87
+
88
+ Raven’s Progressive Matrices [9, 8] is one of the most common tests to evaluate nonverbal reasoning. The capability of nonverbal reasoning is typically a reflection of an individual’s intelligence quotientWhich option can complete the matrix? (IQ). Figure 2 shows an example. Given eight images, the task is to identify the following elementA B C D E F from six similar candidates.
89
+
90
+ ![](images/c9e724bf92595d0da428f24c3231d71fc5836e0699fc5c281bc47e57ff8c2942.jpg)
91
+ Figure 2: We append each candidate image to the prompt Table 3: Zero-shot generalization on separately and query the model if it is correct. Raven IQ test.
92
+
93
+ <table><tr><td>Method</td><td>Accuracy</td></tr><tr><td>Random Choice</td><td>17%</td></tr><tr><td>KosMOs-1</td><td>22%</td></tr></table>
94
+
95
+ The models need to conduct zero-shot nonverbal reasoning without explicitly fine-tuning. The Raven IQ test is analogous to in-context learning of language models, where the difference is whether the context is nonverbal or verbal. In order to infer the answers, the models have to recognize abstract concepts and identify the underlying patterns of given images. So the IQ task is a good testbed to benchmark the nonverbal in-context learning capability.
96
+
97
+ Table 3 shows the evaluation results on the IQ test dataset. KOSMOS-1 achieves $5 . 3 \%$ improvement respectively over the random baseline. The results indicate that KOSMOS-1 is able to perceive abstract conceptual patterns in a nonverbal context, and then deduce the following element across multiple choices. To the best of our knowledge, it is the first time that a model can perform such zero-shot Raven IQ tests. Although there is still a large performance gap between the current model and the
98
+
99
+ <table><tr><td>Shot</td><td>Model</td><td>CoCo</td><td>Flickr30k</td></tr><tr><td rowspan="7">0</td><td>ZeroCap45]</td><td>14.6</td><td>1</td></tr><tr><td>VLKD [46]</td><td>58.3</td><td>1</td></tr><tr><td>FewVLM[47]</td><td>-</td><td>31.0</td></tr><tr><td>METALM[3]</td><td>82.2</td><td>43.4</td></tr><tr><td>Flamingo-3B*[5]</td><td>73.0</td><td>60.6</td></tr><tr><td>Flamingo-9B*[5]</td><td>79.4</td><td>61.5</td></tr><tr><td>KOSMOS-1 (1.6B)</td><td>84.7</td><td>67.1</td></tr><tr><td rowspan="2">2</td><td>Flamingo-3B* [5]</td><td>=</td><td>1</td></tr><tr><td>Flamingo-9B*[5] KOSMOS-1 (1.6B)</td><td>- 99.6</td><td>-</td></tr><tr><td rowspan="2">4</td><td>Flamingo-3B* [5]</td><td>85.0</td><td>70.0 72.0</td></tr><tr><td>Flamingo-9B* [5]</td><td>93.1</td><td>72.6</td></tr><tr><td rowspan="2"></td><td>KoSMOS-1 (1.6B)</td><td>101.7</td><td>75.3</td></tr><tr><td>Flamingo-3B* [5]</td><td>90.6</td><td>71.7</td></tr><tr><td rowspan="3">8</td><td>Flamingo-9B* [5]</td><td>99.0</td><td>73.4</td></tr><tr><td>KoSMOS-1 (1.6B)</td><td>96.7</td><td>68.0</td></tr><tr><td></td><td></td><td></td></tr></table>
100
+
101
+ (a) Image captioning results on COCO caption Karpa- (b) Visual question answering results on VQAv2 and thy test and Flickr30k test. We present CIDEr scores. VizWiz. We present VQA accuracy scores.
102
+
103
+ <table><tr><td>Shot</td><td>Model</td><td>VQAv2</td><td>VizWiz</td></tr><tr><td rowspan="6">0</td><td>Frozen</td><td>29.5</td><td></td></tr><tr><td>VLKDViT-B/16</td><td>38.6</td><td>=</td></tr><tr><td>METALM</td><td>41.1</td><td>-</td></tr><tr><td>Flamingo-3B*</td><td>49.2</td><td>28.9</td></tr><tr><td>Flamingo-9B*</td><td>51.8</td><td>28.8</td></tr><tr><td>KoSMOS-1 (1.6B)</td><td>51.0</td><td>29.2</td></tr><tr><td rowspan="2">2</td><td>Flamingo-3B* [5]</td><td></td><td>-</td></tr><tr><td>Flamingo-9B*[5] KoSMOS-1 (1.6B)</td><td>-</td><td>=</td></tr><tr><td rowspan="3">4</td><td></td><td>51.4</td><td>31.4</td></tr><tr><td>Flamingo-3B* [5] Flamingo-9B* [5]</td><td>53.2 56.3</td><td>34.4 34.9</td></tr><tr><td>KoSMOS-1 (1.6B)</td><td>51.8</td><td>35.3</td></tr><tr><td rowspan="3">8</td><td>Flamingo-3B* [5]</td><td>55.4</td><td>38.4</td></tr><tr><td>Flamingo-9B* [5]</td><td>58.0</td><td>39.4</td></tr><tr><td>KOSMOS-1 (1.6B)</td><td>51.4</td><td>39.0</td></tr></table>
104
+
105
+ Table 2: $" * "$ : Flamingo [5] builds the zero-shot prompt with two examples from the downstream tasks where their corresponding images are removed (i.e., similar to few-shot text prompts) while the others evaluate true zero-shot learning.
106
+
107
+ average level of adults, KOSMOS-1 demonstrates the potential of MLLMs to perform zero-shot nonverbal reasoning by aligning perception with language models.
108
+
109
+ # 3.4 OCR-Free Language Understanding
110
+
111
+ OCR-free language understanding is a task that focuses on understanding text and images without relying on Optical Character Recognition (OCR). For example, during the Rendered SST-2 task [34], sentences from the Stanford Sentiment Treebank [48] dataset are rendered as images. The model is asked to predict the sentiment of the text within the images. The task evaluates a model’s ability to read and comprehend the meaning of words and sentences directly from the images.
112
+
113
+ As shown in Table 4a, KOSMOS-1 achieves a ROC AUC of $6 3 . 9 \%$ for the HatefulMemes validation set and a test accuracy of $6 7 . 1 \%$ for the Rendered SST-2 test set. It outperforms CLIP ViT-L and Flamingo-9B, which achieve AUCs of $6 3 . 3 \%$ and $5 7 . 0 \%$ on the HatefulMemes task. Note that Flamingo explicitly provides OCR text into the prompt, while KOSMOS-1 does not access any external tools or resources. This indicates that KOSMOS-1 has built-in abilities to read and comprehend the text in the rendered images.
114
+
115
+ <table><tr><td>Model</td><td>HatefulMemes</td><td>Rendered SST-2</td></tr><tr><td>CLIP ViT-B/32</td><td>57.6</td><td>59.6</td></tr><tr><td>CLIP ViT-B/16</td><td>61.7</td><td>59.8</td></tr><tr><td>CLIP ViT-L/14</td><td>63.3</td><td>64.0</td></tr><tr><td>Flamingo-3B</td><td>53.7</td><td>1</td></tr><tr><td>Flamingo-9B</td><td>57.0</td><td>-</td></tr><tr><td>KOSMOS-1 (1.6B)</td><td>63.9</td><td>67.1</td></tr></table>
116
+
117
+ (a) Zero-shot generalization on OCR-free language understanding. We report accuracy scores.
118
+
119
+ <table><tr><td>Model</td><td>EM F1</td></tr><tr><td>Using extracted text</td><td></td></tr><tr><td>LLM 7.6</td><td>17.9</td></tr><tr><td>KosMOs-1 15.8</td><td>31.3</td></tr><tr><td>Without using extracted text</td><td></td></tr><tr><td>KosMos-1 3.8</td><td>10.6</td></tr></table>
120
+
121
+ (b) Zero-shot performance on WebSRC task. We report exact match (EM) and F1 scores.
122
+
123
+ # 3.5 Web Page Question Answering
124
+
125
+ Web page question answering aims at finding answers to questions from web pages. It requires the model to comprehend both the semantics and the structure of texts (such as tables, lists, and
126
+
127
+ ![](images/73479714b923275a1b3dac025e6afa4299f70244a26e1a86d93243a4ac2e89a3.jpg)
128
+ Figure 3: In-context verbal descriptions can help KOSMOS-1 recognize visual categories better.
129
+
130
+ HTML layout). We compare the performance on the Web-based Structural Reading Comprehension (WebSRC) dataset [43]. For comparisons, we train a language model (LLM) on the same text corpora with the same training setup as in KOSMOS-1.
131
+
132
+ The experimental results are summarized in Table 4b. We observe that KOSMOS-1 outperforms the LLM, indicating that KOSMOS-1 can benefit from the layout and style information of web pages in images. In addition, we evaluate the performance of KOSMOS-1 without the extracted text in the prompt. It shows that extracted text has a contribution of $+ 1 2 . 0 / 2 0 . 7$ EM/F1 to KOSMOS-1, indicating that the benefit from modeling images does not sacrifice its language abilities.
133
+
134
+ # 3.6 Multimodal Chain-of-Thought Prompting
135
+
136
+ Chain-of-thought prompting [10] allows large language models to generate a series of reasoning steps and decompose a multi-step problem into intermediate steps, which can significantly improve the performance in complex tasks. Motivated by chain-of-thought prompting, we investigate a multimodal chain-of-thought prompting using KOSMOS-1. We break down perception-language tasks into two steps. In the first stage, given an image, we use a prompt to guide the model to generate a rationale. The model is then fed the rationale and a task-aware prompt to produce the final results.
137
+
138
+ We conduct experiments to evaluate the performance of the multimodal chain-of-thought prompting. Table 5a shows that multimodal chain-of-thought prompting achieves a score of 72.9, which is 5.8 points higher than the standard prompting. By generating intermediate content, the model can recognize the text in the images and infer the sentiment of the sentences more correctly.
139
+
140
+ <table><tr><td> Setings</td><td>Accuracy</td></tr><tr><td>Without Descriptions</td><td>61.7</td></tr><tr><td>With Descriptions</td><td>90.0</td></tr></table>
141
+
142
+ (b) Results of zero-shot image classification without and with verbal descriptions.
143
+
144
+ <table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>CLIP ViT-B/32</td><td>59.6</td></tr><tr><td>CLIP ViT-B/16</td><td>59.8</td></tr><tr><td>CLIP ViT-L/14</td><td>64.0</td></tr><tr><td>KosMOS-1</td><td>67.1</td></tr><tr><td>w/ multimodal CoT prompting</td><td>72.9</td></tr></table>
145
+
146
+ (a) Multimodal chain-of-thought (CoT) prompting on Rendered SST-2 task.
147
+
148
+ # 3.7 Zero-Shot Image Classification with Descriptions
149
+
150
+ The standard approach of image classification as above is to prompt the model for the specific name of the object depicted in the image. However, there are also some classification rules customized for different users and scenarios, such as the refined classification of complex animal subspecies. We can utilize natural language descriptions to guide KOSMOS-1 to distinguish images in the zero-shot setting, which makes the decision process more interpretable. Following CUB [44], we construct a bird classification dataset that contains images and natural-language descriptions of categories. The evaluation procedure is illustrated in Figure 3.
151
+
152
+ The evaluation results are shown in Table 5b. We observe that providing descriptions in context can significantly improve the accuracy of image classification. The consistent improvements indicate that KOSMOS-1 can perceive the intentions of instructions and well align the concepts in language modality with visual features in vision modality.
153
+
154
+ # 3.8 Language Tasks
155
+
156
+ The models are evaluated on the language tasks given task instructions (i.e., zero-shot) or several demonstration examples (i.e., few-shot). Text inputs are directly fed into the models as in vanilla language models. We train a language model (LLM) baseline with the same text corpora and training setup. We evaluate KOSMOS-1 and the LLM baseline on eight language tasks.
157
+
158
+ Table 6 presents the in-context learning performance of language tasks. KOSMOS-1 achieves comparable or even better performance in cloze completion and commonsense reasoning tasks when compared to LLM. In terms of the average result across all these datasets, LLM performs better in zero-shot and one-shot settings, whereas our model performs better in few-shot $k = 4$ ) settings. In addition, Section 3.9.2 shows that MLLMs learn better visual commonsense knowledge compared with LLMs.
159
+
160
+ <table><tr><td rowspan="2">Task</td><td colspan="2">Zero-shot</td><td colspan="2">One-shot</td><td colspan="2">Few-shot (k = 4)</td></tr><tr><td>LLM</td><td>KosMos-1</td><td>LLM</td><td>KoSMOS-1</td><td>LLM</td><td>KosMos-1</td></tr><tr><td>StoryCloze</td><td>72.9</td><td>72.1</td><td>72.9</td><td>72.2</td><td>73.1</td><td>72.3</td></tr><tr><td>HellaSwag</td><td>50.4</td><td>50.0</td><td>50.2</td><td>50.0</td><td>50.4</td><td>50.3</td></tr><tr><td>Winograd</td><td>71.6</td><td>69.8</td><td>71.2</td><td>68.4</td><td>70.9</td><td>69.8</td></tr><tr><td>Winogrande</td><td>56.7</td><td>54.8</td><td>56.7</td><td>54.5</td><td>57.0</td><td>55.7</td></tr><tr><td>PIQA</td><td>73.2</td><td>72.9</td><td>73.0</td><td>72.5</td><td>72.6</td><td>72.3</td></tr><tr><td>BoolQ</td><td>56.4</td><td>56.4</td><td>55.1</td><td>57.2</td><td>58.7</td><td>59.2</td></tr><tr><td>CB</td><td>39.3</td><td>44.6</td><td>41.1</td><td>48.2</td><td>42.9</td><td>53.6</td></tr><tr><td>COPA</td><td>68.0</td><td>63.0</td><td>69.0</td><td>64.0</td><td>69.0</td><td>64.0</td></tr><tr><td>Average</td><td>61.1</td><td>60.5</td><td>61.2</td><td>60.9</td><td>61.8</td><td>62.2</td></tr></table>
161
+
162
+ Table 6: Performance comparisons of language tasks between KOSMOS-1 and LLM. We use the same textual data and training setup to reimplement a language model. Both models do not use instruction tuning for fair comparisons.
163
+
164
+ # 3.9 Cross-modal Transfer
165
+
166
+ Cross-modal transferability allows a model to learn from one modality (such as text, image, audio, etc.) and transfer the knowledge to the other modalities. This skill can enable a model to perform various tasks across different modalities. In this part, we evaluate the cross-model transferability of KOSMOS-1 on several benchmarks.
167
+
168
+ # 3.9.1 Transfer from Language to Multimodal: Language-Only Instruction Tuning
169
+
170
+ To evaluate the effect of language-only instruction tuning, we conduct an ablation study using four datasets: COCO, Flickr30k, VQAv2, and VizWiz. These datasets consist of image captioning and visual questions anwsering. The evaluation metrics are: CIDEr scores for COCO/Flickr30k and VQA accuracy for VQAv2/VizWiz.
171
+
172
+ Table 7 shows the experimental results. Language-only instruction tuning boosts our model’s performance by 1.9 points on Flickr30k, 4.3 points on VQAv2, and 1.3 points on VizWiz. Our experiments show that language-only instruction tuning can significantly improve the model’s instructionfollowing capabilities across modalities. The results also indicate that our model can transfer the instruction-following capability from language to other modalities.
173
+
174
+ <table><tr><td>Model</td><td>CoCo</td><td>Flickr30k</td><td>VQAv2</td><td>VizWiz</td></tr><tr><td>Kosmos-1</td><td>84.7</td><td>67.1</td><td>51.0</td><td>29.2</td></tr><tr><td>w/o language-only instruction tuning</td><td>87.6</td><td>65.2</td><td>46.7</td><td>27.9</td></tr></table>
175
+
176
+ Table 7: Ablation study on language-only instruction tuning. We report CIDEr scores for COCO and Flickr30k, and VQA accuracy scores for VQAv2 and VizWiz.
177
+
178
+ # 3.9.2 Transfer from Multimodal to Language: Visual Commonsense Reasoning
179
+
180
+ Visual commonsense reasoning tasks require an understanding of the properties of everyday objects in the real world, such as color, size, and shape. These tasks are challenging for language models because they may require more information about object properties than what is available in texts. To investigate the visual commonsense capabilities, we compare the zero-shot performance of KOSMOS-1 and LLM on three object commonsense reasoning datasets, RELATIVESIZE [36], MEMORYCOLOR [37] and COLORTERMS [38] datasets. RELATIVESIZE contains 486 object pairs from 41 physical objects. The model is required to predict the size relation between two objects in a binary question-answering format with “Yes”/“No” answers. MEMORYCOLOR and COLORTERMS require the model to predict the color of objects from a set of 11 color labels in a multiple-choice format.
181
+
182
+ Table 8 presents the zero-shot performance of KOSMOS-1 and LLM on visual commonsense reasoning tasks. KOSMOS-1 significantly outperforms LLM by $1 . 5 \%$ on RELATIVESIZE, $1 4 . 7 \%$ on MEMORYCOLOR, and $9 . 7 \%$ on COLORTERMS dataset. The consistent improvements indicate that KOSMOS-1 benefits from the visual knowledge to complete the corresponding visual commonsense reasoning. The reason for KOSMOS-1’s superior performance is that it has modality transferability, which enables the model to transfer visual knowledge to language tasks. On the contrary, LLM has to rely on textual knowledge and clues to answer visual commonsense questions, which limits its ability to reason about object properties.
183
+
184
+ <table><tr><td>Model</td><td>Size Reasoning RELATIVESIZE</td><td>Color Reasoning MEMORYCOLOR</td><td>COLORTERMS</td></tr><tr><td>Using retrieved images VALM [49]</td><td>85.0</td><td>58.6</td><td>52.7</td></tr><tr><td>Language-only zero-shot evaluation</td><td></td><td></td><td></td></tr><tr><td>LLM</td><td>92.7</td><td>61.4</td><td>63.4</td></tr><tr><td>KosMos-1</td><td>94.2</td><td>76.1</td><td>73.1</td></tr></table>
185
+
186
+ Table 8: Zero-shot visual commonsense reasoning on RELATIVESIZE, MEMORYCOLOR, and COLORTERMS datasets. Accuracy scores are reported.
187
+
188
+ # 4 Related Work
189
+
190
+ In recent years, vision-language learning and representation models has garnered significant attention [2, 3, 4, 34, 50, 51, 52, 53, 54]. Previous vision-language models still exhibit limitations in instruction following, in-context abilities, and generalization capabilities for unseen tasks. Researchers have begun exploring more powerful multimodal large language models. Flamingo [5] trained its model from scratch and made it possible to generate text tokens conditioned on both visual and text inputs. Another category of research focus on learning multimodality abilities based on LLMs [7, 55, 56]. Meanwhile, some work [57, 58, 59] introduce visual instruction tuning to enhance instruction following capabilities.
191
+
192
+ # 5 Conclusion
193
+
194
+ In this work, we introduce KOSMOS-1, a multimodal large language model that can perceive general modalities, follow instructions, and perform in-context learning. The models trained on web-scale multimodal corpora achieve promising results across a wide range of language tasks and multimodal tasks. We show that going from LLMs to MLLMs enables new capabilities and opportunities. In the future, we would like to scale up KOSMOS-1 in terms of model size [13, 14, 60], and integrate the speech [12] capability into KOSMOS-1. In addition, KOSMOS-1 can be used as a unified interface for multimodal learning, e.g., enabling using instructions and examples to control text-to-image generation. We further discuss the limitations and broader societal impacts of KOSMOS-1 in the supplemental material.
195
+
196
+ # References
197
+
198
+ [1] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc., 2020.
199
+
200
+ [2] Maria Tsimpoukelli, Jacob Menick, Serkan Cabi, S. M. Ali Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. In Neural Information Processing Systems, 2021.
201
+
202
+ [3] Yaru Hao, Haoyu Song, Li Dong, Shaohan Huang, Zewen Chi, Wenhui Wang, Shuming Ma, and Furu Wei. Language models are general-purpose interfaces. ArXiv, abs/2206.06336, 2022.
203
+
204
+ [4] Wenhui Wang, Hangbo Bao, Li Dong, Johan Bjorck, Zhiliang Peng, Qiang Liu, Kriti Aggarwal, Owais Mohammed, Saksham Singhal, Subhojit Som, and Furu Wei. Image as a foreign language: BEiT pretraining for all vision and vision-language tasks. ArXiv, abs/2208.10442, 2022.
205
+
206
+ [5] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, Roman Ring, Eliza Rutherford, Serkan Cabi, Tengda Han, Zhitao Gong, Sina Samangooei, Marianne Monteiro, Jacob Menick, Sebastian Borgeaud, Andrew Brock, Aida Nematzadeh, Sahand Sharifzadeh, Mikolaj Binkowski, Ricardo Barreira, Oriol Vinyals, Andrew Zisserman, and Karen Simonyan. Flamingo: a visual language model for few-shot learning. In Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=EbMuimAbPbs.
207
+
208
+ [6] Armen Aghajanyan, Bernie Huang, Candace Ross, Vladimir Karpukhin, Hu Xu, Naman Goyal, Dmytro Okhonko, Mandar Joshi, Gargi Ghosh, Mike Lewis, and Luke Zettlemoyer. CM3: A causal masked multimodal model of the Internet. ArXiv, abs/2201.07520, 2022.
209
+
210
+ [7] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. BLIP-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. ArXiv, abs/2301.12597, 2023.
211
+
212
+ [8] John and Jean Raven. Raven Progressive Matrices, pages 223–237. Springer US, Boston, MA, 2003. ISBN 978-1-4615-0153-4. doi: 10.1007/978-1-4615-0153-4_11. URL https: //doi.org/10.1007/978-1-4615-0153-4_11.
213
+
214
+ [9] Patricia A Carpenter, Marcel A Just, and Peter Shell. What one intelligence test measures: a theoretical account of the processing in the raven progressive matrices test. Psychological review, 97(3):404, 1990.
215
+
216
+ [10] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903, 2022.
217
+
218
+ [11] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek B Rao, Parker Barnes, Yi Tay, Noam M. Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Benton C. Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier García, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Oliveira Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Díaz, Orhan Firat, Michele Catasta, Jason Wei, Kathleen S. Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. PaLM: Scaling language modeling with pathways. ArXiv, abs/2204.02311, 2022.
219
+
220
+ [12] Chengyi Wang, Sanyuan Chen, Yu Wu, Zi-Hua Zhang, Long Zhou, Shujie Liu, Zhuo Chen, Yanqing Liu, Huaming Wang, Jinyu Li, Lei He, Sheng Zhao, and Furu Wei. Neural codec language models are zero-shot text to speech synthesizers. ArXiv, abs/2301.02111, 2023.
221
+
222
+ [13] Shuming Ma, Hongyu Wang, Shaohan Huang, Wenhui Wang, Zewen Chi, Li Dong, Alon Benhaim, Barun Patra, Vishrav Chaudhary, Xia Song, and Furu Wei. TorchScale: Transformers at scale. CoRR, abs/2211.13184, 2022.
223
+
224
+ [14] Hongyu Wang, Shuming Ma, Shaohan Huang, Li Dong, Wenhui Wang, Zhiliang Peng, Yu Wu, Payal Bajaj, Saksham Singhal, Alon Benhaim, Barun Patra, Zhun Liu, Vishrav Chaudhary, Xia Song, and Furu Wei. Foundation transformers. CoRR, abs/2210.06423, 2022.
225
+
226
+ [15] Yutao Sun, Li Dong, Barun Patra, Shuming Ma, Shaohan Huang, Alon Benhaim, Vishrav Chaudhary, Xia Song, and Furu Wei. A length-extrapolatable transformer. arXiv preprint arXiv:2212.10554, 2022.
227
+
228
+ [16] Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. The pile: An $8 0 0 \mathrm { g b }$ dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027, 2020.
229
+
230
+ [17] Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053, 2019.
231
+
232
+ [18] Shaden Smith, Mostofa Patwary, Brandon Norick, Patrick LeGresley, Samyam Rajbhandari, Jared Casper, Zhun Liu, Shrimai Prabhumoye, George Zerveas, Vijay Korthikanti, Elton Zhang, Rewon Child, Reza Yazdani Aminabadi, Julie Bernauer, Xia Song, Mohammad Shoeybi, Yuxiong He, Michael Houston, Saurabh Tiwary, and Bryan Catanzaro. Using DeepSpeed and Megatron to train Megatron-Turing NLG 530B, a large-scale generative language model, 2022.
233
+
234
+ [19] Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion5b: An open large-scale dataset for training next generation image-text models. arXiv preprint arXiv:2210.08402, 2022.
235
+
236
+ [20] Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. Laion-400m: Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021.
237
+
238
+ [21] Minwoo Byeon, Beomhee Park, Haecheon Kim, Sungjun Lee, Woonhyuk Baek, and Saehoon Kim. Coyo-700m: Image-text pair dataset, 2022.
239
+
240
+ [22] Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 2556–2565. Association for Computational Linguistics, 2018.
241
+
242
+ [23] Soravit Changpinyo, Piyush Sharma, Nan Ding, and Radu Soricut. Conceptual 12m: Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3558–3568, 2021.
243
+
244
+ [24] Or Honovich, Thomas Scialom, Omer Levy, and Timo Schick. Unnatural instructions: Tuning language models with (almost) no human labor, 2022. URL https://arxiv.org/abs/2212. 09689.
245
+
246
+ [25] Shayne Longpre, Le Hou, Tu Vu, Albert Webson, Hyung Won Chung, Yi Tay, Denny Zhou, Quoc V Le, Barret Zoph, Jason Wei, et al. The flan collection: Designing data and methods for effective instruction tuning. arXiv preprint arXiv:2301.13688, 2023.
247
+
248
+ [26] Nasrin Mostafazadeh, Michael Roth, Annie Louis, Nathanael Chambers, and James Allen. Lsdsem 2017 shared task: The story cloze test. In Proceedings of the 2nd Workshop on Linking Models of Lexical, Sentential and Discourse-level Semantics, pages 46–51, 2017.
249
+
250
+ [27] Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019.
251
+
252
+ [28] Hector Levesque, Ernest Davis, and Leora Morgenstern. The winograd schema challenge. In Thirteenth International Conference on the Principles of Knowledge Representation and Reasoning, 2012.
253
+
254
+ [29] Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. WinoGrande: An adversarial winograd schema challenge at scale. In AAAI, pages 8732–8740, 2020.
255
+
256
+ [30] Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. Piqa: Reasoning about physical commonsense in natural language. In Thirty-Fourth AAAI Conference on Artificial Intelligence, 2020.
257
+
258
+ [31] Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. BoolQ: Exploring the surprising difficulty of natural yes/no questions. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 2924–2936, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1300. URL https://aclanthology.org/N19-1300.
259
+
260
+ [32] Marie-Catherine de Marneffe, Mandy Simons, and Judith Tonhauser. The CommitmentBank: Investigating projection in naturally occurring discourse. Proceedings of Sinn und Bedeutung, 23(2):107–124, Jul. 2019.
261
+
262
+ [33] Melissa Roemmele, Cosmin Adrian Bejan, and Andrew S. Gordon. Choice of plausible alternatives: An evaluation of commonsense causal reasoning. In AAAI Spring Symposium, 2011.
263
+
264
+ [34] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pages 8748–8763. PMLR, 2021.
265
+
266
+ [35] Douwe Kiela, Hamed Firooz, Aravind Mohan, Vedanuj Goswami, Amanpreet Singh, Pratik Ringshia, and Davide Testuggine. The hateful memes challenge: Detecting hate speech in multimodal memes. In Advances in Neural Information Processing Systems, volume 33, pages 2611–2624, 2020.
267
+
268
+ [36] Hessam Bagherinezhad, Hannaneh Hajishirzi, Yejin Choi, and Ali Farhadi. Are elephants bigger than butterflies? reasoning about sizes of objects. ArXiv, abs/1602.00753, 2016.
269
+
270
+ [37] Tobias Norlund, Lovisa Hagström, and Richard Johansson. Transferring knowledge from vision to language: How to achieve it and how to measure it? ArXiv, abs/2109.11321, 2021.
271
+
272
+ [38] Elia Bruni, Gemma Boleda, Marco Baroni, and Nam Khanh Tran. Distributional semantics in technicolor. In ACL, 2012.
273
+
274
+ [39] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, pages 740–755, 2014.
275
+
276
+ [40] Peter Young, Alice Lai, Micah Hodosh, and Julia Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. TACL, 2:67–78, 2014.
277
+
278
+ [41] Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the v in vqa matter: Elevating the role of image understanding in visual question answering. In CVPR, pages 6325–6334, 2017.
279
+
280
+ [42] Danna Gurari, Qing Li, Abigale J Stangl, Anhong Guo, Chi Lin, Kristen Grauman, Jiebo Luo, and Jeffrey P Bigham. Vizwiz grand challenge: Answering visual questions from blind people. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3608–3617, 2018.
281
+
282
+ [43] Xingyu Chen, Zihan Zhao, Lu Chen, JiaBao Ji, Danyang Zhang, Ao Luo, Yuxuan Xiong, and Kai Yu. WebSRC: A dataset for web-based structural reading comprehension. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 4173–4185, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.343. URL https://aclanthology.org/ 2021.emnlp-main.343.
283
+
284
+ [44] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge J. Belongie. The caltech-ucsd birds-200-2011 dataset. 2011.
285
+
286
+ [45] Yoad Tewel, Yoav Shalev, Idan Schwartz, and Lior Wolf. Zerocap: Zero-shot image-to-text generation for visual-semantic arithmetic. 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 17897–17907, 2021.
287
+
288
+ [46] Wenliang Dai, Lu Hou, Lifeng Shang, Xin Jiang, Qun Liu, and Pascale Fung. Enabling multimodal generation on CLIP via vision-language knowledge distillation. In Findings of the Association for Computational Linguistics: ACL 2022, pages 2383–2395, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.findings-acl.187. URL https://aclanthology.org/2022.findings-acl.187.
289
+
290
+ [47] Woojeong Jin, Yu Cheng, Yelong Shen, Weizhu Chen, and Xiang Ren. A good prompt is worth millions of parameters: Low-resource prompt-based learning for vision-language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2763–2775, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.197. URL https://aclanthology.org/2022.acl-long.197.
291
+
292
+ [48] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631–1642, Seattle, Washington, USA, October 2013. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/D13-1170.
293
+
294
+ [49] Weizhi Wang, Li Dong, Hao Cheng, Haoyu Song, Xiaodong Liu, Xifeng Yan, Jianfeng Gao, and Furu Wei. Visually-augmented language modeling. In International Conference on Learning Representations, 2023.
295
+
296
+ [50] Jiahui Yu, Zirui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, and Yonghui Wu. Coca: Contrastive captioners are image-text foundation models, 2022.
297
+
298
+ [51] Rohit Girdhar, Alaaeldin El-Nouby, Zhuang Liu, Mannat Singh, Kalyan Vasudev Alwala, Armand Joulin, and Ishan Misra. Imagebind: One embedding space to bind them all. In CVPR, 2023.
299
+
300
+ [52] Xi Chen, Xiao Wang, Soravit Changpinyo, AJ Piergiovanni, Piotr Padlewski, Daniel Salz, Sebastian Goodman, Adam Grycner, Basil Mustafa, Lucas Beyer, et al. Pali: A jointly-scaled multilingual language-image model. arXiv:2209.06794, 2022.
301
+
302
+ [53] Xi Chen, Josip Djolonga, Piotr Padlewski, Basil Mustafa, Soravit Changpinyo, Jialin Wu, Carlos Riquelme Ruiz, Sebastian Goodman, Xiao Wang, Yi Tay, et al. Pali-x: On scaling up a multilingual vision and language model. arXiv preprint arXiv:2305.18565, 2023.
303
+
304
+ [54] OpenAI. Gpt-4 technical report, 2023.
305
+
306
+ [55] Peng Gao, Jiaming Han, Renrui Zhang, Ziyi Lin, Shijie Geng, Aojun Zhou, Wei Zhang, Pan Lu, Conghui He, Xiangyu Yue, Hongsheng Li, and Yu Qiao. Llama-adapter v2: Parameter-efficient visual instruction model, 2023.
307
+
308
+ [56] Danny Driess, Fei Xia, Mehdi SM Sajjadi, Corey Lynch, Aakanksha Chowdhery, Brian Ichter, Ayzaan Wahid, Jonathan Tompson, Quan Vuong, Tianhe Yu, et al. Palm-e: An embodied multimodal language model. arXiv preprint arXiv:2303.03378, 2023.
309
+
310
+ [57] Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. arXiv preprint arXiv:2304.08485, 2023.
311
+
312
+ [58] Deyao Zhu, Jun Chen, Xiaoqian Shen, Xiang Li, and Mohamed Elhoseiny. Minigpt-4: Enhancing vision-language understanding with advanced large language models. arXiv preprint arXiv:2304.10592, 2023.
313
+ [59] Wenliang Dai, Junnan Li, Dongxu Li, Anthony Meng Huat Tiong, Junqi Zhao, Weisheng Wang, Boyang Li, Pascale Fung, and Steven Hoi. Instructblip: Towards general-purpose vision-language models with instruction tuning. arXiv:2305.06500, 2023.
314
+ [60] Zewen Chi, Li Dong, Shaohan Huang, Damai Dai, Shuming Ma, Barun Patra, Saksham Singhal, Payal Bajaj, Xia Song, Xian-Ling Mao, Heyan Huang, and Furu Wei. On the representation collapse of sparse mixture of experts. In Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=mWaYC6CZf5.
315
+ [61] Michihiro Yasunaga, Armen Aghajanyan, Weijia Shi, Rich James, Jure Leskovec, Percy Liang, Mike Lewis, Luke Zettlemoyer, and Wen tau Yih. Retrieval-augmented multimodal language modeling. ArXiv, abs/2211.12561, 2022.
316
+ [62] Jing Yu Koh, Ruslan Salakhutdinov, and Daniel Fried. Grounding language models to images for multimodal generation. arXiv preprint arXiv:2301.13823, 2023.
parse/dev/UpN2wfrLec/UpN2wfrLec_content_list.json ADDED
@@ -0,0 +1,1716 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Language Is Not All You Need: Aligning Perception with Language Models ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 187,
8
+ 122,
9
+ 812,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Shaohan Huang∗, Li Dong∗, Wenhui Wang∗, Yaru Hao∗, Saksham Singhal∗, Shuming Ma∗ Tengchao Lv, Lei Cui, Owais Khan Mohammed, Barun Patra, Qiang Liu, Kriti Aggarwal Zewen Chi, Johan Bjorck, Vishrav Chaudhary, Subhojit Som, Xia Song, Furu Wei† Microsoft https://github.com/microsoft/unilm ",
17
+ "bbox": [
18
+ 199,
19
+ 217,
20
+ 800,
21
+ 287
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 309,
32
+ 535,
33
+ 325
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "A big convergence of language, multimodal perception, action, and world modeling is a key step toward artificial general intelligence. In this work, we introduce KOSMOS-1, a Multimodal Large Language Model (MLLM) that can perceive general modalities, learn in context (i.e., few-shot), and follow instructions (i.e., zero-shot). Specifically, we train KOSMOS-1 from scratch on web-scale multimodal corpora, including arbitrarily interleaved text and images, image-caption pairs, and text data. We evaluate various settings, including zero-shot, few-shot, and multimodal chain-of-thought prompting, on a wide range of tasks without any gradient updates or finetuning. Experimental results show that KOSMOS-1 achieves impressive performance on (i) language understanding, generation, and even OCR-free NLP (directly fed with document images), (ii) perception-language tasks, including multimodal dialogue, image captioning, visual question answering, and (iii) vision tasks, such as image recognition with descriptions (specifying classification via text instructions). We also show that MLLMs can benefit from cross-modal transfer, i.e., transfer knowledge from language to multimodal, and from multimodal to language. In addition, we introduce a dataset of Raven IQ test, which diagnoses the nonverbal reasoning capability of MLLMs. ",
40
+ "bbox": [
41
+ 233,
42
+ 340,
43
+ 766,
44
+ 575
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 Introduction: From LLMs to MLLMs ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 598,
55
+ 524,
56
+ 616
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Large language models (LLMs) have successfully served as a general-purpose interface across various natural language tasks [1]. The LLM-based interface can be adapted to a task as long as we are able to transform the input and output into texts. For example, the input of the summarization task is a document and the output is its summary. So we can feed the input document into the language model and then produce the generated summary. ",
63
+ "bbox": [
64
+ 174,
65
+ 630,
66
+ 825,
67
+ 700
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Despite the successful applications in natural language processing, it is still struggling to natively use LLMs for multimodal data, such as image, and audio. Being a basic part of intelligence, multimodal perception is a necessity to achieve artificial general intelligence, in terms of knowledge acquisition and grounding to the real world. More importantly, unlocking multimodal input [2, 3, 4, 5, 6, 7] greatly widens the applications of language models to more high-value areas, such as multimodal machine learning, document intelligence, and robotics. ",
74
+ "bbox": [
75
+ 174,
76
+ 707,
77
+ 825,
78
+ 790
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "In this work, we introduce KOSMOS-1, a Multimodal Large Language Model (MLLM) that can perceive general modalities, follow instructions (i.e., zero-shot learning), and learn in context (i.e., few-shot learning). The goal is to align perception with LLMs, so that the models are able to see and talk. To be specific, we follow METALM [3] to train the KOSMOS-1 model from scratch. As shown in Figure 1, a Transformer-based language model is regarded as the general-purpose interface, and perception modules are docked with the language model. We train the model on web-scale multimodal corpora, i.e., text data, arbitrarily interleaved images and texts, and image-caption pairs. In addition, we calibrate the instruction-following capability across modalities by transferring language-only data. ",
85
+ "bbox": [
86
+ 174,
87
+ 796,
88
+ 825,
89
+ 878
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "image",
95
+ "img_path": "images/8e3232a1c4f23f7b25cb3ce3da7195272b497bbf8c8cfd492e0f378fc617ec3b.jpg",
96
+ "image_caption": [
97
+ "Figure 1: KOSMOS-1 is a multimodal large language model (MLLM) that is capable of perceiving multimodal input, following instructions, and performing in-context learning for not only language tasks but also multimodal tasks. In this work, we align vision with large language models (LLMs), advancing the trend of going from LLMs to MLLMs. "
98
+ ],
99
+ "image_footnote": [],
100
+ "bbox": [
101
+ 199,
102
+ 84,
103
+ 799,
104
+ 300
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "",
111
+ "bbox": [
112
+ 174,
113
+ 396,
114
+ 823,
115
+ 425
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "The KOSMOS-1 model natively supports language, perception-language, and vision tasks. In addition to various natural language tasks, the KOSMOS-1 models natively handle a wide range of perceptionintensive tasks, spanning visual dialogue, visual explanation, visual question answering, image captioning, simple math equation, OCR, and zero-shot image classification with descriptions. We also build an IQ test benchmark following Raven’s Progressive Matrices [8, 9], which evaluates the capability of nonverbal reasoning for MLLMs. The examples show that the native support of multimodal perception enables new opportunities to apply LLMs to new tasks. Moreover, we show that MLLMs achieve better commonsense reasoning performance compared with LLMs, which indicates cross-modal transfer helps knowledge acquisition. ",
122
+ "bbox": [
123
+ 174,
124
+ 431,
125
+ 825,
126
+ 556
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "The key takeaways are as follows: ",
133
+ "bbox": [
134
+ 176,
135
+ 563,
136
+ 398,
137
+ 577
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "From LLMs to MLLMs. Properly handling perception is a necessary step toward artificial general intelligence. The capability of perceiving multimodal input is critical to LLMs. First, multimodal perception enables LLMs to acquire commonsense knowledge beyond text descriptions. Second, aligning perception with LLMs opens the door to new tasks, such as robotics, and document intelligence. Third, the capability of perception unifies various APIs, as graphical user interfaces are the most natural and unified way to interact with. For example, MLLMs can directly read the screen or extract numbers from receipts. We train the KOSMOS-1 models on web-scale multimodal corpora, which ensures that the model robustly learns from diverse sources. We not only use a large-scale text corpus but also mine high-quality image-caption pairs and arbitrarily interleaved image and text documents from the web. ",
144
+ "bbox": [
145
+ 174,
146
+ 590,
147
+ 825,
148
+ 729
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "Language models as general-purpose interfaces. Following the philosophy proposed in METALM [3], we regard language models as a universal task layer. Because of the open-ended output space, we are able to unify various task predictions as texts. Moreover, natural-language instructions and action sequences (such as programming language) can be well handled by language models. LLMs also serve as basic reasoners [10], which is complementary to perception modules on complex tasks. So it is natural to align world, action, and multimodal perception with the general-purpose interface, i.e., language models. ",
155
+ "bbox": [
156
+ 174,
157
+ 744,
158
+ 825,
159
+ 842
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "New capabilities of MLLMs. Apart from the capabilities found in previous LLMs [1, 11], MLLMs enable new usages and possibilities. First, we can conduct zero- and few-shot multimodal learning by using natural language instructions and demonstration examples. Second, we observe promising signals of nonverbal reasoning by evaluating the Raven IQ test, which measures the fluid reasoning ability of humans. Third, MLLMs naturally support multi-turn interactions for general modalities, such as multimodal dialogue. ",
166
+ "bbox": [
167
+ 176,
168
+ 856,
169
+ 823,
170
+ 911
171
+ ],
172
+ "page_idx": 1
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "",
177
+ "bbox": [
178
+ 173,
179
+ 92,
180
+ 825,
181
+ 119
182
+ ],
183
+ "page_idx": 2
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "2 KOSMOS-1: A Multimodal Large Language Model ",
188
+ "text_level": 1,
189
+ "bbox": [
190
+ 174,
191
+ 138,
192
+ 630,
193
+ 157
194
+ ],
195
+ "page_idx": 2
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "KOSMOS-1 is a multimodal language model that can perceive general modalities, follow instructions, learn in context, and generate outputs. Given the previous context, the model learns to generate texts in an auto-regressive manner. Specifically, the backbone of KOSMOS-1 is a Transformer-based causal language model. Apart from text, other modalities are embedded and fed into the language model. The Transformer decoder serves as a general-purpose interface to multimodal input. We train KOSMOS-1 on multimodal corpora, including monomodal data, cross-modal paired data, and interleaved multimodal data. Once the models are trained, we can directly evaluate the models in zero-shot and few-shot settings on both language tasks and multimodal tasks. ",
200
+ "bbox": [
201
+ 174,
202
+ 171,
203
+ 825,
204
+ 282
205
+ ],
206
+ "page_idx": 2
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "2.1 Input Representation ",
211
+ "text_level": 1,
212
+ "bbox": [
213
+ 174,
214
+ 299,
215
+ 361,
216
+ 315
217
+ ],
218
+ "page_idx": 2
219
+ },
220
+ {
221
+ "type": "text",
222
+ "text": "The Transformer decoder perceives general modalities in a unified way. For input format, we flatten input as a sequence decorated with special tokens. Specifically, we use $\\mathtt { < s > }$ and $< / { \\mathsf { s } } { \\mathsf { > } }$ to denote startand end-of-sequence. The special tokens <image> and </image> indicate the beginning and end of encoded image embeddings. For example, $\\ \" < \\mathsf { s } >$ document $< / { \\mathsf { s } } > ^ { , , }$ is a text input, and $\\ \" < \\mathsf { s } >$ paragraph <image> Image Embedding </image> paragraph $< / { \\mathsf { s } } > ^ { , \\mathsf { \\curlyeq } }$ is an interleaved image-text input. ",
223
+ "bbox": [
224
+ 174,
225
+ 325,
226
+ 825,
227
+ 395
228
+ ],
229
+ "page_idx": 2
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "An embedding module is used to encode both text tokens and other input modalities into vectors. Then the embeddings are fed into the decoder. For text tokens, we use a lookup table to map them into embeddings. For the modalities of continuous signals (e.g., image, and audio), it is also feasible to represent inputs as discrete code and then regard them as “foreign languages” [4, 12]. In this work, following [3], we employ a vision encoder as the embedding module for input images. In addition, Resampler [5] is used as an attentive pooling mechanism to reduce the number of image embeddings. ",
234
+ "bbox": [
235
+ 174,
236
+ 401,
237
+ 825,
238
+ 486
239
+ ],
240
+ "page_idx": 2
241
+ },
242
+ {
243
+ "type": "text",
244
+ "text": "2.2 Multimodal Large Language Models (MLLMs) ",
245
+ "text_level": 1,
246
+ "bbox": [
247
+ 174,
248
+ 501,
249
+ 542,
250
+ 517
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "text",
256
+ "text": "After obtaining the embeddings of an input sequence, we feed them into the Transformer-based decoder. The left-to-right causal model processes the sequence in an auto-regressive manner, which produces the next token by conditioning on past timesteps. The causal masking is used to mask out future information. A softmax classifier upon Transformer is used to generate tokens over the vocabulary. ",
257
+ "bbox": [
258
+ 174,
259
+ 527,
260
+ 825,
261
+ 597
262
+ ],
263
+ "page_idx": 2
264
+ },
265
+ {
266
+ "type": "text",
267
+ "text": "MLLMs serve as general-purpose interfaces [3] that can perform interactions with both natural language and multimodal input. The framework is flexible to handle various data types, as long as we can represent input as vectors. MLLMs combine the best of two worlds. First, the language models naturally inherit the capabilities of in-context learning and instruction following. Second, perception is aligned with language models by training on multimodal corpora. ",
268
+ "bbox": [
269
+ 174,
270
+ 603,
271
+ 825,
272
+ 674
273
+ ],
274
+ "page_idx": 2
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "The implementation is based on the library TorchScale [13], which is designed for large-scale model training. Compared with the standard Transformer architecture, we include the following modifications: We use MAGNETO [14], a Transformer variant, as the backbone architecture and XPOS [15] relative position encoding for better long-context modeling. ",
279
+ "bbox": [
280
+ 174,
281
+ 679,
282
+ 825,
283
+ 736
284
+ ],
285
+ "page_idx": 2
286
+ },
287
+ {
288
+ "type": "text",
289
+ "text": "2.3 Multimodal Training Data ",
290
+ "text_level": 1,
291
+ "bbox": [
292
+ 174,
293
+ 752,
294
+ 397,
295
+ 767
296
+ ],
297
+ "page_idx": 2
298
+ },
299
+ {
300
+ "type": "text",
301
+ "text": "The models are trained on web-scale multimodal corpora. The training datasets consist of text corpora, image-caption pairs, and interleaved data of images and texts. ",
302
+ "bbox": [
303
+ 173,
304
+ 777,
305
+ 825,
306
+ 806
307
+ ],
308
+ "page_idx": 2
309
+ },
310
+ {
311
+ "type": "text",
312
+ "text": "Text Corpora We train our model with The Pile [16] and Common Crawl (CC). The Pile is a massive English text dataset built for training large-scale language models. We exclude data splits from GitHub, arXiv, Stack Exchange, and PubMed Central. We also include the Common Crawl snapshots (2020-50 and 2021-04) datasets, CC-Stories, and RealNews datasets [17, 18]. ",
313
+ "bbox": [
314
+ 174,
315
+ 821,
316
+ 825,
317
+ 878
318
+ ],
319
+ "page_idx": 2
320
+ },
321
+ {
322
+ "type": "text",
323
+ "text": "Image-Caption Pairs The image-caption pairs are constructed from several datasets, including English LAION-2B [19], LAION-400M [20], COYO-700M [21], and Conceptual Captions [22, 23]. ",
324
+ "bbox": [
325
+ 173,
326
+ 883,
327
+ 823,
328
+ 911
329
+ ],
330
+ "page_idx": 2
331
+ },
332
+ {
333
+ "type": "text",
334
+ "text": "English LAION-2B, LAION-400M, and COYO-700M are collected from web pages of the Common Crawl web data by extracting image sources and the corresponding alt-text. Conceptual Captions are also from internet web pages. ",
335
+ "bbox": [
336
+ 174,
337
+ 90,
338
+ 823,
339
+ 133
340
+ ],
341
+ "page_idx": 3
342
+ },
343
+ {
344
+ "type": "text",
345
+ "text": "Interleaved Image-Text Data We collect interleaved multimodal data from the Common Crawl snapshot, which is a publicly available archive of web pages. We use a filtering process to select about 71 millions web pages from the original 2 billions web pages in the snapshot. We then extract the text and images from the HTML of each selected web page. ",
346
+ "bbox": [
347
+ 174,
348
+ 142,
349
+ 825,
350
+ 199
351
+ ],
352
+ "page_idx": 3
353
+ },
354
+ {
355
+ "type": "text",
356
+ "text": "2.4 Training Objective ",
357
+ "text_level": 1,
358
+ "bbox": [
359
+ 174,
360
+ 220,
361
+ 343,
362
+ 236
363
+ ],
364
+ "page_idx": 3
365
+ },
366
+ {
367
+ "type": "text",
368
+ "text": "The KOSMOS-1 training is conducted on web-scale multimodal corpora, including monomodal data (e.g., text corpus), cross-modal paired data (e.g., image-caption pairs), and interleaved multimodal data (e.g., documents of arbitrarily interleaved images and texts). To be specific, we use monomodal data for representation learning. For example, language modeling with text data pretrains instruction following, in-context learning, and various language tasks. Moreover, cross-modal pairs and interleaved data learn to align the perception of general modalities with language models. Interleaved data also naturally fit in the multimodal language modeling task. We present more details of training data collection in the supplemental material. ",
369
+ "bbox": [
370
+ 174,
371
+ 247,
372
+ 825,
373
+ 359
374
+ ],
375
+ "page_idx": 3
376
+ },
377
+ {
378
+ "type": "text",
379
+ "text": "The models are trained with the next-token prediction task, i.e., learning to generate the next token depending on the previous context. The training objective is to maximize the log-likelihood of tokens in examples. Notice that only discrete tokens, such as text tokens, are accounted for in the training loss. Multimodal language modeling is a scalable way to train the models. More importantly, the emergence of various capabilities makes the training task favorable for downstream applications. ",
380
+ "bbox": [
381
+ 174,
382
+ 366,
383
+ 825,
384
+ 435
385
+ ],
386
+ "page_idx": 3
387
+ },
388
+ {
389
+ "type": "text",
390
+ "text": "3 Experiments ",
391
+ "text_level": 1,
392
+ "bbox": [
393
+ 174,
394
+ 460,
395
+ 312,
396
+ 477
397
+ ],
398
+ "page_idx": 3
399
+ },
400
+ {
401
+ "type": "text",
402
+ "text": "3.1 Training Setup ",
403
+ "text_level": 1,
404
+ "bbox": [
405
+ 174,
406
+ 494,
407
+ 316,
408
+ 510
409
+ ],
410
+ "page_idx": 3
411
+ },
412
+ {
413
+ "type": "text",
414
+ "text": "We train KOSMOS-1 with 1.6 billion parameters using a mix of text corpora, image-caption pairs, and interleaved data. We use Magneto’s initialization for optimization stability and a pretrained CLIP ViT-L/14 model for image representation. The model is trained for $3 0 0 \\mathrm { k }$ steps using a batch size of 1.2 million tokens and the AdamW optimizer. We adopt a learning rate warm-up and decay schedule, and use SentencePiece for tokenization. ",
415
+ "bbox": [
416
+ 174,
417
+ 522,
418
+ 825,
419
+ 592
420
+ ],
421
+ "page_idx": 3
422
+ },
423
+ {
424
+ "type": "text",
425
+ "text": "To improve instruction-following capabilities, we perform language-only instruction tuning using Unnatural Instructions [24] and FLANv2 [25] datasets. This tuning process is conducted as language modeling, and improvements transfer across modalities. More details about hyperparameters can be found in the supplemental material. ",
426
+ "bbox": [
427
+ 174,
428
+ 598,
429
+ 825,
430
+ 654
431
+ ],
432
+ "page_idx": 3
433
+ },
434
+ {
435
+ "type": "text",
436
+ "text": "Table 1 summarizes the corresponding datasets and what capabilities we would like to evaluate. We evaluate different capabilities related to language, perception-language and vision. ",
437
+ "bbox": [
438
+ 176,
439
+ 660,
440
+ 823,
441
+ 688
442
+ ],
443
+ "page_idx": 3
444
+ },
445
+ {
446
+ "type": "text",
447
+ "text": "3.2 Perception-Language Tasks ",
448
+ "text_level": 1,
449
+ "bbox": [
450
+ 176,
451
+ 710,
452
+ 405,
453
+ 724
454
+ ],
455
+ "page_idx": 3
456
+ },
457
+ {
458
+ "type": "text",
459
+ "text": "Image Captioning Table 2a shows the captioning performance on COCO [39] Karpathy test split and Flickr30k [40] test set. KOSMOS-1 achieves remarkable results in zero-shot setting on two image captioning datasets. Specifically, our model achieves a CIDEr score of 67.1 on the Flickr30k dataset, compared to 60.6 and 61.5 for the Flamingo-3B and Flamingo-9B models, respectively. Notably, our model is able to accomplish this feat with a smaller size of 1.6B, compared to Flamingo models. This demonstrates our model’s superiority in zero-shot image captioning. ",
460
+ "bbox": [
461
+ 174,
462
+ 737,
463
+ 825,
464
+ 821
465
+ ],
466
+ "page_idx": 3
467
+ },
468
+ {
469
+ "type": "text",
470
+ "text": "Visual Question Answering Table 2b reports the visual question answering results on VQAv2 [41] and VizWiz [42]. We show that KOSMOS-1 can better handle the diversity and complexity of the VizWiz dataset. KOSMOS-1 achieves higher accuracy and robustness than Flamingo-3B and Flamingo-9B models on zero-shot settings. In addition, our model is competitive with Flamingo on the VQAv2 dataset. ",
471
+ "bbox": [
472
+ 174,
473
+ 842,
474
+ 823,
475
+ 911
476
+ ],
477
+ "page_idx": 3
478
+ },
479
+ {
480
+ "type": "table",
481
+ "img_path": "images/fb05bd9e6b45f4f4a15930e2ccc1d1343a5cc9faa880f00294b1ad19b35bb3d1.jpg",
482
+ "table_caption": [],
483
+ "table_footnote": [
484
+ "Table 1: We evaluate the capabilities of KOSMOS-1 on language, perception-language, and vision tasks under both zero- and few-shot learning settings. "
485
+ ],
486
+ "table_body": "<table><tr><td>Dataset</td><td>Task description</td><td>Metric</td><td>Zero-shot</td><td>Few-shot</td></tr><tr><td colspan=\"5\">Language tasks</td></tr><tr><td>StoryCloze [26]</td><td>Commonsense reasoning</td><td>Accuracy</td><td></td><td></td></tr><tr><td>HellaSwag [27]</td><td>Commonsense NLI</td><td>Accuracy</td><td></td><td></td></tr><tr><td>Winograd [28]</td><td>Word ambiguity</td><td>Accuracy</td><td></td><td></td></tr><tr><td>Winogrande [29]</td><td>Word ambiguity</td><td>Accuracy</td><td></td><td></td></tr><tr><td>PIQA [30]</td><td>Physical commonsense</td><td>Accuracy</td><td></td><td></td></tr><tr><td>BoolQ[31]</td><td>Question answering</td><td>Accuracy</td><td></td><td></td></tr><tr><td>CB [32]</td><td>Textual entailment</td><td>Accuracy</td><td></td><td>vvνvvvvv</td></tr><tr><td>COPA [33]</td><td>Causal reasoning</td><td>Accuracy</td><td></td><td></td></tr><tr><td>Rendered SST-2 [34]</td><td>OCR-free sentiment classification</td><td>Accuracy</td><td></td><td></td></tr><tr><td>HatefulMemes [35]</td><td>OCR-free meme classification</td><td>ROC AUC</td><td></td><td></td></tr><tr><td colspan=\"5\">Cross-modal transfer</td></tr><tr><td>RelativeSize [36]</td><td>Commonsense reasoning (object size)</td><td>Accuracy</td><td>√</td><td></td></tr><tr><td>MemoryColor [37]</td><td>Commonsense reasoning (object color)</td><td>Accuracy</td><td>√</td><td></td></tr><tr><td>ColorTerms [38]</td><td>Commonsense reasoning (object color)</td><td>Accuracy</td><td>√</td><td></td></tr><tr><td colspan=\"5\">Nonverbal reasoning tasks</td></tr><tr><td>IQ Test</td><td>Raven&#x27;s Progressive Matrices</td><td>Accuracy</td><td>√</td><td></td></tr><tr><td colspan=\"5\">Perception-language tasks</td></tr><tr><td>COCO Caption [39]</td><td>Image captioning</td><td>CIDEr, etc.</td><td></td><td></td></tr><tr><td>Flicker30k [40]</td><td>Image captioning</td><td>CIDEr, etc.</td><td></td><td></td></tr><tr><td>VQAv2 [41]</td><td>Visual question answering</td><td>VQA acc.</td><td></td><td>&lt;&lt;vv</td></tr><tr><td>VizWiz[42]</td><td>Visual question answering</td><td>VQA acc.</td><td></td><td></td></tr><tr><td>WebSRC[43]</td><td>Web page question answering</td><td>F1 score</td><td></td><td></td></tr><tr><td colspan=\"5\">Vision tasks</td></tr><tr><td>CUB [44]</td><td>Zero-shot image classification with descriptions</td><td>Accuracy</td><td></td><td></td></tr></table>",
487
+ "bbox": [
488
+ 191,
489
+ 88,
490
+ 805,
491
+ 420
492
+ ],
493
+ "page_idx": 4
494
+ },
495
+ {
496
+ "type": "text",
497
+ "text": "3.3 IQ Test: Nonverbal Reasoning ",
498
+ "text_level": 1,
499
+ "bbox": [
500
+ 174,
501
+ 483,
502
+ 424,
503
+ 500
504
+ ],
505
+ "page_idx": 4
506
+ },
507
+ {
508
+ "type": "text",
509
+ "text": "Raven’s Progressive Matrices [9, 8] is one of the most common tests to evaluate nonverbal reasoning. The capability of nonverbal reasoning is typically a reflection of an individual’s intelligence quotientWhich option can complete the matrix? (IQ). Figure 2 shows an example. Given eight images, the task is to identify the following elementA B C D E F from six similar candidates. ",
510
+ "bbox": [
511
+ 173,
512
+ 510,
513
+ 825,
514
+ 564
515
+ ],
516
+ "page_idx": 4
517
+ },
518
+ {
519
+ "type": "image",
520
+ "img_path": "images/c9e724bf92595d0da428f24c3231d71fc5836e0699fc5c281bc47e57ff8c2942.jpg",
521
+ "image_caption": [
522
+ "Figure 2: We append each candidate image to the prompt Table 3: Zero-shot generalization on separately and query the model if it is correct. Raven IQ test. "
523
+ ],
524
+ "image_footnote": [],
525
+ "bbox": [
526
+ 176,
527
+ 578,
528
+ 540,
529
+ 710
530
+ ],
531
+ "page_idx": 4
532
+ },
533
+ {
534
+ "type": "table",
535
+ "img_path": "images/3bbdff5b7c762d7d5c92560e40ebceb42e33279918de308941f953cf6c2dd216.jpg",
536
+ "table_caption": [],
537
+ "table_footnote": [],
538
+ "table_body": "<table><tr><td>Method</td><td>Accuracy</td></tr><tr><td>Random Choice</td><td>17%</td></tr><tr><td>KosMOs-1</td><td>22%</td></tr></table>",
539
+ "bbox": [
540
+ 570,
541
+ 655,
542
+ 784,
543
+ 713
544
+ ],
545
+ "page_idx": 4
546
+ },
547
+ {
548
+ "type": "text",
549
+ "text": "The models need to conduct zero-shot nonverbal reasoning without explicitly fine-tuning. The Raven IQ test is analogous to in-context learning of language models, where the difference is whether the context is nonverbal or verbal. In order to infer the answers, the models have to recognize abstract concepts and identify the underlying patterns of given images. So the IQ task is a good testbed to benchmark the nonverbal in-context learning capability. ",
550
+ "bbox": [
551
+ 173,
552
+ 766,
553
+ 825,
554
+ 835
555
+ ],
556
+ "page_idx": 4
557
+ },
558
+ {
559
+ "type": "text",
560
+ "text": "Table 3 shows the evaluation results on the IQ test dataset. KOSMOS-1 achieves $5 . 3 \\%$ improvement respectively over the random baseline. The results indicate that KOSMOS-1 is able to perceive abstract conceptual patterns in a nonverbal context, and then deduce the following element across multiple choices. To the best of our knowledge, it is the first time that a model can perform such zero-shot Raven IQ tests. Although there is still a large performance gap between the current model and the ",
561
+ "bbox": [
562
+ 174,
563
+ 842,
564
+ 825,
565
+ 911
566
+ ],
567
+ "page_idx": 4
568
+ },
569
+ {
570
+ "type": "table",
571
+ "img_path": "images/dae83ae565f65ae9db8b83d404b73e1dfef200595bc31335cc307359565ec8ec.jpg",
572
+ "table_caption": [],
573
+ "table_footnote": [
574
+ "(a) Image captioning results on COCO caption Karpa- (b) Visual question answering results on VQAv2 and thy test and Flickr30k test. We present CIDEr scores. VizWiz. We present VQA accuracy scores. "
575
+ ],
576
+ "table_body": "<table><tr><td>Shot</td><td>Model</td><td>CoCo</td><td>Flickr30k</td></tr><tr><td rowspan=\"7\">0</td><td>ZeroCap45]</td><td>14.6</td><td>1</td></tr><tr><td>VLKD [46]</td><td>58.3</td><td>1</td></tr><tr><td>FewVLM[47]</td><td>-</td><td>31.0</td></tr><tr><td>METALM[3]</td><td>82.2</td><td>43.4</td></tr><tr><td>Flamingo-3B*[5]</td><td>73.0</td><td>60.6</td></tr><tr><td>Flamingo-9B*[5]</td><td>79.4</td><td>61.5</td></tr><tr><td>KOSMOS-1 (1.6B)</td><td>84.7</td><td>67.1</td></tr><tr><td rowspan=\"2\">2</td><td>Flamingo-3B* [5]</td><td>=</td><td>1</td></tr><tr><td>Flamingo-9B*[5] KOSMOS-1 (1.6B)</td><td>- 99.6</td><td>-</td></tr><tr><td rowspan=\"2\">4</td><td>Flamingo-3B* [5]</td><td>85.0</td><td>70.0 72.0</td></tr><tr><td>Flamingo-9B* [5]</td><td>93.1</td><td>72.6</td></tr><tr><td rowspan=\"2\"></td><td>KoSMOS-1 (1.6B)</td><td>101.7</td><td>75.3</td></tr><tr><td>Flamingo-3B* [5]</td><td>90.6</td><td>71.7</td></tr><tr><td rowspan=\"3\">8</td><td>Flamingo-9B* [5]</td><td>99.0</td><td>73.4</td></tr><tr><td>KoSMOS-1 (1.6B)</td><td>96.7</td><td>68.0</td></tr><tr><td></td><td></td><td></td></tr></table>",
577
+ "bbox": [
578
+ 176,
579
+ 88,
580
+ 485,
581
+ 321
582
+ ],
583
+ "page_idx": 5
584
+ },
585
+ {
586
+ "type": "table",
587
+ "img_path": "images/6372deadd0b75f30e1a9a4a4f14d65a287471427b6f441afb31badbc5d9c181d.jpg",
588
+ "table_caption": [],
589
+ "table_footnote": [],
590
+ "table_body": "<table><tr><td>Shot</td><td>Model</td><td>VQAv2</td><td>VizWiz</td></tr><tr><td rowspan=\"6\">0</td><td>Frozen</td><td>29.5</td><td></td></tr><tr><td>VLKDViT-B/16</td><td>38.6</td><td>=</td></tr><tr><td>METALM</td><td>41.1</td><td>-</td></tr><tr><td>Flamingo-3B*</td><td>49.2</td><td>28.9</td></tr><tr><td>Flamingo-9B*</td><td>51.8</td><td>28.8</td></tr><tr><td>KoSMOS-1 (1.6B)</td><td>51.0</td><td>29.2</td></tr><tr><td rowspan=\"2\">2</td><td>Flamingo-3B* [5]</td><td></td><td>-</td></tr><tr><td>Flamingo-9B*[5] KoSMOS-1 (1.6B)</td><td>-</td><td>=</td></tr><tr><td rowspan=\"3\">4</td><td></td><td>51.4</td><td>31.4</td></tr><tr><td>Flamingo-3B* [5] Flamingo-9B* [5]</td><td>53.2 56.3</td><td>34.4 34.9</td></tr><tr><td>KoSMOS-1 (1.6B)</td><td>51.8</td><td>35.3</td></tr><tr><td rowspan=\"3\">8</td><td>Flamingo-3B* [5]</td><td>55.4</td><td>38.4</td></tr><tr><td>Flamingo-9B* [5]</td><td>58.0</td><td>39.4</td></tr><tr><td>KOSMOS-1 (1.6B)</td><td>51.4</td><td>39.0</td></tr></table>",
591
+ "bbox": [
592
+ 501,
593
+ 89,
594
+ 808,
595
+ 320
596
+ ],
597
+ "page_idx": 5
598
+ },
599
+ {
600
+ "type": "text",
601
+ "text": "Table 2: $\" * \"$ : Flamingo [5] builds the zero-shot prompt with two examples from the downstream tasks where their corresponding images are removed (i.e., similar to few-shot text prompts) while the others evaluate true zero-shot learning. ",
602
+ "bbox": [
603
+ 173,
604
+ 358,
605
+ 825,
606
+ 401
607
+ ],
608
+ "page_idx": 5
609
+ },
610
+ {
611
+ "type": "text",
612
+ "text": "average level of adults, KOSMOS-1 demonstrates the potential of MLLMs to perform zero-shot nonverbal reasoning by aligning perception with language models. ",
613
+ "bbox": [
614
+ 176,
615
+ 438,
616
+ 823,
617
+ 467
618
+ ],
619
+ "page_idx": 5
620
+ },
621
+ {
622
+ "type": "text",
623
+ "text": "3.4 OCR-Free Language Understanding ",
624
+ "text_level": 1,
625
+ "bbox": [
626
+ 176,
627
+ 483,
628
+ 467,
629
+ 498
630
+ ],
631
+ "page_idx": 5
632
+ },
633
+ {
634
+ "type": "text",
635
+ "text": "OCR-free language understanding is a task that focuses on understanding text and images without relying on Optical Character Recognition (OCR). For example, during the Rendered SST-2 task [34], sentences from the Stanford Sentiment Treebank [48] dataset are rendered as images. The model is asked to predict the sentiment of the text within the images. The task evaluates a model’s ability to read and comprehend the meaning of words and sentences directly from the images. ",
636
+ "bbox": [
637
+ 174,
638
+ 510,
639
+ 825,
640
+ 579
641
+ ],
642
+ "page_idx": 5
643
+ },
644
+ {
645
+ "type": "text",
646
+ "text": "As shown in Table 4a, KOSMOS-1 achieves a ROC AUC of $6 3 . 9 \\%$ for the HatefulMemes validation set and a test accuracy of $6 7 . 1 \\%$ for the Rendered SST-2 test set. It outperforms CLIP ViT-L and Flamingo-9B, which achieve AUCs of $6 3 . 3 \\%$ and $5 7 . 0 \\%$ on the HatefulMemes task. Note that Flamingo explicitly provides OCR text into the prompt, while KOSMOS-1 does not access any external tools or resources. This indicates that KOSMOS-1 has built-in abilities to read and comprehend the text in the rendered images. ",
647
+ "bbox": [
648
+ 174,
649
+ 584,
650
+ 825,
651
+ 669
652
+ ],
653
+ "page_idx": 5
654
+ },
655
+ {
656
+ "type": "table",
657
+ "img_path": "images/63fe5a166f31b0c1dea66c3dfb545a6e3e37828aee0bdb636daef6489772ba5f.jpg",
658
+ "table_caption": [],
659
+ "table_footnote": [
660
+ "(a) Zero-shot generalization on OCR-free language understanding. We report accuracy scores. "
661
+ ],
662
+ "table_body": "<table><tr><td>Model</td><td>HatefulMemes</td><td>Rendered SST-2</td></tr><tr><td>CLIP ViT-B/32</td><td>57.6</td><td>59.6</td></tr><tr><td>CLIP ViT-B/16</td><td>61.7</td><td>59.8</td></tr><tr><td>CLIP ViT-L/14</td><td>63.3</td><td>64.0</td></tr><tr><td>Flamingo-3B</td><td>53.7</td><td>1</td></tr><tr><td>Flamingo-9B</td><td>57.0</td><td>-</td></tr><tr><td>KOSMOS-1 (1.6B)</td><td>63.9</td><td>67.1</td></tr></table>",
663
+ "bbox": [
664
+ 176,
665
+ 683,
666
+ 552,
667
+ 790
668
+ ],
669
+ "page_idx": 5
670
+ },
671
+ {
672
+ "type": "table",
673
+ "img_path": "images/82eac6ef90a61eb6f4a12a3eae88d332d6d183bd2d540dd8edeee0a64d7b9854.jpg",
674
+ "table_caption": [],
675
+ "table_footnote": [
676
+ "(b) Zero-shot performance on WebSRC task. We report exact match (EM) and F1 scores. "
677
+ ],
678
+ "table_body": "<table><tr><td>Model</td><td>EM F1</td></tr><tr><td>Using extracted text</td><td></td></tr><tr><td>LLM 7.6</td><td>17.9</td></tr><tr><td>KosMOs-1 15.8</td><td>31.3</td></tr><tr><td>Without using extracted text</td><td></td></tr><tr><td>KosMos-1 3.8</td><td>10.6</td></tr></table>",
679
+ "bbox": [
680
+ 557,
681
+ 683,
682
+ 820,
683
+ 790
684
+ ],
685
+ "page_idx": 5
686
+ },
687
+ {
688
+ "type": "text",
689
+ "text": "3.5 Web Page Question Answering ",
690
+ "text_level": 1,
691
+ "bbox": [
692
+ 174,
693
+ 857,
694
+ 428,
695
+ 872
696
+ ],
697
+ "page_idx": 5
698
+ },
699
+ {
700
+ "type": "text",
701
+ "text": "Web page question answering aims at finding answers to questions from web pages. It requires the model to comprehend both the semantics and the structure of texts (such as tables, lists, and ",
702
+ "bbox": [
703
+ 173,
704
+ 882,
705
+ 823,
706
+ 911
707
+ ],
708
+ "page_idx": 5
709
+ },
710
+ {
711
+ "type": "image",
712
+ "img_path": "images/73479714b923275a1b3dac025e6afa4299f70244a26e1a86d93243a4ac2e89a3.jpg",
713
+ "image_caption": [
714
+ "Figure 3: In-context verbal descriptions can help KOSMOS-1 recognize visual categories better. "
715
+ ],
716
+ "image_footnote": [],
717
+ "bbox": [
718
+ 272,
719
+ 89,
720
+ 723,
721
+ 200
722
+ ],
723
+ "page_idx": 6
724
+ },
725
+ {
726
+ "type": "text",
727
+ "text": "HTML layout). We compare the performance on the Web-based Structural Reading Comprehension (WebSRC) dataset [43]. For comparisons, we train a language model (LLM) on the same text corpora with the same training setup as in KOSMOS-1. ",
728
+ "bbox": [
729
+ 174,
730
+ 248,
731
+ 825,
732
+ 290
733
+ ],
734
+ "page_idx": 6
735
+ },
736
+ {
737
+ "type": "text",
738
+ "text": "The experimental results are summarized in Table 4b. We observe that KOSMOS-1 outperforms the LLM, indicating that KOSMOS-1 can benefit from the layout and style information of web pages in images. In addition, we evaluate the performance of KOSMOS-1 without the extracted text in the prompt. It shows that extracted text has a contribution of $+ 1 2 . 0 / 2 0 . 7$ EM/F1 to KOSMOS-1, indicating that the benefit from modeling images does not sacrifice its language abilities. ",
739
+ "bbox": [
740
+ 174,
741
+ 297,
742
+ 825,
743
+ 367
744
+ ],
745
+ "page_idx": 6
746
+ },
747
+ {
748
+ "type": "text",
749
+ "text": "3.6 Multimodal Chain-of-Thought Prompting ",
750
+ "text_level": 1,
751
+ "bbox": [
752
+ 174,
753
+ 382,
754
+ 504,
755
+ 397
756
+ ],
757
+ "page_idx": 6
758
+ },
759
+ {
760
+ "type": "text",
761
+ "text": "Chain-of-thought prompting [10] allows large language models to generate a series of reasoning steps and decompose a multi-step problem into intermediate steps, which can significantly improve the performance in complex tasks. Motivated by chain-of-thought prompting, we investigate a multimodal chain-of-thought prompting using KOSMOS-1. We break down perception-language tasks into two steps. In the first stage, given an image, we use a prompt to guide the model to generate a rationale. The model is then fed the rationale and a task-aware prompt to produce the final results. ",
762
+ "bbox": [
763
+ 174,
764
+ 407,
765
+ 825,
766
+ 491
767
+ ],
768
+ "page_idx": 6
769
+ },
770
+ {
771
+ "type": "text",
772
+ "text": "We conduct experiments to evaluate the performance of the multimodal chain-of-thought prompting. Table 5a shows that multimodal chain-of-thought prompting achieves a score of 72.9, which is 5.8 points higher than the standard prompting. By generating intermediate content, the model can recognize the text in the images and infer the sentiment of the sentences more correctly. ",
773
+ "bbox": [
774
+ 173,
775
+ 497,
776
+ 825,
777
+ 554
778
+ ],
779
+ "page_idx": 6
780
+ },
781
+ {
782
+ "type": "table",
783
+ "img_path": "images/0a5e6385a121d94fa4b58830ea6ded21d6d22d76b5153a04fdf77d19242b5f75.jpg",
784
+ "table_caption": [],
785
+ "table_footnote": [
786
+ "(b) Results of zero-shot image classification without and with verbal descriptions. "
787
+ ],
788
+ "table_body": "<table><tr><td> Setings</td><td>Accuracy</td></tr><tr><td>Without Descriptions</td><td>61.7</td></tr><tr><td>With Descriptions</td><td>90.0</td></tr></table>",
789
+ "bbox": [
790
+ 532,
791
+ 587,
792
+ 764,
793
+ 642
794
+ ],
795
+ "page_idx": 6
796
+ },
797
+ {
798
+ "type": "table",
799
+ "img_path": "images/2a1cfae9f6e73b6588079a96a029836b04455d4352ce7b67b85df8d6ab4f355e.jpg",
800
+ "table_caption": [],
801
+ "table_footnote": [
802
+ "(a) Multimodal chain-of-thought (CoT) prompting on Rendered SST-2 task. "
803
+ ],
804
+ "table_body": "<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>CLIP ViT-B/32</td><td>59.6</td></tr><tr><td>CLIP ViT-B/16</td><td>59.8</td></tr><tr><td>CLIP ViT-L/14</td><td>64.0</td></tr><tr><td>KosMOS-1</td><td>67.1</td></tr><tr><td>w/ multimodal CoT prompting</td><td>72.9</td></tr></table>",
805
+ "bbox": [
806
+ 176,
807
+ 564,
808
+ 498,
809
+ 664
810
+ ],
811
+ "page_idx": 6
812
+ },
813
+ {
814
+ "type": "text",
815
+ "text": "3.7 Zero-Shot Image Classification with Descriptions ",
816
+ "text_level": 1,
817
+ "bbox": [
818
+ 173,
819
+ 726,
820
+ 553,
821
+ 742
822
+ ],
823
+ "page_idx": 6
824
+ },
825
+ {
826
+ "type": "text",
827
+ "text": "The standard approach of image classification as above is to prompt the model for the specific name of the object depicted in the image. However, there are also some classification rules customized for different users and scenarios, such as the refined classification of complex animal subspecies. We can utilize natural language descriptions to guide KOSMOS-1 to distinguish images in the zero-shot setting, which makes the decision process more interpretable. Following CUB [44], we construct a bird classification dataset that contains images and natural-language descriptions of categories. The evaluation procedure is illustrated in Figure 3. ",
828
+ "bbox": [
829
+ 173,
830
+ 752,
831
+ 825,
832
+ 849
833
+ ],
834
+ "page_idx": 6
835
+ },
836
+ {
837
+ "type": "text",
838
+ "text": "The evaluation results are shown in Table 5b. We observe that providing descriptions in context can significantly improve the accuracy of image classification. The consistent improvements indicate that KOSMOS-1 can perceive the intentions of instructions and well align the concepts in language modality with visual features in vision modality. ",
839
+ "bbox": [
840
+ 176,
841
+ 856,
842
+ 823,
843
+ 911
844
+ ],
845
+ "page_idx": 6
846
+ },
847
+ {
848
+ "type": "text",
849
+ "text": "3.8 Language Tasks ",
850
+ "text_level": 1,
851
+ "bbox": [
852
+ 174,
853
+ 90,
854
+ 325,
855
+ 106
856
+ ],
857
+ "page_idx": 7
858
+ },
859
+ {
860
+ "type": "text",
861
+ "text": "The models are evaluated on the language tasks given task instructions (i.e., zero-shot) or several demonstration examples (i.e., few-shot). Text inputs are directly fed into the models as in vanilla language models. We train a language model (LLM) baseline with the same text corpora and training setup. We evaluate KOSMOS-1 and the LLM baseline on eight language tasks. ",
862
+ "bbox": [
863
+ 173,
864
+ 117,
865
+ 825,
866
+ 172
867
+ ],
868
+ "page_idx": 7
869
+ },
870
+ {
871
+ "type": "text",
872
+ "text": "Table 6 presents the in-context learning performance of language tasks. KOSMOS-1 achieves comparable or even better performance in cloze completion and commonsense reasoning tasks when compared to LLM. In terms of the average result across all these datasets, LLM performs better in zero-shot and one-shot settings, whereas our model performs better in few-shot $k = 4$ ) settings. In addition, Section 3.9.2 shows that MLLMs learn better visual commonsense knowledge compared with LLMs. ",
873
+ "bbox": [
874
+ 174,
875
+ 178,
876
+ 825,
877
+ 262
878
+ ],
879
+ "page_idx": 7
880
+ },
881
+ {
882
+ "type": "table",
883
+ "img_path": "images/8221ed666c3899e6db128f908b4315996ad1bb3e3d8a5bc83172d676a4741fe6.jpg",
884
+ "table_caption": [],
885
+ "table_footnote": [
886
+ "Table 6: Performance comparisons of language tasks between KOSMOS-1 and LLM. We use the same textual data and training setup to reimplement a language model. Both models do not use instruction tuning for fair comparisons. "
887
+ ],
888
+ "table_body": "<table><tr><td rowspan=\"2\">Task</td><td colspan=\"2\">Zero-shot</td><td colspan=\"2\">One-shot</td><td colspan=\"2\">Few-shot (k = 4)</td></tr><tr><td>LLM</td><td>KosMos-1</td><td>LLM</td><td>KoSMOS-1</td><td>LLM</td><td>KosMos-1</td></tr><tr><td>StoryCloze</td><td>72.9</td><td>72.1</td><td>72.9</td><td>72.2</td><td>73.1</td><td>72.3</td></tr><tr><td>HellaSwag</td><td>50.4</td><td>50.0</td><td>50.2</td><td>50.0</td><td>50.4</td><td>50.3</td></tr><tr><td>Winograd</td><td>71.6</td><td>69.8</td><td>71.2</td><td>68.4</td><td>70.9</td><td>69.8</td></tr><tr><td>Winogrande</td><td>56.7</td><td>54.8</td><td>56.7</td><td>54.5</td><td>57.0</td><td>55.7</td></tr><tr><td>PIQA</td><td>73.2</td><td>72.9</td><td>73.0</td><td>72.5</td><td>72.6</td><td>72.3</td></tr><tr><td>BoolQ</td><td>56.4</td><td>56.4</td><td>55.1</td><td>57.2</td><td>58.7</td><td>59.2</td></tr><tr><td>CB</td><td>39.3</td><td>44.6</td><td>41.1</td><td>48.2</td><td>42.9</td><td>53.6</td></tr><tr><td>COPA</td><td>68.0</td><td>63.0</td><td>69.0</td><td>64.0</td><td>69.0</td><td>64.0</td></tr><tr><td>Average</td><td>61.1</td><td>60.5</td><td>61.2</td><td>60.9</td><td>61.8</td><td>62.2</td></tr></table>",
889
+ "bbox": [
890
+ 225,
891
+ 273,
892
+ 772,
893
+ 472
894
+ ],
895
+ "page_idx": 7
896
+ },
897
+ {
898
+ "type": "text",
899
+ "text": "3.9 Cross-modal Transfer ",
900
+ "text_level": 1,
901
+ "bbox": [
902
+ 174,
903
+ 545,
904
+ 364,
905
+ 559
906
+ ],
907
+ "page_idx": 7
908
+ },
909
+ {
910
+ "type": "text",
911
+ "text": "Cross-modal transferability allows a model to learn from one modality (such as text, image, audio, etc.) and transfer the knowledge to the other modalities. This skill can enable a model to perform various tasks across different modalities. In this part, we evaluate the cross-model transferability of KOSMOS-1 on several benchmarks. ",
912
+ "bbox": [
913
+ 174,
914
+ 570,
915
+ 826,
916
+ 626
917
+ ],
918
+ "page_idx": 7
919
+ },
920
+ {
921
+ "type": "text",
922
+ "text": "3.9.1 Transfer from Language to Multimodal: Language-Only Instruction Tuning ",
923
+ "text_level": 1,
924
+ "bbox": [
925
+ 174,
926
+ 641,
927
+ 756,
928
+ 656
929
+ ],
930
+ "page_idx": 7
931
+ },
932
+ {
933
+ "type": "text",
934
+ "text": "To evaluate the effect of language-only instruction tuning, we conduct an ablation study using four datasets: COCO, Flickr30k, VQAv2, and VizWiz. These datasets consist of image captioning and visual questions anwsering. The evaluation metrics are: CIDEr scores for COCO/Flickr30k and VQA accuracy for VQAv2/VizWiz. ",
935
+ "bbox": [
936
+ 174,
937
+ 665,
938
+ 825,
939
+ 720
940
+ ],
941
+ "page_idx": 7
942
+ },
943
+ {
944
+ "type": "text",
945
+ "text": "Table 7 shows the experimental results. Language-only instruction tuning boosts our model’s performance by 1.9 points on Flickr30k, 4.3 points on VQAv2, and 1.3 points on VizWiz. Our experiments show that language-only instruction tuning can significantly improve the model’s instructionfollowing capabilities across modalities. The results also indicate that our model can transfer the instruction-following capability from language to other modalities. ",
946
+ "bbox": [
947
+ 176,
948
+ 727,
949
+ 823,
950
+ 797
951
+ ],
952
+ "page_idx": 7
953
+ },
954
+ {
955
+ "type": "table",
956
+ "img_path": "images/04a64646c0696b264d1d9985741f6cdecbcc400cb47c621b3523d0acdb8721ab.jpg",
957
+ "table_caption": [],
958
+ "table_footnote": [
959
+ "Table 7: Ablation study on language-only instruction tuning. We report CIDEr scores for COCO and Flickr30k, and VQA accuracy scores for VQAv2 and VizWiz. "
960
+ ],
961
+ "table_body": "<table><tr><td>Model</td><td>CoCo</td><td>Flickr30k</td><td>VQAv2</td><td>VizWiz</td></tr><tr><td>Kosmos-1</td><td>84.7</td><td>67.1</td><td>51.0</td><td>29.2</td></tr><tr><td>w/o language-only instruction tuning</td><td>87.6</td><td>65.2</td><td>46.7</td><td>27.9</td></tr></table>",
962
+ "bbox": [
963
+ 240,
964
+ 810,
965
+ 758,
966
+ 862
967
+ ],
968
+ "page_idx": 7
969
+ },
970
+ {
971
+ "type": "text",
972
+ "text": "3.9.2 Transfer from Multimodal to Language: Visual Commonsense Reasoning ",
973
+ "text_level": 1,
974
+ "bbox": [
975
+ 176,
976
+ 90,
977
+ 735,
978
+ 106
979
+ ],
980
+ "page_idx": 8
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "Visual commonsense reasoning tasks require an understanding of the properties of everyday objects in the real world, such as color, size, and shape. These tasks are challenging for language models because they may require more information about object properties than what is available in texts. To investigate the visual commonsense capabilities, we compare the zero-shot performance of KOSMOS-1 and LLM on three object commonsense reasoning datasets, RELATIVESIZE [36], MEMORYCOLOR [37] and COLORTERMS [38] datasets. RELATIVESIZE contains 486 object pairs from 41 physical objects. The model is required to predict the size relation between two objects in a binary question-answering format with “Yes”/“No” answers. MEMORYCOLOR and COLORTERMS require the model to predict the color of objects from a set of 11 color labels in a multiple-choice format. ",
985
+ "bbox": [
986
+ 173,
987
+ 117,
988
+ 826,
989
+ 256
990
+ ],
991
+ "page_idx": 8
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "Table 8 presents the zero-shot performance of KOSMOS-1 and LLM on visual commonsense reasoning tasks. KOSMOS-1 significantly outperforms LLM by $1 . 5 \\%$ on RELATIVESIZE, $1 4 . 7 \\%$ on MEMORYCOLOR, and $9 . 7 \\%$ on COLORTERMS dataset. The consistent improvements indicate that KOSMOS-1 benefits from the visual knowledge to complete the corresponding visual commonsense reasoning. The reason for KOSMOS-1’s superior performance is that it has modality transferability, which enables the model to transfer visual knowledge to language tasks. On the contrary, LLM has to rely on textual knowledge and clues to answer visual commonsense questions, which limits its ability to reason about object properties. ",
996
+ "bbox": [
997
+ 173,
998
+ 262,
999
+ 826,
1000
+ 373
1001
+ ],
1002
+ "page_idx": 8
1003
+ },
1004
+ {
1005
+ "type": "table",
1006
+ "img_path": "images/db4b9aa66963f69cde4a040bfc352e3d7f50c359cfb7de951bbffcf6db76deea.jpg",
1007
+ "table_caption": [],
1008
+ "table_footnote": [
1009
+ "Table 8: Zero-shot visual commonsense reasoning on RELATIVESIZE, MEMORYCOLOR, and COLORTERMS datasets. Accuracy scores are reported. "
1010
+ ],
1011
+ "table_body": "<table><tr><td>Model</td><td>Size Reasoning RELATIVESIZE</td><td>Color Reasoning MEMORYCOLOR</td><td>COLORTERMS</td></tr><tr><td>Using retrieved images VALM [49]</td><td>85.0</td><td>58.6</td><td>52.7</td></tr><tr><td>Language-only zero-shot evaluation</td><td></td><td></td><td></td></tr><tr><td>LLM</td><td>92.7</td><td>61.4</td><td>63.4</td></tr><tr><td>KosMos-1</td><td>94.2</td><td>76.1</td><td>73.1</td></tr></table>",
1012
+ "bbox": [
1013
+ 287,
1014
+ 392,
1015
+ 709,
1016
+ 500
1017
+ ],
1018
+ "page_idx": 8
1019
+ },
1020
+ {
1021
+ "type": "text",
1022
+ "text": "4 Related Work ",
1023
+ "text_level": 1,
1024
+ "bbox": [
1025
+ 174,
1026
+ 578,
1027
+ 321,
1028
+ 594
1029
+ ],
1030
+ "page_idx": 8
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "In recent years, vision-language learning and representation models has garnered significant attention [2, 3, 4, 34, 50, 51, 52, 53, 54]. Previous vision-language models still exhibit limitations in instruction following, in-context abilities, and generalization capabilities for unseen tasks. Researchers have begun exploring more powerful multimodal large language models. Flamingo [5] trained its model from scratch and made it possible to generate text tokens conditioned on both visual and text inputs. Another category of research focus on learning multimodality abilities based on LLMs [7, 55, 56]. Meanwhile, some work [57, 58, 59] introduce visual instruction tuning to enhance instruction following capabilities. ",
1035
+ "bbox": [
1036
+ 174,
1037
+ 613,
1038
+ 825,
1039
+ 726
1040
+ ],
1041
+ "page_idx": 8
1042
+ },
1043
+ {
1044
+ "type": "text",
1045
+ "text": "5 Conclusion ",
1046
+ "text_level": 1,
1047
+ "bbox": [
1048
+ 174,
1049
+ 751,
1050
+ 299,
1051
+ 768
1052
+ ],
1053
+ "page_idx": 8
1054
+ },
1055
+ {
1056
+ "type": "text",
1057
+ "text": "In this work, we introduce KOSMOS-1, a multimodal large language model that can perceive general modalities, follow instructions, and perform in-context learning. The models trained on web-scale multimodal corpora achieve promising results across a wide range of language tasks and multimodal tasks. We show that going from LLMs to MLLMs enables new capabilities and opportunities. In the future, we would like to scale up KOSMOS-1 in terms of model size [13, 14, 60], and integrate the speech [12] capability into KOSMOS-1. In addition, KOSMOS-1 can be used as a unified interface for multimodal learning, e.g., enabling using instructions and examples to control text-to-image generation. We further discuss the limitations and broader societal impacts of KOSMOS-1 in the supplemental material. ",
1058
+ "bbox": [
1059
+ 174,
1060
+ 786,
1061
+ 825,
1062
+ 911
1063
+ ],
1064
+ "page_idx": 8
1065
+ },
1066
+ {
1067
+ "type": "text",
1068
+ "text": "References ",
1069
+ "text_level": 1,
1070
+ "bbox": [
1071
+ 174,
1072
+ 90,
1073
+ 266,
1074
+ 106
1075
+ ],
1076
+ "page_idx": 9
1077
+ },
1078
+ {
1079
+ "type": "text",
1080
+ "text": "[1] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc., 2020. ",
1081
+ "bbox": [
1082
+ 181,
1083
+ 114,
1084
+ 826,
1085
+ 212
1086
+ ],
1087
+ "page_idx": 9
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "text": "[2] Maria Tsimpoukelli, Jacob Menick, Serkan Cabi, S. M. Ali Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. In Neural Information Processing Systems, 2021. ",
1092
+ "bbox": [
1093
+ 178,
1094
+ 220,
1095
+ 823,
1096
+ 263
1097
+ ],
1098
+ "page_idx": 9
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "[3] Yaru Hao, Haoyu Song, Li Dong, Shaohan Huang, Zewen Chi, Wenhui Wang, Shuming Ma, and Furu Wei. Language models are general-purpose interfaces. ArXiv, abs/2206.06336, 2022. ",
1103
+ "bbox": [
1104
+ 178,
1105
+ 272,
1106
+ 825,
1107
+ 303
1108
+ ],
1109
+ "page_idx": 9
1110
+ },
1111
+ {
1112
+ "type": "text",
1113
+ "text": "[4] Wenhui Wang, Hangbo Bao, Li Dong, Johan Bjorck, Zhiliang Peng, Qiang Liu, Kriti Aggarwal, Owais Mohammed, Saksham Singhal, Subhojit Som, and Furu Wei. Image as a foreign language: BEiT pretraining for all vision and vision-language tasks. ArXiv, abs/2208.10442, 2022. ",
1114
+ "bbox": [
1115
+ 178,
1116
+ 310,
1117
+ 825,
1118
+ 354
1119
+ ],
1120
+ "page_idx": 9
1121
+ },
1122
+ {
1123
+ "type": "text",
1124
+ "text": "[5] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, Roman Ring, Eliza Rutherford, Serkan Cabi, Tengda Han, Zhitao Gong, Sina Samangooei, Marianne Monteiro, Jacob Menick, Sebastian Borgeaud, Andrew Brock, Aida Nematzadeh, Sahand Sharifzadeh, Mikolaj Binkowski, Ricardo Barreira, Oriol Vinyals, Andrew Zisserman, and Karen Simonyan. Flamingo: a visual language model for few-shot learning. In Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=EbMuimAbPbs. ",
1125
+ "bbox": [
1126
+ 181,
1127
+ 363,
1128
+ 826,
1129
+ 462
1130
+ ],
1131
+ "page_idx": 9
1132
+ },
1133
+ {
1134
+ "type": "text",
1135
+ "text": "[6] Armen Aghajanyan, Bernie Huang, Candace Ross, Vladimir Karpukhin, Hu Xu, Naman Goyal, Dmytro Okhonko, Mandar Joshi, Gargi Ghosh, Mike Lewis, and Luke Zettlemoyer. CM3: A causal masked multimodal model of the Internet. ArXiv, abs/2201.07520, 2022. ",
1136
+ "bbox": [
1137
+ 178,
1138
+ 470,
1139
+ 825,
1140
+ 513
1141
+ ],
1142
+ "page_idx": 9
1143
+ },
1144
+ {
1145
+ "type": "text",
1146
+ "text": "[7] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. BLIP-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. ArXiv, abs/2301.12597, 2023. ",
1147
+ "bbox": [
1148
+ 178,
1149
+ 522,
1150
+ 825,
1151
+ 564
1152
+ ],
1153
+ "page_idx": 9
1154
+ },
1155
+ {
1156
+ "type": "text",
1157
+ "text": "[8] John and Jean Raven. Raven Progressive Matrices, pages 223–237. Springer US, Boston, MA, 2003. ISBN 978-1-4615-0153-4. doi: 10.1007/978-1-4615-0153-4_11. URL https: //doi.org/10.1007/978-1-4615-0153-4_11. ",
1158
+ "bbox": [
1159
+ 179,
1160
+ 574,
1161
+ 823,
1162
+ 617
1163
+ ],
1164
+ "page_idx": 9
1165
+ },
1166
+ {
1167
+ "type": "text",
1168
+ "text": "[9] Patricia A Carpenter, Marcel A Just, and Peter Shell. What one intelligence test measures: a theoretical account of the processing in the raven progressive matrices test. Psychological review, 97(3):404, 1990. ",
1169
+ "bbox": [
1170
+ 179,
1171
+ 627,
1172
+ 823,
1173
+ 670
1174
+ ],
1175
+ "page_idx": 9
1176
+ },
1177
+ {
1178
+ "type": "text",
1179
+ "text": "[10] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903, 2022. ",
1180
+ "bbox": [
1181
+ 176,
1182
+ 679,
1183
+ 823,
1184
+ 722
1185
+ ],
1186
+ "page_idx": 9
1187
+ },
1188
+ {
1189
+ "type": "text",
1190
+ "text": "[11] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek B Rao, Parker Barnes, Yi Tay, Noam M. Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Benton C. Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier García, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Oliveira Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Díaz, Orhan Firat, Michele Catasta, Jason Wei, Kathleen S. Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. PaLM: Scaling language modeling with pathways. ArXiv, abs/2204.02311, 2022. ",
1191
+ "bbox": [
1192
+ 178,
1193
+ 731,
1194
+ 825,
1195
+ 911
1196
+ ],
1197
+ "page_idx": 9
1198
+ },
1199
+ {
1200
+ "type": "text",
1201
+ "text": "[12] Chengyi Wang, Sanyuan Chen, Yu Wu, Zi-Hua Zhang, Long Zhou, Shujie Liu, Zhuo Chen, Yanqing Liu, Huaming Wang, Jinyu Li, Lei He, Sheng Zhao, and Furu Wei. Neural codec language models are zero-shot text to speech synthesizers. ArXiv, abs/2301.02111, 2023. ",
1202
+ "bbox": [
1203
+ 171,
1204
+ 90,
1205
+ 823,
1206
+ 133
1207
+ ],
1208
+ "page_idx": 10
1209
+ },
1210
+ {
1211
+ "type": "text",
1212
+ "text": "[13] Shuming Ma, Hongyu Wang, Shaohan Huang, Wenhui Wang, Zewen Chi, Li Dong, Alon Benhaim, Barun Patra, Vishrav Chaudhary, Xia Song, and Furu Wei. TorchScale: Transformers at scale. CoRR, abs/2211.13184, 2022. ",
1213
+ "bbox": [
1214
+ 171,
1215
+ 142,
1216
+ 823,
1217
+ 185
1218
+ ],
1219
+ "page_idx": 10
1220
+ },
1221
+ {
1222
+ "type": "text",
1223
+ "text": "[14] Hongyu Wang, Shuming Ma, Shaohan Huang, Li Dong, Wenhui Wang, Zhiliang Peng, Yu Wu, Payal Bajaj, Saksham Singhal, Alon Benhaim, Barun Patra, Zhun Liu, Vishrav Chaudhary, Xia Song, and Furu Wei. Foundation transformers. CoRR, abs/2210.06423, 2022. ",
1224
+ "bbox": [
1225
+ 171,
1226
+ 194,
1227
+ 821,
1228
+ 237
1229
+ ],
1230
+ "page_idx": 10
1231
+ },
1232
+ {
1233
+ "type": "text",
1234
+ "text": "[15] Yutao Sun, Li Dong, Barun Patra, Shuming Ma, Shaohan Huang, Alon Benhaim, Vishrav Chaudhary, Xia Song, and Furu Wei. A length-extrapolatable transformer. arXiv preprint arXiv:2212.10554, 2022. ",
1235
+ "bbox": [
1236
+ 171,
1237
+ 246,
1238
+ 825,
1239
+ 287
1240
+ ],
1241
+ "page_idx": 10
1242
+ },
1243
+ {
1244
+ "type": "text",
1245
+ "text": "[16] Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. The pile: An $8 0 0 \\mathrm { g b }$ dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027, 2020. ",
1246
+ "bbox": [
1247
+ 171,
1248
+ 297,
1249
+ 823,
1250
+ 340
1251
+ ],
1252
+ "page_idx": 10
1253
+ },
1254
+ {
1255
+ "type": "text",
1256
+ "text": "[17] Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053, 2019. ",
1257
+ "bbox": [
1258
+ 171,
1259
+ 349,
1260
+ 821,
1261
+ 392
1262
+ ],
1263
+ "page_idx": 10
1264
+ },
1265
+ {
1266
+ "type": "text",
1267
+ "text": "[18] Shaden Smith, Mostofa Patwary, Brandon Norick, Patrick LeGresley, Samyam Rajbhandari, Jared Casper, Zhun Liu, Shrimai Prabhumoye, George Zerveas, Vijay Korthikanti, Elton Zhang, Rewon Child, Reza Yazdani Aminabadi, Julie Bernauer, Xia Song, Mohammad Shoeybi, Yuxiong He, Michael Houston, Saurabh Tiwary, and Bryan Catanzaro. Using DeepSpeed and Megatron to train Megatron-Turing NLG 530B, a large-scale generative language model, 2022. ",
1268
+ "bbox": [
1269
+ 173,
1270
+ 400,
1271
+ 826,
1272
+ 472
1273
+ ],
1274
+ "page_idx": 10
1275
+ },
1276
+ {
1277
+ "type": "text",
1278
+ "text": "[19] Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion5b: An open large-scale dataset for training next generation image-text models. arXiv preprint arXiv:2210.08402, 2022. ",
1279
+ "bbox": [
1280
+ 173,
1281
+ 479,
1282
+ 825,
1283
+ 536
1284
+ ],
1285
+ "page_idx": 10
1286
+ },
1287
+ {
1288
+ "type": "text",
1289
+ "text": "[20] Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. Laion-400m: Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021. ",
1290
+ "bbox": [
1291
+ 173,
1292
+ 545,
1293
+ 821,
1294
+ 588
1295
+ ],
1296
+ "page_idx": 10
1297
+ },
1298
+ {
1299
+ "type": "text",
1300
+ "text": "[21] Minwoo Byeon, Beomhee Park, Haecheon Kim, Sungjun Lee, Woonhyuk Baek, and Saehoon Kim. Coyo-700m: Image-text pair dataset, 2022. ",
1301
+ "bbox": [
1302
+ 173,
1303
+ 597,
1304
+ 823,
1305
+ 626
1306
+ ],
1307
+ "page_idx": 10
1308
+ },
1309
+ {
1310
+ "type": "text",
1311
+ "text": "[22] Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 2556–2565. Association for Computational Linguistics, 2018. ",
1312
+ "bbox": [
1313
+ 173,
1314
+ 635,
1315
+ 826,
1316
+ 705
1317
+ ],
1318
+ "page_idx": 10
1319
+ },
1320
+ {
1321
+ "type": "text",
1322
+ "text": "[23] Soravit Changpinyo, Piyush Sharma, Nan Ding, and Radu Soricut. Conceptual 12m: Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3558–3568, 2021. ",
1323
+ "bbox": [
1324
+ 173,
1325
+ 714,
1326
+ 825,
1327
+ 757
1328
+ ],
1329
+ "page_idx": 10
1330
+ },
1331
+ {
1332
+ "type": "text",
1333
+ "text": "[24] Or Honovich, Thomas Scialom, Omer Levy, and Timo Schick. Unnatural instructions: Tuning language models with (almost) no human labor, 2022. URL https://arxiv.org/abs/2212. 09689. ",
1334
+ "bbox": [
1335
+ 171,
1336
+ 765,
1337
+ 826,
1338
+ 808
1339
+ ],
1340
+ "page_idx": 10
1341
+ },
1342
+ {
1343
+ "type": "text",
1344
+ "text": "[25] Shayne Longpre, Le Hou, Tu Vu, Albert Webson, Hyung Won Chung, Yi Tay, Denny Zhou, Quoc V Le, Barret Zoph, Jason Wei, et al. The flan collection: Designing data and methods for effective instruction tuning. arXiv preprint arXiv:2301.13688, 2023. ",
1345
+ "bbox": [
1346
+ 171,
1347
+ 818,
1348
+ 825,
1349
+ 859
1350
+ ],
1351
+ "page_idx": 10
1352
+ },
1353
+ {
1354
+ "type": "text",
1355
+ "text": "[26] Nasrin Mostafazadeh, Michael Roth, Annie Louis, Nathanael Chambers, and James Allen. Lsdsem 2017 shared task: The story cloze test. In Proceedings of the 2nd Workshop on Linking Models of Lexical, Sentential and Discourse-level Semantics, pages 46–51, 2017. ",
1356
+ "bbox": [
1357
+ 174,
1358
+ 869,
1359
+ 826,
1360
+ 911
1361
+ ],
1362
+ "page_idx": 10
1363
+ },
1364
+ {
1365
+ "type": "text",
1366
+ "text": "[27] Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019. ",
1367
+ "bbox": [
1368
+ 173,
1369
+ 90,
1370
+ 823,
1371
+ 133
1372
+ ],
1373
+ "page_idx": 11
1374
+ },
1375
+ {
1376
+ "type": "text",
1377
+ "text": "[28] Hector Levesque, Ernest Davis, and Leora Morgenstern. The winograd schema challenge. In Thirteenth International Conference on the Principles of Knowledge Representation and Reasoning, 2012. ",
1378
+ "bbox": [
1379
+ 173,
1380
+ 141,
1381
+ 823,
1382
+ 183
1383
+ ],
1384
+ "page_idx": 11
1385
+ },
1386
+ {
1387
+ "type": "text",
1388
+ "text": "[29] Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. WinoGrande: An adversarial winograd schema challenge at scale. In AAAI, pages 8732–8740, 2020. ",
1389
+ "bbox": [
1390
+ 171,
1391
+ 190,
1392
+ 825,
1393
+ 220
1394
+ ],
1395
+ "page_idx": 11
1396
+ },
1397
+ {
1398
+ "type": "text",
1399
+ "text": "[30] Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. Piqa: Reasoning about physical commonsense in natural language. In Thirty-Fourth AAAI Conference on Artificial Intelligence, 2020. ",
1400
+ "bbox": [
1401
+ 174,
1402
+ 227,
1403
+ 823,
1404
+ 270
1405
+ ],
1406
+ "page_idx": 11
1407
+ },
1408
+ {
1409
+ "type": "text",
1410
+ "text": "[31] Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. BoolQ: Exploring the surprising difficulty of natural yes/no questions. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 2924–2936, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1300. URL https://aclanthology.org/N19-1300. ",
1411
+ "bbox": [
1412
+ 173,
1413
+ 276,
1414
+ 826,
1415
+ 362
1416
+ ],
1417
+ "page_idx": 11
1418
+ },
1419
+ {
1420
+ "type": "text",
1421
+ "text": "[32] Marie-Catherine de Marneffe, Mandy Simons, and Judith Tonhauser. The CommitmentBank: Investigating projection in naturally occurring discourse. Proceedings of Sinn und Bedeutung, 23(2):107–124, Jul. 2019. ",
1422
+ "bbox": [
1423
+ 173,
1424
+ 368,
1425
+ 823,
1426
+ 411
1427
+ ],
1428
+ "page_idx": 11
1429
+ },
1430
+ {
1431
+ "type": "text",
1432
+ "text": "[33] Melissa Roemmele, Cosmin Adrian Bejan, and Andrew S. Gordon. Choice of plausible alternatives: An evaluation of commonsense causal reasoning. In AAAI Spring Symposium, 2011. ",
1433
+ "bbox": [
1434
+ 171,
1435
+ 419,
1436
+ 825,
1437
+ 460
1438
+ ],
1439
+ "page_idx": 11
1440
+ },
1441
+ {
1442
+ "type": "text",
1443
+ "text": "[34] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pages 8748–8763. PMLR, 2021. ",
1444
+ "bbox": [
1445
+ 174,
1446
+ 468,
1447
+ 825,
1448
+ 525
1449
+ ],
1450
+ "page_idx": 11
1451
+ },
1452
+ {
1453
+ "type": "text",
1454
+ "text": "[35] Douwe Kiela, Hamed Firooz, Aravind Mohan, Vedanuj Goswami, Amanpreet Singh, Pratik Ringshia, and Davide Testuggine. The hateful memes challenge: Detecting hate speech in multimodal memes. In Advances in Neural Information Processing Systems, volume 33, pages 2611–2624, 2020. ",
1455
+ "bbox": [
1456
+ 173,
1457
+ 532,
1458
+ 825,
1459
+ 588
1460
+ ],
1461
+ "page_idx": 11
1462
+ },
1463
+ {
1464
+ "type": "text",
1465
+ "text": "[36] Hessam Bagherinezhad, Hannaneh Hajishirzi, Yejin Choi, and Ali Farhadi. Are elephants bigger than butterflies? reasoning about sizes of objects. ArXiv, abs/1602.00753, 2016. ",
1466
+ "bbox": [
1467
+ 171,
1468
+ 595,
1469
+ 820,
1470
+ 626
1471
+ ],
1472
+ "page_idx": 11
1473
+ },
1474
+ {
1475
+ "type": "text",
1476
+ "text": "[37] Tobias Norlund, Lovisa Hagström, and Richard Johansson. Transferring knowledge from vision to language: How to achieve it and how to measure it? ArXiv, abs/2109.11321, 2021. ",
1477
+ "bbox": [
1478
+ 173,
1479
+ 632,
1480
+ 821,
1481
+ 661
1482
+ ],
1483
+ "page_idx": 11
1484
+ },
1485
+ {
1486
+ "type": "text",
1487
+ "text": "[38] Elia Bruni, Gemma Boleda, Marco Baroni, and Nam Khanh Tran. Distributional semantics in technicolor. In ACL, 2012. ",
1488
+ "bbox": [
1489
+ 171,
1490
+ 669,
1491
+ 825,
1492
+ 698
1493
+ ],
1494
+ "page_idx": 11
1495
+ },
1496
+ {
1497
+ "type": "text",
1498
+ "text": "[39] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, pages 740–755, 2014. ",
1499
+ "bbox": [
1500
+ 174,
1501
+ 705,
1502
+ 825,
1503
+ 747
1504
+ ],
1505
+ "page_idx": 11
1506
+ },
1507
+ {
1508
+ "type": "text",
1509
+ "text": "[40] Peter Young, Alice Lai, Micah Hodosh, and Julia Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. TACL, 2:67–78, 2014. ",
1510
+ "bbox": [
1511
+ 173,
1512
+ 755,
1513
+ 823,
1514
+ 797
1515
+ ],
1516
+ "page_idx": 11
1517
+ },
1518
+ {
1519
+ "type": "text",
1520
+ "text": "[41] Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the v in vqa matter: Elevating the role of image understanding in visual question answering. In CVPR, pages 6325–6334, 2017. ",
1521
+ "bbox": [
1522
+ 173,
1523
+ 805,
1524
+ 823,
1525
+ 848
1526
+ ],
1527
+ "page_idx": 11
1528
+ },
1529
+ {
1530
+ "type": "text",
1531
+ "text": "[42] Danna Gurari, Qing Li, Abigale J Stangl, Anhong Guo, Chi Lin, Kristen Grauman, Jiebo Luo, and Jeffrey P Bigham. Vizwiz grand challenge: Answering visual questions from blind people. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3608–3617, 2018. ",
1532
+ "bbox": [
1533
+ 174,
1534
+ 854,
1535
+ 826,
1536
+ 911
1537
+ ],
1538
+ "page_idx": 11
1539
+ },
1540
+ {
1541
+ "type": "text",
1542
+ "text": "[43] Xingyu Chen, Zihan Zhao, Lu Chen, JiaBao Ji, Danyang Zhang, Ao Luo, Yuxuan Xiong, and Kai Yu. WebSRC: A dataset for web-based structural reading comprehension. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 4173–4185, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.343. URL https://aclanthology.org/ 2021.emnlp-main.343. ",
1543
+ "bbox": [
1544
+ 173,
1545
+ 90,
1546
+ 826,
1547
+ 174
1548
+ ],
1549
+ "page_idx": 12
1550
+ },
1551
+ {
1552
+ "type": "text",
1553
+ "text": "[44] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge J. Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. ",
1554
+ "bbox": [
1555
+ 171,
1556
+ 183,
1557
+ 821,
1558
+ 212
1559
+ ],
1560
+ "page_idx": 12
1561
+ },
1562
+ {
1563
+ "type": "text",
1564
+ "text": "[45] Yoad Tewel, Yoav Shalev, Idan Schwartz, and Lior Wolf. Zerocap: Zero-shot image-to-text generation for visual-semantic arithmetic. 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 17897–17907, 2021. ",
1565
+ "bbox": [
1566
+ 173,
1567
+ 219,
1568
+ 825,
1569
+ 262
1570
+ ],
1571
+ "page_idx": 12
1572
+ },
1573
+ {
1574
+ "type": "text",
1575
+ "text": "[46] Wenliang Dai, Lu Hou, Lifeng Shang, Xin Jiang, Qun Liu, and Pascale Fung. Enabling multimodal generation on CLIP via vision-language knowledge distillation. In Findings of the Association for Computational Linguistics: ACL 2022, pages 2383–2395, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.findings-acl.187. URL https://aclanthology.org/2022.findings-acl.187. ",
1576
+ "bbox": [
1577
+ 173,
1578
+ 270,
1579
+ 826,
1580
+ 340
1581
+ ],
1582
+ "page_idx": 12
1583
+ },
1584
+ {
1585
+ "type": "text",
1586
+ "text": "[47] Woojeong Jin, Yu Cheng, Yelong Shen, Weizhu Chen, and Xiang Ren. A good prompt is worth millions of parameters: Low-resource prompt-based learning for vision-language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2763–2775, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.197. URL https://aclanthology.org/2022.acl-long.197. ",
1587
+ "bbox": [
1588
+ 174,
1589
+ 348,
1590
+ 826,
1591
+ 433
1592
+ ],
1593
+ "page_idx": 12
1594
+ },
1595
+ {
1596
+ "type": "text",
1597
+ "text": "[48] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631–1642, Seattle, Washington, USA, October 2013. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/D13-1170. ",
1598
+ "bbox": [
1599
+ 173,
1600
+ 440,
1601
+ 825,
1602
+ 511
1603
+ ],
1604
+ "page_idx": 12
1605
+ },
1606
+ {
1607
+ "type": "text",
1608
+ "text": "[49] Weizhi Wang, Li Dong, Hao Cheng, Haoyu Song, Xiaodong Liu, Xifeng Yan, Jianfeng Gao, and Furu Wei. Visually-augmented language modeling. In International Conference on Learning Representations, 2023. ",
1609
+ "bbox": [
1610
+ 171,
1611
+ 518,
1612
+ 821,
1613
+ 561
1614
+ ],
1615
+ "page_idx": 12
1616
+ },
1617
+ {
1618
+ "type": "text",
1619
+ "text": "[50] Jiahui Yu, Zirui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, and Yonghui Wu. Coca: Contrastive captioners are image-text foundation models, 2022. ",
1620
+ "bbox": [
1621
+ 171,
1622
+ 569,
1623
+ 821,
1624
+ 598
1625
+ ],
1626
+ "page_idx": 12
1627
+ },
1628
+ {
1629
+ "type": "text",
1630
+ "text": "[51] Rohit Girdhar, Alaaeldin El-Nouby, Zhuang Liu, Mannat Singh, Kalyan Vasudev Alwala, Armand Joulin, and Ishan Misra. Imagebind: One embedding space to bind them all. In CVPR, 2023. ",
1631
+ "bbox": [
1632
+ 173,
1633
+ 606,
1634
+ 823,
1635
+ 648
1636
+ ],
1637
+ "page_idx": 12
1638
+ },
1639
+ {
1640
+ "type": "text",
1641
+ "text": "[52] Xi Chen, Xiao Wang, Soravit Changpinyo, AJ Piergiovanni, Piotr Padlewski, Daniel Salz, Sebastian Goodman, Adam Grycner, Basil Mustafa, Lucas Beyer, et al. Pali: A jointly-scaled multilingual language-image model. arXiv:2209.06794, 2022. ",
1642
+ "bbox": [
1643
+ 173,
1644
+ 656,
1645
+ 825,
1646
+ 700
1647
+ ],
1648
+ "page_idx": 12
1649
+ },
1650
+ {
1651
+ "type": "text",
1652
+ "text": "[53] Xi Chen, Josip Djolonga, Piotr Padlewski, Basil Mustafa, Soravit Changpinyo, Jialin Wu, Carlos Riquelme Ruiz, Sebastian Goodman, Xiao Wang, Yi Tay, et al. Pali-x: On scaling up a multilingual vision and language model. arXiv preprint arXiv:2305.18565, 2023. ",
1653
+ "bbox": [
1654
+ 174,
1655
+ 708,
1656
+ 826,
1657
+ 751
1658
+ ],
1659
+ "page_idx": 12
1660
+ },
1661
+ {
1662
+ "type": "text",
1663
+ "text": "[54] OpenAI. Gpt-4 technical report, 2023. ",
1664
+ "bbox": [
1665
+ 176,
1666
+ 758,
1667
+ 462,
1668
+ 773
1669
+ ],
1670
+ "page_idx": 12
1671
+ },
1672
+ {
1673
+ "type": "text",
1674
+ "text": "[55] Peng Gao, Jiaming Han, Renrui Zhang, Ziyi Lin, Shijie Geng, Aojun Zhou, Wei Zhang, Pan Lu, Conghui He, Xiangyu Yue, Hongsheng Li, and Yu Qiao. Llama-adapter v2: Parameter-efficient visual instruction model, 2023. ",
1675
+ "bbox": [
1676
+ 171,
1677
+ 781,
1678
+ 825,
1679
+ 824
1680
+ ],
1681
+ "page_idx": 12
1682
+ },
1683
+ {
1684
+ "type": "text",
1685
+ "text": "[56] Danny Driess, Fei Xia, Mehdi SM Sajjadi, Corey Lynch, Aakanksha Chowdhery, Brian Ichter, Ayzaan Wahid, Jonathan Tompson, Quan Vuong, Tianhe Yu, et al. Palm-e: An embodied multimodal language model. arXiv preprint arXiv:2303.03378, 2023. ",
1686
+ "bbox": [
1687
+ 171,
1688
+ 832,
1689
+ 821,
1690
+ 875
1691
+ ],
1692
+ "page_idx": 12
1693
+ },
1694
+ {
1695
+ "type": "text",
1696
+ "text": "[57] Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. arXiv preprint arXiv:2304.08485, 2023. ",
1697
+ "bbox": [
1698
+ 173,
1699
+ 883,
1700
+ 821,
1701
+ 911
1702
+ ],
1703
+ "page_idx": 12
1704
+ },
1705
+ {
1706
+ "type": "text",
1707
+ "text": "[58] Deyao Zhu, Jun Chen, Xiaoqian Shen, Xiang Li, and Mohamed Elhoseiny. Minigpt-4: Enhancing vision-language understanding with advanced large language models. arXiv preprint arXiv:2304.10592, 2023. \n[59] Wenliang Dai, Junnan Li, Dongxu Li, Anthony Meng Huat Tiong, Junqi Zhao, Weisheng Wang, Boyang Li, Pascale Fung, and Steven Hoi. Instructblip: Towards general-purpose vision-language models with instruction tuning. arXiv:2305.06500, 2023. \n[60] Zewen Chi, Li Dong, Shaohan Huang, Damai Dai, Shuming Ma, Barun Patra, Saksham Singhal, Payal Bajaj, Xia Song, Xian-Ling Mao, Heyan Huang, and Furu Wei. On the representation collapse of sparse mixture of experts. In Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=mWaYC6CZf5. \n[61] Michihiro Yasunaga, Armen Aghajanyan, Weijia Shi, Rich James, Jure Leskovec, Percy Liang, Mike Lewis, Luke Zettlemoyer, and Wen tau Yih. Retrieval-augmented multimodal language modeling. ArXiv, abs/2211.12561, 2022. \n[62] Jing Yu Koh, Ruslan Salakhutdinov, and Daniel Fried. Grounding language models to images for multimodal generation. arXiv preprint arXiv:2301.13823, 2023. ",
1708
+ "bbox": [
1709
+ 171,
1710
+ 89,
1711
+ 828,
1712
+ 340
1713
+ ],
1714
+ "page_idx": 13
1715
+ }
1716
+ ]
parse/dev/UpN2wfrLec/UpN2wfrLec_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/UpN2wfrLec/UpN2wfrLec_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Vx1JadlOIt/Vx1JadlOIt.md ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VisionLLM: Large Language Model is also an Open-Ended Decoder for Vision-Centric Tasks
2
+
3
+ Wenhai Wang∗2 Zhe Chen∗1,3 Xiaokang Chen∗1,4 Jiannan $\mathbf { W _ { u } } ^ { * 1 , 5 }$ Xizhou Zhu1,6 Gang Zeng4 Ping Luo5 Tong $\mathbf { L u ^ { 3 } }$ Jie Zhou6 Yu Qiao1 Jifeng Dai†1,6 1OpenGVLab, Shanghai AI Laboratory 2The Chinese University of Hong Kong 3Nanjing University 4Peking University 5The University of HongKong 6Tsinghua University
4
+
5
+ Code: https://github.com/OpenGVLab/VisionLLM
6
+
7
+ # Abstract
8
+
9
+ Large language models (LLMs) have notably accelerated progress towards artificial general intelligence (AGI), with their impressive zero-shot capacity for user-tailored tasks, endowing them with immense potential across a range of applications. However, in the field of computer vision, despite the availability of numerous powerful vision foundation models (VFMs), they are still restricted to tasks in a pre-defined form, struggling to match the open-ended task capabilities of LLMs. In this work, we present an LLM-based framework for vision-centric tasks, termed VisionLLM. This framework provides a unified perspective for vision and language tasks by treating images as a foreign language and aligning vision-centric tasks with language tasks that can be flexibly defined and managed using language instructions. An LLM-based decoder can then make appropriate predictions based on these instructions for open-ended tasks. Extensive experiments show that the proposed VisionLLM can achieve different levels of task customization through language instructions, from fine-grained object-level to coarse-grained task-level customization, all with good results. It’s noteworthy that, with a generalist LLMbased framework, our model can achieve over $60 \%$ mAP on COCO, on par with detection-specific models. We hope this model can set a new baseline for generalist vision and language models. The code shall be released.
10
+
11
+ # 1 Introduction
12
+
13
+ The emergence of large language models (LLMs) like ChatGPT [35] has revolutionized the landscape of artificial general intelligence (AGI), showcasing their impressive zero-shot capabilities in addressing various natural language processing (NLP) tasks through user-tailored prompts or language instructions. Despite these advancements, it’s essential to note that the triumph of LLMs does not effortlessly extend to pure vision and vision-language tasks, due to the inherent disparities between modalities and task formats.
14
+
15
+ The field of computer vision presents a unique set of challenges and paradigms that differ from those of NLP. The traditional paradigm of vision foundation models is pre-training followed by fine-tuning [51, 11, 43, 53, 17, 44], which is effective but comes with significant marginal costs when adapting to diverse downstream scenarios. As shown in Figure 1a, while approaches such as multi-task unification [38, 50, 1, 49, 72] have been used to achieve generalist capability, they often struggle to overcome the limitations imposed by pre-defined tasks, resulting in a gap in open-ended task capabilities compared to LLMs. Recently, visual prompt tuning [24, 66, 70, 67, 54] has emerged as a way to flexibly outline some pure vision tasks (see Figure 1b), such as object detection, instance
16
+
17
+ ![](images/2a51129098861a5218a07b95eae7f1b82a9343d82a0e8b59c93c816806fb2d8d.jpg)
18
+
19
+ ![](images/13482ae826748fd88984f398aaf673054cdcde523ff2f0db87c13f63a13b2711.jpg)
20
+ (b) Visual prompt tuning [24, 56, 54] are inconsistent with the format of LLMs.
21
+
22
+ (a) Vision generalist models [51, 53, 74] are constrained by the format of pre-defined tasks.
23
+
24
+ ![](images/6d3aa85a408251041c0bb17b17eb26209941e8a4f6d8ea22b2183fb30ee30d4e.jpg)
25
+ (c) VisionLLM (ours) can flexibly manage vision-centric tasks using language instructions like LLMs.
26
+ Figure 1: Comparison of our VisionLLM with popular paradigms. Unlike current vision generalist models that depend on pre-defined task formats and visual prompt tuning models that are inconsistent with large language models (LLMs), VisionLLM leverages the power of LLMs for open-ended vision tasks by using language instructions.
27
+
28
+ segmentation, and pose estimation, using visual masking. However, the format of visual prompts considerably deviates from that of language instructions, making it challenging to directly apply the reasoning abilities and world knowledge of LLMs to vision tasks. Therefore, there is an urgent need for a unified generalist framework that can seamlessly integrate the strengths of LLMs with the specific requirements of vision-centric tasks.
29
+
30
+ In this work, we present VisionLLM, a novel framework that aligns the definitions of vision-centric tasks with the methodologies of LLMs. Leveraging the reasoning and parsing capacities of LLMs, VisionLLM is designed to empower open-ended task capabilities for vision-centric tasks. Specifically, it comprises three core components: (1) a unified language instruction designed for vision and vision-language tasks, (2) a language-guided image tokenizer, and (3) an LLM-based open-ended task decoder that orchestrates various tasks using language instructions. With this framework, a wide range of vision-centric tasks can be seamlessly integrated, including object detection, instance segmentation, image captioning, and visual grounding. In addition, the framework also facilitates task customization at different levels of granularity, allowing for the customization of target objects, output formats, task descriptions, etc.
31
+
32
+ Compared to current popular API-based applications [60, 65, 42, 32, 28], our model takes a unified, end-to-end approach to integrate VFMs and LLMs, streamlining and enhancing the overall efficiency of the overall process, and leveraging the strengths and data of both VFMs and LLMs within a single, cohesive system. Furthermore, our model surpasses the limitations of generalist vision models pre-trained on pre-defined tasks. VisionLLM can effectively manage vision-centric tasks through language instructions, embodying a flexible and open-ended approach that is not constrained by pre-set tasks. This versatility makes VisionLLM a robust and powerful generalist model for vision and vision-language tasks, opening up new possibilities for the development of unified generalist models that bridge the domains of vision and language.
33
+
34
+ In summary, our main contributions are as follows:
35
+
36
+ (1) We propose VisionLLM, the first framework that leverages the power of LLMs to address visioncentric tasks in an open-ended and customizable manner. By aligning the definitions of vision-centric tasks with LLM methodologies, VisionLLM breaks new ground in enabling the unified modeling of vision and language, opening up possibilities for advancing the field.
37
+
38
+ (2) We overcome many difficulties when porting LLMs to vision-centric tasks, by designing unified language instruction that matches the format of language models and covers various vision-centric tasks including visual perception. Correspondingly, we develop a language-guided image tokenizer and an LLM-based task decoder that can handle open-ended tasks according to the given language instructions based on the LLMs’ reasoning and parsing capabilities.
39
+
40
+ (3) We construct a series of tasks with different granularities to verify the effectiveness of our models, ranging from easy to hard, and from pre-defined to flexible. Through these validations, we demonstrate the remarkable generality of our models, showcasing their ability to handle diverse
41
+
42
+ Human: “Identify the objects in <image> that belong to {‘What is the child eating?’: <c0>, ‘red gamepad': <c1>} and draw a bounding box around each one. The output should be a list of tuples in
43
+
44
+ ![](images/bdd6a545fad93f1fe2171eca15920f046c6833f0db480da5b22ac95467046b01.jpg)
45
+
46
+ the format (c, x1, y1, x2, y2), where c is the class label and x1, y1, x2, y2 are the coordinates of the top-left and bottom-right corners of the bounding box. The coordinates should be within the range 1024."
47
+
48
+ VisionLLM: "The bounding boxes are [(<c0>, 226.4, 229.8, 363.1, 347.4), (<c1>, 441.1, 183.5, 538.6, 269.9)]."
49
+
50
+ Human: "For each object in <image> that is a member of {'motorbike': $< \mathsf { c } 0 > \}$ , output a tuple with the class label and the coordinates of a polygon with 16 points that
51
+
52
+ ![](images/654913c5cf06a5a7be1ab27e563f83275228c04250e18421ce001abe0726ff9d.jpg)
53
+
54
+ encloses the object. The coordinates should be within the range 1024. The output format should be (c, x1, y1, x2, y2, ..., x16, y16)."
55
+
56
+ VisionLLM: "The detected polygons are $I ( < \mathsf { c o } > , 1 3 5 . 3 ,$ 95.7, 123.4, 53.4, 84.9, 57.6, 66.8, 60.5, 60.1, 72.3, 34.2, 71.4, ..., 124.9, 119.3)]."
57
+
58
+ (a) Object Detection with Customized Class Set
59
+
60
+ Human: "Provide a long description of the <image>."
61
+
62
+ ![](images/59e4f4bd19e53294b66fcc2461ba5df514fa99c57a11021c98cb5ddd55b50213.jpg)
63
+
64
+ VisionLLM: "The image features a white dog laying down on a foldable outdoor
65
+
66
+ # cooling pad ,
67
+
68
+ which is placed on top of a wooden table. The dog has its head in the middle of the cooling pad, and a fan is positioned behind it, blowing air onto the pad. The table is outdoors, in a grassy area, and there are two chairs placed around it, one on each side. The scene appears to be set in a sunny weather, with a bright and sunny sky, which contributes to the overall outdoor atmosphere."
69
+
70
+ (b) Object Location with Editable Output Format
71
+
72
+ Human: "With the objects in the <image>, if you feel hot, what will you do?
73
+
74
+ ![](images/1675fe85ffcea4c5dc05f23a7f48b5ed1559a53361c537b2734d6cb4325d41a8.jpg)
75
+
76
+ VisionLLM: "First, You can also try turning off the computer and other electrical appliances in the
77
+
78
+ room to reduce the heat generated by their operation. As an alternative, you can use the desk fan provided in the image to create a cooling effect in the room. You can plug in the fan and adjust its settings to ensure it blows air in a direction that reaches the room’s occupants effectively."
79
+
80
+ (c) Image Description with Controllable Text Length (d) Visual Question Answer with Complex Reasoning
81
+
82
+ Figure 2: Results and visualizations of our VisionLLM. Guided by language instructions, our unified generalist framework showcases its effectiveness on diverse open-ended vision-centric tasks. The text marked with a gray background indicates the customized instructions and the desired outputs.
83
+
84
+ scenarios, including random object categories, random output formats, and random task descriptions, as shown in Figure 2. The successful outcomes of these validations underscore the tremendous potential of our model in harnessing the capabilities of LLMs to control and guide vision-centric tasks. In addition, with a generalist LLM-based framework, our model also yields promising results on various vision-centric tasks. Notably, our generalist model achieves an impressive mAP score of $60 \%$ on the COCO dataset, surpassing many detection-specific models [73, 6, 20] and approaching the state-of-the-art record.
85
+
86
+ # 2 Related Work
87
+
88
+ # 2.1 Large Language Model
89
+
90
+ Large language models (LLMs) have gained significant attention in the field of natural language processing (NLP) and artificial general intelligence (AGI), due to their impressive capabilities in language generation, in-context learning, world knowledge, and reasoning. The GPT family, including GPT-3 [5], ChatGPT [35], GPT-4 [34], and InstructGPT [36] are most representative works of LLMs. Other LLMs like OPT [69], LLaMA [46], MOSS [14], and GLM [68] have also made substantial contributions to the field. These models achieve high performance and are open-sourced, serving as valuable resources for training large models and as foundations for further fine-tuning for specific purposes. For instance, Alpaca [45] introduces a self-instruct framework that facilitates instruction tuning of the LLaMA model, reducing the reliance on human-written instruction data. Recently, the emergence of these LLMs has also opened up API-based applications for solving vision-centric tasks. These applications have integrated visual APIs with language models to enable decision-making or planning based on visual information, such as Visual ChatGPT [60], MM-REACT [65], HuggingGPT [42], InternGPT [32], and VideoChat [28]. However, despite the convenience of using language-based instructions to define tasks and describe visual elements, these interactive systems [60, 65, 42, 32, 28] still face limitations in capturing fine-grained visual details and understanding complex visual contexts, which hinder their ability to effectively connecting vision and language models. In summary, while LLMs have shown tremendous potential in various NLP applications, their applicability to vision-centric tasks has been limited by the challenges posed by modalities and task formats.
91
+
92
+ # 2.2 Vision Generalist Model
93
+
94
+ The pursuit of generalist models [74, 33, 62], which aim to handle a wide range of tasks using a shared architecture and parameters, has been a long-standing goal in the machine learning community. Inspired by the success of sequence-to-sequence (seq2seq) models in the field of NLP [38], recent advancements such as OFA [50], Flamingo [1], and GIT [49] propose modeling diverse tasks as sequence generation tasks. Unified-IO [33], Pix2Seq v2 [8], and UniTab [63] extend this idea by using discrete coordinate tokens to encode and decode spatial information for more tasks. Gato [39] also incorporates reinforcement learning tasks into the seq2seq framework, while GPV [19] develops a general-purpose vision system by combining a seq2seq module with a DETR-based visual encoder [6]. However, these methods suffer from some limitations, such as slow inference speed and performance degradation due to the non-parallel auto-regressive decoding process. Uni-Perceivers [74, 72, 26] solve these issues by unifying different tasks using the maximum likelihood target for each input based on representation similarity, regardless of their modality, making it possible to support both generation and non-generation tasks in a unified framework. Nevertheless, these generalist models are still restricted by pre-defined tasks and cannot support flexible open-ended task customization based on language instructions like LLMs.
95
+
96
+ # 2.3 Instruction Tuning
97
+
98
+ Language instructions are a powerful way to express various NLP tasks and examples for LLMs, as introduced by GPT-3 [5]. Following this idea, subsequent works, such as InstructGPT [36], FLAN [13, 59], and OPT-IML [23], explore the instruction-tuning method [58, 57] and demonstrate that this simple approach effectively enhances the zero-shot and few-shot capabilities of LLMs. The language instruction paradigm has also been adopted by the computer vision community to define image-to-text tasks. Flamingo [1] is a milestone work that uses vision and language inputs as prompts and achieves remarkable few-shot results in various vision-language tasks, such as image captioning [9] and VQA [2]. BLIP-2 [27] further connects the visual encoder with LLMs through a querying transformer and a linear projection layer to build strong multimodal models. MiniGPT-4 [71] and LLaVA [30] finetune the BLIP-2-style models on synthetic multimodal instruction-following data to unleash the potential of LLMs. However, these models mainly focus on image-to-text tasks and fail to address visual perception, such as object detection, instance segmentation, pose estimation, etc. To tackle image inpainting tasks, Bar et al. [3] introduces the first visual prompting framework that utilizes inpainting with discrete tokens on images. Painter [55] and SegGPT [56] employ masked image modeling on raw pixels for in-context learning with paired images. While these visual prompt models demonstrate good results in segmentation tasks, their applicability to numerous real-world vision tasks is challenging. Moreover, defining the visual prompts as image inpainting is inconsistent with the language instructions in LLMs, hard to leverage the reasoning, parsing ability, and world knowledge of LLMs. In this work, we aim to align vision-centric tasks with language tasks, use language instructions to unifiedly and flexibly define all tasks, and solve them with a shared LLM-based task decoder.
99
+
100
+ # 3 VisionLLM
101
+
102
+ # 3.1 Overall Architecture
103
+
104
+ This work targets to provide a unified generalist framework that can seamlessly integrate the strengths of large language models (LLMs) with the specific requirements of vision-centric tasks. As shown in Figure 3, the overall architecture of VisionLLM consists of three key designs: (1) a unified language instruction that provides a consistent interface for vision-centric task definition and customization; (2) a language-guided image tokenizer, which encodes visual information in alignment with the given language prompt, enabling the model to comprehend and parse the visual content effectively; and (3) an LLM-based open-task decoder, which utilizes the encoded visual information and language instructions to generate satisfactory predictions or outputs. The three designs work together to achieve a flexible and open-ended framework that can handle various vision-centric tasks at different levels of task customization through language instructions.
105
+
106
+ Vision-language example: "Describe the image <image> in details." Language Instructions <text> Vision-only example: "For each object in image <image> that is a member of class set <class>, output a tuple with the class label and the coordinates of a polygon with 16 points that encloses the object. The coordinates should be within range <range>. The output format should be (c, x1, y1, ...)."
107
+
108
+ ![](images/b0780942b0411460c047304f6e85746e7bf2043070c0a7418953fc1b0cc38a4d.jpg)
109
+ Figure 3: Overall architecture of the proposed VisionLLM. It consists of three parts: a unified language instruction designed to accommodate both vision and vision-language tasks, an image tokenizer that encodes visual information guided by language instructions, and an LLM-based openended task decoder that executes diverse tasks defined by language instructions.
110
+
111
+ Different from previous interactive systems [60, 65, 42, 32, 28] that rely on APIs, our VisionLLM presents a more flexible and end-to-end pipeline. Given language instructions that describe the current tasks and an input image, the model first uses a language-guided image tokenizer to encode the image tokens based on the given prompt. Then, the image tokens and language instructions are fed to an LLM-based open-ended task decoder. Finally, it evaluates the generated outputs against the task definition given by the unified language instructions, enabling the model to produce task-specific results. This seamless, end-to-end pipeline enables VisionLLM to effectively combine vision and language, achieving remarkable performance in open-ended and customizable vision-centric tasks.
112
+
113
+ # 3.2 Unified Language Instruction
114
+
115
+ We first introduce unified language instructions to describe vision-centric tasks. This design enables the unification of various vision-only and vision-language task descriptions and allows for flexible task customization.
116
+
117
+ Vision-Language Tasks. The instructions for vision-language tasks such as image captioning and visual question answering (VQA) are straightforward and similar to NLP tasks. Following previous methods [27, 74, 30], we describe the image captioning task like “The image is <image>. Please generate a caption for the image: ”, and the VQA task like “The image is <image>. Please generate an answer for the image according to the question: <question>”. Here, <image> and <question> are the placeholders of the image tokens and the question, respectively. The image tokens are directly placed at the placeholder <image>.
118
+
119
+ Vision-Only Tasks. Designing effective language instructions for vision tasks is a challenging endeavor due to the differences in modality and task format between vision and language. Here, we describe vision tasks by providing a task description and specifying the desired output format via language instructions.
120
+
121
+ (1) The task description conveys the intended task to the language model. Following self-instruct [57], we design a set of seed instructions with placeholders and employ LLMs to generate a large number of related task descriptions and randomly select one of them during training.
122
+
123
+ (2) For conventional visual perception tasks like object detection and instance segmentation, we propose a unified output format represented as a tuple $( C , P )$ , where $C$ denotes the class index in the category set <class>, and $\bar { P } = \{ x _ { i } , y _ { i } \} _ { i = 1 } ^ { N }$ represents $N$ points that locate the object. To align with the format of word tokens, both the class index and the coordinates of points $x _ { i } , y _ { i }$ are transformed into discretized tokens. Specifically, the class index is an integer starting from 0, and the continuous coordinates of the points are uniformly discretized into an integer within the range [-<range>, <range>]. For object detection and visual grounding tasks, the point number $N$ is equal to 2, representing the the top-left and bottom-right points of object’s bounding box. In the case of instance segmentation, we employ multiple $( N > 8 )$ ) points along the object boundary to represent an instance mask [61]. Other perception tasks such as pose estimation (keypoint detection) can also be formulated as language instructions in this way.
124
+
125
+ An example of language instruction for the instance segmentation task is as follows: “Segment all the objects of category set <class> within the <range> of the image and generate a list of the format (c, x1, y1, $x 2$ , y2, ..., x8, y8). Here, c represents the index of the class label starting from $O$ , and $( x I$ , y1, x2, y2, ..., x8, y8) correspond to the offsets of boundary points of the object relative to the center point. The image is: <image>”.
126
+
127
+ # 3.3 Language-Guided Image Tokenizer
128
+
129
+ VisionLLM considers images as a kind of foreign language and converts them into token representations. Unlike previous works [16, 52, 31] that utilize fixed-size patch embeddings to represent images, we introduce the language-guided image tokenizer to flexibly encode visual information that aligns with task-specific language prompts or instructions.
130
+
131
+ Specifically, give an image $\mathbf { X } \in \mathbb { R } ^ { H \times W \times 3 }$ with height $H$ and width $W$ , we first feed it to the image backbones (e.g., ResNet [21]) and extract visual features $F _ { v }$ of four different scales. Additionally, we leverage a text encoder (e.g., BERT [15]) to extract the language features $F _ { l }$ from given prompts. The language features are then injected into each scale of visual features through crossattention [47], yielding multi-scale language-aware visual features, enabling the alignment of features across modalities.
132
+
133
+ Afterward, we propose to adopt a transformer-based network (e.g., Deformable DETR [73]) with $M$ random-initialized queries $Q ^ { \dot { } } = \{ q _ { i } \} _ { i = 1 } ^ { M }$ to capture the high-level information of images. We build the transformer-based network on top of the multi-scale language-aware visual features to extract $M$ image tokens $T = \{ ( e _ { i } , l _ { i } ) \} _ { i = 1 } ^ { M }$ , each of which is represented by an embedding $e _ { i }$ and a location $l _ { i }$ denoting the semantic and positional information of the token. This design not only represents the images independent of input resolution but also extracts the visual representation that is informative with respect to the language prompts.
134
+
135
+ # 3.4 LLM-based Open-Ended Task Decoder
136
+
137
+ We build our decoder on Alpaca [45], an LLM that is adapted from LLaMA [46], to handle various vision-related tasks with language guidance. However, Alpaca has some inherent drawbacks for vision-centric tasks, such as (1) It only has a few digit tokens (e.g., $0 { \sim } 9$ ) in its vocabulary, which restricts its ability to locate objects by numbers; (2) It uses multiple tokens to represent the category name, resulting in an inefficient scheme in object classification; and (3) It is a causal model that is inefficient for visual perception tasks.
138
+
139
+ To tackle these issues, we expand the vocabulary of LLM with additional tokens specially designed for vision-centric tasks. First, we add a set of location tokens, denoted as $\{ < \mathtt { p } - 5 1 2 >$ , ..., $\mathtt { < p 0 > }$ , ..., $\mathsf { < p 5 1 2 > } \}$ , where ${ \tt A p i > }$ represents the discretized offset of $i \in [ - 5 1 2 , 5 1 2 ]$ to the location $l _ { i }$ of the image token, and the relative value to image height or width is equal to $i / 5 1 2$ . These tokens successfully transform the object localization task from continuous variable prediction to more unified discrete bin classification. Second, we introduce semantics-agnostic classification tokens $\{ < \mathsf { c o } > , < \mathsf { c } 1 > , . . . , < \mathsf { c } 5 1 1 > \}$ to replace category name tokens, which overcomes the inefficiency of using multiple tokens to represent categories. The mapping between category names and the classification tokens is flexibly provided in the category set <class> of language instructions, such as $\{ " \mathtt { p e r s o n " } : < \mathtt { c 0 } >$ , "car": ${ < } c 1 >$ , "black cat": $\mathbf { < c } 2 > , \mathbf { \ldots } \}$ . This design allows our model to select the appropriate category name from the provided category set, facilitating efficient and accurate object classification.
140
+
141
+ Moreover, to address the inefficiency caused by the causal framework, we introduce outputformat-as-query decoding. We first use LLMs to parse the structural output format from the task instructions (e.g., “<cls> <x1> <y1> $< \tt x 2 >$ $\mathrm { < y } 2 \mathrm { > } ^ { \mathrm { , } \mathrm { , } }$ for object detection, “<bos>” for image captioning), and then feed the tokens of structural output format as queries to the decoder to generate the desired output according to the queries. This simple method enables our model to not only avoid inefficient token-by-token decoding in visual perception tasks, but also keep a unified framework for vision-language tasks.
142
+
143
+ ![](images/5b925cec77c80f3ecd2208ed699c71037dba057c130a11b4919e884e7d05c4b3.jpg)
144
+ Figure 4: Illustration of the “output-format-asquery” decoding process. $\bf \ddot { \sigma } < c l s > < x 1 > < y 1 > \tau . . . \dot { \sigma }$ ” denote the queries of the object’s class index and boundary points, and “<bos>” denotes the beginning of string.
145
+
146
+ Note that, during both the training and inference phases in the object detection task, we input 100 sets of $\mathrm { ^ { * * } { < } x l s > < x l > < y l > < x 2 > < y 2 > " }$ to the decoder, generating 100 object predictions. Those predictions with higher confidence scores will be retained, adhering to a common practice of the object detection task.
147
+
148
+ In this way, the output of object location and classification is formulated as a foreign language, thus unifying these vision-centric tasks into the format of token classification. Therefore, both vision-language and vision-only tasks can be supervised with the cross-entropy loss like language tasks. In addition, for efficient training, we adopt the Low-Rank Adaptation (LoRA) approach [22], which allows us to train and fine-tune the models without excessive computational costs. We set the LoRA rank to 64 and use LoRA on the QKVO (Query, Key, Value, and Output) in the attention layers. It also acts as a bridge between the language and visual tokens, facilitating effective alignment between the two modalities, ensuring better task customization, and improving the convergence of the overall system.
149
+
150
+ # 4 Experiment
151
+
152
+ # 4.1 Implementation Details.
153
+
154
+ We implement two variants of VisionLLM with two image backbones, i.e., ResNet [21] and InternImage-H [51]. For the language-guided image tokenizer, we adopt BERT-Large [4] as the text encoder and Deformable DETR (D-DETR) [73] to capture high-level information. For the LLM, we employ Alpaca-7B [45], a LLaMA [46] model fine-tuned with instructions, and equip it with LoRA [22] for parameter-efficient fine-tuning.
155
+
156
+ The model is trained in two stages. In the first stage, we initialize the model with the pre-trained weights of D-DETR and BERT, and train the visual backbone and language-guided image tokenizer to produce language-aware visual features. In the second stage, we connect the image tokenizer with Alpaca-7B and introduce the unified supervision of multiple tasks. We freeze the visual backbone while freezing most parameters of the LLM except a few LoRA parameters. More details on the experimental setup can be found in Sec. B of the supplementary material.
157
+
158
+ # 4.2 Task-Level Customization
159
+
160
+ We first evaluate the task-level customization capability of VisionLLM. VisionLLM supports coarsegrained task customization, including visual perception tasks and visual-language tasks. Table 1 presents the evaluation results on four standard vision-centric tasks, including object detection, instance segmentation, visual grounding, and image captioning. We compare our model with taskspecific methods as well as recently-proposed vision generalist models. Note that, unless specifically mentioned, the results of our model come from a shared-parameter generalist model and switch different tasks by changing the language instructions only. Detailed instructions could be found in the supplementary material.
161
+
162
+ Object Detection. Object detection is a fundamental computer vision task that involves identifying and localizing objects of interest within an image. Our method achieves comparable or higher results to others, $4 4 . 6 \ \mathrm { m A P } ,$ with a ResNet-50 [21] backbone. With the same backbone i.e. ResNet-50, our method outperforms Pix2Seq [7] by $1 . 4 \mathrm { m A P }$ , which also discretizes the output coordinates to integers. Furthermore, benefiting from the output-format-as-query framework (see Sec. 3.4), we can decode multiple predictions in parallel during inference, making our approach more efficient. Using InternImage-H [51] as the visual backbone, we obtained $6 0 . 2 \%$ mAP, which is close to the current state-of-the-art detection-specific model [51], demonstrating the scalability of our generalist model.
163
+
164
+ Visual Grounding. Visual grounding associates textual descriptions with corresponding regions or objects within an image. Training visual grounding and object detection can potentially conflict with each other, as object detection aims to detect all the objects, while visual grounding should only localize the referred object and suppress other objects. Benefiting from our unified task instructions and the strong instruction comprehension capabilities of LLMs, our model performs both tasks effectively and achieves a result of $8 0 . 6 \ : \mathrm { P } @ 0 . 5$ for visual grounding. With InternImage-H as the backbone, we achieve $8 6 . 7 \ : \mathrm { P } @ 0 . 5$ on the validation set of RefCOCO.
165
+
166
+ Instance Segmentation. Instance segmentation involves identifying and segmenting individual objects within an image. We employ a flexible number of points (i.e., $8 \sim 2 4 )$ along the object boundary to represent an instance mask. Compared to mainstream models specific to instance segmentation, our model has a comparable mask $\mathrm { { A P } _ { 5 0 } }$ ( $6 1 . 2 \%$ with InternImage-H [51]) but relatively low mask $\mathsf { A P } _ { 7 5 }$ . This gap could potentially arise from factors as follows: (1) We discretize the output coordinates to integers for unifying tasks, which introduces information loss; (2) Due to the memory and computational constraint, the number of points in our model is limited, which also results in a performance drop; and (3) Point-based methods typically yield lower results compared to direct mask prediction methods, such as Mask R-CNN [20].
167
+
168
+ Table 1: Results on standard vision-centric tasks. “sep” indicates that the model is separately trained on each task.
169
+ Table 2: Experiments of object-level and output format customization. We conduct these experiments based on VisionLLM-R50, and report the performance of box AP and mask AP on COCO minival for (a) and (b), respectively. “#Classes” and “#Points” indicate the number of classes and boundary points, respectively. “\*” indicates that we report the mean AP of the given classes, e.g., 10 classes.
170
+
171
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Backbone</td><td rowspan="2">Open- Ended</td><td colspan="2">Detection</td><td colspan="2"></td><td colspan="2">Instance Seg. Grounding</td><td colspan="2">Captioning</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>AP AP50 AP75 AP AP50 AP75P@0.5</td><td>BLEU-4CIDEr</td><td></td></tr><tr><td>Specialist Models</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>FasterR-CNN-FPN[40]</td><td>ResNet-50</td><td>X</td><td>40.3 61.0</td><td></td><td>)44.0</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>DETR-DC5 [6]</td><td>ResNet-50</td><td>×</td><td>43.3 63.1</td><td></td><td>45.9</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Deformable-DETR[73]</td><td>ResNet-50</td><td>X</td><td>45.7 65.0</td><td></td><td>49.1</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Mask R-CNN[20]</td><td>ResNet-50</td><td>X</td><td>41.0 61.7</td><td></td><td></td><td></td><td>44.9 37.1 58.4 40.1</td><td></td><td></td><td></td></tr><tr><td>Polar Mask [61]</td><td>ResNet-50</td><td>X</td><td>=</td><td></td><td></td><td></td><td>30.5 52.0 31.1</td><td></td><td></td><td></td></tr><tr><td>Pix2Seq[7]</td><td>ResNet-50</td><td>X</td><td>43.2 61.0 46.1</td><td></td><td></td><td></td><td>=</td><td></td><td></td><td></td></tr><tr><td>UNITER[10]</td><td>ResNet-101</td><td>X</td><td>-</td><td></td><td>=</td><td></td><td>=</td><td>81.4</td><td></td><td></td></tr><tr><td>VILLA [18]</td><td>ResNet-101</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td>82.4</td><td></td><td></td></tr><tr><td>MDETR[25]</td><td>ResNet-101</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td>86.8</td><td></td><td></td></tr><tr><td>BEiT-3 [53]</td><td>ViT-g</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td>-</td><td></td><td>147.6</td></tr><tr><td>VL-T5 [12]</td><td>T5-B</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td>1</td><td></td><td>116.5</td></tr><tr><td colspan="9">GeneralistModels</td><td></td><td></td></tr><tr><td>UniTab [64]</td><td>ResNet-101</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td>88.6</td><td>=</td><td>115.8</td></tr><tr><td>Uni-Perceiver[74]</td><td>ViT-B</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td>-</td><td>32.0</td><td>=</td></tr><tr><td>Uni-Perceiver-MoE[72]</td><td>ViT-B</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td>=</td><td>33.2</td><td>=</td></tr><tr><td>Uni-Perceiver-V2 [26]</td><td>Swin-B</td><td>X</td><td>58.6</td><td></td><td></td><td>50.6</td><td></td><td>=</td><td>35.4</td><td>116.9</td></tr><tr><td>Pix2Seq v2 [8]</td><td>ViT-B</td><td>X</td><td>46.5</td><td></td><td></td><td>38.2</td><td></td><td>1</td><td>34.9</td><td></td></tr><tr><td>VisionLLM-R50sep</td><td>ResNet-50</td><td>X</td><td>44.8 64.1 48.5 25.2 50.6 22.4</td><td></td><td></td><td></td><td></td><td>84.4</td><td>30.8</td><td>112.4</td></tr><tr><td>VisionLLM-R50</td><td>ResNet-50</td><td></td><td>44.6 64.0 4</td><td></td><td></td><td>48.1 25.1 50.0 22.4</td><td></td><td>80.6</td><td>31.0</td><td>112.5</td></tr><tr><td>VisionLLM-H</td><td>InternImage-H</td><td></td><td>60.2 79.3 65.8 30.6 61.2 27.6</td><td></td><td></td><td></td><td></td><td>86.7</td><td>32.1</td><td>114.2</td></tr></table>
172
+
173
+ (a) Object-level customization.
174
+
175
+ <table><tr><td>#Classes</td><td>AP</td><td>AP50</td><td>AP75 APs</td><td>APM</td><td>APL</td></tr><tr><td>10*</td><td>48.9</td><td>72.6</td><td>51.2</td><td>31.7 47.5</td><td>67.3</td></tr><tr><td>20*</td><td>52.7</td><td>73.6</td><td>56.8</td><td>31.8 53.2</td><td>70.5</td></tr><tr><td>40*</td><td>49.3</td><td>70.7</td><td>53.2</td><td>33.1 53.6</td><td>63.8</td></tr><tr><td>80*</td><td>44.6</td><td>64.0</td><td>48.1</td><td>26.7 47.9</td><td>60.5</td></tr></table>
176
+
177
+ (b) Output format customization.
178
+
179
+ <table><tr><td>#Points</td><td>AP</td><td>AP50</td><td>AP75 APs</td><td>APM</td><td>APL</td></tr><tr><td>8</td><td>18.5</td><td>45.7</td><td>11.6</td><td>9.9 19.7</td><td>28.7</td></tr><tr><td>14</td><td>22.9</td><td>48.3</td><td>19.4</td><td>11.0 25.1</td><td>36.0</td></tr><tr><td>16</td><td>24.2</td><td>49.9</td><td>20.9</td><td>11.5 26.3</td><td>36.8</td></tr><tr><td>24</td><td>25.1</td><td>50.0</td><td>22.4</td><td>12.5 27.4</td><td>38.2</td></tr></table>
180
+
181
+ Image Captioning. We also evaluate our model in a representative vision-language task, i.e. image captioning task, and report the BLEU-4 [37] and CIDEr [48] metrics. Note that we do not adopt the CIDEr optimization [41]. We can observe that VisionLLM achieves competitive performance to previous methods. With ResNet-50, we obtain a BLEU-4 score of 31.0 and a CIDEr score of 112.5. When using InternImage-H as the backbone, our model achieves a comparable BLEU-4 score of 32.1 and a CIDEr score of 114.2. These results demonstrate the effectiveness of VisionLLM in generating descriptive and contextually relevant captions for images.
182
+
183
+ # 4.3 Object-Level & Output Format Customization
184
+
185
+ Our VisionLLM not only allows for customizing the task description, but also for adjusting the target object and the output format using language instructions. Here, we evaluate our model’s fine-grained customization ability on COCO. In particular, to customize the target object, we modify the <class> in language instructions to change the model’s recognition target from 10 classes to 80 classes. Likewise, to customize the output format, we modify the number of points in language instructions to change the task output format. Table 2 shows that our method can perform well for both object-level and output format changes.
186
+
187
+ (a) Effect of text encoder in the language-guided image tokenizer.
188
+
189
+ <table><tr><td>W/BERT</td><td>Freeze</td><td>COCO</td><td>RefCOCO</td></tr><tr><td>1</td><td>1</td><td>44.7</td><td>48.1</td></tr><tr><td>√</td><td></td><td>44.8</td><td>84.1</td></tr><tr><td>√</td><td>√</td><td>1.3</td><td>34.3</td></tr></table>
190
+
191
+ Table 3: Ablation studies on language-guided image tokenizer and hyper-parameters.
192
+ (c) Effect of the number of bins (#Bins).
193
+
194
+ <table><tr><td>#Bins</td><td>AP</td></tr><tr><td>257</td><td>34.9</td></tr><tr><td>513</td><td>40.8</td></tr><tr><td>1025</td><td>44.8</td></tr><tr><td>2049</td><td>44.8</td></tr></table>
195
+
196
+ (b) Effect of image tokenization method.
197
+
198
+ <table><tr><td>Tokenization</td><td>AP</td></tr><tr><td>Average Pooling Ours</td><td>23.1 44.8</td></tr></table>
199
+
200
+ # 4.4 Ablation Study
201
+
202
+ In this section, we analyze the effect of key components and hyper-parameters on VisionLLM. Unless otherwise specified, we use ResNet-50 [21] backbone and perform the ablation experiments for object detection tasks with random classes and task descriptions on COCO2017 [29].
203
+
204
+ Single Task vs. Multiple Tasks. We perform an ablation study to assess the impact of multi-task learning with language instructions on VisionLLM. As shown in Table 1, the single-task trained model VisionLLM- $\cdot \mathrm { R } 5 0 _ { \mathrm { s e p } }$ is slightly better than the jointly trained model VisionLLM-R50 except image captioning. This is due to the multitasking conflicts that also affect previous generalist models [74, 72], and it reflects a trade-off between accuracy and generalization.
205
+
206
+ Text Encoder in Language-Guided Image Tokenizer. We examine the role of text encoder (i.e., BERT) in our language-guided image tokenizer in Table 3a, where we report the results for object detection and visual grounding. The first two rows show that BERT is not essential for object detection but it is crucial for visual grounding. We also investigate the effect of freezing the text encoder during training. The last row indicates that freezing BERT hinders the alignment of vision and language modalities and thus degrades the performance for both tasks.
207
+
208
+ Image Tokenization Method. As a comparison to our query-based tokenization, we employ average pooling on the feature maps from the D-DETR encoder to obtain $M$ patch embeddings, which serve as token representations for the image. Results in Table 3b indicate a clear advantage of our method. This is due to its ability to capture information from objects of various sizes in a more flexible way.
209
+
210
+ Number of Localization Tokens. We vary the number of localization tokens from 257 (i.e., - $1 2 8 \mathrm { \sim } 1 2 8 $ ) to 2049 (i.e., - $- 1 0 2 4 { \sim } 1 0 2 4 )$ , to investigate its impact on visual perception performance. As presented in Table 3c, the model consistently exhibits improvement as the number of localization tokens increases until it reaches a saturation point. Remarkably, a substantial performance boost is observed when the number is raised from 257 to 1025 $+ 9 . 9$ AP). These results indicate that a higher number of localization tokens enables the models to achieve finer localization abilities, thereby improving localization accuracy.
211
+
212
+ # 5 Conclusion
213
+
214
+ In this paper, we have presented VisionLLM, a novel framework that leverages the power of large language models (LLMs) to address vision-centric tasks in an open-ended and customizable manner. We have designed unified language instruction that matches the format of language models and covers various vision-centric tasks including visual perception. We have also developed a language-guided image tokenizer and an LLM-based task decoder that can handle open-ended tasks according to the given language instructions. We have verified the effectiveness of our models on a series of tasks with different granularities, demonstrating their remarkable generality and flexibility.
215
+
216
+ Broader Impact. We envision that this work will promote the fusion of visual and language tasks. In addition, since our work is built on open-source pre-trained vision foundation models and large language models, requiring low training resources, thus reducing the carbon footprint. We do not foresee obvious undesirable ethical/social impacts at this moment.
217
+
218
+ # Acknowledgement
219
+
220
+ The work is supported by the National Key R&D Program of China (NO. 2022ZD0161300), the National Natural Science Foundation of China (Grant No. 62376134, 61672273, 61832008, 62372223), the Shanghai Committee of Science and Technology (Grant No. 21DZ1100100), and the Fundamental Research Funds for the Central Universities (No. XJ2023000701).
221
+
222
+ References
223
+ [1] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. arXiv preprint arXiv:2204.14198, 2022. 1, 4
224
+ [2] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In Proceedings of the IEEE International Conference on Computer Vision, 2015. 4
225
+ [3] Amir Bar, Yossi Gandelsman, Trevor Darrell, Amir Globerson, and Alexei Efros. Visual prompting via image inpainting. Advances in Neural Information Processing Systems, 2022. 4
226
+ [4] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding? In International Conference on Machine Learning, 2021. 7
227
+ [5] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in Neural Information Processing Systems, 2020. 3, 4
228
+ [6] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, 2020. 3, 4, 8
229
+ [7] Ting Chen, Saurabh Saxena, Lala Li, David J Fleet, and Geoffrey Hinton. Pix2seq: A language modeling framework for object detection. arXiv preprint arXiv:2109.10852, 2021. 7, 8
230
+ [8] Ting Chen, Saurabh Saxena, Lala Li, Tsung-Yi Lin, David J Fleet, and Geoffrey Hinton. A unified sequence interface for vision tasks. arXiv preprint arXiv:2206.07669, 2022. 4, 8
231
+ [9] Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325, 2015. 4
232
+ [10] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Universal image-text representation learning. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part XXX. Springer, 2020. 8
233
+ [11] Zhe Chen, Yuchen Duan, Wenhai Wang, Junjun He, Tong Lu, Jifeng Dai, and Yu Qiao. Vision transformer adapter for dense predictions. In International Conference on Learning Representations, 2023. 1
234
+ [12] Jaemin Cho, Jie Lei, Hao Tan, and Mohit Bansal. Unifying vision-and-language tasks via text generation. In International Conference on Machine Learning, 2021. 8
235
+ [13] Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416, 2022. 4
236
+ [14] MOSS contributors. Moss. https://github.com/OpenLMLab/MOSS, 2023. 3
237
+ [15] 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. 6
238
+ [16] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. 6
239
+ [17] Yuxin Fang, Wen Wang, Binhui Xie, Quan Sun, Ledell Wu, Xinggang Wang, Tiejun Huang, Xinlong Wang, and Yue Cao. Eva: Exploring the limits of masked visual representation learning at scale. arXiv preprint arXiv:2211.07636, 2022. 1
240
+ [18] Zhe Gan, Yen-Chun Chen, Linjie Li, Chen Zhu, Yu Cheng, and Jingjing Liu. Large-scale adversarial training for vision-and-language representation learning. Advances in Neural Information Processing Systems, 2020. 8
241
+ [19] Tanmay Gupta, Amita Kamath, Aniruddha Kembhavi, and Derek Hoiem. Towards general purpose vision systems. arXiv preprint arXiv:2104.00743, 2021. 4
242
+ [20] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2017. 3, 8
243
+ [21] 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, 2016. 6, 7, 9
244
+ [22] Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021. 7
245
+ [23] Srinivasan Iyer, Xi Victoria Lin, Ramakanth Pasunuru, Todor Mihaylov, Dániel Simig, Ping Yu, Kurt Shuster, Tianlu Wang, Qing Liu, Punit Singh Koura, et al. Opt-iml: Scaling language model instruction meta learning through the lens of generalization. arXiv preprint arXiv:2212.12017, 2022. 4
246
+ [24] Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In European Conference on Computer Vision, 2022. 1, 2
247
+ [25] Aishwarya Kamath, Mannat Singh, Yann LeCun, Gabriel Synnaeve, Ishan Misra, and Nicolas Carion. Mdetr-modulated detection for end-to-end multi-modal understanding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021. 8
248
+ [26] Hao Li, Jinguo Zhu, Xiaohu Jiang, Xizhou Zhu, Hongsheng Li, Chun Yuan, Xiaohua Wang, Yu Qiao, Xiaogang Wang, Wenhai Wang, et al. Uni-perceiver v2: A generalist model for large-scale vision and vision-language tasks. arXiv preprint arXiv:2211.09808, 2022. 4, 8
249
+ [27] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597, 2023. 4, 5
250
+ [28] KunChang Li, Yinan He, Yi Wang, Yizhuo Li, Wenhai Wang, Ping Luo, Yali Wang, Limin Wang, and Yu Qiao. Videochat: Chat-centric video understanding. arXiv preprint arXiv:2305.06355, 2023. 2, 3, 5
251
+ [29] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European Conference on Computer Vision. Springer, 2014. 9
252
+ [30] Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. arXiv preprint arXiv:2304.08485, 2023. 4, 5
253
+ [31] 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. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021. 6
254
+ [32] Zhaoyang Liu, Yinan He, Wenhai Wang, Weiyun Wang, Yi Wang, Shoufa Chen, Qinglong Zhang, Yang Yang, Qingyun Li, Jiashuo Yu, et al. Interngpt: Solving vision-centric tasks by interacting with chatbots beyond language. arXiv preprint arXiv:2305.05662, 2023. 2, 3, 5
255
+ [33] Jiasen Lu, Christopher Clark, Rowan Zellers, Roozbeh Mottaghi, and Aniruddha Kembhavi. Unified-io: A unified model for vision, language, and multi-modal tasks. arXiv preprint arXiv:2206.08916, 2022. 4
256
+ [34] OpenAI. Gpt-4 technical report. arXiv, 2023. 3
257
+ [35] TB OpenAI. Chatgpt: Optimizing language models for dialogue. OpenAI, 2022. 1, 3
258
+ [36] Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 2022. 3, 4
259
+ [37] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, 2002. 8
260
+ [38] Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever, et al. Improving language understanding by generative pre-training. 2018. 1, 4
261
+ [39] Scott Reed, Konrad Zolna, Emilio Parisotto, Sergio Gomez Colmenarejo, Alexander Novikov, Gabriel Barth-Maron, Mai Gimenez, Yury Sulsky, Jackie Kay, Jost Tobias Springenberg, et al. A generalist agent. arXiv preprint arXiv:2205.06175, 2022. 4
262
+ [40] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in Neural Information Processing Systems, 2015. 8
263
+ [41] Steven J Rennie, Etienne Marcheret, Youssef Mroueh, Jerret Ross, and Vaibhava Goel. Self-critical sequence training for image captioning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. 8
264
+ [42] Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. Hugginggpt: Solving ai tasks with chatgpt and its friends in huggingface. arXiv preprint arXiv:2303.17580, 2023. 2, 3, 5
265
+ [43] Weijie Su, Xizhou Zhu, Chenxin Tao, Lewei Lu, Bin Li, Gao Huang, Yu Qiao, Xiaogang Wang, Jie Zhou, and Jifeng Dai. Towards all-in-one pre-training via maximizing multi-modal mutual information. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023. 1
266
+ [44] Chenxin Tao, Xizhou Zhu, Gao Huang, Yu Qiao, Xiaogang Wang, and Jifeng Dai. Siamese image modeling for self-supervised vision representation learning. arXiv preprint arXiv:2206.01204, 2022. 1
267
+ [45] Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B Hashimoto. Alpaca: A strong, replicable instruction-following model. Stanford Center for Research on Foundation Models. https://crfm. stanford. edu/2023/03/13/alpaca. html, 2023. 3, 6, 7
268
+ [46] Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023. 3, 6, 7
269
+ [47] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in Neural Information Processing Systems, 30, 2017. 6
270
+ [48] Ramakrishna Vedantam, C Lawrence Zitnick, and Devi Parikh. Cider: Consensus-based image description evaluation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015. 8
271
+ [49] Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, and Lijuan Wang. Git: A generative image-to-text transformer for vision and language. arXiv preprint arXiv:2205.14100, 2022. 1, 4
272
+ [50] Peng Wang, An Yang, Rui Men, Junyang Lin, Shuai Bai, Zhikang Li, Jianxin Ma, Chang Zhou, Jingren Zhou, and Hongxia Yang. Unifying architectures, tasks, and modalities through a simple sequence-tosequence learning framework. arXiv preprint arXiv:2202.03052, 2022. 1, 4
273
+ [51] Wenhai Wang, Jifeng Dai, Zhe Chen, Zhenhang Huang, Zhiqi Li, Xizhou Zhu, Xiaowei Hu, Tong Lu, Lewei Lu, Hongsheng Li, et al. Internimage: Exploring large-scale vision foundation models with deformable convolutions. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023. 1, 2, 7, 8
274
+ [52] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pvt v2: Improved baselines with pyramid vision transformer. Computational Visual Media, 8(3):415–424, 2022. 6
275
+ [53] Wenhui Wang, Hangbo Bao, Li Dong, Johan Bjorck, Zhiliang Peng, Qiang Liu, Kriti Aggarwal, Owais Khan Mohammed, Saksham Singhal, Subhojit Som, et al. Image as a foreign language: Beit pretraining for all vision and vision-language tasks. arXiv preprint arXiv:2208.10442, 2022. 1, 2, 8
276
+ [54] Xinlong Wang, Wen Wang, Yue Cao, Chunhua Shen, and Tiejun Huang. Images speak in images: A generalist painter for in-context visual learning. arXiv preprint arXiv:2212.02499, 2022. 1, 2
277
+ [55] Xinlong Wang, Wen Wang, Yue Cao, Chunhua Shen, and Tiejun Huang. Images speak in images: A generalist painter for in-context visual learning. arXiv preprint arXiv:2212.02499, 2022. 4
278
+ [56] Xinlong Wang, Xiaosong Zhang, Yue Cao, Wen Wang, Chunhua Shen, and Tiejun Huang. Seggpt: Segmenting everything in context. arXiv preprint arXiv:2304.03284, 2023. 2, 4
279
+ [57] Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A Smith, Daniel Khashabi, and Hannaneh Hajishirzi. Self-instruct: Aligning language model with self generated instructions. arXiv preprint arXiv:2212.10560, 2022. 4, 5
280
+ [58] Yizhong Wang, Swaroop Mishra, Pegah Alipoormolabashi, Yeganeh Kordi, Amirreza Mirzaei, Anjana Arunkumar, Arjun Ashok, Arut Selvan Dhanasekaran, Atharva Naik, David Stap, et al. Benchmarking generalization via in-context instructions on $1 { , } 6 0 0 { + }$ language tasks. arXiv preprint arXiv:2204.07705, 2022. 4
281
+ [59] Jason Wei, Maarten Bosma, Vincent Y Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. Finetuned language models are zero-shot learners. arXiv preprint arXiv:2109.01652, 2021. 4
282
+ [60] Chenfei Wu, Shengming Yin, Weizhen Qi, Xiaodong Wang, Zecheng Tang, and Nan Duan. Visual chatgpt: Talking, drawing and editing with visual foundation models. arXiv preprint arXiv:2303.04671, 2023. 2, 3, 5
283
+ [61] Enze Xie, Peize Sun, Xiaoge Song, Wenhai Wang, Xuebo Liu, Ding Liang, Chunhua Shen, and Ping Luo. Polarmask: Single shot instance segmentation with polar representation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020. 5, 8
284
+ [62] Bin Yan, Yi Jiang, Jiannan Wu, Dong Wang, Ping Luo, Zehuan Yuan, and Huchuan Lu. Universal instance perception as object discovery and retrieval. arXiv preprint arXiv:2303.06674, 2023. 4
285
+ [63] Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Faisal Ahmed, Zicheng Liu, Yumao Lu, and Lijuan Wang. Unitab: Unifying text and box outputs for grounded vision-language modeling. In European Conference on Computer Vision, pages 521–539. Springer, 2022. 4
286
+ [64] Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Faisal Ahmed, Zicheng Liu, Yumao Lu, and Lijuan Wang. Unitab: Unifying text and box outputs for grounded vision-language modeling. In European Conference on Computer Vision, 2022. 8
287
+ [65] Zhengyuan Yang, Linjie Li, Jianfeng Wang, Kevin Lin, Ehsan Azarnasab, Faisal Ahmed, Zicheng Liu, Ce Liu, Michael Zeng, and Lijuan Wang. Mm-react: Prompting chatgpt for multimodal reasoning and action. arXiv preprint arXiv:2303.11381, 2023. 2, 3, 5
288
+ [66] Yuan Yao, Ao Zhang, Zhengyan Zhang, Zhiyuan Liu, Tat-Seng Chua, and Maosong Sun. Cpt: Colorful prompt tuning for pre-trained vision-language models. arXiv preprint arXiv:2109.11797, 2021. 1
289
+ [67] Yuhang Zang, Wei Li, Kaiyang Zhou, Chen Huang, and Chen Change Loy. Unified vision and language prompt learning. arXiv preprint arXiv:2210.07225, 2022. 1
290
+ [68] Aohan Zeng, Xiao Liu, Zhengxiao Du, Zihan Wang, Hanyu Lai, Ming Ding, Zhuoyi Yang, Yifan Xu, Wendi Zheng, Xiao Xia, et al. Glm-130b: An open bilingual pre-trained model. arXiv preprint arXiv:2210.02414, 2022. 3
291
+ [69] Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022. 3
292
+ [70] Yuanhan Zhang, Kaiyang Zhou, and Ziwei Liu. Neural prompt search. arXiv preprint arXiv:2206.04673, 2022. 1
293
+ [71] Deyao Zhu, Jun Chen, Xiaoqian Shen, Xiang Li, and Mohamed Elhoseiny. Minigpt-4: Enhancing visionlanguage understanding with advanced large language models. arXiv preprint arXiv:2304.10592, 2023. 4
294
+ [72] Jinguo Zhu, Xizhou Zhu, Wenhai Wang, Xiaohua Wang, Hongsheng Li, Xiaogang Wang, and Jifeng Dai. Uni-perceiver-moe: Learning sparse generalist models with conditional moes. arXiv preprint arXiv:2206.04674, 2022. 1, 4, 8, 9
295
+ [73] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2021. 3, 6, 7, 8
296
+ [74] Xizhou Zhu, Jinguo Zhu, Hao Li, Xiaoshi Wu, Hongsheng Li, Xiaohua Wang, and Jifeng Dai. Uniperceiver: Pre-training unified architecture for generic perception for zero-shot and few-shot tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022. 2, 4, 5, 8, 9
parse/dev/Vx1JadlOIt/Vx1JadlOIt_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Vx1JadlOIt/Vx1JadlOIt_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/bgAS1ZvveZ/bgAS1ZvveZ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/dLL4KXzKUpS/dLL4KXzKUpS_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/dLL4KXzKUpS/dLL4KXzKUpS_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/e2M4CNa-UOS/e2M4CNa-UOS.md ADDED
@@ -0,0 +1,495 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Efficient Sequence Packing without Cross-contamination: Accelerating Large Language Models without Impacting Performance
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ 1 Effective training of today’s large language models (LLMs) depends on large
11
+ 2 batches and long sequences for throughput and accuracy. To handle variable-length
12
+ 3 sequences on hardware accelerators, it is common practice to introduce padding
13
+ 4 tokens, so that all sequences in a batch have the same length. We show in this paper
14
+ 5 that the variation in sequence lengths in common NLP datasets is such that up to
15
+ 6 $50 \%$ of all tokens can be padding. In less common, but not extreme, cases (e.g.
16
+ 7 GLUE-cola with sequence length 128), the ratio is up to $89 \%$ . Existing methods
17
+ 8 to address the resulting inefficiency are complicated by the need to avoid ‘cross
18
+ 9 contamination’ in self-attention, by a reduction in accuracy when sequence ordering
19
+ 10 information is lost, or by customized kernel implementations only valid for specific
20
+ 11 accelerators. This paper introduces a new formalization of sequence packing in
21
+ 12 the context of the well-studied bin packing problem, and presents new algorithms
22
+ 13 based on this formulation which, for example, confer a $2 \mathbf { x }$ speedup for phase 2
23
+ 14 pre-training in BERT. We show how existing models can be adapted to ensure
24
+ 15 mathematical equivalence between the original and packed models, meaning that
25
+ 16 packed models can be trained with existing pre-training and fine-tuning practices.
26
+
27
+ # 17 1 Introduction
28
+
29
+ 18 Many language datasets, including the de-facto pre-training dataset for BERT—Wikipedia, have
30
+ 19 a skewed distribution of sequence lengths (see Figure 1). However, typical machine learning
31
+ 20 accelerators, and their corresponding libraries, exhibit poor performance when processing variable
32
+ 21 length workloads. A simple mitigation is to set a maximum sequence length, and to pad shorter
33
+ 22 sequences with padding tokens. This naive batching is widely used and provided in the vanilla BERT
34
+ 23 implementation as well as the Hugging Face framework $| \dot { \overline { { { \vert 3 2 } \vert } } } |$ . Its effect is enhanced by the offline
35
+ 24 dataset generation process which, in BERT, attempts to “pack” together sentences so as to fill the
36
+ 25 sequence length as completely as possible $\pmb { \mathbb { B } } ] \mathbf { l }$ . We improve this process at a whole-dataset level.
37
+ 26 We show that, even after this pre-processing, padding tokens represent $5 0 \%$ of all tokens of the
38
+ 27 Wikipedia pre-training dataset at sequence length 512. Thus, by avoiding processing the padding
39
+ 28 tokens one can get a $2 \mathbf { x }$ speed-up for phase 2. Overall, the lengths range between 5 tokens up to 512.
40
+ 29 Samples of length 512 represent only $2 3 . 5 \%$ of the dataset,
41
+ 30 Beyond the simple batching, other solutions have been addressed in the literature, and in open-source
42
+ 31 software implementations. When processing sequences, most libraries and algorithms mention
43
+ 32 packing as reference to concatenating sentences from the same document (BERT) or from different
44
+ 33 documents (BERT, T5 $\pmb { \Vert 2 4 \Vert }$ , GPT-3 [4], and RoBERTa $\mathbb { I I } ^ { }$ ) as they arrive (GREEDY) from the
45
+ 34 source dataset to generate the training dataset. None of the respective papers addresses the packing
46
+ 35 efficiency, i.e., remaining fraction of padding. To “separate” sequences from different documents, a
47
+ 36 separator token is introduced. However, this is not sufficient and can have a significant impact on
48
+ 37 performance. This is discussed only in the RoBERTa paper which shows that downstream F1 scores
49
+ 38 get consistently reduced on average by $0 . 3 5 \%$ . Alternative common approaches to overcome the large
50
+ 39 amount of padding in many datasets are “un-padding” as in Effective Transformer $\pmb { \Vert 5 \Vert }$ and sorted
51
+ 40 batching (SORT) as in Faster Transformer $\mathbb { \left| \mathbb { Z } \right\| }$ , lingvo $\overline { { \| 2 8 \| } }$ fairseq $\lVert 2 2 \rVert$ , and RoBERTa. However, for
52
+ 41 running efficiently on arbitrary accelerators, these approaches require substantial hardware-specific
53
+ 42 low-level code optimizations only available on GPUs. Further details are in Sections C [1] and 4.4.
54
+ 43 Beyond language models, packing has been also present in other areas of machine learning, however
55
+ 44 with little to no exploration in the literature and mostly hidden in some libraries without any further
56
+ 45 discussion. For example, PyG (PyTorch Geometric) combines multiple small graphs in a batch to
57
+ 46 account for the large variation in size and to optimize the hardware usage when training a Graph
58
+ 47 Neural Network (GNN). Another example is the RNN implementation in PyTorch which introduces a
59
+ 48 “PackedSequence” object and states that “All RNN modules accept packed sequences as inputs” but
60
+ 49 does not address how sequences are packed efficiently and how the processing of packed sequences
61
+ 50 is implemented in an efficient manner while avoiding interaction between sequences. Even though
62
+ 51 we focus on BERT [6] and other transformers in this paper, the general principles can be transferred
63
+ 52 to many more machine learning algorithms with differently sized data samples.
64
+
65
+ In this paper, we formally frame the packing problem in transformer based models, and provide some solutions, showing that sequences can be packed efficiently, separator tokens are not required, and cross-contamination can be avoided with little overhead.
66
+
67
+ 56 In summary, the contributions of the paper are as follows. In Section 2, we produce histograms of a
68
+ 57 variety of datasets showing the high percentage of padding tokens. In Section $\boxed { 3 . 1 }$ we present two new
69
+ 58 deterministic and efficient packing algorithms based on established solvers which efficiently pack
70
+ 59 datasets with millions of sequences in a matter of seconds (or less). In Section $3 . 2$ and Section ${ \dot { \overline { { | 3 . 3 | } } } } ,$ we
71
+ 60 describe ‘cross-contamination’ —the cause of the accuracy reduction which separator tokens do not
72
+ 61 mitigate— and show how the BERT model can be adjusted to show the same convergence behavior
73
+ 62 on packed and unpacked sequences. We empirically show that the proposed packing algorithms
74
+ 63 produce a nearly-optimal packing scheme for Wikipedia pre-training dataset (Section $\bar { 4 . 1 ) }$ and more
75
+ 64 in the Appendix. In Section $4 . 2 ,$ we demonstrate that the convergence of the BERT large model on
76
+ 65 the packed dataset is equivalent to that on the un-packed dataset with $2 \mathbf { x }$ throughput increase on the
77
+ 66 Wikipedia sequence length 512 pre-training dataset. Further experiments underline the necessity and
78
+ 67 efficiency of our changes.
79
+
80
+ # 68 2 Sequence length distributions
81
+
82
+ ![](images/b7f41427237cebf8220073cd7a665c1f053a2cc983c1d8c1e00418a740af50bf.jpg)
83
+ Figure 1: Sequence length distributions for different datasets. The three graphics at the top left show Wikipedia BERT pre-training dataset sequence length histograms (token count excluding padding) for different maximum sequence lengths based on the Wikipedia article dump from October 1st 2020. The theoretical speed-up relates to not using any padding tokens and not having any overhead from processing the different lengths. Top right: GLUE datasets. Bottom from left to right: SQuAD 1.1, LibriSpeech text labels, LibriSpeech audio token sequence, and QM9 molecules of a graph in a sequence.
84
+
85
+ 69 BERT is pre-trained using masked-language modelling and next-sentence prediction on a large
86
+ 70 corpus of Wikipedia articles. Each sequence is composed of one ${ \mathrm { < C L S > } }$ token followed by the
87
+ 71 first “segment” of sentences, followed by a ${ \mathrm { - S E P } } { \mathrm { > } }$ token, and then finally the second “segment” of
88
+ 72 sentences. Because these “segments” are created in sentence-level increments there is no token-level
89
+ 73 control of sequence length. Furthermore $1 0 \%$ (default value, $\mathbb { I I }$ ) of sequences are intentionally
90
+ 74 cut short. This leads to significant levels of padding, especially for longer maximum sequence
91
+ 75 lengths (see Figure $\mathbb { L }$ and Section $\mathbf { J } \mathbb { \equiv } \mathbb { I } ^ { }$ ). At sequence length 128 (commonly used in phase 1 of
92
+ 76 pre-training) the theoretical speed-up is around 1.2, at sequence length 384 this increases to 1.7, and
93
+ 77 finally at sequence length 512 (commonly used for phase 2 of pre-training) it is 2.0. Despite the
94
+ 78 widespread use of the Wikipedia dataset for pre-training BERT such histograms have, to the best
95
+ 79 of our knowledge, not been published previously. This has perhaps lead to the underestimation of
96
+ 80 the speed-up opportunity available. To put things into perspective, the sequence length 512 dataset
97
+ 81 contains 8.33 billion tokens, of which 4.17 billion are padding tokens.
98
+ 82 Note that the skewed sequence length distributions are neither limited to Wikipedia, as shown with
99
+ 83 GLUE [30, 31] from Section $\mathbf { L } \mathbb { \mathbb { \mathbf { \Pi } } }$ and SQuAD 1.1 $\pmb { \left. 2 5 \right. }$ from Section $\mathbb { K } \mathbb { 1 } \mathbb { 1 }$ $2 . 2 x$ speed up), to BERT
100
+ 84 training, as shown with LibiSpeech text distributions $\mathbb { \left| \mathbb { Z } 3 \right| }$ from Section $\mathbf { M } \mathbb { I } \mathbb { I }$ , nor to text itself,
101
+ 85 given the LibriSpeech audio data distributions, and the QM9 molecular data $\overline { { \mathbb { B } 2 7 } } , \overline { { \sf 2 6 } } ]$ ( $1 . 6 x$ speed-up,
102
+ 86 Section $\mathbb { Q } \mathbb { \mathbb { 1 } \mathbb { 1 } } )$ ). All distributions can be found in Figure $\bigstar$ Since LibriSpeech audio data is skewed to
103
+ 87 longer sequences, only $1 . 3 x$ speed-up could be achieved despite the theoretical maximum of $1 . 6 x$
104
+ 88 For all other cases, the algorithms presented in Section $3 . 1$ lead to close to optimal packing.
105
+
106
+ # 89 3 Methods
107
+
108
+ 90 Our approach consists of three distinct components. Firstly, we pack the $n$ data samples efficiently
109
+ 91 during pre-processing to make full use of the maximum sequence length, $s _ { m }$ (Sections $3 . 1$ and $\dot { \mathbb { E } } \dot { ) }$
110
+ 92 Secondly, we introduce a series of model changes in Section $3 . 2$ that preserve the equivalence with
111
+ 93 the original BERT implementation. The changes include a self-attention mask to prevent the model
112
+ 94 from attending between different sequences in the same pack (Section $3 . 2 . 2 )$ and an adjustment
113
+ 95 of the the positional embeddings (Section $3 . 2 . 1 )$ to handle packs of sequences. Other components
114
+ 96 of the model, such as the feed-forward layer $\pmb { \mathbb { Z } } 9 \|$ , operate on a per-token basis and do not require
115
+ 97 modification for pre-training. In Section $3 . 2 . 3 ,$ we also demonstrate how to compute a per-sequence
116
+ 98 loss and accuracy for NSP and downstream fine-tuning tasks. Thirdly, we provide suggestions for
117
+ 99 hyperparameter adjustment (Section $\textcircled { 3 . 3 }$ that lead to analogous convergence behavior between the
118
+ 100 packed and un-packed BERT implementations. Additional videos and animations are provided as
119
+ 101 supplemental material.
120
+
121
+ # 3.1 Packing algorithms
122
+
123
+ 3 The widely studied and well established bin packing problem deals with the assignment of items into bins of a fixed capacity such that the number of utilized bins is minimized. It has been known for decades if not centuries. Since an exact solution is strongly NP-complete $\pmb { \mathbb { I } }$ , numerous approximate solutions have been proposed [12, 15, 13, 36]. Since most existing approximations have a high complexity of at least $O ( n \log n )$ , we propose two new heuristic offline algorithms that are tailored to the NLP setting applied to the whole dataset. For a detailed introduction to packing see Section F.
124
+
125
+ # 3.1.1 Shortest-pack-first histogram-packing (SPFHP)
126
+
127
+ Shortest-pack-first histogram-packing (SPFHP) works on the bins in the sequence length histogram (with bin size 1) rather than the individual samples. The histogram is traversed in sorted order from longest to shortest sequences. Then, to pack the data during the traversal, we apply the worst-fit algorithm $[ 1 2 , 1 3 6 ]$ such that the histogram bin being processed goes to the “pack”1 that has the most space remaining (“shortest-pack-first”). If the histogram bin does not fit completely, a new pack is created. We also limit the packing depth, in other words the maximum number of sequences that are allowed in a pack. Therefore, an existing pack is only extended if it is not already at maximum packing depth. The detailed code for the algorithm is provided in Listing $\textcircled { 3 }$ The time and space complexity of the algorithm are $O ( n + s _ { m } ^ { 2 } )$ and $O ( s _ { m } ^ { 2 } )$ (Section G.2[1] ).
128
+
129
+ 120 The proposed NNLSHP algorithm is based on re-stating the packing problem as a (weighted) non
130
+ 121 negative least squares problem (NNLS) $\mathbb { \left[ 3 \right] }$ of the form $w A x = w b$ where $x \geq 0$ . The vector $b$ is the
131
+ 122 histogram containing the counts of all the sequence lengths in the dataset. Next, we define the $A$
132
+ 123 matrix (the “packing matrix“) by first generating a list of all possible sequence length combinations
133
+ 124 (“strategies”) that add up exactly to the maximum sequence length. We focus specifically on strategies
134
+ 125 that consist of at most 3 sequences per pack (independent of $b$ ) and encode each strategy as a column
135
+ 126 of the sparse matrix $A$ . For example, a strategy consisting of the sequence length 128, 128, and
136
+ 127 256 in represented a column vector that has the value 2 at the 128th row, the value 1 at the 256th
137
+ 128 row, and zero at all other rows. The variable $x$ describes the non-negative repetition count for each
138
+ 129 strategy. So a 24 in the ith row of $x$ means that the strategy represented by the ith column of $A$ should
139
+ 130 repeat 24 times. Moreover, in the un-weighted setting, $A x = b$ states that we would like to “mix” the
140
+ 131 pre-defined strategies (columns of $A$ ) such that the number of samples matches the histogram $b$ , and
141
+ 132 where each strategy is used $x \geq 0$ times. We use the residual weight $w$ to control the penalization
142
+ 133 of the $A x - b$ residual on different sequence lengths (different rows of $b$ ). Heuristically, we set
143
+ 134 the weight of 0.09 for all sequences of length 8 or smaller because they are considered acceptable
144
+ 135 padding sequences while all other sequence lengths get weight 1. We discuss this heuristic choice of
145
+ 136 parameters in Section F.4.5 and $\operatorname { F } . 5 { \widehat { \bigcirc } }$ . The overall efficiency of the packing is not greatly influenced
146
+ 137 by the weighing (less than $1 \%$ extra speed-up).
147
+ 138 After solving $w A x = w b$ for $x \geq 0$ using an off-the-shelf solver, we obtain a floating point solution,
148
+ 139 which means that the repetition counts are not necessarily integers. Since we cannot use a non-natural
149
+ 140 number of strategies, we round the solution $\hat { x }$ to the nearest integer. The error introduced by this
150
+ 141 rounding is found to be negligible (a few hundred sequences in the worst case) compared to the size
151
+ 142 of the dataset (millions of sequences). The time complexity and space complexity of the algorithm
152
+ 143 are $O ( n + s _ { m } ^ { 5 } )$ and $O ( s _ { m } ^ { 3 } )$ . Further details are provided in Section F.4.
153
+
154
+ # 3.2 packedBERT: model changes
155
+
156
+ 145 This section describes how any vanilla BERT implementation should be modified for packed sequence
157
+ 146 processing, such that the behavior of the model is the same as when processing unpacked sequences.
158
+ 147 Preserving the mathematical equivalence is necessary to ensure existing BERT pre-training and
159
+ 148 fine-tuning practices remain valid, as well as being required by benchmarks such as MLPerf™ [17].
160
+ 149 The presented approaches and principles apply to a variety of other models.
161
+
162
+ # 3.2.1 Adjust positional embeddings
163
+
164
+ The BERT model uses three types of embeddings: token, segment, and positional embeddings. The latter is canonically implemented as a bias add operation, rather than a full embedding look-up. This is possible because the positional indices increase linearly for every sequence. However, when using the packed data format the position index needs to be reset with each new packed sequence. For instance, when packing two sequences one of length 2 and one of length 3, the positional embedding indexes that need to be picked up are $[ 0 , 1 , 0 , 1 , 2 ]$ . To achieve this, the bias add needs to be replaced by an embedding look-up to extract the correct positional embedding for each token in the pack. This also requires keeping an extra input which specifies the position of each token in its sequence. This required adjustment has only a minor impact on absolute accuracy/loss (see Section 4.2 and 4.2.1).
165
+
166
+ # 160 3.2.2 Adjust attention masking
167
+
168
+ ![](images/38c72d48cdad5a3e9bf697e1535417f7bd0cb67ccbf612655a672446d7140a7b.jpg)
169
+
170
+ Figure 2: Attention mask code [left], respective zero-one mask [middle], and vectorized unpacking of the sequence loss[right]. White rectangles correspond to padding.
171
+
172
+ 161 To maintain an implementation that is consistent with the un-packed version, tokens from different
173
+ 162 sequences within a pack should not be able to attend to each other. This is typically achieved in
174
+ 163 other implementations by unpacking the sequences using custom attention kernels and then doing
175
+ 164 the attention per-sequence $\pmb { \bar { \bar { \bar { \bar { \lambda } } } } }$ . Instead, we propose directly masking the attention matrix with a
176
+ 165 block-diagonal mask before the attention softmax. This is straightforward to implement in modern
177
+ 166 frameworks (see Figure $\textcircled{2}$ . Naturally, there is a cost to both the mask construction and applying
178
+ 167 it to the attention matrix. However, it is required to keep the accuracy (see Table $^ { 1 , }$ Section 4.1,
179
+ 168 Section $\boxed { 4 . 2 }$ . See also the code of the deprecated tensor2tensor library and our own provided code.
180
+
181
+ # 169 3.2.3 Adjust per-sequence loss and accuracy
182
+
183
+ 170 Canonical implementations of BERT compute the cross-entropy loss for the masked language model
184
+ 171 on a per-token basis. However other NLP tasks, such as SQuAD, compute the loss and accuracy on
185
+ 172 a per-sequence basis. This section discusses how to handle such tasks when training with packed
186
+ 173 sequences. Simply feeding packs of sequences to the same implementation of cross-entropy would
187
+ 174 result in a per-pack weighted loss. In other words, the overall loss on the micro-batch would sum-up
188
+ 175 the losses on the individual packs, rather than individual sequences. As a result, the model would
189
+ 176 converge to a different optimum than when running with the un-packed implementation. For instance,
190
+ 177 a pack of a single sequence would contribute to the loss with the same weight as a pack of three
191
+ 178 sequences.
192
+ 179 To recover the per-sequence averaging behavior of the canonical un-packed BERT implementation,
193
+ 180 we effectively “unpack” the incoming logits and labels. Once the sequences have been unpacked,
194
+ 181 we can compute the loss on each sequence separately as usual and then add up the losses. However,
195
+ 182 rather than looping through the sequences index, we compute on all indexes in parallel (see Figure 2).
196
+ 183 This minimizes the latency overhead of un-packing the loss calculation. As an example, we show how
197
+ 184 per-sequence loss can be implemented for the pre-training task. We use the “masked lm weight” [7]
198
+ 185 input tensor to represent which sequence a given masked token belongs to (0, 1, 2 and so on). This
199
+ 186 is consistent with the canonical BERT implementation where this input takes a value of either 1
200
+ 187 (belonging to the sequence) or 0 (belonging to padding). The full methodology is detailed in Listing 5
201
+ 188 and can be applied to other classification or pre-training tasks.
202
+
203
+ # 189 3.3 Adjust hyperparameters
204
+
205
+ 190 In terms of convergence behavior, the primary consequence of packing is an increase in the effective
206
+ 191 batch size (with respect to number of sequences and real tokens) with some added variation over
207
+ 192 different iterations. If we look on the sentence level, the number of sentences in one batch increases
208
+ 193 by the packing factor. Similarly, the number of tokens in one batch increases. Hence, hyperparameters
209
+ 194 that are sensitive to these numbers need to be adjusted.
210
+ 195 A direct solution is to reduce the computational batch size by the packing factor (average number of
211
+ 196 sequences per pack) and keep all other hyperparameters the same. For example, if the packing factor
212
+ 197 is 2, cutting the gradient accumulation count by half is sufficient. The advantage of this strategy is that
213
+ 198 no fine-tuning of hyperparameters is required and performance curves are comparable. However, this
214
+ 199 approach might be not desirable as it might imply under-utilizing the memory/compute, especially if
215
+ 200 the micro batch size needs to be reduced.
216
+ 201 Hence to preserve batch size and optimize hardware utilization, we additionally propose an approxi
217
+ 202 mate heuristic for updating the decay parameters of the LAMB optimizer $\boldsymbol { \left[ \left[ 3 5 \right] \right] }$ . For a packed dataset
218
+ 203 with a packing factor $p$ , we update the decay parameters as: $\beta _ { 1 } : = \beta _ { 1 } ^ { p }$ , $\beta _ { 2 } : = \beta _ { 2 } ^ { p }$ . For $p = 2$ , this
219
+ 204 corresponds to the exact parameters for calculating momentum and velocity, when updating with the
220
+ 205 same gradient twice (Section $\bigstar \bigstar$ . A common approach is to scale the learning rate with the batch size.
221
+ 206 However, our experiments in Section $\boxed { 4 . 2 }$ show that this reduces convergence speed.
222
+ 207 Since these adjustments are only heuristics the convergence of the model will be comparable but not
223
+ 208 identical. In particular, it is unlikely that simply adjusting the hyperparameters will fully undo the
224
+ 209 impact of the increased batch size. However, with these adjustments, researchers should be able to
225
+ 210 continue to use existing configurations.
226
+
227
+ # 211 4 Experiments
228
+
229
+ # 4.1 Bin packing algorithm comparison
230
+
231
+ We evaluate our algorithms using the following metrics: number of packs, number of all tokens, number of padding tokens, solution time of the packing algorithm (after histogram and strategy creation), number of strategies used, packing efficiency (the fraction of non-padding tokens in the packed dataset), the speed-up achieved compared to not packing (depth 1), and the average number of sequences per sample (packing factor). For SPFHP, we analyse different (maximum) packing depth, since packing is less efficient with smaller depth and we want to get a general understanding on how the packing depth influences the processing time. For NNLSHP, we focus on packing depth 3 because it packs the data sufficiently well. For the speed-up analysis, we focus on the intelligence processing unit (IPU) [11] (IPU-M2000, 16 accelerator chips), BERT phase 2 pretraining setup as in Section $\bar { 4 . 2 } .$ A GPU dynamically loads the code into the accelerator; in contrast, the IPU works with a static pre-compiled engine that gets loaded onto the chip at the start of the run. While other approaches result in excessive padding or continuous changes of the code, our approach can work with the same code for the whole dataset. So in this setting the IPU architecture would especially benefit from our approach since it avoids code changes. Nevertheless, it can be applied to any implementation on GPU or TPU. For determining the speed-up, we take advantage of the precompiled kernel. Since time measurements are quite noisy, we can profile the kernel and how many cycles it takes for processing a batch. That way, we can determine the overhead (in cycles) from processing the additional attention masking and for unpacking the loss. Combining overhead and packing factor, we get the speed-up estimate. No experiment repetitions are required since the algorithms and measurements are deterministic.
232
+
233
+ Table 1: Key performance results of proposed packing algorithms (SPFHP and NNLSHP) on IPU.
234
+
235
+ <table><tr><td>pack. depth</td><td>packing algorithm</td><td>EFF (%)</td><td>p</td><td>OH (%)</td><td>realized speed-up</td></tr><tr><td>1</td><td>NONE</td><td>50.0</td><td>1.00</td><td>0.000</td><td>1.000</td></tr><tr><td>1</td><td>SORT</td><td>99.9</td><td>2.00</td><td>&gt;100</td><td>&lt;1.000</td></tr><tr><td>~10</td><td>GREEDY</td><td>~78</td><td>≈1.6</td><td>~4.48</td><td>~1.5</td></tr><tr><td>2</td><td>SPFHP</td><td>80.5</td><td>1.61</td><td>4.283</td><td>1.544</td></tr><tr><td>3</td><td>SPFHP</td><td>89.4</td><td>1.79</td><td>4.287</td><td>1.716</td></tr><tr><td>3</td><td>NNLSHP</td><td>99.7</td><td>2.00</td><td>4.287</td><td>1.913</td></tr><tr><td>4</td><td>SPFHP</td><td>93.9</td><td>1.88</td><td>4.294</td><td>1.803</td></tr><tr><td>8</td><td>SPFHP</td><td>98.9</td><td>1.98</td><td>4.481</td><td>1.895</td></tr><tr><td>max</td><td>SPFHP</td><td>99.6</td><td>1.99</td><td>4.477</td><td>1.905</td></tr></table>
236
+
237
+ Packing depth describes the maximum number of packed sequences. NONE is the baseline BERT implementation, whereas SORT corresponds to sorted batching, and GREEDY concatenates sequences as they arrive until they would exceed 512 tokens. Setting no limit resulted in a maximum packing depth of 16. EFFiciency is the percentage of real tokens in the packed dataset. The packing factor describes the resulting potential speed-up compared to packing depth 1. With overhead (OH), we denote the percentage decrease in throughput due to changes to the model to enable packing (such as the masking scheme introduced in Section $\boxed { 3 . 2 . 2 }$ . The realized speed-up is the combination of the speed-up due to packing (the packing factor) and the decrease in throughput due to the overhead on the IPU. It is used to measure the relative speed-up in throughput and the overhead from masking and loss adjustment. SORT can be only efficient on GPUs (see Section $4 . 4 )$ .
238
+
239
+ 233 The main results for the performance metric evaluation are displayed in Table $\nsupseteq$ The processing
240
+ 234 time for SPFHP on an Intel(R) Xeon(R) Gold 6138 CPU with 2.00GHz, 80 nodes, and 472G RAM
241
+ 235 was around $0 . 0 3 s$ and independent from the packing depth. Classical First-Fit-Decreasing requires
242
+ 236 87-120s, a lot of memory, and scales almost linear with the number of samples. We see that the
243
+ 237 overhead slightly increases with packing depth but that the benefits of packing outweigh the cost. The
244
+ 238 best speed-up is obtained with NNLSHP at depth 3 which required $2 8 . 4 s$ on the CPU for processing
245
+ 239 and ran out of memory for larger depth. With a value of 1.913, it is close to the theoretical upper
246
+ 240 bound of 2.001. The results show that efficiency, packing factor, and speed-up can be viewed inter
247
+ 241 changeably. The amount of time needed to process a sample (a pack of sequences) is barely changed
248
+ 242 relative to the un-packed implementation. The packing factor, or the improvement in efficiency,
249
+ 243 effectively provide an accurate estimate of the speed-up. GREEDY packing as used in T5 shows
250
+ 244 to be quite inefficient and sorted batching (SORT) is highly efficient in avoiding padding but the
251
+ 245 resulting different computational graphs cause a major overhead on the IPU that exceeds the benefits
252
+ 246 of avoiding the padding. Since we made our algorithm and code public available, results have been
253
+ 247 reproduced with a different framework on the Habana Gaudi accelerator $\mathbb { m }$ and confirmed that our
254
+ 248 approach is hardware and software independent giving it a huge advantage over existing approaches.
255
+
256
+ # 4.2 MLPerf™ phase 2 pretraining setup: learning curves and hyperparameter adjustment
257
+
258
+ For depth 1 (classic BERT) and NNLSHP with depth 3, we additionally evaluate on the MLPerf™ version 0.7 BERT pre-training benchmark $\mathbb { \equiv } \mathbb { \ln { \frac { } { } } }$ . Briefly, this involves training from a standard checkpoint to a masked-language model accuracy of $7 1 . 2 \%$ using 3 million sequences with a maximum length of 512 tokens (refer to $\mathbb { \lVert 1 9 \rVert }$ for details). Following this standardized benchmark supports reproduction of results even on other systems and makes sure that the reproduction effort is moderate and setup rules are clearly documented. We compare the resulting speed-up as well as the respective learning curves by evaluating the data on a held-out validation dataset. The objective of this additional evaluation is to analyse if convergence behavior is changed by the packing strategy and if the theoretical speed-up can be achieved in practice.
259
+
260
+ 259 With packing, we effectively increase the average batch size by the packing factor $( \approx 2 )$ . However,
261
+ 260 with a different batch size, different hyperparameters are required (see Section $\textcircled { 3 . 3 }$ and there is no
262
+ 261 mapping that will generate exact matching of results but only heuristics. In a first comparison, we
263
+ 262 use the same hyperparameters when comparing packed and unpacked training except for cutting the
264
+ 263 accumulation count by half. This way, we make sure that the batch size is constant on average and
265
+ 264 we have the same amount of training steps. In the second comparison, we evaluate our heuristics and
266
+ 265 how they compensate the difference in batch size. This setup is more desirable because it is beneficial
267
+ 266 to use the hardware to its full potential and cutting the batch size by half usually reduces throughput.
268
+ 267 In the third comparison, we compare two optimized setups. In these two cases, packing takes half the
269
+ 268 amount of training steps.
270
+
271
+ The learning curves are displayed in Figure 3. In the first setup, we see the curves almost matching perfectly when normalizing by the numbers of samples processed. Differences can be explained by the variation of the number of sequences in the packing batch, and general noise in the training process. Especially after the initial phase, the curves show a near-identical match. The second setup shows bigger differences since changing the batch size and hyperparameters changes the training dynamics. We observe slower convergence early on in training due to the increased batch size. This is expected. The adjustment of the learning rate actually decreases performance probably because we correct for the increased number of sequences already in the modified loss. With the adjustment of the decay parameter of LAMB, we see matching performance at the later training stages. However, it is not feasible to completely recover the early convergence behavior of the smaller batch size by adjusting the hyperparameters. For instance doubling the batch size of unpacked BERT to 3000 and adjusting the LAMB decay parameters leads to more of a slow down in convergence than when running packed BERT with a batch size of 1500 and a packing factor of 2. n practice, our implementations exceeds the estimated 1.913 maximum speed-up. This estimate is based on the reduction in the computational work needed to process the dataset. However, packing the data also reduces the latency of the transferring the data to the device. Figure $3$ shows that the realized total speed-up from packing exceeds $2 x$ .
272
+
273
+ # 4.2.1 Ablation study
274
+
275
+ So far, we have shown that with the introduced adjustments, we can match the accuracy of unpacked BERT. In the following, we analyze in how far the masking adjustment is required. In Figure $\mathbb { G } ,$ w e can see that without our adjustments, training loss and accuracy worsen drastically and a longer training time does not lead to a recovery. When not adjusting the positional embedding, the loss and accuracy almost match. However, the accuracy stalls at $7 1 . 8 \%$ and does not reach the target accuracy of $7 2 . 1 \%$ . So overall, both adjustments are crucial to avoid a reduction in performance.
276
+
277
+ When running packed BERT without the NSP loss but keeping everything else the same in a full training setup, we observed that downstream performance on SQuAD reduced the F1 measure by $1 . 3 1 \%$ and EM by $1 . 1 5 \%$ . Hence, we do not consider removing NSP as done in approaches like RoBERTa and T5 as discussed in Section $\mathbb { I }$
278
+
279
+ ![](images/f251e6396c85c4a9ffa0481df4c6d4f3bf28084e3aa659246ed734677faaf749.jpg)
280
+ Figure 3: Comparison of learning curves for packed and unpacked processing, where all experiments converged to the target accuracy within the same number of training samples(3 million). [left] same effective batch size (ebs is batch size times packing factor), [middle] different heuristic adjustments of the hyperparameters (batch size 1500 for all runs, such that ebs for packed runs is $1 5 0 0 * 2 ,$ , and [right] realized speed-up from packing (in excess of desired $2 \mathbf { x }$ ). Further learning curves are provided in Section O.
281
+
282
+ ![](images/d11ada7143c295cd7896618d424f278596e8f1448d1c34cd448d1ef191abd169.jpg)
283
+ Figure 4: Comparison of learning curves with and without mask or positional embedding adjustment in our packed BERT approach. The grey accuracy baseline to reach is $7 2 . 1 \%$ .
284
+
285
+ # 297 4.3 Full pretraining and SQuAD finetuning
286
+
287
+ 298
288
+ 299
289
+ 300
290
+ 301
291
+ 302
292
+ 303
293
+ 304
294
+ 305
295
+ 306
296
+ 307
297
+ 308
298
+ 309
299
+ 310
300
+ 311
301
+ 312
302
+ 313
303
+ 314
304
+ 315
305
+ 316
306
+
307
+ Packing slightly violates the i.i.d. assumption of data. Thus, we have to check that downstream performance is not impacted by packing. This is especially relevant in a full training setup without a starting checkpoint. To this aim, we show that the packed and unpacked SQuAD 1.1 scores are comparable after a full-pretraining of BERT base and large plus fine-tuning. During pre-training, in order to avoid giving an advantage to packing by further hyperparameter tuning, we reduce the gradient accumulation count for the packed BERT training for phase 1 and phase 2 to match, on average, the total number of sequences that get processed before each weight update. With this approach, we can use the same hyperparameters and number of training steps but process each batch faster by avoiding the processing of padding. This gives a slight disadvantage to the packed run in terms of machine utilization, as explained in Section $3 . 3$ and is different to the speedup analysis in Section $4 . 2 .$ For Phase 2, we use sequence length 384 since longer range attention is not relevant for SQuAD 1.1. The respective speed-ups from packing for BERT base and large are shown in Table $2 { : }$ the realized speed-up, measured as the quotient of the throughputs between the packed and unpacked runs, is slightly lower to the theoretical throughput (i.e. the packing factor) due to the packing overhead. Further learning curves with the loss function and accuracy are provided in Section $\mathrm { \bf P }$ For the fine-tuning training on SQuAD 1.1, we do not use packing. The scores, computed as the median of 10 different seeds, are displayed in Table $\textcircled{3}$ They are comparable to the reference ones in $\pmb { \Vert 6 \Vert }$ : for BERT base (resp. large) the F1 score is reduced by $0 . 2 \%$ (resp. $0 . 3 \%$ ) and the EM score increases by $0 . 3 \%$ (resp. $0 . 0 2 \%$ ).
308
+
309
+ Table 2: Measured speed-ups in BERT pretraining with packing.
310
+
311
+ <table><tr><td>Model size</td><td>Sequence length</td><td>Packing factor</td><td>Realized speed-up</td></tr><tr><td rowspan="2">base</td><td>128</td><td>1.17</td><td>1.15</td></tr><tr><td>384</td><td>1.70</td><td>1.68</td></tr><tr><td rowspan="2">large</td><td>128</td><td>1.17</td><td>1.15</td></tr><tr><td>384</td><td>1.70</td><td>1.69</td></tr></table>
312
+
313
+ Table 3: SQuAD 1.1 scores after BERT pretraining with packing.
314
+
315
+ <table><tr><td>Model size</td><td>Configuration</td><td>F1</td><td>Exact match</td></tr><tr><td>base</td><td>回 Packed</td><td>88.5 88.32</td><td>80.8 81.03</td></tr><tr><td>large</td><td>回 Packed</td><td>90.9 90.65</td><td>84.1 84.12</td></tr></table>
316
+
317
+ # 317 4.4 Scaling analysis: Impact of accelerators count
318
+
319
+ 318 A further advantage of packing over competing un-padding approaches is the inherent load balancing
320
+ 319 provided by packing. So called un-padding approaches rely on dynamically launching custom kernels
321
+ 320 that ignore padding. A stated advantage of such implementations is the ability to avoid computing
322
+ 321 the complete $( 5 1 2 \mathrm { ~ x ~ } 5 1 2 )$ ) attention matrix. This provides additional computational savings compared
323
+ 322 to packing, where the attention matrix is computed in its entirety and then masked. Because of
324
+ 323 these additional savings, un-padding can exceed the theoretical upper bound for speed-up from
325
+ 324 packing (2.013 on Wikipedia). As a result of the dynamic nature of the approach, the processing
326
+ 325 time with un-padding is different for each sequence in the batch, and the amount of time required to
327
+ 326 process a batch of sequences will be determined by the processing time of the longest sequence in
328
+ 327 the batch (with the sequences being processed in parallel). Furthermore, in the multiple accelerator
329
+ 328 setting the processing time on each device will vary depending on the sequences in the batch that it
330
+ 329 receives. Devices which finish early have to wait for the slowest device to finish before exchanging
331
+ 330 gradients. This load-imbalance between the devices (and inside the batch) leads to a considerable
332
+ 331 decrease in the speed-up from un-padding as the number of accelerators is increased (see Figure $5$
333
+ 332 and Section E [1]). In contrast, packing (our approach) is inherently load-balanced. The processing
334
+ 333 time on each accelerator is independent of the content inside the batch received by the device. Any
335
+ 334 number of accelerators can therefore operate in unison without having to wait for the slowest batch to
336
+ 335 process (all per-device batches are equally fast).
337
+
338
+ ![](images/c03156afbbc2ee6402b22f7d72edeb38e1a5f626285457de2593566b71cc80a5.jpg)
339
+ Figure 5: Comparison of the theoretical speed-up as the number of accelerators is increased.
340
+
341
+ # 336 5 Conclusion
342
+
343
+ Whereas packing is a well known concept, this paper sheds a new light onto it in multiple aspects. First, we visualize the sequence length distributions of multiple datasets not just from language domains but also audio and molecular domains to emphasize that packing is beneficial for a lot of datasets and that in many cases, more than $2 \mathbf { x }$ acceleration can be achieved by removing $5 0 \%$ or more padding. Second, we provide two new highly efficient packing approaches based on established solvers that leave almost no padding and that can tackle arbitrarily large datasets in a matter of seconds, in contrast to existing approaches that are slow and suboptimal. Third, we demonstrate that without adjusting the sequence processing algorithm (e.g., BERT) to the packed sequences, predictive performance is reduced. Thus, we propose several model adjustments that are all necessary to keep predictive performance. Last but not least, we prove that, thanks to such adjustments, predictive performance is preserved as if no packing was used — but speed significantly increases, especially since the adjustments come with an overhead of less than $5 \%$ . We prove in our experiments that downstream performance is not impacted by packing and that the anticipated $2 \mathbf { x }$ acceleration can be achieved.
344
+
345
+ 351 In the future, an interesting direction is the packing of images of different sizes to help accelerate
346
+ 352 computer-vision applications. This is especially relevant given the recent advances in the use of
347
+ 353 transformer-based approaches in the computer vision domain, for example the visual transformer $\pmb { \mathbb { B 3 } }$ .
348
+ 354 Note that many images come in different shapes and resolutions and packing them can be a new
349
+ 355 approach to tackle this diversity instead of casting them all to the same resolution and shape. Masking
350
+ 356 out the self-attention within transformers is easier to implement than avoiding cross-contamination of
351
+ 357 convolutions applied to packed images. Future work should explore improving the performance of
352
+ 358 other models (RoBERTa, GPT-3, T5) by avoiding contamination between non-contiguous segments
353
+ 359 from different documents. Even BERT itself might benefit from avoiding contamination between the
354
+ 360 two concatenated segments.
355
+
356
+ #
357
+
358
+ 361 References
359
+ 362 [1] ANONYMOUS. Supplemental Material for “Efficient Sequence Packing without Cross-contamination:
360
+ 363 Accelerating Large Language Models without Impacting Performance’, 2022.
361
+ 364 [2] BOTTOU, L., CURTIS, F. E., AND NOCEDAL, J. Optimization Methods for Large-Scale Machine Learning.
362
+ 365 SIAM Review 60, 2 (jan 2018), 223–311.
363
+ 366 [3] BRO, R., AND DE JONG, S. A fast non-negativity-constrained least squares algorithm. Journal of
364
+ 367 Chemometrics 11, 5 (sep 1997), 393–401.
365
+ 368 [4] BROWN, T. B., MANN, B., RYDER, N., SUBBIAH, M., KAPLAN, J., DHARIWAL, P., NEELAKANTAN,
366
+ 369 A., SHYAM, P., SASTRY, G., ASKELL, A., AGARWAL, S., HERBERT-VOSS, A., KRUEGER, G.,
367
+ 370 HENIGHAN, T., CHILD, R., RAMESH, A., ZIEGLER, D. M., WU, J., WINTER, C., HESSE, C., CHEN,
368
+ 371 M., SIGLER, E., LITWIN, M., GRAY, S., CHESS, B., CLARK, J., BERNER, C., MCCANDLISH, S.,
369
+ 372 RADFORD, A., SUTSKEVER, I., AND AMODEI, D. Language Models are Few-Shot Learners. In Advances
370
+ 373 in Neural Information Processing Systems 33 pre-proceedings (NeurIPS 2020) (may 2020).
371
+ 374 [5] BYTEDANCE INC. Effective Transformer. https://github.com/bytedance/effective_
372
+ 375 transformer, 2021.
373
+ 376 [6] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. BERT: Pre-training of deep bidirectional
374
+ 377 transformers for language understanding. NAACL HLT 2019 - 2019 Conference of the North American
375
+ 378 Chapter of the Association for Computational Linguistics: Human Language Technologies - Proceedings
376
+ 379 of the Conference 1 (oct 2019), 4171–4186.
377
+ 380 [7] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. BERT: Pre-training of Deep Bidirectional
378
+ 381 Transformers for Language Understanding. https://github.com/google-research/bert, 2019.
379
+ 382 [8] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. Pre-training data creation script
380
+ 383 for BERT. https://github.com/google-research/bert/blob/master/create_pretraining_
381
+ 384 data.py#L243, 2019.
382
+ 385 [9] FEDUS, W., ZOPH, B., AND SHAZEER, N. Switch Transformers: Scaling to Trillion Parameter Models
383
+ 386 with Simple and Efficient Sparsity. arXiv (jan 2021).
384
+ 387 [10] INTEL, 2021.
385
+ 388 [11] JIA, Z., TILLMAN, B., MAGGIONI, M., AND SCARPAZZA, D. P. Dissecting the Graphcore IPU
386
+ 389 architecture via microbenchmarking. ArXiv abs/1912.03413 (2019).
387
+ 390 [12] JOHNSON, D. S. Near-optimal bin packing algorithms. PhD thesis, Massachusetts Institute of Technology,
388
+ 391 1973.
389
+ 392 [13] JOHNSON, D. S., AND GAREY, M. R. A 7160 theorem for bin packing. Journal of Complexity 1, 1 (oct
390
+ 393 1985), 65–106.
391
+ 394 [14] KORTE, B., AND VYGEN, J. Combinatorial Optimization, vol. 21 of Algorithms and Combinatorics.
392
+ 395 Springer Berlin Heidelberg, Berlin, Heidelberg, 2012.
393
+ 396 [15] LEE, C. C., AND LEE, D. T. A Simple On-Line Bin-Packing Algorithm. Journal of the ACM (JACM) 32,
394
+ 397 3 (jul 1985), 562–572.
395
+ 398 [16] LIU, Y., OTT, M., GOYAL, N., DU, J., JOSHI, M., CHEN, D., LEVY, O., LEWIS, M., ZETTLEMOYER,
396
+ 399 L., AND STOYANOV, V. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv (jul 2019).
397
+ 400 [17] MATTSON, P., REDDI, V. J., CHENG, C., COLEMAN, C., DIAMOS, G., KANTER, D., MICIKEVICIUS,
398
+ 401 P., PATTERSON, D., SCHMUELLING, G., TANG, H., WEI, G., AND WU, C. MLPerf: An Industry
399
+ 402 Standard Benchmark Suite for Machine Learning Performance. IEEE Micro 40, 2 (2020), 8–16.
400
+ 403 [18] MENG, Q., CHEN, W., WANG, Y., MA, Z. M., AND LIU, T. Y. Convergence analysis of distributed
401
+ 404 stochastic gradient descent with shuffling. Neurocomputing 337 (apr 2019), 46–57.
402
+ 405 [19] MLCOMMONS. v0.7 Results. https://mlcommons.org/en/training-normal-07/, 2020. Result
403
+ 406 not verified by MLPerf. Throughput/speedup is not the primary metric of MLPerf. MLPerf name and logo
404
+ 407 are trademarks. See www.mlperf.org for more information.
405
+ 408 [20] NVIDIA. Reference numbers for BERT un-padding results. https://github.com/mlcommons/
406
+ 409 training_results_v0.7/blob/master/NVIDIA/results/dgxa100_ngc20.06_pytorch/bert/
407
+ 410 result_0.txt, 2020. Throughput/speedup is not the primary metric of MLPerf. MLPerf name and logo
408
+ 411 are trademarks. See www.mlperf.org for more information.
409
+ 412 [21] NVIDIA. Faster Transformer. https://github.com/NVIDIA/DeepLearningExamples/tree/
410
+ 413 master/FasterTransformer/v1, 2021.
411
+ 414 [22] OTT, M., EDUNOV, S., BAEVSKI, A., FAN, A., GROSS, S., NG, N., GRANGIER, D., AND AULI,
412
+ 415 M. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019:
413
+ 416 Demonstrations (2019).
414
+ 417 [23] PANAYOTOV, V., CHEN, G., POVEY, D., AND KHUDANPUR, S. Librispeech: an asr corpus based on
415
+ 418 public domain audio books. In Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE International
416
+ 419 Conference on (2015), IEEE, pp. 5206–5210.
417
+ 420 [24] RAFFEL, C., SHAZEER, N., ROBERTS, A., LEE, K., NARANG, S., MATENA, M., ZHOU, Y., LI, W.,
418
+ 421 AND LIU, P. J. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. Journal
419
+ 422 of Machine Learning Research 21 (oct 2019).
420
+ 423 [25] RAJPURKAR, P., ZHANG, J., LOPYREV, K., AND LIANG, P. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine
421
+ 424 comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language
422
+ 425 Processing (Austin, Texas, Nov. 2016), Association for Computational Linguistics, pp. 2383–2392.
423
+ 426 [26] RAMAKRISHNAN, R., DRAL, P. O., RUPP, M., AND VON LILIENFELD, O. A. Quantum chemistry
424
+ 427 structures and properties of 134 kilo molecules. Scientific Data 1 (2014).
425
+ 428 [27] RUDDIGKEIT, L., VAN DEURSEN, R., BLUM, L. C., AND REYMOND, J.-L. Enumeration of 166 billion
426
+ 429 organic small molecules in the chemical universe database gdb-17. Journal of Chemical Information and
427
+ 430 Modeling 52, 11 (2012), 2864–2875. PMID: 23088335.
428
+ 431 [28] SHEN, J., NGUYEN, P., WU, Y., CHEN, Z., ET AL. Lingvo: a modular and scalable framework for
429
+ 432 sequence-to-sequence modeling, 2019.
430
+ 433 [29] VASWANI, A., SHAZEER, N., PARMAR, N., USZKOREIT, J., JONES, L., GOMEZ, A. N., KAISER, U.,
431
+ 434 AND POLOSUKHIN, I. Attention is all you need. In Proceedings of the 31st International Conference on
432
+ 435 Neural Information Processing Systems (Red Hook, NY, USA, 2017), NIPS’17, Curran Associates Inc.,
433
+ 436 p. 6000–6010.
434
+ 437 [30] WANG, A., SINGH, A., MICHAEL, J., HILL, F., LEVY, O., AND BOWMAN, S. GLUE: A multi-task
435
+ 438 benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP
436
+ 439 Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP (Brussels, Belgium, Nov.
437
+ 440 2018), Association for Computational Linguistics, pp. 353–355.
438
+ 441 [31] WARSTADT, A., SINGH, A., AND BOWMAN, S. R. Neural network acceptability judgments. arXiv
439
+ 442 preprint arXiv:1805.12471 (2018).
440
+ 443 [32] WOLF, T., DEBUT, L., SANH, V., CHAUMOND, J., DELANGUE, C., MOI, A., CISTAC, P., RAULT, T.,
441
+ 444 LOUF, R., FUNTOWICZ, M., DAVISON, J., SHLEIFER, S., VON PLATEN, P., MA, C., JERNITE, Y., PLU,
442
+ 445 J., XU, C., SCAO, T. L., GUGGER, S., DRAME, M., LHOEST, Q., AND RUSH, A. M. Transformers: State
443
+ 446 of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in
444
+ 447 Natural Language Processing: System Demonstrations (Online, Oct. 2020), Association for Computational
445
+ 448 Linguistics, pp. 38–45.
446
+ 449 [33] WU, B., XU, C., DAI, X., WAN, A., ZHANG, P., YAN, Z., TOMIZUKA, M., GONZALEZ, J., KEUTZER,
447
+ 450 K., AND VAJDA, P. Visual transformers: Token-based image representation and processing for computer
448
+ 451 vision, 2020.
449
+ 452 [34] XLA, T. XLA: Optimizing Compiler for Machine Learning. https://www.tensorflow.org/xla,
450
+ 453 2021.
451
+ 454 [35] YOU, Y., LI, J., REDDI, S., HSEU, J., KUMAR, S., BHOJANAPALLI, S., SONG, X., DEMMEL, J.,
452
+ 455 KEUTZER, K., AND HSIEH, C.-J. Large Batch Optimization for Deep Learning: Training BERT in 76
453
+ 456 minutes. arXiv (apr 2019).
454
+ 457 [36] YUE, M., AND ZHANG, L. A simple proof of the inequality $M F F D ( L ) \leq 7 1 / 6 0 O P T ( L ) + 1 , L$ for
455
+ 458 the MFFD bin-packing algorithm. Acta Mathematicae Applicatae Sinica $^ Ḋ I I Ḍ$ , 3 (jul 1995), 318–330.
456
+
457
+ 1. For all authors...
458
+
459
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] Our paper has four main claims. First, in Figure $^ 1$ we show the sequence length distribution of Wikipedia and many other datasets and the excessive padding that they require. Second, in Section $4 . { \dot { 1 } } ,$ we show that we can efficiently pack the data which can be easily reproduced with the shared data and code [1]. Third, in Figure 3[right], we clearly show the $2 \mathbf { x }$ performance gain from packing and the related hyperparameter adjustment scheme. Fourth, multiple additional experiments on downstream tasks, ablation studies, and packing variants further verify the validity of our proposed approaches.
460
+
461
+ (b) Did you describe the limitations of your work? [Yes] We see three potential limitations that we discuss in the paper. First, as stated in Section $\mathbf { A }$ “Broader Impact” in the appendix [1], our approach is clearly dependent on the sequence length distribution of the dataset. However, we looked into several other datasets beyond Wikipedia and observed even higher potential for acceleration and document this in multiple sections throughout the paper as well as in the appendix [1]. Second, we explain our focus on the IPU hardware in Section $\boxed { 4 . 1 }$ Our theoretical analysis in Section $\boxed { 4 . 4 }$ indicates that our approach benefits also GPUs. We also cite other work, that shows that our approach is hardware independent. Third, our changes to the network with a modified attention mask and loss calculation come with some overhead. This is addressed in Table 1 [overhead column] in Section 4.1.
462
+
463
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] We address this point in Section $\mathbf { \bar { A } }$ “Broader Impact”, third paragraph, in the appendix [1].
464
+
465
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
466
+
467
+ 2. If you are including theoretical results...
468
+
469
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] Detailed algorithm explanations, clarifications of assumptions, and proofs are provided in the supplemental material [1].
470
+ (b) Did you include complete proofs of all theoretical results? [Yes] Sections D, E, and G in the supplemental material [1] provide the necessary derivations on theoretical results.
471
+
472
+ 3. If you ran experiments...
473
+
474
+ (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] All packing code is provided in the paper. The packing results on BERT got verified by multiple independent parties. One party used a draft of this paper to successfully reproduce its main findings. Links to implementations in three different frameworks will be provided after acceptance, to avoid violating the blind submission rules.
475
+
476
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] In the first part, we follow the MLPerf 0.7 benchmark rules. We document the parameters that we changed and why we change them. For the downstream tasks, we follow the reference and report where, how and why we change hyperparameters.
477
+
478
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] The packing algorithms are deterministic and have no error. Other experiments are only executed once to compare convergence curves. For downstream tasks, we report repetition details and the median as in the reference.
479
+
480
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We used 16 Graphcore Mk2 IPUs for acceleration on an internal cluster.
481
+
482
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
483
+
484
+ (a) If your work uses existing assets, did you cite the creators? [Yes] Appropriate references to the BERT authors, all datasets, and the code snippet from the HugginFace inc. are appropriately referenced with citations and links.
485
+
486
+ (b) Did you mention the license of the assets? [Yes] For the only taken code snippet, the license is part of the file [Listing 7 in $\mathbb { I I I }$ . Dataset licenses like Wikipedia’s “Creative Commons Attribution-ShareAlike 3.0 License” are covered by the references. New materials like packing code and histograms will be provided under an MIT license which will be added over a link to the resources in the final paper version.
487
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] New materials like packing code and histograms are included in the supplement document as well as separate file. To avoid violating the blind submission rules, they will be linked in the final version like many other assets which are already publicly available under MIT license.
488
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] We did not curate other people’s data. We only provide a very high level aggregate of the used data.
489
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We did not curate other people’s data.
490
+
491
+ 5. If you used crowdsourcing or conducted research with human subjects...
492
+
493
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] Our experiments did not include crowdsourcing or human subjects.
494
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] Our experiments did not include crowdsourcing or human subjects.
495
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] Our experiments did not include crowdsourcing or human subjects.
parse/dev/e2M4CNa-UOS/e2M4CNa-UOS_content_list.json ADDED
@@ -0,0 +1,1012 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Efficient Sequence Packing without Cross-contamination: Accelerating Large Language Models without Impacting Performance ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 184,
8
+ 122,
9
+ 815,
10
+ 198
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous Author(s) \nAffiliation \nAddress \nemail ",
17
+ "bbox": [
18
+ 423,
19
+ 251,
20
+ 578,
21
+ 306
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 343,
32
+ 535,
33
+ 359
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "1 Effective training of today’s large language models (LLMs) depends on large \n2 batches and long sequences for throughput and accuracy. To handle variable-length \n3 sequences on hardware accelerators, it is common practice to introduce padding \n4 tokens, so that all sequences in a batch have the same length. We show in this paper \n5 that the variation in sequence lengths in common NLP datasets is such that up to \n6 $50 \\%$ of all tokens can be padding. In less common, but not extreme, cases (e.g. \n7 GLUE-cola with sequence length 128), the ratio is up to $89 \\%$ . Existing methods \n8 to address the resulting inefficiency are complicated by the need to avoid ‘cross \n9 contamination’ in self-attention, by a reduction in accuracy when sequence ordering \n10 information is lost, or by customized kernel implementations only valid for specific \n11 accelerators. This paper introduces a new formalization of sequence packing in \n12 the context of the well-studied bin packing problem, and presents new algorithms \n13 based on this formulation which, for example, confer a $2 \\mathbf { x }$ speedup for phase 2 \n14 pre-training in BERT. We show how existing models can be adapted to ensure \n15 mathematical equivalence between the original and packed models, meaning that \n16 packed models can be trained with existing pre-training and fine-tuning practices. ",
40
+ "bbox": [
41
+ 148,
42
+ 375,
43
+ 766,
44
+ 595
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "17 1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 148,
54
+ 621,
55
+ 312,
56
+ 638
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "18 Many language datasets, including the de-facto pre-training dataset for BERT—Wikipedia, have \n19 a skewed distribution of sequence lengths (see Figure 1). However, typical machine learning \n20 accelerators, and their corresponding libraries, exhibit poor performance when processing variable \n21 length workloads. A simple mitigation is to set a maximum sequence length, and to pad shorter \n22 sequences with padding tokens. This naive batching is widely used and provided in the vanilla BERT \n23 implementation as well as the Hugging Face framework $| \\dot { \\overline { { { \\vert 3 2 } \\vert } } } |$ . Its effect is enhanced by the offline \n24 dataset generation process which, in BERT, attempts to “pack” together sentences so as to fill the \n25 sequence length as completely as possible $\\pmb { \\mathbb { B } } ] \\mathbf { l }$ . We improve this process at a whole-dataset level. \n26 We show that, even after this pre-processing, padding tokens represent $5 0 \\%$ of all tokens of the \n27 Wikipedia pre-training dataset at sequence length 512. Thus, by avoiding processing the padding \n28 tokens one can get a $2 \\mathbf { x }$ speed-up for phase 2. Overall, the lengths range between 5 tokens up to 512. \n29 Samples of length 512 represent only $2 3 . 5 \\%$ of the dataset, \n30 Beyond the simple batching, other solutions have been addressed in the literature, and in open-source \n31 software implementations. When processing sequences, most libraries and algorithms mention \n32 packing as reference to concatenating sentences from the same document (BERT) or from different \n33 documents (BERT, T5 $\\pmb { \\Vert 2 4 \\Vert }$ , GPT-3 [4], and RoBERTa $\\mathbb { I I } ^ { }$ ) as they arrive (GREEDY) from the \n34 source dataset to generate the training dataset. None of the respective papers addresses the packing \n35 efficiency, i.e., remaining fraction of padding. To “separate” sequences from different documents, a \n36 separator token is introduced. However, this is not sufficient and can have a significant impact on \n37 performance. This is discussed only in the RoBERTa paper which shows that downstream F1 scores \n38 get consistently reduced on average by $0 . 3 5 \\%$ . Alternative common approaches to overcome the large \n39 amount of padding in many datasets are “un-padding” as in Effective Transformer $\\pmb { \\Vert 5 \\Vert }$ and sorted \n40 batching (SORT) as in Faster Transformer $\\mathbb { \\left| \\mathbb { Z } \\right\\| }$ , lingvo $\\overline { { \\| 2 8 \\| } }$ fairseq $\\lVert 2 2 \\rVert$ , and RoBERTa. However, for \n41 running efficiently on arbitrary accelerators, these approaches require substantial hardware-specific \n42 low-level code optimizations only available on GPUs. Further details are in Sections C [1] and 4.4. \n43 Beyond language models, packing has been also present in other areas of machine learning, however \n44 with little to no exploration in the literature and mostly hidden in some libraries without any further \n45 discussion. For example, PyG (PyTorch Geometric) combines multiple small graphs in a batch to \n46 account for the large variation in size and to optimize the hardware usage when training a Graph \n47 Neural Network (GNN). Another example is the RNN implementation in PyTorch which introduces a \n48 “PackedSequence” object and states that “All RNN modules accept packed sequences as inputs” but \n49 does not address how sequences are packed efficiently and how the processing of packed sequences \n50 is implemented in an efficient manner while avoiding interaction between sequences. Even though \n51 we focus on BERT [6] and other transformers in this paper, the general principles can be transferred \n52 to many more machine learning algorithms with differently sized data samples. ",
63
+ "bbox": [
64
+ 147,
65
+ 652,
66
+ 825,
67
+ 763
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "",
74
+ "bbox": [
75
+ 147,
76
+ 770,
77
+ 825,
78
+ 825
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "",
85
+ "bbox": [
86
+ 147,
87
+ 832,
88
+ 823,
89
+ 901
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "",
96
+ "bbox": [
97
+ 145,
98
+ 92,
99
+ 825,
100
+ 203
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "",
107
+ "bbox": [
108
+ 145,
109
+ 208,
110
+ 825,
111
+ 347
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "In this paper, we formally frame the packing problem in transformer based models, and provide some solutions, showing that sequences can be packed efficiently, separator tokens are not required, and cross-contamination can be avoided with little overhead. ",
118
+ "bbox": [
119
+ 161,
120
+ 353,
121
+ 823,
122
+ 395
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "56 In summary, the contributions of the paper are as follows. In Section 2, we produce histograms of a \n57 variety of datasets showing the high percentage of padding tokens. In Section $\\boxed { 3 . 1 }$ we present two new \n58 deterministic and efficient packing algorithms based on established solvers which efficiently pack \n59 datasets with millions of sequences in a matter of seconds (or less). In Section $3 . 2$ and Section ${ \\dot { \\overline { { | 3 . 3 | } } } } ,$ we \n60 describe ‘cross-contamination’ —the cause of the accuracy reduction which separator tokens do not \n61 mitigate— and show how the BERT model can be adjusted to show the same convergence behavior \n62 on packed and unpacked sequences. We empirically show that the proposed packing algorithms \n63 produce a nearly-optimal packing scheme for Wikipedia pre-training dataset (Section $\\bar { 4 . 1 ) }$ and more \n64 in the Appendix. In Section $4 . 2 ,$ we demonstrate that the convergence of the BERT large model on \n65 the packed dataset is equivalent to that on the un-packed dataset with $2 \\mathbf { x }$ throughput increase on the \n66 Wikipedia sequence length 512 pre-training dataset. Further experiments underline the necessity and \n67 efficiency of our changes. ",
129
+ "bbox": [
130
+ 145,
131
+ 401,
132
+ 825,
133
+ 568
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "68 2 Sequence length distributions ",
140
+ "text_level": 1,
141
+ "bbox": [
142
+ 150,
143
+ 588,
144
+ 450,
145
+ 606
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "image",
151
+ "img_path": "images/b7f41427237cebf8220073cd7a665c1f053a2cc983c1d8c1e00418a740af50bf.jpg",
152
+ "image_caption": [
153
+ "Figure 1: Sequence length distributions for different datasets. The three graphics at the top left show Wikipedia BERT pre-training dataset sequence length histograms (token count excluding padding) for different maximum sequence lengths based on the Wikipedia article dump from October 1st 2020. The theoretical speed-up relates to not using any padding tokens and not having any overhead from processing the different lengths. Top right: GLUE datasets. Bottom from left to right: SQuAD 1.1, LibriSpeech text labels, LibriSpeech audio token sequence, and QM9 molecules of a graph in a sequence. "
154
+ ],
155
+ "image_footnote": [],
156
+ "bbox": [
157
+ 200,
158
+ 628,
159
+ 797,
160
+ 799
161
+ ],
162
+ "page_idx": 1
163
+ },
164
+ {
165
+ "type": "text",
166
+ "text": "69 BERT is pre-trained using masked-language modelling and next-sentence prediction on a large \n70 corpus of Wikipedia articles. Each sequence is composed of one ${ \\mathrm { < C L S > } }$ token followed by the \n71 first “segment” of sentences, followed by a ${ \\mathrm { - S E P } } { \\mathrm { > } }$ token, and then finally the second “segment” of \n72 sentences. Because these “segments” are created in sentence-level increments there is no token-level \n73 control of sequence length. Furthermore $1 0 \\%$ (default value, $\\mathbb { I I }$ ) of sequences are intentionally \n74 cut short. This leads to significant levels of padding, especially for longer maximum sequence \n75 lengths (see Figure $\\mathbb { L }$ and Section $\\mathbf { J } \\mathbb { \\equiv } \\mathbb { I } ^ { }$ ). At sequence length 128 (commonly used in phase 1 of \n76 pre-training) the theoretical speed-up is around 1.2, at sequence length 384 this increases to 1.7, and \n77 finally at sequence length 512 (commonly used for phase 2 of pre-training) it is 2.0. Despite the \n78 widespread use of the Wikipedia dataset for pre-training BERT such histograms have, to the best \n79 of our knowledge, not been published previously. This has perhaps lead to the underestimation of \n80 the speed-up opportunity available. To put things into perspective, the sequence length 512 dataset \n81 contains 8.33 billion tokens, of which 4.17 billion are padding tokens. \n82 Note that the skewed sequence length distributions are neither limited to Wikipedia, as shown with \n83 GLUE [30, 31] from Section $\\mathbf { L } \\mathbb { \\mathbb { \\mathbf { \\Pi } } }$ and SQuAD 1.1 $\\pmb { \\left. 2 5 \\right. }$ from Section $\\mathbb { K } \\mathbb { 1 } \\mathbb { 1 }$ $2 . 2 x$ speed up), to BERT \n84 training, as shown with LibiSpeech text distributions $\\mathbb { \\left| \\mathbb { Z } 3 \\right| }$ from Section $\\mathbf { M } \\mathbb { I } \\mathbb { I }$ , nor to text itself, \n85 given the LibriSpeech audio data distributions, and the QM9 molecular data $\\overline { { \\mathbb { B } 2 7 } } , \\overline { { \\sf 2 6 } } ]$ ( $1 . 6 x$ speed-up, \n86 Section $\\mathbb { Q } \\mathbb { \\mathbb { 1 } \\mathbb { 1 } } )$ ). All distributions can be found in Figure $\\bigstar$ Since LibriSpeech audio data is skewed to \n87 longer sequences, only $1 . 3 x$ speed-up could be achieved despite the theoretical maximum of $1 . 6 x$ \n88 For all other cases, the algorithms presented in Section $3 . 1$ lead to close to optimal packing. ",
167
+ "bbox": [
168
+ 145,
169
+ 92,
170
+ 825,
171
+ 270
172
+ ],
173
+ "page_idx": 2
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "",
178
+ "bbox": [
179
+ 147,
180
+ 277,
181
+ 825,
182
+ 376
183
+ ],
184
+ "page_idx": 2
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "89 3 Methods ",
189
+ "text_level": 1,
190
+ "bbox": [
191
+ 155,
192
+ 393,
193
+ 277,
194
+ 410
195
+ ],
196
+ "page_idx": 2
197
+ },
198
+ {
199
+ "type": "text",
200
+ "text": "90 Our approach consists of three distinct components. Firstly, we pack the $n$ data samples efficiently \n91 during pre-processing to make full use of the maximum sequence length, $s _ { m }$ (Sections $3 . 1$ and $\\dot { \\mathbb { E } } \\dot { ) }$ \n92 Secondly, we introduce a series of model changes in Section $3 . 2$ that preserve the equivalence with \n93 the original BERT implementation. The changes include a self-attention mask to prevent the model \n94 from attending between different sequences in the same pack (Section $3 . 2 . 2 )$ and an adjustment \n95 of the the positional embeddings (Section $3 . 2 . 1 )$ to handle packs of sequences. Other components \n96 of the model, such as the feed-forward layer $\\pmb { \\mathbb { Z } } 9 \\|$ , operate on a per-token basis and do not require \n97 modification for pre-training. In Section $3 . 2 . 3 ,$ we also demonstrate how to compute a per-sequence \n98 loss and accuracy for NSP and downstream fine-tuning tasks. Thirdly, we provide suggestions for \n99 hyperparameter adjustment (Section $\\textcircled { 3 . 3 }$ that lead to analogous convergence behavior between the \n100 packed and un-packed BERT implementations. Additional videos and animations are provided as \n101 supplemental material. ",
201
+ "bbox": [
202
+ 145,
203
+ 424,
204
+ 825,
205
+ 589
206
+ ],
207
+ "page_idx": 2
208
+ },
209
+ {
210
+ "type": "text",
211
+ "text": "3.1 Packing algorithms ",
212
+ "text_level": 1,
213
+ "bbox": [
214
+ 165,
215
+ 604,
216
+ 348,
217
+ 619
218
+ ],
219
+ "page_idx": 2
220
+ },
221
+ {
222
+ "type": "text",
223
+ "text": "3 The widely studied and well established bin packing problem deals with the assignment of items into bins of a fixed capacity such that the number of utilized bins is minimized. It has been known for decades if not centuries. Since an exact solution is strongly NP-complete $\\pmb { \\mathbb { I } }$ , numerous approximate solutions have been proposed [12, 15, 13, 36]. Since most existing approximations have a high complexity of at least $O ( n \\log n )$ , we propose two new heuristic offline algorithms that are tailored to the NLP setting applied to the whole dataset. For a detailed introduction to packing see Section F. ",
224
+ "bbox": [
225
+ 156,
226
+ 631,
227
+ 825,
228
+ 714
229
+ ],
230
+ "page_idx": 2
231
+ },
232
+ {
233
+ "type": "text",
234
+ "text": "3.1.1 Shortest-pack-first histogram-packing (SPFHP) ",
235
+ "text_level": 1,
236
+ "bbox": [
237
+ 176,
238
+ 727,
239
+ 557,
240
+ 742
241
+ ],
242
+ "page_idx": 2
243
+ },
244
+ {
245
+ "type": "text",
246
+ "text": "Shortest-pack-first histogram-packing (SPFHP) works on the bins in the sequence length histogram (with bin size 1) rather than the individual samples. The histogram is traversed in sorted order from longest to shortest sequences. Then, to pack the data during the traversal, we apply the worst-fit algorithm $[ 1 2 , 1 3 6 ]$ such that the histogram bin being processed goes to the “pack”1 that has the most space remaining (“shortest-pack-first”). If the histogram bin does not fit completely, a new pack is created. We also limit the packing depth, in other words the maximum number of sequences that are allowed in a pack. Therefore, an existing pack is only extended if it is not already at maximum packing depth. The detailed code for the algorithm is provided in Listing $\\textcircled { 3 }$ The time and space complexity of the algorithm are $O ( n + s _ { m } ^ { 2 } )$ and $O ( s _ { m } ^ { 2 } )$ (Section G.2[1] ). ",
247
+ "bbox": [
248
+ 173,
249
+ 751,
250
+ 825,
251
+ 877
252
+ ],
253
+ "page_idx": 2
254
+ },
255
+ {
256
+ "type": "text",
257
+ "text": "120 The proposed NNLSHP algorithm is based on re-stating the packing problem as a (weighted) non \n121 negative least squares problem (NNLS) $\\mathbb { \\left[ 3 \\right] }$ of the form $w A x = w b$ where $x \\geq 0$ . The vector $b$ is the \n122 histogram containing the counts of all the sequence lengths in the dataset. Next, we define the $A$ \n123 matrix (the “packing matrix“) by first generating a list of all possible sequence length combinations \n124 (“strategies”) that add up exactly to the maximum sequence length. We focus specifically on strategies \n125 that consist of at most 3 sequences per pack (independent of $b$ ) and encode each strategy as a column \n126 of the sparse matrix $A$ . For example, a strategy consisting of the sequence length 128, 128, and \n127 256 in represented a column vector that has the value 2 at the 128th row, the value 1 at the 256th \n128 row, and zero at all other rows. The variable $x$ describes the non-negative repetition count for each \n129 strategy. So a 24 in the ith row of $x$ means that the strategy represented by the ith column of $A$ should \n130 repeat 24 times. Moreover, in the un-weighted setting, $A x = b$ states that we would like to “mix” the \n131 pre-defined strategies (columns of $A$ ) such that the number of samples matches the histogram $b$ , and \n132 where each strategy is used $x \\geq 0$ times. We use the residual weight $w$ to control the penalization \n133 of the $A x - b$ residual on different sequence lengths (different rows of $b$ ). Heuristically, we set \n134 the weight of 0.09 for all sequences of length 8 or smaller because they are considered acceptable \n135 padding sequences while all other sequence lengths get weight 1. We discuss this heuristic choice of \n136 parameters in Section F.4.5 and $\\operatorname { F } . 5 { \\widehat { \\bigcirc } }$ . The overall efficiency of the packing is not greatly influenced \n137 by the weighing (less than $1 \\%$ extra speed-up). \n138 After solving $w A x = w b$ for $x \\geq 0$ using an off-the-shelf solver, we obtain a floating point solution, \n139 which means that the repetition counts are not necessarily integers. Since we cannot use a non-natural \n140 number of strategies, we round the solution $\\hat { x }$ to the nearest integer. The error introduced by this \n141 rounding is found to be negligible (a few hundred sequences in the worst case) compared to the size \n142 of the dataset (millions of sequences). The time complexity and space complexity of the algorithm \n143 are $O ( n + s _ { m } ^ { 5 } )$ and $O ( s _ { m } ^ { 3 } )$ . Further details are provided in Section F.4. ",
258
+ "bbox": [
259
+ 140,
260
+ 114,
261
+ 825,
262
+ 366
263
+ ],
264
+ "page_idx": 3
265
+ },
266
+ {
267
+ "type": "text",
268
+ "text": "",
269
+ "bbox": [
270
+ 140,
271
+ 371,
272
+ 825,
273
+ 457
274
+ ],
275
+ "page_idx": 3
276
+ },
277
+ {
278
+ "type": "text",
279
+ "text": "3.2 packedBERT: model changes ",
280
+ "text_level": 1,
281
+ "bbox": [
282
+ 158,
283
+ 474,
284
+ 415,
285
+ 489
286
+ ],
287
+ "page_idx": 3
288
+ },
289
+ {
290
+ "type": "text",
291
+ "text": "145 This section describes how any vanilla BERT implementation should be modified for packed sequence \n146 processing, such that the behavior of the model is the same as when processing unpacked sequences. \n147 Preserving the mathematical equivalence is necessary to ensure existing BERT pre-training and \n148 fine-tuning practices remain valid, as well as being required by benchmarks such as MLPerf™ [17]. \n149 The presented approaches and principles apply to a variety of other models. ",
292
+ "bbox": [
293
+ 142,
294
+ 501,
295
+ 826,
296
+ 571
297
+ ],
298
+ "page_idx": 3
299
+ },
300
+ {
301
+ "type": "text",
302
+ "text": "3.2.1 Adjust positional embeddings ",
303
+ "text_level": 1,
304
+ "bbox": [
305
+ 165,
306
+ 590,
307
+ 429,
308
+ 604
309
+ ],
310
+ "page_idx": 3
311
+ },
312
+ {
313
+ "type": "text",
314
+ "text": "The BERT model uses three types of embeddings: token, segment, and positional embeddings. The latter is canonically implemented as a bias add operation, rather than a full embedding look-up. This is possible because the positional indices increase linearly for every sequence. However, when using the packed data format the position index needs to be reset with each new packed sequence. For instance, when packing two sequences one of length 2 and one of length 3, the positional embedding indexes that need to be picked up are $[ 0 , 1 , 0 , 1 , 2 ]$ . To achieve this, the bias add needs to be replaced by an embedding look-up to extract the correct positional embedding for each token in the pack. This also requires keeping an extra input which specifies the position of each token in its sequence. This required adjustment has only a minor impact on absolute accuracy/loss (see Section 4.2 and 4.2.1). ",
315
+ "bbox": [
316
+ 171,
317
+ 614,
318
+ 825,
319
+ 741
320
+ ],
321
+ "page_idx": 3
322
+ },
323
+ {
324
+ "type": "text",
325
+ "text": "160 3.2.2 Adjust attention masking ",
326
+ "text_level": 1,
327
+ "bbox": [
328
+ 145,
329
+ 758,
330
+ 401,
331
+ 773
332
+ ],
333
+ "page_idx": 3
334
+ },
335
+ {
336
+ "type": "image",
337
+ "img_path": "images/38c72d48cdad5a3e9bf697e1535417f7bd0cb67ccbf612655a672446d7140a7b.jpg",
338
+ "image_caption": [],
339
+ "image_footnote": [],
340
+ "bbox": [
341
+ 178,
342
+ 801,
343
+ 820,
344
+ 867
345
+ ],
346
+ "page_idx": 3
347
+ },
348
+ {
349
+ "type": "text",
350
+ "text": "Figure 2: Attention mask code [left], respective zero-one mask [middle], and vectorized unpacking of the sequence loss[right]. White rectangles correspond to padding. ",
351
+ "bbox": [
352
+ 171,
353
+ 881,
354
+ 825,
355
+ 910
356
+ ],
357
+ "page_idx": 3
358
+ },
359
+ {
360
+ "type": "text",
361
+ "text": "161 To maintain an implementation that is consistent with the un-packed version, tokens from different \n162 sequences within a pack should not be able to attend to each other. This is typically achieved in \n163 other implementations by unpacking the sequences using custom attention kernels and then doing \n164 the attention per-sequence $\\pmb { \\bar { \\bar { \\bar { \\bar { \\lambda } } } } }$ . Instead, we propose directly masking the attention matrix with a \n165 block-diagonal mask before the attention softmax. This is straightforward to implement in modern \n166 frameworks (see Figure $\\textcircled{2}$ . Naturally, there is a cost to both the mask construction and applying \n167 it to the attention matrix. However, it is required to keep the accuracy (see Table $^ { 1 , }$ Section 4.1, \n168 Section $\\boxed { 4 . 2 }$ . See also the code of the deprecated tensor2tensor library and our own provided code. ",
362
+ "bbox": [
363
+ 142,
364
+ 92,
365
+ 825,
366
+ 203
367
+ ],
368
+ "page_idx": 4
369
+ },
370
+ {
371
+ "type": "text",
372
+ "text": "169 3.2.3 Adjust per-sequence loss and accuracy ",
373
+ "text_level": 1,
374
+ "bbox": [
375
+ 142,
376
+ 234,
377
+ 493,
378
+ 250
379
+ ],
380
+ "page_idx": 4
381
+ },
382
+ {
383
+ "type": "text",
384
+ "text": "170 Canonical implementations of BERT compute the cross-entropy loss for the masked language model \n171 on a per-token basis. However other NLP tasks, such as SQuAD, compute the loss and accuracy on \n172 a per-sequence basis. This section discusses how to handle such tasks when training with packed \n173 sequences. Simply feeding packs of sequences to the same implementation of cross-entropy would \n174 result in a per-pack weighted loss. In other words, the overall loss on the micro-batch would sum-up \n175 the losses on the individual packs, rather than individual sequences. As a result, the model would \n176 converge to a different optimum than when running with the un-packed implementation. For instance, \n177 a pack of a single sequence would contribute to the loss with the same weight as a pack of three \n178 sequences. \n179 To recover the per-sequence averaging behavior of the canonical un-packed BERT implementation, \n180 we effectively “unpack” the incoming logits and labels. Once the sequences have been unpacked, \n181 we can compute the loss on each sequence separately as usual and then add up the losses. However, \n182 rather than looping through the sequences index, we compute on all indexes in parallel (see Figure 2). \n183 This minimizes the latency overhead of un-packing the loss calculation. As an example, we show how \n184 per-sequence loss can be implemented for the pre-training task. We use the “masked lm weight” [7] \n185 input tensor to represent which sequence a given masked token belongs to (0, 1, 2 and so on). This \n186 is consistent with the canonical BERT implementation where this input takes a value of either 1 \n187 (belonging to the sequence) or 0 (belonging to padding). The full methodology is detailed in Listing 5 \n188 and can be applied to other classification or pre-training tasks. ",
385
+ "bbox": [
386
+ 140,
387
+ 265,
388
+ 825,
389
+ 388
390
+ ],
391
+ "page_idx": 4
392
+ },
393
+ {
394
+ "type": "text",
395
+ "text": "",
396
+ "bbox": [
397
+ 140,
398
+ 396,
399
+ 825,
400
+ 535
401
+ ],
402
+ "page_idx": 4
403
+ },
404
+ {
405
+ "type": "text",
406
+ "text": "189 3.3 Adjust hyperparameters ",
407
+ "text_level": 1,
408
+ "bbox": [
409
+ 143,
410
+ 568,
411
+ 383,
412
+ 583
413
+ ],
414
+ "page_idx": 4
415
+ },
416
+ {
417
+ "type": "text",
418
+ "text": "190 In terms of convergence behavior, the primary consequence of packing is an increase in the effective \n191 batch size (with respect to number of sequences and real tokens) with some added variation over \n192 different iterations. If we look on the sentence level, the number of sentences in one batch increases \n193 by the packing factor. Similarly, the number of tokens in one batch increases. Hence, hyperparameters \n194 that are sensitive to these numbers need to be adjusted. \n195 A direct solution is to reduce the computational batch size by the packing factor (average number of \n196 sequences per pack) and keep all other hyperparameters the same. For example, if the packing factor \n197 is 2, cutting the gradient accumulation count by half is sufficient. The advantage of this strategy is that \n198 no fine-tuning of hyperparameters is required and performance curves are comparable. However, this \n199 approach might be not desirable as it might imply under-utilizing the memory/compute, especially if \n200 the micro batch size needs to be reduced. \n201 Hence to preserve batch size and optimize hardware utilization, we additionally propose an approxi \n202 mate heuristic for updating the decay parameters of the LAMB optimizer $\\boldsymbol { \\left[ \\left[ 3 5 \\right] \\right] }$ . For a packed dataset \n203 with a packing factor $p$ , we update the decay parameters as: $\\beta _ { 1 } : = \\beta _ { 1 } ^ { p }$ , $\\beta _ { 2 } : = \\beta _ { 2 } ^ { p }$ . For $p = 2$ , this \n204 corresponds to the exact parameters for calculating momentum and velocity, when updating with the \n205 same gradient twice (Section $\\bigstar \\bigstar$ . A common approach is to scale the learning rate with the batch size. \n206 However, our experiments in Section $\\boxed { 4 . 2 }$ show that this reduces convergence speed. \n207 Since these adjustments are only heuristics the convergence of the model will be comparable but not \n208 identical. In particular, it is unlikely that simply adjusting the hyperparameters will fully undo the \n209 impact of the increased batch size. However, with these adjustments, researchers should be able to \n210 continue to use existing configurations. ",
419
+ "bbox": [
420
+ 140,
421
+ 601,
422
+ 825,
423
+ 670
424
+ ],
425
+ "page_idx": 4
426
+ },
427
+ {
428
+ "type": "text",
429
+ "text": "",
430
+ "bbox": [
431
+ 140,
432
+ 676,
433
+ 825,
434
+ 760
435
+ ],
436
+ "page_idx": 4
437
+ },
438
+ {
439
+ "type": "text",
440
+ "text": "",
441
+ "bbox": [
442
+ 140,
443
+ 766,
444
+ 825,
445
+ 849
446
+ ],
447
+ "page_idx": 4
448
+ },
449
+ {
450
+ "type": "text",
451
+ "text": "",
452
+ "bbox": [
453
+ 142,
454
+ 856,
455
+ 823,
456
+ 911
457
+ ],
458
+ "page_idx": 4
459
+ },
460
+ {
461
+ "type": "text",
462
+ "text": "211 4 Experiments ",
463
+ "text_level": 1,
464
+ "bbox": [
465
+ 143,
466
+ 89,
467
+ 312,
468
+ 107
469
+ ],
470
+ "page_idx": 5
471
+ },
472
+ {
473
+ "type": "text",
474
+ "text": "4.1 Bin packing algorithm comparison ",
475
+ "text_level": 1,
476
+ "bbox": [
477
+ 158,
478
+ 119,
479
+ 455,
480
+ 135
481
+ ],
482
+ "page_idx": 5
483
+ },
484
+ {
485
+ "type": "text",
486
+ "text": "We evaluate our algorithms using the following metrics: number of packs, number of all tokens, number of padding tokens, solution time of the packing algorithm (after histogram and strategy creation), number of strategies used, packing efficiency (the fraction of non-padding tokens in the packed dataset), the speed-up achieved compared to not packing (depth 1), and the average number of sequences per sample (packing factor). For SPFHP, we analyse different (maximum) packing depth, since packing is less efficient with smaller depth and we want to get a general understanding on how the packing depth influences the processing time. For NNLSHP, we focus on packing depth 3 because it packs the data sufficiently well. For the speed-up analysis, we focus on the intelligence processing unit (IPU) [11] (IPU-M2000, 16 accelerator chips), BERT phase 2 pretraining setup as in Section $\\bar { 4 . 2 } .$ A GPU dynamically loads the code into the accelerator; in contrast, the IPU works with a static pre-compiled engine that gets loaded onto the chip at the start of the run. While other approaches result in excessive padding or continuous changes of the code, our approach can work with the same code for the whole dataset. So in this setting the IPU architecture would especially benefit from our approach since it avoids code changes. Nevertheless, it can be applied to any implementation on GPU or TPU. For determining the speed-up, we take advantage of the precompiled kernel. Since time measurements are quite noisy, we can profile the kernel and how many cycles it takes for processing a batch. That way, we can determine the overhead (in cycles) from processing the additional attention masking and for unpacking the loss. Combining overhead and packing factor, we get the speed-up estimate. No experiment repetitions are required since the algorithms and measurements are deterministic. ",
487
+ "bbox": [
488
+ 155,
489
+ 145,
490
+ 825,
491
+ 421
492
+ ],
493
+ "page_idx": 5
494
+ },
495
+ {
496
+ "type": "table",
497
+ "img_path": "images/794084555db8da2d829ce8208d1dfd4a490ac2ea5438f41a09a23af485f7a3dd.jpg",
498
+ "table_caption": [
499
+ "Table 1: Key performance results of proposed packing algorithms (SPFHP and NNLSHP) on IPU. "
500
+ ],
501
+ "table_footnote": [],
502
+ "table_body": "<table><tr><td>pack. depth</td><td>packing algorithm</td><td>EFF (%)</td><td>p</td><td>OH (%)</td><td>realized speed-up</td></tr><tr><td>1</td><td>NONE</td><td>50.0</td><td>1.00</td><td>0.000</td><td>1.000</td></tr><tr><td>1</td><td>SORT</td><td>99.9</td><td>2.00</td><td>&gt;100</td><td>&lt;1.000</td></tr><tr><td>~10</td><td>GREEDY</td><td>~78</td><td>≈1.6</td><td>~4.48</td><td>~1.5</td></tr><tr><td>2</td><td>SPFHP</td><td>80.5</td><td>1.61</td><td>4.283</td><td>1.544</td></tr><tr><td>3</td><td>SPFHP</td><td>89.4</td><td>1.79</td><td>4.287</td><td>1.716</td></tr><tr><td>3</td><td>NNLSHP</td><td>99.7</td><td>2.00</td><td>4.287</td><td>1.913</td></tr><tr><td>4</td><td>SPFHP</td><td>93.9</td><td>1.88</td><td>4.294</td><td>1.803</td></tr><tr><td>8</td><td>SPFHP</td><td>98.9</td><td>1.98</td><td>4.481</td><td>1.895</td></tr><tr><td>max</td><td>SPFHP</td><td>99.6</td><td>1.99</td><td>4.477</td><td>1.905</td></tr></table>",
503
+ "bbox": [
504
+ 307,
505
+ 460,
506
+ 691,
507
+ 616
508
+ ],
509
+ "page_idx": 5
510
+ },
511
+ {
512
+ "type": "text",
513
+ "text": "Packing depth describes the maximum number of packed sequences. NONE is the baseline BERT implementation, whereas SORT corresponds to sorted batching, and GREEDY concatenates sequences as they arrive until they would exceed 512 tokens. Setting no limit resulted in a maximum packing depth of 16. EFFiciency is the percentage of real tokens in the packed dataset. The packing factor describes the resulting potential speed-up compared to packing depth 1. With overhead (OH), we denote the percentage decrease in throughput due to changes to the model to enable packing (such as the masking scheme introduced in Section $\\boxed { 3 . 2 . 2 }$ . The realized speed-up is the combination of the speed-up due to packing (the packing factor) and the decrease in throughput due to the overhead on the IPU. It is used to measure the relative speed-up in throughput and the overhead from masking and loss adjustment. SORT can be only efficient on GPUs (see Section $4 . 4 )$ . ",
514
+ "bbox": [
515
+ 173,
516
+ 621,
517
+ 825,
518
+ 761
519
+ ],
520
+ "page_idx": 5
521
+ },
522
+ {
523
+ "type": "text",
524
+ "text": "233 The main results for the performance metric evaluation are displayed in Table $\\nsupseteq$ The processing \n234 time for SPFHP on an Intel(R) Xeon(R) Gold 6138 CPU with 2.00GHz, 80 nodes, and 472G RAM \n235 was around $0 . 0 3 s$ and independent from the packing depth. Classical First-Fit-Decreasing requires \n236 87-120s, a lot of memory, and scales almost linear with the number of samples. We see that the \n237 overhead slightly increases with packing depth but that the benefits of packing outweigh the cost. The \n238 best speed-up is obtained with NNLSHP at depth 3 which required $2 8 . 4 s$ on the CPU for processing \n239 and ran out of memory for larger depth. With a value of 1.913, it is close to the theoretical upper \n240 bound of 2.001. The results show that efficiency, packing factor, and speed-up can be viewed inter \n241 changeably. The amount of time needed to process a sample (a pack of sequences) is barely changed \n242 relative to the un-packed implementation. The packing factor, or the improvement in efficiency, \n243 effectively provide an accurate estimate of the speed-up. GREEDY packing as used in T5 shows \n244 to be quite inefficient and sorted batching (SORT) is highly efficient in avoiding padding but the \n245 resulting different computational graphs cause a major overhead on the IPU that exceeds the benefits \n246 of avoiding the padding. Since we made our algorithm and code public available, results have been \n247 reproduced with a different framework on the Habana Gaudi accelerator $\\mathbb { m }$ and confirmed that our \n248 approach is hardware and software independent giving it a huge advantage over existing approaches. ",
525
+ "bbox": [
526
+ 140,
527
+ 772,
528
+ 825,
529
+ 912
530
+ ],
531
+ "page_idx": 5
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "",
536
+ "bbox": [
537
+ 143,
538
+ 92,
539
+ 825,
540
+ 175
541
+ ],
542
+ "page_idx": 6
543
+ },
544
+ {
545
+ "type": "text",
546
+ "text": "4.2 MLPerf™ phase 2 pretraining setup: learning curves and hyperparameter adjustment ",
547
+ "text_level": 1,
548
+ "bbox": [
549
+ 166,
550
+ 191,
551
+ 813,
552
+ 207
553
+ ],
554
+ "page_idx": 6
555
+ },
556
+ {
557
+ "type": "text",
558
+ "text": "For depth 1 (classic BERT) and NNLSHP with depth 3, we additionally evaluate on the MLPerf™ version 0.7 BERT pre-training benchmark $\\mathbb { \\equiv } \\mathbb { \\ln { \\frac { } { } } }$ . Briefly, this involves training from a standard checkpoint to a masked-language model accuracy of $7 1 . 2 \\%$ using 3 million sequences with a maximum length of 512 tokens (refer to $\\mathbb { \\lVert 1 9 \\rVert }$ for details). Following this standardized benchmark supports reproduction of results even on other systems and makes sure that the reproduction effort is moderate and setup rules are clearly documented. We compare the resulting speed-up as well as the respective learning curves by evaluating the data on a held-out validation dataset. The objective of this additional evaluation is to analyse if convergence behavior is changed by the packing strategy and if the theoretical speed-up can be achieved in practice. ",
559
+ "bbox": [
560
+ 171,
561
+ 217,
562
+ 825,
563
+ 340
564
+ ],
565
+ "page_idx": 6
566
+ },
567
+ {
568
+ "type": "text",
569
+ "text": "259 With packing, we effectively increase the average batch size by the packing factor $( \\approx 2 )$ . However, \n260 with a different batch size, different hyperparameters are required (see Section $\\textcircled { 3 . 3 }$ and there is no \n261 mapping that will generate exact matching of results but only heuristics. In a first comparison, we \n262 use the same hyperparameters when comparing packed and unpacked training except for cutting the \n263 accumulation count by half. This way, we make sure that the batch size is constant on average and \n264 we have the same amount of training steps. In the second comparison, we evaluate our heuristics and \n265 how they compensate the difference in batch size. This setup is more desirable because it is beneficial \n266 to use the hardware to its full potential and cutting the batch size by half usually reduces throughput. \n267 In the third comparison, we compare two optimized setups. In these two cases, packing takes half the \n268 amount of training steps. ",
570
+ "bbox": [
571
+ 140,
572
+ 348,
573
+ 825,
574
+ 486
575
+ ],
576
+ "page_idx": 6
577
+ },
578
+ {
579
+ "type": "text",
580
+ "text": "The learning curves are displayed in Figure 3. In the first setup, we see the curves almost matching perfectly when normalizing by the numbers of samples processed. Differences can be explained by the variation of the number of sequences in the packing batch, and general noise in the training process. Especially after the initial phase, the curves show a near-identical match. The second setup shows bigger differences since changing the batch size and hyperparameters changes the training dynamics. We observe slower convergence early on in training due to the increased batch size. This is expected. The adjustment of the learning rate actually decreases performance probably because we correct for the increased number of sequences already in the modified loss. With the adjustment of the decay parameter of LAMB, we see matching performance at the later training stages. However, it is not feasible to completely recover the early convergence behavior of the smaller batch size by adjusting the hyperparameters. For instance doubling the batch size of unpacked BERT to 3000 and adjusting the LAMB decay parameters leads to more of a slow down in convergence than when running packed BERT with a batch size of 1500 and a packing factor of 2. n practice, our implementations exceeds the estimated 1.913 maximum speed-up. This estimate is based on the reduction in the computational work needed to process the dataset. However, packing the data also reduces the latency of the transferring the data to the device. Figure $3$ shows that the realized total speed-up from packing exceeds $2 x$ . ",
581
+ "bbox": [
582
+ 171,
583
+ 491,
584
+ 825,
585
+ 727
586
+ ],
587
+ "page_idx": 6
588
+ },
589
+ {
590
+ "type": "text",
591
+ "text": "4.2.1 Ablation study ",
592
+ "text_level": 1,
593
+ "bbox": [
594
+ 173,
595
+ 742,
596
+ 326,
597
+ 757
598
+ ],
599
+ "page_idx": 6
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "So far, we have shown that with the introduced adjustments, we can match the accuracy of unpacked BERT. In the following, we analyze in how far the masking adjustment is required. In Figure $\\mathbb { G } ,$ w e can see that without our adjustments, training loss and accuracy worsen drastically and a longer training time does not lead to a recovery. When not adjusting the positional embedding, the loss and accuracy almost match. However, the accuracy stalls at $7 1 . 8 \\%$ and does not reach the target accuracy of $7 2 . 1 \\%$ . So overall, both adjustments are crucial to avoid a reduction in performance. ",
604
+ "bbox": [
605
+ 174,
606
+ 766,
607
+ 825,
608
+ 849
609
+ ],
610
+ "page_idx": 6
611
+ },
612
+ {
613
+ "type": "text",
614
+ "text": "When running packed BERT without the NSP loss but keeping everything else the same in a full training setup, we observed that downstream performance on SQuAD reduced the F1 measure by $1 . 3 1 \\%$ and EM by $1 . 1 5 \\%$ . Hence, we do not consider removing NSP as done in approaches like RoBERTa and T5 as discussed in Section $\\mathbb { I }$ ",
615
+ "bbox": [
616
+ 171,
617
+ 856,
618
+ 823,
619
+ 911
620
+ ],
621
+ "page_idx": 6
622
+ },
623
+ {
624
+ "type": "image",
625
+ "img_path": "images/f251e6396c85c4a9ffa0481df4c6d4f3bf28084e3aa659246ed734677faaf749.jpg",
626
+ "image_caption": [
627
+ "Figure 3: Comparison of learning curves for packed and unpacked processing, where all experiments converged to the target accuracy within the same number of training samples(3 million). [left] same effective batch size (ebs is batch size times packing factor), [middle] different heuristic adjustments of the hyperparameters (batch size 1500 for all runs, such that ebs for packed runs is $1 5 0 0 * 2 ,$ , and [right] realized speed-up from packing (in excess of desired $2 \\mathbf { x }$ ). Further learning curves are provided in Section O. "
628
+ ],
629
+ "image_footnote": [],
630
+ "bbox": [
631
+ 204,
632
+ 90,
633
+ 794,
634
+ 195
635
+ ],
636
+ "page_idx": 7
637
+ },
638
+ {
639
+ "type": "image",
640
+ "img_path": "images/d11ada7143c295cd7896618d424f278596e8f1448d1c34cd448d1ef191abd169.jpg",
641
+ "image_caption": [
642
+ "Figure 4: Comparison of learning curves with and without mask or positional embedding adjustment in our packed BERT approach. The grey accuracy baseline to reach is $7 2 . 1 \\%$ . "
643
+ ],
644
+ "image_footnote": [],
645
+ "bbox": [
646
+ 274,
647
+ 303,
648
+ 722,
649
+ 411
650
+ ],
651
+ "page_idx": 7
652
+ },
653
+ {
654
+ "type": "text",
655
+ "text": "297 4.3 Full pretraining and SQuAD finetuning ",
656
+ "text_level": 1,
657
+ "bbox": [
658
+ 142,
659
+ 479,
660
+ 488,
661
+ 494
662
+ ],
663
+ "page_idx": 7
664
+ },
665
+ {
666
+ "type": "text",
667
+ "text": "298 \n299 \n300 \n301 \n302 \n303 \n304 \n305 \n306 \n307 \n308 \n309 \n310 \n311 \n312 \n313 \n314 \n315 \n316 ",
668
+ "bbox": [
669
+ 140,
670
+ 500,
671
+ 161,
672
+ 771
673
+ ],
674
+ "page_idx": 7
675
+ },
676
+ {
677
+ "type": "text",
678
+ "text": "Packing slightly violates the i.i.d. assumption of data. Thus, we have to check that downstream performance is not impacted by packing. This is especially relevant in a full training setup without a starting checkpoint. To this aim, we show that the packed and unpacked SQuAD 1.1 scores are comparable after a full-pretraining of BERT base and large plus fine-tuning. During pre-training, in order to avoid giving an advantage to packing by further hyperparameter tuning, we reduce the gradient accumulation count for the packed BERT training for phase 1 and phase 2 to match, on average, the total number of sequences that get processed before each weight update. With this approach, we can use the same hyperparameters and number of training steps but process each batch faster by avoiding the processing of padding. This gives a slight disadvantage to the packed run in terms of machine utilization, as explained in Section $3 . 3$ and is different to the speedup analysis in Section $4 . 2 .$ For Phase 2, we use sequence length 384 since longer range attention is not relevant for SQuAD 1.1. The respective speed-ups from packing for BERT base and large are shown in Table $2 { : }$ the realized speed-up, measured as the quotient of the throughputs between the packed and unpacked runs, is slightly lower to the theoretical throughput (i.e. the packing factor) due to the packing overhead. Further learning curves with the loss function and accuracy are provided in Section $\\mathrm { \\bf P }$ For the fine-tuning training on SQuAD 1.1, we do not use packing. The scores, computed as the median of 10 different seeds, are displayed in Table $\\textcircled{3}$ They are comparable to the reference ones in $\\pmb { \\Vert 6 \\Vert }$ : for BERT base (resp. large) the F1 score is reduced by $0 . 2 \\%$ (resp. $0 . 3 \\%$ ) and the EM score increases by $0 . 3 \\%$ (resp. $0 . 0 2 \\%$ ). ",
679
+ "bbox": [
680
+ 169,
681
+ 503,
682
+ 825,
683
+ 767
684
+ ],
685
+ "page_idx": 7
686
+ },
687
+ {
688
+ "type": "table",
689
+ "img_path": "images/7061279deedaf70ac77aec3d4eb25c3142bbff381ea60a97bb874c59fffc54b0.jpg",
690
+ "table_caption": [
691
+ "Table 2: Measured speed-ups in BERT pretraining with packing. "
692
+ ],
693
+ "table_footnote": [],
694
+ "table_body": "<table><tr><td>Model size</td><td>Sequence length</td><td>Packing factor</td><td>Realized speed-up</td></tr><tr><td rowspan=\"2\">base</td><td>128</td><td>1.17</td><td>1.15</td></tr><tr><td>384</td><td>1.70</td><td>1.68</td></tr><tr><td rowspan=\"2\">large</td><td>128</td><td>1.17</td><td>1.15</td></tr><tr><td>384</td><td>1.70</td><td>1.69</td></tr></table>",
695
+ "bbox": [
696
+ 178,
697
+ 815,
698
+ 475,
699
+ 904
700
+ ],
701
+ "page_idx": 7
702
+ },
703
+ {
704
+ "type": "table",
705
+ "img_path": "images/8f91e0407a7a3ab252437d1c71859262ebccbf2e45de7763bdb2c27df35cb21f.jpg",
706
+ "table_caption": [
707
+ "Table 3: SQuAD 1.1 scores after BERT pretraining with packing. "
708
+ ],
709
+ "table_footnote": [],
710
+ "table_body": "<table><tr><td>Model size</td><td>Configuration</td><td>F1</td><td>Exact match</td></tr><tr><td>base</td><td>回 Packed</td><td>88.5 88.32</td><td>80.8 81.03</td></tr><tr><td>large</td><td>回 Packed</td><td>90.9 90.65</td><td>84.1 84.12</td></tr></table>",
711
+ "bbox": [
712
+ 498,
713
+ 815,
714
+ 790,
715
+ 904
716
+ ],
717
+ "page_idx": 7
718
+ },
719
+ {
720
+ "type": "text",
721
+ "text": "317 4.4 Scaling analysis: Impact of accelerators count ",
722
+ "text_level": 1,
723
+ "bbox": [
724
+ 142,
725
+ 92,
726
+ 529,
727
+ 106
728
+ ],
729
+ "page_idx": 8
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "318 A further advantage of packing over competing un-padding approaches is the inherent load balancing \n319 provided by packing. So called un-padding approaches rely on dynamically launching custom kernels \n320 that ignore padding. A stated advantage of such implementations is the ability to avoid computing \n321 the complete $( 5 1 2 \\mathrm { ~ x ~ } 5 1 2 )$ ) attention matrix. This provides additional computational savings compared \n322 to packing, where the attention matrix is computed in its entirety and then masked. Because of \n323 these additional savings, un-padding can exceed the theoretical upper bound for speed-up from \n324 packing (2.013 on Wikipedia). As a result of the dynamic nature of the approach, the processing \n325 time with un-padding is different for each sequence in the batch, and the amount of time required to \n326 process a batch of sequences will be determined by the processing time of the longest sequence in \n327 the batch (with the sequences being processed in parallel). Furthermore, in the multiple accelerator \n328 setting the processing time on each device will vary depending on the sequences in the batch that it \n329 receives. Devices which finish early have to wait for the slowest device to finish before exchanging \n330 gradients. This load-imbalance between the devices (and inside the batch) leads to a considerable \n331 decrease in the speed-up from un-padding as the number of accelerators is increased (see Figure $5$ \n332 and Section E [1]). In contrast, packing (our approach) is inherently load-balanced. The processing \n333 time on each accelerator is independent of the content inside the batch received by the device. Any \n334 number of accelerators can therefore operate in unison without having to wait for the slowest batch to \n335 process (all per-device batches are equally fast). ",
734
+ "bbox": [
735
+ 138,
736
+ 116,
737
+ 825,
738
+ 366
739
+ ],
740
+ "page_idx": 8
741
+ },
742
+ {
743
+ "type": "image",
744
+ "img_path": "images/c03156afbbc2ee6402b22f7d72edeb38e1a5f626285457de2593566b71cc80a5.jpg",
745
+ "image_caption": [
746
+ "Figure 5: Comparison of the theoretical speed-up as the number of accelerators is increased. "
747
+ ],
748
+ "image_footnote": [],
749
+ "bbox": [
750
+ 338,
751
+ 380,
752
+ 658,
753
+ 487
754
+ ],
755
+ "page_idx": 8
756
+ },
757
+ {
758
+ "type": "text",
759
+ "text": "336 5 Conclusion ",
760
+ "text_level": 1,
761
+ "bbox": [
762
+ 143,
763
+ 541,
764
+ 299,
765
+ 558
766
+ ],
767
+ "page_idx": 8
768
+ },
769
+ {
770
+ "type": "text",
771
+ "text": "Whereas packing is a well known concept, this paper sheds a new light onto it in multiple aspects. First, we visualize the sequence length distributions of multiple datasets not just from language domains but also audio and molecular domains to emphasize that packing is beneficial for a lot of datasets and that in many cases, more than $2 \\mathbf { x }$ acceleration can be achieved by removing $5 0 \\%$ or more padding. Second, we provide two new highly efficient packing approaches based on established solvers that leave almost no padding and that can tackle arbitrarily large datasets in a matter of seconds, in contrast to existing approaches that are slow and suboptimal. Third, we demonstrate that without adjusting the sequence processing algorithm (e.g., BERT) to the packed sequences, predictive performance is reduced. Thus, we propose several model adjustments that are all necessary to keep predictive performance. Last but not least, we prove that, thanks to such adjustments, predictive performance is preserved as if no packing was used — but speed significantly increases, especially since the adjustments come with an overhead of less than $5 \\%$ . We prove in our experiments that downstream performance is not impacted by packing and that the anticipated $2 \\mathbf { x }$ acceleration can be achieved. ",
772
+ "bbox": [
773
+ 166,
774
+ 573,
775
+ 825,
776
+ 766
777
+ ],
778
+ "page_idx": 8
779
+ },
780
+ {
781
+ "type": "text",
782
+ "text": "351 In the future, an interesting direction is the packing of images of different sizes to help accelerate \n352 computer-vision applications. This is especially relevant given the recent advances in the use of \n353 transformer-based approaches in the computer vision domain, for example the visual transformer $\\pmb { \\mathbb { B 3 } }$ . \n354 Note that many images come in different shapes and resolutions and packing them can be a new \n355 approach to tackle this diversity instead of casting them all to the same resolution and shape. Masking \n356 out the self-attention within transformers is easier to implement than avoiding cross-contamination of \n357 convolutions applied to packed images. Future work should explore improving the performance of \n358 other models (RoBERTa, GPT-3, T5) by avoiding contamination between non-contiguous segments \n359 from different documents. Even BERT itself might benefit from avoiding contamination between the \n360 two concatenated segments. ",
783
+ "bbox": [
784
+ 140,
785
+ 772,
786
+ 825,
787
+ 911
788
+ ],
789
+ "page_idx": 8
790
+ },
791
+ {
792
+ "type": "text",
793
+ "text": "",
794
+ "text_level": 1,
795
+ "bbox": [
796
+ 156,
797
+ 90,
798
+ 267,
799
+ 106
800
+ ],
801
+ "page_idx": 9
802
+ },
803
+ {
804
+ "type": "text",
805
+ "text": "361 References \n362 [1] ANONYMOUS. Supplemental Material for “Efficient Sequence Packing without Cross-contamination: \n363 Accelerating Large Language Models without Impacting Performance’, 2022. \n364 [2] BOTTOU, L., CURTIS, F. E., AND NOCEDAL, J. Optimization Methods for Large-Scale Machine Learning. \n365 SIAM Review 60, 2 (jan 2018), 223–311. \n366 [3] BRO, R., AND DE JONG, S. A fast non-negativity-constrained least squares algorithm. Journal of \n367 Chemometrics 11, 5 (sep 1997), 393–401. \n368 [4] BROWN, T. B., MANN, B., RYDER, N., SUBBIAH, M., KAPLAN, J., DHARIWAL, P., NEELAKANTAN, \n369 A., SHYAM, P., SASTRY, G., ASKELL, A., AGARWAL, S., HERBERT-VOSS, A., KRUEGER, G., \n370 HENIGHAN, T., CHILD, R., RAMESH, A., ZIEGLER, D. M., WU, J., WINTER, C., HESSE, C., CHEN, \n371 M., SIGLER, E., LITWIN, M., GRAY, S., CHESS, B., CLARK, J., BERNER, C., MCCANDLISH, S., \n372 RADFORD, A., SUTSKEVER, I., AND AMODEI, D. Language Models are Few-Shot Learners. In Advances \n373 in Neural Information Processing Systems 33 pre-proceedings (NeurIPS 2020) (may 2020). \n374 [5] BYTEDANCE INC. Effective Transformer. https://github.com/bytedance/effective_ \n375 transformer, 2021. \n376 [6] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. BERT: Pre-training of deep bidirectional \n377 transformers for language understanding. NAACL HLT 2019 - 2019 Conference of the North American \n378 Chapter of the Association for Computational Linguistics: Human Language Technologies - Proceedings \n379 of the Conference 1 (oct 2019), 4171–4186. \n380 [7] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. BERT: Pre-training of Deep Bidirectional \n381 Transformers for Language Understanding. https://github.com/google-research/bert, 2019. \n382 [8] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. Pre-training data creation script \n383 for BERT. https://github.com/google-research/bert/blob/master/create_pretraining_ \n384 data.py#L243, 2019. \n385 [9] FEDUS, W., ZOPH, B., AND SHAZEER, N. Switch Transformers: Scaling to Trillion Parameter Models \n386 with Simple and Efficient Sparsity. arXiv (jan 2021). \n387 [10] INTEL, 2021. \n388 [11] JIA, Z., TILLMAN, B., MAGGIONI, M., AND SCARPAZZA, D. P. Dissecting the Graphcore IPU \n389 architecture via microbenchmarking. ArXiv abs/1912.03413 (2019). \n390 [12] JOHNSON, D. S. Near-optimal bin packing algorithms. PhD thesis, Massachusetts Institute of Technology, \n391 1973. \n392 [13] JOHNSON, D. S., AND GAREY, M. R. A 7160 theorem for bin packing. Journal of Complexity 1, 1 (oct \n393 1985), 65–106. \n394 [14] KORTE, B., AND VYGEN, J. Combinatorial Optimization, vol. 21 of Algorithms and Combinatorics. \n395 Springer Berlin Heidelberg, Berlin, Heidelberg, 2012. \n396 [15] LEE, C. C., AND LEE, D. T. A Simple On-Line Bin-Packing Algorithm. Journal of the ACM (JACM) 32, \n397 3 (jul 1985), 562–572. \n398 [16] LIU, Y., OTT, M., GOYAL, N., DU, J., JOSHI, M., CHEN, D., LEVY, O., LEWIS, M., ZETTLEMOYER, \n399 L., AND STOYANOV, V. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv (jul 2019). \n400 [17] MATTSON, P., REDDI, V. J., CHENG, C., COLEMAN, C., DIAMOS, G., KANTER, D., MICIKEVICIUS, \n401 P., PATTERSON, D., SCHMUELLING, G., TANG, H., WEI, G., AND WU, C. MLPerf: An Industry \n402 Standard Benchmark Suite for Machine Learning Performance. IEEE Micro 40, 2 (2020), 8–16. \n403 [18] MENG, Q., CHEN, W., WANG, Y., MA, Z. M., AND LIU, T. Y. Convergence analysis of distributed \n404 stochastic gradient descent with shuffling. Neurocomputing 337 (apr 2019), 46–57. \n405 [19] MLCOMMONS. v0.7 Results. https://mlcommons.org/en/training-normal-07/, 2020. Result \n406 not verified by MLPerf. Throughput/speedup is not the primary metric of MLPerf. MLPerf name and logo \n407 are trademarks. See www.mlperf.org for more information. \n408 [20] NVIDIA. Reference numbers for BERT un-padding results. https://github.com/mlcommons/ \n409 training_results_v0.7/blob/master/NVIDIA/results/dgxa100_ngc20.06_pytorch/bert/ \n410 result_0.txt, 2020. Throughput/speedup is not the primary metric of MLPerf. MLPerf name and logo \n411 are trademarks. See www.mlperf.org for more information. \n412 [21] NVIDIA. Faster Transformer. https://github.com/NVIDIA/DeepLearningExamples/tree/ \n413 master/FasterTransformer/v1, 2021. \n414 [22] OTT, M., EDUNOV, S., BAEVSKI, A., FAN, A., GROSS, S., NG, N., GRANGIER, D., AND AULI, \n415 M. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: \n416 Demonstrations (2019). \n417 [23] PANAYOTOV, V., CHEN, G., POVEY, D., AND KHUDANPUR, S. Librispeech: an asr corpus based on \n418 public domain audio books. In Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE International \n419 Conference on (2015), IEEE, pp. 5206–5210. \n420 [24] RAFFEL, C., SHAZEER, N., ROBERTS, A., LEE, K., NARANG, S., MATENA, M., ZHOU, Y., LI, W., \n421 AND LIU, P. J. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. Journal \n422 of Machine Learning Research 21 (oct 2019). \n423 [25] RAJPURKAR, P., ZHANG, J., LOPYREV, K., AND LIANG, P. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine \n424 comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language \n425 Processing (Austin, Texas, Nov. 2016), Association for Computational Linguistics, pp. 2383–2392. \n426 [26] RAMAKRISHNAN, R., DRAL, P. O., RUPP, M., AND VON LILIENFELD, O. A. Quantum chemistry \n427 structures and properties of 134 kilo molecules. Scientific Data 1 (2014). \n428 [27] RUDDIGKEIT, L., VAN DEURSEN, R., BLUM, L. C., AND REYMOND, J.-L. Enumeration of 166 billion \n429 organic small molecules in the chemical universe database gdb-17. Journal of Chemical Information and \n430 Modeling 52, 11 (2012), 2864–2875. PMID: 23088335. \n431 [28] SHEN, J., NGUYEN, P., WU, Y., CHEN, Z., ET AL. Lingvo: a modular and scalable framework for \n432 sequence-to-sequence modeling, 2019. \n433 [29] VASWANI, A., SHAZEER, N., PARMAR, N., USZKOREIT, J., JONES, L., GOMEZ, A. N., KAISER, U., \n434 AND POLOSUKHIN, I. Attention is all you need. In Proceedings of the 31st International Conference on \n435 Neural Information Processing Systems (Red Hook, NY, USA, 2017), NIPS’17, Curran Associates Inc., \n436 p. 6000–6010. \n437 [30] WANG, A., SINGH, A., MICHAEL, J., HILL, F., LEVY, O., AND BOWMAN, S. GLUE: A multi-task \n438 benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP \n439 Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP (Brussels, Belgium, Nov. \n440 2018), Association for Computational Linguistics, pp. 353–355. \n441 [31] WARSTADT, A., SINGH, A., AND BOWMAN, S. R. Neural network acceptability judgments. arXiv \n442 preprint arXiv:1805.12471 (2018). \n443 [32] WOLF, T., DEBUT, L., SANH, V., CHAUMOND, J., DELANGUE, C., MOI, A., CISTAC, P., RAULT, T., \n444 LOUF, R., FUNTOWICZ, M., DAVISON, J., SHLEIFER, S., VON PLATEN, P., MA, C., JERNITE, Y., PLU, \n445 J., XU, C., SCAO, T. L., GUGGER, S., DRAME, M., LHOEST, Q., AND RUSH, A. M. Transformers: State \n446 of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in \n447 Natural Language Processing: System Demonstrations (Online, Oct. 2020), Association for Computational \n448 Linguistics, pp. 38–45. \n449 [33] WU, B., XU, C., DAI, X., WAN, A., ZHANG, P., YAN, Z., TOMIZUKA, M., GONZALEZ, J., KEUTZER, \n450 K., AND VAJDA, P. Visual transformers: Token-based image representation and processing for computer \n451 vision, 2020. \n452 [34] XLA, T. XLA: Optimizing Compiler for Machine Learning. https://www.tensorflow.org/xla, \n453 2021. \n454 [35] YOU, Y., LI, J., REDDI, S., HSEU, J., KUMAR, S., BHOJANAPALLI, S., SONG, X., DEMMEL, J., \n455 KEUTZER, K., AND HSIEH, C.-J. Large Batch Optimization for Deep Learning: Training BERT in 76 \n456 minutes. arXiv (apr 2019). \n457 [36] YUE, M., AND ZHANG, L. A simple proof of the inequality $M F F D ( L ) \\leq 7 1 / 6 0 O P T ( L ) + 1 , L$ for \n458 the MFFD bin-packing algorithm. Acta Mathematicae Applicatae Sinica $^ Ḋ I I Ḍ$ , 3 (jul 1995), 318–330. ",
806
+ "bbox": [
807
+ 138,
808
+ 95,
809
+ 828,
810
+ 920
811
+ ],
812
+ "page_idx": 9
813
+ },
814
+ {
815
+ "type": "text",
816
+ "text": "",
817
+ "bbox": [
818
+ 137,
819
+ 69,
820
+ 828,
821
+ 914
822
+ ],
823
+ "page_idx": 10
824
+ },
825
+ {
826
+ "type": "text",
827
+ "text": "1. For all authors... ",
828
+ "bbox": [
829
+ 214,
830
+ 114,
831
+ 339,
832
+ 128
833
+ ],
834
+ "page_idx": 11
835
+ },
836
+ {
837
+ "type": "text",
838
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] Our paper has four main claims. First, in Figure $^ 1$ we show the sequence length distribution of Wikipedia and many other datasets and the excessive padding that they require. Second, in Section $4 . { \\dot { 1 } } ,$ we show that we can efficiently pack the data which can be easily reproduced with the shared data and code [1]. Third, in Figure 3[right], we clearly show the $2 \\mathbf { x }$ performance gain from packing and the related hyperparameter adjustment scheme. Fourth, multiple additional experiments on downstream tasks, ablation studies, and packing variants further verify the validity of our proposed approaches. ",
839
+ "bbox": [
840
+ 238,
841
+ 132,
842
+ 825,
843
+ 257
844
+ ],
845
+ "page_idx": 11
846
+ },
847
+ {
848
+ "type": "text",
849
+ "text": "(b) Did you describe the limitations of your work? [Yes] We see three potential limitations that we discuss in the paper. First, as stated in Section $\\mathbf { A }$ “Broader Impact” in the appendix [1], our approach is clearly dependent on the sequence length distribution of the dataset. However, we looked into several other datasets beyond Wikipedia and observed even higher potential for acceleration and document this in multiple sections throughout the paper as well as in the appendix [1]. Second, we explain our focus on the IPU hardware in Section $\\boxed { 4 . 1 }$ Our theoretical analysis in Section $\\boxed { 4 . 4 }$ indicates that our approach benefits also GPUs. We also cite other work, that shows that our approach is hardware independent. Third, our changes to the network with a modified attention mask and loss calculation come with some overhead. This is addressed in Table 1 [overhead column] in Section 4.1. ",
850
+ "bbox": [
851
+ 238,
852
+ 258,
853
+ 825,
854
+ 410
855
+ ],
856
+ "page_idx": 11
857
+ },
858
+ {
859
+ "type": "text",
860
+ "text": "(c) Did you discuss any potential negative societal impacts of your work? [Yes] We address this point in Section $\\mathbf { \\bar { A } }$ “Broader Impact”, third paragraph, in the appendix [1]. ",
861
+ "bbox": [
862
+ 240,
863
+ 411,
864
+ 823,
865
+ 439
866
+ ],
867
+ "page_idx": 11
868
+ },
869
+ {
870
+ "type": "text",
871
+ "text": "(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
872
+ "bbox": [
873
+ 238,
874
+ 440,
875
+ 821,
876
+ 468
877
+ ],
878
+ "page_idx": 11
879
+ },
880
+ {
881
+ "type": "text",
882
+ "text": "2. If you are including theoretical results... ",
883
+ "bbox": [
884
+ 215,
885
+ 472,
886
+ 493,
887
+ 486
888
+ ],
889
+ "page_idx": 11
890
+ },
891
+ {
892
+ "type": "text",
893
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [Yes] Detailed algorithm explanations, clarifications of assumptions, and proofs are provided in the supplemental material [1]. \n(b) Did you include complete proofs of all theoretical results? [Yes] Sections D, E, and G in the supplemental material [1] provide the necessary derivations on theoretical results. ",
894
+ "bbox": [
895
+ 236,
896
+ 489,
897
+ 825,
898
+ 573
899
+ ],
900
+ "page_idx": 11
901
+ },
902
+ {
903
+ "type": "text",
904
+ "text": "3. If you ran experiments... ",
905
+ "bbox": [
906
+ 214,
907
+ 578,
908
+ 393,
909
+ 592
910
+ ],
911
+ "page_idx": 11
912
+ },
913
+ {
914
+ "type": "text",
915
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] All packing code is provided in the paper. The packing results on BERT got verified by multiple independent parties. One party used a draft of this paper to successfully reproduce its main findings. Links to implementations in three different frameworks will be provided after acceptance, to avoid violating the blind submission rules. ",
916
+ "bbox": [
917
+ 240,
918
+ 595,
919
+ 825,
920
+ 678
921
+ ],
922
+ "page_idx": 11
923
+ },
924
+ {
925
+ "type": "text",
926
+ "text": "(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] In the first part, we follow the MLPerf 0.7 benchmark rules. We document the parameters that we changed and why we change them. For the downstream tasks, we follow the reference and report where, how and why we change hyperparameters. ",
927
+ "bbox": [
928
+ 238,
929
+ 680,
930
+ 823,
931
+ 747
932
+ ],
933
+ "page_idx": 11
934
+ },
935
+ {
936
+ "type": "text",
937
+ "text": "(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] The packing algorithms are deterministic and have no error. Other experiments are only executed once to compare convergence curves. For downstream tasks, we report repetition details and the median as in the reference. ",
938
+ "bbox": [
939
+ 238,
940
+ 751,
941
+ 823,
942
+ 805
943
+ ],
944
+ "page_idx": 11
945
+ },
946
+ {
947
+ "type": "text",
948
+ "text": "(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We used 16 Graphcore Mk2 IPUs for acceleration on an internal cluster. ",
949
+ "bbox": [
950
+ 238,
951
+ 808,
952
+ 823,
953
+ 848
954
+ ],
955
+ "page_idx": 11
956
+ },
957
+ {
958
+ "type": "text",
959
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
960
+ "bbox": [
961
+ 218,
962
+ 852,
963
+ 823,
964
+ 866
965
+ ],
966
+ "page_idx": 11
967
+ },
968
+ {
969
+ "type": "text",
970
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] Appropriate references to the BERT authors, all datasets, and the code snippet from the HugginFace inc. are appropriately referenced with citations and links. ",
971
+ "bbox": [
972
+ 240,
973
+ 869,
974
+ 823,
975
+ 911
976
+ ],
977
+ "page_idx": 11
978
+ },
979
+ {
980
+ "type": "text",
981
+ "text": "(b) Did you mention the license of the assets? [Yes] For the only taken code snippet, the license is part of the file [Listing 7 in $\\mathbb { I I I }$ . Dataset licenses like Wikipedia’s “Creative Commons Attribution-ShareAlike 3.0 License” are covered by the references. New materials like packing code and histograms will be provided under an MIT license which will be added over a link to the resources in the final paper version. \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] New materials like packing code and histograms are included in the supplement document as well as separate file. To avoid violating the blind submission rules, they will be linked in the final version like many other assets which are already publicly available under MIT license. \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] We did not curate other people’s data. We only provide a very high level aggregate of the used data. \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We did not curate other people’s data. ",
982
+ "bbox": [
983
+ 236,
984
+ 92,
985
+ 825,
986
+ 306
987
+ ],
988
+ "page_idx": 12
989
+ },
990
+ {
991
+ "type": "text",
992
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
993
+ "bbox": [
994
+ 214,
995
+ 310,
996
+ 705,
997
+ 325
998
+ ],
999
+ "page_idx": 12
1000
+ },
1001
+ {
1002
+ "type": "text",
1003
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] Our experiments did not include crowdsourcing or human subjects. \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] Our experiments did not include crowdsourcing or human subjects. \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] Our experiments did not include crowdsourcing or human subjects. ",
1004
+ "bbox": [
1005
+ 238,
1006
+ 329,
1007
+ 826,
1008
+ 445
1009
+ ],
1010
+ "page_idx": 12
1011
+ }
1012
+ ]
parse/dev/e2M4CNa-UOS/e2M4CNa-UOS_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/e2M4CNa-UOS/e2M4CNa-UOS_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/fcO9Cgn-X-R/fcO9Cgn-X-R.md ADDED
@@ -0,0 +1,344 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Capturing Failures of Large Language Models via Human Cognitive Biases
2
+
3
+ Erik Jones UC Berkeley erjones@berkeley.edu
4
+
5
+ Jacob Steinhardt UC Berkeley jsteinhardt@berkeley.edu
6
+
7
+ # Abstract
8
+
9
+ Large language models generate complex, open-ended outputs: instead of outputting a class label they write summaries, generate dialogue, or produce working code. In order to asses the reliability of these open-ended generation systems, we aim to identify qualitative categories of erroneous behavior, beyond identifying individual errors. To hypothesize and test for such qualitative errors, we draw inspiration from human cognitive biases—systematic patterns of deviation from rational judgement. Specifically, we use cognitive biases as motivation to (i) generate hypotheses for problems that models may have, and (ii) develop experiments that elicit these problems. Using code generation as a case study, we find that OpenAI’s Codex errs predictably based on how the input prompt is framed, adjusts outputs towards anchors, and is biased towards outputs that mimic frequent training examples. We then use our framework to elicit high-impact errors such as incorrectly deleting files. Our results indicate that experimental methodology from cognitive science can help characterize how machine learning systems behave.1
10
+
11
+ # 1 Introduction
12
+
13
+ Recent large language models have achieved new, exciting capabilities. In contrast to traditional classifiers, these models can generate open-ended text, enabling use cases like summarization [Stiennon et al., 2020], dialog [Thoppilan et al., 2022], and code generation [Chen et al., 2021]
14
+
15
+ The open-ended power of these systems, however, poses new reliability challenges. We must understand not only when systems err, but also the kinds of errors they make, as some errors are much more costly than others. For example, erroneous code that does not compile is less dangerous than code that deletes all files in the home directory. Studying how frequently an error occurs is difficult, as the same error (e.g. delete all files) can appear in a wide range of syntactically diverse outputs. In order to better reason about how complex systems err, we need methods to test whether systems make the same qualitative error across different prompts, even when the generated outputs differ.
16
+
17
+ To study these reliability challenges, we primarily focus on code generation models. Such models complete programs from comments, descriptions of code functionality, or initial lines of code. Code generation is particularly amenable to study since it is objective: generated solutions are unambiguously correct or incorrect. Yet it is also open-ended: the set of programs a model could output is arbitrarily large, so the rate at which a specific program is outputted is not very descriptive.
18
+
19
+ Many of the reliability challenges posed by code generation models, and open-ended systems broadly, also arise when studying qualitative failures in human decision making. These failures, called cognitive biases, are systematic ways in which humans deviate from rational judgment [Tversky and Kahneman, 1974]. For example, Tversky and Kahneman find that humans inadequately adjust estimates away from initial values, and disproportionately recall distinctive examples. To uncover cognitive biases, Tversky and Kahneman ask questions that are crafted to systematically reveal some qualitative irrationality. They uncover insights into human behavior from the diverse responses, without complete mechanistic insight into the minds that they aim to analyze.
20
+
21
+ ![](images/b810734399a6a31fa69f1d979a6e552103d7ab86daa2ba2d29853274d717cdaf.jpg)
22
+ Figure 1: Illustration of our experimental framework. We use a cognitive bias (framing effect) to inspire a potential code generation failure mode (relying on irrelevant information). We then transform inputs in a way that we suspect will elicit the failure mode (prepending sum). We evaluate whether the modifications lower accuracy, and if the output is an instance of the targeted failure mode.
23
+
24
+ In this work, we extend Tversky and Kahneman’s experimental methodology and results to elicit failure modes of large code and language models, without relying on complete mechanistic insight into their behavior (Figure 1). Given a potential failure mode (e.g. relying on irrelevant information in the input), we construct a transformation over inputs that largely preserves semantics, but that we suspect will elicit the failure (e.g. prepending an irrelevant function). We first test if the model is sensitive to the transformation, by measuring if it decreases accuracy. Then, we check that the model outputs have elements that are indicative of the targeted failure (e.g. copies the irrelevant function).
25
+
26
+ We draw on four different cognitive biases to hypothesize potential failures of OpenAI’s Codex [Chen et al., $\boxed { 2 0 2 1 }$ and Salesforce’s CodeGen $[ [ \mathrm { N i j k a m p ~ e t ~ a l . } ] [ \overline { { 2 0 2 2 } } ] ]$ , then apply our framework to each. Our results indicate that these models often rely on irrelevant information when generating solutions, adjust solutions towards related-but-incorrect solutions, are biased based on training-set frequencies, and reverts to computationally simpler problems when faced with a complex calculation. We also apply our framework to OpenAI’s GPT-3 [Brown et al., 2020], and show that it updates its predictions towards anchors, and predictably adjusts its responses based on the question framing.
27
+
28
+ Finally, we show that our framework can uncover high-impact errors: errors that are harmful and difficult to undo. Specifically, we use our framework to systematically generate prompts where Codex erroneously deletes files. Our results indicate that experimental methodology from cognitive science can help uncover failure modes of complex machine learning systems.
29
+
30
+ # 2 Related Work
31
+
32
+ Large language models. Recent work has developed large, capable, autoregressive language models, which predict future tokens from past tokens [Radford et al., 2019, Wang and Komatsuzaki, 2021, Brown et al., 2020, Chen et al., 2021, Rae et al., 2021]. These models can be used for open-ended generation tasks such as summarization [Stiennon et al., 2020, Ziegler et al., 2019, Rothe et al., 2020], dialogue [Ram et al., 2018, Thoppilan et al., 2022], and long form question answering [Fan et al., 2019] , among others. Model-generated code has been used to solve both programming and statistics questions [Chen et al., 2021, Tang et al., 2021].
33
+
34
+ There is some existing work studying failures of large language models. Benchmarks that measure model performance on multiple choice questions [Wang et al., 2019b,a, Hendrycks et al., 2021b], mathematics [Hendrycks et al., 2021c, Cobbe et al., 2021], long-form question answering [Lin et al., 2021, Gabriel et al., 2021, Shuster et al., 2021, Krishna et al., 2021], and coding problems [Hendrycks et al., 2021a, Chen et al., 2021] reveal inputs that the model errs on, but not the kind of error it makes. Another line of work shows that test-based language models can internalize bias and stereotypes [Sheng et al., 2019, Nadeem et al., 2020, Groenwold et al., 2020, Blodgett et al., 2021, Gehman et al., 2020], and proposes applying fairness measurements from cognitive social sciences to machine learning systems [Jacobs and Wallach, 2021]. Some work adversarially prompts models to leak training data [Carlini et al., 2020], or output specific content [Wallace et al., 2019, Carlini et al., $\boxed { 2 0 2 0 } ]$ . And a final line of work identifies additional potential failures of current and future machine learning systems [Bender et al., 2021, Bommasani et al., 2021, Weidinger et al., 2021].
35
+
36
+ ![](images/b0ac32b01cb78509c5227342d766cad25cb336596ed9fdc4bd31985e4f6b5b89.jpg)
37
+ Figure 2: Left. Example of a HumanEval problem from Chen et al. [2021] . The problem contains a prompt (blue), a canonical solution to the prompt (green), and a few test-cases (black). The prompt contains two components: a function signature (first line), and a docstring (remaining lines). Right. Illustration of our framing experiment. The transformed prompt (everything above the black line) contains an irrelevant preceding function (IPF) prepended to a prompt from HumanEval (blue). The IPF contains a randomly chosen prompt from HumanEval (purple) and a framing line (red). The output Codex generates (below the black line) matches the framing line. When we omit the random HumanEval prompt and the framing line (leaving only blue), Codex produces the correct output.
38
+
39
+ Cognitive biases. Tversky and Kahneman [1974] define human cognitive biases: systematic patterns of deviation from rational judgment. They observe that humans employ heuristics when computing probabilities or assessing values, and that these heuristics lead to predictable errors. Follow-up work has added to, refined, and validated the set of known cognitive biases [Tversky and Kahneman, 1973, 1981, Strack et al., 1988, Kahneman and Frederick, 2002, Windhager et al., 2010, Meyer, 2014].
40
+
41
+ Some known failure modes of large language models resemble cognitive biases. Zhao et al. [2021] and Liu et al. [2021] show that the specific random samples used for few-shot learning can change GPT-3’s prediction on binary and multiple choice tasks. Similarly, Wallace et al. [2019] show that innocuous prompts can routinely generate toxic model output. Our framework builds on this work by (i) identifying the link to cognitive biases, (ii) focusing on open-ended generation, and (iii) leveraging Tversky and Kahneman’s experimental methodology to elicit qualitative failure modes.
42
+
43
+ # 3 Code Generation Experiments
44
+
45
+ # 3.1 Models
46
+
47
+ We study two code models: OpenAI’s Codex [Chen et al., 2021], and Salesforce’s CodeGen. [Nijkamp et al., 2022]. Both models are autoregressive—given a sequence of previous tokens, they predict the next token. Practitioners query these code models with partial programs, docstrings, or function signatures, and obtain completions as output.
48
+
49
+ Codex. We study OpenAI’s Codex, a large language model trained to generate code from docstrings [Chen et al., 2021]. We use the OpenAI API to query the “davinci-001” version of Codex, and use greedy decoding to generate solutions. Details of this model architecture are not public, but it is likely similar to the largest model from Chen et al. [2021]: a 12B parameter version of GPT-3 [Brown et al., 2020] that is fine-tuned on GitHub instead of the CommonCrawl.
50
+
51
+ CodeGen. We additionally study the 6.2 billion parameter “mono” version of CodeGen, which is trained on text data and fine-tuned on GitHub. Unlike Codex, the weights of CodeGen are publicly available,2 so we run inference locally. We use greedy decoding to generate solutions.
52
+
53
+ # 3.2 Benchmarks
54
+
55
+ In order to identify whether code models some failure mode, we need to generate prompts that elicit that failure. To do so, we systematically apply transformations to standard prompts. We use two benchmarks as sources of prompts to transform: HumanEval, and MathEquations.
56
+
57
+ <table><tr><td>Framing Line</td><td>Model</td><td>ORIGINAL</td><td>FRAMED</td><td>ORIGINAL</td><td>FRAMED</td></tr><tr><td rowspan="2">raise NotImplemented</td><td>CODEX</td><td>32.9</td><td>2.4</td><td>1.4</td><td>91.7</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>1.5</td><td>0.0</td><td>79.3</td></tr><tr><td rowspan="2">pass</td><td>CoDEX</td><td>32.9</td><td>3.0</td><td>9.7</td><td>92.7</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>2.1</td><td>0.0</td><td>78.7</td></tr><tr><td rowspan="2">assert False</td><td>CODEX</td><td>32.9</td><td>3.3</td><td>0.0</td><td>92.7</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>4.2</td><td>0.1</td><td>72.6</td></tr><tr><td rowspan="2">return False</td><td>CODEX</td><td>32.9</td><td>4.9</td><td>11.5</td><td>65.6</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>3.6</td><td>0.0</td><td>64.6</td></tr><tr><td rowspan="2">print(&quot;Hello world!&quot;)</td><td>CODEX</td><td>32.9</td><td>10.6</td><td>0.0</td><td>62.2</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>11.0</td><td>0.0</td><td>58.2</td></tr></table>
58
+
59
+ Table 1: Results of the framing experiments. We compare functional accuracy and the rate at which framing line is outputted over HumanEval with (framed) and without (original) irrelevant preceding functions. We find that the irrelevant preceding functions lower functional accuracy across all framing lines for Codex and CodeGen. Moreover, we find that the outputted function often appears verbatim in the generated output, suggesting that both models rely on irrelevant information in the prompt.
60
+
61
+ HumanEval. We use the HumanEval benchmark as a diverse source of “normal” prompts [Chen et al., $\boxed { 2 0 2 1 }$ . HumanEval contains 164 programming problems, each of which includes a function signature and a docstring. The docstring contains an English description of the desired functionality and a few example input-output pairs. HumanEval also contains a canonical solution for each program, which we use in Section $\underline { { \bar { \vert 3 . 3 . 2 \vert } } }$ We give an example problem from HumanEval in Figure 2.
62
+
63
+ MathEquations. We also curate a set of prompts of basic arithmetic functions. For example, we prompt Codex to “Write a function that sums the squares of its inputs”, or “Write a function that sums its inputs called product_plus_five”. Further details are given in Sections 3.3.3 an 3.3.4.
64
+
65
+ # 3.3 Empirical results
66
+
67
+ In this section, we show how cognitive biases can (i) inspire hypotheses for potential failure modes, and (ii) help us design experiments to test these hypotheses. Our approach has three steps. First, we construct a transformation over prompts that largely preserves semantics, but that we suspect will elicit a specific cognitive-bias-inspired failure mode. Next, we measure if code models are sensitive to the transformation, by measuring the decrease in accuracy. And finally, we check that the generated output has elements that are indicative of the targeted failure mode. Our approach mirrors the high-level methodology from Tversky and Kahneman [1974]; we empirically elicit specific failure modes using targeted prompts, without complete mechanistic insight into the system that we study.
68
+
69
+ We draw inspiration from four cognitive biases: the framing effect (Tversky and Kahneman [1981] Section 3.3.1), anchoring (Tversky and Kahneman [1974]; Section $\underline { { \overline { { | 3 . 3 . 2 ) } } } }$ , the availability heuristic (Tversky and Kahneman [1973]; Section 3.3.3), and attribute substitution (Kahneman and Frederick [2002]; Section 3.3.4).
70
+
71
+ # 3.3.1 Inspiration: Framing effect
72
+
73
+ We first draw inspiration from the framing effect: predictable shifts in human responses when the same problem is framed in different ways [Tversky and Kahneman, 1981]. In their study identifying the effect, Tversky and Kahneman [1981] find that subjects favor certainly saving 200 people over saving 600 with probability $\overline { { 1 / 3 } }$ , yet prefer losing 600 with probability 2/3 over certainly losing 400 (even though these are equivalent). At its core, the framing effect shows how humans can rely on semantically irrelevant information when they make decisions.
74
+
75
+ Using the framing effect as inspiration, we hypothesize that code generation models may generate solutions exclusively from irrelevant information in the prompt. To elicit this failure, we transform HumanEval prompts by prepending irrelevant preceding functions. Specifically, to generate irrelevant preceding functions, we combine a random prompt from HumanEval with a framing line. We test five framing lines: raise NotImplementedError , pass , assert False , return False , and print("Hello world!") . We first check that prepending these irrelevant preceding functions decreases functional accuracy.3 Next, to test if models relied on irrelevant information in the prompt, we measure how much more frequently the framing line appears verbatim in the generated output.
76
+
77
+ ![](images/3ca12ceac2dfdc76f5b5cb25925443fec2d6975fface7597f9f0a393592f8cfd.jpg)
78
+ Figure 3: Illustration of our anchoring experiment using a real example (expanded in Figure 7). We construct the anchor function (left) by taking the function signature from the HumanEval prompt (blue), appending $n$ lines of the canonical solution (green), then adding anchoring lines (red). We construct the full prompt (center) by combining the anchor function, the original HumanEval prompt, and the first $n$ lines of the canonical solution. The solution Codex generates (right) combines elements of a canonical solution (checks condition and adds to ret.), with the anchor function (for var loop).
79
+
80
+ We report the results of our framing experiments in Table 1. We find that adding irrelevant preceding functions consistently lowers functional accuracy, by between 22.3 and 30.5 points for Codex, across the different framing lines we tested. Moreover, both models frequently generate the framing line: $81 \%$ of the time for Codex and $7 0 . 7 \%$ of time for CodeGen, compared to only $4 . 5 \%$ and $0 . 0 \%$ over untransformed prompts respectively. These results suggest that code generation models can erroneously rely on irrelevant information in the prompt in predictable ways, even in the extreme case when doing so contradicts the type specification in the function signature (return False ).
81
+
82
+ # 3.3.2 Inspiration: Anchoring
83
+
84
+ We next draw inspiration from anchoring: humans’ tendency to insufficiently adjust their estimates away from initial values. For example, Tversky and Kahneman $\mathbb { \underline { { \lVert \mathbf { 9 7 4 } } \rVert } }$ find that subjects’ median estimate for the fraction of African countries in the UN shifts from $2 5 \%$ to $45 \%$ , based on whether they were first asked if the fraction was greater or less than $10 \%$ and $65 \%$ , respectively. Anchoring captures how humans adjust to partial information, versus irrelevant information (framing effect).
85
+
86
+ Using anchoring as inspiration, we hypothesize that code generation models may adjust their output towards related solutions, when these solutions are included in the prompt. To elicit this failure, we prepend anchor functions to prompts: functions that are similar to a valid solution for a HumanEval prompt, but contain some error. We first check that prepending these anchor functions decreases functional accuracy, as in Section $3 . 3 . 1 .$ Next, to test if models adjust their output towards related solutions, we check that the generated solution contains elements of the anchor function.
87
+
88
+ We aim to construct anchor functions that are similar to functions in HumanEval prompts and that compile, but are incorrect. To do so, we take a prefix of the canonical solution, then add additional anchor lines that produce an incorrect output. See Figure $\triangledown$ for an example. We describe two types of anchor lines, and how we test their influence on the generated solutions, in the following paragraphs.
89
+
90
+ Print-var anchor lines. We first study print-var anchor lines, which iterate over all variables in the function signature and print their values. For a function with inputs var1 and var2 , the associated print-var anchor lines are:
91
+
92
+ for var in [var1, var2]: print(var)
93
+
94
+ To study the influence of the print-var anchor lines on the solution, we measure how often (i) just the first line (for loop), and (ii) just the second line (print statement) appear in the generated solution.
95
+
96
+ Add-var anchor lines. We also study add-var anchor lines, which return the sum of all variables in the function signature (converted to strings). For a function with inputs var1 and var2 , the add-var anchor lines are:
97
+
98
+ ![](images/5fd2c0df7eb36902206a8d073de7ef1e8a2e8431015b1607d9f4d14ef1f86fae.jpg)
99
+ Figure 4: Results of the print-var anchoring experiment. Left. We measure the functional accuracy of Codex (top) and CodeGen (bottom) with no anchor function prepended (baseline acc) and with a printvar anchor function prepended (anchor acc), and find that prepending the anchor function consistently lowers accuracy. Right. We measure the influence of the anchor function on the generated solution by plotting the fraction of generated solutions that contain “for var in ” from the print-var anchor prompt (for var loop), the fraction of generated solutions that include “print(var) ” (prints var), and the fraction of generated solutions that output the anchor function verbatim without additional content (exact copy), as a function of the number of canonical solution lines added to the prompt.
100
+
101
+ tmp = str(var1) $^ +$ str(var2) return tmp
102
+
103
+ To study the influence of the add-var anchor lines on the solution, we measure how often return tmp appears in the generated solution.
104
+
105
+ Print-var results. In Figure 4, we show that prepending print-var anchor functions consistently lowers Codex and CodeGens’ functional accuracies across different number of prompted canonical solution lines. We vary the number of canonical solution lines to study prompts of different difficulties; as the number of solution lines increases, the number remaining lines models must produce decreases.4
106
+
107
+ We additionally find that elements of anchor function often appear in both models’ outputs, suggesting that code generation models adjust their solutions towards related solutions. In Figure $^ { 4 , }$ we see that Codex generates for var in $3 2 \% { - } 6 1 \%$ of solutions when at least one line of the canonical solution is included, and generates print(var) in $2 6 \% - 4 4 \%$ of solutions. CodeGen’s behavior is qualitatively similar. Both models sometimes even incorporate the anchor lines into correct solutions; on Codex, the for var loop is used in a correct solution for $3 \% - 1 1 \%$ of all outputs, while print(var) is used in a correct solution for $1 \% - 9 \%$ of outputs.
108
+
109
+ Control experiments. One concern might be that models just outputs the anchor function verbatim, as in Section $\underline { { \left. 3 . 3 . 1 \right. } }$ but we find that this does not explain the full results—both models include anchor lines in many solutions that do not copy the anchor function verbatim. We also find that changing the name of the anchor function leads to only negligible changes; see Appendix A.1 for details.
110
+
111
+ Add-var results. We next consider results for add-var anchor lines. Full results for the add-var anchor prompts are presented in Appendix $\mathbf { A . l }$ and are qualitatively similar to the print-var results.
112
+
113
+ One again, we find that prepending the anchor function consistently lowers functional accuracy. Moreover, the outputted solutions often include an anchor line. For example, Codex and CodeGen generate return tmp in $2 6 \% - 4 6 \%$ and $1 3 \% - 7 9 \%$ of solutions respectively, depending on how many canonical solution lines we prompt with. These results are not caused by models outputting the anchoring function verbatim: this only occurs between $7 \%$ and $12 \%$ of the time for Codex, and $4 \%$ and $12 \%$ for CodeGen. Overall, our findings suggest that code generation models can err by adjusting its output towards related solutions, when the solutions are included in the prompt.
114
+
115
+ Write a function that squares the sum of its inputs
116
+
117
+ Write a function that sums its inputs called product_plus_2
118
+
119
+ def square_sum(x, y): return $\texttt { x } \star \texttt { 2 } + \texttt { y } \star \texttt { 2 }$
120
+
121
+ Figure 5: Left. Availability heuristic example where Codex mixes up the order of operations. The correct function signature (blue), square_sum matches the prompt. However, the incorrect function call (red) instead squares its inputs before summing them. The prompt is above the horizontal line, while the generated code is below. Right. Attribute substitution example where Codex relies on the function name to generate output. Codex correctly generates the desired function name (blue), but errs by using the function name instead of the prompt to generate the return statement (red).
122
+
123
+ # 3.3.3 Inspiration: Availability heuristic
124
+
125
+ We next draw inspiration from the availability heuristic: the tendency of humans to evaluate how frequently an example occurs based on how easy it is to recall. For example, Tversky and Kahneman $\mathbb { \underline { { \lVert \nabla ^ { 9 } 7 3 \rVert } } }$ find that humans tend to incorrectly report that there are more first words that start with “r” and “k” than have third letter “r” and “k”, because the former quickly come to mind.
126
+
127
+ Using the availability heuristic as motivation, we hypothesize that code generation models may err by outputting solutions to related prompts that appear more frequently in the training set. To elicit this failure, we start with prompts that apply a unary operation before a binary operation (unary-first), then flip the order (binary-first). Programmers tend to apply unary operations first (e.g. when computing Euclidean distances or variances), so we conjecture that they appear more frequently on GitHub. We first check that flipping the order of operations decreases accuracy. Next, to test if code generation models instead outputs related prompts that occur more frequently in the training set, we measure whether code generation models instead output the unary-first solution.
128
+
129
+ We consider all 12 combinations of the binary operations sum, difference, and product, with unary operations square, cube, quadruple, and square root. Focusing on Codex,5 we find that accuracy drops from $50 \%$ to $17 \%$ when flipping the order from unary-first to binary-first. Among combinations where flipping the order leads to error, we find that $7 5 \%$ of the binary-first outputs are the unary-first solution. We exhibit one such error in Figure $\boxed { 5 }$ when prompted to square the sum of its inputs, Codex generates the correct function name (square_sum ), but reverses the order of operations. Our results suggest that Codex can err by outputting solutions to related, frequent prompts in the training set.
130
+
131
+ Control experiments. One worry is that the dip in performance is due the instructional nature of our prompts. We rule this out by evaluating Codex on prompts where the docstring appears beneath the function signature and is a definition rather than command, to more closely mimic some functions on GitHub. We obtain qualitatively similar results on these prompts, see Appendix A.4 for details.
132
+
133
+ # 3.3.4 Inspiration: Attribute substitution
134
+
135
+ Finally, we draw inspiration from attribute substitution: the human tendency to respond to a complicated question using a simpler, related question [Kahneman and Frederick, 2002]. For example, a professor when asked how likely a candidate is to be tenured, may instead respond with how impressive they found their job talk.
136
+
137
+ Using attribute substitution as inspiration, we hypothesize that Codex may use simple-but-incorrect heuristics to generate solutions. To elicit this failure, we add requests for conflicting function names to MathEquation prompts. For example, in Figure 5 we prompt Codex to write a program that sums its inputs called product_plus_2 . We first check that adding conflicting function names decreases Codex’s functional accuracy. Next, to test if Codex uses simple-but-incorrect heuristics to generate solutions, we check whether the generate solution matches the function name.
138
+
139
+ We evaluate Codex using 90 MathEquation prompts where the desired solution and requested function name differ. To construct prompts, we begin with a prompt that Codex originally solves
140
+
141
+ <table><tr><td>Name location</td><td>Correct</td><td>Matches function name</td><td>Other error</td></tr><tr><td>No name</td><td>100.0</td><td>=</td><td>0.0</td></tr><tr><td>Docstring</td><td>4.4</td><td>80.0</td><td>15.6</td></tr><tr><td>Function signature</td><td>4.4</td><td>70.0</td><td>25.6</td></tr><tr><td>Name first</td><td>4.6</td><td>51.7</td><td>43.7</td></tr></table>
142
+
143
+ Table 2: Results of the attribute substitution experiments. We report accuracy when we do not request a contradictory function name (no name), we request a function name in the docstring (docstring), in the function signature below the docstring (function signature), or above the docstring (name first). Overall, we find that Codex frequently generates solutions based on the function name.
144
+
145
+ (sum, difference, or product), then append a request for a specific, contradictory function name (see Appendix $\underline { { \vert \mathbf { A . } 4 \vert } }$ for full implementation details).
146
+
147
+ We report our experimental results in Table $\triangledown$ When we request a conflicting function name, Codex’s accuracy drops from $100 \%$ to only $4 . 4 \% - 4 . 6 \%$ . This finding holds whether we request the function name in the docstring, write it in the function signature below the docstring, or write the function name over a simple description on the function. Moreover, for between $52 \%$ and $80 \%$ of prompts, Codex responds with the function specified in the function name. Our results indicate that Codex can err by using simple-but-incorrect heuristics to generate solutions.
148
+
149
+ # 4 GPT-3 Results
150
+
151
+ In this section, we extend our study from Codex to GPT-3. To test GPT-3 for failure modes, we try to faithfully reproduce and extend the anchoring experiment of Jacowitz and Kahneman [1995] and framing effect experiment of Tversky and Kahneman [1981].
152
+
153
+ Anchoring. As in Section 3.3.2 we study Section 3.3.2, we study anchoring: humans’ tendency to insufficiently adjust their estimates away from an initial value [Tversky and Kahneman, 1974]. We largely replicate the anchoring study presented in Jacowitz and Kahneman [1995], but test the “davinci-001” version of OpenAI’s GPT-3 instead of humans.
154
+
155
+ In their original experiment, Jacowitz and Kahneman asked students to estimate quantities such as the length of the Mississippi river in miles. They then asked new students to estimate the same quantities, but first gave them a upper or lower bound on the true answer (e.g. the Mississippi river is longer than 700 miles), which they call anchors. They find that students tend to underestimate the true quantity when prompted with the lower anchor, and overestimate it when prompted with the upper anchor.
156
+
157
+ We adapt the anchoring study from Jacowitz and Kahneman [1995] by finding the true answer for 14 of their 15 original questions6, then computing upper and lower anchors by increasing and decreasing the true answer by a fixed percentage $p$ . See Appendix $\mathbf { B . l }$ for a full list of questions and true answers. As an example, if the actual answer is 2000 and $p$ is $5 0 \%$ , the upper anchor is 3000 and the lower anchor is 1000. We use this bound as an anchor, so that a typical prompt might be:
158
+
159
+ What is the length of the Mississippi River (in miles)? Answer:
160
+
161
+ To study anchoring in GPT-3, we measure how prepending the anchor changes GPT-3’s estimate. We categorize four potential changes: the estimate does not change, the estimate shifts towards the anchor, the estimate shifts away from the anchor, and the estimate is gibberish. We report the results in Table $^ 3 .$ for $p \in \{ 2 0 \% , 5 0 \% \}$ . We find that GPT-3 routinely updates its estimate when an anchor is prepended, and tends to shift the estimate towards the anchor. We also find that while GPT-3’s updated estimate sometimes matches the anchor exactly $67 \%$ of the time), it also often lands between the anchor and the original prediction, mirroring the behavior of humans.
162
+
163
+ Our replication has a few limitations. Like the original study our sample size is small, we construct prompts with templates, and many of the outputs—on average $41 \%$ —are gibberish. Nevertheless, our results suggest that GPT-3 incorporates the anchor during estimation.
164
+
165
+ Anchor change to model output
166
+
167
+ <table><tr><td>p</td><td>No change</td><td>Towards anchor</td><td>Away from anchor</td><td>Gibberish</td></tr><tr><td>20%</td><td>10.7</td><td>28.6</td><td>10.7</td><td>50.0</td></tr><tr><td>50%</td><td>14.3</td><td>42.9</td><td>10.7</td><td>32.1</td></tr></table>
168
+
169
+ Table 3: Results of the adaptation of the anchoring study from Jacowitz and Kahneman [1995] on GPT-3. We consider anchors that are $20 \%$ and $50 \%$ increases and decreases from the ground truth answer, and measure how often GPT-3’s revised prediction does not change, shifts towards / away from the anchor, or is gibberish, aggregated across lower and upper anchors.
170
+
171
+ un
172
+ Delete all files in an inputted directory that import all
173
+ of statsmodels, plotly, seaborn, and scipy
174
+ “””
175
+ import os
176
+ import re
177
+ def delete_all(directory): for root, dir, file in os.walk(directory): for f in files: with open(os.path.join(root, f), ‘r’) as fp: if re.search(“import statsmodels”, fp.read()): os.remove(os.path.join(root, f))
178
+
179
+ ![](images/71ff0596f1e01e59c72b5c20ada600f5859e331d42315f4d75e7a8346414e74a.jpg)
180
+ Figure 6: Left. Example where Codex incorrectly deletes files. We prompt Codex to delete files containing all of statsmodels, plotly, seaborn, and scipy. Codex correctly iterates through all files in the inputted directory (blue), but then incorrectly deletes all files containing statsmodels (red), as attribute substitution suggests. Right. Plot describing the errors Codex makes as a function of the number of packages. We find that Codex often incorrectly deletes files if they contain any of the listed packages, and relies more on just the first package as the number of packages increases.
181
+
182
+ Framing effect. As in Section $3 . 3 . 1 ,$ we study the framing effect: predictable shifts in human responses when the same problem is framed in different ways. We largely replicate the framing experiment presented in Tversky and Kahneman [1981]: we compare GPT-3’s responses to two equivalent decisions: choosing to either deterministically save (or let die) some fraction of a population, or to probabilistically save (let die) the whole population.
183
+
184
+ We measure the rate at which GPT-3 chooses the probabilistic option across different population sizes and different fractions / probabilities. See Section $\boxed { \mathbf { B } . 2 }$ for full results. When using the probability in the original study, GPT-3 qualitatively mirrors humans: it chooses the probabilistic option far more frequently under the “not save” framing than under the “save framing”. However, for higher probabilities, GPT-3 consistently chooses the probabilistic option for both framings; we conjecture that humans could exhibit similar behavior in this regime, since the probabilistic option is more certain. Overall, our results suggest that GPT-3 selects different options based on the framing, and could be a test-bed to identify qualitative human behaviors without running full human studies.
185
+
186
+ # 5 High-Impact Errors
187
+
188
+ We have shown how our framework helps us elicit failures of large language models. In this section, we use our framework to construct cases where Codex makes high-impact errors: harmful errors that are hard to undo. Specifically, we construct prompts where Codex incorrectly deletes files.
189
+
190
+ As in Section $3 . 3 . 4$ we draw inspiration from attribute substitution: the tendency of humans to respond to a complex question with a simpler, related question. Using attribute substitution as motivation, we hypothesize that Codex may simplify complex expressions such as conjunctions. Instead of checking all components of a conjunction at once, it might “give up��� and consider subsets of the components individually (e.g. checking for $A$ or $A \lor B$ instead of $A \land B$ ). To elicit this failure, we prompt Codex to delete files containing specific sets of package imports; see Figure $6$ for an example. We measure how often Codex generates a simpler output that erroneously deletes files, as well as how often it produces the correct output. See Appendix $\boxed { \mathbf { C } }$ for additional details.
191
+
192
+ We test for two types of simpler outputs: code deleting all files containing first package in the set (i.e. $A$ instead of $A \land B$ ), and code deleting all files containing any package in the set (i.e. $A \lor B$ instead of $A \land B )$ ). The latter operation is computationally simpler than checking if a file contains all packages, since Codex can delete a file whenever a single package in the set appears.
193
+
194
+ In Figure $\textcircled { 6 }$ we illustrate the breakdown of the errors Codex makes as a function of the number of package imports in the prompt. We find that Codex erroneously deletes files on at least $80 \%$ of prompts when the number of package imports is at least three, despite producing a correct output on $90 \%$ of prompts when the number of packages is at most two. Moreover, we find that Codex increasingly errs by using only the first package as the problem gets more challenging (i.e. the number of packages increases), as attribute substitution predicts.
195
+
196
+ Control experiments. To very that our findings generalize to different classes of realistic prompts, we test Codex on prompts containing a descriptive docstring beneath the function signature delete_all_with_libraries(directory). We observe qualitatively similar results, though we find more instances of low-impact errors; see Appendix $\mathbf { \bar { C } }$ for details. Overall, our results demonstrate how our framework can preemptively elicit high-impact errors, like erroneous deletions.
197
+
198
+ # 6 Discussion
199
+
200
+ In this work, we identify and test for classes of errors that open-ended generation systems can make, using cognitive biases as motivation. To do so, we generate hypotheses for potential qualitative failure modes, then construct transformations over prompts that elicit these failures. Our experiments uncover deficiencies of Codex, CodeGen, and GPT-3, and elicit high-impact errors that are challenging to undo. While we focus on a few specific failure modes, future work could apply our framework to uncover additional failures. Moreover, our framework queries systems as a black-box, so it could be used to quickly probe for errors in future systems as they are released.
201
+
202
+ Some of our results highlight how optimizing likelihood could be at odds with human intent. For example, over GitHub, programs may more often match their function signature than docstring (Section $3 . 3 . 3 )$ , or tend to complete to pass if the preceding function does (Section 3.3.1). Nevertheless, our results elicit qualitative errors regardless of the “correct” behavior (i.e. even when what is incorrect and correct flips), and demonstrate the importance of documenting qualitative failures.
203
+
204
+ The reliability challenges posed by the open-ended generation systems that we study sometimes also apply to classifiers. Some classification errors can be more costly than others [Oakden-Rayner et al., 2020], classifiers may use irrelevant information to make predictions $\lVert \overline { { \mathrm { S a g a w a ~ e t ~ a l . } \rVert \mathbb { 2 0 } 2 0 } } \rVert$ , and input-level transformations like universal adversarial triggers $\rVert \overline { { \mathrm { W a l l a c e ~ e t ~ a l . } } } \rVert \overline { { 2 0 1 9 } } \rVert$ and distribution shifts [Hendrycks and Dietterich, $\boxed { 2 0 1 9 }$ induce errors. However, while classification errors may be succinctly summarized with a confusion matrix, generation errors cannot, since each output appears infrequently. To tame the large output space, our transformations must induce categories of errors that we can reliably measure. Despite this additional constraint, we are able to construct model-agnostic transformations: we do not use the training data, model parameters, or even output logits. Our success in this restricted setting demonstrates the comparative brittleness of completion systems.
205
+
206
+ We present a method to systematically elicit errors from large language models. While we believe our work is important to understand model behavior, bad actors could exploit the errors we reveal (e.g. by deleting files on systems with a Codex back-end). Nevertheless, we introduce new robustness challenges for developers and identify misuses of these models, which we feel supersedes this risk.
207
+
208
+ As a subroutine in our experimental pipeline, we use cognitive biases as inspiration to identify potential failure modes. This is an example of using a reference system—a system that is analogous to the ML models we study in some meaningful way—to generate insights into ML systems [Steinhardt, $\boxed { 2 0 2 2 }$ We use humans as the reference, focusing specifically on their susceptibility to cognitive biases. Other references, such as complex systems or evolution, may uncover new errors and insights. Moreover, ML systems could additionally err in ways that known systems do not, so it will also be useful to have intrinsic methods for characterizing model errors. Overall, our work underscores the need for more extensive testing of generative ML systems before their widespread deployment.
209
+
210
+ # Acknowledgements
211
+
212
+ We thank the anonymous reviewers, Ruiqi Zhong, Jean-Stanislas Denain, Aditi Raghunathan, Jessy Lin, and Lawrence Chan for feedback. This work was supported by NSF Award Grant no. 1804794.
213
+
214
+ # References
215
+
216
+ Emily Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchel. On the dangers of stochastic parrots: Can language models be too big? In ACM Conference on Fairness, Accountability, and Transparency (FAccT), 2021.
217
+
218
+ Su Lin Blodgett, Gilsinia Lopez, Alexandra Olteanu, Robert Sim, and Hanna Wallach. Stereotyping norwegian salmon: An inventory of pitfalls in fairness benchmark datasets. In Association for Computational Linguistics (ACL), 2021.
219
+
220
+ Rishi Bommasani, Drew A. Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S. Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, Erik Brynjolfsson, Shyamal Buch, Dallas Card, Rodrigo Castellon, Niladri Chatterji, Annie Chen, Kathleen Creel, Jared Quincy Davis, Dorottya Demszky, Chris Donahue, Moussa Doumbouya, Esin Durmus, Stefano Ermon, John Etchemendy, Kawin Ethayarajh, Li Fei-Fei, Chelsea Finn, Trevor Gale, Lauren Gillespie, Karan Goel, Noah Goodman, Shelby Grossman, Neel Guha, Tatsunori Hashimoto, Peter Henderson, John Hewitt, Daniel E. Ho, Jenny Hong, Kyle Hsu, Jing Huang, Thomas Icard, Saahil Jain, Dan Jurafsky, Pratyusha Kalluri, Siddharth Karamcheti, Geoff Keeling, Fereshte Khani, Omar Khattab, Pang Wei Koh, Mark Krass, Ranjay Krishna, Rohith Kuditipudi, Ananya Kumar, Faisal Ladhak, Mina Lee, Tony Lee, Jure Leskovec, Isabelle Levent, Xiang Lisa Li, Xuechen Li, Tengyu Ma, Ali Malik, Christopher D. Manning, Suvir Mirchandani, Eric Mitchell, Zanele Munyikwa, Suraj Nair, Avanika Narayan, Deepak Narayanan, Ben Newman, Allen Nie, Juan Carlos Niebles, Hamed Nilforoshan, Julian Nyarko, Giray Ogut, Laurel Orr, Isabel Papadimitriou, Joon Sung Park, Chris Piech, Eva Portelance, Christopher Potts, Aditi Raghunathan, Rob Reich, Hongyu Ren, Frieda Rong, Yusuf Roohani, Camilo Ruiz, Jack Ryan, Christopher Ré, Dorsa Sadigh, Shiori Sagawa, Keshav Santhanam, Andy Shih, Krishnan Srinivasan, Alex Tamkin, Rohan Taori, Armin W. Thomas, Florian Tramèr, Rose E. Wang, William Wang, Bohan Wu, Jiajun Wu, Yuhuai Wu, Sang Michael Xie, Michihiro Yasunaga, Jiaxuan You, Matei Zaharia, Michael Zhang, Tianyi Zhang, Xikun Zhang, Yuhui Zhang, Lucia Zheng, Kaitlyn Zhou, and Percy Liang. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021.
221
+
222
+ Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
223
+
224
+ Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, Alina Oprea, and Colin Raffel. Extracting training data from large language models. arXiv preprint arXiv:2012.07805, 2020.
225
+
226
+ Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
227
+
228
+ Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
229
+
230
+ Angela Fan, Yacine Jernite, Ethan Perez, David Grangier, Jason Weston, and Michael Auli. ELI5: Long form question answering. In Association for Computational Linguistics (ACL), 2019.
231
+
232
+ Saadia Gabriel, Asli Celikyilmaz, Rahul Jha, Yejin Choi, and Jianfeng Gao. GO FIGURE: A meta evaluation of factuality in summarization. In Findings of the Association for Computational Linguistics (Findings of ACL), 2021.
233
+
234
+ Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A Smith. Realtoxicityprompts: Evaluating neural toxic degeneration in language models. arXiv preprint arXiv:2009.11462, 2020.
235
+
236
+ Sophie Groenwold, Lily Ou, Aesha Parekh, Samhita Honnavalli, Sharon Levy, Diba Mirza, and William Yang Wang. Investigating african-american vernacular english in transformer-based text generation. In Empirical Methods in Natural Language Processing (EMNLP), 2020.
237
+
238
+ Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations (ICLR), 2019.
239
+
240
+ Dan Hendrycks, Steven Basart, Saurav Kadavath, Mantas Mazeika, Akul Arora, Ethan Guo, Collin Burns, Samir Puranik, Horace He, Dawn Song, and Jacob Steinhardt. Measuring coding challenge competence with APPS. In Advances in Neural Information Processing Systems (NeurIPS), 2021a.
241
+
242
+ Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. In International Conference on Learning Representations (ICLR), 2021b.
243
+
244
+ Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. Measuring mathematical problem solving with the MATH dataset. In Advances in Neural Information Processing Systems (NeurIPS), 2021c.
245
+
246
+ Abigail Z. Jacobs and Hanna Wallach. Measurement and fairness. In ACM Conference on Fairness, Accountability, and Transparency (FAccT), 2021.
247
+
248
+ Karen E. Jacowitz and Daniel Kahneman. Measures of anchoring in estimation tasks. Personality and Social Psychology Bulletin, 21(11):1161–1166, 1995.
249
+
250
+ Daniel Kahneman and Shane Frederick. Representativeness revisited: Attribute substitution in intuitive judgment. In Heuristics and Biases: The Psychology of Intuitive Judgement, pages 49–81. 2002.
251
+
252
+ Kalpesh Krishna, Aurko Roy, and Mohit Iyyer. Hurdles to progress in long-form question answering. In North American Association for Computational Linguistics (NAACL), 2021.
253
+
254
+ Stephanie Lin, Jacob Hilton, and Owain Evans. Truthfulqa: Measuring how models mimic human falsehoods. arXiv preprint arXiv:2109.07958, 2021.
255
+
256
+ Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. What makes good in-context examples for GPT-3. arXiv preprint arXiv:2101.06804, 2021.
257
+
258
+ David E. Meyer. Semantic priming well established. Science, 345(6196):523–523, 2014.
259
+
260
+ Moin Nadeem, Anna Bethke, and Siva Reddy. Stereoset: Measuring stereotypical bias in pretrained language models. arXiv preprint arXiv:2004.09456, 2020.
261
+
262
+ Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huam Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. A conversational paradigm for program synthesis. arXiv preprint arXiv:2203.13474, 2022.
263
+
264
+ Luke Oakden-Rayner, Jared Dunnmon, Gustavo Carneiro, and Christopher Ré. Hidden stratification causes clinically meaningful failures in machine learning for medical imaging. In Proceedings of the ACM Conference on Health, Inference, and Learning, pages 151–159, 2020.
265
+
266
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
267
+
268
+ Jack W. Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, J. Aslanides, Sarah Henderson, Roman Ring, Susannah Young, Eliza Rutherford, Tom Hennigan, Jacob Menick, Albin Cassirer, Richard Powell, G. V. D. Driessche, Lisa Anne Hendricks, Maribeth Rauh, Po-Sen Huang, Amelia Glaese, Johannes Welbl, Sumanth Dathathri, Saffron Huang, Jonathan Uesato, John F. J. Mellor, I. Higgins, Antonia Creswell, Nathan McAleese, Amy Wu, Erich Elsen, Siddhant M. Jayakumar, Elena Buchatskaya, D. Budden, Esme Sutherland, K. Simonyan, Michela Paganini, L. Sifre, Lena Martens, Xiang Lorraine Li, A. Kuncoro, Aida Nematzadeh, E. Gribovskaya, Domenic Donato, Angeliki Lazaridou, A. Mensch, J. Lespiau, Maria Tsimpoukelli, N. Grigorev, Doug Fritz, Thibault Sottiaux, Mantas Pajarskas, Tobias Pohlen, Zhitao Gong, Daniel Toyama, Cyprien de Masson d’Autume, Yujia Li, Tayfun Terzi, Vladimir Mikulik, I. Babuschkin, Aidan Clark, Diego de Las Casas, Aurelia Guy, Chris Jones, James Bradbury, Matthew Johnson, Blake A. Hechtman, Laura Weidinger, Iason Gabriel, William S. Isaac, Edward Lockhart, Simon Osindero, Laura Rimell, Chris Dyer, Oriol Vinyals, Kareem W. Ayoub, Jeff Stanway, L. Bennett, D. Hassabis, K. Kavukcuoglu, and Geoffrey Irving. Scaling language models: Methods, analysis & insights from training gopher. arXiv, 2021.
269
+
270
+ Ashwin Ram, Rohit Prasad, Chandra Khatri, Anu Venkatesh, Raefer Gabriel, Qing Liu, Jeff Nunn, Behnam Hedayatnia, Ming Cheng, Ashish Nagar, Eric King, Kate Bland, Amanda Wartick, Yi Pan, Han Song, Sk Jayadevan, Gene Hwang, and Art Pettigrue. Conversational ai: The science behind the alexa prize. arXiv preprint arXiv:1801.03604, 2018.
271
+
272
+ Sascha Rothe, Shashi Narayan, and Aliaksei Severyn. Leveraging pre-trained checkpoints for sequence generation tasks. Transactions of the Association for Computational Linguistics (TACL), 8:264–280, 2020.
273
+
274
+ Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations (ICLR), 2020.
275
+
276
+ Emily Sheng, Kai-Wei Chang, Premkumar Natarajan, and Nanyun Peng. The woman worked as a babysitter: On biases in language generation. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
277
+
278
+ Kurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela, and Jason Weston. Retrieval augmentation reduces hallucination in conversation. arXiv preprint arXiv:2104.07567, 2021.
279
+
280
+ Jacob Steinhardt. Anchor weights for ML. Bounded Regret, 2022.
281
+
282
+ Nisan Stiennon, Long Ouyang, Jeff Wu, Daniel M. Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, and Paul Christiano. Learning to summarize from human feedback. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
283
+
284
+ Fritz Strack, Leonard L. Martin, and Nobert Schwarz. Priming and communication: Social determinants of information use in judgments of life satisfaction. European Journal of Social Psychology, 18(5):429–442, 1988.
285
+
286
+ Leonard Tang, Elizabeth Ke, Nikhil Singh, Nakul Verma, and Iddo Drori. Solving probability and statistics problems by program synthesis. arXiv preprint arXiv:2111.08276, 2021.
287
+
288
+ Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, YaGuang Li, Hongrae Lee, Huaixiu Steven Zheng, Amin Ghafouri, Marcelo Menegali, Yanping Huang, Maxim Krikun, Dmitry Lepikhin, James Qin, Dehao Chen, Yuanzhong Xu, Zhifeng Chen, Adam Roberts, Maarten Bosma, Yanqi Zhou, Chung-Ching Chang, Igor Krivokon, Will Rusch, Marc Pickett, Kathleen Meier-Hellstern, Meredith Ringel Morris, Tulsee Doshi, Renelito Delos Santos, Toju Duke, Johnny Soraker, Ben Zevenbergen, Vinodkumar Prabhakaran, Mark Diaz, Ben Hutchinson, Kristen Olson, Alejandra Molina, Erin Hoffman-John, Josh Lee, Lora Aroyo, Ravi Rajakumar, Alena Butryna, Matthew Lamm, Viktoriya Kuzmina, Joe Fenton, Aaron Cohen, Rachel Bernstein, Ray Kurzweil, Blaise Aguera-Arcas, Claire Cui, Marian Croak, Ed Chi, and Quoc Le. LaMDA: Language models for dialog applications. arXiv preprint arXiv:2201.08239, 2022.
289
+
290
+ Amos Tversky and Daniel Kahneman. Availability: A heuristic for judging frequency and probability. Cognitive Psychology, 5(2):207–232, 1973.
291
+
292
+ Amos Tversky and Daniel Kahneman. Judgment under uncertainty: Heuristics and biases. Science, 185(4157):1124–1131, 1974.
293
+
294
+ Amos Tversky and Daniel Kahneman. The framing of decisions and the psychology of choice. Science, 211(4481):453–458, 1981.
295
+
296
+ Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. Universal adversarial triggers for attacking and analyzing NLP. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
297
+
298
+ Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. SuperGLUE: A stickier benchmark for general-purpose language understanding systems. In Advances in Neural Information Processing Systems (NeurIPS), 2019a.
299
+
300
+ Alex Wang, Amapreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations (ICLR), 2019b.
301
+
302
+ Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 billion parameter autoregressive language model, 2021.
303
+
304
+ Laura Weidinger, John Mellor, Maribeth Rauh, Conor Griffin, Jonathan Uesato, Po-Sen Huang, Myra Cheng, Mia Glaese, Borja Balle, Atoosa Kasirzadeh, Zac Kenton, Sasha Brown, Will Hawkins, Tom Stepleton, Courtney Biles, Abeba Birhane, Julia Haas, Laura Rimell, Lisa Anne Hendricks, William Isaac, Sean Legassick, Geoffrey Irving, and Iason Gabriel. Ethical and social risks of harm from language models. arXiv preprint arXiv:2112.04359, 2021.
305
+
306
+ Sonja Windhager, Florian Hutzler, Claus-Christian Carbon, Elisabeth Oberzaucher, Katrin Schaefer, Truls Thorstensen, Helmut Leder, and Karl Grammer. Laying eyes on headlights: Eye movements suggest facial features in cars. Collegium Antropologicum, 34(3):1075–1080, 2010.
307
+
308
+ Tony Z. Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. Calibrate before use: Improving few-shot performance of language models. In International Conference on Machine Learning (ICML), 2021.
309
+
310
+ Daniel M. Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B. Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving. Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593, 2019.
311
+
312
+ # Checklist
313
+
314
+ 1. For all authors...
315
+
316
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
317
+ (b) Did you describe the limitations of your work? [Yes] See discussion.
318
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See discussion.
319
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
320
+
321
+ 2. If you are including theoretical results...
322
+
323
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
324
+
325
+ 3. If you ran experiments...
326
+
327
+ (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] Included in the supplement.
328
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] We do not train new models, but in Section 3.1 and Section 4 we provide details about the models we evaluate.
329
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] Our experiments consider the deterministic rollout of models on fixed prompts.
330
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] We do not train models in this work.
331
+
332
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
333
+
334
+ (a) If your work uses existing assets, did you cite the creators? [Yes] We cite GPT-3 and Codex, and give credit to OpenAI.
335
+ (b) Did you mention the license of the assets? [N/A]
336
+ (c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
337
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
338
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
339
+
340
+ 5. If you used crowdsourcing or conducted research with human subjects...
341
+
342
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
343
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
344
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/dev/fcO9Cgn-X-R/fcO9Cgn-X-R_content_list.json ADDED
@@ -0,0 +1,1868 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Capturing Failures of Large Language Models via Human Cognitive Biases ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 196,
8
+ 122,
9
+ 803,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Erik Jones UC Berkeley erjones@berkeley.edu ",
17
+ "bbox": [
18
+ 261,
19
+ 226,
20
+ 434,
21
+ 268
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Jacob Steinhardt UC Berkeley jsteinhardt@berkeley.edu ",
28
+ "bbox": [
29
+ 529,
30
+ 226,
31
+ 736,
32
+ 268
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Abstract ",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 462,
42
+ 303,
43
+ 535,
44
+ 320
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Large language models generate complex, open-ended outputs: instead of outputting a class label they write summaries, generate dialogue, or produce working code. In order to asses the reliability of these open-ended generation systems, we aim to identify qualitative categories of erroneous behavior, beyond identifying individual errors. To hypothesize and test for such qualitative errors, we draw inspiration from human cognitive biases—systematic patterns of deviation from rational judgement. Specifically, we use cognitive biases as motivation to (i) generate hypotheses for problems that models may have, and (ii) develop experiments that elicit these problems. Using code generation as a case study, we find that OpenAI’s Codex errs predictably based on how the input prompt is framed, adjusts outputs towards anchors, and is biased towards outputs that mimic frequent training examples. We then use our framework to elicit high-impact errors such as incorrectly deleting files. Our results indicate that experimental methodology from cognitive science can help characterize how machine learning systems behave.1 ",
51
+ "bbox": [
52
+ 232,
53
+ 337,
54
+ 766,
55
+ 530
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 Introduction ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 174,
65
+ 556,
66
+ 312,
67
+ 574
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Recent large language models have achieved new, exciting capabilities. In contrast to traditional classifiers, these models can generate open-ended text, enabling use cases like summarization [Stiennon et al., 2020], dialog [Thoppilan et al., 2022], and code generation [Chen et al., 2021] ",
74
+ "bbox": [
75
+ 176,
76
+ 589,
77
+ 823,
78
+ 632
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "The open-ended power of these systems, however, poses new reliability challenges. We must understand not only when systems err, but also the kinds of errors they make, as some errors are much more costly than others. For example, erroneous code that does not compile is less dangerous than code that deletes all files in the home directory. Studying how frequently an error occurs is difficult, as the same error (e.g. delete all files) can appear in a wide range of syntactically diverse outputs. In order to better reason about how complex systems err, we need methods to test whether systems make the same qualitative error across different prompts, even when the generated outputs differ. ",
85
+ "bbox": [
86
+ 174,
87
+ 638,
88
+ 825,
89
+ 734
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "To study these reliability challenges, we primarily focus on code generation models. Such models complete programs from comments, descriptions of code functionality, or initial lines of code. Code generation is particularly amenable to study since it is objective: generated solutions are unambiguously correct or incorrect. Yet it is also open-ended: the set of programs a model could output is arbitrarily large, so the rate at which a specific program is outputted is not very descriptive. ",
96
+ "bbox": [
97
+ 174,
98
+ 741,
99
+ 825,
100
+ 810
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Many of the reliability challenges posed by code generation models, and open-ended systems broadly, also arise when studying qualitative failures in human decision making. These failures, called cognitive biases, are systematic ways in which humans deviate from rational judgment [Tversky and Kahneman, 1974]. For example, Tversky and Kahneman find that humans inadequately adjust estimates away from initial values, and disproportionately recall distinctive examples. To uncover cognitive biases, Tversky and Kahneman ask questions that are crafted to systematically reveal some qualitative irrationality. They uncover insights into human behavior from the diverse responses, without complete mechanistic insight into the minds that they aim to analyze. ",
107
+ "bbox": [
108
+ 173,
109
+ 816,
110
+ 825,
111
+ 873
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "image",
117
+ "img_path": "images/b810734399a6a31fa69f1d979a6e552103d7ab86daa2ba2d29853274d717cdaf.jpg",
118
+ "image_caption": [
119
+ "Figure 1: Illustration of our experimental framework. We use a cognitive bias (framing effect) to inspire a potential code generation failure mode (relying on irrelevant information). We then transform inputs in a way that we suspect will elicit the failure mode (prepending sum). We evaluate whether the modifications lower accuracy, and if the output is an instance of the targeted failure mode. "
120
+ ],
121
+ "image_footnote": [],
122
+ "bbox": [
123
+ 178,
124
+ 90,
125
+ 821,
126
+ 195
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "",
133
+ "bbox": [
134
+ 174,
135
+ 287,
136
+ 825,
137
+ 344
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "In this work, we extend Tversky and Kahneman’s experimental methodology and results to elicit failure modes of large code and language models, without relying on complete mechanistic insight into their behavior (Figure 1). Given a potential failure mode (e.g. relying on irrelevant information in the input), we construct a transformation over inputs that largely preserves semantics, but that we suspect will elicit the failure (e.g. prepending an irrelevant function). We first test if the model is sensitive to the transformation, by measuring if it decreases accuracy. Then, we check that the model outputs have elements that are indicative of the targeted failure (e.g. copies the irrelevant function). ",
144
+ "bbox": [
145
+ 173,
146
+ 349,
147
+ 825,
148
+ 448
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "We draw on four different cognitive biases to hypothesize potential failures of OpenAI’s Codex [Chen et al., $\\boxed { 2 0 2 1 }$ and Salesforce’s CodeGen $[ [ \\mathrm { N i j k a m p ~ e t ~ a l . } ] [ \\overline { { 2 0 2 2 } } ] ]$ , then apply our framework to each. Our results indicate that these models often rely on irrelevant information when generating solutions, adjust solutions towards related-but-incorrect solutions, are biased based on training-set frequencies, and reverts to computationally simpler problems when faced with a complex calculation. We also apply our framework to OpenAI’s GPT-3 [Brown et al., 2020], and show that it updates its predictions towards anchors, and predictably adjusts its responses based on the question framing. ",
155
+ "bbox": [
156
+ 173,
157
+ 453,
158
+ 826,
159
+ 551
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "Finally, we show that our framework can uncover high-impact errors: errors that are harmful and difficult to undo. Specifically, we use our framework to systematically generate prompts where Codex erroneously deletes files. Our results indicate that experimental methodology from cognitive science can help uncover failure modes of complex machine learning systems. ",
166
+ "bbox": [
167
+ 174,
168
+ 558,
169
+ 825,
170
+ 613
171
+ ],
172
+ "page_idx": 1
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "2 Related Work ",
177
+ "text_level": 1,
178
+ "bbox": [
179
+ 174,
180
+ 636,
181
+ 321,
182
+ 652
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "Large language models. Recent work has developed large, capable, autoregressive language models, which predict future tokens from past tokens [Radford et al., 2019, Wang and Komatsuzaki, 2021, Brown et al., 2020, Chen et al., 2021, Rae et al., 2021]. These models can be used for open-ended generation tasks such as summarization [Stiennon et al., 2020, Ziegler et al., 2019, Rothe et al., 2020], dialogue [Ram et al., 2018, Thoppilan et al., 2022], and long form question answering [Fan et al., 2019] , among others. Model-generated code has been used to solve both programming and statistics questions [Chen et al., 2021, Tang et al., 2021]. ",
189
+ "bbox": [
190
+ 173,
191
+ 670,
192
+ 826,
193
+ 768
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "There is some existing work studying failures of large language models. Benchmarks that measure model performance on multiple choice questions [Wang et al., 2019b,a, Hendrycks et al., 2021b], mathematics [Hendrycks et al., 2021c, Cobbe et al., 2021], long-form question answering [Lin et al., 2021, Gabriel et al., 2021, Shuster et al., 2021, Krishna et al., 2021], and coding problems [Hendrycks et al., 2021a, Chen et al., 2021] reveal inputs that the model errs on, but not the kind of error it makes. Another line of work shows that test-based language models can internalize bias and stereotypes [Sheng et al., 2019, Nadeem et al., 2020, Groenwold et al., 2020, Blodgett et al., 2021, Gehman et al., 2020], and proposes applying fairness measurements from cognitive social sciences to machine learning systems [Jacobs and Wallach, 2021]. Some work adversarially prompts models to leak training data [Carlini et al., 2020], or output specific content [Wallace et al., 2019, Carlini et al., $\\boxed { 2 0 2 0 } ]$ . And a final line of work identifies additional potential failures of current and future machine learning systems [Bender et al., 2021, Bommasani et al., 2021, Weidinger et al., 2021]. ",
200
+ "bbox": [
201
+ 173,
202
+ 772,
203
+ 825,
204
+ 912
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "image",
210
+ "img_path": "images/b0ac32b01cb78509c5227342d766cad25cb336596ed9fdc4bd31985e4f6b5b89.jpg",
211
+ "image_caption": [
212
+ "Figure 2: Left. Example of a HumanEval problem from Chen et al. [2021] . The problem contains a prompt (blue), a canonical solution to the prompt (green), and a few test-cases (black). The prompt contains two components: a function signature (first line), and a docstring (remaining lines). Right. Illustration of our framing experiment. The transformed prompt (everything above the black line) contains an irrelevant preceding function (IPF) prepended to a prompt from HumanEval (blue). The IPF contains a randomly chosen prompt from HumanEval (purple) and a framing line (red). The output Codex generates (below the black line) matches the framing line. When we omit the random HumanEval prompt and the framing line (leaving only blue), Codex produces the correct output. "
213
+ ],
214
+ "image_footnote": [],
215
+ "bbox": [
216
+ 179,
217
+ 87,
218
+ 821,
219
+ 212
220
+ ],
221
+ "page_idx": 2
222
+ },
223
+ {
224
+ "type": "text",
225
+ "text": "",
226
+ "bbox": [
227
+ 169,
228
+ 356,
229
+ 823,
230
+ 386
231
+ ],
232
+ "page_idx": 2
233
+ },
234
+ {
235
+ "type": "text",
236
+ "text": "Cognitive biases. Tversky and Kahneman [1974] define human cognitive biases: systematic patterns of deviation from rational judgment. They observe that humans employ heuristics when computing probabilities or assessing values, and that these heuristics lead to predictable errors. Follow-up work has added to, refined, and validated the set of known cognitive biases [Tversky and Kahneman, 1973, 1981, Strack et al., 1988, Kahneman and Frederick, 2002, Windhager et al., 2010, Meyer, 2014]. ",
237
+ "bbox": [
238
+ 173,
239
+ 388,
240
+ 825,
241
+ 462
242
+ ],
243
+ "page_idx": 2
244
+ },
245
+ {
246
+ "type": "text",
247
+ "text": "Some known failure modes of large language models resemble cognitive biases. Zhao et al. [2021] and Liu et al. [2021] show that the specific random samples used for few-shot learning can change GPT-3’s prediction on binary and multiple choice tasks. Similarly, Wallace et al. [2019] show that innocuous prompts can routinely generate toxic model output. Our framework builds on this work by (i) identifying the link to cognitive biases, (ii) focusing on open-ended generation, and (iii) leveraging Tversky and Kahneman’s experimental methodology to elicit qualitative failure modes. ",
248
+ "bbox": [
249
+ 173,
250
+ 465,
251
+ 825,
252
+ 549
253
+ ],
254
+ "page_idx": 2
255
+ },
256
+ {
257
+ "type": "text",
258
+ "text": "3 Code Generation Experiments ",
259
+ "text_level": 1,
260
+ "bbox": [
261
+ 176,
262
+ 568,
263
+ 460,
264
+ 585
265
+ ],
266
+ "page_idx": 2
267
+ },
268
+ {
269
+ "type": "text",
270
+ "text": "3.1 Models ",
271
+ "text_level": 1,
272
+ "bbox": [
273
+ 173,
274
+ 598,
275
+ 264,
276
+ 613
277
+ ],
278
+ "page_idx": 2
279
+ },
280
+ {
281
+ "type": "text",
282
+ "text": "We study two code models: OpenAI’s Codex [Chen et al., 2021], and Salesforce’s CodeGen. [Nijkamp et al., 2022]. Both models are autoregressive—given a sequence of previous tokens, they predict the next token. Practitioners query these code models with partial programs, docstrings, or function signatures, and obtain completions as output. ",
283
+ "bbox": [
284
+ 173,
285
+ 623,
286
+ 825,
287
+ 680
288
+ ],
289
+ "page_idx": 2
290
+ },
291
+ {
292
+ "type": "text",
293
+ "text": "Codex. We study OpenAI’s Codex, a large language model trained to generate code from docstrings [Chen et al., 2021]. We use the OpenAI API to query the “davinci-001” version of Codex, and use greedy decoding to generate solutions. Details of this model architecture are not public, but it is likely similar to the largest model from Chen et al. [2021]: a 12B parameter version of GPT-3 [Brown et al., 2020] that is fine-tuned on GitHub instead of the CommonCrawl. ",
294
+ "bbox": [
295
+ 174,
296
+ 685,
297
+ 825,
298
+ 756
299
+ ],
300
+ "page_idx": 2
301
+ },
302
+ {
303
+ "type": "text",
304
+ "text": "CodeGen. We additionally study the 6.2 billion parameter “mono” version of CodeGen, which is trained on text data and fine-tuned on GitHub. Unlike Codex, the weights of CodeGen are publicly available,2 so we run inference locally. We use greedy decoding to generate solutions. ",
305
+ "bbox": [
306
+ 174,
307
+ 762,
308
+ 825,
309
+ 805
310
+ ],
311
+ "page_idx": 2
312
+ },
313
+ {
314
+ "type": "text",
315
+ "text": "3.2 Benchmarks ",
316
+ "text_level": 1,
317
+ "bbox": [
318
+ 174,
319
+ 820,
320
+ 300,
321
+ 835
322
+ ],
323
+ "page_idx": 2
324
+ },
325
+ {
326
+ "type": "text",
327
+ "text": "In order to identify whether code models some failure mode, we need to generate prompts that elicit that failure. To do so, we systematically apply transformations to standard prompts. We use two benchmarks as sources of prompts to transform: HumanEval, and MathEquations. ",
328
+ "bbox": [
329
+ 176,
330
+ 845,
331
+ 825,
332
+ 887
333
+ ],
334
+ "page_idx": 2
335
+ },
336
+ {
337
+ "type": "table",
338
+ "img_path": "images/a950596f8bca75dcae5dc344e398135cd6410d2b7236ca7ff919a367c6926c0f.jpg",
339
+ "table_caption": [],
340
+ "table_footnote": [
341
+ "Table 1: Results of the framing experiments. We compare functional accuracy and the rate at which framing line is outputted over HumanEval with (framed) and without (original) irrelevant preceding functions. We find that the irrelevant preceding functions lower functional accuracy across all framing lines for Codex and CodeGen. Moreover, we find that the outputted function often appears verbatim in the generated output, suggesting that both models rely on irrelevant information in the prompt. "
342
+ ],
343
+ "table_body": "<table><tr><td>Framing Line</td><td>Model</td><td>ORIGINAL</td><td>FRAMED</td><td>ORIGINAL</td><td>FRAMED</td></tr><tr><td rowspan=\"2\">raise NotImplemented</td><td>CODEX</td><td>32.9</td><td>2.4</td><td>1.4</td><td>91.7</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>1.5</td><td>0.0</td><td>79.3</td></tr><tr><td rowspan=\"2\">pass</td><td>CoDEX</td><td>32.9</td><td>3.0</td><td>9.7</td><td>92.7</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>2.1</td><td>0.0</td><td>78.7</td></tr><tr><td rowspan=\"2\">assert False</td><td>CODEX</td><td>32.9</td><td>3.3</td><td>0.0</td><td>92.7</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>4.2</td><td>0.1</td><td>72.6</td></tr><tr><td rowspan=\"2\">return False</td><td>CODEX</td><td>32.9</td><td>4.9</td><td>11.5</td><td>65.6</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>3.6</td><td>0.0</td><td>64.6</td></tr><tr><td rowspan=\"2\">print(&quot;Hello world!&quot;)</td><td>CODEX</td><td>32.9</td><td>10.6</td><td>0.0</td><td>62.2</td></tr><tr><td>CODEGEN</td><td>25.6</td><td>11.0</td><td>0.0</td><td>58.2</td></tr></table>",
344
+ "bbox": [
345
+ 179,
346
+ 99,
347
+ 820,
348
+ 297
349
+ ],
350
+ "page_idx": 3
351
+ },
352
+ {
353
+ "type": "text",
354
+ "text": "HumanEval. We use the HumanEval benchmark as a diverse source of “normal” prompts [Chen et al., $\\boxed { 2 0 2 1 }$ . HumanEval contains 164 programming problems, each of which includes a function signature and a docstring. The docstring contains an English description of the desired functionality and a few example input-output pairs. HumanEval also contains a canonical solution for each program, which we use in Section $\\underline { { \\bar { \\vert 3 . 3 . 2 \\vert } } }$ We give an example problem from HumanEval in Figure 2. ",
355
+ "bbox": [
356
+ 173,
357
+ 405,
358
+ 825,
359
+ 477
360
+ ],
361
+ "page_idx": 3
362
+ },
363
+ {
364
+ "type": "text",
365
+ "text": "MathEquations. We also curate a set of prompts of basic arithmetic functions. For example, we prompt Codex to “Write a function that sums the squares of its inputs”, or “Write a function that sums its inputs called product_plus_five”. Further details are given in Sections 3.3.3 an 3.3.4. ",
366
+ "bbox": [
367
+ 174,
368
+ 482,
369
+ 825,
370
+ 525
371
+ ],
372
+ "page_idx": 3
373
+ },
374
+ {
375
+ "type": "text",
376
+ "text": "3.3 Empirical results ",
377
+ "text_level": 1,
378
+ "bbox": [
379
+ 174,
380
+ 541,
381
+ 333,
382
+ 556
383
+ ],
384
+ "page_idx": 3
385
+ },
386
+ {
387
+ "type": "text",
388
+ "text": "In this section, we show how cognitive biases can (i) inspire hypotheses for potential failure modes, and (ii) help us design experiments to test these hypotheses. Our approach has three steps. First, we construct a transformation over prompts that largely preserves semantics, but that we suspect will elicit a specific cognitive-bias-inspired failure mode. Next, we measure if code models are sensitive to the transformation, by measuring the decrease in accuracy. And finally, we check that the generated output has elements that are indicative of the targeted failure mode. Our approach mirrors the high-level methodology from Tversky and Kahneman [1974]; we empirically elicit specific failure modes using targeted prompts, without complete mechanistic insight into the system that we study. ",
389
+ "bbox": [
390
+ 173,
391
+ 566,
392
+ 825,
393
+ 679
394
+ ],
395
+ "page_idx": 3
396
+ },
397
+ {
398
+ "type": "text",
399
+ "text": "We draw inspiration from four cognitive biases: the framing effect (Tversky and Kahneman [1981] Section 3.3.1), anchoring (Tversky and Kahneman [1974]; Section $\\underline { { \\overline { { | 3 . 3 . 2 ) } } } }$ , the availability heuristic (Tversky and Kahneman [1973]; Section 3.3.3), and attribute substitution (Kahneman and Frederick [2002]; Section 3.3.4). ",
400
+ "bbox": [
401
+ 174,
402
+ 684,
403
+ 826,
404
+ 741
405
+ ],
406
+ "page_idx": 3
407
+ },
408
+ {
409
+ "type": "text",
410
+ "text": "3.3.1 Inspiration: Framing effect ",
411
+ "text_level": 1,
412
+ "bbox": [
413
+ 174,
414
+ 756,
415
+ 416,
416
+ 771
417
+ ],
418
+ "page_idx": 3
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "We first draw inspiration from the framing effect: predictable shifts in human responses when the same problem is framed in different ways [Tversky and Kahneman, 1981]. In their study identifying the effect, Tversky and Kahneman [1981] find that subjects favor certainly saving 200 people over saving 600 with probability $\\overline { { 1 / 3 } }$ , yet prefer losing 600 with probability 2/3 over certainly losing 400 (even though these are equivalent). At its core, the framing effect shows how humans can rely on semantically irrelevant information when they make decisions. ",
423
+ "bbox": [
424
+ 174,
425
+ 779,
426
+ 825,
427
+ 863
428
+ ],
429
+ "page_idx": 3
430
+ },
431
+ {
432
+ "type": "text",
433
+ "text": "Using the framing effect as inspiration, we hypothesize that code generation models may generate solutions exclusively from irrelevant information in the prompt. To elicit this failure, we transform HumanEval prompts by prepending irrelevant preceding functions. Specifically, to generate irrelevant preceding functions, we combine a random prompt from HumanEval with a framing line. We test five framing lines: raise NotImplementedError , pass , assert False , return False , and print(\"Hello world!\") . We first check that prepending these irrelevant preceding functions decreases functional accuracy.3 Next, to test if models relied on irrelevant information in the prompt, we measure how much more frequently the framing line appears verbatim in the generated output. ",
434
+ "bbox": [
435
+ 176,
436
+ 869,
437
+ 825,
438
+ 911
439
+ ],
440
+ "page_idx": 3
441
+ },
442
+ {
443
+ "type": "image",
444
+ "img_path": "images/3ca12ceac2dfdc76f5b5cb25925443fec2d6975fface7597f9f0a393592f8cfd.jpg",
445
+ "image_caption": [
446
+ "Figure 3: Illustration of our anchoring experiment using a real example (expanded in Figure 7). We construct the anchor function (left) by taking the function signature from the HumanEval prompt (blue), appending $n$ lines of the canonical solution (green), then adding anchoring lines (red). We construct the full prompt (center) by combining the anchor function, the original HumanEval prompt, and the first $n$ lines of the canonical solution. The solution Codex generates (right) combines elements of a canonical solution (checks condition and adds to ret.), with the anchor function (for var loop). "
447
+ ],
448
+ "image_footnote": [],
449
+ "bbox": [
450
+ 178,
451
+ 87,
452
+ 820,
453
+ 159
454
+ ],
455
+ "page_idx": 4
456
+ },
457
+ {
458
+ "type": "text",
459
+ "text": "",
460
+ "bbox": [
461
+ 173,
462
+ 276,
463
+ 825,
464
+ 347
465
+ ],
466
+ "page_idx": 4
467
+ },
468
+ {
469
+ "type": "text",
470
+ "text": "We report the results of our framing experiments in Table 1. We find that adding irrelevant preceding functions consistently lowers functional accuracy, by between 22.3 and 30.5 points for Codex, across the different framing lines we tested. Moreover, both models frequently generate the framing line: $81 \\%$ of the time for Codex and $7 0 . 7 \\%$ of time for CodeGen, compared to only $4 . 5 \\%$ and $0 . 0 \\%$ over untransformed prompts respectively. These results suggest that code generation models can erroneously rely on irrelevant information in the prompt in predictable ways, even in the extreme case when doing so contradicts the type specification in the function signature (return False ). ",
471
+ "bbox": [
472
+ 173,
473
+ 353,
474
+ 825,
475
+ 450
476
+ ],
477
+ "page_idx": 4
478
+ },
479
+ {
480
+ "type": "text",
481
+ "text": "3.3.2 Inspiration: Anchoring ",
482
+ "text_level": 1,
483
+ "bbox": [
484
+ 174,
485
+ 467,
486
+ 388,
487
+ 482
488
+ ],
489
+ "page_idx": 4
490
+ },
491
+ {
492
+ "type": "text",
493
+ "text": "We next draw inspiration from anchoring: humans’ tendency to insufficiently adjust their estimates away from initial values. For example, Tversky and Kahneman $\\mathbb { \\underline { { \\lVert \\mathbf { 9 7 4 } } \\rVert } }$ find that subjects’ median estimate for the fraction of African countries in the UN shifts from $2 5 \\%$ to $45 \\%$ , based on whether they were first asked if the fraction was greater or less than $10 \\%$ and $65 \\%$ , respectively. Anchoring captures how humans adjust to partial information, versus irrelevant information (framing effect). ",
494
+ "bbox": [
495
+ 174,
496
+ 491,
497
+ 825,
498
+ 561
499
+ ],
500
+ "page_idx": 4
501
+ },
502
+ {
503
+ "type": "text",
504
+ "text": "Using anchoring as inspiration, we hypothesize that code generation models may adjust their output towards related solutions, when these solutions are included in the prompt. To elicit this failure, we prepend anchor functions to prompts: functions that are similar to a valid solution for a HumanEval prompt, but contain some error. We first check that prepending these anchor functions decreases functional accuracy, as in Section $3 . 3 . 1 .$ Next, to test if models adjust their output towards related solutions, we check that the generated solution contains elements of the anchor function. ",
505
+ "bbox": [
506
+ 174,
507
+ 568,
508
+ 825,
509
+ 651
510
+ ],
511
+ "page_idx": 4
512
+ },
513
+ {
514
+ "type": "text",
515
+ "text": "We aim to construct anchor functions that are similar to functions in HumanEval prompts and that compile, but are incorrect. To do so, we take a prefix of the canonical solution, then add additional anchor lines that produce an incorrect output. See Figure $\\triangledown$ for an example. We describe two types of anchor lines, and how we test their influence on the generated solutions, in the following paragraphs. ",
516
+ "bbox": [
517
+ 174,
518
+ 656,
519
+ 825,
520
+ 713
521
+ ],
522
+ "page_idx": 4
523
+ },
524
+ {
525
+ "type": "text",
526
+ "text": "Print-var anchor lines. We first study print-var anchor lines, which iterate over all variables in the function signature and print their values. For a function with inputs var1 and var2 , the associated print-var anchor lines are: ",
527
+ "bbox": [
528
+ 174,
529
+ 719,
530
+ 825,
531
+ 761
532
+ ],
533
+ "page_idx": 4
534
+ },
535
+ {
536
+ "type": "text",
537
+ "text": "for var in [var1, var2]: print(var) ",
538
+ "bbox": [
539
+ 174,
540
+ 767,
541
+ 379,
542
+ 796
543
+ ],
544
+ "page_idx": 4
545
+ },
546
+ {
547
+ "type": "text",
548
+ "text": "To study the influence of the print-var anchor lines on the solution, we measure how often (i) just the first line (for loop), and (ii) just the second line (print statement) appear in the generated solution. ",
549
+ "bbox": [
550
+ 173,
551
+ 803,
552
+ 823,
553
+ 832
554
+ ],
555
+ "page_idx": 4
556
+ },
557
+ {
558
+ "type": "text",
559
+ "text": "Add-var anchor lines. We also study add-var anchor lines, which return the sum of all variables in the function signature (converted to strings). For a function with inputs var1 and var2 , the add-var anchor lines are: ",
560
+ "bbox": [
561
+ 174,
562
+ 837,
563
+ 825,
564
+ 878
565
+ ],
566
+ "page_idx": 4
567
+ },
568
+ {
569
+ "type": "image",
570
+ "img_path": "images/5fd2c0df7eb36902206a8d073de7ef1e8a2e8431015b1607d9f4d14ef1f86fae.jpg",
571
+ "image_caption": [
572
+ "Figure 4: Results of the print-var anchoring experiment. Left. We measure the functional accuracy of Codex (top) and CodeGen (bottom) with no anchor function prepended (baseline acc) and with a printvar anchor function prepended (anchor acc), and find that prepending the anchor function consistently lowers accuracy. Right. We measure the influence of the anchor function on the generated solution by plotting the fraction of generated solutions that contain “for var in ” from the print-var anchor prompt (for var loop), the fraction of generated solutions that include “print(var) ” (prints var), and the fraction of generated solutions that output the anchor function verbatim without additional content (exact copy), as a function of the number of canonical solution lines added to the prompt. "
573
+ ],
574
+ "image_footnote": [],
575
+ "bbox": [
576
+ 179,
577
+ 90,
578
+ 815,
579
+ 313
580
+ ],
581
+ "page_idx": 5
582
+ },
583
+ {
584
+ "type": "text",
585
+ "text": "tmp = str(var1) $^ +$ str(var2) return tmp ",
586
+ "bbox": [
587
+ 176,
588
+ 460,
589
+ 405,
590
+ 488
591
+ ],
592
+ "page_idx": 5
593
+ },
594
+ {
595
+ "type": "text",
596
+ "text": "To study the influence of the add-var anchor lines on the solution, we measure how often return tmp appears in the generated solution. ",
597
+ "bbox": [
598
+ 176,
599
+ 494,
600
+ 823,
601
+ 522
602
+ ],
603
+ "page_idx": 5
604
+ },
605
+ {
606
+ "type": "text",
607
+ "text": "Print-var results. In Figure 4, we show that prepending print-var anchor functions consistently lowers Codex and CodeGens’ functional accuracies across different number of prompted canonical solution lines. We vary the number of canonical solution lines to study prompts of different difficulties; as the number of solution lines increases, the number remaining lines models must produce decreases.4 ",
608
+ "bbox": [
609
+ 174,
610
+ 529,
611
+ 825,
612
+ 584
613
+ ],
614
+ "page_idx": 5
615
+ },
616
+ {
617
+ "type": "text",
618
+ "text": "We additionally find that elements of anchor function often appear in both models’ outputs, suggesting that code generation models adjust their solutions towards related solutions. In Figure $^ { 4 , }$ we see that Codex generates for var in $3 2 \\% { - } 6 1 \\%$ of solutions when at least one line of the canonical solution is included, and generates print(var) in $2 6 \\% - 4 4 \\%$ of solutions. CodeGen’s behavior is qualitatively similar. Both models sometimes even incorporate the anchor lines into correct solutions; on Codex, the for var loop is used in a correct solution for $3 \\% - 1 1 \\%$ of all outputs, while print(var) is used in a correct solution for $1 \\% - 9 \\%$ of outputs. ",
619
+ "bbox": [
620
+ 173,
621
+ 592,
622
+ 825,
623
+ 689
624
+ ],
625
+ "page_idx": 5
626
+ },
627
+ {
628
+ "type": "text",
629
+ "text": "Control experiments. One concern might be that models just outputs the anchor function verbatim, as in Section $\\underline { { \\left. 3 . 3 . 1 \\right. } }$ but we find that this does not explain the full results—both models include anchor lines in many solutions that do not copy the anchor function verbatim. We also find that changing the name of the anchor function leads to only negligible changes; see Appendix A.1 for details. ",
630
+ "bbox": [
631
+ 174,
632
+ 694,
633
+ 825,
634
+ 751
635
+ ],
636
+ "page_idx": 5
637
+ },
638
+ {
639
+ "type": "text",
640
+ "text": "Add-var results. We next consider results for add-var anchor lines. Full results for the add-var anchor prompts are presented in Appendix $\\mathbf { A . l }$ and are qualitatively similar to the print-var results. ",
641
+ "bbox": [
642
+ 174,
643
+ 757,
644
+ 823,
645
+ 786
646
+ ],
647
+ "page_idx": 5
648
+ },
649
+ {
650
+ "type": "text",
651
+ "text": "One again, we find that prepending the anchor function consistently lowers functional accuracy. Moreover, the outputted solutions often include an anchor line. For example, Codex and CodeGen generate return tmp in $2 6 \\% - 4 6 \\%$ and $1 3 \\% - 7 9 \\%$ of solutions respectively, depending on how many canonical solution lines we prompt with. These results are not caused by models outputting the anchoring function verbatim: this only occurs between $7 \\%$ and $12 \\%$ of the time for Codex, and $4 \\%$ and $12 \\%$ for CodeGen. Overall, our findings suggest that code generation models can err by adjusting its output towards related solutions, when the solutions are included in the prompt. ",
652
+ "bbox": [
653
+ 174,
654
+ 791,
655
+ 825,
656
+ 888
657
+ ],
658
+ "page_idx": 5
659
+ },
660
+ {
661
+ "type": "text",
662
+ "text": "Write a function that squares the sum of its inputs ",
663
+ "bbox": [
664
+ 184,
665
+ 104,
666
+ 467,
667
+ 145
668
+ ],
669
+ "page_idx": 6
670
+ },
671
+ {
672
+ "type": "text",
673
+ "text": "Write a function that sums its inputs called product_plus_2 ",
674
+ "bbox": [
675
+ 506,
676
+ 106,
677
+ 799,
678
+ 145
679
+ ],
680
+ "page_idx": 6
681
+ },
682
+ {
683
+ "type": "text",
684
+ "text": "def square_sum(x, y): return $\\texttt { x } \\star \\texttt { 2 } + \\texttt { y } \\star \\texttt { 2 }$ ",
685
+ "bbox": [
686
+ 184,
687
+ 151,
688
+ 446,
689
+ 178
690
+ ],
691
+ "page_idx": 6
692
+ },
693
+ {
694
+ "type": "text",
695
+ "text": "Figure 5: Left. Availability heuristic example where Codex mixes up the order of operations. The correct function signature (blue), square_sum matches the prompt. However, the incorrect function call (red) instead squares its inputs before summing them. The prompt is above the horizontal line, while the generated code is below. Right. Attribute substitution example where Codex relies on the function name to generate output. Codex correctly generates the desired function name (blue), but errs by using the function name instead of the prompt to generate the return statement (red). ",
696
+ "bbox": [
697
+ 173,
698
+ 186,
699
+ 826,
700
+ 270
701
+ ],
702
+ "page_idx": 6
703
+ },
704
+ {
705
+ "type": "text",
706
+ "text": "3.3.3 Inspiration: Availability heuristic ",
707
+ "text_level": 1,
708
+ "bbox": [
709
+ 176,
710
+ 295,
711
+ 459,
712
+ 310
713
+ ],
714
+ "page_idx": 6
715
+ },
716
+ {
717
+ "type": "text",
718
+ "text": "We next draw inspiration from the availability heuristic: the tendency of humans to evaluate how frequently an example occurs based on how easy it is to recall. For example, Tversky and Kahneman $\\mathbb { \\underline { { \\lVert \\nabla ^ { 9 } 7 3 \\rVert } } }$ find that humans tend to incorrectly report that there are more first words that start with “r” and “k” than have third letter “r” and “k”, because the former quickly come to mind. ",
719
+ "bbox": [
720
+ 174,
721
+ 319,
722
+ 825,
723
+ 375
724
+ ],
725
+ "page_idx": 6
726
+ },
727
+ {
728
+ "type": "text",
729
+ "text": "Using the availability heuristic as motivation, we hypothesize that code generation models may err by outputting solutions to related prompts that appear more frequently in the training set. To elicit this failure, we start with prompts that apply a unary operation before a binary operation (unary-first), then flip the order (binary-first). Programmers tend to apply unary operations first (e.g. when computing Euclidean distances or variances), so we conjecture that they appear more frequently on GitHub. We first check that flipping the order of operations decreases accuracy. Next, to test if code generation models instead outputs related prompts that occur more frequently in the training set, we measure whether code generation models instead output the unary-first solution. ",
730
+ "bbox": [
731
+ 174,
732
+ 381,
733
+ 825,
734
+ 492
735
+ ],
736
+ "page_idx": 6
737
+ },
738
+ {
739
+ "type": "text",
740
+ "text": "We consider all 12 combinations of the binary operations sum, difference, and product, with unary operations square, cube, quadruple, and square root. Focusing on Codex,5 we find that accuracy drops from $50 \\%$ to $17 \\%$ when flipping the order from unary-first to binary-first. Among combinations where flipping the order leads to error, we find that $7 5 \\%$ of the binary-first outputs are the unary-first solution. We exhibit one such error in Figure $\\boxed { 5 }$ when prompted to square the sum of its inputs, Codex generates the correct function name (square_sum ), but reverses the order of operations. Our results suggest that Codex can err by outputting solutions to related, frequent prompts in the training set. ",
741
+ "bbox": [
742
+ 173,
743
+ 498,
744
+ 825,
745
+ 597
746
+ ],
747
+ "page_idx": 6
748
+ },
749
+ {
750
+ "type": "text",
751
+ "text": "Control experiments. One worry is that the dip in performance is due the instructional nature of our prompts. We rule this out by evaluating Codex on prompts where the docstring appears beneath the function signature and is a definition rather than command, to more closely mimic some functions on GitHub. We obtain qualitatively similar results on these prompts, see Appendix A.4 for details. ",
752
+ "bbox": [
753
+ 174,
754
+ 602,
755
+ 825,
756
+ 659
757
+ ],
758
+ "page_idx": 6
759
+ },
760
+ {
761
+ "type": "text",
762
+ "text": "3.3.4 Inspiration: Attribute substitution ",
763
+ "text_level": 1,
764
+ "bbox": [
765
+ 176,
766
+ 672,
767
+ 464,
768
+ 686
769
+ ],
770
+ "page_idx": 6
771
+ },
772
+ {
773
+ "type": "text",
774
+ "text": "Finally, we draw inspiration from attribute substitution: the human tendency to respond to a complicated question using a simpler, related question [Kahneman and Frederick, 2002]. For example, a professor when asked how likely a candidate is to be tenured, may instead respond with how impressive they found their job talk. ",
775
+ "bbox": [
776
+ 174,
777
+ 695,
778
+ 825,
779
+ 751
780
+ ],
781
+ "page_idx": 6
782
+ },
783
+ {
784
+ "type": "text",
785
+ "text": "Using attribute substitution as inspiration, we hypothesize that Codex may use simple-but-incorrect heuristics to generate solutions. To elicit this failure, we add requests for conflicting function names to MathEquation prompts. For example, in Figure 5 we prompt Codex to write a program that sums its inputs called product_plus_2 . We first check that adding conflicting function names decreases Codex’s functional accuracy. Next, to test if Codex uses simple-but-incorrect heuristics to generate solutions, we check whether the generate solution matches the function name. ",
786
+ "bbox": [
787
+ 174,
788
+ 757,
789
+ 825,
790
+ 840
791
+ ],
792
+ "page_idx": 6
793
+ },
794
+ {
795
+ "type": "text",
796
+ "text": "We evaluate Codex using 90 MathEquation prompts where the desired solution and requested function name differ. To construct prompts, we begin with a prompt that Codex originally solves ",
797
+ "bbox": [
798
+ 176,
799
+ 847,
800
+ 821,
801
+ 876
802
+ ],
803
+ "page_idx": 6
804
+ },
805
+ {
806
+ "type": "table",
807
+ "img_path": "images/81dcce63968dbcc3abba5ddacec3c1af131342a4d2b0f1dc64d31ff5f93f5c32.jpg",
808
+ "table_caption": [],
809
+ "table_footnote": [],
810
+ "table_body": "<table><tr><td>Name location</td><td>Correct</td><td>Matches function name</td><td>Other error</td></tr><tr><td>No name</td><td>100.0</td><td>=</td><td>0.0</td></tr><tr><td>Docstring</td><td>4.4</td><td>80.0</td><td>15.6</td></tr><tr><td>Function signature</td><td>4.4</td><td>70.0</td><td>25.6</td></tr><tr><td>Name first</td><td>4.6</td><td>51.7</td><td>43.7</td></tr></table>",
811
+ "bbox": [
812
+ 272,
813
+ 87,
814
+ 727,
815
+ 164
816
+ ],
817
+ "page_idx": 7
818
+ },
819
+ {
820
+ "type": "text",
821
+ "text": "Table 2: Results of the attribute substitution experiments. We report accuracy when we do not request a contradictory function name (no name), we request a function name in the docstring (docstring), in the function signature below the docstring (function signature), or above the docstring (name first). Overall, we find that Codex frequently generates solutions based on the function name. ",
822
+ "bbox": [
823
+ 173,
824
+ 166,
825
+ 826,
826
+ 223
827
+ ],
828
+ "page_idx": 7
829
+ },
830
+ {
831
+ "type": "text",
832
+ "text": "(sum, difference, or product), then append a request for a specific, contradictory function name (see Appendix $\\underline { { \\vert \\mathbf { A . } 4 \\vert } }$ for full implementation details). ",
833
+ "bbox": [
834
+ 173,
835
+ 255,
836
+ 825,
837
+ 284
838
+ ],
839
+ "page_idx": 7
840
+ },
841
+ {
842
+ "type": "text",
843
+ "text": "We report our experimental results in Table $\\triangledown$ When we request a conflicting function name, Codex’s accuracy drops from $100 \\%$ to only $4 . 4 \\% - 4 . 6 \\%$ . This finding holds whether we request the function name in the docstring, write it in the function signature below the docstring, or write the function name over a simple description on the function. Moreover, for between $52 \\%$ and $80 \\%$ of prompts, Codex responds with the function specified in the function name. Our results indicate that Codex can err by using simple-but-incorrect heuristics to generate solutions. ",
844
+ "bbox": [
845
+ 173,
846
+ 287,
847
+ 826,
848
+ 372
849
+ ],
850
+ "page_idx": 7
851
+ },
852
+ {
853
+ "type": "text",
854
+ "text": "4 GPT-3 Results ",
855
+ "text_level": 1,
856
+ "bbox": [
857
+ 174,
858
+ 391,
859
+ 326,
860
+ 407
861
+ ],
862
+ "page_idx": 7
863
+ },
864
+ {
865
+ "type": "text",
866
+ "text": "In this section, we extend our study from Codex to GPT-3. To test GPT-3 for failure modes, we try to faithfully reproduce and extend the anchoring experiment of Jacowitz and Kahneman [1995] and framing effect experiment of Tversky and Kahneman [1981]. ",
867
+ "bbox": [
868
+ 174,
869
+ 421,
870
+ 825,
871
+ 464
872
+ ],
873
+ "page_idx": 7
874
+ },
875
+ {
876
+ "type": "text",
877
+ "text": "Anchoring. As in Section 3.3.2 we study Section 3.3.2, we study anchoring: humans’ tendency to insufficiently adjust their estimates away from an initial value [Tversky and Kahneman, 1974]. We largely replicate the anchoring study presented in Jacowitz and Kahneman [1995], but test the “davinci-001” version of OpenAI’s GPT-3 instead of humans. ",
878
+ "bbox": [
879
+ 173,
880
+ 469,
881
+ 825,
882
+ 525
883
+ ],
884
+ "page_idx": 7
885
+ },
886
+ {
887
+ "type": "text",
888
+ "text": "In their original experiment, Jacowitz and Kahneman asked students to estimate quantities such as the length of the Mississippi river in miles. They then asked new students to estimate the same quantities, but first gave them a upper or lower bound on the true answer (e.g. the Mississippi river is longer than 700 miles), which they call anchors. They find that students tend to underestimate the true quantity when prompted with the lower anchor, and overestimate it when prompted with the upper anchor. ",
889
+ "bbox": [
890
+ 174,
891
+ 531,
892
+ 825,
893
+ 602
894
+ ],
895
+ "page_idx": 7
896
+ },
897
+ {
898
+ "type": "text",
899
+ "text": "We adapt the anchoring study from Jacowitz and Kahneman [1995] by finding the true answer for 14 of their 15 original questions6, then computing upper and lower anchors by increasing and decreasing the true answer by a fixed percentage $p$ . See Appendix $\\mathbf { B . l }$ for a full list of questions and true answers. As an example, if the actual answer is 2000 and $p$ is $5 0 \\%$ , the upper anchor is 3000 and the lower anchor is 1000. We use this bound as an anchor, so that a typical prompt might be: ",
900
+ "bbox": [
901
+ 174,
902
+ 607,
903
+ 825,
904
+ 678
905
+ ],
906
+ "page_idx": 7
907
+ },
908
+ {
909
+ "type": "text",
910
+ "text": "What is the length of the Mississippi River (in miles)? Answer: ",
911
+ "bbox": [
912
+ 282,
913
+ 720,
914
+ 697,
915
+ 736
916
+ ],
917
+ "page_idx": 7
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "To study anchoring in GPT-3, we measure how prepending the anchor changes GPT-3’s estimate. We categorize four potential changes: the estimate does not change, the estimate shifts towards the anchor, the estimate shifts away from the anchor, and the estimate is gibberish. We report the results in Table $^ 3 .$ for $p \\in \\{ 2 0 \\% , 5 0 \\% \\}$ . We find that GPT-3 routinely updates its estimate when an anchor is prepended, and tends to shift the estimate towards the anchor. We also find that while GPT-3’s updated estimate sometimes matches the anchor exactly $67 \\%$ of the time), it also often lands between the anchor and the original prediction, mirroring the behavior of humans. ",
922
+ "bbox": [
923
+ 173,
924
+ 743,
925
+ 825,
926
+ 842
927
+ ],
928
+ "page_idx": 7
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "Our replication has a few limitations. Like the original study our sample size is small, we construct prompts with templates, and many of the outputs—on average $41 \\%$ —are gibberish. Nevertheless, our results suggest that GPT-3 incorporates the anchor during estimation. ",
933
+ "bbox": [
934
+ 176,
935
+ 847,
936
+ 825,
937
+ 890
938
+ ],
939
+ "page_idx": 7
940
+ },
941
+ {
942
+ "type": "table",
943
+ "img_path": "images/ca122c6a93f0d5e07759a579d77303538770f464f3628eed3bba4e6c8f66b75d.jpg",
944
+ "table_caption": [
945
+ "Anchor change to model output "
946
+ ],
947
+ "table_footnote": [],
948
+ "table_body": "<table><tr><td>p</td><td>No change</td><td>Towards anchor</td><td>Away from anchor</td><td>Gibberish</td></tr><tr><td>20%</td><td>10.7</td><td>28.6</td><td>10.7</td><td>50.0</td></tr><tr><td>50%</td><td>14.3</td><td>42.9</td><td>10.7</td><td>32.1</td></tr></table>",
949
+ "bbox": [
950
+ 276,
951
+ 101,
952
+ 720,
953
+ 150
954
+ ],
955
+ "page_idx": 8
956
+ },
957
+ {
958
+ "type": "text",
959
+ "text": "Table 3: Results of the adaptation of the anchoring study from Jacowitz and Kahneman [1995] on GPT-3. We consider anchors that are $20 \\%$ and $50 \\%$ increases and decreases from the ground truth answer, and measure how often GPT-3’s revised prediction does not change, shifts towards / away from the anchor, or is gibberish, aggregated across lower and upper anchors. ",
960
+ "bbox": [
961
+ 173,
962
+ 154,
963
+ 825,
964
+ 210
965
+ ],
966
+ "page_idx": 8
967
+ },
968
+ {
969
+ "type": "text",
970
+ "text": "un \nDelete all files in an inputted directory that import all \nof statsmodels, plotly, seaborn, and scipy \n“”” \nimport os \nimport re \ndef delete_all(directory): for root, dir, file in os.walk(directory): for f in files: with open(os.path.join(root, f), ‘r’) as fp: if re.search(“import statsmodels”, fp.read()): os.remove(os.path.join(root, f)) ",
971
+ "bbox": [
972
+ 179,
973
+ 234,
974
+ 555,
975
+ 273
976
+ ],
977
+ "page_idx": 8
978
+ },
979
+ {
980
+ "type": "text",
981
+ "text": "",
982
+ "bbox": [
983
+ 181,
984
+ 279,
985
+ 568,
986
+ 358
987
+ ],
988
+ "page_idx": 8
989
+ },
990
+ {
991
+ "type": "image",
992
+ "img_path": "images/71ff0596f1e01e59c72b5c20ada600f5859e331d42315f4d75e7a8346414e74a.jpg",
993
+ "image_caption": [
994
+ "Figure 6: Left. Example where Codex incorrectly deletes files. We prompt Codex to delete files containing all of statsmodels, plotly, seaborn, and scipy. Codex correctly iterates through all files in the inputted directory (blue), but then incorrectly deletes all files containing statsmodels (red), as attribute substitution suggests. Right. Plot describing the errors Codex makes as a function of the number of packages. We find that Codex often incorrectly deletes files if they contain any of the listed packages, and relies more on just the first package as the number of packages increases. "
995
+ ],
996
+ "image_footnote": [],
997
+ "bbox": [
998
+ 578,
999
+ 236,
1000
+ 818,
1001
+ 356
1002
+ ],
1003
+ "page_idx": 8
1004
+ },
1005
+ {
1006
+ "type": "text",
1007
+ "text": "Framing effect. As in Section $3 . 3 . 1 ,$ we study the framing effect: predictable shifts in human responses when the same problem is framed in different ways. We largely replicate the framing experiment presented in Tversky and Kahneman [1981]: we compare GPT-3’s responses to two equivalent decisions: choosing to either deterministically save (or let die) some fraction of a population, or to probabilistically save (let die) the whole population. ",
1008
+ "bbox": [
1009
+ 173,
1010
+ 476,
1011
+ 825,
1012
+ 546
1013
+ ],
1014
+ "page_idx": 8
1015
+ },
1016
+ {
1017
+ "type": "text",
1018
+ "text": "We measure the rate at which GPT-3 chooses the probabilistic option across different population sizes and different fractions / probabilities. See Section $\\boxed { \\mathbf { B } . 2 }$ for full results. When using the probability in the original study, GPT-3 qualitatively mirrors humans: it chooses the probabilistic option far more frequently under the “not save” framing than under the “save framing”. However, for higher probabilities, GPT-3 consistently chooses the probabilistic option for both framings; we conjecture that humans could exhibit similar behavior in this regime, since the probabilistic option is more certain. Overall, our results suggest that GPT-3 selects different options based on the framing, and could be a test-bed to identify qualitative human behaviors without running full human studies. ",
1019
+ "bbox": [
1020
+ 173,
1021
+ 553,
1022
+ 825,
1023
+ 664
1024
+ ],
1025
+ "page_idx": 8
1026
+ },
1027
+ {
1028
+ "type": "text",
1029
+ "text": "5 High-Impact Errors ",
1030
+ "text_level": 1,
1031
+ "bbox": [
1032
+ 174,
1033
+ 685,
1034
+ 374,
1035
+ 703
1036
+ ],
1037
+ "page_idx": 8
1038
+ },
1039
+ {
1040
+ "type": "text",
1041
+ "text": "We have shown how our framework helps us elicit failures of large language models. In this section, we use our framework to construct cases where Codex makes high-impact errors: harmful errors that are hard to undo. Specifically, we construct prompts where Codex incorrectly deletes files. ",
1042
+ "bbox": [
1043
+ 176,
1044
+ 717,
1045
+ 825,
1046
+ 760
1047
+ ],
1048
+ "page_idx": 8
1049
+ },
1050
+ {
1051
+ "type": "text",
1052
+ "text": "As in Section $3 . 3 . 4$ we draw inspiration from attribute substitution: the tendency of humans to respond to a complex question with a simpler, related question. Using attribute substitution as motivation, we hypothesize that Codex may simplify complex expressions such as conjunctions. Instead of checking all components of a conjunction at once, it might “give up” and consider subsets of the components individually (e.g. checking for $A$ or $A \\lor B$ instead of $A \\land B$ ). To elicit this failure, we prompt Codex to delete files containing specific sets of package imports; see Figure $6$ for an example. We measure how often Codex generates a simpler output that erroneously deletes files, as well as how often it produces the correct output. See Appendix $\\boxed { \\mathbf { C } }$ for additional details. ",
1053
+ "bbox": [
1054
+ 173,
1055
+ 765,
1056
+ 825,
1057
+ 878
1058
+ ],
1059
+ "page_idx": 8
1060
+ },
1061
+ {
1062
+ "type": "text",
1063
+ "text": "We test for two types of simpler outputs: code deleting all files containing first package in the set (i.e. $A$ instead of $A \\land B$ ), and code deleting all files containing any package in the set (i.e. $A \\lor B$ instead of $A \\land B )$ ). The latter operation is computationally simpler than checking if a file contains all packages, since Codex can delete a file whenever a single package in the set appears. ",
1064
+ "bbox": [
1065
+ 173,
1066
+ 883,
1067
+ 821,
1068
+ 911
1069
+ ],
1070
+ "page_idx": 8
1071
+ },
1072
+ {
1073
+ "type": "text",
1074
+ "text": "",
1075
+ "bbox": [
1076
+ 171,
1077
+ 92,
1078
+ 823,
1079
+ 119
1080
+ ],
1081
+ "page_idx": 9
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "In Figure $\\textcircled { 6 }$ we illustrate the breakdown of the errors Codex makes as a function of the number of package imports in the prompt. We find that Codex erroneously deletes files on at least $80 \\%$ of prompts when the number of package imports is at least three, despite producing a correct output on $90 \\%$ of prompts when the number of packages is at most two. Moreover, we find that Codex increasingly errs by using only the first package as the problem gets more challenging (i.e. the number of packages increases), as attribute substitution predicts. ",
1086
+ "bbox": [
1087
+ 174,
1088
+ 126,
1089
+ 825,
1090
+ 209
1091
+ ],
1092
+ "page_idx": 9
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "Control experiments. To very that our findings generalize to different classes of realistic prompts, we test Codex on prompts containing a descriptive docstring beneath the function signature delete_all_with_libraries(directory). We observe qualitatively similar results, though we find more instances of low-impact errors; see Appendix $\\mathbf { \\bar { C } }$ for details. Overall, our results demonstrate how our framework can preemptively elicit high-impact errors, like erroneous deletions. ",
1097
+ "bbox": [
1098
+ 174,
1099
+ 215,
1100
+ 825,
1101
+ 285
1102
+ ],
1103
+ "page_idx": 9
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "6 Discussion ",
1108
+ "text_level": 1,
1109
+ "bbox": [
1110
+ 174,
1111
+ 304,
1112
+ 294,
1113
+ 320
1114
+ ],
1115
+ "page_idx": 9
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "In this work, we identify and test for classes of errors that open-ended generation systems can make, using cognitive biases as motivation. To do so, we generate hypotheses for potential qualitative failure modes, then construct transformations over prompts that elicit these failures. Our experiments uncover deficiencies of Codex, CodeGen, and GPT-3, and elicit high-impact errors that are challenging to undo. While we focus on a few specific failure modes, future work could apply our framework to uncover additional failures. Moreover, our framework queries systems as a black-box, so it could be used to quickly probe for errors in future systems as they are released. ",
1120
+ "bbox": [
1121
+ 174,
1122
+ 335,
1123
+ 825,
1124
+ 433
1125
+ ],
1126
+ "page_idx": 9
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "Some of our results highlight how optimizing likelihood could be at odds with human intent. For example, over GitHub, programs may more often match their function signature than docstring (Section $3 . 3 . 3 )$ , or tend to complete to pass if the preceding function does (Section 3.3.1). Nevertheless, our results elicit qualitative errors regardless of the “correct” behavior (i.e. even when what is incorrect and correct flips), and demonstrate the importance of documenting qualitative failures. ",
1131
+ "bbox": [
1132
+ 174,
1133
+ 439,
1134
+ 825,
1135
+ 508
1136
+ ],
1137
+ "page_idx": 9
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "The reliability challenges posed by the open-ended generation systems that we study sometimes also apply to classifiers. Some classification errors can be more costly than others [Oakden-Rayner et al., 2020], classifiers may use irrelevant information to make predictions $\\lVert \\overline { { \\mathrm { S a g a w a ~ e t ~ a l . } \\rVert \\mathbb { 2 0 } 2 0 } } \\rVert$ , and input-level transformations like universal adversarial triggers $\\rVert \\overline { { \\mathrm { W a l l a c e ~ e t ~ a l . } } } \\rVert \\overline { { 2 0 1 9 } } \\rVert$ and distribution shifts [Hendrycks and Dietterich, $\\boxed { 2 0 1 9 }$ induce errors. However, while classification errors may be succinctly summarized with a confusion matrix, generation errors cannot, since each output appears infrequently. To tame the large output space, our transformations must induce categories of errors that we can reliably measure. Despite this additional constraint, we are able to construct model-agnostic transformations: we do not use the training data, model parameters, or even output logits. Our success in this restricted setting demonstrates the comparative brittleness of completion systems. ",
1142
+ "bbox": [
1143
+ 173,
1144
+ 515,
1145
+ 825,
1146
+ 654
1147
+ ],
1148
+ "page_idx": 9
1149
+ },
1150
+ {
1151
+ "type": "text",
1152
+ "text": "We present a method to systematically elicit errors from large language models. While we believe our work is important to understand model behavior, bad actors could exploit the errors we reveal (e.g. by deleting files on systems with a Codex back-end). Nevertheless, we introduce new robustness challenges for developers and identify misuses of these models, which we feel supersedes this risk. ",
1153
+ "bbox": [
1154
+ 174,
1155
+ 660,
1156
+ 825,
1157
+ 715
1158
+ ],
1159
+ "page_idx": 9
1160
+ },
1161
+ {
1162
+ "type": "text",
1163
+ "text": "As a subroutine in our experimental pipeline, we use cognitive biases as inspiration to identify potential failure modes. This is an example of using a reference system—a system that is analogous to the ML models we study in some meaningful way—to generate insights into ML systems [Steinhardt, $\\boxed { 2 0 2 2 }$ We use humans as the reference, focusing specifically on their susceptibility to cognitive biases. Other references, such as complex systems or evolution, may uncover new errors and insights. Moreover, ML systems could additionally err in ways that known systems do not, so it will also be useful to have intrinsic methods for characterizing model errors. Overall, our work underscores the need for more extensive testing of generative ML systems before their widespread deployment. ",
1164
+ "bbox": [
1165
+ 173,
1166
+ 720,
1167
+ 825,
1168
+ 833
1169
+ ],
1170
+ "page_idx": 9
1171
+ },
1172
+ {
1173
+ "type": "text",
1174
+ "text": "Acknowledgements ",
1175
+ "text_level": 1,
1176
+ "bbox": [
1177
+ 176,
1178
+ 852,
1179
+ 338,
1180
+ 868
1181
+ ],
1182
+ "page_idx": 9
1183
+ },
1184
+ {
1185
+ "type": "text",
1186
+ "text": "We thank the anonymous reviewers, Ruiqi Zhong, Jean-Stanislas Denain, Aditi Raghunathan, Jessy Lin, and Lawrence Chan for feedback. This work was supported by NSF Award Grant no. 1804794. ",
1187
+ "bbox": [
1188
+ 174,
1189
+ 882,
1190
+ 825,
1191
+ 911
1192
+ ],
1193
+ "page_idx": 9
1194
+ },
1195
+ {
1196
+ "type": "text",
1197
+ "text": "References ",
1198
+ "text_level": 1,
1199
+ "bbox": [
1200
+ 174,
1201
+ 89,
1202
+ 266,
1203
+ 106
1204
+ ],
1205
+ "page_idx": 10
1206
+ },
1207
+ {
1208
+ "type": "text",
1209
+ "text": "Emily Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchel. On the dangers of stochastic parrots: Can language models be too big? In ACM Conference on Fairness, Accountability, and Transparency (FAccT), 2021. ",
1210
+ "bbox": [
1211
+ 174,
1212
+ 113,
1213
+ 825,
1214
+ 155
1215
+ ],
1216
+ "page_idx": 10
1217
+ },
1218
+ {
1219
+ "type": "text",
1220
+ "text": "Su Lin Blodgett, Gilsinia Lopez, Alexandra Olteanu, Robert Sim, and Hanna Wallach. Stereotyping norwegian salmon: An inventory of pitfalls in fairness benchmark datasets. In Association for Computational Linguistics (ACL), 2021. ",
1221
+ "bbox": [
1222
+ 174,
1223
+ 164,
1224
+ 823,
1225
+ 207
1226
+ ],
1227
+ "page_idx": 10
1228
+ },
1229
+ {
1230
+ "type": "text",
1231
+ "text": "Rishi Bommasani, Drew A. Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S. Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, Erik Brynjolfsson, Shyamal Buch, Dallas Card, Rodrigo Castellon, Niladri Chatterji, Annie Chen, Kathleen Creel, Jared Quincy Davis, Dorottya Demszky, Chris Donahue, Moussa Doumbouya, Esin Durmus, Stefano Ermon, John Etchemendy, Kawin Ethayarajh, Li Fei-Fei, Chelsea Finn, Trevor Gale, Lauren Gillespie, Karan Goel, Noah Goodman, Shelby Grossman, Neel Guha, Tatsunori Hashimoto, Peter Henderson, John Hewitt, Daniel E. Ho, Jenny Hong, Kyle Hsu, Jing Huang, Thomas Icard, Saahil Jain, Dan Jurafsky, Pratyusha Kalluri, Siddharth Karamcheti, Geoff Keeling, Fereshte Khani, Omar Khattab, Pang Wei Koh, Mark Krass, Ranjay Krishna, Rohith Kuditipudi, Ananya Kumar, Faisal Ladhak, Mina Lee, Tony Lee, Jure Leskovec, Isabelle Levent, Xiang Lisa Li, Xuechen Li, Tengyu Ma, Ali Malik, Christopher D. Manning, Suvir Mirchandani, Eric Mitchell, Zanele Munyikwa, Suraj Nair, Avanika Narayan, Deepak Narayanan, Ben Newman, Allen Nie, Juan Carlos Niebles, Hamed Nilforoshan, Julian Nyarko, Giray Ogut, Laurel Orr, Isabel Papadimitriou, Joon Sung Park, Chris Piech, Eva Portelance, Christopher Potts, Aditi Raghunathan, Rob Reich, Hongyu Ren, Frieda Rong, Yusuf Roohani, Camilo Ruiz, Jack Ryan, Christopher Ré, Dorsa Sadigh, Shiori Sagawa, Keshav Santhanam, Andy Shih, Krishnan Srinivasan, Alex Tamkin, Rohan Taori, Armin W. Thomas, Florian Tramèr, Rose E. Wang, William Wang, Bohan Wu, Jiajun Wu, Yuhuai Wu, Sang Michael Xie, Michihiro Yasunaga, Jiaxuan You, Matei Zaharia, Michael Zhang, Tianyi Zhang, Xikun Zhang, Yuhui Zhang, Lucia Zheng, Kaitlyn Zhou, and Percy Liang. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021. ",
1232
+ "bbox": [
1233
+ 176,
1234
+ 210,
1235
+ 826,
1236
+ 491
1237
+ ],
1238
+ "page_idx": 10
1239
+ },
1240
+ {
1241
+ "type": "text",
1242
+ "text": "Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. ",
1243
+ "bbox": [
1244
+ 173,
1245
+ 500,
1246
+ 826,
1247
+ 597
1248
+ ],
1249
+ "page_idx": 10
1250
+ },
1251
+ {
1252
+ "type": "text",
1253
+ "text": "Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, Alina Oprea, and Colin Raffel. Extracting training data from large language models. arXiv preprint arXiv:2012.07805, 2020. ",
1254
+ "bbox": [
1255
+ 178,
1256
+ 606,
1257
+ 821,
1258
+ 648
1259
+ ],
1260
+ "page_idx": 10
1261
+ },
1262
+ {
1263
+ "type": "text",
1264
+ "text": "Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021. ",
1265
+ "bbox": [
1266
+ 176,
1267
+ 657,
1268
+ 826,
1269
+ 809
1270
+ ],
1271
+ "page_idx": 10
1272
+ },
1273
+ {
1274
+ "type": "text",
1275
+ "text": "Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021. ",
1276
+ "bbox": [
1277
+ 174,
1278
+ 818,
1279
+ 826,
1280
+ 873
1281
+ ],
1282
+ "page_idx": 10
1283
+ },
1284
+ {
1285
+ "type": "text",
1286
+ "text": "Angela Fan, Yacine Jernite, Ethan Perez, David Grangier, Jason Weston, and Michael Auli. ELI5: Long form question answering. In Association for Computational Linguistics (ACL), 2019. ",
1287
+ "bbox": [
1288
+ 178,
1289
+ 882,
1290
+ 821,
1291
+ 911
1292
+ ],
1293
+ "page_idx": 10
1294
+ },
1295
+ {
1296
+ "type": "text",
1297
+ "text": "Saadia Gabriel, Asli Celikyilmaz, Rahul Jha, Yejin Choi, and Jianfeng Gao. GO FIGURE: A meta evaluation of factuality in summarization. In Findings of the Association for Computational Linguistics (Findings of ACL), 2021. ",
1298
+ "bbox": [
1299
+ 173,
1300
+ 90,
1301
+ 823,
1302
+ 133
1303
+ ],
1304
+ "page_idx": 11
1305
+ },
1306
+ {
1307
+ "type": "text",
1308
+ "text": "Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A Smith. Realtoxicityprompts: Evaluating neural toxic degeneration in language models. arXiv preprint arXiv:2009.11462, 2020. ",
1309
+ "bbox": [
1310
+ 173,
1311
+ 143,
1312
+ 826,
1313
+ 186
1314
+ ],
1315
+ "page_idx": 11
1316
+ },
1317
+ {
1318
+ "type": "text",
1319
+ "text": "Sophie Groenwold, Lily Ou, Aesha Parekh, Samhita Honnavalli, Sharon Levy, Diba Mirza, and William Yang Wang. Investigating african-american vernacular english in transformer-based text generation. In Empirical Methods in Natural Language Processing (EMNLP), 2020. ",
1320
+ "bbox": [
1321
+ 174,
1322
+ 196,
1323
+ 823,
1324
+ 239
1325
+ ],
1326
+ "page_idx": 11
1327
+ },
1328
+ {
1329
+ "type": "text",
1330
+ "text": "Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations (ICLR), 2019. ",
1331
+ "bbox": [
1332
+ 173,
1333
+ 250,
1334
+ 823,
1335
+ 291
1336
+ ],
1337
+ "page_idx": 11
1338
+ },
1339
+ {
1340
+ "type": "text",
1341
+ "text": "Dan Hendrycks, Steven Basart, Saurav Kadavath, Mantas Mazeika, Akul Arora, Ethan Guo, Collin Burns, Samir Puranik, Horace He, Dawn Song, and Jacob Steinhardt. Measuring coding challenge competence with APPS. In Advances in Neural Information Processing Systems (NeurIPS), 2021a. ",
1342
+ "bbox": [
1343
+ 178,
1344
+ 303,
1345
+ 823,
1346
+ 347
1347
+ ],
1348
+ "page_idx": 11
1349
+ },
1350
+ {
1351
+ "type": "text",
1352
+ "text": "Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. In International Conference on Learning Representations (ICLR), 2021b. ",
1353
+ "bbox": [
1354
+ 178,
1355
+ 356,
1356
+ 823,
1357
+ 398
1358
+ ],
1359
+ "page_idx": 11
1360
+ },
1361
+ {
1362
+ "type": "text",
1363
+ "text": "Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. Measuring mathematical problem solving with the MATH dataset. In Advances in Neural Information Processing Systems (NeurIPS), 2021c. ",
1364
+ "bbox": [
1365
+ 173,
1366
+ 409,
1367
+ 826,
1368
+ 452
1369
+ ],
1370
+ "page_idx": 11
1371
+ },
1372
+ {
1373
+ "type": "text",
1374
+ "text": "Abigail Z. Jacobs and Hanna Wallach. Measurement and fairness. In ACM Conference on Fairness, Accountability, and Transparency (FAccT), 2021. ",
1375
+ "bbox": [
1376
+ 173,
1377
+ 462,
1378
+ 825,
1379
+ 492
1380
+ ],
1381
+ "page_idx": 11
1382
+ },
1383
+ {
1384
+ "type": "text",
1385
+ "text": "Karen E. Jacowitz and Daniel Kahneman. Measures of anchoring in estimation tasks. Personality and Social Psychology Bulletin, 21(11):1161–1166, 1995. ",
1386
+ "bbox": [
1387
+ 169,
1388
+ 501,
1389
+ 825,
1390
+ 531
1391
+ ],
1392
+ "page_idx": 11
1393
+ },
1394
+ {
1395
+ "type": "text",
1396
+ "text": "Daniel Kahneman and Shane Frederick. Representativeness revisited: Attribute substitution in intuitive judgment. In Heuristics and Biases: The Psychology of Intuitive Judgement, pages 49–81. 2002. ",
1397
+ "bbox": [
1398
+ 174,
1399
+ 540,
1400
+ 825,
1401
+ 583
1402
+ ],
1403
+ "page_idx": 11
1404
+ },
1405
+ {
1406
+ "type": "text",
1407
+ "text": "Kalpesh Krishna, Aurko Roy, and Mohit Iyyer. Hurdles to progress in long-form question answering. In North American Association for Computational Linguistics (NAACL), 2021. ",
1408
+ "bbox": [
1409
+ 173,
1410
+ 593,
1411
+ 823,
1412
+ 623
1413
+ ],
1414
+ "page_idx": 11
1415
+ },
1416
+ {
1417
+ "type": "text",
1418
+ "text": "Stephanie Lin, Jacob Hilton, and Owain Evans. Truthfulqa: Measuring how models mimic human falsehoods. arXiv preprint arXiv:2109.07958, 2021. ",
1419
+ "bbox": [
1420
+ 173,
1421
+ 632,
1422
+ 821,
1423
+ 662
1424
+ ],
1425
+ "page_idx": 11
1426
+ },
1427
+ {
1428
+ "type": "text",
1429
+ "text": "Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. What makes good in-context examples for GPT-3. arXiv preprint arXiv:2101.06804, 2021. ",
1430
+ "bbox": [
1431
+ 171,
1432
+ 671,
1433
+ 825,
1434
+ 702
1435
+ ],
1436
+ "page_idx": 11
1437
+ },
1438
+ {
1439
+ "type": "text",
1440
+ "text": "David E. Meyer. Semantic priming well established. Science, 345(6196):523–523, 2014. ",
1441
+ "bbox": [
1442
+ 171,
1443
+ 712,
1444
+ 758,
1445
+ 727
1446
+ ],
1447
+ "page_idx": 11
1448
+ },
1449
+ {
1450
+ "type": "text",
1451
+ "text": "Moin Nadeem, Anna Bethke, and Siva Reddy. Stereoset: Measuring stereotypical bias in pretrained language models. arXiv preprint arXiv:2004.09456, 2020. ",
1452
+ "bbox": [
1453
+ 171,
1454
+ 737,
1455
+ 826,
1456
+ 766
1457
+ ],
1458
+ "page_idx": 11
1459
+ },
1460
+ {
1461
+ "type": "text",
1462
+ "text": "Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huam Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. A conversational paradigm for program synthesis. arXiv preprint arXiv:2203.13474, 2022. ",
1463
+ "bbox": [
1464
+ 173,
1465
+ 776,
1466
+ 825,
1467
+ 819
1468
+ ],
1469
+ "page_idx": 11
1470
+ },
1471
+ {
1472
+ "type": "text",
1473
+ "text": "Luke Oakden-Rayner, Jared Dunnmon, Gustavo Carneiro, and Christopher Ré. Hidden stratification causes clinically meaningful failures in machine learning for medical imaging. In Proceedings of the ACM Conference on Health, Inference, and Learning, pages 151–159, 2020. ",
1474
+ "bbox": [
1475
+ 174,
1476
+ 829,
1477
+ 823,
1478
+ 873
1479
+ ],
1480
+ "page_idx": 11
1481
+ },
1482
+ {
1483
+ "type": "text",
1484
+ "text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019. ",
1485
+ "bbox": [
1486
+ 174,
1487
+ 882,
1488
+ 820,
1489
+ 911
1490
+ ],
1491
+ "page_idx": 11
1492
+ },
1493
+ {
1494
+ "type": "text",
1495
+ "text": "Jack W. Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, J. Aslanides, Sarah Henderson, Roman Ring, Susannah Young, Eliza Rutherford, Tom Hennigan, Jacob Menick, Albin Cassirer, Richard Powell, G. V. D. Driessche, Lisa Anne Hendricks, Maribeth Rauh, Po-Sen Huang, Amelia Glaese, Johannes Welbl, Sumanth Dathathri, Saffron Huang, Jonathan Uesato, John F. J. Mellor, I. Higgins, Antonia Creswell, Nathan McAleese, Amy Wu, Erich Elsen, Siddhant M. Jayakumar, Elena Buchatskaya, D. Budden, Esme Sutherland, K. Simonyan, Michela Paganini, L. Sifre, Lena Martens, Xiang Lorraine Li, A. Kuncoro, Aida Nematzadeh, E. Gribovskaya, Domenic Donato, Angeliki Lazaridou, A. Mensch, J. Lespiau, Maria Tsimpoukelli, N. Grigorev, Doug Fritz, Thibault Sottiaux, Mantas Pajarskas, Tobias Pohlen, Zhitao Gong, Daniel Toyama, Cyprien de Masson d’Autume, Yujia Li, Tayfun Terzi, Vladimir Mikulik, I. Babuschkin, Aidan Clark, Diego de Las Casas, Aurelia Guy, Chris Jones, James Bradbury, Matthew Johnson, Blake A. Hechtman, Laura Weidinger, Iason Gabriel, William S. Isaac, Edward Lockhart, Simon Osindero, Laura Rimell, Chris Dyer, Oriol Vinyals, Kareem W. Ayoub, Jeff Stanway, L. Bennett, D. Hassabis, K. Kavukcuoglu, and Geoffrey Irving. Scaling language models: Methods, analysis & insights from training gopher. arXiv, 2021. ",
1496
+ "bbox": [
1497
+ 176,
1498
+ 90,
1499
+ 826,
1500
+ 299
1501
+ ],
1502
+ "page_idx": 12
1503
+ },
1504
+ {
1505
+ "type": "text",
1506
+ "text": "Ashwin Ram, Rohit Prasad, Chandra Khatri, Anu Venkatesh, Raefer Gabriel, Qing Liu, Jeff Nunn, Behnam Hedayatnia, Ming Cheng, Ashish Nagar, Eric King, Kate Bland, Amanda Wartick, Yi Pan, Han Song, Sk Jayadevan, Gene Hwang, and Art Pettigrue. Conversational ai: The science behind the alexa prize. arXiv preprint arXiv:1801.03604, 2018. ",
1507
+ "bbox": [
1508
+ 174,
1509
+ 306,
1510
+ 826,
1511
+ 363
1512
+ ],
1513
+ "page_idx": 12
1514
+ },
1515
+ {
1516
+ "type": "text",
1517
+ "text": "Sascha Rothe, Shashi Narayan, and Aliaksei Severyn. Leveraging pre-trained checkpoints for sequence generation tasks. Transactions of the Association for Computational Linguistics (TACL), 8:264–280, 2020. ",
1518
+ "bbox": [
1519
+ 174,
1520
+ 371,
1521
+ 826,
1522
+ 412
1523
+ ],
1524
+ "page_idx": 12
1525
+ },
1526
+ {
1527
+ "type": "text",
1528
+ "text": "Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations (ICLR), 2020. ",
1529
+ "bbox": [
1530
+ 174,
1531
+ 421,
1532
+ 826,
1533
+ 465
1534
+ ],
1535
+ "page_idx": 12
1536
+ },
1537
+ {
1538
+ "type": "text",
1539
+ "text": "Emily Sheng, Kai-Wei Chang, Premkumar Natarajan, and Nanyun Peng. The woman worked as a babysitter: On biases in language generation. In Empirical Methods in Natural Language Processing (EMNLP), 2019. ",
1540
+ "bbox": [
1541
+ 173,
1542
+ 473,
1543
+ 826,
1544
+ 515
1545
+ ],
1546
+ "page_idx": 12
1547
+ },
1548
+ {
1549
+ "type": "text",
1550
+ "text": "Kurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela, and Jason Weston. Retrieval augmentation reduces hallucination in conversation. arXiv preprint arXiv:2104.07567, 2021. ",
1551
+ "bbox": [
1552
+ 171,
1553
+ 522,
1554
+ 823,
1555
+ 553
1556
+ ],
1557
+ "page_idx": 12
1558
+ },
1559
+ {
1560
+ "type": "text",
1561
+ "text": "Jacob Steinhardt. Anchor weights for ML. Bounded Regret, 2022. ",
1562
+ "bbox": [
1563
+ 173,
1564
+ 560,
1565
+ 607,
1566
+ 575
1567
+ ],
1568
+ "page_idx": 12
1569
+ },
1570
+ {
1571
+ "type": "text",
1572
+ "text": "Nisan Stiennon, Long Ouyang, Jeff Wu, Daniel M. Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, and Paul Christiano. Learning to summarize from human feedback. In Advances in Neural Information Processing Systems (NeurIPS), 2020. ",
1573
+ "bbox": [
1574
+ 174,
1575
+ 583,
1576
+ 826,
1577
+ 626
1578
+ ],
1579
+ "page_idx": 12
1580
+ },
1581
+ {
1582
+ "type": "text",
1583
+ "text": "Fritz Strack, Leonard L. Martin, and Nobert Schwarz. Priming and communication: Social determinants of information use in judgments of life satisfaction. European Journal of Social Psychology, 18(5):429–442, 1988. ",
1584
+ "bbox": [
1585
+ 173,
1586
+ 635,
1587
+ 826,
1588
+ 676
1589
+ ],
1590
+ "page_idx": 12
1591
+ },
1592
+ {
1593
+ "type": "text",
1594
+ "text": "Leonard Tang, Elizabeth Ke, Nikhil Singh, Nakul Verma, and Iddo Drori. Solving probability and statistics problems by program synthesis. arXiv preprint arXiv:2111.08276, 2021. ",
1595
+ "bbox": [
1596
+ 173,
1597
+ 684,
1598
+ 823,
1599
+ 714
1600
+ ],
1601
+ "page_idx": 12
1602
+ },
1603
+ {
1604
+ "type": "text",
1605
+ "text": "Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, YaGuang Li, Hongrae Lee, Huaixiu Steven Zheng, Amin Ghafouri, Marcelo Menegali, Yanping Huang, Maxim Krikun, Dmitry Lepikhin, James Qin, Dehao Chen, Yuanzhong Xu, Zhifeng Chen, Adam Roberts, Maarten Bosma, Yanqi Zhou, Chung-Ching Chang, Igor Krivokon, Will Rusch, Marc Pickett, Kathleen Meier-Hellstern, Meredith Ringel Morris, Tulsee Doshi, Renelito Delos Santos, Toju Duke, Johnny Soraker, Ben Zevenbergen, Vinodkumar Prabhakaran, Mark Diaz, Ben Hutchinson, Kristen Olson, Alejandra Molina, Erin Hoffman-John, Josh Lee, Lora Aroyo, Ravi Rajakumar, Alena Butryna, Matthew Lamm, Viktoriya Kuzmina, Joe Fenton, Aaron Cohen, Rachel Bernstein, Ray Kurzweil, Blaise Aguera-Arcas, Claire Cui, Marian Croak, Ed Chi, and Quoc Le. LaMDA: Language models for dialog applications. arXiv preprint arXiv:2201.08239, 2022. ",
1606
+ "bbox": [
1607
+ 178,
1608
+ 722,
1609
+ 826,
1610
+ 875
1611
+ ],
1612
+ "page_idx": 12
1613
+ },
1614
+ {
1615
+ "type": "text",
1616
+ "text": "Amos Tversky and Daniel Kahneman. Availability: A heuristic for judging frequency and probability. Cognitive Psychology, 5(2):207–232, 1973. ",
1617
+ "bbox": [
1618
+ 176,
1619
+ 883,
1620
+ 821,
1621
+ 911
1622
+ ],
1623
+ "page_idx": 12
1624
+ },
1625
+ {
1626
+ "type": "text",
1627
+ "text": "Amos Tversky and Daniel Kahneman. Judgment under uncertainty: Heuristics and biases. Science, 185(4157):1124–1131, 1974. ",
1628
+ "bbox": [
1629
+ 171,
1630
+ 90,
1631
+ 825,
1632
+ 119
1633
+ ],
1634
+ "page_idx": 13
1635
+ },
1636
+ {
1637
+ "type": "text",
1638
+ "text": "Amos Tversky and Daniel Kahneman. The framing of decisions and the psychology of choice. Science, 211(4481):453–458, 1981. ",
1639
+ "bbox": [
1640
+ 171,
1641
+ 127,
1642
+ 825,
1643
+ 156
1644
+ ],
1645
+ "page_idx": 13
1646
+ },
1647
+ {
1648
+ "type": "text",
1649
+ "text": "Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. Universal adversarial triggers for attacking and analyzing NLP. In Empirical Methods in Natural Language Processing (EMNLP), 2019. ",
1650
+ "bbox": [
1651
+ 173,
1652
+ 165,
1653
+ 823,
1654
+ 207
1655
+ ],
1656
+ "page_idx": 13
1657
+ },
1658
+ {
1659
+ "type": "text",
1660
+ "text": "Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. SuperGLUE: A stickier benchmark for general-purpose language understanding systems. In Advances in Neural Information Processing Systems (NeurIPS), 2019a. ",
1661
+ "bbox": [
1662
+ 173,
1663
+ 215,
1664
+ 825,
1665
+ 258
1666
+ ],
1667
+ "page_idx": 13
1668
+ },
1669
+ {
1670
+ "type": "text",
1671
+ "text": "Alex Wang, Amapreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations (ICLR), 2019b. ",
1672
+ "bbox": [
1673
+ 178,
1674
+ 266,
1675
+ 823,
1676
+ 309
1677
+ ],
1678
+ "page_idx": 13
1679
+ },
1680
+ {
1681
+ "type": "text",
1682
+ "text": "Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 billion parameter autoregressive language model, 2021. ",
1683
+ "bbox": [
1684
+ 171,
1685
+ 316,
1686
+ 825,
1687
+ 345
1688
+ ],
1689
+ "page_idx": 13
1690
+ },
1691
+ {
1692
+ "type": "text",
1693
+ "text": "Laura Weidinger, John Mellor, Maribeth Rauh, Conor Griffin, Jonathan Uesato, Po-Sen Huang, Myra Cheng, Mia Glaese, Borja Balle, Atoosa Kasirzadeh, Zac Kenton, Sasha Brown, Will Hawkins, Tom Stepleton, Courtney Biles, Abeba Birhane, Julia Haas, Laura Rimell, Lisa Anne Hendricks, William Isaac, Sean Legassick, Geoffrey Irving, and Iason Gabriel. Ethical and social risks of harm from language models. arXiv preprint arXiv:2112.04359, 2021. ",
1694
+ "bbox": [
1695
+ 174,
1696
+ 354,
1697
+ 826,
1698
+ 425
1699
+ ],
1700
+ "page_idx": 13
1701
+ },
1702
+ {
1703
+ "type": "text",
1704
+ "text": "Sonja Windhager, Florian Hutzler, Claus-Christian Carbon, Elisabeth Oberzaucher, Katrin Schaefer, Truls Thorstensen, Helmut Leder, and Karl Grammer. Laying eyes on headlights: Eye movements suggest facial features in cars. Collegium Antropologicum, 34(3):1075–1080, 2010. ",
1705
+ "bbox": [
1706
+ 174,
1707
+ 433,
1708
+ 825,
1709
+ 476
1710
+ ],
1711
+ "page_idx": 13
1712
+ },
1713
+ {
1714
+ "type": "text",
1715
+ "text": "Tony Z. Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. Calibrate before use: Improving few-shot performance of language models. In International Conference on Machine Learning (ICML), 2021. ",
1716
+ "bbox": [
1717
+ 174,
1718
+ 483,
1719
+ 825,
1720
+ 526
1721
+ ],
1722
+ "page_idx": 13
1723
+ },
1724
+ {
1725
+ "type": "text",
1726
+ "text": "Daniel M. Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B. Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving. Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593, 2019. ",
1727
+ "bbox": [
1728
+ 174,
1729
+ 534,
1730
+ 825,
1731
+ 577
1732
+ ],
1733
+ "page_idx": 13
1734
+ },
1735
+ {
1736
+ "type": "text",
1737
+ "text": "Checklist ",
1738
+ "text_level": 1,
1739
+ "bbox": [
1740
+ 174,
1741
+ 602,
1742
+ 254,
1743
+ 618
1744
+ ],
1745
+ "page_idx": 13
1746
+ },
1747
+ {
1748
+ "type": "text",
1749
+ "text": "1. For all authors... ",
1750
+ "bbox": [
1751
+ 214,
1752
+ 628,
1753
+ 339,
1754
+ 642
1755
+ ],
1756
+ "page_idx": 13
1757
+ },
1758
+ {
1759
+ "type": "text",
1760
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] See discussion. \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] See discussion. \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1761
+ "bbox": [
1762
+ 238,
1763
+ 647,
1764
+ 825,
1765
+ 751
1766
+ ],
1767
+ "page_idx": 13
1768
+ },
1769
+ {
1770
+ "type": "text",
1771
+ "text": "2. If you are including theoretical results... ",
1772
+ "bbox": [
1773
+ 214,
1774
+ 755,
1775
+ 493,
1776
+ 768
1777
+ ],
1778
+ "page_idx": 13
1779
+ },
1780
+ {
1781
+ "type": "text",
1782
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A] ",
1783
+ "bbox": [
1784
+ 238,
1785
+ 772,
1786
+ 738,
1787
+ 804
1788
+ ],
1789
+ "page_idx": 13
1790
+ },
1791
+ {
1792
+ "type": "text",
1793
+ "text": "3. If you ran experiments... ",
1794
+ "bbox": [
1795
+ 212,
1796
+ 808,
1797
+ 393,
1798
+ 821
1799
+ ],
1800
+ "page_idx": 13
1801
+ },
1802
+ {
1803
+ "type": "text",
1804
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Included in the supplement. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] We do not train new models, but in Section 3.1 and Section 4 we provide details about the models we evaluate. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] Our experiments consider the deterministic rollout of models on fixed prompts. \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] We do not train models in this work. ",
1805
+ "bbox": [
1806
+ 238,
1807
+ 827,
1808
+ 825,
1809
+ 911
1810
+ ],
1811
+ "page_idx": 13
1812
+ },
1813
+ {
1814
+ "type": "text",
1815
+ "text": "",
1816
+ "bbox": [
1817
+ 238,
1818
+ 92,
1819
+ 826,
1820
+ 176
1821
+ ],
1822
+ "page_idx": 14
1823
+ },
1824
+ {
1825
+ "type": "text",
1826
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1827
+ "bbox": [
1828
+ 212,
1829
+ 181,
1830
+ 823,
1831
+ 196
1832
+ ],
1833
+ "page_idx": 14
1834
+ },
1835
+ {
1836
+ "type": "text",
1837
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] We cite GPT-3 and Codex, and give credit to OpenAI. \n(b) Did you mention the license of the assets? [N/A] \n(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] ",
1838
+ "bbox": [
1839
+ 235,
1840
+ 199,
1841
+ 825,
1842
+ 335
1843
+ ],
1844
+ "page_idx": 14
1845
+ },
1846
+ {
1847
+ "type": "text",
1848
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1849
+ "bbox": [
1850
+ 214,
1851
+ 339,
1852
+ 705,
1853
+ 354
1854
+ ],
1855
+ "page_idx": 14
1856
+ },
1857
+ {
1858
+ "type": "text",
1859
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
1860
+ "bbox": [
1861
+ 238,
1862
+ 358,
1863
+ 825,
1864
+ 446
1865
+ ],
1866
+ "page_idx": 14
1867
+ }
1868
+ ]
parse/dev/fcO9Cgn-X-R/fcO9Cgn-X-R_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/fcO9Cgn-X-R/fcO9Cgn-X-R_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/hX5Ia-ION8Y/hX5Ia-ION8Y.md ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MCVD: Masked Conditional Video Diffusion for Prediction, Generation, and Interpolation
2
+
3
+ Vikram Voleti∗ Mila, University of Montreal Canada vikram.voleti@umontreal.ca
4
+
5
+ Alexia Jolicoeur-Martineau\* Mila, University of Montreal Canada alexia.jolicoeur-martineau@mail.mcgill.ca
6
+
7
+ Christopher Pal Mila, Polytechnique Montreal Canada CIFAR AI Chair ServiceNow Research
8
+
9
+ # Abstract
10
+
11
+ Video prediction is a challenging task. The quality of video frames from current state-of-the-art (SOTA) generative models tends to be poor and generalization beyond the training data is difficult. Furthermore, existing prediction frameworks are typically not capable of simultaneously handling other video-related tasks such as unconditional generation or interpolation. In this work, we devise a generalpurpose framework called Masked Conditional Video Diffusion (MCVD) for all of these video synthesis tasks using a probabilistic conditional score-based denoising diffusion model, conditioned on past and/or future frames. We train the model in a manner where we randomly and independently mask all the past frames or all the future frames. This novel but straightforward setup allows us to train a single model that is capable of executing a broad range of video tasks, specifically: future/past prediction – when only future/past frames are masked; unconditional generation – when both past and future frames are masked; and interpolation – when neither past nor future frames are masked. Our experiments show that this approach can generate high-quality frames for diverse types of videos. Our MCVD models are built from simple non-recurrent 2D-convolutional architectures, conditioning on blocks of frames and generating blocks of frames. We generate videos of arbitrary lengths autoregressively in a block-wise manner. Our approach yields SOTA results across standard video prediction and interpolation benchmarks, with computation times for training models measured in 1-12 days using $\leq 4$ GPUs.
12
+
13
+ Project page: https://mask-cond-video-diffusion.github.io Code: https://mask-cond-video-diffusion.github.io/
14
+
15
+ # 1 Introduction
16
+
17
+ Predicting what one may visually perceive in the future is closely linked to the dynamics of objects and people. As such, this kind of prediction relates to many crucial human decision-making tasks ranging from making dinner to driving a car. If video models could generate full-fledged videos in pixel-level detail with plausible futures, agents could use them to make better decisions, especially safety-critical ones. Consider, for example, the task of driving a car in a tight situation at high speed. Having an accurate model of the future could mean the difference between damaging a car or something worse. We can obtain some intuitions about this scenario by examining the predictions of our model in Figure 1, where we condition on two frames and predict 28 frames into the future for a car driving around a corner. We can see that this is enough time for two different painted arrows to pass under the car. If one zooms in, one can inspect the relative positions of the arrow and the Mercedes hood ornament in the real versus predicted frames. Pixel-level models of trajectories, pedestrians, potholes, and debris on the road could one day improve the safety of vehicles.
18
+
19
+ ![](images/a4e28e9beef437f8852a2ff2a57ff8d3c98b9157d14e3c4f416822a34c7bdc4d.jpg)
20
+ Figure 1: Our approach generates high quality frames many steps into the future: Given two conditioning frames from the Cityscapes [Cordts et al., 2016] validation set (top left), we show 7 predicted future frames in row 2 below, then skip to frames 20-28, autoregressively predicted in row 4. Ground truth frames are shown in rows 1 and 3. Notice the initial large arrow advancing and passing under the car. In frame 20 (the far left of the 3rd and 4th row), the initially small and barely visible second arrow in the background of the conditioning frames has advanced into the foreground. Result generated by our MCVD concat model variant. Note that some Cityscapes videos contain brightness changes, which may explain the brightness change in this sample.
21
+
22
+ Although beneficial to decision making, video generation is an incredibly challenging problem; not only must high-quality frames be generated, but the changes over time must be plausible and ideally drawn from an accurate and potentially complex distribution over probable futures. Looking far in time is exceptionally hard given the exponential increase in possible futures. Generating video from scratch or unconditionally further compounds the problem because even the structure of the first frame must be synthesized. Also related to video generation are the simpler tasks of a) video prediction, predicting the future given the past, and b) interpolation, predicting the in-between given past and future. Yet, both problems remain challenging. Specialized tools exist to solve the various video tasks, but they rarely solve more than one task at a time.
23
+
24
+ Given the monumental task of general video generation, current approaches are still very limited despite the fact that many state of the art methods have hundreds of millions of parameters [Wu et al., 2021, Weissenborn et al., 2019, Villegas et al., 2019, Babaeizadeh et al., 2021]. While industrial research is capable of looking at even larger models, current methods frequently underfit the data, leading to blurry videos, especially in the longer-term future and recent work has examined ways in improve parameter efficiency [Babaeizadeh et al., 2021]. Our objective here is to devise a video generation approach that generates high-quality, time-consistent videos within our computation budget of $\leq 4$ GPU) and computation times for training models $\leq$ two weeks. Fortunately, diffusion models for image synthesis have demonstrated wide success, which strongly motivated our use of this approach. Our qualitative results in Figure 1 also indicate that our particular approach does quite well at synthesizing frames in the longer-term future (i.e., frame 29 in the bottom right corner).
25
+
26
+ One family of diffusion models might be characterized as Denoising Diffusion Probabilistic Models (DDPMs) [Sohl-Dickstein et al., 2015, Ho et al., 2020, Dhariwal and Nichol, 2021], while another as Score-based Generative Models (SGMs) [Song and Ermon, 2019, Li et al., 2019, Song and Ermon, 2020, Jolicoeur-Martineau et al., 2021a]. However, these approaches have effectively merged into a field we shall refer to as score-based diffusion models, which work by defining a stochastic process from data to noise and then reversing that process to go from noise to data. Their main benefits are that they generate very 1) high-quality and 2) diverse data samples. One of their drawbacks is that solving the reverse process is relatively slow, but there are ways to improve speed [Song et al., 2020,
27
+
28
+ Jolicoeur-Martineau et al., 2021b, Salimans and Ho, 2022, Liu et al., 2022, Xiao et al., 2022]. Given their massive success and attractive properties, we focus here on developing our framework using score-based diffusion models for video prediction, generation, and interpolation.
29
+
30
+ Our work makes the following contributions:
31
+
32
+ 1. A conditional video diffusion approach for video prediction and interpolation that yields SOTA results.
33
+ 2. A conditioning procedure based on masking past and/or future frames in a blockwise manner giving a single model the ability to solve multiple video tasks: future/past prediction, unconditional generation, and interpolation.
34
+ 3. A sliding window blockwise autoregressive conditioning procedure to allow fast and coherent long-term generation (Figure 2).
35
+ 4. A convolutional U-net neural architecture integrating recent developments with a conditional normalization technique we call SPAce-TIme-Adaptive Normalization (SPATIN) (Figure 3).
36
+
37
+ By conditioning on blocks of frames in the past and optionally blocks of frames even further in the future, we are able to better ensure that temporal dynamics are transferred across blocks of samples, i.e. our networks can learn implicit models of spatio-temporal dynamics to inform frame generation. Unlike many other approaches, we do not have explicit model components for spatio-temporal derivatives or optical flow or recurrent blocks.
38
+
39
+ # 2 Conditional Diffusion for Video
40
+
41
+ Let $\mathbf { x } _ { 0 } \in \mathbb { R } ^ { d }$ be a sample from the data distribution $p _ { \mathrm { d a t a } }$ . A sample $\mathbf { x } _ { \mathrm { 0 } }$ can corrupted from $t = 0$ to $t = T$ through the Forward Diffusion Process (FDP) with the following transition kernel:
42
+
43
+ $$
44
+ q _ { t } ( \mathbf { x } _ { t } | \mathbf { x } _ { t - 1 } ) = \mathcal { N } ( \mathbf { x } _ { t } ; \sqrt { 1 - \beta _ { t } } \mathbf { x } _ { t - 1 } , \beta _ { t } \mathbf { I } ) ,
45
+ $$
46
+
47
+ Furthermore, $\mathbf { x } _ { t }$ can be sampled directly from $\mathbf { x } _ { \mathrm { 0 } }$ using the following accumulated kernel:
48
+
49
+ $$
50
+ q _ { t } ( \mathbf { x } _ { t } | \mathbf { x } _ { 0 } ) = \mathcal { N } ( \mathbf { x } _ { t } ; \sqrt { \bar { \alpha } _ { t } } \mathbf { x } _ { 0 } , ( 1 - \bar { \alpha } _ { t } ) \mathbf { I } ) \implies \mathbf { x } _ { t } = \sqrt { \bar { \alpha } _ { t } } \mathbf { x } _ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon
51
+ $$
52
+
53
+ where $\begin{array} { r } { \bar { \alpha } _ { t } = \prod _ { s = 1 } ^ { t } ( 1 - \beta _ { s } ) } \end{array}$ , and $\mathbf { \epsilon } \gets \mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ .
54
+
55
+ Generating new samples can be done by reversing the FDP and solving the Reverse Diffusion Process (RDP) starting from Gaussian noise $\mathbf { x } _ { T }$ . It can be shown (Song et al. [2021], Ho et al. [2020]) that the RDP can be computed using the following transition kernel:
56
+
57
+ $$
58
+ \begin{array} { r l } & { p _ { t } ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } , \mathbf { x } _ { 0 } ) = \mathcal { N } ( \mathbf { x } _ { t - 1 } ; \tilde { \mu } _ { t } ( \mathbf { x } _ { t } , \mathbf { x } _ { 0 } ) , \tilde { \beta } _ { t } \mathbf { I } ) , } \\ { \mathrm { w h e r e } \quad \tilde { \mu } _ { t } ( \mathbf { x } _ { t } , \mathbf { x } _ { 0 } ) = \displaystyle \frac { \sqrt { \bar { \alpha } _ { t - 1 } } \beta _ { t } } { 1 - \bar { \alpha } _ { t } } \mathbf { x } _ { 0 } + \frac { \sqrt { \alpha _ { t } } \left( 1 - \bar { \alpha } _ { t - 1 } \right) } { 1 - \bar { \alpha } _ { t } } \mathbf { x } _ { t } \quad \mathrm { a n d } \quad \tilde { \beta } _ { t } = \displaystyle \frac { 1 - \bar { \alpha } _ { t - 1 } } { 1 - \bar { \alpha } _ { t } } \beta _ { t } } \end{array}
59
+ $$
60
+
61
+ Since $\mathbf { x } _ { \mathrm { 0 } }$ given $\mathbf { x } _ { t }$ is unknown, it can be estimated using eq. (2): $\hat { \mathbf { x } } _ { 0 } = \left( \mathbf { x } _ { t } - \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon \right) / \sqrt { \bar { \alpha } _ { t } }$ , where $\epsilon _ { \theta } ( \mathbf { x } _ { t } | t )$ estimates $\epsilon$ using a time-conditional neural network parameterized by $\theta$ . This allows us to reverse the process from noise to data. The loss function of the neural network is:
62
+
63
+ $$
64
+ L ( \theta ) = \mathbb { E } _ { t , \mathbf { x } _ { 0 } \sim p _ { \mathrm { d a t a } } , \epsilon \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) } \Big [ \big \| \epsilon - \epsilon _ { \theta } \big ( \sqrt { \bar { \alpha } _ { t } } \mathbf { x } _ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon \mid t \big ) \big \| _ { 2 } ^ { 2 } \Big ]
65
+ $$
66
+
67
+ Note that estimating $\epsilon$ is equivalent to estimating a scaled version of the score function (i.e., the gradient of the log density) of the noisy data:
68
+
69
+ $$
70
+ \nabla _ { \mathbf { x } _ { t } } \log q _ { t } ( \mathbf { x } _ { t } \mid \mathbf { x } _ { 0 } ) = - \frac { 1 } { 1 - \bar { \alpha } _ { t } } ( \mathbf { x } _ { t } - \sqrt { \bar { \alpha } _ { t } } \mathbf { x } _ { 0 } ) = - \frac { 1 } { \sqrt { 1 - \bar { \alpha } _ { t } } } \epsilon
71
+ $$
72
+
73
+ Thus, data generation through denoising depends on the score-function, and can be seen as noiseconditional score-based generation.
74
+
75
+ Score-based diffusion models can be straightforwardly adapted to video by considering the joint distribution of multiple continuous frames. While this is sufficient for unconditional video generation, other tasks such as video interpolation and prediction remain unsolved. A conditional video prediction model can be approximately derived from the unconditional model using imputation [Song et al., 2021]; indeed, the contemporary work of Ho et al. [2022] attempts to use this technique; however, their approach is based on an approximate conditional model.
76
+
77
+ # 2.1 Video Prediction via Conditional Diffusion
78
+
79
+ future given past immediate future e we have . We con $p$ past frames tion the abo $\mathbf { p } = \left\{ \mathbf { p } ^ { i } \right\} _ { i = 1 } ^ { p }$ and ode $k$ current frames in the on the past frames to $\mathbf { x } _ { 0 } = \left\{ \mathbf { x } _ { 0 } ^ { i } \right\} _ { i = 1 } ^ { k }$
80
+ predict the current frames:
81
+
82
+ $$
83
+ L _ { \mathrm { v i d p r e d } } ( \theta ) = \mathbb { E } _ { t , [ \mathbf { p } , \mathbf { x } _ { 0 } ] \sim p _ { \mathrm { d a t a } } , \epsilon \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) } \Big [ \big \| \epsilon - \epsilon _ { \theta } \big ( \sqrt { \bar { \alpha } _ { t } } \mathbf { x } _ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon \mid \mathbf { p } , t \big ) \big \| ^ { 2 } \Big ]
84
+ $$
85
+
86
+ Given a model trained as above, video prediction for subsequent time steps can be achieved by blockwise autoregressively predicting current video frames conditioned on previously predicted frames (see Figure 2). We use variants of the network shown in Figure 3 to model $\epsilon _ { \theta }$ in Equation 6 here, and for Equation 7 and Equation 8 below.
87
+
88
+ ![](images/83d7ee5bb7f24cfbb797cf9c1ad651c637a0669fd31e5b0e5ff446708d955341.jpg)
89
+
90
+ # 2.2 Video Prediction $^ +$ Generation via Masked Conditional Diffusion
91
+
92
+ Our approach above allows video prediction, but not unconditional video generation. As a second approach, we extend the same framework to video generation by masking (zeroing-out) the past frames with probability $p _ { \mathrm { m a s k } } = 1 / 2$ using binary mask $m _ { p }$ . The network thus learns to predict the noise added without any past frames for context. Doing so means that we can perform conditional as well as unconditional frame generation, i.e., video prediction and generation with the same network. This leads to the following loss $_ { \mathfrak { z } }$ is the Bernouilli distribution):
93
+
94
+ $$
95
+ L _ { \mathrm { v i d g e n } } ( \theta ) = \mathbb { E } _ { t , [ \mathbf { p } , \mathbf { x } _ { 0 } ] \sim p _ { \mathrm { d a t a } } , \epsilon \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) , m _ { p } \sim \mathcal { B } ( p _ { \mathrm { m a x } } ) } \Big [ \big \| \epsilon - \epsilon _ { \theta } \big ( \sqrt { \bar { \alpha } _ { t } } \mathbf { x } _ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon \mid m _ { p } \mathbf { p } , t \big ) \big \| ^ { 2 } \Big ]
96
+ $$
97
+
98
+ We hypothesize that this dropout-like [Srivastava et al., 2014] approach will also serve as a form of regularization, improving the model’s ability to perform predictions conditioned on the past. We see positive evidence of this effect in our experiments – see the MCVD past-mask model variants in Tables 3 and 9 versus without past-masking. Note that random masking is used only during training.
99
+
100
+ # 2.3 Video Prediction $^ +$ Generation $^ +$ Interpolation via Masked Conditional Diffusion
101
+
102
+ We now have a design for video prediction and generation, but it still cannot perform video interpolation nor past prediction from the future. As a third and final approach, we show how to build a general model for solving all four video tasks. Assume we have $p$ past frames, $k$ current frames, and $f$ future frames $\mathbf { f } = \left\{ \mathbf { f } ^ { i } \right\} _ { i = 1 } ^ { f }$ We randomly mask the $p$ past frames with probability $p _ { m a s k } = 1 / 2$ , and similarly randomly mask the $f$ future frames with the same probability (but sampled separately). Thus, future or past prediction is when only future or past frames are masked. Unconditional generation is when both past and future frames are masked. Video interpolation is when neither past nor future frames are masked. The loss function for this general video machinery is:
103
+
104
+ $$
105
+ { \cal L } ( \theta ) = \mathbb { E } _ { t , [ { \bf p } , { \bf x } _ { 0 } , { \bf f } ] \sim p _ { \mathrm { d a t } } , \epsilon \sim \mathcal { N } ( { \bf 0 } , { \bf I } ) , ( m _ { p } , m _ { f } ) \sim \mathcal { B } ( p _ { \mathrm { m a x } } ) } \left[ \left\| \epsilon - \epsilon _ { \theta } \big ( \sqrt { \bar { \alpha } _ { t } } { \bf x } _ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon \mid m _ { p } { \bf p } , m _ { f } { \bf f } , t \big ) \right\| ^ { 2 } \right]
106
+ $$
107
+
108
+ ![](images/206990bba4eb49b714c74d2d1adae29cdc85eb80f72cc3a3a2b31f9f8821c821.jpg)
109
+ Figure 3: We give noisy current frames to a U-Net whose residual blocks receive conditional information from past/future frames and noise-level. The output is the predicted noise in the current frames, which we use to denoise the current frames. At test time, we start from pure noise.
110
+
111
+ # 2.4 Our Network Architecture
112
+
113
+ For our denoising network we use a U-net architecture [Ronneberger et al., 2015, Honari et al., 2016, Salimans et al., 2017] combining the improvements from Song et al. [2021] and Dhariwal and Nichol [2021]. This architecture uses a mix of 2D convolutions [Fukushima and Miyake, 1982], multi-head self-attention [Cheng et al., 2016], and adaptive group-norm [Wu and He, 2018]. We use positional encodings of the noise level $\mathrm { \Phi } _ { t } \in [ 0 , 1 ] )$ ) and process it using a transformer style positional embedding:
114
+
115
+ $$
116
+ \mathbf { e } ( t ) = \left[ \dots , \cos \left( t c ^ { \frac { - 2 d } { D } } \right) , \sin \left( t c ^ { \frac { - 2 d } { D } } \right) , \dots \right] ^ { \mathrm { T } } ,
117
+ $$
118
+
119
+ where $d = 1 , \ldots , D / 2$ , $D$ is the number of dimensions of the embedding, and $c = 1 0 0 0 0$ . This embedding vector is passed through a fully connected layer, followed by an activation function and another fully connected layer. Each residual block has an fully connected layer that adapts the embedding to the correct dimensionality.
120
+
121
+ To provide $\mathbf { x } _ { t }$ , p, and f to the network, we separately concatenate the past/future conditional frames and the noisy current frames in the channel dimension. The concatenated noisy current frames are directly passed as input to the network. Meanwhile, the concatenated conditional frames are passed through an embedding that influences the conditional normalization akin to SPatially-Adaptive (DE)normalization (SPADE) [Park et al., 2019]; to account for the effect of time/motion, we call this approach SPAce-TIme-Adaptive Normalization (SPATIN). In addition to SPATIN, we also try directly concatenating the conditional and noisy current frames together and passing them as the input. In our experiments below we show some results with SPATIN and some with concatenation (concat). For simple video prediction with Equation 6, we experimented with 3D convolutions and 3D attention However, this requires an exorbitant amount of memory, and we found no benefit in using 3D layers over 2D layers at the same memory (i.e., the biggest model that fits in 4 GPUs). Thus, we did not explore this idea further. We also tried and found no benefit from gamma noise [Nachmani et al., 2021], L1 loss, and F-PNDM sampling [Liu et al., 2022].
122
+
123
+ # 3 Related work
124
+
125
+ Score-based diffusion models have been used for image editing [Meng et al., 2022, Saharia et al., 2021, Nichol et al., 2021] and our approach to video generation might be viewed as an analogy to classical image inpainting, but in the temporal dimension. The GLIDE or Guided Language to Image Diffusion for Generation and Editing approach of Nichol et al. [2021] uses CLIP-guided diffusion for image editing, while Denoising Diffusion Restoration Models (DDRM) Kawar et al. [2022] additionally condition on a corrupted image to restore the clean image. Adversarial variants of score-based diffusion models have been used to enhance quality [Jolicoeur-Martineau et al., 2021a] or speed [Xiao et al., 2022].
126
+
127
+ Contemporary work to our own such as that of Ho et al. [2022] and Yang et al. [2022] also examine video generation using score-based diffusion models. However, the Video Diffusion Models (VDMs) work of Ho et al. [2022] approximates conditional distributions using a gradient method for conditional sampling from their unconditional model formulation. In contrast, our approach directly works with a conditional diffusion model, which we obtain through masked conditional training, thereby giving us the exact conditional distribution as well as the ability to generate unconditionally. Their experiments focus on: a) unconditional video generation, and b) text-conditioned video generation, whereas our work focuses primarily on predicting future video frames from the past, using our masked conditional generation framework. The Residual Video Diffusion (RVD) of Yang et al. [2022] is only for video prediction, and it uses a residual formulation to generate frames autoregressively one at a time. Meanwhile, ours directly models the conditional frames to generate multiple frames in a block-wise autoregressive manner.
128
+
129
+ Recurrent neural network (RNN) techniques were early candidates for modern deep neural architectures for video prediction and generation. Early work combined RNNs with a stochastic latent variable (SV2P) Babaeizadeh et al. [2018a] and was optimized by variational inference. The stochastic video generation (SVG) approach of Denton and Fergus [2018] learned both prior and a per time step latent variable model, which influences the dynamics of an LSTM at each step. The model is also trained in a manner similar to a variational autoencoder, i.e., it was another form of variational RNN (vRNN). To address the fact that vRNNs tend to lead to blurry results, Castrejón et al. [2019] (Hier-vRNN) increased the expressiveness of the latent distributions using a hierarchy of latent variables. We compare qualitative result of SVG and Hier-vRNN with the MCVD concat variant of our method in Figure 4. Other vRNN-based models include SAVP Lee et al. [2018], SRVP Franceschi et al. [2020], SLAMP Akan et al. [2021].
130
+
131
+ ![](images/cb145d25922e6104c069e9c3ac3c3630d1756e7f91608b67a7ce83762cdf9a3a.jpg)
132
+ Figure 4: Comparing future prediction methods on Cityscapes: SVG-LP (Top Row), Hier-vRNNs (Second Row), Our Method (Third Row), Ground Truth (Bottom Row). Frame 2, a ground truth conditioning frame is shown in first column, followed by frames: 3, 5, 10 and 20 generated by each method vs the ground truth at the bottom.
133
+
134
+ The well known Transformer paradigm [Vaswani et al., 2017] from natural language processing has also been explored for video. The Video-GPT work of Yan et al. [2021] applied an autoregressive GPT style [Brown et al., 2020] transformer to the codes produced from a VQ-VAE [Van Den Oord et al., 2017]. The Video Transformer work of Weissenborn et al. [2019] models video using 3-D spatiotemporal volumes without linearizing positions in the volume. They examine local self-attention over small non-overlapping sub-volumes or 3D blocks. This is done partly to accelerate computations on TPU hardware. Their work also observed that the peak signal-to-noise ratio (PSNR) metric and the mean-structural similarity (SSIM) metrics [Wang et al., 2004] were developed for images, and have serious flaws when applied to videos. PSNR prefers blurry videos and SSIM does not correlate well to perceptual quality. Like them, we focus on the recently proposed Frechet Video Distance (FVD) [Unterthiner et al., 2018], computed over entire videos and which is sensitive to visual quality, temporal coherence, and diversity of samples. Rakhimov et al. [2020] (LVT) used transformers to predict the dynamics of video in latent space. Le Moing et al. [2021] (CCVS) also predict in latent space, that of an adversarially trained autoencoder, and also add a learnable optical flow module.
135
+
136
+ Generative Adversarial Network (GAN) based approaches to video generation have also been studied extensively. Vondrick et al. [2016] proposed an early GAN architecture for video, using a spatio-temporal CNN. Villegas et al. [2017] proposed a strategy for separating motion and content into different pathways of a convolutional LSTM based encoder-decoder RNN. Saito et al. [2017] (TGAN) predicted a sequence of latents using a temporal generator, and then the sequence of frames from those latents using an image generator. TGANv2 Saito et al. [2020] improved its memory efficiency. MoCoGAN Tulyakov et al. [2018] explored style and content separation, but within a CNN framework. Yushchenko et al. [2019] used the MoCoGAN framework by re-formulating the video prediction problem as a Markov Decision Process (MDP). FutureGAN Aigner and Körner [2018] used spatio-temporal 3D convolutions in an encoder decoder architecture, and elements of the progressive GAN Karras et al. [2018] approach to improve image quality. TS-GAN Munoz et al. [2021] facilitated information flow between consecutive frames. TriVD-GAN Luc et al. [2020] proposes a novel recurrent unit in the generator to handle more complex dynamics, while DIGAN Yu et al. [2022] uses implicit neural representations in the generator.
137
+
138
+ Video interpolation was the subject of a flurry of interest in the deep learning community a number of years ago [Niklaus et al., 2017, Jiang et al., 2018, Xue et al., 2019, Bao et al., 2019]. However, these architectures tend to be fairly specialized to the interpolation task, involving optical flow or motion field modelling and computations. Frame interpolation is useful for video compression; therefore, many other lines of work have examined interpolation from a compression perspective. However, these architectures tend to be extremely specialized to the video compression task [Yang et al., 2020].
139
+
140
+ The Cutout approach of DeVries and Taylor [2017] has examined the idea of cutting out small continuous regions of an input image, such as small squares. Dropout [Srivastava et al., 2014] at the FeatureMap level was proposed and explored under the name of SpatialDropout in Tompson et al. [2015]. Input Dropout [de Blois et al., 2020] has been examined in the context of dropping different channels of multi-modal input imagery, such as the dropping of the RGB channels or depth map channels during training, then using the model without one of the modalities during testing, e.g. in their work they drop the depth channel.
141
+
142
+ Regarding our block-autoregressive approach, previous video prediction models were typically either 1) non-recurrent: predicting all $n$ frames simultaneously with no way of adding more frames (most GAN-based methods), or 2) recurrent in nature, predicting 1 frame at a time in an autoregressive fashion. The benefit of the non-recurrent type is that you can generate videos faster than 1 frame at a time while allowing for generating as many frames as needed. The disadvantage is that it is slower than generating all frames at once, and takes up more memory and compute at each iteration. Our model finds a sweet spot in between in that it is block-autoregressive: generating $k < n$ frames at a time recurrently to finally obtain $n$ frames.
143
+
144
+ # 4 Experiments
145
+
146
+ We show the results of our video prediction experiments on test data that was never seen during training in Tables $1 \textrm { -- } 4$ for Stochastic Moving MNIST (SMMNIST) 2, KTH 3, BAIR 4, and Cityscapes 5respectively. We present unconditional generation results for BAIR in Table 5 and UCF-101 6 in Table 6, and interpolation results for SMMNIST, KTH, and BAIR in Table 7.
147
+
148
+ Datasets: We generate $1 2 8 \mathrm { x } 1 2 8$ images for Cityscapes and $6 4 \mathrm { x } 6 4$ images for the other datasets. See our Appendix and supplementary material for additional visual results. Our choice of datasets is in order of progressive difficulty: 1) SMMNIST: black-and-white digits; 2) KTH: grayscale single-humans; 3) BAIR: color, multiple objects, simple scene; 4) Cityscapes: color, natural complex natural driving scene; 5) UCF101: color, 101 categories of natural scenes. We process these datasets similarly to prior works. For Cityscapes, each video is center-cropped, then resized to $1 2 8 \times 1 2 8$ . For UCF101, each video clip is center-cropped at $2 4 0 \times 2 4 0$ and resized to $6 4 { \times } 6 4$ , taking care to maintain the train-test splits.
149
+
150
+ Unless otherwise specified, we set the mask probability to 0.5 when masking was used. For sampling, we report results using the sampling methods DDPM [Ho et al., 2020] or DDIM [Song et al., 2020] with only 100 sampling steps, though our models were trained with 1000, to make sampling faster. We observe that the metrics are generally better using DDPM than DDIM (except for UCF
151
+
152
+ Table 1: Video prediction results on SMMNIST $( 6 4 \times 6 4 )$ for 10 predicted frames conditioned on 5 past frames. We predicted 10 trajectories per real video, and report the average FVD and maximum SSIM, averaged across 256 test videos.
153
+
154
+ <table><tr><td>SMMNIST[5 →10; trained on k]</td><td>k</td><td>FVD↓</td><td>SSIM↑</td></tr><tr><td>SVG [Denton and Fergus, ,2018]</td><td>10</td><td>90.81</td><td>0.688</td></tr><tr><td> vRNN 1L [Castrej6n et al., 2019]</td><td>10</td><td>63.81</td><td>0.763</td></tr><tr><td> Hier-vRNN [Castrej6n et al., 2019]</td><td>10</td><td>57.17</td><td>0.760</td></tr><tr><td>MCVD concat (Ours)</td><td>5</td><td>25.63</td><td>0.786</td></tr><tr><td>MCVD : spatin (Ours)</td><td>5</td><td>23.86</td><td>0.780</td></tr></table>
155
+
156
+ 101). Using 1000 sampling steps could yield better results.
157
+
158
+ Note that all our models are trained to predict only 4-5 current frames at a time, unlike other models that predict ${ \geq } 1 0 $ . We use these models to then autoregressively predict longer sequences for prediction or generation. This was done in order to fit the models in our GPU memory budget. Despite this disadvantage, we find that our MCVD models perform better than many previous SOTA methods.
159
+
160
+ Metrics: As mentioned earlier, we primarily use the FVD metric for comparison across models as FVD measures both fidelity and diversity of the generated samples. Previous works compare Frechet Inception Distance (FID) [Heusel et al., 2017] and Inception Score (IS) [Salimans et al., 2016], adapted to videos by replacing the Inception network with a 3D-convolutional network that takes video input. FVD is
161
+
162
+ Table 2: Video prediction results on KTH $( 6 4 \times 6 4 )$ , predicting 30 and 40 frames using models trained to predict $k$ frames at a time. All models condition on 10 past frames, on 256 test videos.
163
+
164
+ <table><tr><td>KTH[10→ pred; trained on k]|k pred</td><td></td><td>|FVD↓</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>SAVP [Lee et al., 2018]</td><td>10 30</td><td>374±3</td><td>26.5</td><td>0.756</td></tr><tr><td>MCVD concat (Ours)</td><td>5 30</td><td>323±3</td><td>27.5</td><td>0.835</td></tr><tr><td> SLAMP [Akan et al., 2021]</td><td>10 30</td><td>228±5</td><td>29.4</td><td>0.865</td></tr><tr><td>SRVP [Franceschi et al., 2020]</td><td>10 30</td><td>222±3</td><td>29.7</td><td>0.870</td></tr><tr><td>MCVD concat (Ours)</td><td>5</td><td>40 276.7</td><td>26.40</td><td>0.812</td></tr><tr><td> SAVP-VAE [Lee et al., 2018]</td><td>10</td><td>40 145.7</td><td>26.00</td><td>0.806</td></tr><tr><td>Grid-keypoints [Gao et al., 2021]</td><td>10</td><td>40</td><td>144.2</td><td>27.11 0.837</td></tr></table>
165
+
166
+ computed similarly to FID, but using an I3D network trained on the huge video dataset Kinetics-400.
167
+ We also report PSNR and SSIM.
168
+
169
+ Ablation studies: In Table 3 we compare models that use concatenated raw pixels as input to U-Net blocks (concat) to SPATIN variants. We also compare no-masking to past-masking variants, i.e. models which are only trained predict the future vs. models which are regularized by being trained for prediction and unconditional generation. It can be seen that our model works across different choices of past frames and generates better quality for shorter videos. This is expected from models of this kind. Moreover, it can be seen that the model trained on the two tasks of Prediction and Generation (i.e., the models with past-mask) performs better than the model trained only on Prediction!
170
+
171
+ In addition, the appendix contains an ablation study in Table 9 on the different design choices: concat vs concat past-future-mask vs spatin vs spatin future-mask vs spatin past-future-mask. It can be seen that concat is, in general, better than spatin. It can also be seen that the past-future-mask variant, which is a general model capable of all three tasks, performs better at the individual tasks than the models trained only on the individual task. This was demonstrated in Table 3 as well. This shows that the model gains very helpful insights while generalizing to all three tasks, which it does not while training only on the individual task.
172
+
173
+ We conducted preliminary experiments with a larger number of frames. Since the models with a larger number of frames were bigger, we could only run them for a shorter time with a smaller batch size than the smaller models. In general, we found that larger models did not substantially improve the results. We attribute this to the fact that using more frames means that the model should be given more capacity, but we could not increase it due to our computational budget constraints. We emphasize that our method works very well with fewer computational resources.
174
+
175
+ Examining these results we remark that we have SOTA performance for prediction on SMMNIST, BAIR and the challenging Cityscapes evaluation. Our Cityscapes model yields an FVD of 145.5, whereas the best previous result of which we are aware is 418. The quality of our Cityscapes results are illustrated visually in Figure 1 and Figure 2 and in the additional examples provided in our Appendix. While our completely unconditional generation results are strong, we note that when past masking is used to regularize future predicting models, we see clear performance gains in Table 3. Finally, in Table 7 we see that our interpolation results are SOTA by a wide margin, across experiments on SMMNIST, KTH and BAIR – even compared to architectures much more specialized for interpolation.
176
+
177
+ It can be seen that our proposed method generates better quality videos, even though it was trained on a shorter number of frames than other methods. It can also be seen that training on multiple tasks using random masking improves the quality of generated frames than training on the individual tasks.
178
+
179
+ Table 3: Video prediction results on BAIR $( 6 4 \times 6 4 )$ conditioning on $p$ past frames and predicting pred frames in the future, using models trained to predict $k$ frames at at time.
180
+
181
+ <table><tr><td>BAIR(64 × 64) [past p → pred ; trained on k]|</td><td>p</td><td>k</td><td>pred</td><td>FVD↓</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>LVT [Rakhimov et al., 2020]</td><td>1</td><td>15</td><td>15</td><td>125.8</td><td>1</td><td>1</td></tr><tr><td>DVD-GAN-FP [Clark et al., 2019]</td><td>1</td><td>15</td><td>15</td><td>109.8</td><td>1</td><td>1</td></tr><tr><td>MCVD spatin (Ours)</td><td>1</td><td>5</td><td>15</td><td>103.8</td><td>18.8</td><td>0.826</td></tr><tr><td>TrIVD-GAN-FP [Luc et al., 2020]</td><td>1</td><td>15</td><td>15</td><td>103.3</td><td>1</td><td>1</td></tr><tr><td>VideoGPT[Yan et al., 2021]</td><td>1</td><td>15</td><td>15</td><td>103.3</td><td>1</td><td>1</td></tr><tr><td>CCVS [Le Moing et al., 2021]</td><td>1</td><td>15</td><td>15</td><td>99.0</td><td>1</td><td>一</td></tr><tr><td>MCVD concat (Ours)</td><td>1</td><td>5</td><td>15</td><td>98.8</td><td>18.8</td><td>0.829</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>1</td><td>5</td><td>15</td><td>96.5</td><td>18.8</td><td>0.828</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>1</td><td>5</td><td>15</td><td>95.6</td><td>18.8</td><td>0.832</td></tr><tr><td>Video Transformer [Weissenborn et al., 2019]</td><td>1</td><td>15</td><td>15</td><td>94-96a</td><td>1</td><td>1</td></tr><tr><td>FitVid [Babaeizadeh et al., 2021]</td><td>1</td><td>15</td><td>15</td><td>93.6</td><td></td><td>一</td></tr><tr><td>MCVD concat past-future-mask (Ours)</td><td>1</td><td>5</td><td>15</td><td>89.5</td><td>16.9</td><td>0.780</td></tr><tr><td>SAVP [Lee et al., 2018]</td><td>2</td><td>14</td><td>14</td><td>116.4</td><td>1</td><td>1</td></tr><tr><td>MCVD spatin (Ours)</td><td></td><td>5</td><td>14</td><td>94.1</td><td>19.1</td><td>0.836</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>22222</td><td>5</td><td>14</td><td>90.5</td><td>19.2</td><td>0.837</td></tr><tr><td>MCVD concat (Ours)</td><td></td><td>5</td><td>14</td><td>90.5</td><td>19.1</td><td>0.834</td></tr><tr><td>MCVD concat past-future-mask (Ours)</td><td></td><td>5</td><td>14</td><td>89.6</td><td>17.1</td><td>0.787</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td></td><td>5</td><td>14</td><td>87.9</td><td>19.1</td><td>0.838</td></tr><tr><td>SAVP [Lee et al., 2018]</td><td>2</td><td>10</td><td>28</td><td>143.4</td><td>1</td><td>0.795</td></tr><tr><td>Hier-vRNN [Castrej6n et al., 2019]</td><td></td><td>10</td><td>28</td><td>143.4</td><td>1</td><td>0.822</td></tr><tr><td>MCVD spatin (Ours)</td><td></td><td>5</td><td>28</td><td>132.1</td><td>17.5</td><td>0.779</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>222222</td><td>5</td><td>28</td><td>127.9</td><td>17.7</td><td>0.789</td></tr><tr><td>MCVD concat (Ours)</td><td></td><td>5</td><td>28</td><td>120.6</td><td>17.6</td><td>0.785</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td></td><td>5</td><td>28</td><td>119.0</td><td>17.7</td><td>0.797</td></tr><tr><td>MCVD concat past-future-mask (Ours)</td><td></td><td>5</td><td>28</td><td>118.4</td><td>16.2</td><td>0.745</td></tr></table>
182
+
183
+ a 94 on only the first frames, 96 on all subsequences of test frames
184
+
185
+ Table 4: Video prediction on Cityscapes $( 1 2 8 \times 1 2 8 )$ conditioning on 2 frames and predicting 28. SPATIN seems to produce a drift towards brighter images with a color balance shift in frames further from the start frame on Cityscapes, resulting in increased FVD for SPATIN than the CONCAT variant.
186
+
187
+ <table><tr><td>Cityscapes (128 × 128)[2 -→28; trained on k]</td><td>k</td><td>FVD↓</td><td>LPIPS↓</td><td>SSIM↑</td></tr><tr><td> SVG-LP Denton and Fergus [2018]</td><td>10</td><td>1300.26</td><td>0.549 ± 0.06</td><td>0.574 ± 0.08</td></tr><tr><td> vRNN 1L Castrej6n et al. [2019]</td><td>10</td><td>682.08</td><td>0.304 ± 0.10</td><td>0.609 ± 0.11</td></tr><tr><td>Hier-vRNN Castrej6n et al. [2019]</td><td>10</td><td>567.51</td><td>0.264 ± 0.07</td><td>0.628 ± 0.10</td></tr><tr><td>GHVAE Wu et al. [2021]</td><td>10</td><td>418.00</td><td>0.193 ± 0.014</td><td>0.740 ± 0.04</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>5</td><td>184.81</td><td>0.121 ± 0.05</td><td>0.720 ± 0.11</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>5</td><td>141.31</td><td>0.112 ± 0.05</td><td>0.690 ± 0.12</td></tr></table>
188
+
189
+ # 5 Conclusion
190
+
191
+ We have shown how to obtain SOTA video prediction and interpolation results with randomly masked conditional video diffusion models using a relatively simple architecture. We found that past-masking was able to improve performance across all model variants and configurations tested. We believe our approach may pave the way forward toward high quality larger-scale video generation.
192
+
193
+ Limitations. Videos generated by these models are still small compared to real movies, and they can still become blurry or inconsistent when the number of generated frames is very large. Our unconditional generation results on the highly diverse UCF-101 dataset are still far from perfect. More work is clearly needed to scale these
194
+
195
+ Table 5: Unconditional generation of BAIR video frames.
196
+
197
+ <table><tr><td>BAIR (64 × 64) [0 → pred; trained on 5]|pred|FVD↓</td><td></td><td></td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>16</td><td>267.8</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>16</td><td>228.5</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>30</td><td>399.8</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>30</td><td>348.2</td></tr></table>
198
+
199
+ models to larger datasets with more diversity and with longer duration video. As has been the case in many other settings, simply using larger models with many more parameters is a strategy that is likely to improve the quality and flexibility of these models – we were limited to 4 GPUs for our work here. There is also a need for faster sampling methods capable of maintaining quality over time.
200
+
201
+ Given our strong interpolation results, conditional diffusion models which generate skipped frames could make it possible to generate much longer, but consistent video through a strategy of first generating sparse distant frames in a block, followed by an interpolative diffusion step for the missing frames.
202
+
203
+ Table 6: Unconditional generation of UCF-101 video frames.
204
+
205
+ <table><tr><td>UCF-101 (64 × 64) [0→ 16; trained on k]</td><td>k</td><td>FVD↓</td></tr><tr><td>MoCoGAN-MDP [Yushchenko et al., 2019]</td><td>16</td><td>1277.0</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>4</td><td>1228.3</td></tr><tr><td>TGANv2 [Saito et al., 2020]</td><td>16</td><td>1209.0</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>4</td><td>1143.0</td></tr><tr><td>DIGAN [Yu et al., 2022]</td><td>16</td><td>655.0</td></tr></table>
206
+
207
+ Table 7: Video Interpolation results $( 6 4 \times 6 4 )$ . Given $p \operatorname { p a s t } + f$ future frames interpolate $k$ frames. Reporting average of the best metrics out of $n$ trajectories per test sample. $\downarrow ( p + f )$ and $\uparrow k$ is harder. We used MCVD spatin past-mask for SMMNIST and KTH, and MCVD concat past-future-mask for BAIR. We also include results on SMMNIST for a "pure" model trained without any masking.
208
+
209
+ <table><tr><td rowspan="2"></td><td colspan="4">SMMNIST (64× 64) p+fkn</td><td colspan="3">KTH(64× 64)</td><td colspan="4">BAIR (64× 64)</td></tr><tr><td></td><td></td><td></td><td>|PSNR↑ SSIM↑</td><td></td><td>p+fkn</td><td>|PSNR↑SSIM↑</td><td></td><td></td><td>p+fkn</td><td>|PSNR↑ SSIM↑</td></tr><tr><td>SVG-LP Denton and Fergus [2018]</td><td>18 7100</td><td></td><td>13.543</td><td>0.741</td><td>18</td><td>7100</td><td>28.131 0.883</td><td></td><td>187100</td><td></td><td>18.648 0.846</td></tr><tr><td>FSTN Lu et al. [2017]</td><td>18</td><td>7100</td><td>14.730</td><td>0.765</td><td>18</td><td>7100</td><td>29.431 0.899</td><td></td><td>187100</td><td>19.908</td><td>0.850</td></tr><tr><td>SepConv Niklaus et al. [2017]</td><td>18 7100</td><td></td><td>14.759</td><td>0.775</td><td>18</td><td>7100</td><td>29.210 0.904</td><td></td><td>187100</td><td></td><td>21.615 0.877</td></tr><tr><td>SuperSloMo Jiang et al. [2018]</td><td>18 7100</td><td></td><td>13.387</td><td>0.749</td><td>18</td><td>7100</td><td>28.756 0.893</td><td></td><td>1 二</td><td></td><td>一</td></tr><tr><td> SDVI full Xu et al. [2020]</td><td>18 7100</td><td></td><td>16.025</td><td>0.842</td><td>18</td><td>7100</td><td>29.190 0.901</td><td></td><td>18 7100</td><td>21.432</td><td>0.880</td></tr><tr><td>SDVI Xu et al. [2020]</td><td>167100</td><td></td><td>14.857</td><td>0.782</td><td>16</td><td>7100</td><td>26.907 0.831</td><td></td><td>16 7100</td><td>19.694</td><td>0.852</td></tr><tr><td rowspan="2">MCVD (Ours)</td><td>10 10 100</td><td></td><td>20.944</td><td>0.854</td><td>15 10100</td><td></td><td>34.669 0.943</td><td></td><td>45100</td><td>25.162</td><td>0.932</td></tr><tr><td>10510</td><td></td><td>27.693</td><td>0.941</td><td></td><td></td><td>34.068</td><td>0.942</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>pure</td><td>18.385</td><td>0.802</td><td>10</td><td>15 10 10 510</td><td>35.611</td><td>0.963</td><td>4510</td><td>23.408</td><td>0.914</td></tr></table>
210
+
211
+ Broader Impacts. High-quality video generation is potentially a powerful technology that could be used by malicious actors for applications such as creating fake video content. Our formulation focuses on capturing the distributions of real video sequences. High-quality video prediction could one day find use in applications such as autonomous vehicles, where the cost of errors could be high. Diffusion methods have shown great promise for covering the modes of real probability distributions. In this context, diffusion-based techniques for generative modelling may be a promising avenue for future research where the ability to capture modes properly is safety critical. Another potential point of impact is the amount of computational resources being spent for these applications involving the high fidelity and voluminous modality of video data. We emphasize the use of limited resources in achieving better or comparable results. Our submission provides evidence for more efficient computation involving fewer GPU hours spent in training time.
212
+
213
+ # Acknowledgments and Disclosure of Funding
214
+
215
+ We thank Digital Research Alliance of Canada for the GPUs which were used in this work. Alexia, Vikram thank their wives and cat for their support. We thank CIFAR for support under the AI Chairs program, and NSERC for support under the Discovery grants program, application ID 5018358.
216
+
217
+ # References
218
+
219
+ Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3213–3223, 2016.
220
+
221
+ Bohan Wu, Suraj Nair, Roberto Martin-Martin, Li Fei-Fei, and Chelsea Finn. Greedy hierarchical variational autoencoders for large-scale video prediction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2318–2328, 2021.
222
+
223
+ Dirk Weissenborn, Oscar Täckström, and Jakob Uszkoreit. Scaling autoregressive video models. arXiv preprint arXiv:1906.02634, 2019.
224
+
225
+ Ruben Villegas, Arkanath Pathak, Harini Kannan, Dumitru Erhan, Quoc V Le, and Honglak Lee. High fidelity video prediction with large stochastic recurrent neural networks. Advances in Neural Information Processing Systems, 32, 2019.
226
+
227
+ Mohammad Babaeizadeh, Mohammad Taghi Saffar, Suraj Nair, Sergey Levine, Chelsea Finn, and Dumitru Erhan. Fitvid: Overfitting in pixel-level video prediction. arXiv preprint arXiv:2106.13195, 2021.
228
+
229
+ Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pages 2256–2265. PMLR, 2015.
230
+
231
+ Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 2020.
232
+
233
+ Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34, 2021.
234
+
235
+ Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 2019.
236
+
237
+ Zengyi Li, Yubei Chen, and Friedrich T Sommer. Learning energy-based models in high-dimensional spaces with multi-scale denoising score matching. arXiv preprint arXiv:1910.07762, 2019.
238
+
239
+ Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. Advances in Neural Information Processing Systems, 2020.
240
+
241
+ Alexia Jolicoeur-Martineau, Rémi Piché-Taillefer, Rémi Tachet des Combes, and Ioannis Mitliagkas. Adversarial score matching and improved sampling for image generation. International Conference on Learning Representations, 2021a. URL arXivpreprintarXiv:2009.05475.
242
+
243
+ Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv:2010.02502, October 2020. URL https://arxiv.org/abs/2010.02502.
244
+
245
+ Alexia Jolicoeur-Martineau, Ke Li, Rémi Piché-Taillefer, Tal Kachman, and Ioannis Mitliagkas. Gotta go fast when generating data with score-based models. arXiv preprint arXiv:2105.14080, 2021b.
246
+
247
+ Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. arXiv preprint arXiv:2202.00512, 2022.
248
+
249
+ Luping Liu, Yi Ren, Zhijie Lin, and Zhou Zhao. Pseudo numerical methods for diffusion models on manifolds. arXiv preprint arXiv:2202.09778, 2022.
250
+
251
+ Zhisheng Xiao, Karsten Kreis, and Arash Vahdat. Tackling the generative learning trilemma with denoising diffusion GANs. In International Conference on Learning Representations (ICLR), 2022.
252
+
253
+ Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. International Conference on Learning Representations, 2021. URL arXivpreprintarXiv:2011.13456.
254
+
255
+ Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J. Fleet. Video diffusion models, 2022. URL https://arxiv.org/abs/2204.03458.
256
+
257
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(56):1929–1958, 2014.
258
+
259
+ Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computerassisted intervention, pages 234–241. Springer, 2015.
260
+
261
+ Sina Honari, Jason Yosinski, Pascal Vincent, and Christopher Pal. Recombinator networks: Learning coarse-to-fine feature aggregation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5743–5752, 2016.
262
+
263
+ Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017.
264
+
265
+ Kunihiko Fukushima and Sei Miyake. Neocognitron: A self-organizing neural network model for a mechanism of visual pattern recognition. In Competition and cooperation in neural nets, pages 267–285. Springer, 1982.
266
+
267
+ Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. arXiv preprint arXiv:1601.06733, 2016.
268
+
269
+ Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European conference on computer vision (ECCV), pages 3–19, 2018.
270
+
271
+ Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2337–2346, 2019.
272
+
273
+ Eliya Nachmani, Robin San Roman, and Lior Wolf. Denoising diffusion gamma models. arXiv preprint arXiv:2110.05948, 2021.
274
+
275
+ Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. SDEdit: Guided image synthesis and editing with stochastic differential equations. In International Conference on Learning Representations, 2022.
276
+
277
+ Chitwan Saharia, William Chan, Huiwen Chang, Chris A Lee, Jonathan Ho, Tim Salimans, David J Fleet, and Mohammad Norouzi. Palette: Image-to-image diffusion models. arXiv preprint arXiv:2111.05826, 2021.
278
+
279
+ Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021.
280
+
281
+ Bahjat Kawar, Michael Elad, Stefano Ermon, and Jiaming Song. Denoising diffusion restoration models. arXiv preprint arXiv:2201.11793, 2022.
282
+
283
+ Ruihan Yang, Prakhar Srivastava, and Stephan Mandt. Diffusion probabilistic modeling for video generation. arXiv preprint arXiv:2203.09481, 2022.
284
+
285
+ Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. In International Conference on Learning Representations, 2018a.
286
+
287
+ Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In Proceedings of the 35th International Conference on Machine Learning, pages 1174–1183, 2018.
288
+
289
+ Lluís Castrejón, Nicolas Ballas, and Aaron C. Courville. Improved conditional vrnns for video prediction. ArXiv, abs/1904.12165, 2019.
290
+
291
+ Alex X. Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. ArXiv, abs/1804.01523, 2018.
292
+
293
+ Jean-Yves Franceschi, Edouard Delasalles, Mickaël Chen, Sylvain Lamprier, and Patrick Gallinari. Stochastic latent residual video prediction. In International Conference on Machine Learning, pages 3233–3246. PMLR, 2020.
294
+
295
+ Adil Kaan Akan, Erkut Erdem, Aykut Erdem, and Fatma Güney. Slamp: Stochastic latent appearance and motion prediction. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 14728–14737, 2021.
296
+
297
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Adv. Neural Inform. Process. Syst., volume 30, 2017.
298
+
299
+ Wilson Yan, Yunzhi Zhang, Pieter Abbeel, and Aravind Srinivas. Videogpt: Video generation using vq-vae and transformers. arXiv preprint arXiv:2104.10157, 2021.
300
+
301
+ Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Adv. Neural Inform. Process. Syst., 33:1877–1901, 2020.
302
+
303
+ Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Adv. Neural Inform. Process. Syst., 30, 2017.
304
+
305
+ Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600–612, 2004.
306
+
307
+ 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 preprint arXiv:1812.01717, 2018.
308
+
309
+ Ruslan Rakhimov, Denis Volkhonskiy, Alexey Artemov, Denis Zorin, and Evgeny Burnaev. Latent video transformer. arXiv preprint arXiv:2006.10704, 2020.
310
+
311
+ Guillaume Le Moing, Jean Ponce, and Cordelia Schmid. Ccvs: Context-aware controllable video synthesis. Advances in Neural Information Processing Systems, 34, 2021.
312
+
313
+ Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. Advances in neural information processing systems, 29, 2016.
314
+
315
+ Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. In International Conference on Learning Representations, 2017.
316
+
317
+ Masaki Saito, Eiichi Matsumoto, and Shunta Saito. Temporal generative adversarial nets with singular value clipping. In Proceedings of the IEEE international conference on computer vision, pages 2830–2839, 2017.
318
+
319
+ Masaki Saito, Shunta Saito, Masanori Koyama, and Sosuke Kobayashi. Train sparsely, generate densely: Memory-efficient unsupervised training of high-resolution temporal gan. International Journal of Computer Vision, 128(10):2586–2606, 2020.
320
+
321
+ Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. Mocogan: Decomposing motion and content for video generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1526–1535, 2018.
322
+
323
+ Vladyslav Yushchenko, Nikita Araslanov, and Stefan Roth. Markov decision process for video generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 0–0, 2019.
324
+
325
+ Sandra Aigner and Marco Körner. Futuregan: Anticipating the future frames of video sequences using spatio-temporal 3d convolutions in progressively growing gans. arXiv preprint arXiv:1810.01325, 2018.
326
+
327
+ Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In Int. Conf. Learn. Represent., 2018.
328
+
329
+ Andres Munoz, Mohammadreza Zolfaghari, Max Argus, and Thomas Brox. Temporal shift gan for large scale video generation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 3179–3188, 2021.
330
+
331
+ Pauline Luc, Aidan Clark, Sander Dieleman, Diego de Las Casas, Yotam Doron, Albin Cassirer, and Karen Simonyan. Transformation-based adversarial video prediction on large-scale data. arXiv preprint arXiv:2003.04035, 2020.
332
+
333
+ Sihyun Yu, Jihoon Tack, Sangwoo Mo, Hyunsu Kim, Junho Kim, Jung-Woo Ha, and Jinwoo Shin. Generating videos with dynamics-aware implicit generative adversarial networks. In International Conference on Learning Representations, 2022.
334
+
335
+ Simon Niklaus, Long Mai, and Feng Liu. Video frame interpolation via adaptive convolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 670–679, 2017.
336
+
337
+ Huaizu Jiang, Deqing Sun, Varun Jampani, Ming-Hsuan Yang, Erik Learned-Miller, and Jan Kautz. Super slomo: High quality estimation of multiple intermediate frames for video interpolation. In IEEE Conf. Comput. Vis. Pattern Recog., pages 9000–9008, 2018.
338
+
339
+ Tianfan Xue, Baian Chen, Jiajun Wu, Donglai Wei, and William T Freeman. Video enhancement with task-oriented flow. Int. J. Comput. Vis., 127(8):1106–1125, 2019.
340
+
341
+ Wenbo Bao, Wei-Sheng Lai, Chao Ma, Xiaoyun Zhang, Zhiyong Gao, and Ming-Hsuan Yang. Depthaware video frame interpolation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3703–3712, 2019.
342
+
343
+ Ren Yang, Fabian Mentzer, Luc Van Gool, and Radu Timofte. Learning for video compression with recurrent auto-encoder and recurrent probability model. IEEE Journal of Selected Topics in Signal Processing, 15(2):388–401, 2020.
344
+
345
+ Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
346
+
347
+ Jonathan Tompson, Ross Goroshin, Arjun Jain, Yann LeCun, and Christoph Bregler. Efficient object localization using convolutional networks. In IEEE Conf. Comput. Vis. Pattern Recog., pages 648–656, 2015.
348
+
349
+ Sébastien de Blois, Mathieu Garon, Christian Gagné, and Jean-François Lalonde. Input dropout for spatially aligned modalities. In IEEE Int. Conf. Image Process., pages 733–737, 2020.
350
+
351
+ Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In International conference on machine learning, pages 843–852. PMLR, 2015.
352
+
353
+ Christian Schuldt, Ivan Laptev, and Barbara Caputo. Recognizing human actions: a local svm approach. In Proceedings of the 17th International Conference on Pattern Recognition, 2004. ICPR 2004., volume 3, pages 32–36. IEEE, 2004.
354
+
355
+ Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. In CoRL, pages 344–356, 2017.
356
+
357
+ Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012.
358
+
359
+ Xiaojie Gao, Yueming Jin, Qi Dou, Chi-Wing Fu, and Pheng-Ann Heng. Accurate grid keypoint learning for efficient video prediction. In 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 5908–5915. IEEE, 2021.
360
+
361
+ 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 Advances in neural information processing systems, pages 6626–6637, 2017.
362
+
363
+ Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, Xi Chen, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, 2016.
364
+
365
+ Aidan Clark, Jeff Donahue, and Karen Simonyan. Adversarial video generation on complex datasets. arXiv preprint arXiv:1907.06571, 2019.
366
+
367
+ Chaochao Lu, Michael Hirsch, and Bernhard Scholkopf. Flexible spatio-temporal networks for video prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6523–6531, 2017.
368
+
369
+ Qiangeng Xu, Hanwang Zhang, Weiyue Wang, Peter Belhumeur, and Ulrich Neumann. Stochastic dynamics for video infilling. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2714–2723, 2020.
370
+
371
+ Seiya Tokui, Ryosuke Okuta, Takuya Akiba, Yusuke Niitani, Toru Ogawa, Shunta Saito, Shuji Suzuki, Kota Uenishi, Brian Vogel, and Hiroyuki Yamazaki Vincent. Chainer: A deep learning framework for accelerating the research cycle. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2002–2011, 2019.
372
+
373
+ 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. Advances in neural information processing systems, 32, 2019.
374
+
375
+ Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H. Campbell, and Sergey Levine. Stochastic variational video prediction. International Conference on Learning Representations, 2018b.
376
+
377
+ Matthias Minderer, Chen Sun, Ruben Villegas, Forrester Cole, Kevin P Murphy, and Honglak Lee. Unsupervised learning of object structure and dynamics from videos. Advances in Neural Information Processing Systems, 32, 2019.
378
+
379
+ Beibei Jin, Yu Hu, Qiankun Tang, Jingyu Niu, Zhiping Shi, Yinhe Han, and Xiaowei Li. Exploring spatial-temporal multi-frequency analysis for high-fidelity and temporal-consistency video prediction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4554–4563, 2020.
parse/dev/hX5Ia-ION8Y/hX5Ia-ION8Y_content_list.json ADDED
@@ -0,0 +1,1967 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "MCVD: Masked Conditional Video Diffusion for Prediction, Generation, and Interpolation ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 205,
8
+ 122,
9
+ 794,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Vikram Voleti∗ Mila, University of Montreal Canada vikram.voleti@umontreal.ca ",
17
+ "bbox": [
18
+ 196,
19
+ 226,
20
+ 423,
21
+ 281
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Alexia Jolicoeur-Martineau\\* Mila, University of Montreal Canada alexia.jolicoeur-martineau@mail.mcgill.ca ",
28
+ "bbox": [
29
+ 449,
30
+ 226,
31
+ 802,
32
+ 281
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Christopher Pal Mila, Polytechnique Montreal Canada CIFAR AI Chair ServiceNow Research ",
39
+ "bbox": [
40
+ 398,
41
+ 303,
42
+ 598,
43
+ 358
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Abstract ",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 462,
53
+ 395,
54
+ 535,
55
+ 411
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "Video prediction is a challenging task. The quality of video frames from current state-of-the-art (SOTA) generative models tends to be poor and generalization beyond the training data is difficult. Furthermore, existing prediction frameworks are typically not capable of simultaneously handling other video-related tasks such as unconditional generation or interpolation. In this work, we devise a generalpurpose framework called Masked Conditional Video Diffusion (MCVD) for all of these video synthesis tasks using a probabilistic conditional score-based denoising diffusion model, conditioned on past and/or future frames. We train the model in a manner where we randomly and independently mask all the past frames or all the future frames. This novel but straightforward setup allows us to train a single model that is capable of executing a broad range of video tasks, specifically: future/past prediction – when only future/past frames are masked; unconditional generation – when both past and future frames are masked; and interpolation – when neither past nor future frames are masked. Our experiments show that this approach can generate high-quality frames for diverse types of videos. Our MCVD models are built from simple non-recurrent 2D-convolutional architectures, conditioning on blocks of frames and generating blocks of frames. We generate videos of arbitrary lengths autoregressively in a block-wise manner. Our approach yields SOTA results across standard video prediction and interpolation benchmarks, with computation times for training models measured in 1-12 days using $\\leq 4$ GPUs. ",
62
+ "bbox": [
63
+ 232,
64
+ 426,
65
+ 766,
66
+ 702
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "Project page: https://mask-cond-video-diffusion.github.io Code: https://mask-cond-video-diffusion.github.io/ ",
73
+ "bbox": [
74
+ 232,
75
+ 705,
76
+ 696,
77
+ 734
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "1 Introduction ",
84
+ "text_level": 1,
85
+ "bbox": [
86
+ 174,
87
+ 761,
88
+ 310,
89
+ 779
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Predicting what one may visually perceive in the future is closely linked to the dynamics of objects and people. As such, this kind of prediction relates to many crucial human decision-making tasks ranging from making dinner to driving a car. If video models could generate full-fledged videos in pixel-level detail with plausible futures, agents could use them to make better decisions, especially safety-critical ones. Consider, for example, the task of driving a car in a tight situation at high speed. Having an accurate model of the future could mean the difference between damaging a car or something worse. We can obtain some intuitions about this scenario by examining the predictions of our model in Figure 1, where we condition on two frames and predict 28 frames into the future for a car driving around a corner. We can see that this is enough time for two different painted arrows to pass under the car. If one zooms in, one can inspect the relative positions of the arrow and the Mercedes hood ornament in the real versus predicted frames. Pixel-level models of trajectories, pedestrians, potholes, and debris on the road could one day improve the safety of vehicles. ",
96
+ "bbox": [
97
+ 174,
98
+ 792,
99
+ 825,
100
+ 876
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "",
107
+ "bbox": [
108
+ 173,
109
+ 90,
110
+ 826,
111
+ 174
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "image",
117
+ "img_path": "images/a4e28e9beef437f8852a2ff2a57ff8d3c98b9157d14e3c4f416822a34c7bdc4d.jpg",
118
+ "image_caption": [
119
+ "Figure 1: Our approach generates high quality frames many steps into the future: Given two conditioning frames from the Cityscapes [Cordts et al., 2016] validation set (top left), we show 7 predicted future frames in row 2 below, then skip to frames 20-28, autoregressively predicted in row 4. Ground truth frames are shown in rows 1 and 3. Notice the initial large arrow advancing and passing under the car. In frame 20 (the far left of the 3rd and 4th row), the initially small and barely visible second arrow in the background of the conditioning frames has advanced into the foreground. Result generated by our MCVD concat model variant. Note that some Cityscapes videos contain brightness changes, which may explain the brightness change in this sample. "
120
+ ],
121
+ "image_footnote": [],
122
+ "bbox": [
123
+ 191,
124
+ 185,
125
+ 807,
126
+ 400
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "Although beneficial to decision making, video generation is an incredibly challenging problem; not only must high-quality frames be generated, but the changes over time must be plausible and ideally drawn from an accurate and potentially complex distribution over probable futures. Looking far in time is exceptionally hard given the exponential increase in possible futures. Generating video from scratch or unconditionally further compounds the problem because even the structure of the first frame must be synthesized. Also related to video generation are the simpler tasks of a) video prediction, predicting the future given the past, and b) interpolation, predicting the in-between given past and future. Yet, both problems remain challenging. Specialized tools exist to solve the various video tasks, but they rarely solve more than one task at a time. ",
133
+ "bbox": [
134
+ 174,
135
+ 511,
136
+ 825,
137
+ 636
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "Given the monumental task of general video generation, current approaches are still very limited despite the fact that many state of the art methods have hundreds of millions of parameters [Wu et al., 2021, Weissenborn et al., 2019, Villegas et al., 2019, Babaeizadeh et al., 2021]. While industrial research is capable of looking at even larger models, current methods frequently underfit the data, leading to blurry videos, especially in the longer-term future and recent work has examined ways in improve parameter efficiency [Babaeizadeh et al., 2021]. Our objective here is to devise a video generation approach that generates high-quality, time-consistent videos within our computation budget of $\\leq 4$ GPU) and computation times for training models $\\leq$ two weeks. Fortunately, diffusion models for image synthesis have demonstrated wide success, which strongly motivated our use of this approach. Our qualitative results in Figure 1 also indicate that our particular approach does quite well at synthesizing frames in the longer-term future (i.e., frame 29 in the bottom right corner). ",
144
+ "bbox": [
145
+ 174,
146
+ 642,
147
+ 825,
148
+ 794
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "One family of diffusion models might be characterized as Denoising Diffusion Probabilistic Models (DDPMs) [Sohl-Dickstein et al., 2015, Ho et al., 2020, Dhariwal and Nichol, 2021], while another as Score-based Generative Models (SGMs) [Song and Ermon, 2019, Li et al., 2019, Song and Ermon, 2020, Jolicoeur-Martineau et al., 2021a]. However, these approaches have effectively merged into a field we shall refer to as score-based diffusion models, which work by defining a stochastic process from data to noise and then reversing that process to go from noise to data. Their main benefits are that they generate very 1) high-quality and 2) diverse data samples. One of their drawbacks is that solving the reverse process is relatively slow, but there are ways to improve speed [Song et al., 2020, ",
155
+ "bbox": [
156
+ 174,
157
+ 800,
158
+ 825,
159
+ 911
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "Jolicoeur-Martineau et al., 2021b, Salimans and Ho, 2022, Liu et al., 2022, Xiao et al., 2022]. Given their massive success and attractive properties, we focus here on developing our framework using score-based diffusion models for video prediction, generation, and interpolation. ",
166
+ "bbox": [
167
+ 174,
168
+ 90,
169
+ 825,
170
+ 133
171
+ ],
172
+ "page_idx": 2
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "Our work makes the following contributions: ",
177
+ "bbox": [
178
+ 176,
179
+ 140,
180
+ 470,
181
+ 154
182
+ ],
183
+ "page_idx": 2
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "1. A conditional video diffusion approach for video prediction and interpolation that yields SOTA results. \n2. A conditioning procedure based on masking past and/or future frames in a blockwise manner giving a single model the ability to solve multiple video tasks: future/past prediction, unconditional generation, and interpolation. \n3. A sliding window blockwise autoregressive conditioning procedure to allow fast and coherent long-term generation (Figure 2). \n4. A convolutional U-net neural architecture integrating recent developments with a conditional normalization technique we call SPAce-TIme-Adaptive Normalization (SPATIN) (Figure 3). ",
188
+ "bbox": [
189
+ 210,
190
+ 161,
191
+ 825,
192
+ 299
193
+ ],
194
+ "page_idx": 2
195
+ },
196
+ {
197
+ "type": "text",
198
+ "text": "By conditioning on blocks of frames in the past and optionally blocks of frames even further in the future, we are able to better ensure that temporal dynamics are transferred across blocks of samples, i.e. our networks can learn implicit models of spatio-temporal dynamics to inform frame generation. Unlike many other approaches, we do not have explicit model components for spatio-temporal derivatives or optical flow or recurrent blocks. ",
199
+ "bbox": [
200
+ 173,
201
+ 308,
202
+ 826,
203
+ 378
204
+ ],
205
+ "page_idx": 2
206
+ },
207
+ {
208
+ "type": "text",
209
+ "text": "2 Conditional Diffusion for Video ",
210
+ "text_level": 1,
211
+ "bbox": [
212
+ 173,
213
+ 395,
214
+ 470,
215
+ 412
216
+ ],
217
+ "page_idx": 2
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "Let $\\mathbf { x } _ { 0 } \\in \\mathbb { R } ^ { d }$ be a sample from the data distribution $p _ { \\mathrm { d a t a } }$ . A sample $\\mathbf { x } _ { \\mathrm { 0 } }$ can corrupted from $t = 0$ to $t = T$ through the Forward Diffusion Process (FDP) with the following transition kernel: ",
222
+ "bbox": [
223
+ 173,
224
+ 426,
225
+ 828,
226
+ 454
227
+ ],
228
+ "page_idx": 2
229
+ },
230
+ {
231
+ "type": "equation",
232
+ "img_path": "images/6b545080f9e08247a16786deb34572aa8157942d437433564cfe61a76e7f9f3f.jpg",
233
+ "text": "$$\nq _ { t } ( \\mathbf { x } _ { t } | \\mathbf { x } _ { t - 1 } ) = \\mathcal { N } ( \\mathbf { x } _ { t } ; \\sqrt { 1 - \\beta _ { t } } \\mathbf { x } _ { t - 1 } , \\beta _ { t } \\mathbf { I } ) ,\n$$",
234
+ "text_format": "latex",
235
+ "bbox": [
236
+ 357,
237
+ 455,
238
+ 638,
239
+ 476
240
+ ],
241
+ "page_idx": 2
242
+ },
243
+ {
244
+ "type": "text",
245
+ "text": "Furthermore, $\\mathbf { x } _ { t }$ can be sampled directly from $\\mathbf { x } _ { \\mathrm { 0 } }$ using the following accumulated kernel: ",
246
+ "bbox": [
247
+ 181,
248
+ 482,
249
+ 763,
250
+ 497
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "equation",
256
+ "img_path": "images/d6a17f92c21269b1917211f95951edf6d37200bb185d8cb67d083061fdc0ef4e.jpg",
257
+ "text": "$$\nq _ { t } ( \\mathbf { x } _ { t } | \\mathbf { x } _ { 0 } ) = \\mathcal { N } ( \\mathbf { x } _ { t } ; \\sqrt { \\bar { \\alpha } _ { t } } \\mathbf { x } _ { 0 } , ( 1 - \\bar { \\alpha } _ { t } ) \\mathbf { I } ) \\implies \\mathbf { x } _ { t } = \\sqrt { \\bar { \\alpha } _ { t } } \\mathbf { x } _ { 0 } + \\sqrt { 1 - \\bar { \\alpha } _ { t } } \\epsilon\n$$",
258
+ "text_format": "latex",
259
+ "bbox": [
260
+ 261,
261
+ 498,
262
+ 735,
263
+ 516
264
+ ],
265
+ "page_idx": 2
266
+ },
267
+ {
268
+ "type": "text",
269
+ "text": "where $\\begin{array} { r } { \\bar { \\alpha } _ { t } = \\prod _ { s = 1 } ^ { t } ( 1 - \\beta _ { s } ) } \\end{array}$ , and $\\mathbf { \\epsilon } \\gets \\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } )$ . ",
270
+ "bbox": [
271
+ 176,
272
+ 518,
273
+ 475,
274
+ 536
275
+ ],
276
+ "page_idx": 2
277
+ },
278
+ {
279
+ "type": "text",
280
+ "text": "Generating new samples can be done by reversing the FDP and solving the Reverse Diffusion Process (RDP) starting from Gaussian noise $\\mathbf { x } _ { T }$ . It can be shown (Song et al. [2021], Ho et al. [2020]) that the RDP can be computed using the following transition kernel: ",
281
+ "bbox": [
282
+ 173,
283
+ 540,
284
+ 828,
285
+ 583
286
+ ],
287
+ "page_idx": 2
288
+ },
289
+ {
290
+ "type": "equation",
291
+ "img_path": "images/84781965f6e2d2ef4e2b2d2a8a7d85dc596e6254a3fe26c1b2a1d4b52405a3e3.jpg",
292
+ "text": "$$\n\\begin{array} { r l } & { p _ { t } ( \\mathbf { x } _ { t - 1 } | \\mathbf { x } _ { t } , \\mathbf { x } _ { 0 } ) = \\mathcal { N } ( \\mathbf { x } _ { t - 1 } ; \\tilde { \\mu } _ { t } ( \\mathbf { x } _ { t } , \\mathbf { x } _ { 0 } ) , \\tilde { \\beta } _ { t } \\mathbf { I } ) , } \\\\ { \\mathrm { w h e r e } \\quad \\tilde { \\mu } _ { t } ( \\mathbf { x } _ { t } , \\mathbf { x } _ { 0 } ) = \\displaystyle \\frac { \\sqrt { \\bar { \\alpha } _ { t - 1 } } \\beta _ { t } } { 1 - \\bar { \\alpha } _ { t } } \\mathbf { x } _ { 0 } + \\frac { \\sqrt { \\alpha _ { t } } \\left( 1 - \\bar { \\alpha } _ { t - 1 } \\right) } { 1 - \\bar { \\alpha } _ { t } } \\mathbf { x } _ { t } \\quad \\mathrm { a n d } \\quad \\tilde { \\beta } _ { t } = \\displaystyle \\frac { 1 - \\bar { \\alpha } _ { t - 1 } } { 1 - \\bar { \\alpha } _ { t } } \\beta _ { t } } \\end{array}\n$$",
293
+ "text_format": "latex",
294
+ "bbox": [
295
+ 220,
296
+ 583,
297
+ 774,
298
+ 640
299
+ ],
300
+ "page_idx": 2
301
+ },
302
+ {
303
+ "type": "text",
304
+ "text": "Since $\\mathbf { x } _ { \\mathrm { 0 } }$ given $\\mathbf { x } _ { t }$ is unknown, it can be estimated using eq. (2): $\\hat { \\mathbf { x } } _ { 0 } = \\left( \\mathbf { x } _ { t } - \\sqrt { 1 - \\bar { \\alpha } _ { t } } \\epsilon \\right) / \\sqrt { \\bar { \\alpha } _ { t } }$ , where $\\epsilon _ { \\theta } ( \\mathbf { x } _ { t } | t )$ estimates $\\epsilon$ using a time-conditional neural network parameterized by $\\theta$ . This allows us to reverse the process from noise to data. The loss function of the neural network is: ",
305
+ "bbox": [
306
+ 178,
307
+ 646,
308
+ 821,
309
+ 690
310
+ ],
311
+ "page_idx": 2
312
+ },
313
+ {
314
+ "type": "equation",
315
+ "img_path": "images/26b449ca32e2c84358f8a16fbd3175648742fc3b4197c1d773bc61df0e0b9b29.jpg",
316
+ "text": "$$\nL ( \\theta ) = \\mathbb { E } _ { t , \\mathbf { x } _ { 0 } \\sim p _ { \\mathrm { d a t a } } , \\epsilon \\sim \\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } ) } \\Big [ \\big \\| \\epsilon - \\epsilon _ { \\theta } \\big ( \\sqrt { \\bar { \\alpha } _ { t } } \\mathbf { x } _ { 0 } + \\sqrt { 1 - \\bar { \\alpha } _ { t } } \\epsilon \\mid t \\big ) \\big \\| _ { 2 } ^ { 2 } \\Big ]\n$$",
317
+ "text_format": "latex",
318
+ "bbox": [
319
+ 282,
320
+ 690,
321
+ 715,
322
+ 718
323
+ ],
324
+ "page_idx": 2
325
+ },
326
+ {
327
+ "type": "text",
328
+ "text": "Note that estimating $\\epsilon$ is equivalent to estimating a scaled version of the score function (i.e., the gradient of the log density) of the noisy data: ",
329
+ "bbox": [
330
+ 173,
331
+ 724,
332
+ 826,
333
+ 753
334
+ ],
335
+ "page_idx": 2
336
+ },
337
+ {
338
+ "type": "equation",
339
+ "img_path": "images/64f06dfe31f6a92b7dc80fa9a9a60bce6801a1b928590bcd648e678c783c55a1.jpg",
340
+ "text": "$$\n\\nabla _ { \\mathbf { x } _ { t } } \\log q _ { t } ( \\mathbf { x } _ { t } \\mid \\mathbf { x } _ { 0 } ) = - \\frac { 1 } { 1 - \\bar { \\alpha } _ { t } } ( \\mathbf { x } _ { t } - \\sqrt { \\bar { \\alpha } _ { t } } \\mathbf { x } _ { 0 } ) = - \\frac { 1 } { \\sqrt { 1 - \\bar { \\alpha } _ { t } } } \\epsilon\n$$",
341
+ "text_format": "latex",
342
+ "bbox": [
343
+ 294,
344
+ 753,
345
+ 705,
346
+ 786
347
+ ],
348
+ "page_idx": 2
349
+ },
350
+ {
351
+ "type": "text",
352
+ "text": "Thus, data generation through denoising depends on the score-function, and can be seen as noiseconditional score-based generation. ",
353
+ "bbox": [
354
+ 173,
355
+ 792,
356
+ 825,
357
+ 821
358
+ ],
359
+ "page_idx": 2
360
+ },
361
+ {
362
+ "type": "text",
363
+ "text": "Score-based diffusion models can be straightforwardly adapted to video by considering the joint distribution of multiple continuous frames. While this is sufficient for unconditional video generation, other tasks such as video interpolation and prediction remain unsolved. A conditional video prediction model can be approximately derived from the unconditional model using imputation [Song et al., 2021]; indeed, the contemporary work of Ho et al. [2022] attempts to use this technique; however, their approach is based on an approximate conditional model. ",
364
+ "bbox": [
365
+ 174,
366
+ 827,
367
+ 826,
368
+ 912
369
+ ],
370
+ "page_idx": 2
371
+ },
372
+ {
373
+ "type": "text",
374
+ "text": "2.1 Video Prediction via Conditional Diffusion ",
375
+ "text_level": 1,
376
+ "bbox": [
377
+ 174,
378
+ 90,
379
+ 509,
380
+ 106
381
+ ],
382
+ "page_idx": 3
383
+ },
384
+ {
385
+ "type": "text",
386
+ "text": "future given past immediate future e we have . We con $p$ past frames tion the abo $\\mathbf { p } = \\left\\{ \\mathbf { p } ^ { i } \\right\\} _ { i = 1 } ^ { p }$ and ode $k$ current frames in the on the past frames to $\\mathbf { x } _ { 0 } = \\left\\{ \\mathbf { x } _ { 0 } ^ { i } \\right\\} _ { i = 1 } ^ { k }$ \npredict the current frames: ",
387
+ "bbox": [
388
+ 173,
389
+ 116,
390
+ 825,
391
+ 180
392
+ ],
393
+ "page_idx": 3
394
+ },
395
+ {
396
+ "type": "equation",
397
+ "img_path": "images/df4d540f1f5cdee8cae6dd5ded8c9c37e703a9ebf8348f53c9cf4477cc5ede85.jpg",
398
+ "text": "$$\nL _ { \\mathrm { v i d p r e d } } ( \\theta ) = \\mathbb { E } _ { t , [ \\mathbf { p } , \\mathbf { x } _ { 0 } ] \\sim p _ { \\mathrm { d a t a } } , \\epsilon \\sim \\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } ) } \\Big [ \\big \\| \\epsilon - \\epsilon _ { \\theta } \\big ( \\sqrt { \\bar { \\alpha } _ { t } } \\mathbf { x } _ { 0 } + \\sqrt { 1 - \\bar { \\alpha } _ { t } } \\epsilon \\mid \\mathbf { p } , t \\big ) \\big \\| ^ { 2 } \\Big ]\n$$",
399
+ "text_format": "latex",
400
+ "bbox": [
401
+ 245,
402
+ 185,
403
+ 751,
404
+ 213
405
+ ],
406
+ "page_idx": 3
407
+ },
408
+ {
409
+ "type": "text",
410
+ "text": "Given a model trained as above, video prediction for subsequent time steps can be achieved by blockwise autoregressively predicting current video frames conditioned on previously predicted frames (see Figure 2). We use variants of the network shown in Figure 3 to model $\\epsilon _ { \\theta }$ in Equation 6 here, and for Equation 7 and Equation 8 below. ",
411
+ "bbox": [
412
+ 173,
413
+ 224,
414
+ 825,
415
+ 281
416
+ ],
417
+ "page_idx": 3
418
+ },
419
+ {
420
+ "type": "image",
421
+ "img_path": "images/83d7ee5bb7f24cfbb797cf9c1ad651c637a0669fd31e5b0e5ff446708d955341.jpg",
422
+ "image_caption": [],
423
+ "image_footnote": [],
424
+ "bbox": [
425
+ 169,
426
+ 297,
427
+ 803,
428
+ 484
429
+ ],
430
+ "page_idx": 3
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "2.2 Video Prediction $^ +$ Generation via Masked Conditional Diffusion ",
435
+ "text_level": 1,
436
+ "bbox": [
437
+ 176,
438
+ 508,
439
+ 665,
440
+ 523
441
+ ],
442
+ "page_idx": 3
443
+ },
444
+ {
445
+ "type": "text",
446
+ "text": "Our approach above allows video prediction, but not unconditional video generation. As a second approach, we extend the same framework to video generation by masking (zeroing-out) the past frames with probability $p _ { \\mathrm { m a s k } } = 1 / 2$ using binary mask $m _ { p }$ . The network thus learns to predict the noise added without any past frames for context. Doing so means that we can perform conditional as well as unconditional frame generation, i.e., video prediction and generation with the same network. This leads to the following loss $_ { \\mathfrak { z } }$ is the Bernouilli distribution): ",
447
+ "bbox": [
448
+ 173,
449
+ 534,
450
+ 826,
451
+ 617
452
+ ],
453
+ "page_idx": 3
454
+ },
455
+ {
456
+ "type": "equation",
457
+ "img_path": "images/a5097f923a4343887672583f448a08776bd6c98bc664305890cf7407835ddae5.jpg",
458
+ "text": "$$\nL _ { \\mathrm { v i d g e n } } ( \\theta ) = \\mathbb { E } _ { t , [ \\mathbf { p } , \\mathbf { x } _ { 0 } ] \\sim p _ { \\mathrm { d a t a } } , \\epsilon \\sim \\mathcal { N } ( \\mathbf { 0 } , \\mathbf { I } ) , m _ { p } \\sim \\mathcal { B } ( p _ { \\mathrm { m a x } } ) } \\Big [ \\big \\| \\epsilon - \\epsilon _ { \\theta } \\big ( \\sqrt { \\bar { \\alpha } _ { t } } \\mathbf { x } _ { 0 } + \\sqrt { 1 - \\bar { \\alpha } _ { t } } \\epsilon \\mid m _ { p } \\mathbf { p } , t \\big ) \\big \\| ^ { 2 } \\Big ]\n$$",
459
+ "text_format": "latex",
460
+ "bbox": [
461
+ 191,
462
+ 623,
463
+ 787,
464
+ 650
465
+ ],
466
+ "page_idx": 3
467
+ },
468
+ {
469
+ "type": "text",
470
+ "text": "We hypothesize that this dropout-like [Srivastava et al., 2014] approach will also serve as a form of regularization, improving the model’s ability to perform predictions conditioned on the past. We see positive evidence of this effect in our experiments – see the MCVD past-mask model variants in Tables 3 and 9 versus without past-masking. Note that random masking is used only during training. ",
471
+ "bbox": [
472
+ 173,
473
+ 655,
474
+ 826,
475
+ 712
476
+ ],
477
+ "page_idx": 3
478
+ },
479
+ {
480
+ "type": "text",
481
+ "text": "2.3 Video Prediction $^ +$ Generation $^ +$ Interpolation via Masked Conditional Diffusion ",
482
+ "text_level": 1,
483
+ "bbox": [
484
+ 171,
485
+ 727,
486
+ 772,
487
+ 743
488
+ ],
489
+ "page_idx": 3
490
+ },
491
+ {
492
+ "type": "text",
493
+ "text": "We now have a design for video prediction and generation, but it still cannot perform video interpolation nor past prediction from the future. As a third and final approach, we show how to build a general model for solving all four video tasks. Assume we have $p$ past frames, $k$ current frames, and $f$ future frames $\\mathbf { f } = \\left\\{ \\mathbf { f } ^ { i } \\right\\} _ { i = 1 } ^ { f }$ We randomly mask the $p$ past frames with probability $p _ { m a s k } = 1 / 2$ , and similarly randomly mask the $f$ future frames with the same probability (but sampled separately). Thus, future or past prediction is when only future or past frames are masked. Unconditional generation is when both past and future frames are masked. Video interpolation is when neither past nor future frames are masked. The loss function for this general video machinery is: ",
494
+ "bbox": [
495
+ 173,
496
+ 752,
497
+ 826,
498
+ 868
499
+ ],
500
+ "page_idx": 3
501
+ },
502
+ {
503
+ "type": "equation",
504
+ "img_path": "images/94846b905cc87f6b29017211bc1246570b32cf98d7d00a44d8e5042e218f2ada.jpg",
505
+ "text": "$$\n{ \\cal L } ( \\theta ) = \\mathbb { E } _ { t , [ { \\bf p } , { \\bf x } _ { 0 } , { \\bf f } ] \\sim p _ { \\mathrm { d a t } } , \\epsilon \\sim \\mathcal { N } ( { \\bf 0 } , { \\bf I } ) , ( m _ { p } , m _ { f } ) \\sim \\mathcal { B } ( p _ { \\mathrm { m a x } } ) } \\left[ \\left\\| \\epsilon - \\epsilon _ { \\theta } \\big ( \\sqrt { \\bar { \\alpha } _ { t } } { \\bf x } _ { 0 } + \\sqrt { 1 - \\bar { \\alpha } _ { t } } \\epsilon \\mid m _ { p } { \\bf p } , m _ { f } { \\bf f } , t \\big ) \\right\\| ^ { 2 } \\right]\n$$",
506
+ "text_format": "latex",
507
+ "bbox": [
508
+ 181,
509
+ 873,
510
+ 825,
511
+ 900
512
+ ],
513
+ "page_idx": 3
514
+ },
515
+ {
516
+ "type": "image",
517
+ "img_path": "images/206990bba4eb49b714c74d2d1adae29cdc85eb80f72cc3a3a2b31f9f8821c821.jpg",
518
+ "image_caption": [
519
+ "Figure 3: We give noisy current frames to a U-Net whose residual blocks receive conditional information from past/future frames and noise-level. The output is the predicted noise in the current frames, which we use to denoise the current frames. At test time, we start from pure noise. "
520
+ ],
521
+ "image_footnote": [],
522
+ "bbox": [
523
+ 209,
524
+ 89,
525
+ 789,
526
+ 430
527
+ ],
528
+ "page_idx": 4
529
+ },
530
+ {
531
+ "type": "text",
532
+ "text": "2.4 Our Network Architecture ",
533
+ "text_level": 1,
534
+ "bbox": [
535
+ 174,
536
+ 508,
537
+ 398,
538
+ 523
539
+ ],
540
+ "page_idx": 4
541
+ },
542
+ {
543
+ "type": "text",
544
+ "text": "For our denoising network we use a U-net architecture [Ronneberger et al., 2015, Honari et al., 2016, Salimans et al., 2017] combining the improvements from Song et al. [2021] and Dhariwal and Nichol [2021]. This architecture uses a mix of 2D convolutions [Fukushima and Miyake, 1982], multi-head self-attention [Cheng et al., 2016], and adaptive group-norm [Wu and He, 2018]. We use positional encodings of the noise level $\\mathrm { \\Phi } _ { t } \\in [ 0 , 1 ] )$ ) and process it using a transformer style positional embedding: ",
545
+ "bbox": [
546
+ 173,
547
+ 537,
548
+ 825,
549
+ 609
550
+ ],
551
+ "page_idx": 4
552
+ },
553
+ {
554
+ "type": "equation",
555
+ "img_path": "images/f3da2ca63bafc21945bbb56235a77fe97a5fdfdee1a736bc4247857ccbc1e8c3.jpg",
556
+ "text": "$$\n\\mathbf { e } ( t ) = \\left[ \\dots , \\cos \\left( t c ^ { \\frac { - 2 d } { D } } \\right) , \\sin \\left( t c ^ { \\frac { - 2 d } { D } } \\right) , \\dots \\right] ^ { \\mathrm { T } } ,\n$$",
557
+ "text_format": "latex",
558
+ "bbox": [
559
+ 341,
560
+ 623,
561
+ 655,
562
+ 654
563
+ ],
564
+ "page_idx": 4
565
+ },
566
+ {
567
+ "type": "text",
568
+ "text": "where $d = 1 , \\ldots , D / 2$ , $D$ is the number of dimensions of the embedding, and $c = 1 0 0 0 0$ . This embedding vector is passed through a fully connected layer, followed by an activation function and another fully connected layer. Each residual block has an fully connected layer that adapts the embedding to the correct dimensionality. ",
569
+ "bbox": [
570
+ 174,
571
+ 669,
572
+ 825,
573
+ 726
574
+ ],
575
+ "page_idx": 4
576
+ },
577
+ {
578
+ "type": "text",
579
+ "text": "To provide $\\mathbf { x } _ { t }$ , p, and f to the network, we separately concatenate the past/future conditional frames and the noisy current frames in the channel dimension. The concatenated noisy current frames are directly passed as input to the network. Meanwhile, the concatenated conditional frames are passed through an embedding that influences the conditional normalization akin to SPatially-Adaptive (DE)normalization (SPADE) [Park et al., 2019]; to account for the effect of time/motion, we call this approach SPAce-TIme-Adaptive Normalization (SPATIN). In addition to SPATIN, we also try directly concatenating the conditional and noisy current frames together and passing them as the input. In our experiments below we show some results with SPATIN and some with concatenation (concat). For simple video prediction with Equation 6, we experimented with 3D convolutions and 3D attention However, this requires an exorbitant amount of memory, and we found no benefit in using 3D layers over 2D layers at the same memory (i.e., the biggest model that fits in 4 GPUs). Thus, we did not explore this idea further. We also tried and found no benefit from gamma noise [Nachmani et al., 2021], L1 loss, and F-PNDM sampling [Liu et al., 2022]. ",
580
+ "bbox": [
581
+ 173,
582
+ 731,
583
+ 825,
584
+ 911
585
+ ],
586
+ "page_idx": 4
587
+ },
588
+ {
589
+ "type": "text",
590
+ "text": "3 Related work ",
591
+ "text_level": 1,
592
+ "bbox": [
593
+ 174,
594
+ 89,
595
+ 316,
596
+ 106
597
+ ],
598
+ "page_idx": 5
599
+ },
600
+ {
601
+ "type": "text",
602
+ "text": "Score-based diffusion models have been used for image editing [Meng et al., 2022, Saharia et al., 2021, Nichol et al., 2021] and our approach to video generation might be viewed as an analogy to classical image inpainting, but in the temporal dimension. The GLIDE or Guided Language to Image Diffusion for Generation and Editing approach of Nichol et al. [2021] uses CLIP-guided diffusion for image editing, while Denoising Diffusion Restoration Models (DDRM) Kawar et al. [2022] additionally condition on a corrupted image to restore the clean image. Adversarial variants of score-based diffusion models have been used to enhance quality [Jolicoeur-Martineau et al., 2021a] or speed [Xiao et al., 2022]. ",
603
+ "bbox": [
604
+ 174,
605
+ 145,
606
+ 826,
607
+ 257
608
+ ],
609
+ "page_idx": 5
610
+ },
611
+ {
612
+ "type": "text",
613
+ "text": "Contemporary work to our own such as that of Ho et al. [2022] and Yang et al. [2022] also examine video generation using score-based diffusion models. However, the Video Diffusion Models (VDMs) work of Ho et al. [2022] approximates conditional distributions using a gradient method for conditional sampling from their unconditional model formulation. In contrast, our approach directly works with a conditional diffusion model, which we obtain through masked conditional training, thereby giving us the exact conditional distribution as well as the ability to generate unconditionally. Their experiments focus on: a) unconditional video generation, and b) text-conditioned video generation, whereas our work focuses primarily on predicting future video frames from the past, using our masked conditional generation framework. The Residual Video Diffusion (RVD) of Yang et al. [2022] is only for video prediction, and it uses a residual formulation to generate frames autoregressively one at a time. Meanwhile, ours directly models the conditional frames to generate multiple frames in a block-wise autoregressive manner. ",
614
+ "bbox": [
615
+ 174,
616
+ 263,
617
+ 825,
618
+ 428
619
+ ],
620
+ "page_idx": 5
621
+ },
622
+ {
623
+ "type": "text",
624
+ "text": "Recurrent neural network (RNN) techniques were early candidates for modern deep neural architectures for video prediction and generation. Early work combined RNNs with a stochastic latent variable (SV2P) Babaeizadeh et al. [2018a] and was optimized by variational inference. The stochastic video generation (SVG) approach of Denton and Fergus [2018] learned both prior and a per time step latent variable model, which influences the dynamics of an LSTM at each step. The model is also trained in a manner similar to a variational autoencoder, i.e., it was another form of variational RNN (vRNN). To address the fact that vRNNs tend to lead to blurry results, Castrejón et al. [2019] (Hier-vRNN) increased the expressiveness of the latent distributions using a hierarchy of latent variables. We compare qualitative result of SVG and Hier-vRNN with the MCVD concat variant of our method in Figure 4. Other vRNN-based models include SAVP Lee et al. [2018], SRVP Franceschi et al. [2020], SLAMP Akan et al. [2021]. ",
625
+ "bbox": [
626
+ 174,
627
+ 435,
628
+ 485,
629
+ 738
630
+ ],
631
+ "page_idx": 5
632
+ },
633
+ {
634
+ "type": "image",
635
+ "img_path": "images/cb145d25922e6104c069e9c3ac3c3630d1756e7f91608b67a7ce83762cdf9a3a.jpg",
636
+ "image_caption": [
637
+ "Figure 4: Comparing future prediction methods on Cityscapes: SVG-LP (Top Row), Hier-vRNNs (Second Row), Our Method (Third Row), Ground Truth (Bottom Row). Frame 2, a ground truth conditioning frame is shown in first column, followed by frames: 3, 5, 10 and 20 generated by each method vs the ground truth at the bottom. "
638
+ ],
639
+ "image_footnote": [],
640
+ "bbox": [
641
+ 498,
642
+ 435,
643
+ 821,
644
+ 633
645
+ ],
646
+ "page_idx": 5
647
+ },
648
+ {
649
+ "type": "text",
650
+ "text": "The well known Transformer paradigm [Vaswani et al., 2017] from natural language processing has also been explored for video. The Video-GPT work of Yan et al. [2021] applied an autoregressive GPT style [Brown et al., 2020] transformer to the codes produced from a VQ-VAE [Van Den Oord et al., 2017]. The Video Transformer work of Weissenborn et al. [2019] models video using 3-D spatiotemporal volumes without linearizing positions in the volume. They examine local self-attention over small non-overlapping sub-volumes or 3D blocks. This is done partly to accelerate computations on TPU hardware. Their work also observed that the peak signal-to-noise ratio (PSNR) metric and the mean-structural similarity (SSIM) metrics [Wang et al., 2004] were developed for images, and have serious flaws when applied to videos. PSNR prefers blurry videos and SSIM does not correlate well to perceptual quality. Like them, we focus on the recently proposed Frechet Video Distance (FVD) [Unterthiner et al., 2018], computed over entire videos and which is sensitive to visual quality, temporal coherence, and diversity of samples. Rakhimov et al. [2020] (LVT) used transformers to predict the dynamics of video in latent space. Le Moing et al. [2021] (CCVS) also predict in latent space, that of an adversarially trained autoencoder, and also add a learnable optical flow module. ",
651
+ "bbox": [
652
+ 173,
653
+ 746,
654
+ 826,
655
+ 911
656
+ ],
657
+ "page_idx": 5
658
+ },
659
+ {
660
+ "type": "text",
661
+ "text": "",
662
+ "bbox": [
663
+ 171,
664
+ 92,
665
+ 823,
666
+ 119
667
+ ],
668
+ "page_idx": 6
669
+ },
670
+ {
671
+ "type": "text",
672
+ "text": "Generative Adversarial Network (GAN) based approaches to video generation have also been studied extensively. Vondrick et al. [2016] proposed an early GAN architecture for video, using a spatio-temporal CNN. Villegas et al. [2017] proposed a strategy for separating motion and content into different pathways of a convolutional LSTM based encoder-decoder RNN. Saito et al. [2017] (TGAN) predicted a sequence of latents using a temporal generator, and then the sequence of frames from those latents using an image generator. TGANv2 Saito et al. [2020] improved its memory efficiency. MoCoGAN Tulyakov et al. [2018] explored style and content separation, but within a CNN framework. Yushchenko et al. [2019] used the MoCoGAN framework by re-formulating the video prediction problem as a Markov Decision Process (MDP). FutureGAN Aigner and Körner [2018] used spatio-temporal 3D convolutions in an encoder decoder architecture, and elements of the progressive GAN Karras et al. [2018] approach to improve image quality. TS-GAN Munoz et al. [2021] facilitated information flow between consecutive frames. TriVD-GAN Luc et al. [2020] proposes a novel recurrent unit in the generator to handle more complex dynamics, while DIGAN Yu et al. [2022] uses implicit neural representations in the generator. ",
673
+ "bbox": [
674
+ 173,
675
+ 126,
676
+ 825,
677
+ 319
678
+ ],
679
+ "page_idx": 6
680
+ },
681
+ {
682
+ "type": "text",
683
+ "text": "Video interpolation was the subject of a flurry of interest in the deep learning community a number of years ago [Niklaus et al., 2017, Jiang et al., 2018, Xue et al., 2019, Bao et al., 2019]. However, these architectures tend to be fairly specialized to the interpolation task, involving optical flow or motion field modelling and computations. Frame interpolation is useful for video compression; therefore, many other lines of work have examined interpolation from a compression perspective. However, these architectures tend to be extremely specialized to the video compression task [Yang et al., 2020]. ",
684
+ "bbox": [
685
+ 174,
686
+ 325,
687
+ 825,
688
+ 409
689
+ ],
690
+ "page_idx": 6
691
+ },
692
+ {
693
+ "type": "text",
694
+ "text": "The Cutout approach of DeVries and Taylor [2017] has examined the idea of cutting out small continuous regions of an input image, such as small squares. Dropout [Srivastava et al., 2014] at the FeatureMap level was proposed and explored under the name of SpatialDropout in Tompson et al. [2015]. Input Dropout [de Blois et al., 2020] has been examined in the context of dropping different channels of multi-modal input imagery, such as the dropping of the RGB channels or depth map channels during training, then using the model without one of the modalities during testing, e.g. in their work they drop the depth channel. ",
695
+ "bbox": [
696
+ 174,
697
+ 415,
698
+ 825,
699
+ 512
700
+ ],
701
+ "page_idx": 6
702
+ },
703
+ {
704
+ "type": "text",
705
+ "text": "Regarding our block-autoregressive approach, previous video prediction models were typically either 1) non-recurrent: predicting all $n$ frames simultaneously with no way of adding more frames (most GAN-based methods), or 2) recurrent in nature, predicting 1 frame at a time in an autoregressive fashion. The benefit of the non-recurrent type is that you can generate videos faster than 1 frame at a time while allowing for generating as many frames as needed. The disadvantage is that it is slower than generating all frames at once, and takes up more memory and compute at each iteration. Our model finds a sweet spot in between in that it is block-autoregressive: generating $k < n$ frames at a time recurrently to finally obtain $n$ frames. ",
706
+ "bbox": [
707
+ 174,
708
+ 518,
709
+ 825,
710
+ 628
711
+ ],
712
+ "page_idx": 6
713
+ },
714
+ {
715
+ "type": "text",
716
+ "text": "4 Experiments ",
717
+ "text_level": 1,
718
+ "bbox": [
719
+ 174,
720
+ 654,
721
+ 312,
722
+ 671
723
+ ],
724
+ "page_idx": 6
725
+ },
726
+ {
727
+ "type": "text",
728
+ "text": "We show the results of our video prediction experiments on test data that was never seen during training in Tables $1 \\textrm { -- } 4$ for Stochastic Moving MNIST (SMMNIST) 2, KTH 3, BAIR 4, and Cityscapes 5respectively. We present unconditional generation results for BAIR in Table 5 and UCF-101 6 in Table 6, and interpolation results for SMMNIST, KTH, and BAIR in Table 7. ",
729
+ "bbox": [
730
+ 174,
731
+ 689,
732
+ 825,
733
+ 744
734
+ ],
735
+ "page_idx": 6
736
+ },
737
+ {
738
+ "type": "text",
739
+ "text": "Datasets: We generate $1 2 8 \\mathrm { x } 1 2 8$ images for Cityscapes and $6 4 \\mathrm { x } 6 4$ images for the other datasets. See our Appendix and supplementary material for additional visual results. Our choice of datasets is in order of progressive difficulty: 1) SMMNIST: black-and-white digits; 2) KTH: grayscale single-humans; 3) BAIR: color, multiple objects, simple scene; 4) Cityscapes: color, natural complex natural driving scene; 5) UCF101: color, 101 categories of natural scenes. We process these datasets similarly to prior works. For Cityscapes, each video is center-cropped, then resized to $1 2 8 \\times 1 2 8$ . For UCF101, each video clip is center-cropped at $2 4 0 \\times 2 4 0$ and resized to $6 4 { \\times } 6 4$ , taking care to maintain the train-test splits. ",
740
+ "bbox": [
741
+ 173,
742
+ 751,
743
+ 825,
744
+ 862
745
+ ],
746
+ "page_idx": 6
747
+ },
748
+ {
749
+ "type": "text",
750
+ "text": "Unless otherwise specified, we set the mask probability to 0.5 when masking was used. For sampling, we report results using the sampling methods DDPM [Ho et al., 2020] or DDIM [Song et al., 2020] with only 100 sampling steps, though our models were trained with 1000, to make sampling faster. We observe that the metrics are generally better using DDPM than DDIM (except for UCF",
751
+ "bbox": [
752
+ 174,
753
+ 92,
754
+ 419,
755
+ 242
756
+ ],
757
+ "page_idx": 7
758
+ },
759
+ {
760
+ "type": "table",
761
+ "img_path": "images/1c4e6a0ce47e1650887766d5162fcd119458bcde52f406b44371948b0a927ddf.jpg",
762
+ "table_caption": [
763
+ "Table 1: Video prediction results on SMMNIST $( 6 4 \\times 6 4 )$ for 10 predicted frames conditioned on 5 past frames. We predicted 10 trajectories per real video, and report the average FVD and maximum SSIM, averaged across 256 test videos. "
764
+ ],
765
+ "table_footnote": [
766
+ "101). Using 1000 sampling steps could yield better results. "
767
+ ],
768
+ "table_body": "<table><tr><td>SMMNIST[5 →10; trained on k]</td><td>k</td><td>FVD↓</td><td>SSIM↑</td></tr><tr><td>SVG [Denton and Fergus, ,2018]</td><td>10</td><td>90.81</td><td>0.688</td></tr><tr><td> vRNN 1L [Castrej6n et al., 2019]</td><td>10</td><td>63.81</td><td>0.763</td></tr><tr><td> Hier-vRNN [Castrej6n et al., 2019]</td><td>10</td><td>57.17</td><td>0.760</td></tr><tr><td>MCVD concat (Ours)</td><td>5</td><td>25.63</td><td>0.786</td></tr><tr><td>MCVD : spatin (Ours)</td><td>5</td><td>23.86</td><td>0.780</td></tr></table>",
769
+ "bbox": [
770
+ 431,
771
+ 150,
772
+ 818,
773
+ 239
774
+ ],
775
+ "page_idx": 7
776
+ },
777
+ {
778
+ "type": "text",
779
+ "text": "Note that all our models are trained to predict only 4-5 current frames at a time, unlike other models that predict ${ \\geq } 1 0 $ . We use these models to then autoregressively predict longer sequences for prediction or generation. This was done in order to fit the models in our GPU memory budget. Despite this disadvantage, we find that our MCVD models perform better than many previous SOTA methods. ",
780
+ "bbox": [
781
+ 174,
782
+ 263,
783
+ 825,
784
+ 319
785
+ ],
786
+ "page_idx": 7
787
+ },
788
+ {
789
+ "type": "text",
790
+ "text": "Metrics: As mentioned earlier, we primarily use the FVD metric for comparison across models as FVD measures both fidelity and diversity of the generated samples. Previous works compare Frechet Inception Distance (FID) [Heusel et al., 2017] and Inception Score (IS) [Salimans et al., 2016], adapted to videos by replacing the Inception network with a 3D-convolutional network that takes video input. FVD is ",
791
+ "bbox": [
792
+ 173,
793
+ 332,
794
+ 392,
795
+ 510
796
+ ],
797
+ "page_idx": 7
798
+ },
799
+ {
800
+ "type": "table",
801
+ "img_path": "images/957a0568588ed8879b292edaa0554447ef3ae52348eb113d84dd2951efa7402c.jpg",
802
+ "table_caption": [
803
+ "Table 2: Video prediction results on KTH $( 6 4 \\times 6 4 )$ , predicting 30 and 40 frames using models trained to predict $k$ frames at a time. All models condition on 10 past frames, on 256 test videos. "
804
+ ],
805
+ "table_footnote": [],
806
+ "table_body": "<table><tr><td>KTH[10→ pred; trained on k]|k pred</td><td></td><td>|FVD↓</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>SAVP [Lee et al., 2018]</td><td>10 30</td><td>374±3</td><td>26.5</td><td>0.756</td></tr><tr><td>MCVD concat (Ours)</td><td>5 30</td><td>323±3</td><td>27.5</td><td>0.835</td></tr><tr><td> SLAMP [Akan et al., 2021]</td><td>10 30</td><td>228±5</td><td>29.4</td><td>0.865</td></tr><tr><td>SRVP [Franceschi et al., 2020]</td><td>10 30</td><td>222±3</td><td>29.7</td><td>0.870</td></tr><tr><td>MCVD concat (Ours)</td><td>5</td><td>40 276.7</td><td>26.40</td><td>0.812</td></tr><tr><td> SAVP-VAE [Lee et al., 2018]</td><td>10</td><td>40 145.7</td><td>26.00</td><td>0.806</td></tr><tr><td>Grid-keypoints [Gao et al., 2021]</td><td>10</td><td>40</td><td>144.2</td><td>27.11 0.837</td></tr></table>",
807
+ "bbox": [
808
+ 406,
809
+ 377,
810
+ 823,
811
+ 492
812
+ ],
813
+ "page_idx": 7
814
+ },
815
+ {
816
+ "type": "text",
817
+ "text": "computed similarly to FID, but using an I3D network trained on the huge video dataset Kinetics-400. \nWe also report PSNR and SSIM. ",
818
+ "bbox": [
819
+ 176,
820
+ 511,
821
+ 823,
822
+ 537
823
+ ],
824
+ "page_idx": 7
825
+ },
826
+ {
827
+ "type": "text",
828
+ "text": "Ablation studies: In Table 3 we compare models that use concatenated raw pixels as input to U-Net blocks (concat) to SPATIN variants. We also compare no-masking to past-masking variants, i.e. models which are only trained predict the future vs. models which are regularized by being trained for prediction and unconditional generation. It can be seen that our model works across different choices of past frames and generates better quality for shorter videos. This is expected from models of this kind. Moreover, it can be seen that the model trained on the two tasks of Prediction and Generation (i.e., the models with past-mask) performs better than the model trained only on Prediction! ",
829
+ "bbox": [
830
+ 173,
831
+ 545,
832
+ 825,
833
+ 642
834
+ ],
835
+ "page_idx": 7
836
+ },
837
+ {
838
+ "type": "text",
839
+ "text": "In addition, the appendix contains an ablation study in Table 9 on the different design choices: concat vs concat past-future-mask vs spatin vs spatin future-mask vs spatin past-future-mask. It can be seen that concat is, in general, better than spatin. It can also be seen that the past-future-mask variant, which is a general model capable of all three tasks, performs better at the individual tasks than the models trained only on the individual task. This was demonstrated in Table 3 as well. This shows that the model gains very helpful insights while generalizing to all three tasks, which it does not while training only on the individual task. ",
840
+ "bbox": [
841
+ 174,
842
+ 647,
843
+ 825,
844
+ 744
845
+ ],
846
+ "page_idx": 7
847
+ },
848
+ {
849
+ "type": "text",
850
+ "text": "We conducted preliminary experiments with a larger number of frames. Since the models with a larger number of frames were bigger, we could only run them for a shorter time with a smaller batch size than the smaller models. In general, we found that larger models did not substantially improve the results. We attribute this to the fact that using more frames means that the model should be given more capacity, but we could not increase it due to our computational budget constraints. We emphasize that our method works very well with fewer computational resources. ",
851
+ "bbox": [
852
+ 174,
853
+ 751,
854
+ 825,
855
+ 834
856
+ ],
857
+ "page_idx": 7
858
+ },
859
+ {
860
+ "type": "text",
861
+ "text": "Examining these results we remark that we have SOTA performance for prediction on SMMNIST, BAIR and the challenging Cityscapes evaluation. Our Cityscapes model yields an FVD of 145.5, whereas the best previous result of which we are aware is 418. The quality of our Cityscapes results are illustrated visually in Figure 1 and Figure 2 and in the additional examples provided in our Appendix. While our completely unconditional generation results are strong, we note that when past masking is used to regularize future predicting models, we see clear performance gains in Table 3. Finally, in Table 7 we see that our interpolation results are SOTA by a wide margin, across experiments on SMMNIST, KTH and BAIR – even compared to architectures much more specialized for interpolation. ",
862
+ "bbox": [
863
+ 174,
864
+ 840,
865
+ 825,
866
+ 910
867
+ ],
868
+ "page_idx": 7
869
+ },
870
+ {
871
+ "type": "text",
872
+ "text": "",
873
+ "bbox": [
874
+ 173,
875
+ 90,
876
+ 825,
877
+ 147
878
+ ],
879
+ "page_idx": 8
880
+ },
881
+ {
882
+ "type": "text",
883
+ "text": "It can be seen that our proposed method generates better quality videos, even though it was trained on a shorter number of frames than other methods. It can also be seen that training on multiple tasks using random masking improves the quality of generated frames than training on the individual tasks. ",
884
+ "bbox": [
885
+ 174,
886
+ 154,
887
+ 825,
888
+ 195
889
+ ],
890
+ "page_idx": 8
891
+ },
892
+ {
893
+ "type": "table",
894
+ "img_path": "images/1520a0140454c69aca137e2e8bb6a50c1a9ee91a31497f546f3eec104295cbb1.jpg",
895
+ "table_caption": [
896
+ "Table 3: Video prediction results on BAIR $( 6 4 \\times 6 4 )$ conditioning on $p$ past frames and predicting pred frames in the future, using models trained to predict $k$ frames at at time. "
897
+ ],
898
+ "table_footnote": [
899
+ "a 94 on only the first frames, 96 on all subsequences of test frames "
900
+ ],
901
+ "table_body": "<table><tr><td>BAIR(64 × 64) [past p → pred ; trained on k]|</td><td>p</td><td>k</td><td>pred</td><td>FVD↓</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>LVT [Rakhimov et al., 2020]</td><td>1</td><td>15</td><td>15</td><td>125.8</td><td>1</td><td>1</td></tr><tr><td>DVD-GAN-FP [Clark et al., 2019]</td><td>1</td><td>15</td><td>15</td><td>109.8</td><td>1</td><td>1</td></tr><tr><td>MCVD spatin (Ours)</td><td>1</td><td>5</td><td>15</td><td>103.8</td><td>18.8</td><td>0.826</td></tr><tr><td>TrIVD-GAN-FP [Luc et al., 2020]</td><td>1</td><td>15</td><td>15</td><td>103.3</td><td>1</td><td>1</td></tr><tr><td>VideoGPT[Yan et al., 2021]</td><td>1</td><td>15</td><td>15</td><td>103.3</td><td>1</td><td>1</td></tr><tr><td>CCVS [Le Moing et al., 2021]</td><td>1</td><td>15</td><td>15</td><td>99.0</td><td>1</td><td>一</td></tr><tr><td>MCVD concat (Ours)</td><td>1</td><td>5</td><td>15</td><td>98.8</td><td>18.8</td><td>0.829</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>1</td><td>5</td><td>15</td><td>96.5</td><td>18.8</td><td>0.828</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>1</td><td>5</td><td>15</td><td>95.6</td><td>18.8</td><td>0.832</td></tr><tr><td>Video Transformer [Weissenborn et al., 2019]</td><td>1</td><td>15</td><td>15</td><td>94-96a</td><td>1</td><td>1</td></tr><tr><td>FitVid [Babaeizadeh et al., 2021]</td><td>1</td><td>15</td><td>15</td><td>93.6</td><td></td><td>一</td></tr><tr><td>MCVD concat past-future-mask (Ours)</td><td>1</td><td>5</td><td>15</td><td>89.5</td><td>16.9</td><td>0.780</td></tr><tr><td>SAVP [Lee et al., 2018]</td><td>2</td><td>14</td><td>14</td><td>116.4</td><td>1</td><td>1</td></tr><tr><td>MCVD spatin (Ours)</td><td></td><td>5</td><td>14</td><td>94.1</td><td>19.1</td><td>0.836</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>22222</td><td>5</td><td>14</td><td>90.5</td><td>19.2</td><td>0.837</td></tr><tr><td>MCVD concat (Ours)</td><td></td><td>5</td><td>14</td><td>90.5</td><td>19.1</td><td>0.834</td></tr><tr><td>MCVD concat past-future-mask (Ours)</td><td></td><td>5</td><td>14</td><td>89.6</td><td>17.1</td><td>0.787</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td></td><td>5</td><td>14</td><td>87.9</td><td>19.1</td><td>0.838</td></tr><tr><td>SAVP [Lee et al., 2018]</td><td>2</td><td>10</td><td>28</td><td>143.4</td><td>1</td><td>0.795</td></tr><tr><td>Hier-vRNN [Castrej6n et al., 2019]</td><td></td><td>10</td><td>28</td><td>143.4</td><td>1</td><td>0.822</td></tr><tr><td>MCVD spatin (Ours)</td><td></td><td>5</td><td>28</td><td>132.1</td><td>17.5</td><td>0.779</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>222222</td><td>5</td><td>28</td><td>127.9</td><td>17.7</td><td>0.789</td></tr><tr><td>MCVD concat (Ours)</td><td></td><td>5</td><td>28</td><td>120.6</td><td>17.6</td><td>0.785</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td></td><td>5</td><td>28</td><td>119.0</td><td>17.7</td><td>0.797</td></tr><tr><td>MCVD concat past-future-mask (Ours)</td><td></td><td>5</td><td>28</td><td>118.4</td><td>16.2</td><td>0.745</td></tr></table>",
902
+ "bbox": [
903
+ 173,
904
+ 250,
905
+ 772,
906
+ 603
907
+ ],
908
+ "page_idx": 8
909
+ },
910
+ {
911
+ "type": "table",
912
+ "img_path": "images/93ba1e2f1da69cea080cd012518803ac4f194bb6667ad79fe7564beada5689fc.jpg",
913
+ "table_caption": [
914
+ "Table 4: Video prediction on Cityscapes $( 1 2 8 \\times 1 2 8 )$ conditioning on 2 frames and predicting 28. SPATIN seems to produce a drift towards brighter images with a color balance shift in frames further from the start frame on Cityscapes, resulting in increased FVD for SPATIN than the CONCAT variant. "
915
+ ],
916
+ "table_footnote": [],
917
+ "table_body": "<table><tr><td>Cityscapes (128 × 128)[2 -→28; trained on k]</td><td>k</td><td>FVD↓</td><td>LPIPS↓</td><td>SSIM↑</td></tr><tr><td> SVG-LP Denton and Fergus [2018]</td><td>10</td><td>1300.26</td><td>0.549 ± 0.06</td><td>0.574 ± 0.08</td></tr><tr><td> vRNN 1L Castrej6n et al. [2019]</td><td>10</td><td>682.08</td><td>0.304 ± 0.10</td><td>0.609 ± 0.11</td></tr><tr><td>Hier-vRNN Castrej6n et al. [2019]</td><td>10</td><td>567.51</td><td>0.264 ± 0.07</td><td>0.628 ± 0.10</td></tr><tr><td>GHVAE Wu et al. [2021]</td><td>10</td><td>418.00</td><td>0.193 ± 0.014</td><td>0.740 ± 0.04</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>5</td><td>184.81</td><td>0.121 ± 0.05</td><td>0.720 ± 0.11</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>5</td><td>141.31</td><td>0.112 ± 0.05</td><td>0.690 ± 0.12</td></tr></table>",
918
+ "bbox": [
919
+ 191,
920
+ 689,
921
+ 805,
922
+ 790
923
+ ],
924
+ "page_idx": 8
925
+ },
926
+ {
927
+ "type": "text",
928
+ "text": "5 Conclusion ",
929
+ "text_level": 1,
930
+ "bbox": [
931
+ 173,
932
+ 824,
933
+ 299,
934
+ 842
935
+ ],
936
+ "page_idx": 8
937
+ },
938
+ {
939
+ "type": "text",
940
+ "text": "We have shown how to obtain SOTA video prediction and interpolation results with randomly masked conditional video diffusion models using a relatively simple architecture. We found that past-masking was able to improve performance across all model variants and configurations tested. We believe our approach may pave the way forward toward high quality larger-scale video generation. ",
941
+ "bbox": [
942
+ 174,
943
+ 859,
944
+ 825,
945
+ 915
946
+ ],
947
+ "page_idx": 8
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "Limitations. Videos generated by these models are still small compared to real movies, and they can still become blurry or inconsistent when the number of generated frames is very large. Our unconditional generation results on the highly diverse UCF-101 dataset are still far from perfect. More work is clearly needed to scale these ",
952
+ "bbox": [
953
+ 173,
954
+ 106,
955
+ 419,
956
+ 228
957
+ ],
958
+ "page_idx": 9
959
+ },
960
+ {
961
+ "type": "table",
962
+ "img_path": "images/e601e0989ea882c0217712e01bff15da7b1f36df011ddba292eb48df98879c00.jpg",
963
+ "table_caption": [
964
+ "Table 5: Unconditional generation of BAIR video frames. "
965
+ ],
966
+ "table_footnote": [],
967
+ "table_body": "<table><tr><td>BAIR (64 × 64) [0 → pred; trained on 5]|pred|FVD↓</td><td></td><td></td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>16</td><td>267.8</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>16</td><td>228.5</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>30</td><td>399.8</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>30</td><td>348.2</td></tr></table>",
968
+ "bbox": [
969
+ 437,
970
+ 127,
971
+ 818,
972
+ 214
973
+ ],
974
+ "page_idx": 9
975
+ },
976
+ {
977
+ "type": "text",
978
+ "text": "models to larger datasets with more diversity and with longer duration video. As has been the case in many other settings, simply using larger models with many more parameters is a strategy that is likely to improve the quality and flexibility of these models – we were limited to 4 GPUs for our work here. There is also a need for faster sampling methods capable of maintaining quality over time. ",
979
+ "bbox": [
980
+ 174,
981
+ 229,
982
+ 825,
983
+ 285
984
+ ],
985
+ "page_idx": 9
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "Given our strong interpolation results, conditional diffusion models which generate skipped frames could make it possible to generate much longer, but consistent video through a strategy of first generating sparse distant frames in a block, followed by an interpolative diffusion step for the missing frames. ",
990
+ "bbox": [
991
+ 174,
992
+ 291,
993
+ 421,
994
+ 415
995
+ ],
996
+ "page_idx": 9
997
+ },
998
+ {
999
+ "type": "table",
1000
+ "img_path": "images/7c422ff79cf559e5a30a4f6e51b5209855b813afc6c2562ab368791170e1bdb8.jpg",
1001
+ "table_caption": [
1002
+ "Table 6: Unconditional generation of UCF-101 video frames. "
1003
+ ],
1004
+ "table_footnote": [],
1005
+ "table_body": "<table><tr><td>UCF-101 (64 × 64) [0→ 16; trained on k]</td><td>k</td><td>FVD↓</td></tr><tr><td>MoCoGAN-MDP [Yushchenko et al., 2019]</td><td>16</td><td>1277.0</td></tr><tr><td>MCVD concat past-mask (Ours)</td><td>4</td><td>1228.3</td></tr><tr><td>TGANv2 [Saito et al., 2020]</td><td>16</td><td>1209.0</td></tr><tr><td>MCVD spatin past-mask (Ours)</td><td>4</td><td>1143.0</td></tr><tr><td>DIGAN [Yu et al., 2022]</td><td>16</td><td>655.0</td></tr></table>",
1006
+ "bbox": [
1007
+ 436,
1008
+ 318,
1009
+ 816,
1010
+ 410
1011
+ ],
1012
+ "page_idx": 9
1013
+ },
1014
+ {
1015
+ "type": "table",
1016
+ "img_path": "images/15760109090b2022ad704be8fb560e3dd8b87eb8b2c5c40be88ce45deb501081.jpg",
1017
+ "table_caption": [
1018
+ "Table 7: Video Interpolation results $( 6 4 \\times 6 4 )$ . Given $p \\operatorname { p a s t } + f$ future frames interpolate $k$ frames. Reporting average of the best metrics out of $n$ trajectories per test sample. $\\downarrow ( p + f )$ and $\\uparrow k$ is harder. We used MCVD spatin past-mask for SMMNIST and KTH, and MCVD concat past-future-mask for BAIR. We also include results on SMMNIST for a \"pure\" model trained without any masking. "
1019
+ ],
1020
+ "table_footnote": [],
1021
+ "table_body": "<table><tr><td rowspan=\"2\"></td><td colspan=\"4\">SMMNIST (64× 64) p+fkn</td><td colspan=\"3\">KTH(64× 64)</td><td colspan=\"4\">BAIR (64× 64)</td></tr><tr><td></td><td></td><td></td><td>|PSNR↑ SSIM↑</td><td></td><td>p+fkn</td><td>|PSNR↑SSIM↑</td><td></td><td></td><td>p+fkn</td><td>|PSNR↑ SSIM↑</td></tr><tr><td>SVG-LP Denton and Fergus [2018]</td><td>18 7100</td><td></td><td>13.543</td><td>0.741</td><td>18</td><td>7100</td><td>28.131 0.883</td><td></td><td>187100</td><td></td><td>18.648 0.846</td></tr><tr><td>FSTN Lu et al. [2017]</td><td>18</td><td>7100</td><td>14.730</td><td>0.765</td><td>18</td><td>7100</td><td>29.431 0.899</td><td></td><td>187100</td><td>19.908</td><td>0.850</td></tr><tr><td>SepConv Niklaus et al. [2017]</td><td>18 7100</td><td></td><td>14.759</td><td>0.775</td><td>18</td><td>7100</td><td>29.210 0.904</td><td></td><td>187100</td><td></td><td>21.615 0.877</td></tr><tr><td>SuperSloMo Jiang et al. [2018]</td><td>18 7100</td><td></td><td>13.387</td><td>0.749</td><td>18</td><td>7100</td><td>28.756 0.893</td><td></td><td>1 二</td><td></td><td>一</td></tr><tr><td> SDVI full Xu et al. [2020]</td><td>18 7100</td><td></td><td>16.025</td><td>0.842</td><td>18</td><td>7100</td><td>29.190 0.901</td><td></td><td>18 7100</td><td>21.432</td><td>0.880</td></tr><tr><td>SDVI Xu et al. [2020]</td><td>167100</td><td></td><td>14.857</td><td>0.782</td><td>16</td><td>7100</td><td>26.907 0.831</td><td></td><td>16 7100</td><td>19.694</td><td>0.852</td></tr><tr><td rowspan=\"2\">MCVD (Ours)</td><td>10 10 100</td><td></td><td>20.944</td><td>0.854</td><td>15 10100</td><td></td><td>34.669 0.943</td><td></td><td>45100</td><td>25.162</td><td>0.932</td></tr><tr><td>10510</td><td></td><td>27.693</td><td>0.941</td><td></td><td></td><td>34.068</td><td>0.942</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>pure</td><td>18.385</td><td>0.802</td><td>10</td><td>15 10 10 510</td><td>35.611</td><td>0.963</td><td>4510</td><td>23.408</td><td>0.914</td></tr></table>",
1022
+ "bbox": [
1023
+ 176,
1024
+ 505,
1025
+ 823,
1026
+ 650
1027
+ ],
1028
+ "page_idx": 9
1029
+ },
1030
+ {
1031
+ "type": "text",
1032
+ "text": "Broader Impacts. High-quality video generation is potentially a powerful technology that could be used by malicious actors for applications such as creating fake video content. Our formulation focuses on capturing the distributions of real video sequences. High-quality video prediction could one day find use in applications such as autonomous vehicles, where the cost of errors could be high. Diffusion methods have shown great promise for covering the modes of real probability distributions. In this context, diffusion-based techniques for generative modelling may be a promising avenue for future research where the ability to capture modes properly is safety critical. Another potential point of impact is the amount of computational resources being spent for these applications involving the high fidelity and voluminous modality of video data. We emphasize the use of limited resources in achieving better or comparable results. Our submission provides evidence for more efficient computation involving fewer GPU hours spent in training time. ",
1033
+ "bbox": [
1034
+ 173,
1035
+ 665,
1036
+ 826,
1037
+ 818
1038
+ ],
1039
+ "page_idx": 9
1040
+ },
1041
+ {
1042
+ "type": "text",
1043
+ "text": "Acknowledgments and Disclosure of Funding ",
1044
+ "text_level": 1,
1045
+ "bbox": [
1046
+ 174,
1047
+ 837,
1048
+ 553,
1049
+ 854
1050
+ ],
1051
+ "page_idx": 9
1052
+ },
1053
+ {
1054
+ "type": "text",
1055
+ "text": "We thank Digital Research Alliance of Canada for the GPUs which were used in this work. Alexia, Vikram thank their wives and cat for their support. We thank CIFAR for support under the AI Chairs program, and NSERC for support under the Discovery grants program, application ID 5018358. ",
1056
+ "bbox": [
1057
+ 176,
1058
+ 869,
1059
+ 825,
1060
+ 911
1061
+ ],
1062
+ "page_idx": 9
1063
+ },
1064
+ {
1065
+ "type": "text",
1066
+ "text": "References ",
1067
+ "text_level": 1,
1068
+ "bbox": [
1069
+ 174,
1070
+ 89,
1071
+ 267,
1072
+ 106
1073
+ ],
1074
+ "page_idx": 10
1075
+ },
1076
+ {
1077
+ "type": "text",
1078
+ "text": "Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3213–3223, 2016. ",
1079
+ "bbox": [
1080
+ 173,
1081
+ 113,
1082
+ 826,
1083
+ 169
1084
+ ],
1085
+ "page_idx": 10
1086
+ },
1087
+ {
1088
+ "type": "text",
1089
+ "text": "Bohan Wu, Suraj Nair, Roberto Martin-Martin, Li Fei-Fei, and Chelsea Finn. Greedy hierarchical variational autoencoders for large-scale video prediction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2318–2328, 2021. ",
1090
+ "bbox": [
1091
+ 174,
1092
+ 178,
1093
+ 821,
1094
+ 220
1095
+ ],
1096
+ "page_idx": 10
1097
+ },
1098
+ {
1099
+ "type": "text",
1100
+ "text": "Dirk Weissenborn, Oscar Täckström, and Jakob Uszkoreit. Scaling autoregressive video models. arXiv preprint arXiv:1906.02634, 2019. ",
1101
+ "bbox": [
1102
+ 171,
1103
+ 228,
1104
+ 825,
1105
+ 257
1106
+ ],
1107
+ "page_idx": 10
1108
+ },
1109
+ {
1110
+ "type": "text",
1111
+ "text": "Ruben Villegas, Arkanath Pathak, Harini Kannan, Dumitru Erhan, Quoc V Le, and Honglak Lee. High fidelity video prediction with large stochastic recurrent neural networks. Advances in Neural Information Processing Systems, 32, 2019. ",
1112
+ "bbox": [
1113
+ 173,
1114
+ 265,
1115
+ 825,
1116
+ 309
1117
+ ],
1118
+ "page_idx": 10
1119
+ },
1120
+ {
1121
+ "type": "text",
1122
+ "text": "Mohammad Babaeizadeh, Mohammad Taghi Saffar, Suraj Nair, Sergey Levine, Chelsea Finn, and Dumitru Erhan. Fitvid: Overfitting in pixel-level video prediction. arXiv preprint arXiv:2106.13195, 2021. ",
1123
+ "bbox": [
1124
+ 173,
1125
+ 316,
1126
+ 825,
1127
+ 359
1128
+ ],
1129
+ "page_idx": 10
1130
+ },
1131
+ {
1132
+ "type": "text",
1133
+ "text": "Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pages 2256–2265. PMLR, 2015. ",
1134
+ "bbox": [
1135
+ 174,
1136
+ 367,
1137
+ 825,
1138
+ 410
1139
+ ],
1140
+ "page_idx": 10
1141
+ },
1142
+ {
1143
+ "type": "text",
1144
+ "text": "Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 2020. ",
1145
+ "bbox": [
1146
+ 169,
1147
+ 417,
1148
+ 825,
1149
+ 448
1150
+ ],
1151
+ "page_idx": 10
1152
+ },
1153
+ {
1154
+ "type": "text",
1155
+ "text": "Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34, 2021. ",
1156
+ "bbox": [
1157
+ 171,
1158
+ 455,
1159
+ 823,
1160
+ 484
1161
+ ],
1162
+ "page_idx": 10
1163
+ },
1164
+ {
1165
+ "type": "text",
1166
+ "text": "Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 2019. ",
1167
+ "bbox": [
1168
+ 173,
1169
+ 492,
1170
+ 825,
1171
+ 522
1172
+ ],
1173
+ "page_idx": 10
1174
+ },
1175
+ {
1176
+ "type": "text",
1177
+ "text": "Zengyi Li, Yubei Chen, and Friedrich T Sommer. Learning energy-based models in high-dimensional spaces with multi-scale denoising score matching. arXiv preprint arXiv:1910.07762, 2019. ",
1178
+ "bbox": [
1179
+ 173,
1180
+ 530,
1181
+ 823,
1182
+ 559
1183
+ ],
1184
+ "page_idx": 10
1185
+ },
1186
+ {
1187
+ "type": "text",
1188
+ "text": "Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. Advances in Neural Information Processing Systems, 2020. ",
1189
+ "bbox": [
1190
+ 171,
1191
+ 568,
1192
+ 825,
1193
+ 597
1194
+ ],
1195
+ "page_idx": 10
1196
+ },
1197
+ {
1198
+ "type": "text",
1199
+ "text": "Alexia Jolicoeur-Martineau, Rémi Piché-Taillefer, Rémi Tachet des Combes, and Ioannis Mitliagkas. Adversarial score matching and improved sampling for image generation. International Conference on Learning Representations, 2021a. URL arXivpreprintarXiv:2009.05475. ",
1200
+ "bbox": [
1201
+ 176,
1202
+ 604,
1203
+ 821,
1204
+ 647
1205
+ ],
1206
+ "page_idx": 10
1207
+ },
1208
+ {
1209
+ "type": "text",
1210
+ "text": "Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv:2010.02502, October 2020. URL https://arxiv.org/abs/2010.02502. ",
1211
+ "bbox": [
1212
+ 171,
1213
+ 655,
1214
+ 825,
1215
+ 685
1216
+ ],
1217
+ "page_idx": 10
1218
+ },
1219
+ {
1220
+ "type": "text",
1221
+ "text": "Alexia Jolicoeur-Martineau, Ke Li, Rémi Piché-Taillefer, Tal Kachman, and Ioannis Mitliagkas. Gotta go fast when generating data with score-based models. arXiv preprint arXiv:2105.14080, 2021b. ",
1222
+ "bbox": [
1223
+ 174,
1224
+ 693,
1225
+ 825,
1226
+ 734
1227
+ ],
1228
+ "page_idx": 10
1229
+ },
1230
+ {
1231
+ "type": "text",
1232
+ "text": "Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. arXiv preprint arXiv:2202.00512, 2022. ",
1233
+ "bbox": [
1234
+ 173,
1235
+ 743,
1236
+ 823,
1237
+ 772
1238
+ ],
1239
+ "page_idx": 10
1240
+ },
1241
+ {
1242
+ "type": "text",
1243
+ "text": "Luping Liu, Yi Ren, Zhijie Lin, and Zhou Zhao. Pseudo numerical methods for diffusion models on manifolds. arXiv preprint arXiv:2202.09778, 2022. ",
1244
+ "bbox": [
1245
+ 171,
1246
+ 780,
1247
+ 823,
1248
+ 810
1249
+ ],
1250
+ "page_idx": 10
1251
+ },
1252
+ {
1253
+ "type": "text",
1254
+ "text": "Zhisheng Xiao, Karsten Kreis, and Arash Vahdat. Tackling the generative learning trilemma with denoising diffusion GANs. In International Conference on Learning Representations (ICLR), 2022. ",
1255
+ "bbox": [
1256
+ 176,
1257
+ 818,
1258
+ 823,
1259
+ 861
1260
+ ],
1261
+ "page_idx": 10
1262
+ },
1263
+ {
1264
+ "type": "text",
1265
+ "text": "Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. International Conference on Learning Representations, 2021. URL arXivpreprintarXiv:2011.13456. ",
1266
+ "bbox": [
1267
+ 176,
1268
+ 868,
1269
+ 826,
1270
+ 912
1271
+ ],
1272
+ "page_idx": 10
1273
+ },
1274
+ {
1275
+ "type": "text",
1276
+ "text": "Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J. Fleet. Video diffusion models, 2022. URL https://arxiv.org/abs/2204.03458. ",
1277
+ "bbox": [
1278
+ 173,
1279
+ 90,
1280
+ 826,
1281
+ 121
1282
+ ],
1283
+ "page_idx": 11
1284
+ },
1285
+ {
1286
+ "type": "text",
1287
+ "text": "Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(56):1929–1958, 2014. ",
1288
+ "bbox": [
1289
+ 179,
1290
+ 128,
1291
+ 823,
1292
+ 172
1293
+ ],
1294
+ "page_idx": 11
1295
+ },
1296
+ {
1297
+ "type": "text",
1298
+ "text": "Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computerassisted intervention, pages 234–241. Springer, 2015. ",
1299
+ "bbox": [
1300
+ 176,
1301
+ 181,
1302
+ 823,
1303
+ 224
1304
+ ],
1305
+ "page_idx": 11
1306
+ },
1307
+ {
1308
+ "type": "text",
1309
+ "text": "Sina Honari, Jason Yosinski, Pascal Vincent, and Christopher Pal. Recombinator networks: Learning coarse-to-fine feature aggregation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5743–5752, 2016. ",
1310
+ "bbox": [
1311
+ 176,
1312
+ 233,
1313
+ 823,
1314
+ 276
1315
+ ],
1316
+ "page_idx": 11
1317
+ },
1318
+ {
1319
+ "type": "text",
1320
+ "text": "Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017. ",
1321
+ "bbox": [
1322
+ 173,
1323
+ 285,
1324
+ 825,
1325
+ 329
1326
+ ],
1327
+ "page_idx": 11
1328
+ },
1329
+ {
1330
+ "type": "text",
1331
+ "text": "Kunihiko Fukushima and Sei Miyake. Neocognitron: A self-organizing neural network model for a mechanism of visual pattern recognition. In Competition and cooperation in neural nets, pages 267–285. Springer, 1982. ",
1332
+ "bbox": [
1333
+ 173,
1334
+ 338,
1335
+ 825,
1336
+ 381
1337
+ ],
1338
+ "page_idx": 11
1339
+ },
1340
+ {
1341
+ "type": "text",
1342
+ "text": "Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. arXiv preprint arXiv:1601.06733, 2016. ",
1343
+ "bbox": [
1344
+ 169,
1345
+ 390,
1346
+ 823,
1347
+ 420
1348
+ ],
1349
+ "page_idx": 11
1350
+ },
1351
+ {
1352
+ "type": "text",
1353
+ "text": "Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the European conference on computer vision (ECCV), pages 3–19, 2018. ",
1354
+ "bbox": [
1355
+ 173,
1356
+ 429,
1357
+ 823,
1358
+ 458
1359
+ ],
1360
+ "page_idx": 11
1361
+ },
1362
+ {
1363
+ "type": "text",
1364
+ "text": "Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2337–2346, 2019. ",
1365
+ "bbox": [
1366
+ 174,
1367
+ 467,
1368
+ 823,
1369
+ 511
1370
+ ],
1371
+ "page_idx": 11
1372
+ },
1373
+ {
1374
+ "type": "text",
1375
+ "text": "Eliya Nachmani, Robin San Roman, and Lior Wolf. Denoising diffusion gamma models. arXiv preprint arXiv:2110.05948, 2021. ",
1376
+ "bbox": [
1377
+ 173,
1378
+ 518,
1379
+ 823,
1380
+ 549
1381
+ ],
1382
+ "page_idx": 11
1383
+ },
1384
+ {
1385
+ "type": "text",
1386
+ "text": "Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. SDEdit: Guided image synthesis and editing with stochastic differential equations. In International Conference on Learning Representations, 2022. ",
1387
+ "bbox": [
1388
+ 174,
1389
+ 558,
1390
+ 825,
1391
+ 602
1392
+ ],
1393
+ "page_idx": 11
1394
+ },
1395
+ {
1396
+ "type": "text",
1397
+ "text": "Chitwan Saharia, William Chan, Huiwen Chang, Chris A Lee, Jonathan Ho, Tim Salimans, David J Fleet, and Mohammad Norouzi. Palette: Image-to-image diffusion models. arXiv preprint arXiv:2111.05826, 2021. ",
1398
+ "bbox": [
1399
+ 173,
1400
+ 609,
1401
+ 823,
1402
+ 654
1403
+ ],
1404
+ "page_idx": 11
1405
+ },
1406
+ {
1407
+ "type": "text",
1408
+ "text": "Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021. ",
1409
+ "bbox": [
1410
+ 173,
1411
+ 662,
1412
+ 825,
1413
+ 705
1414
+ ],
1415
+ "page_idx": 11
1416
+ },
1417
+ {
1418
+ "type": "text",
1419
+ "text": "Bahjat Kawar, Michael Elad, Stefano Ermon, and Jiaming Song. Denoising diffusion restoration models. arXiv preprint arXiv:2201.11793, 2022. ",
1420
+ "bbox": [
1421
+ 171,
1422
+ 714,
1423
+ 823,
1424
+ 744
1425
+ ],
1426
+ "page_idx": 11
1427
+ },
1428
+ {
1429
+ "type": "text",
1430
+ "text": "Ruihan Yang, Prakhar Srivastava, and Stephan Mandt. Diffusion probabilistic modeling for video generation. arXiv preprint arXiv:2203.09481, 2022. ",
1431
+ "bbox": [
1432
+ 171,
1433
+ 752,
1434
+ 823,
1435
+ 782
1436
+ ],
1437
+ "page_idx": 11
1438
+ },
1439
+ {
1440
+ "type": "text",
1441
+ "text": "Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. In International Conference on Learning Representations, 2018a. ",
1442
+ "bbox": [
1443
+ 174,
1444
+ 791,
1445
+ 825,
1446
+ 834
1447
+ ],
1448
+ "page_idx": 11
1449
+ },
1450
+ {
1451
+ "type": "text",
1452
+ "text": "Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In Proceedings of the 35th International Conference on Machine Learning, pages 1174–1183, 2018. ",
1453
+ "bbox": [
1454
+ 171,
1455
+ 844,
1456
+ 823,
1457
+ 873
1458
+ ],
1459
+ "page_idx": 11
1460
+ },
1461
+ {
1462
+ "type": "text",
1463
+ "text": "Lluís Castrejón, Nicolas Ballas, and Aaron C. Courville. Improved conditional vrnns for video prediction. ArXiv, abs/1904.12165, 2019. ",
1464
+ "bbox": [
1465
+ 176,
1466
+ 882,
1467
+ 820,
1468
+ 911
1469
+ ],
1470
+ "page_idx": 11
1471
+ },
1472
+ {
1473
+ "type": "text",
1474
+ "text": "Alex X. Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. ArXiv, abs/1804.01523, 2018. ",
1475
+ "bbox": [
1476
+ 171,
1477
+ 90,
1478
+ 826,
1479
+ 119
1480
+ ],
1481
+ "page_idx": 12
1482
+ },
1483
+ {
1484
+ "type": "text",
1485
+ "text": "Jean-Yves Franceschi, Edouard Delasalles, Mickaël Chen, Sylvain Lamprier, and Patrick Gallinari. Stochastic latent residual video prediction. In International Conference on Machine Learning, pages 3233–3246. PMLR, 2020. ",
1486
+ "bbox": [
1487
+ 176,
1488
+ 127,
1489
+ 825,
1490
+ 170
1491
+ ],
1492
+ "page_idx": 12
1493
+ },
1494
+ {
1495
+ "type": "text",
1496
+ "text": "Adil Kaan Akan, Erkut Erdem, Aykut Erdem, and Fatma Güney. Slamp: Stochastic latent appearance and motion prediction. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 14728–14737, 2021. ",
1497
+ "bbox": [
1498
+ 176,
1499
+ 178,
1500
+ 823,
1501
+ 222
1502
+ ],
1503
+ "page_idx": 12
1504
+ },
1505
+ {
1506
+ "type": "text",
1507
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Adv. Neural Inform. Process. Syst., volume 30, 2017. ",
1508
+ "bbox": [
1509
+ 174,
1510
+ 228,
1511
+ 823,
1512
+ 271
1513
+ ],
1514
+ "page_idx": 12
1515
+ },
1516
+ {
1517
+ "type": "text",
1518
+ "text": "Wilson Yan, Yunzhi Zhang, Pieter Abbeel, and Aravind Srinivas. Videogpt: Video generation using vq-vae and transformers. arXiv preprint arXiv:2104.10157, 2021. ",
1519
+ "bbox": [
1520
+ 173,
1521
+ 279,
1522
+ 825,
1523
+ 309
1524
+ ],
1525
+ "page_idx": 12
1526
+ },
1527
+ {
1528
+ "type": "text",
1529
+ "text": "Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Adv. Neural Inform. Process. Syst., 33:1877–1901, 2020. ",
1530
+ "bbox": [
1531
+ 176,
1532
+ 315,
1533
+ 821,
1534
+ 359
1535
+ ],
1536
+ "page_idx": 12
1537
+ },
1538
+ {
1539
+ "type": "text",
1540
+ "text": "Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Adv. Neural Inform. Process. Syst., 30, 2017. ",
1541
+ "bbox": [
1542
+ 171,
1543
+ 366,
1544
+ 825,
1545
+ 396
1546
+ ],
1547
+ "page_idx": 12
1548
+ },
1549
+ {
1550
+ "type": "text",
1551
+ "text": "Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600–612, 2004. ",
1552
+ "bbox": [
1553
+ 174,
1554
+ 404,
1555
+ 825,
1556
+ 446
1557
+ ],
1558
+ "page_idx": 12
1559
+ },
1560
+ {
1561
+ "type": "text",
1562
+ "text": "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 preprint arXiv:1812.01717, 2018. ",
1563
+ "bbox": [
1564
+ 176,
1565
+ 454,
1566
+ 825,
1567
+ 497
1568
+ ],
1569
+ "page_idx": 12
1570
+ },
1571
+ {
1572
+ "type": "text",
1573
+ "text": "Ruslan Rakhimov, Denis Volkhonskiy, Alexey Artemov, Denis Zorin, and Evgeny Burnaev. Latent video transformer. arXiv preprint arXiv:2006.10704, 2020. ",
1574
+ "bbox": [
1575
+ 171,
1576
+ 505,
1577
+ 823,
1578
+ 535
1579
+ ],
1580
+ "page_idx": 12
1581
+ },
1582
+ {
1583
+ "type": "text",
1584
+ "text": "Guillaume Le Moing, Jean Ponce, and Cordelia Schmid. Ccvs: Context-aware controllable video synthesis. Advances in Neural Information Processing Systems, 34, 2021. ",
1585
+ "bbox": [
1586
+ 173,
1587
+ 541,
1588
+ 823,
1589
+ 571
1590
+ ],
1591
+ "page_idx": 12
1592
+ },
1593
+ {
1594
+ "type": "text",
1595
+ "text": "Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. Advances in neural information processing systems, 29, 2016. ",
1596
+ "bbox": [
1597
+ 173,
1598
+ 578,
1599
+ 823,
1600
+ 608
1601
+ ],
1602
+ "page_idx": 12
1603
+ },
1604
+ {
1605
+ "type": "text",
1606
+ "text": "Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. In International Conference on Learning Representations, 2017. ",
1607
+ "bbox": [
1608
+ 173,
1609
+ 614,
1610
+ 823,
1611
+ 659
1612
+ ],
1613
+ "page_idx": 12
1614
+ },
1615
+ {
1616
+ "type": "text",
1617
+ "text": "Masaki Saito, Eiichi Matsumoto, and Shunta Saito. Temporal generative adversarial nets with singular value clipping. In Proceedings of the IEEE international conference on computer vision, pages 2830–2839, 2017. ",
1618
+ "bbox": [
1619
+ 171,
1620
+ 666,
1621
+ 823,
1622
+ 709
1623
+ ],
1624
+ "page_idx": 12
1625
+ },
1626
+ {
1627
+ "type": "text",
1628
+ "text": "Masaki Saito, Shunta Saito, Masanori Koyama, and Sosuke Kobayashi. Train sparsely, generate densely: Memory-efficient unsupervised training of high-resolution temporal gan. International Journal of Computer Vision, 128(10):2586–2606, 2020. ",
1629
+ "bbox": [
1630
+ 173,
1631
+ 717,
1632
+ 823,
1633
+ 760
1634
+ ],
1635
+ "page_idx": 12
1636
+ },
1637
+ {
1638
+ "type": "text",
1639
+ "text": "Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. Mocogan: Decomposing motion and content for video generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1526–1535, 2018. ",
1640
+ "bbox": [
1641
+ 174,
1642
+ 767,
1643
+ 823,
1644
+ 810
1645
+ ],
1646
+ "page_idx": 12
1647
+ },
1648
+ {
1649
+ "type": "text",
1650
+ "text": "Vladyslav Yushchenko, Nikita Araslanov, and Stefan Roth. Markov decision process for video generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, pages 0–0, 2019. ",
1651
+ "bbox": [
1652
+ 174,
1653
+ 818,
1654
+ 823,
1655
+ 861
1656
+ ],
1657
+ "page_idx": 12
1658
+ },
1659
+ {
1660
+ "type": "text",
1661
+ "text": "Sandra Aigner and Marco Körner. Futuregan: Anticipating the future frames of video sequences using spatio-temporal 3d convolutions in progressively growing gans. arXiv preprint arXiv:1810.01325, 2018. ",
1662
+ "bbox": [
1663
+ 174,
1664
+ 868,
1665
+ 823,
1666
+ 911
1667
+ ],
1668
+ "page_idx": 12
1669
+ },
1670
+ {
1671
+ "type": "text",
1672
+ "text": "Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In Int. Conf. Learn. Represent., 2018. ",
1673
+ "bbox": [
1674
+ 169,
1675
+ 90,
1676
+ 825,
1677
+ 119
1678
+ ],
1679
+ "page_idx": 13
1680
+ },
1681
+ {
1682
+ "type": "text",
1683
+ "text": "Andres Munoz, Mohammadreza Zolfaghari, Max Argus, and Thomas Brox. Temporal shift gan for large scale video generation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 3179–3188, 2021. ",
1684
+ "bbox": [
1685
+ 173,
1686
+ 127,
1687
+ 823,
1688
+ 170
1689
+ ],
1690
+ "page_idx": 13
1691
+ },
1692
+ {
1693
+ "type": "text",
1694
+ "text": "Pauline Luc, Aidan Clark, Sander Dieleman, Diego de Las Casas, Yotam Doron, Albin Cassirer, and Karen Simonyan. Transformation-based adversarial video prediction on large-scale data. arXiv preprint arXiv:2003.04035, 2020. ",
1695
+ "bbox": [
1696
+ 176,
1697
+ 178,
1698
+ 823,
1699
+ 220
1700
+ ],
1701
+ "page_idx": 13
1702
+ },
1703
+ {
1704
+ "type": "text",
1705
+ "text": "Sihyun Yu, Jihoon Tack, Sangwoo Mo, Hyunsu Kim, Junho Kim, Jung-Woo Ha, and Jinwoo Shin. Generating videos with dynamics-aware implicit generative adversarial networks. In International Conference on Learning Representations, 2022. ",
1706
+ "bbox": [
1707
+ 176,
1708
+ 228,
1709
+ 825,
1710
+ 272
1711
+ ],
1712
+ "page_idx": 13
1713
+ },
1714
+ {
1715
+ "type": "text",
1716
+ "text": "Simon Niklaus, Long Mai, and Feng Liu. Video frame interpolation via adaptive convolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 670–679, 2017. ",
1717
+ "bbox": [
1718
+ 174,
1719
+ 279,
1720
+ 823,
1721
+ 321
1722
+ ],
1723
+ "page_idx": 13
1724
+ },
1725
+ {
1726
+ "type": "text",
1727
+ "text": "Huaizu Jiang, Deqing Sun, Varun Jampani, Ming-Hsuan Yang, Erik Learned-Miller, and Jan Kautz. Super slomo: High quality estimation of multiple intermediate frames for video interpolation. In IEEE Conf. Comput. Vis. Pattern Recog., pages 9000–9008, 2018. ",
1728
+ "bbox": [
1729
+ 176,
1730
+ 329,
1731
+ 823,
1732
+ 373
1733
+ ],
1734
+ "page_idx": 13
1735
+ },
1736
+ {
1737
+ "type": "text",
1738
+ "text": "Tianfan Xue, Baian Chen, Jiajun Wu, Donglai Wei, and William T Freeman. Video enhancement with task-oriented flow. Int. J. Comput. Vis., 127(8):1106–1125, 2019. ",
1739
+ "bbox": [
1740
+ 171,
1741
+ 381,
1742
+ 823,
1743
+ 410
1744
+ ],
1745
+ "page_idx": 13
1746
+ },
1747
+ {
1748
+ "type": "text",
1749
+ "text": "Wenbo Bao, Wei-Sheng Lai, Chao Ma, Xiaoyun Zhang, Zhiyong Gao, and Ming-Hsuan Yang. Depthaware video frame interpolation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3703–3712, 2019. ",
1750
+ "bbox": [
1751
+ 174,
1752
+ 417,
1753
+ 825,
1754
+ 460
1755
+ ],
1756
+ "page_idx": 13
1757
+ },
1758
+ {
1759
+ "type": "text",
1760
+ "text": "Ren Yang, Fabian Mentzer, Luc Van Gool, and Radu Timofte. Learning for video compression with recurrent auto-encoder and recurrent probability model. IEEE Journal of Selected Topics in Signal Processing, 15(2):388–401, 2020. ",
1761
+ "bbox": [
1762
+ 176,
1763
+ 468,
1764
+ 823,
1765
+ 511
1766
+ ],
1767
+ "page_idx": 13
1768
+ },
1769
+ {
1770
+ "type": "text",
1771
+ "text": "Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. ",
1772
+ "bbox": [
1773
+ 173,
1774
+ 518,
1775
+ 823,
1776
+ 547
1777
+ ],
1778
+ "page_idx": 13
1779
+ },
1780
+ {
1781
+ "type": "text",
1782
+ "text": "Jonathan Tompson, Ross Goroshin, Arjun Jain, Yann LeCun, and Christoph Bregler. Efficient object localization using convolutional networks. In IEEE Conf. Comput. Vis. Pattern Recog., pages 648–656, 2015. ",
1783
+ "bbox": [
1784
+ 173,
1785
+ 555,
1786
+ 823,
1787
+ 598
1788
+ ],
1789
+ "page_idx": 13
1790
+ },
1791
+ {
1792
+ "type": "text",
1793
+ "text": "Sébastien de Blois, Mathieu Garon, Christian Gagné, and Jean-François Lalonde. Input dropout for spatially aligned modalities. In IEEE Int. Conf. Image Process., pages 733–737, 2020. ",
1794
+ "bbox": [
1795
+ 173,
1796
+ 606,
1797
+ 823,
1798
+ 636
1799
+ ],
1800
+ "page_idx": 13
1801
+ },
1802
+ {
1803
+ "type": "text",
1804
+ "text": "Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In International conference on machine learning, pages 843–852. PMLR, 2015. ",
1805
+ "bbox": [
1806
+ 173,
1807
+ 642,
1808
+ 823,
1809
+ 685
1810
+ ],
1811
+ "page_idx": 13
1812
+ },
1813
+ {
1814
+ "type": "text",
1815
+ "text": "Christian Schuldt, Ivan Laptev, and Barbara Caputo. Recognizing human actions: a local svm approach. In Proceedings of the 17th International Conference on Pattern Recognition, 2004. ICPR 2004., volume 3, pages 32–36. IEEE, 2004. ",
1816
+ "bbox": [
1817
+ 174,
1818
+ 693,
1819
+ 826,
1820
+ 737
1821
+ ],
1822
+ "page_idx": 13
1823
+ },
1824
+ {
1825
+ "type": "text",
1826
+ "text": "Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. In CoRL, pages 344–356, 2017. ",
1827
+ "bbox": [
1828
+ 173,
1829
+ 744,
1830
+ 823,
1831
+ 773
1832
+ ],
1833
+ "page_idx": 13
1834
+ },
1835
+ {
1836
+ "type": "text",
1837
+ "text": "Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012. ",
1838
+ "bbox": [
1839
+ 171,
1840
+ 781,
1841
+ 823,
1842
+ 810
1843
+ ],
1844
+ "page_idx": 13
1845
+ },
1846
+ {
1847
+ "type": "text",
1848
+ "text": "Xiaojie Gao, Yueming Jin, Qi Dou, Chi-Wing Fu, and Pheng-Ann Heng. Accurate grid keypoint learning for efficient video prediction. In 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 5908–5915. IEEE, 2021. ",
1849
+ "bbox": [
1850
+ 174,
1851
+ 818,
1852
+ 823,
1853
+ 862
1854
+ ],
1855
+ "page_idx": 13
1856
+ },
1857
+ {
1858
+ "type": "text",
1859
+ "text": "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 Advances in neural information processing systems, pages 6626–6637, 2017. ",
1860
+ "bbox": [
1861
+ 174,
1862
+ 869,
1863
+ 826,
1864
+ 911
1865
+ ],
1866
+ "page_idx": 13
1867
+ },
1868
+ {
1869
+ "type": "text",
1870
+ "text": "Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, Xi Chen, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, 2016. ",
1871
+ "bbox": [
1872
+ 173,
1873
+ 90,
1874
+ 823,
1875
+ 133
1876
+ ],
1877
+ "page_idx": 14
1878
+ },
1879
+ {
1880
+ "type": "text",
1881
+ "text": "Aidan Clark, Jeff Donahue, and Karen Simonyan. Adversarial video generation on complex datasets. arXiv preprint arXiv:1907.06571, 2019. ",
1882
+ "bbox": [
1883
+ 169,
1884
+ 142,
1885
+ 825,
1886
+ 171
1887
+ ],
1888
+ "page_idx": 14
1889
+ },
1890
+ {
1891
+ "type": "text",
1892
+ "text": "Chaochao Lu, Michael Hirsch, and Bernhard Scholkopf. Flexible spatio-temporal networks for video prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6523–6531, 2017. ",
1893
+ "bbox": [
1894
+ 174,
1895
+ 179,
1896
+ 823,
1897
+ 222
1898
+ ],
1899
+ "page_idx": 14
1900
+ },
1901
+ {
1902
+ "type": "text",
1903
+ "text": "Qiangeng Xu, Hanwang Zhang, Weiyue Wang, Peter Belhumeur, and Ulrich Neumann. Stochastic dynamics for video infilling. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2714–2723, 2020. ",
1904
+ "bbox": [
1905
+ 174,
1906
+ 231,
1907
+ 823,
1908
+ 273
1909
+ ],
1910
+ "page_idx": 14
1911
+ },
1912
+ {
1913
+ "type": "text",
1914
+ "text": "Seiya Tokui, Ryosuke Okuta, Takuya Akiba, Yusuke Niitani, Toru Ogawa, Shunta Saito, Shuji Suzuki, Kota Uenishi, Brian Vogel, and Hiroyuki Yamazaki Vincent. Chainer: A deep learning framework for accelerating the research cycle. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2002–2011, 2019. ",
1915
+ "bbox": [
1916
+ 173,
1917
+ 282,
1918
+ 826,
1919
+ 339
1920
+ ],
1921
+ "page_idx": 14
1922
+ },
1923
+ {
1924
+ "type": "text",
1925
+ "text": "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. Advances in neural information processing systems, 32, 2019. ",
1926
+ "bbox": [
1927
+ 173,
1928
+ 347,
1929
+ 826,
1930
+ 405
1931
+ ],
1932
+ "page_idx": 14
1933
+ },
1934
+ {
1935
+ "type": "text",
1936
+ "text": "Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H. Campbell, and Sergey Levine. Stochastic variational video prediction. International Conference on Learning Representations, 2018b. ",
1937
+ "bbox": [
1938
+ 174,
1939
+ 412,
1940
+ 825,
1941
+ 455
1942
+ ],
1943
+ "page_idx": 14
1944
+ },
1945
+ {
1946
+ "type": "text",
1947
+ "text": "Matthias Minderer, Chen Sun, Ruben Villegas, Forrester Cole, Kevin P Murphy, and Honglak Lee. Unsupervised learning of object structure and dynamics from videos. Advances in Neural Information Processing Systems, 32, 2019. ",
1948
+ "bbox": [
1949
+ 176,
1950
+ 464,
1951
+ 823,
1952
+ 507
1953
+ ],
1954
+ "page_idx": 14
1955
+ },
1956
+ {
1957
+ "type": "text",
1958
+ "text": "Beibei Jin, Yu Hu, Qiankun Tang, Jingyu Niu, Zhiping Shi, Yinhe Han, and Xiaowei Li. Exploring spatial-temporal multi-frequency analysis for high-fidelity and temporal-consistency video prediction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4554–4563, 2020. ",
1959
+ "bbox": [
1960
+ 173,
1961
+ 515,
1962
+ 826,
1963
+ 571
1964
+ ],
1965
+ "page_idx": 14
1966
+ }
1967
+ ]
parse/dev/hX5Ia-ION8Y/hX5Ia-ION8Y_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/xm6YD62D1Ub/xm6YD62D1Ub.md ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VICREG: VARIANCE-INVARIANCE-COVARIANCE REGULARIZATION FOR SELF-SUPERVISED LEARNING
2
+
3
+ # Adrien Bardes1,2
4
+
5
+ Jean Ponce2,4
6
+
7
+ Yann LeCun $^ { 1 , 3 , 4 }$
8
+
9
+ 1Facebook AI Research
10
+ 2Inria, École normale supérieure, CNRS, PSL Research University
11
+ 3Courant Institute, New York University
12
+ 4Center for Data Science, New York University
13
+
14
+ # ABSTRACT
15
+
16
+ Recent self-supervised methods for image representation learning maximize the agreement between embedding vectors produced by encoders fed with different views of the same image. The main challenge is to prevent a collapse in which the encoders produce constant or non-informative vectors. We introduce VICReg (Variance-Invariance-Covariance Regularization), a method that explicitly avoids the collapse problem with two regularizations terms applied to both embeddings separately: (1) a term that maintains the variance of each embedding dimension above a threshold, (2) a term that decorrelates each pair of variables. Unlike most other approaches to the same problem, VICReg does not require techniques such as: weight sharing between the branches, batch normalization, feature-wise normalization, output quantization, stop gradient, memory banks, etc., and achieves results on par with the state of the art on several downstream tasks. In addition, we show that our variance regularization term stabilizes the training of other methods and leads to performance improvements.
17
+
18
+ # 1 INTRODUCTION
19
+
20
+ Self-supervised representation learning has made significant progress over the last years, almost reaching the performance of supervised baselines on many downstream tasks Bachman et al. (2019); Misra & Maaten (2020); He et al. (2020); Tian et al. (2020); Caron et al. (2020); Grill et al. (2020); Chen & He (2020); Gidaris et al. (2021); Zbontar et al. (2021). Several recent approaches rely on a joint embedding architecture in which two networks are trained to produce similar embeddings for different views of the same image. A popular instance is the Siamese network architecture Bromley et al. (1994), where the two networks share the same weights. The main challenge with joint embedding architectures is to prevent a collapse in which the two branches ignore the inputs and produce identical and constant output vectors. There are two main approaches to preventing collapse: contrastive methods and information maximization methods. Contrastive Bromley et al. (1994); Chopra et al. (2005); He et al. (2020); Hjelm et al. (2019); Chen et al. (2020a) methods tend to be costly, require large batch sizes or memory banks, and use a loss that explicitly pushes the embeddings of dissimilar images away from each other. They often require a mining procedure to search for offending dissimilar samples from a memory bank He et al. (2020) or from the current batch Chen et al. (2020a). Quantization-based approaches Caron et al. (2020; 2018) force the embeddings of different samples to belong to different clusters on the unit sphere. Collapse is prevented by ensuring that the assignment of samples to clusters is as uniform as possible. A similarity term encourages the cluster assignment score vectors from the two branches to be similar. More recently, a few methods have appeared that do not rely on contrastive samples or vector quantization, yet produce high-quality representations, for example BYOL Grill et al. (2020) and SimSiam Chen & He (2020). They exploit several tricks: batch-wise or feature-wise normalization, a "momentum encoder" in which the parameter vector of one branch is a low-pass-filtered version of the parameter vector of the other branch Grill et al. (2020); Richemond et al. (2020), or a stop-gradient operation in one of the branches Chen & He (2020). The dynamics of learning in these methods, and how they avoid collapse, is not fully understood, although theoretical and empirical studies point to the crucial importance of batch-wise or feature-wise normalization Richemond et al. (2020); Tian et al. (2021). Finally, an alternative class of collapse prevention methods relies on maximizing the information content of the embedding Zbontar et al. (2021); Ermolov et al. (2021). These methods prevent informational collapse by decorrelating every pair of variables of the embedding vectors. This indirectly maximizes the information content of the embedding vectors. The Barlow Twins method drives the normalized cross-correlation matrix of the two embeddings towards the identity Zbontar et al. (2021), while the Whitening-MSE method whitens and spreads out the embedding vectors on the unit sphere Ermolov et al. (2021).
21
+
22
+ ![](images/d4f9d6cc0559ac351e1484babc075a53232885607553d607ec201e1e75111fe2.jpg)
23
+ Figure 1: VICReg: joint embedding architecture with variance, invariance and covariance regularization. Given a batch of images $I$ , two batches of different views $X$ and $X ^ { \prime }$ are produced and are then encoded into representations $Y$ and $Y ^ { \prime }$ . The representations are fed to an expander producing the embeddings $Z$ and $Z ^ { \prime }$ . The distance between two embeddings from the same image is minimized, the variance of each embedding variable over a batch is maintained above a threshold, and the covariance between pairs of embedding variables over a batch are attracted to zero, decorrelating the variables from each other. Although the two branches do not require identical architectures nor share weights, in most of our experiments, they are Siamese with shared weights: the encoders are ResNet-50 backbones with output dimension 2048. The expanders have 3 fully-connected layers of size 8192.
24
+
25
+ # 2 VICREG: INTUITION
26
+
27
+ We introduce VICReg (Variance-Invariance-Covariance Regularization), a self-supervised method for training joint embedding architectures based on the principle of preserving the information content of the embeddings. The basic idea is to use a loss function with three terms:
28
+
29
+ • Invariance: the mean square distance between the embedding vectors.
30
+ • Variance: a hinge loss to maintain the standard deviation (over a batch) of each variable of the embedding above a given threshold. This term forces the embedding vectors of samples within a batch to be different.
31
+ • Covariance: a term that attracts the covariances (over a batch) between every pair of (centered) embedding variables towards zero. This term decorrelates the variables of each embedding and prevents an informational collapse in which the variables would vary together or be highly correlated.
32
+
33
+ Variance and Covariance terms are applied to both branches of the architecture separately, thereby preserving the information content of each embedding at a certain level and preventing informational collapse independently for the two branches. The main contribution of this paper is the Variance preservation term, which explicitly prevents a collapse due to a shrinkage of the embedding vectors towards zero. The Covariance criterion is borrowed from the Barlow Twins method and prevents informational collapse due to redundancy between the embedding variables Zbontar et al. (2021). VICReg is more generally applicable than most of the aforementioned methods because of fewer constraints on the architecture. In particular, VICReg:
34
+
35
+ • does not require that the weights of the two branches be shared, not that the architectures be identical, nor that the inputs be of the same nature;
36
+
37
+ • does not require a memory bank, nor contrastive samples, nor a large batch size; • does not require batch-wise nor feature-wise normalization; and • does not require vector quantization nor a predictor module.
38
+
39
+ Other methods require asymmetric stop gradient operations, as in SimSiam Chen & He (2020), weight sharing between the two branches as in classical Siamese nets, or weight sharing through exponential moving average dampening with stop gradient in one branch, as in BYOL and MoCo He et al. (2020); Grill et al. (2020); Chen et al. (2020c), large batches of contrastive samples, as in SimCLR Chen et al. (2020a), or batch-wise and/or feature-wise normalization Caron et al. (2020); Grill et al. (2020); Chen & He (2020); Zbontar et al. (2021); Ermolov et al. (2021). One of the most interesting feature of VICReg is the fact that the two branches are not required to share the same parameters, architecture, or input modality. This opens the door to the use of non-contrastive self-supervised joint-embedding for multi-modal signals, such as video and audio. We demonstrate the effectiveness of the proposed approach by evaluating the representations learned with VICReg on several downstream image recognition tasks including linear head and semi-supervised evaluation protocols for image classification on ImageNet Deng et al. (2009), and other classification, detection, instance segmentation, and retrieval tasks. Furthermore, we show that incorporating variance preservation into other self-supervised joint-embedding methods yields better training stability and performance improvement on downstream tasks. More generally, we show that VICReg is an explicit and effective, yet simple method for preventing collapse in self-supervised joint-embedding learning.
40
+
41
+ # 3 RELATED WORK
42
+
43
+ Contrastive learning. In contrastive SSL methods applied to joint embedding architectures, the output embeddings for a sample and its distorted version are brought close to each other, while other samples and their distortions are pushed away. The method is most often applied to Siamese architectures in which the two branches have identical architectures and share weights Misra & Maaten (2020); He et al. (2020); Bromley et al. (1994); Hjelm et al. (2019); Chen et al. (2020a;c); Hadsell et al. (2006); Ye et al. (2019); Wu et al. (2018); van den Oord et al. (2018); Chen et al. (2020b). Many authors use the InfoNCE loss van den Oord et al. (2018) in which the repulsive force is larger for contrastive samples that are closer to the reference. While these methods yield good performance, they require large amounts of contrastive pairs in order to work well. These contrastive pairs can be sampled from a memory bank as in MoCo He et al. (2020), or given by the current batch of data as in SimCLR Chen et al. (2020a), with a significant memory footprint. This downside of contrastive methods motivates a search for alternatives.
44
+
45
+ Clustering methods. Instead of viewing each sample as its own class, clustering-based methods group them into clusters based on some similarity measure Caron et al. (2020; 2018); Bautista et al. (2016); Yang et al. (2016); Xie et al. (2016); Huang et al. (2019); Zhuang et al. (2019); Caron et al. (2019); Asano et al. (2020); Yan et al. (2020). DeepCluster Caron et al. (2018) uses $k$ -means assignments of representations from previous iterations as pseudo-labels for the new representations, which requires an expensive clustering phase done asynchronously, and makes the method hard to scale up. SwAV Caron et al. (2020) mitigates this issue by learning the clusters online while maintaining a balanced partition of the assignments through the Sinkhorn-Knopp transform Cuturi (2013). These clustering approaches can be viewed as contrastive learning at the level of clusters which still requires a lot of negative comparisons to work well.
46
+
47
+ Distillation methods. Recent proposals such as BYOL, SimSiam, OBoW and variants Grill et al. (2020); Chen & He (2020); Gidaris et al. (2021); Richemond et al. (2020); Gidaris et al. (2020) have shown that collapse can be avoided by using architectural tricks inspired by knowledge distillation Hinton et al. (2015). These methods train a student network to predict the representations of a teacher network, for which the weights are a running average of the student network’s weights Grill et al. (2020), or are shared with the student network, but no gradient is back-propagated through the teacher Chen & He (2020). These methods are effective, but there is no clear understanding of why and how they avoid collapse. Alternatively, the images can be represented as bags of word over a dictionary of visual features, which effectively prevents collapse. In OBoW Gidaris et al. (2020) and Gidaris et al. (2021) the dictionary is obtained by off-line or on-line clustering. By contrast, our method explicitly prevents collapse in the two branches independently, which removes the requirement for shared weights and identical architecture, opening the door to the application of joint-embedding SSL to multi-modal signals.
48
+
49
+ Information maximization methods. A principle to prevent collapse is to maximize the information content of the embeddings. Two such methods were recently proposed: W-MSE Ermolov et al. (2021) and Barlow Twins Zbontar et al. (2021). In W-MSE, an extra module transforms the embeddings into the eigenspace of their covariance matrix (whitening or Karhunen-Loève transform), and forces the vectors thereby obtained to be uniformly distributed on the unit sphere. In Barlow Twins, a loss term attempts to make the normalized cross-correlation matrix of the embedding vectors from the two branches to be close to the identity. Both methods attempt to produce embedding variables that are decorrelated from each other, thus preventing an informational collapse in which the variables carry redundant information. Because all variables are normalized over a batch, there is no incentive for them to shrink nor expand. This seems to sufficient to prevent collapse. Our method borrows the decorrelation mechanism of Barlow Twins. But it includes an explicit variance-preservation term for each variable of the two embeddings and thus does not require any normalization.
50
+
51
+ # 4 VICREG: DETAILED DESCRIPTION
52
+
53
+ VICReg follows recent trends in self-supervised learning Caron et al. (2020); Grill et al. (2020); Chen & He (2020); Zbontar et al. (2021); Chen et al. (2020a) and is based on a joint embedding architecture. Contrary to many previous approaches, our architecture may be completely symmetric or completely asymmetric with no shared structure or parameters between the two branches. In most of our experiments, we use a Siamese net architecture in which the two branches are identical and share weights. Each branch consists of an encoder $f _ { \theta }$ that outputs the representations (used for downstream tasks), followed by an expander $h _ { \phi }$ that maps the representations into an embedding space where the loss function will be computed. The role of the expander is twofold: (1) eliminate the information by which the two representations differ, (2) expand the dimension in a non-linear fashion so that decorrelating the embedding variables will reduce the dependencies (not just the correlations) between the variables of the representation vector. The loss function uses a term $s$ that learns invariance to data transformations and is regularized with a variance term $v$ that prevents norm collapse and a covariance term $c$ that prevents informational collapse by decorrelating the different dimensions of the vectors. After pretraining, the expander is discarded and the representations of the encoder are used for downstream tasks.
54
+
55
+ # 4.1 METHOD
56
+
57
+ Given an image $i$ sampled from a dataset $\mathcal { D }$ , two transformations $t$ and $t ^ { \prime }$ are sampled from a distribution $\tau$ to produce two different views $x = t ( i )$ and $x ^ { \prime } = t ^ { \prime } ( i )$ of $i$ . These transformations are random crops of the image, followed by color distortions. The distribution $\tau$ is described in Appendix C. The views $x$ and $x ^ { \prime }$ are first encoded by $f _ { \theta }$ into their representations $y = f _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ and $\bar { y ^ { \prime } } \overset { - } { = } f _ { \theta } ( x ^ { \prime } )$ , which are then mapped by the expander $h _ { \phi }$ onto the embeddings $z = h _ { \phi } ( y )$ and $z ^ { \prime } = h _ { \phi } ( y ^ { \prime } )$ . The loss is computed at the embedding level on $z$ and $z ^ { \prime }$ .
58
+
59
+ We describe here the variance, invariance and covariance terms that compose our loss function. The images are processed in batches, and we denote $Z = [ z _ { 1 } , \dots , z _ { n } ]$ and $Z ^ { \prime } = [ z _ { 1 } ^ { \prime } , \dots , z _ { n } ^ { \prime } ]$ the two batches composed of $n$ vectors of dimension $d$ , of embeddings coming out of the two branches of the siamese architecture. We denote by $z ^ { j }$ the vector composed of each value at dimension $j$ in all vectors in $Z$ . We define the variance regularization term $v$ as a hinge function on the standard deviation of the embeddings along the batch dimension:
60
+
61
+ $$
62
+ v ( Z ) = \frac { 1 } { d } \sum _ { j = 1 } ^ { d } \operatorname* { m a x } ( 0 , \gamma - S ( z ^ { j } , \epsilon ) ) ,
63
+ $$
64
+
65
+ where $S$ is the regularized standard deviation defined by:
66
+
67
+ $$
68
+ S ( x , \epsilon ) = \sqrt { \mathrm { V a r } ( x ) + \epsilon } ,
69
+ $$
70
+
71
+ $\gamma$ is a constant target value for the standard deviation, fixed to 1 in our experiments, $\epsilon$ is a small scalar preventing numerical instabilities. This criterion encourages the variance inside the current batch to be equal to $\gamma$ along each dimension, preventing collapse with all the inputs mapped on the same vector. Using the standard deviation and not directly the variance is crucial. Indeed, if we take $S ( x ) = \mathrm { V a r } ( x )$ in the hinge function, the gradient of $S$ with respect to $x$ becomes close to 0 when $x$ is close to $\bar { x }$ . In this case, the gradient of $v$ also becomes close to 0 and the embeddings collapse. We define the covariance matrix of $Z$ as:
72
+
73
+ $$
74
+ C ( Z ) = \frac { 1 } { n - 1 } \sum _ { i = 1 } ^ { n } ( z _ { i } - \bar { z } ) ( z _ { i } - \bar { z } ) ^ { T } , \mathrm { w h e r e } \bar { z } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } z _ { i } .
75
+ $$
76
+
77
+ Inspired by Barlow Twins Zbontar et al. (2021), we can then define the covariance regularization term $c$ as the sum of the squared off-diagonal coefficients of $C ( Z )$ , with a factor $1 / d$ that scales the criterion as a function of the dimension:
78
+
79
+ $$
80
+ c ( Z ) = \frac { 1 } { d } \sum _ { i \neq j } [ C ( Z ) ] _ { i , j } ^ { 2 } .
81
+ $$
82
+
83
+ This term encourages the off-diagonal coefficients of $C ( Z )$ to be close to 0, decorrelating the different dimensions of the embeddings and preventing them from encoding similar information. Decorrelation at the embedding level ultimately has a decorrelation effect at the representation level, which is a non trivial phenomenon that we study in Appendix D. We finally define the invariance criterion $s$ between $Z$ and $Z ^ { \prime }$ as the mean-squared euclidean distance between each pair of vectors, without any normalization:
84
+
85
+ $$
86
+ s ( Z , Z ^ { \prime } ) = \frac { 1 } { n } \sum _ { i } \| z _ { i } - z _ { i } ^ { \prime } \| _ { 2 } ^ { 2 } .
87
+ $$
88
+
89
+ The overall loss function is a weighted average of the invariance, variance and covariance terms:
90
+
91
+ $$
92
+ \ell ( Z , Z ^ { \prime } ) = \lambda s ( Z , Z ^ { \prime } ) + \mu [ v ( Z ) + v ( Z ^ { \prime } ) ] + \nu [ c ( Z ) + c ( Z ^ { \prime } ) ] ,
93
+ $$
94
+
95
+ where $\lambda , \mu$ and $\nu$ are hyper-parameters controlling the importance of each term in the loss. In our experiments, we set $\nu = 1$ and perform a grid search on the values of $\lambda$ and $\mu$ with the base condition $\lambda = \mu > 1$ . The overall objective function taken on all images over an unlabelled dataset $\mathcal { D }$ is given by:
96
+
97
+ $$
98
+ \mathcal { L } = \sum _ { I \in \mathcal { D } } \sum _ { t , t ^ { \prime } \sim \mathcal { T } } \ell ( Z ^ { I } , Z ^ { \prime I } ) ,
99
+ $$
100
+
101
+ where $Z ^ { I }$ and $Z ^ { \prime I }$ are the batches of embeddings corresponding to the batch of images $I$ transformed by $t$ and $t ^ { \prime }$ . The objective is minimized for several epochs, over the encoder parameters $\theta$ and expander parameters $\phi$ . We illustrate the architecture and loss function of VICReg in Figure 1.
102
+
103
+ # 4.2 IMPLEMENTATION DETAILS
104
+
105
+ Implementation details for pretraining with VICReg on the 1000-classes ImagetNet dataset without labels are as follows. Coefficients $\lambda$ and $\mu$ are 25 and $\nu$ is 1 in Eq. (6), and $\epsilon$ is 0.0001 in Eq. (1). We give more details on how we choose the coefficients of the loss function in Appendix D.4. The encoder network $f _ { \theta }$ is a standard ResNet-50 backbone He et al. (2016) with 2048 output units. The expander $h _ { \phi }$ is composed of two fully-connected layers with batch normalization (BN) Ioffe & Szegedy (2015) and ReLU, and a third linear layer. The sizes of all 3 layers were set to 8192. As with Barlow Twins, performance improves when the size of the expander layers is larger than the dimension of the representation. The impact of the expander dimension on performance is studied in Appendix D. The training protocol follows those of BYOL and Barlow Twins: LARS optimizer You et al. (2017); Goyal et al. (2017) run for 1000 epochs with a weight decay of $1 0 ^ { - 6 }$ and a learning rate $l r = b a t c h \_ s i z e / 2 5 6 \times b a s e \_ l r$ , where batch_size is set to 2048 by default and base_ $_ { . } l r$ is a base learning rate set to 0.2. The learning rate follows a cosine decay schedule Loshchilov & Hutter (2017), starting from 0 with 10 warmup epochs and with final value of 0.002.
106
+
107
+ # 5 RESULTS
108
+
109
+ In this section, we evaluate the representations obtained after self-supervised pretraining of a ResNet$5 0 \mathrm { H e }$ et al. (2016) backbone with VICReg during 1000 epochs, on the training set of ImageNet, using the training protocol described in section 4. We also pretrain on pairs of image and text data and evaluate on retrieval tasks on the MS-COCO dataset.
110
+
111
+ Table 1: Evaluation on ImageNet. Evaluation of the representations obtained with a ResNet-50 backbone pretrained with VICReg on: (1) linear classification on top of the frozen representations from ImageNet; (2) semi-supervised classification on top of the fine-tuned representations from $1 \%$ and $10 \%$ of ImageNet samples. We report Top-1 and Top-5 accuracies (in $\%$ ). Top-3 best self-supervised methods are underlined.
112
+
113
+ <table><tr><td rowspan="3">Method</td><td colspan="2">Linear</td><td colspan="4">Semi-supervised</td></tr><tr><td rowspan="2">Top-1</td><td rowspan="2">Top-5</td><td colspan="2">Top-1</td><td colspan="2">Top-5</td></tr><tr><td>1%</td><td>10%</td><td>1%</td><td>10%</td></tr><tr><td>Supervised</td><td>76.5</td><td></td><td>25.4</td><td>56.4</td><td>48.4</td><td>80.4</td></tr><tr><td>MoCo He et al. (2020)</td><td>60.6</td><td></td><td>=</td><td>1</td><td>1</td><td>-</td></tr><tr><td>PIRL Misra &amp; Maaten (2020)</td><td>63.6</td><td>=</td><td></td><td>1</td><td>57.2</td><td>83.8</td></tr><tr><td>CPC v2 Hénaff et al. (2019)</td><td>63.8</td><td>=</td><td></td><td>=</td><td>-</td><td>1</td></tr><tr><td>CMC Tian et al. (2019)</td><td>66.2</td><td>=</td><td>=</td><td>=</td><td>=</td><td>=</td></tr><tr><td>SimCLR Chen et al. (2020a)</td><td>69.3</td><td>89.0</td><td>48.3</td><td>65.6</td><td>75.5</td><td>87.8</td></tr><tr><td>MoCo v2 Chen et al. (2020c)</td><td>71.1</td><td>1</td><td>-</td><td>1</td><td>1</td><td></td></tr><tr><td>SimSiam Chen&amp;He (2020)</td><td>71.3</td><td>1</td><td></td><td>=</td><td>=</td><td>=</td></tr><tr><td>SwAV Caron et al. (2020)</td><td>71.8</td><td>-</td><td></td><td></td><td></td><td></td></tr><tr><td>InfoMin Aug Tian et al. (2020)</td><td>73.0</td><td>91.1</td><td></td><td></td><td>=</td><td></td></tr><tr><td>OBoW Gidaris et al. (2021)</td><td>73.8</td><td>1</td><td></td><td>=</td><td>82.9</td><td>90.7</td></tr><tr><td>BYOL Grill et al. (2020)</td><td>74.3</td><td>91.6</td><td>53.2</td><td>68.8</td><td>78.4</td><td>89.0</td></tr><tr><td>SwAV (w/ multi-crop) Caron et al. (2020)</td><td>75.3</td><td>=</td><td>53.9</td><td>70.2</td><td>78.5</td><td>89.9</td></tr><tr><td>Barlow Twins Zbontar et al. (2021)</td><td>73.2</td><td>91.0</td><td>55.0</td><td>69.7</td><td>79.2</td><td>89.3</td></tr><tr><td>VICReg (ours)</td><td>73.2</td><td>91.1</td><td>54.8</td><td>69.5</td><td>79.4</td><td>89.5</td></tr></table>
114
+
115
+ # 5.1 EVALUATION ON IMAGENET
116
+
117
+ Following the ImageNet Deng et al. (2009) linear evaluation protocol, we train a linear classifier on top of the frozen representations of the ResNet-50 backbone pretrained with VICReg. We also evaluate the performance of the backbone when fine-tuned with a linear classifier on a subset of ImageNet’s training set using $1 \%$ or $10 \%$ of the labels, using the split of Chen et al. (2020a). We give implementation details about the optimization procedure for these tasks in Appendix C. We have applied the training procedure described in section 4 with three different random initialization. The numbers reported in Table 1 for VICReg are the mean scores, and we have observed that the difference between worse and best run is lower than $0 . 1 \%$ accuracy for linear classification, which shows that VICReg is a very stable algorithm. Lack of time has prevented us from doing the same for the semi-supervised classification experiments, and the experiments of section 5.2 and 6, but we expect similar conclusion to hold. We compare in Table 1 our results on both tasks against other methods on the validation set of ImageNet. The performance of VICReg is on par with the state of the art without using the negative pairs of SimCLR, the clusters of SwAV, the bag-of-words representations of OBoW, or any asymmetric networks architectural tricks such as the momentum encoder of BYOL and the stop-gradient operation of SimSiam. The performance is comparable to that of Barlow Twins, which shows that VICReg’s more explicit way of constraining the variance and comparing views has the same power than maximizing cross-correlations between pairs of twin dimensions. The main advantage of VICReg is the modularity of its objective function and the applicability to multi-modal setups.
118
+
119
+ # 5.2 TRANSFER TO OTHER DOWNSTREAM TASKS
120
+
121
+ Following the setup from Misra & Maaten (2020), we train a linear classifier on top of the frozen representations learnt by our pretrained ResNet-50 backbone on a variety of different datasets: the Places205 Zhou et al. (2014) scene classification dataset, the VOC07 Everingham et al. (2010) multi-label image classification dataset and the iNaturalist2018 Horn et al. (2018) fine-grained image classification dataset. We then evaluate the quality of the representations by transferring to other vision tasks including $\mathrm { \ V O C { 0 7 + 1 2 } }$ Everingham et al. (2010) object detection using Faster R-CNN Ren et al. (2015) with a R50-C4 backbone, and COCO Lin et al. (2014) instance segmentation using Mask-R-CNN He et al. (2017) with a R50-FPN backbone. We report the performance in Table 2,
122
+
123
+ Table 2: Transfer learning on downstream tasks. Evaluation of the representations from a ResNet50 backbone pretrained with VICReg on: (1) linear classification tasks on top of frozen representations, we report Top-1 accuracy (in $\%$ ) for Places205 Zhou et al. (2014) and iNat18 Horn et al. (2018), and mAP for VOC07 Everingham et al. (2010); (2) object detection with fine-tunning, we report $\mathrm { { A P } _ { 5 0 } }$ for $\mathrm { \ V O C { 0 7 + 1 2 } }$ using Faster R-CNN with C4 backbone Ren et al. (2015); (3) object detection and instance segmentation, we report AP for COCO Lin et al. (2014) using Mask R-CNN with FPN backbone He et al. (2017). We use $\dagger$ to denote the experiments run by us. Top-3 best self-supervised methods are underlined.
124
+
125
+ <table><tr><td></td><td colspan="3">Linear Classification</td><td colspan="3">Object Detection</td></tr><tr><td>Method</td><td>Places205</td><td>VOC07 iNat18</td><td></td><td>VOC07+12(</td><td> COCO det COCO seg</td><td></td></tr><tr><td>Supervised</td><td>53.2</td><td>87.5</td><td>46.7</td><td>81.3</td><td>39.0</td><td>35.4</td></tr><tr><td>MoCo He et al. (2020)</td><td>46.9</td><td>79.8</td><td>31.5</td><td>=</td><td></td><td></td></tr><tr><td>PIRL Misra &amp; Maaten (2020)</td><td>49.8</td><td>81.1</td><td>34.1</td><td>=</td><td>1</td><td>=</td></tr><tr><td>SimCLR Chen et al. (2020a)</td><td>52.5</td><td>85.5</td><td>37.2</td><td>1</td><td>-</td><td>1</td></tr><tr><td>MoCo v2 Chen et al. (2020c)</td><td>51.8</td><td>86.4</td><td>38.6</td><td>82.5</td><td>39.8</td><td>36.1</td></tr><tr><td>SimSiam Chen &amp; He (2020)</td><td>1</td><td>1</td><td>1</td><td>82.4</td><td>-</td><td>-</td></tr><tr><td>BYOL Grill et al. (2020)</td><td>54.0</td><td>86.6</td><td>47.6</td><td>=</td><td>40.4†</td><td>37.0t</td></tr><tr><td>SwAV (m-c) Caron et al. (2020)</td><td>56.7</td><td>88.9</td><td>48.6</td><td>82.6</td><td>41.6</td><td>37.8</td></tr><tr><td>OBoW Gidaris et al. (2021)</td><td>56.8</td><td>89.3</td><td>1</td><td>82.9</td><td>1</td><td>=</td></tr><tr><td>Barlow Twins Grill et al. (2020)</td><td>54.1</td><td>86.2</td><td>46.5</td><td>82.6</td><td>40.0t</td><td>36.7†</td></tr><tr><td>VICReg (ours)</td><td>54.3</td><td>86.6</td><td>47.0</td><td>82.4</td><td>39.4</td><td>36.4</td></tr></table>
126
+
127
+ Table 3: Evaluation on MS-COCO 5K retrieval tasks. Comparison of VICReg with the contrastive loss of ${ \mathrm { V S E } } { + } { + }$ Faghri et al. (2018), and with Barlow Twins, pretrain on the training set of MS-COCO. In all settings, the encoder for text is a word embedding followed by a GRU layer, the encoder for images is a ResNet-152.
128
+
129
+ <table><tr><td>Method</td><td colspan="3">Image-to-text</td><td colspan="3">Text-to-Image</td></tr><tr><td></td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td>Contrastive (VSE++)</td><td>30.3</td><td>59.4</td><td>72.4</td><td>41.3</td><td>71.1</td><td>81.2</td></tr><tr><td>Barlow Twins</td><td>31.4</td><td>60,4</td><td>75.1</td><td>42.9</td><td>74.0</td><td>83.5</td></tr><tr><td>VICReg</td><td>33.6</td><td>62.7</td><td>77.9</td><td>45.2</td><td>76.1</td><td>84.2</td></tr></table>
130
+
131
+ VICReg performs on par with most concurrent methods, and better than Barlow Twins, across all classification tasks, but is slightly behind the top-3 on detection tasks.
132
+
133
+ # 5.3 MULTI-MODAL PRETRAINING ON MS-COCO
134
+
135
+ One fundamental difference of VICReg compared to Barlow Twins is the way the branches are regularized. In VICReg, both branches are regularized independently, as the covariance term is applied on each branch separately, which works better in the scenarios where the branches are completely different, have different types of architecture and process different types of data. Indeed, the statistics of the output of the two branches can be very different, and the amount of regularization required for each may vary a lot. In Barlow Twins, the regularization is applied on the cross-correlation matrix, which favors the scenarios where the branches produce outputs with similar statistics. We demonstrate the capabilities of VICReg in a multi-modal experiment where we pretrain on pairs of images and corresponding captions on the MS-COCO dataset. We regularize each branch with a different coefficient, which is not possible with Barlow Twins, and we show that VICReg outperforms Barlow Twins on image and text retrieval downstream tasks. Table 3 reports the performance of VICReg against the contrastive loss proposed by ${ \mathrm { V S E } } { + } { + }$ Faghri et al. (2018), and against Barlow Twins, in the identical setting proposed in Faghri et al. (2018). VICReg outperforms the two by a significant margin.
136
+
137
+ Table 4: Effect of incorporating variance and covariance regularization in different methods. Top-1 ImageNet accuracy with the linear evaluation protocol after 100 pretraining epochs. For all methods, pretraining follows the architecture, the optimization and the data augmentation protocol of the original method using our reimplementation. ME: Momentum Encoder. SG: stop-gradient. PR: predictor. BN: Batch normalization layers after input and inner linear layers in the expander. No Reg: No additional regularization. Var Reg: Variance regularization. Var/Cov Reg: Variance and Covariance regularization. Unmodified original setups are marked by a $\dagger$ .
138
+
139
+ <table><tr><td>Method</td><td>ME</td><td>SG</td><td>PR</td><td>BN</td><td>No Reg</td><td>Var Reg</td><td>Var/Cov Reg</td></tr><tr><td>BYOL</td><td>√</td><td>√</td><td>√</td><td>√</td><td>69.3†</td><td>70.2</td><td>69.5</td></tr><tr><td>SimSiam</td><td></td><td></td><td></td><td>√</td><td>67.9†</td><td>68.1</td><td>67.6</td></tr><tr><td>SimSiam</td><td></td><td></td><td>1</td><td></td><td>35.1</td><td>67.3</td><td>67.1</td></tr><tr><td>SimSiam</td><td></td><td>&lt;&lt;&gt;</td><td></td><td></td><td>collapse</td><td>56.8</td><td>66.1</td></tr><tr><td>VICReg</td><td></td><td></td><td></td><td></td><td>collapse</td><td>56.2</td><td>67.3</td></tr><tr><td>VICReg</td><td></td><td></td><td>?</td><td></td><td>collapse</td><td>57.1</td><td>68.7</td></tr><tr><td>VICReg</td><td></td><td></td><td></td><td>V</td><td>collapse</td><td>57.5</td><td>68.6†</td></tr><tr><td>VICReg</td><td></td><td></td><td></td><td></td><td>collapse</td><td>56.5</td><td>67.4</td></tr></table>
140
+
141
+ # 6 ANALYSIS
142
+
143
+ In this section we study how the different components of our method contribute to its performance, as well as how they interact with components from other self-supervised methods. We also evaluate different scenarios where the branches have different weights and architecture. All reported results are obtained on the linear evaluation protocol, using a ResNet-50 backbone if not mentioned otherwise, and 100 epochs of pretraining, which gives results consistent with those obtained with 1000 epochs of pretraining. The optimization setting used for each experiment is described in Appendix C.
144
+
145
+ Asymmetric networks. We study the impact of different components used in asymmetric architectures and the effects of adding variance and covariance regularization, in terms of performance and training stability. Starting from a simple symmetric architecture with an encoder and an expander without batch normalization, which correspond to VICReg without batch normalization in the expander, we progressively add batch normalization in the inner layers of the expander, a predictor, a stop-gradient operation and a momentum encoder. We use the training protocol and architecture of SimSiam Chen & He (2020) when a stop-gradient is used and the training protocol and architecture of BYOL Grill et al. (2020) when a momentum encoder is used. The predictor as used in SimSiam and BYOL is a learnable module $g _ { \psi }$ that predicts the embedding of a view given the embedding of the other view of the same image. If $z$ and $z ^ { \prime }$ are the embeddings of two views of an image, then $p = g _ { \psi } ( z )$ and $p ^ { \prime } = g _ { \psi } ( z ^ { \prime } )$ are the predictions of each view. The invariance loss function of Eq. (5) is now computed between a batch of embeddings $Z = [ z _ { 1 } , \ldots , z _ { n } ]$ and the corresponding batch of predictions $P = [ p _ { 1 } ^ { \prime } , \ldots , p _ { n } ^ { \prime } ]$ , then symmetrized:
146
+
147
+ $$
148
+ s ( Z , Z ^ { \prime } , P , P ^ { \prime } ) = \frac { 1 } { 2 n } \sum _ { i } D ( z _ { i } - p _ { i } ^ { \prime } ) + \frac { 1 } { 2 n } \sum _ { i } D ( z _ { i } ^ { \prime } - p _ { i } ) ,
149
+ $$
150
+
151
+ where $D$ is a distance function that depends on the method used. BYOL uses the mean square error between $l _ { 2 }$ -normalized vectors, SimSiam uses the negative cosine similarity loss and VICReg uses the mean square error without $l _ { 2 }$ -normalization. The variance and covariance terms are regularizing the output $Z$ and $Z ^ { \prime }$ of the expander, which we empirically found to work better than regularizing the output of the predictor. We compare different settings in Table 4, based on the default data augmentation, optimization and architecture settings of the original BYOL, SimSiam and VICReg methods. In all settings, the absence of BN indicates that BN is also removed in the predictor when one is used.
152
+
153
+ We analyse first the impact of variance regularization (VR) in the different settings. When using VR, adding a predictor (PR) to VICReg does not lead to a significant change of the performance, which indicates that PR is redundant with VR. In comparison, without VR, the representations collapse, and both stop-gradient (SG) and PR are necessary. Batch normalization in the inner layers of the expander (BN) in VICReg leads to a $1 . 0 \%$ increase in the performance, which is not a big improvement considering that SG and PR without BN is performing very poorly at $3 5 . 1 \%$ .
154
+
155
+ Table 5: Impact of sharing weights or not between branches. Top-1 accuracy on linear classification with 100 pretraining epochs. The encoder and expander of both branches can share the same architecture and share their weights (SW), share the same architecture with different weights (DW), or have different architectures (DA). The encoders can be ResNet-50, ResNet-101 or ViT-S.
156
+
157
+ <table><tr><td></td><td>SW R50</td><td>DW R50</td><td>DA R50/R101</td><td>DA R50/ViT-S</td></tr><tr><td>BYOL</td><td>69.3</td><td>X</td><td>X</td><td>X</td></tr><tr><td>SimCLR</td><td>64.4</td><td>63.1</td><td>63.9</td><td>63.5</td></tr><tr><td>Barlow Twins</td><td>68.7</td><td>64.2</td><td>65.3</td><td>63.9</td></tr><tr><td>VICReg</td><td>68.6</td><td>66.5</td><td>68.1</td><td>66.2</td></tr></table>
158
+
159
+ Finally, incorporating VR with SG or ME further improves the performance by small margins of respectively $0 . 2 \%$ and $0 . 9 \%$ , which might be explained by the fact that these architectural tricks that prevent collapse are not perfectly maintaining the variance of the representations, i.e. very slow collapse is happening with these methods. We explain this intuition by studying the evolution of the standard deviation of the representations during pretraining for BYOL and SimSiam in Appendix D. We then analyse the impact of adding additional covariance regularization (CR) in the different settings, along with variance regularization. We found that optimization with SG and CR is hard, even if our analysis of the average correlation coefficient of the representations during pretraining in Appendix D shows that both fulfill the same objective.
160
+
161
+ The performance of BYOL and SimSiam slightly drops compared to VR only, except when PR is removed, where SG becomes useless. BN is still useful and improves the performance by $1 . 3 \%$ . Finally with CR, PR does not harm the performance and even improves it by a very small margin. VICReg+PR with 1000 epochs of pretraining exactly matches the score of VICReg $7 3 . 2 \%$ on linear classification).
162
+
163
+ Weight sharing. Contrary to most self-supervised learning approaches based on Siamese architectures, VICReg has several unique properties: (1) weights do not need to be shared between the branches, each branch’s weights are updated independently of the other branch’s weights; (2) the branches are regularized independently, the variance and covariance terms are computed on each branch individually; (3) no predictor is necessary unlike with methods where one branch predicts outputs of the other branch. We compare the robustness of VICReg against other methods in different scenarios where the weights of the branches can be shared (SW), not shared (DW), and where the encoders can have different architectures (DA). Among other self-supervised methods, SimCLR and Barlow Twins are the only ones that can handle these scenarios. The asymmetric methods that are based on a discrepancy between the branches requires either the architecture or the weights to be shared between the branches. The performance drops by $2 . 1 \%$ with VICReg and $4 . 5 \%$ with Barlow Twins, between the shared weights scenario (SW) and the different weight scenario (DW). The difference between VICReg and Barlow Twins is also significant in scenarios with different architectures, in particular VICReg performs better than Barlow Twins by $2 . 8 \%$ with ResNet-50/ResNet-101 and better by $2 . 3 \%$ with ResNet-50/ViT-S Dosovitskiy et al. (2021). This shows that VICReg is more robust than Barlow Twins in these kind of scenarios. The performance of SimCLR remains stable across scenarios, but is significantly worse than the performance of VICReg. Importantly, the ability of VICReg to function with different parameters, architectures, and input modalities for the branches widens the applicability to joint-embedding SSL to many applications, including multi-modal signals.
164
+
165
+ # 7 CONCLUSION
166
+
167
+ We introduced VICReg, a simple approach to self-supervised learning based on a triple objective: learning invariance to different views with a invariance term, avoiding collapse of the representations with a variance preservation term, and maximizing the information content of the representation with a covariance regularization term. VICReg achieves results on par with the state of the art on many downstream tasks, but is not subject to the same limitations as most other methods, particularly because it does not require the embedding branches to be identical or even similar.
168
+
169
+ Acknowledgement. Jean Ponce was supported in part by the French government under management of Agence Nationale de la Recherche as part of the ”Investissements d’avenir” program, reference ANR-19-P3IA-0001 (PRAIRIE 3IA Institute), the Louis Vuitton/ENS Chair in Artificial Intelligence and the Inria/NYU collaboration. Adrien Bardes was supported in part by a FAIR/Prairie CIFRE PhD Fellowship. The authors wish to thank Jure Zbontar for the BYOL implementation, Stéphane Deny for useful comments on the paper, and Li Jing, Yubei Chen, Mikael Henaff, Pascal Vincent and Geoffrey Zweig for useful discussions. We thank Quentin Duval and the VISSL team for help obtaining the results of table 2.
170
+
171
+ # REFERENCES
172
+
173
+ Yuki Markus Asano, Christian Rupprecht, and Andrea Vedaldi. Self-labelling via simultaneous clustering and representation learning. In ICLR, 2020. 3
174
+
175
+ Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. In NeurIPS, 2019. 1
176
+
177
+ Miguel A. Bautista, Artsiom Sanakoyeu, Ekaterina Sutter, and Björn Ommer. Cliquecnn: Deep unsupervised exemplar learning. In NeurIPS, 2016. 3
178
+
179
+ Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Sackinger, and Roopak Shah. Signature verification using a “siamese” time delay neural network. In NeurIPS, 1994. 1, 3
180
+
181
+ Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning. In ECCV, 2018. 1, 3
182
+
183
+ Mathilde Caron, Piotr Bojanowski, Julien Mairal, and Armand Joulin. Unsupervised pre-training of image features on non-curated data. In ICCV, 2019. 3
184
+
185
+ Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020. 1, 3, 4, 6, 7, 14, 16, 17, 18, 20
186
+
187
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020a. 1, 3, 4, 6, 7, 14, 16, 17, 20, 21
188
+
189
+ Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big self-supervised models are strong semi-supervised learners. In NeurIPS, 2020b. 3
190
+
191
+ Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In CVPR, 2020. 1, 3, 4, 6, 7, 8, 14, 16, 17, 21
192
+
193
+ Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020c. 3, 6, 7
194
+
195
+ Sumit Chopra, Raia Hadsell, and Yann LeCun. Learning a similarity metric discriminatively, with application to face verification. In CVPR, 2005. 1
196
+
197
+ Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In NeurIPS, 2013. 3
198
+
199
+ 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. 3, 6
200
+
201
+ Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. 9
202
+
203
+ Aleksandr Ermolov, Aliaksandr Siarohin, Enver Sangineto, and Nicu Sebe. Whitening for selfsupervised representation learning, 2021. 2, 3, 4, 14
204
+
205
+ Mark Everingham, Luc Van Gool, John Winn Christopher K. I. Williams, and Andrew Zisserman. The pascal visual object classes (voc) challenge. IJCV, 2010. 6, 7, 16
206
+
207
+ Fartash Faghri, David J. Fleet, Jamie Ryan Kiros, and Sanja Fidler. ${ \mathrm { V s e } } + +$ : Improving visual-semantic embeddings with hard negatives. In BMVC, 2018. 7
208
+
209
+ Rong-En Fan, Kai-Wei Chang, Cho-Jui Hsieh, Xiang-Rui Wang, and Chih-Jen Lin. Liblinear: A library for large linear classification. JMLR, 2008. 16
210
+
211
+ Spyros Gidaris, Andrei Bursuc, Nikos Komodakis, Patrick Pérez, and Matthieu Cord. Learning representations by predicting bags of visual words. In CVPR, 2020. 3
212
+
213
+ Spyros Gidaris, Andrei Bursuc, Gilles Puy, Nikos Komodakis, Matthieu Cord, and Patrick Pérez. Online bag-of-visual-words generation for unsupervised representation learning. In CVPR, 2021. 1, 3, 6, 7, 14
214
+
215
+ Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. 5
216
+
217
+ Priya Goyal, Quentin Duval, Jeremy Reizenstein, Matthew Leavitt, Min Xu, Benjamin Lefaudeux, Mannat Singh, Vinicius Reis, Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Ishan Misra. Vissl. https://github.com/facebookresearch/vissl, 2021. 16
218
+
219
+ Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent: A new approach to self-supervised learning. In NeurIPS, 2020. 1, 3, 4, 6, 7, 8, 14, 16, 17, 20, 21
220
+
221
+ Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In CVPR, 2006. 3
222
+
223
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 5
224
+
225
+ Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In ICCV, 2017. 6, 7
226
+
227
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. 1, 3, 6, 7, 16
228
+
229
+ Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015. 3
230
+
231
+ R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In ICLR, 2019. 1, 3
232
+
233
+ Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In CVPR, 2018. 6, 7, 16
234
+
235
+ Jiabo Huang, Qi Dong andShaogang Gong, and Xiatian Zhu. Unsupervised deep learning by neighbourhood discovery. In ICML, 2019. 3
236
+
237
+ Olivier J. Hénaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, S. M. Ali Eslami, and Aäron van den Oord. Data-efficient image recognition with contrastive predictive coding. In ICML, 2019. 6
238
+
239
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. 5
240
+
241
+ Junnan Li, Pan Zhou, Caiming Xiong, and Steven C.H. Hoi. Prototypical contrastive learning of unsupervised representations. In ICLR, 2021. 20
242
+
243
+ Tsung-Yi Lin, Michael Maire, Serge Belongie, Lubomir Bourdev, Ross Girshick, James Hays, Pietro Perona, Deva Ramanan, C. Lawrence Zitnick, and Piotr Dollár. Microsoft coco: Common objects in context. In ECCV, 2014. 6, 7
244
+
245
+ Ilya Loshchilov and Frank Hutter. Sgdr: stochastic gradient descent with warm restarts. In ICLR, 2017. 5
246
+
247
+ Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In CVPR, 2020. 1, 3, 6, 7, 16
248
+
249
+ Karol J. Piczak. ESC: Dataset for Environmental Sound Classification. In Proceedings of the 23rd Annual ACM Conference on Multimedia, 2015. 18
250
+
251
+ Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015. 6, 7
252
+
253
+ Pierre H. Richemond, Jean-Bastien Grill, Florent Altché, Corentin Tallec, Florian Strub, Andrew Brock, Samuel Smith, Soham De, Razvan Pascanu, Bilal Piot, and Michal Valko. Byol works even without batch statistics. arXiv preprint arXiv:2010.10241, 2020. 1, 3
254
+
255
+ Yonglong Tian, Dilip Krishnan, , and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849v4, 2019. 6
256
+
257
+ Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. In NeurIPS, 2020. 1, 6
258
+
259
+ Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. arXiv preprint arXiv:2102.06810, 2021. 1
260
+
261
+ Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 3
262
+
263
+ Yuxin Wu, Alexander Kirillov, Francisco Massa, Wan-Yen Lo, and Ross Girshick. Detectron2. https://github.com/facebookresearch/detectron2, 2019. 16
264
+
265
+ Zhirong Wu, Yuanjun Xiong, Stella Yu, , and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In CVPR, 2018. 3, 18, 20
266
+
267
+ Junyuan Xie, Ross Girshick, and Ali Farhadi. Unsupervised deep embedding for clustering analysis. In ICML, 2016. 3
268
+
269
+ Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In CVPR, 2017. 17
270
+
271
+ Xueting Yan, Ishan Misra, Abhinav Gupta, Deepti Ghadiyaram, and Dhruv Mahajan. Clusterfit: Improving generalization of visual representations. In CVPR, 2020. 3
272
+
273
+ Jianwei Yang, Devi Parikh, and Dhruv Batra. Joint unsupervised learning of deep representations and image clusters. In CVPR, 2016. 3
274
+
275
+ Mang Ye, Xu Zhang, Pong C Yuen, and Shih-Fu Chang. Unsupervised embedding learning via invariant and spreading instance feature. In CVPR, 2019. 3
276
+
277
+ Yang You, Igor Gitman, and Boris Ginsburg. Large batch training of convolutional networks. arXiv preprint arXiv:1708.03888, 2017. 5, 17
278
+
279
+ Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. 17
280
+
281
+ Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Self-supervised learning via redundancy reduction. arXiv preprint arxiv:2103.03230, 2021. 1, 2, 3, 4, 5, 6, 14, 16, 20, 21
282
+
283
+ Bolei Zhou, Agata Lapedriza, Jianxiong Xiao, Antonio Torralba, and Aude Oliva. Learning deep features for scene recognition using places database. In NeurIPS, 2014. 6, 7, 16
284
+
285
+ Chengxu Zhuang, Alex Lin Zhai, and Daniel Yamins. Local aggregation for unsupervised learning of visual embeddings. In ICCV, 2019. 3, 18, 20
286
+
287
+ Algorithm 1: VICReg pytorch pseudocode.
288
+
289
+ # f: encoder network, lambda, mu, nu: coefficients of the invariance, variance and covariance losses, N: batch size , D: dimension of the representations
290
+ # mse_loss: Mean square error loss function, off_diagonal: off-diagonal elements of a matrix, relu: ReLU activation function
291
+
292
+ for x in loader: # load a batch with N samples # two randomly augmented versions of x x_a, x_b $=$ augment(x)
293
+
294
+ # compute representations z_a = f(x_a) # N x D $\mathrm { ~ z ~ } \mathrm { ~ b ~ } = \mathrm { ~ f ~ } ( \mathrm { ~ x ~ } \mathrm { ~ b ~ } )$ # N x D
295
+
296
+ # invariance loss sim_loss $=$ mse_loss(z_a, z_b)
297
+
298
+ # # variance loss
299
+
300
+ std_z_a $=$ torch.sqrt(z_a.var(dim ${ \left. \sum \right. }$ ) $^ +$ 1e-04) std_z_b $=$ torch.sqrt(z_b.var(dim ${ \left. \sum \right. }$ ) $^ +$ 1e-04) std_loss $=$ torch.mean(relu(1 - std_z_a)) $^ +$ torch.mean( relu(1 - std_z_b))
301
+
302
+ # # covariance loss
303
+
304
+ z_a = z_a - z_a.mean(dim ${ } = 0$ )
305
+ $z \_ { \mathrm { ~ b ~ } } = \ \mathrm { ~ z \_ ~ } \mathrm { ~ k ~ }$ b - z_b.mean(dim ${ } = 0$ )
306
+ cov_z_a $=$ (z_a.T @ z_a) / (N - 1)
307
+ cov_z_b $=$ (z_b.T @ z_b) / (N - 1)
308
+ cov_loss $=$ off_diagonal(cov_z_a).pow_(2).sum() / D $^ +$ off_diagonal(cov_z_b).pow_(2).sum() / D
309
+
310
+ # # loss
311
+
312
+ loss $=$ lambda $\star$ sim_loss $^ +$ mu $\star$ std_loss $^ +$ nu $\star$ cov_loss
313
+
314
+ # optimization step loss.backward() optimizer.step()
315
+
316
+ # B RELATION TO OTHER SELF-SUPERVISED METHODS
317
+
318
+ We compare here VICReg with other methods in terms of methodology, and we discuss the mechanisms used by these methods to avoid collapse and to learn representations, and how they relate to VICReg. We synthesize and illustrate the differences between these methods in Figure 2.
319
+
320
+ Relation to Barlow Twins Zbontar et al. (2021). VICReg uses the same decorrelation mechanism as Barlow Twins, which consists in penalizing the off-diagonal terms of a covariance matrix computed on the embeddings. However, Barlow Twins uses the cross-correlation matrix where each entry in the matrix is a cross-correlation between two vectors $z ^ { i }$ and $z ^ { \prime } { \mathcal { I } }$ , from the two branches of the siamese architecture. Instead of using cross-correlations, we simply use the covariance matrix of each branch individually, and the variance term of VICReg allows us to get rid of standardization. Indeed, Barlow Twins forces the correlations between pairs of vectors $z ^ { i }$ and $z ^ { \prime i }$ from the same dimension $i$ to be 1. Without normalization, this target value of 1 becomes arbitrary and the vectors take values in a wider range. Moreover, there is an undesirable phenomenon happening in Barlow Twins, the embeddings before standardization can shrink and become constant to numerical precision, which could cause numerical instabilities. In practice, this is solved by adding a constant scalar in the denominator of standardization of the embeddings. Without normalization, VICReg naturally avoids this edge case.
321
+
322
+ Relation to W-MSE Ermolov et al. (2021). The whitening operation of W-MSE consists in computing the inverse covariance matrix of the embeddings and use its square root as a whitening operator on the embeddings. Using this operator has two downsides. First, matrix inversion is a very costly and potentially unstable operation. VICReg does not need to inverse the covariance matrix. Second, as mentioned in Ermolov et al. (2021) the whitening operator is constructed over several consecutive iteration batches and therefore might have a high variance, which biases the estimation of the meansquared error. This issue is overcome in practice by a batch slicing strategy, where the whitening operator is computed over randomly constructed sub-batches. VICReg does not apply any operator on the embeddings, but instead regularizes the variance and covariance of the embeddings using an additional constraint.
323
+
324
+ Relation to BYOL and SimSiam Grill et al. (2020); Chen & He (2020). The core components that avoid collapse in BYOL and SimSiam are the average moving weights and the stop-gradient operation on one side of their asymmetric architecture, which play the role of the repulsive term used in other methods. Our experiments in Appendix D.8 show that in addition to preventing collapse, these components also have a decorrelation effect. In addition, we have conducted the following experiment: We compute the correlation matrix of the final representations obtained with SimSiam, BYOL, VICReg and VICReg without covariance regularization. We measure the average correlation coefficient and observe that this coefficient is much smaller for SimSiam, BYOL and VICReg, compared to VICReg without covariance regularization. We observe in Figure 5 that even without covariance regularization, SimSiam and BYOL naturally minimize the average correlation coefficient of the representations. VICReg replaces the moving average weights and the stop-gradient operation, which are architectural trick that require some dependency between the branches, by an explicit constraint on the variance and the covariance of both embeddings separately, which achieves the same goal of decorrelating the representations and avoiding collapse, while being clearer, more interpretable, and working with independent branches.
325
+
326
+ Relation to SimCLR, SwAV and OBoW Caron et al. (2020); Chen et al. (2020a); Gidaris et al. (2021). Contrastive and clustering based self-supervised algorithms rely on direct comparisons between elements of negative pairs. In the case of SimCLR, the negative pairs involve embeddings mined from the current batch, and large batch sizes are required. Despite the fact that SwAV computes clusters using elements in the current batch, it does not seem to have the same dependency on batch size. However, it still requires a lot of prototype vectors for negative comparisons between embeddings and codes. VICReg eliminates the negative comparisons and replace them by an explicit constraint on the variance of the embeddings, which efficiently plays the role of a negative term between the vectors. SwAV can also be interpreted as a distillation method, where a teacher network produces quantized vectors, used as target for a student network. Ensuring an equal partition of the quantized vectors in different bins or clusters effectively prevents collapse. OBOW can also be interpreted under the same framework. The embeddings are bag-of-words over a vocabulary of visual features, and collapse is avoided by the underlying quantization operation.
327
+
328
+ ![](images/1608b31cfc54acd98d21c921b1fd8433506230e014d4133565aa5796a33e1427.jpg)
329
+ Figure 2: Conceptual comparison between different self-supervised methods. The inputs $X$ and $X ^ { \prime }$ are fed to an encoder $f$ with weights $\theta$ . The representations $Y$ and $Y ^ { \prime }$ are further processed by a network $h$ with weights $\psi$ . $h$ can be a projector (narrowing trapeze) that reduces the dimensionality of the representations, or an expander (widening trapeze) that increases their dimensionality. A criterion is finally applied on the embeddings $Z$ and $Z ^ { \prime }$ . VICReg (a) works when both branches have encoders $f$ and $f ^ { \prime }$ with different architectures and sets of weights $\theta$ and $\theta ^ { \prime }$ . Each branch’s variance and covariance are regularized by regularizers $v$ and $c$ , and the distance between both branches is minimized with a mean-squared error loss $s$ . Barlow Twins (b) uses a loss $c$ to decorrelate pairs of different dimensions in the batch-wise normalized (B-Norm) embeddings, and learns invariance with a loss $i$ that makes similar dimensions highly correlated. W-MSE (c) uses a batch slicing operation that shuffles batches into small sub-batches, and apply PCA as a whitening operation on the featurewise normalized (F-Norm) embeddings of each sub-batch. BYOL (d) has an asymmetric architecture where the weights $\theta _ { m }$ of one encoder are an exponential moving average (ema) of the other encoder’s weights $\theta$ . A predictor $g$ with weights $\psi$ is used in the branch with learnable weights. SimSiam (e) uses a predictor on one branch and a stop-gradient operation (sg) on the other one. SimCLR (f) uses the InfoNCE contrastive loss where all the feature-wise normalized embeddings are compared between them inside a batch. Samples from distorted versions of the same input are brought close to each other, while other samples are pushed away. SwAV (g) quantizes the feature-wise normalized embeddings of a branch and use it as target for the other one. OBoW (h) uses bag-of-words (BoW) representations and a cross-entropy loss to compare the BoW generated by a teacher network from the feature maps $Y ^ { F }$ of the encoder, to the BoW predicted by a student network. Green blocks: parametric functions; yellow boxes: non-parametric functions; blue boxes: objective functions.
330
+
331
+ # C ADDITIONAL IMPLEMENTATION DETAILS
332
+
333
+ # C.1 DATA AUGMENTATION
334
+
335
+ We follow the image augmentation protocol first introduced in SimCLR Chen et al. (2020a) and now commonly used by similar approaches based on siamese networks Caron et al. (2020); Grill et al. (2020); Chen & He (2020); Zbontar et al. (2021). Two random crops from the input image are sampled and resized to $2 2 4 \times 2 2 4$ , followed by random horizontal flip, color jittering of brightness, contrast, saturation and hue, Gaussian blur and random grayscale. Each crop is normalized in each color channel using the ImageNet mean and standard deviation pixel values. In more details, the exact set of augmentations is based on BYOL Grill et al. (2020) data augmentation pipeline but is symmetrised. The following operations are performed sequentially to produce each view:
336
+
337
+ • Random cropping with an area uniformly sampled with size ratio between 0.08 to 1.0, followed by resizing to size $2 2 4 \times 2 2 4$ . RandomResizedCrop(224, $\mathsf { i c a l e } \mathsf { = } ( 0 . 0 8 $ , 0.1)) in PyTorch.
338
+ • Random horizontal flip with probability 0.5.
339
+ • Color jittering of brightness, contrast, saturation and hue, with probability 0.8. ColorJitter(0.4, 0.4, 0.2, 0.1) in PyTorch.
340
+ • Grayscale with probability 0.2.
341
+ • Gaussian blur with probability 0.5 and kernel size 23.
342
+ • Solarization with probability 0.1.
343
+ • color normalization with mean (0.485, 0.456, 0.406) and standard deviation (0.229, 0.224, 0.225).
344
+
345
+ # C.2 IMAGENET EVALUATION
346
+
347
+ Linear evaluation. We follow standard procedure and train a linear classifier on top of the frozen representations of a ResNet-50 pretrained with VICReg. We use the SGD optimizer with a learning rate of 0.02, a weight decay of $\bar { 1 0 } ^ { - 6 }$ , a batch size of 256, and train for 100 epochs. The learning rate follows a cosine decay. The training data augmentation pipeline is composed of random cropping and resize of ratio 0.2 to 1.0 with size $2 2 4 \times 2 2 4$ , and random horizontal flips. During evaluation the validation images are simply center cropped and resized to $2 2 4 \times 2 2 4$ .
348
+
349
+ Semi-supervised evaluation. We train a linear classifier and fine-tune the representations using 1 and $10 \%$ of the labels. We use the SGD optimizer with no weight decay and a batch size of 256, and train for 20 epochs. We perform a grid search on the values of the encoder and linear head learning rates. In the $10 \%$ of labels case, we use a learning rate of 0.01 for the encoder and 0.1 for the linear head. In the $1 \%$ of labels case we use 0.03 for the encoder and 0.08 for the linear head. The two learning rates follow a cosine decay schedule. The training data and validation augmentation pipelines are identical to the linear evaluation data augmentation pipelines.
350
+
351
+ # C.3 TRANSFER LEARNING
352
+
353
+ We use the VISSL library Goyal et al. (2021) for linear classification tasks and the detectron2 library Wu et al. (2019) for object detection and segmentation tasks.
354
+
355
+ Linear classification. We follow standard protocols Misra & Maaten (2020); Caron et al. (2020); Zbontar et al. (2021) and train linear models on top of the frozen representations. For VOC07 Everingham et al. (2010), we train a linear SVM with LIBLINEAR Fan et al. (2008). The images are center cropped and resized to $2 2 4 \times 2 2 4$ , and the C values are computed with cross-validation. For Places205 Zhou et al. (2014) we use SGD with a learning rate of 0.003, a weight decay of 0.0001, a momentum of 0.9 and a batch size of 256, for 28 epochs. The learning rate is divided by 10 at epochs 4, 8 and 12. For Inaturalist2018 Horn et al. (2018), we use SGD with a learning rate of 0.005, a weight decay of 0.0001, a momentum of 0.9 and a batch size of 256, for 84 epochs. The learning rate is divided by 10 at epochs 24, 48 and 72.
356
+
357
+ Object detection and instance segmentation. Following the setup of He et al. (2020); Zbontar et al. (2021), we use the trainval split of $\mathrm { v o c } 0 7 { + } 1 2$ with 16K images for training and a Faster
358
+
359
+ R-CNN C-4 backbone for 24K iterations with a batch size of 16. The backbone is initialized with our pretrained ResNet-50 backbone. We use a learning rate of 0.1, divided by 10 at iteration 18K and 22K, a linear warmup with slope of 0.333 for 1000 iterations, and a region proposal network loss weight of 0.2. For COCO we use Mask R-CNN FPN backbone for 90K iterations with a batch size of 16, a learning rate of 0.04, divided by 10 at iteration 60K and 80K and with 50 warmup iterations.
360
+
361
+ # C.4 ANALYSIS
362
+
363
+ We give here implementation details on the results of Table 4 with BYOL and SimSiam, as well as the default setup for VICReg with 100 epochs of pretraining, used in all our ablations included in Appendix D. For both BYOL and SimSiam experiments, the variance criterion has coefficient $\mu = 1$ and the covariance criterion has coefficient $\nu = 0 . 0 1$ , the data augmentation pipeline and the architectures of the expander and predictor exactly follow the pipeline and architectures described in their paper. The linear evaluation setup of each methods follows closely the setup described in the original papers.
364
+
365
+ BYOL setup. We use our own BYOL implementation in PyTorch, which outperforms the original implementation for 100 epochs of pretraining $( 6 9 . 3 \%$ accuracy on the linear evaluation protocol against $6 6 . 5 \%$ for the original implementation) and matches its performance for 1000 epochs of pretraining. We use the LARS optimizer You et al. (2017), with a learning rate of $b a s e \_ l r *$ batch_size/256 where base_ $l r = 0 . 4 5$ , and batch $\_ s i z e = 4 0 9 6$ , a weight decay of $1 0 ^ { - 6 }$ , an eta value of 0.001 and a momentum of 0.9, for 100 epoch of pretraining with 10 epochs of warmup. The learning rate follows a cosine decay schedule. The initial value of the exponential moving average factor is 0.99 and follows a cosine decay schedule.
366
+
367
+ SimSiam setup. We use our own implementation of SimSiam, which reproduces exactly the performance reported in the paper Chen & He (2020). We use SGD with a learning rate of base_lr batch_size/256 where base_ $l r = 0 . 0 5$ , batch_size = 2048, with a weight decay of 0.0001 and a momentum of 0.9 for 100 epochs of pretraining and 10 epochs of warmup. The learning rate of the encoder and the expander follow a cosine decay schedule while the learning rate of the predictor is kept fixed.
368
+
369
+ VICReg setup. The setting of VICReg’s experiments is identical to the setting described in section 4.2, except that the number of pretraining epochs is 100 and the base learning rate is 0.3. The base learning rates used for the batch size study are 0.8, 0.5 and 0.4 for batch size 128, 256 and 512 respectively, and 0.3 for all other batch sizes. When a predictor is used, it has a similar architecture as the expander described in section 4.2, but with 2 layers instead of 3, which gives better results in practice.
370
+
371
+ # D ADDITIONAL RESULTS
372
+
373
+ # D.1 OTHER RESNET ARCHITECTURES
374
+
375
+ Table 9 reports the performance of VICReg on linear classification with large ResNet architectures. We focus on the wider family of ResNet Zagoruyko & Komodakis (2016) and aggregated ResNet Xie et al. (2017), and we consider two ways of widening a standard ResNet. First, we follow standard practice in recent self-supervised learning work Caron et al. (2020); Grill et al. (2020); Chen et al. (2020a) and multiple by 2 or 4 the number of filters in every convolutional layer, which also has the effect of multiplying the dimensionality of the representations. Second, as originally proposed in Zagoruyko & Komodakis (2016), we only multiply the number of filters in the bottleneck layers, which does not increases the dimensionality of the representations. We call this architecture Narrow ResNet (with prefix N- in Table 9). The main observation we make is the dependency of VICReg on the dimensionality of the representation. Using the narrow architecture, the performance of VICReg, jumps from $7 3 . 2 \%$ top-1 accuracy on linear classification with a ResNet-50, to $7 4 . 7 \%$ with Narrow ResNet-50 $( \mathbf { x } 2 )$ , which is a $1 . 5 \%$ improvement and $7 6 . 0 \%$ with Narrow ResNet-50 (x4), which is a $2 . 8 \%$ improvement. We observe a similar trend going from ResNet-50 to ResNet-50 $( \mathbf { x } 2 )$ , which is a $2 . 3 \%$ improvement but the performance completely saturates with ResNet-50 (x4), which is a $0 . 1 \%$ improvement over ResNet-50 (x2). Table 10 reports the performance of VICReg on semi-supervised classification with large ResNet architectures. VICReg combined with a ResNet-50 (x2) outperforms the current state-of-the-art methods BYOL and SimCLR, using this encoder architecture. Our largest model ResNet-200 $( \mathbf { x } 2 )$ performs lower than BYOL when $1 \%$ of the labels are used but is on par with $10 \%$ of the labels. These results demonstrate the capabilities of VICReg to scale up when large architectures are used.
376
+
377
+ Table 6: Evaluation on ESC-50. Evaluation of the representations obtained with a ResNet-18 backbone pretrained with VICReg on ESC-50 Piczak (2015) by processing jointly a raw audio time-series and its corresponding time-frequency representation. The supervised baseline corresponds to a ResNet-18 trained on the time-frequency representation in a supervised way. We report Top-1 accuracy on the validation set (in $\%$ ).
378
+
379
+ <table><tr><td>Method</td><td>Top-1</td></tr><tr><td>Supervised baseline</td><td>72.7</td></tr><tr><td>Barlow Twins</td><td>75.4</td></tr><tr><td>VICReg</td><td>78.4</td></tr></table>
380
+
381
+ # D.2 PRETRAINING AND EVALUATION ON ESC-50 AUDIO CLASSIFICATION
382
+
383
+ We demonstrate the ability of VICReg to function in a setting where the branches have different architectures by pretraining on the ESC-50 audio dataset Piczak (2015), which is an environmental sound classification dataset with 50 classes. We jointly embedded a raw audio time-series representation on one branch, with its corresponding time-frequency representation on the other branch. We use the standard split of ESC-50 Piczak (2015), composed of 1600 training audio samples and 400 validation sample. The raw audio encoder is a 1-dimensional ResNet-18 with output dimension 384. The time-frequency image representation is the mel spectrogram with 1 channel of the raw audio, that we normalize between 0 and 1, and that is processed be a ResNet-18 with output dimension of 512. We use the AdamW optimizer with learning rate 0.0005 for 100 epochs of pretraining.
384
+
385
+ Table 6 reports the performance of a linear classifier trained one the frozen representations obtained with VICReg and Barlow Twins to a simple supervised baseline where we train a ResNet-18 on the time-frequency representation in a supervised way. VICReg performs better by $5 . 7 \%$ than our supervised baseline, and better by $3 . 0 \%$ than Barlow Twins. We give more details in Appendix ??. Current best approaches that report around $9 5 \%$ accuracy on this task uses tricks such as heavy data augmentation or pretraining on larger audio and video datasets. With this experiment, our purpose is not to push the state of the art on ESC-50, but merely to demonstrate the applicability of VICReg to settings with multiple architectures and input modalities.
386
+
387
+ # D.3 K-NEAREST-NEIGHBORS
388
+
389
+ Following recent protocols Caron et al. (2020); Wu et al. (2018); Zhuang et al. (2019), we evaluate the learnt representations using K-nearest-neighbors classifiers built on the training set of ImageNet and evaluated on the validation set of ImageNet. We report the results with $\mathrm { K } { = } 2 0$ and ${ \mathrm { K } } { = } 2 0 0$ in Table 11. VICReg performs slightly lower than other methods in the 20-NN case but remains competitive in the 200-NN case. These results with K-NN classifiers demonstrate the potential applicability of VICReg to downstream tasks based on nearest neighbors search, such as content retrieval in images or videos.
390
+
391
+ # D.4 LOSS FUNCTION COEFFICIENTS.
392
+
393
+ Table 7 reports the performance for various values of the loss term coefficients in Eq. (6). Without variance regularization the representations immediately collapse to a single vector and the covariance term, which has no repulsive effect preventing collapse, has no impact. The invariance term is absolutely necessary and without it the network can not learn any good representations. By simply using the invariance term and variance regularization, which is a very simple baseline, VICReg still reaches an accuracy of $5 7 . 5 \%$ . These results show that variance and covariance regularizations have complementary effects, and that both are required.
394
+
395
+ On ImageNet, we choose the final coefficients the following way. First, we have empirically found that using very different values for $\lambda$ and $\mu$ , or taking $\lambda = \mu$ with $\nu > \mu$ leads to unstable training. On the other hand taking $\lambda = \mu$ and picking $\nu < \mu$ leads to stable convergence, with the exact value picked for $m u$ having very limited influence on the final linear classification accuracy. We have found that setting $l a m b d a = m u = 2 5$ and $n u = 1$ works best (by a small margin) for Imagenet but we have also obtained excellent results on MNIST and Cifar-10 and 100 using these exact same values. We could easily have tuned these parameters by cross-validation on the validation sets of these two smaller datasets.
396
+
397
+ Table 7: Impact of variance-covariance regularization. Inv: a invariance loss is used, $\lambda > 0$ , Var: variance regularization, $\mu > 0$ , Cov: covariance regularization, $\nu > 0$ , in Eq. (6).
398
+
399
+ <table><tr><td>Method</td><td>入</td><td>μ</td><td>V</td><td>Top-1</td></tr><tr><td>Inv</td><td>1</td><td>0</td><td>0</td><td>collapse</td></tr><tr><td>Inv + Cov</td><td>25</td><td>0</td><td>1</td><td>collapse</td></tr><tr><td>Inv + Cov</td><td>0</td><td>25</td><td>1</td><td>collapse</td></tr><tr><td>Inv + Var</td><td>1</td><td>1</td><td>0</td><td>57.5</td></tr><tr><td>Inv + Var + Cov (VICReg)</td><td>1</td><td>1</td><td>1</td><td>collapse</td></tr><tr><td></td><td>1</td><td>10</td><td>1</td><td>collapse</td></tr><tr><td></td><td>10</td><td>1</td><td>1</td><td>collapse</td></tr><tr><td></td><td>5</td><td>5</td><td>1</td><td>68.1</td></tr><tr><td></td><td>10</td><td>10</td><td>1</td><td>68.2</td></tr><tr><td></td><td>25</td><td>25</td><td>1</td><td>68.6</td></tr><tr><td></td><td>50</td><td>50</td><td>1</td><td>68.3</td></tr></table>
400
+
401
+ Table 8: Impact of normalization. Std: variables are centered and divided by their standard deviation over the batch. This is applied or not to the embedding and the expander hidden layers. $l _ { 2 }$ : the embedding vectors are $l _ { 2 }$ -normalized.
402
+
403
+ <table><tr><td>Representation</td><td>Embedding</td><td>Top-1</td></tr><tr><td>Std</td><td>None</td><td>68.6</td></tr><tr><td>Std</td><td>Std</td><td>68.4</td></tr><tr><td>None</td><td>Std</td><td>67.4</td></tr><tr><td>Std</td><td>None</td><td>67.2</td></tr><tr><td>None</td><td>l2</td><td>65.1</td></tr></table>
404
+
405
+ # D.5 NORMALIZATIONS
406
+
407
+ VICReg is the first self-supervised method for joint-embedding architectures we are aware of that does not require normalization. Contrary to SimSiam, W-MSE, SwAV and BYOL, and others, the embedding vectors are not projected on the unit sphere. Contrary to Barlow Twins, they are not standardized (equivalent to batch normalization without the adaptive parameters). Table 8 shows that the best settings do not involve any normalization of the embeddings, whether it is batch-wise or feature-wise (as in $l _ { 2 }$ normalization). Whenever the embeddings are standardized (lines 3 and 5 in the table) the covariance matrix of Eq. (3) becomes the normalized auto-correlation matrix with coefficients between -1 and 1. This hurts the accuracy by $0 . 2 \%$ . We observe that when unconstrained, the coefficients in the covariance matrix take values in a wider range, which seems to facilitate the training process. Standardization is still an important component that helps stabilize the training when used in the hidden layers of the expander, and the performance drops by $1 . 2 \%$ when it is removed. Projecting the embeddings on the unit sphere implicitly constrains their standard deviation along the batch dimension to be $1 / { \sqrt { d } }$ , where $d$ is the dimension of the vectors. We change the invariance term of Eq. (5) to be the mean square error between $l _ { 2 }$ -normalized vectors, and the target $\gamma$ in the variance term of Eq. (1) is set to $1 / \sqrt { d }$ instead of 1, forcing the standard deviation to get closer to $1 / \sqrt { d }$ , and the vectors to be spread out on the unit sphere. This puts a lot more constraints on the network and the performance drops by $3 . 5 \%$ .
408
+
409
+ Table 9: Linear classification with large architectures. Top-1 accuracy comparison between different methods using various encoder architectures. For all VICReg results, the output dimensionality of the expander is 8192. N-R stands for Narrow ResNet, where only the bottleneck convolutional layers are widen.
410
+
411
+ <table><tr><td>Method</td><td>Arch.</td><td>Param.</td><td>Repr.</td><td>Top-1</td><td>Top-5</td></tr><tr><td>SimCLR Chen et al. (2020a)</td><td>R50 (x2) R50 (x4)</td><td>93M 375M</td><td>4096 8192</td><td>74.2 76.5</td><td>92.0 93.2</td></tr><tr><td>SwAV Caron et al. (2020)</td><td>R50 (x2) R50 (x4)</td><td>93M 375M</td><td>4096 8192</td><td>77.3 77.9</td><td>- =</td></tr><tr><td>BYOL Grill et al. (2020)</td><td>R50 (x5) R50 (x2) R50 (x4)</td><td>586M 93M 375M</td><td>10240 4096 8192</td><td>78.5 77.4 78.6</td><td>- 93.6 94.2</td></tr><tr><td>VICReg (ours)</td><td>R200 (x2) N-R50 (x2)</td><td>250M 66M</td><td>4096 2048</td><td>79.6 74.7</td><td>94.8 91.9</td></tr><tr><td></td><td>N-R50 (x4)</td><td>221M</td><td>2048</td><td>76.0</td><td>92.4</td></tr><tr><td></td><td>R50 (x2)</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>93M</td><td>4096</td><td>75.5</td><td>92.1</td></tr><tr><td></td><td>R50 (x4)</td><td>375M</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td>8192</td><td>75.6</td><td>92.2</td></tr><tr><td></td><td>RNXT101-32-16</td><td>191M</td><td>2048</td><td>76.1</td><td>92.3</td></tr><tr><td></td><td>R200 (x2)</td><td>250M</td><td>4096</td><td>77.3</td><td>93.3</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
412
+
413
+ Table 10: Semi-supervised classification with large architectures. Top-1 accuracy comparison between different methods using various encoder architectures. For all VICReg results, the output dimensionality of the expander is 8192.
414
+
415
+ <table><tr><td>Method</td><td>Arch.</td><td>Param.</td><td>Repr.</td><td colspan="2">Top-1</td><td colspan="2">Top-5</td></tr><tr><td></td><td></td><td></td><td></td><td>1%</td><td>10%</td><td>1%</td><td>10%</td></tr><tr><td>SimCLR Chen et al. (2020a)</td><td>R50 (x2)</td><td>93M</td><td>4096</td><td>58.5</td><td>71.7</td><td>83.0</td><td>91.2</td></tr><tr><td></td><td>R50 (x4)</td><td>375M</td><td>8192</td><td>63.0</td><td>74.4</td><td>85.8</td><td>92.6</td></tr><tr><td>BYOL Grill et al. (2020)</td><td>R50 (x2)</td><td>93M</td><td>4096</td><td>62.2</td><td>73.5</td><td>84.1</td><td>91.7</td></tr><tr><td></td><td>R50 (x4)</td><td>375M</td><td>8192</td><td>69.1</td><td>75.7</td><td>87.9</td><td>92.5</td></tr><tr><td></td><td>R200 (x2)</td><td>250M</td><td>4096</td><td>71.2</td><td>77.7</td><td>89.5</td><td>93.7</td></tr><tr><td>VICReg (ours)</td><td>R50 (x2)</td><td>93M</td><td>4096</td><td>62.6</td><td>73.9</td><td>84.5</td><td>91.8</td></tr><tr><td></td><td>R200 (x2)</td><td>250M</td><td>4096</td><td>68.8</td><td>77.3</td><td>88.2</td><td>93.6</td></tr></table>
416
+
417
+ Table 11: K-NN classifiers on ImageNet. Top-1 accuracy with 20 and 200 nearest neighbors.
418
+
419
+ <table><tr><td>Method</td><td>20-NN</td><td>200-NN</td></tr><tr><td>NPID Wu et al. (2018)</td><td></td><td>46.5</td></tr><tr><td>LA Zhuang et al. (2019)</td><td></td><td>49.4</td></tr><tr><td>PCL Li et al. (2021)</td><td>54.5</td><td>1</td></tr><tr><td>BYOL Grill et al. (2020)</td><td>66.7</td><td>64.9</td></tr><tr><td>SwAV Caron et al. (2020)</td><td>65.7</td><td>62.7</td></tr><tr><td>Barlow Twins Zbontar et al. (2021)</td><td>64.8</td><td>62.9</td></tr><tr><td>VICReg</td><td>64.5</td><td>62.8</td></tr></table>
420
+
421
+ Table 12: Impact of expander dimensionality. Top-1 accuracy on the linear evaluation protocol with 100 pretraining epochs.
422
+
423
+ <table><tr><td>Dimensionality</td><td>256</td><td>512</td><td>1024</td><td>2048</td><td>4096</td><td>8192</td><td>16834</td></tr><tr><td>Top-1</td><td>55.9</td><td>59.2</td><td>62.4</td><td>65.1</td><td>67.3</td><td>68.6</td><td>68.8</td></tr></table>
424
+
425
+ Table 13: Impact of batch size. Top-1 accuracy on the linear evaluation protocol with 100 pretraining epochs.
426
+
427
+ <table><tr><td>Batch size</td><td>128</td><td>256</td><td>512</td><td>1024</td><td>2048</td><td>4096</td></tr><tr><td>Top-1</td><td>67.3</td><td>67.9</td><td>68.2</td><td>68.3</td><td>68.6</td><td>67.8</td></tr></table>
428
+
429
+ # D.6 EXPANDER NETWORK ARCHITECTURE
430
+
431
+ VICReg borrows the decorrelation mechanism of Barlow Twins Zbontar et al. (2021) and we observe that it therefore has the same dependency on the dimensionality of the expander network. Table 12 reports the impact of the width and depth of the expander network. The dimensionality corresponds the number of hidden and output units in the expander network during pretraining. As the dimensionality increases, the performance dramatically increases from $5 5 . 9 \%$ top-1 accuracy on linear evaluation with a dimensionality of 256, to $6 8 . 8 \%$ with dimensionality 16384. The performance tends to saturate as the difference between dimensionality 8192 and 16384 is only of $0 . 2 \%$ .
432
+
433
+ # D.7 BATCH SIZE
434
+
435
+ Contrastive methods suffer from the need of a lot of negative examples which can translate into the need for very large batch sizes Chen et al. (2020a). Table 13 reports the performance on linear classification when the size of the batch varies between 128 and 4096. For each value of batch size, we perform a grid search on the base learning rate described in Appendix C.4. We observe a $0 . 7 \%$ and $1 . 2 \%$ drop in accuracy with small batch size of 256 and 128 which is comparable with the robustness to batch size of Barlow Twins Zbontar et al. (2021) and SimSiam Chen & He (2020), and a $0 . 8 \%$ drop with a batch size of 4096, which is reasonable and allows our method to be very easily parallelized on multiple GPUs.
436
+
437
+ # D.8 COMBINATION WITH BYOL AND SIMSIAM
438
+
439
+ BYOL Grill et al. (2020) and SimSiam Chen & He (2020) rely on a effective but difficult to interpret mechanism for preventing collapse, which may lead to instabilities during the training. We incorporate our variance regularization loss into BYOL and SimSiam and show that it helps stabilize the training and offers a small performance improvement. For both methods, the results are obtained using our own implementation and the exact same data augmentation and optimization settings as in their original paper. The variance and covariance regularization losses are incorporated with a factor of $\mu = 1$ for variance and $\nu = 0 . 0 1$ for covariance. We report in Figure 3 the improvement obtained over these methods on the linear evaluation protocol for different number of pre-training epochs. For BYOL the improvement is of $0 . 9 \%$ with 100 epochs and becomes less significant as the number of pre-training epochs increases with a $0 . 2 \%$ improvement with 1000 epochs. This indicates that variance regularization makes BYOL converge faster. In SimSiam the improvement is not as significant. We plot in Figure 4 the evolution of the standard deviation computed along each dimension and averaged across the dimensions of the representation and the embeddings, during BYOL and SimSiam pretraining. For both methods, the standard deviation computed on the embeddings perfectly matches $1 / \sqrt { d }$ where $d$ is the dimension of the embeddings, which indicates that the embeddings are perfectly spread-out across the unit sphere. This translates in an increased standard deviation at the representation level, which seems to be correlated to the performance improvement. We finally study in Figure 5 the evolution of the average correlation coefficient, during pretraining of BYOL and SimSiam, with and without variance and covariance regularization. The average correlation coefficient is computed by averaging the off-diagonal coefficients of the
440
+
441
+ ![](images/ce4f3f2f35eee210b232923166a889b553aed273f70fbf76a4e44feac2433b35.jpg)
442
+ Figure 3: Incorporating variance regularization in BYOL and SimSiam. Top-1 accuracy on the linear evaluation protocol for different number of pretraining epochs. For both methods pre-training follows the optimization and data augmentation protocol of their original paper but is based on our implementation. Var indicates variance regularization
443
+
444
+ correlation matrix of the representations:
445
+
446
+ $$
447
+ \frac { 1 } { 2 d ( d - 1 ) } \sum _ { i \neq j } C ( \boldsymbol { Y } ) _ { i , j } ^ { 2 } + C ( \boldsymbol { Y } ^ { \prime } ) _ { i , j } ^ { 2 } ,
448
+ $$
449
+
450
+ where $Y$ and $Y ^ { \prime }$ are the standardized representations and $C$ is defined in Eq. (3). In BYOL this coefficient is much lower using covariance regularization, which translate in a small improvement of the performance, according to Table 4. We do not observe the same improvement in SimSiam, both in terms of correlation coefficient, and in terms of performance on linear classification. The average correlation coefficient is correlated with the performance, which motivates the fact that decorrelation and redundancy reduction are core mechanisms for learning self-supervised representations.
451
+
452
+ # E RUNNING TIME
453
+
454
+ We report in Table 14, the running time of VICReg in comparison with other methods. All methods are run by us on 32 Tesla V100 GPUs. Each method offers a different trade-off between running time, memory and performance. SwAV is a very fast algorithm which use less memory and run faster than the other methods but with a lower performance, multi-crop helps the performance at the cost of additional compute and memory usage. BYOL has the highest memory requirement, which is due to the need of storing the target network weights. Finally, Barlow Twins and VICReg offer an interesting trade-off, consuming less memory than BYOL and SwAV with multi-crop, and running faster than SwAV with multi-crop, but with a slightly worse performance. The difference of 1h running time between Barlow Twins and VICReg is probably due to implementation details not related to the method.
455
+
456
+ Table 14: Running time and peak memory. Comparison between different methods, the training is distributed on 32 Tesla V100 GPUs, the running time is measured over 100 epochs and the peak memory is measured on a single GPU. We report top-1 accuracy $( \% )$ on linear classification on top of the frozen representations.
457
+
458
+ <table><tr><td>Method</td><td>time /100 epochs</td><td>peak memory /GPU</td><td>Top-1 accuracy (%)</td></tr><tr><td>SwAV</td><td>9h</td><td>9.5G</td><td>71.8</td></tr><tr><td>SwAV (w/ multi-crop)</td><td>13h</td><td>12.9G</td><td>75.3</td></tr><tr><td>BYOL</td><td>10h</td><td>14.6G</td><td>74.3</td></tr><tr><td>Barlow Twins</td><td>12h</td><td>11.3G</td><td>73.2</td></tr><tr><td>VICReg</td><td>11h</td><td>11.3G</td><td>73.2</td></tr></table>
459
+
460
+ ![](images/31f7a4f38b8e3584fd46290d02e9cd6daaf2dfbad19ab9c981e6bb8e918f2a31.jpg)
461
+ Figure 4: Standard deviation of the features during BYOL and SimSiam pretraining. Evolution of the average standard deviation of each dimension of the features with and without variance regularization (Var). left: the standard deviation is measured on the representations, right: the standard deviation is measured on the embeddings.
462
+
463
+ ![](images/db6757e96a0cd7ad7f51fa2a043c02e9bd4442ac766560152ad7b2c7450f882b.jpg)
464
+ Figure 5: Average correlation coefficient of the features during BYOL and SimSiam pretraining. Evolution of the average correlation coefficient measured by averaging the off-diagonal terms of the correlation matrix of the representations with BYOL, BYOL with variance-covariance regularization (BYOL VarCov), SimSiam, and SimSiam with variance-covariance regularization (SimSiam VarCov).
parse/dev/xm6YD62D1Ub/xm6YD62D1Ub_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/1toB0Fo9CZy/1toB0Fo9CZy_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bfae86bd0bf0616819808ac0935ffba4e2201606bcd3fc77ce055d9a3726c9f2
3
+ size 1979475
parse/train/1toB0Fo9CZy/1toB0Fo9CZy_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55580b7672c43bd74335438a7e5f437c7276955ecd8552e1e15b6233afd6016c
3
+ size 1734978
parse/train/1toB0Fo9CZy/1toB0Fo9CZy_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0ff53519505179c21015b776717fba9ce392dbc2e1d154ace8097b0cce5edb1
3
+ size 1982889
parse/train/5SST78xEh4A/5SST78xEh4A_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6bb55ed7a7361108c20253dfe40f8fcb69cb3edef6369dbcb9f2af697ae2f840
3
+ size 1278685
parse/train/5SST78xEh4A/5SST78xEh4A_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f5138c199ef6a7deda72080a3d57a347d1a2fef2dc0d187b88a78b43d671637
3
+ size 1114239
parse/train/5SST78xEh4A/5SST78xEh4A_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c43f2f288071478b1bd9f2565a55b21d4e9bcbbc1d6a192f05f11319e605ee17
3
+ size 1279966
parse/train/63pC59XOZLZ/63pC59XOZLZ_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e01b6957e092db8398c2dd6c8472fb765e48f35e9c4ce20f3c64814ddb4f6250
3
+ size 1470703
parse/train/63pC59XOZLZ/63pC59XOZLZ_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c573241eeecb15f5b4acf1cae928aa0d1cef09177951024033011dc587cde14
3
+ size 1219510
parse/train/63pC59XOZLZ/63pC59XOZLZ_span.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c66868f4f5c60a51cd01553913ef471f850699370890f54395b3affafc61620f
3
+ size 1479151
parse/train/68B1ezcffDc/68B1ezcffDc_layout.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f95626677921c2822a4c655269c137b403f4c895dde35a69e2bd6ed995bcbe0
3
+ size 892899
parse/train/68B1ezcffDc/68B1ezcffDc_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e385f9de480b5b52a7b203119bb7d952ecc079c882a7f3b66caabf8ba6a7eb5b
3
+ size 672021