Datasets:
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +74 -0
- md/test/3mXJ9o2DNx/3mXJ9o2DNx.md +388 -0
- md/test/89l6VLPrin/89l6VLPrin.md +249 -0
- md/test/B6t5wy6g5a/B6t5wy6g5a.md +591 -0
- md/test/BfMQIJ0nLc/BfMQIJ0nLc.md +0 -0
- md/test/Fx2SbBgcte/Fx2SbBgcte.md +387 -0
- md/test/IEduRUO55F/IEduRUO55F.md +0 -0
- md/test/JVeM7uwDwK/JVeM7uwDwK.md +0 -0
- md/test/KOZu91CzbK/KOZu91CzbK.md +575 -0
- md/test/KUNzEQMWU7/KUNzEQMWU7.md +0 -0
- md/test/PIl69UIAWL/PIl69UIAWL.md +489 -0
- md/test/Ufc5cWhHko/Ufc5cWhHko.md +320 -0
- md/test/Unb5CVPtae/Unb5CVPtae.md +0 -0
- md/test/YCWjhGrJFD/YCWjhGrJFD.md +399 -0
- md/test/dtvJF1Vy2i/dtvJF1Vy2i.md +0 -0
- md/test/fYerSwf1Tb/fYerSwf1Tb.md +404 -0
- md/test/fnO5h1CFyh/fnO5h1CFyh.md +375 -0
- md/test/gDlsMWost9/gDlsMWost9.md +633 -0
- md/test/iSAgvYhZzg/iSAgvYhZzg.md +448 -0
- md/test/jolYuxpVn1/jolYuxpVn1.md +634 -0
- md/test/jxpsAj7ltE/jxpsAj7ltE.md +218 -0
- md/test/nKvGCUoiuW/nKvGCUoiuW.md +361 -0
- md/test/sllU8vvsFF/sllU8vvsFF.md +435 -0
- md/test/t0L4xG4aGC/t0L4xG4aGC.md +280 -0
- md/test/u6jbcaCHqO/u6jbcaCHqO.md +507 -0
- md/test/vqIH0ObdqL/vqIH0ObdqL.md +334 -0
- md/test/y1pPWFVfvR/y1pPWFVfvR.md +670 -0
- md/test/yzfi15eVI7/yzfi15eVI7.md +509 -0
- md/train/5CGPY2VeEGb/5CGPY2VeEGb.md +297 -0
- md/train/79zWncwO2p/79zWncwO2p.md +272 -0
- md/train/8yKEo06dKNo/8yKEo06dKNo.md +0 -0
- md/train/Ad7Gv5NkBPz/Ad7Gv5NkBPz.md +438 -0
- md/train/B1eCk1StPH/B1eCk1StPH.md +324 -0
- md/train/B1evfa4tPB/B1evfa4tPB.md +0 -0
- md/train/BJg7x1HFvB/BJg7x1HFvB.md +282 -0
- md/train/Bk8ZcAxR-/Bk8ZcAxR-.md +401 -0
- md/train/BkVsEMYel/BkVsEMYel.md +0 -0
- md/train/BkedwoC5t7/BkedwoC5t7.md +357 -0
- md/train/BklfR3EYDH/BklfR3EYDH.md +401 -0
- md/train/BkmM8Dceg/BkmM8Dceg.md +322 -0
- md/train/ByQPVFull/ByQPVFull.md +233 -0
- md/train/ByeWogStDS/ByeWogStDS.md +378 -0
- md/train/Byg1v1HKDB/Byg1v1HKDB.md +419 -0
- md/train/Bygh9j09KX/Bygh9j09KX.md +354 -0
- md/train/Bym0cU1CZ/Bym0cU1CZ.md +384 -0
- md/train/ByxY8CNtvr/ByxY8CNtvr.md +370 -0
- md/train/CaCHjsqCBJV/CaCHjsqCBJV.md +488 -0
- md/train/EbIDjBynYJ8/EbIDjBynYJ8.md +0 -0
- md/train/EdXhmWvvQV/EdXhmWvvQV.md +296 -0
- md/train/FMPuzXV1fR/FMPuzXV1fR.md +329 -0
.gitattributes
CHANGED
|
@@ -363,3 +363,77 @@ parse/dev/pCucay08Co/pCucay08Co_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
|
| 363 |
parse/dev/GGi4igGZEB-/GGi4igGZEB-_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 364 |
parse/dev/MpJjrfSJ-Xs/MpJjrfSJ-Xs_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 365 |
parse/dev/pCucay08Co/pCucay08Co_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 363 |
parse/dev/GGi4igGZEB-/GGi4igGZEB-_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 364 |
parse/dev/MpJjrfSJ-Xs/MpJjrfSJ-Xs_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 365 |
parse/dev/pCucay08Co/pCucay08Co_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 366 |
+
parse/dev/aNWiwR2HiOs/aNWiwR2HiOs_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 367 |
+
parse/dev/aNWiwR2HiOs/aNWiwR2HiOs_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 368 |
+
parse/dev/SHbhHHfePhP/SHbhHHfePhP_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 369 |
+
parse/dev/o4neHaKMlse/o4neHaKMlse_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 370 |
+
parse/dev/jlAjNL8z5cs/jlAjNL8z5cs_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 371 |
+
parse/dev/aNWiwR2HiOs/aNWiwR2HiOs_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 372 |
+
parse/dev/SHbhHHfePhP/SHbhHHfePhP_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 373 |
+
parse/dev/SHbhHHfePhP/SHbhHHfePhP_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 374 |
+
parse/dev/jlAjNL8z5cs/jlAjNL8z5cs_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 375 |
+
parse/dev/jlAjNL8z5cs/jlAjNL8z5cs_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 376 |
+
parse/dev/o4neHaKMlse/o4neHaKMlse_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 377 |
+
parse/dev/QJb1-8NH2Ux/QJb1-8NH2Ux_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 378 |
+
parse/dev/G5RwHpBUv0/G5RwHpBUv0_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 379 |
+
parse/dev/EJka_dVXEcr/EJka_dVXEcr_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 380 |
+
parse/dev/QJb1-8NH2Ux/QJb1-8NH2Ux_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 381 |
+
parse/dev/3tbTw2ga8K/3tbTw2ga8K_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 382 |
+
parse/dev/G5RwHpBUv0/G5RwHpBUv0_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 383 |
+
parse/dev/s1FjXzJ0jy/s1FjXzJ0jy_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 384 |
+
parse/dev/Y4cs1Z3HnqL/Y4cs1Z3HnqL_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 385 |
+
parse/dev/qHrADgAdYu/qHrADgAdYu_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 386 |
+
parse/dev/K48UYo0glaJ/K48UYo0glaJ_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 387 |
+
parse/dev/e1u9PVnwNr/e1u9PVnwNr_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 388 |
+
parse/dev/SrC-nwieGJ/SrC-nwieGJ_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 389 |
+
parse/dev/K48UYo0glaJ/K48UYo0glaJ_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 390 |
+
parse/dev/SrC-nwieGJ/SrC-nwieGJ_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 391 |
+
parse/dev/0RTJcuvHtIu/0RTJcuvHtIu_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 392 |
+
parse/dev/0RTJcuvHtIu/0RTJcuvHtIu_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 393 |
+
parse/dev/7YTh6S8HIY/7YTh6S8HIY_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 394 |
+
parse/dev/Y4cs1Z3HnqL/Y4cs1Z3HnqL_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 395 |
+
parse/dev/Y4cs1Z3HnqL/Y4cs1Z3HnqL_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 396 |
+
parse/dev/PlKWVd2yBkY/PlKWVd2yBkY_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 397 |
+
parse/dev/SrC-nwieGJ/SrC-nwieGJ_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 398 |
+
parse/dev/K48UYo0glaJ/K48UYo0glaJ_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 399 |
+
parse/dev/uLYc4L3C81A/uLYc4L3C81A_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 400 |
+
parse/dev/UDqHhbqYJV/UDqHhbqYJV_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 401 |
+
parse/dev/uLYc4L3C81A/uLYc4L3C81A_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 402 |
+
parse/dev/0RTJcuvHtIu/0RTJcuvHtIu_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 403 |
+
parse/dev/bMYU8_qD8PW/bMYU8_qD8PW_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 404 |
+
parse/dev/bMYU8_qD8PW/bMYU8_qD8PW_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 405 |
+
parse/dev/UDqHhbqYJV/UDqHhbqYJV_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 406 |
+
parse/dev/PlKWVd2yBkY/PlKWVd2yBkY_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 407 |
+
parse/dev/UDqHhbqYJV/UDqHhbqYJV_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 408 |
+
parse/dev/bMYU8_qD8PW/bMYU8_qD8PW_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 409 |
+
parse/dev/k9bx1EfHI_-/k9bx1EfHI_-_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 410 |
+
parse/dev/PlKWVd2yBkY/PlKWVd2yBkY_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 411 |
+
parse/dev/cpDhcsEDC2/cpDhcsEDC2_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 412 |
+
parse/dev/uLYc4L3C81A/uLYc4L3C81A_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 413 |
+
parse/dev/k9bx1EfHI_-/k9bx1EfHI_-_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 414 |
+
parse/dev/cpDhcsEDC2/cpDhcsEDC2_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 415 |
+
parse/dev/SwIp410B6aQ/SwIp410B6aQ_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 416 |
+
parse/dev/MWoZh1gvbxA/MWoZh1gvbxA_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 417 |
+
parse/dev/AyajSjTAzmg/AyajSjTAzmg_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 418 |
+
parse/dev/cpDhcsEDC2/cpDhcsEDC2_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 419 |
+
parse/dev/SwIp410B6aQ/SwIp410B6aQ_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 420 |
+
parse/dev/MWoZh1gvbxA/MWoZh1gvbxA_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 421 |
+
parse/dev/k9bx1EfHI_-/k9bx1EfHI_-_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 422 |
+
parse/dev/SwIp410B6aQ/SwIp410B6aQ_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 423 |
+
parse/dev/pkh8bwJbUbL/pkh8bwJbUbL_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 424 |
+
parse/dev/K10zWxlEGI/K10zWxlEGI_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 425 |
+
parse/dev/MWoZh1gvbxA/MWoZh1gvbxA_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 426 |
+
parse/dev/pkh8bwJbUbL/pkh8bwJbUbL_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 427 |
+
parse/dev/pkh8bwJbUbL/pkh8bwJbUbL_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 428 |
+
parse/dev/AyajSjTAzmg/AyajSjTAzmg_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 429 |
+
parse/dev/AyajSjTAzmg/AyajSjTAzmg_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 430 |
+
parse/dev/VnAwNNJiwDb/VnAwNNJiwDb_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 431 |
+
parse/dev/QJb1-8NH2Ux/QJb1-8NH2Ux_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 432 |
+
parse/dev/EJka_dVXEcr/EJka_dVXEcr_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 433 |
+
parse/dev/G5RwHpBUv0/G5RwHpBUv0_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 434 |
+
parse/dev/EJka_dVXEcr/EJka_dVXEcr_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 435 |
+
parse/dev/OnD9zGAGT0k/OnD9zGAGT0k_layout.pdf filter=lfs diff=lfs merge=lfs -text
|
| 436 |
+
parse/dev/OnD9zGAGT0k/OnD9zGAGT0k_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 437 |
+
parse/dev/OnD9zGAGT0k/OnD9zGAGT0k_span.pdf filter=lfs diff=lfs merge=lfs -text
|
| 438 |
+
parse/dev/3tbTw2ga8K/3tbTw2ga8K_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 439 |
+
parse/dev/VnAwNNJiwDb/VnAwNNJiwDb_span.pdf filter=lfs diff=lfs merge=lfs -text
|
md/test/3mXJ9o2DNx/3mXJ9o2DNx.md
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONNECTING DOMAINS AND CONTRASTING SAMPLES: A LADDER FOR DOMAIN GENERALIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Distribution shifts between training and testing datasets, contrary to classical machine learning assumptions, frequently occur in practice and impede model generalization performance. Studies on domain generalization (DG) thereby arise, aiming to predict the label on unseen target domain data by only using data from source domains. In the meanwhile, the contrastive learning (CL) technique, which prevails in self-supervised pre-training, can align different augmentation of samples to obtain invariant representation. It is intuitive to consider the class-separated representations learned in CL are able to improve domain generalization, while the reality is quite the opposite: people observe directly applying CL deteriorates the performance. We analyze the phenomenon with the CL theory and discover the lack of intra-class connectivity in the DG setting causes the deficiency. Thus we propose domain-connecting contrastive learning (DCCL) to enhance the conceptual connectivity across domains and obtain generalizable representations for DG. Specifically, more aggressive data augmentation and cross-domain positive samples are introduced into self-contrastive learning to improve intra-class connectivity. Furthermore, to better embed the unseen test domains, we propose model anchoring to exploit the intra-class connectivity in pre-trained representations and complement it with generative transformation loss. Extensive experiments on five standard DG benchmarks are provided. The results verify that DCCL outperforms state-of-the-art baselines even without domain supervision.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Neural networks have achieved great progress in various vision applications, such as visual recognition (He et al., 2016), object detection (Tan et al., 2020), semantic segmentation (Cheng et al., 2021), pose estimation (Sun et al., 2019), etc. Despite the immense success, existing approaches for representation learning typically assume that training and testing data are independently sampled from the identical distribution. However, in real-world scenarios, this assumption does not necessarily hold. In image recognition, for example, distribution shifts w.r.t. geographic location (Beery et al., 2018) and image background (Fang et al., 2013) frequently occur and impede the generalization performance of models.
|
| 12 |
+
|
| 13 |
+
Accordingly, domain generalization (DG) (Gulrajani & Lopez-Paz, 2020) is widely studied to strengthen the transferability of deep learning models. Different from domain adaptation (DA) (You et al., 2019; Tzeng et al., 2017) where unlabeled or partially labeled data in target domains are available during training, in a DG task we can only resort to source domains. A natural idea for DG is to learn invariant representation across a variety of seen domains so as to benefit the classification of unobserved testing domain samples. As a powerful representation learning technique, contrastive learning (CL) (Chen et al., 2020) aims to obtain class-separated representations and has the potential for DG (Yao et al., 2022). In this paper, however, we observe that the widely deployed self-contrastive learning (SCL) (Chen et al., 2020; He et al., 2020; Grill et al., 2020), which aligns the augmentation of the same input, does not naturally fit the domain generalization setting: it implicitly assumes the capability to sample instances from the whole data distribution.
|
| 14 |
+
|
| 15 |
+
To bridge this gap, we propose domain-connecting contrastive learning (DCCL) to pursue transferable representations in DG, whose core insight comes from a novel understanding of CL attributing the success of CL to the intra-class representation connectivity (Wang et al., 2022b). Specifically, we first suggest two direct approaches to improve intra-class connectivity (to be fully explained at the beginning of Section 2) within CL: (i) applying more aggressive data augmentation and (ii) expanding the scope of positive samples from self-augmented outputs to the augmentation of same-class samples across domains. In addition to the direct approaches, we have an interesting observation that the pre-trained models, unlike the learned maps, indeed possess the desired intra-class connectivity: the intra-class samples of the training domains and the testing domains are scattered but well-connected. The encouraging observation motivates us to anchor learned maps to the pre-trained model and further complement it with a generative transformation loss for stronger intra-class connectivity. As a visual illustration, Figure 1 demonstrates the embeddings learned by regular Empirical Risk Minimization (ERM) and by the proposed DCCL. ERM embeds the data in a more scattered distribution, and many samples in the central region cannot be distinguished; on the other hand, DCCL can well cluster and separate inter-class samples regardless of the domains. It verifies the effectiveness of our proposed DCCL on connecting domains.
|
| 16 |
+
|
| 17 |
+
Our contributions are summarized as follows: (i) We analyze the failure of self-contrastive learning on DG and propose two effective strategies to improve intra-class connectivity within CL. (ii) We propose to anchor learned maps to pre-trained models which possess the desired connectivity of training and testing domains. Generative transformation loss is further introduced to complement the alignment in between.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Visualization for ERM and DCCL on PACS. Intra-class points have the same colors, and two marker types differentiate the training and testing domains. Our proposed method better bridges the intra-class samples across domains than ERM.
|
| 21 |
+
|
| 22 |
+
(iii) We conduct extensive experiments on five real-world DG benchmarks with various settings, demonstrating the effectiveness and rationality of DCCL.
|
| 23 |
+
|
| 24 |
+
# 2 PRELIMINARIES
|
| 25 |
+
|
| 26 |
+
We first illustrate the core concept of the paper, intra-class connectivity. It refers to the intra-class data connectivity across different domains and resembles the connectivity in CL theory (Wang et al., 2022b), which depicts the preference that samples should not be isolated from other intra-class data of the same class 1. In the remainder of this section, we introduce problem formulation and necessary preliminaries for contrastive learning in this section. A thorough review of related work on domain generalization and contrastive learning are deferred to Appendix B due to space limit.
|
| 27 |
+
|
| 28 |
+
# 2.1 DATA IN THE DOMAIN GENERALIZATION SETTING
|
| 29 |
+
|
| 30 |
+
Given $N$ observations (from $M$ domains), $\mathbf { X } \ = \ \left\{ x _ { 1 } , \ldots , x _ { N } \right\} \ \subseteq \ { \mathcal { X } }$ is the collection of input features, $\mathbf { Y } ~ = ~ \{ y _ { 1 } , . . . , y _ { N } \} ~ \subseteq ~ { \mathcal { Y } }$ represents the prediction targets, and the whole dataset $D _ { s }$ is represented as $\{ ( x _ { i } ^ { m } , y _ { i } ^ { m } ) _ { i = 1 } ^ { N _ { m } } \} _ { m = 1 } ^ { M }$ , where m $N _ { m }$ is the number of samples $\textstyle ( \sum _ { m = 1 } ^ { M } N _ { m } = N )$ in the domain and $x _ { i }$ is re-indexed as accordingly.
|
| 31 |
+
|
| 32 |
+
The goal of this paper is to train a generalizable classification model from partial domains in $D _ { s }$ , which has satisfactory performance even on the unseen domains in evaluation. We also follow the specific settings in Cha et al. (2021; 2022); Chen et al. (2022) where only the feature vector $x _ { i } \in \mathbf { X }$ and the label $y _ { i } \in \textbf { Y }$ are observable, while the domain identifier $d _ { m } \in \mathbf { D }$ cannot be explicitly utilized due to the expensive cost.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: The overall framework of DCCL. The green dotted arrows indicate the two representations form a positive pair and the red ones connect the negative pairs. $a ( \cdot )$ is an augmentation operation. Three key parts in DCCL are (i) cross-domain contrast to bridge the intra-class samples across domains; (ii) pre-trained model anchoring to further possess the intra-class connectivity; (iii) generative transformation to complement the pre-trained representation alignment.
|
| 36 |
+
|
| 37 |
+
# 2.2 CONTRASTIVE LEARNING
|
| 38 |
+
|
| 39 |
+
Contrastive Learning (CL) enforces the closeness of augmentation from the same input, compared to other inputs in the representation space. The main components of CL, as summarized in Chen et al. (2020); He et al. (2020), include: (i) data augmentation for contrastive views, (ii) a representation map $f$ as the data encoder: $\mathcal { X } \widetilde { \mathbb { R } } ^ { d }$ , (iii) projection head $h ( \cdot )$ for expressive representation, and (iv) contrastive loss for optimization. Given an instance from $\mathbf { X }$ , we draw a positive pair $x , x ^ { + }$ by applying a random data augmentation $a \sim A$ , where $\mathcal { A }$ is the pre-specified distribution of random data augmentation maps. As a contrastive concept to positive samples, a negative pool $\mathcal { N } _ { x }$ is the set of augmented samples randomly drawn from the whole dataset $\mathbf { X }$ . To ease the construction of the CL loss, we denote $p ( x )$ as the distribution of $x$ , $p \left( x , x ^ { + } \right)$ as the corresponding joint distribution of the positive pairs, and $p _ { n } ( x _ { i } ^ { - } )$ (“n” is shorthand for “negative”) as the distribution for $x _ { i } ^ { - } \in \mathcal { N } _ { x }$ , which are all independent and identically distributed (i.i.d.). Let $z$ denote the normalized outputs of input feature $x$ through $f _ { h } : = ( h \circ f ) ( \cdot )$ . Consequently, $z ^ { + } = f _ { h } ( x ^ { + } )$ is the positive embedding of $z = f _ { h } ( x )$ , and $z _ { i } { } ^ { - } = f _ { h } ( x _ { i } ^ { - } )$ represents the embedding of the samples in the negative pool $\mathcal { N } _ { x }$ .
|
| 40 |
+
|
| 41 |
+
The most common form of the CL loss $( \mathcal { L } _ { \mathrm { C L } } )$ adapts the earlier InfoNCE loss (Oord et al., 2018) and is formulated as:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\mathcal { L } _ { \mathrm { C L } } = \underset { p ( x , x ^ { + } ) } { \mathbb { E } } \left[ - \log \frac { \exp { ( z \cdot z ^ { + } / \tau ) } } { i \in [ | \mathcal { N } _ { x } | ] } \right]
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\tau > 0$ is the temperature parameter. The minimization of the CL loss contributes to learning an embedding space where samples from the positive pair are pulled closer and samples of the negative pair are pushed apart. However, the CL loss is typically used in the unsupervised pretraining (Chen et al., 2020; He et al., 2020; Grill et al., 2020) setting. To adapt it to domain generalization (Yao et al., 2022; Chen et al., 2022; Kim et al., 2021), the full model is also required to learn from supervised signals. Thus, it is intuitive to combine the CL loss with the empirical risk minimization (ERM) loss $\mathcal { L } _ { \mathrm { E R M } }$ as the following objective:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathcal { L } = \mathcal { L } _ { \mathrm { E R M } } + \lambda \mathcal { L } _ { \mathrm { C L } }
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\lambda$ is the regularization parameter. In practice, $\mathcal { L } _ { \mathrm { E R M } }$ is usually chosen as the softmax cross entropy loss to classify the output embedding $z$ ; we follow the classical setting (as well as the previous studies) in this paper. We note that contrastive learning is only performed during training to regularize the learned representations.
|
| 54 |
+
|
| 55 |
+
# 3 PROPOSED METHODOLOGY
|
| 56 |
+
|
| 57 |
+
We will shortly revisit the recent theoretical understanding of CL (Wang et al., 2022b), and show how the implications from CL theory motivate the design of DCCL for domain generalization.
|
| 58 |
+
|
| 59 |
+
# 3.1 IMPLICATIONS FROM CONTRASTIVE LEARNING THEORY
|
| 60 |
+
|
| 61 |
+
We take a recent study on contrastive learning (Wang et al., 2022b) as the main tool to analyze the failure of self-contrastive learning in the previous subsection. Their analysis shows the ERM loss (the pure classification loss) is mainly impacted by the intra-class conditional variance of the learned representation, and the usage of CL can help reduce the intra-class conditional variance, thus controlling the ERM loss.
|
| 62 |
+
|
| 63 |
+
The magic comes from the intra-class data connectivity enforced by CL. In applying CL, proper data augmentation can help “connect” two different samples $x _ { i } , x _ { j }$ within the same class, which technically means there exists a pair of augmentation maps $a _ { i } , a _ { j }$ so that $a _ { i } ( x _ { i } ) , a _ { j } ( x _ { j } )$ are close to each other. As pushed in optimizing the CL loss (1), the ultimate representations $f _ { h } ( x _ { i } ) , f _ { h } ( x _ { j } )$ will finally be close since
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
f _ { h } ( x _ { i } ) \approx f _ { h } \left( a _ { i } ( x _ { i } ) \right) \approx f _ { h } \left( a _ { j } ( x _ { j } ) \right) \approx f _ { h } ( x _ { j } ) .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
In other words, as a ladder, $a _ { i } ( x _ { i } ) , a _ { j } ( x _ { j } )$ connect the two samples $x _ { i } , x _ { j }$ , and analogously all the samples within the same class will be connected by proper data augmentation. CL later on pushes their new representations to cluster thanks to the CL loss.
|
| 70 |
+
|
| 71 |
+
To illustrate the statement above, we construct a toy classification task in Appendix C, where data augmentation is removed. SCL in this example fails to obtain intra-class connectivity due to insufficient data augmentation and domain-separated (rather than class-separated) representations, which ultimately causes poor classification performance. We further remark a similar idea of leveraging the sample similarities in the same class has been studied by Arjovsky et al. (2019, invariant risk minimization), while the CL theory removes the limitation that the marginal distribution on source domains should be the same on target domains, and thus is theoretically more applicable to DG.
|
| 72 |
+
|
| 73 |
+
# 3.2 MORE AGGRESSIVE DATA AUGMENTATION AND CROSS-DOMAIN POSITIVE SAMPLES
|
| 74 |
+
|
| 75 |
+
Inspired by the theoretical analysis above, in this subsection we propose two direct approaches to improve intra-class connectivity: (i) applying more aggressive data augmentation and (ii) expanding the scope of positive samples, from solely self-augmented outputs $a ( x )$ to the augmentation of intraclass samples across domains.
|
| 76 |
+
|
| 77 |
+
For the first approach, in spite of the fact that data augmentation in DG (such as horizontal flipping and color jittering) has already been a standard regularization technique (Gulrajani & Lopez-Paz, 2020; Cha et al., 2021; Wang et al., 2022a), the choice of data augmentation, we emphasize, matters for contrastive learning in the domain generalization setting. We naturally need a larger augmentation distribution $\mathcal { A }$ to connect $a _ { i } ( x _ { i } )$ and $a _ { j } ( x _ { j } )$ since $x _ { i } , x _ { j }$ can be drawn from different domains. As ablation studies, the effect of data augmentation intensity is evaluated in Section 4.3.
|
| 78 |
+
|
| 79 |
+
Motivated by supervised CL (Khosla et al., 2020; Gunel et al., 2020; Cui et al., 2021), we further introduce cross-domain positive pairs into contrastive learning to bridge the intra-class samples scattered in different domains. Specifically, we not only consider the correlated views of the same data sample as positive pairs but also the augmented instances from other intra-class samples across domains. The positive sample $x ^ { + }$ will now be conditionally independent of $x$ , and the positive pairs have the same conditional distribution $p ^ { ( 1 ) } ( x ^ { + } | y ) = p ( \dot { x } | y )$ 2 (the specific distribution of the positive sample $x ^ { + }$ in this subsection will be denoted with a superscript (1)); in other words, $x ^ { + }$ can now be the augmentation view of a random sample within the same class $y$ of $x$ . With the joint distribution of $x , x ^ { + }$ denoted as $\begin{array} { r } { p ^ { ( 1 ) } ( x , x ^ { + } ) = \int _ { y } p ^ { ( 1 ) } ( x ^ { + } | y ) p ( x | y ) p ( y ) \mathrm { d } y , } \end{array}$ , the primal domainconnecting contrastive learning (DCCL) objective $\mathcal { L } _ { \mathrm { D C C L } } ^ { ( 0 ) }$ can be formulated as:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathcal { L } _ { \mathrm { { D C C L } } } ^ { ( 0 ) } = \underset { p ^ { ( 1 ) } ( x , x ^ { + } ) } { \mathbb { E } } \left[ - \log \frac { \exp \left( z \cdot z ^ { + } / \tau \right) } { i \in [ | \mathcal { N } _ { x } | ] } \right] .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Without the explicit use of domain information, $- \log \exp { ( z \cdot z ^ { + } / \tau ) }$ , the term corresponding to alignment in loss (3), can now push the intra-class samples from different domains together.
|
| 86 |
+
|
| 87 |
+
# 3.3 ANCHORING LEARNED MAPS TO PRE-TRAINED MODELS
|
| 88 |
+
|
| 89 |
+
Up to now, we have not addressed the core difficulty in domain generalization—lack of access to the testing domains in training: CL is originally designed for the self-supervised scenario where a huge amount and wide range of data are fed to the models. However, in the context of domain generalization, the model is just fine-tuned on limited data within partial domains. Consequently, the mechanism of CL can only contribute to the clustering of representations in the seen domains, while the embeddings of the unseen testing domains and the ones of the training domains in the same class may still be separated.
|
| 90 |
+
|
| 91 |
+
Interestingly, the intra-class connectivity for representations, the desired property in CL, seems to exist at the beginning of the fine-tuning. We observe the phenomenon when visualizing the representations obtained from the pre-trained model using t-SNE (Van der Maaten & Hinton, 2008) in Figure 4a, which thereby motivates our design in this subsection. We can find that mapped by the initial pre-trained model ResNet-50, intra-class samples of the training domains and the testing domains are scattered while well-connected.
|
| 92 |
+
|
| 93 |
+
We attribute the phenomenon to the effective representations returned by pre-trained model, which reasonably model the pairwise interactions among images and thus draw target domains closer to source domains. To verify the effectiveness of the representations, we design a quantitative metric to evaluate whether the pre-trained space is “well-connected”, by turning to the concept of “connectivity” in graphs. Details can be found in Appendix A.4.
|
| 94 |
+
|
| 95 |
+
As for the model design, the phenomenon motivates us to better utilize the pre-trained model $f _ { \mathrm { p r e } }$ for stronger intra-class connectivity in the mapped representations obtained from $f$ . We propose to take the usage of pre-trained models as data augmentation in a disguised form: regular data augmentation works on the raw data and return $x$ while we can further “augment” the representation $x$ via $f _ { \mathrm { p r e } }$ .
|
| 96 |
+
|
| 97 |
+
In mathematical language, we descibe our design as follows. Upon the augmented sample $x$ defined in the last subsection, we further incorporate the pre-trained embedding $z _ { \mathrm { p r e } } = h \circ f _ { \mathrm { p r e } } ( x )$ into the definition of feasible positive embeddings $z ^ { ( 2 ) , + }$ , which expands the scope of the previous positive embeddings $z ^ { + }$ (the superscript (2) implies the different distribution compared to $z ^ { + }$ in the last subsection). In particular, for a given $x$ , we decide the form of the newly coined positive embedding $z ^ { ( 2 ) , + }$ as:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
z ^ { ( 2 ) , + } = \left\{ \begin{array} { l l } { { z ^ { + } = h \circ f ( x ^ { + } ) , } } & { { \mathrm { w . p . ~ } \frac { 1 } { 2 } , } } \\ { { z _ { \mathrm { p r e } } = h \circ f _ { \mathrm { p r e } } ( x ) , } } & { { \mathrm { w . p . ~ } \frac { 1 } { 2 } . } } \end{array} \right.
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
With the distribution of the extended positive embedding denoted as $p ^ { ( 2 ) } \left( z ^ { ( 2 ) , + } \right)$ (the positive pairs $x , x ^ { + }$ still follow $p ^ { ( 1 ) } ( x , x ^ { + } ) )$ , the proposed DCCL loss $\mathcal { L } _ { \mathrm { { D C C L } } }$ can be written as:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathcal { L } _ { \mathrm { { D C C L } } } = \underset { p ^ { ( 2 ) } \left( z , z ^ { ( 2 ) , + } \right) } { \mathbb { E } } \left[ - \log \frac { \exp \left( z \cdot z ^ { ( 2 ) , + } / \tau \right) } { i \in [ | \mathcal { N } _ { x } | ] } \right] ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $p ^ { ( 2 ) } \left( z , z ^ { ( 2 ) , + } \right)$ is the joint distribution of $z , z ^ { ( 2 ) , + }$ constructed in this subsection.
|
| 110 |
+
|
| 111 |
+
# 3.4 GENERATIVE TRANSFORMATION LOSS FOR PRE-TRAINED REPRESENTATION
|
| 112 |
+
|
| 113 |
+
In the previous section, our proposed contrastive learning method manages to mine the supervised signal at the inter-sample level, where we align the positive pairs (composed of different samples) while pushing apart the samples in a negative pool.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 3: An overview of the generative transformation module in DCCL. Two representations $z _ { p r e }$ and $z$ of the same image are generated via the pre-trained and the finetuned model respectively. The variational reconstruction is conducted to encode essential within-sample information.
|
| 117 |
+
|
| 118 |
+
Echoing the findings in (Yao et al., 2022), which point out that directly aligning positive pairs across vastly different domains often results in poor performance, our research similarly identifies a substantial gap in the representations of pre-trained and finetuned models. Direct alignment using contrastive learning as evidenced by our empirical evaluation, tends to be sub-optimal. In response, we introduce the concept of variational generative loss to comprehend the transformation process and bridge these representational gaps. Additionally, the generative transformation module is designed to reconstruct the features of the pre-trained model at an intra-sample level. This complements the inter-sample level supervision provided by contrastive loss. The module, along with its associated loss function, is intended to provide a more enriched supervised signal, encapsulating crucial within-sample information. Th module, in turn, supports as a pivotal proxy objective that facilitates model anchoring 3.3.
|
| 119 |
+
|
| 120 |
+
To simplify the notation of the transformation, we abuse the previous notations $\{ z , z _ { \mathrm { p r e } } \}$ for the output embedding from a certain learned/pre-trained model layer, omitting the corresponding layer denotation. $z _ { \mathrm { p r e } }$ is the fixed supervised signal provided by the pre-trained model.
|
| 121 |
+
|
| 122 |
+
With the notation $\{ z , z _ { \mathrm { p r e } } \}$ , we introduce the following variational generative model to parameterize the map $g : z \mapsto z _ { \mathrm { p r e } }$ relating the representation manifolds formed by (the first several layers of) the learned map $f$ and the fixed pre-trained model $f _ { \mathrm { p r e } }$ . In particular, $g$ is composed of an encoder $\phi$ modeling a tunable conditional distribution $q _ { \phi } \left( z _ { \mathrm { l a t } } \ | \ z \right)$ of $z _ { \mathrm { l a t } }$ and a tunable decoder $\psi$ mapping $z _ { \mathrm { l a t } }$ back to $z _ { \mathrm { p r e } }$ , in which $z _ { \mathrm { l a t } } \in \mathbb { R } ^ { d ^ { \prime } }$ is the latent representation of the generator. Similar to the training of a regular variational autoencoder (VAE) (Kingma et al., 2019), the latent variable $z _ { \mathrm { l a t } }$ will be sampled from $q _ { \phi } \left( z _ { \mathrm { l a t } } \mid z \right)$ ; we can then project $z _ { \mathrm { l a t } }$ to the pre-trained embedding space via decoder $\psi$ . Our variational reconstruction loss $\mathcal { L } _ { \mathrm { D C C L } } ^ { \mathrm { G e n } }$ is designed as:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\mathcal { L } _ { \mathtt { D C C L } } ^ { \mathtt { G e n } } = - \mathbb { E } _ { q _ { \phi } ( z _ { \mathrm { l a t } } \mid z ) } \left[ \log p _ { \psi } \left( z _ { \mathtt { p r e } } \mid z _ { \mathtt { l a t } } \right) \right] + \mathrm { K L } \left[ q _ { \phi } \left( z _ { \mathtt { l a t } } \mid z \right) \parallel p \left( z _ { \mathtt { l a t } } \right) \right] ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $p \left( z _ { \mathrm { l a t } } \right)$ is the pre-specified prior distribution of $z _ { \mathrm { l a t } }$ , $p _ { \psi }$ $\left( z _ { \mathrm { p r e } } \mid z _ { \mathrm { l a t } } \right)$ is decided by the “reconstruction loss” $\| z _ { \mathrm { p r e } } - \psi \left( z _ { \mathrm { l a t } } \right) \| ^ { 2 }$ , and the $\mathrm { K L }$ divergence term corresponds to the variational regularization term to avoid mode collapse. The workflow of our proposed generative transformation is shown in Figure 3.
|
| 129 |
+
|
| 130 |
+
Finally, to benefit the representation learning through both generative transformation and our improved contrastive leaning, we set our ultimate objective as:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { r } { \mathcal { L } = \mathcal { L } _ { \mathrm { E R M } } + \lambda \mathcal { L } _ { \mathrm { D C C L } } + \beta \mathcal { L } _ { \mathrm { D C C L } } ^ { \mathrm { G e n } } } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where $\lambda$ and $\beta$ are coefficients to balance the multi-task loss. The ablation studies in Section 4.3 verify the effectiveness of each component.
|
| 137 |
+
|
| 138 |
+
# 4 EXPERIMENTS
|
| 139 |
+
|
| 140 |
+
In this section, we empirically evaluate the performance of our proposed DCCL, intending to answer the following research questions:
|
| 141 |
+
|
| 142 |
+
• RQ1: Does DCCL enable networks to learn transferable representation under distribution shifts?
|
| 143 |
+
• RQ2: How do different components in our framework contribute to the performance?
|
| 144 |
+
• RQ3: How good is the generalizability of our proposed DCCL under different circumstances (e.g.,
|
| 145 |
+
varying label ratios and backbones)?
|
| 146 |
+
• RQ4: Does DCCL really connect the cross-domain representations?
|
| 147 |
+
|
| 148 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 149 |
+
|
| 150 |
+
We exhaustively evaluate out-of-domain (OOD) accuracy of DCCL on various representative DG benchmarks as in Cha et al. (2021); Yao et al. (2022); Cha et al. (2022); Chen et al. (2022): Office
|
| 151 |
+
|
| 152 |
+
Table 1: Experimental comparisons with state-of-the-art methods on benchmarks with ResNet-50. (The tables are re-scaled due to space limit.)
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Algorithm</td><td>A</td><td>C</td><td>P</td><td>S</td><td>Avg.</td></tr><tr><td>IRM(Arjovsky et al.,2019)</td><td>84.8</td><td>76.4</td><td>96.7</td><td>76.1</td><td>83.5</td></tr><tr><td>MetaReg (Balaji et al., 2018)</td><td>87.2</td><td>79.2</td><td>97.6</td><td>70.3</td><td>83.6</td></tr><tr><td>DANN (Ganin et al.,2016)</td><td>86.4</td><td>77.4</td><td>97.3</td><td>73.5</td><td>83.7</td></tr><tr><td>ERM(Vapnik,1999)</td><td>85.7</td><td>77.1</td><td>97.4</td><td>76.6</td><td>84.2</td></tr><tr><td>GroupDRO (Ganin et al., 2016)</td><td>83.5</td><td>79.1</td><td>96.7</td><td>78.3</td><td>84.4</td></tr><tr><td>MTL (Blanchard et al., 2021)</td><td>87.5</td><td>77.1</td><td>96.4</td><td>77.3</td><td>84.6</td></tr><tr><td>I-Mixup (Xu et al.,2020)</td><td>86.1</td><td>78.9</td><td>97.6</td><td>75.8</td><td>84.6</td></tr><tr><td>MMD (Li et al.,2018b)</td><td>86.1</td><td>79.4</td><td>96.6</td><td>76.5</td><td>84.7</td></tr><tr><td>VREx (Krueger et al., 2021)</td><td>86.0</td><td>79.1</td><td>96.9</td><td>77.7</td><td>84.9</td></tr><tr><td>MLDG (Li et al., 2018a)</td><td>85.5</td><td>80.1</td><td>97.4</td><td>76.6</td><td>84.9</td></tr><tr><td>ARM (Zhang et al.,2020)</td><td>86.8</td><td>76.8</td><td>97.4</td><td>79.3</td><td>85.1</td></tr><tr><td>RSC (Huang et al., 2020)</td><td>85.4</td><td>79.7</td><td>97.6</td><td>78.2</td><td>85.2</td></tr><tr><td>Mixstyle (Zhou etal.,2021)</td><td>86.8</td><td>79.0</td><td>96.6</td><td>78.5</td><td>85.2</td></tr><tr><td>ER (Zhao et al.,2020)</td><td>87.5</td><td>79.3</td><td>98.3</td><td>76.3</td><td>85.3</td></tr><tr><td>pAdaIN (Nuriel et al., 2021)</td><td>85.8</td><td>81.1</td><td>97.2</td><td>77.4</td><td>85.4</td></tr><tr><td>SelfReg (Kim et al.,2021)</td><td>85.0</td><td>81.0</td><td>95.9</td><td>80.5</td><td>85.6</td></tr><tr><td>EISNet (Wang et al.,2020)</td><td>86.6</td><td>81.5</td><td>97.1</td><td>78.1</td><td>85.8</td></tr><tr><td>CORAL(Sun & Saenko,2016)</td><td>88.3</td><td>80.0</td><td>97.5</td><td>78.8</td><td>86.2</td></tr><tr><td>SagNet (Nam et al., 2021)</td><td>87.4</td><td>80.7</td><td>97.1</td><td>80.0</td><td>86.3</td></tr><tr><td>DSON (Seo et al., 2020)</td><td>87.0</td><td>80.6</td><td>96.0</td><td>82.9</td><td>86.6</td></tr><tr><td>COMEN (Chen et al., 2022)</td><td>88.1</td><td>82.6</td><td>97.2</td><td>81.9</td><td>87.5</td></tr><tr><td>SWAD (Cha et al., 2021)</td><td>89.3</td><td>83.4</td><td>97.3</td><td>82.5</td><td>88.1</td></tr><tr><td>MIRO (Cha et al.,2022)</td><td>89.8</td><td>83.6</td><td>98.2</td><td>82.1</td><td>88.4</td></tr><tr><td>PCL (Yao et al.,2022)</td><td>90.2</td><td>83.9</td><td>98.1</td><td>82.6</td><td>88.7</td></tr><tr><td>Ours</td><td>90.5</td><td>84.2</td><td>98.0</td><td>83.3</td><td>89.1± 0.1</td></tr></table>
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Algorithm</td><td>A</td><td>C</td><td>P</td><td>R</td><td>Avg</td></tr><tr><td>Mixstyle (Zhou et al., 2021)</td><td>51.1</td><td>53.2</td><td>68.2</td><td>69.2</td><td>60.4</td></tr><tr><td>IRM(Arjovsky et al.,219)</td><td>58.9</td><td>52.2</td><td>72.1</td><td>74.0</td><td>64.3</td></tr><tr><td>ARM(Zhang et al.,2020)</td><td>58.9</td><td>51.0</td><td>74.1</td><td>75.2</td><td>64.8</td></tr><tr><td>RSC (Huang et al.,2020)</td><td>60.7</td><td>51.4</td><td>74.8</td><td>75.1</td><td>65.5</td></tr><tr><td>CDANN (Li et al.,2018b)</td><td>61.5</td><td>50.4</td><td>74.4</td><td>76.6</td><td>65.7</td></tr><tr><td>DANN (Ganin et al., 2016)</td><td>59.9</td><td>53.0</td><td>73.6</td><td>76.9</td><td>65.9</td></tr><tr><td>GroupDRO (Ganin et al., 2016)</td><td>60.4</td><td>52.7</td><td>75.0</td><td>76.0</td><td>66.0</td></tr><tr><td>MMD (Li et al., 2018b)</td><td>60.4</td><td>53.3</td><td>74.3</td><td>77.4</td><td>66.4</td></tr><tr><td>MTL (Blanchard et al.,2021)</td><td>61.5</td><td>52.4</td><td>74.9</td><td>76.8</td><td>66.4</td></tr><tr><td>VREx (Krueger et al.,021)</td><td>60.7</td><td>53.0</td><td>75.3</td><td>76.6</td><td>66.4</td></tr><tr><td>MLDG (Li et al., 2018a)</td><td>61.5</td><td>53.2</td><td>75.0</td><td>77.5</td><td>66.8</td></tr><tr><td>ERM(Vapnik,1999)</td><td>63.1</td><td>51.9</td><td>77.2</td><td>78.1</td><td>67.6</td></tr><tr><td>SelfReg (Kim et al.,2021)</td><td>63.6</td><td>53.1</td><td>76.9</td><td>78.1</td><td>67.9</td></tr><tr><td>I-Mixup (Xu et al.,2020)</td><td>62.4</td><td>54.8</td><td>76.9</td><td>78.3</td><td>68.1</td></tr><tr><td>SagNet (Nam et al., 2021)</td><td>63.4</td><td>54.8</td><td>75.8</td><td>78.3</td><td>68.1</td></tr><tr><td>CORAL (Sun & Saenko,2016)</td><td>65.3</td><td>54.4</td><td>76.5</td><td>78.4</td><td>68.7</td></tr><tr><td>COMEN(Chen et al.,2022)</td><td>65.4</td><td>55.6</td><td>75.8</td><td>78.9</td><td>68.9</td></tr><tr><td>SWAD (Cha et al., 2021)</td><td>66.1</td><td>57.7</td><td>78.4</td><td>80.2</td><td>70.6</td></tr><tr><td>PCL (Yao et al.,2022)</td><td>67.3</td><td>59.9</td><td>78.7</td><td>80.7</td><td>71.6</td></tr><tr><td>MIRO (Cha et al., 2022)</td><td>68.8</td><td>58.1</td><td>79.9</td><td>82.6</td><td>72.4</td></tr><tr><td>Ours</td><td>70.1</td><td>59.1</td><td>81.4</td><td>83.4</td><td>73.5±0.2</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Home (Venkateswara et al., 2017), PACS (Li et al., 2017), VLCS (Fang et al., 2013), TerraIncognita (Beery et al., 2018), and DomainNet (Peng et al., 2019). The details of the data sets are shown in Appendix A.1. For fair comparison, we strictly follow the experimental settings in Gulrajani & Lopez-Paz (2020); Cha et al. (2021); Yao et al. (2022); Chen et al. (2022) and adopt the widely used leave-one-domain-out evaluation protocol, i.e., one domain is chosen as the held-out testing domain and the rest are regarded as source training domains. The experiment results are all averaged over three repeated runs. Following DomainBed (Gulrajani & Lopez-Paz, 2020), we leave $20 \%$ of source domain data for validation and model selection. As in previous works (Cha et al., 2022; Yao et al., 2022), we use the ResNet-50 model pre-trained on ImageNet by default, and our code is mainly built upon DomainBed (Gulrajani & Lopez-Paz, 2020) and SWAD (Cha et al., 2021). Due to space constraints, detailed implementation and experimental setups are shown in Appendix A.1. The limitations, attribution of existing assets, and the use of personal data are discussed in Appendix D.
|
| 159 |
+
|
| 160 |
+
# 4.2 RESULTS (RQ1)
|
| 161 |
+
|
| 162 |
+
We provide comprehensive comparisons with a set of strong baselines on the domain generalization benchmarks, PACS and OfficeHome, in Tables 1a and 1b. Detailed experimental results on TerraIncognita, VLCS, and DomainNet datasets are deferred to Appendix A.2. We observe our proposed method achieves the best performance: the metrics are 44.0 $( \mathrm { E R M } ) { } 4 7 . 0$ (Best Baseline) $ 4 7 . 5$ (Ours) on DomainNet, $7 7 . 3 \substack { } 7 9 . 6 \substack { } 8 0 . 0$ on VLCS, and $4 7 . 8 \substack { } 5 2 . 9 \substack { } 5 3 . 7$ on TerraIncognita. The results of the intermediate columns in the tables represent performance on the testing domain. For example, “A” in Table 1 denotes testing on domain Art and training on Photo, Cartoon, and Sketch. The final result is averaged over all domains. The symbol $^ +$ in the tables is used to denote that the reproduced experimental performance is clearly distinct from the reported one (such as $\mathrm { ^ { 6 6 } P C L ^ { + , } }$ in Table 4). All the baselines are sorted in ascending order of their performance.
|
| 163 |
+
|
| 164 |
+
We have the following findings from the tables. (i) We find that DCCL substantially outperforms all the baseline methods concerning OOD accuracy. This indicates the capability of DCCL to extract transferable representation for generalization under distribution shift. (ii) We notice most baselines make explicit use of domain supervision, while only a few methods such as RSC (Huang et al., 2020), SagNet (Nam et al., 2021), COMEN (Chen et al., 2022), SWAD (Cha et al., 2021), MIRO (Cha et al., 2022) and our DCCL do not. The excellent performance of our DCCL may reveal previous works do not well utilize the domain information and there is still much room for improvement. (iii) We note that PCL (Yao et al., 2022) (Proxy Contrastive Learning) has utilized the potential of CL, aligns embeddings of different samples into domain centers, and consistently achieves good performance. Meanwhile, MIRO (Cha et al., 2022) also preserves the pre-trained features by adding the mutual information regularization term and attains satisfactory performance. However, because of their deficiency to connect cross-domain representations, our method manages to improve upon the success the previous baselines had.
|
| 165 |
+
|
| 166 |
+
Table 2: Ablation Studies of DCCL on OfficeHome.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>CDC</td><td>PMA</td><td>GT</td><td>A</td><td>P</td><td>R</td><td></td><td>Avg</td></tr><tr><td colspan="3">- with Self-Contrast</td><td>66.1</td><td>57.7</td><td>78.4</td><td>80.2</td><td>70.6</td></tr><tr><td colspan="3"></td><td>65.4</td><td>51.4</td><td>79.1</td><td>79.5</td><td>68.9</td></tr><tr><td>√</td><td>-</td><td>-</td><td>68.0</td><td>57.9</td><td>80.1</td><td>81.3</td><td>71.8</td></tr><tr><td></td><td>√</td><td>-</td><td>68.8</td><td>57.8</td><td>80.4</td><td>82.3</td><td>72.3</td></tr><tr><td></td><td>-</td><td>√</td><td>69.0</td><td>56.9</td><td>80.6</td><td>81.6</td><td>72.0</td></tr><tr><td>=</td><td>√</td><td>√</td><td>70.0</td><td>58.7</td><td>80.5</td><td>83.4</td><td>73.1</td></tr><tr><td></td><td>√</td><td>-</td><td>69.2</td><td>58.5</td><td>81.0</td><td>83.0</td><td>72.9</td></tr><tr><td></td><td></td><td>√</td><td>69.0</td><td>58.5</td><td>80.7</td><td>82.1</td><td>72.6</td></tr><tr><td colspan="3">w/o Aggressive Aug</td><td>69.8</td><td>58.6</td><td>81.0</td><td>82.6</td><td>73.0</td></tr><tr><td>√</td><td><</td><td>√</td><td>70.1</td><td>59.1</td><td>81.4</td><td>83.4</td><td>73.5</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 3: Experimental comparisons of DCCL with representative baselines on OfficeHome under various label ratios.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Ratio</td><td>Algorithm</td><td>A</td><td>C</td><td>P</td><td>R</td><td>Avg.</td></tr><tr><td rowspan="6">5%</td><td>ERM(Vapnik,1999)</td><td>40.4</td><td>32.6</td><td>42.6</td><td>49.2</td><td>41.2</td></tr><tr><td>SWAD (Cha et al., 2021)</td><td>46.9</td><td>36.2</td><td>48.5</td><td>54.2</td><td>46.4</td></tr><tr><td></td><td>477</td><td></td><td></td><td></td><td>48</td></tr><tr><td>COMEN (Chen al.,1.22)</td><td></td><td></td><td>50.2</td><td>56.1</td><td></td></tr><tr><td>MIRO (Cha et al., 2022)</td><td>51.0</td><td>41.6</td><td>58.6</td><td>61.5</td><td>53.2</td></tr><tr><td>Ours</td><td>55.7</td><td>44.1</td><td>63.1</td><td>67.1</td><td>57.5 (+16.3)</td></tr><tr><td rowspan="6">10%</td><td>ERM(Vapnik,1999)</td><td>45.1</td><td>41.9</td><td>55.9</td><td>58.0</td><td>50.2</td></tr><tr><td>COMEN(Chen et al.,2022)</td><td>50.4</td><td>44.3</td><td>56.8</td><td>60.9</td><td>53.1</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SPCL (Chae t al.021)</td><td>53.3</td><td>43.9</td><td>61.9</td><td>65.2</td><td>56.1</td></tr><tr><td>MIRO (Cha et al., 2022)</td><td>58.9</td><td>46.6</td><td>68.6</td><td>71.7</td><td>61.4</td></tr><tr><td>Ours</td><td>62.5</td><td>49.2</td><td>72.3</td><td>75.1</td><td>64.8 (+14.6)</td></tr></table>
|
| 173 |
+
|
| 174 |
+
# 4.3 ABLATION STUDIES (RQ2)
|
| 175 |
+
|
| 176 |
+
In this part, we investigate the effectiveness of the proposed DCCL by evaluating the impact of different components. We denote the Cross-Domain Contrastive learning in Section 3.2 as CDC (with more aggressive data augmentation and cross-domain positive samples), Pre-trained Model Anchoring in Section 3.3 as PMA, and Generative Transformation in Section 3.4 as GT. The ablation results are summarized in Table 2. The check mark in the table indicates the module is incorporated. We note that our improved contrastive learning loss in Eqn. (4) has two components: CDC and PMA. The overall improvement of the loss is substantial: $7 0 . 6 7 2 . 9$ . From the table, we can observe that all the components are useful: when any one of these components is removed, the performance drops accordingly. For example, removing PMA module leads to significant performance degeneration, which verifies the importance of anchoring learned maps to pre-trained models. We can then find the combination of PMA and GT leads to the highest improvement in the ablation, which indicates GT and PMA modules complement each other in an effective way. The finding is also consistent with our motivation in Section 3.4. Moreover, we also evaluate self-contrastive learning. The experimental results indicate that self-contrastive learning will distort the learned embeddings and hamper performance. Besides, the experiment without aggressive data augmentation also validates the effectiveness of stronger data augmentations we suggest in Section 3.2. Additional experimental details and explanations regarding our choices for VAE structures, contrastive learning techniques within DCCL, cross-domain examples in CDC, alternative pre-trained backbones, and the Wilds Benchmark can be found in Appendix A.5.
|
| 177 |
+
|
| 178 |
+
# 4.4 CASE STUDIES
|
| 179 |
+
|
| 180 |
+
Generalization ability (RQ3). To verify the generalizability of our proposed DCCL, we conduct experiments3 with different label ratios (the percentage of labeled training data) and backbones. (i) In Table 3, we find DCCL can obtain consistent improvement over baselines, in both cases of $5 \%$ and $10 \%$ label ratios. Our method yields a 16.3 and 14.6 absolute improvement compared with
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 4: t-SNE visualization of the representations across both training and testing domains, output by Pre-trained, ERM, and SCL respectively. Same-class points are in the same colors, and two marker types differentiate the training or the testing domains. We visualize the embedding on PACS dataset where the source domains are Photo, Sketch, and Cartoon; the target domain is Art.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Algorithm</td><td>A</td><td>C</td><td>P</td><td>R</td><td>Avg.</td></tr><tr><td>ERM(Vapnik,1999)</td><td>50.6</td><td>49.0</td><td>69.9</td><td>71.4</td><td>60.2</td></tr><tr><td>SWAD (Cha et al.,2021)</td><td>54.6</td><td>50.0</td><td>71.1</td><td>72.8</td><td>62.1</td></tr><tr><td>PCL+ (Yao et al., 2022)</td><td>58.8</td><td>51.9</td><td>74.2</td><td>75.2</td><td>65.0</td></tr><tr><td>MIRO (Cha et al.,2022)</td><td>59.7</td><td>52.6</td><td>75.0</td><td>77.7</td><td>66.2</td></tr><tr><td>COMEN (Chen et al.,2022)</td><td>57.6</td><td>55.8</td><td>75.5</td><td>76.9</td><td>66.5</td></tr><tr><td>"Mismatch"</td><td>53.4</td><td>50.7</td><td>72.3</td><td>74.0</td><td>62.6</td></tr><tr><td>Ours</td><td>61.7</td><td>53.6</td><td>75.9</td><td>78.7</td><td>67.5</td></tr></table>
|
| 186 |
+
|
| 187 |
+
Table 4: Experimental comparisons of DCCL on OfficeHome with the ResNet-18 backbone in use.
|
| 188 |
+
|
| 189 |
+
ERM. We can observe that as the number of available labels reduces, the model benefits more from our DCCL (compared with previous $6 7 . 6 7 3 . 5 $ increase under $100 \%$ label ratio in Table 1b). (ii) In Table 4, we test the performance with a new backbone, ResNet-18 (previously ResNet-50)4. We find that even though the baselines’ relative ordering changes significantly, our model still performs the best, showcasing the robustness thereof. We further observe replacing the ResNet-18 pre-trained representations to the larger ResNet-50 ones (“mismatch” between the backbone used for fine-tuning and the pre-trained representations) will cause substantial performance drop $6 7 . 5 6 2 . 6$ .
|
| 190 |
+
|
| 191 |
+
Analysis of the representations in DCCL (RQ4). We analyze the representations returned by DCCL to provide more insights. In Figure 4, we utilize t-SNE (Van der Maaten & Hinton, 2008) to visualize the embeddings of the pre-trained model, ERM, and SCL model. We can observe that mapped by the original pre-trained model ResNet-50, the intra-class samples of the training domains and the testing domains are scattered while well-connected. However, in the ERM model, many samples in the testing domain are distributed in the central part of the plot, which is separated from the training samples. There is a clear gap between the training and the testing domains. As for SCL, it seems to harm the learned embedding space and distort the class decision boundary. The observations verify our conjectures in Section C.
|
| 192 |
+
|
| 193 |
+
We then visualize the embeddings of ERM, PCL, and our DCCL methods on the testing domains in Appendix A.3. Our DCCL learns discriminative representations even in the unseen target domain by enhancing intra-class connectivity in CL, which is not addressed in ERM and PCL.
|
| 194 |
+
|
| 195 |
+
# 5 CONCLUSIONS
|
| 196 |
+
|
| 197 |
+
In this paper, we revisit the role of contrastive learning in domain generalization and identify a key factor: intra-class connectivity. We analyze the failure of directly applying contrastive learning to DG and propose two strategies to improve intra-class connectivity: (i) applying more aggressive data augmentation and (ii) expanding the scope of positive samples. Moreover, to alleviate lack of access to the testing domains in training, we propose to anchor learned maps to pre-trained models which possess the desired connectivity of training and testing domains. Generative transformation is further introduced to complement the pre-trained alignment. Consequently, we combine the pieces together and propose DCCL to enable robust representations in the out-of-domain scenario. Extensive experiments on 5 real-world datasets demonstrate the effectiveness of DCCL, which outperforms a bundle of baselines.
|
| 198 |
+
|
| 199 |
+
# REFERENCES
|
| 200 |
+
|
| 201 |
+
Martin Arjovsky, Leon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. ´ arXiv preprint arXiv:1907.02893, 2019.
|
| 202 |
+
|
| 203 |
+
Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. Metareg: Towards domain generalization using meta-regularization. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montreal, Canada ´ , pp. 1006–1016, 2018.
|
| 204 |
+
Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European conference on computer vision (ECCV), pp. 456–473, 2018.
|
| 205 |
+
Gilles Blanchard, Aniket Anand Deshmukh, Urun Dogan, Gyemin Lee, and Clayton Scott. Domain ¨ generalization by marginal transfer learning. The Journal of Machine Learning Research, 22(1): 46–100, 2021.
|
| 206 |
+
Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. Advances in neural information processing systems, 33:9912–9924, 2020.
|
| 207 |
+
Junbum Cha, Sanghyuk Chun, Kyungjae Lee, Han-Cheol Cho, Seunghyun Park, Yunsung Lee, and Sungrae Park. Swad: Domain generalization by seeking flat minima. Advances in Neural Information Processing Systems, 34:22405–22418, 2021.
|
| 208 |
+
Junbum Cha, Kyungjae Lee, Sungrae Park, and Sanghyuk Chun. Domain generalization by mutualinformation regularization with pre-trained models. In ECCV, 2022.
|
| 209 |
+
Prithvijit Chattopadhyay, Yogesh Balaji, and Judy Hoffman. Learning to balance specificity and invariance for in and out of domain generalization. In European Conference on Computer Vision, pp. 301–318. Springer, 2020.
|
| 210 |
+
Chaoqi Chen, Jiongcheng Li, Xiaoguang Han, Xiaoqing Liu, and Yizhou Yu. Compound domain generalization via meta-knowledge encoding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7119–7129, 2022.
|
| 211 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 1597–1607. PMLR, 2020.
|
| 212 |
+
Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15750–15758, 2021.
|
| 213 |
+
Bowen Cheng, Alex Schwing, and Alexander Kirillov. Per-pixel classification is not all you need for semantic segmentation. Advances in Neural Information Processing Systems, 34:17864–17875, 2021.
|
| 214 |
+
Xu Chu, Yujie Jin, Wenwu Zhu, Yasha Wang, Xin Wang, Shanghang Zhang, and Hong Mei. Dna: Domain generalization with diversified neural averaging. In International Conference on Machine Learning, pp. 4010–4034. PMLR, 2022.
|
| 215 |
+
Jiequan Cui, Zhisheng Zhong, Shu Liu, Bei Yu, and Jiaya Jia. Parametric contrastive learning. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 715–724, 2021.
|
| 216 |
+
Babak Esmaeili, Hao Wu, Sarthak Jain, Alican Bozkurt, Narayanaswamy Siddharth, Brooks Paige, Dana H Brooks, Jennifer Dy, and Jan-Willem Meent. Structured disentangled representations. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 2525–2534. PMLR, 2019.
|
| 217 |
+
Chen Fang, Ye Xu, and Daniel N. Rockmore. Unbiased metric learning: On the utilization of multiple datasets and web images for softening bias. In IEEE International Conference on Computer Vision, ICCV 2013, Sydney, Australia, December 1-8, 2013, pp. 1657–1664. IEEE Computer Society, 2013.
|
| 218 |
+
|
| 219 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pp. 1126–1135. PMLR, 2017.
|
| 220 |
+
|
| 221 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096–2030, 2016.
|
| 222 |
+
Tianyu Gao, Xingcheng Yao, and Danqi Chen. Simcse: Simple contrastive learning of sentence embeddings. arXiv preprint arXiv:2104.08821, 2021.
|
| 223 |
+
Jean-Bastien Grill, Florian Strub, Florent Altche, Corentin Tallec, Pierre H. Richemond, Elena ´ Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, ´ Bilal Piot, Koray Kavukcuoglu, Remi Munos, and Michal Valko. Bootstrap your own latent - A ´ new approach to self-supervised learning. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 224 |
+
Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020.
|
| 225 |
+
Beliz Gunel, Jingfei Du, Alexis Conneau, and Ves Stoyanov. Supervised contrastive learning for pre-trained language model fine-tuning. arXiv preprint arXiv:2011.01403, 2020.
|
| 226 |
+
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.
|
| 227 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pp. 9726–9735. IEEE, 2020.
|
| 228 |
+
R. Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
|
| 229 |
+
Huaibo Huang, Ran He, Zhenan Sun, Tieniu Tan, et al. Introvae: Introspective variational autoencoders for photographic image synthesis. Advances in neural information processing systems, 31, 2018.
|
| 230 |
+
Zeyi Huang, Haohan Wang, Eric P Xing, and Dong Huang. Self-challenging improves cross-domain generalization. In European Conference on Computer Vision, pp. 124–140. Springer, 2020.
|
| 231 |
+
Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 232 |
+
Daehee Kim, Youngjun Yoo, Seunghyun Park, Jinkyu Kim, and Jaekoo Lee. Selfreg: Selfsupervised contrastive regularization for domain generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9619–9628, 2021.
|
| 233 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
|
| 234 |
+
Diederik P Kingma, Max Welling, et al. An introduction to variational autoencoders. Foundations and Trends® in Machine Learning, 12(4):307–392, 2019.
|
| 235 |
+
David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). In International Conference on Machine Learning, pp. 5815–5826. PMLR, 2021.
|
| 236 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M. Hospedales. Deeper, broader and artier domain generalization. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 5543–5551. IEEE Computer Society, 2017.
|
| 237 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M. Hospedales. Learning to generalize: Metalearning for domain generalization. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pp. 3490–3497. AAAI Press, 2018a.
|
| 238 |
+
Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C. Kot. Domain generalization with adversarial feature learning. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 5400–5409. IEEE Computer Society, 2018b.
|
| 239 |
+
Pan Li, Da Li, Wei Li, Shaogang Gong, Yanwei Fu, and Timothy M Hospedales. A simple feature augmentation for domain generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8886–8895, 2021.
|
| 240 |
+
Sihang Li, Xiang Wang, An Zhang, Yingxin Wu, Xiangnan He, and Tat-Seng Chua. Let invariant rationale discovery inspire graph contrastive learning. In International Conference on Machine Learning, pp. 13052–13065. PMLR, 2022.
|
| 241 |
+
Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 624–639, 2018c.
|
| 242 |
+
Yuchen Liu, Yaoming Wang, Yabo Chen, Wenrui Dai, Chenglin Li, Junni Zou, and Hongkai Xiong. Promoting semantic connectivity: Dual nearest neighbors contrastive learning for unsupervised domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3510–3519, 2023.
|
| 243 |
+
Toshihiko Matsuura and Tatsuya Harada. Domain generalization using a mixture of multiple latent domains. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 11749– 11756, 2020.
|
| 244 |
+
Hyeonseob Nam, HyunJae Lee, Jongchan Park, Wonjun Yoon, and Donggeun Yoo. Reducing domain gap by reducing style bias. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8690–8699, 2021.
|
| 245 |
+
Oren Nuriel, Sagie Benaim, and Lior Wolf. Permuted adain: Reducing the bias towards global statistics in image classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9482–9491, 2021.
|
| 246 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 247 |
+
Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pp. 1406–1415. IEEE, 2019.
|
| 248 |
+
Fengchun Qiao, Long Zhao, and Xi Peng. Learning to learn single domain generalization. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pp. 12553–12562. IEEE, 2020.
|
| 249 |
+
Seonguk Seo, Yumin Suh, Dongwan Kim, Geeho Kim, Jongwoo Han, and Bohyung Han. Learning to optimize domain specific normalization for domain generalization. In European Conference on Computer Vision, pp. 68–83. Springer, 2020.
|
| 250 |
+
|
| 251 |
+
Changjian Shui, Boyu Wang, and Christian Gagne. On the benefits of representation regularization ´ in invariance based domain generalization. Machine Learning, 111(3):895–915, 2022.
|
| 252 |
+
|
| 253 |
+
Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pp. 443–450. Springer, 2016.
|
| 254 |
+
Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 5693–5703. Computer Vision Foundation / IEEE, 2019.
|
| 255 |
+
Mingxing Tan, Ruoming Pang, and Quoc V. Le. Efficientdet: Scalable and efficient object detection. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pp. 10778–10787. IEEE, 2020.
|
| 256 |
+
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 2962–2971. IEEE Computer Society, 2017.
|
| 257 |
+
Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
|
| 258 |
+
Vladimir N Vapnik. An overview of statistical learning theory. IEEE transactions on neural networks, 10(5):988–999, 1999.
|
| 259 |
+
Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 5385– 5394. IEEE Computer Society, 2017.
|
| 260 |
+
Riccardo Volpi, Hongseok Namkoong, Ozan Sener, John C. Duchi, Vittorio Murino, and Silvio Savarese. Generalizing to unseen domains via adversarial data augmentation. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montreal, Canada ´ , pp. 5339–5349, 2018.
|
| 261 |
+
Jindong Wang, Cuiling Lan, Chang Liu, Yidong Ouyang, Tao Qin, Wang Lu, Yiqiang Chen, Wenjun Zeng, and Philip Yu. Generalizing to unseen domains: A survey on domain generalization. IEEE Transactions on Knowledge and Data Engineering, 2022a.
|
| 262 |
+
Shujun Wang, Lequan Yu, Caizi Li, Chi-Wing Fu, and Pheng-Ann Heng. Learning from extrinsic and intrinsic supervisions for domain generalization. In European Conference on Computer Vision, pp. 159–176. Springer, 2020.
|
| 263 |
+
Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 9929–9939. PMLR, 2020.
|
| 264 |
+
Yifei Wang, Qi Zhang, Yisen Wang, Jiansheng Yang, and Zhouchen Lin. Chaos is a ladder: A new theoretical understanding of contrastive learning via augmentation overlap. arXiv preprint arXiv:2203.13457, 2022b.
|
| 265 |
+
Minghao Xu, Jian Zhang, Bingbing Ni, Teng Li, Chengjie Wang, Qi Tian, and Wenjun Zhang. Adversarial domain adaptation with domain mixup. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 6502–6509, 2020.
|
| 266 |
+
Xufeng Yao, Yang Bai, Xinyun Zhang, Yuechen Zhang, Qi Sun, Ran Chen, Ruiyu Li, and Bei Yu. Pcl: Proxy-based contrastive learning for domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7097–7107, 2022.
|
| 267 |
+
Kaichao You, Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I. Jordan. Universal domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 2720–2729. Computer Vision Foundation / IEEE, 2019.
|
| 268 |
+
Marvin Zhang, Henrik Marklund, Abhishek Gupta, Sergey Levine, and Chelsea Finn. Adaptive risk minimization: A meta-learning approach for tackling group shift. arXiv preprint arXiv:2007.02931, 8:9, 2020.
|
| 269 |
+
Shanshan Zhao, Mingming Gong, Tongliang Liu, Huan Fu, and Dacheng Tao. Domain generalization via entropy regularization. Advances in Neural Information Processing Systems, 33: 16096–16107, 2020.
|
| 270 |
+
Fan Zhou, Zhuqing Jiang, Changjian Shui, Boyu Wang, and Brahim Chaib-draa. Domain generalization with optimal transport and metric learning. arXiv preprint arXiv:2007.10573, 2020a.
|
| 271 |
+
Kaiyang Zhou, Yongxin Yang, Timothy Hospedales, and Tao Xiang. Learning to generate novel domains for domain generalization. In European conference on computer vision, pp. 561–578. Springer, 2020b.
|
| 272 |
+
Kaiyang Zhou, Yongxin Yang, Yu Qiao, and Tao Xiang. Domain generalization with mixstyle. arXiv preprint arXiv:2104.02008, 2021.
|
| 273 |
+
|
| 274 |
+
# A DETAILS OF EXPERIMENTS
|
| 275 |
+
|
| 276 |
+
A.1 EXPERIMENTAL SETUP
|
| 277 |
+
Table 5: Statistics of datasets.
|
| 278 |
+
|
| 279 |
+
<table><tr><td>Datasets</td><td>#images</td><td># domains</td><td>#classes</td></tr><tr><td>PACS</td><td>9991</td><td>4</td><td>7</td></tr><tr><td>VLCS</td><td>10729</td><td>4</td><td>5</td></tr><tr><td>OfficeHome</td><td>15588</td><td>4</td><td>65</td></tr><tr><td>TerraIncognita</td><td>24788</td><td>4</td><td>10</td></tr><tr><td>DomainNet</td><td>586575</td><td>6</td><td>345</td></tr></table>
|
| 280 |
+
|
| 281 |
+
Here we elaborate the detailed experimental setup of our paper. Following DomainBed (Gulrajani & Lopez-Paz, 2020), we split $80 \% / 2 0 \%$ data from source domains as the training/validation set. The best-performing model on the validation set will be evaluated on the testing target domain to obtain the test performance. The statistics of the experimental datasets are shown in Table 5. We list the number of images, domains, classes in each dataset. The proposed model is optimized using Adam (Kingma & Ba, 2015) with the learning rate of 5e-5. The hyper-parameter $\lambda$ is searched over $\{ 0 . 1$ , $1 , 2 , 5 \}$ , and $\beta$ is tuned in the range of $\{ 0 . 0 1 , 0 . 0 5 , 0 . 1 \}$ . The temperature $\tau$ is set to 0.1 by default. For the projection head used for contrastive learning, we use a two-layer MLP with ReLU and BatchNorm. Regarding variational reconstruction, following Cha et al. (2022), we employ a simple yet effective architecture, in which the identity function is used as mean encoder and a bias-only network with softplus activation for the variance encoder. More intricate architecture can be explored in the future. Following Gulrajani & Lopez-Paz (2020), for all the datasets except DomainNet, we train the model for 5000 steps. For the DomainNet dataset, we train the model for 15000 steps. Other algorithm-agnostic hyper-parameters such as the batch size are all set to be the same as in the standard benchmark DomainBed (Gulrajani & Lopez-Paz, 2020). For batch construction, we sample the same number of samples from each training domain as in DomainBed (Gulrajani & Lopez-Paz, 2020). Generative Transformation is done for all 4 layers in ResNet-18/50. The experiments are all conducted on one Tesla V100 32 GB GPU. For the data augmentation strategy, previous works usually adopted random cropping, grayscale, horizontal flipping and random color jittering. In this paper, we simply increase the intensity of random color jittering to achieve more aggressive data augmentation. The experimental results have verified the effectiveness of the strategy. Developing stronger and more adaptive augmentation methods for contrastive learning on DG may further enhance the performance.
|
| 282 |
+
|
| 283 |
+
A.2 EXPERIMENTAL RESULTS ON TERRAINCOGNITA, VLCS, AND DOMAINNET DATA SETS
|
| 284 |
+
|
| 285 |
+
We put the experimental comparisons with state-of-the-art baselines on TerraIncognita, VLCS, and DomainNet data sets respectively in Tables 6, 7, and 8. The symbol $^ +$ in the tables is used to denote that the reproduced experimental performance is distinct from the originally reported one such as $\mathrm { ^ { 6 6 } P C L ^ { + 5 } }$ in Table 8. We can observe our proposed DCCL still surpasses previous methods, which is consistent with the conclusion in the main text and successfully verify the effectiveness of our proposed method.
|
| 286 |
+
|
| 287 |
+
# A.3 VISUALIZATION
|
| 288 |
+
|
| 289 |
+
We demonstrate the embeddings of ERM, PCL, and our DCCL methods on the testing domain in Figure 5. ERM, among the three methods, has the most samples distributed in the central area which cannot be distinguished. For the embedding of contrastive-learning-based baseline PCL, there are fewer samples distributed ambiguously. However, the class clusters are not compact and the class boundaries are not clear. By contrast, our DCCL learns discriminative representations even in the unseen target domain by enhancing intra-class connectivity in CL.
|
| 290 |
+
|
| 291 |
+
Table 6: Experimental comparisons with state-of-the-art methods on TerraIncognita benchmark with ResNet-50.
|
| 292 |
+
|
| 293 |
+
<table><tr><td>Algorithm</td><td>L100</td><td>L38</td><td>L43</td><td>L46</td><td>Avg.</td></tr><tr><td>MMD (Li et al., 2018b)</td><td>41.9</td><td>34.8</td><td>57.0</td><td>35.2</td><td>42.2</td></tr><tr><td>GroupDRO (Ganin et al., 2016)</td><td>41.2</td><td>38.6</td><td>56.7</td><td>36.4</td><td>43.2</td></tr><tr><td>Mixstyle (Zhou et al.,2021)</td><td>54.3</td><td>34.1</td><td>55.9</td><td>31.7</td><td>44.0</td></tr><tr><td>ARM (Zhang et al.,2020)</td><td>49.3</td><td>38.3</td><td>55.8</td><td>38.7</td><td>45.5</td></tr><tr><td>MTL (Blanchard et al., 2021)</td><td>49.3</td><td>39.6</td><td>55.6</td><td>37.8</td><td>45.6</td></tr><tr><td>CDANN (Li et al., 2018b)</td><td>47.0</td><td>41.3</td><td>54.9</td><td>39.8</td><td>45.8</td></tr><tr><td>VREx (Krueger et al.,2021)</td><td>48.2</td><td>41.7</td><td>56.8</td><td>38.7</td><td>46.4</td></tr><tr><td>RSC (Huang et al., 2020)</td><td>50.2</td><td>39.2</td><td>56.3</td><td>40.8</td><td>46.6</td></tr><tr><td>DANN (Ganin et al., 2016)</td><td>51.1</td><td>40.6</td><td>57.4</td><td>37.7</td><td>46.7</td></tr><tr><td>SelfReg (Kim et al.,2021)</td><td>48.8</td><td>41.3</td><td>57.3</td><td>40.6</td><td>47.0</td></tr><tr><td>IRM (Arjovsky et al.,2019)</td><td>54.6</td><td>39.8</td><td>56.2</td><td>39.6</td><td>47.6</td></tr><tr><td>CORAL (Sun & Saenko,2016)</td><td>51.6</td><td>42.2</td><td>57.0</td><td>39.8</td><td>47.7</td></tr><tr><td>MLDG (Li et al., 2018a)</td><td>54.2</td><td>44.3</td><td>55.6</td><td>36.9</td><td>47.8</td></tr><tr><td>ERM(Vapnik,1999)</td><td>54.3</td><td>42.5</td><td>55.6</td><td>38.8</td><td>47.8</td></tr><tr><td>I-Mixup (Xu et al., 2020)</td><td>59.6</td><td>42.2</td><td>55.9</td><td>33.9</td><td>47.9</td></tr><tr><td>SagNet (Nam et al., 2021)</td><td>53.0</td><td>43.0</td><td>57.9</td><td>40.4</td><td>48.6</td></tr><tr><td>COMEN (Chen et al.,2022)</td><td>56.0</td><td>44.3</td><td>58.4</td><td>39.4</td><td>49.5</td></tr><tr><td>SWAD (Cha et al., 2021)</td><td>55.4</td><td>44.9</td><td>59.7</td><td>39.9</td><td>50.0</td></tr><tr><td>PCL (Yao et al.,2022)</td><td>58.7</td><td>46.3</td><td>60.0</td><td>43.6</td><td>52.1</td></tr><tr><td>MIRO (Cha et al.,2022)</td><td>60.9</td><td>47.6</td><td>59.5</td><td>43.4</td><td>52.9</td></tr><tr><td>Ours</td><td>62.2</td><td>48.3</td><td>60.6</td><td>43.6</td><td>53.7±0.2</td></tr></table>
|
| 294 |
+
|
| 295 |
+
Table 7: Experimental comparisons with state-of-the-art methods on VLCS benchmark with ResNet-50.
|
| 296 |
+
|
| 297 |
+
<table><tr><td>Algorithm</td><td>C</td><td>L</td><td>S</td><td>V</td><td>Avg</td></tr><tr><td>GroupDRO (Ganin et al., 2016)</td><td>97.3</td><td>63.4</td><td>69.5</td><td>76.7</td><td>76.7</td></tr><tr><td>RSC (Huang et al., 2020)</td><td>97.9</td><td>62.5</td><td>72.3</td><td>75.6</td><td>77.1</td></tr><tr><td>MLDG (Li et al., 2018a)</td><td>97.4</td><td>65.2</td><td>71.0</td><td>75.3</td><td>77.2</td></tr><tr><td>MTL (Blanchard et al., 2021)</td><td>97.8</td><td>64.3</td><td>71.5</td><td>75.3</td><td>77.2</td></tr><tr><td>ERM (Vapnik,1999)</td><td>98.0</td><td>64.7</td><td>71.4</td><td>75.2</td><td>77.3</td></tr><tr><td>I-Mixup (Xu et al., 2020)</td><td>98.3</td><td>64.8</td><td>72.1</td><td>74.3</td><td>77.4</td></tr><tr><td>MMD (Li et al., 2018b)</td><td>97.7</td><td>64.0</td><td>72.8</td><td>75.3</td><td>77.5</td></tr><tr><td>CDANN (Li et al., 2018b)</td><td>97.1</td><td>65.1</td><td>70.7</td><td>77.1</td><td>77.5</td></tr><tr><td>ARM (Zhang et al., 2020)</td><td>98.7</td><td>63.6</td><td>71.3</td><td>76.7</td><td>77.6</td></tr><tr><td>SagNet (Nam et al., 2021)</td><td>97.9</td><td>64.5</td><td>71.4</td><td>77.5</td><td>77.8</td></tr><tr><td>SelfReg (Kim et al., 2021)</td><td>96.7</td><td>65.2</td><td>73.1</td><td>76.2</td><td>77.8</td></tr><tr><td>Mixstyle (Zhou et al., 2021)</td><td>98.6</td><td>64.5</td><td>72.6</td><td>75.7</td><td>77.9</td></tr><tr><td>PCL (Yao et al., 2022)</td><td>99.0</td><td>63.6</td><td>73.8</td><td>75.6</td><td>78.0</td></tr><tr><td>VREx (Krueger et al., 2021)</td><td>98.4</td><td>64.4</td><td>74.1</td><td>76.2</td><td>78.3</td></tr><tr><td>COMEN (Chen et al.,2022)</td><td>98.5</td><td>64.1</td><td>74.1</td><td>77.0</td><td>78.4</td></tr><tr><td>IRM (Arjovsky et al., 2019)</td><td>98.6</td><td>64.9</td><td>73.4</td><td>77.3</td><td>78.6</td></tr><tr><td>DANN (Ganin et al., 2016)</td><td>99.0</td><td>65.1</td><td>73.1</td><td>77.2</td><td>78.6</td></tr><tr><td>CORAL (Sun & Saenko,2016)</td><td>98.3</td><td>66.1</td><td>73.4</td><td>77.5</td><td>78.8</td></tr><tr><td>SWAD (Cha et al., 2021)</td><td>98.8</td><td>63.3</td><td>75.3</td><td>79.2</td><td>79.1</td></tr><tr><td>MIRO (Cha et al., 2022)</td><td>98.8</td><td>64.2</td><td>75.5</td><td>79.9</td><td>79.6</td></tr><tr><td>Ours</td><td>99.1</td><td>64.0</td><td>76.1</td><td>80.7</td><td>80.0± 0.1</td></tr></table>
|
| 298 |
+
|
| 299 |
+
# A.4 REPRESENTATION CONNECTIVITY OF PRE-TRAINED MODELS
|
| 300 |
+
|
| 301 |
+
Our motivation to utilize pre-trained models for better connectivity is intuitive: we consider pretrained model can return effective representations modeling the pairwise interactions among images, which thus draws target domains closer to source domains. To verify the motivation, we conduct experiments to evaluate whether the pre-trained model is “well-connected”.
|
| 302 |
+
|
| 303 |
+
1. We design a quantitative metric to help evaluate whether the pre-trained space is “wellconnected”. For images within the same class, we take those images as nodes and construct a graph, only connecting two nodes when their distance on the pre-trained space is smaller than a threshold. We denote the smallest possible threshold which makes the graph connected as $\tau$ , and denote the mean and the std of the pairwise distances respectively as $\mu$ and $\sigma$ . We can thus use $( \tau - \mu ) / \sigma$ as a metric to describe the connectivity of the representations.
|
| 304 |
+
|
| 305 |
+
<table><tr><td>Algorithm</td><td>clip</td><td>info</td><td>paint</td><td>quick</td><td>real</td><td>sketch</td><td>Avg</td></tr><tr><td>MMD (Li et al., 2018b)</td><td>32.1</td><td>11.0</td><td>26.8</td><td>8.7</td><td>32.7</td><td>28.9</td><td>23.4</td></tr><tr><td>GroupDRO (Ganin et al., 2016)</td><td>47.2</td><td>17.5</td><td>33.8</td><td>9.3</td><td>51.6</td><td>40.1</td><td>33.3</td></tr><tr><td>VREx (Krueger et al., 2021)</td><td>47.3</td><td>16.0</td><td>35.8</td><td>10.9</td><td>49.6</td><td>42.0</td><td>33.6</td></tr><tr><td>IRM (Arjovsky et al., 2019)</td><td>48.5</td><td>15.0</td><td>38.3</td><td>10.9</td><td>48.2</td><td>42.3</td><td>33.9</td></tr><tr><td>Mixstyle (Zhou et al., 2021)</td><td>51.9</td><td>13.3</td><td>37.0</td><td>12.3</td><td>46.1</td><td>43.4</td><td>34.0</td></tr><tr><td>ARM (Zhang et al., 2020)</td><td>49.7</td><td>16.3</td><td>40.9</td><td>9.4</td><td>53.4</td><td>43.5</td><td>35.5</td></tr><tr><td>CDANN (Li et al., 2018b)</td><td>54.6</td><td>17.3</td><td>43.7</td><td>12.1</td><td>56.2</td><td>45.9</td><td>38.3</td></tr><tr><td>DANN (Ganin et al., 2016)</td><td>53.1</td><td>18.3</td><td>44.2</td><td>11.8</td><td>55.5</td><td>46.8</td><td>38.3</td></tr><tr><td>RSC (Huang et al., 2020)</td><td>55.0</td><td>18.3</td><td>44.4</td><td>12.2</td><td>55.7</td><td>47.8</td><td>38.9</td></tr><tr><td>I-Mixup (Xu et al., 2020)</td><td>55.7</td><td>18.5</td><td>44.3</td><td>12.5</td><td>55.8</td><td>48.2</td><td>39.2</td></tr><tr><td>SagNet (Nam et al.,2021)</td><td>57.7</td><td>19.0</td><td>45.3</td><td>12.7</td><td>58.1</td><td>48.8</td><td>40.3</td></tr><tr><td>MTL (Blanchard et al., 2021)</td><td>57.9</td><td>18.5</td><td>46.0</td><td>12.5</td><td>59.5</td><td>49.2</td><td>40.6</td></tr><tr><td>MLDG (Li et al.,2018a)</td><td>59.1</td><td>19.1</td><td>45.8</td><td>13.4</td><td>59.6</td><td>50.2</td><td>41.2</td></tr><tr><td>CORAL (Sun & Saenko,2016)</td><td>59.2</td><td>19.7</td><td>46.6</td><td>13.4</td><td>59.8</td><td>50.1</td><td>41.5</td></tr><tr><td>SelfReg (Kim et al.,2021)</td><td>60.7</td><td>21.6</td><td>49.4</td><td>12.7</td><td>60.7</td><td>51.7</td><td>42.8</td></tr><tr><td>MetaReg (Balaji et al., 2018)</td><td>59.8</td><td>25.6</td><td>50.2</td><td>11.5</td><td>64.6</td><td>50.1</td><td>43.6</td></tr><tr><td>DMG (Chattopadhyay et al., 2020)</td><td>65.2</td><td>22.2</td><td>50.0</td><td>15.7</td><td>59.6</td><td>49.0</td><td>43.6</td></tr><tr><td>ERM (Vapnik,1999)</td><td>63.0</td><td>21.2</td><td>50.1</td><td>13.9</td><td>63.7</td><td>52.0</td><td>44.0</td></tr><tr><td>COMEN (Chen et al., 2022)</td><td>64.0</td><td>21.1</td><td>50.2</td><td>14.1</td><td>63.2</td><td>51.8</td><td>44.1</td></tr><tr><td>PCL+ (Yao et al., 2022)</td><td>64.3</td><td>20.9</td><td>52.7</td><td>16.7</td><td>62.2</td><td>55.5</td><td>45.4</td></tr><tr><td>SWAD (Cha et al., 2021)</td><td>66.0</td><td>22.4</td><td>53.5</td><td>16.1</td><td>65.8</td><td>55.5</td><td>46.5</td></tr><tr><td>MIRO (Cha et al., 2022)</td><td>66.4</td><td>23.5</td><td>54.1</td><td>16.2</td><td>66.8</td><td>54.8</td><td>47.0</td></tr><tr><td>Ours</td><td>66.9</td><td>23.0</td><td>55.1</td><td>16.0</td><td>67.7</td><td>56.1</td><td>47.5± 0.0</td></tr></table>
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Table 8: Experimental comparisons with state-of-the-art methods on DomainNet benchmark with ResNet-50.
|
| 309 |
+
Figure 5: t-SNE visualization of the ERM, PCL and DCCL representations on the testing domain. Same-class points are in the same colors. We visualize the embedding on PACS dataset where the source domains are photo, sketch, and cartoon; the target domain is art.
|
| 310 |
+
|
| 311 |
+
2. We report the mean (max) metrics (the smaller, the better) of each class for ERM and pre-trained model on PACS, VLCS, and Terra.; the values for ERM are 1.37 (2.68), 1.78 (2.15), and 3.31 (3.56), for pre-trained model 0.54 (0.81), 0.46 (0.62), and 0.63 (0.76). The results confirm the pre-trained space is well-connected.
|
| 312 |
+
|
| 313 |
+
Furthermore, the variation in performance improvement across different datasets can be attributed to differences in connectivity. We define a measure to evaluate connectivity in Appendix A.4 where lower values indicate better connectivity. For the pre-trained (ERM) model, the connectivity measure we have is 0.54 (1.37) for PACS and 0.49 (2.85) for OfficeHome. A larger discrepancy in connectivity between ERM and the pretraine model $\frac { 1 . 3 7 } { 0 . 5 4 }$ v.s. $\frac { 2 . 8 5 } { 0 . 4 9 } \cdot$ ) allows for greater potential for
|
| 314 |
+
|
| 315 |
+
# A.5 FURTHER ABLATION STUDY
|
| 316 |
+
|
| 317 |
+
Choices of VAE structures. In our experiments, using more advanced VAE structures like HFVAE (Esmaeili et al., 2019) (72.7) and IntroVAE (Huang et al., 2018) (73.1) will yield worse results than vanilla VAE (73.5), which may be attributed to the increased training difficulty.
|
| 318 |
+
|
| 319 |
+
Choices of contrastive learning methods. SimCLR is denoted as “SelfContrast” in Table 4. Our proposed DCCL (73.5) turns out to outperform other representative SSL approaches: SimCLR (Chen et al., 2020) (68.9 in Tab. 4), MoCo (He et al., 2020) (69.7), BYOL (Grill et al., 2020) (70.7), SwAV (Caron et al., 2020) (71.5).
|
| 320 |
+
|
| 321 |
+
Further justification of cross-domain contrast (CDC). To further justify cross-domain contrast (CDC), we also implement a baseline using within-domain positive samples only, and the accuracy drops remarkably compared to CDC $( 7 1 . 8 7 0 . 4 )$ ). In addition, we include an oracle experiment with solely cross-domain positive pairs and observe comparable performance $( 7 1 . 8 7 1 . 9 )$ ). It may require careful design to make good use of domain information to obtain improvements.
|
| 322 |
+
|
| 323 |
+
Choices of pre-trained backbone and resources. In Table 9, we present additional experiments on Instagram (3.6B) pre-trained RegNet. Compared to PCL, which ignores the pre-trained information, DCCL achieves consistent and substantial improvement on imagenet pre-trained models. And when applied to Instagram, the improvement becomes remarkably larger. These indicate the importance of the pre-trained information, and more abundant the pre-training resources, the stronger the pretrained information is needed.
|
| 324 |
+
|
| 325 |
+
<table><tr><td>Backbone Resource</td><td>ResNet-18 ImageNet (1.3M)</td><td>ResNet-50</td><td>RegNet Instagram (3.6B)</td></tr><tr><td>PCL</td><td>65.0</td><td>71.6</td><td>73.2</td></tr><tr><td>DCCL</td><td>67.5 (+2.5)</td><td>73.5 (+1.9)</td><td>82.5 (+9.3)</td></tr></table>
|
| 326 |
+
|
| 327 |
+
Table 9: Perf with different pre-trained resources.
|
| 328 |
+
|
| 329 |
+
# Further Experiments on the Wilds Benchmark.
|
| 330 |
+
|
| 331 |
+
We also test the OOD performance of our proposed DCCL using the Camelyon and iWildCam datasets from the Wilds benchmark with the pre-trained ResNet-50 network. In Table 10, DCCL demonstrate a consistent and substantial improvement in performance on the more challenging datasets.
|
| 332 |
+
|
| 333 |
+
<table><tr><td>Datasets Metrics</td><td colspan="2">Camelyon Avg. Acc Worst Acc</td><td>iWildCam F1</td></tr><tr><td>ERM</td><td>88.7</td><td>68.3</td><td>31.3</td></tr><tr><td>PCL</td><td>91.2</td><td>75.5</td><td>30.2</td></tr><tr><td>DCCL</td><td>96.7</td><td>90.9</td><td>32.7</td></tr><tr><td></td><td></td><td></td><td></td></tr></table>
|
| 334 |
+
|
| 335 |
+
Table 10: Perf on Wilds datasets with pre-trained ResNet-50.
|
| 336 |
+
|
| 337 |
+
# Further Ablation Study on the VLCS dataset.
|
| 338 |
+
|
| 339 |
+
Here we additionally performed an ablation study on the VLCS dataset, as shown in Table 11, where the performance gain above SWAD is relatively smaller. These results further confirm that the three components we identified contribute consistently to the effectiveness, as detailed in our paper.
|
| 340 |
+
|
| 341 |
+
# B RELATED WORK
|
| 342 |
+
|
| 343 |
+
In this section, we review the related works in domain generalization and contrastive learning.
|
| 344 |
+
|
| 345 |
+
# B.1 DOMAIN GENERALIZATION
|
| 346 |
+
|
| 347 |
+
The goal of DG is to enable models to generalize to unknown target domains under distribution shifts. The related literature can be split into several categories as follows.
|
| 348 |
+
|
| 349 |
+
Table 11: Ablation Study on VLCS dataset with pre-trained ResNet-50.
|
| 350 |
+
|
| 351 |
+
<table><tr><td>Algorithm</td><td>C</td><td>L</td><td>S</td><td>V</td><td>Avg</td></tr><tr><td>SWAD</td><td>98.8</td><td>63.3</td><td>75.3</td><td>79.2</td><td>79.1</td></tr><tr><td>DCCL w/o CDC</td><td>98.9</td><td>63.8</td><td>75.6</td><td>79.5</td><td>79.4</td></tr><tr><td>DCCL w/o PMA</td><td>98.6</td><td>63.7</td><td>75.7</td><td>79.3</td><td>79.3</td></tr><tr><td>DCCL w/o GT</td><td>98.7</td><td>64.3</td><td>75.2</td><td>80.2</td><td>79.6</td></tr><tr><td>DCCL</td><td>99.1</td><td>64.0</td><td>76.1</td><td>80.7</td><td>80.0</td></tr></table>
|
| 352 |
+
|
| 353 |
+
(i) The first line of work focuses on learning policies. One strategy is meta learning (Finn et al., 2017), which adapts to new environments rapidly with limited observations; the meta-optimization idea was thus introduced in DG (Li et al., 2018a; Balaji et al., 2018; Qiao et al., 2020) to generalize to future testing environments/domains; another widely-studied strategy is ensemble learning (Cha et al., 2021; Chu et al., 2022), claiming DG can benefit from several diverse neural networks to obtain more robust representations. (ii) The second line of work is data augmentation. Many fabricated or learnable augmentation strategies (Volpi et al., 2018; Zhou et al., 2020b; Li et al., 2021; Xu et al., 2020) were developed to regularize and enhance deep learning models. In our paper, we verify more aggressive augmentation can lead to better representations in CL as well. (iii) The last series of work is domain invariant learning. Researchers seek to learn invariances across multiple observed domains for improved generalization on target domains. The commonly used approaches include domain discrepancy regularization (Li et al., 2018b; Zhou et al., 2020a) and domain adversarial learning (Li et al., 2018c; Ganin et al., 2016; Matsuura & Harada, 2020). Recently, MIRO (Cha et al., 2022) began to explore the retention of pre-trained features by designing the mutual information regularization term. The paper (Liu et al., 2023) also utilized the concept connectivity to build up the method. However, their concept of ”connectivity” based on joint distribution clearly differ from our paper. Therefore the theoretical motivation behind two papers are indeed different. Moreover, the methods proposed are different. Except for the common strategy of strong augmentation recommended by the contrastive learning theory paper Wang et al. (2022b), our proposed methods are different from the ones in Liu et al. (2023). They propose two nearest-neighbor-based methods for constructing positive pairs, while our main contribution lies in the exploitation of both the pre-trained models and the intra-class data connectivity.
|
| 354 |
+
|
| 355 |
+
# B.2 CONTRASTIVE LEARNING
|
| 356 |
+
|
| 357 |
+
Contrastive learning (CL) (Chen et al., 2020) aims to learn discriminative sample representation by aligning positive instances and pushing negative ones apart. As a promising self-supervised learning paradigm, CL is widely used in unsupervised pre-training to improve the performance of downstream tasks (Hjelm et al., 2019; Gao et al., 2021; Li et al., 2022; He et al., 2020; Chen et al., 2020; Caron et al., 2020; Chen & He, 2021; Grill et al., 2020). SimCLR (Chen et al., 2020) is the CL framework that first reveals the projection head and data augmentation as the core components to learn invariant representation across views. MoCo (He et al., 2020) proposes to build a dynamic queue dictionary to enlarge batch size for effective learning. There are also works (Khosla et al., 2020; Gunel et al., 2020; Cui et al., 2021) adapting CL to the supervised setting to leverage label information.
|
| 358 |
+
|
| 359 |
+
The capability of CL to obtain class-separated representations has also motivated the application in domain generalization. SelfReg (Kim et al., 2021) introduced a new regularization method to build self-supervised signals with only positive samples; PCL (Yao et al., 2022) proposed a proxybased approach to alleviate the positive alignment issue in CL; COMEN (Chen et al., 2022) used a prototype-based CL component to learn the relationships between various hidden clusters. However, the role of CL in domain generalization is not yet well explored, and our work is dedicated to shedding some light on the understanding of its effect from a intra-class connectivity perspective.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 6: Illustration for the toy example of self-contrastive learning (SCL). Spots and slashes are filled in to represent different domains; orange and blue rectangles respectively denote classes 1 and 2. The mapping function $\varphi \circ \theta$ learned on domain $d _ { 1 }$ can perfectly classify the samples, and the mapping attains perfect alignment and uniformity (the objective of SCL). However, when applied to a new domain $d _ { 2 }$ , the classifier completely fails $0 \%$ acc).
|
| 363 |
+
|
| 364 |
+
# C FAILURE OF SELF-CONTRASTIVE LEARNING IN DOMAIN GENERALIZATION
|
| 365 |
+
|
| 366 |
+
Self-contrastive learning, which aligns the augmentation views of the same input, has achieved successful performance in unsupervised pre-training tasks (Chen et al., 2020; He et al., 2020; Grill et al., 2020). However, it does not naturally fit the domain generalization setting since it assumes the ability to sample $x$ from the whole data distribution; in the training stage of domain generalization, we instead are only able to access partial domains. This mismatch can lead to suboptimal performance in domain generalization if the users mechanically adopt the classical contrastive learning loss.
|
| 367 |
+
|
| 368 |
+
We provide a linearly separable toy example in Figure 6 to show the deficiency of SCL that even attaining optimal CL loss (1) cannot guarantee good performance in the domain generalization setting, where only partial domains are involved in the training. In the figure, slashes and spots are used to represent domains $d _ { 1 }$ and $d _ { 2 }$ ; orange and blue rectangles respectively denote classes 1 and 2. We specifically consider the extreme case that no augmentation is applied and only domain $d _ { 1 }$ is involved in the training. We then construct a map ${ \bf \bar { \boldsymbol { \varphi } } } \left( \theta ( \boldsymbol { x } ) \right) : = \left( \cos \left( \theta \right) , \sin \left( \theta \right) \right)$ with $\theta ( x ) = \left( x - \operatorname { s g n } ( y ) \right) \pi ^ { 5 }$ . The map $f _ { h } = \varphi \circ \theta$ attains perfect alignment (due to no augmentation) and maximal uniformity (new representations are uniformly distributed on the corresponding circle arcs) on the 1-sphere $\mathring { \mathbb { S } } ^ { 1 } : = \big \{ { \boldsymbol { x } } ^ { \cdot } \in \mathbb { R } ^ { 2 } : \| { \boldsymbol { x } } \| _ { 2 } = 1 \big \}$ , and based on the derivation in Wang $\&$ Isola (2020) $f _ { h }$ will minimize the CL loss (1). However, the new representations for domain $d _ { 2 }$ do not reflect the class information and even have the opposite signs as domain $d _ { 1 }$ .
|
| 369 |
+
|
| 370 |
+
We can conclude that the usage of classical SCL does not necessarily lead to good performance under the domain generalization setting; and empirical verification is provided in Section 4.4 as well. Similar limitation is observed in invariance-based DG methods (Shui et al., 2022). We provide the detailed settings of the coined data distribution as follows.
|
| 371 |
+
|
| 372 |
+
Example C.1 (Self-contrastive learning does not help domain generalization.). Let the label collection $\mathcal { V }$ be $\{ - 1 , 1 \}$ and the portions of two classes are both 0.5. Assume there are two domains $d _ { 1 }$ and $d _ { 2 }$ : if a sample $X = ( \bar { X } _ { 1 } , X _ { 2 } ) \in \mathbb { R } ^ { 2 }$ with label $Y$ is from domain $d _ { 1 }$ , its conditional distribution will be specified as
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\left\{ { \begin{array} { l } { X _ { 1 } \sim \operatorname { U n i f } \left( 0 , 1 \right) Y , } \\ { X _ { 2 } \sim \operatorname { U n i f } \left( 1 , 2 \right) Y , } \\ { X _ { 1 } \downarrow \downarrow \ X _ { 2 } \mid Y ; } \end{array} } \right.
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
in domain $d _ { 2 }$ the distribution of $X _ { 1 } , X _ { 2 }$ is interchanged. Considering the extreme case that no augmentation is applied and only domain $d _ { 1 }$ is involved in the training, we construct a map $\varphi \left( \theta ( x ) \right) : = \left( \cos \left( \theta \right) , \sin \left( \theta \right) \right)$ with $\theta ( x ) = ( x _ { 1 } - \mathrm { s g n } ( y ) ) \pi ^ { 6 }$ . The map $f _ { h } = \varphi \circ \theta$ attains perfect alignment (due to no augmentation) and maximal uniformity (new representations are uniformly distributed on the corresponding circle arcs) on the 1-sphere $\mathrm { \dot { \mathbb { S } } ^ { 1 } } : = \left\{ \dot { x } \in \mathbb { R } ^ { 2 } : \| x \| _ { 2 } = 1 \right\}$ , and based on the derivation in Wang & Isola (2020) $f _ { h }$ will minimize the $C L$ loss $( l )$ . However, the new representations for domain $d _ { 2 }$ do not reflect the class information and even have the opposite signs as domain $d _ { 1 }$ .
|
| 379 |
+
|
| 380 |
+
SCL in the previous example fails to obtain intra-class connectivity due to insufficient data augmentation and domain-separated (rather than class-separated) representations, which ultimately causes poor generalization performance. Inspired by the above analysis, we thus propose two approaches to improve intra-class connectivity: (i) applying more aggressive data augmentation and (ii) expanding the scope of positive samples, from solely self-augmented outputs $a ( x )$ to the augmentation of intraclass samples across domains.
|
| 381 |
+
|
| 382 |
+
# D DISCUSSIONS & LIMITATIONS
|
| 383 |
+
|
| 384 |
+
In the paper, We analyze the failure of directly applying SCL to DG with the CL theory and suggest lack of intra-class connectivity in the DG setting causes the deficiency. We accordingly propose domain-connecting contrastive learning (DCCL) to enhance the connectivity across domains and obtain generalizable and transferable representation for DG. Extensive experiments also verify the effectiveness of our method.
|
| 385 |
+
|
| 386 |
+
However, we’re also aware of the limitations of our work. We don’t make explicit use of the domain information. It implies if one can well leverage the domain information, better generalization performance might be obtained. Moreover, similar to Cha et al. (2022), our proposed DCCL requires the pre-trained embeddings of the samples. This existing drawback can be mitigated by generating the pre-trained embeddings in advance and storing them locally. In addition, how to develop stronger and more adaptive augmentation methods for contrastive learning on DG is not explored in this paper and remains an open problem.
|
| 387 |
+
|
| 388 |
+
Regarding attribution of existing assets, we only utilize existing open-sourced datasets, which all can be found in DomainBed7 benchmark. In addition, we don’t make any use of personal data. For all the datasets used, there is no private personally identifiable information or offensive content.
|
md/test/89l6VLPrin/89l6VLPrin.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRAPH LAYOUTS AND GRAPH CONTRASTIVE LEARNING VIA NEIGHBOUR EMBEDDINGS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In node-level graph representation learning, there are two distinct paradigms. One is known as graph layouts, where nodes are embedded into 2D space for visualization purposes. Another is graph contrastive learning, where nodes are parametrically embedded into a high-dimensional vector space based on node features. In this work, we show that these two paradigms are intimately related, and that both can be successfully approached via neighbour embedding methods. First, we introduce graph $t$ -SNE for two-dimensional graph drawing, and show that the resulting layouts outperform all existing algorithms in terms of local structure preservation, as measured by $k \mathbf { N N }$ classification accuracy. Second, we introduce graph contrastive neighbor embedding (graph CNE), which uses a fully-connected neural network (MLP) to transform graph node features into an embedding space by optimizing the contrastive InfoNCE objective. We show that graph CNE, while being conceptually simpler than most existing graph contrastive learning methods, produces competitive node representations and outperforms state-of-the-art MLP-based methods in terms of linear classification accuracy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many real-world datasets, ranging from molecule structure to citation networks come in form of graphs. As graphs are abstract objects consisting of a set of nodes $\nu$ and a set of edges $\mathcal { E }$ , graph representation learning, i.e. embedding graph nodes into a vector space $\mathbb { R } ^ { d }$ , is a popular approach in machine learning. Traditionally, a distinction is made between graph layout (or graph drawing) methods, which embed nodes into $\mathbb { R } ^ { 2 }$ for visualization purposes, and graph contrastive learning methods, which use higher-dimensional embeddings more suitable for downstream analysis, such as classification or clustering.
|
| 12 |
+
|
| 13 |
+
For a graph $G = ( \nu , \mathcal { E } )$ , graph layout methods usually only take into account its structure and obtain the layout by pulling together connected nodes. In contrast, graph contrastive learning (GCL)
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: 2D embeddings of the Amazon Computer (ACO) and Photo (APH) datasets, obtained using our graph $t$ -SNE and graph CNE. Graph $t$ -SNE is a graph layout method. Graph CNE is a graph contrastive learning method, mapping node features to 2D (or other dimensionality, e.g. 128D, see Section 6) using a neural network. Embeddings were aligned using Procrustes rotation.
|
| 17 |
+
|
| 18 |
+
methods typically use node features $\mathbf { X }$ of size $n \times D$ where $n = | \mathcal { V } |$ and employ a neural network, usually a graph convolutional network (GCN) (Kipf & Welling, 2017), for the $\mathbf { R } ^ { D } \to \mathbf { R } ^ { d }$ mapping. GCL methods also pull connected nodes together, sometimes explicitly through their loss function, but also implicitly through the GCN architecture (Trivedi et al., 2022; Wang et al., 2023; Guo et al., 2023).
|
| 19 |
+
|
| 20 |
+
Recent work (Kruiger et al., 2017; Zhu et al., 2020a; Zhong et al., 2023; Bohm et al., 2022) pointed ¨ out deep connections between graph layout and neighbor embedding algorithms such as $t$ -SNE (Van der Maaten & Hinton, 2008) or UMAP (McInnes et al., 2018), which are based on neighborhood preservation. In parallel, another line of work explored connections between neighbor embeddings and contrastive learning (Damrich et al., 2022; Bohm et al., 2023; Hu et al., 2023). ¨ This raises the question to what extent neighbor embedding and contrastive neighbor embedding algorithms (see Section 3) can be useful for graph representation learning.
|
| 21 |
+
|
| 22 |
+
In this work, we answer this question. We introduce a novel graph layout algorithm, graph $t$ -SNE (Figure 1), and show that it strongly outperforms existing methods. We also introduce a novel, augmentation-free, GCL algorithm, graph CNE (Figure 1), based on the framework for contrastive neighbor embeddings, and show that it reaches competitive GCL performance without using GCNs. Conceptually, we present a single coherent framework for node-level graph representation learning, tying together graph layouts, graph contrastive learning, and neighbor embeddings.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
Graph layouts Graph layout algorithms have traditionally been based on spring models, where every connected pair of nodes feels an attractive force $F _ { a }$ and all pairs of nodes feel a repulsive force $F _ { r }$ (force-directed graph layouts). Many algorithms can be written as $F _ { a } = d _ { i j } ^ { a }$ and $F _ { r } = d _ { i j } ^ { r }$ (Noack, 2007), where $d _ { i j }$ is the embedding distance between nodes. For example, Fruchterman– Reingold algorithm, also known as FDP, uses $a = 2 , r = - 1$ (Fruchterman & Reingold, 1991); ForceAtlas2 uses $a = 1 , r = - 1$ (Jacomy et al., 2014); LinLog uses $a = 0 , r = - 1$ (Noack, 2007). Efficient implementations can be based on Barnes–Hut approximation of the repulsive forces, as in SFDP (Hu, 2005). Relationship to neighbour embeddings was discussed by Bohm et al. (2022). ¨
|
| 27 |
+
|
| 28 |
+
Graph layouts inspired by $t$ -SNE Several recent graph layout algorithms have been inspired by neighbor embeddings. tsNET (Kruiger et al., 2017) applied modified version of $t$ -SNE to the pairwise shortest path distances between all nodes. DRGraph (Zhu et al., 2020a) made tsNET faster by using negative sampling (Mikolov et al., 2013). $t$ -FDP (Zhong et al., 2023) suggested custom $F _ { a }$ and $F _ { r }$ forces inspired by $t$ -SNE and adopted interpolation-based approximation of Linderman et al. (2019). Below we will show that our graph $t$ -SNE outperforms both DRGraph and $t$ -FDP. Finally, Leow et al. (2019) also suggested an algorithm called ‘graph $t$ -SNE’, that used a graph convolutional network (Kipf & Welling, 2017) to build a parametric mapping optimizing a combination of $t$ -SNE losses on node features and on shortest graph distances; it has almost no relation to our graph $t { \cdot }$ -SNE.
|
| 29 |
+
|
| 30 |
+
Node-level graph contrastive learning The basic principle behind contrastive learning is to learn data representation by contrasting pairs of observations that are similar to each other (positive pairs) with those that are dissimilar to each other (negative pairs). In computer vision, positive pairs are generated via data augmentation, e.g. in SimCLR (Chen et al., 2020). Graph contrastive learning (GCL) requires node features (as input to the network) and can be graph-level or node-level, depending on whether representations are obtained for a set of graphs or for the set of nodes of a single graph. Graph-level GCL is based on graph augmentations, such as node dropping or edge perturbation, e.g. in GraphCL (You et al., 2020). Prominent examples of node-level GCL algorithms that are also based on graph augmentations include GRACE (Zhu et al., 2020b), GCA (Zhu et al., 2021), MVGRL (Hassani & Khasahmadi, 2020), DGI (Velickovic et al., 2019), BGRL (Thakoor et al., 2021), CCA-SSG (Zhang et al., 2021), etc. All of them use graph convolutional networks (GCN) to create graph embeddings.
|
| 31 |
+
|
| 32 |
+
Augmentation-free node-level GCL A general problem with domain-agnostic graph augmentations is that they can have unpredictable effects on graph semantics (Trivedi et al., 2022), as even minor augmentations can potentially result in a semantically different graph. This motivated development of augmentation-free GCL methods. Here positive pairs are pairs of nodes that are located close to each other in terms of graph distance. AFGRL (Lee et al., 2022) and AF-GCL (Li et al., 2023) treat nodes with small shortest path distance as candidate positives, and use $k$ nearest neighbors in GCN-based node representations to select actual positives. Local-GCL (Zhang et al., 2022) uses all first-order graph neighbors as positives, and employs random Fourier features to approximate $\mathcal { O } ( n ^ { 2 } )$ repulsive forces. All of these methods are also based on the GCN architecture.
|
| 33 |
+
|
| 34 |
+
# 3 BACKGROUND
|
| 35 |
+
|
| 36 |
+
# 3.1 NEIGHBOR EMBEDDINGS
|
| 37 |
+
|
| 38 |
+
Neighbor embeddings are a family of methods aiming to embed $n$ observations from some highdimensional metric space $\mathcal { X }$ into a lower-dimensional (usually two-dimensional) vector space $\bar { \mathbb { R } } ^ { d }$ , such that neighborhood relationships between observations are preserved in the embedding space. Typically, $\mathcal { X }$ is another real-valued space $\mathbb { R } ^ { p }$ , with $d \ll p$ . We denote the original vectors as $\mathbf { x } _ { i } \in \mathbb { R } ^ { p }$ and the embedding vectors as $\mathbf { y } _ { i } \in \bar { \mathbb { R } } ^ { d }$ .
|
| 39 |
+
|
| 40 |
+
One of the most popular neighbor embedding methods, $t { \cdot }$ -distributed stochastic neighbor embedding ( $t$ -SNE; Van der Maaten $\&$ Hinton, 2008) is an extension of the stochastic neighbor embedding (SNE) originally suggested by Hinton & Roweis (2002). $t$ -SNE minimizes the Kullback-Leibler divergence between the high-dimensional and low-dimensional affinities $p _ { i j }$ and $q _ { i j }$ :
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\mathcal { L } = \mathrm { { K L } } ( \mathbf { P } \parallel \mathbf { Q } ) = \sum _ { i j } p _ { i j } \log \frac { p _ { i j } } { q _ { i j } } .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Both affinity matrices are defined to be symmetric, positive, and to sum to 1. In the original algorithm, $\mathbf { P }$ was computed using adaptive Gaussian kernels, but almost the same results can be obtained simply by normalizing and symmetrizing the $k \mathbf { N N }$ graph adjacency matrix A (Bohm et al., 2022): ¨
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathbf { P } = { \frac { \mathbf { A } / k + \mathbf { A } ^ { \top } / k } { 2 n } } .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Here A has element $a _ { i j } = 1$ if $\mathbf { x } _ { j }$ is within $k$ nearest neighbors of $\mathbf { x } _ { i }$ . Reasonable values of $k$ typically lie between 10 and 100. Low-dimensional affinities $\mathbf { Q }$ are defined in $t$ -SNE using a $t$ - distribution kernel with one degree of freedom, also known as the Cauchy kernel:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
q _ { i j } = \frac { ( 1 + \| \mathbf { y } _ { i } - \mathbf { y } _ { j } \| ^ { 2 } ) ^ { - 1 } } { \sum _ { k \neq l } ( 1 + \| \mathbf { y } _ { l } - \mathbf { y } _ { k } \| ^ { 2 } ) ^ { - 1 } } .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
The original SNE algorithm used Gaussian kernel instead of Cauchy, which led to worse results when embedding high-dimensional data (Kobak et al., 2019).
|
| 59 |
+
|
| 60 |
+
Even though it is usually not presented like that, $t$ -SNE can be thought of as a graph layout algorithm for $k \mathbf { N N }$ graphs, in particular after the reformulation in Equation 2. During optimization, neighboring nodes (sharing an edge) feel attraction, whereas all nodes feel repulsion, arising through the normalization in Equation 3. In practice, $t$ -SNE optimization can be accelerated by an approximation of the repulsive force field based on the Barnes–Hut algorithm (Van Der Maaten, 2014; Yang et al., 2013) or on interpolation (Linderman et al., 2019).
|
| 61 |
+
|
| 62 |
+
# 3.2 CONTRASTIVE NEIGHBOR EMBEDDINGS
|
| 63 |
+
|
| 64 |
+
The contrastive neighbor embedding (CNE) algorithm (Damrich et al., 2022) is a flexible framework that also operates on the $k \mathbf { N N }$ graph of the data, and optimizes the embedding in order to place connected nodes closer together than unconnected pairs of nodes. Damrich et al. (2022) considered three different loss functions: NCE (noise-contrastive estimation) (Gutmann & Hyvarinen, 2010), ¨ InfoNCE (Jozefowicz et al., 2016; Oord et al., 2018), and negative sampling (Mikolov et al., 2013). These loss functions are called contrastive because they are based on contrasting edges and nonedges in the same mini-batch, and do not require a global normalization like in Equation 3. Using NCE and InfoNCE in CNE approximates $t$ -SNE.
|
| 65 |
+
|
| 66 |
+
Damrich et al. (2022) also considered parametric embeddings, where a neural network (usually a fully-connected network) is trained to produce embedding vectors $\mathbf { y } _ { i } ~ = ~ f ( \mathbf { x } _ { i } )$ using one of the loss function listed above. This allows to embed new observations that have not been part of the training process. In contrast, non-parametric embeddings optimize $\mathbf { y } _ { i }$ vectors directly, without any $f ( \cdot )$ function. Together, this yields six combinations, called parametric/non-parametric NC$t$ -SNE, InfoNC- $\mathbf { \nabla } \cdot t$ -SNE, and Neg- $\cdot t$ -SNE. Damrich et al. (2022) showed that Neg- $\cdot t$ -SNE is equivalent to UMAP (McInnes et al., 2018), while NC- $\cdot t .$ -SNE was first suggested by Artemenkov & Panov (2020) as NCVis.
|
| 67 |
+
|
| 68 |
+
Table 1: Benchmark datasets. Columns: number of nodes in the largest connected component, number of undirected edges, edges/nodes ratio, number of node classes, feature dimensionality.
|
| 69 |
+
|
| 70 |
+
<table><tr><td>Dataset</td><td>Abbr.</td><td>Nodes</td><td>Edges</td><td>E/N</td><td>Classes</td><td>Dim.</td></tr><tr><td>CiteseerGraphDataset</td><td>CSR</td><td>2120</td><td>3679</td><td>1.7</td><td>6</td><td>3703</td></tr><tr><td>CoraGraphDataset</td><td>COR</td><td>2485</td><td>5069</td><td>2.0</td><td>7</td><td>1433</td></tr><tr><td>AmazonCoBuyPhotoDataset</td><td>APH</td><td>7487</td><td>119 043</td><td>15.9</td><td>8</td><td>745</td></tr><tr><td>AmazonCoBuyComputerDataset</td><td>ACO</td><td>13381</td><td>245 778</td><td>18.4</td><td>10</td><td>767</td></tr><tr><td>PubmedGraphDataset</td><td>PUB</td><td>19717</td><td>44324</td><td>2.2</td><td>3</td><td>500</td></tr><tr><td>ogbn-arxiv</td><td>ARX</td><td>169 343</td><td>1157799</td><td>6.8</td><td>40</td><td>128</td></tr></table>
|
| 71 |
+
|
| 72 |
+
In this work we will only use the InfoNCE loss function, defined for one graph edge $i j$ (positive pair) as
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\ell ( i , j ) = - \log \frac { q _ { i j } } { q _ { i j } + \sum _ { k = 1 } ^ { m } q _ { i k } } ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where the sum in the denominator is over $m$ negative pairs $i k$ where $k$ can be drawn from all nodes in the same mini-batch apart from $i$ and $j$ . One mini-batch consists of $b$ graph edges, and hence contains $2 b$ nodes. Therefore, for a given batch size $b$ , the maximal value of $m$ is $2 b - 2$ . The larger the $m$ , the closer InfoNC- $t$ -SNE is to $t$ -SNE (Damrich et al., 2022). The $q _ { i j }$ affinities do not need to be normalized and are defined simply as
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
q _ { i j } = ( 1 + \| \mathbf { y } _ { i } - \mathbf { y } _ { j } \| ^ { 2 } ) ^ { - 1 } .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
It is easy to see that InfoNCE loss will aim to make $q _ { i j }$ large if $i j$ is a positive pair and small if it is a negative one.
|
| 85 |
+
|
| 86 |
+
When using high-dimensional embedding space, e.g. $d = 1 2 8$ instead of $d = 2$ , it makes sense to define $q _ { i j }$ using the Gaussian kernel transformation of the cosine distance (Damrich et al., 2022; Bohm et al., 2023):¨
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
q _ { i j } = \exp \bigl ( \mathbf { y } _ { i } ^ { \mathsf { T } } \mathbf { y } _ { j } / ( \lVert \mathbf { y } _ { i } \rVert \cdot \lVert \mathbf { y } _ { j } \rVert ) / \tau \bigr ) = \mathrm { c o n s t } \cdot \exp \Big ( - \Big \lVert \frac { \mathbf { y } _ { i } } { \lVert \mathbf { y } _ { i } \rVert } - \frac { \mathbf { y } _ { j } } { \lVert \mathbf { y } _ { j } \rVert } \Big \rVert ^ { 2 } \Big / ( 2 \tau ) \Big ) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $\tau$ is called the temperature (by default, $\tau = 0 . 5$ ). Together with Equation 5, this gives the same loss function as used in SimCLR (Chen et al., 2020), a popular contrastive learning algorithm in computer vision. The only difference is that instead of $k \mathbf { N N }$ edges, SimCLR uses pairs of augmented images as positive pairs.
|
| 93 |
+
|
| 94 |
+
# 4 EXPERIMENTAL SETUP
|
| 95 |
+
|
| 96 |
+
Datasets We used six publicly available graph datasets (Table 1). All datasets were retrieved from the Deep Graph Library (Wang et al., 2019), except ogbn-arxiv, which was retrieved from the Open Graph Benchmark (Hu et al., 2020). Each dataset was treated as an unweighted undirected graph, where each node has a class label and a feature vector (typically a word embedding vector of some descriptive text about the node, such as a product review). We restricted ourselves to graphs with labeled nodes in order to use classification accuracy as the performance metric. We also restricted ourselves to graphs with feature vectors in order to use both non-parametric and parametric embeddings. In all datasets we used only the largest connected component, and excluded all selfloops if present, using NetworkX (Hagberg et al., 2008) functions connected components and selfloop edges.
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 2: Embeddings of the ACO and APH datasets obtained using FDP (Fruchterman & Reingold, 1991), DRGraph (Zhu et al., 2020a), and $t$ -FDP (Zhong et al., 2023), and our graph $t { \cdot }$ -SNE. Embeddings in each row were aligned using Procrustes rotation. See Figure A.3 for all six datasets.
|
| 100 |
+
|
| 101 |
+
Performance metrics We evaluated the performance of our methods using three performance metrics: $k$ -nearest-neighbors $( k \mathsf { N N } )$ recall, $k \mathbf { N N }$ classification accuracy, and, for high-dimensional embeddings, linear classification accuracy.
|
| 102 |
+
|
| 103 |
+
The $k \mathbf { N N }$ recall quantifies how well local node neighborhoods are preserved in the embedding. We defined it as the average fraction of each node’s graph neighbors that are among the node’s nearest neighbors in the embedding:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathrm { R e c a l l } = \frac { 1 } { | \mathcal { V } | } \sum _ { i = 1 } ^ { | \mathcal { V } | } \frac { \left| N _ { G } [ i ] \cap N _ { E , k _ { i } } [ i ] \right| } { k _ { i } } ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $| \nu |$ is the number of nodes in the graph, $N _ { G } [ i ]$ is the set of node $i$ ’s graph neighbors, $N _ { E , k } [ i ]$ denotes the set of node $i$ ’s $k$ Euclidean nearest neighbors in the embedding space, and $k _ { i } = | N _ { G } [ i ] |$ is the number of node $i$ ’s graph neighbors. This metric is similar to what is commonly used in the literature to benchmark graph layout algorithms (Kruiger et al., 2017; Zhu et al., 2020a; Zhong et al., 2023), and so is our main metric for measuring graph layout quality.
|
| 110 |
+
|
| 111 |
+
The $k \mathbf { N N }$ classification accuracy quantifies local class separation in the embedding. To calculate $k \mathbf { N N }$ accuracy, we split all nodes into a training $( 2 / 3$ of all nodes) and a test set $( 1 / 3$ of all nodes), and used the sklearn.neighbors.KNeighborsClassifier with $k = 1 0$ (Pedregosa et al., 2011). Of note, we used the train/test split only for training the classifier but not for computing the graph embedding itself. We used sklearn.preprocessing.StandardScaler to standardize all features based on the training set.
|
| 112 |
+
|
| 113 |
+
For graph CNE with $d = 1 2 8$ , trained using cosine distance, we experimented with using cosinedistance-based $k \mathbf { N N }$ recall and accuracy, but found that it gave very close results to the Euclideandistance-based $k \mathbf { N N }$ evaluations (all differences below 1 percentage point).
|
| 114 |
+
|
| 115 |
+
For linear accuracy we used the sklearn.linear model.LogisticRegression class with no regularization (penalty $=$ None) and otherwise default parameters, and the same train/test split. Features were standardized using StandardScaler.
|
| 116 |
+
|
| 117 |
+
Computing environment All computations were performed on a remote computing server with an Intel Xeon Gold CPU with 16 double-threaded 2.9 Ghz cores, 384 GB of RAM, and an NVIDIA RTX A6000 GPU. GPU training was used for CNE models but not for $t$ -SNE. Computation times are shown in Figure A.1. For the largest dataset (ARX), graph $t$ -SNE took around 100 seconds and graph CNE took around 60 minutes.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 3: Performance metrics for graph layouts: $k \mathbf { N N }$ recall and $k \mathbf { N N }$ accuracy. Datasets are ordered by the increasing sample size. See Figures 2 and A.3 for the corresponding layouts.
|
| 121 |
+
|
| 122 |
+
# 5 GRAPH LAYOUTS VIA GRAPH $t$ -SNE
|
| 123 |
+
|
| 124 |
+
The $t$ -SNE algorithm consists of two steps: first, it computes pairwise affinities between all pairs of points based on the $k \mathbf { N N }$ graph; second, it optimizes the embedding to match these affinities (Section 3.1). For graph $t$ -SNE, we replace the first step and obtain the affinity matrix directly from the graph adjacency matrix. We then run $t$ -SNE optimization to produce the embedding (Figure 1).
|
| 125 |
+
|
| 126 |
+
Given an unweighted graph $G = ( \nu , \mathcal { E } )$ , its adjacency matrix $\mathbf { A }$ is defined such that $A _ { i j } = 1$ if $( i , j ) \in \mathcal { E }$ and $A _ { i j } = 0$ otherwise. Since all graphs considered in this study are undirected, the adjacency matrix is a binary, symmetric square $n \times n$ matrix. In order to convert it into an affinity matrix suitable for $t$ -SNE, we follow the standard $t$ -SNE’s approach (Section 3.1): divide each row by the sum of its elements, then symmetrize the resulting matrix, and then normalize to sum to 1:
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mathbf { P } = { \frac { { \tilde { \mathbf { A } } } + { \tilde { \mathbf { A } } } ^ { \top } } { 2 n } } , { \mathrm { ~ w h e r e ~ } } { \tilde { A } } _ { i j } = A _ { i j } { \Big / } \sum _ { k = 1 } ^ { n } A _ { i k } .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
For optimization, we used the openTSNE library (Policar et al., 2019) with default parameters. It ˇ uses Laplacian Eigenmaps (Belkin & Niyogi, 2003) for initialization (Kobak & Linderman, 2021), sets the learning rate equal to $n$ to achieve good convergence (Linderman & Steinerberger, 2019; Belkina et al., 2019), and employs fast FIt-SNE algorithm that has linear ${ \mathcal { O } } ( n )$ runtime (Linderman et al., 2019).
|
| 133 |
+
|
| 134 |
+
We compared graph $t$ -SNE with three existing graph layout algorithms: FDP (Fruchterman & Reingold, 1991), DRGraph (Zhu et al., 2020a), and $t$ -FDP (Zhong et al., 2023). We chose FDP because it is the default layout algorithm in a popular NetworkX package (Hagberg et al., 2008). Two other algorithms, $t$ -FDP and DRGraph, are recent and can be considered state-of-the-art (we did not use tsNET (Kruiger et al., 2017) for benchmarking, because it cannot embed large graphs and is outperformed by its successor DRGraph). We used the NetworkX implementation of FDP (networkx.drawing.layout.spring layout) and the original implementations of both $t$ -FDP and DRGraph, all with default parameters (Figure 2).
|
| 135 |
+
|
| 136 |
+
We found that graph $t$ -SNE consistently outperformed all competitors in terms of both $k \mathbf { N N }$ recall and $k \mathbf { N N }$ accuracy (Figure 3): it showed the highest values on all datasets, 12 out of 12 times. In agreement with the original results of Zhu et al. (2020a) and Zhong et al. (2023), we saw that DRGraph and $t$ -FDP outperformed FDP in both metrics. Our graph $t$ -SNE showed further improvement, and it was substantial: in terms of $k \mathbf { N N }$ recall, graph $t$ -SNE improved on the best competitor on average by 18.2 percentage points, and in terms of $k \mathbf { N N }$ accuracy — on average by 6.7 percentage points. The improvement was particularly strong for the largest graph (ARX), where performance of other methods strongly deteriorated.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 4: Performance metrics for graph CNE compared to graph $t$ -SNE: $k \mathbf { N N }$ recall, $k \mathbf { N N }$ classification accuracy, and linear accuracy. Shading shows standard deviation over five CNE runs. Datasets are ordered by the increasing sample size.
|
| 140 |
+
|
| 141 |
+
Visually, the embeddings produced by graph $t$ -SNE looked similar to DRGraph embeddings (Figures 2 and A.3), but showed richer within-class structure, in agreement with the higher $k \mathbf { N N }$ recall values.
|
| 142 |
+
|
| 143 |
+
We have also experimented with an alternative way to convert the adjacency matrix into the affinity matrix: namely, to divide A by the sum of its elements: $\begin{array} { r } { \mathbf { P } = \mathbf { A } / \sum _ { i j } \hat { A _ { i j } } } \end{array}$ . This approach resulted in similar $k \mathbf { N N }$ recall and $k \mathbf { N N }$ accuracy values, but gave visually unpleasing embeddings, with lowdegree nodes pushed out to the periphery (Figure A.2). Furthermore, we experimented with various initialization schemes, but found that on our graphs, random initialization performed very similar to the default Laplacian Eigenmaps initialization.
|
| 144 |
+
|
| 145 |
+
# 6 NODE-LEVEL GRAPH CONTRASTIVE LEARNING VIA GRAPH CNE
|
| 146 |
+
|
| 147 |
+
Similar to $t$ -SNE, the CNE algorithm consists of two steps. First, it builds the $k \mathbf { N N }$ graph of the data. Second, it optimizes the embedding (in our case, parametric embedding) using a contrastive loss function such as InfoNCE to make neighbors be close in the embedding (Section 3.2). For graph CNE, we omit the first step and provide the graph to CNE directly.
|
| 148 |
+
|
| 149 |
+
We used parametric CNE models, setting the output dimensionality to $d = 2$ and $d = 1 2 8$ . In both cases we used a fully-connected network (MLP), as is default in CNE, with the number of neurons in each layer $D \ \to \ 1 0 0 \ \to \ 1 0 0 \ \to \ 1 0 0 \ \to \ d$ , where $D$ is the number of input node features (Table 1). For both dimensionalities we used the InfoNCE loss. Following Damrich et al. (2022), we used the cosine distance and the Gaussian similarity kernel for $d = 1 2 8$ , mimicking the standard SimCLR setup (Chen et al., 2020), and the Euclidean distance and the Cauchy similarity kernel for $d = 2$ , mimicking the standard $t$ -SNE setup. We set the number of negative samples to 100 (increasing it from the default 5 improved the results), and batch size to $\operatorname* { m i n } \{ \bar { 1 } 0 2 4 , | \mathcal { V } | / \bar { 1 } 0 \}$ (in pilot experiments we noticed that small graphs required smaller batch sizes for good convergence). The number of epochs was set to 100. Optimization parameters were left at default values: Adam optimizer (Kingma & Ba, 2015) with learning rate 0.001.
|
| 150 |
+
|
| 151 |
+
Compared to graph $t$ -SNE, graph CNE, with both $d = 2$ and $d = 1 2 8$ , had lower $k \mathbf { N N }$ recall (Figure 4). This is likely because graph CNE had to use node features, whereas graph $t$ -SNE was unconstrained by them and optimized graph neighborhood preservation directly. At the same time, $k \mathbf { N N }$ accuracy was very similar (Figure 4) on all datasets, apart from the ARX dataset. The comparatively poor performance of graph CNE on the ARX dataset was likely due to ARX feature space showing weak class separation (Table 2); whereas graph $t$ -SNE does not use node features and hence is not influenced by the feature quality. Visually, two-dimensional graph CNE embeddings looked very similar to graph $t$ -SNE embeddings (Figure 1), even though the former were parametric and the latter were non-parametric.
|
| 152 |
+
|
| 153 |
+
Table 2: Linear classification accuracy (in $\%$ ) of graph CNE and existing graph contrastive learning algorithms. Output dimensionality of CNE is indicated in brackets. The line marked by $\star$ shows $k \mathbf { N N }$ accuracy instead of linear accuracy. CNE values are mean $\pm$ standard deviation across five training runs. Non-CNE values are taken from Zhang et al. (2022), MLP values are taken from https://openreview.net/forum?id ${ . } = { }$ dSYkYNNZkV¬eId $\underline { { \underline { { \mathbf { \Pi } } } } } =$ aLQzIXVy0w and Guo et al. (2023). OOM denotes out-of-memory error. Datasets are ordered by the increasing sample size. For comparison, the first row shows linear accuracy in the feature space.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td>CSR</td><td>COR</td><td>APH</td><td>ACO</td><td>PUB</td><td>ARX</td></tr><tr><td>Feature space</td><td>70.3</td><td>68.6</td><td>90.7</td><td>79.6</td><td>87.8</td><td>55.1</td></tr><tr><td>Graph CNE (2)</td><td>65.4 ± 2.2</td><td>62.7 ± 6.2</td><td>73.2 ± 1.4</td><td>77.1 ±0.7</td><td>66.9 ± 2.3</td><td>41.7 ± 0.8</td></tr><tr><td>Graph CNE (2) *</td><td>72.1 ± 1.5</td><td>78.1± 3.2</td><td>92.9 ± 0.3</td><td>89.0± 0.2</td><td>77.2 ±0.6</td><td>45.3 ± 0.2</td></tr><tr><td>Graph CNE (128)</td><td>72.0 ± 1.3</td><td>80.0± 1.2</td><td>92.9 ± 0.5</td><td>86.8±0.7</td><td>84.6±0.6</td><td>52.9 ± 0.3</td></tr><tr><td>GRACE</td><td>71.2 ± 0.5</td><td>81.9 ± 0.4</td><td>92.2± 0.2</td><td>86.3± 0.3</td><td>80.6±0.4</td><td>0OM</td></tr><tr><td>GCA</td><td>72.1± 0.4</td><td>82.3 ± 0.4</td><td>92.5 ± 0.1</td><td>87.9 ± 0.3</td><td>80.7± 0.5</td><td>OOM</td></tr><tr><td>MVGRL</td><td>73.3 ± 0.5</td><td>83.5 ± 0.4</td><td>91.7± 0.1</td><td>87.5 ± 0.1</td><td>80.1±0.7</td><td>0OM</td></tr><tr><td>DGI</td><td>71.8±0.7</td><td>82.3 ± 0.6</td><td>91.6 ± 0.2</td><td>83.9± 0.5</td><td>76.8± 0.6</td><td>71.2 ± 0.2</td></tr><tr><td>BGRL</td><td>71.1±0.8</td><td>82.7 ± 0.6</td><td>93.1 ± 0.3</td><td>89.7 ± 0.4</td><td>79.6± 0.5</td><td>72.7± 0.2</td></tr><tr><td>CCA-SSG</td><td>73.1 ± 0.3</td><td>84.2 ± 0.4</td><td>93.1 ± 0.1</td><td>88.7± 0.3</td><td>81.6± 0.4</td><td>72.3 ± 0.2</td></tr><tr><td>AF-GCL</td><td>72.0±0.4</td><td>83.2± 0.2</td><td>92.5 ± 0.3</td><td>89.7±0.2</td><td>79.1 ± 0.8</td><td></td></tr><tr><td>AFGRL</td><td>68.7± 0.3</td><td>81.3± 0.2</td><td>93.2 ± 0.3</td><td>89.9 ± 0.3</td><td>80.6± 0.4</td><td>0OM</td></tr><tr><td>Local-GCL</td><td>73.6 ± 0.4</td><td>84.5± 0.4</td><td>93.3 ± 0.4</td><td>88.8±0.4</td><td>82.1 ± 0.5</td><td>71.3 ± 0.3</td></tr><tr><td>Local-GCL,MLP</td><td>70.3± 0.6</td><td>78.3± 0.5</td><td>90.9±0.4</td><td>82.4±0.5</td><td>79.6± 0.5</td><td></td></tr><tr><td>GRACE, MLP</td><td>65.5 ± 2.6</td><td>67.7 ± 0.9</td><td>87.9 ± 0.6</td><td>80.9 ± 1.2</td><td>83.3± 0.5</td><td></td></tr></table>
|
| 156 |
+
|
| 157 |
+
As expected, CNE with $d = 1 2 8$ , yielded considerably higher linear classification accuracy compared to both 2-dimensional embeddings (Figure 4). In terms of linear accuracy, graph CNE performed comparably to the state-of-the-art graph contrastive learning (GCL) algorithms1 (Table 2). Graph CNE achieved the best results on one of the datasets (PUB), and had close to the best results on other datasets, apart from the ARX.
|
| 158 |
+
|
| 159 |
+
Note that graph CNE was at disadvantage compared to all other GCL methods listed in Table 2 because it used an MLP network, whereas other GCL methods traditionally use graph convolutional networks (GCN). GCN takes the entire graph as input and uses message passing, which pulls together embeddings of connected nodes and helps to obtain better embeddings. However, GCN is not able to transform one node at a time, and so a trained GCN cannot be applied to a new, held-out node. In contrast, our graph CNE with MLP can (after training) process one node at a time, which we consider more appropriate for node-level graph learning (see Discussion). There are very few GCL results based on the MLP architecture reported in the literature. Two examples are Local-GCL and GRACE trained with MLP architecture (reported in the OpenReview discussion of Zhang et al. (2022) and in Guo et al. (2023) respectively, Table 2): both had lower accuracy compared to our graph CNE on all datasets.
|
| 160 |
+
|
| 161 |
+
For the ARX graph, we did not find any existing MLP-based results. Lower performance of graph CNE compared to GCN-based GCL methods was, again, likely due to the feature space of this graph showing only weak class separation (Table 2, first row).
|
| 162 |
+
|
| 163 |
+
# 7 DISCUSSION
|
| 164 |
+
|
| 165 |
+
Summary Our paper makes three contributions, two practical and one conceptual:
|
| 166 |
+
|
| 167 |
+
i. We suggested a novel graph layout algorithm, graph $t$ -SNE, and showed that it outperforms existing competitors in preserving local graph structure.
|
| 168 |
+
|
| 169 |
+
ii. We suggested a novel node-level augmentation-free graph contrastive learning algorithm, graph CNE, and showed that it achieves comparable performance to the state-of-the-art methods despite using the MLP architecture, and outperforms existing MLP-based graph contrastive learning results.
|
| 170 |
+
iii. We established a conceptual connection between graph layouts and graph contrastive learning: we argued that both are instances of graph embeddings (non-parametric 2D embedding and parametric 128D embedding), and both can be efficiently implemented using neighbor embedding frameworks. We suggested a new task, parametric 2D embeddings (Figure 1), as a ‘missing link’ between these two existing tasks.
|
| 171 |
+
|
| 172 |
+
Simplicity Both graph $t$ -SNE and graph CNE are remarkably simple, because they use existing $t$ -SNE and CNE machinery out of the box. This is in stark contrast with competing algorithms. For example, existing graph layout algorithms inspired by $t$ -SNE, such as tsNET (Kruiger et al., 2017), DRGraph (Zhu et al., 2020a), and $t$ -FDP (Zhong et al., 2023), all develop their own machinery, implementation, and approximations, and deviate from $t$ -SNE in many different nontrivial ways (see Section 2). However, as we demonstrated, simply using $t$ -SNE (via graph $t$ -SNE), outperforms all of them in terms of layout quality.
|
| 173 |
+
|
| 174 |
+
Similarly, in node-level graph contrastive learning (GCL), the focus has been on developing graph augmentations (see Section 2), following the contrastive learning paradigm in computer vision that is based on image augmentations. Augmentation-free GCL methods such as AFGRL (Lee et al., 2022) and AF-GCL (Li et al., 2023) instead rely on complex heuristics to select positive pairs. Our approach is conceptually much simpler, as it uses the InfoNCE loss function with graph edges as positive pairs, and nothing else. The closest method in the literature is Local-GCL (Zhang et al., 2022), which also uses graph edges as positive pairs. The difference is that Local-GCL uses an approximation scheme to deal with $O ( n ^ { 2 } )$ repulsive forces, whereas we use the standard contrastive learning approach of within-batch repulsion, which is much simpler.
|
| 175 |
+
|
| 176 |
+
All of the existing GCL methods, including Local-GCL, employ graph convolutional neural networks (GCNs). Recent work argued that the reason many GCL algorithms work well has little to do with the specific augmentations or heuristics they use, but rather is due to their GCN architecture (Trivedi et al., 2022; Guo et al., 2023). GCN uses message passing between graph nodes, which implicitly makes representations of connected node pairs more similar. In other words, in GCL algorithms employing GCNs, it is the GCN that does the heavy lifting, and not the specifics of the GCL algorithm. In contrast, our graph CNE uses an MLP network, and nevertheless performed similarly well. See below on why we think MLP is a more suitable choice for node-level GCL tasks.
|
| 177 |
+
|
| 178 |
+
Limitations In this work, we focused on complex real-world graphs and have purposefully not tested our graph $t$ -SNE on simple planar graphs or 3D mesh graphs that are often used for benchmarking graph layout algorithms. We suspect that graph $t$ -SNE would perform suboptimally on such graphs, as $t$ -SNE is known to have troubles with embedding simple 2D manifolds such as the Swiss roll. To some extent this can be addressed by increasing the degree of freedom parameter of the $t$ -distribution or using the Gaussian kernel instead (Kobak et al., 2019), and/or by increasing the exaggeration value (Kobak & Berens, 2019; Bohm et al., 2022; Damrich et al., 2022). ¨
|
| 179 |
+
|
| 180 |
+
Our graph CNE relies on the MLP and we did not experiment with GCN architecture. This, however, is not a limitation but a purposeful design choice: we think that GCN, whereas very meaningful for graph-level learning, is less applicable for node-level learning, where one may want to apply the trained model to a set of new objects (based on their node features). With GCN, this is not possible, as it requires the entire graph to be passed in at the same time. We therefore consider MLP architecture more appropriate for node-level GCL.
|
| 181 |
+
|
| 182 |
+
Take-home message We showed that graph layouts and graph contrastive learning are intimately related and can be approached by existing neighbour embedding frameworks, surpassing state-ofthe-art results.
|
| 183 |
+
|
| 184 |
+
# REFERENCES
|
| 185 |
+
|
| 186 |
+
Aleksandr Artemenkov and Maxim Panov. NCVis: noise contrastive approach for scalable visualization. In Proceedings of The Web Conference 2020, pp. 2941–2947, 2020.
|
| 187 |
+
|
| 188 |
+
Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural Computation, 15(6):1373–1396, 2003.
|
| 189 |
+
Anna C Belkina, Christopher O Ciccolella, Rina Anno, Richard Halpert, Josef Spidlen, and Jennifer E Snyder-Cappione. Automated optimized parameters for T-distributed stochastic neighbor embedding improve visualization and analysis of large datasets. Nature Communications, 10(1): 5415, 2019.
|
| 190 |
+
Jan Niklas Bohm, Philipp Berens, and Dmitry Kobak. Attraction-repulsion spectrum in neighbor ¨ embeddings. The Journal of Machine Learning Research, 23(1):4118–4149, 2022.
|
| 191 |
+
Jan Niklas Bohm, Philipp Berens, and Dmitry Kobak. Unsupervised visualization of image datasets ¨ using contrastive learning. International Conference on Learning Representations, 2023.
|
| 192 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International Conference on Machine Learning, pp. 1597–1607. PMLR, 2020.
|
| 193 |
+
Sebastian Damrich, Niklas Bohm, Fred A Hamprecht, and Dmitry Kobak. From ¨ $t$ -SNE to UMAP with contrastive learning. In The Eleventh International Conference on Learning Representations, 2022.
|
| 194 |
+
Thomas MJ Fruchterman and Edward M Reingold. Graph drawing by force-directed placement. Software: Practice and Experience, 21(11):1129–1164, 1991.
|
| 195 |
+
Xiaojun Guo, Yifei Wang, Zeming Wei, and Yisen Wang. Architecture matters: Uncovering implicit mechanisms in graph contrastive learning. In Thirty-seventh Conference on Neural Information Processing Systems, 2023.
|
| 196 |
+
Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle ¨ for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 297–304. JMLR Workshop and Conference Proceedings, 2010.
|
| 197 |
+
Aric Hagberg, Pieter Swart, and Daniel S Chult. Exploring network structure, dynamics, and function using NetworkX. Technical report, Los Alamos National Lab, 2008.
|
| 198 |
+
Kaveh Hassani and Amir Hosein Khasahmadi. Contrastive multi-view representation learning on graphs. In International Conference on Machine Learning, pp. 4116–4126. PMLR, 2020.
|
| 199 |
+
Geoffrey E Hinton and Sam Roweis. Stochastic neighbor embedding. Advances in Neural Information Processing Systems, 15, 2002.
|
| 200 |
+
Tianyang Hu, Zhili Liu, Fengwei Zhou, Wenjia Wang, and Weiran Huang. Your contrastive learning is secretly doing stochastic neighbor embedding. International Conference on Learning Representations, 2023.
|
| 201 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. Advances in Neural Information Processing Systems, 33:22118–22133, 2020.
|
| 202 |
+
Yifan Hu. Efficient, high-quality force-directed graph drawing. Mathematica Journal, 10(1):37–71, 2005.
|
| 203 |
+
Mathieu Jacomy, Tommaso Venturini, Sebastien Heymann, and Mathieu Bastian. ForceAtlas2, a continuous graph layout algorithm for handy network visualization designed for the gephi software. PloS One, 9(6):e98679, 2014.
|
| 204 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
|
| 205 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, 2015.
|
| 206 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. International Conference for Learning Representations, 2017.
|
| 207 |
+
Dmitry Kobak and Philipp Berens. The art of using t-SNE for single-cell transcriptomics. Nature Communications, 10(1):5416, 2019.
|
| 208 |
+
Dmitry Kobak and George C Linderman. Initialization is critical for preserving global data structure in both t-SNE and UMAP. Nature Biotechnology, 39(2):156–157, 2021.
|
| 209 |
+
Dmitry Kobak, George Linderman, Stefan Steinerberger, Yuval Kluger, and Philipp Berens. Heavytailed kernels reveal a finer cluster structure in t-SNE visualisations. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 124–139. Springer, 2019.
|
| 210 |
+
Johannes F Kruiger, Paulo E Rauber, Rafael Messias Martins, Andreas Kerren, Stephen Kobourov, and Alexandru C Telea. Graph layouts by t-SNE. In Computer Graphics Forum, volume 36, pp. 283–294. Wiley Online Library, 2017.
|
| 211 |
+
Namkyeong Lee, Junseok Lee, and Chanyoung Park. Augmentation-free self-supervised learning on graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 7372–7380, 2022.
|
| 212 |
+
Yao Yang Leow, Thomas Laurent, and Xavier Bresson. GraphTSNE: a visualization technique for graph-structured data. Representation Learning on Graphs and Manifold Workshop at the International Conference for Learning Representations, 2019.
|
| 213 |
+
Haifeng Li, Jun Cao, Jiawei Zhu, Qinyao Luo, Silu He, and Xuying Wang. Augmentation-free graph contrastive learning of invariant-discriminative representations. IEEE Transactions on Neural Networks and Learning Systems, pp. 1–11, 2023.
|
| 214 |
+
George C Linderman and Stefan Steinerberger. Clustering with t-SNE, provably. SIAM Journal on Mathematics of Data Science, 1(2):313–332, 2019.
|
| 215 |
+
George C Linderman, Manas Rachh, Jeremy G Hoskins, Stefan Steinerberger, and Yuval Kluger. Fast interpolation-based t-SNE for improved visualization of single-cell RNA-seq data. Nature Methods, 16(3):243–245, 2019.
|
| 216 |
+
Leland McInnes, John Healy, and James Melville. UMAP: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.03426, 2018.
|
| 217 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. Advances in Neural Information Processing Systems, 26, 2013.
|
| 218 |
+
Andreas Noack. Energy models for graph clustering. Journal of Graph Algorithms and Applications, 11(2):453–480, 2007.
|
| 219 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 220 |
+
Fabian Pedregosa, Gael Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier ¨ Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, et al. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 221 |
+
Pavlin G Policar, Martin Stra ˇ zar, and Bla ˇ z Zupan. openTSNE: a modular Python library for t-SNE ˇ dimensionality reduction and embedding. BioRxiv, pp. 731877, 2019.
|
| 222 |
+
Shantanu Thakoor, Corentin Tallec, Mohammad Gheshlaghi Azar, Mehdi Azabou, Eva L Dyer, Remi Munos, Petar Velickovi ˇ c, and Michal Valko. Large-scale representation learning on graphs ´ via bootstrapping. arXiv preprint arXiv:2102.06514, 2021.
|
| 223 |
+
Puja Trivedi, Ekdeep Singh Lubana, Yujun Yan, Yaoqing Yang, and Danai Koutra. Augmentations in graph contrastive learning: Current methodological flaws & towards better practices. In Proceedings of the ACM Web Conference 2022, pp. 1538–1549, 2022.
|
| 224 |
+
Laurens Van Der Maaten. Accelerating t-SNE using tree-based algorithms. The Journal of Machine Learning Research, 15(1):3221–3245, 2014.
|
| 225 |
+
Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9(11), 2008.
|
| 226 |
+
Petar Velickovic, William Fedus, William L Hamilton, Pietro Lio, Yoshua Bengio, and R Devon. \` 676 hjelm. Deep graph infomax. ICLR, 2(3):4, 2019.
|
| 227 |
+
Minjie Wang, Da Zheng, Zihao Ye, Quan Gan, Mufei Li, Xiang Song, Jinjing Zhou, Chao Ma, Lingfan Yu, Yu Gai, et al. Deep graph library: A graph-centric, highly-performant package for graph neural networks. arXiv preprint arXiv:1909.01315, 2019.
|
| 228 |
+
Yifei Wang, Qi Zhang, Tianqi Du, Jiansheng Yang, Zhouchen Lin, and Yisen Wang. A message passing perspective on learning dynamics of contrastive learning. International Conference on Learning Representations, 2023.
|
| 229 |
+
Zhirong Yang, Jaakko Peltonen, and Samuel Kaski. Scalable optimization of neighbor embedding for visualization. In International Conference on Machine Learning, pp. 127–135. PMLR, 2013.
|
| 230 |
+
Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, and Yang Shen. Graph contrastive learning with augmentations. Advances in Neural Information Processing Systems, 33:5812–5823, 2020.
|
| 231 |
+
Hengrui Zhang, Qitian Wu, Junchi Yan, David Wipf, and Philip S Yu. From canonical correlation analysis to self-supervised graph neural networks. Advances in Neural Information Processing Systems, 34:76–89, 2021.
|
| 232 |
+
Hengrui Zhang, Qitian Wu, Yu Wang, Shaofeng Zhang, Junchi Yan, and Philip S Yu. Localized contrastive learning on graphs. arXiv preprint arXiv:2212.04604, 2022.
|
| 233 |
+
Fahai Zhong, Mingliang Xue, Jian Zhang, Fan Zhang, Rui Ban, Oliver Deussen, and Yunhai Wang. Force-directed graph layouts revisited: a new force based on the t-distribution. IEEE Transactions on Visualization and Computer Graphics, 2023.
|
| 234 |
+
Minfeng Zhu, Wei Chen, Yuanzhe Hu, Yuxuan Hou, Liangjun Liu, and Kaiyuan Zhang. DRGraph: An efficient graph layout algorithm for large-scale graphs by dimensionality reduction. IEEE Transactions on Visualization and Computer Graphics, 27(2):1666–1676, 2020a.
|
| 235 |
+
Yanqiao Zhu, Yichen Xu, Feng Yu, Qiang Liu, Shu Wu, and Liang Wang. Deep graph contrastive representation learning. arXiv preprint arXiv:2006.04131, 2020b.
|
| 236 |
+
Yanqiao Zhu, Yichen Xu, Feng Yu, Qiang Liu, Shu Wu, and Liang Wang. Graph contrastive learning with adaptive augmentation. In Proceedings of the Web Conference 2021, pp. 2069–2080, 2021.
|
| 237 |
+
|
| 238 |
+
# A SUPPLEMENTARY FIGURES
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure A.1: Computation times for graph $t$ -SNE and graph CNE with 2 and 128 output dimensions. openTSNE was run on CPU with $\mathrm { n - j } \mathrm { o b s = - 1 }$ . CNE was run on GPU. Datasets are ordered by the increasing number of nodes. The runtime of openTSNE (for a given number of gradient descent steps) grows linearly with the number of nodes. The runtime of CNE (for a given number of epochs and a given batch size) grows linearly with the number of edges. The Pubmed dataset (PUB) has fewer edges than the Amazon datasets (APH and ACO), see Table 1.
|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
ACO, per-node normalization
|
| 245 |
+
ACO, whole-matrix normalization
|
| 246 |
+
Figure A.2: Graph $t { \cdot }$ -SNE visualizations of ACO and APH datasets using per-node normalization of the adjacency matrix (default) and whole-matrix normalization. Embeddings in each row were aligned using Procrustes rotation.
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
Figure A.3: Embeddings of all considered datasets obtained using FDP (Fruchterman & Reingold, 1991), DRGraph (Zhu et al., 2020a), and $t$ -FDP (Zhong et al., 2023), and our graph $t$ -SNE. Embeddings in each row were aligned using Procrustes rotation.
|
md/test/B6t5wy6g5a/B6t5wy6g5a.md
ADDED
|
@@ -0,0 +1,591 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ALIGNING LARGE MULTIMODAL MODELS WITH FACTUALLY AUGMENTED RLHF
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Large Multimodal Models (LMM) are built across modalities and the misalignment between two modalities can result in “hallucination”, generating textual outputs that are not grounded by the multimodal information in context. To address the multimodal misalignment issue, we adapt the Reinforcement Learning from Human Feedback (RLHF) from the text domain to the task of vision-language alignment, where human annotators are asked to compare two responses and pinpoint the more hallucinated one, and the vision-language model is trained to maximize the simulated human rewards. We propose a new alignment algorithm called Factually Augmented RLHF that augments the reward model with additional factual information such as image captions and ground-truth multi-choice options, which alleviates the reward hacking phenomenon in RLHF and further improves the performance. We also enhance the GPT-4-generated training data (for vision instruction tuning) with previously available human-written imagetext pairs to improve the general capabilities of our model. To evaluate the proposed approach in real-world scenarios, we develop a new evaluation benchmark MMHAL-BENCH with a special focus on penalizing hallucinations. As the first LMM trained with RLHF, our approach achieves remarkable improvement on the LLaVA-Bench dataset with the $96 \%$ performance level of the text-only GPT-4 (while previous best methods can only achieve the $87 \%$ level), and an improvement by $60 \%$ on MMHAL-BENCH over other baselines.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Large Language Models (LLMs; Brown et al. (2020); Chowdhery et al. (2022); OpenAI (2023)) can delve into the multimodal realm either by further pre-training with image-text pairs (Alayrac et al.; Awadalla et al., 2023) or by fine-tuning them with specialized vision instruction tuning datasets (Liu et al., 2023b; Zhu et al., 2023), leading to the emergence of powerful Large Multimodal Models (LMMs). Yet, developing LMMs faces challenges, notably the gap between the volume and quality of multimodal data versus text-only datasets. Consider the LLaVA model (Liu et al., 2023b), which is initialized from a pre-trained vision encoder (Radford et al., 2021) and an instruction-tuned language model (Chiang et al., 2023). It is trained on just 150K synthetic image-based dialogues, which is much less in comparison to the text-only models (Flan (Longpre et al., 2023) utilizing over 100M examples spanning 1800 tasks. Such limitations in data can lead to misalignment between the vision and language modalities. Consequently, LMMs may produce hallucinated outputs, which are not accurately anchored to the context provided by images.
|
| 12 |
+
|
| 13 |
+
To mitigate the challenges posed by the scarcity of high-quality visual instruction tuning data for LMM training, we introduce LLaVA-RLHF, a vision-language model trained for improved multimodal alignment. One of our key contributions is the adaptation of the Reinforcement Learning from Human Feedback (RLHF) (Stiennon et al., 2020; Ouyang et al., 2022; Bai et al., 2022a), a general and scalable alignment paradigm that shows great success for text-based AI agents, to the multimodal alignment for LMMs. By collecting human preferences with an emphasis on detecting hallucinations1, we utilize those preferences in reinforcement learning for LMM fine-tuning (Ziegler
|
| 14 |
+
|
| 15 |
+
Question: Where is this photo taken?
|
| 16 |
+
|
| 17 |
+
Ground Truth: From the slogan “Welcome to Houston, Texas”, we can infer that this photo is taken at an airport in Houston, Texas.
|
| 18 |
+
|
| 19 |
+
LLaVA:
|
| 20 |
+
This photo is taken at an airport.
|
| 21 |
+
LLaVA- $\mathbf { S F T ^ { + } }$ :
|
| 22 |
+
This photo is taken at the Houston airport.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
|
| 26 |
+
# LLaVA-RLHF:
|
| 27 |
+
|
| 28 |
+
This photo is taken in the baggage claim area of an airport, specifically in the lobby of the George Bush Intercontinental Airport in Houston, Texas. The large sign in the background indicates the airport’s name and location. The presence of multiple people, handbags, and suitcases in the scene further supports the fact that this is indeed an airport setting.
|
| 29 |
+
|
| 30 |
+
# Question:
|
| 31 |
+
|
| 32 |
+
What is the gender of the person riding the motorcycle in the image?
|
| 33 |
+
|
| 34 |
+
Ground Truth: No one is riding the motorcycle in the image.
|
| 35 |
+
|
| 36 |
+
LLaVA:
|
| 37 |
+
The person riding the motorcycle in the image is a woman. LLaVA- $\mathbf { S F T ^ { + } }$ :
|
| 38 |
+
The person riding the motorcycle in the image is a man.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
|
| 42 |
+
# LLaVA-RLHF:
|
| 43 |
+
|
| 44 |
+
The image does not provide enough information to determine the gender of the person riding the motorcycle. It only shows a motorcycle parked on the side of the road, and there is no indication of the rider’s gender. The rider could be a man or a woman, or even someone who identifies as nonbinary or gender non-conforming. It is important to avoid making assumptions about a person’s gender based on visual cues alone, as these assumptions can be inaccurate and potentially harmful.
|
| 45 |
+
|
| 46 |
+
Table 1: Qualitative examples to illustrate the effect of RLHF on Large Multimodal Model. LLaVARLHF is presented to be more helpful (above) and less hallucinated (bottom).
|
| 47 |
+
|
| 48 |
+
et al., 2019; Stiennon et al., 2020). Our approach can improve the multimodal alignment with a relatively low annotation cost, e.g., collecting 10K human preferences for image-based conversations with $\$ 3000$ . To the best of our knowledge, this approach is the first successful adaptation of RLHF to multimodal alignment.
|
| 49 |
+
|
| 50 |
+
A potential issue with the current RLHF paradigm is called reward hacking, which means achieving high scores from the reward model does not necessarily lead to improvement in human judgments. To prevent reward hacking, previous work (Bai et al., 2022a; Touvron et al., 2023b) proposed to iteratively collect “fresh” human feedback, which tends to be costly and cannot effectively utilize existing human preference data. In this work, we propose a more data-efficient alternative, i.e., we try to make the reward model capable of leveraging existing human-annotated data and knowledge in larger language models. Firstly, we improve the general capabilities of the reward model by using a better vision encoder with higher resolutions and a larger language model. Secondly, we introduce a novel algorithm named Factually Augmented RLHF (Fact-RLHF), which calibrates the reward signals by augmenting them with additional information such as image captions or ground-truth multi-choice option, as illustrated in Fig. 1.
|
| 51 |
+
|
| 52 |
+
To improve the general capabilities of LMMs during the Supervised Fine-Tuning (SFT) stage, we further augment the synthetic vision instruction tuning data (Liu et al., 2023b) with existing highquality human-annotated multi-modal data in the conversation format. Specifically, we convert VQA-v2 (Goyal et al., 2017a) and A-OKVQA (Schwenk et al., 2022) into a multi-round QA task, and Flickr30k (Young et al., 2014b) into a Spotting Captioning task (Chen et al., 2023a), and train the LLaVA-SFT+ models based on the new mixture of data.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 1: Illustration of how hallucination may occur during the Supervised Fine-Tuning (SFT) phase of LMM training and how Factually Augmented RLHF alleviates the issue of limited capacity in the reward model which is initialized from the SFT model.
|
| 56 |
+
|
| 57 |
+
Lastly, we look into assessing the multimodal alignment of LMMs in real-world generation scenarios, placing particular emphasis on penalizing any hallucinations. We create a set of varied benchmark questions that cover the 12 main object categories in COCO (Lin et al., 2014) and include 8 different task types, leading to MMHAL-BENCH. Our evaluation indicates that this benchmark dataset aligns well with human evaluations, especially when scores are adjusted for anti-hallucinations. In our experimental evaluation, as the first LMM trained with RLHF, LLaVA-RLHF delivers impressive outcomes. We observed a notable enhancement on LLaVA-Bench, achieving $94 \%$ , an improvement by $60 \%$ in MMHAL-BENCH, and established new performance benchmarks for LLaVA with a $5 2 . 4 \%$ score on MMBench (Liu et al., 2023c) and an $8 2 . 7 \%$ F1 on POPE (Li et al., 2023d).
|
| 58 |
+
|
| 59 |
+
# 2 METHOD
|
| 60 |
+
|
| 61 |
+
In this study, we employ a multimodal Reinforcement Learning from Human Feedback (RLHF) approach to align Large Multimodal Models (LMMs) with human values (Sec. 2.1). The process begins with Multimodal Supervised Fine-Tuning to establish a foundational understanding of multimodal inputs (Sec. 2.2). This is enhanced by Multimodal Preference Modeling, where a reward model is trained with human-annotated comparisons to discern better responses (Sec. 2.3). The approach culminates with Reinforcement Learning and Factually Augmented RLHF, which refine the model’s responses for accuracy and factual alignment, leveraging high-quality instruction-tuning data and additional ground-truth information to combat reward hacking and hallucinations (Sec. 2.4).
|
| 62 |
+
|
| 63 |
+
# 2.1 MULTIMODAL RLHF
|
| 64 |
+
|
| 65 |
+
Reinforcement Learning from Human Feedback (RLHF) (Ziegler et al., 2019; Stiennon et al., 2020; Ouyang et al., 2022; Bai et al., 2022a) has emerged as a powerful and scalable strategy for aligning Large Language Models (LLMs) with human values. In this work, we use RLHF to align LMMs. The basic pipeline of our multimodal RLHF can be summarized into three stages:
|
| 66 |
+
|
| 67 |
+
Multimodal Supervised Fine-Tuning A vision encoder and a pre-trained LLM are jointly finetuned on an instruction-following demonstration dataset using token-level supervision to produce a supervised fine-tuned (SFT) model πSFT.
|
| 68 |
+
|
| 69 |
+
Multimodal Preference Modeling In this stage, a reward model, alternatively referred to as a preference model, is trained to give a higher score to the “better” response. The pairwise comparison training data are typically annotated by human annotators. Formally, let the aggregated preference data be represented as ${ \mathcal { D } } _ { \mathrm { R M } } = \{ ( { \mathcal { T } } , x , y _ { 0 } , y _ { 1 } , i ) \}$ , where $\mathcal { T }$ denotes the image, $x$ denotes the prompt, $y _ { 0 }$ and $y _ { 1 }$ are two associated responses, and $i$ indicates the index of the preferred response. The reward model employs a cross-entropy loss function:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathcal { L } ( r _ { \theta } ) = - \mathbf { E } _ { ( \mathcal { T } , x , y _ { 0 } , y _ { 1 } , i ) \sim \mathcal { D } _ { \mathrm { R M } } } \left[ \log \sigma ( r _ { \theta } ( \mathcal { T } , x , y _ { i } ) - r _ { \theta } ( \mathcal { T } , x , y _ { 1 - i } ) ) \right] .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Reinforcement Learning Here, a policy model, initialized through multimodal supervised finetuning (SFT) (Ouyang et al., 2022; Touvron et al., 2023b), is trained to generate an appropriate response for each user query by maximizing the reward signal as provided by the reward model. To address potential over-optimization challenges, notably reward hacking, a per-token KL penalty derived from the initial policy model (Ouyang et al., 2022) is sometimes applied. Formally, given the set of collected images and user prompts, ${ \mathcal { D } } _ { \mathrm { R L } } = \{ ( { \mathcal { T } } , x ) \}$ , along with the fixed initial policy model $\pi ^ { \mathrm { I N I T } }$ and the RL-optimized model $\mathcal { \bar { \pi } } _ { \phi } ^ { \mathrm { R L } }$ , the full optimization loss is articulated as:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { L } ( \pi _ { \phi } ^ { \mathrm { R L } } ) = - \mathbf { E } _ { ( \mathbb { Z } , x ) \in \mathcal { D } _ { \mathrm { R L } } , y \sim \pi ^ { R L } ( y | \mathbb { Z } , x ) } \left[ r _ { \theta } ( \mathbb { Z } , x , y ) - \beta \cdot \mathbb { D } _ { K L } \left( \pi _ { \phi } ^ { \mathrm { R L } } ( y | \mathbb { Z } , x ) \| \pi ^ { \mathrm { I N I T } } ( y | \mathbb { Z } , x ) \right) \right] ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\beta$ is the hyper-parameter to control the scale of the KL penalty.
|
| 82 |
+
|
| 83 |
+
# 2.2 AUGMENTING LLAVA WITH HIGH-QUALITY INSTRUCTION-TUNING
|
| 84 |
+
|
| 85 |
+
Recent studies (Zhou et al., 2023; Touvron et al., 2023b) show that high-quality instruction tuning data is essential for aligning Large Language Models (LLMs). We find this becomes even more salient for LMMs. As these models traverse vast textual and visual domains, clear tuning instructions are crucial. Correctly aligned data ensures models produce contextually relevant outputs, effectively bridging language and visual gaps. For example, LLaVA synthesized 150k visual instruction data using the text-only GPT-4, where an image is represented as the associated captions on bounding boxes to prompt GPT-4. Though careful filtering has been applied to improve the quality, the pipeline can occasionally generate visually misaligned instruction data that can not be easily removed with an automatic filtering script, as highlighted in Table 1.
|
| 86 |
+
|
| 87 |
+
In this work, we consider enhancing LLaVA (98k conversations, after holding out $6 0 \mathrm { k }$ conversations for preference modeling and RL training) with high-quality instruction-tuning data derived from existing human annotations. Specifically, we curated three categories of visual instruction data: “Yes” or “No” queries from VQA-v2 (83k) (Goyal et al., 2017b), multiple-choice questions from A-OKVQA (16k) (Marino et al., 2019), and grounded captions from Flickr30k (23k) (Young et al., 2014a). Our analysis revealed that this amalgamation of datasets significantly improved LMM capabilities on benchmark tests. Impressively, these results surpassed models (Dai et al., 2023; Li et al., 2023a; Laurenc¸on et al., 2023) trained on datasets an order of magnitude larger than ours, as evidenced by Table 7 and 4. 2
|
| 88 |
+
|
| 89 |
+
# Instruction
|
| 90 |
+
|
| 91 |
+
We have developed an AI assistant adept at facilitating image-based conversations. However, it occasionally generates what we call hallucinations, which are inaccuracies unsupported by the image content or real-world knowledge.
|
| 92 |
+
|
| 93 |
+
In this task, we request that you select the most appropriate response from the AI model based on the conversation context. When making this selection, primarily consider these two factors:
|
| 94 |
+
|
| 95 |
+
• Honesty: Fundamentally, the AI should provide accurate information and articulate its uncertainty without misleading the user. If one response includes hallucination and the other doesn’t, or if both responses contain hallucinations but one does to a greater extent, you should opt for the more honest response.
|
| 96 |
+
|
| 97 |
+
• Helpfulness: In scenarios where both responses are free from hallucinations, you should opt for the more helpful one. The AI should attempt to accomplish the task or answer the question posed, provided it’s not harmful, in the most helpful and engaging manner possible.
|
| 98 |
+
|
| 99 |
+
# Annotation Task
|
| 100 |
+
|
| 101 |
+
Please select the better response from A and B
|
| 102 |
+
[IMAGE]
|
| 103 |
+
[CONVERSATION CONTEXT]
|
| 104 |
+
[RESPONSE A]
|
| 105 |
+
[RESPONSE B]
|
| 106 |
+
|
| 107 |
+
uestion 1: Which response has fewer hallucinations in terms of the given image?
|
| 108 |
+
|
| 109 |
+
Question 2: If you have selected a tie between Response 1 and Response 2 from the previous question, which response would be more helpful or less incorrect?
|
| 110 |
+
|
| 111 |
+
Table 2: The instruction to the crowdworkers for human preference collection.
|
| 112 |
+
|
| 113 |
+
# 2.3 HALLUCINATION-AWARE PREFERENCE MODEL
|
| 114 |
+
|
| 115 |
+
Our preference model training process integrates a single reward model that emphasizes both multimodal alignment and overall helpfulness3. We collect human preferences on 10k hold-out LLaVA data by re-sampling the last response with our SFT model and a temperature of 0.7. The reward model is initialized from the SFT model to obtain the basic multimodal capabilities.
|
| 116 |
+
|
| 117 |
+
# 2.4 FACTUALLY AUGMENTED RLHF (FACT-RLHF)
|
| 118 |
+
|
| 119 |
+
We conduct multimodal RLHF on $5 0 \mathrm { k }$ hold-out LLaVA conversations, with additional $1 2 \mathrm { k }$ multichoice questions from A-OKVQA and 10k yes/no questions subsampled from VQA-v2. Due to the concerns of existing hallucinations in the synthetic multi-round conversation data of LLaVA, we only use the first question in each conversation for RL training, which avoids the pre-existing hallucinations in the conversational context.
|
| 120 |
+
|
| 121 |
+
Reward Hacking in RLHF In preliminary multimodal RLHF experiments, we observe that due to the intrinsic multimodal misalignment in the SFT model, the reward model is weak and sometimes cannot effectively detect hallucinations in the RL model’s responses. In the text domain, previous work (Bai et al., 2022a; Touvron et al., 2023b) proposed to iteratively collect “fresh” human feedback. However, this can be quite costly and cannot effectively utilize existing human-annotated data and there is no guarantee that more preference data can significantly improve the discriminative capabilities of the reward model for multimodal problems.
|
| 122 |
+
|
| 123 |
+
Facutual Augmentation To augment the capability of the reward model, we propose Factually Augmented RLHF (Fact-RLHF), where the reward model has access to additional ground-truth information such as image captions to calibrate its judgment. In original RLHF (Stiennon et al., 2020; OpenAI, 2022), the reward model needs to judge the quality of the response only based on the user query (i.e., the input image and prompt):
|
| 124 |
+
|
| 125 |
+
In Factually Augmented RLHF (Fact-RLHF), the reward model has additional information about the textual descriptions of the image:
|
| 126 |
+
|
| 127 |
+
Image: [IMAGE]
|
| 128 |
+
Factual Information: [5 COCO IMAGE CAPTIONS / 3 A-OKVQA RATIONALS]
|
| 129 |
+
User: [USER PROMPT]
|
| 130 |
+
Assistant: [RESPONSE]
|
| 131 |
+
Augmented Reward Model: [SCORE]
|
| 132 |
+
|
| 133 |
+
This prevents the reward model hacked by the policy model when the policy model generates some hallucinations that are clearly not grounded by the image captions. For general questions with COCO images, we concatenate the five COCO captions as the additional factual information, while for A-OKVQA questions, we use the annotated rationals as the factual information. The factually augmented reward model is trained on the same binary preference data as the vanilla reward model, except that the factual information is provided both during the model fine-tuning and inference.
|
| 134 |
+
|
| 135 |
+
Symbolic Rewards: Correctness Penalty & Length Penalty Certain questions come with a predetermined ground-truth answer in our RL data, including binary choices (e.g., “Yes/No”) in VQA-v2 and multiple-choice options (e.g., “ABCD”) in A-OKVQA. These annotations can also be regarded as additional factual information. Therefore, in the Fact-RLHF algorithm, we introduce a symbolic reward mechanism that penalizes selections that diverge from these ground-truth options. Furthermore, we observed that RLHF-trained models often produce more verbose outputs, a phenomenon also noted by Dubois et al. (2023). While these verbose outputs might be favored by users or by automated LLM-based evaluation systems (Sun et al., 2023; Zheng et al., 2023), they tend to introduce more hallucinations for LMMs. In this work, we incorporate the response length, measured in the number of tokens, as an auxiliary penalizing factor.
|
| 136 |
+
|
| 137 |
+
# 3 EXPERIMENTS
|
| 138 |
+
|
| 139 |
+
# 3.1 NEURAL ARCHITECTURES
|
| 140 |
+
|
| 141 |
+
Base Model We adopt the same network architecture as LLaVA (Liu et al., 2023b). Our LLM is based on Vicuna (Touvron et al., 2023a; Chiang et al., 2023), and we utilize the pre-trained CLIP visual encoder, ViT-L/14 (Radford et al., 2021). We use grid features both before and after the final Transformer layer. To project image features to the word embedding space, we employ a linear layer. It’s important to note that we use the pre-trained linear projection layer checkpoints from LLaVA, concentrating on the end-to-end fine-tuning phase for multi-modal alignment in our study. For $\mathrm { L L a V A – S F T ^ { + } 7 B }$ , we use a Vicuna- $. \mathrm { { V 1 . 5 } _ { 7 8 } }$ LLM and ViT-L/14 with image resolution $2 5 6 \times 2 5 6$ . For $\mathrm { L L a V A – S F T ^ { + } } _ { 1 3 \mathrm { B } }$ , we use a Vicuna- $\mathrm { V } 1 . 5 _ { 1 3 \mathrm { B } }$ LLM and ViT-L/14 with image resolution $3 3 6 \times 3 3 6$ .
|
| 142 |
+
|
| 143 |
+
Reward Model The architecture of the reward model is the same as the base LLaVA model, except that the embedding output of the last token is linearly projected to a scalar value to indicate the reward of the whole response. We use our own collected 10k human preference data to train the reward model with the cross-entropy loss (Eq. 1). Following Ouyang et al. (2022), we train the reward model for only one epoch to avoid over-fitting (mis-calibration). A size of 500 validation data is also held out for early stopping. The final reward model’s accuracy on the validation data is $65 \%$ , which is near our observed human labeler consistency of $\cdot$ (Appendix. G).
|
| 144 |
+
|
| 145 |
+
RL Models: Policy and Value Following Dubois et al. (2023), we initialize the value model from the reward model. Therefore, when training an $\mathrm { L L a V A _ { 7 B } }$ policy model with an $\mathrm { L L a v A } _ { 1 3 8 }$ reward model, the value model is also 13B. To fit all the models (i.e., police, reward, value, original policy) into one GPU, we adopt LoRA (Hu et al., 2021) for all the fine-tuning processes in RLHF. We use Proximal Policy Optimization (PPO; Schulman et al. (2017)) with a KL penalty for the RL training. Without further notice, both LLaVA-RLHF7B and LLaVA-RLHF13B are trained with a $\mathrm { L L a V \bar { A } – S F T ^ { + } } _ { 1 3 \mathrm { B } }$ initialized reward model. More details can be found in Appendix I.
|
| 146 |
+
|
| 147 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Subsets</td><td rowspan="2"></td></tr><tr><td>Conv Detail Complex Full-Set</td><td></td></tr><tr><td>LLaVA7B</td><td>75.1 75.4</td><td>92.3</td><td>81.0</td></tr><tr><td>VIGC7B</td><td>83.3 80.6</td><td>93.1</td><td>85.8</td></tr><tr><td>LLaVA-SFT+7B</td><td>88.8 74.6</td><td>95.0</td><td>86.3</td></tr><tr><td>LLaVA-RLHF7B</td><td>93.0 79.0</td><td>109.5</td><td>94.1</td></tr><tr><td>LLaVA13B×336</td><td>87.2 74.3</td><td>92.9</td><td>84.9</td></tr><tr><td>VIGC13B×336</td><td>88.9 77.4</td><td>93.5</td><td>86.8</td></tr><tr><td>LLaVA-SFT+13B×336</td><td>85.8 75.5</td><td>93.9</td><td>85.2</td></tr><tr><td>LLaVA-RLHF13B×336 93.9</td><td>82.5</td><td>110.1</td><td>95.6</td></tr></table>
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
|
| 151 |
+
Table 3: (left) Automatic evaluation of LLaVA-RLHF on the LLaVA-Bench Evaluation. GPT-4 compares the answers from the VLM model outputs with the answers by GPT-4 (text-only) and gives a rating. We report the relative scores (Liu et al., 2023b) of VLM models compared to GPT-4 (text-only). (right) Detailed performance of different models on the eight categories in MMHALBENCH, where “Overall” indicates the averaged performance across all categories. The questions are collected by adversarially filtering on the original LLaVA13BX336 model.
|
| 152 |
+
|
| 153 |
+
# 3.2 RESULTS
|
| 154 |
+
|
| 155 |
+
We use LLaVA-Bench (Liu et al., 2023b) and our MMHAL-BENCH4 as our main evaluation metrics for their high alignment with human preferences. In addition, we conducted tests on widelyrecognized Large Multimodal Model benchmarks. We employed MMBench (Liu et al., 2023c), a multi-modal benchmark offering an objective evaluation framework comprising 2,974 multiplechoice questions spanning 20 ability dimensions. This benchmark utilizes ChatGPT to juxtapose model predictions against desired choices, ensuring an equitable assessment of VLMs across varying instruction-following proficiencies. Furthermore, we incorporated POPE (Li et al., 2023d), a polling-based query technique, to offer an evaluation of VLM object perception tendencies.
|
| 156 |
+
|
| 157 |
+
High-quality SFT data is crucial for capability benchmarks. By delving into the specific performances for the capability benchmarks (i.e., MMBench and POPE), we observe a notable improvement in capabilities brought by high-quality instruction-tuning data $( \mathrm { L L a V A { - } S F T ^ { + } }$ ) in Tables 4 and $7 . \mathrm { L L a V A } \mathrm { \bar { - } S F T ^ { + } } _ { 7 \mathrm { B } }$ model exemplifies this with an impressive performance of $5 2 . 1 \%$ on MMBench and an $8 2 . 7 \%$ F1 score on POPE, marking an improvement over LLaVA by margins of $1 3 . 4 \%$ and $6 . 7 \%$ respectively. However, it’s worth noting that LLaVA-SFT+ does trail behind models like Kosmos and Shikra. Despite this, LLaVA-SFT+ stands out in terms of sample efficiency, utilizing only 220k fine-tuning data—a $5 \%$ fraction of what’s employed by the aforementioned models. Furthermore, this enhancement isn’t confined to just one model size. When scaled up, LLaVA- $\mathrm { S F T ^ { + } }$ 13BX336 achieves commendable results, attaining $5 7 . 5 \%$ on MMBench and $8 2 . 9 \%$ on POPE. Comparatively, the effect of RLHF on the capability benchmarks is more mixed. LLaVA-RLHF shows subtle degradations at the 7b scale, but the LLaVA- $\mathrm { R L H F } _ { 1 3 \mathrm { B } }$ improves over $\mathrm { L L a V A – S F T ^ { + } } _ { 1 3 \mathrm { B } }$ by $3 \%$ o n MMBench. This phenomenon is similar to the Alignment Tax observed in previous work (Bai et al., 2022a). Nonetheless, with our current empirical scaling law of LLaVA-RLHF (Kaplan et al., 2020; Askell et al., 2021), we believe RLHF alignment would not damage the in-general capabilities of LMMs for models of larger scales.
|
| 158 |
+
|
| 159 |
+
RLHF improves human alignment benchmarks further. From another angle, even though highquality instruction data demonstrates large gains in capability assessment, it does not improve much on human-alignment benchmarks including LLaVA-Bench and MMHAL-BENCH, which is also evident in recent LLM studies (Wang et al., 2023). LLaVA-RLHF show a significant improvement in aligning with human values. It attains scores of 2.05 (7b) and 2.53 (13b) on MMHAL-BENCH and improves LLaVA- $S \mathrm { F T ^ { + } }$ by over $10 \%$ on LLaVA-Bench. We also presented qualitative examples in Table 1, which shows LLaVA-RLHF produces more reliable and helpful outputs.
|
| 160 |
+
|
| 161 |
+
Table 4: CircularEval multi-choice accuracy results on MMBench dev set. We adopt the following abbreviations: LR for Logical Reasoning; AR for Attribute Reasoning; RR for Relation Reasoning; FP-C for Fine-grained Perception (Cross Instance); FP-S for Fine-grained Perception (Single Instance); CP for Coarse Perception. Baseline results are taken from Liu et al. (2023c).
|
| 162 |
+
|
| 163 |
+
<table><tr><td>LLM</td><td>Data</td><td>Overall</td><td>LR</td><td>AR</td><td>RR</td><td>FP-S</td><td>FP-C</td><td>CP</td></tr><tr><td>OpenFlaming09B</td><td>-</td><td>6.6</td><td>4.2</td><td>15.4</td><td>0.9</td><td>8.1</td><td>1.4</td><td>5.0</td></tr><tr><td>MiniGPT-47B</td><td>5k</td><td>24.3</td><td>7.5</td><td>31.3</td><td>4.3</td><td>30.3</td><td>9.0</td><td>35.6</td></tr><tr><td>LLaMA-Adapter7B</td><td>52k</td><td>41.2</td><td>11.7</td><td>35.3</td><td>29.6</td><td>47.5</td><td>38.6</td><td>56.4</td></tr><tr><td>Otter-I9B</td><td>2.8M</td><td>51.4</td><td>32.5</td><td>56.7</td><td>53.9</td><td>46.8</td><td>38.6</td><td>65.4</td></tr><tr><td>Shikra7B</td><td>5.5M</td><td>58.8</td><td>25.8</td><td>56.7</td><td>58.3</td><td>57.2</td><td>57.9</td><td>75.8</td></tr><tr><td>Kosmos-2</td><td>14M</td><td>59.2</td><td>46.7</td><td>55.7</td><td>43.5</td><td>64.3</td><td>49.0</td><td>72.5</td></tr><tr><td>InstructBLIP7B</td><td>1.2M</td><td>36.0</td><td>14.2</td><td>46.3</td><td>22.6</td><td>37.0</td><td>21.4</td><td>49.0</td></tr><tr><td>IDEFICS9B</td><td>1M</td><td>48.2</td><td>20.8</td><td>54.2</td><td>33.0</td><td>47.8</td><td>36.6</td><td>67.1</td></tr><tr><td>IDEFICS80B</td><td>1M</td><td>54.6</td><td>29.0</td><td>67.8</td><td>46.5</td><td>56.0</td><td>48.0</td><td>61.9</td></tr><tr><td>InstructBLIP13B</td><td>1.2M</td><td>44.0</td><td>19.1</td><td>54.2</td><td>34.8</td><td>47.8</td><td>24.8</td><td>56.4</td></tr><tr><td>LLaVA7B</td><td>158k</td><td>38.7</td><td>16.7</td><td>48.3</td><td>30.4</td><td>45.5</td><td>32.4</td><td>40.6</td></tr><tr><td>LLaVA-SFT+7B</td><td>220k</td><td>52.1</td><td>28.3</td><td>63.2</td><td>37.4</td><td>53.2</td><td>35.9</td><td>66.8</td></tr><tr><td>LLaVA-RLHF7B</td><td>280k</td><td>51.4</td><td>24.2</td><td>63.2</td><td>39.1</td><td>50.2</td><td>40.0</td><td>66.1</td></tr><tr><td>LLaVA13B×336</td><td>158k</td><td>47.5</td><td>23.3</td><td>59.7</td><td>31.3</td><td>41.4</td><td>38.6</td><td>65.8</td></tr><tr><td>LLaVA-SFT+ 13B x336</td><td>220k</td><td>57.5</td><td>25.8</td><td>65.7</td><td>54.8</td><td>57.9</td><td>51.0</td><td>68.5</td></tr><tr><td>LLaVA-RLHF13B×336</td><td>280k</td><td>60.1</td><td>29.2</td><td>67.2</td><td>56.5</td><td>60.9</td><td>53.8</td><td>71.5</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Table 5: Abalation studies on methodologies (SFT, RLHF, and Fact-RLHF), data mixtures (LLaVa with additional datasets), and model sizes of the policy model (PM) and the reward model (RM).
|
| 166 |
+
|
| 167 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">PM</td><td rowspan="2">RM</td><td colspan="3"> SFT Data</td><td rowspan="2">MMBench</td><td rowspan="2">POPE</td><td rowspan="2">LLaVA-B</td><td rowspan="2">MMHAL-B</td></tr><tr><td>VQA</td><td>AOK</td><td>Flickr</td></tr><tr><td>SFT</td><td>7b</td><td></td><td>X</td><td>X</td><td>X</td><td>38.7</td><td>76.0</td><td>81.0</td><td>1.3</td></tr><tr><td>SFT</td><td>7b</td><td></td><td>√</td><td>X</td><td>X</td><td>42.9</td><td>82.0</td><td>30.4</td><td>2.0</td></tr><tr><td>SFT</td><td>7b</td><td>=</td><td>×</td><td>√</td><td>X</td><td>48.5</td><td>79.8</td><td>34.7</td><td>1.1</td></tr><tr><td>SFT</td><td>7b</td><td></td><td></td><td>X</td><td>√</td><td>37.8</td><td>77.6</td><td>46.6</td><td>1.5</td></tr><tr><td>SFT</td><td>7b</td><td>-</td><td>√</td><td>√</td><td>√</td><td>52.1</td><td>82.7</td><td>86.3</td><td>1.8</td></tr><tr><td>RLHF</td><td>7b</td><td>7b</td><td></td><td></td><td></td><td>40.0</td><td>78.2</td><td>85.4</td><td>1.4</td></tr><tr><td>RLHF</td><td>7b</td><td>7b</td><td>x<></td><td></td><td></td><td>50.8</td><td>82.7</td><td>87.8</td><td>1.8</td></tr><tr><td>RLHF</td><td>7b</td><td>13b</td><td></td><td>√</td><td>√</td><td>48.9</td><td>82.7</td><td>93.4</td><td>1.8</td></tr><tr><td>Fact-RLHF</td><td>7b</td><td>13b</td><td>√</td><td>√</td><td>√</td><td>51.4</td><td>81.5</td><td>94.1</td><td>2.1</td></tr></table>
|
| 168 |
+
|
| 169 |
+
# 3.3 ABLATION ANALYSIS
|
| 170 |
+
|
| 171 |
+
We conduct ablation studies on $\mathrm { L L a V A _ { 7 B } }$ and evaluate over the four aforementioned benchmarks. We compare the performance of Fact-Augmented RLHF (Fact-RLHF) with standard RLHF in Table 5. Our findings indicate that while the conventional RLHF exhibits improvement on LLaVABench, it underperforms on MMHAL-BENCH. This can be attributed to the model’s tendency, during PPO, to manipulate the naive RLHF reward model by producing lengthier responses rather than ones that are less prone to hallucinations. On the other hand, our Fact-RLHF demonstrates enhancements on both LLaVA-Bench and MMHAL-BENCH. This suggests that Fact-RLHF not only better aligns with human preferences but also effectively minimizes hallucinated outputs. 5
|
| 172 |
+
|
| 173 |
+
# 4 RELATED WORK
|
| 174 |
+
|
| 175 |
+
Large Multimodal Models Recent success in Large Language Models (LLMs) (Brown et al., 2020; OpenAI, 2023; Chowdhery et al., 2022; Anil et al., 2023; Scao et al., 2022; Muennighoff et al., 2022; Touvron et al., 2023a;b; Taori et al., 2023; Chiang et al., 2023) Flamingo (Alayrac et al.) integrated LLMs into vision-language pretraining with its variants like OpenFlamingo (Awadalla et al., 2023) and IDEFICS (Laurenc¸on et al., 2023). PaLI (Chen et al., 2022; 2023b) studied V&L components scaling, while PaLM-E delved into the embodied domain. BLIP-2 (Li et al., 2023c) introduced the Q-former to connect image and language encoders, enhanced by InstructBLIP (Dai et al., 2023). Otter (Li et al., 2023b;a) boosts OpenFlamingo’s instruction-following, while MiniGPT-4 (Zhu et al., 2023), resembling GPT4’s capabilities, emphasizes efficiency and alignment of visual and linguistic models. mPLUG-Owl (Ye et al., 2023) employs a novel approach, first aligning visual features and then refining the language model with LoRA. Shikra Chen et al. (2023a) and Kosmos (Peng et al., 2023) utilize grounded image-text pairs in training. LRV (Liu et al., 2023a) synthetized “Yes/No” visual instruction data. QWen-VL (Bai et al., 2023) scaled LMM pre-training significantly, and LLaVA (Liu et al., 2023b; Lu et al., 2023) set a precedent in LMM by leveraging GPT4 for visionlanguage dataset generation. However, due to the syntactic nature of these generated datasets, misalignments between image and text modalities are prevalent. Our research is the first to address this misalignment through RLHF.
|
| 176 |
+
|
| 177 |
+
Hallucination Prior to the advent of LLMs, the NLP community primarily defined “hallucination” as the generation of nonsensical content or content that deviates from its source (Ji et al., 2023). The introduction of versatile LLMs has expanded this definition, as outlined by (Zhang et al., 2023) into: 1) Input-conflicting hallucination, which veers away from user-given input, exemplified in machine translation (Lee et al., 2018; Zhou et al., 2020); 2) Context-conflicting hallucination where output contradicts prior LLM-generated information (Shi et al., 2023); and 3) Fact-conflicting hallucination, where content misaligns with established knowledge (Lin et al., 2021). Within the LMM realm, “object hallucination” is well-documented (Rohrbach et al., 2018; MacLeod et al., 2017; Li et al., 2023d; Biten et al., 2022; Liu et al., 2023a), referring to models producing descriptions or captions including objects that don’t match or are missing from the target image. We expand on this, encompassing any LMM-generated description unfaithful to image aspects, including relations, attributes, environments, and so on. Consequently, we present MMHAL-BENCH, aiming to holistically pinpoint and measure hallucinations in LMMs.
|
| 178 |
+
|
| 179 |
+
# 5 DISCUSSIONS & LIMITATIONS
|
| 180 |
+
|
| 181 |
+
Hallucination phenomena are observed in both LLMs and LMMs. The potential reasons are twofold. Firstly, a salient factor contributing to this issue is the low quality of instruction tuning data for current LMMs, as they are typically synthesized by more powerful LLMs such as GPT-4. We expect our proposed high-quality vision instruction-tuning data and future efforts on manually curating high-quality visual instruction tuning data can alleviate this problem.
|
| 182 |
+
|
| 183 |
+
Secondly, the adoption of behavior cloning training in instruction-tuned LMMs emerges as another fundamental cause (Schulman, 2023). Since the instruction data labelers lack insight into the LMM’s visual perception of an image, such training inadvertently conditions LMMs to speculate on uncertain content. To circumvent this pitfall, the implementation of reinforcement learning-based training provides a promising avenue, guiding the model to articulate uncertainties more effectively (Lin et al., 2022; Kadavath et al., 2022). Our work demonstrates a pioneering effort in this direction. Figure 2 illustrates the two sources of hallucination in current behavior cloning training of LLMs.
|
| 184 |
+
|
| 185 |
+
However, while LLaVA-RLHF enhances human alignment, reduces hallucination, and encourages truthfulness and calibration, applying RLHF can inadvertently dampen the performance of smallsized LMMs. Balancing alignment enhancements without compromising the capability of LMM and LLM is still an unresolved challenge. Though we’ve demonstrated the effective use of linear projection in LLaVA with top-tier instruction data, determining an optimal mixture and scaling it to bigger models remains intricate. Our research primarily delves into the fine-tuning phase of VLMs, leaving the issues of misalignment in other modalities and during pre-training yet to be explored.
|
| 186 |
+
|
| 187 |
+
Finally, while MMHAL-BENCH focuses on curtailing hallucinations when evaluating LMMs, it is noteworthy that short or evasive responses can inadvertently attain high scores on MMHAL-BENCH. This underlines an intrinsic trade-off between honesty and helpfulness (Bai et al., 2022a). Consequently, for a more comprehensive assessment of alignment with human preferences, we advocate for the evaluation of prospective LMMs using both MMHAL-BENCH and LLaVA-Bench.
|
| 188 |
+
|
| 189 |
+
# 6 CONCLUSION
|
| 190 |
+
|
| 191 |
+
We proposed several strategies to tackle the multimodal misalignment problems, particularly for LMM, which often produce text inconsistent with the associated images. First, we enrich GPT-4 generated vision instruction tuning data from LLaVA with existing human-authored image-text pairs. Next, we adopt the Reinforcement Learning from Human Feedback (RLHF) algorithm from the text domain to bridge vision-language gaps, wherein human evaluators discern and mark the more hallucinated output. We train the LMM to optimize against simulated human preferences. Moreover, we introduce the Factually Augmented RLHF, leveraging additional factual information such as image captions to enhance the reward model, countering reward hacking in RLHF, and boosting model performance. For tangible real-world impact assessment, we have devised MMHAL-BENCH, an evaluation benchmark targeting the penalization of hallucination. Remarkably, LLaVA-RLHF, being the first LMM trained with RLHF, shows a notable surge in performance across benchmarks. We opensource our code, and data and hope our findings could help the future development of more reliable and human-aligned LLMs and LMMs.
|
| 192 |
+
|
| 193 |
+
# REFERENCES
|
| 194 |
+
|
| 195 |
+
Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. In Advances in Neural Information Processing Systems.
|
| 196 |
+
Rohan Anil, Andrew M Dai, Orhan Firat, Melvin Johnson, Dmitry Lepikhin, Alexandre Passos, Siamak Shakeri, Emanuel Taropa, Paige Bailey, Zhifeng Chen, et al. Palm 2 technical report. arXiv preprint arXiv:2305.10403, 2023.
|
| 197 |
+
Amanda Askell, Yuntao Bai, Anna Chen, Dawn Drain, Deep Ganguli, Tom Henighan, Andy Jones, Nicholas Joseph, Ben Mann, Nova DasSarma, et al. A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861, 2021.
|
| 198 |
+
Anas Awadalla, Irena Gao, Josh Gardner, Jack Hessel, Yusuf Hanafy, Wanrong Zhu, Kalyani Marathe, Yonatan Bitton, Samir Gadre, Shiori Sagawa, et al. Openflamingo: An opensource framework for training large autoregressive vision-language models. arXiv preprint arXiv:2308.01390, 2023.
|
| 199 |
+
Jinze Bai, Shuai Bai, Shusheng Yang, Shijie Wang, Sinan Tan, Peng Wang, Junyang Lin, Chang Zhou, and Jingren Zhou. Qwen-vl: A frontier large vision-language model with versatile abilities. arXiv preprint arXiv:2308.12966, 2023.
|
| 200 |
+
Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, et al. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862, 2022a.
|
| 201 |
+
Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell, Jackson Kernion, Andy Jones, Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron McKinnon, Carol Chen, Catherine Olsson, Christopher Olah, Danny Hernandez, Dawn Drain, Deep Ganguli, Dustin Li, Eli TranJohnson, Ethan Perez, Jamie Kerr, Jared Mueller, Jeffrey Ladish, Joshua Landau, Kamal Ndousse, Kamile Lukosuite, Liane Lovitt, Michael Sellitto, Nelson Elhage, Nicholas Schiefer, Noemi Mercado, Nova DasSarma, Robert Lasenby, Robin Larson, Sam Ringer, Scott Johnston, Shauna Kravec, Sheer El Showk, Stanislav Fort, Tamera Lanham, Timothy Telleen-Lawton, Tom Conerly, Tom Henighan, Tristan Hume, Samuel R. Bowman, Zac Hatfield-Dodds, Ben Mann, Dario Amodei, Nicholas Joseph, Sam McCandlish, Tom Brown, and Jared Kaplan. Constitutional ai: Harmlessness from ai feedback, 2022b.
|
| 202 |
+
Ali Furkan Biten, Llu´ıs Gomez, and Dimosthenis Karatzas. Let there be a clock on the beach: ´ Reducing object hallucination in image captioning. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 1381–1390, 2022.
|
| 203 |
+
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, 33:1877–1901, 2020.
|
| 204 |
+
Keqin Chen, Zhao Zhang, Weili Zeng, Richong Zhang, Feng Zhu, and Rui Zhao. Shikra: Unleashing multimodal llm’s referential dialogue magic. arXiv preprint arXiv:2306.15195, 2023a.
|
| 205 |
+
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 preprint arXiv:2209.06794, 2022.
|
| 206 |
+
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, 2023b.
|
| 207 |
+
Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An open-source chatbot impressing gpt-4 with $9 0 \% *$ chatgpt quality, March 2023. URL https: //vicuna.lmsys.org.
|
| 208 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. PaLM: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
|
| 209 |
+
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 preprint arXiv:2305.06500, 2023.
|
| 210 |
+
Yann Dubois, Xuechen Li, Rohan Taori, Tianyi Zhang, Ishaan Gulrajani, Jimmy Ba, Carlos Guestrin, Percy Liang, and Tatsunori B Hashimoto. Alpacafarm: A simulation framework for methods that learn from human feedback. arXiv preprint arXiv:2305.14387, 2023.
|
| 211 |
+
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 Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6904–6913, 2017a.
|
| 212 |
+
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 Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6904–6913, 2017b.
|
| 213 |
+
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.
|
| 214 |
+
Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea Madotto, and Pascale Fung. Survey of hallucination in natural language generation. ACM Computing Surveys, 55(12):1–38, 2023.
|
| 215 |
+
Saurav Kadavath, Tom Conerly, Amanda Askell, Tom Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zac Hatfield-Dodds, Nova DasSarma, Eli Tran-Johnson, et al. Language models (mostly) know what they know. arXiv preprint arXiv:2207.05221, 2022.
|
| 216 |
+
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
|
| 217 |
+
|
| 218 |
+
Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Alexander Kolesnikov, et al. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. International Journal of Computer Vision, 128(7):1956–1981, 2020.
|
| 219 |
+
|
| 220 |
+
Hugo Laurenc¸on, Lucile Saulnier, Leo Tronchon, Stas Bekman, Amanpreet Singh, Anton Lozhkov, ´ Thomas Wang, Siddharth Karamcheti, Alexander M Rush, Douwe Kiela, et al. Obelisc: An open web-scale filtered dataset of interleaved image-text documents. arXiv preprint arXiv:2306.16527, 2023.
|
| 221 |
+
Katherine Lee, Orhan Firat, Ashish Agarwal, Clara Fannjiang, and David Sussillo. Hallucinations in neural machine translation. 2018.
|
| 222 |
+
Bo Li, Yuanhan Zhang, Liangyu Chen, Jinghao Wang, Fanyi Pu, Jingkang Yang, Chunyuan Li, and Ziwei Liu. Mimic-it: Multi-modal in-context instruction tuning. 2023a.
|
| 223 |
+
Bo Li, Yuanhan Zhang, Liangyu Chen, Jinghao Wang, Jingkang Yang, and Ziwei Liu. Otter: A multi-modal model with in-context instruction tuning. arXiv preprint arXiv:2305.03726, 2023b.
|
| 224 |
+
Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping languageimage pre-training with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597, 2023c.
|
| 225 |
+
Yifan Li, Yifan Du, Kun Zhou, Jinpeng Wang, Wayne Xin Zhao, and Ji-Rong Wen. Evaluating object hallucination in large vision-language models. arXiv preprint arXiv:2305.10355, 2023d.
|
| 226 |
+
Stephanie Lin, Jacob Hilton, and Owain Evans. Truthfulqa: Measuring how models mimic human falsehoods. arXiv preprint arXiv:2109.07958, 2021.
|
| 227 |
+
Stephanie Lin, Jacob Hilton, and Owain Evans. Teaching models to express their uncertainty in words. arXiv preprint arXiv:2205.14334, 2022.
|
| 228 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ´ Computer Vision–ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V 13, pp. 740–755. Springer, 2014.
|
| 229 |
+
Fuxiao Liu, Kevin Lin, Linjie Li, Jianfeng Wang, Yaser Yacoob, and Lijuan Wang. Aligning large multi-modal model with robust instruction tuning. arXiv preprint arXiv:2306.14565, 2023a.
|
| 230 |
+
Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. 2023b.
|
| 231 |
+
Yuan Liu, Haodong Duan, Yuanhan Zhang, Bo Li, Songyang Zhang, Wangbo Zhao, Yike Yuan, Jiaqi Wang, Conghui He, Ziwei Liu, et al. Mmbench: Is your multi-modal model an all-around player? arXiv preprint arXiv:2307.06281, 2023c.
|
| 232 |
+
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.
|
| 233 |
+
Yadong Lu, Chunyuan Li, Haotian Liu, Jianwei Yang, Jianfeng Gao, and Yelong Shen. An empirical study of scaling instruct-tuned large multimodal models. arXiv preprint arXiv:2309.09958, 2023.
|
| 234 |
+
Haley MacLeod, Cynthia L Bennett, Meredith Ringel Morris, and Edward Cutrell. Understanding blind people’s experiences with computer-generated captions of social media images. In proceedings of the 2017 CHI conference on human factors in computing systems, pp. 5988–5999, 2017.
|
| 235 |
+
Kenneth Marino, Mohammad Rastegari, Ali Farhadi, and Roozbeh Mottaghi. Ok-vqa: A visual question answering benchmark requiring external knowledge. In Proceedings of the IEEE/cvf conference on computer vision and pattern recognition, pp. 3195–3204, 2019.
|
| 236 |
+
Niklas Muennighoff, Thomas Wang, Lintang Sutawika, Adam Roberts, Stella Biderman, Teven Le Scao, M Saiful Bari, Sheng Shen, Zheng-Xin Yong, Hailey Schoelkopf, et al. Crosslingual generalization through multitask finetuning. arXiv preprint arXiv:2211.01786, 2022.
|
| 237 |
+
|
| 238 |
+
OpenAI. OpenAI: Introducing ChatGPT, 2022. URL https://openai.com/blog/ chatgpt.
|
| 239 |
+
|
| 240 |
+
OpenAI. Gpt-4 technical report, 2023.
|
| 241 |
+
|
| 242 |
+
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, 35: 27730–27744, 2022.
|
| 243 |
+
Zhiliang Peng, Wenhui Wang, Li Dong, Yaru Hao, Shaohan Huang, Shuming Ma, and Furu Wei. Kosmos-2: Grounding multimodal large language models to the world. arXiv preprint arXiv:2306.14824, 2023.
|
| 244 |
+
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, pp. 8748–8763. PMLR, 2021.
|
| 245 |
+
Anna Rohrbach, Lisa Anne Hendricks, Kaylee Burns, Trevor Darrell, and Kate Saenko. Object hallucination in image captioning. arXiv preprint arXiv:1809.02156, 2018.
|
| 246 |
+
Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman ´ Castagne, Alexandra Sasha Luccioni, Franc¸ois Yvon, Matthias Gall ´ e, et al. Bloom: A 176b-´ parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100, 2022.
|
| 247 |
+
John Schulman. Reinforcement learning from human feedback: Progress and challenges, Apr 2023. URL https://www.youtube.com/watch?v $\cdot$ hhiLw5Q_UFg&ab_channel= BerkeleyEECS. Berkeley EECS.
|
| 248 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438, 2015.
|
| 249 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 250 |
+
Dustin Schwenk, Apoorv Khandelwal, Christopher Clark, Kenneth Marino, and Roozbeh Mottaghi. A-okvqa: A benchmark for visual question answering using world knowledge. In European Conference on Computer Vision, pp. 146–162. Springer, 2022.
|
| 251 |
+
Weijia Shi, Sewon Min, Michihiro Yasunaga, Minjoon Seo, Rich James, Mike Lewis, Luke Zettlemoyer, and Wen-tau Yih. Replug: Retrieval-augmented black-box language models. arXiv preprint arXiv:2301.12652, 2023.
|
| 252 |
+
Nisan Stiennon, Long Ouyang, Jeffrey Wu, Daniel Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, and Paul F Christiano. Learning to summarize with human feedback. Advances in Neural Information Processing Systems, 33:3008–3021, 2020.
|
| 253 |
+
Zhiqing Sun, Yikang Shen, Qinhong Zhou, Hongxin Zhang, Zhenfang Chen, David Cox, Yiming Yang, and Chuang Gan. Principle-driven self-alignment of language models from scratch with minimal human supervision. arXiv preprint arXiv:2305.03047, 2023.
|
| 254 |
+
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023.
|
| 255 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee´ Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. LLaMA: Open and \` efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023a.
|
| 256 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023b.
|
| 257 |
+
|
| 258 |
+
Amazon Mechanical Turk. Amazon mechanical turk. Retrieved August, 17:2012, 2012.
|
| 259 |
+
|
| 260 |
+
Yizhong Wang, Hamish Ivison, Pradeep Dasigi, Jack Hessel, Tushar Khot, Khyathi Raghavi Chandu, David Wadden, Kelsey MacMillan, Noah A Smith, Iz Beltagy, et al. How far can camels go? exploring the state of instruction tuning on open resources. arXiv preprint arXiv:2306.04751, 2023.
|
| 261 |
+
Qinghao Ye, Haiyang Xu, Guohai Xu, Jiabo Ye, Ming Yan, Yiyang Zhou, Junyang Wang, Anwen Hu, Pengcheng Shi, Yaya Shi, et al. mplug-owl: Modularization empowers large language models with multimodality. arXiv preprint arXiv:2304.14178, 2023.
|
| 262 |
+
Peter Young, Alice Lai, Micah Hodosh, and Julia Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. Transactions of the Association for Computational Linguistics, 2:67–78, 2014a.
|
| 263 |
+
Peter Young, Alice Lai, Micah Hodosh, and Julia Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. Transactions of the Association for Computational Linguistics, 2:67–78, 2014b.
|
| 264 |
+
Yue Zhang, Yafu Li, Leyang Cui, Deng Cai, Lemao Liu, Tingchen Fu, Xinting Huang, Enbo Zhao, Yu Zhang, Yulong Chen, et al. Siren’s song in the ai ocean: A survey on hallucination in large language models. arXiv preprint arXiv:2309.01219, 2023.
|
| 265 |
+
Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric. P Xing, Hao Zhang, Joseph E. Gonzalez, and Ion Stoica. Judging llm-as-a-judge with mt-bench and chatbot arena, 2023.
|
| 266 |
+
Chunting Zhou, Graham Neubig, Jiatao Gu, Mona Diab, Paco Guzman, Luke Zettlemoyer, and Marjan Ghazvininejad. Detecting hallucinated content in conditional neural sequence generation. arXiv preprint arXiv:2011.02593, 2020.
|
| 267 |
+
Chunting Zhou, Pengfei Liu, Puxin Xu, Srini Iyer, Jiao Sun, Yuning Mao, Xuezhe Ma, Avia Efrat, Ping Yu, Lili Yu, et al. Lima: Less is more for alignment. arXiv preprint arXiv:2305.11206, 2023.
|
| 268 |
+
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.
|
| 269 |
+
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.
|
| 270 |
+
|
| 271 |
+
# A FURTHER ABLATION STUDIES
|
| 272 |
+
|
| 273 |
+
# A.1 ABLATION ON HIGH-QUALITY INSTRUCTION-TUNING DATA
|
| 274 |
+
|
| 275 |
+
In Table 5, we evaluate the impact of individual instruction-tuning datasets. For the sake of simplicity, we did not adjust the mixture rate, earmarking that consideration for future research. Our findings indicate that A-OKVQA (Schwenk et al., 2022) contributes significantly to performance enhancements, boosting results by $+ 9 . 8 \%$ on MMBench and a more modest $+ 3 . 8 \%$ on POPE. In contrast, VQA-v2 (Goyal et al., 2017a) is particularly influential on POPE, where it leads to a $6 \%$ improvement, while only having a slight impact on MMBench. This differential can possibly be attributed to the overlapping “Yes/No” format in VQA and the multiple-choice structure of AOKVQA. Flickr30k notably enhances the performance in LLaVA-Bench and MMHAL-BENCH — a likely consequence of the inherently grounded nature of the task. Furthermore, amalgamating these three datasets results in compounded performance gains across various capability benchmarks.
|
| 276 |
+
|
| 277 |
+
# A.2 DATA FILTERING V.S. RLHF
|
| 278 |
+
|
| 279 |
+
In our preliminary tests, we employed the Fact-RLHF reward model to filter out $70 \%$ , $50 \%$ , and $30 \%$ of LLaVA data. Subsequently, we finetuned an LLaVA model on this filtered data, yielding scores of 81.2, 81.5, and 81.8 on the LLaVA-Bench. However, performance on MMHAL-BENCH , POPE, and MMBench remained largely unchanged. We believe this stagnation can be attributed to two factors: the absence of a negative feedback mechanism preventing the model from identifying hallucinations in its output, and the potential limitations of our Fact-RLHF reward model, especially when compared against the high-capacity oracle models in previous successful studies (Touvron et al., 2023b).
|
| 280 |
+
|
| 281 |
+
# B HALLUCINATION-AWARE HUMAN PREFERENCE DATA COLLECTION
|
| 282 |
+
|
| 283 |
+
Inspired by the recent RLHF studies that collect helpfulness and harmlessness preferences (Bai et al., 2022b; Touvron et al., 2023b) separately, in this study, we decide to differentiate between responses that are merely less helpful and those that are inconsistent with the images (often characterized by multimodal hallucinations). To achieve this, we provide crowdworkers with the template illustrated in Table 2 to guide their annotations when comparing two given responses. With our current template design, we aim to prompt crowdworkers to identify potential hallucinations in the model’s responses.
|
| 284 |
+
|
| 285 |
+
# C MMHAL-BENCH DATA COLLECTION
|
| 286 |
+
|
| 287 |
+
To quantify and evaluate the hallucination in LMM responses, we have created a new benchmark MMHAL-BENCH. There are two major differences between MMHAL-BENCH and previous VLM benchmarks: 1) Speciality: In contrast to prevalent LMM benchmarks Liu et al. (2023b;c); Li et al. (2023d) that evaluate the response quality in the general sense (e.g., helpfulness, relevance), we focus on determining whether there hallucination exists in the LMM responses. Our evaluation metrics are directly developed on this main criterion. 2) Practicality: Some previous LMM benchmarks Li et al. (2023d); Rohrbach et al. (2018) also examine hallucination, but they have limited the questions to yes/no questions, which we found the results may sometimes disagree with the detailed description generated by LMM. Instead of over-simplifying the questions, we adopt general, realistic, and open-ended questions in our MMHAL-BENCH, which can better reflect the response quality in practical user-LMM interactions.
|
| 288 |
+
|
| 289 |
+
In MMHAL-BENCH, we have meticulously designed 96 image-question pairs, ranging in 8 question categories $\times \ 1 2$ object topics. More specifically, we have observed that LMM often make false claims about the image contents when answering some types of questions, and thus design our questions according to these types:
|
| 290 |
+
|
| 291 |
+
• Object attribute: LMMs incorrectly describe the visual attributes of invididual objects, such as color and shape.
|
| 292 |
+
• Adversarial object: LMMs answers questions involving something that does not exist in the image, instead of pointing out that the referred object cannot be found.
|
| 293 |
+
• Comparison: LMMs incorrectly compare the attributes of multiple objects.
|
| 294 |
+
• Counting: LMMs fail to count the number of the named objects.
|
| 295 |
+
• Spatial relation: LMMs fail to understand the spatial relations between multiple objects in the response.
|
| 296 |
+
• Environment: LMMs make wrong inference about the environment of the given image.
|
| 297 |
+
• Holistic description: LMMs make false claims about contents in the given image when giving a comprehensive and detailed description of the whole image.
|
| 298 |
+
• Others: LMMs fail to recognize the text or icons, or incorrectly reason based on the observed visual information.
|
| 299 |
+
|
| 300 |
+
We create and filter the questions in an adversarial manner. More specifically, we design the imagequestion pairs to ensure that the original $\mathrm { L L a V A } _ { 1 3 \mathrm { B X } 3 3 6 }$ model hallucinates when answering these questions. While these questions are initially tailored based on LLaVA13BX336’s behavior, we have observed that they also have a broader applicability, causing other LMMs to hallucinate as well.
|
| 301 |
+
|
| 302 |
+
To avoid data leakage or evaluation on data that LMMs have observed during training, we select images from the validation and test sets of OpenImages (Kuznetsova et al., 2020) and design all brandnew questions. Our image-question pairs cover 12 common object meta-categories from COCO (Lin et al., 2014), including “accessory”, “animal”, “appliance”, “electronic”, “food”, “furniture”, “indoor”, “kitchen”, “outdoor”, “person”, “sports”, and “vehicle”.
|
| 303 |
+
|
| 304 |
+
When evaluating LMMs on MMHAL-BENCH, we employ the powerful GPT-4 model (OpenAI, 2023) to analyze and rate the responses. Currently, the publically available GPT-4 API only supports text input, so it cannot judge directly based on the image contents. Therefore, to aid GPT-4’s assessment, we also provide category names of the image content, and a standard human-generated answer in the prompt, in addition to the question and LMM response pair. Consequently, GPT-4 can determine whether hallucination exists in the LMM response by comparing it against the image content and the thorough human-generated answer. When provided with adequate information from MMHAL-BENCH, GPT-4 can make reasonable decisions aligned with human judgments. For example, when deciding whether hallucination exists in responses from $\mathrm { L L a V A } _ { 1 3 \mathrm { B X } 3 3 6 }$ and $\mathrm { I D E F I C S } _ { 8 0 \mathrm { B } }$ , GPT-4 agrees with human judgments in $94 \%$ of the cases. Please see the Appendix for the example image-question pairs and GPT-4 prompts we used for MMHAL-BENCH evaluation.
|
| 305 |
+
|
| 306 |
+
# D SOURCE OF MULTIMODAL HALLUCINATION
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 2: Two sources of hallucination in Supervised Fine-Tuning (SFT): GPT-4 synthesized data contains hallucinations; Instruction data labelers have no insights about what LMMs know or see, which essentially teaches them to speculate on uncertain content (i.e. hallucinate).
|
| 310 |
+
|
| 311 |
+
# E DETAILED EVALUATION RESULTS ON MMHAL-BENCH
|
| 312 |
+
|
| 313 |
+
We include Table 6 for the full evaluation results on MMHAL-BENCH.
|
| 314 |
+
|
| 315 |
+
Table 6: Detailed evaluation results for different LMMs on MMHAL-BENCH.
|
| 316 |
+
|
| 317 |
+
<table><tr><td rowspan="2">LLM</td><td rowspan="2"></td><td rowspan="2"></td><td colspan="8"></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Kosmos-2</td><td>1.69</td><td>0.68</td><td>2</td><td>0.25</td><td>1.42</td><td>1.67</td><td>1.67</td><td>2.67</td><td>2.5</td><td>1.33</td></tr><tr><td>IDEFIC9B</td><td>1.89</td><td>0.64</td><td>1.58</td><td>0.75</td><td>2.75</td><td>1.83</td><td>1.83</td><td>2.5</td><td>2.17</td><td>1.67</td></tr><tr><td>IDEFIC80B</td><td>2.05</td><td>0.61</td><td>2.33</td><td>1.25</td><td>2</td><td>2.5</td><td>1.5</td><td>3.33</td><td>2.33</td><td>1.17</td></tr><tr><td>InstructBLIP7B</td><td>2.1</td><td>0.58</td><td>3.42</td><td>2.08</td><td>1.33</td><td>1.92</td><td>2.17</td><td>3.67</td><td>1.17</td><td>1.08</td></tr><tr><td>InstructBLIP13B</td><td>2.14</td><td>0.58</td><td>2.75</td><td>1.75</td><td>1.25</td><td>2.08</td><td>2.5</td><td>4.08</td><td>1.5</td><td>1.17</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>1.83</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>1.55</td><td>0.76</td><td>1.33</td><td>2.08</td><td></td><td>1.7</td><td>2.7</td><td>2.58</td><td>1.7</td><td>1.3</td></tr><tr><td>LLaVA-RLHF7B</td><td>2.05</td><td>0.68</td><td>2.92</td><td>1.83</td><td>2.42</td><td>1.92</td><td>2.25</td><td>2.25</td><td>1.75</td><td>1.08</td></tr><tr><td>LLaVA13Bx336</td><td>1.11</td><td>0.84</td><td>0.67</td><td>0</td><td>1.75</td><td>1.58</td><td>1.5</td><td>1.25</td><td>1.5</td><td>0.67</td></tr><tr><td>LLaVA-SFT3Bx336</td><td>2.43</td><td>0.55</td><td>3.08</td><td>1.75</td><td>2.0</td><td>3.25</td><td>2.25</td><td>3.83</td><td>1.5</td><td>1.75</td></tr><tr><td>LLaVA-RLHF13B</td><td>2.53</td><td>0.57</td><td>3.33</td><td>2.67</td><td>1.75</td><td>2.25</td><td>2.33</td><td>3.25</td><td>2.25</td><td>2.42</td></tr></table>
|
| 318 |
+
|
| 319 |
+
# F DETAILED EVALUATION RESULTS ON POPE
|
| 320 |
+
|
| 321 |
+
We include Table 7 for the full evaluation results on POPE.
|
| 322 |
+
|
| 323 |
+
Table 7: POPE evaluation benchmark (Li et al., 2023d). Accuracy denotes the accuracy of predictions. “Yes” represents the probability of the model outputting a positive answer. Results with “\*” are obtained from Li et al., 2023d
|
| 324 |
+
|
| 325 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">Random</td><td colspan="3">Popular</td><td colspan="3">Adversarial</td><td colspan="2">Overall</td></tr><tr><td>Acc↑</td><td>F1个</td><td>Yes (%)</td><td>Acc↑</td><td>F1个</td><td>Yes (%)</td><td>Acc↑</td><td>F1个</td><td>Yes (%)</td><td>F1个</td><td>Yes (%)</td></tr><tr><td></td><td>86.9</td><td>86.2</td><td>43.3</td><td>84.0</td><td>83.2</td><td>45.2</td><td>83.1</td><td>82.5</td><td>46.5</td><td>84.0</td><td>45.0</td></tr><tr><td></td><td>850</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>61650</td><td></td><td></td><td></td><td>508</td></tr><tr><td></td><td></td><td>8</td><td>5555</td><td></td><td></td><td></td><td></td><td></td><td>68688</td><td></td><td></td></tr><tr><td>LLaVA7</td><td>50.4</td><td>66.6</td><td>98.8</td><td>49.9</td><td>66.4</td><td>99.4</td><td>49.7</td><td>66.3</td><td>99.4</td><td>66.4</td><td>99.2</td></tr><tr><td>LLaVA7B</td><td>761</td><td>80.7</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LLaVA-SFT+7B</td><td></td><td></td><td>70.9</td><td>89</td><td>754</td><td>77.9</td><td>62.7</td><td>72.0</td><td>43.2</td><td>76.0</td><td>77.3</td></tr><tr><td>LLaVA-RLHF7B</td><td>84.8</td><td>83.3</td><td>39.6</td><td>83.3</td><td>81.8</td><td>41.8</td><td>80.7</td><td>79.5</td><td>44.0</td><td>81.5</td><td>41.8</td></tr><tr><td>LLaVA13B</td><td>73.7</td><td>78.8</td><td>72.3</td><td>73.6</td><td>78.2</td><td>71.0</td><td>67.2</td><td>74.4</td><td>77.8</td><td>77.1</td><td>73.7</td></tr><tr><td>LLA-SPHF13B</td><td>86.0</td><td>848</td><td>405</td><td>849</td><td>82.6</td><td>41.6</td><td>823</td><td>81.1</td><td>43.5</td><td>82.8</td><td>41.9</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 326 |
+
|
| 327 |
+
# G AMAZON MECHANICAL TURK DESIGN FOR HUMAN FEEDBACK DATA COLLECTION
|
| 328 |
+
|
| 329 |
+
Labeler Information We hired 28 anonymized labelers from the Amazon Mechanical Turk (Turk, 2012) platform. A 5-question qualification test is used to select good labelers. The total annotation of the 10K human preference dataset, including trials, cost $\cdot$ 5000. A statistics figure of the preferences annotated by labelers is shown in Tabel. 3. The agreement across labelers on a hold-out dataset is $\cdot$ .
|
| 330 |
+
|
| 331 |
+
In this preference dataset, each labeler, on average, annotated about 540 items. The least active labeler contributed 30 annotations, while at the lower end, a quarter of the labelers annotated 81 items or fewer. The most common level of contribution was around 278 annotations, with half of the labelers annotating this amount or less. On the higher end, three-quarters of the labelers contributed up to 419 annotations. The most prolific labeler in the group stood out with an impressive 4,006 annotations.
|
| 332 |
+
|
| 333 |
+
Data Collection Template The instruction we gave to the crowdworkers is shown in Table 2.
|
| 334 |
+
Here, we demonstrate some few-shot examples we provided to the crowdworkers.
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 3: Statistics of the preferences annotated by labelers
|
| 338 |
+
|
| 339 |
+
# Conversation Context:
|
| 340 |
+
|
| 341 |
+
User: What benefits does the sleeping environment provide for the cat?
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
|
| 345 |
+
# Response 1:
|
| 346 |
+
|
| 347 |
+
The sleeping environment displayed in the image provides a comfortable and cozy setting for the white cat. The cat is resting on a black couch with its front paws tucked under its chest, which suggests a sense of safety and relaxation. The close-up of the cat emphasizes its peaceful and undisturbed rest, allowing the cat to fully enjoy its nap. This comfortable setting meets the cat’s needs for a safe and inviting space, contributing to its well-being and overall happiness.
|
| 348 |
+
|
| 349 |
+
# Response 2:
|
| 350 |
+
|
| 351 |
+
The sleeping environment on the couch provides the cat with a comfortable and cozy space to rest. The couch’s soft and enclosed nature, along with its cushioned surface, allows the cat to curl up and feel secure while sleeping. This environment is particularly suitable for cats as it mimics their natural preference for snug and warm spaces, like those found in the wild or in their mother’s womb.
|
| 352 |
+
|
| 353 |
+
# Annotation:
|
| 354 |
+
|
| 355 |
+
Response 1 has fewer hallucinations.
|
| 356 |
+
|
| 357 |
+
# Explanation:
|
| 358 |
+
|
| 359 |
+
Response 1 has hallucinations because the pawns are positioned in the front of the cat’s chest versus under. Response 2 is factual to the image.
|
| 360 |
+
In addition (not important in this example), response 2 is more helpful, given it follows the instructions better on discussing the benefits of the environments.
|
| 361 |
+
|
| 362 |
+
Table 8: An example we provided to the crowdworkers.
|
| 363 |
+
|
| 364 |
+
# Conversation Context:
|
| 365 |
+
|
| 366 |
+
User: What do you see happening in this image?
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
|
| 370 |
+
# Response 1:
|
| 371 |
+
|
| 372 |
+
The image depicts a crowded city street filled with people walking in front of numerous businesses, including an Apple store. There are at least 13 people visible on the street, with some carrying handbags or backpacks, indicating that they could be shopping or running errands.
|
| 373 |
+
|
| 374 |
+
The street is bustling with activity and is also busy with vehicles, including a car and a truck. The traffic appears to be dense, with vehicles parked or passing by on the crowded street. The overall atmosphere of the scene is lively and indicative of a busy urban setting.
|
| 375 |
+
|
| 376 |
+
# Response 2:
|
| 377 |
+
|
| 378 |
+
The image captures a bustling street in a crowded city, possibly Hong Kong, with numerous people walking up and down the busy commercial street. There are many pedestrians, including tourists and locals, engaging in various activities and enjoying the lively atmosphere. Some people can be seen carrying handbags, while a man is also holding a umbrella, possibly indicating the weather conditions or as a precaution against sunlight. A large sign is visible in the street, adding to the vibrant and colorful scene.
|
| 379 |
+
|
| 380 |
+
# Annotation:
|
| 381 |
+
|
| 382 |
+
Response 2 has fewer hallucinations.
|
| 383 |
+
|
| 384 |
+
# Explanation:
|
| 385 |
+
|
| 386 |
+
Response 1 has hallucinations since there is an Apple shop but no Apple store, and there are no vechiles parking around.
|
| 387 |
+
Response 2 also has hallucinations since no one is holding an umbrella.
|
| 388 |
+
|
| 389 |
+
# Conversation Context:
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
|
| 393 |
+
User: What should a beginner skier be cautious about when encountering similar conditions as the person in the image?
|
| 394 |
+
|
| 395 |
+
# Response 1:
|
| 396 |
+
|
| 397 |
+
When encountering similar conditions as the person in the image, a beginner skier should be cautious about several factors. First, they need to ensure they have appropriate skiing equipment, such as proper skis and ski poles, as seen in the image. Second, they should be aware of their surroundings, including the presence of other skiers and obstacles like trees, as the person in the image is skiing on a trail surrounded by trees. Third, they need to know the basic skiing techniques, such as stopping and turning safely. It is also essential to learn the meaning of different trail signs and markings to understand the level of difficulty of the trail. Finally, following the guidance of experienced skiers or taking skiing lessons can help beginners navigate these conditions more confidently and securely.
|
| 398 |
+
|
| 399 |
+
# Response 2:
|
| 400 |
+
|
| 401 |
+
A beginner skier should be cautious about several factors when encountering similar conditions as the person in the image. The skier is seen skiing down a snowy hill, possibly on a cross-country slope, surrounded by evergreen trees. A beginner skier should be aware of their surroundings, including potential obstacles like trees and other skiers. They should also pay attention to the slope’s gradient and make sure they choose a suitable trail based on their skiing ability.
|
| 402 |
+
|
| 403 |
+
Furthermore, proper skiing techniques and equipment are essential for beginners. They should ensure they have the right gear, such as well-fitted boots, skis, and poles, and learn the basics of skiing, such as turning, stopping, and maintaining balance. Additionally, they must be aware of their limits and not attempt to ski on slopes beyond their skill level. Finally, following safety guidelines and skiing with a buddy can help beginners navigate the terrain with more confidence and reduce the risk of accidents.
|
| 404 |
+
|
| 405 |
+
# Annotation:
|
| 406 |
+
|
| 407 |
+
Response 1 and Response 2 are both factual to the image.
|
| 408 |
+
Response 2 is more helpful.
|
| 409 |
+
|
| 410 |
+
# Explanation:
|
| 411 |
+
|
| 412 |
+
Both Response 1 and Response 2 are factual to the image, so the comparison will be determined by their helpfulness.
|
| 413 |
+
Response 2 is more helpful, given it illustrates the potential risk of the image about cross-country skiing.
|
| 414 |
+
|
| 415 |
+
# H EXAMPLE QUESTIONS OF MMHAL-BENCH
|
| 416 |
+
|
| 417 |
+
In this section, we showcase some example questions of MMHAL-BENCH. As mentioned in the main paper, MMHAL-BENCHcovers 12 common object categories, and 8 types of questions where LMMs usually incorrectly hallucinate:
|
| 418 |
+
|
| 419 |
+
• Object attribute: LMMs incorrectly describe the visual attributes of invididual objects, such as color and shape. See example Table 11.
|
| 420 |
+
• Adversarial object: LMMs answers questions involving something that does not exist in the image, instead of pointing out that the referred object cannot be found. See example Table 12.
|
| 421 |
+
• Comparison: LMMs incorrectly compare the attributes of multiple objects. See example Table 13.
|
| 422 |
+
• Counting: LMMs fail to count the number of the named objects. See example Table 14.
|
| 423 |
+
• Spatial relation: LMMs fail to understand the spatial relations between multiple objects in the response. See example Table 15.
|
| 424 |
+
• Environment: LMMs make wrong inference about the environment of the given image. See example Table 16.
|
| 425 |
+
• Holistic description: LMMs make false claims about contents in the given image when giving a comprehensive and detailed description of the whole image. See example Table 17.
|
| 426 |
+
• Others: LMMs fail to recognize the text or icons, or incorrectly reason based on the observed visual information. See example Table 18.
|
| 427 |
+
|
| 428 |
+
# Question:
|
| 429 |
+
|
| 430 |
+
What color is the fire hydrant cap in the picture?
|
| 431 |
+
|
| 432 |
+
Ground Truth: The color of the fire hydrant cap in the image is yellow.
|
| 433 |
+
|
| 434 |
+

|
| 435 |
+
|
| 436 |
+
LLaVA: The fire hydrant cap in the picture is red.
|
| 437 |
+
|
| 438 |
+
Table 11: An example question where LLaVA hallucinates the object attribute.
|
| 439 |
+
|
| 440 |
+
# Question:
|
| 441 |
+
|
| 442 |
+
Is the jam on the bread made of strawberry?
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
|
| 446 |
+
# Ground Truth:
|
| 447 |
+
|
| 448 |
+
In fact, this photo only shows a cut and toasted bread slice. There is no jam on it.
|
| 449 |
+
|
| 450 |
+
LLaVA: Yes, the jam on the bread is made of strawberry.
|
| 451 |
+
|
| 452 |
+
# Question:
|
| 453 |
+
|
| 454 |
+
Which electronic device is larger?
|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
|
| 458 |
+
Ground Truth: The iPod touch on the left is larger than the iPod nano on the right.
|
| 459 |
+
|
| 460 |
+
LLaVA: The iPod is larger than the cell phone.
|
| 461 |
+
|
| 462 |
+
Table 13: An example question where LLaVA hallucinates the comparison between multiple objects.
|
| 463 |
+
|
| 464 |
+
Question: How many oysters can you see in the photo?
|
| 465 |
+
|
| 466 |
+

|
| 467 |
+
|
| 468 |
+
Ground Truth: There are five oysters visible in the photo.
|
| 469 |
+
|
| 470 |
+
LLaVA: There are three oysters visible in the photo.
|
| 471 |
+
|
| 472 |
+
Table 14: An example question where LLaVA hallucinates the number of objects.
|
| 473 |
+
|
| 474 |
+
# Question:
|
| 475 |
+
|
| 476 |
+
How is the yellow boat positioned in relation to the white yacht in the image?
|
| 477 |
+
|
| 478 |
+

|
| 479 |
+
|
| 480 |
+
# Ground Truth:
|
| 481 |
+
|
| 482 |
+
The yellow boat is positioned in front of the white yacht in the image.
|
| 483 |
+
|
| 484 |
+
LLaVA:
|
| 485 |
+
|
| 486 |
+
The yellow boat is positioned behind the white yacht in the image, traveling in the same direction.
|
| 487 |
+
|
| 488 |
+
Table 15: An example question where LLaVA hallucinates the spatial relation between objects.
|
| 489 |
+
|
| 490 |
+
Question: Is this photo taken indoors or outdoors?
|
| 491 |
+
|
| 492 |
+

|
| 493 |
+
|
| 494 |
+
# Ground Truth:
|
| 495 |
+
|
| 496 |
+
The photo is taken indoors, since there is a group of hockey players playing in an ice stadium.
|
| 497 |
+
|
| 498 |
+
LLaVA: The photo is taken outdoors, as it features a group of hockey players on a frozen lake.
|
| 499 |
+
|
| 500 |
+
Table 16: An example question where LLaVA hallucinates the environment of the image.
|
| 501 |
+
|
| 502 |
+
# Question:
|
| 503 |
+
|
| 504 |
+
Describe the image in detail.
|
| 505 |
+
|
| 506 |
+

|
| 507 |
+
|
| 508 |
+
# Ground Truth:
|
| 509 |
+
|
| 510 |
+
In this image, I see a book, a pen, and a television on a table. The TV screen shows a man speaking in a park.
|
| 511 |
+
|
| 512 |
+
# LLaVA:
|
| 513 |
+
|
| 514 |
+
The image shows a man sitting in front of a television, watching a video. The man is wearing a suit and has a mustache, giving him a distinguished appearance. The television screen displays a video, which is likely a news report or a documentary.
|
| 515 |
+
|
| 516 |
+
Table 17: An example question where LLaVA hallucinates during giving a holistic description.
|
| 517 |
+
|
| 518 |
+
# Question:
|
| 519 |
+
|
| 520 |
+
What is the name of the book?
|
| 521 |
+
|
| 522 |
+

|
| 523 |
+
|
| 524 |
+
Ground Truth: The name of the book is “Proverbial Philosophy.”
|
| 525 |
+
|
| 526 |
+
LLaVA: The name of the book is “The Over-Soul.”
|
| 527 |
+
|
| 528 |
+
Table 18: An example question where LLaVA hallucinates the text in the image.
|
| 529 |
+
|
| 530 |
+
Table 19: Dataset Information.
|
| 531 |
+
|
| 532 |
+
<table><tr><td>Data</td><td>Size</td><td>Eval Metric</td><td>Format</td></tr><tr><td>LLaVA (Liu et al., 2023b)</td><td>158k</td><td>=</td><td></td></tr><tr><td>A-OKVQA (Marino et al., 2019)</td><td>16k</td><td></td><td>Multiple-Choice Questions</td></tr><tr><td>VQA-v2 (Goyal et al., 2017a)</td><td>83k</td><td></td><td>"Yes/No” Questions</td></tr><tr><td>Flickr30k (Young et al., 2014b)</td><td>23k</td><td></td><td>Grounded Captions</td></tr><tr><td>MMBench (Liu et al.,2023c),</td><td>1k</td><td> Accuracy</td><td>Multiple-Choice Questions</td></tr><tr><td>POPE (Li et al., 2023d)</td><td>3k</td><td>F1</td><td>`Yes/No” Questions</td></tr><tr><td>LLaVA-Bench (Liu et al., 2023b)</td><td>0.1k</td><td>GPT4</td><td>Helpfulness Questions</td></tr><tr><td>MMHAL-BENCH (Ours)</td><td>0.1k</td><td>GPT4</td><td>Hallucination Questions</td></tr></table>
|
| 533 |
+
|
| 534 |
+
# I DETAILS ON IMPLEMENTATIONS AND HYPERPARAMETERS
|
| 535 |
+
|
| 536 |
+
For LoRA-based fine-tuning during the RLHF stage, we use a low-rank $r = 6 4$ for both attention modules and feed-forward network modules. We follow Dubois et al. (2023) on the implementation of the PPO algorithm, which is a variant of (Ouyang et al., $2 0 2 2 )$ . Specifically, we normalize the advantage across the entire batch of rollouts obtained for each PPO step and initialize the value model from the reward model.
|
| 537 |
+
|
| 538 |
+
We used a batch size of 512 for each PPO step. This comprised two epochs of gradient steps, each having 256 rollouts. We applied a peak learning rate of $3 \times 1 0 ^ { - 5 }$ with cosine decay. We clipped the gradient by its Euclidean norm at a limit of 1. Our training spanned 4 complete rounds on our heldout RL data, equaling around 500 PPO steps. For generalized advantage estimation (GAE; Schulman et al. (2015)), both $\lambda$ and $\gamma$ were set at 1. We opted for a constant KL regularizer coefficient of 0.1.
|
| 539 |
+
|
| 540 |
+
For symbolic rewards, the length penalty is set as the number of response tokens divided by the maximum response length (set to 896) times the length penalty coefficient. We set the length penalty coefficient to $- 1 0 . 0$ for general questions, $- 4 0 . 0$ for detailed description questions in LLaVA data, and 2.5 for complex reasoning questions in LLaVA data. The correctness penalty is set to 0 for incorrect responses (or irrelevant responses), and to 2 for correct responses. A penalty of $- 8 . 0$ is also applied to incomplete responses.
|
| 541 |
+
|
| 542 |
+
The three employed supervised fine-tuning datasets are VQA-v2 (Goyal et al., 2017a), AK-VQA (Marino et al., 2019) and Flickr30k (Young et al., 2014b) as listed in Section 2.2. We use “Yes” or “No” queries from VQA-v2 (83k), multiple-choice questions from A-OKVQA (16k), and grounded captions from Flickr30k (23k). The 10k human preference data are paired outputs from the base 7B LLaVA model and we ask the Amazon Turker annotators to label which one contains fewer hallucinations. The details about the collection process are in Appendix G.
|
| 543 |
+
|
| 544 |
+
For each evaluation task, we report the accuracy for MMBench (Liu et al., 2023c), which is a multiple-choice question benchmark consisting of 1031 questions. We report the F1 score for the POPE (Li et al., 2023d), which is a “Yes/No” question benchmark and consists of 3k questions in three categories (random, adversarial and popular). The LLaVA bench (Liu et al., 2023b) consists of around 100 questions and will be evaluated by GPT4 against the outputs from text-only GPT4. Finally, we report the GPT4 score on MMHalBench, which has 96 questions as well targeting the hallucination level of each model.
|
| 545 |
+
|
| 546 |
+
# J GPT-4 EXAMPLERS AND PROMPT FOR MMHAL-BENCH
|
| 547 |
+
|
| 548 |
+
We leverage GPT-4 (OpenAI, 2023) to evaluate the model responses to the image-question pairs in MMHAL-BENCH. To this end, we first explain the concept of “hallucination” in the context of LMM and list several examples, and request GPT-4 to analyze and rate the response by LMMs. Finally, we instantiate the query by providing the image contents (extracted from OpenImages annotations), question, standard human-generated answer, and the LMM response to evaluate. We use the following template prompt as the input to GPT-4, and extract its output to quantify the quality of each response.
|
| 549 |
+
|
| 550 |
+
Please act as an impartial and objective judge and evaluate the quality of the response provided by a Large Multimodal Model (LMM) to the user question. Your evaluation should be mainly based on whether the response is informative, and whether the response contains any hallucination. Hallucination, in this context, refers to a situation where the LMM generates a response that includes information not present or implied in the image or previous conversation. A hallucination could be a false claim about an object, action, emotion , or any other detail that is not grounded in the image.
|
| 551 |
+
|
| 552 |
+
For clarity, consider these examples:
|
| 553 |
+
|
| 554 |
+
### Example 1:
|
| 555 |
+
|
| 556 |
+
- Image Contents: Lynx, Cat Question: How many cats can you see in this image?
|
| 557 |
+
- Standard Human-Generated Answer: There are two cats visible in the image.
|
| 558 |
+
- LMM Response to Evaluate: There is one cat in the image.
|
| 559 |
+
- Analysis: The LMM’s response is false because it claims there is only one cat in the image, when in fact there are two.
|
| 560 |
+
- Hallucination: Yes.
|
| 561 |
+
|
| 562 |
+
### Example 2:
|
| 563 |
+
|
| 564 |
+
- Image Contents: Tree, Plant, Panda, Animal
|
| 565 |
+
- Question: What can you see from this photo?
|
| 566 |
+
- Standard Human-Generated Answer: In this photo we can see branches. We can see a panda on a branch. The background is blurry. LMM Response to Evaluate: In the photo, I can see a large black and white panda sitting on a tree branch. The image captures the panda’s unique appearance and its natural habitat, showcasing the beauty and rarity of these animals.
|
| 567 |
+
- Analysis: The LMM’s response is not false because it does not make any false claims about the image contents. For example, it does not claim that the panda is eating bamboo.
|
| 568 |
+
|
| 569 |
+
- Hallucination: No.
|
| 570 |
+
|
| 571 |
+
### Example 3:
|
| 572 |
+
|
| 573 |
+
- Image Contents: Fashion accessory, Mammal, Dog, Umbrella Question: Describe this image in details.
|
| 574 |
+
- Standard Human-Generated Answer: In this picture I can see a dog laying under a yellow umbrella on a beach, and there is a rope on the right side. In the background I can see few persons talking or lying . At the top of the image, I can see the blue and clear sky. LMM Response to Evaluate: The image features a brown dog laying on the sand at the beach, underneath a yellow umbrella. The dog is positioned near the water, and there are people in the background. The beach is sandy, and the sun is shining, creating a pleasant atmosphere. The dog is enjoying the shade provided by the umbrella, which is a common way to protect pets from the sun’s harmful rays. The presence of people in the background suggests that the beach is a popular spot for leisure activities, such as sunbathing, swimming, and relaxing.
|
| 575 |
+
- Analysis: The LMM’s response is false because it claims that the dog is positioned near the water, but there is no water in the image.
|
| 576 |
+
- Hallucination: Yes.
|
| 577 |
+
|
| 578 |
+
### Example 4:
|
| 579 |
+
|
| 580 |
+
- Image Contents: Clothing, Luggage and bags, Man, Building, Woman, Person
|
| 581 |
+
- Question: Where is this photo taken?
|
| 582 |
+
- Standard Human-Generated Answer: From the slogan "Welcome to Houston, Texas", we can infer that this photo is taken at an airport in Houston, Texas.
|
| 583 |
+
LMM Response to Evaluate: This photo is taken at an airport, specifically at the entrance of a terminal. However, the specific location of this airport cannot be determined from the image.
|
| 584 |
+
- Analysis: Although the LMM’s response does not explicitly mention the location "Houston, Texas" and does not perfectly answer the question, it makes no false claims about the image contents. Therefore, this response is not considered hallucination. It is OK if the LMM fails to directly answer the question, expresses uncertainty, or cannot include all the objects or details in the human-generated answer.
|
| 585 |
+
- Hallucination: No.
|
| 586 |
+
### Example 5: Image Contents: Tree, Tower Question: What environmental concerns are involved in this photo? Standard Human-Generated Answer: This photo shows a smokestack emitting smoke. It may cause severe air pollution which threatens human health. LMM Response to Evaluate: In the photo, there are several environmental concerns related to the smokestack emitting smoke. The smoke from the smokestack is a byproduct of industrial processes, which can contribute to air pollution, climate change, and negative impacts on human health. The smoke contains harmful pollutants, such as particulate matter, sulfur dioxide, nitrogen oxides, and carbon monoxide, which can lead to respiratory problems, heart disease, and other health issues. Additionally, the smoke contributes to the greenhouse effect, which can lead to global warming and climate change. The smokestack’s emissions also affect the environment, as they can harm wildlife, vegetation, and ecosystems. Therefore, it is essential to address these environmental concerns by implementing measures to reduce emissions and promote sustainable practices in industrial processes. Analysis: Although the LMM’s response is significantly longer than the standard human-generated answer, it does not contain any false claims about the image contents. Instead, it provides additional general information about the environmental concerns, which can be inferred from the smoke emission. Such detailed analysis or reasoning should be considered as a positive aspect, as long as it contains no false claims. Hallucination: No.
|
| 587 |
+
With these examples in mind, please help me evaluate whether the response by the LMM is informative, and whether hallucination exists in it, based on the comparison between the LMM’s response and the factual information provided in the image contents, question, and the standard human-generated answer below.
|
| 588 |
+
Please note that the standard human-generated answer may only contain factual information but may not give a detailed analysis. Also, the standard human-generated answer may not be completely comprehensive in describing all the objects and their attributes, so please be a bit more cautious during evalutation. LMM’s detailed analysis or reasoning should be encouraged.
|
| 589 |
+
To evaluate the LMM responses, first, begin your evaluation by providing a short explanation. Second, after providing your explanation, you must rate the response by choosing from the following options: Rating: 6, very informative with good analysis or reasoning, no hallucination Rating: 5, very informative, no hallucination Rating: 4, somewhat informative, no hallucination Rating: 3, not informative, no hallucination Rating: 2, very informative, with hallucination
|
| 590 |
+
|
| 591 |
+
<table><tr><td>- Rating:1,somewhat informative,with hallucination - Rating:0,not informative,with hallucination</td></tr></table>
|
md/test/BfMQIJ0nLc/BfMQIJ0nLc.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/test/Fx2SbBgcte/Fx2SbBgcte.md
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ANIMATEDIFF: ANIMATE YOUR PERSONALIZED TEXT-TO-IMAGE DIFFUSION MODELS WITHOUT SPECIFIC TUNING
|
| 2 |
+
|
| 3 |
+
Yuwei $\mathbf { G u o 1 }$ Ceyuan $\mathbf { Y a n g } ^ { 2 \dagger }$ Anyi Rao3 Zhengyang Liang2 Yaohui Wang2 Yu Qiao2 Maneesh Agrawala3 Dahua $\mathbf { L i n ^ { 1 , 2 } }$ Bo Dai2
|
| 4 |
+
1The Chinese University of Hong Kong 2Shanghai Artificial Intelligence Laboratory 3Stanford University
|
| 5 |
+
|
| 6 |
+
(cartoon) 1boy, dark skin, playing guitar, concert, . . .
|
| 7 |
+
|
| 8 |
+
(oil painting) black pearl pirate ship, night time, sea, . . .
|
| 9 |
+
|
| 10 |
+
(realistic) a Lamborghini on road, fireworks, high detail, . . .
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
With the advance of text-to-image (T2I) diffusion models (e.g., Stable Diffusion) and corresponding personalization techniques such as DreamBooth and LoRA, everyone can manifest their imagination into high-quality images at an affordable cost. However, adding motion dynamics to existing high-quality personalized T2Is and enabling them to generate animations remains an open challenge. In this paper, we present AnimateDiff, a practical framework for animating personalized T2I models without requiring model-specific tuning. At the core of our framework is a plug-and-play motion module that can be trained once and seamlessly integrated into any personalized T2Is originating from the same base T2I. Through our proposed training strategy, the motion module effectively learns transferable motion priors from real-world videos. Once trained, the motion module can be inserted into a personalized T2I model to form a personalized animation generator. We further propose MotionLoRA, a lightweight fine-tuning technique for AnimateDiff that enables a pre-trained motion module to adapt to new motion patterns, such as different shot types, at a low training and data collection cost. We evaluate AnimateDiff and MotionLoRA on several public representative personalized T2I models collected from the community. The results demonstrate that our approaches help these models generate temporally smooth animation clips while preserving the visual quality and motion diversity. Codes and pre-trained weights are available at https://github.com/guoyww/AnimateDiff.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Text-to-image (T2I) diffusion models (Nichol et al., 2021; Ramesh et al., 2022; Saharia et al., 2022; Rombach et al., 2022) have greatly empowered artists and amateurs to create visual content using text prompts. To further stimulate the creativity of existing T2I models, lightweight personalization methods, such as DreamBooth (Ruiz et al., 2023) and LoRA (Hu et al., 2021) have been proposed. These methods enable customized fine-tuning on small datasets using consumer-grade hardware such as a laptop with an RTX3080, thereby allowing users to adapt a base T2I model to new domains and improve visual quality at a relatively low cost. Consequently, a large community of AI artists and amateurs has contributed numerous personalized models on model-sharing platforms such as Civitai (2022) and Hugging Face (2022). While these personalized T2I models can generate remarkable visual quality, their outputs are limited to static images. On the other hand, the ability to generate animations is more desirable in real-world production, such as in the movie and cartoon industries. In this work, we aim to directly transform existing high-quality personalized T2I models into animation generators without requiring model-specific fine-tuning, which is often impractical in terms of computation and data collection costs for amateur users.
|
| 19 |
+
|
| 20 |
+
We present AnimateDiff, an effective pipeline for addressing the problem of animating personalized T2Is while preserving their visual quality and domain knowledge. The core of AnimateDiff is an approach for training a plug-and-play motion module that learns reasonable motion priors from video datasets, such as WebVid-10M (Bain et al., 2021). At inference time, the trained motion module can be directly integrated into personalized T2Is and produce smooth and visually appealing animations without requiring specific tuning. The training of the motion module in AnimateDiff consists of three stages. Firstly, we fine-tune a domain adapter on the base T2I to align with the visual distribution of the target video dataset. This preliminary step guarantees the motion module concentrates on learning the motion priors rather than pixel-level details from the training videos. Secondly, we inflate the base T2I together with the domain adapter and introduce a newly initialized motion module for motion modeling. We then optimize this module on videos while keeping the domain adapter and base T2I weights fixed. By doing so, the motion module learns generalized motion priors and can, via module insertion, enable other personalized T2Is to generate smooth and appealing animations aligned with their personalized domains. The third stage of AnimateDiff, also dubbed as MotionLoRA, aims to adapt the pre-trained motion module to specific motion patterns with a small number of reference videos and training iterations. We achieve this by fine-tuning the motion module with the aid of Low-Rank Adaptation (LoRA) (Hu et al., 2021). Remarkably, adapting to a new motion pattern can be achieved with as few as 50 reference videos. Moreover, a MotionLoRA model requires only approximately 30M of additional storage space, further enhancing the efficiency of model sharing. This efficiency is particularly valuable for users who are unable to bear the expensive costs of pre-training but desire to fine-tune the motion module for specific effects.
|
| 21 |
+
|
| 22 |
+
We evaluate the performance of AnimateDiff and MotionLoRA on a diverse set of personalized T2I models collected from model-sharing platforms (Civitai, 2022; Hugging Face, 2022). These models encompass a wide spectrum of domains, ranging from 2D cartoons to realistic photographs, thereby forming a comprehensive benchmark for our evaluation. The results of our experiments demonstrate promising outcomes. In practice, we also found that a Transformer (Vaswani et al., 2017) architecture along the temporal axis is adequate for capturing appropriate motion priors. We also demonstrate that our motion module can be seamlessly integrated with existing content-controlling approaches (Zhang et al., 2023; Mou et al., 2023) such as ControlNet without requiring additional training, enabling AnimateDiff for controllable animation generation.
|
| 23 |
+
|
| 24 |
+
In summary, (1) we present AnimateDiff, a practical pipeline that enables the animation generation ability of any personalized T2Is without specific fine-tuning; (2) we verify that a Transformer architecture is adequate for modeling motion priors, which provides valuable insights for video generation; (3) we propose MotionLoRA, a lightweight fine-tuning technique to adapt pre-trained motion modules to new motion patterns; (4) we comprehensively evaluate our approach with representative community models and compare it with both academic baselines and commercial tools such as Gen2 (2023) and Pika Labs (2023). Furthermore, we showcase its compatibility with existing works for controllable generation.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Text-to-image diffusion models. Diffusion models (Ho et al., 2020; Dhariwal & Nichol, 2021; Song et al., 2020) for text-to-image (T2I) generation (Gu et al., 2022; Mokady et al., 2023; Podell et al., 2023; Ding et al., 2021; Zhou et al., 2022b; Ramesh et al., 2021; Li et al., 2022) have gained significant attention in both academic and non-academic communities recently. GLIDE (Nichol et al., 2021) introduced text conditions and demonstrated that incorporating classifier guidance leads to more pleasing results. DALL-E2 (Ramesh et al., 2022) improves text-image alignment by leveraging the CLIP (Radford et al., 2021) joint feature space. Imagen (Saharia et al., 2022) incorporates a large language model (Raffel et al., 2020) and a cascade architecture to achieve photorealistic results. Latent Diffusion Model (Rombach et al., 2022), also known as Stable Diffusion, moves the diffusion process to the latent space of an auto-encoder to enhance efficiency. eDiff-I (Balaji et al., 2022) employs an ensemble of diffusion models specialized for different generation stages.
|
| 29 |
+
|
| 30 |
+
Personalizing T2I models. To facilitate the creation with pre-trained T2Is, many works focus on efficient model personalization (Shi et al., 2023; Lu et al., 2023; Dong et al., 2022; Kumari et al., 2023), i.e., introducing concepts or styles to the base T2I using reference images. The most straightforward approach to achieve this is complete fine-tuning of the model. Despite its potential to significantly enhance overall quality, this practice can lead to catastrophic forgetting (Kirkpatrick et al., 2017; French, 1999) when the reference image set is small. Instead, DreamBooth (Ruiz et al., 2023) fine-tunes the entire network with preservation loss and uses only a few images. Textual Inversion (Gal et al., 2022) optimize a token embedding for each new concept. Low-Rank Adaptation (LoRA) (Hu et al., 2021) facilitates the above fine-tuning process by introducing additional LoRA layers to the base T2I and optimizing only the weight residuals. There are also encoder-based approaches that address the personalization problem (Gal et al., 2023; Jia et al., 2023). In our work, we focus on tuning-based methods, including overall fine-tuning, DreamBooth (Ruiz et al., 2023), and LoRA (Hu et al., 2021), as they preserve the original feature space of the base T2I.
|
| 31 |
+
|
| 32 |
+
Animating personalized T2Is. There are not many existing works regarding animating personalized T2Is. Text2Cinemagraph (Mahapatra et al., 2023) proposed to generate cinematography via flow prediction. In the field of video generation, it is common to extend a pre-trained T2I with temporal structures. Existing works (Esser et al., 2023; Zhou et al., 2022a; Singer et al., 2022; Ho et al., 2022b,a; Ruan et al., 2023; Luo et al., 2023; Yin et al., 2023b,a; Wang et al., 2023b; Hong et al., 2022; Luo et al., 2023) mostly update all parameters and modify the feature space of the original T2I and is not compatible with personalized ones. Align-Your-Latents (Blattmann et al., 2023) shows that the frozen image layers in a general video generator can be personalized. Recently, some video generation approaches have shown promising results in animating a personalized T2I model. Tune-a-Video (Wu et al., 2023) fine-tune a small number of parameters on a single video. Text2Video-Zero (Khachatryan et al., 2023) introduces a training-free method to animate a pre-trained T2I via latent wrapping based on a pre-defined affine matrix.
|
| 33 |
+
|
| 34 |
+
# 3 PRELIMINARY
|
| 35 |
+
|
| 36 |
+
We introduce the preliminary of Stable Diffusion (Rombach et al., 2022), the base T2I model used in our work, and Low-Rank Adaptation (LoRA) (Hu et al., 2021), which helps understand the domain adapter (Sec. 4.1) and MotionLoRA (Sec. 4.3) in AnimateDiff.
|
| 37 |
+
|
| 38 |
+
Stable Diffusion. We chose Stable Diffusion (SD) as the base T2I model in this paper since it is open-sourced and has a well-developed community with many high-quality personalized T2I models for evaluation. SD performs the diffusion process within the latent space of a pre-trained autoen
|
| 39 |
+
|
| 40 |
+
coder $\mathcal { E } ( \cdot )$ and $\mathcal { D } ( \cdot )$ . In training, an encoded image $z _ { 0 } = \mathcal { E } ( x _ { 0 } )$ is perturbed to $z _ { t }$ by the forword diffusion:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
z _ { t } = \sqrt { \bar { \alpha _ { t } } } z _ { 0 } + \sqrt { 1 - \bar { \alpha _ { t } } } \epsilon , \epsilon \sim \mathcal { N } ( 0 , I ) ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
for $t = 1 , \dots , T$ , where pre-defined $\hat { \alpha } _ { t }$ determines the noise strength at step $t$ . The denoising network $\epsilon _ { \theta } ( \cdot )$ learns to reverse this process by predicting the added noise, encouraged by an MSE loss:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathcal { L } = \mathbb { E } _ { \mathcal { E } ( x _ { 0 } ) , y , \epsilon \sim \mathcal { N } ( 0 , I ) , t } \left[ | | \epsilon - \epsilon _ { \theta } ( z _ { t } , t , \tau _ { \theta } ( y ) ) | | _ { 2 } ^ { 2 } \right] ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $y$ is the text prompt corresponding to $x _ { 0 }$ ; $\tau _ { \theta } ( \cdot )$ is a text encoder mapping the prompt to a vector sequence. In SD, $\epsilon _ { \theta } ( \cdot )$ is implemented as a UNet (Ronneberger et al., 2015) consisting of pairs of down/up sample blocks at four resolution levels, as well as a middle block. Each network block consists of ResNet (He et al., 2016), spatial self-attention layers, and cross-attention layers3. (optional) Adapt to New Patterns AnimateDiff that introduce text conditions.<prompts>
|
| 53 |
+
|
| 54 |
+
Low-rank adaptation (LoRA). LoRA (Hu et al., 2021) is an approach that accelerates the fine-Pipeline tuning of large models and is first proposed for language model adaptation. Instead of retraining all model parameters, LoRA adds pairs of rank-decomposition matrices and optimizes only these newly introduced weights. By limiting the trainable parameters and keeping the original weights5\~20 Ref. frozen, LoRA is less likely to cause catastrophic forgetting (Kirkpatrick et al., 2017). Concretely, the rank-decomposition matrices serve as the residual of the pre-trained model weights $\mathcal { W } \in \mathbb { R } ^ { m \times n }$ . The new model weight with LoRA isPretrained Image Layers (frozen)
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\mathcal { W } ^ { \prime } = \mathcal { W } + \Delta \mathcal { W } = \mathcal { W } + A B ^ { T } ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $A \in \mathbb { R } ^ { m \times r }$ , $B \in \mathbb { R } ^ { n \times r }$ are a pair of rank-decomposition matrices, $r$ is a hyper-parameter, which is referred to as the rank of LoRA layers. In practice, LoRA is only applied to attention layers, further reducing the cost and storage for model fine-tuning.
|
| 61 |
+
|
| 62 |
+
# 4 ANIMATEDIFF
|
| 63 |
+
|
| 64 |
+
. (optional) Adapt to New PatternsThe core of our method is learning transferable motion priors from video data, which can be applied to <prompts>personalized T2Is without specific tuning. As shown in Fig. 2, at inference time, our motion module (blue) and the optional MotionLoRA (green) can be directly inserted into a personalized T2I to constitute the an0\~50 Ref.imation generator, which subsequently generates aniVideosmations via an iterative denoising process.
|
| 65 |
+
|
| 66 |
+
Pretrained Image Layers (frozen)We achieve this by training three components of AniDomain Reliever (trainable at stage 1) mateDiff, namely domain adapter, motion module, and Motion Module (trainable at stage 2)MotionLoRA. The domain adapter in Sec. 4.1 is only (trainable at stage 3)used in the training to alleviate the negative effects caused by the visual distribution gap between the base T2I pre-training data and our video training data; the motion module in Sec. 4.2 is for learning the motion priors; and the MotionLoRA in Sec. 4.3, which is optional in the case of general animation, is for adapting pre-trained motion modules to new motion patterns. Sec.4.4 elaborates on the training (Fig. 3) and inference of AnimateDiff.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: Inference pipeline.
|
| 70 |
+
|
| 71 |
+
# 4.1 ALLEVIATE NEGATIVE EFFECTS FROM TRAINING DATA WITH DOMAIN ADAPTER
|
| 72 |
+
|
| 73 |
+
Due to the difficulty in collection, the visual quality of publicly available video training datasets is much lower than their image counterparts. For example, the contents of the video dataset WebVid (Bain et al., 2021) are mostly real-world recordings, whereas the image dataset LAIONAesthetic (Schuhmann et al., 2022) contains higher-quality contents, including artistic paintings and professional photography. Moreover, when treated individually as images, each video frame can contain motion blur, compression artifacts, and watermarks. Therefore, there is a non-negligible quality domain gap between the high-quality image dataset used to train the base T2I and the target video dataset we use for learning the motion priors. We argue that such a gap can limit the quality of the animation generation pipeline when trained directly on the raw video data.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 3: Training pipeline of AnimateDiff. AnimateDiff consists of three training stages for the corresponding component modules. Firstly, a domain adapter (Sec. 4.1) is trained to alleviate the negative effects caused by training videos. Secondly, a motion module (Sec. 4.2) is inserted and trained on videos to learn general motion priors. Lastly, MotionLoRA (Sec. 4.3) is trained on a few reference videos to adapt the pre-trained motion module to new motion patterns.
|
| 77 |
+
|
| 78 |
+
To avoid learning this quality discrepancy as part of our motion module and preserve the knowledge of the base T2I, we propose to fit the domain information to a separate network, dubbed as domain adapter. We drop the domain adapter at inference time and show that this practice helps reduce the negative effects caused by the domain gap mentioned above. We implement the domain adapter layers with LoRA (Hu et al., 2021) and insert them into the self-/cross-attention layers in the base T2I, as shown in Fig. 3. Take query (Q) projection as an example. The internal feature $z$ after projection becomes
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
Q = { \mathcal { W } } ^ { Q } z + { \mathrm { A d a p t e r L a y e r } } ( z ) = { \mathcal { W } } ^ { Q } z + \alpha \cdot A B ^ { T } z ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $\alpha = 1$ is a scalar and can be adjusted to other values at inference time (set to 0 to remove the effects of domain adapter totally). We then optimize only the parameters of the domain adapter on static frames randomly sampled from video datasets with the same objective in Eq. (2).
|
| 85 |
+
|
| 86 |
+
# 4.2 LEARN MOTION PRIORS WITH MOTION MODULE
|
| 87 |
+
|
| 88 |
+
To model motion dynamics along the temporal dimension on top of a pre-trained T2I, we must 1) inflate the 2-dimensional diffusion model to deal with 3-dimensional video data and 2) design a sub-module to enable efficient information exchange along the temporal axis.
|
| 89 |
+
|
| 90 |
+
Network Inflation. The pre-trained image layers in the base T2I model capture high-quality content priors. To utilize the knowledge, a preferable way for network inflation is to let these image layers independently deal with video frames. To achieve this, we adopt a practice similar to recent works (Ho et al., 2022b; Wu et al., 2023; Blattmann et al., 2023), and modify the model so that it takes 5D video tensors $\boldsymbol { x } \in \mathbb { R } ^ { b \times c \times f \times h \times w }$ as input, where $b$ and $f$ represent batch axis and frametime axis respectively. When the internal feature maps go through image layers, the temporal axis $f$ is ignored by being reshaped into the $b$ axis, allowing the network to process each frame independently. We then reshape the feature map to the 5D tensor after the image layer. On the other hand, our newly inserted motion module ignores the spatial axis by reshaping $h , w$ into $b$ and then reshaping back after the module.
|
| 91 |
+
|
| 92 |
+
Module Design. Recent works on video generation have explored many designs for temporal modeling. In AnimateDiff, we adopt the Transformer (Vaswani et al., 2017) architecture as our motion module design, and make minor modifications to adapt it to operate along the temporal axis, which we refer to as “temporal Transformer” in the following sections. We experimentally found this design is adequate for modeling motion priors. As illustrated in Fig. 3, the temporal Transformer consists of several self-attention blocks along the temporal axis, with sinusoidal position encoding to encode the location of each frame in the animation. As mentioned above, the input of the motion module is the reshaped feature map whose spatial dimensions are merged into the batch axis. When we divide the reshaped feature map along the temporal axis, it can be regarded as vector sequences with length of $f$ , i.e., $\{ z _ { 1 } , . . . , z _ { f } ; \bar { z } _ { i } \in \bar { \mathbb { R } } ^ { ( b \times h \times w ) \times c } \}$ . The vectors will then be projected and go
|
| 93 |
+
|
| 94 |
+
through several self-attention blocks, i.e.
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
z _ { o u t } = \mathrm { A t t e n t i o n } ( Q , K , V ) = \mathrm { S o f t m a x } ( Q K ^ { T } / \sqrt { c } ) \cdot V ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $Q = W ^ { Q } z$ , $K = W ^ { K } z$ , and $V = W ^ { V } z$ are three separated projections. The attention mechanism enables the generation of the current frame to incorporate information from other frames. As a result, instead of generating each frame individually, the T2I model inflated with our motion module learns to capture the changes of visual content over time, which constitute the motion dynamics in an animation clip. Note that sinusoidal position encoding added before the self-attention is essential; otherwise, the module is not aware of the frame order in the animation. To avoid any harmful effects that the additional module might introduce, we zero initialize (Zhang et al., 2023) the output projection layers of the temporal Transformer and add a residual connection so that the motion module is an identity mapping at the beginning of training.
|
| 101 |
+
|
| 102 |
+
# 4.3 ADAPT TO NEW MOTION PATTERNS WITH MOTIONLORA
|
| 103 |
+
|
| 104 |
+
While the pre-trained motion module captures general motion priors, a question arises when we need to effectively adapt it to new motion patterns such as camera zooming, panning and rolling, etc., with a small number of reference videos and training iterations. Such efficiency is essential for users who cannot afford expensive pre-training costs but would like to fine-tune the motion module for specific effects. Here comes the last stage of AnimateDiff, also dubbed as MotionLoRA (Fig. 3), an efficient fine-tuning approach for motion personalization. Considering the architecture of the motion module and the limited number of reference videos, we add LoRA layers to the self-attention layers of the motion module in the inflated model described in Sec. 4.2, then train these LoRA layers on the reference videos of new motion patterns.
|
| 105 |
+
|
| 106 |
+
We experiment with several shot types and get the reference videos via rule-based data augmentation. For instance, to get videos with zooming effects, we augment the videos by gradually reducing (zoom-in) or enlarging (zoom-out) the cropping area of video frames along the temporal axis. We demonstrate that our MotionLoRA can achieve promising results even with as few as $2 0 \sim 5 0$ reference videos, 2,000 training iterations (around $1 \sim 2$ hours) as well as about 30M storage space, enabling efficient model tuning and sharing among users. Benefited by the low-rank property, MotionLoRA also has the composition capability. Namely, individually trained MotionLoRA models can be combined to achieve composed motion effects at inference time.
|
| 107 |
+
|
| 108 |
+
# 4.4 ANIMATEDIFF IN PRACTICE
|
| 109 |
+
|
| 110 |
+
Training. As illustrated in Fig. 3, AnimateDiff consists of three trainable component modules to learn transferable motion priors. Their training objectives are slightly different. The domain adapter is trained with the original objective as in Eq. (2). The motion module and MotionLoRA, as part of an animation generator, use a similar objective with minor modifications to accommodate higher dimension video data. Concretely, a video data batch $x _ { 0 } ^ { 1 : f } \ \in \ \mathbb { R } ^ { b \times c \times f \times h \times w }$ is first encoded into the latent codes $z _ { 0 } ^ { 1 : f }$ frame-wisely via the pre-trained auto-encoder of SD. The latent codes are then noised using the defined forward diffusion schedule as in Eq. (1)
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
z _ { t } ^ { 1 : f } = \sqrt { \bar { \alpha _ { t } } } z _ { 0 } ^ { 1 : f } + \sqrt { 1 - \bar { \alpha _ { t } } } \epsilon ^ { 1 : f } .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
The inflated model inputs the noised latent codes and corresponding text prompts and predicts the added noises. The final training objective of our motion modeling module is:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathcal { L } = \mathbb { E } _ { \mathcal { E } ( x _ { 0 } ^ { 1 : f } ) , y , \epsilon ^ { 1 : f } \sim \mathcal { N } ( 0 , I ) , t } \left[ \| \epsilon - \epsilon _ { \theta } ( z _ { t } ^ { 1 : f } , t , \tau _ { \theta } ( y ) ) \| _ { 2 } ^ { 2 } \right] .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
It’s worth noting that when training the domain adapter, the motion module, and the MotionLoRA, parameters outside the trainable part remain frozen.
|
| 123 |
+
|
| 124 |
+
Inference. At inference time (Fig. 2), the personalized T2I model will first be inflated in the same way discussed in Section 4.2, then injected with the motion module for general animation generation, and the optional MotionLoRA for generating animation with personalized motion. As for the domain adapter, instead of simply dropping it during the inference time, in practice, we can also inject it into the personalized T2I model and adjust its contribution by changing the scaler $\alpha$ in Eq. (4). An ablation study on the value of $\alpha$ is conducted in experiments. Finally, the animation frames can be obtained by performing the reverse diffusion process and decoding the latent codes.
|
| 125 |
+
|
| 126 |
+
<table><tr><td>RCNZ Cartoon 3d</td><td>TUSUN</td><td>epiC Realism</td><td>ToonYou</td></tr><tr><td>ural lighting,...</td><td>ing in the snow,...</td><td>a golden Labrador, nat-cute Pallas's Cat walk-photo of 24 y.o woman,</td><td>coastline, lighthouse, waves, sunlight,...</td></tr><tr><td>MeinaMix</td><td>Realistic Vision</td><td>night street,... MoXin</td><td>Oil painting</td></tr><tr><td>night time,...</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>lgirl,white hair, purplea cyberpunk city street,a bird sits on a branch,sunset,orange sky, fish- eyes,dress,petals,...</td><td></td><td></td><td></td></tr></table>
|
| 127 |
+
|
| 128 |
+
Figure 4: Qualitative Result. Each sample corresponds to a distinct personalized T2I. Best viewed with Acrobat Reader. Click the images to play the animation clips.
|
| 129 |
+
|
| 130 |
+
# 5 EXPERIMENTS
|
| 131 |
+
|
| 132 |
+
We implement AnimateDiff upon Stable Diffusion V1.5 and train motion module using the WebVid10M (Bain et al., 2021) dataset. Detailed configurations can be found in supplementary materials.
|
| 133 |
+
|
| 134 |
+
# 5.1 QUALITATIVE RESULTS
|
| 135 |
+
|
| 136 |
+
Evaluate on community models. We evaluated the AnimateDiff with a diverse set of representative personalized T2Is collected from Civitai (2022). These personalized T2Is encompass a wide range of domains, thus serving as a comprehensive benchmark. Since personalized domains in these T2Is only respond to certain “trigger words”, we abstain from using common text prompts but refer to the model homepage to construct the evaluation prompts. In Fig. 4, we show eight qualitative results of AnimateDiff. Each sample corresponds to a distinct personalized T2I. In the second row of Figure 1, we present the outcomes obtained by integrating AnimateDiff with MotionLoRA to achieve shot type controls. The last two samples exhibit the composition capability of MotionLoRA, achieved by linearly combining the individually trained weights.
|
| 137 |
+
|
| 138 |
+
Compare with baselines. In the absence of existing methods specifically designed for animating personalized T2Is, we compare our method with two recent works in video generation that can be adapted for this task: 1) Text2Video-Zero (Khachatryan et al., 2023) and 2) Tune-a-Video (Wu et al., 2023). We also compare AnimateDiff with two commercial tools: 3) Gen-2 (2023) for textto-video generation, and 4) Pika Labs (2023) for image animation. The results are shown in Fig. 5.
|
| 139 |
+
|
| 140 |
+
# 5.2 QUANTITATIVE COMPARISON
|
| 141 |
+
|
| 142 |
+
We conduct the quantitative comparison through user study and CLIP metrics. The comparison focuses on three key aspects: text alignment, domain similarity, and motion smoothness. The results are shown in Table 1. Detailed implementations can be found in supplementary materials.
|
| 143 |
+
|
| 144 |
+
User study. In the user study, we generate animations using all three methods based on the same personalized T2I models. Participants are then asked to individually rank the results based on the above three aspects. We use the Average User Ranking (AUR) as a preference metric where a higher score indicates superior performance. Note that the corresponding prompts and images are provided for reference for text alignment and domain similarity evaluation.
|
| 145 |
+
|
| 146 |
+
Figure 5: Qualitative Comparison. Best viewed with Acrobat Reader. Click the images to play the animation clips.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Tune-A-Video</td><td>AnimateDiff</td><td>T2V-Zer0</td><td>AnimateDiff</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>araccoon is playing guitar, soft lighting,...</td><td></td><td></td><td></td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 1: Quantitative comparison. A higher score indicates superior performance.
|
| 151 |
+
|
| 152 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">User Study (↑)</td><td colspan="3">CLIP Metric (↑)</td></tr><tr><td>Text.</td><td>Domain.</td><td>Smooth.</td><td>Text.</td><td>Domain.</td><td>Smooth.</td></tr><tr><td>Text2Video-Zero</td><td>1.620</td><td>2.620</td><td>1.560</td><td>32.04</td><td>84.84</td><td>96.57</td></tr><tr><td>Tune-a- Video</td><td>2.180</td><td>1.100</td><td>1.615</td><td>35.98</td><td>80.68</td><td>97.42</td></tr><tr><td>Ours</td><td>2.210</td><td>2.280</td><td>2.825</td><td>31.39</td><td>87.29</td><td>98.00</td></tr></table>
|
| 153 |
+
|
| 154 |
+
CLIP metric. We also employed the CLIP (Radford et al., 2021) metric, following the approach taken by previous studies (Wu et al., 2023; Khachatryan et al., 2023). When evaluating domain similarity, it is important to note that the CLIP score was computed between the animation frames and the reference images generated using the personalized T2Is.
|
| 155 |
+
|
| 156 |
+
# 5.3 ABLATIVE STUDY
|
| 157 |
+
|
| 158 |
+
Domain adapter. To investigate the impact of the domain adapter in AnimateDiff, we conducted a study by adjusting the scaler in the adapter layers during inference, ranging from 1 (full impact) to 0 (complete removal). As illustrated in Figure 6, as the scaler of the adapter decreases, there is an improvement in overall visual quality, accompanied by a reduction in the visual content distribution learned from the video dataset (the watermark in the case of WebVid (Bain et al., 2021)). These results indicate the successful role of the domain adapter in enhancing the visual quality of AnimateDiff by alleviating the motion module from learning the visual distribution gap.
|
| 159 |
+
|
| 160 |
+
Motion module design. We compare our motion module design of the temporal Transformer with its full convolution counterpart, which is motivated by the fact that both designs are widely employed in recent works on video generation. We replace the temporal attention with 1D temporal convolution and ensured that the two model parameters were closely aligned. As depicted in supplementary materials, the convolutional motion module aligns all frames to be identical but does not incorporate any motion compared to the Transformer architecture.
|
| 161 |
+
|
| 162 |
+
Efficiency of MotionLoRA. The efficiency of MotionLoRA in AnimateDiff was examined in terms of parameter efficiency and data efficiency. Parameter efficiency is crucial for efficient model training and sharing among users, while data efficiency is essential for real-world applications where collecting an adequate number of reference videos for specific motion patterns may be challenging.
|
| 163 |
+
|
| 164 |
+
To investigate these aspects, we trained multiple MotionLoRA models with varying parameter scales and reference video quantities. In Fig. 7, the first two samples demonstrate that MotionLoRA is capable of learning new camera motions (e.g., zoom-in) with a small parameter scale while maintaining comparable motion quality. Furthermore, even with a modest number of reference videos (e.g., $N = 5 0$ ), the model successfully learns the desired motion patterns. However, when the number of reference videos is excessively limited (e.g., $N = 5$ ), significant degradation in quality is observed, suggesting that MotionLoRA encounters difficulties in learning shared motion patterns and instead relies on capturing texture information from the reference videos.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 6: Ablation on domain adapter. We adjust the scaler of the adapter from 1 to 0 to gradually remove its effects. In this figure, we show the first frame of the generated animation.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 7: Ablation on MotionLoRA’s efficiency. Two samples on the left: with different network rank; Three samples on the right: with different numbers of reference videos. Best viewed with alpha = 1.0 Acrobat Reader. Click the images to play the animation clips.
|
| 171 |
+
Figure 8: Controllable generation. Best viewed with Acrobat Reader. Click the images to play the animation clips.
|
| 172 |
+
|
| 173 |
+
# 5.4 CONTROLLABLE GENERATION.
|
| 174 |
+
|
| 175 |
+
The separated learning of visual content and motion priors in AnimateDiff enables the direct application of existing content control approaches for controllable generation. To demonstrate this capability, we combined AnimateDiff with ControlNet (Zhang et al., 2023) to control the generation with extracted depth map sequence. In contrast to recent video editing techniques (Ceylan et al., 2023; Wang et al., 2023a) that employ DDIM (Song et al., 2020) inversion to obtain smoothed latent sequences, we generate animations from randomly sampled noise. As illustrated in Figure 8, our recity street, neon, fog, closeup portrait photo of young woman in dark clothes, . . .
|
| 176 |
+
|
| 177 |
+
sults exhibit meticulous motion details (such as hair and facial expressions) and high visual quality.
|
| 178 |
+
|
| 179 |
+
# 6 CONCLUSION
|
| 180 |
+
|
| 181 |
+
In this paper, we present AnimateDiff, a practical pipeline directly turning personalized text-toimage (T2I) models for animation generation once and for all, without compromising quality or losing pre-learned domain knowledge. To accomplish this, we design three component modules in AnimateDiff to learn meaningful motion priors while alleviating visual quality degradation and enabling motion personalization with a lightweight fine-tuning technique named MotionLoRA. Once trained, our motion module can be integrated into other personalized T2Is to generate animated images with natural and coherent motions while remaining faithful to the personalized domain. Extensive evaluation with various personalized T2I models also validates the effectiveness and generalizability of our AnimateDiff and MotionLoRA. Furthermore, we demonstrate the compatibility of our method with existing content-controlling approaches, enabling controllable generation without incurring additional training costs. Overall, AnimateDiff provides an effective baseline for personalized animation and holds significant potential for a wide range of applications.
|
| 182 |
+
|
| 183 |
+
# 7 ETHICS STATEMENT
|
| 184 |
+
|
| 185 |
+
We strongly condemn the misuse of generative AI to create content that harms individuals or spreads misinformation. However, we acknowledge the potential for our method to be misused since it primarily focuses on animation and can generate human-related content. It is also important to highlight that our method incorporates personalized text-to-image models developed by other artists. These models may contain inappropriate content and can be used with our method.
|
| 186 |
+
|
| 187 |
+
To address these concerns, we uphold the highest ethical standards in our research, including adhering to legal frameworks, respecting privacy rights, and encouraging the generation of positive content. Furthermore, we believe that introducing an additional content safety checker, similar to that in Stable Diffusion (Rombach et al., 2022), could potentially resolve this issue.
|
| 188 |
+
|
| 189 |
+
# 8 REPRODUCIBILITY STATEMENT
|
| 190 |
+
|
| 191 |
+
We provide comprehensive implementation details for the training and inference of our method in supplementary materials, aiming to enhance the reproducibility of our approach. We also make both the code and pre-trained weights open-sourced to facilitate further investigation and exploration.
|
| 192 |
+
|
| 193 |
+
# ACKNOWLEDGEMENT
|
| 194 |
+
|
| 195 |
+
This project is funded in part by Shanghai AI Laboratory (P23KS00020, 2022ZD0160201), CUHK Interdisciplinary AI Research Institute, and the Centre for Perceptual and Interactive Intelligence (CPIl) Ltd under the Innovation and Technology Commission (ITC)’s InnoHK.
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
Max Bain, Arsha Nagrani, Gul Varol, and Andrew Zisserman. Frozen in time: A joint video and ¨ image encoder for end-to-end retrieval. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1728–1738, 2021.
|
| 200 |
+
|
| 201 |
+
Yogesh Balaji, Seungjun Nah, Xun Huang, Arash Vahdat, Jiaming Song, Karsten Kreis, Miika Aittala, Timo Aila, Samuli Laine, Bryan Catanzaro, et al. ediffi: Text-to-image diffusion models with an ensemble of expert denoisers. arXiv preprint arXiv:2211.01324, 2022.
|
| 202 |
+
|
| 203 |
+
Andreas Blattmann, Robin Rombach, Huan Ling, Tim Dockhorn, Seung Wook Kim, Sanja Fidler, and Karsten Kreis. Align your latents: High-resolution video synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22563–22575, 2023.
|
| 204 |
+
|
| 205 |
+
Duygu Ceylan, Chun-Hao Paul Huang, and Niloy J Mitra. Pix2video: Video editing using image diffusion. arXiv preprint arXiv:2303.12688, 2023.
|
| 206 |
+
|
| 207 |
+
Civitai. Civitai. https://civitai.com/, 2022.
|
| 208 |
+
|
| 209 |
+
Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34:8780–8794, 2021.
|
| 210 |
+
|
| 211 |
+
Ming Ding, Zhuoyi Yang, Wenyi Hong, Wendi Zheng, Chang Zhou, Da Yin, Junyang Lin, Xu Zou, Zhou Shao, Hongxia Yang, et al. Cogview: Mastering text-to-image generation via transformers. Advances in Neural Information Processing Systems, 34:19822–19835, 2021.
|
| 212 |
+
|
| 213 |
+
Shuangrui Ding, Maomao Li, Tianyu Yang, Rui Qian, Haohang Xu, Qingyi Chen, Jue Wang, and Hongkai Xiong. Motion-aware contrastive video representation learning via foregroundbackground merging. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9716–9726, 2022.
|
| 214 |
+
|
| 215 |
+
Ziyi Dong, Pengxu Wei, and Liang Lin. Dreamartist: Towards controllable one-shot text-to-image generation via contrastive prompt-tuning. arXiv preprint arXiv:2211.11337, 2022.
|
| 216 |
+
|
| 217 |
+
Patrick Esser, Johnathan Chiu, Parmida Atighehchian, Jonathan Granskog, and Anastasis Germanidis. Structure and content-guided video synthesis with diffusion models. arXiv preprint arXiv:2302.03011, 2023.
|
| 218 |
+
Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128–135, 1999.
|
| 219 |
+
Rinon Gal, Yuval Alaluf, Yuval Atzmon, Or Patashnik, Amit H Bermano, Gal Chechik, and Daniel Cohen-Or. An image is worth one word: Personalizing text-to-image generation using textual inversion. arXiv preprint arXiv:2208.01618, 2022.
|
| 220 |
+
Rinon Gal, Moab Arar, Yuval Atzmon, Amit H Bermano, Gal Chechik, and Daniel CohenOr. Designing an encoder for fast personalization of text-to-image models. arXiv preprint arXiv:2302.12228, 2023.
|
| 221 |
+
Gen-2. Gen-2: The next step forward for generative ai. https://research.runwayml. com/gen2/, 2023.
|
| 222 |
+
Shuyang Gu, Dong Chen, Jianmin Bao, Fang Wen, Bo Zhang, Dongdong Chen, Lu Yuan, and Baining Guo. Vector quantized diffusion model for text-to-image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10696–10706, 2022.
|
| 223 |
+
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, pp. 770–778, 2016.
|
| 224 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020.
|
| 225 |
+
Jonathan Ho, William Chan, Chitwan Saharia, Jay Whang, Ruiqi Gao, Alexey Gritsenko, Diederik P Kingma, Ben Poole, Mohammad Norouzi, David J Fleet, et al. Imagen video: High definition video generation with diffusion models. arXiv preprint arXiv:2210.02303, 2022a.
|
| 226 |
+
Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J Fleet. Video diffusion models. arXiv preprint arXiv:2204.03458, 2022b.
|
| 227 |
+
Wenyi Hong, Ming Ding, Wendi Zheng, Xinghan Liu, and Jie Tang. Cogvideo: Large-scale pretraining for text-to-video generation via transformers. arXiv preprint arXiv:2205.15868, 2022.
|
| 228 |
+
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.
|
| 229 |
+
Hugging Face. Huggingface. https://huggingface.co/, 2022.
|
| 230 |
+
Xuhui Jia, Yang Zhao, Kelvin CK Chan, Yandong Li, Han Zhang, Boqing Gong, Tingbo Hou, Huisheng Wang, and Yu-Chuan Su. Taming encoder for zero fine-tuning image customization with text-to-image diffusion models. arXiv preprint arXiv:2304.02642, 2023.
|
| 231 |
+
Levon Khachatryan, Andranik Movsisyan, Vahram Tadevosyan, Roberto Henschel, Zhangyang Wang, Shant Navasardyan, and Humphrey Shi. Text2video-zero: Text-to-image diffusion models are zero-shot video generators. IEEE International Conference on Computer Vision (ICCV), 2023.
|
| 232 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521–3526, 2017.
|
| 233 |
+
Nupur Kumari, Bingliang Zhang, Richard Zhang, Eli Shechtman, and Jun-Yan Zhu. Multi-concept customization of text-to-image diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1931–1941, 2023.
|
| 234 |
+
Wei Li, Xue Xu, Xinyan Xiao, Jiachen Liu, Hu Yang, Guohao Li, Zhanpeng Wang, Zhifan Feng, Qiaoqiao She, Yajuan Lyu, et al. Upainting: Unified text-to-image diffusion generation with cross-modal guidance. arXiv preprint arXiv:2210.16031, 2022.
|
| 235 |
+
Haoming Lu, Hazarapet Tunanyan, Kai Wang, Shant Navasardyan, Zhangyang Wang, and Humphrey Shi. Specialist diffusion: Plug-and-play sample-efficient fine-tuning of text-to-image diffusion models to learn any unseen style. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14267–14276, 2023.
|
| 236 |
+
Zhengxiong Luo, Dayou Chen, Yingya Zhang, Yan Huang, Liang Wang, Yujun Shen, Deli Zhao, Jingren Zhou, and Tieniu Tan. Videofusion: Decomposed diffusion models for high-quality video
|
| 237 |
+
generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10209–10218, 2023.
|
| 238 |
+
Aniruddha Mahapatra, Aliaksandr Siarohin, Hsin-Ying Lee, Sergey Tulyakov, and Jun-Yan Zhu. Text-guided synthesis of eulerian cinemagraphs, 2023.
|
| 239 |
+
Ron Mokady, Amir Hertz, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. Null-text inversion for editing real images using guided diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6038–6047, 2023.
|
| 240 |
+
Chong Mou, Xintao Wang, Liangbin Xie, Jian Zhang, Zhongang Qi, Ying Shan, and Xiaohu Qie. T2i-adapter: Learning adapters to dig out more controllable ability for text-to-image diffusion models. arXiv preprint arXiv:2302.08453, 2023.
|
| 241 |
+
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.
|
| 242 |
+
Pika Labs. Pika labs. https://www.pika.art/, 2023.
|
| 243 |
+
Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Muller, Joe ¨ Penna, and Robin Rombach. Sdxl: improving latent diffusion models for high-resolution image synthesis. arXiv preprint arXiv:2307.01952, 2023.
|
| 244 |
+
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, pp. 8748–8763. PMLR, 2021.
|
| 245 |
+
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. The Journal of Machine Learning Research, 21(1):5485–5551, 2020.
|
| 246 |
+
Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In International Conference on Machine Learning, pp. 8821–8831. PMLR, 2021.
|
| 247 |
+
Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical textconditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022.
|
| 248 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High- ¨ resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Con
|
| 249 |
+
ference on Computer Vision and Pattern Recognition, pp. 10684–10695, 2022.
|
| 250 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation, 2015.
|
| 251 |
+
Ludan Ruan, Yiyang Ma, Huan Yang, Huiguo He, Bei Liu, Jianlong Fu, Nicholas Jing Yuan, Qin Jin, and Baining Guo. Mm-diffusion: Learning multi-modal diffusion models for joint audio and video generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10219–10228, 2023.
|
| 252 |
+
Nataniel Ruiz, Yuanzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22500– 22510, 2023.
|
| 253 |
+
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghasemipour, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in Neural Information Processing Systems, 35:36479–36494, 2022.
|
| 254 |
+
Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion-5b: An open large-scale dataset for training next generation image-text models. arXiv preprint arXiv:2210.08402, 2022.
|
| 255 |
+
Jing Shi, Wei Xiong, Zhe Lin, and Hyun Joon Jung. Instantbooth: Personalized text-to-image generation without test-time finetuning. arXiv preprint arXiv:2304.03411, 2023.
|
| 256 |
+
Uriel Singer, Adam Polyak, Thomas Hayes, Xi Yin, Jie An, Songyang Zhang, Qiyuan Hu, Harry Yang, Oron Ashual, Oran Gafni, et al. Make-a-video: Text-to-video generation without text-video data. arXiv preprint arXiv:2209.14792, 2022.
|
| 257 |
+
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020.
|
| 258 |
+
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.
|
| 259 |
+
Wen Wang, Kangyang Xie, Zide Liu, Hao Chen, Yue Cao, Xinlong Wang, and Chunhua Shen. Zeroshot video editing using off-the-shelf image diffusion models. arXiv preprint arXiv:2303.17599, 2023a.
|
| 260 |
+
Yaohui Wang, Xinyuan Chen, Xin Ma, Shangchen Zhou, Ziqi Huang, Yi Wang, Ceyuan Yang, Yinan He, Jiashuo Yu, Peiqing Yang, Yuwei Guo, Tianxing Wu, Chenyang Si, Yuming Jiang, Cunjian Chen, Chen Change Loy, Bo Dai, Dahua Lin, Yu Qiao, and Ziwei Liu. Lavie: High-quality video generation with cascaded latent diffusion models, 2023b.
|
| 261 |
+
Jay Zhangjie Wu, Yixiao Ge, Xintao Wang, Weixian Lei, Yuchao Gu, Wynne Hsu, Ying Shan, Xiaohu Qie, and Mike Zheng Shou. Tune-a-video: One-shot tuning of image diffusion models for text-to-video generation. IEEE International Conference on Computer Vision (ICCV), 2023.
|
| 262 |
+
Hu Ye, Jun Zhang, Sibo Liu, Xiao Han, and Wei Yang. Ip-adapter: Text compatible image prompt adapter for text-to-image diffusion models. arXiv preprint arXiv:2308.06721, 2023.
|
| 263 |
+
Shengming Yin, Chenfei Wu, Jian Liang, Jie Shi, Houqiang Li, Gong Ming, and Nan Duan. Dragnuwa: Fine-grained control in video generation by integrating text, image, and trajectory. arXiv preprint arXiv:2308.08089, 2023a.
|
| 264 |
+
Shengming Yin, Chenfei Wu, Huan Yang, Jianfeng Wang, Xiaodong Wang, Minheng Ni, Zhengyuan Yang, Linjie Li, Shuguang Liu, Fan Yang, et al. Nuwa-xl: Diffusion over diffusion for extremely long video generation. arXiv preprint arXiv:2303.12346, 2023b.
|
| 265 |
+
Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. Adding conditional control to text-to-image diffusion models. IEEE International Conference on Computer Vision (ICCV), 2023.
|
| 266 |
+
Daquan Zhou, Weimin Wang, Hanshu Yan, Weiwei Lv, Yizhe Zhu, and Jiashi Feng. Magicvideo: Efficient video generation with latent diffusion models. arXiv preprint arXiv:2211.11018, 2022a.
|
| 267 |
+
Yufan Zhou, Ruiyi Zhang, Changyou Chen, Chunyuan Li, Chris Tensmeyer, Tong Yu, Jiuxiang Gu, Jinhui Xu, and Tong Sun. Towards language-free training for text-to-image generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 17907– 17917, 2022b.
|
| 268 |
+
|
| 269 |
+
# APPENDIX
|
| 270 |
+
|
| 271 |
+
# A IMPLEMENTATION DETAILS
|
| 272 |
+
|
| 273 |
+
Training. We utilize the WebVid-10M dataset (Bain et al., 2021), a large-scale video dataset consisting of approximately 10.7 million text-video data pairs to train the motion module. This dataset offers diverse motion categories, which significantly facilitates the learning process of the motion module. We adopt a training resolution of $2 5 6 \times 2 5 6$ to balance training efficiency and motion quality. To train the domain adapter, we randomly sample static frames and resize them to the target resolution. For the motion module and MotionLoRA, we uniformly sample the videos at a stride of 4 to get video clips at a length of 16. We use a learning rate of $1 \times \mathrm { { 1 0 ^ { - 4 } } }$ and train the motion module with 16 NVIDIA A100s for 5 epochs.
|
| 274 |
+
|
| 275 |
+
Inference. As described in the main paper, at inference, we first inflate a personalized text-to-image model and insert the pre-trained motion module to constitute the corresponding animation generator. In our experiment setup, we generate animations at a resolution of $5 1 2 \times 5 1 2$ using a DDIM (Song et al., 2020) sampler with classifier-free guidance. We referred to the model’s official web page to determine the denoising hyperparameters (guidance scale, LoRA scaler, etc.) and generally adopted the same settings.
|
| 276 |
+
|
| 277 |
+
Table 2: Community models for evaluation.
|
| 278 |
+
|
| 279 |
+
<table><tr><td>Model Name</td><td>Domain</td><td>Type</td></tr><tr><td>Toon You1</td><td>2D Cartoon</td><td>T2I Base Model</td></tr><tr><td>MeinaMix2</td><td>2D Anime</td><td>T2I Base Model</td></tr><tr><td>Lyriel3</td><td>Stylistic</td><td>T2I Base Model</td></tr><tr><td>RCNZ Cartoon 3d4</td><td>3D Cartoon</td><td>T2I Base Model</td></tr><tr><td>epiC Realism5</td><td>Realistic</td><td>T2I Base Model</td></tr><tr><td>Realistic Vision 6</td><td>Realistic</td><td>T2I Base Model</td></tr><tr><td>Oil painting7</td><td>Stylistic</td><td>LoRA</td></tr><tr><td>MoXin8</td><td>Stylistic</td><td>LoRA</td></tr><tr><td>TUSUN9</td><td>Concept</td><td>LoRA</td></tr></table>
|
| 280 |
+
|
| 281 |
+
Models for evaluation. To ensure a comprehensive benchmark, we selected nine representative personalized T2I models from Civitai (2022), a model-sharing platform that enables artists to upload their creations. As illustrated in Table 2, these models encompass diverse domains such as 2D anime, stylistic painting, and realistic photographic images. They also cover a wide range of subjects, including portraits, animals, landscapes, etc.. This selection ensures a comprehensive evaluation of our approach across various domains and subjects.
|
| 282 |
+
|
| 283 |
+
Baselines adaptation. To adapt the two academic baselines for personalized animation generation, we followed the recommended best practices in the respective papers and performed parameter tuning on a case-by-case basis. For Tune-A-Video (Wu et al., 2023), we use a reference video on the project’s webpage and fine-tune the network after replacing the T2I backbone with a personalized one, as suggested in the paper. Regarding Text2Video-Zero (Khachatryan et al., 2023), we directly generate video clips upon the personalized T2Is without any modifications. In addition, we conducted qualitative comparisons with two commercial tools for video generation and image animation, namely Gen-2 (2023) and Pika Labs (2023). For Gen2, we employed personalized T2I images as image prompts to generate the corresponding videos. As for Pika Labs, we utilized it to animate still images generated by the personalized T2Is.
|
| 284 |
+
|
| 285 |
+
(SD1.5) Close up of (SD1.5) Sunset (SD1.5) An astronaut (SD1.5) A bigfoot grapes on table. time-lapse at the beach. flying in space. walking.
|
| 286 |
+
|
| 287 |
+
User study. To ensure a fair comparison between our method and the baselines, we generated 20 animations for each method without cherry-picking, resulting in 20 sets of triple pairs. Subsequently, we conducted a user study involving ten participants. Each participant is presented with the three samples generated by different methods at one time and asked to rank them based on three specific aspects: text alignment, domain similarity, and motion smoothness. To evaluate text alignment, we provide the corresponding text prompt to the users and request them to rank the samples accordingly. To assess domain similarity, we initially generate reference images using the same personalized T2I. These reference images are then presented to the users, who are asked to rate the animations based on their perceived similarity to the reference images. Regarding motion smoothness, users are instructed to rank the animations based on the consistency of the motion.
|
| 288 |
+
|
| 289 |
+
CLIP metric. Using the generated animations, we first extract the CLIP image embeddings of each frame and then compute the cosine similarity under different settings. To assess text alignment, we computed the average similarity between the prompt embedding and the embeddings of individual frames. For evaluating domain similarity, we computed the CLIP score between the reference images and the frames of the animations. To measure motion smoothness, we calculated the similarity between all pairs of video frames and reported the average number.
|
| 290 |
+
|
| 291 |
+
# B ADDITIONAL DISCUSSIONS
|
| 292 |
+
|
| 293 |
+
# B.1 VISUAL QUALITIES ON BASE T2I.
|
| 294 |
+
|
| 295 |
+
By integrating the motion module with the base T2I that the motion module is pre-trained upon, i.e., Stable Diffusion V1.5, AnimateDiff demonstrates capabilities in general T2V generation. We showcase such ability by generating videos with commonly used textual prompts in previous works (Zhou et al., 2022a; Blattmann et al., 2023). As illustrated in Fig. 9, without the enhancement from personalized T2I models, the domain of the synthetic videos corresponds closely with the pre-training dataset WebVid-10M Bain et al. (2021).
|
| 296 |
+
|
| 297 |
+
# B.2 DOMAIN ADAPTER VISUALIZATION
|
| 298 |
+
|
| 299 |
+
To further validate the effectiveness of the domain adapter, we conduct an additional ablative study where the motion module is trained with the domain adapter entirely removed from the pipeline. We qualitatively compare the personalized T2I animation results upon three baselines: (1) training without adapter; (2) full pipeline with scaler $\alpha$ set to 1; (3) full pipeline with scaler $\alpha$ set to 0.
|
| 300 |
+
|
| 301 |
+
As shown in Fig. 10, when the domain adapter is completely removed from the training pipeline, visual attributes inherent to the training dataset, specifically watermarks, emerge in the synthetic animations (1st row). This arises due to the intertwining of visual appearance and motion learning during the motion module’s training phase, resulting in the watermark pattern being learned by the motion module and subsequently transferred to other personalized T2I backbones. Similarly, watermarks appear when the adapter exerts its full impact (2nd row). In contrast, by fitting the visual distribution to a separate domain adapter and eliminating it during inference, our full pipeline train w/o adapter full pipeline, $\alpha = 1$ full pipeline, $\alpha = 0$ (3rd row) achieves superior quality devoid of watermarks. This implies that the visual distribution within the training dataset can be effectively eliminated by merely dropping the adapter.
|
| 302 |
+
|
| 303 |
+
# B.3 BENEFITS FROM SCALE-UP TRAINING
|
| 304 |
+
|
| 305 |
+
In practice, we find that the overall quality of the generated animations benefits from scale-up training. This involves training with larger batch sizes, video resolution, and the number of total optimizing iterations. In Fig. 11, we present two pairs of qualitative comparisons between motion modules trained with standard and scale-up training. Under the scale-up training setting, we train the motion module on the resolutions of $3 2 0 \times 5 1 2$ , with $8 \times$ larger batch size compared to the standard setting. The result indicates that considerable enhancement in motion amplitude and diversity can be achieved through an increase in the training scale. For instance, the camera involves view angle changes (2nd row) in contrast to mere zooming (1st row). The character’s head displays turning movements (4th row) rather than solely facing forward (3rd row).
|
| 306 |
+
|
| 307 |
+
# C LIMITATIONS
|
| 308 |
+
|
| 309 |
+
# C.1 MOTION PRIORS IN ANIMATEDIFF
|
| 310 |
+
|
| 311 |
+
The transferable motion priors in AnimateDiff are learned from a large-scale video dataset WebVid10M (Bain et al., 2021) that encompasses mainly real-world footage. Supported by the richness and diversity of the dataset, the motion module can learn real-world motions (Ding et al., 2022) like sea waves, vehicular movement, and human actions, which are modeled by the temporal self-attention mechanism. Therefore, the motion priors largely depend on the dataset coverage and accuracy, which introduces potential limitations discussed as follows.
|
| 312 |
+
|
| 313 |
+
Motion diversity and complexity. In practice, we find that the motion module pre-trained on WebVid-10M performs well on non-violent motions such as fluid (e.g., ocean waves, fog, etc.), rigid objects (e.g., cars, boats), and simple human movements (e.g., walking, facial expressions). This aligns with our observation that the training dataset predominantly encompasses these motions.
|
| 314 |
+
|
| 315 |
+
However, the module struggles with complex motions that are infrequent in the training dataset and challenging to represent via short video clips during training, e.g., dance movements and drastic scene changes. These instructions often result in static synthetic outcomes or unnatural deformations. Potential solutions could involve enriching the training set’s motion diversity or training with larger resolution and extended clip length, which will help to better model motion patterns.
|
| 316 |
+
|
| 317 |
+
Text-motion alignment. In the pre-training dataset, WebVid-10M, most text labels primarily describe visual content while overlooking detailed motion descriptions. Consequently, this leads to the animations generated by AnimateDiff exhibiting little response to the motion descriptions. Notwithstanding, this phenomenon does not imply that the motion module does not acquire corresponding motion priors. For instance, zoom-in/out effects frequently appear in the pre-training videos. However, their text labels typically contain only broad “zooming” tags, making it difficult for the motion module to distinguish the difference between zoom-in and zoom-out accurately. As a result, utilizing a “zoom in” prefix alongside the common text prompt generates both zoom-in and zoom-out effects, indicating the need for a video dataset with more accurately labeled motion tags. This also suggests that MotionLoRA does not learn new motion patterns entirely from scratch but refines and enhances the pre-existing motion priors (regardless of whether they can be triggered by text) obtained during pre-training, enabling the motion module to express such priors as desired during inference.
|
| 318 |
+
|
| 319 |
+
# C.2 DEPENDENCY ON IMAGE BACKBONE
|
| 320 |
+
|
| 321 |
+
Under the decoupled training strategy, the motion and visual content in the generated animations originate from the pre-trained motion module and the underlying image backbone, respectively. Consequently, the performance of the entire pipeline of AnimateDiff is heavily reliant on the underlying T2I models. If the base model struggles to respond appropriately to the text prompt and fails to generate accurate content, the additional motion module is unlikely to compensate for this weakness. Conversely, superior image backbones can enhance the synthetic results. To demonstrate this, we implement AnimateDiff on Stable Diffusion XL (Podell et al., 2023) and compare general T2V results on rare semantic compositions against the Stable Diffusion V1.5 version, as depicted in Fig. 12. The figure illustrates that the synthetic video based on SDXL achieves better visual composition and semantic alignment.
|
| 322 |
+
|
| 323 |
+
Practically, to mitigate potential limitations introduced by the foundational T2I models, employing off-the-shelf modules such as IP-adapter (Ye et al., 2023) for additional style/content reference, ControlNet (Zhang et al., 2023) for spatial composition corrections, could be beneficial.
|
| 324 |
+
|
| 325 |
+
# D MORE VISUAL RESULTS
|
| 326 |
+
|
| 327 |
+
In Fig. 13, we show more visual results of AnimateDiff and the results of further combing AnimateDiff with MotionLoRA to achieve shot type control. In Fig. 14, we show more qualitative comparisons between AnimateDiff and four academic and commercial baselines. In Fig. 15, we compare two motion module architectures, i.e., the full convolution one and its Transformer counterpart.
|
| 328 |
+
|
| 329 |
+
Oil painting
|
| 330 |
+
|
| 331 |
+
Realistic Vision
|
| 332 |
+
|
| 333 |
+
Realistic Vision
|
| 334 |
+
|
| 335 |
+
Realistic Vision city, rainy day, wet, car, a bustling street, oil painting, . . .
|
| 336 |
+
|
| 337 |
+
photo of 18 y.o woman in dress, night city street, motion blur, . . .
|
| 338 |
+
|
| 339 |
+
photo of a cyberpunk city street, night time, dark atmosphere, . . .
|
| 340 |
+
|
| 341 |
+
b&w photo of 42 y.o man in black clothes, bald, face, half body, . . .
|
| 342 |
+
|
| 343 |
+
Oil painting
|
| 344 |
+
|
| 345 |
+
Lyriel
|
| 346 |
+
|
| 347 |
+
Oil painting epiC Realism oil painting, black pearl pirate ship, wind, waves, night time, . . .
|
| 348 |
+
|
| 349 |
+
portrait of halo, sunglasses, blue eyes, tartan scarf, . . .
|
| 350 |
+
|
| 351 |
+
oil painting, mountain, lake water, boat, forest, masterpiece, . . .
|
| 352 |
+
|
| 353 |
+
landscape, a rocky mountain with milky way, nighttime, . . .
|
| 354 |
+
|
| 355 |
+
epiC Realism epiC Realism
|
| 356 |
+
|
| 357 |
+
ToonYou
|
| 358 |
+
|
| 359 |
+
Realistic Vision (zoom-in) A nebula in universe, highly detailed, colorful, . . .
|
| 360 |
+
|
| 361 |
+
(rolling) landscape of a aesthetically Belgium and wildflower, . . .
|
| 362 |
+
|
| 363 |
+
(rolling) 1boy, dark skin, playing guitar, concert, stage lights, . . .
|
| 364 |
+
|
| 365 |
+
(zoom-in) cabins in the forest, water, aurora in the sky, fog, . . .
|
| 366 |
+
|
| 367 |
+
Oil Painting
|
| 368 |
+
|
| 369 |
+
MoXin
|
| 370 |
+
|
| 371 |
+
RCNZ Cartoon 3d
|
| 372 |
+
|
| 373 |
+
Lyriel
|
| 374 |
+
|
| 375 |
+
(panning) oil painting, house, grass, wheat field laboring crowd, . . .
|
| 376 |
+
|
| 377 |
+
(panning) fantastic composition, old Chinese town, . . .
|
| 378 |
+
|
| 379 |
+
(panning) a golden labrador, warm vibrant colours, . . .
|
| 380 |
+
|
| 381 |
+
(tilting) waters, canyon, sunlight, traveler, high quality, . . .
|
| 382 |
+
|
| 383 |
+
Figure 13: Additional qualitative results. Best viewed with Acrobat Reader. Click the images to play the animation clips.
|
| 384 |
+
|
| 385 |
+
<table><tr><td>Tune-A-Video</td><td>AnimateDiff</td><td>T2V-Zero</td><td>AnimateDiff</td></tr><tr><td>a man is playing guitar, dramatic lighting,.. Pika Labs (2023)</td><td>AnimateDiff</td><td>a girl is playing guitar, wavy hair, upper body,.. Gen-2 (2023)</td><td>AnimateDiff</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>cabins in the forest, water,aurora in the sky,fog,.. Pika Labs (2023)</td><td>AnimateDiff</td><td>taxi, rear view, New York city at night,... Gen-2 (2023)</td><td>AnimateDiff</td></tr><tr><td colspan="2">sunset, orange sky, fishing boats,ocean waves,...</td><td></td><td>a woman standing on the road at night,...</td></tr></table>
|
| 386 |
+
|
| 387 |
+
Figure 14: Qualitative comparison. Best viewed with Acrobat Reader. Click the images to play the animation clips.
|
md/test/IEduRUO55F/IEduRUO55F.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/test/JVeM7uwDwK/JVeM7uwDwK.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/test/KOZu91CzbK/KOZu91CzbK.md
ADDED
|
@@ -0,0 +1,575 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RETROFORMER: RETROSPECTIVE LARGE LANGUAGE AGENTS WITH POLICY GRADIENT OPTIMIZATION
|
| 2 |
+
|
| 3 |
+
Weiran Yao†, Shelby Heinecke†, Juan Carlos Niebles†, Zhiwei Liu†, Yihao Feng†, Le $\mathbf { X } \mathbf { u } \mathbf { e } ^ { \dagger }$ , Rithesh Murthy†, Zeyuan Chen†, Jianguo Zhang†, Devansh Arpit†, Ran $\mathbf { X } \mathbf { u } ^ { \dag }$ , Phil $\mathbf { M } \mathbf { u } \mathbf { i } ^ { \dagger }$ , Huan Wang†, ∗, Caiming Xiong†, ∗, Silvio Savarese†, ∗
|
| 4 |
+
|
| 5 |
+
†Salesforce AI Research
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Recent months have seen the emergence of a powerful new trend in which large language models (LLMs) are augmented to become autonomous language agents capable of performing objective oriented multi-step tasks on their own, rather than merely responding to queries from human users. Most existing language agents, however, are not optimized using environment-specific rewards. Although some agents enable iterative refinement through verbal feedback, they do not reason and plan in ways that are compatible with gradient-based learning from rewards. This paper introduces a principled framework for reinforcing large language agents by learning a retrospective model, which automatically tunes the language agent prompts from environment feedback through policy gradient. Specifically, our proposed agent architecture learns from rewards across multiple environments and tasks, for fine-tuning a pre-trained language model which refines the language agent prompt by summarizing the root cause of prior failed attempts and proposing action plans. Experimental results on various tasks demonstrate that the language agents improve over time and that our approach considerably outperforms baselines that do not properly leverage gradients from the environment.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Recently, we have seen the emergence of a powerful new trend in which large language models (LLMs) are augmented to become autonomous language action agents capable of performing tasks on their own, ultimately in the service of a goal, rather than responding to queries from human users. Prominent studies, including ReAct (Yao et al., 2023), Toolformer (Schick et al., 2023), HuggingGPT (Shen et al., 2023), Generative Agents (Park et al., 2023), WebGPT (Nakano et al., 2021), AutoGPT (Gravitas, 2023), BabyAGI (Nakajima, 2023), and Langchain (Chase, 2023), have successfully showcased the viability of creating autonomous decision-making agents by leveraging the capabilities of LLMs. These approaches use LLMs to generate text-based outputs and actions that can be further employed for making API calls and executing operations within a given environment.
|
| 14 |
+
|
| 15 |
+
Given the immense scale of LLMs with an extensive parameter count, the behaviors of most existing language agents, however, are not optimized or aligned with environment reward functions. An exception is a very recent language agent architecture, namely Reflexion (Shinn et al., 2023), and several other related work, e.g., Self-Refine (Madaan et al., 2023b) and Generative Agents (Park et al., 2023), which use verbal feedback, namely self-reflection, to help agents learn from prior failure. These reflective agents convert binary or scalar reward from the environment into verbal feedback in the form of a textual summary, which is then added as additional context to the prompt for the language agent. The self-reflection feedback acts as a semantic signal by providing the agent with a concrete direction to improve upon, helping it learn from prior mistakes and prevent repetitive errors to perform better in the next attempt.
|
| 16 |
+
|
| 17 |
+
Although the self-reflection operation enables iterative refinement, generating useful reflective feedback from a pre-trained, frozen LLM is challenging, as showcased in Fig. 1, since it requires the
|
| 18 |
+
|
| 19 |
+
LLM to have a good understanding of where the agent made mistakes in a specific environment, i.e., the credit assignment problem (Sutton & Barto, 2018), as well as the ability to generate a summary containing actionable insights for improvement. The verbal reinforcement cannot be optimal, if the frozen language model has not been properly fine-tuned to specialize in credit assignment problems for the tasks in given environments. Furthermore, the existing language agents do not reason and plan in ways that are compatible with differentiable, gradient-based learning from rewards by exploiting the existing abundant reinforcement learning techniques. To address these limitations, this paper introduces Retroformer, a principled framework for reinforcing language agents by learning a plug-in retrospective model, which automatically refines the language agent prompts from environment feedback through policy optimization. Specifically, our proposed agent architecture can learn from arbitrary reward information across multiple environments and tasks, for iteratively fine-tuning a pre-trained language model, which refines the language agent prompts by reflecting on failed attempts and assigning credits of actions taken by the agent on future rewards.
|
| 20 |
+
|
| 21 |
+
# 1. Task instruction
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: An example of uninformative self-reflections from a frozen LLM. The root cause of failure in prior trial is that the agent should have only submitted the spinoff series “Teen Titans Go” and not “Teen Titans” in the answer. The agent forgot its goal during a chain of lengthy interactions. The verbal feedback from a frozen LLM, however, only rephrases the prior failed actions sequences as the proposed plan, resulting repetitive, incorrect actions in the next trial.
|
| 25 |
+
|
| 26 |
+
We conduct experiments on a number of real-world tasks including HotPotQA (Yang et al., 2018), which involves search-based question answering tasks, AlfWorld (Shridhar et al., 2021), in which the agent solves embodied robotics tasks through low-level text actions, and WebShop (Yao et al., 2022), a browser environment for web shopping. We observe Retroformer agents are faster learners compared with Reflexion, which does not use gradient for reasoning and planning, and are better decision-makers and reasoners. More concretely, Retroformer agents improve the success rate in HotPotQA by $18 \%$ with 4 retries, $36 \%$ in AlfWorld with 3 retries and $4 \%$ in WebShop, which demonstrate the effectiveness of gradient-based learning for LLM action agents.
|
| 27 |
+
|
| 28 |
+
To summarize, our contributions are the following:
|
| 29 |
+
|
| 30 |
+
• The paper introduces Retroformer, which iteratively refines the prompts given to large language agents based on environmental feedback to improve learning speed and task completion. We take a policy gradient approach with the Actor LLM being part of the environment, allowing learning from a wide range of reward signals for diverse tasks.
|
| 31 |
+
• The proposed method focuses on fine-tuning the retrospective model in the language agent system architecture, without accessing the Actor LLM parameters or needing to propagate gradients through it. The agnostic nature of Retroformer makes it a flexible plug-in module for various types of cloud-based LLMs, such as OpenAI GPT or Google Bard.
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORK
|
| 34 |
+
|
| 35 |
+
Autonomous Language Agents We summarize in Table 1 the recent language agent literature related to our work from five perspectives and differentiate our method from them. The completion of a complex task typically involves numerous stages. An AI agent must possess knowledge of these stages and plan accordingly. Chain-of-Thoughts or CoT (Wei et al., 2022) is the pioneering work that prompts the agent to decompose challenging reasoning tasks into smaller, more manageable steps. ReAct (Yao et al., 2023), on the other hand, proposes the exploitation of this reasoning and acting proficiency within LLM to encourage interaction with the environment (e.g. using the Wikipedia search API) by mapping observations to the generation of reasoning and action traces or API calls in natural language. This agent architecture has spawned various applications, such as HuggingGPT (Shen et al., 2023), Generative Agents (Park et al., 2023), WebGPT (Nakano et al., 2021), AutoGPT (Gravitas, 2023), and BabyAGI (Nakajima, 2023).
|
| 36 |
+
|
| 37 |
+
Table 1: Related work on large language agents.
|
| 38 |
+
|
| 39 |
+
<table><tr><td>Approach</td><td>Gradient learning</td><td>Arbitrary reward</td><td>Iterative refinement</td><td>Hidden constraints</td><td>Decision making</td><td>Memory</td></tr><tr><td>CoT (Wei et al., 2022)</td><td>X</td><td>×</td><td>X</td><td>×</td><td>x<x></td><td>x<x<<√</td></tr><tr><td>ReAct (Yao et al., 2023)</td><td>X</td><td>×</td><td>×</td><td>√</td><td></td><td></td></tr><tr><td>Self-refine (Madaan et al., 2023b)</td><td>×</td><td>×</td><td></td><td>x√</td><td></td><td></td></tr><tr><td>RAP (Hao et al., 2023)</td><td>×</td><td>×</td><td></td><td></td><td></td><td></td></tr><tr><td>Reflexion (Shinn et al., 2023)</td><td>×</td><td>×</td><td>√</td><td></td><td></td><td></td></tr><tr><td>Retroformer (our method)</td><td>√</td><td>√</td><td>√</td><td>√</td><td>√</td><td></td></tr></table>
|
| 40 |
+
|
| 41 |
+
However, these approaches fail to learn from valuable feedback, such as environment rewards, to enhance the agent’s behaviors, resulting in performances that are solely dependent on the quality of the pre-trained LLM. Self-refine (Madaan et al., 2023a) addresses this limitation by employing a single LLM as a generator, refiner, and provider of feedback, allowing for iterative refinement of outputs. However, it is not specifically tailored for real-world task-based interaction with the environment. On the other hand, RAP (Hao et al., 2023) repurposes the LLM to function as both a world model and a reasoning agent. It incorporates Monte Carlo Tree Search for strategic exploration within the extensive realm of reasoning with environment rewards. This approach enables effective navigation and decision-making in complex domains. Recently, Shinn et al. (2023) presents Reflexion, a framework that equips agents with dynamic memory and self-reflection capabilities, enhancing their reasoning skills. Self-reflection plays a pivotal role, allowing autonomous agents to iteratively refine past actions, make improvements, and prevent repetitive errors.
|
| 42 |
+
|
| 43 |
+
Transformer Reinforcement Learning Reinforcement learning with a provided reward function or a reward-labeled dataset, commonly referred to as RLHF, has become a standard practice within the LLM fine-tuning pipeline. These endeavors have convincingly demonstrated the efficacy of RL as a means to guide language models towards desired behaviors that align with predefined reward functions encompassing various domains, including machine translation, summarization, and generating favorable reviews. Among the prevalent transformer RL methods are online RL algorithms such as Proximal Policy Optimization or PPO (Schulman et al., 2017), and offline RL techniques such as Implicit Language Q-Learning or ILQL (Snell et al., 2022) and Direct Preference Optimization or DPO (Rafailov et al., 2023). These methods have been implemented in TRL/TRLX (von Werra et al., 2020; Max et al., 2023) distributed training framework.
|
| 44 |
+
|
| 45 |
+
# 3 NOTATION AND FORMULATION
|
| 46 |
+
|
| 47 |
+
In this work, we denote a large language model (LLM) based action agent as a function $\mathcal { M } _ { \xi _ { l } } : \mathcal { X } \to$ $\mathcal { A }$ , where $\mathcal { X }$ is the space of prompts, which may include the actual prompts $x ^ { u }$ provided by the users, as well as some contextual information $c \in { \mathcal { C } }$ . Here $\mathcal { C }$ is the space of context as a representation of the current state $s$ returned by the environment $\Omega$ . $\mathcal { A }$ is the space of actions. Note the actions taken by most language model based agents are sampled auto-repressively, so $\mathcal { M }$ is a random function. The subscript $\xi _ { l }$ denotes the re-parameterized random variables involved in the sampling process. Another note is, the LLM-based agent itself is stateless. All the states and possible memorization are characterized as text in the agent prompt $x$ .
|
| 48 |
+
|
| 49 |
+
The environment is defined as a tuple $( \mathcal { T } _ { \xi _ { o } } , \mathcal { R } )$ . $\mathcal { T } _ { \xi _ { o } } : \mathcal { S } \times \mathcal { A } \mathcal { S }$ is the state transition function, where $s$ is the space of states and $\mathcal { A }$ is the action space. Here we assume the states and actions are represented using text. Again we used $\xi _ { o }$ to represent the randomness involved in the state transition. For each state $s \in S$ , a reward function is defined as $\mathcal { R } : \mathcal { S } \mathbb { R }$ . At each step of the play, the state $s$ is described using natural language, and integrated into the context $c$ . In the context, previous states may also be described and embedded to help LLMs making a good guess on the next action to take. As in all the reinfor episode returns $\begin{array} { r } { G _ { c u m } = \sum _ { t = 0 } ^ { T } R ( s _ { t } ) } \end{array}$ ing, the final goal is to maximize the cumulativ. In many situations, the rewards are sparse, i.e., $R ( s _ { t } )$ rds, are
|
| 50 |
+
|
| 51 |
+
The retrospective model takes the all the previous states $s _ { 1 } , \ldots , t$ , actions $a _ { 1 } , \ldots , t$ , rewards $r _ { 1 } , \ldots , t$ , and the user prompt $x ^ { u }$ as input, and massage them into a new prompt $x$ to be consumed by the LLM:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\Gamma _ { \xi _ { r } , \Theta } : [ S _ { i } , \mathcal { A } _ { i } , \mathcal { R } _ { i } , \mathcal { X } _ { i } ^ { u } ] _ { i = 1 } ^ { t } \to \mathcal { X } ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\xi _ { r }$ stands for the randomness involved in the retrospective model, and $\Theta$ is the set of learnable parameters in the retrospective model. The goal of the RL optimization is
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r l } & { \underset { \Theta } { \arg \operatorname* { m a x } } \quad \mathbb { E } _ { \xi _ { l } , \xi _ { o } , \xi _ { r } } \left[ \overset { T } { \underset { t = 1 } { \sum } } R ( s _ { t } ) \right] \quad \quad s . t . } \\ & { s _ { t + 1 } = \mathcal { T } _ { \xi _ { o } } \left( s _ { t } , \mathcal { L } _ { \xi _ { l } } \circ \Gamma _ { \xi _ { r } , \Theta } \left( \left[ s _ { i } , a _ { i } , r _ { i } , x _ { i } ^ { u } \right] _ { i = 1 } ^ { t } \right) \right) , \quad \forall t \in \{ 1 , \cdots , T - 1 \} } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Note that the only learnable parameters are in the retrospective model $M _ { r }$ . Since LLM action agent is frozen, it can be considered as part of the environment. Specifically, if we construct another environment with the transition function $T ^ { \prime } = \mathcal { T } ( S , \bullet ) \circ \mathcal { L } : \bar { S } \times \mathcal { X } \ : \ : S$ , and the same reward function $\mathcal { R }$ , then Eq. (2) is just a regular RL optimization so all the popular RL algorithms apply.
|
| 64 |
+
|
| 65 |
+
# 4 OUR APPROACH: REINFORCING RETROSPECTIVE LANGUAGE AGENT
|
| 66 |
+
|
| 67 |
+
As illustrated in Fig. 2, our proposed framework Retroformer is comprised of two language model components: an actor LLM, denoted as $M _ { a }$ , which generates reasoning thoughts and actions, and a retrospective LLM, denoted as $M _ { r }$ , which generates verbal reinforcement cues to assist the actor in self-improvement by refining the actor prompt with reflection responses.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 2: Framework overview. (a) The retrospective agent system (Sec. 4.1) contains two LLMs communicating to refine agent prompts with environment feedback. (b) The retrospective LM is fine-tuned with response ratings using proximal policy optimization (Sec. 4.2).
|
| 71 |
+
|
| 72 |
+
We assume in this paper that the actor model is a frozen LLM whose model parameters are inaccessable (e.g., OpenAI GPT) and the retrospective model is a smaller, local language model that can be fine-tuned under low-resource settings (e.g., Llama-7b). In addition, Retroformer has an iterative policy gradient optimization step which is specifically designed to reinforce the retrospective model with gradient-based approach. We provide in this section a detailed description of each of these modules and subsequently elucidate their collaborative functioning within the Retroformer framework. The implementation details are presented in Appendix C.
|
| 73 |
+
|
| 74 |
+
# 4.1 RETROSPECTIVE AGENT ARCHITECTURE
|
| 75 |
+
|
| 76 |
+
As illustrated in Fig. 2(a), for the actor and retrospective models, we apply a standard communication protocol modified from the Relexion agent architecture (Shinn et al., 2023), in which the retrospective model refines the actor prompt by appending verbal feedback to the prompt.
|
| 77 |
+
|
| 78 |
+
Actor Model The actor model is a LLM hosted in the cloud, whose model parameters are hidden and frozen all the time. The actor LM is instructed to generate actions with required textual content, taking into account the observed states. Similar to reinforcement learning, we select an action or generation, denoted as $a _ { t }$ , from the current policy $\pi _ { \theta }$ at time step $t$ and receive an observation, represented by $s _ { t }$ , from the environment. We use ReAct (Yao et al., 2023) as our actor prompt.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
a _ { k , i , t } = M _ { a } \left( \left[ s _ { k , i , \tau } , a _ { k , i , \tau } , r _ { k , i , \tau } \right] _ { \tau = 1 } ^ { t - 1 } , s _ { k , i , t } \right) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
Retrospective Model The retrospective model $M _ { r }$ is instantiated as a local LM. Its primary function is to produce self-reflections, offering valuable feedback for diagnosing a possible reason for prior failure and devising a new, concise, high-level plan that aims to mitigate same failure. Operating under a sparse reward signal, such as binary success status (success/failure), the model detects the root cause of failure by considering the current trajectory alongside its persistent memory.
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { r } { y _ { k , i } = M _ { r } ( \underbrace { \left[ s _ { k , i , \tau } , a _ { k , i , \tau } , r _ { k , i , \tau } \right] _ { \tau = 1 } ^ { T } , G _ { k , i } } _ { \mathrm { R e f l e c t i o n ~ p r o m p t } \ x _ { k , i } } ) . } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
This self-reflection feedback $y _ { k , i }$ is appended to the actor prompt to prevent repetitive errors in a specific environment in future attempts. Consider a multi-step task, wherein the agent failed in the prior trial. In such a scenario, the retrospective model can detect that a particular action, denoted as $a _ { t }$ , led to subsequent erroneous actions and final failure. In future trials, the actor LM can use these self-reflections, which are appended to the prompt, to adapt its reasoning and action steps at time $t$ , opting for the alternative action $a _ { t } ^ { \prime }$ . This iterative process empowers the agent to exploit past experiences within a specific environment and task, thereby avoiding repetitive errors.
|
| 91 |
+
|
| 92 |
+
Memory Module The actor model generates thoughts and actions, by conditioning on its recent interactions (short-term memory) and reflection responses (long-term memory) in the text prompt.
|
| 93 |
+
|
| 94 |
+
• Short-term memory. The trajectory history $\tau _ { i }$ of the current episode $i$ serves as the short-term memory for decision making and reasoning.
|
| 95 |
+
• Long-term memory. The self-reflection responses that summarize prior failed attempts are appended to the actor prompt as the long-term memory.
|
| 96 |
+
|
| 97 |
+
To facilitate policy optimization in Section 4.2, we store the instructions and responses of the retrospective model of each trial, together with the episode returns in a local dataset, which we call replay buffer. We sample from the replay buffer to fine-tune the retrospective model. The long and short-term memory components provide context that is specific to a given task over several failed trials and the replay buffer provides demonstrations of good and bad reflections across the tasks and environments, so that our Retroformer agent not only exploits lessons learned over failed trials in the current task, but also explores by learning from success in other related tasks.
|
| 98 |
+
|
| 99 |
+
• Replay buffer. The memory $D _ { \mathrm { R L } }$ which stores the triplets $( x _ { k , i } , y _ { k , i } , G _ { k , i } )$ of the reflection instruction prompt ${ \boldsymbol { x } } _ { k , i }$ , reflection response $y _ { k , i }$ and episode return $G _ { k , i }$ of trial $i$ and task $k$ .
|
| 100 |
+
|
| 101 |
+
Reward Shaping Instead of exactly matching the ground truth to produce a binary reward, we use soft matching (e.g., f1 score) whenever possible to evaluate the alignment of the generated output with the expected answer or product as the reward function. The details are in Appendix C.3.
|
| 102 |
+
|
| 103 |
+
# 4.2 POLICY GRADIENT OPTIMIZATION
|
| 104 |
+
|
| 105 |
+
The actor model $M _ { a }$ is regarded as an frozen LLM, such as GPT, with inaccessible model parameters. In this scenario, the most direct approach to enhancing actor performance in a given environment is by refining the actor LM’s prompt. Consequently, the retrospective model $M _ { r }$ , a smaller local language model, paraphrases the actor’s prompt by incorporating a concise summary of errors and valuable insights from failed attempts. We therefore aim to optimize the $M _ { r }$ model using environment reward. The desired behavior of $M _ { r }$ is to improve the actor model $M _ { a }$ in next attempt. Hence, the difference in episode returns between two consecutive trials naturally serves as a reward signal for fine-tuning the retrospective model $M _ { r }$ with reinforcement learning.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 3: Policy gradient optimization of retrospective LM using RLHF training pipeline.
|
| 109 |
+
|
| 110 |
+
Instruction and Response Generation The retrospective model generates a pair of instruction and response at the end of each episode $i$ in the environment $k$ . In the episode $i$ , the actor produces a trajectory $\tau _ { i }$ by interacting with the environment. The reward function then produces a score $r _ { i }$ . At the end of the episode, to produce verbal feedback for refining the actor prompt, $M _ { r }$ takes the set of $\{ \tau _ { i } , r _ { i } \}$ as the instruction ${ \boldsymbol { x } } _ { k , i }$ and is prompted to produce a reflection response $y _ { k , i }$ . All these instruction-response pairs $( x _ { k , i } , y _ { k , i } )$ across tasks and trials are stored to a local dataset $D _ { \mathrm { R L } }$ , which we call “replay buffer”, for fine-tuning the $M _ { r }$ .
|
| 111 |
+
|
| 112 |
+
Response Rating As illustrated in Fig. 2(b), let us assume a reflection prompt $x _ { k , i }$ and the corresponding episode return $G _ { k , i }$ , and the retrospective model $M _ { r }$ generates the response $y _ { k , i }$ that summarizes the mistakes in $i$ , which results in the return $G _ { k , i + 1 }$ in the next attempt $i + 1$ . Because the actor is a frozen LM and the temperature is low as default (Yao et al., 2023), the injected randomness that leads to differences in returns $\Delta G _ { k , i } = G _ { k , i + 1 } - G _ { k , i }$ are mostly from the reflection responses $y _ { k , i }$ , in which positive $\Delta G _ { k , i }$ indicates better responses that help the actor learn from prior errors, and hence should be rated with higher scores; negative or zero $\Delta G _ { k , i }$ indicates worse responses that needs to be avoided and hence should be rated with lower scores. Therefore, we approximate the rating score of a reflection instruction-response pair $( x _ { k , i } , y _ { k , i } )$ as:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
r ( x _ { k , i } , y _ { k , i } ) \triangleq G _ { k , i + 1 } - G _ { k , i } .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
Proximal Policy Optimization The optimization step of Retroformer is visualized in Fig. 3. We use the differences of episode returns as the ratings of the generated reflection responses. The retrospective language model is fine-tuned with the response ratings following the RLHF training procedures (although we do not have human in the loop) with proximal policy optimization (PPO):
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { P P O } } = \mathbb { E } _ { x \sim D _ { \mathrm { R L } } } \mathbb { E } _ { y \sim \mathrm { L L M } _ { \phi } ^ { \mathrm { R L } } ( x ) } \left[ r _ { \theta } ( x , y ) - \beta \log \frac { \mathrm { L L M } _ { \phi } ^ { \mathrm { R L } } ( y | x ) } { \mathrm { L L M } ^ { \mathrm { R e f } } ( y | x ) } \right] , } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $( x , y )$ are sampled from the replay buffer (note there is only 1 step in the Retrospective model’s trajactory), $r _ { \theta } ( x , y )$ is the defined reward model, and the second term in this objective is the KL divergence to make sure that the fine-tuned model $\mathrm { L L M } ^ { \mathrm { R L } }$ does not stray too far from the frozen reference model LLMRef.
|
| 125 |
+
|
| 126 |
+
For offline training, we collected the dataset $D _ { \mathrm { R L } }$ by rolling out a base policy, i.e., the frozen actor LM and the initialized retrospective LM, in the tasks in the training sets for $N$ trials and compute the ratings. We apply the standard RLHF pipeline to fine-tune the retrospective model offline before evaluating the agent in the validation tasks. In online execution, we use best-of- $n$ sampler, with the scores evaluated by the learned reward model from RLHF pipeline (Ouyang et al., 2022), for generating better retrospective responses in each trial.
|
| 127 |
+
|
| 128 |
+
# 5 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
Extensive experiments are conducted to evaluate our method, including comparisons with ReAct and Reflexion performances, and visualization and discussion of agent’s generated text and actions.
|
| 131 |
+
|
| 132 |
+
# 5.1 EXPERIMENT SETUP
|
| 133 |
+
|
| 134 |
+
# 5.1.1 ENVIRONMENT
|
| 135 |
+
|
| 136 |
+
We use open-source environments: HotPotQA (Yang et al., 2018), WebShop (Yao et al., 2022) and AlfWorld (Shridhar et al., 2021) , which evaluates the agent’s reasoning and tool usage abilities for question answering reasoning, multi-step decision making, and web browsing.
|
| 137 |
+
|
| 138 |
+
HotPotQA The agent is asked to solve a question answering task by searching in Wikipedia pages. At each time step, the agent is asked to choose from three action types or API calls:
|
| 139 |
+
|
| 140 |
+
1. SEARCH[ENTITY], which searches the exact entity on Wikipedia and returns the first paragraph if it exists. If not, it will return some similar entities to search.
|
| 141 |
+
2. LOOKUP[KEYWORD], which returns the next sentence containing keyword in the last passage successfully found by Search.
|
| 142 |
+
3. FINISH[ANSWER], which returns the answer and finishes the task.
|
| 143 |
+
|
| 144 |
+
AlfWorld The agent is asked to perform six different tasks, including finding hidden objects (e.g., finding a spatula in a drawer), moving objects (e.g., moving a knife to the cutting board), and manipulating objects with other objects (e.g., chilling a tomato in the fridge) by planning with the following action APIs, including GOTO[LOCATION], TAKE[OBJ], OPEN[OBJ], CLOSE[OBJ] , TOGGLE[OBJ], CLEAN[OBJ], HEAT[OBJ], and COOL[OBJ], etc.
|
| 145 |
+
|
| 146 |
+
WebShop The agent is asked to solve a shopping task by browsing websites with detailed product descriptions and specifications. The action APIs include searching in the search bar, i.e., SEARCH[QUERY] and clicking buttons in the web pages, i.e., CHOOSE[BUTTON]. The clickable buttons include, product titles, options, buy, back to search, prev/next page, etc.
|
| 147 |
+
|
| 148 |
+
# 5.2 EXPERIMENT SETTINGS
|
| 149 |
+
|
| 150 |
+
We use GPT-3 (model: text-davinci-003) and GPT-4 as the frozen actor model. For the retrospective model, we fine-tune it from LongChat (model: longchat-7b-16k). The implementation details, which include data collection and model training are in Appendix C.
|
| 151 |
+
|
| 152 |
+
Evaluation Metrics We report the success rate over validation tasks in an environment. The agent is evaluated on 100 validation tasks from the distractor dev split of open-source HotPotQA dataset, 134 tasks in AlfWorld and 100 tasks in WebShop, as in (Shinn et al., 2023).
|
| 153 |
+
|
| 154 |
+
Baselines We experiment with two language agent baselines: 1) ReAct (Yao et al., 2023). This is the state-of-the-art frozen language agent architecture, which does not learn from the environment rewards at all, thus serving as a baseline for showing how the agent performs without using environment feedback. 2) Reflexion (Shinn et al., 2023). This is the state-of-the-art language agent architecture that the authors identify from literature so far. This agent enhances from verbal feedback of the environment, but does not use gradient signals explicitly. It can serve as a baseline for showing the effectiveness of gradient-based learning. 3) SAC. Furthermore, we include one online RL algorithm, i.e., Soft Actor-Critic (Haarnoja et al., 2018), or SAC as baseline model for comparison.
|
| 155 |
+
|
| 156 |
+
# 5.3 RESULTS
|
| 157 |
+
|
| 158 |
+
We present the experiment results in Table 2 and discuss the details below.
|
| 159 |
+
|
| 160 |
+
Table 2: Results with Retroformer in the HotPotQA, AlfWorld and Webshop environments. We report the average success rate for the language agents over tasks in the environment. “#Params” denotes the learnable parameters of each approach. “#Retries” denotes the number of retry attempts. “LoRA $r ^ { \mathrm { : } }$ ” denotes the rank of low-rank adaptation matrices for fine-tuning.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Method</td><td>#Params</td><td>#Retries</td><td>HotPotQA</td><td></td><td>AlfWorld</td><td></td><td>WebShop</td><td></td></tr><tr><td>SAC</td><td>2.25M</td><td>N=4</td><td>27</td><td></td><td>58.95%</td><td></td><td>30%</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td colspan="9"> Actor LLM</td></tr><tr><td></td><td></td><td></td><td>GPT-3</td><td>GPT-4</td><td>GPT-3</td><td>GPT-4</td><td>GPT-3</td><td>GPT-4</td></tr><tr><td>ReAct Reflexion</td><td>0</td><td></td><td>34%</td><td>40%</td><td>62.69%</td><td>77.61%</td><td>33%</td><td>42%</td></tr><tr><td rowspan="2"></td><td>0</td><td>N=1</td><td>42%</td><td>46%</td><td>76.87% 84.33%</td><td>81.34%</td><td>35% 35%</td><td>42%</td></tr><tr><td></td><td>N=4</td><td>50%</td><td>52%</td><td></td><td>85.07%</td><td></td><td>44%</td></tr><tr><td rowspan="2">Retroformer (w/ LoRA r=1)</td><td>0.53M</td><td>N=1</td><td>45%</td><td>48%</td><td>93.28% 100%</td><td>95.62%</td><td>36%</td><td>43%</td></tr><tr><td></td><td>N=4</td><td>53%</td><td>53%</td><td></td><td>100%</td><td>36%</td><td>45%</td></tr><tr><td rowspan="2">Retroformer (w/ LoRA r=4)</td><td>2.25M</td><td>N=1</td><td>48%</td><td>51%</td><td>97.76%</td><td>97.76%</td><td>34%</td><td>43%</td></tr><tr><td></td><td>N=4</td><td>54%</td><td>54%</td><td>100%</td><td>100%</td><td>36%</td><td>46%</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Question Answering – HotPotQA We visualize the performances of Retroformer against the baselines in Fig. 4. As shown in Table 2, we observe that our method consistently improve the agent performances over trials and the effects of fine-tuned retrospective model (Retroformer) are mostly significant in the first few trials.
|
| 165 |
+
|
| 166 |
+
Furthermore, as shown in Fig. 4, our agent outperforms the two strong baselines. Specifically, the results indicate that our reinforced model provides the language agents with better reflection responses in early trials, which enables the agents to learn faster, while also achieving better performances in the end. Our Retroformer agent achieves $54 \%$ success rate in 4 trials, which is better than the stateof-the-art $50 \%$ success rate reported in (Jang, 2023) that uses a much larger frozen language model, i.e., GPT-3 (model: text-davinci-003) as the reflection component. The results show the effectiveness of our policy gradient approach for fine-tuning the agent with offline samples.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 4: Retroformer shows faster and consistent performance improvement of success rate.
|
| 170 |
+
|
| 171 |
+
We then examine how the retrospective model is improved with policy optimization by comparing the generated responses from the frozen LM and the ones from the fine-tuned, reinforced LM. As an example, Fig. 5 illustrates how the uninformative self-reflections from a frozen LLM, which we propose in Fig. 1, are tackled by RL. The agent failed in the last attempt because it submitted “Teen Tians” and “Teen Titans Go” as the answer to the Teen Titans spin-off series, while the correct answer includes only “Teen Titans Go”; The agent forgot its original goal during a chain of lengthy interactions. The self-reflection from the frozen model reiterated the prior action sequences that led to failure as the steps that the agent should have done, which prompts the agent to repeat these steps in the next attempt, resulting in an infinite loop. On the contrary, our reinforced response prompts the agent to focus on spinoff series and asks the agent to find the answer in the previous actions and observations with the search results of “Tara Strong”. Retroformer presents better credit assignment and root cause analysis abilities, and has the power to generate actionable insights.
|
| 172 |
+
|
| 173 |
+
Decision Making – AlfWorld As showcased in Fig. 6(a), the performance improvement by Retroformer over the frozen baselines is significant and our method solves the environment within 3 retries. Similar patterns are observed that the agent performs slightly better with more learnable parameters $( r = 4$ ) and that the improvements are mostly from early retries. We find that the reinforced retrospective model behaves like a summarization model of the prior failed plans and finds the differences of the prior plan with the task descriptions. With the permissible actions seen in the task instructions, this behavior effectively prevents repetitive failures and reduces search spaces.
|
| 174 |
+
|
| 175 |
+
<table><tr><td rowspan="7">Question</td><td>Priorfalledtrial Thought 1: I need to search Juliet Starling and find the</td><td>Renlecuon(Green:Retroiormer;Brown:FrozenLM)</td></tr><tr><td>Canadian-American actress who voiced her, then find the Teen Titans spinoff series she has done voice roles for. Action 1: Search[Juliet Starling] Observation 1: Could not find [Juliet Starling].. Thought 2: Juliet Starling is a character from Lollipop Chainsaw, so I can search Lollipop Chainsaw. Lolipop Chainsaw featured Juliet Action 2: Search[Lollipop Chainsaw]</td><td>I failed to find the Teen Titans spinoff series that Tara Strong has done voice roles for. Instead,I found Lollipop Chainsaw,a video game that Juliet Starling appeared in.I should have searched Tara Strong and Teen Titans or Teen Titans Go! specifically in my previous action to find the correct answer.</td></tr><tr><td>Starling, who was voiced by a Observation 2: Lollipop Chainsaw is a... Canadian-American actress who has done voice roles for what Teen Thought 3: Juliet Starling is voiced by Tara Strong, so I</td><td>My thought process was strong but my execution was flawed. I</td></tr><tr><td>needtosearchTaraStrongandfindtheTeenTitans spinoffshouldhavesearched forLolipopChainsaw firstandlookedupthe series she has done voice roles for.</td><td></td></tr><tr><td>Action 3: Search[Tara Strong]</td><td>Canadian-American actress who voiced Juliet Starling afterwards.I</td></tr><tr><td>Observation 3: Tara Lyn Strong... Thought 4: Tara Strong has voiced characters in Teen</td><td>also should have looked up Tara Strong's filmography and searched</td></tr><tr><td>Titans and Teen Titans Go!, so the answer is Teen Titans and Teen Titans Go!. Action 4: Finish[Teen Titans and Teen Titans Go!]</td><td>for any voice roles she did specifically for Teen Titans or Teen Titans Go!.Next trial:Question: The novel was adapted into a film by a director known for his work on another iconic 1980s franchise.What novel is this film based on?Thought 1:</td></tr></table>
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 5: Response refinement from the reinforced retrospective model. Note that the lengthy observation step in the prior failed trial column is abbreviated for better presentation purposes.
|
| 179 |
+
Figure 6: Comparisons of Retroformer against baselines in (a) AlfWorld and (b) WebShop environments under different base Actor LLM and LoRA rank $r = 1 , 4$ .
|
| 180 |
+
|
| 181 |
+
Web Browsing – WebShop As in Fig. 6(b), the performance improvement by Retroformer over the frozen baselines is observed but the improvements may be limited, when compared with HotPotQA and AlfWorld, with $4 \%$ improvement in success rate with 4 retries. This limitation was also observed in (Shinn et al., 2023) as web browsing requires a significant amount of exploration with more precise search queries, if compared with HotPotQA. The results probably indicate that the verbal feedback approach (Reflexion, Retroformer) is not an optimal method for this environment, but our fine-tuning method still proves effective.
|
| 182 |
+
|
| 183 |
+
# 6 CONCLUSION
|
| 184 |
+
|
| 185 |
+
In this study, we present Retroformer, an elegant framework for iteratively improving large language agents by learning a plug-in retrospective model. This model, through the process of policy optimization, automatically refines the prompts provided to the language agent with environmental feedback. Through extensive evaluations on real-world datasets, the method has been proven to effectively improve the performances of large language agents over time both in terms of learning speed and final task completion.
|
| 186 |
+
|
| 187 |
+
By considering the LLM action agent as a component of the environment, our policy gradient approach allows learning from arbitrary reward signals from diverse environments and tasks. This facilitates the iterative refinement of a specific component within the language agent architecture – the retrospective model, in our case, while circumventing the need to access the Actor LLM parameters or propagate gradients through it. This agnostic characteristic renders Retroformer a concise and adaptable plug-in module for different types of cloud-hosted LLMs, such as OpenAI GPT and Bard. Furthermore, our approach is not limited to enhancing the retrospective model alone; it can be applied to fine-tune other components within the agent system architecture, such as the memory and summarization module, or the actor prompt. By selectively focusing on the component to be finetuned while keeping the remainder fixed, our proposed policy gradient approach allows for iterative improvements of the component with reward signals obtained from the environment.
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Michael Ahn, Anthony Brohan, Noah Brown, Yevgen Chebotar, Omar Cortes, Byron David, Chelsea Finn, Keerthana Gopalakrishnan, Karol Hausman, Alex Herzog, et al. Do as i can, not as i say: Grounding language in robotic affordances. arXiv preprint arXiv:2204.01691, 2022.
|
| 192 |
+
Harrison Chase. Langchain. https://github.com/hwchase17/langchain, 2023.
|
| 193 |
+
Significant Gravitas. Autogpt. https://github.com/Significant-Gravitas/ Auto-GPT, 2023.
|
| 194 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International conference on machine learning, pp. 1861–1870. PMLR, 2018.
|
| 195 |
+
Shibo Hao, Yi Gu, Haodi Ma, Joshua Jiahua Hong, Zhen Wang, Daisy Zhe Wang, and Zhiting Hu. Reasoning with language model is planning with world model. arXiv preprint arXiv:2305.14992, 2023.
|
| 196 |
+
Eric Jang. Can llms critique and iterate on their own outputs? evjang.com, Mar 2023. URL https://evjang.com/2023/03/26/self-reflection.html.
|
| 197 |
+
Aman Madaan, Alexander Shypula, Uri Alon, Milad Hashemi, Parthasarathy Ranganathan, Yiming Yang, Graham Neubig, and Amir Yazdanbakhsh. Learning performance-improving code edits. arXiv preprint arXiv:2302.07867, 2023a.
|
| 198 |
+
Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, et al. Self-refine: Iterative refinement with self-feedback. arXiv preprint arXiv:2303.17651, 2023b.
|
| 199 |
+
Max, Jonathan Tow, Leandro von Werra, Shahbuland Matiana, Alex Havrilla, cat state, Louis Castricato, Alan, Duy V. Phung, Ayush Thakur, Alexey Bukhtiyarov, aaronrmm, alexandremuzio, Fabrizio Milo, Mikael Johansson, Qing Wang, Chen9154, Chengxi Guo, Daniel, Daniel King, Dong Shin, Ethan Kim, Gabriel Simmons, Jiahao Li, Justin Wei, Manuel Romero, Nicky Pochinkov, Omar Sanseviero, and Reshinth Adithyan. CarperAI/trlx: v0.7.0: NeMO PPO, PEFT Migration, and Fixes, June 2023. URL https://doi.org/10.5281/zenodo.8076391.
|
| 200 |
+
Volodymyr Mnih, Adria Puigdom \` enech Badia, Mehdi Mirza, Alex Graves, Timothy P. Lillicrap, Tim \` Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. CoRR, abs/1602.01783, 2016.
|
| 201 |
+
Yohei Nakajima. Babyagi. https://github.com/yoheinakajima/babyagi, 2023.
|
| 202 |
+
Reiichiro Nakano, Jacob Hilton, Suchir Balaji, Jeff Wu, Long Ouyang, Christina Kim, Christopher Hesse, Shantanu Jain, Vineet Kosaraju, William Saunders, et al. Webgpt: Browser-assisted question-answering with human feedback. arXiv preprint arXiv:2112.09332, 2021.
|
| 203 |
+
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, 35: 27730–27744, 2022.
|
| 204 |
+
Joon Sung Park, Joseph C O’Brien, Carrie J Cai, Meredith Ringel Morris, Percy Liang, and Michael S Bernstein. Generative agents: Interactive simulacra of human behavior. arXiv preprint arXiv:2304.03442, 2023.
|
| 205 |
+
|
| 206 |
+
Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D Manning, and Chelsea Finn. Direct preference optimization: Your language model is secretly a reward model. arXiv preprint arXiv:2305.18290, 2023.
|
| 207 |
+
|
| 208 |
+
Timo Schick, Jane Dwivedi-Yu, Roberto Dess\`ı, Roberta Raileanu, Maria Lomeli, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. Toolformer: Language models can teach themselves to use tools. arXiv preprint arXiv:2302.04761, 2023.
|
| 209 |
+
|
| 210 |
+
John Schulman, Sergey Levine, Philipp Moritz, Michael I. Jordan, and Pieter Abbeel. Trust region policy optimization. CoRR, abs/1502.05477, 2015.
|
| 211 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017.
|
| 212 |
+
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.
|
| 213 |
+
Noah Shinn, Federico Cassano, Beck Labash, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflexion: Language agents with verbal reinforcement learning. arXiv preprint arXiv:2303.11366, 2023.
|
| 214 |
+
Mohit Shridhar, Xingdi Yuan, Marc-Alexandre Cotˆ e, Yonatan Bisk, Adam Trischler, and Matthew ´ Hausknecht. ALFWorld: Aligning Text and Embodied Environments for Interactive Learning. In Proceedings of the International Conference on Learning Representations (ICLR), 2021. URL https://arxiv.org/abs/2010.03768.
|
| 215 |
+
Charlie Snell, Ilya Kostrikov, Yi Su, Mengjiao Yang, and Sergey Levine. Offline rl for natural language generation with implicit language q learning. arXiv preprint arXiv:2206.11871, 2022.
|
| 216 |
+
R. S. Sutton, D. Mcallester, S. Singh, and Y. Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in Neural Information Processing Systems 12, volume 12, pp. 1057–1063. MIT Press, 2000.
|
| 217 |
+
Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. The MIT Press, second edition, 2018. URL http://incompleteideas.net/book/the-book-2nd. html.
|
| 218 |
+
Leandro von Werra, Younes Belkada, Lewis Tunstall, Edward Beeching, Tristan Thrush, and Nathan Lambert. Trl: Transformer reinforcement learning. https://github.com/lvwerra/trl, 2020.
|
| 219 |
+
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.
|
| 220 |
+
Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William W. Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2018.
|
| 221 |
+
Shunyu Yao, Howard Chen, John Yang, and Karthik Narasimhan. Webshop: Towards scalable real-world web interaction with grounded language agents. Advances in Neural Information Processing Systems, 35:20744–20757, 2022.
|
| 222 |
+
Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. ReAct: Synergizing reasoning and acting in language models. In International Conference on Learning Representations (ICLR), 2023.
|
| 223 |
+
Xingdi Yuan, Marc-Alexandre Cotˆ e, Alessandro Sordoni, Romain Laroche, Remi Tachet des ´ Combes, Matthew Hausknecht, and Adam Trischler. Counting to explore and generalize in textbased games. arXiv preprint arXiv:1806.11525, 2018.
|
| 224 |
+
|
| 225 |
+
# Appendix for
|
| 226 |
+
|
| 227 |
+
# “Retroformer: Retrospective Large Language Agents with Policy Gradient Optimization”
|
| 228 |
+
|
| 229 |
+
A CHALLENGES
|
| 230 |
+
|
| 231 |
+
Although LLMs are not designed to handle tool use or take actions, it has been observed (Gravitas, 2023; Nakajima, 2023; Chase, 2023) that empirically for text-rich environment, especially when the actions and states are accurately described using natural languages, LLMs work surprisingly well. However there are still plenty of challenges applying LLM-based agents. Here we list several below.
|
| 232 |
+
|
| 233 |
+
Spurious Actions LLMs are not pre-trained or designed with an action-agent application in mind. Even some restrictions are explicitly specified in the prompt, the LLM model may still generate spurious actions that are not in the action space $\mathcal { A }$ .
|
| 234 |
+
|
| 235 |
+
Limited Prompt Length LLM itself is stateless. However, in applications it is preferred to empower agents with states or memories for better performance. It has been observed that LLM based agents are easy to run into infinite loops if the states are not handled nicely. Many LLM agents concatenate all the previous state descriptions and actions into the prompt so that LLM as a way to bestow ”state” to the LLM. Inevitably this methodology runs into the prompt length issues. As the trajectory grows longer, the prompt runs out of spaces.
|
| 236 |
+
|
| 237 |
+
Heuristic Prompt Engineering Even though a lot of paradigms have been proposed to improve LLM agents’ performance (Yao et al., 2023; Ahn et al., 2022), there is a lack of systematic methodologies for consistent model refinement. In fact, manual prompt tuning is still widely used in a lot of the application scenarios.
|
| 238 |
+
|
| 239 |
+
Prohibitive Training Most of the well-performing LLMs are too large to be fit in just one or two GPUs. It is technically challenging to optimize the LLMs directly as is done in the the classical reinforcement learning setting. In particular, OpenAI has not provided any solution for RL based finetuning. Most of the issues are caused by the fact that LLMs are not pre-trained or designed with an action-agent application in mind.
|
| 240 |
+
|
| 241 |
+
# B INTUITION
|
| 242 |
+
|
| 243 |
+
Compared to the LLM-based action agents, classical RL agents, though not able to handle text-based environments as nicely in the zero shot setting, are able to keep improving based on the feedback and rewards provided by the environment. Popular RL algorithms include Policy Gradient (Sutton et al., 2000), Proximal Policy Optimization Algorithm (PPO) (Schulman et al., 2017), Trust Region Policy Optimization (TRPO) (Schulman et al., 2015), and Advantage Actor Critic methods (Mnih et al., 2016).
|
| 244 |
+
|
| 245 |
+
In this draft we are proposing a simple but powerful novel framework to tackle the challenges mentioned above. On one hand, we would like to leverage the classical RL based optimization algorithms such as policy gradient to improve the model performance. On the other hand, our framework avoids finetuning on the LLM directly. The key is, instead of training the LLM directly, we train a retrospective LM. The retrospective LM takes users’ prompt, rewards and feedback from the environment as input. Its output will be prompt for the actual LLM to be consumed. RL algorithms are employed to optimize the weights in the retrospective LM model instead of directly on the LLM. In our framework the weights in the actual LLM is assumed to be fixed (untrainable), which aligns well with the application scenario when the LLM is either too large to tune or prohibited from any tuning.
|
| 246 |
+
|
| 247 |
+
Another perspective viewing our framework is, we train a retrospective LM to apply automatic prompt tuning for the LLM agents. In this case, the RL algorithms such as policy gradients are employed to optimize the prompts. Ideally the retrospective LM can help summarize the past “experience”, the users’ prompt, the environments’ feedback into a condensed text with length limit so that it is easier for the LLM to digest. To some extent, in our setting the original LLM can be considered as part of the environment since its parameters are all fixed.
|
| 248 |
+
|
| 249 |
+
# C IMPLEMENTATION DETAILS
|
| 250 |
+
|
| 251 |
+
# C.1 RETROFORMER
|
| 252 |
+
|
| 253 |
+
Model We use GPT-3 (model: text-davinci-003) as the frozen actor model. For the retrospective model, we instantiate it from LongChat (model: longchat-7b-16k), which is a LM with 16k context length by fine-tuning llama-7b on instruction-following samples from ShareGPT. In all experiments, we set the temperature of actor LM as zero, i.e., $\mathrm { T } { = } 0$ and top $\mathsf { p } = 1$ to isolate the randomness of LM from the effects of reflections. We acknowledge that setting a higher temperature value can encourage exploration but it can obscure the impact of the proposed approaches, making it difficult to compare against existing baselines with $\mathrm { T } { = } 0$ (Yao et al., 2023; Shinn et al., 2023).
|
| 254 |
+
|
| 255 |
+
Setup Our proposed learning framework is developed by using multiple open-source tools as follows. We use the OpenAI connectors from langchain to build our actor models $M _ { a }$ . During inference of the retrospective model, we host an API server using FastChat and integrates it with langchain agents. The tool can host longchat-7b-16k with concurrent requests to speed up RL policy rollouts. For fine-tuning the retrospective model, we develop our training pipeline with $t r l$ , which supports transformer reinforcement learning with PPO trainer.
|
| 256 |
+
|
| 257 |
+
We present the details of the specific prompts we used and the full agent demonstrations and examples for each environment in Appendix E.
|
| 258 |
+
|
| 259 |
+
Data Collection For HotPotQA environment, We collected 3,383 reflection samples by running the base rollout policy for 3 trials $\mathrm { ~ N ~ } = \mathrm { ~ 3 ~ }$ ) for 3,000 tasks in the training set, in which 1,084 instruction-response pairs have positive ratings. For AlfWorld, we collected 523 reflection samples and for WebShop, we collected 267 reflection samples.
|
| 260 |
+
|
| 261 |
+
Training We fine-tune the retrospective model $M _ { r }$ with 4-bit quantized LoRA adapters $\mathrm { ( r { = } } 1$ or $\mathrm { r } { = } 4$ ) on the offline RL datasets with epochs $^ { = 4 }$ ; batch size $^ { = 8 }$ ; $_ { \mathrm { l r } = 1 . 4 \mathrm { e } - 5 }$ . The number of trainable parameters is $0 . 5 3 \mathbf { M }$ $( 0 . 0 1 5 \%$ of llama-7b) or $2 . 2 5 \mathbf { M }$ . Since longchat-16k is based on Llama, we used the default llama recipes for finetuning. Specifically, we first run supervised fine-tuning trainer on the samples with positive ratings for 2 epochs and then the RLHF pipeline, including reward modeling, and RL fine-tuning with PPO, on the whole offline rating dataset using the default settings for llama-7b model. We list the key hyperparameters here:
|
| 262 |
+
|
| 263 |
+
• Supervised Finetuning: learning rate=1e-5, batch siz $^ { \underline { { \ } } 3 2 }$ , max step $_ { \mathrm { 5 } } { = } 5 { , } 0 0 0$ • Reward Modeling: learning rate ${ \mathrm { : = } } 2 . 5 { \mathrm { e } } { \mathrm { - } } 5 $ , batch size $^ { = 3 2 }$ , max steps=20,000 • Policy Gradient Finetuning: learning rate ${ \mathrm { \Omega } } = 1 . 4 { \mathrm { e } } { - 5 }$ , max step $\scriptstyle \ = 2 0 , 0 0 0$ , output max length=128, batch size $_ { = 6 4 }$ , gradient accumulation steps $^ { = 8 }$ , ppo epochs $^ { = 4 }$
|
| 264 |
+
|
| 265 |
+
Reproducibility All experiments are done in Google Cloud Platform (GCP) GKE environment with A100 40GB GPUs. The code can be found in https://anonymous.4open.science/ r/Retroformer-F107. We plan to open source the code repository after the review period.
|
| 266 |
+
|
| 267 |
+
Algorithm The offline PPO algorithm we used for finetuning the Retrospective component in this paper is presented below in Algorithm 1. It contains three steps: offline data collection, reward model learning, and policy gradient finetuning. We use the offline ratings data to train a reward model first, and plug in the reward model for PPO finetuning.
|
| 268 |
+
|
| 269 |
+
1: Initialize TEXT-DAVINCI-003 as the Retrospective model with LONGCHAT-16K. Set the maximum trials for rollouts as $N = 3$ . The temperature used for sampling $t _ { s } = 0 . 9$ .
|
| 270 |
+
2: Step 1: Offline Data Collection. Collect multiple rollouts for each environments $k ( k \mathbf { \theta } =$ $1 , \cdots , K )$ for the tasks in the training sets and save as $D _ { \mathrm { R L } }$ .
|
| 271 |
+
3: for episode $t = 1 , \ldots , \mathrm { N } \mathbf { d }$ o
|
| 272 |
+
4: for source domain $\mathbf { k } = 1 , \ldots , \mathbf { K }$ do
|
| 273 |
+
5: Receive trajectory $\big [ s _ { k , i , \tau } , a _ { k , i , \tau } , r _ { k , i , \tau } \big ] _ { \tau = 1 } ^ { T }$ and episodic returns $G _ { k , i }$ for task $i$ .
|
| 274 |
+
6: for unsuccessful tasks $j$ do
|
| 275 |
+
7: Randomly sample a pair of reflection responses $( y _ { k , j } ^ { ( 1 ) } , y _ { k , j } ^ { ( 2 ) } )$ with Retrospective LM temperature set to Roll out the ne $t _ { s }$ , with the sam episode with struction prompt defined in Eq. (4, and receive the episodic returns .
|
| 276 |
+
8: $y _ { k , j }$ $( G _ { k , i + 1 } ^ { ( 1 ) } , G _ { k , i + 1 } ^ { ( 2 ) } )$
|
| 277 |
+
9: Compute reflection response rating by $r ( x _ { k , i } , y _ { k , i } ) \triangleq G _ { k , i + 1 } - G _ { k , i }$ in Eq. (5).
|
| 278 |
+
10: Label the response with higher ratings as the accepted response while the lower response is labeled as the rejected response.
|
| 279 |
+
11: end for
|
| 280 |
+
12: end for
|
| 281 |
+
13: end for
|
| 282 |
+
14: Step 2. Reward Model Learning. Use the REWARDTRAINER in TRL to train a model for classifying accepted and rejected responses given instructions.
|
| 283 |
+
15: Step 3: Policy Gradient Finetuning. Plug-in the trained reward model and use the PPOTRAINER in TRL to finetune the Retrospective model for generating reflection responses with higher ratings.
|
| 284 |
+
|
| 285 |
+
# C.2 BASELINE: SOFT-ACTOR CRITIC AGENT
|
| 286 |
+
|
| 287 |
+
Traditional reinforcement learning methods have been recognized to perform well within the same framework of interaction-feedback-learning. We include one online RL algorithm, i.e., Soft ActorCritic (Haarnoja et al., 2018), or SAC as baseline model for comparison. Given that the three environments are text-based games, inspired by (Yuan et al., 2018), we do mean-pooling for the embeddings of the generated text outputs, such as “Search[It Takes a Family]” as the agent actions. Therefore, the action space is continuous and is of 768 dimension. We apply LoRA adapters with $r = 4$ on the agent Action model instantiated from longchat-16k, and use SAC to do the online updates, with discount factor gamma $_ { 1 = 0 . 9 9 }$ , interpolation factor polyak $_ { = 0 . 9 9 5 }$ , learning rate $= 0 . 0 1$ , entropy regularzation alpha $= 0 . 2$ , and batch size $^ { = 8 }$ .
|
| 288 |
+
|
| 289 |
+
# C.3 REWARD FUNCTION
|
| 290 |
+
|
| 291 |
+
HotPotQA F1 reward is used in the HotPotQA environment for comparing the matching of a generated answer to a question against the ground truth answer. After removing the stopwords in both answers, we calculate the number of common tokens in two answers. Then Precision is # of common tokens divided by # of generated answer tokens and the Recall is # common tokens divided by # ground truth answer tokens. We can then compute f1 from precision and recall.
|
| 292 |
+
|
| 293 |
+
AlfWorld The binary success (1) and failure of the tasks at the end of episode is used as the reward.
|
| 294 |
+
|
| 295 |
+
WebShop In each episode, the agent receives a reward $r = \mathcal { R } ( s _ { T } , a )$ in the end at timestep $T$ , where $a =$ choose[buy], $y$ is the product chosen by the agent in the final state $s _ { T }$ , and $Y _ { \mathrm { a t t } }$ and $Y _ { \mathrm { o p t } }$ are its corresponding attributes and options. The reward is defined as:
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
r = r _ { \mathrm { t y p e } } \cdot \frac { | U _ { \mathrm { a t t } } \cap Y _ { \mathrm { a t t } } | + | U _ { \mathrm { o p t } } \cap Y _ { \mathrm { o p t } } | + { \bf 1 } [ y _ { \mathrm { p r i c e } } \leq u _ { \mathrm { p r i c e } } ] } { | U _ { \mathrm { a t t } } | + | U _ { \mathrm { o p t } } | + 1 }
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
where the type reward $r _ { \mathrm { t y p e } } = \tt T e x t M a t c h ( \bar { y } , \bar { y } ^ { * } )$ is based on text matching heuristics to assign low reward when $y$ and $y ^ { \ast }$ have similar attributes and options but are obviously different types of products. For example, “butter” and “plant-based meat” differ in types but may both contain attributes “cruelty-free”, “non-GMO”, and an option “size: pack of $2 ^ { \circ }$ .
|
| 302 |
+
|
| 303 |
+
# D ADDITIONAL EXPERIMENTS
|
| 304 |
+
|
| 305 |
+
# Frozen model response
|
| 306 |
+
|
| 307 |
+
I got stuck in a loop where I kept searching for the same person, Henry Miller, instead of Beatrice Sylvas Wickens. It's possible that I may have misheard or misunderstood the question. To avoid this, I should have written down the question and made sure I understood it correctly before beginning the search. Additionally, I should have tried searching for "James Henry Miller's wife" instead of just "James Henry Miller".
|
| 308 |
+
|
| 309 |
+
# Reinforced model response
|
| 310 |
+
|
| 311 |
+
I think the issue might have been with the search. I was not able to find the name "Miller" in the paragraph, which is why I was not able to find James Henry Miller's wife. I should have searched for "Miller's wife" instead of "James Henry Miller's wife" to avoid this confusion.
|
| 312 |
+
|
| 313 |
+
New Plan:
|
| 314 |
+
|
| 315 |
+
To avoid confusion, I will search for "Miller's wife" instead of "James Henry Miller's wife" and directly look for the nationality of the wife.
|
| 316 |
+
|
| 317 |
+
Figure 7: Response refinement from the reinforced retrospective model with structured format.
|
| 318 |
+
|
| 319 |
+
Structured Reflections and Action Plans. We discover one emergent behavior of the reinforced model that it can automatically paraphrase the original responses into two separate structured sections, namely Reflection section and New plan: section, although not being explicitly trained or prompted for. One such example is shown in Fig. 7. The paraphrased response retrospects in the first paragraph and provides actionable insights next, while the response from the frozen LM interleaved both parts in one paragraph, making it hard to comprehend. We can also observer from Fig. 5 that the reinforced response removes the messy, irrelevant “Next trial:” content in the end for cleaner format, which may very likely result from LLM hallucination.
|
| 320 |
+
|
| 321 |
+
# E FULL EXAMPLES
|
| 322 |
+
|
| 323 |
+
# E.1 ACTOR PROMPT ENGINEERING
|
| 324 |
+
|
| 325 |
+
An example of the HotPotQA actor language model prompt is shown below.
|
| 326 |
+
|
| 327 |
+
Solve a question answering task with interleaving Thought,Action,Observation steps.Thought can reason about the current situation,and Action can be three types:
|
| 328 |
+
|
| 329 |
+
(1) Search[entity],which searches the exact entity on Wikipedia and returns the first paragraph if it exists.If not,it will return some similar entities to search.
|
| 330 |
+
(2)Lookup[keyword],which returns the next sentence containing the keyword in the last passage successfully found by Search.
|
| 331 |
+
(3)Finish[answer],which returns the answer and finishes the task.
|
| 332 |
+
You may take as many steps as necessary.
|
| 333 |
+
You have attempted to answer the following question before and failed.The following
|
| 334 |
+
reflection(s) give a plan to avoid failing to answer the question in the same way you did previously. Use them to improve your strategy of correctly answering the given question.
|
| 335 |
+
|
| 336 |
+
# Reflections:
|
| 337 |
+
|
| 338 |
+
- I should have searched for the title of the book instead of the author.Ialso didn't check for the proverb which was not the question.
|
| 339 |
+
-I should have searched for "It Takes a Family by Rick Santorum" instead of just "It Takes a Family" to get the correct answer.
|
| 340 |
+
- My search was not concise and Idid not specify what Iwas looking for.Ialso did not check similar results. In this case,I should have searched for ‘It Takes a Family by Rick Santorum' to find the correct answer.
|
| 341 |
+
|
| 342 |
+
Question:It Takesa Family is a response to this 1996 book that was published by who Thought1:I need to search for the title of the book,"It Takesa Family",and find who publishedit.
|
| 343 |
+
|
| 344 |
+
Action1:Search["It Takesa Family"]
|
| 345 |
+
|
| 346 |
+
Observation 1: Richard John Santorum(san-TOR-am;born May10,1958)is an American politician, attorney,author,and political commentator who represented Pennsylvania in the United States Senate from 1995 to 2007.He was the Senate's third-ranking Republican during the final six years of his tenure.He also ran unsuccessfully for President of the United States in the 2012 Republican primaries,finishing second to Mitt Romney.Santorum was elected to the United States Senate from Pennsylvania in 1994.He served two terms until losing his 2006 reelection bid.A Roman Catholic, Santorum is a social conservative who opposes abortion and same-sex marriage and embraced a cultural warrior image during his Senate tenure.While serving as a senator,Santorum authored the Santorum Amendment,which would have promoted the teaching of intelligent design.He wasa leading sponsor of the 2003 federal law known as the Partial-Birth Abortion Ban Act.In the years following his departure from the Senate, Santorum has worked as a consultant,private practice lawyer,and news contributor. He ran for the Republican nomination in the 2012 U.S. presidential election. Before suspending his campaign on April 10,2012,Santorum exceeded expectations by winning 11 primaries and caucuses and receiving nearly four million votes,making him the runner-up to eventual nominee Mitt Romney.Santorum ran for president again in 2016,but ended his campaign in February 2016 after a poor showing in the Iowa caucuses.In January 2017, he became a CNN senior political commentator. However,he was terminated from his contract with CNN in May 2021 due to comments he made about Native Americans a few weeks prior which were deemed"dismissive".
|
| 347 |
+
|
| 348 |
+
Thought 2:The paragraph mentions Rick Santorum, so I need to search "It Takes a Family by Rick Santorum".
|
| 349 |
+
|
| 350 |
+
Action 2:Search["It Takes a Family by Rick Santorum"]
|
| 351 |
+
|
| 352 |
+
Observation 2:It Takes a Family is a 2005 book by then Pennsylvania Senator Rick Santorum.The title is a response to the 1996 book It Takes a Village by then-First Lady Hillary Clinton.In the book,Santorum states that the family structure is necessary. He argues that liberal social policies have devastated the family structure and that prevailing socially liberal attitudes have systematically devalued families across the board. He argues that the government should take a proactive role in promoting strong families.
|
| 353 |
+
|
| 354 |
+
Thought 3:It Takes a Family was published by Rick Santorum,so the answer is Rick Santorum. Action 3:Finish[Rick Santorum]
|
| 355 |
+
Observation 3:Answer is INCORRECT
|
| 356 |
+
|
| 357 |
+
# An example of the AlfWorld actor language model prompt is shown below.
|
| 358 |
+
|
| 359 |
+
You are in the middle of a room. Looking quickly around you, you see a cabinet 10, a cabinet 9, a cabinet 8, a cabinet 7, a cabinet 6, a cabinet 5, a cabinet 4, a cabinet 3, a cabinet 2, a cabinet 1, a coffeemachine 1, a countertop 2, a countertop 1, a diningtable 2, a diningtable 1, a drawer 3, a drawer 2, a drawer 1, a fridge 1, a garbagecan 1, a microwave 1, a sinkbasin 1, a stoveburner 4, a stoveburner 3, a stoveburner 2, a stoveburner 1, and a toaster 1.
|
| 360 |
+
|
| 361 |
+
# [Few-Shot Demonstrations]
|
| 362 |
+
|
| 363 |
+
# Your memory for the task below:
|
| 364 |
+
|
| 365 |
+
Trial 0: I will try to find a different task to complete. I will look for other objects in the room and try to complete tasks related to those objects. For example, I could try to find a book to read or a glass to drink from. I will also try to use the objects I have found in the room in different ways to see if that helps me complete a task.
|
| 366 |
+
|
| 367 |
+
Your task is to: heat some mug and put it in coffeemachine.
|
| 368 |
+
> think: To solve the task, I need to find and take a mug, then heat it with stoveburner, then put it in coffeemachine.
|
| 369 |
+
Ok.
|
| 370 |
+
$>$ look
|
| 371 |
+
You are in the middle of a room. Looking quickly around you, you see nothing.
|
| 372 |
+
> think: First I need to find a mug. A mug is more likely to appear in countertop (1-2), diningtable (1-2), drawer (1-3), fridge (1), sinkbasin (1), stoveburner (1-4), toaster (1). I can check one by one, starting with countertop 1.
|
| 373 |
+
Ok.
|
| 374 |
+
> look
|
| 375 |
+
You are in the middle of a room. Looking quickly around you, you see nothing.
|
| 376 |
+
> go to countertop 1
|
| 377 |
+
On the countertop 1, you see a butterknife 1, a cup 1, a fork 2, and a mug 1.
|
| 378 |
+
> think: Now I find a mug (1). Next, I need to take it.
|
| 379 |
+
Ok.
|
| 380 |
+
> take mug 1 from countertop 1
|
| 381 |
+
You pick up the mug 1 from the countertop 1.
|
| 382 |
+
> think: Now I take a mug (1). Next, I need to heat it with stoveburner (1-4).
|
| 383 |
+
Ok.
|
| 384 |
+
> go to stoveburner 1
|
| 385 |
+
On the stoveburner 1, you see a pan 2.
|
| 386 |
+
> examine stoveburner 1
|
| 387 |
+
On the stoveburner 1, you see a pan 2.
|
| 388 |
+
> examine stoveburner 1
|
| 389 |
+
On the stoveburner 1, you see a pan 2.
|
| 390 |
+
> examine stoveburner 1
|
| 391 |
+
On the stoveburner 1, you see a pan 2.
|
| 392 |
+
> examine stoveburner 1
|
| 393 |
+
On the stoveburner 1, you see a pan 2.
|
| 394 |
+
|
| 395 |
+
STATUS: FAIL
|
| 396 |
+
|
| 397 |
+
New plan: I was stuck in a loop in which I continually examined stoveburner 1 instead of heating mug 1 with stoveburner 1. I should have taken mug 1 from countertop 1, then heated it with stoveburner 1, then put it in coffeemachine 1. It did not help to execute two identical actions in a row. I will try to execute a different action if I am stuck in a loop again.
|
| 398 |
+
|
| 399 |
+
# An example of the WebShop actor language model prompt is shown below.
|
| 400 |
+
|
| 401 |
+
Webshop [Few-Shot Demonstrations]
|
| 402 |
+
|
| 403 |
+
# Instruction:
|
| 404 |
+
|
| 405 |
+
i would like a 3 ounce bottle of bright citrus deodorant for sensitive skin, and price lower than
|
| 406 |
+
50.00 dollars
|
| 407 |
+
[Search]
|
| 408 |
+
|
| 409 |
+
# Your memory for the task below:
|
| 410 |
+
|
| 411 |
+
Trial 0: In this attempt, I was unsuccessful. I accidentally bought a product that was more than my budget of \$50. The initial search results were not good.
|
| 412 |
+
|
| 413 |
+
# Action: search[3 ounce bright citrus deodorant sensitive skin]
|
| 414 |
+
|
| 415 |
+
Observation:
|
| 416 |
+
[Back to Search]
|
| 417 |
+
Page 1 (Total results: 50)
|
| 418 |
+
[Next >]
|
| 419 |
+
[B078GWRC1J]
|
| 420 |
+
Bright Citrus Deodorant by Earth Mama | Natural and Safe for Sensitive Skin, Pregnancy and
|
| 421 |
+
Breastfeeding, Contains Organic Calendula 3-Ounce
|
| 422 |
+
\$10.99
|
| 423 |
+
[B078GTKVXY]
|
| 424 |
+
Ginger Fresh Deodorant by Earth Mama | Natural and Safe for Sensitive Skin, Pregnancy and
|
| 425 |
+
Breastfeeding, Contains Organic Calendula 3-Ounce
|
| 426 |
+
\$10.99
|
| 427 |
+
[B08KBVJ4XN]
|
| 428 |
+
Barrel and Oak - Aluminum-Free Deodorant, Deodorant for Men, Essential Oil-Based Scent, 24-H
|
| 429 |
+
Odor Protection, Cedar & Patchouli Blend, Gentle on Sensitive Skin (Mountain Sage, $2 . 7 \quad \circ z$ ,
|
| 430 |
+
2-Pack)
|
| 431 |
+
\$15.95 Action: think[B078GWRC1J and B078GTKVXY are bright citrus deodorant less then 50 dollars. I can check B078GWRC1J first.]
|
| 432 |
+
Observation: OK.
|
| 433 |
+
|
| 434 |
+
# Action: click[B078GWRC1J]
|
| 435 |
+
|
| 436 |
+
Observation:
|
| 437 |
+
[Back to Search]
|
| 438 |
+
$[ <$ Prev]
|
| 439 |
+
scent [assorted scents][bright citrus][calming lavender][ginger fresh][simply non-scents] size [travel set (4-pack)][3 ounce (pack of 1)][3-ounce (2-pack)]
|
| 440 |
+
Bright Citrus Deodorant by Earth Mama | Natural and Safe for Sensitive Skin, Pregnancy and Breastfeeding, Contains Organic Calendula 3-Ounce
|
| 441 |
+
Price: \$10.99
|
| 442 |
+
Rating: N.A.
|
| 443 |
+
[Description]
|
| 444 |
+
[Features]
|
| 445 |
+
[Reviews]
|
| 446 |
+
[Buy Now]
|
| 447 |
+
|
| 448 |
+
Action: think[For 3 ounce bottle of bright citrus deodorant for sensitive skin, the item has options 'bright citrus' and '3 ounce (pack of 1)' and seems good to buy.] Observation: OK.
|
| 449 |
+
|
| 450 |
+
Action: click[bright citrus] Observation: You have clicked bright citrus.
|
| 451 |
+
|
| 452 |
+
Action: click[3 ounce (pack of 1)] Observation: You have clicked 3 ounce (pack of 1).
|
| 453 |
+
|
| 454 |
+
Action: click[Buy Now]
|
| 455 |
+
|
| 456 |
+
# E.2 RETROSPECTIVE PROMPT ENGINEERING
|
| 457 |
+
|
| 458 |
+
An example of the HotPotQA retrospective instruction prompt is shown below.
|
| 459 |
+
|
| 460 |
+
You are an advanced reasoning agent that can improve based on self reflection. You will be given a previous reasoning trial in which you were given access to an Docstore API environment and a question to answer. You were unsuccessful in answering the question either because you guessed the wrong answer with Finish[<answer>], or you used up your set number of reasoning steps. In a few sentences, Diagnose a possible reason for failure and devise a new, concise, high level plan that aims to mitigate the same failure. Use complete sentences.
|
| 461 |
+
|
| 462 |
+
Here are some examples. [Few-Shot Demonstrations]
|
| 463 |
+
|
| 464 |
+
# Previous trial:
|
| 465 |
+
|
| 466 |
+
Question: The 2016 Washington State Cougars were led by the coach who previously helmed which other team?
|
| 467 |
+
|
| 468 |
+
Thought: I need to search Washington State Cougars and find the coach of the 2016 team, then find which other team the coach previously helmed.
|
| 469 |
+
|
| 470 |
+
Action: Search[Washington State Cougars]
|
| 471 |
+
|
| 472 |
+
Observation: The Washington State Cougars (known informally as the Cougs) are the athletic teams that represent Washington State University. Located in Pullman, Washington, WSU is a member of the Pac-12 Conference in NCAA Division I. The athletic program comprises ten women's sports and six men's intercollegiate sports, and also offers various intramural sports.
|
| 473 |
+
|
| 474 |
+
Thought: The paragraph does not mention the coach of the 2016 team. I need to look up "coach" to find the coach of the 2016 team.
|
| 475 |
+
|
| 476 |
+
Action: Lookup[coach]
|
| 477 |
+
|
| 478 |
+
Observation: (Result 2/5) During the 2001–03 seasons, the Cougar football teams were distinguished by three ten-win seasons, three top ten poll rankings, and appearances in the Sun, Rose, and Holiday Bowls. The Cougars shared the Pac-10 title in 2002. Alumnus Paul Wulff, WSU's 31st head coach, was fired in late November 2011, after compiling a 9–40 (.184) record in four seasons. Mike Leach coached the team from 2012 to 2019, guiding them to six bowl games. Leach left to coach Mississippi State in 2020 and was replaced by Hawaii head coach Nick Rolovich. Rolovitch was fired in October 2021 for not complying with the state's COVID-19 vaccine mandate. Defensive coordinator Jake Dickert was named the interim head coach.
|
| 479 |
+
|
| 480 |
+
Thought: The 2016 Washington State Cougars were led by Mike Leach. I need to search Mike Leach and find which other team he previously helmed.
|
| 481 |
+
|
| 482 |
+
Action: Search[Mike Leach]
|
| 483 |
+
|
| 484 |
+
Observation: Michael Charles Leach (March 9, 1961 – December 12, 2022) was an American college football coach who primarily coached at the NCAA Division I FBS level. He was a two-time national coach of the year, three-time conference coach of the year and the mastermind behind the NCAA record-setting air raid offense. He was the head coach at Texas Tech University from 2000 to 2009, where he became the winningest coach in school history. After Texas Tech, he coached at Washington State University from 2012 to 2019, where he recorded the third-most wins of any coach in school history. He then coached at Mississippi State from 2020 until his death in 2022.Leach was known for directing offenses using lots of passing to several receivers, in a spread system known as the air raid, which Leach developed with Hal Mumme when Mumme was head coach and Leach was offensive coordinator at Iowa Wesleyan, Valdosta State, and Kentucky in the 1990s. Leach's offenses with Mumme, and later as a head coach himself, have broken numerous school and NCAA records. On eighteen occasions, Leach led his unranked team to victory over a team ranked in the AP poll, which is the most in the AP era.
|
| 485 |
+
|
| 486 |
+
Thought: Mike Leach previously helmed Texas Tech University and Kentucky. So the answer is Texas Tech University and Kentucky.
|
| 487 |
+
Action: Finish[Texas Tech University and Kentucky]
|
| 488 |
+
Observation: Answer is INCORRECT
|
| 489 |
+
|
| 490 |
+
Reflection:
|
| 491 |
+
|
| 492 |
+
# An example of the AlfWorld retrospective instruction prompt is shown below.
|
| 493 |
+
|
| 494 |
+
You will be given the history of a past experience in which you were placed in an environment and given a task to complete. You were unsuccessful in completing the task. Do not summarize your environment, but rather think about the strategy and path you took to attempt to complete the task. Devise a concise, new plan of action that accounts for your mistake with reference to specific actions that you should have taken. For example, if you tried A and B but forgot C, then devise a plan to achieve C with environment-specific actions. You will need this later when you are solving the same task. Give your plan after "Plan". Here are two examples:
|
| 495 |
+
|
| 496 |
+
# [Few-Shot Demonstrations]
|
| 497 |
+
|
| 498 |
+
Your task is to: heat some mug and put it in coffeemachine.
|
| 499 |
+
> think: To solve the task, I need to find and take a mug, then heat it with stoveburner, then put it in coffeemachine.
|
| 500 |
+
Ok.
|
| 501 |
+
> look
|
| 502 |
+
You are in the middle of a room. Looking quickly around you, you see nothing.
|
| 503 |
+
> think: First I need to find a mug. A mug is more likely to appear in countertop (1-2), diningtable (1-2), drawer (1-3), fridge (1), sinkbasin (1), stoveburner (1-4), toaster (1). I can check one by one, starting with countertop 1.
|
| 504 |
+
Ok.
|
| 505 |
+
> look
|
| 506 |
+
You are in the middle of a room. Looking quickly around you, you see nothing.
|
| 507 |
+
> go to countertop 1
|
| 508 |
+
On the countertop 1, you see a butterknife 1, a cup 1, a fork 2, and a mug 1.
|
| 509 |
+
> think: Now I find a mug (1). Next, I need to take it.
|
| 510 |
+
Ok.
|
| 511 |
+
> take mug 1 from countertop 1
|
| 512 |
+
You pick up the mug 1 from the countertop 1.
|
| 513 |
+
> think: Now I take a mug (1). Next, I need to heat it with stoveburner (1-4).
|
| 514 |
+
Ok.
|
| 515 |
+
> go to stoveburner 1
|
| 516 |
+
On the stoveburner 1, you see a pan 2.
|
| 517 |
+
> examine stoveburner 1
|
| 518 |
+
On the stoveburner 1, you see a pan 2.
|
| 519 |
+
> examine stoveburner 1
|
| 520 |
+
On the stoveburner 1, you see a pan 2.
|
| 521 |
+
> examine stoveburner 1
|
| 522 |
+
On the stoveburner 1, you see a pan 2.
|
| 523 |
+
> examine stoveburner 1
|
| 524 |
+
On the stoveburner 1, you see a pan 2.
|
| 525 |
+
|
| 526 |
+
STATUS: FAIL
|
| 527 |
+
|
| 528 |
+
New plan: I was stuck in a loop in which I continually examined stoveburner 1 instead of heating mug 1 with stoveburner 1. I should have taken mug 1 from countertop 1, then heated it with stoveburner 1, then put it in coffeemachine 1. It did not help to execute two identical actions in a row. I will try to execute a different action if I am stuck in a loop again.
|
| 529 |
+
|
| 530 |
+
# An example of the WebShop retrospective instruction prompt is shown below.
|
| 531 |
+
|
| 532 |
+
You will be given the history of a past experience in which you were placed in an environment and given a task to complete. You were unsuccessful in completing the task. Do not summarize your environment, but rather think about the strategy and path you took to attempt to complete the task. Devise a concise, new plan of action that accounts for your mistake with reference to specific actions that you should have taken. There are two examples below.
|
| 533 |
+
|
| 534 |
+
[Few-Shot Demonstrations]
|
| 535 |
+
Instruction:
|
| 536 |
+
i am looking for dairy free and apple variety pack of chips, and price lower than 30.00 dollars
|
| 537 |
+
[Search]
|
| 538 |
+
Action: search[dairy free and apple variety pack of chips]
|
| 539 |
+
Observation:
|
| 540 |
+
[Back to Search]
|
| 541 |
+
Page 1 (Total results: 50)
|
| 542 |
+
[Next >]
|
| 543 |
+
[B07HRFJWP8]
|
| 544 |
+
Enjoy Life Foods Soft Baked Ovals, Breakfast Bars, Nut Free Bars, Soy Free, Dairy Free, Non GMO, Gluten Free, Vegan, Variety Pack, 4 Boxes (20 Bars Total)
|
| 545 |
+
\$100.0
|
| 546 |
+
[B01KMHY5PG]
|
| 547 |
+
Enjoy Life Soft Baked Chewy Bars, Variety Pack, Nut Free Bars, Soy Free, Dairy Free, Gluten Free, 6 Boxes (30 Total Bars)
|
| 548 |
+
\$21.49
|
| 549 |
+
[B008D2X8C4]
|
| 550 |
+
Enjoy Life Lentil Chips Variety Pack, Dairy Free Chips, Soy Free, Nut Free, Non GMO, Vegan, Gluten Free, 24 Bags (0.8 oz)
|
| 551 |
+
\$100.0
|
| 552 |
+
Action: think[The first two items are not what I want. The third item is the dairy free and apple variety pack of chips I want.]
|
| 553 |
+
Observation: OK.
|
| 554 |
+
Action: click[B008D2X8C4]
|
| 555 |
+
Observation:
|
| 556 |
+
[Back to Search]
|
| 557 |
+
[< Prev]
|
| 558 |
+
flavor name [dill and sour cream][garlic & parmesan][light sea salt][margherita pizza][thai chili lime][variety pack]
|
| 559 |
+
size [0.8 ounce (pack of 24)][4 ounce (pack of 12)]
|
| 560 |
+
Price: \$100.0
|
| 561 |
+
Rating: N.A.
|
| 562 |
+
[Description]
|
| 563 |
+
[Features]
|
| 564 |
+
[Reviews]
|
| 565 |
+
[Buy Now]
|
| 566 |
+
Action: think[The item has options 'variety pack' and '0.8 ounce (pack of 24)' and seems good to buy.] Observation: OK.
|
| 567 |
+
Action: click[variety pack]
|
| 568 |
+
Observation: You have clicked variety pack.
|
| 569 |
+
Action: click[0.8 ounce (pack of 24)]
|
| 570 |
+
Observation: You have clicked 0.8 ounce (pack of 24).
|
| 571 |
+
Action: click[Buy Now]
|
| 572 |
+
STATUS: FAIL
|
| 573 |
+
Next plan: In this attempt, I was unsuccessful. I accidentally bought a product that was \$100, which is more
|
| 574 |
+
|
| 575 |
+
than my budget of \$30. Either way, the initial search results were not good. Next time, I will do search["variety pack of chips"] and then check if the results meet the dairy free and the \$30 budget constraints. I will continue to refine my searches so that I can find more products.
|
md/test/KUNzEQMWU7/KUNzEQMWU7.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/test/PIl69UIAWL/PIl69UIAWL.md
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRAPHLLM: BOOSTING GRAPH REASONING ABILITY OF LARGE LANGUAGE MODEL
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The advancement of Large Language Models (LLMs) has remarkably pushed the boundaries towards artificial general intelligence (AGI), with their exceptional ability on understanding diverse types of information, including but not limited to images and audio. Despite this progress, a critical gap remains in empowering LLMs to proficiently understand and reason on graph data. Recent studies underscore LLMs’ underwhelming performance on fundamental graph reasoning tasks. In this paper, we endeavor to unearth the obstacles that impede LLMs in graph reasoning, pinpointing the common practice of converting graphs into natural language descriptions (Graph2Text) as a fundamental bottleneck. To overcome this impediment, we introduce GraphLLM, a pioneering end-to-end approach that synergistically integrates graph learning models with LLMs. This integration equips LLMs with the capability to proficiently interpret and reason on graph data, harnessing the superior expressive power of graph learning models. Our empirical evaluations across four fundamental graph reasoning tasks validate the effectiveness of GraphLLM. The results exhibit a substantial average accuracy enhancement of $5 4 . 4 4 \%$ , alongside a noteworthy context reduction of $9 6 . 4 5 \%$ across various graph reasoning tasks.1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The AI community has witnessed the emergence of powerful pre-trained Large Language Models (LLMs) (Brown et al., 2020; Chowdhery et al., 2022; OpenAI, 2023; Touvron et al., 2023), which leads to the pursuit of the potential realization of Artificial General Intelligence (AGI). Inspired by the fact that an intelligent agent, like the human brain, processes information of diverse types, there is a trend towards empowering LLMs to understand various forms of data, such as audio (Huang et al., 2023) and images (Alayrac et al., 2022). Despite significant strides in interpreting multimodal information (Yin et al., 2023), empowering LLMs to understand graph data remains relatively unexplored. Graphs, which represent entities as nodes and relationships as edges, are ubiquitous in numerous fields, e.g. molecular networks, social networks. An intelligent agent is expected to reason with graph data to facilitate many tasks such as drug discovery (Stokes et al., 2020) and chip design (Mirhoseini et al., 2021).
|
| 12 |
+
|
| 13 |
+
Current efforts have revealed that LLM’s performance on some fundamental graph reasoning tasks is (unexpectedly) subpar. As noted by Wang et al. (2023a), even with tailor-made prompts, LLMs muster an accuracy of barely $3 3 . 5 \%$ when tasked with calculating the shortest path on a graph with up to 20 nodes. Their research also highlighted that fine-tuning OPT-2.7B (Zhang et al., 2022) failed to elicit the graph reasoning ability. Similarly, our experiments indicate that fine-tuning more recent LLaMA2-7B/13B (Touvron et al., 2023) still results in underwhelming performances in several fundamental graph reasoning tasks. This raises an essential question: What hinders the ability of LLMs on graph reasoning tasks?
|
| 14 |
+
|
| 15 |
+
We posit that the key obstacle to LLMs’ graph reasoning ability can be attributed to the prevailing practice of converting graphs into natural language descriptions (Graph2Text). A majority of the existing attempts to apply LLMs to graph data, such as the studies by Wang et al. (2023a); Guo et al. (2023); Ye et al. (2023), employ Graph2Text strategy to convert graph data into textual descriptions. While the Graph2Text-based methodology facilitates direct processing of graph data by
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Demonstration of Graph2Text vs. GraphLLM. The LLM is tasked with computing the minimum quantity of dark matter necessary to transition from the starting wormhole to the ending wormhole, given the connectivity graph and the textual descriptions of each node.
|
| 19 |
+
|
| 20 |
+
LLMs through textual descriptions, it introduces following inherent shortcomings that curtail the ability of LLMs on graph reasoning tasks:
|
| 21 |
+
|
| 22 |
+
1. LLMs, when using the Graph2Text strategy, are compelled to discern implicit graph structures from sequential text. In contrast to dedicated graph learning models that inherently process graph structures, LLMs may face difficulties in learning on graph based on sequential graph descriptions. 2. The Graph2Text-based methodology inherently results in a lengthy context of graph description, as illustrated in Figure 1. This could pose a challenge for LLMs to identify essential information for graph reasoning tasks from the lengthy contexts (Liu et al., 2023).
|
| 23 |
+
|
| 24 |
+
To tackle the aforementioned limitations and enhance the ability of LLMs in graph reasoning, we introduce GraphLLM. Contrary to the Graph2Text strategy of converting graphs into textual descriptions, GraphLLM’s core idea is to synergistically integrate a graph learning module (graph transformer) with the LLM to enhance graph reasoning ability. By synergizing the LLM and the graph transformer, GraphLLM harnesses the strengths of both and offers a more powerful and efficient solution to applying LLMs for graph reasoning tasks. Specifically, GraphLLM possesses the following two key advantages over Graph2Text-based methodology:
|
| 25 |
+
|
| 26 |
+
1. Collaborative Synergy. GraphLLM takes an end-to-end approach to integrate graph learning models and LLMs within a single, cohesive system. By synergizing with graph learning models, LLMs can harness its superior expressive power on graph data. Compared to Graph2Text-based methodology, GraphLLM achieves an average accuracy improvement from $4 3 . 7 5 \%$ to $9 8 . 1 9 \%$ on four fundamental graph reasoning tasks.
|
| 27 |
+
2. Context Condensation. GraphLLM condenses graph information into a concise, fixed-length prefix, thereby circumventing the need of Graph2Text strategy to produce lengthy graph descriptions. Compared to Graph2Text-based methodology, GraphLLM substantially reduces the context length by $9 6 . 4 5 \%$ .
|
| 28 |
+
|
| 29 |
+
Our experiments on four fundamental graph reasoning tasks covering text substructure counting, maximum triplet sum, shortest path, and bipartite graph matching, demonstrate that GraphLLM boosts the graph reasoning ability of LLM by an average accuracy improvement of $5 4 . 4 4 \%$ , while achieving a remarkable context reduction of $9 6 . 4 5 \%$ and $3 . 4 2 \mathrm { x }$ inference acceleration.
|
| 30 |
+
|
| 31 |
+
# 2 PRELIMINARY
|
| 32 |
+
|
| 33 |
+
Definition 2.1. (Input Graph) Given an instance of instruction pair (Input, Instruction, Response), the Input graph is a set $\nu$ of $n$ node $\left\{ d _ { 0 } , d _ { 1 } , \ldots , d _ { n - 1 } \right\}$ , where $\mathbf { \ b { d } } _ { i }$ is the textual feature2 of $i$ -th node, with graph structure $\mathcal { E }$ on $\nu$ . The graph structure $\mathcal { E } : \mathcal { V } \times \mathcal { V } \{ 0 , 1 \}$ is defined as follows:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\mathcal { E } ( d _ { i } , d _ { j } ) = \left\{ \begin{array} { l l } { 1 , } & { \mathrm { i f ~ t h e r e ~ i s ~ a ~ r e l a t i o n s h i p ~ b e t w e e n ~ } d _ { i } \mathrm { ~ a n d ~ } d _ { j } } \\ { 0 , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Thus the Input graph $\mathcal { G }$ can be denoted as a tuple $\{ \nu , \varepsilon \}$ . Graph2Text-based methodology introduces graph description language $\varLambda ( \mathcal { V } , \mathcal { E } ) $ TextDescription.
|
| 40 |
+
|
| 41 |
+
Definition 2.2. (Fine-tuning on Graph Reasoning Tasks) Given a pre-trained LLM $\mathcal { M }$ with parameters $\pmb \theta$ , a dataset of $m$ instruction pairs $\{ ( \mathtt { I n p u t } _ { i }$ , Instructioni, $\mathsf { R e s p o n s e } _ { i } \big ) _ { i = 0 , \dots , m - 1 } \big \}$ , where each Input $_ i$ is a graph $\mathcal { G } _ { i } = \{ \mathcal { V } _ { i } , \mathcal { E } _ { i } \}$ , and a task-specific objective function $\mathcal { L }$ , the finetuning process aims to learn task-specific parameters $\pmb { \theta } ^ { \star }$ by minimizing the following loss function:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\pmb { \theta } ^ { \star } = \arg \operatorname* { m i n } _ { \pmb { \theta } ^ { \prime } } \sum _ { i = 0 } ^ { m - 1 } \mathcal { L } ( \mathcal { M } ( \mathcal { V } , \mathcal { E } , \mathrm { I n s t r u c t i o n } ; \ : \pmb { \theta } ^ { \prime } ) ; \mathrm { R e s p o n s e } )
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\mathcal { M } ( : \pmb { \theta } ^ { \prime } )$ represents the output of the fine-tuned LLM $\mathcal { M }$ with parameters $\pmb { \theta } ^ { \prime }$ . Note that in Eq. (2) the subscripts of $\nu , \varepsilon$ , Instruction and Response are omitted for clarity.
|
| 48 |
+
|
| 49 |
+
Prefix Tuning Given a pre-trained LLM with an $L$ -layer transformer, prefix tuning fixes the original LLM parameters and only prepends $K$ trainable continuous tokens (prefixes) to the keys and values of the attention at every transformer layer. Taking the $l$ -th attention layer as an example $( l < L )$ , prefix vectors $P _ { l } \in \mathbb { R } ^ { \dot { K } \times d ^ { \mathrm { M } } }$ M is concatenated with the original keys Kl ∈ R∗×dM and values $V _ { l } \in \mathbb { R } ^ { * \times d ^ { \mathrm { M } } }$ , where $d ^ { \mathrm { M } }$ is the dimension of LLM, formulated as:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\pmb { K } _ { l } ^ { \prime } = [ \pmb { P } _ { l } ; \pmb { K } _ { l } ] ; \pmb { V } _ { l } ^ { \prime } = [ \pmb { P } _ { l } ; \pmb { V } _ { l } ] \in \mathbb { R } ^ { ( K + \ast ) \times d ^ { \mathrm { M } } }
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
The new prefixed keys $\pmb { K } _ { l } ^ { \prime }$ and values $V _ { l } ^ { \prime }$ are then subjected to the $l$ -th attention layer of LLM. For simplicity, we denote the vanilla attention computation as $O _ { l } = \tt { A t t n } ( Q _ { l } , K _ { l } , V _ { l } )$ . The computation of attention becomes:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
O _ { l } = \mathrm { { A t t n } } ( Q _ { l } , [ P _ { l } ; { K _ { l } } ] , [ P _ { l } ; { V _ { l } } ] )
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
In vanilla prefix tuning, prefixes are initialized from a trainable parameter tensor $\pmb { \mathsf { P } } \in \mathbb { R } ^ { L \times K \times d ^ { \mathrm { M } } }$ .
|
| 62 |
+
|
| 63 |
+
# 3 GRAPHLLM
|
| 64 |
+
|
| 65 |
+
# 3.1 GENERAL FRAMEWORK OF GRAPHLLM
|
| 66 |
+
|
| 67 |
+
Reason on Graphs Since graphs inherently represent entities and their interrelationships, reasoning on graphs requires simultaneous consideration of both the entities (nodes) and their relationships (edges). Consequently, graph reasoning tasks encompass two sub-objectives: node understanding and structure understanding. For example, in the context of counting specific substructures within a molecular graph, one must discern the types of atoms from node descriptions (node understanding) and recognize the chemical bonds derived from the graph’s structure (structure understanding). In the proposed GraphLLM, we intentionally devise modules addressing these dual objectives.
|
| 68 |
+
|
| 69 |
+
As demonstrated in Figure 2, GraphLLM consists of the following three main steps:
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 2: An illustration of reasoning on a toy molecular graph with GraphLLM. The LLM is requested to identify the number of C-C-O triangles in the molecule.
|
| 73 |
+
|
| 74 |
+
1. Node Understanding (§3.2): A textual transformer encoder-decoder is used to extract semantic information crucial to solving graph reasoning tasks from node textual descriptions. The encoderdecoder is newly initialized and updated with the guidance of the pre-trained LLM.
|
| 75 |
+
2. Structure Understanding (§3.3): A graph transformer is employed to learn on the graph structure by aggregating the node representations obtained from the textual encoder-decoder. In this way, the graph representation produced by the graph transformer can incorporate both node semantic information and graph structure information simultaneously.
|
| 76 |
+
3. Graph-enhanced Prefix Tuning for LLMs (§3.4): GraphLLM derives the graph-enhanced prefix from the graph representation. During graph-enhanced prefix tuning, the LLM synergizes with the graph transformer by end-to-end fine-tuning, therefore boosting the LLM’s capability in conducting graph reasoning tasks with proficiency.
|
| 77 |
+
|
| 78 |
+
# 3.2 ENCODER-DECODER FOR NODE UNDERSTANDING
|
| 79 |
+
|
| 80 |
+
The goal of the encoder-decoder is to extract the required information from the nodes based on the specific graph reasoning task. For example, when identifying substructures within molecule, it is necessary to extract atom types from the descriptions of the atoms. For the shortest path task, discerning the cost associated with each node from their descriptions is essential. Therefore, GraphLLM employs a textual transformer encoder-decoder architecture to adaptively extract node information required for graph reason tasks.
|
| 81 |
+
|
| 82 |
+
Specifically, a textual transformer encoder first applies self-attention to the node description, generating a context vector that captures the semantic meaning pertinent to graph reasoning tasks. Subsequently, a transformer decoder produce the node representation $\mathsf { H } _ { i }$ through the cross-attention between the context vector $\mathbf { c } _ { i }$ and the query Q. The query $\mathbf { Q }$ is a newly-initialized trainable embedding. For convenience, we provide a brief overview of the computation process of the encoder-decoder in Eq. (5). Detailed information can be found in Appendix A.1.
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r } { \pmb { c } _ { i } = \mathrm { T r a n s f o r m e r E n c o d e r } ( \pmb { d } _ { i } \pmb { W } _ { \mathrm { D } } ) } \\ { \pmb { \mathsf { H } } _ { i } = \mathrm { T r a n s f o r m e r D e c o d e r } ( \pmb { \Omega } ; \pmb { c } _ { i } ) } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where di ∈ R∗×dM is the embeddings3 of the textual description of node $i$ $^ *$ represents description’s length). $W _ { \mathrm { D } } \in \mathbb { R } ^ { d ^ { \mathrm { M } } \times d }$ is a down-projection matrix to reduce the dimension. $d$ is the dimension of the node understanding encoder-decoder and the structure understanding graph transformer. $\pmb { c } _ { i } \in$ $\mathbb { R } ^ { * \times d }$ is node $i$ ’s context vector and $\boldsymbol { \mathsf { H } } _ { i } \in \mathbb { R } ^ { L \times K \times d }$ is the node $\overrightarrow { i } \overrightarrow { \mathbf { \nabla } }$ representation. $\pmb { \mathbb { Q } } \in \mathbb { R } ^ { L \times K \times \bar { d } }$ is learnable query embedding, where $L$ is the layer number of LLM transformer and $K$ is the length of prefix.
|
| 89 |
+
|
| 90 |
+
In GraphLLM, we adopt a lightweight transformer encoder-decoder (0.05B parameters for LLaMA 2 7B backbone). In practice, a newly-initialized encoder-decoder can effectively learn to capture node information required for graph reasoning tasks under the guidance of the pre-trained LLM.
|
| 91 |
+
|
| 92 |
+
# 3.3 GRAPH TRANSFORMER FOR STRUCTURE UNDERSTANDING
|
| 93 |
+
|
| 94 |
+
Aiming at structure understanding, GraphLLM utilizes a graph transformer to learn from the graph structure. In our framework, the core advantage of the graph transformer over other commonly used graph learning modules (Kipf & Welling, 2017; Velickovi ˇ c et al. ´ , 2018) lies in its decoupling of node information and structural information. In the graph transformer, both the positional encoding, which captures the structural information of the graph, and the node representations are independently fed into the transformer blocks and subsequently updated during the learning process. We empirically find that the decoupling of node understanding and structure understanding enhances GraphLLM’s graph reasoning ability. The graph transformer primarily consists of two key designs: positional encoding and attention mechanism on graph.
|
| 95 |
+
|
| 96 |
+
The positional encoding $e _ { i , j }$ between node $i$ and node $j$ is initialized using relative random walk probabilities (RRWP) encoding (Ma et al., 2023). Let $\pmb { A }$ be the adjacency matrix of a graph $\{ \mathbb { V } , \mathcal { E } \}$ and $_ D$ be the degree matrix. Define the random walk matrix $M : = D ^ { \dot { - } 1 } A$ , $\pmb { I }$ the identity matrix. The positional encoding $e _ { i , j }$ for each node pair $i , j \in \mathcal { V }$ can be formulated as follows:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { R _ { i , j } = [ I _ { i , j } , M _ { i , j } , M _ { i , j } ^ { 2 } , . . . , M _ { i , j } ^ { C - 1 } ] \in \mathbb { R } ^ { C } } \\ & { \ e _ { i , j } = \Phi ( R _ { i , j } ) \in \mathbb { R } ^ { d } } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
in which $C$ is a parameter controlling the maximum length of random walks considered. $R _ { i , j }$ is updated by an elementwise MLP $\Phi : \mathbb { R } ^ { C } \mathbb { R } ^ { d }$ to get the relative positional encoding $e _ { i , j }$ , which encodes the structural relationship between node $i$ and node $j$ .
|
| 103 |
+
|
| 104 |
+
We adopt attention design of the graph transformer introduced by Ma et al. (2023). Note that the graph transformer adapts self attention on $\boldsymbol { h } _ { i } : = \boldsymbol { \mathsf { H } } _ { i } [ l , \boldsymbol { k } , : ] \in \mathbb { R } ^ { d } \ \dot { ( l \in [ 0 , L - 1 ] ; k \in [ 0 , K - 1 ] ) }$ of each index $[ l , k ]$ independently. Given $h _ { i } ^ { ( 0 ) } = h _ { i }$ = hi, e(0)i,j $e _ { i , j } ^ { ( 0 ) } = e _ { i , j }$ , the $t$ -th layer of graph transformer $( t < T )$ can be formulated as:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\begin{array} { r l } & { \hat { \pmb { e } } _ { i , j } ^ { ( t ) } = \sigma ( \rho ( ( \boldsymbol { W } _ { \mathrm { Q } } \boldsymbol { h } _ { i } ^ { ( t ) } + \boldsymbol { W } _ { \mathrm { K } } \boldsymbol { h } _ { j } ^ { ( t ) } ) \odot \boldsymbol { W } _ { \mathrm { E w } } \boldsymbol { e } _ { i , j } ^ { ( t ) } ) + \boldsymbol { W } _ { \mathrm { E b } } \boldsymbol { e } _ { i , j } ^ { ( t ) } ) \in \mathbb { R } ^ { d } } \\ & { { \boldsymbol \alpha } _ { i j } = \mathrm { S o f t m a x } _ { j \in \mathbb { V } } ( \boldsymbol { W } _ { \mathrm { A } } \hat { \pmb { e } } _ { i , j } ^ { ( t ) } ) \in \mathbb { R } } \\ & { \boldsymbol { h } _ { i } ^ { ( t + 1 ) } = \displaystyle \sum _ { j \in \mathbb { V } } { \boldsymbol \alpha } _ { i j } \cdot \boldsymbol { W } _ { \mathrm { V } } \boldsymbol { h } _ { j } ^ { ( t ) } \in \mathbb { R } ^ { d } } \end{array}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $W _ { \mathrm { Q } } , W _ { \mathrm { K } } , W _ { \mathrm { E w } } , W _ { \mathrm { E b } } , W _ { \mathrm { V } } \ \in \ \mathbb { R } ^ { d \times d }$ and $W _ { \mathrm { A } } \in \mathbb { R } ^ { 1 \times d }$ are learnable weight matrices; $\odot$ indicates elementwise multiplication; and $\rho ( \pmb { x } ) : = ( \mathrm { R e L U } ( \pmb { x } ) ) ^ { 1 / 2 } - ( \mathrm { R e L U } ( - \pmb { x } ) ) ^ { 1 / 2 }$ . We also include feed-forward module, residual connection and normalization in our implementation, but they are omitted here for simplicity, which are detailed shown in Appendix A.2. The representation $\mathsf { H } _ { i }$ of node $i$ is derived by gathering ${ \bf \Sigma } _ { h _ { i } ^ { ( T ) } }$ of each index $[ l , k ]$ .
|
| 111 |
+
|
| 112 |
+
For node-level graph reasoning tasks, the Input graph representation $\mathbf { G } = \mathbf { H } _ { i }$ , where node $i$ is to be inferred. For graph-level graph reasoning tasks, the Input graph representation $\begin{array} { r } { \mathsf { G } = \sum _ { i \in \mathbb { V } } \mathsf { H } _ { i } / | \mathbb { V } | } \end{array}$ by mean-pooling on the graph.
|
| 113 |
+
|
| 114 |
+
# 3.4 GRAPH-ENHANCED PREFIX TUNING FOR LLMS
|
| 115 |
+
|
| 116 |
+
To produce a Response in human language for a graph reasoning task, LLMs utilize graphenhanced tunable prefix derived from the graph representation $\pmb { \mathsf { G } }$ during the tuning process. Specifi
|
| 117 |
+
|
| 118 |
+
cally, the graph-enhanced prefix $\mathbf { P }$ is obtained by applying a linear projection to the graph representation G as illustrated in Eq. (8), where WU ∈ Rd×dM i s a matrix converting the dimension.
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\pmb { \mathsf { P } } = \pmb { \mathsf { G } } \pmb { W } _ { \mathrm { U } } + \pmb { \mathsf { B } }
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Then $\pmb { \mathsf { P } } \in \mathbb { R } ^ { L \times K \times d ^ { \mathrm { M } } }$ is prepended to each attention layer of the LLM as shown in Eqs. (3) and (4).
|
| 125 |
+
|
| 126 |
+
Connection to Prefix Tuning It’s worth noting that when $W _ { \mathrm { U } }$ is a zero matrix, GraphLLM degenerates into vanilla prefix tuning as $\pmb { \mathsf { P } } = \pmb { \mathsf { G } } \pmb { 0 } + \pmb { \mathsf { B } }$ . From this perspective, GraphLLM is an enhancement of prefix tuning. In GraphLLM, the LLM synergizes with the powerful graph transformer to incorporate additional context information crucial to graph reasoning into the prefix. Consequently, the LLM can produce appropriate response for the graph reasoning task by interpreting the contexts encapsulated within the graph-enhanced prefix.
|
| 127 |
+
|
| 128 |
+
# 4 EXPERIMENT
|
| 129 |
+
|
| 130 |
+
In this section, we aim to empirically substantiate three central hypotheses posited in this study.
|
| 131 |
+
|
| 132 |
+
• Q1: Does GraphLLM effectively enhance the graph reasoning ability of the LLM? • Q2: Can GraphLLM address the issue of lengthy context caused by Graph2Text strategy? • Q3: How does GraphLLM perform in terms of computational efficiency?
|
| 133 |
+
|
| 134 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 135 |
+
|
| 136 |
+
Graph Reasoning Tasks We follow the design of the graph reasoning tasks in Wang et al. (2023a), which proposes a series of graph reasoning tasks with varying complexity on randomly generated graphs. Note that in Wang et al. (2023a), the nodes are identified and described by a single number index simply. This over-simplification potentially hinders a comprehensive evaluation of the model’s capabilities in node understanding. Consequently, we develop four graph reasoning tasks where each node has a textual entity description of around 50 tokens. These tasks can simultaneously test the abilities of node understanding and structure understanding, which are both crucial for graph reasoning tasks. We present the illustration of the graph tasks in Figure 3, and the dataset statistics are provided in Table 1.
|
| 137 |
+
|
| 138 |
+
Table 1: Statistics of the graph reasoning task datasets.
|
| 139 |
+
|
| 140 |
+
<table><tr><td></td><td>Substructure Counting</td><td>Maximum Triplet Sum</td><td>Shortest Path</td><td>Bipartite Graph Matching</td></tr><tr><td>Avg.|V| /Avg. |ε|</td><td>15 /22.3</td><td>15/26.6</td><td>20/32.4</td><td>20/14.0</td></tr><tr><td>No. of Tokens in Node Desc.</td><td>52-59</td><td>39-82</td><td>48-58</td><td>34-61</td></tr></table>
|
| 141 |
+
|
| 142 |
+
• Task 1: Substructure Counting Let $\mathcal { G } = \{ \nu , \varepsilon \}$ be a molecular graph, where each atom in $\nu$ has a text description $\mathbf { } d _ { i }$ that includes the element type of the atom. LLMs are tasked with counting the number of specific substructure, e.g. carbon-carbon-oxygen triangle.
|
| 143 |
+
|
| 144 |
+
• Task 2: Maximum Triplet Sum Let $\mathcal { G } = \{ \nu , \varepsilon \}$ be a friendship graph, where each person in $\nu$ has a text description $\mathbf { \ b { d } } _ { i }$ that includes the age of the person. In this task, LLMs are instructed to identify the maximum cumulative age among all possible triplets formed by selecting a specific individual, their direct friends, and the friends of those friends.
|
| 145 |
+
|
| 146 |
+
• Task 3: Shortest Path Let $\mathcal { G } = \{ \nu , \varepsilon \}$ be a graph that represents interconnected wormholes. Each wormhole in $\nu$ requires a different amount of dark matter for activation, which is included in the text description $\mathbf { \ b { d } } _ { i }$ of each node. Activating a wormhole enables spatial jumps to any connected wormhole. LLMs are required to compute the path from the starting wormhole to the destination wormhole that requires the least amount of dark matter.
|
| 147 |
+
|
| 148 |
+
• Task 4: Bipartite Graph Matching Let $\mathcal { G } = \{ \nu , \mathcal { E } \}$ be a graph that depicts the application relationship between applicants and jobs. An edge in $\mathcal { E }$ represents an applicant applying for a specific job. Each job can only accept one applicant and a job applicant can be appointed for only one job. The text description $\mathbf { \delta } d _ { i }$ of each node provides information about either the job or the applicant. LLMs are required to compute the maximum possible number of applicants who can find the jobs they are interested in.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 3: Illustration of the graph reasoning tasks. Each Input graph consists of a number of nodes characterized by textual node descriptions and the graph structure between the nodes.
|
| 152 |
+
|
| 153 |
+
Each task consists of 2,000/2,000/6,000 graph instance for training/validation/test. The textual descriptions of the nodes are generated by gpt-3.5-turbo according to specific instructions and manually verified. The graph descriptions of these tasks using Graph2Text strategy are presented in the Appendix D.
|
| 154 |
+
|
| 155 |
+
Baselines We compare GraphLLM with two categories of approaches: prompting and fine-tuning. The prompting approaches encompass the following strategies: zero-shot prompting, few-shot incontext learning (Brown et al., 2020) and few-shot chain-of-thought (CoT) prompting (Wei et al., 2022). The fine-tuning approaches include widely adopted prefix tuning (Li & Liang, 2021) and LoRA (Hu et al., 2022). Due to context length limit, all tasks are confined to one shot for fewshot methods. For LoRA, we apply low rank adaption only on attention module (attn) and on both attention module and feed-forward networks (attn+ffn) (Zhang et al., 2023). For all the baselines, we follow Wang et al. (2023a); Guo et al. (2023) to design prompts which describe the Input graph in natural language (Graph2Text). To analyze the performance gap that may emerge from utilizing different graph description languages, we utilized two prevalent methods to describe the graph structure: adjacency list and edge list.
|
| 156 |
+
|
| 157 |
+
Imeplementations We use LLaMA 2 7B/13B (Touvron et al., 2023) as our LLM backbone. For all tested methods, we set the temperature $\tau$ to 0 to ensure that the LLM’s response is deterministic. We adopt Exact Match Accuracy as metrics for the four graph reasoning tasks. All experiments are conducted on $4 \times 8 0 \mathrm { G }$ A100 GPUs. Complete experiment setups such as hyperparameters, batch size, optimizer, learning rates are in Appendix B.
|
| 158 |
+
|
| 159 |
+
Table 2: Performance on Graph Reasoning Tasks. Shown is the mean $\pm$ s.d. of 3 runs with different random seeds. Highlighted are the top and second-best.
|
| 160 |
+
|
| 161 |
+
<table><tr><td rowspan="2">Input Format</td><td rowspan="2">Method</td><td colspan="4">LLaMA2-7B</td><td colspan="4">LLaMA2-13B</td></tr><tr><td>Substructure Counting</td><td>Maximum Triplet Sum</td><td>Shortest Path</td><td>Bipartite Graph Matching</td><td>Substructure Counting</td><td>Maximum Triplet Sum</td><td>Shortest Path</td><td>Bipartite Graph Matching</td></tr><tr><td rowspan="6">Adjacency List</td><td>Zero-shot</td><td>0.2260</td><td>0.1110</td><td>0.0000</td><td>0.3630</td><td>0.0145</td><td>0.0925</td><td>0.0010</td><td>0.1180</td></tr><tr><td>Few-shot</td><td>0.2735</td><td>0.1445</td><td>0.0575</td><td>0.3280</td><td>0.2780</td><td>0.1430</td><td>0.0520</td><td>0.2675</td></tr><tr><td>Few-shot CoT</td><td>0.2177</td><td>0.0585</td><td>0.1089</td><td>0.2399</td><td>0.2150</td><td>0.0544</td><td>0.1552</td><td>0.1048</td></tr><tr><td>LoRA(attn)</td><td>0.5012±0054</td><td>0.4427 ±.0031</td><td>0.2119±.0004</td><td>0.7383±1078</td><td>0.4926±.0068</td><td>0.4080±.0009</td><td>0.1251±.0019</td><td>0.7792±.0353</td></tr><tr><td>LoRA(attn+fn)</td><td>0.5400±0363</td><td>0.4723±.0115</td><td>0.1652±.0420</td><td>0.6941±.0691</td><td>0.4948±0035</td><td>0.4274±.0459</td><td>0.1181 ±.0051</td><td>0.8010±.0490</td></tr><tr><td>Prefix Tuning</td><td>0.5003±.013</td><td>0.3887±.036</td><td>0.2173±.0078</td><td>0.5534±.0739</td><td>0.4610±.044</td><td>0.3377 ±.008</td><td>0.1608 ±.0376</td><td>0.4640±.0314</td></tr><tr><td rowspan="8">Edge List (Random Order)</td><td>Zero-shot</td><td>0.2460</td><td>0.1260</td><td>0.0000</td><td>0.4325</td><td>0.0805</td><td>0.1265</td><td>0.0010</td><td>0.0055</td></tr><tr><td>Few-shot</td><td>0.2610</td><td>0.1420</td><td>0.0111</td><td>0.3687</td><td>0.2655</td><td>0.1423</td><td>0.1110</td><td>0.3230</td></tr><tr><td>Few-shot CoT</td><td>0.2127</td><td>0.0565</td><td>0.1069</td><td>0.1411</td><td>0.2320</td><td>0.0767</td><td>0.1351</td><td>0.0464</td></tr><tr><td>LoRA(attn)</td><td>0.5035 ±.0007</td><td>0.4224±.0040</td><td>0.2011 ±.0074</td><td>0.6457±0243</td><td>0.4920±.0172</td><td>0.4143±.0059</td><td>0.1240±.0008</td><td>0.6319±.0199</td></tr><tr><td>LoRA(attn+fn)</td><td>0.5101±.0051</td><td>0.4552±.0319</td><td>0.2011±.0046</td><td>0.5446±0364</td><td>0.4904±.0051</td><td>0.4489±0157</td><td>0.1958±.0180</td><td>0.6126±.0338</td></tr><tr><td>Prefix Tuning</td><td>0.3925±0612</td><td>0.3780±0131</td><td>0.1656±.0273</td><td>0.4599±.0187</td><td>0.3319±.1148</td><td>0.3525±.0048</td><td>0.1246±.0014</td><td>0.5228±.0575</td></tr><tr><td>GraphLLM</td><td>0.9990±.0007</td><td>0.9577±.0058</td><td>0.9726 ±.001</td><td>0.9981±.0015</td><td>0.9890±.0021</td><td>0.9392±.0064</td><td>0.9619±.0038</td><td>0.9934±.064</td></tr></table>
|
| 162 |
+
|
| 163 |
+
# 4.2 PERFORMANCE ON GRAPH REASONING TASKS (Q1)
|
| 164 |
+
|
| 165 |
+
Table 2 delineates the performance differentials between GraphLLM and Graph2Text-based methodologies across the four graph reasoning tasks. From this comparative analysis, we can infer several key insights: (1). The zero-shot, few-shot, and chain-of-thought Graph2Text-based prompting methods deliver subpar performance, indicating the limitations of LLMs in generalizing to graph reasoning tasks without additional fine-tuning. (2). Even with fine-tuning on graph reasoning tasks, Graph2Text-based methodology significantly lag behind the performance achieved by GraphLLM. This discrepancy suggests that the Graph2Text-based approaches can constitute a significant obstacle preventing LLMs from adapting to graph reasoning tasks. (3). The choice between the two primary graph description languages (adjacency/edge list) doesn’t lead to a consistent enhancement in the performance of Graph2Text-based methods. This finding confirms that the impediments introduced by the Graph2Text methodology aren’t tied to a specific graph description language. (4). On average, GraphLLM achieves an Exact Match Accuracy of $9 8 . 1 9 \%$ over the four tasks, in contrast to the top-performing Graph2Text-based method, which manages only $4 7 . 3 5 \%$ . This difference underscores the effectiveness of our approach in facilitating LLMs in graph reasoning tasks.
|
| 166 |
+
|
| 167 |
+
Evaluation on Stronger LLMs We also evaluate the Graph2Text strategy on more powerful gpt-3.5-turbo and $\mathtt { g p t - 4 }$ , illustrated on Table 3. The results indicate that even the advanced gpt-4 falls short in basic graph reasoning tasks, limiting its application in more complex scenarios such as drug design. GraphLLM provides a lightweight fine-tuning method that enables the LLM to synergize with graph reasoning modules. Notably, GraphLLM with LLaMA 2 7B as the backbone LLM shows relative improvements of $2 . 6 1 \%$ , $9 9 . 8 \%$ , $1 2 . 2 2 \%$
|
| 168 |
+
|
| 169 |
+
Table 3: Performance of gpt-3.5-turbo and $\mathtt { g p t - 4 }$ with Graph2Text strategy (converting input graph into adjacency list described in natural language), evaluated on 30 random samples due to the money cost.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>LLM</td><td>Method</td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">gpt-3.5- turbo</td><td>Zero-shot</td><td>0.2667</td><td>0.5667</td><td>0.2000</td><td>0.1000</td></tr><tr><td>Few-shot</td><td>0.3000</td><td>0.3000</td><td>0.2667</td><td>0.0667</td></tr><tr><td>Few-shot CoT</td><td>0.3667</td><td>0.7000</td><td>0.7333</td><td>0.2667</td></tr><tr><td rowspan="3">gpt-4</td><td>Zero-shot</td><td>0.6000</td><td>0.7333</td><td>0.6667</td><td>0.3333</td></tr><tr><td>Few-shot</td><td>0.5000</td><td>0.8667</td><td>0.5667</td><td>0.5000</td></tr><tr><td>Few-shot CoT</td><td>0.5000</td><td>0.9333</td><td>0.8667</td><td>0.8667</td></tr><tr><td>LLaMA 2-7B GraphLLM</td><td></td><td>0.9990</td><td>0.9577</td><td>0.9726</td><td>0.9981</td></tr></table>
|
| 172 |
+
|
| 173 |
+
and $1 5 . 1 6 \%$ compared to $\mathtt { g p t - 4 }$ few-shot CoT on the four fundamental graph reasoning tasks, respectively.
|
| 174 |
+
|
| 175 |
+
# 4.3 COMPARATIVE ANALYSIS ON CONTEXT REDUCTION (Q2)
|
| 176 |
+
|
| 177 |
+
Table 4 demonstrates the LLM context length for graph reasoning tasks utilizing Graph2Text-based methods and GraphLLM, respectively. Notably, GraphLLM reduces the context length by a substantial $9 6 . 4 5 \%$ across the four graph reasoning tasks averagely. This substantial reduction is achieved as GraphLLM encodes both node descriptions and structural information into a fixed-length prefix (5 additional prefix tokens in our GraphLLM’s implementation). In contrast, Graph2Text-based methods describe the graph in natural language, including both node descriptions and graph structure. This approach inherently results in an extended context, potentially hampering the efficiency and effectiveness of LLMs on graph reasoning.
|
| 178 |
+
|
| 179 |
+
Figure 4 illustrates the performance of Graph2Text-based methods and GraphLLM on the substructure counting task when the size of graph increases. More concretely, the average node number of the graph instances in the substructure counting dataset is incrementally increased from 15 to 45, with a step size of 10. We compare GraphLLM with Graph2Text-based prefix tuning and LoRA, ignoring other less effective baseline methods. We additionally compare GraphLLM with Graph2Text-based few-shot CoT on gpt-3.5-turbo $- 1 6 \mathrm { k }$ , because the context limit of $\mathtt { g p t } - 3 . 5 \mathtt { - t u r b o } / \mathtt { g p t } - 4$ is exceeded when the node number reaches 25. We observe that with the increase in graph size, the context size of the Graph2Text-based method also expands, leading to a corresponding decline in performance. It is noteworthy that as the graph size increases to 45 nodes, Graph2Text-based methods with LLaMA 2 as backbone exceeds the context length limit (4096 tokens), and the performance of gpt-3.5-turbo-16k also dropped to 0. In comparison, GraphLLM still retains an accuracy of 0.9645. This stability highlights the robustness of GraphLLM, contrasting with the declining performance and efficiency observed in Graph2Text-based methods as graph size expands.
|
| 180 |
+
|
| 181 |
+
Table 4: Context length of different methods on graph reasoning tasks, measured by average token number processed by the LLaMA 2 tokenizer. A/B shown is the context length of Graph2Text-based methods with adjacency list/edge list as graph description language.
|
| 182 |
+
|
| 183 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Avg.Context Length</td></tr><tr><td>Substructure Counting</td><td>Maximum Triplet Sum</td><td>Shortest Path</td><td>Bipartite Graph Matching</td></tr><tr><td>Zero-shot</td><td>1.3K/1.3K</td><td>1.4K / 1.4K</td><td>1.8K/1.7K</td><td>1.2K /1.2K</td></tr><tr><td>Few-shot</td><td>2.6K/2.5K</td><td>2.8K/2.8K</td><td>3.1K/2.9K</td><td>2.4K/2.7K</td></tr><tr><td>Few-shot CoT</td><td>2.8K/2.7K</td><td>3.0K/2.9K</td><td>3.3K/3.1K</td><td>2.5K/2.8K</td></tr><tr><td>LoRA</td><td>1.3K /1.3K</td><td>1.4K / 1.4K</td><td>1.8K/1.7K</td><td>1.2K / 1.2K</td></tr><tr><td>Prefix Tuning</td><td>1.3K/1.3K</td><td>1.4K /1.4K</td><td>1.8K/1.7K</td><td>1.2K/1.2K</td></tr><tr><td>GraphLLM</td><td>0.040K (↓96.92%)</td><td>0.052K (↓96.29%)</td><td>0.048K (↓97.18%)</td><td>0.055K (↓95.42%)</td></tr></table>
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 4: Performance on substructure counting tasks when increasing the node number $| \mathbb { V } |$ of graph instances. A(B) represents context length and the corresponding performance. ”OOL” denotes exceeding context length limit.
|
| 187 |
+
|
| 188 |
+
# 4.4 ANALYSIS ON COMPUTATIONAL EFFICIENCY (Q3)
|
| 189 |
+
|
| 190 |
+
Inference Acceleration Figure 5 illustrates the comparison of inference times on substructure counting task between GraphLLM and Graph2Text-based methods. Notably, GraphLLM achieves a speedup of 3.42 times compared to the best-performing Graph2Textbased method. The complete results of the inference time for other tasks are provided in the Appendix. The experimental results indicate that the inference acceleration achieved by GraphLLM, due to the context reduction for graph reasoning tasks, considerably surpasses the additional time overhead introduced by the graph learning module.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 5: Avg. inference time on the substructure counting task on LLaMA 2 7B .
|
| 194 |
+
|
| 195 |
+
# 5 RELATED WORK
|
| 196 |
+
|
| 197 |
+
LLMs exhibit the ability to understand diverse types of information and craft contextually relevant text responses, including but not limited to images (Wang et al., 2023b), audio (Huang et al., 2023), and point clouds (Xu et al., 2023). Endeavors to empower LLMs with the ability to understand graph data have been ongoing. Generally, these efforts can be categorized into two main categories. The first category includes models that employ a large language model to interface with individual graph models or APIs (Zhang, 2023; Wei et al., 2023). Nevertheless, these interactive systems still encounter limitations in accessing the internal graph reasoning process, which hinder their ability to seamlessly integrate graph learning and large language models. The second category includes models that employ an end-to-end training strategy. Notably, Wang et al. (2023a) make an attempt to fine-tune an opt-2.5B model on a Graph2Text corpus of basic graph reasoning tasks. However, their efforts fail to elicit graph reasoning ability of LLMs. The task of enhancing the graph reasoning ability of LLMs in an end-to-end manner remains unresolved. To our knowledge, our work stands out as a pioneering effort in successfully integrating the graph learning model with LLMs, demonstrably enhancing graph reasoning ability. GraphLLM takes a unified, end-to-end approach to integrate graph learning models and LLMs, enhancing the overall efficiency by synergizing the strengths of both within a single, cohesive system.
|
| 198 |
+
|
| 199 |
+
# 6 DISCUSSION
|
| 200 |
+
|
| 201 |
+
We introduce GraphLLM, an integrated end-to-end approach that synergizes LLMs with graph learning models to enhance the graph reasoning capabilities of LLMs.We hope our work can provide insights and guidance for future research in the domain of enabling LLMs to comprehend graph data and tackle advanced graph-related tasks.
|
| 202 |
+
|
| 203 |
+
# REFERENCES
|
| 204 |
+
|
| 205 |
+
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 L Menick, Sebastian Borgeaud, Andy Brock, Aida Nematzadeh, Sahand Sharifzadeh, Mikoł aj 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, volume 35, pp. 23716–23736, 2022.
|
| 206 |
+
|
| 207 |
+
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, T. J. Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeff 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, abs/2005.14165, 2020.
|
| 208 |
+
|
| 209 |
+
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 Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben 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 Garcia, 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 Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. Palm: Scaling language modeling with pathways, 2022.
|
| 210 |
+
|
| 211 |
+
Jiayan Guo, Lun Du, and Hengyu Liu. Gpt4graph: Can large language models understand graph structured data ? an empirical evaluation and benchmarking. ArXiv, abs/2305.15066, 2023.
|
| 212 |
+
|
| 213 |
+
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. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum? id=nZeVKeeFYf9.
|
| 214 |
+
|
| 215 |
+
Rongjie Huang, Mingze Li, Dongchao Yang, Jiatong Shi, Xuankai Chang, Zhenhui Ye, Yuning Wu, Zhiqing Hong, Jiawei Huang, Jinglin Liu, Yi Ren, Zhou Zhao, and Shinji Watanabe. Audiogpt: Understanding and generating speech, music, sound, and talking head, 2023.
|
| 216 |
+
|
| 217 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017. URL https: //openreview.net/forum?id $\bar { }$ SJU4ayYgl.
|
| 218 |
+
|
| 219 |
+
Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 4582–4597, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.353.
|
| 220 |
+
|
| 221 |
+
Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. Lost in the middle: How language models use long contexts, 2023.
|
| 222 |
+
|
| 223 |
+
Liheng Ma, Chen Lin, Derek Lim, Adriana Romero-Soriano, Puneet Kumar Dokania, Mark Coates, Philip H. S. Torr, and Ser Nam Lim. Graph inductive biases in transformers without message passing. In International Conference on Machine Learning, 2023.
|
| 224 |
+
|
| 225 |
+
Azalia Mirhoseini, Anna Goldie, Mustafa Yazgan, Joe Wenjie Jiang, Ebrahim Songhori, Shen Wang, Young-Joon Lee, Eric Johnson, Omkar Pathak, Azade Nazi, Jiwoo Pak, Andy Tong, Kavya Srinivasa, William Hang, Emre Tuncer, Quoc V. Le, James Laudon, Richard Ho, Roger Carpenter, and Jeff Dean. A graph placement methodology for fast chip design. Nature, 594(7862):207–212, jun 2021. doi: 10.1038/s41586-021-03544-w.
|
| 226 |
+
|
| 227 |
+
OpenAI. Gpt-4 technical report, 2023.
|
| 228 |
+
|
| 229 |
+
Jonathan M Stokes, Kevin Yang, Kyle Swanson, Wengong Jin, Andres Cubillos-Ruiz, Nina M Donghia, Craig R MacNair, Shawn French, Lindsey A Carfrae, Zohar Bloom-Ackermann, et al. A deep learning approach to antibiotic discovery. Cell, 180(4):688–702, 2020.
|
| 230 |
+
|
| 231 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez, Madian Khabsa, Isabel Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov, Pushkar Mishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaoqing Ellen Tan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu, Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan, Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, and Thomas Scialom. Llama 2: Open foundation and fine-tuned chat models, 2023.
|
| 232 |
+
|
| 233 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph attention networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rJXMpikCZ.
|
| 234 |
+
|
| 235 |
+
Heng Wang, Shangbin Feng, Tianxing He, Zhaoxuan Tan, Xiaochuang Han, and Yulia Tsvetkov. Can language models solve graph problems in natural language?, 2023a.
|
| 236 |
+
|
| 237 |
+
Wenhai Wang, Zhe Chen, Xiaokang Chen, Jiannan Wu, Xizhou Zhu, Gang Zeng, Ping Luo, Tong Lu, Jie Zhou, Yu Qiao, and Jifeng Dai. Visionllm: Large language model is also an open-ended decoder for vision-centric tasks, 2023b.
|
| 238 |
+
|
| 239 |
+
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, brian ichter, Fei Xia, Ed H. Chi, Quoc V Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/ forum?id=_VjQlMeSB_J.
|
| 240 |
+
|
| 241 |
+
Lanning Wei, Zhiqiang He, Huan Zhao, and Quanming Yao. Unleashing the power of graph learning through llm-based autonomous agents, 2023.
|
| 242 |
+
|
| 243 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id=ryGs6iA5Km.
|
| 244 |
+
|
| 245 |
+
Runsen Xu, Xiaolong Wang, Tai Wang, Yilun Chen, Jiangmiao Pang, and Dahua Lin. Pointllm: Empowering large language models to understand point clouds, 2023.
|
| 246 |
+
|
| 247 |
+
Ruosong Ye, Caiqi Zhang, Runhui Wang, Shuyuan Xu, and Yongfeng Zhang. Natural language is all a graph needs, 2023.
|
| 248 |
+
|
| 249 |
+
Shukang Yin, Chaoyou Fu, Sirui Zhao, Ke Li, Xing Sun, Tong Xu, and Enhong Chen. A survey on multimodal large language models, 2023.
|
| 250 |
+
|
| 251 |
+
Jiawei Zhang. Graph-toolformer: To empower llms with graph reasoning ability via prompt augmented by chatgpt, 2023.
|
| 252 |
+
|
| 253 |
+
Qingru Zhang, Minshuo Chen, Alexander Bukharin, Pengcheng He, Yu Cheng, Weizhu Chen, and Tuo Zhao. Adaptive budget allocation for parameter-efficient fine-tuning. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview. net/forum?id $\bar { }$ lq62uWRJjiY.
|
| 254 |
+
|
| 255 |
+
Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, Todor Mihaylov, Myle Ott, Sam Shleifer, Kurt Shuster, Daniel Simig, Punit Singh Koura, Anjali Sridhar, Tianlu Wang, and Luke Zettlemoyer. Opt: Open pre-trained transformer language models, 2022.
|
| 256 |
+
|
| 257 |
+
# A DETAILED FORMULATION OF GRAPHLLM
|
| 258 |
+
|
| 259 |
+
# A.1 DETAILS OF TEXTUAL TRANSFORMER ENCODER-DECODER
|
| 260 |
+
|
| 261 |
+
Details of the textual transformer encoder-decoder architecture are shown in Figure 6. In each layer of the transformer encoder, the sequential node textual features pass through the multi-head selfattention module without masking, allowing for a contextual understanding of the text sequence. The resulting encoded sequence, $\mathbf { c } _ { i }$ , engages in the cross-attention with fixed-size query embeddings in the transformer decoder. This process enables query embeddings to extract essential information from it. Finally, the output of the transformer decoder, $\mathsf { H } _ { i }$ , contains specific information from the encoded sequence $\mathbf { c } _ { i }$ , serving as the node representation.
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 6: Architecture of the textual transformer encoder-decoder in GraphLLM.
|
| 265 |
+
|
| 266 |
+
# A.2 COMPLETE FORMULATION OF GRAPH TRANSFORMER
|
| 267 |
+
|
| 268 |
+
A complete graph transformer layer comprises a multi-head attention module, a feed-forward network, along with the residual connection and layer normalization associated with each of these components. For the $t$ -th layer in the graph transformer, the attention computation, excluding the multi-head part, is as follows:
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
\begin{array} { r l } & { \hat { \pmb { e } } _ { i , j } ^ { ( t ) } = \sigma ( \rho ( ( \boldsymbol { W } _ { \mathrm { Q } } \pmb { h } _ { i } ^ { ( t ) } + \boldsymbol { W } _ { \mathrm { K } } \pmb { h } _ { j } ^ { ( t ) } ) \odot \boldsymbol { W } _ { \mathrm { E w } } \pmb { e } _ { i , j } ^ { ( t ) } ) + \boldsymbol { W } _ { \mathrm { E b } } \pmb { e } _ { i , j } ^ { ( t ) } ) \in \mathbb { R } ^ { d } } \\ & { \alpha _ { i j } = \mathrm { S o f t m a x } _ { j \in \mathbb { V } _ { i } } ( \boldsymbol { W } _ { \mathrm { A } } \hat { \pmb { e } } _ { i , j } ^ { ( t ) } ) \in \mathbb { R } } \\ & { \hat { \pmb { h } } _ { i } ^ { ( t ) } = \displaystyle \sum _ { j \in \mathbb { V } _ { i } } \alpha _ { i j } \cdot \boldsymbol { W } _ { \mathrm { V } } \pmb { h } _ { j } ^ { ( t ) } \in \mathbb { R } ^ { d } } \end{array}
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
where $W _ { \mathrm { Q } } , W _ { \mathrm { K } } , W _ { \mathrm { E w } } , W _ { \mathrm { F } }$ , $W _ { \mathrm { V } } \in \mathbb { R } ^ { d \times d }$ and $W _ { \mathrm { A } } \in \mathbb { R } ^ { 1 \times d }$ are learnable weight matrices; $\sigma$ is a non-linear activation (ReLU by default); $\rho ( \pmb { x } ) : = ( \mathrm { R e L U } ( \pmb { x } ) ) ^ { 1 / 2 } - ( \mathrm { R e L U } ( - \pmb { x } ) ) ^ { 1 / 2 }$ ; $\odot$ indicates elementwise multiplication.
|
| 275 |
+
|
| 276 |
+
The different attention heads are combined as a whole, and this combination is then subject to a residual connection and passed through layer normalization to obtain the output of the multi-head attention module.
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\begin{array} { r l } & { \boldsymbol { h } _ { i } ^ { ( t ) , \mathrm { a t t n } } = \mathrm { L a y e r N o r m } ( \mathrm { C o n c a t } ( \{ \hat { h } _ { i , h } ^ { ( t ) } \} _ { h = 1 } ^ { N _ { h } } ) { W _ { \mathrm { O } } } + \boldsymbol { h } _ { i } ^ { ( t ) } ) } \\ & { \boldsymbol { e } _ { i , j } ^ { ( t ) , \mathrm { a t t n } } = \mathrm { L a y e r N o r m } ( \mathrm { C o n c a t } ( \{ \hat { e } _ { i , j , h } ^ { ( t ) } \} _ { h = 1 } ^ { N _ { h } } ) { W _ { \mathrm { E o } } } + \boldsymbol { e } _ { i , j } ^ { ( t ) } ) } \end{array}
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
where $W _ { \mathrm { O } } , W _ { \mathrm { E o } } \in \mathbb { R } ^ { d \times d }$ are learnable weight matrices, $N _ { h }$ denotes the number of attention heads and h(ti ${ \pmb h } _ { i } ^ { ( t ) , \mathrm { a t t n } } , { \pmb e } _ { i , j } ^ { ( t ) , \mathrm { a t t n } }$ are the normalized outputs of the attention module.
|
| 283 |
+
|
| 284 |
+
The feed-forward network, the corresponding residual connection and layer normalization can be formulated as:
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\begin{array} { r l } & { \pmb { h } _ { i } ^ { ( t + 1 ) } = \mathrm { L a y e r N o r m } \big ( \mathtt { F e e d f o r w a r d } ( \pmb { h } _ { i } ^ { ( t ) , \mathrm { a t t n } } ) + \pmb { h } _ { i } ^ { ( t ) , \mathrm { a t t n } } \big ) } \\ & { \pmb { e } _ { i , j } ^ { ( t + 1 ) } = \mathrm { L a y e r N o r m } \big ( \mathtt { F e e d f o r w a r d } ( \pmb { e } _ { i , j } ^ { ( t ) , \mathrm { a t t n } } ) + \pmb { e } _ { i , j } ^ { ( t ) , \mathrm { a t t n } } \big ) } \end{array}
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
where h(ti ${ h _ { i } ^ { ( t + 1 ) } , e _ { i , j } ^ { ( t + 1 ) } }$ $t$
|
| 291 |
+
|
| 292 |
+
# B SETUP
|
| 293 |
+
|
| 294 |
+
We provide the hyperparameters of our method for different graph tasks in Table 5. For the baseline methods that require fine-tuning of LLM, we ensure fair comparison by training them for the same number of epochs as GraphLLM. Additionally, we conducted a search for some important hyperparameters. Specifically, we search the rank parameter of the LoRA from a set $\{ 4 , 8 , 1 6 \}$ and the number of prefix tokens in prefix tuning from a set $\{ 5 , 1 0 , 2 0 \}$ .
|
| 295 |
+
|
| 296 |
+
Table 5: Hyperparameters of GraphLLM for the four datasets.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Hyperparameter</td><td>Subsunuingre</td><td>Maximum Trilet</td><td>Shortest Path</td><td>Biparit Ghrah</td></tr><tr><td>Textual Encoder</td><td>4</td><td>4</td><td>4</td><td>4</td></tr><tr><td>Textual Decoder</td><td>4</td><td>4</td><td>4</td><td>4</td></tr><tr><td>Graph Transformer</td><td>4</td><td>4</td><td>4</td><td>4</td></tr><tr><td>Hidden dim</td><td>768</td><td>768</td><td>768</td><td>768</td></tr><tr><td>Heads</td><td>6</td><td>6</td><td>6</td><td>6</td></tr><tr><td>Dropout</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Graph pooling</td><td>1</td><td></td><td>1</td><td>mean</td></tr><tr><td>Prefix</td><td>5</td><td>5</td><td>5</td><td>5</td></tr><tr><td>PE dim</td><td>8</td><td>8</td><td>8</td><td>8</td></tr><tr><td>Batch size</td><td>32</td><td>32</td><td>32</td><td>32</td></tr><tr><td>Learning Rate</td><td>5e-5</td><td>5e-5</td><td>5e-5</td><td>5e-5</td></tr><tr><td>Epochs</td><td>15</td><td>20</td><td>20</td><td>15</td></tr><tr><td> Warmup epochs</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Weight decay</td><td>1e-1</td><td>le-1</td><td>le-1</td><td>1e-1</td></tr><tr><td> Tunable parameters</td><td>0.0933B</td><td>0.0933B</td><td>0.0933B</td><td>0.0933B</td></tr></table>
|
| 299 |
+
|
| 300 |
+
# C SUPPLEMENTAL EXPERIMENT RESULTS
|
| 301 |
+
|
| 302 |
+
# C.1 INFERENCE TIME
|
| 303 |
+
|
| 304 |
+
In Table 6, we provide the inference time of different methods on LLaMA 2 7B and 13B. The results are calculated by taking the average inference time of all instances in the test set. From the results, we can observe that due to the reduction in context for graph reasoning tasks, GraphLLM exhibits a significant advantage in terms of inference time compared to Graph2Text-based methods. Furthermore, this advantage becomes more pronounced as the LLM’s scale increases.
|
| 305 |
+
|
| 306 |
+
# C.2 ABLATION STUDY ON GRAPH TRANSFORMER
|
| 307 |
+
|
| 308 |
+
We experiment with different design choices on the structure understanding module. Specifically, we replace the aggregation mechanism via attention in graph transformer with other commonly used graph learning layer. Here we adopt GIN (Xu et al., 2019) and GAT (Velickovi ˇ c et al. ´ , 2018), while keeping the other modules unchanged in each case. Table 7 shows the experimental results on the four graph reasoning tasks. GIN variant and GAT variant only achieve average accuracies of $2 4 . 2 \%$ and $1 7 . 3 \%$ , respectively. The significant disparity in accuracy between GIN variant, GAT variant, and GraphLLM indicates that the practice of decoupling node information and structural information plays an essential role in improving GraphLLM’s structure understanding ability, subsequently enhancing the graph reasoning capability.
|
| 309 |
+
|
| 310 |
+
Table 6: Inference time on the four graph reasoning tasks.
|
| 311 |
+
|
| 312 |
+
<table><tr><td rowspan="2">Input Format</td><td rowspan="2">Method</td><td colspan="4">LLaMA2-7B</td><td colspan="4">LLaMA2-13B</td></tr><tr><td>Maximum Path Sum</td><td>Substructure Counting</td><td>Shortest Path</td><td>Bipartite Graph Matching</td><td>Maximum Path Sum</td><td>Substructure Counting</td><td>Shortest Path</td><td>Bipartite Graph Matching</td></tr><tr><td rowspan="6">Adjacency List</td><td>Zero-shot</td><td>0.1673</td><td>0.1541</td><td>0.2649</td><td>0.1385</td><td>0.2878</td><td>0.2670</td><td>0.4517</td><td>0.2402</td></tr><tr><td>Few-shot</td><td>0.4269</td><td>0.6506</td><td>0.5168</td><td>0.6116</td><td>0.7479</td><td>1.1150</td><td>0.8848</td><td>1.0604</td></tr><tr><td>CoT</td><td>4.9367</td><td>2.4122</td><td>5.5155</td><td>4.2542</td><td>8.2850</td><td>4.1148</td><td>9.2961</td><td>7.2886</td></tr><tr><td>LoRA(attn)</td><td>0.1710</td><td>0.1568</td><td>0.2804</td><td>0.1420</td><td>0.2926</td><td>0.2698</td><td>0.4601</td><td>0.2455</td></tr><tr><td>LoRA(attn+ffn)</td><td>0.1818</td><td>0.1654</td><td>0.2842</td><td>0.1503</td><td>0.3071</td><td>0.2842</td><td>0.4813</td><td>0.2586</td></tr><tr><td>Prefix Tuning</td><td>0.1846</td><td>0.1694</td><td>0.2947</td><td>0.1519</td><td>0.3161</td><td>0.2910</td><td>0.4963</td><td>0.2603</td></tr><tr><td rowspan="7">Edge List (Random Order)</td><td>Zero-shot</td><td>0.1642</td><td>0.1447</td><td>0.2521</td><td>0.1486</td><td>0.2869</td><td>0.2508</td><td>0.4355</td><td>0.2573</td></tr><tr><td>Few-shot</td><td>0.4216</td><td>0.6259</td><td>0.4938</td><td>0.6560</td><td>0.7350</td><td>1.0678</td><td>0.8457</td><td>1.1473</td></tr><tr><td>CoT</td><td>4.8385</td><td>2.3190</td><td>5.3227</td><td>4.5724</td><td>8.1369</td><td>3.9703</td><td>9.0008</td><td>7.8130</td></tr><tr><td>LoRA(attn)</td><td>0.1678</td><td>0.1465</td><td>0.2569</td><td>0.1511</td><td>0.2923</td><td>0.2539</td><td>0.4431</td><td>0.2622</td></tr><tr><td>LoRA(attn+ffn)</td><td>0.1783</td><td>0.1556</td><td>0.2714</td><td>0.1597</td><td>0.3054</td><td>0.2670</td><td>0.4636</td><td>0.2758</td></tr><tr><td>Prefix Tuning</td><td>0.1777</td><td>0.1623</td><td>0.2757</td><td>0.1632</td><td>0.3080</td><td>0.2821</td><td>0.4724</td><td>0.2825</td></tr><tr><td>GraphLLM</td><td>0.0449</td><td>0.0484</td><td>0.0734</td><td>0.0523</td><td>0.0583</td><td>0.0616</td><td>0.0937</td><td>0.0665</td></tr></table>
|
| 313 |
+
|
| 314 |
+
Table 7: Ablation study on graph transformer.
|
| 315 |
+
|
| 316 |
+
<table><tr><td>Ablation</td><td> Maximum Triplet</td><td>Substntnge</td><td>Shortest</td><td>BipariteGhaph</td></tr><tr><td>GT→ GINConv</td><td>0.2237±.0060</td><td>0.3878±.0650</td><td>0.2122±0053</td><td>0.1427 ±.0019</td></tr><tr><td>GT →GATConv</td><td>0.1819±.0053</td><td>0.2598±.0102</td><td>0.1443±.0017</td><td>0.1052±.0015</td></tr><tr><td>GraphLLM</td><td>0.9577 ±.0058</td><td>0.9990±.0007</td><td>0.9726±.0011</td><td>0.9981±.0015</td></tr></table>
|
| 317 |
+
|
| 318 |
+
# D EXAMPLES OF GRAPH REASONING TASKS
|
| 319 |
+
|
| 320 |
+
# Substructure Counting
|
| 321 |
+
|
| 322 |
+
# Input:
|
| 323 |
+
|
| 324 |
+
Here are the descriptions of 15 atoms in a molecule.
|
| 325 |
+
|
| 326 |
+
Atom 1: The Carbon atom has an atomic number of 6, denoted as ”C”. Carbon has an electronegativity value of approximately 3.25. The covalent radius of a Carbon atom is about ...
|
| 327 |
+
|
| 328 |
+
Atom 2: The Carbon atom has an atomic number of 6, denoted as ”C”. Carbon has an electronegativity value of approximately 2.16. The covalent radius of a Carbon atom is about ...
|
| 329 |
+
|
| 330 |
+
Atom 3: The Oxygen atom has an atomic number of 8, denoted as ”O”. Oxygen has an electronegativity value of approximately 3.52. The covalent radius of a Oxygen atom is about ... :
|
| 331 |
+
|
| 332 |
+
Atom 15: The Nitrogen atom has an atomic number of 7, denoted as ”N”. Nitrogen has an electronegativity value of approximately 2.95. The covalent radius of a Nitrogen atom is ...
|
| 333 |
+
|
| 334 |
+
These atoms are connected as the following undirected graph to form the molecule:
|
| 335 |
+
|
| 336 |
+
Atom 1 is connected with: Atom 2, Atom 3, Atom 4, Atom 5, Atom 6, Atom 7, Atom 8.
|
| 337 |
+
|
| 338 |
+
Atom 2 is connected with: Atom 1, Atom 3, Atom 5, Atom 8.
|
| 339 |
+
|
| 340 |
+
Atom 3 is connected with: Atom 1, Atom 2.
|
| 341 |
+
|
| 342 |
+
Atom 15 is connected with: Atom 8, Atom 14.
|
| 343 |
+
|
| 344 |
+
How many carbon-carbon-oxygen triangles containing Atom 1 are in the molecule?
|
| 345 |
+
|
| 346 |
+
# Response on gpt-4 Failure Case :
|
| 347 |
+
|
| 348 |
+
A carbon-carbon-oxygen triangle would consist of two carbon atoms and one oxygen atom. Since Atom 1 is a carbon atom and must be included in the triangle, we are looking for triangles where the other two atoms are one carbon and one oxygen.
|
| 349 |
+
|
| 350 |
+
Looking at the connections of Atom 1, it is connected to the following carbon atoms: Atom 2, Atom 4, Atom 6, Atom 7. It is also connected to the following oxygen atoms: Atom 3, Atom 5, Atom 8.
|
| 351 |
+
|
| 352 |
+
Now we need to see if any of these carbon atoms are connected to any of these oxygen atoms.
|
| 353 |
+
|
| 354 |
+
- Atom 2 (carbon) is connected to Atom 3 (oxygen) and Atom 8 (oxygen).
|
| 355 |
+
- Atom 4 (carbon) is not connected to any of the oxygen atoms connected to Atom 1.
|
| 356 |
+
- Atom 6 (carbon) is not connected to any of the oxygen atoms connected to Atom 1.
|
| 357 |
+
- Atom 7 (carbon) is not connected to any of the oxygen atoms connected to Atom 1.
|
| 358 |
+
|
| 359 |
+
So, there are two carbon-carbon-oxygen triangles that contain Atom 1: Atom 1 - Atom 2 - Atom 3 and Atom 1 - Atom 2 - Atom 8.
|
| 360 |
+
|
| 361 |
+
# Correct Answer:
|
| 362 |
+
|
| 363 |
+
There are 3 C-C-O triangles containing Atom 1.
|
| 364 |
+
|
| 365 |
+
# Maximum Triplet Sum
|
| 366 |
+
|
| 367 |
+
# Input:
|
| 368 |
+
|
| 369 |
+
Here are the descriptions of 15 people.
|
| 370 |
+
|
| 371 |
+
Person 1: She is Wilma Lyons, and she is a sixty-year-old. With her colorful hair and unconventional fashion sense, she stands out as a true original. Her unassuming nature and humility create an environment ...
|
| 372 |
+
|
| 373 |
+
Person 2: Meet Manuel Cornelius, who is 30 years of age. With her adventurous spirit and love for the outdoors, she’s always up for exploring new places and experiences. She possesses an air of sophistication and grace, seen in her timeless fashion ...
|
| 374 |
+
|
| 375 |
+
Person 15: Her petite frame and delicate features give her a dainty and ethereal presence. Her name is Cornelia Brooks, and she’s forty years old. Her contagious enthusiasm and energy inspire others to ...
|
| 376 |
+
|
| 377 |
+
The relationship between them can be described as the following undirected graph:
|
| 378 |
+
|
| 379 |
+
Person 1 is connected with: Person 14, Person 8.
|
| 380 |
+
|
| 381 |
+
Person 2 is connected with: Person 11, Person 14, Person 15.
|
| 382 |
+
|
| 383 |
+
Person 3 is connected with: Person 11, Person 5, Person 13, Person 6.
|
| 384 |
+
|
| 385 |
+
Person 15 is connected with: Person 2, Person 7, Person 9, Person 10, Person 11.
|
| 386 |
+
|
| 387 |
+
Question: What is the maximum sum of age of a triplet composed of Person 1, her friends and friends of friends?
|
| 388 |
+
|
| 389 |
+
# Response on gpt-4 Failure Case :
|
| 390 |
+
|
| 391 |
+
Person 1 is connected with Person 14 and Person 8.
|
| 392 |
+
|
| 393 |
+
Person 14 is connected with Person 1, Person 2, Person 7, Person 12, Person 13. Among these, Person 2, Person 7, and Person 12 are not connected with Person 1, so they can be the third person on the path. Their ages are 50, 30, and 60 respectively.
|
| 394 |
+
|
| 395 |
+
Person 8 is connected with Person 1, Person 11, Person 6. Among these, Person 11 and Person 6 are not connected with Person 1, so they can be the third person on the path. Their ages are 40 and 40 respectively.
|
| 396 |
+
|
| 397 |
+
So the maximum sum of the 3 people’s age on the path is 60 (Person 1) $+ 6 0$ (Person 14) + 60 (Person $1 2 ) = 1 8 0$ .
|
| 398 |
+
|
| 399 |
+
# Correct Answer:
|
| 400 |
+
|
| 401 |
+
The maximum sum is 160.
|
| 402 |
+
|
| 403 |
+
# Shortest Path
|
| 404 |
+
|
| 405 |
+
# Input:
|
| 406 |
+
|
| 407 |
+
Here are the descriptions of 20 wormholes.
|
| 408 |
+
|
| 409 |
+
It is wormhole 1, and it is located in galaxy ARP 188. This wormhole is about 5463 light-years away from Earth and requires 20 pounds of dark matter to activate.
|
| 410 |
+
|
| 411 |
+
It is wormhole 2, and it is located in galaxy Horsehead Nebula. This wormhole is about 7606 light-years away from Earth and requires 20 pounds of dark matter to activate.
|
| 412 |
+
|
| 413 |
+
It is wormhole 3, and it is located in galaxy Large Magellanic Cloud. This wormhole is about 4214 light-years away from Earth and requires 40 pounds of dark matter to activate.
|
| 414 |
+
|
| 415 |
+
It is wormhole 4, and it is located in galaxy Pelican Nebula. This wormhole is about 3920 light-years away from Earth and requires 40 pounds of dark matter to activate.
|
| 416 |
+
|
| 417 |
+
It is wormhole 20, and it is located in galaxy Needle Galaxy. This wormhole is about 844 light-years away from Earth and requires 30 pounds of dark matter to activate.
|
| 418 |
+
|
| 419 |
+
These wormholes are connected as the following undirected graph:
|
| 420 |
+
|
| 421 |
+
Wormhole 1 is connected with: Wormhole 8, Wormhole 9, Wormhole 12, Wormhole 19.
|
| 422 |
+
|
| 423 |
+
Wormhole 2 is connected with: Wormhole 3, Wormhole 13, Wormhole 17, Wormhole 20.
|
| 424 |
+
|
| 425 |
+
Wormhole 3 is connected with: Wormhole 2, Wormhole 7, Wormhole 8, Wormhole 13.
|
| 426 |
+
|
| 427 |
+
Wormhole 20 is connected with: Wormhole 2, Wormhole 9, Wormhole 13.
|
| 428 |
+
|
| 429 |
+
Question: Starting from wormhole 1, How much dark matter we’ll need at the minimum to reach Wormhole 2?
|
| 430 |
+
|
| 431 |
+
# Response on gpt-4 Failure Case :
|
| 432 |
+
|
| 433 |
+
From the descriptions, we know that:
|
| 434 |
+
|
| 435 |
+
- Wormhole 1 requires 20 pounds of dark matter to activate.
|
| 436 |
+
- Wormhole 8 requires 20 pounds of dark matter to activate.
|
| 437 |
+
- Wormhole 3 requires 40 pounds of dark matter to activate.
|
| 438 |
+
- Wormhole 2 requires 20 pounds of dark matter to activate.
|
| 439 |
+
|
| 440 |
+
Adding these up, you need a total of $2 0 + 2 0 + 4 0 + 2 0 = 1 0 0$ pounds of dark matter to reach wormhole 2 from wormhole 1.
|
| 441 |
+
|
| 442 |
+
# Correct Answer:
|
| 443 |
+
|
| 444 |
+
We need 80 pounds.
|
| 445 |
+
|
| 446 |
+
# Bipartite Graph Matching
|
| 447 |
+
|
| 448 |
+
# Input:
|
| 449 |
+
|
| 450 |
+
Here are the descriptions of 10 job applicants.
|
| 451 |
+
|
| 452 |
+
Applicant 1: She is Adam Lamarr, and she is 51 years old. She wants to find a job. She’s an urban planner, designing sustainable cities, harmonizing architecture and environment for better living.
|
| 453 |
+
|
| 454 |
+
Applicant 10: He is Travis Wight, and he is 18 years old. He wants to find a job. He finds peace in practicing meditation and mindfulness, nurturing his well-being.
|
| 455 |
+
|
| 456 |
+
Here are the descriptions of 10 jobs.
|
| 457 |
+
|
| 458 |
+
Job 1: The average salary for a year is 47326.6 dollars, and it needs to work 38 hours every week. We want applicants with related experience.
|
| 459 |
+
|
| 460 |
+
Each applicant is interested in some of the jobs, and the relationship can be described as the following graph.
|
| 461 |
+
|
| 462 |
+
Applicant 1 is interested in: Job 9.
|
| 463 |
+
|
| 464 |
+
Applicant 2 is interested in: Job 6.
|
| 465 |
+
|
| 466 |
+
Applicant 10 is interested in: Job 6.
|
| 467 |
+
|
| 468 |
+
Each job can only accept one applicant and a job applicant can be appointed for only one job. For most how many applicants can find the job they are interested in?
|
| 469 |
+
|
| 470 |
+
# Response on gpt-4 Failure Case :
|
| 471 |
+
|
| 472 |
+
First, let’s look at the jobs that only have one applicant interested in them. These are Job 9, Job 4, and Job 10. Applicant 1, Applicant 3, Applicant 8, and Applicant 7 can be appointed to these jobs respectively.
|
| 473 |
+
|
| 474 |
+
Next, let’s look at the jobs that have multiple applicants interested in them. These are Job 1, Job 5, Job 6, and Job 7.
|
| 475 |
+
|
| 476 |
+
For Job 1, the only remaining interested applicant is Applicant 7, so she can be appointed to this job.
|
| 477 |
+
|
| 478 |
+
For Job 5, the only interested applicant is Applicant 5, so he can be appointed to this job.
|
| 479 |
+
|
| 480 |
+
For Job 6, there are three interested applicants: Applicant 2, Applicant 5, and Applicant 9.
|
| 481 |
+
Since Applicant 5 has already been appointed to Job 5, we can appoint Applicant 2 to Job 6.
|
| 482 |
+
|
| 483 |
+
For Job 7, the only interested applicant is Applicant 5, but he has already been appointed to Job 5. Therefore, Job 7 will remain vacant.
|
| 484 |
+
|
| 485 |
+
In conclusion, the maximum number of applicants that can find the job they are interested in is 6: Applicant 1, Applicant 3, Applicant 8, Applicant 7, Applicant 5, and Applicant 2.
|
| 486 |
+
|
| 487 |
+
# Correct Answer:
|
| 488 |
+
|
| 489 |
+
5 Applicants.
|
md/test/Ufc5cWhHko/Ufc5cWhHko.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RECLIP: Resource-efficient CLIP by Training with Small Images
|
| 2 |
+
|
| 3 |
+
Runze Li∗ Dahun Kim † Bir Bhanu∗ Weicheng Kuo † UC Riverside∗ Google Deepmind†
|
| 4 |
+
|
| 5 |
+
Reviewed on OpenReview: https://openreview.net/forum?id=Ufc5cWhHko
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We present RECLIP (Resource-efficient CLIP), a simple method that minimizes computational resource footprint for CLIP (Contrastive Language Image Pretraining). Inspired by the notion of coarse-to-fine in computer vision, we leverage small images to learn from large-scale language supervision efficiently, and finetune the model with high-resolution data in the end. Since the complexity of the vision transformer heavily depends on input image size, our approach significantly reduces the training resource requirements both in theory and in practice. Using the same batch size and training epoch, RECLIP achieves highly competitive zero-shot classification and image-text retrieval accuracy with 6 to $8 \times$ less computational resources and 7 to $9 \times$ fewer FLOPs than the baseline. Compared to the state-of-the-art contrastive learning methods, RECLIP demonstrates 5 to $5 9 \times$ training resource savings while maintaining highly competitive zero-shot classification and retrieval performance. Finally, RECLIP matches the state of the art in transfer learning to open-vocabulary detection tasks, achieving $3 2 ~ \mathrm { A P r }$ on LVIS. We hope this work will pave the path for the broader research community to explore language supervised pretraining in resource-friendly settings.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Representation learning is a foundational problem in computer vision and machine intelligence. Effective image representation can benefit a myriad of downstream tasks, including but not limited to image classification, object detection, semantic segmentation, and 3D scene understanding. In the past decade, the community has witnessed the rise of supervised learning (Deng et al., 2009; Sun et al., 2017), then self-supervised learning (Chen et al., 2020; He et al., 2020; Bao et al., 2022), and most recently language-supervised learning (Radford et al., 2021; Jia et al., 2021; Yu et al., 2022). Language-supervised representation gains much traction for its exceptional versatility. It exhibits outstanding performance in zero-shot classification (Radford et al., 2021), linear probing (Radford et al., 2021; Yu et al., 2022), few-shot learning (Zhou et al., 2022), full finetuning (Dong et al., 2022a), and finds great applications in text-guided image generation (Ramesh et al., 2021). Much like the role of supervised pretraining (Deng et al., 2009) before, language-supervised pretraining has emerged as a simple yet powerful methodology for representation learning today.
|
| 14 |
+
|
| 15 |
+
Traditional supervised learning uses a predetermined set of labels, and is effective across a wide range of data and computational resources. In contrast, natural language offers richer learning signals such as object categories or instances, named-entities, descriptions, actions, and their relations at multiple levels of granularity. Unfortunately, this rich supervision also leads to a higher level of noise in the data, where many image-text pairs have only loose connections. To address this noise, data and computational scaling have proven to be highly effective and necessary. For example, training CLIP models require ${ \sim } 3 \mathbf { k }$ V100-GPU-days, and likewise CoCa requires ${ \sim } 2 3 \mathrm { k }$ TPU-v4-coredays. Apart from the lengthy training time, the large batch requirement of contrastive learning recipes also demand substantial amount of device memory at all times. These factors limit the research of language supervised learning to institutions with high-end infrastructure, and hinder the exploration by the broader community.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Top: Resource-efficient CLIP (RECLIP) training pipeline. Bottom: existing CLIP training methods. RECLIP leverages small images for the main training phase which significantly reduces computational resource requirements through much shorter image sequence length.
|
| 19 |
+
|
| 20 |
+
Thus, improving efficiency of contrastive training has drawn substantial research interest. For example, Zhai et al. (2022) precomputes the image features by a pretrained classification model to reduce the training cost. Zhai et al. (2023) utilizes sigmoid loss to avoid the use of all-gather operation and improves learning with a smaller batch size. Moreover, Yao et al. (2021) leverages masked images to speed up contrastive learning. The community have also explored smaller batch sizes (Dong et al., 2022b) or curated academic datasets (Li et al., 2022a; Lei et al., 2022) for contrastive learning. However, it is not clear how well the findings in smaller batch and data size settings generalize to larger batch and data size.
|
| 21 |
+
|
| 22 |
+
We present RECLIP (Resource-efficient CLIP), a simple method designed to make CLIP more affordable and reproducible for the community (see Fig. 1). Consider images 1-3 in the top left of Fig. 1. Humans can effortlessly match the images with the corresponding texts below them, e.g. “a boy is playing a soccer ball in grass” matching image 1. Although the images are only of size $6 4 \times 6 4$ , they contain adequate amount of visual information for pairing with texts. Our main insight is to train on small images during the main training phase, and finetune the model with high-resolution images for a short schedule in the end. Intuitively speaking, our approach re-introduces the idea of “coarse-to-fine” from classical computer vision to contrastive learning, whereby pretraining incorporates high-level information from small images and finetuning enables the model to refocus its attention on the important details. There is no need for multi-view supervisions (Li et al., 2022a; Yao et al., 2021), feature distillation (Lei et al., 2022), other contrastive losses (Zhai et al., 2023), pretrained classifiers (Zhai et al., 2022), or image masking (Li et al., 2022b). Surprisingly, RECLIP achieves highly competitive zero-shot classification and retrieval performance using $6 4 \times 6 4$ images, which significantly reduces computational resource usage. We attribute this to the complexity of image tower being quartic with respect to the image size (see Eqn. 4).
|
| 23 |
+
|
| 24 |
+
In addition, RECLIP demonstrates the efficiency and effectiveness of using short sequence length for image language representation learning. Existing image-text pretraining methods typically use long sequence lengths, e.g. 441 (Radford et al., 2021) or 784 (Yu et al., 2022) to achieve strong downstream zero-shot transfers. Long sequence image encoding has been validated to benefit image classification (Beyer et al., 2022) and object detection (Chen et al., 2022a) with vision transformers. Hu et al. (2022) find the sequence length is a key factor for masked image representation learning. Different from these methods that advocate for long sequence length, RECLIP demonstrates that using only 16 tokens for the image encoding is sufficient for the main training phase, and can achieve highly competitive zero-shot transfer capabilities via a short high-resolution finetuning schedule. Interestingly, our image sequence length is 4 to $5 \times$ shorter than the text sequence lengths of popular recipes e.g. 76 (Radford et al., 2021) or 64 (Yu et al., 2022).
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 2: Zero-shot accuracy vs. compute resource in cores $\times$ hours trade-off. RECLIP-X: RECLIP training for 300k and 600k steps with image size $X$ where $X = 6 4$ , 80, 112. RECLIP-64-F20k: RECLIP-64 finetuned for 20k steps. Our CLIP repro.: our reproduction of CLIP (Radford et al., 2021). Zero-shot image-text retrieval results are averaged from image-to-text and text-to-image Recall $@ 1$ on two benchmark datasets, Flickr30K (Plummer et al., 2015) and MSCOCO (Chen et al., 2015). RECLIP consumes significantly less compute resource and is more accurate on zeroshot image-text retrieval and highly competitive classification results on ImageNet-1K validation set.
|
| 28 |
+
|
| 29 |
+
In Fig. 2, we present zero-shot classification and retrieval performance, and resource costs in cores $\times$ hours of training RECLIP models and the baseline model for short and long schedules. Experiments show that, using the same batch size and training steps, RECLIP reduces the computation resources by 6 to $8 \times$ and largely preserves the classification and retrieval accuracy. When comparing to state-of-the-art (SOTA) methods, RECLIP significantly saves resource usage by 5 to $5 9 \times$ and shows highly competitive zero-shot classification and retrieval accuracy. Apart from image-level tasks, we explore transfer learning of RECLIP to open-vocabulary detection tasks (Gu et al., 2022), which typically requires high-resolution images for small object recognition. Surprisingly, RECLIP achieves $3 2 ~ \mathrm { A P } _ { r }$ , matching the state of the art performance of RO-ViT (Kim et al., 2023) on LVIS benchmark. This demonstrates the potential of RECLIP for region and pixel-level tasks beyond image-level understanding. In summary, our contributions are:
|
| 30 |
+
|
| 31 |
+
• We present a new language image pretraining methodology, Resource-efficient CLIP (RECLIP) to minimize computational resource requirements.
|
| 32 |
+
• We leverage small images for the main contrastive learning phase to enable the model to be trained with language supervisions fast and then finetune the model on high-resolution data with a short schedule in the end.
|
| 33 |
+
• RECLIP significantly saves compute resource, reduces FLOPs and achieves highly competitive performance on both zero-shot classification and image-text retrieval benchmarks.
|
| 34 |
+
• RECLIP matches the state of the art in open-vocabulary detection with much less training resources.
|
| 35 |
+
|
| 36 |
+
We believe RECLIP could enable the broader research community to explore and understand language supervised pretraining in a more resource friendly setting.
|
| 37 |
+
|
| 38 |
+
# 2 Related Work
|
| 39 |
+
|
| 40 |
+
# 2.1 Learning with Low-Resolution Images
|
| 41 |
+
|
| 42 |
+
Deep learning techniques have been utilized on a wide-variety of computer vision tasks, e.g. visual recognition (He et al., 2016; Dosovitskiy et al., 2021), video analysis (Tran et al., 2018), images generations (Ramesh et al., 2021), etc. Most of existing work follow the standard training and testing paradigms to exploit very deep models by using images with the fixed resolution, e.g. $2 2 4 \times 2 2 4$ . This setting has been one of fundamental standards for various computer vision tasks. However, an increasing number of studies have been conducted to investigate to train deep learning models with low-resolution data. Touvron et al. (2019) have observed significant discrepancy on image sizes caused by augmentation methods during the train and test period, and further validated the effectiveness of using lower resolution images for training than testing. Driven by the needs for specific tasks, e.g. face recognition, surveillance images analysis, etc., Singh et al. (2019; 2022) and Huang et al. (2022) study learning with low resolution images and generally focus on using high resolution images as auxiliary data to help to train models with low resolution data, which causes difficulties to generalize on broader visual recognition tasks. For video understanding, Wu et al. (2020) propose to use variable mini-batch shapes with different spatial-temporal resolutions for training deep video models and obtain optimal performance and time trade-offs. With recent advances of vision transformers (Dosovitskiy et al., 2021; He et al., 2022), Guo et al. (2022) speedup image pretraining by using masked image modelling with low resolution data. Liu et al. (2022) introduce a a log-spaced continuous position bias for pretraining vision models by using smaller images and transfer to high-resolution localization tasks.
|
| 43 |
+
|
| 44 |
+
# 2.2 Language-supervised Learning
|
| 45 |
+
|
| 46 |
+
Due to the natural co-occurrence of image and language data on the web, language-supervised learning has become a highly effective and scalable representation learning methodology. Researchers have explored a variety of paired image-text data such as image tags (Chen & Gupta, 2015; Divvala et al., 2014; Joulin et al., 2016), captions (Desai & Johnson, 2021; Sariyildiz et al., 2020; Wang et al., 2009; Sharma et al., 2018), alt-texts (Jia et al., 2021; Schuhmann et al., 2021), image search queries (Radford et al., 2021), page title (Chen et al., 2022b), or a combination of these sources (Chen et al., 2022b). From a modeling perspective, contrastive learning is particularly suitable for recognition and retrieval tasks, because of its simplicity and versatility. However, the high requirements of computational resources have limited the research from the broader community.
|
| 47 |
+
|
| 48 |
+
To fully leverage capabilities of vision and language pretraining, large batch size (e.g. 16k (Jia et al., 2021), 32k (Radford et al., 2021; Yao et al., 2021), or $6 4 \mathrm { k }$ (Yu et al., 2022)) and web image text data have been adopted widely. This requires a large amount of computational resources which many academic institutions and industry labs cannot afford. To address such limitation, Zhai et al. (2022) proposes to precompute the image features with frozen classifier backbone, while Zhai et al. (2023) proposes sigmoid loss which better supports small batch training. In addition, masked image learning (Yao et al., 2021), multi-views data augmentations (Li et al., 2022a; Yao et al., 2021), knowledge distillations (Lei et al., 2022) and masked self-distillation Dong et al. (2022b) have been proposed. Since many of these methods are trained and evaluated on smaller scale/data, it is unclear how well they may scale up to larger batch and data. For example, Weers et al. (2023) shows that the advantage of contrastive learning approaches on smaller scales may not always hold at larger scales. In contrast, we propose a simple and novel recipe for language image pretraining, which (1) significantly reduces computation resource requirements and (2) works well on a large-scale web dataset Chen et al. (2022b) with minimal change to the established CLIP recipe (Radford et al., 2021).
|
| 49 |
+
|
| 50 |
+
# 3 Method
|
| 51 |
+
|
| 52 |
+
# 3.1 Preliminaries
|
| 53 |
+
|
| 54 |
+
Contrastive Language Image Pretraining. Following existing works (Radford et al., 2021; Yu et al., 2022), we utilize a transformer-based contrastive model which consists of an image encoder and a text encoder. The image and text encoders are trained to output image-level representation and sentence-level representations respectively. The image embeddings $\{ p \}$ and text embeddings $\{ \boldsymbol { q } \}$ are obtained by global average pooling at the last layers of image and text encoders. The cosine similarity of the embeddings in batch $B$ , scaled by a learnable temperature $\tau$ are the input to the InfoNCE loss (Oord et al., 2018; Radford et al., 2021). The image and text contrastive loss is obtained by ${ L _ { c o n } } = { \left( { { L _ { \mathrm { { I 2 T } } } } + { L _ { \mathrm { { T 2 I } } } } } \right) } / 2$ , with:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { l } { { \displaystyle { \cal L } _ { \mathrm { I 2 T } } = - \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \log ( \frac { \exp ( p _ { i } q _ { i } / \tau ) } { \sum _ { j = 1 } ^ { B } \exp ( p _ { i } q _ { j } / \tau ) } ) } . } \\ { { \displaystyle { \cal L } _ { \mathrm { T 2 I } } = - \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \log ( \frac { \exp ( q _ { i } p _ { i } / \tau ) } { \sum _ { j = 1 } ^ { B } \exp ( q _ { i } p _ { j } / \tau ) } ) . } } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $i , j$ are indexes within the batch. This loss is optimized to learn both the image and language representation in the dual-encoder model.
|
| 61 |
+
|
| 62 |
+
# 3.2 Resource-efficient CLIP
|
| 63 |
+
|
| 64 |
+
At a high-level, our method utilizes small images to reduce computation and leverage a brief finetuning stage at the end of training to adapt for high-resolution inference. Intuitively, the use of smaller images presents a trade-off between how much detail we encode per example and how many samples we process per unit of computation resource. Fig. 1 shows the RECLIP training pipeline on the top. There are two phases: low-resolution main training, and highresolution finetuning. In the first phase, we leverage small images which contain sufficient visual concepts with paired texts as the input to the image and text encoders. By using an image size of 64 and a text length of 16, RECLIP processes the training data significantly faster than existing methods. In the second phase, we finetune the model for a short cycle on high-resolution data to provide valuable image details, which largely enhances the representation quality of the model. Below we delve deeper into specific aspects of RECLIP design.
|
| 65 |
+
|
| 66 |
+
Structure preservation by learning from small images. In Fig. 1, we observe that small images can preserve visual structure and contain sufficient concepts well. For instance, human can easily tell the object, “a dog”, in the third image and associate the image with the text of “a brown dog waits for ...”, and this is a fundamental principle for our RECLIP to leverage small images for the main language-supervised pretraining. Because down-sampling is a structure-preserving operation i.e. global appearance remains similar, we are able to reduce the token length aggressively without compromising the performance of the model. This is different from other techniques to reduce the sequence length (e.g. random masking) where the global appearance may change significantly with reduced sequence lengths. Additional visualization presents a comparison between various image resolutions and sheds light on how small images effectively preserve visual appearance (see Fig. 3).
|
| 67 |
+
|
| 68 |
+
Training complexity with small images. The computation cost of contrastive learning mostly depends on the cost of processing images (Radford et al., 2021; Li et al., 2022b; Yu et al., 2022), partly because the image encoder is typically heavier than the text encoder, partly because the image token length tends to be greater than that of text tokens. Below we provide theoretical analysis to understand the efficiency of using small images.
|
| 69 |
+
|
| 70 |
+
Let the number of tokens from the image encoder be:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
N = h w / p ^ { 2 }
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
, where $h / w$ are height/widths of the image, and $p$ is the patch size. If we replace $h$ by $H / r$ and $w$ by $W / r$ , where $H / W$ are the original image height and widths, and $r$ is the down-sampling factor. The computation complexity $C$ of the image encoder of a batch is given by :
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
C = O ( B N ^ { 2 } ) = O ( \frac { B H ^ { 2 } W ^ { 2 } } { p ^ { 2 } r ^ { 4 } } )
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
, where $B$ is the batch size. When $B , H , W , p$ are held constant, we have:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
C = O ( \frac { 1 } { r ^ { 4 } } )
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
This shows that reducing the image size is very effective in reducing computation complexity to the inverse power of up to 4. Since image encoder is the computation bottleneck in existing CLIP recipes (Radford et al., 2021; Li et al., 2022b; Zhai et al., 2022; Yu et al., 2022), RECLIP reduces the image sequence length to 16 by using an image size of 64, which makes our image token length the same as our own text token length, and much shorter than those of aforementioned methods.
|
| 89 |
+
|
| 90 |
+
The above complexity analysis $\textrm { C }$ is calculated based on the core operations self-attention layers in transformers. However, empirically the complexity of a transformer may not be dominated by the self-attention layers, the fully connected layers also play an important role. GPT-3 (Brown et al., 2020) paper have provided computation analysis of their language models, where the computation cost is estimated as $O ( N )$ , linear with the sequence length. Thus, we discussed the lower-bound of the complexity $C _ { l b }$ of RECLIP in equation 6. Using the notation of equation 4 and equation 5, we have
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
C _ { l b } = O ( B N ) = O ( \frac { B H W } { p r ^ { 2 } } ) ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
During the training, the B, H, W, p are normally constant, so equation 6 can be simplified as:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
C = O ( \frac { 1 } { r ^ { 2 } } ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Compared to equation 5, we observe that the computation savings in practice may be somewhere between $O ( \textstyle { \frac { 1 } { r ^ { 2 } } } )$ and $O ( \textstyle { \frac { 1 } { r ^ { 4 } } } )$ . This analysis shows that changing $r$ is very effective regardless of the compute estimation techniques.
|
| 103 |
+
|
| 104 |
+
Constant batch size. Batch size is a critical factor in contrastive learning (Radford et al., 2021; Pham et al., 2021; Li et al., 2022b; Chen et al., 2022a) and larger batch has consistently yielded improvement. In Equation 4, the complexity changes linearly with batch size $B$ . Observing that reduced batch size tends to hurt representation quality, we keep the batch size constant to save both computation and memory use by reducing image size only.
|
| 105 |
+
|
| 106 |
+
High-resolution finetuning. We perform high resolution finetuning after the main low-resolution training. Intuitively speaking, the model has acquired a high-level understanding of the images and texts through the main training phase. We improve its representation further by providing more detailed visual information through a short highresolution finetuning process. The images used for high-resolution training are the same as those for the low-res training, except that we remove the downsampling to preserve the rich visual details.
|
| 107 |
+
|
| 108 |
+
Care is taken to initialize the positional embeddings from low-res pretraining to high-res finetuning. We up-sample the positional embedding weights from the low dimension (e.g. 4x4 for $h = w = 6 4$ ) to the dimension of high-resolution positional embeddings (e.g. 14x14 for $h = w = 2 2 4$ ) for a given patch size $p = 1 6$ . Compared to up-sampling the low-res positional embeddings without increasing the amount of weights, we found this weight up-sampling beneficial because the positional embeddings have higher capacity to adapt with more detailed spatial representation. We use trainable positional embedding throughout the paper following existing works (Radford et al., 2021; Dosovitskiy et al., 2021; Yu et al., 2022).
|
| 109 |
+
|
| 110 |
+
Network architecture. We use the ViT-Large backbone as image encoder by default unless noted otherwise. The ViT-Large is a vision transformer which consists of 24 multi-head self-attention layers with 16 heads and the width dimension of 1024. The patch size is fixed at 16 following common practice. Although we focus on ViT architecture in this study, RECLIP involves only changing the input size, and can potentially support other network architectures as well (Vaswani et al., 2017; Dosovitskiy et al., 2021; He et al., 2016; Liu et al., 2021; Tolstikhin et al., 2021). Our text encoder follows the same transformer design as previous works (Radford et al., 2021; Yu et al., 2022). The text encoder consists of 12 multi-head self-attention layers with 12 heads and the width dimension of 1024.
|
| 111 |
+
|
| 112 |
+
Implementation details. We use a starting learning rate of 0.001, and train for $2 5 0 \mathrm { k }$ and $5 5 0 \mathrm { k }$ steps with linear LR decay using an Adafactor optimizer. We set weight decay to 0.01 and batch size to 16384. The batch size is chosen to be a multiple of 1024 and the model feature dimension (e.g. 4096) a multiple of 128, so that TPU padding would not occur on the sequence dimension. A short LR warmup of 2500 steps is used. Our high-resolution finetuning schedule starts with a learning rate of $1 0 ^ { - 4 }$ with 5000 steps LR warmup, and decays linearly over a total schedule of $2 0 \mathrm { k }$ or 50k iterations. We use an image size of 224 or 448 for finetuning. We use the English subset of the WebLI dataset (Chen et al., 2022b) for training. Our training is run on TPU-v3 infrastructure. Compared to general-purpose GPU devices, TPUs are specifically designed for large matrix operations commonly used in neural networks. Each TPU v3 device has 16GB high-bandwidth memory per core, which is comparable to that of a V100 and suitable for synchronous large-scale training. For zero-shot image classification, we use the same text prompts as Radford et al. (2021).
|
| 113 |
+
|
| 114 |
+
# 4 Experiments
|
| 115 |
+
|
| 116 |
+
# 4.1 Main Results
|
| 117 |
+
|
| 118 |
+
Zero-shot image-text retrieval and image classification. Following existing works (Radford et al., 2021; Li et al., 2022b; Yu et al., 2022), we evaluate RECLIP on zero-shot image and text retrieval on Flickr30K (Plummer et al., 2015) and MSCOCO (Chen et al., 2015) test sets, and zero-shot image classification on ImageNet (Deng et al., 2009), ImageNet-A (Hendrycks et al., 2021b), ImageNet-R (Hendrycks et al., 2021a), ImageNet-V2 (Recht et al., 2019) and ImageNet-Sketch (Wang et al., 2019) datasets. we take each image and text to the corresponding encoder to obtain embeddings for all image and text pairs. Then we calculate the the cosine similarity scores for the retrieval, and use the aligned image and text embeddings to perform zero-shot image classification by matching images with label names without fine-tuning.
|
| 119 |
+
|
| 120 |
+
Table 1: Zero-shot image-text retrieval, image classification results. $\mathrm { C L I P ^ { \ast } }$ : The original CLIP model (Radford et al., 2021) is marked in gray. The resource use is converted to TPU-v3 core-hours per Li et al. (2022b). CLIP, our repro.: our reproduced CLIP. RECLIP- $X$ : RECLIP trained with image size $X$ where $X = 6 4 , 8 0 , 1 1 2$ . RECLIP-64-F20K: RECLIP-64 finetuned for a shorter schedule of $2 0 \mathrm { k }$ steps. Best results are bolded.
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">steps Training</td><td rowspan="2">Cores</td><td colspan="3"></td><td rowspan="2"></td><td colspan="5"></td></tr><tr><td></td><td></td><td></td><td>INet</td><td></td><td></td><td></td><td></td></tr><tr><td>CLIP*(Radford et al.,2021)</td><td>-</td><td>120.0K</td><td>88.0</td><td>68.7</td><td>58.4</td><td>37.8</td><td>76.2</td><td>77.2</td><td>88.9</td><td>70.1</td><td>60.2</td></tr><tr><td>CLIP, our repro.</td><td>300k</td><td>26.4K</td><td>89.3</td><td>75.4</td><td>61.3</td><td>45.1</td><td>74.5</td><td>54.4</td><td>88.9</td><td>67.7</td><td>64.5</td></tr><tr><td>RECLIP-112</td><td>300k</td><td>13.1K</td><td>90.0</td><td>76.6</td><td>63.1</td><td>45.0</td><td>74.2</td><td>55.4</td><td>87.8</td><td>67.2</td><td>63.2</td></tr><tr><td>RECLIP-80</td><td>300k</td><td>7.5K</td><td>91.0</td><td>77.1</td><td>62.8</td><td>45.7</td><td>74.3</td><td>56.7</td><td>87.8</td><td>67.2</td><td>62.9</td></tr><tr><td>RECLIP-64</td><td>300k</td><td>6.6K</td><td>89.4</td><td>77.0</td><td>62.2</td><td>45.2</td><td>73.3</td><td>53.7</td><td>86.3</td><td>66.2</td><td>61.6</td></tr><tr><td>RECLIP-64-F20K</td><td>270k</td><td>3.9K</td><td>88.5</td><td>76.1</td><td>60.8</td><td>44.5</td><td>72.6</td><td>51.7</td><td>85.3</td><td>65.3</td><td>60.6</td></tr><tr><td>CLIP, our repro.</td><td>600k</td><td>52.8K</td><td>89.3</td><td>76.9</td><td>63.3</td><td>46.8</td><td>76.4</td><td>60.2</td><td>90.9</td><td>70.1</td><td>66.4</td></tr><tr><td>RECLIP-112</td><td>600k</td><td>23.4K</td><td>90.6</td><td>77.6</td><td>63.6</td><td>46.5</td><td>75.8</td><td>58.8</td><td>89.3</td><td>69.1</td><td>65.2</td></tr><tr><td>RECLIP-80</td><td>600k</td><td>11.2K</td><td>91.3</td><td>78.2</td><td>64.6</td><td>47.2</td><td>75.8</td><td>60.3</td><td>89.0</td><td>69.2</td><td>64.6</td></tr><tr><td>RECLIP-64</td><td>600k</td><td>9.2K</td><td>91.0</td><td>78.1</td><td>64.2</td><td>46.9</td><td>75.4</td><td>60.9</td><td>88.8</td><td>68.9</td><td>64.5</td></tr><tr><td>RECLIP-64-F20K</td><td>570k</td><td>6.5K</td><td>91.0</td><td>77.1</td><td>63.6</td><td>46.2</td><td>74.9</td><td>58.6</td><td>88.2</td><td>68.4</td><td>63.5</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Table 1 presents the results of RECLIP on this benchmark, where the baseline is our own reproduced version of CLIP. Our baseline model trains on the WebLI dataset with the images of $2 2 4 \times 2 2 4$ for $3 0 0 \mathrm { k }$ and $6 0 0 \mathrm { k }$ steps. The original CLIP (Radford et al., 2021) model and trains on their own dataset with the image size of $3 3 6 \times 3 3 6$ , which is marked in gray. RECLIP uses small images for the main training phase and finetune the model with the images of $2 2 4 \times 2 2 4$ for 20k or 50k steps.
|
| 125 |
+
|
| 126 |
+
For long-schedule training of $6 0 0 \mathrm { k }$ steps, RECLIP-64 significantly reduces compute use by $\sim { \bf 6 }$ times from 52.8K to 9.2K in cores $\times$ hours, which saves $\sim 8 0 \%$ compute resource, and it outperforms the baseline model by $+ 3 . 9$ on Flickr and MSCOCO retrieval. RECLIP-64-F20K, which finetunes the model for only $2 0 \mathrm { k }$ steps with high-resolution images, further reduces the computation use by $\sim { \bf 8 } \times$ to 6.5K and improves retrieval performance by $+ 1 . 8$ . On zeroshot image classification, RECLIP-64 achieves 75.4 and RECLIP-64-F20K achieves 74.9 of the top-1 accuracy, which is very competitive with the baseline method. RECLIP-64 reduces the token length for the image encoding from 196 to 16 during the main training phase, which is a key factor for resource savings. Overall, RECLIP-64 shows attractive trade-offs between the resource use and zero-shot retrieval and image classification performance.
|
| 127 |
+
|
| 128 |
+
We also train RECLIP with the image size of $8 0 \times 8 0$ . Comparing to the baseline method which consumes 52.8K in cores $\times$ hours, our RECLIP-80 remarkably reduces resource usage by $\sim 5$ times to 11.2K. RECLIP-80 improves retrieval results by $+ 5 . 0$ on Flickr30K and MSCOCO test sets, and achieves highly competitive zero-shot image classification performance of 75.8. Specifically, taking INet-A as an example, RECLIP-80 outperforms the baseline method for both $3 0 0 \mathrm { k }$ and $6 0 0 \mathrm { k }$ training steps. For short training schedule with 300 steps, RECLIP-80 requires only 7.5K in cores $\times$ hours which is $\sim 4 \times$ less than the baseline model.
|
| 129 |
+
|
| 130 |
+
Table 2: Comparisons of GFLOPs between RECLIP and the baseline model during the RECLIP training.
|
| 131 |
+
|
| 132 |
+
<table><tr><td>Models</td><td>GFLOPs</td></tr><tr><td>CLIP, our repro.</td><td>71.4</td></tr><tr><td>RECLIP-112</td><td>24.8</td></tr><tr><td>RECLIP-80</td><td>10.1</td></tr><tr><td>RECLIP-64</td><td>7.3</td></tr></table>
|
| 133 |
+
|
| 134 |
+
GFLOPS. We compare GFLOPs of RECLIP with the baseline method in Table 2. The baseline method, CLIP, our repro., requires 71.4 GFLOPs. Our RECLIP-80 reduces GFLOPs by $\sim { } 7 \times$ to 10.1 and RECLIP-64 further reduces GFLOPs by $\sim { \bf 1 0 } \times$ by using even smaller images.
|
| 135 |
+
|
| 136 |
+
# 4.2 System-level Comparison
|
| 137 |
+
|
| 138 |
+
We present system-level comparison between RECLIP and a series of existing methods on Flickr30K and MSCOCO image-text retrieval benchmarks, and ImageNet classification accuracy in Table 3. We train RECLIP for $6 0 0 \mathrm { k }$ steps and then finetune for $5 0 \mathrm { k }$ steps with the image size of $4 4 8 \times 4 4 8$ . For RECLIP-64-F20K, we finetune for $2 0 \mathrm { k }$ steps.
|
| 139 |
+
|
| 140 |
+
Table 3: Comparisons of zero-shot image-text retrieval and ImageNet classification top-1 accuracy on Flickr30K, MSCOCO and ImageNet. Models that use the fully-supervised dataset (Sun et al., 2017) and much larger are marked in gray. †: We refer to (Li et al., 2022b) to convert GPU cost to TPU usage in CLIP (Radford et al., 2021), FILIP (Yao et al., 2021). Cores $\times$ hours results are reported on TPU-v3 infrastructure. Best results are bolded.
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan="3">Method</td><td rowspan="3">Image Encoder Size</td><td rowspan="3">Cores × Hours</td><td rowspan="3">ImageNet</td><td colspan="4">Flickr30K (1K test set)</td><td colspan="4">MSCOCO (5K test set)</td></tr><tr><td colspan="2">image-to-text</td><td colspan="2">text-to-image</td><td colspan="2">image-to-text</td><td colspan="2">text-to-image</td></tr><tr><td>R@1</td><td>R@5</td><td>R@1</td><td>R@5</td><td>R@1</td><td>R@5</td><td>R@1</td><td>R@5</td></tr><tr><td>PaLI(Chen et al.,2022b)</td><td>3.9B</td><td>598.7K</td><td>Top-1 85.4</td><td>1</td><td>1</td><td>1</td><td>1</td><td>-</td><td>-</td><td>-</td><td>1</td></tr><tr><td>BASIC (Pham et al., 2021)</td><td>2.4B</td><td>288.1K</td><td>85.7</td><td>-</td><td>1</td><td>-</td><td>1</td><td>1</td><td>-</td><td>-</td><td></td></tr><tr><td>CoCa (Yu et al.,2022)</td><td>1B</td><td>962.1K</td><td>86.3</td><td>92.5</td><td>99.5</td><td>80.4</td><td>95.7</td><td>66.3</td><td>86.2</td><td>51.2</td><td>74.2</td></tr><tr><td>CLIP (Radford et al.,2021)</td><td>302M</td><td>120.0K†</td><td>76.2</td><td>88.0</td><td>98.7</td><td>68.7</td><td>90.6</td><td>58.4</td><td>81.5</td><td>37.8</td><td>62.4</td></tr><tr><td>ALIGN (Jia et al.,2021)</td><td>408M</td><td>355.0K</td><td>76.4</td><td>88.6</td><td>98.7</td><td>75.7</td><td>93.8</td><td>58.6</td><td>83.0</td><td>45.6</td><td>69.8</td></tr><tr><td>FILIP (Yao et al.,2021)</td><td>302M</td><td>180.0Kt</td><td>78.3</td><td>89.8</td><td>99.2</td><td>75.0</td><td>93.4</td><td>61.3</td><td>84.3</td><td>45.9</td><td>70.6</td></tr><tr><td>FLIP (Li et al.,2022b)</td><td>303M</td><td>81.9K</td><td>75.8</td><td>91.7</td><td>-</td><td>78.2</td><td></td><td>63.8</td><td>-</td><td>47.3</td><td></td></tr><tr><td>RECLIP-80 (ours)</td><td>303M</td><td>28.7K</td><td>76.3</td><td>91.4</td><td>99.1</td><td>79.2</td><td>94.7</td><td>64.9</td><td>85.2</td><td>48.2</td><td>72.6</td></tr><tr><td>RECLIP-64-F20K (ours)</td><td>303M</td><td>16.4K</td><td>75.3</td><td>92.5</td><td>99.1</td><td>78.7</td><td>94.9</td><td>64.5</td><td>85.2</td><td>47.3</td><td>71.9</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Table 4: LVIS open-vocabulary object detection. RECLIP maintains the same open-vocabulary detection $( \mathsf { A P } _ { r } )$ ) and standard detection (AP) as the state of the art RO-ViT despite using much less training resources.
|
| 145 |
+
|
| 146 |
+
<table><tr><td>ViT based method</td><td>Pretrained model</td><td>Detector backbone</td><td>APr</td><td>AP</td></tr><tr><td>RO-ViT (Kim et al., 2023)</td><td>ViT-L/16</td><td>ViT-L/16</td><td>32.1</td><td>34.0</td></tr><tr><td>RECLIP-RO-ViT (Ours)</td><td>ViT-L/16</td><td>ViT-L/16</td><td>32.0</td><td>34.7</td></tr></table>
|
| 147 |
+
|
| 148 |
+
From Table 3, we observe clear resource savings and highly competitive performance achieved with our simple and efficient training recipes. RECLIP with small images saves $3 \sim 5 9 \times$ compute resource in cores $\times$ hours. When comparing to the models with the similar scale of the image encoder (Radford et al., 2021; Jia et al., 2021; Yao et al., 2021; Li et al., 2022b), RECLIP reduces resource use by $\mathbf { 5 } \sim \mathbf { 2 2 }$ times with competitive zero-shot retrieval and image classification performance. In the comparisons to FLIP (Li et al., 2022b), RECLIP-64-F20K uses $\sim 5 \times$ less resource in cores $\times$ hours and outperforms it by $+ 2 . 0$ on Flickr30k and MSCOCO retrieval. Surprisingly, when compared to the CoCa, RECLIP-64-F20K significantly saves $\sim \mathbf { 9 8 \% }$ resource use and achieves the best image to text retrieval on Flickr30K test set, giving 92.5 of $\mathbf { R } \ @ 1$ . RECLIP-64-F20K gives 75.3, which is very competitive on zero-shot ImageNet classification among purely language supervised approaches. We believe this resource savings mostly come from the use of very short image sequence length i.e., 16, which is very different from existing recipes (Radford et al., 2021; Li et al., 2022b; Yu et al., 2022; Zhai et al., 2022).
|
| 149 |
+
|
| 150 |
+
We also observe that RECLIP-80 uses $3 \sim 3 4 \times$ less compute resource. When comparing to the CoCa (Yu et al., 2022), RECLIP-80 saves $\sim { \bf 9 7 \% }$ resource use and achieves highly competitive retrieval performance. The resource savings of RECLIP-80 can also be attributed to the largely-reduced sequence length, i.e., 25 for the image encoding. RECLIP-80 achieves highly competitive ImageNet top1 accuracy of 76.3, which outperforms CLIP and is on-par with ALIGN. Overall, RECLIP provides very affordable recipes for large-scale language and image pretraining.
|
| 151 |
+
|
| 152 |
+
We note that some leading methods (Chen et al., 2022b; Pham et al., 2021; Yu et al., 2022) marked in gray demonstrate substantially better zero-shot classification because of larger image encoder capacity and the use of JFT (Sun et al., 2017) dataset. JFT is a human-annotated classification dataset which is cleaner than most web crawled imagetext datasets (Radford et al., 2021; Schuhmann et al., 2021; Jia et al., 2021) and most advantageous for zero-shot classification, so we list the JFT-trained entries there for reference only.
|
| 153 |
+
|
| 154 |
+
# 4.3 Open Vocabulary Detection
|
| 155 |
+
|
| 156 |
+
We conduct evaluation on the LVIS dataset (Gupta et al., 2019) by using RECLIP for open vocabulary detection. We take a recent SOTA approach RO-ViT (Kim et al., 2023) as the baseline and apply RECLIP-80 to pre-train the model (RECLIP-RO-ViT). We train only on the LVIS base categories (frequent & common) and test on both the base and novel (rare) categories following the protocol of ViLD (Gu et al., 2022). The results are in the Table 4. RECLIP-ROViT achieves 32.0 Mask APr (AP on rare categories) (Gupta et al., 2019), matching the state of the art performance of RO-ViT (32.1). This is surprisingly encouraging because detection task typically requires much higher resolution e.g. 1024 than classification task to recognize the small objects, which can be especially challenging for RECLIP due to the low-res information loss. In addition, RECLIP-RO-ViT outperforms RO-ViT by 0.7 on all-category AP, showing that its representation is also suitable for standard detection on the base categories. These detection results suggest that RECLIP representation is versatile and suitable for a broader range of object and pixel-level tasks.
|
| 157 |
+
|
| 158 |
+
# 4.4 Ablations
|
| 159 |
+
|
| 160 |
+
In this section, we ablate the design of RECLIP training and evaluate on the zero-shot retrieval and classification accuracy.
|
| 161 |
+
|
| 162 |
+
The importance of high-resolution finetuning. Table 5 shows the importance of finetuning RECLIP with highresolution data after the main training phase. We compare the retrieval and classification accuracy by using the model trained with and without high-resolution finetuning on an image size of 224 for 50k steps. We observe that highresolution finetuning significantly improves the performance for zero-shot retrieval and classification. In particular, training RECLIP by using the smallest images, e.g. $6 4 \times 6 4$ , high-resolution finetuning offers the most notable benefits. This is also aligned with the results in Table 3 where RECLIP models trained with small images, e.g. $6 4 \times 6 4$ or $8 0 \times 8 0$ , and finetuned with $4 4 8 \times 4 4 8$ for a short cycle can achieve comparable performance with SOTA models.
|
| 163 |
+
|
| 164 |
+
Table 5: The importance of RECLIP high-resolution finetuning. We found that high-resolution finetuning significantly improves zero-shot transfer performance. RECLIP-X: RECLIP trained with image size $X$ . Best results are bolded.
|
| 165 |
+
|
| 166 |
+
<table><tr><td rowspan="3"></td><td rowspan="3">Total Training</td><td colspan="5">Before high-resolution finetuning</td><td colspan="5">After high-resolution finetuning</td></tr><tr><td>INet</td><td colspan="2">Flickr30K</td><td colspan="2">MSCOCO</td><td>INet</td><td colspan="2">Flickr30K</td><td colspan="2">MSCOCO</td></tr><tr><td>Top-1</td><td>I2T</td><td>T2I</td><td>I2T</td><td>T2I</td><td>Top-1</td><td>I2T</td><td>T2I</td><td>I2T</td><td>T2I</td></tr><tr><td>RECLIP-112</td><td>300k</td><td>69.0</td><td>83.2</td><td>67.9</td><td>58.6</td><td>40.0</td><td>74.2 (+5.2)</td><td>90.0(+6.8)</td><td>76.6 (+8.7)</td><td>63.1 (+4.7)</td><td>45.0 (+5.0)</td></tr><tr><td>RECLIP-80</td><td>300k</td><td>66.3</td><td>80.8</td><td>65.4</td><td>54.6</td><td>37.4</td><td>74.3 (+8.0)</td><td>91.0 (+10.2)</td><td>77.1 (+11.7)</td><td>62.8 (+8.2)</td><td>45.7 (+8.3)</td></tr><tr><td>RECLIP-64</td><td>300k</td><td>62.8</td><td>79.6</td><td>63.6</td><td>51.4</td><td>34.5</td><td>73.3 (+10.5)</td><td>89.4 (+9.8)</td><td>77.0 (+6.4)</td><td>62.2 (+10.8)</td><td>45.2 (+10.7)</td></tr><tr><td>RECLIP-112</td><td>600k</td><td>70.7</td><td>87.4</td><td>71.9</td><td>59.0</td><td>40.9</td><td>75.8 (+5.1)</td><td>90.6(+3.2)</td><td>77.6 (+5.7)</td><td>63.6 (+4.6)</td><td>46.5 (+5.5)</td></tr><tr><td>RECLIP-80</td><td>600k</td><td>67.7</td><td>82.8</td><td>68.1</td><td>55.8</td><td>39.0</td><td>75.8 (+8.1)</td><td>91.3 (+8.3)</td><td>78.2 (+10.1)</td><td>64.6 (+ 8.8)</td><td>47.2 (+8.2)</td></tr><tr><td>RECLIP-64</td><td>600k</td><td>65.5</td><td>80.9</td><td>66.1</td><td>54.3</td><td>37.1</td><td>75.4 (+9.9)</td><td>91.0 (+10.1)</td><td>78.1 (+12.0)</td><td>64.2 (+10.1)</td><td>46.9 (+9.8)</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Text length for RECLIP main training. Table 6 studies the text length for the RECLIP training. We use the text length of 64 and 16 to train our RECLIP with an image size of 80. Somewhat surprisingly, we observe that using a short text length, i.e. 16, during the main training phase clearly reduces the resource use and achieve competitive zero-shot retrieval and image classification performance. This training efficiency gains is possible because we use much shorter image sequence lengths than existing recipes (Radford et al., 2021; Yu et al., 2022).
|
| 169 |
+
|
| 170 |
+
Table 6: The effect of the text length in RECLIP main training. We found that using a short image sequence can further save compute resource and achieve promising zero-shot transfer performance. Default RECLIP settings are in dark gray . Best results are bolded.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Text</td><td>Cores</td><td>Flickr30K</td><td>MSCOCO</td><td>INet</td></tr><tr><td>Length</td><td>× hours</td><td>I2T T2I</td><td>I2T T2I</td><td>Top-1</td></tr><tr><td>64</td><td>15.5K</td><td>91.2 78.0</td><td>64.3 46.7</td><td>75.6</td></tr><tr><td>16</td><td>11.2K</td><td>91.3 78.2</td><td>64.6 47.2</td><td>75.8</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Small batch size for RECLIP main training phase. Our RECLIP is designed with principles of using constant batch size but varying image resolutions during the main training phase. Table 7 ablates effects of the batch size during the main training phase on zero-shot retrieval and image classification accuracy. We first train the model for $2 5 0 \mathrm { k }$ steps by using the batch size of 4k or 16k and the image size 112; then we finetune it for $5 0 \mathrm { k }$ steps by using the batch size of $1 6 \mathrm { k }$ and the image size of 224. From Table 7 shows that using smaller batch size $( 4 \mathbf { k } )$ saves compute resource by $6 9 \%$ , but the zero-shot retrieval and classification performance drops significantly even with the same high-resolution finetuning phase. Therefore, we conclude that using the same large batch size is important for language image pretraining to ensure competitive zero-shot transfer performance.
|
| 175 |
+
|
| 176 |
+
Table 7: The importance of RECLIP main training with constant batch size. We found that using the same batch size (16k) for RECLIP main training and finetuning achieves better zero-shot transfer performance. Default RECLIP settings are in dark gray . Best results are bolded.
|
| 177 |
+
|
| 178 |
+
<table><tr><td>Batch</td><td>Cores X</td><td>Flickr30K</td><td></td><td>MSCOCO</td><td>INet</td></tr><tr><td>Size</td><td>Hours</td><td>I2T</td><td>T2I</td><td>I2T T2I</td><td>Top-1</td></tr><tr><td>4k</td><td>4.2K</td><td>81.9</td><td>68.8</td><td>51.2 38.6</td><td>64.4</td></tr><tr><td>16k</td><td>13.1K</td><td>90.0</td><td>76.6</td><td>63.1 45.0</td><td>74.2</td></tr></table>
|
| 179 |
+
|
| 180 |
+
Increasing the batch size with small images for RECLIP. In Table 8, we ablate RECLIP by varying both the batch size and image size during the main training phase. The multi-grid training paradigm is as below: (1) we equally divide training process into 3 stages with the same steps in each; (2) we train the model for $2 5 \mathrm { k }$ , 50k and $1 0 0 \mathrm { k }$ steps by using the batch size of 64k, 32k and 16k, and the image size of 112, 160 and 224 in each stage. The idea is to increase the batch size while using low resolution data, and decrease the batch size with high-resolution data. The multi-grid free baseline is trained for 300k steps by using a constant batch size 16k and image size 112, and finetuned with image size 224. We observe that RECLIP without “MG" is not only simpler, but saves computational resource by $3 0 \%$ . In addition, RECLIP achieves better zero-shot retrieval retrieval performance on Flickr30K and MSCOCO and very similar ImageNet performance.
|
| 181 |
+
|
| 182 |
+
Table 8: The effect of multigrid training strategy, where we increase the image size and decrease the batch size simultaneously. We found RECLIP is simple and effective. Default RECLIP settings are in dark gray .
|
| 183 |
+
|
| 184 |
+
<table><tr><td rowspan="2">MG</td><td rowspan="2">Cores X Hours</td><td colspan="2">Flickr30K</td><td colspan="2">MSCOCO</td><td rowspan="2">INet</td></tr><tr><td>I2T</td><td>T2I</td><td>I2T T2I</td><td>Top-1</td></tr><tr><td>√</td><td>18.4K</td><td>89.2</td><td>75.5</td><td>62.3</td><td>45.3</td><td>74.5</td></tr><tr><td>X</td><td>13.1K</td><td>90.0</td><td>76.6</td><td>63.1</td><td>45.0</td><td>74.2</td></tr></table>
|
| 185 |
+
|
| 186 |
+
Multi-stages RECLIP high-resolution finetuning. In Table 9, we further study RECLIP with 1 and 2 highresolution finetuning stages given a model trained with low-resolution data. We study the following two variants. $( 1 1 2 2 2 4 4 4 8 )$ : we train the model for $3 0 0 \mathrm { k }$ steps with the image size of 112, finetune it for $4 0 \mathrm { k }$ steps with the image size of 224, and finetune it for another $4 0 \mathrm { k }$ steps with the image size of 448. $\mathrm { 1 1 2 } \mathrm { 4 4 8 }$ ): we train the model for $3 0 0 \mathrm { k }$ steps with the image size of 112 and finetune it for $5 0 \mathrm { k }$ steps with the image size of 448. We set $5 0 \mathrm { k }$ steps to keep the computation cost comparable with the first one. We observe that $( 1 1 2 4 4 8$ ) gives very competitive zero-shot retrieval and image classification accuracy. Thus, we use only one high-resolution finetuning stage. Table 9: RECLIP with one-stage or multi-stages high-resolution finetuning. We found that one high-resolution finetuning stage is simple and sufficient. Default RECLIP settings are in dark gray . The best results are bolded.
|
| 187 |
+
|
| 188 |
+
<table><tr><td>Stages</td><td>Corex</td><td>12Flickr30K2I</td><td>12MSCOCO2I</td><td>INp-1</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>112→ 224→ 448</td><td>31.1K</td><td>91.0 77.7</td><td>64.1 47.4</td><td>76.2</td></tr><tr><td>112 → 448</td><td>30.8K</td><td>90.7 78.0</td><td>64.3 47.0</td><td>76.1</td></tr></table>
|
| 189 |
+
|
| 190 |
+
Comparisons of image resizing and token masking In Table 10, we present a comparison between token masking (Li et al., 2022b) and image resizing training strategy with matching computational budget. The benchmark is zero-shot ImageNet classification. All factors other than masking vs resizing are controlled to be the same. For example, we use the same batch size, data, training recipe, and the same number of iterations for low-resolution (vs masked) pretraining and high-resolution (vs unmasked) finetuning. To match the compute usage betweeen resizing and masking, we set the masking ratios such that the sequence lengths are the same. For example, Mask-112 masks $7 5 \%$ tokens to match the sequence length of RECLIP-112 (assuming the baseline using full image size 224x224). Table 10 shows that image resizing has a clear advantage over token masking. RECLIP-112 starts with a gap of $+ 2 . 9$ with Mask-112. As the token masking ratio goes above $7 5 \%$ (Mask-112), we observe an increasing gap between resizing and masking $( + 5 . 4 \%$ for RECLIP-64), showing the clear advantage of resizing in very low-compute settings.
|
| 191 |
+
|
| 192 |
+
Table 10: Comparison of resizing vs token masking on zero-shot ImageNet classification. RECLIP-X: RECLIP with image size X. Mask-X: token masking with the same compute budget as the corresponding RECLIP-X. Resizing consistently outperforms masking, and the gap increases with decreasing compute budget. Best results are bolded.
|
| 193 |
+
|
| 194 |
+
<table><tr><td>X (Image Size)</td><td>Mask-X</td><td>RECLIP-X</td></tr><tr><td>112</td><td>72.9</td><td>75.8 (+2.9)</td></tr><tr><td>80</td><td>71.3</td><td>75.8 (+3.5)</td></tr><tr><td>64</td><td>69.5</td><td>74.9 (+5.4)</td></tr></table>
|
| 195 |
+
|
| 196 |
+
# 4.5 Visualization
|
| 197 |
+
|
| 198 |
+
Visualization of small images. In Fig. 3, we visualize images at various resolutions paired with their corresponding texts. We observe that small images generally preserve high-level structures of the original images, and contain sufficient visual information for language supervisions. For example, the martial arts, office meeting, concert, and gymnastics scenes are clearly recognizable down to $6 4 \times 6 4$ resolution. This supports the key insight of our RECLIP training design that leverages small images for the main training phase to save computation.
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 3: Visualization of image-text pairs and images are in various resolutions. Images are scaled with the same factor of 0.01 for both height and width. Small images contain sufficient visual information for contrastive training.
|
| 202 |
+
|
| 203 |
+
Visualization of image and text retrieval. We present image and text retrieval results of RECLIP in Fig. 4. Despite highly resource efficient training, RECLIP still produces accurate results on both image-to-text and text-to-image retrieval. For example, the concepts of football players, race cars, circular sculpture, police officer, musicians, and bulldozer are all correctly matched between image and texts.
|
| 204 |
+
|
| 205 |
+
# 5 Conclusions
|
| 206 |
+
|
| 207 |
+
We present the RECLIP, a method for resource-efficient language image pretraining. We propose to leverage small images with paired texts for the main constrastive training phase and finetune the model with high-resolution images for a short cycle at the end. The proposed training method has been validated on zero-shot image and text retrieval benchmarks and image classification datasets. In comparisons to the baseline method, RECLIP training recipe saves the computations by $6 \sim 8 \times$ with improved zero-shot retrieval performance and competitive classification accuracy. Compared to the state-of-the art methods, RECLIP significantly saves $\mathbf { 7 9 \% } \sim \mathbf { 9 8 \% }$ resource in cores $\mathbf { \nabla } \times$ hours with
|
| 208 |
+
|
| 209 |
+
# Image Query
|
| 210 |
+
|
| 211 |
+
# Text Retrieval Results
|
| 212 |
+
|
| 213 |
+
# Image Query
|
| 214 |
+
|
| 215 |
+
# Text Retrieval Results
|
| 216 |
+
|
| 217 |
+
1. football players are celebrating as an opposing team member watches 2. two football players leap into the air as a player on the opposing team moves toward them 3. two defensive players jumping in the air to block a quarterback s pass
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
|
| 221 |
+
1: a man is doing a handstand on top
|
| 222 |
+
of a circular sculpture covered with
|
| 223 |
+
graffiti
|
| 224 |
+
2: a person does a handstand on
|
| 225 |
+
public art
|
| 226 |
+
3: a man doing handstand on top of
|
| 227 |
+
a round statue
|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
|
| 233 |
+
1. a man wearing jeans and boots is jumping into the air with a white sandy hill below him and a blue cloudless sky behind him 2. a man in a long sleeved gray shirt and jeans leaps from a sandy hillside 3. a man in a gray shirt jumps over the top of a sand dune in the desert
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
|
| 237 |
+
1. two race cars are going down a racetrack bend 2. two cars are on a racetrack 3. indy car white blue with a red mark on the roof rounding a turn in front of the white car
|
| 238 |
+
|
| 239 |
+
Text Query: a police officer walking out of his parked vehicle and about the approach a yellow vehicle
|
| 240 |
+
|
| 241 |
+
Text Query: a bulldozer works to demolish a decrepit building in the background another brick building waits for its demise its face covered with a grid of blackened window holes
|
| 242 |
+
|
| 243 |
+
Image Retrieval Results:
|
| 244 |
+
|
| 245 |
+
Image Retrieval Results:
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 4: Visualization of image and text retrieval results. Despite training with orders of magnitude less resource, RECLIP correctly match many visual concepts with texts.
|
| 249 |
+
|
| 250 |
+
highly competitive zero-shot classification and image-text retrieval performance. We hope RECLIP paves the path to make contrastive language image pretraining more resource-friendly and accessible to the broad research community.
|
| 251 |
+
|
| 252 |
+
# Broader Impact Statement
|
| 253 |
+
|
| 254 |
+
Language image pretraining plays an important role in many applications, e.g. image and text retrieval, text-to-image generations, open-vocabulary detection, etc. This work presents a language image pretraining method, RECLIP, on large-scale web datasets and the proposed model has been evaluated on a series of zero-shot downstream tasks. The large image-text corpus may contain biased or harmful content which could be learnt by the model. Our model is for research use only and these models should not be used in applications that involve detecting features related to humans (e.g. facial recognition). The good news is RECLIP significantly reduces the resource use, thereby reducing the carbon footprint and is very environment-friendly for the community to build upon in the long run.
|
| 255 |
+
|
| 256 |
+
# References
|
| 257 |
+
|
| 258 |
+
Hangbo Bao, Li Dong, Songhao Piao, and Furu Wei. BEit: BERT pre-training of image transformers. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id $=$ p-BhZSz59o4.
|
| 259 |
+
|
| 260 |
+
Lucas Beyer, Xiaohua Zhai, and Alexander Kolesnikov. Better plain vit baselines for imagenet-1k, 2022.
|
| 261 |
+
|
| 262 |
+
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 H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877–1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper_files/ paper/2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf.
|
| 263 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In Hal Daumé III and Aarti Singh (eds.), ICML, volume 119 of Proceedings of Machine Learning Research, pp. 1597–1607. PMLR, 13–18 Jul 2020.
|
| 264 |
+
Wuyang Chen, Xianzhi Du, Fan Yang, Lucas Beyer, Xiaohua Zhai, Tsung-Yi Lin, Huizhong Chen, Jing Li, Xiaodan Song, Zhangyang Wang, and Denny Zhou. A simple single-scale vision transformer for object localization and instance segmentation, 2022a.
|
| 265 |
+
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 preprint arXiv:2209.06794, 2022b.
|
| 266 |
+
Xinlei Chen and Abhinav Gupta. Webly supervised learning of convolutional networks. In ICCV, 2015.
|
| 267 |
+
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.
|
| 268 |
+
J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR, 2009.
|
| 269 |
+
Karan Desai and Justin Johnson. Virtex: Learning visual representations from textual annotations. In CVPR, 2021.
|
| 270 |
+
Santosh K Divvala, Ali Farhadi, and Carlos Guestrin. Learning everything about anything: Webly-supervised visual concept learning. In CVPR, 2014.
|
| 271 |
+
Xiaoyi Dong, Jianmin Bao, Ting Zhang, Dongdong Chen, Shuyang Gu, Weiming Zhang, Lu Yuan, Dong Chen, Fang Wen, and Nenghai Yu. Clip itself is a strong fine-tuner: Achieving 85.7accuracy with vit-b and vit-l on imagenet, 2022a.
|
| 272 |
+
Xiaoyi Dong, Yinglin Zheng, Jianmin Bao, Ting Zhang, Dongdong Chen, Hao Yang, Ming Zeng, Weiming Zhang, Lu Yuan, Dong Chen, Fang Wen, and Nenghai Yu. Maskclip: Masked self-distillation advances contrastive language-image pretraining, 2022b.
|
| 273 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ YicbFdNTTy.
|
| 274 |
+
Xiuye Gu, Tsung-Yi Lin, Weicheng Kuo, and Yin Cui. Open-vocabulary object detection via vision and language knowledge distillation. In International Conference on Learning Representations, 2022. URL https: //openreview.net/forum?id $=$ lL3lnMbR4WU.
|
| 275 |
+
Jianyuan Guo, Kai Han, Han Wu, Yehui Tang, Yunhe Wang, and Chang Xu. Fastmim: Expediting masked image modeling pre-training for vision, 2022. URL https://arxiv.org/abs/2212.06593.
|
| 276 |
+
Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 277 |
+
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 (CVPR), June 2016.
|
| 278 |
+
|
| 279 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 280 |
+
|
| 281 |
+
Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16000–16009, 2022.
|
| 282 |
+
Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. ICCV, 2021a.
|
| 283 |
+
Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. CVPR, 2021b.
|
| 284 |
+
Ronghang Hu, Shoubhik Debnath, Saining Xie, and Xinlei Chen. Exploring long-sequence masked autoencoders. arXiv:2210.07224, 2022.
|
| 285 |
+
Zhenhua Huang, Shunzhi Yang, MengChu Zhou, Zhetao Li, Zheng Gong, and Yunwen Chen. Feature map distillation of thin nets for low-resolution object recognition. IEEE Transactions on Image Processing, 31:1364–1379, 2022. doi: 10.1109/TIP.2022.3141255.
|
| 286 |
+
Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V Le, Yunhsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, 2021.
|
| 287 |
+
Armand Joulin, Laurens van der Maaten, Allan Jabri, and Nicolas Vasilache. Learning visual features from large weakly supervised data. In ECCV, 2016.
|
| 288 |
+
Dahun Kim, Anelia Angelova, and Weicheng Kuo. Region-aware pretraining for open-vocabulary object detection with vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 11144–11154, June 2023.
|
| 289 |
+
Jie Lei, Xinlei Chen, Ning Zhang, Mengjiao Wang, Mohit Bansal, Tamara L. Berg, and Licheng Yu. Loopitr: Combining dual and cross encoder architectures for image-text retrieval, 2022.
|
| 290 |
+
Yangguang Li, Feng Liang, Lichen Zhao, Yufeng Cui, Wanli Ouyang, Jing Shao, Fengwei Yu, and Junjie Yan. Supervision exists everywhere: A data efficient contrastive language-image pre-training paradigm. In International Conference on Learning Representations, 2022a. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ zq1iJkNk3uN.
|
| 291 |
+
Yanghao Li, Haoqi Fan, Ronghang Hu, Christoph Feichtenhofer, and Kaiming He. Scaling language-image pretraining via masking. preprint :2212.00794, 2022b.
|
| 292 |
+
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 (ICCV), pp. 10012–10022, October 2021.
|
| 293 |
+
Ze Liu, Han Hu, Yutong Lin, Zhuliang Yao, Zhenda Xie, Yixuan Wei, Jia Ning, Yue Cao, Zheng Zhang, Li Dong, Furu Wei, and Baining Guo. Swin transformer v2: Scaling up capacity and resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 12009–12019, June 2022.
|
| 294 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 295 |
+
Hieu Pham, Zihang Dai, Golnaz Ghiasi, Hanxiao Liu, Adams Wei Yu, Minh-Thang Luong, Mingxing Tan, and Quoc V. Le. Combined scaling for zero-shot transfer learning. CoRR, abs/2111.10050, 2021. URL https://arxiv. org/abs/2111.10050.
|
| 296 |
+
|
| 297 |
+
Bryan A Plummer, Liwei Wang, Chris M Cervantes, Juan C Caicedo, Julia Hockenmaier, and Svetlana Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In ICCV, pp. 2641–2649, 2015.
|
| 298 |
+
|
| 299 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In ICML, 2021.
|
| 300 |
+
Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 8821–8831. PMLR, 18–24 Jul 2021.
|
| 301 |
+
Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do ImageNet classifiers generalize to ImageNet? In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 5389–5400. PMLR, 09–15 Jun 2019. URL https://proceedings.mlr.press/v97/recht19a.html.
|
| 302 |
+
Mert Bulent Sariyildiz, Julien Perez, and Diane Larlus. Learning visual representations with caption annotations. In ECCV, 2020.
|
| 303 |
+
Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. Laion- $. 4 0 0 \mathrm { m }$ : Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021.
|
| 304 |
+
Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In ACL, 2018.
|
| 305 |
+
Maneet Singh, Shruti Nagpal, Richa Singh, and Mayank Vatsa. Dual directed capsule network for very low resolution image recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019.
|
| 306 |
+
Maneet Singh, Shruti Nagpal, Richa Singh, and Mayank Vatsa. Derivenet for (very) low resolution image classification. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(10):6569–6577, 2022. doi: 10.1109/TPAMI.2021.3088756.
|
| 307 |
+
Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In ICCV, 2017.
|
| 308 |
+
Ilya O Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, and Alexey Dosovitskiy. Mlpmixer: An all-mlp architecture for vision. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 24261– 24272. Curran Associates, Inc., 2021. URL https://proceedings.neurips.cc/paper/2021/file/ cba0a4ee5ccd02fda0fe3f9a3e7b89fe-Paper.pdf.
|
| 309 |
+
Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Herve Jegou. Fixing the train-test resolution discrepancy. In H. Wallach, H. Larochelle, A. Beygelzimer, F. dAlché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings. neurips.cc/paper/2019/file/d03a857a23b5285736c4d55e0bb067c8-Paper.pdf.
|
| 310 |
+
Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
|
| 311 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper/2017/file/ 3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf.
|
| 312 |
+
Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global representations by penalizing local predictive power. In Advances in Neural Information Processing Systems, pp. 10506–10518, 2019.
|
| 313 |
+
Josiah Wang, Katja Markert, Mark Everingham, et al. Learning models for object recognition from natural language descriptions. In BMVC, 2009.
|
| 314 |
+
Floris Weers, Vaishaal Shankar, Angelos Katharopoulos, Yinfei Yang, and Tom Gunter. Self supervision does not help natural language supervision at scale, 2023.
|
| 315 |
+
Chao-Yuan Wu, Ross Girshick, Kaiming He, Christoph Feichtenhofer, and Philipp Krahenbuhl. A multigrid method for efficiently training video models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 316 |
+
Lewei Yao, Runhui Huang, Lu Hou, Guansong Lu, Minzhe Niu, Hang Xu, Xiaodan Liang, Zhenguo Li, Xin Jiang, and Chunjing Xu. Filip: Fine-grained interactive language-image pre-training. In ICLR, 2021.
|
| 317 |
+
Jiahui Yu, Zirui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, and Yonghui Wu. Coca: Contrastive captioners are image-text foundation models. Transactions on Machine Learning Research, 2022. ISSN 2835-8856. URL https://openreview.net/forum?id $=$ Ee277P3AYC.
|
| 318 |
+
Xiaohua Zhai, Xiao Wang, Basil Mustafa, Andreas Steiner, Daniel Keysers, Alexander Kolesnikov, and Lucas Beyer. Lit: Zero-shot transfer with locked-image text tuning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 18123–18133, June 2022.
|
| 319 |
+
Xiaohua Zhai, Basil Mustafa, Alexander Kolesnikov, and Lucas Beyer. Sigmoid loss for language image pre-training, 2023.
|
| 320 |
+
Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision (IJCV), 2022.
|
md/test/Unb5CVPtae/Unb5CVPtae.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/test/YCWjhGrJFD/YCWjhGrJFD.md
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING DIFFUSION MODELS WITH REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Kevin Black∗ 1 Michael Janner∗ 1 Yilun $ { \mathbf { D } } { \mathbf { u } } ^ { 2 }$ Ilya Kostrikov1 Sergey Levine1 1 University of California, Berkeley 2 Massachusetts Institute of Technology {kvablack, janner, kostrikov, sergey.levine}@berkeley.edu yilundu@mit.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Diffusion models are a class of flexible generative models trained with an approximation to the log-likelihood objective. However, most use cases of diffusion models are not concerned with likelihoods, but instead with downstream objectives such as human-perceived image quality or drug effectiveness. In this paper, we investigate reinforcement learning methods for directly optimizing diffusion models for such objectives. We describe how posing denoising as a multi-step decisionmaking problem enables a class of policy gradient algorithms, which we refer to as denoising diffusion policy optimization (DDPO), that are more effective than alternative reward-weighted likelihood approaches. Empirically, DDPO can adapt text-to-image diffusion models to objectives that are difficult to express via prompting, such as image compressibility, and those derived from human feedback, such as aesthetic quality. Finally, we show that DDPO can improve prompt-image alignment using feedback from a vision-language model without the need for additional data collection or human annotation. The project’s website can be found at http://rl-diffusion.github.io.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Diffusion probabilistic models (Sohl-Dickstein et al., 2015) have recently emerged as the de facto standard for generative modeling in continuous domains. Their flexibility in representing complex, high-dimensional distributions has led to the adoption of diffusion models in applications including image and video synthesis (Ramesh et al., 2021; Saharia et al., 2022; Ho et al., 2022), drug and material design (Xu et al., 2021; Xie et al., 2021; Schneuing et al., 2022), and continuous control (Janner et al., 2022; Wang et al., 2022; Hansen-Estruch et al., 2023). The key idea behind diffusion models is to iteratively transform a simple prior distribution into a target distribution by applying a sequential denoising process. This procedure is conventionally motivated as a maximum likelihood estimation problem, with the objective derived as a variational lower bound on the log-likelihood of the training data.
|
| 12 |
+
|
| 13 |
+
However, most use cases of diffusion models are not directly concerned with likelihoods, but instead with downstream objective such as human-perceived image quality or drug effectiveness. In this paper, we consider the problem of training diffusion models to satisfy such objectives directly, as opposed to matching a data distribution. This problem is challenging because exact likelihood computation with diffusion models is intractable, making it difficult to apply many conventional reinforcement learning (RL) algorithms. We instead propose to frame denoising as a multi-step decision-making task, using the exact likelihoods at each denoising step in place of the approximate likelihoods induced by a full denoising process. We present a policy gradient algorithm, which we refer to as denoising diffusion policy optimization (DDPO), that can optimize a diffusion model for downstream tasks using only a black-box reward function.
|
| 14 |
+
|
| 15 |
+
We apply our algorithm to the finetuning of large text-to-image diffusion models. Our initial evaluation focuses on tasks that are difficult to specify via prompting, such as image compressibility, and those derived from human feedback, such as aesthetic quality. However, because many reward functions of interest are difficult to specify programmatically, finetuning procedures often rely on large-scale human labeling efforts to obtain a reward signal (Ouyang et al., 2022). In the case of text-to-image diffusion, we propose a method for replacing such labeling with feedback from a vision-language model (VLM). Similar to RLAIF finetuning for language models (Bai et al., 2022b), the resulting procedure allows for diffusion models to be adapted to reward functions that would otherwise require additional human annotations. We use this procedure to improve prompt-image alignment for unusual subject-setting compositions.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1 (Reinforcement learning for diffusion models) We propose a reinforcement learning algorithm, DDPO, for optimizing diffusion models on downstream objectives such as compressibility, aesthetic quality, and prompt-image alignment as determined by vision-language models. Each row shows a progression of samples for the same prompt and random seed over the course of training.
|
| 19 |
+
|
| 20 |
+
Our contributions are as follows. We first present the derivation and conceptual motivation of DDPO. We then document the design of various reward functions for text-to-image generation, ranging from simple computations to workflows involving large VLMs, and demonstrate the effectiveness of DDPO compared to alternative reward-weighted likelihood methods in these settings. Finally, we demonstrate the generalization ability of our finetuning procedure to unseen prompts.
|
| 21 |
+
|
| 22 |
+
# 2 RELATED WORK
|
| 23 |
+
|
| 24 |
+
Diffusion probabilistic models. Denoising diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020) have emerged as an effective class of generative models for modalities including images (Ramesh et al., 2021; Saharia et al., 2022), videos (Ho et al., 2022; Singer et al., 2022), 3D shapes (Zhou et al., 2021; Zeng et al., 2022), and robotic trajectories (Janner et al., 2022; Ajay et al., 2022; Chi et al., 2023). While the denoising objective is conventionally derived as an approximation to likelihood, the training of diffusion models typically departs from maximum likelihood in several ways (Ho et al., 2020). Modifying the objective to more strictly optimize likelihood (Nichol & Dhariwal, 2021; Kingma et al., 2021) often leads to worsened image quality, as likelihood is not a faithful proxy for visual quality. In this paper, we show how diffusion models can be optimized directly for downstream objectives.
|
| 25 |
+
|
| 26 |
+
Controllable generation with diffusion models. Recent progress in text-to-image diffusion models (Ramesh et al., 2021; Saharia et al., 2022) has enabled fine-grained high-resolution image synthesis. To further improve the controllability and quality of diffusion models, recent approaches have investigated finetuning on limited user-provided data (Ruiz et al., 2022), optimizing text embeddings for new concepts (Gal et al., 2022), composing models (Du et al., 2023; Liu et al., 2022), adapters for additional input constraints (Zhang & Agrawala, 2023), and inference-time techniques such as classifier (Dhariwal & Nichol, 2021) and classifier-free (Ho & Salimans, 2021) guidance.
|
| 27 |
+
|
| 28 |
+
Reinforcement learning from human feedback. A number of works have studied using human feedback to optimize models in settings such as simulated robotic control (Christiano et al., 2017), game-playing (Knox & Stone, 2008), machine translation (Nguyen et al., 2017), citation retrieval (Menick et al., 2022), browsing-based question-answering (Nakano et al., 2021), summarization (Stiennon et al., 2020; Ziegler et al., 2019), instruction-following (Ouyang et al., 2022), and alignment with specifications (Bai et al., 2022a). Recently, Lee et al. (2023) studied the alignment of text-toimage diffusion models to human preferences using a method based on reward-weighted likelihood maximization. In our comparisons, their method corresponds to one iteration of the reward-weighted regresion (RWR) method. Our results demonstrate that DDPO significantly outperforms even multiple iterations of weighted likelihood maximization (RWR-style) optimization.
|
| 29 |
+
|
| 30 |
+
Diffusion models as sequential decision-making processes. Although predating diffusion models, Bachman & Precup (2015) similarly posed data generation as a sequential decision-making problem and used the resulting framework to apply reinforcement learning methods to image generation. More recently, Fan & Lee (2023) introduced a policy gradient method for training diffusion models. However, this paper aimed to improve data distribution matching rather than optimizing downstream objectives, and therefore the only reward function considered was a GAN-like discriminator. In concurrent work to ours, DPOK (Fan et al., 2023) built upon Fan & Lee (2023) and Lee et al. (2023) to better align text-to-image diffusion models to human preferences using a policy gradient algorithm. Like Lee et al. (2023), DPOK only considers a single preference-based reward function (Xu et al., 2023); additionally, their work studies KL-regularization and primarily focuses on training a different diffusion model for each prompt. In contrast, we train on many prompts at once (up to 398) and demonstrate generalization to many more prompts outside of the training set. Furthermore, we study how DDPO can be applied to multiple reward functions beyond those based on human feedback, including how rewards derived automatically from VLMs can improve prompt-image alignment. We provide a direct comparison to DPOK in Appendix C.
|
| 31 |
+
|
| 32 |
+
# 3 PRELIMINARIES
|
| 33 |
+
|
| 34 |
+
In this section, we provide a brief background on diffusion models and the RL problem formulation.
|
| 35 |
+
|
| 36 |
+
# 3.1 DIFFUSION MODELS
|
| 37 |
+
|
| 38 |
+
In this work, we consider conditional diffusion probabilistic models (Sohl-Dickstein et al., 2015; Ho et al., 2020), which represent a distribution $p ( \mathbf { x } _ { 0 } | \mathbf { c } )$ over a dataset of samples $\mathbf { x } _ { \mathrm { 0 } }$ and corresponding contexts c. The distribution is modeled as the reverse of a Markovian forward process $q ( \mathbf { x } _ { t } \mid \mathbf { x } _ { t - 1 } )$ , which iteratively adds noise to the data. Reversing the forward process can be accomplished by training a neural network $\mu _ { \theta } ( \mathbf { x } _ { t } , \mathbf { c } , t )$ with the following objective:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\mathcal { L } _ { \mathrm { D D P M } } ( \theta ) = \mathbb { E } _ { ( \mathbf { x _ { 0 } } , \mathbf { c } ) \sim p ( \mathbf { x _ { 0 } } , \mathbf { c } ) , t \sim \mathcal { U } \left\{ 0 , T \right\} , \mathbf { x } _ { t } \sim q ( \mathbf { x } _ { t } | \mathbf { x _ { 0 } } ) } \left[ \| \tilde { \pmb { \mu } } ( \mathbf { x } _ { 0 } , t ) - \pmb { \mu } _ { \theta } ( \mathbf { x } _ { t } , \mathbf { c } , t ) \| ^ { 2 } \right]
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\tilde { \pmb { \mu } }$ is the posterior mean of the forward process, a weighted average of $\mathbf { x } _ { \mathrm { 0 } }$ and $\mathbf { x } _ { t }$ . This objective is justified as maximizing a variational lower bound on the log-likelihood of the data (Ho et al., 2020).
|
| 45 |
+
|
| 46 |
+
Sampling from a diffusion model begins with drawing a random $\mathbf { x } _ { T } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ and following the reverse process $p _ { \theta } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \mathbf { c } )$ to produce a trajectory $\left\{ { \bf x } _ { T } , { \bf x } _ { T - 1 } , \ldots , { \bf x } _ { 0 } \right\}$ ending with a sample $\mathbf { x } _ { \mathrm { 0 } }$ . The sampling process depends not only on the predictor $\mu _ { \theta }$ but also the choice of sampler. Most popular samplers (Ho et al., 2020; Song et al., 2021) use an isotropic Gaussian reverse process with a fixed timestep-dependent variance:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
p _ { \theta } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \mathbf { c } ) = { \mathcal { N } } ( \mathbf { x } _ { t - 1 } \mid \mu _ { \theta } ( \mathbf { x } _ { t } , \mathbf { c } , t ) , \sigma _ { t } ^ { 2 } \mathbf { I } ) .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
# 3.2 MARKOV DECISION PROCESSES AND REINFORCEMENT LEARNING
|
| 53 |
+
|
| 54 |
+
A Markov decision process (MDP) is a formalization of sequential decision-making problems. An MDP is defined by a tuple $( S , { \mathcal { A } } , \rho _ { 0 } , P , R )$ , in which $s$ is the state space, $\mathcal { A }$ is the action space, $\rho _ { 0 }$ is the distribution of initial states, $P$ is the transition kernel, and $R$ is the reward function. At each timestep $t$ , the agent observes a state $\mathbf { s } _ { t } \in \cal { S }$ , takes an action $\mathbf { a } _ { t } \in \mathcal A$ , receives a reward $R ( \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ , and transitions to a new state $\mathbf { s } _ { t + 1 } \sim P ( \mathbf { s } _ { t + 1 } \mid \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ . An agent acts according to a policy $\pi ( \mathbf { a } \mid \mathbf { s } )$ .
|
| 55 |
+
|
| 56 |
+
As the agent acts in the MDP, it produces trajectories, which are sequences of states and actions $\tau = ( \mathbf { s } _ { 0 } , \mathbf { a } _ { 0 } , \mathbf { s } _ { 1 } , \mathbf { a } _ { 1 } , \ldots , \mathbf { s } _ { T } , \mathbf { a } _ { T } )$ . The reinforcement learning (RL) objective is for the agent to maximize ${ \mathcal { I } } _ { \mathrm { R L } } ( \pi )$ , the expected cumulative reward over trajectories sampled from its policy:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\begin{array} { r } { \mathcal { I } _ { \mathrm { R L } } ( \pi ) = \mathbb { E } _ { \tau \sim p ( \tau | \pi ) } \left[ \sum _ { t = 0 } ^ { T } R ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right] . } \end{array}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
# 4 REINFORCEMENT LEARNING TRAINING OF DIFFUSION MODELS
|
| 63 |
+
|
| 64 |
+
We now describe how RL algorithms can be used to train diffusion models. We present two classes of methods and show that each corresponds to a different mapping of the denoising process to the MDP framework.
|
| 65 |
+
|
| 66 |
+
# 4.1 PROBLEM STATEMENT
|
| 67 |
+
|
| 68 |
+
We assume a pre-existing diffusion model, which may be pretrained or randomly initialized. Assuming a fixed sampler, the diffusion model induces a sample distribution $p _ { \theta } ( \mathbf { x } _ { 0 } \mid \mathbf { c } )$ . The denoising diffusion RL objective is to maximize a reward signal $r$ defined on the samples and contexts:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
{ \mathcal { I } } _ { \mathrm { D D R L } } ( \theta ) = \mathbb { E } _ { \mathbf { c } \sim p ( \mathbf { c } ) , \ \mathbf { x } _ { 0 } \sim p _ { \theta } ( \mathbf { x } _ { 0 } \mid \mathbf { c } ) } \left[ r ( \mathbf { x } _ { 0 } , \mathbf { c } ) \right]
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
for some context distribution $p ( \mathbf { c } )$ of our choosing.
|
| 75 |
+
|
| 76 |
+
# 4.2 REWARD-WEIGHTED REGRESSION
|
| 77 |
+
|
| 78 |
+
To optimize $\mathcal { I } _ { \mathrm { D D R L } }$ with minimal changes to standard diffusion model training, we can use the denoising loss $\mathcal { L } _ { \mathrm { D D P M } }$ (Equation 1), but with training data $\mathbf { x } _ { 0 } \sim p _ { \theta } ( \mathbf { x } _ { 0 } \mid \mathbf { c } )$ and an added weighting that depends on the reward $r ( \mathbf { x } _ { 0 } , \mathbf { c } )$ . Lee et al. (2023) describe a single-round version of this procedure for diffusion models, but in general this approach can be performed for multiple rounds of alternating sampling and training, leading to an online RL method. We refer to this general class of algorithms as reward-weighted regression (RWR) (Peters & Schaal, 2007).
|
| 79 |
+
|
| 80 |
+
A standard weighting scheme uses exponentiated rewards to ensure nonnegativity,
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
w _ { \mathrm { R W R } } ( \mathbf { x } _ { 0 } , \mathbf { c } ) = \frac { 1 } { Z } \exp \big ( \beta r ( \mathbf { x } _ { 0 } , \mathbf { c } ) \big ) ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\beta$ is an inverse temperature and $Z$ is a normalization constant. We also consider a simplified weighting scheme that uses binary weights,
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { w _ { \mathrm { s p a r s e } } ( \mathbf { x } _ { 0 } , \mathbf { c } ) = \mathbb { 1 } \big [ r ( \mathbf { x } _ { 0 } , \mathbf { c } ) \geq C \big ] , } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $C$ is a reward threshold determining which samples are used for training. In supervised learning terms, this is equivalent to repeated filtered finetuning on training data coming from the model.
|
| 93 |
+
|
| 94 |
+
Within the RL formalism, the RWR procedure corresponds to the following one-step MDP:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { r l r l r l r l } { { \mathbf s } \triangleq { \mathbf c } } & { } & { { \mathbf a } \triangleq { \mathbf x } _ { 0 } } & & { \pi ( { \mathbf a } \mid { \mathbf s } ) \triangleq p _ { \theta } ( { \mathbf x } _ { 0 } \mid { \mathbf c } ) } & { } & { \rho _ { 0 } ( { \mathbf s } ) \triangleq p ( { \mathbf c } ) } & { } & { R ( { \mathbf s } , { \mathbf a } ) \triangleq r ( { \mathbf x } _ { 0 } , { \mathbf c } ) } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
with a transition kernel $P$ that immediately leads to an absorbing termination state. Therefore, maximizing ${ \mathcal { I } } _ { \mathrm { D D R L } } ( \theta )$ is equivalent to maximizing the RL objective ${ \mathcal { I } } _ { \mathrm { R L } } ( \pi )$ in this MDP.
|
| 101 |
+
|
| 102 |
+
From RL literature, weighting a log-likelihood objective by $w _ { \mathrm { R W R } }$ is known to approximately maximize ${ \mathcal { I } } _ { \mathrm { R L } } ( \pi )$ subject to a KL divergence constraint on $\pi$ (Nair et al., 2020). However, $\mathcal { L } _ { \mathrm { D D P M } }$ (Equation 1) does not involve an exact log-likelihood — it is instead derived as a variational bound on $\log { p _ { \theta } ( \mathbf { x } _ { 0 } \mid \mathbf { c } ) }$ . Therefore, the RWR procedure applied to diffusion model training is not theoretically justified and only optimizes $\mathcal { I } _ { \mathrm { D D R L } }$ very approximately.
|
| 103 |
+
|
| 104 |
+
# 4.3 DENOISING DIFFUSION POLICY OPTIMIZATION
|
| 105 |
+
|
| 106 |
+
RWR relies on an approximate log-likelihood because it ignores the sequential nature of the denoising process, only using the final samples $\mathbf { x } _ { \mathrm { 0 } }$ . In this section, we show how the denoising process can be reframed as a multi-step MDP, allowing us to directly optimize $\mathcal { I } _ { \mathrm { D D R L } }$ using policy gradient estimators. This follows the derivation in Fan & Lee (2023), who prove an equivalence between their method and a policy gradient algorithm where the reward is a GAN-like discriminator. We present a general framework with an arbitrary reward function, motivated by our desire to optimize arbitrary downstream objectives (Section 5). We refer to this class of algorithms as denoising diffusion policy optimization (DDPO) and present two variants based on specific gradient estimators.
|
| 107 |
+
|
| 108 |
+
Denoising as a multi-step MDP. We map the iterative denoising procedure to the following MDP:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r l } { \mathbf { s } _ { t } \triangleq ( \mathbf { c } , t , \mathbf { x } _ { t } ) \quad \pi ( \mathbf { a } _ { t } \mid \mathbf { s } _ { t } ) \triangleq p _ { \theta } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \mathbf { c } ) \qquad } & { P ( \mathbf { s } _ { t + 1 } \mid \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \triangleq \left( \delta _ { \mathbf { c } } , \delta _ { t - 1 } , \delta _ { \mathbf { x } _ { t - 1 } } \right) } \\ { \mathbf { a } _ { t } \triangleq \mathbf { x } _ { t - 1 } \qquad } & { \rho _ { 0 } ( \mathbf { s } _ { 0 } ) \triangleq \left( p ( \mathbf { c } ) , \delta _ { T } , \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) \right) \qquad } & { R ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \triangleq \left\{ \begin{array} { l l } { r ( \mathbf { x } _ { 0 } , \mathbf { c } ) } & { \mathrm { i f ~ } t = 0 } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
in which $\delta _ { y }$ is the Dirac delta distribution with nonzero density only at $y$ . Trajectories consist of $T$ timesteps, after which $P$ leads to a termination state. The cumulative reward of each trajectory is equal to $r ( \mathbf { x } _ { 0 } , \mathbf { c } )$ , so maximizing ${ \mathcal { I } } _ { \mathrm { D D R L } } ( \theta )$ is equivalent to maximizing ${ \mathcal { I } } _ { \mathrm { R L } } ( \pi )$ in this MDP.
|
| 115 |
+
|
| 116 |
+
The benefit of this formulation is that if we use a standard sampler with $p _ { \theta } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \mathbf { c } )$ parameterized as in Equation 2, the policy $\pi$ becomes an isotropic Gaussian as opposed to the arbitrarily complicated distribution $p _ { \theta } ( \mathbf { x } _ { 0 } \mid \mathbf { c } )$ as it is in the RWR formulation. This simplification allows for the evaluation of exact log-likelihoods and their gradients with respect to the diffusion model parameters.
|
| 117 |
+
|
| 118 |
+
Policy gradient estimation. With access to likelihoods and likelihood gradients, we can make direct Monte Carlo estimates of $\nabla _ { \boldsymbol { \theta } } \mathcal { I } _ { \mathrm { D D R L } }$ . Like RWR, DDPO alternates collecting denoising trajectories $\left\{ \mathbf { x } _ { T } , \mathbf { x } _ { T - 1 } , \ldots , \mathbf { x } _ { 0 } \right\}$ via sampling and updating parameters via gradient descent.
|
| 119 |
+
|
| 120 |
+
The first variant of DDPO, which we call $\mathrm { \Delta D P O _ { S F } }$ , uses the score function policy gradient estimator, also known as the likelihood ratio method or REINFORCE (Williams, 1992; Mohamed et al., 2020):
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\nabla _ { \boldsymbol { \theta } } \mathcal { I } _ { \mathrm { D D R L } } = \mathbb { E } \left[ \sum _ { t = 0 } ^ { T } \nabla _ { \boldsymbol { \theta } } \log p _ { \boldsymbol { \theta } } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \mathbf { c } ) ~ r ( \mathbf { x } _ { 0 } , \mathbf { c } ) \right]
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where the expectation is taken over denoising trajectories generated by the current parameters $\theta$ .
|
| 127 |
+
|
| 128 |
+
However, this estimator only allows for one step of optimization per round of data collection, as the gradient must be computed using data generated by the current parameters. To perform multiple steps of optimization, we may use an importance sampling estimator (Kakade & Langford, 2002):
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\nabla _ { \theta } \mathcal { I } _ { \mathrm { D D R L } } = \mathbb { E } \left[ \sum _ { t = 0 } ^ { T } \frac { p _ { \theta } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \mathbf { c } ) } { p _ { \theta _ { \mathrm { o i d } } } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \mathbf { c } ) } \nabla _ { \theta } \log p _ { \theta } ( \mathbf { x } _ { t - 1 } \mid \mathbf { x } _ { t } , \mathbf { c } ) r ( \mathbf { x } _ { 0 } , \mathbf { c } ) \right]
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where the expectation is taken over denoising trajectories generated by the parameters $\theta _ { \mathrm { o l d } }$ . This estimator becomes inaccurate if $p _ { \theta }$ deviates too far from $p _ { \theta _ { \mathrm { o l d } } }$ , which can be addressed using trust regions (Schulman et al., 2015) to constrain the size of the update. In practice, we implement the trust region via clipping, as in proximal policy optimization (Schulman et al., 2017).
|
| 135 |
+
|
| 136 |
+
# 5 REWARD FUNCTIONS FOR TEXT-TO-IMAGE DIFFUSION
|
| 137 |
+
|
| 138 |
+
In this work, we evaluate our methods on text-to-image diffusion. Text-to-image diffusion serves as a valuable test environment for reinforcement learning due to the availability of large pretrained models and the versatility of using diverse and visually interesting reward functions. In this section, we outline our selection of reward functions. We study a spectrum of reward functions of varying complexity, ranging from those that are straightforward to specify and evaluate to those that capture the depth of real-world downstream tasks.
|
| 139 |
+
|
| 140 |
+
# 5.1 COMPRESSIBILITY AND INCOMPRESSIBILITY
|
| 141 |
+
|
| 142 |
+
The capabilities of text-to-image diffusion models are limited by the co-occurrences of text and images in their training distribution. For instance, images are rarely captioned with their file size, making it impossible to specify a desired file size via prompting. This limitation makes reward functions based on file size a convenient case study: they are simple to compute, but not controllable through the conventional methods of likelihood maximization and prompt engineering.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2 (VLM reward function) Illustration of the VLM-based reward function for prompt-image alignment. LLaVA (Liu et al., 2023) provides a short description of a generated image; the reward is the similarity between this description and the original prompt as measured by BERTScore (Zhang et al., 2020).
|
| 146 |
+
|
| 147 |
+
We fix the resolution of diffusion model samples at $5 1 2 \mathrm { x } 5 1 2$ , such that the file size is determined solely by the compressibility of the image. We define two tasks based on file size: compressibility, in which the file size of the image after JPEG compression is minimized, and incompressibility, in which the same measure is maximized.
|
| 148 |
+
|
| 149 |
+
# 5.2 AESTHETIC QUALITY
|
| 150 |
+
|
| 151 |
+
To capture a reward function that would be useful to a human user, we define a task based on perceived aesthetic quality. We use the LAION aesthetics predictor (Schuhmann, 2022), which is trained on 176,000 human image ratings. The predictor is implemented as a linear model on top of CLIP embeddings (Radford et al., 2021). Annotations range between 1 and 10, with the highest-rated images mostly containing artwork. Since the aesthetic quality predictor is trained on human judgments, this task constitutes reinforcement learning from human feedback (Ouyang et al., 2022; Christiano et al., 2017; Ziegler et al., 2019).
|
| 152 |
+
|
| 153 |
+
# 5.3 AUTOMATED PROMPT ALIGNMENT WITH VISION-LANGUAGE MODELS
|
| 154 |
+
|
| 155 |
+
A very general-purpose reward function for training a text-to-image model is prompt-image alignment. However, specifying a reward that captures generic prompt alignment is difficult, conventionally requiring large-scale human labeling efforts. We propose using an existing VLM to replace additional human annotation. This design is inspired by recent work on RLAIF (Bai et al., 2022b), in which language models are improved using feedback from themselves.
|
| 156 |
+
|
| 157 |
+
We use LLaVA (Liu et al., 2023), a state-of-the-art VLM, to describe an image. The finetuning reward is the BERTScore (Zhang et al., 2020) recall metric, a measure of semantic similarity, using the prompt as the reference sentence and the VLM description as the candidate sentence. Samples that more faithfully include all of the details of the prompt receive higher rewards, to the extent that those visual details are legible to the VLM.
|
| 158 |
+
|
| 159 |
+
In Figure 2, we show one simple question: “what is happening in this image?”. While this captures the general task of prompt-image alignment, in principle any question could be used to specify complex or hard-to-define reward functions for a particular use case. One could even employ a language model to automatically generate candidate questions and evaluate responses based on the prompt. This framework provides a flexible interface where the complexity of the reward function is only limited by the capabilities of the vision and language models involved.
|
| 160 |
+
|
| 161 |
+
# 6 EXPERIMENTAL EVALUATION
|
| 162 |
+
|
| 163 |
+
The purpose of our experiments is to evaluate the effectiveness of RL algorithms for finetuning diffusion models to align with a variety of user-specified objectives. After examining the viability of the general approach, we focus on the following questions:
|
| 164 |
+
|
| 165 |
+
1. How do variants of DDPO compare to RWR and to each other?
|
| 166 |
+
2. Can VLMs allow for optimizing rewards that are difficult to specify manually?
|
| 167 |
+
3. Do the effects of RL finetuning generalize to prompts not seen during finetuning?
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3 (DDPO samples) Qualitative depiction of the effects of RL finetuning on different reward functions. DDPO transforms naturalistic images into stylized artwork to maximize aesthetic quality, removes background content and applies foreground smoothing to maximize compressibility, and adds high-frequency noise to maximize incompressibility.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 4 (Finetuning effectiveness) The relative effectiveness of different RL algorithms on three reward functions. We find that the policy gradient variants, denoted DDPO, are more effective optimizers than both RWR variants.
|
| 174 |
+
|
| 175 |
+
# 6.1 ALGORITHM COMPARISONS
|
| 176 |
+
|
| 177 |
+
We begin by evaluating all methods on the compressibility, incompressibility, and aesthetic quality tasks, as these tasks isolate the effectiveness of the RL approach from considerations relating to the VLM reward function. We use Stable Diffusion v1.4 (Rombach et al., 2022) as the base model for all experiments. Compressibility and incompressibility prompts are sampled uniformly from all 398 animals in the ImageNet-1000 (Deng et al., 2009) categories. Aesthetic quality prompts are sampled uniformly from a smaller set of 45 common animals.
|
| 178 |
+
|
| 179 |
+
As shown qualitatively in Figure 3, DDPO is able to effectively adapt a pretrained model with only the specification of a reward function and without any further data curation. The strategies found to optimize each reward are nontrivial; for example, to maximize LAION-predicted aesthetic quality, DDPO transforms a model that produces naturalistic images into one that produces artistic drawings. To maximize compressibility, DDPO removes backgrounds and applies smoothing to what remains. To maximize incompressibility, DDPO finds artifacts that are difficult for the JPEG compression algorithm to encode, such as high-frequency noise and sharp edges. Samples from RWR are provided in Appendix G for comparison.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 5 (Prompt alignment) (L) Progression of samples for the same prompt and random seed over the course of training. The images become significantly more faithful to the prompt. The samples also adopt a cartoon-like style, which we hypothesize is because the prompts are more likely depicted as illustrations than realistic photographs in the pretraining distribution. (R) Quantitative improvement of prompt alignment. Each thick line is the average score for an activity, while the faint lines show average scores for a few randomly selected individual prompts.
|
| 183 |
+
|
| 184 |
+
We provide a quantitative comparison of all methods in Figure 4. We plot the attained reward as a function of the number of queries to the reward function, as reward evaluation becomes the limiting factor in many practical applications. DDPO shows a clear advantage over RWR on all tasks, demonstrating that formulating the denoising process as a multi-step MDP and estimating the policy gradient directly is more effective than optimizing a reward-weighted variational bound on log-likelihood. Within the DDPO class, the importance sampling estimator slightly outperforms the score function estimator, likely due to the increased number of optimization steps. Within the RWR class, the performance of weighting schemes is comparable, making the sparse weighting scheme preferable on these tasks due to its simplicity and reduced resource requirements.
|
| 185 |
+
|
| 186 |
+
# 6.2 AUTOMATED PROMPT ALIGNMENT
|
| 187 |
+
|
| 188 |
+
We next evaluate the ability of VLMs, in conjunction with DDPO, to automatically improve the image-prompt alignment of the pretrained model without additional human labels. We focus on $\mathrm { D D P O _ { I S } }$ for this experiment, as we found it to be the most effective algorithm in Section 6.1. The prompts for this task all have the form “a(n) [animal] [activity] ”, where the animal comes from the same list of 45 common animals used in Section 6.1 and the activity is chosen from a list of 3 activities: “riding a bike”, “playing chess”, and “washing dishes”.
|
| 189 |
+
|
| 190 |
+
The progression of finetuning is depicted in Figure 5. Qualitatively, the samples come to depict the prompts much more faithfully throughout the course of training. This trend is also reflected quantitatively, though is less salient as small changes in BERTScore can correspond to large differences in relevance (Zhang et al., 2020). It is important to note that some of the prompts in the finetuning set, such as “a dolphin riding a bike”, had zero success rate from the pretrained model; if trained in isolation, this prompt would be unlikely to ever improve because there would be no reward signal. It was only via transferrable learning across prompts that these difficult prompts could improve.
|
| 191 |
+
|
| 192 |
+
Nearly all of the samples become more cartoon-like or artistic during finetuning. This was not optimized for directly. We hypothesize that this may be a function of the pretraining distribution (one would expect depictions of animals doing everyday activities to be more commonly cartoon-like than photorealistic) or of the reward function (perhaps LLaVA has an easier time recognizing the content of simple cartoon-like images).
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 6 (Generalization) Finetuning on a limited set of animals generalizes to both new animals and non-animal everyday objects. The prompts for the rightmost two columns are “a capybara washing dishes” and “a duck taking an exam”. A quantitative analysis is provided in Appendix F, and more samples are provided in Appendix G.
|
| 196 |
+
|
| 197 |
+
# 6.3 GENERALIZATION
|
| 198 |
+
|
| 199 |
+
RL finetuning on large language models has been shown to produce interesting generalization properties; for example, instruction finetuning almost entirely in English has been shown to improve capabilities in other languages (Ouyang et al., 2022). It is difficult to reconcile this phenomenon with our current understanding of generalization; it would a priori seem more likely for finetuning to have an effect only on the finetuning prompt set or distribution. In order to investigate the same phenomenon with diffusion models, Figure 6 shows a set of DDPO-finetuned model samples corresponding to prompts that were not seen during finetuning. In concordance with instructionfollowing transfer in language modeling, we find that the effects of finetuning do generalize, even with prompt distributions as narrow as 45 animals and 3 activities. We find evidence of generalization to animals outside of the training distribution, to non-animal everyday objects, and in the case of prompt-image alignment, even to novel activities such as “taking an exam”.
|
| 200 |
+
|
| 201 |
+
# 7 DISCUSSION AND LIMITATIONS
|
| 202 |
+
|
| 203 |
+
We presented an RL-based framework for training denoising diffusion models to directly optimize a variety of reward functions. By posing the iterative denoising procedure as a multi-step decisionmaking problem, we were able to design a class of policy gradient algorithms that are highly effective at training diffusion models. We found that DDPO was an effective optimizer for tasks that are difficult to specify via prompts, such as image compressibility, and difficult to evaluate programmatically, such as semantic alignment with prompts. To provide an automated way to derive rewards, we also proposed a method for using VLMs to provide feedback on the quality of generated images. While our evaluation considers a variety of prompts, the full range of images in our experiments was constrained (e.g., animals performing activities). Future iterations could expand both the questions posed to the VLM, possibly using language models to propose relevant questions based on the prompt, as well as the diversity of the prompt distribution. We also chose not to study the problem of overoptimization, a common issue with RL finetuning in which the model diverges too far from the original distribution to be useful (see Appendix A); we highlight this as an important area for future work. We hope that this work will provide a step toward more targeted training of large generative models, where optimization via RL can produce models that are effective at achieving user-specified goals rather than simply matching an entire data distribution.
|
| 204 |
+
|
| 205 |
+
Broader Impacts. Generative models can be valuable productivity aids, but may also pose harm when used for disinformation, impersonation, or phishing. Our work aims to make diffusion models more useful by enabling them to optimize user-specified objectives. This adaptation has beneficial applications, such as the generation of more understandable educational material, but may also be used maliciously, in ways that we do not outline here. Work on the reliable detection of synthetic content remains important to mitigate such harms from generative models.
|
| 206 |
+
|
| 207 |
+
This work was partially supported by the Office of Naval Research and computational resource donations from Google via the TPU Research Cloud (TRC). Michael Janner was supported by a fellowship from the Open Philanthropy Project. Yilun Du and Kevin Black were supported by fellowships from the National Science Foundation.
|
| 208 |
+
|
| 209 |
+
CODE REFERENCES
|
| 210 |
+
|
| 211 |
+
We used the following open-source libraries for this work: NumPy (Harris et al., 2020), JAX (Bradbury et al., 2018), Flax (Heek et al., 2023), optax (Babuschkin et al., 2020), h5py (Collette, 2013), transformers (Wolf et al., 2020), and diffusers (von Platen et al., 2022).
|
| 212 |
+
|
| 213 |
+
REFERENCES
|
| 214 |
+
Anurag Ajay, Yilun Du, Abhi Gupta, Joshua Tenenbaum, Tommi Jaakkola, and Pulkit Agrawal. Is conditional generative modeling all you need for decision-making? arXiv preprint arXiv:2211.15657, 2022.
|
| 215 |
+
Igor Babuschkin, Kate Baumli, Alison Bell, Surya Bhupatiraju, Jake Bruce, Peter Buchlovsky, David Budden, Trevor Cai, Aidan Clark, Ivo Danihelka, Antoine Dedieu, Claudio Fantacci, Jonathan Godwin, Chris Jones, Ross Hemsley, Tom Hennigan, Matteo Hessel, Shaobo Hou, Steven Kapturowski, Thomas Keck, Iurii Kemaev, Michael King, Markus Kunesch, Lena Martens, Hamza Merzic, Vladimir Mikulik, Tamara Norman, George Papamakarios, John Quan, Roman Ring, Francisco Ruiz, Alvaro Sanchez, Rosalia Schneider, Eren Sezener, Stephen Spencer, Srivatsan Srinivasan, Wojciech Stokowiec, Luyu Wang, Guangyao Zhou, and Fabio Viola. The DeepMind JAX Ecosystem, 2020. URL http://github.com/deepmind.
|
| 216 |
+
Philip Bachman and Doina Precup. Data generation as sequential decision making. Advances in Neural Information Processing Systems, 28, 2015.
|
| 217 |
+
Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, Nicholas Joseph, Saurav Kadavath, Jackson Kernion, Tom Conerly, Sheer El-Showk, Nelson Elhage, Zac Hatfield-Dodds, Danny Hernandez, Tristan Hume, Scott Johnston, Shauna Kravec, Liane Lovitt, Neel Nanda, Catherine Olsson, Dario Amodei, Tom Brown, Jack Clark, Sam McCandlish, Chris Olah, Ben Mann, and Jared Kaplan. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862, 2022a.
|
| 218 |
+
Yuntao Bai, Saurav Kadavath, Sandipan Kundu, Amanda Askell, Jackson Kernion, Andy Jones, Anna Chen, Anna Goldie, Azalia Mirhoseini, Cameron McKinnon, Carol Chen, Catherine Olsson, Christopher Olah, Danny Hernandez, Dawn Drain, Deep Ganguli, Dustin Li, Eli Tran-Johnson, Ethan Perez, Jamie Kerr, Jared Mueller, Jeffrey Ladish, Joshua Landau, Kamal Ndousse, Kamile Lukosuite, Liane Lovitt, Michael Sellitto, Nelson Elhage, Nicholas Schiefer, Noemi Mercado, Nova DasSarma, Robert Lasenby, Robin Larson, Sam Ringer, Scott Johnston, Shauna Kravec, Sheer El Showk, Stanislav Fort, Tamera Lanham, Timothy Telleen-Lawton, Tom Conerly, Tom Henighan, Tristan Hume, Samuel R. Bowman, Zac Hatfield-Dodds, Ben Mann, Dario Amodei, Nicholas Joseph, Sam McCandlish, Tom Brown, and Jared Kaplan. Constitutional AI: Harmlessness from AI feedback. arXiv preprint arXiv:2212.08073, 2022b.
|
| 219 |
+
Arpit Bansal, Hong-Min Chu, Avi Schwarzschild, Soumyadip Sengupta, Micah Goldblum, Jonas Geiping, and Tom Goldstein. Universal guidance for diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 843–852, 2023.
|
| 220 |
+
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
|
| 221 |
+
Cheng Chi, Siyuan Feng, Yilun Du, Zhenjia Xu, Eric Cousineau, Benjamin Burchfiel, and Shuran Song. Diffusion Policy: Visuomotor Policy Learning via Action Diffusion. arXiv preprint arXiv:2303.04137, 2023.
|
| 222 |
+
Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. In Neural Information Processing Systems, 2017.
|
| 223 |
+
Andrew Collette. Python and HDF5. O’Reilly, 2013.
|
| 224 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In Conference on Computer Vision and Pattern Recognition, 2009.
|
| 225 |
+
Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. In Advances in Neural Information Processing Systems, 2021.
|
| 226 |
+
Yilun Du, Conor Durkan, Robin Strudel, Joshua B Tenenbaum, Sander Dieleman, Rob Fergus, Jascha Sohl-Dickstein, Arnaud Doucet, and Will Grathwohl. Reduce, reuse, recycle: Compositional generation with energy-based diffusion models and mcmc. arXiv preprint arXiv:2302.11552, 2023.
|
| 227 |
+
Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In International conference on machine learning, pp. 1329–1338. PMLR, 2016.
|
| 228 |
+
Ying Fan and Kangwook Lee. Optimizing ddpm sampling with shortcut fine-tuning. arXiv preprint arXiv:2301.13362, 2023.
|
| 229 |
+
Ying Fan, Olivia Watkins, Yuqing Du, Hao Liu, Moonkyung Ryu, Craig Boutilier, Pieter Abbeel, Mohammad Ghavamzadeh, Kangwook Lee, and Kimin Lee. Dpok: Reinforcement learning for fine-tuning text-to-image diffusion models. arXiv preprint arXiv:2305.16381, 2023.
|
| 230 |
+
Rinon Gal, Yuval Alaluf, Yuval Atzmon, Or Patashnik, Amit H Bermano, Gal Chechik, and Daniel Cohen-Or. An image is worth one word: Personalizing text-to-image generation using textual inversion. arXiv preprint arXiv:2208.01618, 2022.
|
| 231 |
+
Leo Gao, John Schulman, and Jacob Hilton. Scaling laws for reward model overoptimization. arXiv preprint arXiv:2210.10760, 2022.
|
| 232 |
+
Gabriel Goh, Nick Cammarata †, Chelsea Voss †, Shan Carter, Michael Petrov, Ludwig Schubert, Alec Radford, and Chris Olah. Multimodal neurons in artificial neural networks. Distill, 2021. https://distill.pub/2021/multimodal-neurons.
|
| 233 |
+
Philippe Hansen-Estruch, Ilya Kostrikov, Michael Janner, Jakub Grudzien Kuba, and Sergey Levine. IDQL: Implicit q-learning as an actor-critic method with diffusion policies. arXiv preprint arXiv:2304.10573, 2023.
|
| 234 |
+
Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, Robert Kern, Matti Picus, Stephan Hoyer, Marten H. van Kerkwijk, Matthew Brett, Allan Haldane, Jaime Fernández del Río, Mark Wiebe, Pearu Peterson, Pierre Gérard-Marchant, Kevin Sheppard, Tyler Reddy, Warren Weckesser, Hameer Abbasi, Christoph Gohlke, and Travis E. Oliphant. Array programming with NumPy. Nature, 585(7825):357–362, 2020.
|
| 235 |
+
Jonathan Heek, Anselm Levskaya, Avital Oliver, Marvin Ritter, Bertrand Rondepierre, Andreas Steiner, and Marc van Zee. Flax: A neural network library and ecosystem for JAX, 2023. URL http://github.com/google/flax.
|
| 236 |
+
Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. In NeurIPS 2021 Workshop on Deep Generative Models and Downstream Applications, 2021.
|
| 237 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, 2020.
|
| 238 |
+
Jonathan Ho, William Chan, Chitwan Saharia, Jay Whang, Ruiqi Gao, Alexey Gritsenko, Diederik P. Kingma, Ben Poole, Mohammad Norouzi, David J. Fleet, and Tim Salimans. Imagen video: High definition video generation with diffusion models. arXiv preprint arXiv:2210.02303, 2022.
|
| 239 |
+
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.
|
| 240 |
+
Michael Janner, Yilun Du, Joshua Tenenbaum, and Sergey Levine. Planning with diffusion for flexible behavior synthesis. In International Conference on Machine Learning, 2022.
|
| 241 |
+
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In Proceedings of the Nineteenth International Conference on Machine Learning, pp. 267–274, 2002.
|
| 242 |
+
Diederik P Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. In Neural Information Processing Systems, 2021.
|
| 243 |
+
W. Bradley Knox and Peter Stone. TAMER: Training an Agent Manually via Evaluative Reinforcement. In International Conference on Development and Learning, 2008.
|
| 244 |
+
Kimin Lee, Hao Liu, Moonkyung Ryu, Olivia Watkins, Yuqing Du, Craig Boutilier, Pieter Abbeel, Mohammad Ghavamzadeh, and Shixiang Shane Gu. Aligning text-to-image models using human feedback. arXiv preprint arXiv:2302.12192, 2023.
|
| 245 |
+
Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. 2023.
|
| 246 |
+
Nan Liu, Shuang Li, Yilun Du, Antonio Torralba, and Joshua B Tenenbaum. Compositional visual generation with composable diffusion models. arXiv preprint arXiv:2206.01714, 2022.
|
| 247 |
+
Jacob Menick, Maja Trebacz, Vladimir Mikulik, John Aslanides, Francis Song, Martin Chadwick, Mia Glaese, Susannah Young, Lucy Campbell-Gillingham, Geoffrey Irving, and Nat McAleese. Teaching language models to support answers with verified quotes. arXiv preprint arXiv:2203.11147, 2022.
|
| 248 |
+
Shakir Mohamed, Mihaela Rosca, Michael Figurnov, and Andriy Mnih. Monte carlo gradient estimation in machine learning. The Journal of Machine Learning Research, 21(1):5183–5244, 2020.
|
| 249 |
+
Ashvin Nair, Murtaza Dalal, Abhishek Gupta, and Sergey Levine. Accelerating online reinforcement learning with offline datasets. arXiv preprint arXiv:2006.09359, 2020.
|
| 250 |
+
Reiichiro Nakano, Jacob Hilton, Suchir Balaji, Jeff Wu, Long Ouyang, Christina Kim, Christopher Hesse, Shantanu Jain, Vineet Kosaraju, William Saunders, Xu Jiang, Karl Cobbe, Tyna Eloundou, Gretchen Krueger, Kevin Button, Matthew Knight, Benjamin Chess, and John Schulman. Webgpt: Browser-assisted question-answering with human feedback. arXiv preprint arXiv:2112.09332, 2021.
|
| 251 |
+
Khanh Nguyen, Hal Daumé III, and Jordan Boyd-Graber. Reinforcement learning for bandit neural machine translation with simulated human feedback. In Empirical Methods in Natural Language Processing, 2017.
|
| 252 |
+
Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, 2021.
|
| 253 |
+
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, and Ryan Lowe. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155, 2022.
|
| 254 |
+
Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. CoRR, abs/1910.00177, 2019. URL https://arxiv.org/abs/1910.00177.
|
| 255 |
+
Jan Peters and Stefan Schaal. Reinforcement learning by reward-weighted regression for operational space control. In International Conference on Machine learning, 2007.
|
| 256 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
|
| 257 |
+
Aditya Ramesh, Mikhail Pavlov, Scott Gray Gabriel Goh, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. arXiv preprint arXiv:2102.12092, 2021.
|
| 258 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. Highresolution image synthesis with latent diffusion models. In IEEE Conference on Computer Vision and Pattern Recognition, 2022.
|
| 259 |
+
Nataniel Ruiz, Yuanzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. arXiv preprint arXiv:2208.12242, 2022.
|
| 260 |
+
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J Fleet, and Mohammad Norouzi. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022.
|
| 261 |
+
Arne Schneuing, Yuanqi Du, Arian Jamasb Charles Harris, Ilia Igashov, Weitao Du, Tom Blundell, Pietro Lió, Carla Gomes, Michael Bronstein Max Welling, and Bruno Correia. Structure-based drug design with equivariant diffusion models. arXiv preprint arXiv:2210.02303, 2022.
|
| 262 |
+
Chrisoph Schuhmann. Laion aesthetics, Aug 2022. URL https://laion.ai/blog/ laion-aesthetics/.
|
| 263 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, 2015.
|
| 264 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 265 |
+
Uriel Singer, Adam Polyak, Thomas Hayes, Xi Yin, Jie An, Songyang Zhang, Qiyuan Hu, Harry Yang, Oron Ashual, Oran Gafni, et al. Make-a-video: Text-to-video generation without text-video data. arXiv preprint arXiv:2209.14792, 2022.
|
| 266 |
+
Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, 2015.
|
| 267 |
+
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum? id=St1giarCHLP.
|
| 268 |
+
Nisan Stiennon, Long Ouyang, Jeffrey Wu, Daniel Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, and Paul F Christiano. Learning to summarize with human feedback. In Neural Information Processing Systems, 2020.
|
| 269 |
+
Richard S Sutton, David McAllester, Satinder Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In S. Solla, T. Leen, and K. Müller (eds.), Advances in Neural Information Processing Systems, volume 12. MIT Press, 1999. URL https://proceedings.neurips.cc/paper_files/paper/1999/file/ 464d828b85b0bed98e80ade0a5c43b0f-Paper.pdf.
|
| 270 |
+
Patrick von Platen, Suraj Patil, Anton Lozhkov, Pedro Cuenca, Nathan Lambert, Kashif Rasul, Mishig Davaadorj, and Thomas Wolf. Diffusers: State-of-the-art diffusion models. https: //github.com/huggingface/diffusers, 2022.
|
| 271 |
+
Zhendong Wang, Jonathan J Hunt, and Mingyuan Zhou. Diffusion policies as an expressive policy class for offline reinforcement learning. arXiv preprint arXiv:2208.06193, 2022.
|
| 272 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Reinforcement learning, pp. 5–32, 1992.
|
| 273 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi 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 the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 38–45, Online, October 2020. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2020.emnlp-demos. 6.
|
| 274 |
+
Tian Xie, Xiang Fu, Octavian-Eugen Ganea, Regina Barzilay, and Tommi S Jaakkola. Crystal diffusion variational autoencoder for periodic material generation. In International Conference on Learning Representations, 2021.
|
| 275 |
+
Jiazheng Xu, Xiao Liu, Yuchen Wu, Yuxuan Tong, Qinkai Li, Ming Ding, Jie Tang, and Yuxiao Dong. Imagereward: Learning and evaluating human preferences for text-to-image generation. arXiv preprint arXiv:2304.05977, 2023.
|
| 276 |
+
Minkai Xu, Lantao Yu, Yang Song, Chence Shi, Stefano Ermon, , and Jian Tang. GeoDiff: A geometric diffusion model for molecular conformation generation. In International Conference on Learning Representations, 2021.
|
| 277 |
+
Xiaohui Zeng, Arash Vahdat, Francis Williams, Zan Gojcic, Or Litany, Sanja Fidler, and Karsten Kreis. Lion: Latent point diffusion models for 3d shape generation. arXiv preprint arXiv:2210.06978, 2022.
|
| 278 |
+
Lvmin Zhang and Maneesh Agrawala. Adding conditional control to text-to-image diffusion models, 2023.
|
| 279 |
+
Tianyi Zhang, Varsha Kishore\*, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. BERTScore: Evaluating text generation with BERT. In International Conference on Learning Representations, 2020.
|
| 280 |
+
Linqi Zhou, Yilun Du, and Jiajun Wu. 3d shape generation and completion through point-voxel diffusion. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 5826–5835, 2021.
|
| 281 |
+
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.
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 7 (Reward model overoptimization) Examples of RL overoptimizing reward functions. (L) The diffusion model eventually loses all recognizable semantic content and produces noise when optimizing for incompressibility. $\mathbf { ( R ) }$ When optimized for prompts of the form “n animals”, the diffusion model exploits the VLM with a typographic attack (Goh et al., 2021), writing text that is interpreted as the specified number $n$ instead of generating the correct number of animals.
|
| 285 |
+
|
| 286 |
+
Section 6.1 highlights the optimization problem: given a reward function, how well can an RL algorithm maximize that reward? However, finetuning on a reward function, especially a learned one, has been observed to lead to reward overoptimization or exploitation (Gao et al., 2022) in which the model achieves high reward while moving too far away from the pretraining distribution to be useful.
|
| 287 |
+
|
| 288 |
+
Our setting is no exception, and we provide two examples of reward exploitation in Figure 7. When optimizing the incompressibility objective, the model eventually stops producing semantically meaningful content, degenerating into high-frequency noise. Similarly, we observed that LLaVA is susceptible to typographic attacks (Goh et al., 2021). When optimizing for alignment with respect to prompts of the form $^ { * 6 } n$ animals”, DDPO exploited deficiencies in the VLM by instead generating text loosely resembling the specified number: for example, “sixx ttutttas” above a picture of eight turtles.
|
| 289 |
+
|
| 290 |
+
There is currently no general-purpose method for preventing overoptimization. One common strategy is to add a KL-regularization term to the reward (Ouyang et al., 2022; Stiennon et al., 2020); we refer the reader to the concurrent work of Fan et al. (2023) for a study of KL-regularization in the context of finetuning text-to-image diffusion models. However, Gao et al. (2022) suggest that existing solutions, including KL-regularization, may be empirically equivalent to early stopping. As a result, in this work, we manually identified the last checkpoint before a model began to deteriorate for each method and used that as the reference for qualitative results. We highlight this problem as an important area for future work.
|
| 291 |
+
|
| 292 |
+
# APPENDIX B COMPARISON TO CLASSIFIER GUIDANCE
|
| 293 |
+
|
| 294 |
+
Classifier guidance (Dhariwal & Nichol, 2021) was originally introduced as a way to improve sample quality for conditional generation using the gradients from an image classifier. For a differentiable reward function such as the LAION aesthetics predictor (Schuhmann, 2022), one could naturally imagine an extension to classifier guidance that uses gradients from such a predictor to improve aesthetic score. The issue is that classifier guidance uses gradients with respect to the noisy images in the intermediate stages of the denoising process, which requires retraining the guidance network on
|
| 295 |
+
|
| 296 |
+
<table><tr><td>Method</td><td>Aesthetic Score</td></tr><tr><td>Base model</td><td>5.95± 0.03</td></tr><tr><td>Universal guidance</td><td>6.14 ± 0.05</td></tr><tr><td>DDPOIs @ 20k reward queries</td><td>6.63± 0.03</td></tr></table>
|
| 297 |
+
|
| 298 |
+
Table 1 Comparison of DDPO with universal guidance using the LAION aesthetic predictor. We report the mean and one standard error over 50 samples for the prompt “wolf”.
|
| 299 |
+
|
| 300 |
+
noisy images. Universal guidance (Bansal et al., 2023) sidesteps this issue by applying the guidance network to the fully denoised image predicted by the diffusion model at each step.
|
| 301 |
+
|
| 302 |
+
We compare DDPO with universal guidance in Table 1. We used the official implementation of universal guidance1 with the recommended hyperparameters for style transfer, substituting the guidance network with the LAION aesthetics predictor. While universal guidance is able to produce a statistically significant improvement in aesthetic score, the change is small compared to DDPO. We only report results averaged over 50 samples for a single prompt, since universal guidance is very slow; on an NVIDIA A100 GPU, it takes almost 2 minutes to generate a single image, whereas standard generation (e.g., from a DDPO-finetuned model) takes 4 seconds.
|
| 303 |
+
|
| 304 |
+
# APPENDIX C COMPARISON TO DPOK
|
| 305 |
+
|
| 306 |
+
Here we directly compare our implementation of DDPO to the results reported in the DPOK paper (Fan et al., 2023), which was developed concurrently with this work. The key similarities and differences between our experimental setups are summarized below:
|
| 307 |
+
|
| 308 |
+
• For this experiment only, we use Stable Diffusion v1-5 as the base model and train the UNet with low-rank adaptation (LoRA; Hu et al. (2021)) in order to match DPOK.
|
| 309 |
+
• Rather than matching the hyperparameters in DPOK, we use the same hyperparameters as in our other experiments (Appendix D.5) except for the learning rate which we increase to 3e-4. We found that when using LoRA, a higher learning rate is necessary to get comparable performance to full finetuning.
|
| 310 |
+
• Like DPOK, we train on four prompts: “a green colored rabbit” (color), “four wolves in the park” (count), “a dog and a cat” (composition), and “a dog on the moon” (location). Unlike DPOK, we train a single model for all four prompts.
|
| 311 |
+
• Like DPOK, we train the model using ImageReward (Xu et al., 2023) as the reward function. We evaluate the model using ImageReward and the LAION aesthetics predictor (Schuhmann, 2022).
|
| 312 |
+
• Unlike DPOK, we do not employ KL regularization.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 8 Comparison of $\mathrm { D D P O _ { I S } }$ with DPOK. We take the DPOK numbers directly from the paper, which only reports scores at one point in training (after $2 0 \mathrm { k }$ reward queries). Like in DPOK, scores are averaged over 50 samples for each prompt.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 9 Qualtitative examples of the results of ImageReward training on the DPOK prompts: “a green colored rabbit” (color), “four wolves in the park” (count), “a dog and a cat” (composition), and “a dog on the moon” (location). The finetuned images are generated from a model trained for $2 0 \mathrm { k }$ reward queries.
|
| 319 |
+
|
| 320 |
+
The results are presented in Figure 8. Our implementation of $\mathrm { D D P O _ { I S } }$ outperforms DPOK accross the board, without using KL regularization. Figure 8 also doubles as a quantitative study of overoptimization (Appendix A), since the model is trained with one reward function (ImageReward) and evaluated with another (LAION aesthetic score). We find that significant overoptimization does begin to happen within $2 5 \mathrm { k }$ reward queries for one of the prompts (count: “four wolves in the park”), which is reflected by a drop in LAION aesthetic score. However, the overoptimization is not severe or unreasonably fast. We provide qualitative samples in Figure 9 showing that the model is able to produce high-quality images at $2 0 \mathrm { k }$ reward queries.
|
| 321 |
+
|
| 322 |
+
# APPENDIX D IMPLEMENTATION DETAILS
|
| 323 |
+
|
| 324 |
+
For all experiments, we use Stable Diffusion v1.4 (Rombach et al., 2022) as the base model and finetune only the UNet weights while keeping the text encoder and autoencoder weights frozen.
|
| 325 |
+
|
| 326 |
+
# D.1 DDPO IMPLEMENTATION
|
| 327 |
+
|
| 328 |
+
We collect 256 samples per training iteration. For $\mathrm { \Delta D D P O _ { S F } }$ , we accumulate gradients across all 256 samples and perform one gradient update. For $\mathrm { D D P O _ { I S } }$ , we split the samples into 4 minibatches and perform 4 gradient updates. Gradients are always accumulated across all denoising timesteps for a single sample. For $\mathrm { D D P O _ { I S } }$ , we use the same clipped surrogate objective as in proximal policy optimization (Schulman et al., 2017), but find that we need to use a very small clip range compared to standard RL tasks. We use a clip range of 1e-4 for all experiments.
|
| 329 |
+
|
| 330 |
+
# D.2 RWR IMPLEMENTATION
|
| 331 |
+
|
| 332 |
+
We compute the weights for a training iteration using the entire dataset of samples collected for that training iteration. For $w _ { \mathrm { R W R } }$ , the weights are computed using the softmax function. For $w _ { \mathrm { s p a r s e } }$ , we use a percentile-based threshold, meaning $C$ is dynamically selected such that the bottom $p \%$ of a given pool of samples are discarded and the rest are used for training.
|
| 333 |
+
|
| 334 |
+
# D.3 REWARD NORMALIZATION
|
| 335 |
+
|
| 336 |
+
In practice, rewards are rarely used as-is, but instead are normalized to have zero mean and unit variance. Furthermore, this normalization can depend on the current state; in the policy gradient context, this is analogous to a value function baseline (Sutton et al., 1999), and in the RWR context, this is analogous to advantage-weighted regression (Peng et al., 2019). In our experiments, we normalize the rewards on a per-context basis. For DDPO, this is implemented as normalization by a running mean and standard deviation that is tracked for each prompt independently. For RWR, this is implemented by computing the softmax over rewards for each prompt independently. For $\mathrm { R W R } _ { \mathrm { s p a r s e } }$ this is implemented by computing the percentile-based threshold $C$ for each prompt independently.
|
| 337 |
+
|
| 338 |
+
# D.4 RESOURCE DETAILS
|
| 339 |
+
|
| 340 |
+
RWR experiments were conducted on a v3-128 TPU pod, and took approximately 4 hours to reach $5 0 \mathrm { k }$ samples. DDPO experiments were conducted on a v4-64 TPU pod, and took approximately 4 hours to reach $5 0 \mathrm { k }$ samples. For the VLM-based reward function, LLaVA inference was conducted on a DGX machine with 8 80Gb A100 GPUs.
|
| 341 |
+
|
| 342 |
+
D.5 FULL HYPERPARAMETERS
|
| 343 |
+
|
| 344 |
+
<table><tr><td></td><td></td><td>DDPOIS</td><td>DDPOSF</td><td>RWR</td><td>RWRsparse</td></tr><tr><td>Diffusion</td><td>Denoising steps (T) Guidance weight (w)</td><td>50 5.0</td><td>50 5.0</td><td>50 5.0</td><td>50 5.0</td></tr><tr><td>Optimization</td><td>Optimizer Learning rate Weight decay β E Gradient clip norm</td><td>AdamW 1e-5 1e-4 0.9 0.999 1e-8 1.0</td><td>AdamW 1e-5 1e-4 0.9 0.999 1e-8 1.0</td><td>AdamW 1e-5 1e-4 0.9 0.999 1e-8 1.0</td><td>AdamW 1e-5 1e-4 0.9 0.999 1e-8 1.0</td></tr><tr><td>RWR</td><td>Inverse temperature (β) Percentile Batch size Gradient updates per iteration Samples per iteration</td><td>=</td><td>=</td><td>0.2 1 128 400 10k</td><td>1 0.9 128 400 10k</td></tr><tr><td>DDPO</td><td>Batch size Samples per iteration Gradient updates per iteration Clip range</td><td>64 256 4 1e-4</td><td>256 256 1</td><td>=</td><td></td></tr></table>
|
| 345 |
+
|
| 346 |
+
# D.6 LIST OF 45 COMMON ANIMALS
|
| 347 |
+
|
| 348 |
+
This list was used for experiments with the aesthetic quality reward function and the VLM-based reward function.
|
| 349 |
+
|
| 350 |
+
<table><tr><td>cat deer lizard mouse pig</td><td>dog cow beetle rat turkey</td><td>horse goat ant snake fly</td><td>monkey lion butterfly turtle llama</td><td>rabbit tiger fish frog camel</td><td>zebra bear shark chicken bat</td><td>spider raccoon whale duck gorilla</td><td>bird fox dolphin goose hedgehog</td><td>sheep wolf squirrel bee kangaroo</td></tr></table>
|
| 351 |
+
|
| 352 |
+
# APPENDIX E ADDITIONAL DESIGN DECISIONS
|
| 353 |
+
|
| 354 |
+
# E.1 CFG TRAINING
|
| 355 |
+
|
| 356 |
+
Recent text-to-image diffusion models rely critically on classifier-free guidance (CFG) (Ho & Salimans, 2021) to produce perceptually high-quality results. CFG involves jointly training the diffusion model on conditional and unconditional objectives by randomly masking out the context c during training. The conditional and unconditional predictions are then mixed at sampling time using a guidance weight $w$ :
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\tilde { \epsilon } _ { \theta } ( \mathbf { x } _ { t } , t , \mathbf { c } ) = w \epsilon _ { \theta } ( \mathbf { x } _ { t } , t , \mathbf { c } ) + ( 1 - w ) \epsilon _ { \theta } ( \mathbf { x } _ { t } , t )
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
where $\epsilon _ { \theta }$ is the $\epsilon$ -prediction parameterization of the diffusion model (Ho et al., 2020) and $\tilde { \epsilon } _ { \theta }$ is the guided $\epsilon$ -prediction that is used to compute the next denoised sample.
|
| 363 |
+
|
| 364 |
+
For reinforcement learning, it does not make sense to train on the unconditional objective since the reward may depend on the context. However, we found that when only training on the conditional objective, performance rapidly deteriorated after the first round of finetuning. We hypothesized that this is due to the guidance weight becoming miscalibrated each time the model is updated, leading to degraded samples, which in turn impair the next round of finetuning, and so on. Our solution was to choose a fixed guidance weight and use the guided $\epsilon$ -prediction during training as well as sampling. We call this procedure CFG training. Figure 10 shows the effect of CFG training on $\mathrm { R W R } _ { \mathrm { s p a r s e } }$ ; it has no effect after a single round of finetuning, but becomes essential for subsequent rounds.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 10 (CFG training) We run the $\mathrm { R W R } _ { \mathrm { s p a r s e } }$ algorithm while optimizing only the conditional $\epsilon$ - prediction (without CFG training), and while optimizing the guided $\epsilon$ -prediction (with CFG training). Each point denotes a diffusion model update. We find that CFG training is essential for methods that do more than one round of interleaved sampling and training.
|
| 368 |
+
|
| 369 |
+
# E.2 INTERLEAVING
|
| 370 |
+
|
| 371 |
+
There are two main differences between DDPO and RWR, as compared in Section 6.1: the objective (DDPO uses the policy gradient) and the data distribution (DDPO is significantly more on-policy, collecting 256 samples per iteration as opposed to 10,000 for RWR). This choice is motivated by standard RL practice, in which policy gradient methods specifically require on-policy data (Sutton et al., 1999), whereas RWR is designed to work in on off-policy data (Nair et al., 2020) and is known to underperform other algorithms in more online settings (Duan et al., 2016).
|
| 372 |
+
|
| 373 |
+
However, we can isolate the effect of the data distribution by varying how interleaved the sampling and training are in RWR. At one extreme is a single-round algorithm (Lee et al., 2023), in which $N$ samples are collected from the pretrained model and used for finetuning. It is also possible to run $k$ rounds of finetuning each on $\frac { \mathbf { \dot { N } } } { k }$ samples collected from the most up-to-date model. In Figure 11, we evaluate this hyperparameter and find that increased interleaving does help up to a point, after which it causes performance degradation. However, RWR is still unable to match the asymptotic performance of DDPO at any level of interleaving.
|
| 374 |
+
|
| 375 |
+
# APPENDIX F QUANTITATIVE RESULTS FOR GENERALIZATION
|
| 376 |
+
|
| 377 |
+
In Section 6.3, we presented qualitative evidence of both the aesthetic quality model and the imageprompt alignment model generalizing to prompts that were unseen during finetuning. In Figure 12, we provide an additional quantitative analysis of generalization with the aesthetic quality model, where we measure the average reward throughout training for several prompt distributions. In accordance with the qualitative evidence, we see that the model generalizes very well to unseen animals, and everyday objects to a lesser degree.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 11 (RWR interleaving ablation) Ablation over the number of samples collected per iteration for RWR. The number of gradient updates per iteration remains the same throughout. We find that more frequent interleaving is beneficial up to a point, after which it causes performance degradation. However, RWR is still unable to match the asymptotic performance of DDPO at any level of interleaving.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 12 (Quantitative generalization) Reward curves demonstrating the generalization of the aesthetic quality objective to prompts not seen during finetuning. The finetuning prompts are a list of 45 common animals, “unseen animals” is a list of 38 additional animals, and “ordinary objects” is a list of 50 objects (e.g. toaster, chair, coffee cup, etc.).
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 13 (RWR samples)
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 14 (More image-prompt alignment samples)
|
| 390 |
+
|
| 391 |
+
# APPENDIX G MORE SAMPLES
|
| 392 |
+
|
| 393 |
+
Figure 13 shows qualitative samples from the baseline RWR method. Figure 14 shows more samples on seen prompts from DDPO finetuning with the image-prompt alignment reward function. Figure 15 shows more examples of generalization to unseen animals and everyday objects with the aesthetic quality reward function. Figure 16 shows more examples of generalization to unseen subjects and activities with the image-prompt alignment reward function.
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 15 (Aesthetic quality generalization)
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 16 (Image-prompt alignment generalization)
|
md/test/dtvJF1Vy2i/dtvJF1Vy2i.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/test/fYerSwf1Tb/fYerSwf1Tb.md
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HA W K E SVAE: SEQUENTIAL PATIENT EVENT SYNTHESIS FOR CLINICAL TRIALS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Generating sequential events data, such as adverse patient events, can provide valuable insights for clinical trial development, pharmaceutical research, patient modeling, and more. One approach to generate such data is by using generative AI models, which can synthesize data that resembles real-world data. However, in the domains such as clinical trials, patient data is especially limited. Data generation methods from literature such as LSTM, Probabilistic Auto-regressive, and Diffusion-based data generators struggle with this particular task off the shelf, as we show empirically. To address this task, we propose HawkesVAE, a Variational Autoencoder (VAE) that models events using Hawkes Processes (HP). Hawkes Processes are specialized statistical models designed specifically for the task of event and time-gap prediction, and VAEs enable an end-to-end generative design. Additionally, traditional VAEs rely solely on embeddings to decode events, but in a data-limited setting, this approach can have issues fitting the data. Therefore, we experiment with different ways of allowing the decoder to access varying amounts of information from the input events. Our experiments show that HawkesVAE outperforms other methods in terms of fidelity and allows the generation of highly accurate event sequences in multiple real-world sequential event datasets with only a small amount of external information. Furthermore, our empirical experiments demonstrate that HawkesVAE generates data that allows for superior utility over existing baselines while maintaining privacy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generating sequential event data with limited training data is a crucial area of research, especially in healthcare (Wang & Sun, 2022a; Das et al., 2023; Theodorou et al., 2023). Clinical trials provide an example where generating synthetic event data for patients is particularly useful, as real data is often inaccessible due to patient privacy and legal reasons. Thus, high-quality synthetic sequential event data can be of great value for machine learning applications and data analysis. Our primary objective is to develop an effective algorithm for generating sequential event data with limited training data. However, developing a high-quality model for sequential data can be more complicated than datarich tasks in computer vision or natural language processing. This is due to the diversity of individual features and the small training datasets available. Previous work in this area (Beigi et al., 2022; Shafquat et al., 2023) have generally focused on generating the static context information for each subject (e.g. subject demographics), while generating the sequential events has remained an elusive, yet vital next step in order to create a fully synthetic dataset.
|
| 12 |
+
|
| 13 |
+
Hawkes processes are statistical models that are specialized for event-type and time gap prediction (Hawkes, 1971), which has been shown to be highly effective at point process prediction when augmented with Transformer Layers (Zuo et al., 2020). Variational Autoencoders (VAEs) (Kingma & Welling, 2013) are a generative framework that specializes encoding an observed data into a probabilistic latent space $z$ that may be sampled. In our research, we demonstrate that combining the Hawkes Process with VAEs can successfully approximate sequential event generation, leading to state-of-the-art performance on our real-world data benchmarks.
|
| 14 |
+
|
| 15 |
+
To summarize our contributions,
|
| 16 |
+
|
| 17 |
+
1. We introduce HawkesVAE–a model that combines Variational Autoencoder $^ +$ Hawkes Process that is able to generate sequential event data with their time gaps on 7 real-world clinical trial datasets. Additionally, our generation supports a high level of control, allowing users to specify specific event types to generate. To our knowledge, we are the first to propose this method for synthetic sequential event generation.
|
| 18 |
+
2. We demonstrate that HawkesVAE outperforms the alternative approaches in terms of AUCROC for downstream ML classification designed for tabular data, including VAE+LSTM, PAR, and DDPM.
|
| 19 |
+
3. We conduct experiments demonstrating that HawkesVAE’s privacy with two metrics: ML Inference Score, which shows that synthetic event sequences are hard to distinguish from the original sequences, and Distance to Closest Record (DCR), which shows that synthetic sequences are not copies of the original data.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
Synthetic Data Generation as a research area has been quickly garnering attention from the research community, with examples such as CTGAN (Xu et al., 2019), CTabGan (Zhao et al., 2022), TabDDPM (Kotelnikov et al., 2023), the Synthetic Data Vault1 (Patki et al., 2016), and more. However, most of these models, such as TabDDPM and CTGAN, are focused on explicitly generating tabular data with no time component; or, in the case of SDV’s ParSynthesizer (Zhang et al., 2022a), it is relatively simple and may be approximated with a GRU or LSTM model. In related fields such as synthetic clinical trial data generation (Choi et al., 2017; Das et al., 2023; Wang et al., 2023b; Lu et al., 2023; Theodorou et al., 2023), the model usually only focuses on generating the order at which certain clinical events happen (i.e., the diagnosis code of next patient visit), as opposed to generating the specific times of the visits as well. While it would be possible to extend this line of previous work, we believe that is out of scope for this paper and should be considered as future work.
|
| 24 |
+
|
| 25 |
+
Hawkes Processes and VAEs have been somewhat explored in the past. However, we found disadvantages that limit application in a full synthetic data generation setting. Previous work explores variational Hawkes processes in the context of event prediction for (disease progression (Sun et al., 2021) and social events sequences Pan et al. (2020), but they rely on the context of previous ground truth observations as well as the hidden state, whereas we can generate a synthetic sequence of event types and times. Another work (Lin et al., 2021) explores using variational approaches to disentangle multivariate Hawkes Process for event type prediction, but it also relies on knowing the ground truth to predict the next timestep. Additionally, our model only requires a single embedding to synthesize a sequence, whereas they require an embedding at each timestep. Furthermore, none of these methods are able solely to consider specific event types to generate, which HawkesVAE supports.
|
| 26 |
+
|
| 27 |
+
# 3 PROBLEM SETUP
|
| 28 |
+
|
| 29 |
+
# 3.1 NEURAL HAWKES PROCESS
|
| 30 |
+
|
| 31 |
+
We are given a set of $L$ observations of the form (time $t _ { j }$ , event type $k _ { j }$ ). $\begin{array} { r l } { S } & { { } = } \end{array}$ $\{ ( t _ { 1 } , k _ { 1 } ) , \bar { \mathbf { \Phi } } \cdot \cdot \mathbf { \Phi } . , ( t _ { j } , k _ { j } ) , \dots \mathbf { \Phi } , ( t _ { L } , k _ { L } ) \}$ Each time $t _ { j } \in \mathbb { R } ^ { + } \bigcup \{ 0 \}$ and is sorted such that $t _ { j } < t _ { j + 1 }$ . Each event $k _ { j } \in \{ 1 , \ldots , K \}$ . The traditional Hawkes Process assumption that events only have a positive, decaying influence on future events is not realistic in practice, as there exist examples where an occurrence of an event lowers the probability of a future event (e.g., medication reduces the probability of adverse events). Therefore, the Neural Hawkes Process (Mei & Eisner, 2017) was proposed to generalize the traditional Hawkes Process. The following derivations follow (Zuo et al., 2020).
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\lambda ( t ) : = \sum _ { k = 1 } ^ { K } \lambda _ { k } ( t ) : = \sum _ { k = 1 } ^ { K } f _ { k } ( \boldsymbol W _ { k } ^ { \top } \boldsymbol h ( t ) ) = \sum _ { k = 1 } ^ { K } \beta _ { k } \log \left( 1 + e ^ { \frac { W _ { k } ^ { T } h ( t ) } { \beta _ { k } } } \right) ,
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\lambda ( t )$ is the intensity function for any event occurring, $\lambda _ { k } ( t )$ is the intensity function for the event $k \in \mathcal { K }$ occurring, $K = | { \cal { K } } |$ is the total number of event types, and $h ( t )$ are the hidden states of the event sequence obtained by a Transformer encoder and $\dot { W } _ { k } ^ { \top }$ are learned weights that calculate the significance of each event type at time $t$ . $f _ { k } ( c ) = \beta _ { k } \log ( 1 + e ^ { \frac { x } { \beta _ { k } } } )$ is the softplus function with parameter $\beta _ { k }$ . The output of $f _ { k } ( x )$ is always positive. Note that the positive intensity does not mean that the influence is always positive, as the influence of previous events are calculated through $W _ { k } ^ { \top } h ( t )$ . If there is an event occurring at time $t$ , then the probability of event $k$ is $P ( k _ { t } = k ) =$ $\frac { \lambda _ { k } ( t ) } { \lambda ( t ) }$
|
| 38 |
+
|
| 39 |
+
Let the history of all events before $t$ be represented by $\mathcal { H } _ { t } = \{ ( t _ { j } , k _ { j } ) , t _ { j } < t \}$ . The continuous time intensity for prediction is defined as
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\lambda ( t | \mathcal { H } _ { t } ) : = \sum _ { k = 1 } ^ { K } \lambda _ { k } ( t | \mathcal { H } _ { t } ) : = \sum _ { k = 1 } ^ { K } f _ { k } \left( \alpha _ { k } \frac { t - t _ { j } } { t _ { j } } + W _ { k } ^ { \top } h ( t _ { j } ) + \mu _ { k } \right) ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where time is defined on interval $[ t _ { j } , t _ { j + 1 } )$ , $f _ { k }$ is the softplus function as before, $\alpha _ { k }$ is a learned importance of the interpolation between the two observed timesteps $t _ { j }$ and $t _ { j + 1 }$ . Note that when $t = t _ { j }$ , $\alpha _ { k }$ does not matter as the influence is 0 (intuitively, this is because we know that this event exists, so there is no need to estimate anything). The history of all previous events up to time $t$ is represented by $t _ { j }$ . $\boldsymbol { W } _ { k } ^ { \top }$ are weights that convert this history to a scalar. $\mu _ { k }$ is the base intensity of event $k$ . Therefore, the probability of $p ( t | \mathcal { H } _ { t _ { j } } )$ is the intensity at $t \in [ t _ { j } , t _ { j + 1 } )$ given the history $\mathcal { H } _ { t }$ and the probability that no other events occur from the interval $( t _ { j } , t )$
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
p ( t | \mathcal { H } _ { t _ { j } } ) = \lambda ( t | \mathcal { H } _ { t } ) \exp \left( - \int _ { t _ { j } } ^ { t } \lambda ( t ^ { \prime } | \mathcal { H } _ { t ^ { \prime } } ) d t ^ { \prime } \right) .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Note that if $t _ { j }$ is the last observation, then $t _ { j + 1 } = \infty$ . Finally, the next time value $\hat { t } _ { j + 1 }$ and event prediction $\hat { k } _ { j + 1 }$ is given as
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\hat { t } _ { j + 1 } = \int _ { t _ { j } } ^ { \infty } t \cdot p ( t | \mathcal { H } _ { t } ) d t , \quad \hat { k } _ { j + 1 } = \arg \operatorname* { m a x } _ { k } \frac { \lambda _ { k } ( t _ { j + 1 } | \mathcal { H } _ { t _ { j + 1 } } ) } { \lambda ( t _ { j + 1 } | \mathcal { H } _ { t _ { j + 1 } } ) }
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
For training, we want to maximize the likelihood of the observed sequence $\{ ( t _ { 1 } , k _ { 1 } ) , \ldots , ( t _ { L } , k _ { L } ) \}$ The log-likelihood function is given by2
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\ell ( \{ ( t _ { 1 } , k _ { 1 } ) , \ldots , ( t _ { L } , k _ { L } ) \} ) = \sum _ { j = 1 } ^ { L } \log ( \lambda ( t _ { j } | \mathcal { H } _ { t _ { j } } ) ) - \int _ { t _ { 1 } } ^ { t _ { L } } \lambda ( t | \mathcal { H } _ { t } ) d t .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Finally, since the gradient of the log-likelihood function has an intractable integral, one may obtain an unbiased estimate by performing Monte Carlo sampling (Robert et al., 1999).
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\nabla \left[ \int _ { t _ { 1 } } ^ { t _ { L } } \lambda ( t | \mathcal { H } _ { t } ) d t \right] _ { M C } = \sum _ { j = 2 } ^ { L } ( t _ { j } - t _ { j - 1 } ) ( \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \nabla \lambda ( u _ { i } ) )
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
With $\begin{array} { r } { u _ { i } \sim U n i f o r m ( t _ { j - 1 } , t _ { j } ) . \nabla \lambda ( u _ { i } ) } \end{array}$ is fully differentiable with respect to $u _ { i }$
|
| 70 |
+
|
| 71 |
+
# 4 HA W K E SVAE
|
| 72 |
+
|
| 73 |
+
Figure 1 shows an example of the proposed model with all optional structural constraints (allowing the model to access the true event knowledge, such as type and event length information). A diagram of the model without such additions is shown in Figure 3 in the Appendix. To combine the VAE and the Hawkes Process, we realize that the log-likelihood can be modeled as the log-likelihood of a Hawkes process if we assume that the event times and event types are generated from a multinomial Gaussian, i.e., the combined loss may be written as the following.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 1: Diagram of the HawkesVAE Encoder-Decoder structure where. Here, the model input is the real patient event sequence $^ +$ time, which is used to train a VAE model to the same output event sequence $^ +$ time. The event sequence length for each event (if not known) is predicted as well. Optional inputs (in dashed lines) include the ground truth knowledge of which event types to generate and/or event lengths. The input observations are encoded first by a specific event encoder (Hawkes, LSTM, etc), and then embeddings are mapped to the patient embedding space via an MLP. The opposite process occurs for decoding from the patient embedding.
|
| 77 |
+
|
| 78 |
+
Sample event sequence $S _ { z } \sim P _ { \theta } ( S | z )$ where $S _ { z } = \{ ( t _ { 1 } , k _ { 1 } ) , \ldots , ( t _ { j } , k _ { j } ) , \ldots , ( t _ { L _ { z } } , k _ { L _ { z } } ) \}$ . Then $H _ { t , z }$ denotes the history up to time $t$ in $S _ { z }$ .
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\lambda _ { \theta } ( t | \mathcal { H } _ { t , z } ) : = \sum _ { k = 1 } ^ { K } \lambda _ { \theta , k } ( t | \mathcal { H } _ { t , z } ) : = \sum _ { k = 1 } ^ { K } f _ { k } \left( \alpha _ { k } \frac { t - t _ { j } } { t _ { j } } + W _ { \theta , k } ^ { \top } h _ { \theta } ( t _ { j } ) + \mu _ { \theta , k } \right) ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
Where $t \in [ t _ { j } , t _ { j + 1 } )$ . That is, $t$ lies between the $j$ th and $j + 1$ th observation in $S _ { z }$ (if $t _ { j }$ is the last observation, then $t _ { j + 1 } = \infty$ ). $\lambda _ { \theta , k }$ , $\boldsymbol { W } _ { \boldsymbol { \theta } , k } ^ { \top }$ , and $h _ { \theta } ^ { \top }$ are the same as the Neural Hawkes Process, only parameterized by $\theta$ .
|
| 85 |
+
|
| 86 |
+
The log-likelihood is:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\ln P _ { \theta } ( S _ { z } | z ) = \sum _ { j = 1 } ^ { L _ { z } } \log ( \lambda _ { \theta } ( t _ { j } | \mathcal { H } _ { t _ { j } , z } ) ) - \int _ { t _ { 1 } } ^ { t _ { L _ { z } } } \lambda _ { \theta } ( t | \mathcal { H } _ { t , z } ) d t .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Adding the VAE ELBO loss (Appendix A.7), the combined HawkesVAE loss is:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
L _ { \theta , \phi } = \mathbb { E } _ { z \sim q _ { \phi } ( \cdot | S _ { z } ) } \left[ \ln P _ { \theta } ( S _ { z } | z ) \right] - D _ { K L } ( q _ { \phi } ( \cdot | S _ { z } ) | | P _ { \theta } ( \cdot | S _ { z } ) ) .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
# 4.1 KEY DETAILS
|
| 99 |
+
|
| 100 |
+
Encoding and Decoding Hawkes Processes The encoder model $-$ takes in the original event types and times, and predicts the mean and standard deviation to sample $\cdot$ $N o r m a l ( \hat { \mu } , \hat { \sigma } )$ . This is used for $\cdot$ in the loss function and follows the previous Transformer Hawkes Process implementation of a transformer encoder, with alternating sine and cosine waves to denote temporal information as specified in Vaswani et al. (2017).
|
| 101 |
+
|
| 102 |
+
However, the decoder model is more complicated. Hawkes Process is usually evaluated via one prediction step at a time (i.e., the input is the ground truth time-step and event type, and the task is to predict the next time step and event type). For our purposes, we need to adapt this into an autoregressive decoding scheme similar to the language modeling task.
|
| 103 |
+
|
| 104 |
+
At training time, the input to the decoder $-$ is hidden vector $\cdot$ and a sequence of ground truth event types and times. It is tasked with predicting the next event type $\cdot$ , next event time $\cdot$ , and the λs necessary to compute $P _ { \theta } ( \cdot | S _ { z } )$ . Furthermore, we follow Transformer Hawkes Process’s approach of also adding mean squared error losses to the time: time loss $\cdot$ $\cdot$ and cross-entropy loss of the predicted $\begin{array} { r } { t y p e \_ l o s s = - \sum _ { c = 1 } ^ { | K | } k \log ( p _ { k } ) } \end{array}$
|
| 105 |
+
|
| 106 |
+
At inference time, the input to decoder is only $z$ , and we auto-regressively decode the predicted event types and times. To predict next time and event tuple $\cdot$ , the input is the previously predicted times and events $-$ . (each predicted time and event is repeatedly appended to the input). We find that auto-regressive greedy sampling $\hat { k } = \arg \operatorname* { m a x } ( \hat { k } )$ of the next event type does not result in good sequences, and probabilistic sampling based on the raw logit score will result in higher utility sequences. Finally, we note that we can control for generating events that are similar to the original patient by first encoding the original patient, and then sampling around it, a benefit of the probabilistic nature of the VAE latent space $z$ . Otherwise, it would be impossible to correspond the original labels to the synthetic data.
|
| 107 |
+
|
| 108 |
+
Event Type Information In addition to proposing HawkesVAE, we also propose several variants of it. In some applications, such as clinical trial patient modelling (Wang & Sun, 2022a; Fu et al., 2022; Das et al., 2023), we may be interested in an event sequence with the event types known, that is, the model only needs to generate the timestamps at which events occur. This is to address the concern of subject fidelity–that is–the generated subject must be significantly similar to the original subject in order for the generated data to be useful; therefore, knowing which events occur in a subject to generate a similar subject would not be unreasonable. The “Events Known” model was created to enforce ONLY simulating specific events, without consideration of all events (which may be irrelevant and confuse the generator).
|
| 109 |
+
|
| 110 |
+
To accommodate this framework, we train num event Transformer Hawkes Process expert encoders and decoders that only model a single event. Since event type is known, we may index into the specific encoder/decoder pair as given by the event index (shown in Figure 1). Finally, all independent event time predictions over all known types are combined via their predicted event times to create a final multi-event sequence prediction. Since the VAE model requires a single embedding to sample a latent vector, we sum the patient embedding output of all expert event encoders, and pass this joint embedding to the expert decoders. The decoder is trained to generate the predicted time and type sequence of its respective expert event.
|
| 111 |
+
|
| 112 |
+
Note that we have the sum the latent patient embeddings of the expert decoders due to the limitation of having a fully generative model. It would be unfair for to have varying size latent spaces for each patient.
|
| 113 |
+
|
| 114 |
+
Sequence Length Prediction Given known subset of events $\kappa ^ { \prime } \in \kappa$ , we generate event sequences such that ${ \cal { S } } = \{ ( t _ { j } , k _ { j } ) ; j = 1 , \ldots , L ; k _ { j } \in { \cal { K } } ^ { \prime } \}$ , where $L$ is learned from the data. Note that by default, all HawkesVAE variants autoregressively continue to predict event types and times until it reaches its own predicted stopping length. Like other synthesizers (Zhang et al., 2022a), we also experiment with using a max-length criterion, such that the event generation still stops at a certain $L$ . We explore 2 cases. (1) If the event type is not known, we simply generate sequence $S =$ $\{ ( t _ { j } , k _ { j } ) ; j = 1 , \ldots , L ^ { \prime } \}$ where $L ^ { \prime }$ is a prespecified sequence length. (2) If the event type is known, then we allow the model to know the specific max lengths $L _ { k } ^ { \prime }$ for each specific event type. Let $L ^ { \prime } =$ $\textstyle \sum _ { k _ { i } \in K ^ { \prime } } L _ { k _ { i } } ^ { \prime }$ We then generate a sequence $S = \{ ( t _ { j } , k _ { j } ) ; \stackrel { \sim } { j } = 1 , \ldots , L ^ { \prime } ; \left( \sum _ { j = 1 } ^ { L ^ { \prime } } 1 ( k _ { j } = k _ { i } ) \right) =$ $L _ { k _ { i } } ^ { \prime } ; \forall k _ { i } \in \mathcal { K } ^ { \prime } \}$
|
| 115 |
+
|
| 116 |
+
# 5 EXPERIMENTS
|
| 117 |
+
|
| 118 |
+
Datasets We evaluated our models on 7 real-world clinical trial outcome datasets obtained from Project Data Sphere3 (Green et al., 2015; Fu et al., 2022). Specifically, we chose the trials as outlined in Table 1. These datasets have shown to be effective evaluation datasets for tabular prediction (Wang & Sun, 2022b; Wang et al., 2023a) and digital twin generation (Das et al., 2023). Specifically, we use
|
| 119 |
+
|
| 120 |
+
Table 1: A description of all of the real-world datasets used in the evaluation. All trial data was obtained from Project Data Sphere (Green et al., 2015). Num Rows refers to the raw number of data points in the trial. Num Subj refers to the total number of patients. Num Events denotes the total number of unique events. Events / Subj denotes the average number of events that a patient experiences. Positive Label Proportion denotes the percentage of patients that did not experience the death event.
|
| 121 |
+
|
| 122 |
+
<table><tr><td>Dataset</td><td>Description</td><td>Num Rows</td><td>Num Subj</td><td></td><td>Num EventsEvents /Subj</td><td>PositveLabel</td></tr><tr><td>NCT00003299</td><td>LsmalICceIr</td><td>20210</td><td>548</td><td>34</td><td>36.880</td><td>0.951</td></tr><tr><td>NCT00041119</td><td>Breast Cancer</td><td>2983</td><td>425</td><td>150</td><td>7.019</td><td>0.134</td></tr><tr><td>NCT00079274</td><td>Colon Cancer</td><td>316</td><td>70</td><td>18</td><td>4.514</td><td>0.184</td></tr><tr><td>NCT00174655</td><td>Breast Cancer</td><td>7002</td><td>953</td><td>21</td><td>7.347</td><td>0.019</td></tr><tr><td>NCT00312208</td><td>Breast Cancer</td><td>2193</td><td>378</td><td>182</td><td>5.802</td><td>0.184</td></tr><tr><td>NCT00694382</td><td>Venous Thromboembolism in Cancer Patients</td><td>7853</td><td>803</td><td>746</td><td>9.780</td><td>0.456</td></tr><tr><td>NCT03041311</td><td>LsmalICel</td><td>1043</td><td>47</td><td>207</td><td>22.192</td><td>0.622</td></tr></table>
|
| 123 |
+
|
| 124 |
+
NCT00003299 (Niell et al., 2005), NCT00041119 (Baldwin et al., 2012), NCT00079274 (Alberts et al., 2012), NCT00174655 (Fernandez-Cuesta et al.´ , 2012), NCT00312208 (Mackey et al., 2016), NCT00694382 (Agnelli et al., 2012), NCT03041311 (Daniel et al., 2021). A full description of the data is shown in Table 1. Each dataset contains events and the times at which they occur, e.g. medications, procedures, as well as some adverse events like vomiting, etc. We use these datasets to predict if the subject experiences the death event, which is an external label. Note that HawkesVAE does not require a fixed patient event sequence length.
|
| 125 |
+
|
| 126 |
+
Models to Compare We compared the following models:
|
| 127 |
+
|
| 128 |
+
1. LSTM VAE: To compare against a VAE baseline, we manually implement our own LSTM VAE, which predicts the event type as a categorical classification task and the timestamp as a regression task at each event prediction.
|
| 129 |
+
|
| 130 |
+
2. PARSynthesizer from SDV (Zhang et al., 2022a; Patki et al., 2016) since it is the most relevant model for synthesizing sequential event data, based on a conditional probabilistic auto-regressive (CPAR) model. To the best of our knowledge, no other models specifically handle sequential event data generation from scratch with easily accessible code.
|
| 131 |
+
|
| 132 |
+
3. DDPM (Kotelnikov et al., 2023) is a recently proposed state-of-the-art general tabular synthesizer based on diffusion models. Although it is not explicitly built for sequential data, we are able to enhance it by adding time as a numerical column. This model also outperforms CTGAN-related models $\mathrm { X u }$ et al. (2019); Zhao et al. (2021; 2022), the previous go-to for synthetic tabular data generation. We believe that this is a strong, representative baseline of general tabular synthetic data generation.
|
| 133 |
+
|
| 134 |
+
3. HawkesVAE (Multivariate) is the VAE $^ +$ Multivariate Hawkes Process that is trained without any assumptions. At training time, the task is to predict the next event and timestamp given a history of observations. At inference time, we perform autoregressive decoding, adding the last prediction to the history until a predicted cutoff is reached.
|
| 135 |
+
|
| 136 |
+
4. HawkesVAE (Events Known) assumes that one knows which specific events occur for the Hawkes Model (but not the timestamps or the number of occurrences). Similar to HawkesVAE (Multivariate), training is performed by predicting the next event and timestamp given history, and autoregressive decoding is done at inference time until a predicted cutoff.
|
| 137 |
+
|
| 138 |
+
Additionally, we attempted to implement HALO (Theodorou et al., 2023), a hierarchical autoregressive language model that achieved state-of-the-art performance for Electronic Health Record (EHR)
|
| 139 |
+
|
| 140 |
+
synthesis, but was not able to obtain representative results on the clinical trial evaluation datasets, primarily due to the small size of training data, demonstrating the difficulty of this task.
|
| 141 |
+
|
| 142 |
+
# 5.1 UTILITY EVALUATION
|
| 143 |
+
|
| 144 |
+
We evaluate the utility (ROCAUC) of the generated synthetic data by performing binary classification of death events in all 7 clinical trials. The standard deviation of each ROCAUC score is calculated via bootstrapping ( $\cdot$ bootstrapped test datapoints). Training is performed completely on synthetic data by matching each generated patient to its ground truth death event label. Testing is performed on the original held-out ground truth split. For the Original Data baseline, we performed 5 cross validations on 80/20 train test splits of the real data. The main results are shown in Table 2. We see that synthetic data generated by HawkesVAE variants generally perform the best in terms of downstream death event classification performance, where HawkesVAE (Multivariate) outperforms the next best model (in 4/7 datasets and is within 1 standard deviation with the rest of the datasets). Allowing the model access to the specific types also enables it to significantly outperform other baselines. Occasionally, synthetic data is able to support better performance than the original dataset on downstream tasks (this behavior is also seen in TabDDPM). We believe that this is due to the synthetic model generating examples that are more easily separable and/or more diverse than real data. However, this is only a hypothesis and should be investigated further in future research, but we are encouraged to see that our proposed method captures this behavior. Additionally, some examples of an (anonymized) generated sequence can be seen in Figure 2.
|
| 145 |
+
|
| 146 |
+
Table 2: Binary classification ROCAUCs (↑ higher the better, $\cdot$ standard deviation) of a downstream LSTM trained on data generated from the HawkesVAE models as well as the original data and baselines. Note that the LSTM and the HawkesVAE models estimate their own sequence length. HawkesVAE (Events Known) is put in a separate category due to its requirement of event type information. Bolded indicates original data mean within 1 standard deviation.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Dataset</td><td>Original Data</td><td>LSTM VAE</td><td>PAR</td><td>DDPM</td><td>Hawkes (Multivariate)</td><td>Hawkes (Events Known)</td></tr><tr><td>NCT00003299</td><td></td><td>0.689 ± 0.105 0.563 ± 0.053</td><td>0.504 ± 0.066</td><td>0.557 ± 0.055</td><td>0.572 ± 0.051</td><td>0.709 ± 0.049</td></tr><tr><td>NCT00041119</td><td>0.678± 0.078 0.617 ± 0.036</td><td></td><td>0.573 ± 0.043</td><td>0.630 ± 0.045</td><td>0.646 ± 0.037</td><td>0.665 ± 0.045</td></tr><tr><td>NCT00079274</td><td>0.637 ± 0.140</td><td>0.481 ± 0.092</td><td>0.567 ± 0.096</td><td>0.583 ± 0.098</td><td>0.622 ± 0.016</td><td>0.653 ± 0.019</td></tr><tr><td>NCT00174655</td><td>0.660 ± 0.128</td><td>0.535 ± 0.073</td><td>0.523 ± 0.074</td><td>0.513 ± 0.078</td><td>0.548 ± 0.024</td><td>0.594 ± 0.068</td></tr><tr><td>NCT00312208</td><td>0.632 ± 0.072 0.454 ± 0.039</td><td></td><td>0.463 ±0.039</td><td>0.503 ± 0.043</td><td>0.590 ± 0.050</td><td>0.634 ± 0.032</td></tr><tr><td>NCT00694382</td><td>0.640 ± 0.038</td><td>0.490 ± 0.019</td><td>0.549± 0.022</td><td>0.531 ± 0.021</td><td>0.568 ± 0.018</td><td>0.625 ± 0.020</td></tr><tr><td>NCT03041311</td><td>0.738 ± 0.149</td><td>0.563 ± 0.097</td><td>0.507 ± 0.087</td><td>0.574 ± 0.096</td><td>0.689 ± 0.084</td><td>0.755 ± 0.059</td></tr></table>
|
| 149 |
+
|
| 150 |
+
# 5.2 PRIVACY EVALUATIONS
|
| 151 |
+
|
| 152 |
+
ML Inference Score: We first calculate the performance of predicting whether a generated sequence is real vs synthetic via an LSTM binary classification (Patki et al., 2016). The real subjects are labelled with ”0” and the synthetic subjects are labelled with ”1”. Results are shown in Table 3, and we see that HawkesVAE variants perform closest to the optimal 0.5 ROCAUC ideal score. One thing to note is that a perfect copy of the original data would result in a 0.5 score, so we have the following metric to measure the opposite scenario.
|
| 153 |
+
|
| 154 |
+
Distance to Closest Record (DCR) Score: Second, we follow the evaluation metrics per TabDDPM (Kotelnikov et al., 2023). That is, we compare the feature vectors of the real vs synthetic data, and measure how far the synthetic data is from the original. The higher this distance is, the more different the generated data is from the original data, and thus the more private it is. A completely different version of the data would obtain the highest distance, but could result in bad performance in the downstream LSTM classification performance or a high ML Inference score (close to 1). We calculate this by featurizing the event time predictions in terms of (count, means, and standard deviations). Then, we normalize and obtain the L2 distance between a generated subject and the closest real subject. Table 4 shows this result. Notice that HawkesVAE variants generally obtain quite low scores on this metric. DDPM and PAR also generate data closer to the original data compared to LSTM VAE. We note the privacy-fidelity tradeoff, as LSTM VAE generates data that is further away from the original, but yields worse utility (Table 2).
|
| 155 |
+
|
| 156 |
+
Table 3: Results of ML Inference Score: LSTM binary classification of real vs synthetic (the closer to 0.5 the score is, the better). Standard deviation calculated via bootstrapping is shown via $\pm$ . AUCROC scores are shown. HawkesVAE (Events Known) is put in a separate category due to its requirement of event type info.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Dataest</td><td>LSTMVAE</td><td>PAR</td><td>DDPM</td><td>HawkesVAE (Multivariate)</td><td>HawkesVAE (Events Known)</td></tr><tr><td>NCT00003299</td><td>1.000 ± 0.000</td><td>0.968 ± 0.010</td><td>0.762 ± 0.024</td><td>0.792 ± 0.019</td><td>0.689 ± 0.020</td></tr><tr><td>NCT00041119</td><td>0.932 ± 0.017</td><td>0.998 ± 0.002</td><td>0.926 ± 0.017</td><td>0.726 ± 0.015</td><td>0.768 ± 0.021</td></tr><tr><td>NCT00079274</td><td>1.000 ± 0.000</td><td>0.807 ± 0.082</td><td>0.894 ± 0.050</td><td>0.733 ± 0.012</td><td>0.701 ± 0.054</td></tr><tr><td>NCT00174655</td><td>1.000 ± 0.000</td><td>0.999 ± 0.001</td><td>0.998 ± 0.001</td><td>0.696 ± 0.008</td><td>0.593 ± 0.023</td></tr><tr><td>NCT00312208</td><td>0.994 ± 0.007</td><td>0.874 ± 0.026</td><td>0.729 ± 0.035</td><td>0.712 ± 0.024</td><td>0.693 ± 0.038</td></tr><tr><td>NCT00694382</td><td>1.000 ± 0.000</td><td>0.923 ± 0.012</td><td>0.992 ± 0.005</td><td>0.891± 0.014</td><td>0.856 ± 0.016</td></tr><tr><td>NCT03041311</td><td>1.000 ± 0.000</td><td>0.651 ± 0.112</td><td>0.374 ± 0.121</td><td>0.573 ± 0.111</td><td>0.477 ± 0.127</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 4: Distance to Closest Record (DCR) Score. Note that this score only tells part of the picture. The higher this score is, the larger the difference between the synthetic data and the original data. The lower the score, the more similar the synthetic data is to the original data.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Dataset</td><td>LSTM VAE</td><td>PAR</td><td>DDPM</td><td>HawkesVAE (Multivariate)</td><td>HawkesVAE (Events Known)</td></tr><tr><td>NCT00003299</td><td>3.700</td><td>2.647</td><td>1.426</td><td>2.256</td><td>1.138</td></tr><tr><td>NCT00041119</td><td>4.677</td><td>4.633</td><td>1.007</td><td>3.251</td><td>0.612</td></tr><tr><td>NCT00079274</td><td>2.732</td><td>1.977</td><td>1.346</td><td>1.618</td><td>1.675</td></tr><tr><td>NCT00174655</td><td>32.185</td><td>56.915</td><td>3.581</td><td>2.110</td><td>1.215</td></tr><tr><td>NCT00312208</td><td>87.015</td><td>2.348</td><td>1.207</td><td>1.535</td><td>0.745</td></tr><tr><td>NCT00694382</td><td>17.946</td><td>35.362</td><td>1.059</td><td>2.125</td><td>0.971</td></tr><tr><td>NCT03041311</td><td>36.740</td><td>37.723</td><td>4.662</td><td>5.565</td><td>4.922</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 5.3 ABLATIONS
|
| 165 |
+
|
| 166 |
+
Assuming Knowledge of Event Lengths In this section, we examine the ability of our framework to take in additional subject-level information regarding sequence generation. For example, HawkesVAE assumes that we have access to the original event lengths (e.g., event 1 occurs 5 times in the original sequence, generate the times at which event 1 occurs), as well as the event indices (e.g., we know that subject 1 has events 2,5,6). For more details, see Section 4.1. Table 5 shows the result of allowing the model to know how many times events occur (for HawkesVAE (Events Known)) or how the total length of the sequence to be generated (for HawkesVAE (Multivariate) and LSTM VAE). We see that providing the model with a list of event types that occur boosts performance significantly, as HawkesVAE (Events Known) performs markedly better than the other models.
|
| 167 |
+
|
| 168 |
+
Table 5: AUCROC results ( $\cdot$ higher the better, $\pm$ standard deviation) from fitting a downstream LSTM to predict death event from the ablation of informing of the exact length of the sequence to generate.
|
| 169 |
+
|
| 170 |
+
<table><tr><td>Dataset</td><td>Original Data</td><td>LSTM</td><td>Hawkes (Multivariate)</td><td>Hawkes (Events Known)</td></tr><tr><td>NCT00003299</td><td>0.689 ± 0.105</td><td>0.485 ± 0.050</td><td>0.574 ± 0.071</td><td>0.761 ± 0.038</td></tr><tr><td>NCT00041119</td><td>0.678 ± 0.078</td><td>0.613 ± 0.037</td><td>0.643 ± 0.039</td><td>0.652 ± 0.042</td></tr><tr><td>NCT00079274</td><td>0.637±0.140</td><td>0.403 ± 0.094</td><td>0.632 ± 0.017</td><td>0.654 ± 0.098</td></tr><tr><td>NCT00174655</td><td>0.670 ± 0.128</td><td>0.560 ± 0.053</td><td>0.557 ± 0.057</td><td>0.618 ± 0.053</td></tr><tr><td>NCT00312208</td><td>0.632 ± 0.072</td><td>0.437 ± 0.040</td><td>0.589 ± 0.041</td><td>0.624 ± 0.037</td></tr><tr><td>NCT00694382</td><td>0.640 ± 0.038</td><td>0.496 ± 0.021</td><td>0.585 ± 0.022</td><td>0.642 ± 0.022</td></tr><tr><td>NCT03041311</td><td>0.738 ± 0.149</td><td>0.608 ± 0.092</td><td>0.717 ± 0.083</td><td>0.860 ± 0.056</td></tr></table>
|
| 171 |
+
|
| 172 |
+
HawkesVAE for Event Forecasting The results in Table 6 show that the HawkesVAE variants are generally significantly better than their other counterparts in terms of event forecasting. Note that it is possible for HawkesVAE (Events Known) not to have perfect accuracy in terms of event prediction because the time prediction may be incorrect, and therefore, the predicted ordering of the events could not match the original ordering.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 2: Example of a generated sequence from HawkesVAE (Events Known) from NCT00003299 0 10 20 30 40 50 60 70 80 splotted by the individual events. The blue dots denoting the specific event timestamp prediction. The ralgired dots are the ground truth timestamps and the ground truth predictions. Each prediction is linked /arthwith dashed lines for clarity.
|
| 176 |
+
|
| 177 |
+
Table 6: Accuracy of HawkesVAE for Event Forecasting (↑ higher the better, $\pm$ standard deviation). A correct prediction is made if raw predicted event matches the original event in the ordering 0 10 20 30 40 50 60 70 80 r respectively. Note that HawkesVAE (Events Known) is a special case since it only needs to laddgenerate event types from a given event list.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Dataset</td><td>LSTMVAE</td><td>PAR</td><td>DDPM</td><td>HawkesVAE (Multivarate)</td><td>HawkesVAE (Events Known)</td></tr><tr><td>NCT00003299</td><td>0.043 ± 0.047</td><td>0.052 ± 0.048</td><td>0.056 ± 0.054</td><td>0.023 ± 0.034</td><td>0.602 ± 0.085</td></tr><tr><td>NCT00041119</td><td>0.001 ± 0.013</td><td>0.110 ± 0.151</td><td>0.339 ± 0.283</td><td>0.357 ± 0.012</td><td>0.848 ± 0.228</td></tr><tr><td>NCT00079274</td><td>0.028 ± 0.074</td><td>0.073 ± 0.145</td><td>0.376 ± 0.255</td><td>0.406 ± 0.101</td><td>0.765 ± 0.234</td></tr><tr><td>NCT00174655</td><td>0.134 ± 0.062</td><td>0.093 ± 0.144</td><td>0.117 ± 0.005</td><td>0.158 ± 0.340</td><td>0.992 ± 0.055</td></tr><tr><td>NCT00312208</td><td>0.002 ± 0.022</td><td>0.037 ± 0.112</td><td>0.154 ± 0.225</td><td>0.102 ± 0.031</td><td>0.530 ± 0.294</td></tr><tr><td>NCT00694382</td><td>0.000 ± 0.005</td><td>0.015 ± 0.053</td><td>0.033 ± 0.168</td><td>0.051 ± 0.009</td><td>0.360± 0.267</td></tr><tr><td>NCT03041311</td><td>0.000 ± 0.005</td><td>0.036 ± 0.051</td><td>0.130 ± 0.133</td><td>0.140 ± 0.013</td><td>0.265 ± 0.215</td></tr></table>
|
| 180 |
+
|
| 181 |
+
# 6 DISCUSSION
|
| 182 |
+
|
| 183 |
+
0 10 20 30 40 50 60 70 80 Time Creating sequential events and data of significance is crucial for advancing clinical trial development, pharmaceutical research, and related domains. However, in many of these fields, strict legal privacy regulations have resulted in much of this valuable data being isolated and inaccessible. 0 10 20 30 40 50 60 70 80 Generation of synthetic data addresses this, but sparse event occurrences and limited training data Time increase the complexity and difficulty of this task.
|
| 184 |
+
|
| 185 |
+
We introduce HawkesVAE, a novel model that combines Variational Autoencoder and Hawkes Pro0 10 20 30 40 50 60 70 80 cess techniques. While we have evaluated HawkesVAE on clinical trial patient data, the methodolTime ogy is quite general and can be applied to other forms of sequential data, such as financial or social media data. This model excels at generating sequential event data with precise timestamps, and we demonstrate its superior performance compared to the traditional LSTM and GAN-based models Time in handling tabular data for downstream machine learning tasks. Additionally, HawkesVAE showcases its ability to forecast events. Through experiments, we illustrate its capacity to generate event sequences that closely resemble the originals, without resorting to mere duplication. Ultimately, we 0 10 20 30 40 50 60 70 80 demonstrate that HawkesVAE outperforms existing methods in terms of data utility, enabling the Time generation of highly authentic event sequences across multiple real-world sequential event datasets. Empirical experiments indicate that providing the model with additional information, such as event index or event length, leads to significant improvements in the synthetic data quality. We believe that 0 10 20 30 40 50 60 70 80 Time a sweet spot is reached by allowing the model to know the event index–as it provides a significant downstream classification boost while maintaining a low ML inference score.
|
| 186 |
+
|
| 187 |
+
# REFERENCES
|
| 188 |
+
|
| 189 |
+
Giancarlo Agnelli, Daniel J George, Ajay K Kakkar, William Fisher, Michael R Lassen, Patrick Mismetti, Patrick Mouret, Umesh Chaudhari, Francesca Lawson, and Alexander GG Turpie. Semu
|
| 190 |
+
|
| 191 |
+
loparin for thromboprophylaxis in patients receiving chemotherapy for cancer. New England Journal of Medicine, 366(7):601–609, 2012.
|
| 192 |
+
Steven R Alberts, Daniel J Sargent, Suresh Nair, Michelle R Mahoney, Margaret Mooney, Stephen N Thibodeau, Thomas C Smyrk, Frank A Sinicrope, Emily Chan, Sharlene Gill, et al. Effect of oxaliplatin, fluorouracil, and leucovorin with or without cetuximab on survival among patients with resected stage iii colon cancer: a randomized trial. Jama, 307(13):1383–1393, 2012.
|
| 193 |
+
R Michael Baldwin, Kouros Owzar, Hitoshi Zembutsu, Aparna Chhibber, Michiaki Kubo, Chen Jiang, Dorothy Watson, Rachel J Eclov, Joel Mefford, Howard L McLeod, et al. A genomewide association study identifies novel loci for paclitaxel-induced sensory peripheral neuropathy in calgb 40101. Clinical Cancer Research, 18(18):5099–5109, 2012.
|
| 194 |
+
Mandis Beigi, Afrah Shafquat, Jason Mezey, and Jacob Aptekar. Simulants: Synthetic clinical trial data via subject-level privacy-preserving synthesis. In AMIA Annual Symposium Proceedings, volume 2022, pp. 231. American Medical Informatics Association, 2022.
|
| 195 |
+
Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. Advances in neural information processing systems, 31, 2018.
|
| 196 |
+
Edward Choi, Nan Du, Robert Chen, Le Song, and Jimeng Sun. Constructing disease network and temporal progression model via context-sensitive hawkes process. In 2015 IEEE International Conference on Data Mining, pp. 721–726. IEEE, 2015.
|
| 197 |
+
Edward Choi, Siddharth Biswal, Bradley Malin, Jon Duke, Walter F Stewart, and Jimeng Sun. Generating multi-label discrete patient records using generative adversarial networks. In Machine learning for healthcare conference, pp. 286–305. PMLR, 2017.
|
| 198 |
+
Davey Daniel, Vladimer Kuchava, Igor Bondarenko, Oleksandr Ivashchuk, Sreekanth Reddy, Jana Jaal, Iveta Kudaba, Lowell Hart, Amiran Matitashvili, Yili Pritchett, et al. Trilaciclib prior to chemotherapy and atezolizumab in patients with newly diagnosed extensive-stage small cell lung cancer: a multicentre, randomised, double-blind, placebo-controlled phase ii trial. International journal of cancer, 148(10):2557–2570, 2021.
|
| 199 |
+
Trisha Das, Zifeng Wang, and Jimeng Sun. Twin: Personalized clinical trial digital twin generation. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 402–413, 2023.
|
| 200 |
+
Lynnette Fernandez-Cuesta, Catherine Oakman, Priscila Falagan-Lotsch, Ke-seay Smoth, Em- ´ manuel Quinaux, Marc Buyse, M Stella Dolci, Evandro De Azambuja, Pierre Hainaut, Patrizia Dell’Orto, et al. Prognostic and predictive value of tp53mutations in node-positive breast cancer patients treated with anthracycline-or anthracycline/taxane-based adjuvant therapy: results from the big 02-98 phase iii trial. Breast Cancer Research, 14(3):1–13, 2012.
|
| 201 |
+
Vincent Fortuin, Dmitry Baranchuk, Gunnar Ratsch, and Stephan Mandt. Gp-vae: Deep probabilis- ¨ tic time series imputation. In International conference on artificial intelligence and statistics, pp. 1651–1661. PMLR, 2020.
|
| 202 |
+
Tianfan Fu, Cao Xiao, Cheng Qian, Lucas M Glass, and Jimeng Sun. Probabilistic and dynamic molecule-disease interaction modeling for drug discovery. In Proceedings of the 27th ACM SIGKDD conference on knowledge discovery & data mining, pp. 404–414, 2021.
|
| 203 |
+
Tianfan Fu, Kexin Huang, Cao Xiao, Lucas M Glass, and Jimeng Sun. Hint: Hierarchical interaction network for clinical-trial-outcome predictions. Patterns, 3(4), 2022.
|
| 204 |
+
Angela K Green, Katherine E Reeder-Hayes, Robert W Corty, Ethan Basch, Mathew I Milowsky, Stacie B Dusetzina, Antonia V Bennett, and William A Wood. The project data sphere initiative: accelerating cancer research by sharing data. The oncologist, 20(5):464–e20, 2015.
|
| 205 |
+
Shir Gur, Sagie Benaim, and Lior Wolf. Hierarchical patch vae-gan: Generating diverse videos from a single sample. Advances in Neural Information Processing Systems, 33:16761–16772, 2020.
|
| 206 |
+
Alan G Hawkes. Spectra of some self-exciting and mutually exciting point processes. Biometrika, 58(1):83–90, 1971.
|
| 207 |
+
Valerie Isham and Mark Westcott. A self-correcting point process. Stochastic processes and their applications, 8(3):335–347, 1979.
|
| 208 |
+
Patrick Kidger, James Morrill, James Foster, and Terry Lyons. Neural controlled differential equations for irregular time series. Advances in Neural Information Processing Systems, 33:6696– 6707, 2020.
|
| 209 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 210 |
+
Akim Kotelnikov, Dmitry Baranchuk, Ivan Rubachev, and Artem Babenko. Tabddpm: Modelling tabular data with diffusion models. In International Conference on Machine Learning, pp. 17564– 17579. PMLR, 2023.
|
| 211 |
+
Xixun Lin, Jiangxia Cao, Peng Zhang, Chuan Zhou, Zhao Li, Jia Wu, and Bin Wang. Disentangled deep multivariate hawkes process for learning event sequences. In 2021 IEEE International Conference on Data Mining (ICDM), pp. 360–369. IEEE, 2021.
|
| 212 |
+
Thomas Josef Liniger. Multivariate hawkes processes. PhD thesis, ETH Zurich, 2009.
|
| 213 |
+
Yingzhou Lu, Huazheng Wang, and Wenqi Wei. Machine learning for synthetic data generation: a review. arXiv preprint arXiv:2302.04062, 2023.
|
| 214 |
+
JR Mackey, T Pienkowski, J Crown, S Sadeghi, M Martin, Arlene Chan, M Saleh, S Sehdev, ´ L Provencher, V Semiglazov, et al. Long-term outcomes after adjuvant treatment of sequential versus combination docetaxel with doxorubicin and cyclophosphamide in node-positive breast cancer: Bcirg-005 randomized trial. Annals of Oncology, 27(6):1041–1047, 2016.
|
| 215 |
+
Hongyuan Mei and Jason M Eisner. The neural hawkes process: A neurally self-modulating multivariate point process. Advances in neural information processing systems, 30, 2017.
|
| 216 |
+
Xenia Miscouridou, Samir Bhatt, George Mohler, Seth Flaxman, and Swapnil Mishra. Cox-hawkes: doubly stochastic spatiotemporal poisson processes. arXiv preprint arXiv:2210.11844, 2022.
|
| 217 |
+
Harvey B Niell, James E Herndon, Antonius A Miller, Dorothy M Watson, Alan B Sandler, Karen Kelly, Randolph S Marks, Micheal C Perry, Rafat H Ansari, Grefory Otterson, et al. Randomized phase iii intergroup trial of etoposide and cisplatin with or without paclitaxel and granulocyte colony-stimulating factor in patients with extensive-stage small-cell lung cancer: Cancer and leukemia group b trial 9732. Journal of Clinical Oncology, 23(16):3752–3759, 2005.
|
| 218 |
+
Zhen Pan, Zhenya Huang, Defu Lian, and Enhong Chen. A variational point process model for social event sequences. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 173–180, 2020.
|
| 219 |
+
Neha Patki, Roy Wedge, and Kalyan Veeramachaneni. The synthetic data vault. In IEEE International Conference on Data Science and Advanced Analytics (DSAA), pp. 399–410, Oct 2016. doi: 10.1109/DSAA.2016.49.
|
| 220 |
+
Christian P Robert, George Casella, and George Casella. Monte Carlo statistical methods, volume 2. Springer, 1999.
|
| 221 |
+
Afrah Shafquat, Jason Mezey, Mandis Beigi, Jimeng Sun, Andy Gao, and Jacob W Aptekar. An interpretable data augmentation framework for improving generative modeling of synthetic clinical trial data. In ICML 3rd Workshop on Interpretable Machine Learning in Healthcare (IMLH), 2023.
|
| 222 |
+
Haohai Sun, Shangyi Geng, Jialun Zhong, Han Hu, and Kun He. Graph hawkes transformer for extrapolated reasoning on temporal knowledge graphs. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 7481–7493, 2022.
|
| 223 |
+
Zhaohong Sun, Zhoujian Sun, Wei Dong, Jinlong Shi, and Zhengxing Huang. Towards predictive analysis on disease progression: a variational hawkes process model. IEEE Journal of Biomedical and Health Informatics, 25(11):4195–4206, 2021.
|
| 224 |
+
Brandon Theodorou, Cao Xiao, and Jimeng Sun. Synthesize high-dimensional longitudinal electronic health records via hierarchical autoregressive language model. Nature Communications, 14(1):5305, 2023.
|
| 225 |
+
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.
|
| 226 |
+
Zifeng Wang and Jimeng Sun. Promptehr: Conditional electronic healthcare records generation with prompt learning. arXiv preprint arXiv:2211.01761, 2022a.
|
| 227 |
+
Zifeng Wang and Jimeng Sun. Transtab: Learning transferable tabular transformers across tables. Advances in Neural Information Processing Systems, 35:2902–2915, 2022b.
|
| 228 |
+
Zifeng Wang, Chufan Gao, Cao Xiao, and Jimeng Sun. Anypredict: Foundation model for tabular prediction. arXiv preprint arXiv:2305.12081, 2023a.
|
| 229 |
+
Zifeng Wang, Brandon Theodorou, Tianfan Fu, Cao Xiao, and Jimeng Sun. Pytrial: A comprehensive platform for artificial intelligence for drug development. arXiv preprint arXiv:2306.04018, 2023b.
|
| 230 |
+
Qingsong Wen, Tian Zhou, Chaoli Zhang, Weiqi Chen, Ziqing Ma, Junchi Yan, and Liang Sun. Transformers in time series: A survey. arXiv preprint arXiv:2202.07125, 2022.
|
| 231 |
+
Lei Xu, Maria Skoularidou, Alfredo Cuesta-Infante, and Kalyan Veeramachaneni. Modeling tabular data using conditional gan. In Advances in Neural Information Processing Systems, 2019.
|
| 232 |
+
Kevin Zhang, Neha Patki, and Kalyan Veeramachaneni. Sequential models in the synthetic data vault. arXiv preprint arXiv:2207.14406, 2022a.
|
| 233 |
+
Yizhou Zhang, Defu Cao, and Yan Liu. Counterfactual neural temporal point process for estimating causal influence of misinformation on social media. Advances in Neural Information Processing Systems, 35:10643–10655, 2022b.
|
| 234 |
+
Zilong Zhao, Aditya Kunar, Robert Birke, and Lydia Y Chen. Ctab-gan: Effective table data synthesizing. In Asian Conference on Machine Learning, pp. 97–112. PMLR, 2021.
|
| 235 |
+
Zilong Zhao, Aditya Kunar, Robert Birke, and Lydia Y Chen. Ctab-gan+: Enhancing tabular data synthesis. arXiv preprint arXiv:2204.00401, 2022.
|
| 236 |
+
Simiao Zuo, Haoming Jiang, Zichong Li, Tuo Zhao, and Hongyuan Zha. Transformer hawkes process. In International conference on machine learning, pp. 11692–11702. PMLR, 2020.
|
| 237 |
+
|
| 238 |
+
# Contents
|
| 239 |
+
|
| 240 |
+
A.1 Ethics and Reproducibility 13
|
| 241 |
+
A.1.1 HawkesVAE Hyperparameters 14
|
| 242 |
+
A.1.2 ML Utility Calculation Hyperparameters 14
|
| 243 |
+
A.2 More Related Work 14
|
| 244 |
+
A.3 Autoregressive Greedy Sampling vs Probabilistic Sampling 15
|
| 245 |
+
A.4 Diagram of the VAE Encoder-Decoder structure using a single model 15
|
| 246 |
+
A.5 Plots of subjects 16
|
| 247 |
+
A.6 Traditional Hawkes Process . 19
|
| 248 |
+
A.7 Variational Autoencoder 19
|
| 249 |
+
A.8 Neural Hawkes Process Likelihood . 19
|
| 250 |
+
A.9 Utility / Privacy Spider Plots 20
|
| 251 |
+
A.10 Future Work . 22
|
| 252 |
+
|
| 253 |
+
# A APPENDIX
|
| 254 |
+
|
| 255 |
+
# A.1 ETHICS AND REPRODUCIBILITY
|
| 256 |
+
|
| 257 |
+
Transformer Hawkes (Zuo et al., 2020) is open source and can be found at https://github. com/SimiaoZuo/Transformer-Hawkes-Process. Training on an NVIDIA GeForce RTX 3090 takes around 12 hrs to run the full model. The code will be made public and open source on GitHub. for the camera-ready version. All datasets were obtained from Project Data Sphere (Green et al., 2015) with permission via a research data access request form. The links are as follows:
|
| 258 |
+
|
| 259 |
+
1. NCT00003299 (Niell et al., 2005): A Randomized Phase III Study Comparing Etoposide and Cisplatin With Etoposide, Cisplatin and Paclitaxel in Patients With Extensive Small Cell Lung Cancer. Available at https://data.projectdatasphere.org/ projectdatasphere/html/content/261
|
| 260 |
+
2. NCT00041119 (Baldwin et al., 2012): Cyclophosphamide And Doxorubicin (CA) (4 VS 6 Cycles) Versus Paclitaxel (4 VS 6 Cycles) As Adjuvant Therapy For Breast Cancer in Women With 0-3 Positive Axillary Lymph Nodes:A 2X2 Factorial Phase III Randomized Study. Available at https://data.projectdatasphere.org/ projectdatasphere/html/content/486
|
| 261 |
+
3. NCT00079274 (Alberts et al., 2012): A Randomized Phase III Trial of Oxaliplatin (OXAL) Plus 5-Fluorouracil (5-FU)/Leucovorin (CF) With or Without Cetuximab (C225) After Curative Resection for Patients With Stage III Colon Cancer. Available at https://data. projectdatasphere.org/projectdatasphere/html/content/407
|
| 262 |
+
4. NCT00174655 (Fernandez-Cuesta et al. ´ , 2012): An Intergroup Phase III Trial to Evaluate the Activity of Docetaxel, Given Either Sequentially or in Combination With Doxorubicin, Followed by CMF, in Comparison to Doxorubicin Alone or in Combination With Cyclophosphamide, Followed by CMF, in the Adjuvant Treatment of Node-positive Breast Cancer Patients. Available at https://data.projectdatasphere.org/ projectdatasphere/html/content/127
|
| 263 |
+
5. NCT00312208 (Mackey et al., 2016): A Multicenter Phase III Randomized Trial Comparing Docetaxel in Combination With Doxorubicin and Cyclophosphamide Versus Doxorubicin and Cyclophosphamide Followed by Docetaxel as Adjuvant Treatment of Operable Breast Cancer HER2neu Negative Patients With Positive Axillary Lymph Nodes. Available at https://data.projectdatasphere.org/projectdatasphere/html/ content/118
|
| 264 |
+
6. NCT00694382 (Agnelli et al., 2012): A Multinational, Randomized, Double-Blind, Placebo-controlled Study to Evaluate the Efficacy and Safety of AVE5026 in the Prevention of Venous Thromboembolism (VTE) in Cancer Patients at High Risk for VTE and Who Are Undergoing Chemotherapy. Available at https://data.projectdatasphere. org/projectdatasphere/html/content/119
|
| 265 |
+
7. NCT03041311 (Daniel et al., 2021): Phase 2 Study of Carboplatin, Etoposide, and Atezolizumab With or Without Trilaciclib in Patients With Untreated Extensive-Stage Small Cell Lung Cancer (SCLC). Available at https://data.projectdatasphere. org/projectdatasphere/html/content/435
|
| 266 |
+
|
| 267 |
+
# A.1.1 HA W K E SVAE HYPERPARAMETERS
|
| 268 |
+
|
| 269 |
+
For PARSyntheizer, default hyper-parameters were used. For DDPM, we followed the GitHub example for churn2 https://github.com/yandex-research/tab-ddpm, but trained for 10,000 steps for each dataset.
|
| 270 |
+
|
| 271 |
+
Table 7: Hyperparameters Considered for HawkesVAE
|
| 272 |
+
|
| 273 |
+
<table><tr><td>Parameter</td><td>Space</td></tr><tr><td>embedding-size</td><td>[32,64,128]</td></tr><tr><td>patient_embedding_size</td><td>[64,128,256]</td></tr><tr><td>num_transformer_layers (Encoder)</td><td>[1,2,3,4,5,6,7,8]</td></tr><tr><td>num_heads (Encoder)</td><td>[2,4,8]</td></tr><tr><td>num_trans former_layers (Decoder)</td><td>[1,2,3,4,5,6,7,8]</td></tr><tr><td>num_heads (Decoder)</td><td>[2,4,8]</td></tr><tr><td>lr</td><td>[1e-3,1e-4]</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 8: Hyperparameters Considered for LSTM VAE
|
| 276 |
+
|
| 277 |
+
<table><tr><td>Parameter</td><td>Space</td></tr><tr><td>embedding_size patient_embedding_size num_lstm_layers (Encoder) hidden_size (Encoder) num_lstm_layers (Decoder) hidden_size (Decoder)</td><td>[32,64,128] [64,128,256] [1,2] [32,64,128] [1,2]</td></tr></table>
|
| 278 |
+
|
| 279 |
+
# A.1.2 ML UTILITY CALCULATION HYPERPARAMETERS
|
| 280 |
+
|
| 281 |
+
This section outlines hyperparameters explored for the downstream model for downstream ML Utility.
|
| 282 |
+
|
| 283 |
+
Table 9: Hyperparameters Considered for LSTM Predictor Models
|
| 284 |
+
|
| 285 |
+
<table><tr><td>Parameter</td><td>Space</td></tr><tr><td>embedding_size</td><td>[32,64,128]</td></tr><tr><td>num_lstm_layers (Encoder)</td><td>[1,2]</td></tr><tr><td>hidden_size (Encoder)</td><td>[32.64,128]</td></tr><tr><td>lr</td><td>[1e-3,1e-4]</td></tr></table>
|
| 286 |
+
|
| 287 |
+
# A.2 MORE RELATED WORK
|
| 288 |
+
|
| 289 |
+
Hawkes Processes (Hawkes, 1971; Isham & Westcott, 1979; Liniger, 2009) are point process that models event occurrence times as a function of previous event occurrences. Recent work has generalized this classical model to achieve state-of-the-art results in point process modeling tasks, such as estimating the causal influence of misinformation on social media (Zhang et al., 2022b), knowledge graph temporal entity/time prediction (Choi et al., 2015; Fu et al., 2021; Sun et al., 2022), neural differential equations (Chen et al., 2018; Kidger et al., 2020), time series prediction (Wen et al., 2022), and more.
|
| 290 |
+
|
| 291 |
+
Variational Autoencoders (VAEs) (Kingma & Welling, 2013) are generative models that have been applied to many data-synthesizing tasks such as probabilistic multivariate time series imputation (Fortuin et al., 2020) or generating diverse videos from a single input example video (Gur et al., 2020). Furthermore, VAEs have the unique advantage of being able to sample from the embedding distribution. Therefore, at inference time, we have the option to sample around the encoded embeddings of a certain data point.
|
| 292 |
+
|
| 293 |
+
# A.3 AUTOREGRESSIVE GREEDY SAMPLING VS PROBABILISTIC SAMPLING
|
| 294 |
+
|
| 295 |
+
In this section, we compare the results of greedily choosing the best type as opposed to probabilistic sampling from the rescaled logits $l \in \mathbb { R } ^ { N _ { e v e n t s } }$ . We rescale the logits to be positive and sum to 1: $l =$ $\cdot$ , and sample from k ∼ Multinomial $\cdot$ (For the Greedy version, we take arg $\operatorname* { m a x } _ { k } ( l ) )$ .
|
| 296 |
+
|
| 297 |
+
Let HawkesVAE (Probabilistic) represent the probabilistic sampling and HawkesVAE (Greedy) represent greedy sampling. Table 10 shows the results, and we see that the Greedy version often fails to generate useful synthetic sequences.
|
| 298 |
+
|
| 299 |
+
Table 10: Binary death event classification ROCAUCs of a downstream LSTM trained on data generated from the HawkesVAE models as well as the original data and baselines. Note that the LSTM and the HawkesVAE models estimate their own sequence stopping length.
|
| 300 |
+
|
| 301 |
+
<table><tr><td>Dataset</td><td colspan="2">NCT00003299</td><td colspan="2">NCT00041119 NCT00079274</td><td colspan="2">NCT00174655</td></tr><tr><td>Original Data</td><td>0.5608 ± 0.0891</td><td>0.6322 ± 0.0679</td><td></td><td>0.6009 ± 0.1525</td><td></td><td>0.6008± 0.1015</td></tr><tr><td>HawkesVAE (Probabalistic)</td><td>0.5860 ± 0.0564</td><td></td><td>0.6379 ± 0.0378</td><td>0.6007 ± 0.0831</td><td></td><td>0.5775 ± 0.0538</td></tr><tr><td>HawkesVAE (Greedy)</td><td>0.4525 ± 0.0517</td><td></td><td>0.6287 ± 0.0420</td><td>0.3909 ± 0.0939</td><td></td><td>0.4505 ± 0.0919</td></tr><tr><td colspan="7"></td></tr><tr><td>Dataset</td><td></td><td>NCT00312208</td><td></td><td>NCT00694382</td><td>NCT03041311</td><td></td></tr><tr><td>Original Data</td><td></td><td>0.5285 ± 0.0566</td><td></td><td>0.5915 ± 0.0281</td><td></td><td>0.6046 ± 0.1244</td></tr><tr><td>HawkesVAE (Probabilistic)</td><td></td><td>0.5632 ± 0.0384</td><td></td><td>0.5149 ± 0.0198</td><td></td><td>0.5584 ± 0.0741</td></tr><tr><td>HawkesVAE (Greedy)</td><td></td><td>0.4495 ± 0.0142</td><td></td><td>0.3829 ± 0.0613</td><td></td><td>0.5001 ± 0.0341</td></tr></table>
|
| 302 |
+
|
| 303 |
+
A.4 DIAGRAM OF THE VAE ENCODER-DECODER STRUCTURE USING A SINGLE MODEL
|
| 304 |
+
|
| 305 |
+
In the main paper, we show the diagram of HawkesVAE (Events Known). For VAE LSTM and HawkesVAE (Multivariate), we do not need the additional complexity of learning separate weights for each event, as we simply model all events in a multivariate fashion. Figure 3 shows this construction.
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure 3: Diagram of HawkesVAE (Multivariate) Encoder-Decoder structure, where event types and lens are learned. Here, the model output is the event times, event types, and total sequence length. The input observations are encoded first by a specific event encoder (Hawkes, LSTM, etc), and then embeddings are then mapped to the patient embedding space via an MLP. The opposite process occurs for decoding from the patient embedding.
|
| 309 |
+
|
| 310 |
+
# A.5 PLOTS OF SUBJECTS
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 4: Plot of 10 subject embeddings (in different colors) with 10 randomly sampled embeddings surrounding them. Embeddings are obtained from the predicted mean and standard deviation. The original predicted mean is shown with a $\times$ and the sampled embeddings are shown with a dot. These embeddings can be used to generate event sequences that should look somewhat similar to the original.
|
| 314 |
+
|
| 315 |
+
In this section, we visualize some of the HawkesVAE embeddings. Using Principal Component Analysis (PCA) to obtain a 2-dimensional visualization, we show 10 randomly sampled embeddings surrounding an initial subject embedding. The VAE loss penalizes event sequences generated from these similar embeddings to be the same as the original patient embedding. Figure 4 shows this plot, which makes sense as a sanity check that the sampled subject embeddings are close to the original and generally do not overlap with other subjects.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 5: Example of another generated sequence from HawkesVAE (Events Known) from NCT00003299. The blue dots denoting the specific event timestamp prediction. The red dots are the ground truth timestamps and the ground truth predictions. Each prediction is also linked with dashed lines for clarity
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 6: Example of another regenerated (encoded and decoded) sequence from HawkesVAE (Events Known) from NCT00003299. The blue dots denoting the specific event timestamp prediction. The red dots are the ground truth timestamps and the ground truth predictions. Each prediction is also linked with dashed lines for clarity
|
| 322 |
+
|
| 323 |
+
Figure 5 and Figure 6 show some examples of reconstructed subjects as generated by the bestperforming model (HawkesVAE (Events Known)). Intuitively, it visually reveals that the generated data generally matches the original data.
|
| 324 |
+
|
| 325 |
+
# A.6 TRADITIONAL HAWKES PROCESS
|
| 326 |
+
|
| 327 |
+
The Hawkes Process is a double stochastic point process. The traditional Hawkes Processes assumes that past events can temporarily raise (never lower) the probability of future events, assuming that such excitation is positive, additive over the past events, and exponentially decaying with time.
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\lambda ( t ) : = \left( \mu + \sum _ { \left\{ t _ { j } , t _ { j } < t \right\} } e ^ { - \delta ( t - t _ { j } ) } \right) ,
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
where $\delta$ is a decaying rate. Occurrence of a single event occurring at $t$ has intensity $\lambda ( t )$ , calculated as the sum of base intensity $\mu$ as well as all previously occurring events $t _ { j } < t$ .
|
| 334 |
+
|
| 335 |
+
# A.7 VARIATIONAL AUTOENCODER
|
| 336 |
+
|
| 337 |
+
We follow the standard formulation of VAEs (Kingma & Welling, 2013). To generate a latent variable in the multidimensional case, we first sample a noise vector $\epsilon \sim \mathcal { N } ( 0 , \mathbf { I }$ and hidden vector $z \sim \mathcal { N } ( \pmb { \mu } , \pmb { \sigma } ^ { 2 } \mathbf { I } )$ where $\pmb { \mu }$ and $\sigma ^ { 2 }$ are one-dimensional vectors. The relationship between the input and its latent representation is defined as: prior $\mathbf { \varepsilon } = p _ { \theta } ( z )$ , likelihood $= p _ { \theta } ( x | z )$ , and posterior $\begin{array} { r l } { \mathbf { \Psi } } & { { } = p _ { \theta } ( z | x ) } \end{array}$ . The intractable posterior is approximated by $q _ { \phi } ( z | x )$ . We want to minimize the Kullback–Leibler divergence between $q _ { \phi } ( z | x )$ and $p _ { \theta } ( z | x )$ , which in practice leads to maximizing the evidence lower bound (ELBO) for training along with the likelihood of $x$ .
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
L _ { \theta , \phi } = \mathbb { E } _ { z \sim q _ { \phi } ( \cdot \vert x ) } [ \ln p _ { \theta } ( x \vert z ) ] - D _ { K L } ( q _ { \phi } ( \cdot \vert x ) \vert \vert p _ { \theta } ( \cdot ) ) .
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
# A.8 NEURAL HAWKES PROCESS LIKELIHOOD
|
| 344 |
+
|
| 345 |
+
The following derivation is reformatted from (Mei & Eisner, 2017). For the proposed models, given complete observations of an event stream over the time interval $[ 0 , T ]$ , the log-likelihood of the parameters turns out to be given by the simple formula:
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\ell ( \{ ( t _ { 1 } , k _ { 1 } ) , \dots , ( t _ { L } , k _ { L } ) \} ) = \sum _ { j = 1 } ^ { L } \log ( \lambda ( t _ { j } | \mathcal { H } _ { t _ { j } } ) ) - \int _ { t _ { 1 } } ^ { t _ { L } } \lambda ( t | \mathcal { H } _ { t } ) d t
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
Where $\begin{array} { r } { \lambda ( t ) = \sum _ { k = 1 } ^ { K } \lambda _ { k } ( t ) } \end{array}$ . For the rest of the proof, let us drop the $\mathcal { H }$ notation for the sake of simplicity.
|
| 352 |
+
|
| 353 |
+
The cumulative distribution function of $T _ { i } \in ( t _ { i - 1 } , t _ { i } )$ given history $H _ { T _ { i } }$ is given by:
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
F ( t ) = P ( T _ { i } \leq t ) = 1 - P ( T _ { i } > t )
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
$P ( T _ { i } > t )$ is the probability that no events occur from $t _ { i - 1 }$ to $t$ , so we sum over the integral of those intensities.
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\begin{array} { l } { { \displaystyle F ( t ) = 1 - \exp \left( - \int _ { t _ { i - 1 } } ^ { t } \lambda ( s ) d s \right) } } \\ { { \displaystyle \qquad = 1 - \exp \left( \int _ { 0 } ^ { t _ { i - 1 } } \lambda ( s ) d s - \int _ { 0 } ^ { t _ { i } } \lambda ( s ) d s \right) } } \end{array}
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
The derivative can be written as:
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
f ( t ) = \exp \left( \int _ { 0 } ^ { t _ { i - 1 } } \lambda ( s ) d s - \int _ { 0 } ^ { t _ { i } } \lambda ( s ) d s \right)
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
Moreover, given the past history $\mathcal { H } _ { i }$ and the next event time $t _ { i }$ , the type distribution of $k _ { i }$ is given by:
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
P ( k _ { i } \mid t _ { i } ) = \frac { \lambda _ { k _ { i } } ( t _ { i } ) } { \lambda ( t _ { i } ) }
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
Therefore, we can derive the likelihood function as follows:
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\begin{array} { l } { { \displaystyle { \mathcal { L } = \prod _ { i : t _ { i } \leq T } \mathcal { L } _ { i } = \prod _ { t _ { i } \leq T } \{ f ( t _ { i } ) P ( k _ { i } \mid t _ { i } ) \} } } } \\ { { \displaystyle = \prod _ { i : t _ { i } \leq T } \{ \exp \left( \int _ { 0 } ^ { t _ { i - 1 } } \lambda ( s ) d s - \int _ { 0 } ^ { t _ { i } } \lambda ( s ) d s \right) \lambda _ { k _ { i } } ( t _ { i } ) \} } } \end{array}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
Taking the log of the likelihood:
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r l } & { \ell : = \log { \mathcal { L } } = \displaystyle \sum _ { i : t _ { i } \leq T } \log \lambda _ { k _ { i } } ( t _ { i } ) - \sum _ { i : t _ { i } \leq T } \left( \int _ { 0 } ^ { t _ { i } } \lambda ( s ) d s - \int _ { 0 } ^ { t _ { i - 1 } } \lambda ( s ) d s \right) } \\ & { \qquad = \displaystyle \sum _ { i : t _ { i } \leq T } \log \lambda _ { k _ { i } } ( t _ { i } ) - \sum _ { i : t _ { i } \leq T } \left( \int _ { t _ { i - 1 } } ^ { t _ { i } } \lambda ( s ) d s \right) } \\ & { \qquad = \displaystyle \sum _ { i : t _ { i } < T } \log \lambda _ { k _ { i } } ( t _ { i } ) - \int _ { s = 0 } ^ { T } \lambda ( s ) d s } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
# A.9 UTILITY / PRIVACY SPIDER PLOTS
|
| 390 |
+
|
| 391 |
+
Here, we visualize the utility/privacy trade-off that is inherent to any synthetic data generation task. Each metric is normalized for ease of visualization so that the maximum achieved metric is set as the tip of the triangle by dividing by the max. For ML Inference Privacy (where 0.5 is the ideal value), we first take the absolute value of the difference (i.e. $x = | x - 0 . 5 | ,$ ), and then divide by the max as before.
|
| 392 |
+
|
| 393 |
+
The results are shown in Figure 7. We see a clear tradeoff, as the best-performing Distance to Closest Record model, usually VAE LSTM or PAR, performs worse on the downstream ROCAC metric. This is because the generated sequences are of poorer quality, being too different from the original. The best-performing Downstream ROCAUC models also generally have good ML Inference Privacy, which is to be expected as those models generate data that is similar to the original, which would allow for (1) better performance on the held-out test set for ROCAUC and (2) being harder to distinguish from original data.
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
E LSTM wkesVAE (Events Known) wkesVAE (Multivariate) Figure 7: Spider Plots of all Models over each dataset.
|
| 397 |
+
|
| 398 |
+
# A.10 FUTURE WORK
|
| 399 |
+
|
| 400 |
+
Future work should continue exploring sequential event information. Currently, numeric values, such as lab values, are not considered. Initial experiments showed that directly regressing on the event values yielded poor results. Different methods of encoding lab values into events should be explored, such as discretization into bins. Furthermore, while we chose VAE to be the main generator framework due to its proven effectiveness, exploring Diffusion Models, which have shown superior performance over GANs as TabDDPM, is also an interesting future topic of research.
|
| 401 |
+
|
| 402 |
+
Cox-Hawkes Miscouridou et al. (2022) use a log-Gaussian Cox process (LGCP) as a prior for the background rate of the Hawkes process, allowing flexibility in capturing a wide range of underlying background effects. The computational complexity of the Hawkes process and LGCP poses challenges, but the authors introduce an efficient method for inference. Specifically, they employ a unique approach for Markov Chain Monte Carlo (MCMC) sampling, utilizing pre-trained Gaussian Process generators. This innovative technique offers direct and cost-effective access to samples during inference, addressing the computational expenses associated with the Hawkes process and LGCP.
|
| 403 |
+
|
| 404 |
+
Since Cox models are frequently used in survival analysis, a common healthcare task, this approach would be an exciting future direction to explore, potentially combining synthetic event generation with survival analysis.
|
md/test/fnO5h1CFyh/fnO5h1CFyh.md
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING SUCCESSOR REPRESENTATIONS WITH DISTRIBUTED HEBBIAN TEMPORAL MEMORY
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper presents a novel approach to address the challenge of online hidden representation learning for decision-making under uncertainty in non-stationary, partially observable environments. The proposed algorithm, Distributed Hebbian Temporal Memory (DHTM), is based on factor graph formalism and a multicomponent neuron model. DHTM aims to capture sequential data relationships and make cumulative predictions about future observations, forming Successor Representation (SR). Inspired by neurophysiological models of the neocortex, the algorithm utilizes distributed representations, sparse transition matrices, and local Hebbian-like learning rules to overcome the instability and slow learning process of traditional temporal memory algorithms like RNN and HMM. Experimental results demonstrate that DHTM outperforms classical LSTM and performs comparably to more advanced RNN-like algorithms, speeding up Temporal Difference learning for SR in changing environments. Additionally, we compare the SRs produced by DHTM to another biologically inspired HMM-like algorithm, CSCG. Our findings suggest that DHTM is a promising approach for addressing the challenges of online hidden representation learning in dynamic environments.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Modelling sequential data is one of the most important tasks in Artificial Intelligence as it has many applications, including decision-making and world models, natural language processing, conversational AI, time-series analysis, and video and music generation (Min et al., 2021; Eraslan et al., 2019; Dwivedi et al., 2023; Ji et al., 2020; Moerland et al., 2023). One of the classical approaches to modelling sequential data is forming a representation that stores and condenses the most relevant information about a sequence, and finding a general transformation rule of this information through the dimension of time (Lipton et al., 2015; Harshvardhan et al., 2020; Mathys et al., 2011). We refer to the class of algorithms that use this approach as Temporal Memory (TM) algorithms, as they essentially model the cognitive ability of complex living organisms to remember the experience and make future predictions based on this memory (Hochreiter & Schmidhuber, 1997; Friston et al., 2016; 2018; Parr & Friston, 2017).
|
| 12 |
+
|
| 13 |
+
This paper addresses the problem of hidden representation learning for decision-making under uncertainty, which can be formalized as agent Reinforcement Learning (RL) for a Partially Observable Markov Decision Process (POMDP) (Poupart, 2005). Inferring the hidden state in a partially observable environment is, in effect, a sequence modelling problem as it requires processing a sequence of observations to get enough information about hidden states. One of the most efficient representations of the hidden states for discrete POMDP is the Successor Representation (SR) that disentangles hidden states and goals given by the reward function (Dayan, 1993). An extension of the SR into continuous POMDP is the Successor Features framework, which employs the same idea of value function decomposition, but, instead, for features of a hidden state (Barreto et al., 2017). Temporal Memory algorithms can be leveraged to make cumulative predictions about future states and their features to form SR or SF.
|
| 14 |
+
|
| 15 |
+
The most prominent TM algorithms, like a Recurrent Neural Network (RNN) or a Hidden Markov Model (HMM), use backpropagation to capture data relationships, which is known for its instability due to recurrent non-linear derivatives. They also require having complete sequences of data at hand during the training. Although the gradient vanishing problem can be partially circumvented in a way Receptance Weighted Key Value (RWKV) (Peng et al., 2023) or Linear Recurrent Unit (LRU) (Orvieto et al., 2023) models do, the problem of online learning is still a viable topic. In contrast to HMM, RNN models and their descendants also lack a probabilistic theory foundation, which is beneficial for modeling sequences captured from stochastic environments (Salaun et al., 2019; Zhao ¨ et al., 2020). There is little research on TM models that can be used in fully online adaptable systems interacting with partially observable stochastic environments with access only to one sequence data point at a time, a prevalent case in Reinforcement Learning (Jahromi et al., 2022).
|
| 16 |
+
|
| 17 |
+
We propose a Distributed Hebbian Temporal Memory (DHTM) algorithm based on the factor graph formalism and multi-compartment neuron model. The resulting graphical structure of our model is similar to one of the Factorial-HMM (Ghahramani & Jordan, 1995), but with a factor graph forming online during training. We also show that depending on the graphical structure, our TM can be viewed as an HMM version of either RNN or LRU regarding information propagation in time. An important feature of our model is that transition matrices for each factor are stored as different components (segments) of artificial neurons, which makes computations very efficient in the case of sparse transition matrices. Our TM forms sequence representations fully online and employs only local Hebbian-like learning rules (Hebb, 2005; Churchland & Sejnowski, 1992; Lillicrap et al., 2020), circumventing gradient drawbacks and making the learning process much faster than gradient methods.
|
| 18 |
+
|
| 19 |
+
Some key ideas for our TM algorithm are inspired by neurophysiological models of the neocortex neural circuits and pyramidal neurons (George & Hawkins, 2009; Hawkins & Ahmad, 2016; O’Reilly et al., 2021). For example, emission matrices for random variables are fixed to resemble the columnar structure of the neocortex layers, which significantly lessens the number of trainable parameters, speeding up learning and leading to sparse transition matrices. Another example is using multi-compartmental neurons with active dendritic segments as independent detectors of neuron pattern activity (London & Hausser, 2005). Each dendritic segment can be viewed as a row of an ¨ HMM state transition matrix or, more generally, a value of a discrete factor function. Thus, we don’t explicitly store large transition matrices, only their non-zero parts.
|
| 20 |
+
|
| 21 |
+
The DHTM model notoriously fits Successor Features in the Reinforcement Learning setup to speed up TD learning. The proposed TM is tested as a world model (Ha & Schmidhuber, 2018; Hafner et al., 2023) for an RL agent architecture, making decisions in a simple Pinball-like environment and in a more challenging AnimalAI testbed (Crosby et al., 2020). Our algorithm outperforms a classic RNN algorithm LSTM and a more advanced RNN-like transformer algorithm RWKV in online Successor Feature formation task due to combination of fast Hebbian-like learning and sparse hidden state coding. Another advantage of our algorithm is that it allows its implementation for neuromorphic processors, as it uses only local learning rules.
|
| 22 |
+
|
| 23 |
+
Our contribution in this work is the following:
|
| 24 |
+
|
| 25 |
+
• We propose a distributed memory model DHTM based on the factor graph formalism and multicompartment neural model.
|
| 26 |
+
• Our model stores sparse factor functions in neural segments, which significantly lessens the number of trainable parameters and speeds up learning.
|
| 27 |
+
• The DHTM learns fully online employing only local Hebbian-like rules.
|
| 28 |
+
• The DHTM model fits Successor Features in the RL setup to speed up TD learning.
|
| 29 |
+
• Tested as a world model for an RL agent architecture in a Pinball environment, DHTM outperforms LSTM and RWKV in online Successor Features formation task.
|
| 30 |
+
|
| 31 |
+
# 2 BACKGROUND
|
| 32 |
+
|
| 33 |
+
This section provides basic information about some concepts necessary to follow the paper.
|
| 34 |
+
|
| 35 |
+
# 2.1 REINFORCEMENT LEARNING
|
| 36 |
+
|
| 37 |
+
In this paper, we consider decision-making in a partially observable environment, which is usually formalized as Partially Observable Decision Process (Poupart, 2005). A POMDP is defined as a tuple $\mathcal { M } \ : = \ : \left( S , A , \dot { P } , R , O , D , \gamma \right)$ , where $S$ —state space, $A$ —action space, $P ( s , a , s ^ { \acute { \iota } } ) \ =$
|
| 38 |
+
|
| 39 |
+
$P r ( s ^ { \star } \mid s , a )$ —transition function, $R ( s )$ –reward function, O—observation space, $D ( a , s ^ { \epsilon } , o ) = $ $P r ( o \mid a , s ^ { 6 } ) .$ —sensor model and $\gamma \in [ 1 , 0 )$ —discount factor, given a transition $s , a s ^ { \ast }$ , where $s \in S$ , $a \in A$ , $o \in O$ . If $S , A , O$ are finite, $P , D$ can be viewed as real valued matrices, otherwise, they are conditional density functions. Here we consider deterministic rewards, which depend only on the current state, i.e. $R ( s ) : S \mathbb { R }$ .
|
| 40 |
+
|
| 41 |
+
The task of RL is to find a policy $\pi ( a \mid s ) : S \times A \to [ 0 , 1 ]$ , which maximizes expected return $G = \mathbb { E } [ \sum _ { t = 0 } ^ { T } \gamma ^ { l } R _ { t } ]$ , where $T$ is an episode length. For value based methods, it is convenient to define optimal policy via $\mathbf { Q }$ -function: $\begin{array} { r } { Q ^ { \pi } ( s _ { t } , a _ { t } ) = \mathbb { E } [ \sum _ { l \geq t } \gamma ^ { l } R ( s _ { l + 1 } ) \mid s _ { t } , a _ { t } , \pi ] } \end{array}$ . For an optimal value function $Q ^ { * }$ an optimal policy can be defined as $\pi ( a \top s ) = \arg \operatorname* { m a x } _ { a } Q ^ { * } ( s , a )$ .
|
| 42 |
+
|
| 43 |
+
# 2.2 HIDDEN MARKOV MODEL
|
| 44 |
+
|
| 45 |
+
Partially observable Markov process can be approximated by a Hidden Markov model (HMM) with hidden state space $H$ and observation space $O$ . $O$ is the same as in $\mathcal { M }$ , but $H$ generally is not equal $S$ . Variables $H _ { t }$ represent an unobservable (hidden) approximated state of the environment which evolves over time, and observable variables $O _ { t }$ represent observations that depend on the same time step state $H _ { t }$ , and $h _ { t } , o _ { t }$ are corresponding values of this random variables. For the sake of simplicity, we suppose that actions are fully observable and information about them is included into $H _ { t }$ variables. For the process of length $T$ with state values $h _ { 1 : T } = ( h _ { 1 } , \ldots , h _ { T } )$ and $o _ { 1 : T } =$ $\big ( o _ { 1 } , \ldots , o _ { T } \big )$ , the Markov property yields the following factorization of the generative model:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
p ( o _ { 1 : T } , h _ { 1 : T } ) = p ( h _ { 1 } ) \prod _ { t = 2 } ^ { T } p ( h _ { t } | h _ { t - 1 } ) \prod _ { t = 1 } ^ { T } p ( o _ { t } | h _ { t } ) .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
In case of discrete hidden state, a time-independent stochastic transition matrix can be learned with Baum–Welch algorithm (Baum et al., 1970), a variant of Expectation Maximization algorithm. To compute the statistics for the expectation step, it employs the forward-backward algorithm, which is a special case of sum-product algorithm (Kschischang et al., 2001).
|
| 52 |
+
|
| 53 |
+
# 2.3 SUCCESSOR REPRESENTATION
|
| 54 |
+
|
| 55 |
+
Successor Representations are such representations of hidden states from which we can linearly infer the state value given the reward function (Dayan, 1993). Here, we assume observation and state spaces are discrete.
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\begin{array} { l } { { \displaystyle V ( h _ { t } = i ) = \mathrm { E } [ \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } R _ { t + l + 1 } \mid h _ { t } = i ] = \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } \mathrm { E } [ R _ { t + l + 1 } \mid h _ { t } = i ] = } } \\ { { = \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } \sum _ { j } p ( h _ { t + l + 1 } = j \mid h _ { t } = i ) R _ { j } = \sum _ { j } \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } p ( h _ { t + l + 1 } = j \mid h _ { t } = i ) R _ { j } = \sum _ { j } M _ { i j } R _ { j } , } } \end{array}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $i$ , and $\begin{array} { r } { M _ { i j } = \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } p ( h _ { t + l + 1 } = j \mid h _ { t } = i ) } \end{array}$ $\gamma$ is a discount factor, vector $\mathrm { S R } ( h = i ) = \{ M _ { i j } \} _ { j }$ . $R _ { j }$ is a reward for observing the state is a Successor Representation of a state $j$ . That is, SR can be computed by a TM that is able to predict future states. TM algorithms effectively predict observations only for a finite time horizon $T$ . Therefore, in order to learn SR, a technique similar to TD learning in standard RL may be employed:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\begin{array} { l } { { \delta _ { i j } = \displaystyle \sum _ { l = 0 } ^ { T } \gamma ^ { l } p ( h _ { t + l + 1 } = j \mid h _ { t } = i ) ) + \gamma ^ { T + 1 } \sum _ { k } M _ { k j } p ( h _ { t + T + 1 } = k \mid h _ { t } = i ) - M _ { i j } , } } \\ { { M _ { i j } M _ { i j } + \alpha \delta _ { i j } , } } \end{array}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\alpha \in ( 0 , 1 )$ is a learning rate, $\delta _ { i j }$ —TD error for SR.
|
| 68 |
+
|
| 69 |
+
In partially observable environments, however, exact state values are not known, therefore we operate with state distributions or so-called belief states (Poupart, 2005), which are inferred from observations. In that case, state value and SR are functions of hidden state variable distribution (see details in Appendix B).
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: Partial factor graph for the DHTM. The input to the model is a sequence of binary images, each pixel is modelled as Bernoulli random variable $\mathbf { \bar { \rho } }$ , where $l$ and $m$ denote corresponding rows and cols of the image. The encoder block forms image categorical features $\Phi _ { t } ^ { k }$ in an unsupervised manner. Each feature $\Phi$ has its own explaining hidden variable, which may depend on hidden variables of the other features and on itself from the previous time step. $F _ { c } ^ { k }$ and $F _ { e } ^ { k }$ are context and emission factors for the corresponding variables. Unary factors $M _ { t - 1 } ^ { i }$ called messages represent accumulated information about previous time steps.
|
| 73 |
+
|
| 74 |
+
# 2.4 SPARSE DISTRIBUTED REPRESENTATIONS
|
| 75 |
+
|
| 76 |
+
In our work, we design our model to operate with sparse distributed representations (SDRs) to reflect the spatiotemporal property of cortical network activity (Perin et al., 2011). In the discrete time case, SDR is a sparse binary vector in a high-dimensional space. To encode observed dense binary patterns to SDRs, we use a biologically plausible $\mathbf { k }$ -WTA (k-winners take all) neural network algorithm called spatial pooler with a Hebbian-like unsupervised learning method (see details in Appendix A).
|
| 77 |
+
|
| 78 |
+
# 3 DISTRIBUTED HEBBIAN TEMPORAL MEMORY
|
| 79 |
+
|
| 80 |
+
# 3.1 FACTOR GRAPH MODEL
|
| 81 |
+
|
| 82 |
+
Distributed Hebbian Temporal Memory is based on the sum-product belief propagation algorithm in a factor graph (see Figure 1). Analogously to Factorial-HMM (Ghahramani & Jordan, 1997), we divide the hidden space $H$ into subspaces $\mathbf { \bar { \nabla } } H ^ { k }$ . There are four sets of random variables (RV) in the model: $H _ { t - 1 } ^ { i }$ —latent variables representing hidden states from the previous time step (context), $H _ { t } ^ { k }$ —latent variables for the current time step, $\Phi _ { t } ^ { k }$ —feature variables, and $O _ { t } ^ { l m }$ —observable variables. Except for $O _ { t } ^ { l m }$ , all random variables have a categorical distribution. In contrast, $O _ { t } ^ { l m }$ , are values are denoted as corresponding lowercase letters: Bernoulli variables because they represent pixels from a binary input image observation. RV state $h _ { t - 1 } ^ { i } , h _ { t } ^ { \bar { k } } , \varphi _ { t } ^ { \bar { k } } , o _ { t } ^ { l m }$ .
|
| 83 |
+
|
| 84 |
+
Each variable $\Phi _ { t } ^ { k }$ is considered independent and has a separate graphical model for increased computational efficiency. However, hidden variables of the same time step are statistically interdependent in practice. We introduce their interdependence through a segment computation trick that goes beyond the standard sum-product algorithm (see Eq. 7).
|
| 85 |
+
|
| 86 |
+
The model also has three types of factors: $M _ { t - 1 } ^ { i }$ —messages from previous time steps, $F _ { c } ^ { k }$ —context factor (generalized transition matrix), $F _ { e } ^ { k }$ —emission factor. We assume that messages $M _ { t - 1 } ^ { i }$ include posterior information from the time step $t - 1$ , therefore we don’t depict observable variables for previous time steps in Figure 1.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 2: Neuronal implementation of the DHTM. Random variables are represented by cell clusters (white circles), where each cell corresponds to a state and its spike frequency—to the probability of the state $p ( h _ { t } ^ { k } )$ . Cell’s dendritic segments $s e g ( k )$ correspond to context factor values $f _ { l }$ for a particular combination of states (active presynaptic cells) $r e c ( l )$ . Segments’ excitations $E _ { l }$ are combined to determine cell’s spike frequency $\bar { p ( h _ { t } ^ { k } ) }$ . Segment’s synaptic weights reflect specificity of $r e c ( l )$ combination for the segment. Emission factors ${ \dot { F } } _ { e } ^ { k }$ are fixed and represented by minicolumns inside a variable.
|
| 90 |
+
|
| 91 |
+
Further, we discuss only the upper block of the graph, which is DHTM itself. The lower block—an encoder—is described in the Appendix A. The only requirement for the encoder is that its output should be represented as states of categorical variables (features) for the current observation.
|
| 92 |
+
|
| 93 |
+
# 3.2 NEURAL IMPLEMENTATION
|
| 94 |
+
|
| 95 |
+
The main routine of the DHTM is to estimate distributions of currently hidden state variables given by the equation 4, the computational flow of which is schematically depicted in Figure 2:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
p ( h _ { t } ^ { k } ) \propto \sum _ { \{ h _ { t - 1 } ^ { i } : i \in \omega _ { k } \} } \prod _ { i \in \omega _ { k } } M _ { t - 1 } ^ { i } ( h _ { t - 1 } ^ { i } ) F _ { c } ^ { k } ( h _ { t } ^ { k } , \{ h _ { t - 1 } ^ { i } : i \in \omega _ { k } \} ) ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\omega _ { k } = i _ { 1 } , \ldots , i _ { n }$ —set of previous time step RV indexes included in $F _ { c } ^ { k }$ factor, $( n + 1 )$ —factor size.
|
| 102 |
+
|
| 103 |
+
For computational purposes, we translate the problem to the neural network architecture with Hebbian-like learning (for biological interpretation of the model, see Appendix C). As can be seen from Figure 2, every RV can be viewed as a set of spiking neurons representing the RV’s states, that is, $p ( h _ { t } ^ { k } ) = p ( c _ { t } ^ { j } = 1 )$ , where $j$ —index of a neuron corresponding to the state $h _ { t } ^ { k }$ . Cell activity is binary $c _ { t } ^ { j } \in \{ 0 , 1 \}$ (spike/no-spike), and the probability might be interpreted as a spike rate. Factors $F _ { c } ^ { k }$ and $M _ { t - 1 } ^ { i }$ can be represented as vectors, where elements are factor values for all possible combinations of RV states included in the factor. Let’s denote elements of the vectors as $f _ { l }$ and $m _ { u }$ correspondingly, where $l$ corresponds to a particular combination of $k , h _ { t } ^ { k } , h _ { t - 1 } ^ { i _ { 1 } } , \ldots , h _ { t - 1 } ^ { i _ { n _ { l } } }$ state values and $u$ indexes all neurons representing states of previous time step RVs.
|
| 104 |
+
|
| 105 |
+
Drawing inspiration from biological neural networks with active dendrites, we group a neuron’s connections (dendrites) into segments. A segment acts as an independent computational unit that detects a particular input pattern (a context state) defined by its own receptive field. In our model, a segment links together factor value $f _ { l }$ , the computational graph shown in Figure 2, and the excitation $E _ { l }$ induced by the segment $l$ to the cell it is attached to. The segment is active, i.e., $s _ { l } = 1$ if all its presynaptic cells are active; otherwise, $s _ { l } = 0$ . Computationally, a segment transmits its factor value $f _ { l }$ to a cell it is attached to if the context matches the corresponding state combination.
|
| 106 |
+
|
| 107 |
+
We can now rewrite equation 4 as the following:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
p ( h _ { t } ^ { k } ) \propto \sum _ { l \in \mathrm { s e g } ( j ) } L _ { l } f _ { l } ^ { k } ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\begin{array} { r } { L _ { l } = \prod _ { u \in \mathrm { r e c } ( l ) } m _ { u } } \end{array}$ is segment’s likelihood as long as messages are normalized, $\sec ( j )$ — indexes of segments that are attached to cell $j$ , $\operatorname { r e c } ( l ) .$ —indexes of presynaptic cells that constitute receptive field of a segment with index $l$ .
|
| 114 |
+
|
| 115 |
+
Initially, all factor entries are zero, meaning cells have no segments. As learning proceeds, new non-zero connections grouped into segments are grown. In equation 5 we benefit from having sparse factor value vectors because its complexity depends linearly on the amount of non-zero components. And that’s usually the case in our model due to one-step Monte-Carlo learning and specific form of emission factors $\dot { F } _ { e } ^ { k }$ :
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
F _ { e } ^ { k } ( h _ { t } ^ { k } , o _ { t } ^ { k } ) = \mathbb { I } [ h _ { t } ^ { k } \in \mathrm { c o l } ( \varphi _ { t } ^ { k } ) ] ,
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where I—indicator function, $\operatorname { c o l } ( \varphi _ { t } ^ { k } )$ is a set of hidden states connected to the feature state $\varphi _ { t } ^ { k }$ that forms a column. The form of emission factor is inspired by presumably columnar structure of the neocortex and was shown to induce sparse transition matrix in HMM (George et al., 2021).
|
| 122 |
+
|
| 123 |
+
Segment likelihood $L _ { l }$ , resulting from the sum-product algorithm, is calculated as if presynaptic cells are independent. However, it’s not usually the case for sparse factors. To take into account, approximately, their interdependence, we substitute the following equation for segment log-likelihood:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\log L _ { l } = \log \sum _ { u \in \mathrm { r e c } ( l ) } w _ { u l } m _ { u } + \sum _ { u \in \mathrm { r e c } ( l ) } ( 1 - w _ { u l } ) \log m _ { u } - \log n _ { l } ,
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $w _ { p l }$ —synapse efficiency or neuron specificity for segment, such that $w _ { u l } = p ( s _ { l } = 1 | c _ { t - 1 } ^ { u } =$ 1), and $n _ { l }$ -number of cells in segment’s receptive field.
|
| 130 |
+
|
| 131 |
+
The idea that underlies the formula is to approximate between two extreme cases:
|
| 132 |
+
|
| 133 |
+
• $p ( s _ { l } = 1 | c _ { t - 1 } ^ { u } = 1 ) 1$ for all $u$ , which means that all cells in the receptive field are dependent and are part of one cluster, i.e., they fire together. In that case, it should be $p ( s _ { l } ) = m _ { u }$ for any $u$ , but we also reduce prediction variance by averaging between different $u$ .
|
| 134 |
+
• $p ( s _ { l } = 1 | c _ { t - 1 } ^ { u } = 1 ) \to 0$ for all $u$ means that presynaptic cells don’t form a cluster. In that case, segment activation probability is just a product of the activation probability of each cell.
|
| 135 |
+
|
| 136 |
+
The resulting equation for belief propagation in DHTM is the following:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
p ( h _ { t } ^ { k } ) = p ( c _ { t } ^ { j } = 1 ) = \operatorname * { s o f t m a x } _ { j \in \mathrm { c e l l s } [ H _ { t } ^ { k } ] } \big ( \operatorname* { m a x } _ { l \in s e g ( j ) } ( E _ { l } ) \big ) ,
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $E _ { l } = \log f _ { l } + \log L _ { l }$ , $\mathrm { c e l l s } [ H _ { t } ^ { k } ]$ —indexes of cells that represent states for $H _ { t } ^ { k }$ variable. Here, we also approximate logarithmic sum with max operation inspired by the neurophysiological model of segment aggregation by cell (Stuart & Spruston, 2015).
|
| 143 |
+
|
| 144 |
+
The next step after computing $p ( h _ { t } ^ { k } )$ distribution parameters is to incorporate information about current observations $p ( h _ { t } ^ { \bar { k } } \mid o _ { t } ^ { k } ) \propto p ( h _ { t } ^ { k } ) \mathbb { I } [ h _ { t } ^ { k } \in \mathrm { c o l } ( o _ { t } ^ { k } ) ]$ . After that, the learning step is performed. The step for closing the loop of our TM algorithm is to assign the posterior for the current step $p ( h _ { t } ^ { k } \mid \hat { o _ { t } ^ { k } } )$ to $M _ { t - 1 } ^ { i }$ .
|
| 145 |
+
|
| 146 |
+
DHTM learns $f _ { l }$ and $w _ { u l }$ weights by Monte-Carlo Hebbian-like updates. First, $h _ { t - 1 } ^ { i }$ and $h _ { t } ^ { k }$ are sampled from their posterior distributions: $p ( h _ { t - 1 } ^ { i } \mid o _ { t - 1 } ^ { i } ) \propto M _ { t - 1 } ^ { i }$ and $p ( h _ { t } ^ { k } \mid o _ { t } ^ { k } )$ correspondingly. Then $f _ { l }$ is updated according to the segment’s $s _ { l }$ and its cell’s $c _ { t } ^ { j }$ activity so that $f _ { l }$ is proportional to several coincidences $s _ { l } = c _ { t } ^ { j } = 1$ during the recent past, i.e., cell and its segment are active at the same time step. It’s similar to Baum-Welch’s update rule (Baum et al., 1970) for the transition matrix in HMM, which, in effect, counts transitions from one state to another, but, in our case, the previous state (context) is represented by a group of RVs, not just one hidden RV.
|
| 147 |
+
|
| 148 |
+
Weights $w _ { u l }$ are also updated by the Hebbian rule to reflect the specificity of a presynaptic $u$ for activating a segment $\it l$ . That is, they are targeted to represent probability $p ( s _ { l } = 1 | c _ { t - 1 } ^ { u } = 1 )$ that segment $s _ { l }$ is active, given cell $u$ was active at the previous time-step. We could learn it by counting activation coincidences and mismatches. But in our algorithm it is approximated as exponential moving average of segment’s $s _ { l }$ frequency activation, given $c _ { t - 1 } ^ { u } = 1$ : $\Delta w _ { u l } = \alpha \cdot \mathbb { I } [ c _ { t - 1 } ^ { u } =$ 1] $\cdot ( \mathbb { I } [ s _ { l } = 1 ] - w _ { u l } )$ ), where $\alpha \in [ 0 , 1 )$ — learning rate.
|
| 149 |
+
|
| 150 |
+
# 3.3 AGENT ARCHITECTURE
|
| 151 |
+
|
| 152 |
+
We incorporate DHTM as a part of an RL agent. The agent consists of a DHTM memory model, an SF mapping from hidden space, and a feature reward function. The memory model aims to speed up SF learning by predicting cumulative future distributions of feature variables $\Phi$ according to equation 17. As shown in equation 13, SF representations are learned to estimate state value. The $r ( \varphi _ { t } ^ { k } )$ reward function is also learned during interaction with the environment and, combined with SF representations, is used to estimate the action value function.
|
| 153 |
+
|
| 154 |
+
Algorithm 1 General agent training procedure
|
| 155 |
+
|
| 156 |
+
<table><tr><td colspan="2">1: for episode=1..n do</td></tr><tr><td>2:</td><td>RESET_MEMORY()</td></tr><tr><td>3: 4:</td><td>action ←null</td></tr><tr><td>5:</td><td>while (not terminal) and (steps <max_steps) do obs,reward ← STEP()</td></tr><tr><td>6:</td><td>features ← ENCODE(PREPROCESS(obs))</td></tr><tr><td>7:</td><td>OBSERVE(features,action)</td></tr><tr><td>8:</td><td>REINFORCE(reward, features)</td></tr><tr><td>9:</td><td></td></tr><tr><td>10:</td><td>action ← SAMPLE_ACTION(</td></tr><tr><td></td><td>ACT(action)</td></tr><tr><td>11: 12:</td><td>end while</td></tr><tr><td colspan="2">end for</td></tr></table>
|
| 157 |
+
|
| 158 |
+
The agent training procedure is outlined in Algorithm 1. For each episode, the memory state is reset to a fixed initial message with RESET MEMORY() and action variable is initialized with null value. An observation image returned by an environment (obs) is first preprocessed to get events, mimicking a simple event-based camera with a floating threshold determined from the average difference between the current and previous step image intensities. The resulting events are encoded to SDRs with a biologically inspired spatial pooling encoder described in Appendix A. In OBSERVE() routine, the memory learns to predict next feature states as described in Section 3 and SF learning happens according to equation 16. An agent learns associations to feature states and rewards in line 8:
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
r _ { i } ^ { k } r _ { i } ^ { k } + \alpha \mathbb { I } [ \varphi _ { t } ^ { k } = i ] ( R _ { t } - r _ { i } ^ { k } )
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $\alpha$ is a learning rate, $R _ { t }$ —a reward for the current time step.
|
| 165 |
+
|
| 166 |
+
We include actions into the model by forcing some of the hidden variables $H _ { t } ^ { k }$ to represent actions. That is, we assume that information about action is included in the hidden state of the model. For example, if we have 4 actions, we set 4 states for one of the hidden variables and set its state from observation of the action. We form on-policy SFs, i.e. relying on policy iteration theorem.
|
| 167 |
+
|
| 168 |
+
An agent has a softmax policy over predicted values: $\pi ( a _ { t } \mid o _ { 0 : t } ) = \mathrm { s o f t m a x } ( V [ p ( h _ { t + 1 } \mid o _ { 0 : t } , a _ { t } ) ] )$ . We use the model to predict the hidden state distribution for every action in the next timestep $t + 1$ and then estimate its value according to equation 13.
|
| 169 |
+
|
| 170 |
+
# 4 EXPERIMENTS
|
| 171 |
+
|
| 172 |
+
We test our model in a reinforcement learning task in a pinball-like 2D environment, where successor features are easy to interpret, and in a more challenging AnimalAI 3D environment. This section shows how different memory models affect SF learning and an RL agent’s adaptability. In our work, we compare the proposed DHTM model with LSTM (Hochreiter & Schmidhuber, 1997), RWKV (Peng et al., 2023), and CSCG (George et al., 2021) (see Appendix E for the details).
|
| 173 |
+
|
| 174 |
+
# 4.1 PINBALL
|
| 175 |
+
|
| 176 |
+
The first, classic maze, test is designed in the Pinball environment (see Appendix F for details) to qualitatively assess SFs formed by different TMs for random policy (see Fig. 3). Ball is controlled by the agent able to apply a momentum in four opposite directions. The ball and terminal state are separated by a wall with a door on the right. Each episode is maximum of 30 steps. Memories are tested in two regimes: 5-step planning (i.e. using equation 17 only) and prediction only (equation 18). As can be seen from the heatmaps, only DHTM yields adequate value functions. However, as can be seen from the learning curves, surprise of DHTM is higher than of the other memories. LSTM’s learning curve is much flatter than of the others. Five-step DHTM planning gives more abrupt value function in comparison to prediction regime, as it usually requires more than five steps to reach the goal. Heatmaps for other baselines can be found in Appendix G.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 3: Results of 2D maze random policy experiment in the Pinball environment. Surprise learning curves for DHTM, LSTM, RWKV and CSCG. Heatmaps represent value functions for DHTM and LSTM.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 4: Surprise comparison for various memory models including DHTM (ours), LSTM, RWKV, and Factorial version of CSCG (fchmm). The SFs generated by normalized five-step prediction models are used to calculate surprise for three future time steps.
|
| 183 |
+
|
| 184 |
+
The second test is to show how TM can enhance adaptation in changing environments. For that experiment, we use two configurations of the Pinball environment shown in Figure 7-A. We narrow the action space to three momentum vectors: vertical, 30 degrees left and 30 degrees right from the vertical axis. Each time step, the agent gets a small negative reward and a large positive reward if the ball enters the force field in the centre. The episode finishes when the ball enters the rewarding force field or the maximum number of steps is reached. Each trial is run for 500 episodes, each a maximum of 15 steps long, and we average the results over three trials for each parameter set and memory model.
|
| 185 |
+
|
| 186 |
+
We test the accuracy of five-step SF representations by measuring their pseudo-surprise, which is surprise computed for observed states on different time steps after SF was predicted with respect to normalized SF (more details in Appendix D). In all experiments, the encoder outputs five variables $\Phi$ with 50 states each. As can be seen from Figure 4, SRs produced by our memory model (dhtm) give lower surprise than SRs of LSTM (lstm) and RWKV (rwkv), and is on par with SRs produced by Factorial version of CSCG (fchmm), which is just several CSCGs trained in parallel to enable handling of multiple variables outputted by encoder.
|
| 187 |
+
|
| 188 |
+
Then, we test how the number of prediction steps affects the agent’s adaptability in the Pinball environment. In the first 500 episodes, the agent is trained to reach the target in the centre, as shown in Figure 7-A, then the target is blocked by a random force that applies force in perpendicular direction to the ball’s movement. The results show that an agent that uses five prediction steps during n-step TD learning of SF faster adapts to the changes in the environment in comparison to 1-step TD learning for SF, as seen from Figure 5-A.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 5: A. Comparison of agent’s adaptability during changes in the environment with different prediction steps during n-step TD learning of SF. At the 500th episode, the environment changes its configuration, shown in Figure 7-A. B. AnimalAI changing food position experiment. Left picture is DHTM reward curves each averaged over five trials for two cases: SF formed by 7-step planning using DHTM and SF is predicted using TD learned weights and DHTM inferred belief states. At the 300th episode, the food is moved to the opposite corridor (see Fig. 7-C).
|
| 192 |
+
|
| 193 |
+
# 4.2 ANIMALAI
|
| 194 |
+
|
| 195 |
+
We designed an experiment in AnimalAI environment shown on Figure 7-C. There are two corridors, one of which contains food (yellow cirle). The agent makes a decision at the start of the trial, having three options: go to the left corridor, go to the right and stay turning. After the decision is made, the agent follows a fixed strategy, which brings it either to the right corridor or to the left, and it observes its movement and actions. An episode ends when strategy is executed. Each time step, agent gets small negative reward and big positive reward only if reaches food. After 300 episodes, food is placed to the other corridor. Reward curves averaged over five trials for each setup are presented in Figure 5-B. There are two cases on the plot: SF is formed by prediction (equation 18) or planned (equation 17). The results for DHTM show that planning allows much faster adaptation to the change of the rewarding food position.
|
| 196 |
+
|
| 197 |
+
# 5 CONCLUSION
|
| 198 |
+
|
| 199 |
+
In this paper, we introduce a novel probabilistic Factorial-HMM-like algorithm DHTM for learning an observation sequence model in stochastic environments that uses local Hebbian-like learning rules, which renders it apt for running on neuromorphic processors. DHTM is scalable to multiple feature variables as it employs sparse distributed representations and sparse factor function implementation using segments, which biologically plausible multicomponent neural models inspire. In contrast to methods that use Monte-Carlo trajectory sampling for future states probability estimation, our method is able to perform belief propagation, so each prediction step adds constant amount of computations. We show that our memory model can quickly learn the observation sequences representation and the transition dynamics. The DHTM produces more accurate n-step Successor Features than LSTM and RWKV, which speeds up n-step TD learning of the SF in Reinforced Learning tasks with the changing environment.
|
| 200 |
+
|
| 201 |
+
One of the limitations of the DHTM is that its temporal context is random, as it is formed on the fly. That is, the mechanism of context formation doesn’t allow generalizations. That is why we are forced to use feature space inferred from observations for value function decomposition, to soften this problem. Nevertheless, we believe that forming Successor Features combined with two level hierarchy of DHTM layers may provide the next step to circumvent this limitation, which directs of our further research. Another limitation is the maximum number of variables per factor. The amount of segments in use grows exponentially with the number of variables per factor, especially in noisy environments. Solving this issue would require to modify segment excitation or growth algorithms.
|
| 202 |
+
|
| 203 |
+
# REFERENCES
|
| 204 |
+
|
| 205 |
+
Andre Barreto, Will Dabney, R ´ emi Munos, Jonathan J Hunt, Tom Schaul, Hado P van Hasselt, ´ and David Silver. Successor features for transfer in reinforcement learning. Advances in neural information processing systems, 30, 2017.
|
| 206 |
+
|
| 207 |
+
Leonard E Baum, Ted Petrie, George Soules, and Norman Weiss. A maximization technique occurring in the statistical analysis of probabilistic functions of markov chains. The annals of mathematical statistics, 41(1):164–171, 1970.
|
| 208 |
+
Edward Beeching, Jilles Debangoye, Olivier Simonin, and Christian Wolf. Godot reinforcement learning agents. arXiv preprint arXiv:2112.03636, 2021.
|
| 209 |
+
PENG Bo. Blinkdl/rwkv-lm: 0.01, August 2021. URL https://doi.org/10.5281/ zenodo.5196577.
|
| 210 |
+
Patricia Smith Churchland and Terrence Joseph Sejnowski. The computational brain. MIT press, 1992.
|
| 211 |
+
Matthew Crosby, Benjamin Beyret, Murray Shanahan, Jose Hern ´ andez-Orallo, Lucy Cheke, and ´ Marta Halina. The animal-ai testbed and competition. In Hugo Jair Escalante and Raia Hadsell (eds.), Proceedings of the NeurIPS 2019 Competition and Demonstration Track, volume 123 of Proceedings of Machine Learning Research, pp. 164–176. PMLR, 08–14 Dec 2020.
|
| 212 |
+
Yuwei Cui, Subutai Ahmad, and Jeff Hawkins. The htm spatial pooler—a neocortical algorithm for online sparse distributed coding. Frontiers in Computational Neuroscience, 11:111, 2017. ISSN 1662-5188. doi: 10.3389/fncom.2017.00111. URL https://www.frontiersin.org/ article/10.3389/fncom.2017.00111.
|
| 213 |
+
Peter Dayan. Improving generalization for temporal difference learning: The successor representation. Neural computation, 5(4):613–624, 1993.
|
| 214 |
+
Damir Dobric, Andreas Pech, Bogdan Ghita, and Thomas Wennekers. On the importance of the newborn stage when learning patterns with the spatial pooler. SN Computer Science, 3(2):179, 2022.
|
| 215 |
+
Yogesh K Dwivedi, Nir Kshetri, Laurie Hughes, Emma Louise Slade, Anand Jeyaraj, Arpan Kumar Kar, Abdullah M Baabdullah, Alex Koohang, Vishnupriya Raghavan, Manju Ahuja, et al. “so what if chatgpt wrote it?” multidisciplinary perspectives on opportunities, challenges and implications of generative conversational ai for research, practice and policy. International Journal of Information Management, 71:102642, 2023.
|
| 216 |
+
Gokcen Eraslan, ¨ Ziga Avsec, Julien Gagneur, and Fabian J Theis. Deep learning: new computational ˇ modelling techniques for genomics. Nature Reviews Genetics, 20(7):389–403, 2019.
|
| 217 |
+
Karl Friston, Thomas FitzGerald, Francesco Rigoli, Philipp Schwartenbeck, Giovanni Pezzulo, et al. Active inference and learning. Neuroscience & Biobehavioral Reviews, 68:862–879, 2016.
|
| 218 |
+
Karl J Friston, Richard Rosch, Thomas Parr, Cathy Price, and Howard Bowman. Deep temporal models and active inference. Neuroscience & Biobehavioral Reviews, 90:486–501, 2018.
|
| 219 |
+
Dileep George and Jeff Hawkins. Towards a mathematical theory of cortical micro-circuits. PLoS computational biology, 5(10):e1000532, 2009.
|
| 220 |
+
Dileep George, Rajeev V. Rikhye, Nishad Gothoskar, J. Swaroop Guntupalli, Antoine Dedieu, and Miguel Lazaro-Gredilla. Clone-structured graph representations enable flexible learning and vi- ´ carious evaluation of cognitive maps. Nature Communications, 12(11):2392, Apr 2021. ISSN 2041-1723. doi: 10.1038/s41467-021-22559-5.
|
| 221 |
+
Z. Ghahramani and M.I. Jordan. Factorial Hidden Markov Models. Machine Learning, 29(2-3): 245–273, 1997. ISSN 0885-6125. doi: 10.1023/a:1007425814087.
|
| 222 |
+
Zoubin Ghahramani and Michael Jordan. Factorial hidden markov models. Advances in neural information processing systems, 8, 1995.
|
| 223 |
+
David Ha and Jurgen Schmidhuber. World models. ¨ arXiv preprint arXiv:1803.10122, 2018.
|
| 224 |
+
Danijar Hafner, Jurgis Pasukonis, Jimmy Ba, and Timothy Lillicrap. Mastering diverse domains through world models. arXiv preprint arXiv:2301.04104, 2023.
|
| 225 |
+
GM Harshvardhan, Mahendra Kumar Gourisaria, Manjusha Pandey, and Siddharth Swarup Rautaray. A comprehensive survey and analysis of generative models in machine learning. Computer Science Review, 38:100285, 2020.
|
| 226 |
+
Jeff Hawkins and Subutai Ahmad. Why neurons have thousands of synapses, a theory of sequence memory in neocortex. Frontiers in Neural Circuits, 10, March 2016. ISSN 1662-5110. doi: 10.3389/fncir.2016.00023. URL http://journal.frontiersin.org/Article/10. 3389/fncir.2016.00023/abstract.
|
| 227 |
+
Donald Olding Hebb. The organization of behavior: A neuropsychological theory. Psychology press, 2005.
|
| 228 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9:1735– 80, 12 1997. doi: 10.1162/neco.1997.9.8.1735.
|
| 229 |
+
Mehdi Jafarnia Jahromi, Rahul Jain, and Ashutosh Nayyar. Online learning for unknown partially observable mdps. In International Conference on Artificial Intelligence and Statistics, pp. 1712– 1732. PMLR, 2022.
|
| 230 |
+
Shulei Ji, Jing Luo, and Xinyu Yang. A comprehensive survey on deep music generation: Multi-level representations, algorithms, evaluations, and future directions. arXiv preprint arXiv:2011.06801, 2020.
|
| 231 |
+
F.R. Kschischang, B.J. Frey, and H.-A. Loeliger. Factor graphs and the sum-product algorithm. IEEE Transactions on Information Theory, 47(2):498–519, 2001. doi: 10.1109/18.910572.
|
| 232 |
+
Petr Kuderov, Evgenii Dzhivelikian, and Aleksandr I Panov. Stabilize sequential data representation via attraction module. In International Conference on Brain Informatics, pp. 83–95. Springer, 2023.
|
| 233 |
+
Timothy P. Lillicrap, Adam Santoro, Luke Marris, Colin J. Akerman, and Geoffrey Hinton. Backpropagation and the brain. Nature Reviews Neuroscience, 21(6):335–346, Jun 2020. ISSN 1471- 003X, 1471-0048. doi: 10.1038/s41583-020-0277-3.
|
| 234 |
+
Zachary C Lipton, John Berkowitz, and Charles Elkan. A critical review of recurrent neural networks for sequence learning. arXiv preprint arXiv:1506.00019, 2015.
|
| 235 |
+
Michael London and Michael Hausser. Dendritic computation. ¨ Annu. Rev. Neurosci., 28:503–532, 2005.
|
| 236 |
+
Christoph Mathys, Jean Daunizeau, Karl J Friston, and Klaas E Stephan. A bayesian foundation for individual learning under uncertainty. Frontiers in human neuroscience, 5:39, 2011.
|
| 237 |
+
Bonan Min, Hayley Ross, Elior Sulem, Amir Pouran Ben Veyseh, Thien Huu Nguyen, Oscar Sainz, Eneko Agirre, Ilana Heintz, and Dan Roth. Recent advances in natural language processing via large pre-trained language models: A survey. ACM Computing Surveys, 2021.
|
| 238 |
+
James Mnatzaganian, Ernest Fokoue, and Dhireesha Kudithipudi. A mathematical formalization of ´ hierarchical temporal memory’s spatial pooler. Frontiers in Robotics and AI, 3, 2017. ISSN 2296- 9144. URL https://www.frontiersin.org/articles/10.3389/frobt.2016. 00081.
|
| 239 |
+
Thomas M Moerland, Joost Broekens, Aske Plaat, Catholijn M Jonker, et al. Model-based reinforcement learning: A survey. Foundations and Trends® in Machine Learning, 16(1):1–118, 2023.
|
| 240 |
+
V. Mountcastle. The columnar organization of the neocortex. Brain, 120(4):701–722, April 1997. ISSN 14602156. doi: 10.1093/brain/120.4.701. URL https://academic.oup.com/ brain/article-lookup/doi/10.1093/brain/120.4.701.
|
| 241 |
+
Antonio Orvieto, Samuel L Smith, Albert Gu, Anushan Fernando, Caglar Gulcehre, Razvan Pascanu, and Soham De. Resurrecting recurrent neural networks for long sequences. arXiv preprint arXiv:2303.06349, 2023.
|
| 242 |
+
Matthias Oster, Rodney Douglas, and Shih-Chii Liu. Computation with spikes in a winner-take-all network. Neural Computation, 21(9):2437–2465, 09 2009. doi: 10.1162/neco.2009.07-08-829.
|
| 243 |
+
Randall C. O’Reilly, Jacob L. Russin, Maryam Zolfaghar, and John Rohrlich. Deep predictive learning in neocortex and pulvinar. Journal of Cognitive Neuroscience, 33(6):1158–1196, May 2021. ISSN 0898-929X. doi: 10.1162/jocn a 01708.
|
| 244 |
+
Thomas Parr and Karl J Friston. Working memory, attention, and salience in active inference. Scientific reports, 7(1):14678, 2017.
|
| 245 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, highperformance deep learning library. In Advances in Neural Information Processing Systems 32, pp. 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library. pdf.
|
| 246 |
+
Bo Peng, Eric Alcaide, Quentin Anthony, Alon Albalak, Samuel Arcadinho, Huanqi Cao, Xin Cheng, Michael Chung, Matteo Grella, Kranthi Kiran GV, et al. Rwkv: Reinventing rnns for the transformer era. arXiv preprint arXiv:2305.13048, 2023.
|
| 247 |
+
Rodrigo Perin, Thomas K Berger, and Henry Markram. A synaptic organizing principle for cortical neuronal groups. Proceedings of the National Academy of Sciences, 108(13):5419–5424, 2011.
|
| 248 |
+
Pascal Poupart. Exploiting structure to efficiently solve large scale partially observable Markov decision processes. Citeseer, 2005.
|
| 249 |
+
Achille Salaun, Yohan Petetin, and Franc¸ois Desbouvries. Comparing the modeling powers of rnn ¨ and hmm. In 2019 18th ieee international conference on machine learning and applications (icmla), pp. 1496–1499. IEEE, 2019.
|
| 250 |
+
Jochen F. Staiger and Carl C. H. Petersen. Neuronal circuits in barrel cortex for whisker sensory perception. Physiological Reviews, 101(1):353–415, 2021. doi: 10.1152/physrev.00019.2019. URL https://doi.org/10.1152/physrev.00019.2019. PMID: 32816652.
|
| 251 |
+
Greg J. Stuart and Nelson Spruston. Dendritic integration: 60 years of progress. Nature Neuroscience, 18(12):1713–1721, Dec 2015. ISSN 1546-1726. doi: 10.1038/nn.4157. URL https://doi.org/10.1038/nn.4157.
|
| 252 |
+
Jingyu Zhao, Feiqing Huang, Jia Lv, Yanjie Duan, Zhen Qin, Guodong Li, and Guangjian Tian. Do rnn and lstm have long memory? In International Conference on Machine Learning, pp. 11365–11375. PMLR, 2020.
|
| 253 |
+
|
| 254 |
+
# A ENCODING AND DECODING OBSERVATIONS
|
| 255 |
+
|
| 256 |
+
Because our model is designed to work with sparse distributed representations and the testing environments do not provide observations as SDRs by default, an encoding procedure is required. For this task, we use a modified version of the Spatial Pooler (SP) (Cui et al., 2017; Mnatzaganian et al., 2017), a distributed noise-tolerant online clustering neural network algorithm that converts input binary patterns into SDRs with fixed sparsity while retaining pairwise similarity (Kuderov et al., 2023). The SP algorithm learns a spatial specialization of neurons’ receptive fields using the local Hebbian rule and $\mathbf { k }$ -WTA $k$ winners take all) inhibition (Oster et al., 2009). Here we outline the main differences from the “vanilla” version of the SP algorithm described in Cui et al. (2017).
|
| 257 |
+
|
| 258 |
+
During an agent’s decision-making process pipeline, the SP encoder accepts a current observation $o$ and transforms it to a latent state SDR $z$ . In terms of processing, our SP encoder functions as a standard artificial neural network with a $\mathbf { k }$ -WTA binary activation function.:
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\begin{array} { r } { \mathrm { o v e r l a p s } _ { i } = \beta _ { i } W _ { i } o \qquad } \\ { z _ { i } = \mathbb { I } \left[ i \in \mathrm { k W T A ( o v e r l a p s ) } \right] , } \end{array}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
where $o { \mathrm { - } } { \mathrm { a } }$ binary observation vector, $W _ { i }$ —a row-vector representing $i$ -th neuron’s connection weights (where non-existing connections have zero weights), overlaps $_ i$ —a value representing the strength of the input pattern recognition with the neuron $i ^ { 1 }$ , $\beta _ { i }$ —an $i$ -th neuron boosting value, $z _ { i }$ — an $i$ -th bit of an output SDR, $\mathbb { I } [ . . . ] .$ —an indicator function, kWTA—a $k$ -winners-take-all activation function returning $k$ indices of the neurons with the highest overlap.
|
| 265 |
+
|
| 266 |
+
One difference between the “vanilla” SP algorithm and ours is that we do not distinguish between potential and active neural connections. Because all [existing] connections are active, they all participate in calculating overlaps. In the overlaps calculation, non-binary, that is, real-valued weights are used, similar to artificial neural networks, as shown in equation 10. Furthermore, each neuron has a fixed capacity to produce neurotransmitters, which it distributes between its synaptic connections. This means that we keep all neuron weights normalized and summed to one. While it achieves the same Hebbian learning with homeostatic plasticity as the original SP, the exact formula is slightly different:
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\begin{array} { l } { { \displaystyle \tilde { W } _ { i } = W _ { i } + \alpha z _ { i } \frac { \mathrm { R F } _ { i } \odot o } { \sum _ { j } \mathrm { R F } _ { i } \odot o } } } \\ { { \displaystyle W _ { i } \gets \frac { \tilde { W } _ { i } } { \sum _ { j } \tilde { W } _ { i } } , } } \end{array}
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
where $\tilde { W } _ { i }$ —a row of new $i$ -th neuron weights before normalization, $\alpha$ —learning rate, $z _ { i }$ —a binary value representing the current activity state of the $i$ -th neuron, $R F _ { i }$ —an $i$ -th row of the binary connectivity matrix representing an $i$ -th neuron receptive field, $\odot$ —elementwise product, $o$ —a binary observation vector.
|
| 273 |
+
|
| 274 |
+
The original SP algorithm has several drawbacks, including encoding instability caused by an innate homeostatic plasticity mechanism known as boosting, which helps neurons specialize and increases overall adaptability but makes memorization tasks more difficult, and slow processing on large inputs such as images, where an encoding overhead becomes noticeable when compared to overall model timings around 1k input size.
|
| 275 |
+
|
| 276 |
+
The introduction of the newborn stage, which follows the ideas proposed in Dobric et al. (2022), solves an encoding instability problem. The newborn stage of a spatial pooler occurs during the early stages of its learning process, when its neurons are expected to specialize. The boosting, which is intended to aid in the specialization process, is activated only during the newborn stage and its scale gradually decreases from the configured value to zero. Boosting remains turned off during an encoder’s “adulthood”, reducing the possibility of spontaneous re-specialization.
|
| 277 |
+
|
| 278 |
+
To reduce processing overhead, we use a much more sparsified connection matrix than in the original SP version. We randomly initialize connections with $40 \%$ sparsity, which is typical for the “vanilla” SP. Then, during the newborn stage, we gradually prune the vast majority of the weakest connections, resulting in neurons that are highly specialized due to their small receptive fields. We typically configure the final receptive field size in relation to the average input pattern size (usually $2 5 \mathrm { - } 2 0 0 \%$ of it, resulting in $0 . 1 \%$ connections sparsity). For example, if binary input patterns have on average 100 active bits out of 1000, we can set the target size of receptive fields to 25, which is $2 5 \%$ of the active input size and corresponds to $2 . 5 \%$ connection matrix sparsity. As a result, the spatial pooler’s instability (and thus adaptiveness!) becomes even more limited in the adult stage.
|
| 279 |
+
|
| 280 |
+
Because of its soft discretization (from the distributed representation) and clusterization properties, we expect SP to assist the model with input sequence memorization and an environment transition dynamics generalization tasks in addition to the encoding itself. However, because the SP encoder learns online, particularly during the newborn stage, its output representation can be highly unstable during the early stages, potentially resulting in a performance drop.
|
| 281 |
+
|
| 282 |
+
To visualize and debug an encoded observation, we also learn a decoder, which is a linear neural layer learned locally with gradient descend on the MSE error between the predicted reconstruction and the actual observation.
|
| 283 |
+
|
| 284 |
+
# B VALUE FUNCTION DECOMPOSITION
|
| 285 |
+
|
| 286 |
+
In our agent model, we approximate the reward function R(s) as a sum: $\begin{array} { r } { R _ { t } = \frac { 1 } { n } \sum _ { k = 1 } ^ { n } r ( \varphi _ { t } ^ { k } ) \varphi _ { t } ^ { k } } \end{array}$ , where $r ( \varphi _ { t } ^ { k } )$ is a reward associated with state $\varphi _ { t } ^ { k }$ , $n$ –number of feature variables. Then, similarly to the Successor Representation idea (see Section 2.3), the value function can be represented as:
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\begin{array} { l } { { \displaystyle V ( h _ { t } ) = \mathrm { E } [ \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } R _ { t + l + 1 } \mid h _ { t } ] = \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } \mathrm { E } [ \frac { 1 } { n } \sum _ { k = 1 } ^ { n } r ( \varphi _ { t } ^ { k } ) \mid h _ { t } ] } } \\ { ~ = \frac { 1 } { n } \sum _ { k = 1 } ^ { n } \sum _ { j } \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } p ( \varphi _ { t + l + 1 } ^ { k } = j \mid h _ { t } ^ { k } ) r _ { j } ^ { k } } \\ { ~ = \frac { 1 } { n } \sum _ { k = 1 } ^ { n } \sum _ { j } M _ { j } ^ { k } ( h _ { t } ^ { k } ) r _ { j } ^ { k } , } \end{array}
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
where $\begin{array} { r } { M _ { j } ^ { k } ( h _ { t } ^ { k } ) = \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } p ( \varphi _ { t + l + 1 } ^ { k } = j \ | \ h _ { t } ^ { k } ) } \end{array}$ , $h _ { t } = ( h _ { t } ^ { 1 } , . . . , h _ { t } ^ { n } ) \mathrm { . }$ —hidden state vector of variables $\{ H _ { t } ^ { k } \} _ { k }$ .
|
| 293 |
+
|
| 294 |
+
Then, the temporal difference for $M _ { i j } ^ { k } = M _ { j } ^ { k } ( h _ { t } ^ { k } = i )$ is:
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\delta _ { i j } ^ { k } = \sum _ { l = 0 } ^ { T } \gamma ^ { l } p ( \varphi _ { t + l + 1 } ^ { k } = j \mid h _ { t } ^ { k } = i ) ) + \gamma ^ { T + 1 } \sum _ { m } M _ { m j } ^ { k } p ( h _ { t + T + 1 } ^ { k } = m \mid h _ { t } ^ { k } = i ) - M _ { i j } ^ { k } ,
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
However, in POMDP we can’t observe $h _ { t } ^ { k }$ , we only have a distribution $p ( h _ { t } ^ { k } \mid o _ { 0 : t } )$ . Therefore, we need to average out the hidden state variable $\begin{array} { r } { \delta _ { j } ^ { k } = \sum _ { i } \delta _ { i j } ^ { k } \cdot p ( h _ { t } ^ { k } = i \mid o _ { 0 : t } ) } \end{array}$ . Assuming that we minimise $L = ( \delta _ { j } ^ { k } ) ^ { 2 }$ , we get the following update rule:
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
\begin{array} { r l } & { \delta _ { j } ^ { k } = \mathrm { g e n } _ { t + T } ( \varphi ^ { k } = j \mid o _ { 0 : t } ) + \gamma ^ { T + 1 } \mathrm { p r e d } _ { t + T + 1 } ( \varphi ^ { k } = j \mid o _ { 0 : t } ) - \displaystyle \sum _ { i } M _ { i j } ^ { k } p ( h _ { t } ^ { k } = i \mid o _ { 0 : t } ) } \\ & { M _ { i j } ^ { k } M _ { i j } ^ { k } + \alpha \delta _ { j } ^ { k } \cdot p ( h _ { t } ^ { k } = i \mid o _ { 0 : t } ) , } \end{array}
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
where $\mathrm { g e n } _ { t + T }$ —Successor Features component, generated by temporal memory up to timestep $T$ , and pred $\cdot t { + } T { + } 1$ —SF component predicted using $M _ { i j } ^ { k }$ weights:
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { r l } & { \mathrm { g e n } _ { t + T } ( \varphi ^ { k } = j \mid o _ { 0 : t } ) = \displaystyle \sum _ { l = 0 } ^ { T } \gamma ^ { l } \sum _ { i } p ( \varphi _ { t + l + 1 } ^ { k } = j \mid h _ { t } ^ { k } = i ) p ( h _ { t } ^ { k } = i \mid o _ { 0 : t } ) } \\ & { \mathrm { p r e d } _ { t + T + 1 } ( \varphi ^ { k } = j \mid o _ { 0 : t } ) = \displaystyle \sum _ { i } M _ { i j } ^ { k } p ( h _ { t + T + 1 } ^ { k } = i \mid o _ { 0 : t } ) } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
# C BIOLOGICAL INTERPRETATION
|
| 313 |
+
|
| 314 |
+
Neural implementation of the DHTM is inspired by neocortical neural networks (see Fig. 6). Hidden variables $H ^ { k }$ may be considered as populations of excitatory pyramidal neurons in cortical layer L2/3 of somatosensory areas, with lateral inhibition modelled as softmax function. Staiger & Petersen (2021) showed that neurons in this layer are responsible for temporal context formation.
|
| 315 |
+
|
| 316 |
+
The neuronal activity at timestep $t$ can be thought to carry messages $M _ { t - 1 } ^ { k }$ . Messages are propagated through synapses of dendritic segments, which correspond to factors $F _ { c } ^ { k }$ . Dendritic segments of biological neurons are known to be coincidence detectors of its synaptic input (Stuart & Spruston, 2015). We use the notion of dendritic segment to sparsely represent context factors $F _ { c } ^ { k }$ , as each factor value corresponds to a particular combination of states (or active cells).
|
| 317 |
+
|
| 318 |
+
Feature variables $\Phi _ { t } ^ { k }$ may be considered to represent cells of a granular layer (L4), as they are known to be the main hub for sensory excitation for L2/3. L2/3 cells that have common sensory input from the layer L4 are modelled as columns for particular feature states $\mathrm { c o l } ( \varphi _ { \mathrm { t } } ^ { \mathrm { k } } )$ (Mountcastle, 1997).
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 6: Biological view of the neural implementation of the DHTM. Variables $H _ { t - 1 } ^ { \cdot }$ correspond to populations of neurons that have common sensory input and lateral inhibitory competition. Dendritic segments correspond to factor values $f _ { l }$ . spike frequency of a neuron reflects state probability $p ( h _ { t } ^ { k } )$ of a variable.
|
| 322 |
+
|
| 323 |
+
# D PSEUDO-SURPRISE
|
| 324 |
+
|
| 325 |
+
To calculate the pseudo-surprise of SF, we do the following:
|
| 326 |
+
|
| 327 |
+
1. Normalize SF by summing it over corresponding variables $\Psi$ and dividing SF by these sums. The result is SF-induced probability distribution $p ( \varphi ^ { k } )$ of $\Psi ^ { k }$ variables. 2. Measure average surprise over future observed states $\varphi ^ { k }$ , according to this distribution: $- \log p ( \varphi ^ { k } = j )$ , where $j$ is the observed state.
|
| 328 |
+
|
| 329 |
+
Normalized SF represents future observation (feature) profile for the current state. Pseudo-surprise shows whether SF is consistent with the observed feature states or not. For example, if SF doesn’t predict feature $j$ ( $p ( \varphi ^ { k } = j ) = 0 ,$ ), but we observe it, this’ll result in infinite surprise, which means that the SF is of a bad quality.
|
| 330 |
+
|
| 331 |
+
# E BASELINE RL AGENTS IMPLEMENTATION
|
| 332 |
+
|
| 333 |
+
As mentioned in Section 3.3, we incorporate DHTM as a part of an RL agent, which has a memory model, an SF mapping from hidden space, and a feature reward function. Our memory model is expected to speed up SF learning for an agent. We put this hypothesis to the test by experimenting with other memory models while keeping the agent architecture the same. Thus, all tested memory models work in the same regime—they learn sequences of encoded binary observations (i.e. SDRs that we get from Spatial Pooler encoder described in Appendix A) concatenated with one-hot encoded actions.
|
| 334 |
+
|
| 335 |
+
LSTM baseline was implemented with a single LSTMCell from PyTorch library (Paszke et al., 2019). It is supported by an additional symexp-layer to encode input before passing it to the LSTM cell and a symexp-layer to decode the LSTM cell’s output from the LSTM’s hidden state back to the input representation, where symexp activation function, $\operatorname { s y m e x p } ( x ) = \operatorname { s i g n } ( x ) e ^ { | x | - 1 }$ , is a reverse of symlog function: s $\mathrm { \ y m l o g } = \mathrm { s i g n } ( x ) \log { ( | x | + 1 ) }$ .
|
| 336 |
+
|
| 337 |
+
The similar way we implemented RWKV baseline: a single RWKV layer supported by single-layer linear encoder and decoder. Current public RWKV implementation is a fast evolving framework (Bo, 2021), and for the increased performance it is tightly bound to the offline batch training common for the transformer architectures. In our case we needed a so-called sequential mode for online learning similar to LSTM. Thus, we adapted another public implementation mentioned in the official documentation (RWKV in 150 lines of code).
|
| 338 |
+
|
| 339 |
+
Both RNNs were trained online with backpropagation through time (BPTT) on the observed sequences with the backpropagation update step scheduled every $k$ timesteps. We experimented with different schedules and found that $k = 2 0$ provides a balance between the training stability and speed. The learning rate was set to $\alpha = 6 \cdot 1 \bar { 0 } ^ { - 4 }$ for LSTM and $\alpha = 5 \cdot 1 0 ^ { - 4 }$ for RWKV.
|
| 340 |
+
|
| 341 |
+
We also incorporated some notion of random variables and their states by splitting the hidden state of the tested RNNs into groups. In all experiments the hidden state represents 80 categorical variables with 4 states. That is, both RNNs are forced to learn 80 categorical distributions with multi-crossentropy loss to explain the observed sequences, which is a somewhat close to the multi-categorical hidden state representation used in DreamerV2/V3 (Hafner et al., 2023). The idea of using symexp activation function, mentioned above, is inspired by Dreamer too, and is used to remedy the problem of learning extreme probability values. Without symexp the neural network has to represent zero probability with high negative logit values and one-probability with high positive logit values, which is hard to reach with low learning rate and may lead to instabilities. Thus, symexp function makes it faster to reach target values in log space.
|
| 342 |
+
|
| 343 |
+
CSCG baseline was implemented using code from the repository accompanying the paper (https: //github.com/vicariousinc/naturecomm_cscg). In our experiments, in order to handle multiple feature variables, we trained several CSCGs independently using the same data. CSCG was trained on batches with size of 500 observation steps. We iteratively calculated exponential moving average of transition matrices obtained for different batches with smoothing coefficient $\alpha = 0 . 8$ . This smoothed transition matrix was used as initialization for the next batch training and for inference.
|
| 344 |
+
|
| 345 |
+
All baselines employed a multilayer perceptron, implemented with PyTorch, in order to map from the hidden state distribution to Successor Features because the simple linear model described in Appendix B didn’t work for them. The MLP had one hidden layer with size 256 units and batch size of 32 for CSCG and 256 for LSTM and RWKV with squared temporal difference as a loss function defined by equation 16.
|
| 346 |
+
|
| 347 |
+
# F EXPERIMENTAL SETUPS
|
| 348 |
+
|
| 349 |
+
Pinball is a partially observable environment developed in the Godot Game Engine (Beeching et al., 2021). A ball that can move in the surface’s 2D space and a surface with borders make up the environment (see Figure 7-A). Force fields depicted as circles introduce stochasticity to the environment as they deflect the ball in random directions. An agent can apply arbitrary momentum to a ball. For each time step, the environment returns an image of the top view of the table as an observation and a reward. The agent gets the reward by entering force fields. Each force field can be configured to pass a specific reward value and to terminate an episode.
|
| 350 |
+
|
| 351 |
+
AnimalAI is a testbed inspired by experiments with animals (Crosby et al., 2020). The environment consists of 3D area surrounded by a wall and many different objects that can be placed using a configuration file including: walls, food, ramps, trees, movable obstacles and so on (see Figure 7- C).
|
| 352 |
+
|
| 353 |
+
# G 2D MAZE VALUE FUNCTIONS
|
| 354 |
+
|
| 355 |
+
H GLOSSARY
|
| 356 |
+
|
| 357 |
+
Categorical Random Variable—a discrete random variable that can take on of finite $K$ possible states.
|
| 358 |
+
|
| 359 |
+
Cortical Column or Minicolumn—a population of neurons in the neocortex that spans across layers and shares sensory input.
|
| 360 |
+
|
| 361 |
+
Dendritic segment—a group of synapses (neuron’s connections) that acts as an independent computational unit affecting the resulting neuron’s activity.
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 7: A. Pinball experiments used two different setups. The upper image shows a setup in which the target is not blocked. The lower image depicts the setup, with the target obscured by a random field that deflects the ball perpendicular to its movement direction. B. Visualization of several steps in the Pinball environment. Each step is depicted by raw observation image, binary image of events, predicted events and Successor Features. C. Animal experimental setup: two corridors, one of which containing food (yellow circle), the agent is in between of the corridors (letter A). Food position changes after 300 episodes. Images on the right: observations (raw), processed observations (events), predictions and Successor Features decoded back to observation space for three last steps of an episode.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 8: Heatmaps representing value function in 2D maze Pinball environment setup.
|
| 368 |
+
|
| 369 |
+
Factor Graph—bipartite graph representing the factorization of a probability distribution, with one part representing factor nodes and another—random variables.
|
| 370 |
+
|
| 371 |
+
Multi-compartment neuron model—a model of neuron that divides neuron’s connections into groups (segments) of different types (compartments), where each group may be considered as partly independent computational unit and groups of each compartment may affect the neuron’s activity differently.
|
| 372 |
+
|
| 373 |
+
Sparse Distributed Representations (SDR)—sparse binary vector in a high-dimensional space, usually formed by $\mathbf { k }$ -WTA algorithms.
|
| 374 |
+
|
| 375 |
+
Spatial Pooler (SP)—a distributed noise-tolerant online clustering neural network algorithm that converts input binary patterns into SDRs with fixed sparsity while retaining pairwise similarity. Successor Representations (SR)—a discounted sum of future [one-hot encoded] observations. Successor Features (SF)—a generalization of SR, a discounted sum of future latent states. Temporal Memory (TM)—in this work by this term we mean “memory for sequences”. Hidden Markov Model (HMM)—statistical model of a stochastic process where state probability depends only on previous state of the process.
|
md/test/gDlsMWost9/gDlsMWost9.md
ADDED
|
@@ -0,0 +1,633 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTIMODAL CHAIN-OF-THOUGHT REASONING IN LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Large language models (LLMs) have shown impressive performance on complex reasoning by leveraging chain-of-thought (CoT) prompting to generate intermediate reasoning chains as the rationale to infer the answer. However, existing CoT studies have primarily focused on the language modality. We propose Multimodal-CoT that incorporates language (text) and vision (images) modalities into a two-stage framework that separates rationale generation and answer inference. In this way, answer inference can leverage better generated rationales that are based on multimodal information. Experimental results on ScienceQA and A-OKVQA benchmark datasets show the effectiveness of our proposed approach. With Multimodal-CoT, our model under 1 billion parameters achieves new state-of-the-art performance on the ScienceQA benchmark. Our analysis indicates that Multimodal-CoT offers the advantages of mitigating hallucination. Code is publicly available at Anonymous.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Imagine reading a textbook with no figures or tables. Our ability to knowledge acquisition is greatly strengthened by jointly modeling diverse data modalities, such as vision, language, and audio. Recently, large language models (LLMs) (Brown et al., 2020; Thoppilan et al., 2022; Rae et al., 2021; Chowdhery et al., 2022) have shown impressive performance in complex reasoning by generating intermediate reasoning steps before inferring the answer. The intriguing technique is called chain-of-thought (CoT) reasoning (Wei et al., 2022b; Kojima et al., 2022; Zhang et al., 2023c).
|
| 12 |
+
|
| 13 |
+
However, existing studies related to CoT reasoning are largely isolated in the language modality (Wang et al., 2022c; Zhou et al., 2022; Lu et al., 2022b; Fu et al., 2022), with little consideration of multimodal scenarios. To elicit CoT reasoning in multimodality, we advocate a MultimodalCoT paradigm. Given the inputs in different modalities, Multimodal-CoT decomposes multistep problems into intermediate reasoning steps (rationale) and then infers the answer. Since vision and language are the most popular modalities, we focus on those two modalities in this work. An example is shown in Figure 1.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Example of the multimodal CoT task.
|
| 17 |
+
|
| 18 |
+
In general, there are two ways to elicit Multimodal-CoT reasoning as follows: (i) prompting LLMs and (ii) fine-tuning small models.1
|
| 19 |
+
|
| 20 |
+
The most immediate way to perform Multimodal-CoT is to transform the input of different modalities into a unified modality and prompt LLMs to perform CoT (Zhang et al., 2023a; Lu et al., 2023; Liu et al., 2023; Alayrac et al., 2022; Hao et al., 2022; Yasunaga et al., 2022). For example, it is possible to generate a caption for an image by a captioning model and then concatenate the caption with the original language input to be fed into LLMs (Lu et al., 2022a). However, there is severe information loss in the captioning process; thus, using image captions (as opposed to vision features) may suffer from a lack of mutual synergy in the representation space of different modalities. In addition, LLMs either have paywalls or resource-consuming to deploy locally.
|
| 21 |
+
|
| 22 |
+
To facilitate the interaction between modalities, another potential solution is to fine-tune smaller language models (LMs) by fusing multimodal features (Zhang et al., 2023b). As this approach allows the flexibility of adjusting model architectures to incorporate multimodal features, we study fine-tuning models in this work instead of prompting LLMs. The key challenge is that language models under 100 billion parameters tend to generate hallucinated rationales that mislead the answer inference (Ho et al., 2022; Magister et al., 2022; Ji et al., 2022).
|
| 23 |
+
|
| 24 |
+
To mitigate the challenge of hallucination, we propose Multimodal-CoT that incorporates language (text) and vision (images) modalities into a two-stage framework that separates rationale generation and answer inference.2 In this way, answer inference can leverage better generated rationales that are based on multimodal information. Our experiments are conducted on the ScienceQA (Lu et al., 2022a) and A-OKVQA (Schwenk et al., 2022) datasets, which are the latest multimodal reasoning benchmarks with annotated reasoning chains.
|
| 25 |
+
|
| 26 |
+
Our method achieves new state-of-the-art performance on the ScienceQA benchmark. We find that Multimodal-CoT is beneficial in mitigating hallucination and boosting convergence. Our contributions are summarized as follows:
|
| 27 |
+
|
| 28 |
+
(i) To the best of our knowledge, this work is the first to study CoT reasoning in different modalities in scientific peer-reviewed literature.
|
| 29 |
+
(ii) We propose a two-stage framework by fine-tuning language models to fuse vision and language representations to perform Multimodal-CoT. The model is able to generate informative rationales to facilitate inferring final answers.
|
| 30 |
+
(iii) Our method achieves new state-of-the-art performance on the ScienceQA benchmark. Our work elicits the analysis of why the naive way of employing CoT fails in the context and how incorporating vision features alleviates the problem. The approach has been shown to be generally effective across tasks and backbone models.
|
| 31 |
+
|
| 32 |
+
# 2 BACKGROUND
|
| 33 |
+
|
| 34 |
+
This section reviews studies eliciting CoT reasoning by prompting and fine-tuning language models.
|
| 35 |
+
|
| 36 |
+
# 2.1 COT REASONING WITH LLMS
|
| 37 |
+
|
| 38 |
+
Recently, CoT has been widely used to elicit the multi-step reasoning abilities of LLMs (Wei et al., 2022b). Concretely, CoT techniques encourage the LLM to generate intermediate reasoning chains for solving a problem. Studies have shown that LLMs can perform CoT reasoning with two major paradigms of techniques: Zero-Shot-CoT (Kojima et al., 2022) and Few-Shot-CoT (Wei et al., 2022b; Zhang et al., 2023c). For Zero-Shot-CoT, Kojima et al. (2022) showed that LLMs are decent zero-shot reasoners by adding a prompt like “Let’s think step by step” after the test question to invoke CoT reasoning. For Few-Shot-CoT, a few step-by-step reasoning demonstrations are used as conditions for inference. Each demonstration has a question and a reasoning chain that leads to the final answer. The demonstrations are commonly obtained by hand-crafting or automatic generation. These two techniques, hand-crafting and automatic generation are thus referred to as Manual-CoT (Wei et al., 2022b) and Auto-CoT (Zhang et al., 2023c).
|
| 39 |
+
|
| 40 |
+
With effective demonstrations, Few-Shot-CoT often achieves stronger performance than Zero-ShotCoT and has attracted more research interest. Therefore, most recent studies focused on how to improve Few-Shot-CoT. Those studies are categorized into two major research lines: (i) optimizing the demonstrations; (ii) optimizing the reasoning chains. Table 1 compares typical CoT techniques.
|
| 41 |
+
|
| 42 |
+
Optimizing Demonstrations The performance of Few-Shot-CoT relies on the quality of demonstrations. As reported in Wei et al. (2022b), using demonstrations written by different annotators results in dramatic accuracy disparity in reasoning tasks. Beyond hand-crafting the demonstrations, recent studies have investigated ways to optimize the demonstration selection process. Notably, Rubin et al. (2022) retrieved the semantically similar demonstrations with the test instance. However, this approach shows a degraded performance when there are mistakes in the reasoning chains (Zhang et al., 2023c). To address the limitation, Zhang et al. (2023c) found that the key is the diversity of demonstration questions and proposed Auto-CoT: (i) partition questions of a given dataset into a few clusters; (ii) sample a representative question from each cluster and generate its reasoning chain using Zero-Shot-CoT with simple heuristics. In addition, reinforcement learning (RL) and complexitybased selection strategies were proposed to obtain effective demonstrations. Fu et al. (2022) chose examples with complex reasoning chains (i.e., with more reasoning steps) as the demonstrations. Lu et al. (2022b) trained an agent to find optimal in-context examples from a candidate pool and maximize the prediction rewards on given training examples when interacting with GPT-3.5.
|
| 43 |
+
|
| 44 |
+
Table 1: Representative CoT techniques (FT: fine-tuning; KD: knowledge distillation). Segment 1: in-context learning techniques; Segment 2: fine-tuning techniques. To the best of our knowledge, our work is the first to study CoT reasoning in different modalities in scientific peer-reviewed literature. Besides, we focus on 1B-models, without relying on the outputs of LLMs.
|
| 45 |
+
|
| 46 |
+
<table><tr><td>Models</td><td>Mutimodal Model/Engine Training</td><td></td><td></td><td>CoTRole</td><td>CoT Source</td></tr><tr><td>Zero-Shot-CoT (Keimal.t l2)</td><td>xxxx</td><td>GPT-M5(17B)</td><td>ICL</td><td>Reasoning</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>HTemprated</td></tr><tr><td>Self-Consistency-CoT (Wang et al.,2022b)</td><td></td><td>Codex (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Least-to-Most Prompting (Zhou et al., 2022)</td><td></td><td>Codex (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Retrieval-CoT (Zhang et al., 2023c)</td><td>X</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Auto-generated</td></tr><tr><td>PromptPG-CoT (Lu et al., 2022b)</td><td>X</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Auto-CoT (Zhang et al., 2023c)</td><td>X</td><td>Codex (175B)</td><td>ICL</td><td>Reasoning</td><td>Auto-generated</td></tr><tr><td>Complexity-CoT (Fu et al.,2022)</td><td>X</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Few-Shot-PoT (Chen et al., 2022)</td><td>×</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>UnifiedQA (Lu et al., 2022a)</td><td>X</td><td>T5 (770M)</td><td>FT</td><td>Explanation</td><td>Crawled</td></tr><tr><td>Fine-Tuned T5 XXL (Magister et al.,2022)</td><td>X</td><td>T5 (11B)</td><td>KD</td><td></td><td>Reasoning LLM-generated</td></tr><tr><td>Fine-Tune-CoT (Ho et al.,2022)</td><td></td><td>GPT-3 (6.7B)</td><td>KD</td><td></td><td>Reasoning LLM-generated</td></tr><tr><td>Multimodal-CoT (our work)</td><td>√</td><td>T5 (770M)</td><td>FT</td><td>Reasoning</td><td>Crawled</td></tr></table>
|
| 47 |
+
|
| 48 |
+
Optimizing Reasoning Chains A notable way to optimize reasoning chains is problem decomposition. Zhou et al. (2022) proposed least-to-most prompting to decompose complex problems into sub-problems and then solve these sub-problems sequentially. As a result, solving a given subproblem is facilitated by the answers to previously solved sub-problems. Similarly, Khot et al. (2022) used diverse decomposition structures and designed different prompts to answer each sub-question. In addition to prompting the reasoning chains as natural language texts, Chen et al. (2022) proposed program-of-thoughts (PoT), which modeled the reasoning process as a program and prompted LLMs to derive the answer by executing the generated programs. Another trend is to vote over multiple reasoning paths for a test question. Wang et al. (2022b) introduced a self-consistency decoding strategy to sample multiple outputs of LLMs and then took a majority over the final answers. Wang et al. (2022c) and Li et al. (2022c) introduced randomness in the input space to produce more diverse outputs for voting.
|
| 49 |
+
|
| 50 |
+
# 2.2 ELICITING COT REASONING BY FINE-TUNING MODELS
|
| 51 |
+
|
| 52 |
+
A recent interest is eliciting CoT reasoning by fine-tuning language models. Lu et al. (2022a) finetuned the encoder-decoder T5 model on a large-scale dataset with CoT annotations. However, a dramatic performance decline is observed when using CoT to infer the answer, i.e., generating the reasoning chain before the answer (reasoning). Instead, CoT is only used as an explanation after the answer. Magister et al. (2022) and Ho et al. (2022) employed knowledge distillation by fine-tuning a student model on the chain-of-thought outputs generated by a larger teacher model. Wang et al. (2022a) proposed an iterative context-aware prompting approach to dynamically synthesize prompts conditioned on the current step’s contexts.
|
| 53 |
+
|
| 54 |
+
There is a key challenge in training 1B-models to be CoT reasoners. As observed by Wei et al. (2022b), models under 100 billion parameters tend to produce illogical CoT that leads to wrong answers. In other words, it might be harder for 1B-models to generate effective CoT than directly generating the answer. It becomes even more challenging in a multimodal setting where answering the question also requires understanding the multimodal inputs. In the following part, we will explore the challenge of Multimodal-CoT and investigate how to perform effective multi-step reasoning.
|
| 55 |
+
|
| 56 |
+
# 3 CHALLENGE OF MULTIMODAL-COT
|
| 57 |
+
|
| 58 |
+
Existing studies have suggested that the CoT reasoning ability may emerge in language models at a certain scale, e.g., over 100 billion parameters (Wei et al., 2022a). However, it remains an unresolved challenge to elicit such reasoning abilities in 1B-models, let alone in the multimodal scenario. This work focuses on 1B-models as they can be fine-tuned and deployed with consumer-grade GPUs (e.g., 32G memory). In this section, we will investigate why 1B-models fail at CoT reasoning and study how to design an effective approach to overcome the challenge.
|
| 59 |
+
|
| 60 |
+
# 3.1 TOWARDS THE ROLE OF COT
|
| 61 |
+
|
| 62 |
+
To begin with, we fine-tune a text-only baseline for CoT reasoning on the ScienceQA benchmark (Lu et al., 2022a). We adopt FLAN-AlpacaBase as the backbone language model.3 Our task is modeled as a text generation problem, where the model takes the textual information as the input and generates the output sequence that consists of the rationale and the answer. As an example shown in Figure 1, the model takes the concatenation of tokens of the question text (Q), the context text (C), and multiple options (M) as the input. To study the effect of CoT, we compare the performance with three variants: (i) $\tt N o - C o T$ which predicts the answer directly $\mathrm { ( Q C M \to A ) }$ ); (ii) Reasoning where answer inference is conditioned to the rationale $( \mathbf { Q C M } { } \mathbf { R A } )$ ; (iii) Explanation where the rationale is used for explaining the answer inference $\mathrm { Q C M } { } \mathrm { A R }$ ).
|
| 63 |
+
|
| 64 |
+
Surprisingly, we observe a $\downarrow 1 2 . 3 1 \%$ accuracy decrease $8 1 . 6 3 \% 6 9 . 3 2 \% )$ if the model predicts rationales before answers $( \mathrm { Q C M } { } \mathrm { R A } )$ ). The results imply that the rationales might not necessarily contribute to predicting the right answer. According to Lu et al. (2022a), the plausible reason might be that the model exceeds the maximum token limits before ob
|
| 65 |
+
|
| 66 |
+
Table 2: Effects of CoT in the one-stage setting.
|
| 67 |
+
|
| 68 |
+
<table><tr><td>Method</td><td>Format</td><td>Accuracy</td></tr><tr><td>No-CoT</td><td>QCM→A</td><td>81.63</td></tr><tr><td>Reasoning</td><td>QCM→RA</td><td>69.32</td></tr><tr><td>Explanation</td><td>QCM→AR</td><td>69.68</td></tr></table>
|
| 69 |
+
|
| 70 |
+
taining the required answer or stops generating the prediction early. However, we find that the maximum length of the generated outputs (RA) is always less than 400 tokens, which is below the length limit of language models (i.e., 512 in T5 models). Therefore, it deserves a more in-depth investigation into why the rationales harm answer inference.
|
| 71 |
+
|
| 72 |
+
# 3.2 MISLEADING BY HALLUCINATED RATIONALES
|
| 73 |
+
|
| 74 |
+
To dive into how the rationales affect the answer prediction, we separate the CoT problem into two stages, rationale generation and answer inference.4 We report the RougeL score and accuracy for the rationale generation and answer inference, respectively. Table 3 shows the results based on the two-stage framework. Although the two-stage baseline
|
| 75 |
+
|
| 76 |
+
Table 3: Two-stage setting of (i) rationale generation (RougeL) and (ii) answer inference (Accuracy).
|
| 77 |
+
|
| 78 |
+
<table><tr><td colspan="3">Method () QCM→R(ii) QCMR→A</td></tr><tr><td>Two-Stage Framework</td><td>90.73</td><td>78.57</td></tr><tr><td>w/Captions</td><td>90.88</td><td>79.37</td></tr><tr><td>w/ Vision Features</td><td>93.46</td><td>85.31</td></tr></table>
|
| 79 |
+
|
| 80 |
+
model achieves a 90.73 RougeL score of the rationale generation, the answer inference accuracy is only $7 8 . 5 7 \%$ . Compared with the $\mathrm { Q C M } { } \mathbf { A }$ variant $( 8 1 . 6 3 \% )$ in Table 2, the result shows that the generated rationale in the two-stage framework does not improve answer accuracy.
|
| 81 |
+
|
| 82 |
+
Then, we randomly sample 50 error cases and find that the model tends to generate hallucinated rationales that mislead the answer inference. As an example shown in Figure 2, the model (left part) hallucinates that, “The south pole of one magnet is closest to the south pole of the other magnet”,
|
| 83 |
+
|
| 84 |
+
# Problem
|
| 85 |
+
|
| 86 |
+
Question: Will these magnets attract or repel each other?
|
| 87 |
+
Context: Two magnets are placed as shown. Hint: Magnets that attract pull together. Magnets that repel push apart.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
|
| 91 |
+
Options: (A) attract
|
| 92 |
+
|
| 93 |
+
(B) repel
|
| 94 |
+
|
| 95 |
+
Gold Rationale: Will these magnets attract or repel? To find out, look at which poles are closest to each other. The north pole of one magnet is closest to the south pole of the other magnet. Poles that are different attract. So, these magnets will attract each other. Answer: The answer is (A).
|
| 96 |
+
|
| 97 |
+
# Baseline
|
| 98 |
+
|
| 99 |
+
# $^ +$ Vision Features
|
| 100 |
+
|
| 101 |
+
Generated Rationale: Will these magnets attract or repel? To find out, look at which poles are closest to each other. The south pole of one magnet is closest to the south pole of the other magnet. Poles that are the same repel. So, these magnets will repel each other.
|
| 102 |
+
Answer: The answer is (B).
|
| 103 |
+
|
| 104 |
+
Generated Rationale: Will these magnets attract or repel? To find out, look at which poles are closest to each other. The north pole of one magnet is closest to the south pole of the other magnet. Poles that are different attract. So, these magnets will attract each other.
|
| 105 |
+
|
| 106 |
+
Answer: The answer is (A).
|
| 107 |
+
|
| 108 |
+
Figure 2: Example of the two-stage framework without vision features (baseline) and with vision features (ours) for generating rationales and predicting answers. The upper part presents the problem details with a gold rationale, and the lower part shows the outputs of the baseline and our method incorporated with vision features. We observe that the baseline fails to predict the right answer due to the misleading by hallucinated rationales. More examples are shown in Appendix A.1.
|
| 109 |
+
|
| 110 |
+
due to the lack of reference to the vision content. We find that such mistakes occur at a ratio of $56 \%$ among the error cases (Figure 3(a)).
|
| 111 |
+
|
| 112 |
+
# 3.3 MULTIMODALITY CONTRIBUTES TO EFFECTIVE RATIONALES
|
| 113 |
+
|
| 114 |
+
We speculate that such a phenomenon of hallucination is due to a lack of necessary vision contexts for performing effective Multimodal-CoT. To inject vision information, a simple way is to transform the image into a caption (Lu et al., 2022a) and then append the caption in the input of both stages. However, as shown in Table 3, using captions only yields marginal performance gains $( \uparrow 0 . 8 0 \% )$ . Then, we explore an advanced technique by incorporating vision features into the language model. Concretely, we feed the image to the ViT model (Dosovitskiy et al., 2021b) to extract vision features. Then we fuse the vision features with the encoded language representations before feeding the decoder (more details will be presented in Section 4). Interestingly, with vision features, the RougeL score of the rationale generation has boosted to $9 3 . 4 6 \%$ $\mathrm { Q C M } { } \mathrm { R } _ { } ^ { \circ }$ ), which correspondingly contributes to better answer accuracy of $8 5 . 3 1 \%$ $\mathrm { Q C M R { \to } A } )$ ).
|
| 115 |
+
|
| 116 |
+
With those effective rationales, the phenomenon of hallucination is mitigated — $6 0 . 7 \%$ hallucination mistakes in Section 3.2 have been corrected (Figure 3(b)), as an example shown in Figure 2 (right part).5 The analysis so far compellingly shows that vision features are indeed beneficial for generating effective rationales and contributing to accurate answer inference. As the two-stage method achieves better performance than one-stage methods, we choose the two-stage method in our MultimodalCoT framework.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 3: The ratio of (a) hallucination mistakes and (b) correction rate w/ vision features.
|
| 120 |
+
|
| 121 |
+
# 4 MULTIMODAL-COT
|
| 122 |
+
|
| 123 |
+
In light of the discussions in Section 3, we propose Multimodal-CoT to incorporate language (text) and vision (images) modalities into a two-stage framework. The key motivation is the anticipation that the answer inference can leverage better generated rationales that are based on multimodal information. In this section, we will overview the procedure of the framework and elaborate on the technical design of the model architecture.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 4: Overview of our Multimodal-CoT framework. Multimodal-CoT consists of two stages: (i) rationale generation and (ii) answer inference. Both stages share the same model structure but differ in the input and output. In the first stage, we feed the model with language and vision inputs to generate rationales. In the second stage, we append the original language input with the rationale generated from the first stage. Then, we feed the updated language input with the original vision input to the model to infer the answer.
|
| 127 |
+
|
| 128 |
+
# 4.1 FRAMEWORK OVERVIEW
|
| 129 |
+
|
| 130 |
+
Multimodal-CoT consists of two operation stages: (i) rationale generation and (ii) answer inference. Both stages share the same model structure but differ in the input $X$ and output $Y$ . The overall procedure is illustrated in Figure 4. We will take vision-language as an example to show how Multimodal-CoT works.
|
| 131 |
+
|
| 132 |
+
In the rationale generation stage, we feed the model with $X = \{ X _ { \mathrm { l a n g u a g e } } ^ { 1 } , X _ { \mathrm { v i s i o n } } \}$ where $X _ { \mathrm { l a n g u a g e } } ^ { 1 }$ represents the language input in the first stage and $X _ { \mathrm { v i s i o n } }$ represents the vision input, i.e., the image. For example, $X$ can be instantiated as a concatenation of question, context, and options of a multiple choice reasoning problem (Lu et al., 2022a) as shown in Figure 4. The goal is to learn a rationale generation model $R = F ( X )$ where $R$ is the rationale.
|
| 133 |
+
|
| 134 |
+
In the answer inference stage, the rationale to construct the language input in the sec $R$ is apped stage, ge inpwhere $X _ { \mathrm { l a } } ^ { 1 }$ nguagenotes $X _ { \mathrm { l a n g u a g e } } ^ { 2 } = X _ { \mathrm { l a n g u a g e } } ^ { 1 } \circ R$ $\circ$ concatenation. Then, we feed the updated input X′ = {X2language, Xvision} to the answer inference model to infer the final answer $A = F ( X ^ { \prime } )$ .
|
| 135 |
+
|
| 136 |
+
In both stages, we train two models with the same architecture independently. They take the annotated elements (e.g., $X R$ , $X R A$ , respectively) from the training set for supervised learning. During inference, given $X$ , the rationales for the test sets are generated using the model trained in the first stage; they are used in the second stage for answer inference.
|
| 137 |
+
|
| 138 |
+
# 4.2 MODEL ARCHITECTURE
|
| 139 |
+
|
| 140 |
+
Given language input $X _ { \mathrm { l a n g u a g e } } ~ \in ~ \{ X _ { \mathrm { l a n g u a g e } } ^ { 1 } , X _ { \mathrm { l a n g u a g e } } ^ { 2 } \}$ and vision input $X _ { \mathrm { v i s i o n } }$ , we compute the probability of generating target text $Y$ (either the rationale or the answer in Figure 4) of length $N$ by
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
p ( { \cal Y } | { \cal X } _ { \mathrm { l a n g u a g e } } , { \cal X } _ { \mathrm { v i s i o n } } ) = \prod _ { i = 1 } ^ { N } p _ { \theta } ( Y _ { i } \mid { \cal X } _ { \mathrm { l a n g u a g e } } , { \cal X } _ { \mathrm { v i s i o n } } , { \cal Y } _ { < i } ) ,
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
where $p _ { \theta } \left( Y _ { i } \mid X _ { \mathrm { l a n g u a g e } } , X _ { \mathrm { v i s i o n } } , Y _ { < i } \right)$ is implemented with a Transformer-based network (Vaswani et al., 2017). The network has three major procedures: encoding, interaction, and decoding. Specifically, we feed the language text into a Transformer encoder to obtain a textual representation, which is interacted and fused with the vision representation before being fed into the Transformer decoder.
|
| 147 |
+
|
| 148 |
+
Encoding The model $F ( X )$ takes both the language and vision inputs and obtains the text representation $H _ { \mathrm { l a n g u a g e } }$ and the image feature $H _ { \mathrm { v i s i o n } }$ by the following functions:
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\begin{array} { r c l } { H _ { \mathrm { l a n g u a g e } } } & { = } & { \mathrm { L a n g u a g e E n c o d e r } ( X _ { \mathrm { l a n g u a g e } } ) , } \\ { H _ { \mathrm { v i s i o n } } } & { = } & { W _ { h } \cdot \mathrm { V i s i o n E x t r a c t o r } ( X _ { \mathrm { v i s i o n } } ) , } \end{array}
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where LanguageEncoder(·) is implemented as a Transformer model. We use the hidden states of the last layer in the Transformer encoder as the language representation $H _ { \mathrm { l a n g u a g e } } \in \mathbb { R } ^ { n \times d }$ where $n$ denotes the length of the language input, and $d$ is the hidden dimension. Meanwhile, VisionExtractor(·) is used to vectorize the input image into vision features. Inspired by the recent success of Vision Transformers (Dosovitskiy et al., 2021a), we fetch the patch-level features by frozen vision extraction models, such as ViT (Dosovitskiy et al., 2021b). After obtaining the patch-level vision features, we apply a learnable projection matrix $W _ { h }$ to convert the shape of VisionExtractor $( X _ { \mathrm { v i s i o n } } )$ into that of $H _ { \mathrm { l a n g u a g e } }$ ; thus we have $H _ { \mathrm { v i s i o n } } \in \mathbb { R } ^ { m \times d }$ where $m$ is the number of patches.
|
| 155 |
+
|
| 156 |
+
Note that our approach is general to both scenarios with or without image context. For the questions without associated images, we use all-zero vectors as the “blank features” with the same shape as the normal image features to tell the model to ignore them.
|
| 157 |
+
|
| 158 |
+
Interaction After obtaining language and vision representations, we use a single-head attention network to correlate text tokens with image patches, where the query $( Q )$ , key $( K )$ and value $( V )$ are $H _ { \mathrm { l a n g u a g e } }$ , $H _ { \mathrm { v i s i o n } }$ and $H _ { \mathrm { v i s i o n } }$ , respectively. The attention output $H _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } \in \mathbb { R } ^ { n \times d }$ is defined as:
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
H _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } = \mathrm { S o f t m a x } ( \frac { Q K ^ { \top } } { \sqrt { d _ { k } } } ) V ,
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $d _ { k }$ is the same as the dimension of $H _ { \mathrm { l a n g u a g e } }$ because a single head is used.
|
| 165 |
+
|
| 166 |
+
Then, we apply the gated fusion mechanism (Zhang et al., 2020; Wu et al., 2021; Li et al., 2022a) to fuse $H _ { \mathrm { l a n g u a g e } }$ and $H _ { \mathrm { v i s i o n } }$ . The fused output $\dot { H } _ { \mathrm { f u s e } } \in \mathbb { R } ^ { n \times d }$ is obtained by:
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\begin{array} { r c l } { { \lambda } } & { { = } } & { { \mathrm { S i g m o i d } ( W _ { l } H _ { \mathrm { l a n g u a g e } } + W _ { v } H _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } ) , } } \\ { { { \cal H } _ { \mathrm { f u s e } } } } & { { = } } & { { ( 1 - \lambda ) \cdot { \cal H } _ { \mathrm { l a n g u a g e } } + \lambda \cdot { \cal H } _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } , } } \end{array}
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
where $W _ { l }$ and $W _ { v }$ are learnable parameters.
|
| 173 |
+
|
| 174 |
+
Decoding Finally, the fused output $H _ { \mathrm { f u s e } }$ is fed into the Transformer decoder to predict the target $Y$
|
| 175 |
+
|
| 176 |
+
# 5 EXPERIMENTS
|
| 177 |
+
|
| 178 |
+
This section will present the benchmark dataset, the implementation of our technique, and the baselines for comparisons. Then, we will report our main results and findings.
|
| 179 |
+
|
| 180 |
+
# 5.1 DATASET
|
| 181 |
+
|
| 182 |
+
Our method is evaluated on the ScienceQA (Lu et al., 2022a) and A-OKVQA (Schwenk et al., 2022) benchmark datasets. ScienceQA is a large-scale multimodal science question dataset with annotated lectures and explanations. It contains $2 1 k$ multimodal multiple choice questions with rich domain diversity across 3 subjects, 26 topics, 127 categories, and 379 skills. There are $1 2 k , 4 k$ , and $4 k$ questions in the training, validation, and test splits, respectively. A-OKVQA is a knowledgebased visual question answering benchmark, which has $2 5 k$ questions requiring a broad base of commonsense and world knowledge to answer. It has $1 7 k / 1 k / 6 k$ questions for train/val/test. To keep consistency with ScienceQA, we use the multiple-choice setting.
|
| 183 |
+
|
| 184 |
+
# 5.2 IMPLEMENTATION
|
| 185 |
+
|
| 186 |
+
The following part presents the experimental settings of Multimodal-CoT and the baseline methods.
|
| 187 |
+
|
| 188 |
+
Experimental Settings We adopt the T5 encoder-decoder architecture (Raffel et al., 2020) under Base (200M) and large (700M) settings in our framework. We apply FLAN-Alpaca to initialize our model weights.6 We will show that Multimodal-CoT is generally effective with other backbone LMs, such as UnifiedQA (Khashabi et al., 2020) and FLAN-T5 (Chung et al., 2022) (Section 6.1). The vision features are obtained by the frozen ViT-large encoder (Dosovitskiy et al., 2021b). We fine-tune the models up to 20 epochs, with a learning rate of 5e-5. The maximum input sequence length is 512. The batch size is 8. Our experiments are run on 8 NVIDIA Tesla V100 32G GPUs.
|
| 189 |
+
|
| 190 |
+
Table 4: Main results $( \% )$ . Size $=$ backbone model size from the ScienceQA leaderboard (“-” means unavailable or unknown). Question classes: $\mathbf { N A T } =$ natural science, $\mathrm { S O C = }$ social science, $\mathrm { L A N } =$ language science, TXT $=$ text context, $\mathbf { I M G } =$ image context, $\mathbf { N O } = \mathbf { n o }$ context, ${ \mathrm { G } } 1 { - } 6 =$ grades 1-6, $G 7 - 1 2 =$ grades 7-12. Segment 1: Human performance; Segment 2: VQA baselines; Segment 3: LM baselines, i.e., UnifiedQA and few-shot learning LLMs; Segment 4: Fine-tuned large vision-language models; Segment 5: Our Multimodal-CoT results. Prior published best results are marked with an underline. Our best average result is in bold face. $\dagger$ denotes concurrent studies after this work.
|
| 191 |
+
|
| 192 |
+
<table><tr><td>Model</td><td>Size</td><td>NAT</td><td>SOC</td><td>LAN</td><td>TXT</td><td>IMG</td><td>NO</td><td>G1-6</td><td>G7-12</td><td>Avg</td></tr><tr><td>Human</td><td></td><td>90.23</td><td>84.97</td><td>87.48</td><td>89.60</td><td>87.50</td><td>88.10</td><td>91.59</td><td>82.42</td><td>88.40</td></tr><tr><td>MCAN (Yu et al., 2019)</td><td>95M</td><td>56.08</td><td>46.23</td><td>58.09</td><td>59.43</td><td>51.17</td><td>55.40</td><td>51.65</td><td>59.72</td><td>54.54</td></tr><tr><td>Top-Down (Anderson et al., 2018)</td><td>70M</td><td>59.50</td><td>54.33</td><td>61.82</td><td>62.90</td><td>54.88</td><td>59.79</td><td>57.27</td><td>62.16</td><td>59.02</td></tr><tr><td>BAN (Kim et al., 2018)</td><td>112M</td><td>60.88</td><td>46.57</td><td>66.64</td><td>62.61</td><td>52.60</td><td>65.51</td><td>56.83</td><td>63.94</td><td>59.37</td></tr><tr><td>DFAF (Gao et al.,2019)</td><td>74M</td><td>64.03</td><td>48.82</td><td>63.55</td><td>65.88</td><td>54.49</td><td>64.11</td><td>57.12</td><td>67.17</td><td>60.72</td></tr><tr><td>ViLT (Kim et al., 2021)</td><td>113M</td><td>60.48</td><td>63.89</td><td>60.27</td><td>63.20</td><td>61.38</td><td>57.00</td><td>60.72</td><td>61.90</td><td>61.14</td></tr><tr><td>Patch-TRM (Lu et al.,2021)</td><td>90M</td><td>65.19</td><td>46.79</td><td>65.55</td><td>66.96</td><td>55.28</td><td>64.95</td><td>58.04</td><td>67.50</td><td>61.42</td></tr><tr><td>VisualBERT (Li et al., 2019)</td><td>111M</td><td>59.33</td><td>69.18</td><td>61.18</td><td>62.71</td><td>62.17</td><td>58.54</td><td>62.96</td><td>59.92</td><td>61.87</td></tr><tr><td>UnifiedQA (Lu et al., 2022a)</td><td>223M</td><td>71.00</td><td>76.04</td><td>78.91</td><td>66.42</td><td>66.53</td><td>81.81</td><td>77.06</td><td>68.82</td><td>74.11</td></tr><tr><td>GPT-3.5 (text-davinci-002) (Luet al.,2022a)</td><td>173B</td><td>75.44</td><td>70.87</td><td>78.09</td><td>74.68</td><td>67.43</td><td>79.93</td><td>78.23</td><td>69.68</td><td>75.17</td></tr><tr><td>GPT-3.5 (text-davinci-003)</td><td>173B</td><td>77.71</td><td>68.73</td><td>80.18</td><td>75.12</td><td>67.92</td><td>81.81</td><td>80.58</td><td>69.08</td><td>76.47</td></tr><tr><td>ChatGPT (Lu et al., 2023)</td><td></td><td>78.82</td><td>70.98</td><td>83.18</td><td>77.37</td><td>67.92</td><td>86.13</td><td>80.72</td><td>74.03</td><td>78.31</td></tr><tr><td>GPT-4 (Lu et al.,2023)</td><td>=</td><td>85.48</td><td>72.44</td><td>90.27</td><td>82.65</td><td>71.49</td><td>92.89</td><td>86.66</td><td>79.04</td><td>83.99</td></tr><tr><td>Chameleon (ChatGPT) (Lu et al.,2023)t</td><td>=</td><td>81.62</td><td>70.64</td><td>84.00</td><td>79.77</td><td>70.80</td><td>86.62</td><td>81.86</td><td>76.53</td><td>79.93</td></tr><tr><td>Chameleon (GPT-4) (Lu et al.,2023)†</td><td>-</td><td>89.83</td><td>74.13</td><td>89.82</td><td>88.27</td><td>77.64</td><td>92.13</td><td>88.03</td><td>83.72</td><td>86.54</td></tr><tr><td>LLaMA-Adapter (Zhang et al.,2023a)t</td><td>6B</td><td>84.37</td><td>88.30</td><td>84.36</td><td>83.72</td><td>80.32</td><td>86.90</td><td>85.83</td><td>84.05</td><td>85.19</td></tr><tr><td>LLaVA (Liu et al.,2023)†</td><td>13B</td><td>90.36</td><td>95.95</td><td>88.00</td><td>89.49</td><td>88.00</td><td>90.66</td><td>90.93</td><td>90.90</td><td>90.92</td></tr><tr><td>InstructBLIP (Dai et al.,2023)t</td><td>11B</td><td>-</td><td>-</td><td></td><td></td><td>90.70</td><td>1</td><td>-</td><td></td><td></td></tr><tr><td>Mutimodal-CoTBase</td><td>223M</td><td>84.06</td><td>92.35</td><td>82.18</td><td>82.75</td><td>82.75</td><td>84.74</td><td>85.79</td><td>84.44</td><td>85.31</td></tr><tr><td>Mutimodal-CoTLarge</td><td>738M</td><td>91.03</td><td>93.70</td><td>86.64</td><td>90.13</td><td>88.25</td><td>89.48</td><td>91.12</td><td>89.26</td><td>90.45</td></tr></table>
|
| 193 |
+
|
| 194 |
+
Baseline Models Our baselines include (i) Visual question answering (VQA) models (Anderson et al., 2018; Kim et al., 2018; Yu et al., 2019; Gao et al., 2019; Kim et al., 2021; Lu et al., 2021; Li et al., 2019); (ii) LMs, including the Text-to-text UnifiedQA model (Khashabi et al., 2020) and fewshot learning LLMs (GPT-3.5, ChatGPT, GPT-4, and Chameleon (Lu et al., 2023)); (iii) Fine-tuned large vision-language model LLaMA-Adapter (Zhang et al., 2023a), LLaVA (Liu et al., 2023), and InstructBLIP (Dai et al., 2023). More details are presented in Appendix B.1.
|
| 195 |
+
|
| 196 |
+
# 5.3 MAIN RESULTS
|
| 197 |
+
|
| 198 |
+
Table 4 shows the main results in the ScienceQA benchmark. Mutimodal- ${ \bf \cdot C o T _ { L a r g e } }$ achieves substantial performance gains over the prior best model in publications $( 8 6 . 5 4 \% 9 0 . 4 5 \% )$ ). The efficacy of Multimodal-CoT is further supported by the results obtained from the A-OKVQA benchmark (Table 5). Our ablation study (Appendix C.1) reveals that both the integration of vision features and the two-stage framework design contribute to the overall performance. Furthermore, MultimodalCoT demonstrates the ability to mitigate hallucination (Section 3.3) and improve convergence (Appendix C.2).
|
| 199 |
+
|
| 200 |
+
Table 5: Results on the A-OKVQA dataset. Baseline results are from (Chen et al., 2023) and Schwenk et al. (2022).
|
| 201 |
+
|
| 202 |
+
<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>BERT</td><td>32.93</td></tr><tr><td>GPT-3 (Curie)</td><td>35.07</td></tr><tr><td>IPVR (OPT-66B)</td><td>48.6</td></tr><tr><td>ViLBERT</td><td>49.1</td></tr><tr><td>LXMERT</td><td>51.4</td></tr><tr><td>Language-only Baseline</td><td>47.86</td></tr><tr><td>Multimodal-CoTBase</td><td>50.57</td></tr></table>
|
| 203 |
+
|
| 204 |
+
It is worth noting that Chameleon, LLaMA-Adapter, LLaVA, and InstructBLIP are concurrent works released several months after our work. We show that our method is orthogonal to those latest multimodal models (e.g., InstructBLIP) and can be potentially used with them together to improve generality further, i.e., scaled to scenarios where human-annotated rationales are unavailable (Appendix C.3), thereby establishing the effectiveness across diverse tasks.
|
| 205 |
+
|
| 206 |
+
# 6 ANALYSIS
|
| 207 |
+
|
| 208 |
+
The following analysis will investigate whether Multimodal-CoT is generally effective with different backbone models and vision features. We will also conduct an error analysis to explore the limitations to inspire future studies. We use models under the base size for analysis unless otherwise stated.
|
| 209 |
+
|
| 210 |
+
# 6.1 EFFECTIVENESS ACROSS BACKBONES
|
| 211 |
+
|
| 212 |
+
To test the generality of the benefits of our approach to other backbone models, we alter the underlying LMs to other variants in different types. As shown in Table 6, our approach is generally effective for the widely used backbone models.
|
| 213 |
+
|
| 214 |
+
Table 6: Using different backbone LMs. More detailed results are presented in Appendix C.5.
|
| 215 |
+
|
| 216 |
+
<table><tr><td>Method</td><td>Accuracy</td></tr><tr><td>Prior Best (Lu et al.,2022a)</td><td>75.17</td></tr><tr><td>MM-CoTon UnifiedQA</td><td>82.55</td></tr><tr><td>MM-CoT on FLAN-T5</td><td>83.19</td></tr><tr><td> MM-CoT on FLAN-Alpaca</td><td>85.31</td></tr></table>
|
| 217 |
+
|
| 218 |
+
# 6.2 USING DIFFERENT VISION FEATURES
|
| 219 |
+
|
| 220 |
+
Different vision features may affect the model performance. We compare three widely-used types of vision features, ViT (Dosovitskiy et al., 2021b), CLIP (Radford et al., 2021), DETR (Carion et al., 2020), and ResNet (He et al., 2016). ViT, CLIP, and DETR are patch-like features. For the ResNet features, we repeat the pooled features of ResNet-50 to the same
|
| 221 |
+
|
| 222 |
+
Table 7: Using different vision features.
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Feature</td><td>Feature Shape</td><td>Accuracy</td></tr><tr><td>ViT</td><td>(145,1024)</td><td>85.31</td></tr><tr><td>CLIP</td><td>(49,2048)</td><td>84.27</td></tr><tr><td>DETR</td><td>(100,256)</td><td>83.16</td></tr><tr><td>ResNet</td><td>(512,2048)</td><td>82.86</td></tr></table>
|
| 225 |
+
|
| 226 |
+
length with the text sequence to imitate the patch-like features, where each patch is the same as the pooled image features. More details of the vision features are presented in Appendix B.2.
|
| 227 |
+
|
| 228 |
+
Table 7 shows the comparative results of vision features. We observe that ViT achieves relatively better performance. Therefore, we use ViT by default in Multimodal-CoT.
|
| 229 |
+
|
| 230 |
+
# 6.3 ERROR ANALYSIS
|
| 231 |
+
|
| 232 |
+
To gain deeper insights into the behavior of Multimodal-CoT and facilitate future research, we manually analyzed randomly selected examples generated by our approach. The categorization results are illustrated in Figure 5. We examined 50 samples that yielded incorrect answers and categorized them accordingly. The examples from each category can be found in Appendix D.
|
| 233 |
+
|
| 234 |
+
The most prevalent error type is commonsense mistakes, accounting for $80 \%$ of the errors. These mistakes occur when the model is faced with questions that require commonsense knowledge, such as interpreting maps, counting objects in images, or utilizing the alphabet. The second error type is logical mistakes, constituting $14 \%$ of the errors, which involve contradictions in the reasoning process. Additionally, we have observed cases where incorrect answers are provided despite the CoT being either empty or correct, amounting to $6 \%$ of the errors. The CoT in these cases may not necessarily influence the final answer.
|
| 235 |
+
|
| 236 |
+

|
| 237 |
+
Figure 5: Categorization analysis.
|
| 238 |
+
|
| 239 |
+
The analysis reveals potential avenues for future research. Enhancements can be made to MultimodalCoT by: (i) integrating more informative visual features and strengthening the interaction between language and vision to enable comprehension of maps and numerical counting; (ii) incorporating commonsense knowledge; and (iii) implementing a filtering mechanism, such as using only relevant CoTs to infer answers and disregarding irrelevant ones.
|
| 240 |
+
|
| 241 |
+
# 7 CONCLUSION
|
| 242 |
+
|
| 243 |
+
We formally study the problem of multimodal CoT. We propose Multimodal-CoT that incorporates language and vision modalities into a two-stage framework that separates rationale generation and answer inference, so answer inference can leverage better generated rationales from multimodal information. With Multimodal-CoT, our model under 1 billion parameters achieves new state-ofthe-art performance on the ScienceQA benchmark. Analysis shows that Multimodal-CoT has the merits of mitigating hallucination and enhancing convergence speed. Our error analysis identifies the potential to leverage more effective vision features, inject commonsense knowledge, and apply filtering mechanisms to improve CoT reasoning in future studies.
|
| 244 |
+
|
| 245 |
+
# REFERENCES
|
| 246 |
+
|
| 247 |
+
Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. Advances in Neural Information Processing Systems, 35:23716– 23736, 2022.
|
| 248 |
+
|
| 249 |
+
Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 6077–6086. IEEE Computer Society, 2018. doi: 10.1109/CVPR. 2018.00636.
|
| 250 |
+
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. 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.
|
| 251 |
+
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part I, pp. 213–229, 2020.
|
| 252 |
+
Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey E. Hinton. Big self-supervised models are strong semi-supervised learners. 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.
|
| 253 |
+
Wenhu Chen, Xueguang Ma, Xinyi Wang, and William W Cohen. Program of thoughts prompting: Disentangling computation from reasoning for numerical reasoning tasks. ArXiv preprint, abs/2211.12588, 2022.
|
| 254 |
+
Zhenfang Chen, Qinhong Zhou, Yikang Shen, Yining Hong, Hao Zhang, and Chuang Gan. See, think, confirm: Interactive prompting between vision and language models for knowledge-based visual reasoning. ArXiv preprint, abs/2301.05226, 2023.
|
| 255 |
+
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 Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben 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 Garcia, 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 Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. Palm: Scaling language modeling with pathways. ArXiv preprint, abs/2204.02311, 2022.
|
| 256 |
+
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, abs/2210.11416, 2022.
|
| 257 |
+
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, 2023.
|
| 258 |
+
|
| 259 |
+
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 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021a.
|
| 260 |
+
|
| 261 |
+
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 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021b.
|
| 262 |
+
|
| 263 |
+
Yao Fu, Hao Peng, Ashish Sabharwal, Peter Clark, and Tushar Khot. Complexity-based prompting for multi-step reasoning. ArXiv preprint, abs/2210.00720, 2022.
|
| 264 |
+
|
| 265 |
+
Peng Gao, Zhengkai Jiang, Haoxuan You, Pan Lu, Steven C. H. Hoi, Xiaogang Wang, and Hongsheng Li. Dynamic fusion with intra- and inter-modality attention flow for visual question answering. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 6639–6648. Computer Vision Foundation / IEEE, 2019. doi: 10.1109/CVPR.2019.00680.
|
| 266 |
+
|
| 267 |
+
Yaru Hao, Haoyu Song, Li Dong, Shaohan Huang, Zewen Chi, Wenhui Wang, Shuming Ma, and Furu Wei. Language models are general-purpose interfaces. ArXiv preprint, abs/2206.06336, 2022.
|
| 268 |
+
|
| 269 |
+
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. doi: 10.1109/CVPR.2016.90.
|
| 270 |
+
|
| 271 |
+
Namgyu Ho, Laura Schmid, and Se-Young Yun. Large language models are reasoning teachers. ArXiv preprint, abs/2212.10071, 2022.
|
| 272 |
+
|
| 273 |
+
Jie Huang and Kevin Chen-Chuan Chang. Towards reasoning in large language models: A survey. ArXiv preprint, abs/2212.10403, 2022.
|
| 274 |
+
|
| 275 |
+
Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Yejin Bang, Andrea Madotto, and Pascale Fung. Survey of hallucination in natural language generation. ACM Computing Surveys, 2022.
|
| 276 |
+
|
| 277 |
+
Daniel Khashabi, Sewon Min, Tushar Khot, Ashish Sabharwal, Oyvind Tafjord, Peter Clark, and Hannaneh Hajishirzi. UNIFIEDQA: Crossing format boundaries with a single QA system. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 1896–1907, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.171.
|
| 278 |
+
|
| 279 |
+
Tushar Khot, Harsh Trivedi, Matthew Finlayson, Yao Fu, Kyle Richardson, Peter Clark, and Ashish Sabharwal. Decomposed prompting: A modular approach for solving complex tasks. ArXiv preprint, abs/2210.02406, 2022.
|
| 280 |
+
|
| 281 |
+
Jin-Hwa Kim, Jaehyun Jun, and Byoung-Tak Zhang. Bilinear attention networks. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolo Cesa-Bianchi, and Roman Garnett \` (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montreal, Canada ´ , pp. 1571–1581, 2018.
|
| 282 |
+
|
| 283 |
+
Wonjae Kim, Bokyung Son, and Ildoo Kim. Vilt: Vision-and-language transformer without convolution or region supervision. 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. 5583–5594. PMLR, 2021.
|
| 284 |
+
|
| 285 |
+
Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. ArXiv preprint, abs/2205.11916, 2022.
|
| 286 |
+
|
| 287 |
+
Bei Li, Chuanhao Lv, Zefan Zhou, Tao Zhou, Tong Xiao, Anxiang Ma, and JingBo Zhu. On vision features in multimodal machine translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 6327–6337, Dublin, Ireland, 2022a. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.438.
|
| 288 |
+
Junnan Li, Dongxu Li, Caiming Xiong, and Steven C. H. Hoi. BLIP: bootstrapping language-image pre-training for unified vision-language understanding and generation. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvari, Gang Niu, and Sivan Sabato (eds.), ´ International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 12888–12900. PMLR, 2022b.
|
| 289 |
+
Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. Visualbert: A simple and performant baseline for vision and language. ArXiv preprint, abs/1908.03557, 2019.
|
| 290 |
+
Yifei Li, Zeqi Lin, Shizhuo Zhang, Qiang Fu, Bei Chen, Jian-Guang Lou, and Weizhu Chen. On the advance of making language models better reasoners. ArXiv preprint, abs/2206.02336, 2022c.
|
| 291 |
+
Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. ArXiv preprint, abs/2304.08485, 2023.
|
| 292 |
+
Pan Lu, Liang Qiu, Jiaqi Chen, Tony Xia, Yizhou Zhao, Wei Zhang, Zhou Yu, Xiaodan Liang, and Song-Chun Zhu. Iconqa: A new benchmark for abstract diagram understanding and visual language reasoning. In The 35th Conference on Neural Information Processing Systems (NeurIPS) Track on Datasets and Benchmarks, 2021.
|
| 293 |
+
Pan Lu, Swaroop Mishra, Tony Xia, Liang Qiu, Kai-Wei Chang, Song-Chun Zhu, Oyvind Tafjord, Peter Clark, and Ashwin Kalyan. Learn to explain: Multimodal reasoning via thought chains for science question answering. Advances in Neural Information Processing Systems, 35:2507–2521, 2022a.
|
| 294 |
+
Pan Lu, Liang Qiu, Kai-Wei Chang, Ying Nian Wu, Song-Chun Zhu, Tanmay Rajpurohit, Peter Clark, and Ashwin Kalyan. Dynamic prompt learning via policy gradient for semi-structured mathematical reasoning. ArXiv preprint, abs/2209.14610, 2022b.
|
| 295 |
+
Pan Lu, Liang Qiu, Wenhao Yu, Sean Welleck, and Kai-Wei Chang. A survey of deep learning for mathematical reasoning. ArXiv preprint, abs/2212.10535, 2022c.
|
| 296 |
+
Pan Lu, Baolin Peng, Hao Cheng, Michel Galley, Kai-Wei Chang, Ying Nian Wu, Song-Chun Zhu, and Jianfeng Gao. Chameleon: Plug-and-play compositional reasoning with large language models. In The Thirty-seventh Conference on Neural Information Processing Systems (NeurIPS 2023), 2023.
|
| 297 |
+
Lucie Charlotte Magister, Jonathan Mallinson, Jakub Adamek, Eric Malmi, and Aliaksei Severyn. Teaching small language models to reason. ArXiv preprint, abs/2212.08410, 2022.
|
| 298 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. 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. 8748–8763. PMLR, 2021.
|
| 299 |
+
Jack W. Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, Eliza Rutherford, Tom Hennigan, Jacob Menick, Albin Cassirer, Richard Powell, George van den Driessche, Lisa Anne Hendricks, Maribeth Rauh, Po-Sen Huang, Amelia Glaese, Johannes Welbl, Sumanth Dathathri, Saffron Huang, Jonathan Uesato, John Mellor, Irina Higgins, Antonia Creswell, Nat McAleese, Amy Wu, Erich Elsen, Siddhant Jayakumar, Elena Buchatskaya, David Budden, Esme Sutherland, Karen Simonyan, Michela Paganini, Laurent Sifre, Lena Martens, Xiang Lorraine Li, Adhiguna Kuncoro, Aida Nematzadeh, Elena Gribovskaya, Domenic Donato, Angeliki Lazaridou, Arthur Mensch, Jean-Baptiste Lespiau, Maria Tsimpoukelli, Nikolai Grigorev, Doug Fritz, Thibault Sottiaux, Mantas Pajarskas, Toby Pohlen, Zhitao Gong, Daniel Toyama, Cyprien de Masson d’Autume,
|
| 300 |
+
|
| 301 |
+
Yujia Li, Tayfun Terzi, Vladimir Mikulik, Igor Babuschkin, Aidan Clark, Diego de Las Casas, Aurelia Guy, Chris Jones, James Bradbury, Matthew Johnson, Blake Hechtman, Laura Weidinger, Iason Gabriel, William Isaac, Ed Lockhart, Simon Osindero, Laura Rimell, Chris Dyer, Oriol Vinyals, Kareem Ayoub, Jeff Stanway, Lorrayne Bennett, Demis Hassabis, Koray Kavukcuoglu, and Geoffrey Irving. Scaling language models: Methods, analysis & insights from training gopher. ArXiv preprint, abs/2112.11446, 2021.
|
| 302 |
+
|
| 303 |
+
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. J. Mach. Learn. Res., 21:140:1–140:67, 2020.
|
| 304 |
+
|
| 305 |
+
Ohad Rubin, Jonathan Herzig, and Jonathan Berant. Learning to retrieve prompts for in-context learning. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2655–2671, Seattle, United States, 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.191.
|
| 306 |
+
|
| 307 |
+
Dustin Schwenk, Apoorv Khandelwal, Christopher Clark, Kenneth Marino, and Roozbeh Mottaghi. A-okvqa: A benchmark for visual question answering using world knowledge. In Computer Vision– ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part VIII, pp. 146–162. Springer, 2022.
|
| 308 |
+
|
| 309 |
+
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.
|
| 310 |
+
|
| 311 |
+
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, Vincent Zhao, Yanqi Zhou, Chung-Ching Chang, Igor Krivokon, Will Rusch, Marc Pickett, Pranesh Srinivasan, Laichee Man, 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, abs/2201.08239, 2022.
|
| 312 |
+
|
| 313 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998–6008, 2017.
|
| 314 |
+
|
| 315 |
+
Boshi Wang, Xiang Deng, and Huan Sun. Iteratively prompt pre-trained language models for chain of thought. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 2714–2730, Abu Dhabi, United Arab Emirates, 2022a. Association for Computational Linguistics.
|
| 316 |
+
|
| 317 |
+
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. Self-consistency improves chain of thought reasoning in language models. ArXiv preprint, abs/2203.11171, 2022b.
|
| 318 |
+
|
| 319 |
+
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. Rationale-augmented ensembles in language models. ArXiv preprint, abs/2207.00747, 2022c.
|
| 320 |
+
|
| 321 |
+
Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, Ed H. Chi, Tatsunori Hashimoto, Oriol Vinyals, Percy Liang, Jeff Dean, and William Fedus. Emergent abilities of large language models. Transactions on Machine Learning Research, 2022a. Survey Certification.
|
| 322 |
+
|
| 323 |
+
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, abs/2201.11903, 2022b.
|
| 324 |
+
Zhiyong Wu, Lingpeng Kong, Wei Bi, Xiang Li, and Ben Kao. Good for misconceived reasons: An empirical revisiting on the need for visual context in multimodal machine translation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 6153–6166, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021. acl-long.480.
|
| 325 |
+
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. Proceedings of the 40th International Conference on Machine Learning, PMLR, pp. 39755–39769, 2022.
|
| 326 |
+
Zhou Yu, Jun Yu, Yuhao Cui, Dacheng Tao, and Qi Tian. Deep modular co-attention networks for visual question answering. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 6281–6290. Computer Vision Foundation / IEEE, 2019. doi: 10.1109/CVPR.2019.00644.
|
| 327 |
+
Renrui Zhang, Jiaming Han, Aojun Zhou, Xiangfei Hu, Shilin Yan, Pan Lu, Hongsheng Li, Peng Gao, and Yu Qiao. Llama-adapter: Efficient fine-tuning of language models with zero-init attention. ArXiv preprint, abs/2303.16199, 2023a.
|
| 328 |
+
Zhuosheng Zhang, Kehai Chen, Rui Wang, Masao Utiyama, Eiichiro Sumita, Zuchao Li, and Hai Zhao. Neural machine translation with universal visual representation. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 329 |
+
Zhuosheng Zhang, Kehai Chen, Rui Wang, Masao Utiyama, Eiichiro Sumita, Zuchao Li, and Hai Zhao. Universal multimodal representation for language understanding. IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 1–18, 2023b. doi: 10.1109/TPAMI.2023.3234170.
|
| 330 |
+
Zhuosheng Zhang, Aston Zhang, Mu Li, and Alex Smola. Automatic chain of thought prompting in large language models. In The Eleventh International Conference on Learning Representations, 2023c.
|
| 331 |
+
Denny Zhou, Nathanael Scharli, Le Hou, Jason Wei, Nathan Scales, Xuezhi Wang, Dale Schuurmans, ¨ Olivier Bousquet, Quoc Le, and Ed Chi. Least-to-most prompting enables complex reasoning in large language models. ArXiv preprint, abs/2205.10625, 2022.
|
| 332 |
+
|
| 333 |
+
# A EXTENDED ANALYSIS FOR THE CHALLENGE OF MULTIMODAL-COT
|
| 334 |
+
|
| 335 |
+
A.1 ADDITIONAL EXAMPLES OF MISLEADING THROUGH HALLUCINATED RATIONALES
|
| 336 |
+
|
| 337 |
+
Based on our case studies (Section 3.2), we have observed a tendency for the baseline model to generate hallucinated rationales. Here, we present additional examples to illustrate this phenomenon, as depicted in Figure 6.
|
| 338 |
+
|
| 339 |
+
# Problem
|
| 340 |
+
|
| 341 |
+
Question: Which solution has a higher concentration of yellow particles? Context: The diagram below is a model of two solutions. Each yellow ball represents one particle of solute.
|
| 342 |
+
|
| 343 |
+
(C) neither; their concentrations are the same
|
| 344 |
+
|
| 345 |
+
Gold Rationale: In Solution A and Solution B, the yellow particles represent the solute. To figure out which solution has a higher concentration of yellow particles, look at both the number of yellow particles and the volume of the solvent in each container. Use the concentration formula to find the number of yellow particles per milliliter. Solution B has more yellow particles per milliliter. So, Solution B has a higher concentration of yellow particles.
|
| 346 |
+
|
| 347 |
+
Answer: The answer is (A).
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
|
| 351 |
+
# Baseline
|
| 352 |
+
|
| 353 |
+
Rationale: In Solution A and Solution B, the yellow particles represent the solute. To figure out which solution has a higher concentration of yellow particles, look at both the number of yellow particles and the volume of the solvent in each container. Use the concentration formula to find the number of yellow particles per milliliter. Solution A has more yellow particles per milliliter. So, Solution A has a higher concentration of yellow particles.
|
| 354 |
+
|
| 355 |
+
Answer: The answer is (B).
|
| 356 |
+
|
| 357 |
+
# $^ +$ Vision Features
|
| 358 |
+
|
| 359 |
+
Rationale: In Solution A and Solution B, the yellow particles represent the solute. To figure out which solution has a higher concentration of yellow particles, look at both the number of yellow particles and the volume of the solvent in each container. Use the concentration formula to find the number of yellow particles per milliliter. Solution B has more yellow particles per milliliter. So, Solution B has a higher concentration of yellow particles.
|
| 360 |
+
|
| 361 |
+
Answer: The answer is (A).
|
| 362 |
+
|
| 363 |
+
# Problem
|
| 364 |
+
|
| 365 |
+
Question: Think about the magnetic force between the magnets in each pair. Which of the following statements is true?
|
| 366 |
+
|
| 367 |
+
Context: The images below show two pairs of magnets. The magnets in different pairs do not affect each other. All the magnets shown are made of the same material.
|
| 368 |
+
|
| 369 |
+
<table><tr><td rowspan="3">Options:</td><td>(A)The magnitude of the magnetic force is smaller in Pair 2.</td></tr><tr><td>(B)The magnitude of the magnetic force is smaller in Pair 1.</td></tr><tr><td>(C)The magnitude of the magnetic force is the same in both pairs.</td></tr></table>
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
|
| 373 |
+
Gold Rationale: The magnets in Pair 1 attract. The magnets in Pair 2 repel. But whether the magnets attract or repel affects only the direction of the magnetic force. It does not affect the magnitude of the magnetic force. Both magnet sizes and distance affect the magnitude of the magnetic force. The sizes of the magnets in Pair 1 are the same as in Pair 2. The distance between the magnets is also the same. So, the magnitude of the magnetic force is the same in both pairs.
|
| 374 |
+
|
| 375 |
+
Answer: The answer is (C).
|
| 376 |
+
|
| 377 |
+
# Baseline
|
| 378 |
+
|
| 379 |
+
Rationale: Distance affects the magnitude of the magnetic force. When there is a greater distance between magnets, the magnitude of the magnetic force between them is smaller. There is a greater distance between the magnets in Pair 2 than in Pair 1. So, the magnitude of the magnetic force is smaller in Pair 2 than in Pair 1. Answer: The answer is (B).
|
| 380 |
+
|
| 381 |
+
# $^ +$ Vision Features
|
| 382 |
+
|
| 383 |
+
Rationale: The magnets in Pair 1 attract. The magnets in Pair 2 repel. But whether the magnets attract or repel affects only the direction of the magnetic force. It does not affect the magnitude of the magnetic force. Both magnet sizes and distance affect the magnitude of the magnetic force. The sizes of the magnets in Pair 1 are the same as in Pair 2. The distance between the magnets is also the same. So, the magnitude of the magnetic force is the same in both pairs. Answer: The answer is (C).
|
| 384 |
+
|
| 385 |
+
Figure 6: Examples of the two-stage framework without vision features (baseline) and with vision features (ours) for generating rationales and predicting answers. The upper part presents the problem details, and the lower part shows the outputs of the baseline and our method.
|
| 386 |
+
|
| 387 |
+
# A.2 TWO-STAGE TRAINING PERFORMANCE WITH DIFFERENT SIZES OF LMS
|
| 388 |
+
|
| 389 |
+
In Section 3, we observed that the inclusion of vision features has a positive impact on the generation of more effective rationales, consequently resulting in improved answer accuracy. In addition to incorporating vision features, another approach to addressing the issue of incorrect rationales is to scale the size of the language model (LM). Figure 7 showcases the answer accuracy achieved by our two-stage training framework, both with and without the integration of vision features. Notably, when employing a larger LM, the baseline accuracy (without vision features) experiences a significant enhancement. This finding suggests that scaling the LM size could potentially alleviate the problem of incorrect rationales. However, it is crucial to acknowledge that the performance still falls considerably short of utilizing vision features. This outcome further validates the effectiveness of our Multimodal-CoT methodology across varying LM sizes.
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Figure 7: Answer accuracy with different sizes of LMs.
|
| 393 |
+
|
| 394 |
+
A.3 DISCUSSION OF THE POSSIBLE PARADIGMS TO ACHIEVE MULTIMODAL-COT
|
| 395 |
+
|
| 396 |
+
As discussed in Section 1, there are two primary approaches to facilitate Multimodal-CoT reasoning: (i) prompting LLMs and (ii) fine-tuning small models. The common approach in the first approach is to unify the input from different modalities and prompt LLMs to perform reasoning (Zhang et al., $2 0 2 3 \mathrm { a }$ ; Lu et al., 2023; Liu et al., 2023; Alayrac et al., 2022; Hao et al., 2022; Yasunaga et al., 2022). For instance, one way to achieve this is by extracting the caption of an image using a captioning model and then concatenating the caption with the original language input to feed LLMs. By doing so, visual information is conveyed to LLMs as text, effectively bridging the gap between modalities. This approach can be represented as the input-output format ¡image caption, question $^ +$ caption answer¿. We refer to this approach as Caption-based Reasoning (Figure 8a). It is worth noting that the effectiveness of this approach depends on the quality of the image caption, which may be susceptible to errors introduced during the transfer from image captioning to answer inference.
|
| 397 |
+
|
| 398 |
+
In contrast, an intriguing aspect of CoT is the ability to decompose complex problems into a series of simpler problems and solve them step by step. This transformation leads to a modification of the standard format ¡question answer¿ into ¡question rationale answer¿. Rationales, being more likely to reflect the reasoning processes leading to the answer, play a crucial role in this paradigm. Consequently, we refer to approaches following this paradigm as CoT-based Reasoning. The nomenclature has been widely adopted in the literature (Huang & Chang, 2022; Zhang et al., 2023c; Lu et al., 2022c).
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 8: Paradigms to achieve Multimodal-CoT.
|
| 402 |
+
|
| 403 |
+
Our work aligns with the paradigms of CoT-based Reasoning in the context of multimodal scenarios, specifically employing the ¡question $^ +$ image rationale answer¿ framework (Figure 8b). This approach confers advantages on two fronts. Firstly, the Multimodal-CoT framework leverages feature-level interactions between vision and language inputs, enabling the model to gain a deeper understanding of the input information and facilitating more effective inference of answers by incorporating well-founded rationales. Our analysis has demonstrated that Multimodal-CoT offers notable benefits by mitigating hallucination and enhancing convergence, resulting in superior performance on our benchmark datasets. Secondly, the lightweight nature of Multimodal-CoT renders it compatible with resource constraints and circumvents any potential paywalls.
|
| 404 |
+
|
| 405 |
+
# B EXPERIMENTAL DETAILS
|
| 406 |
+
|
| 407 |
+
# B.1 BASELINE METHODS
|
| 408 |
+
|
| 409 |
+
We utilized three categories of methods as our baselines:
|
| 410 |
+
|
| 411 |
+
(i) Visual question answering (VQA) models, including MCAN (Yu et al., 2019), Top-Down (Anderson et al., 2018), BAN (Kim et al., 2018), DFAF (Gao et al., 2019), ViLT (Kim et al., 2021), Patch-TRM (Lu et al., 2021), and VisualBERT (Li et al., 2019). These VQA baselines take the question, context, and choices as textual input, while utilizing the image as visual input. They employ a linear classifier to predict the score distribution over the choice candidates.
|
| 412 |
+
|
| 413 |
+
(ii) LMs, including the text-to-text UnifiedQA model (Khashabi et al., 2020) and few-shot learning LLMs (GPT-3.5, ChatGPT, GPT-4, and Chameleon (Lu et al., 2023)). UnifiedQA (Khashabi et al., 2020) is adopted as it is the best fine-tuning model in Lu et al. (2022a). UnifiedQA takes the textual information as the input and outputs the answer choice. The image is converted into a caption extracted by an image captioning model following Lu et al. (2022a). UnifiedQA treats our task as a text generation problem. In Lu et al. (2022a), it is trained to generate a target answer text, i.e., one of the candidate options. Then, the most similar option is selected as the final prediction to evaluate the question answering accuracy. For GPT-3.5 models (Chen et al., 2020), we use the text-davinci-002 and text-davinci-003 engines due to their strong performance. In addition, we also include the comparison with ChatGPT and GPT-4. The inference is based on the few-shot prompting, where two in-context examples from the training set are concatenated before the test instance. The few-shot demonstrations are the same as those in Lu et al. (2022a).
|
| 414 |
+
|
| 415 |
+
(iii) Fine-tuned large vision-language model. We select the recently released LLaMA-Adapter (Zhang et al., 2023a), LLaVA (Liu et al., 2023), and InstructBLIP (Dai et al., 2023) as the competitive large vision-language baselines. The backbone model is the 7B LLaMA model fine-tuned with $5 2 k$ self-instruct demonstrations. To adapt to our tasks, the model is further fine-tuned on the ScienceQA dataset.
|
| 416 |
+
|
| 417 |
+
For UnifiedQA and GPT-family models, CoT is applied after the answer (Lu et al., 2022a). Besides the above baselines, we develop a stronger baseline by slightly modifying the output format of UnifiedQA. Instead of predicting the answer texts, our baseline directly predicts the choice, e.g., the answer is $B$ . This setting helps our baseline achieve better results than the existing UnifiedQA. Therefore, we use the stronger method as the language-only baseline for analysis.
|
| 418 |
+
|
| 419 |
+
# B.2 DETAILS OF VISION FEATURES
|
| 420 |
+
|
| 421 |
+
In Section 6.2, we compared four types of vision features, ViT (Dosovitskiy et al., 2021b), CLIP (Radford et al., 2021), DETR (Carion et al., 2020), and ResNet (He et al., 2016). The specific models are: (i) ViT: vit large patch32 384,7 (ii) CLIP: RN101;8 (iii) DETR: detr resnet101 dc5;9 (iv) ResNet: we use the averaged pooled features of a pre-trained ResNet50 CNN.
|
| 422 |
+
|
| 423 |
+
Table 8 presents the dimension of the vision features (after the function VisionExtractor(·) in Eq. 3). For ResNet-50, we repeat the pooled features of ResNet-50 to the same length as the text sequence to imitate the patch-like features, where each patch is the same as the pooled image features.
|
| 424 |
+
|
| 425 |
+
Table 8: Feature shape of vision features
|
| 426 |
+
|
| 427 |
+
<table><tr><td>Method</td><td>Feature Shape</td></tr><tr><td>ViT</td><td>(145,1024)</td></tr><tr><td>CLIP</td><td>(49,2048)</td></tr><tr><td>DETR</td><td>(100,256)</td></tr><tr><td>ResNet</td><td>(512,2048)</td></tr></table>
|
| 428 |
+
|
| 429 |
+
# B.3 DATASETS
|
| 430 |
+
|
| 431 |
+
Our method is evaluated on the ScienceQA (Lu et al., 2022a) and A-OKVQA (Schwenk et al., 2022) benchmark datasets.
|
| 432 |
+
|
| 433 |
+
• ScienceQA is a large-scale multimodal science question dataset with annotated lectures and explanations. It contains $2 1 k$ multimodal multiple choice questions with rich domain diversity across 3 subjects, 26 topics, 127 categories, and 379 skills. The dataset is split into training, validation, and test splits with $1 2 k$ , $4 k$ , and $4 k$ questions, respectively.
|
| 434 |
+
|
| 435 |
+
• A-OKVQA is a knowledge-based visual question answering benchmark, which has $2 5 k$ questions requiring a broad base of commonsense and world knowledge to answer. Each question is annotated with rationales that explain why a particular answer was correct according to necessary facts or knowledge. It has $1 7 k / 1 k / 6 k$ questions for train/val/test.
|
| 436 |
+
|
| 437 |
+
For ScienceQA, our model is evaluated on the test set. For A-OKVQA, our model is evaluated on the validation set as the test set is hidden.
|
| 438 |
+
|
| 439 |
+
# B.4 IMPLEMENTATION DETAILS OF MULTIMODAL-COT
|
| 440 |
+
|
| 441 |
+
As the Multimodal-CoT task requires generating the reasoning chains and leveraging the vision features, we adopt the T5 encoder-decoder architecture (Raffel et al., 2020) under Base (200M) and large (700M) settings in our framework. We apply FLAN-Alpaca to initialize our model weights.10 We will show that Multimodal-CoT is generally effective with other backbone LMs, such as UnifiedQA (Khashabi et al., 2020) and FLAN-T5 (Chung et al., 2022) (Section 6.1). The vision features are obtained by the frozen ViT-large encoder (Dosovitskiy et al., 2021b). Since using image captions can slightly improve model performance, as shown in Section 3.3, we append the image captions to the context following Lu et al. (2022a). The captions are generated by InstructBLIP (Dai et al., 2023). We fine-tune the models up to 20 epochs, with a learning rate selected in $\{ 5 \mathrm { e } { - } 5 , 8 \mathrm { e } { - } 5 \}$ . The maximum input sequence lengths for rationale generation and answer inference are 512 and 64, respectively. The batch size is 8. Our experiments are run on 8 NVIDIA Tesla V100 32G GPUs.
|
| 442 |
+
|
| 443 |
+
# C FURTHER ANALYSIS
|
| 444 |
+
|
| 445 |
+
# C.1 ABLATION STUDY
|
| 446 |
+
|
| 447 |
+
Ablation study results in Table 9 show that both the integration of vision features and the two-stage framework design contribute to the overall performance. These findings provide strong evidence for the effectiveness of multimodality and highlight the potential for achieving CoT reasoning using 1B-models through our proposed two-stage framework.
|
| 448 |
+
|
| 449 |
+
Table 9: Ablation results of Multimodal-CoT.
|
| 450 |
+
|
| 451 |
+
<table><tr><td>Model</td><td>Base</td><td>Large</td></tr><tr><td>Multimodal-CoT</td><td>85.31</td><td>90.45</td></tr><tr><td> w/o Two-Stage Framework</td><td>82.62</td><td>84.56</td></tr><tr><td>w/o Vision Features</td><td>78.57</td><td>83.97</td></tr></table>
|
| 452 |
+
|
| 453 |
+
Figure 9 shows the validation accuracy curve of the baseline and Multimodal-CoT across different training epochs. “One-stage” is based on the $\mathrm { Q C M } { } \mathbf { A }$ input-output format as it achieves the best performance in Table 2 and “Two-stage” is our two-stage framework. We find that the two-stage methods achieve relatively higher accuracy at the beginning than the one-stage baselines that generate the answer directly without CoT. However, without the vision features, the two-stage baseline could not yield better results as the training goes on due to the low-quality rationales (as observed in Section 3). In contrast, using vision features helps generate more effective rationales that contribute to better answer accuracy in our two-stage multimodal variant.
|
| 454 |
+
|
| 455 |
+

|
| 456 |
+
Figure 9: Accuracy curve of the No-CoT baseline and Multimodal-CoT variants.
|
| 457 |
+
|
| 458 |
+
C.3 WHEN MULTIMODAL-COT MEETS LARGE MODELS
|
| 459 |
+
|
| 460 |
+
A recent flame is to leverage large language models or large vision-language models to generate reasoning chains for multimodal question answering problems (Zhang et al., 2023a; Lu et al., 2023; Liu et al., 2023; Alayrac et al., 2022; Hao et al., 2022; Yasunaga et al., 2022). We are interested in whether we can use large models to generate the rationales for Multimodal-CoT; thus breaking the need for datasets with human-annotated rationales. During the first-stage training of Multimodal-CoT, our target rationales are based on human annotation in the benchmark datasets. Now, we replace the target rationales with those generated by an LLM or a vision-language model. Concretely, we feed the questions with images (IMG) and the question without images (TXT) to InstructBLIP (Dai et al., 2023) (Figure 10a) and ChatGPT (Figure 10b) for zero-shot inference, respectively. Then, we use the generated pseudo-rationales as the target rationales for training instead of relying on the human annotation of reasoning chains.
|
| 461 |
+
|
| 462 |
+
Table 10 shows the comparison results. We see that using the generated rationales achieves comparable performance to using human-annotated rationales for training. In addition, the performance is also much better than directly prompting those baseline models to obtain the answer (in the $\mathrm { Q C M } { } \mathbf { A }$ inference format).
|
| 463 |
+
|
| 464 |
+
Table 10: Result comparison with large models. We also present the results of InstructBLIP and ChatGPT baselines for reference. The inference format for the two baselines is $\mathbf { Q C M } { \xrightarrow { } } \mathbf { A } .$ .
|
| 465 |
+
|
| 466 |
+
<table><tr><td>Model</td><td>IMG</td><td>TXT</td><td>AVG</td></tr><tr><td>InstructBLIP ChatGPT</td><td>60.50 56.52</td><td>1 67.16</td><td>1 65.95</td></tr><tr><td>Multimodal-CoT w/ Annotation</td><td>88.25</td><td>90.13</td><td>90.45</td></tr><tr><td>Multimodal-CoT w/ Generation</td><td>83.54</td><td>85.73</td><td>87.76</td></tr></table>
|
| 467 |
+
|
| 468 |
+

|
| 469 |
+
Figure 10: Rationale generation examples
|
| 470 |
+
|
| 471 |
+
We see that Multimodal-CoT can work effectively with large models. The findings above compellingly show the feasibility of adaptation to scenarios without human-annotated rationales, thereby establishing the effectiveness of our approach across diverse tasks.
|
| 472 |
+
|
| 473 |
+
# C.4 ALIGNMENT STRATEGIES FOR MULTIMODAL INTERACTION
|
| 474 |
+
|
| 475 |
+
We are interested in whether using different alignment strategies for multimodal interaction may contribute to different behaviors of multimodal-CoT. To this end, we tried another alignment strategy, i.e., image-grounded text encoder, in BLIP Li et al. (2022b). This alignment approach injects visual information by inserting one additional cross-attention layer between the self-attention layer and the feed-forward network for each transformer block of the text encoder. Our current strategy in the paper is similar to the unimodal encoder as in BLIP, which is used for comparison.
|
| 476 |
+
|
| 477 |
+
Table 11: Result comparison with different alignment strategies for multimodal interaction.
|
| 478 |
+
|
| 479 |
+
<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>Direct Answering</td><td>82.62</td></tr><tr><td>Unimodal encoder</td><td>85.31</td></tr><tr><td>Image-grounded text encoder</td><td>84.60</td></tr></table>
|
| 480 |
+
|
| 481 |
+
In Table 11, we see that using other alignment strategies also contributes to better performance than direct answering.
|
| 482 |
+
|
| 483 |
+
# C.5 DETAILED RESULTS OF MULTIMODAL-COT ON DIFFERENT BACKBONE MODELS
|
| 484 |
+
|
| 485 |
+
To test the generality of the benefits of our approach to other backbone models, we alter the underlying LMs to other variants of different types. As detailed results shown in Table 12, our approach is generally effective for the widely used backbone models.
|
| 486 |
+
|
| 487 |
+
Table 12: Detailed results of Multimodal-CoT on different backbone models.
|
| 488 |
+
|
| 489 |
+
<table><tr><td>Model</td><td>NAT</td><td>SOC</td><td>LAN</td><td>TXT</td><td>IMG</td><td>NO</td><td>G1-6</td><td>G7-12</td><td>Avg</td></tr><tr><td>MM-CoTon UnifiedQA</td><td>80.60</td><td>89.43</td><td>81.00</td><td>80.50</td><td>80.61</td><td>81.74</td><td>82.38</td><td>82.86</td><td>82.55</td></tr><tr><td>MM-CoT on FLAN-T5</td><td>81.39</td><td>90.89</td><td>80.64</td><td>80.79</td><td>80.47</td><td>82.58</td><td>83.48</td><td>82.66</td><td>83.19</td></tr><tr><td>MM-CoT on FLAN-Alpaca</td><td>84.06</td><td>92.35</td><td>82.18</td><td>82.75</td><td>82.75</td><td>84.74</td><td>85.79</td><td>84.44</td><td>85.31</td></tr></table>
|
| 490 |
+
|
| 491 |
+
# D EXAMPLES OF CASE STUDIES
|
| 492 |
+
|
| 493 |
+
To gain deeper insights into the behavior of Multimodal-CoT and facilitate future research, we manually analyzed randomly selected examples generated by our approach. The categorization results are illustrated in Figure 11. We examined 50 samples that yielded incorrect answers and categorized them accordingly.
|
| 494 |
+
|
| 495 |
+

|
| 496 |
+
Figure 11: Categorization analysis.
|
| 497 |
+
|
| 498 |
+
The most prevalent error type is commonsense mistakes, accounting for $80 \%$ of the errors. These mistakes occur when the model is faced with questions that require commonsense knowledge, such as interpreting maps (Figure 12a), counting objects in images (Figure 12b), or utilizing the alphabet (Figure 12c).
|
| 499 |
+
|
| 500 |
+
The second error type is logical mistakes, constituting $14 \%$ of the errors, which involve comparison mistakes (Figure 13a) and contradictions in the reasoning process (Figure 13b).
|
| 501 |
+
|
| 502 |
+
Additionally, we have observed cases where incorrect answers are provided despite the CoT being either empty or correct, amounting to $6 \%$ of the errors. The CoT in these cases may not necessarily influence the final answer (Figure 14).
|
| 503 |
+
|
| 504 |
+
The analysis reveals potential avenues for future research. Enhancements can be made to MultimodalCoT by: (i) integrating more informative visual features and strengthening the interaction between language and vision to enable comprehension of maps and numerical counting; (ii) incorporating commonsense knowledge; and (iii) implementing a filtering mechanism, such as using only relevant CoTs to infer answers and disregarding irrelevant ones.
|
| 505 |
+
|
| 506 |
+
# Problem
|
| 507 |
+
|
| 508 |
+
Question: Which of these cities is marked on the map?
|
| 509 |
+
|
| 510 |
+
Context: N/A
|
| 511 |
+
|
| 512 |
+
Options: (A) Las Vegas (B) San Francisco (C) Phoenix (D) Salt Lake City
|
| 513 |
+
|
| 514 |
+
Rationale : The city is Las Vegas, Nevada. Salt Lake City, Phoenix, and San Francisco are marked with gray circles on the map below.
|
| 515 |
+
Answer: The answer is (A).
|
| 516 |
+
|
| 517 |
+
# Prediction
|
| 518 |
+
|
| 519 |
+
Rationale: The city is San Francisco, California. Salt Lake City, Las Vegas, and Phoenix are marked with gray circles on the map below.
|
| 520 |
+
Answer: The answer is (B).
|
| 521 |
+
|
| 522 |
+
(a) Mistakes about maps.
|
| 523 |
+
|
| 524 |
+
# Problem
|
| 525 |
+
|
| 526 |
+
Question: Complete the text to describe the diagram. Solute particles moved in both directions across the permeable membrane. But more solute particles moved across the membrane (). When there was an equal concentration on both sides, the particles reached equilibrium.
|
| 527 |
+
|
| 528 |
+
Context: The diagram below shows a solution with one solute. Each solute particle is represented by a green ball. The solution fills a closed container that is divided in half by a membrane. The membrane, represented by a dotted line, is permeable to the solute particles. The diagram shows how the solution can change over time during the process of diffusion.
|
| 529 |
+
|
| 530 |
+
Options: (A) to the left than to the right (B) to the right than to the left
|
| 531 |
+
|
| 532 |
+
Rationale $:$ (extract) It shows you how the solution changed during the process of diffusion. Before the solute particles reached equilibrium, there were 3 solute particles on the left side of the membrane and 5 solute particles on the right side of the membrane. When the solute particles reached equilibrium, there were 4 solute particles on each side of the membrane. There was 1 more solute particle on the left side of the membrane than before. So, for the solute particles to reach equilibrium, more solute particles must have moved across the membrane to the left than to the right.
|
| 533 |
+
|
| 534 |
+
Answer: The answer is (A).
|
| 535 |
+
|
| 536 |
+

|
| 537 |
+
|
| 538 |
+
# Prediction
|
| 539 |
+
|
| 540 |
+

|
| 541 |
+
Figure 12: Examples of commonsense mistakes.
|
| 542 |
+
|
| 543 |
+
Rationale: (extract) It shows you how the solution changed during the process of diffusion. Before the solute particles reached equilibrium, there were 5 solute particles on the left side of the membrane and 4 solute particles on the right side of the membrane. When the solute particles reached equilibrium, there were 5 solute particles on each side of the membrane. There was 1 more solute particle on the right side of the membrane than before. So, for the solute particles to reach equilibrium, more solute particles must have moved across the membrane to the right than to the right. Answer: The answer is (B).
|
| 544 |
+
|
| 545 |
+
# Problem
|
| 546 |
+
|
| 547 |
+
(b) Mistakes about counting numbers in the image.
|
| 548 |
+
|
| 549 |
+
Question: Which word would you find on a dictionary page with the following guide words? helping - hunter Context: The diagram below shows a solution with one solute. Each solute particle is represented by a green ball. The solution fills a closed container that is divided in half by a membrane. The membrane, represented by a dotted line, is permeable to the solute particles. The diagram shows how the solution can change over time during the process of diffusion.
|
| 550 |
+
|
| 551 |
+
Vision N/A
|
| 552 |
+
|
| 553 |
+
Options: (A) hospital (B) hardship
|
| 554 |
+
|
| 555 |
+
Rationale : Put the words in alphabetical order. Since hospital is between the guide words helping - hunter, it would be found on that page.
|
| 556 |
+
Answer: The answer is (A).
|
| 557 |
+
|
| 558 |
+
# Prediction
|
| 559 |
+
|
| 560 |
+
Rationale: Put the words in alphabetical order. Since hardship is between the guide words helping - hunter, it would be found on that page.
|
| 561 |
+
Answer: The answer is (B).
|
| 562 |
+
|
| 563 |
+
(c) Mistakes about utilizing alphabet.
|
| 564 |
+
|
| 565 |
+
# Problem
|
| 566 |
+
|
| 567 |
+
Question: Compare the motion of two cars. Which car was moving at a lower speed?
|
| 568 |
+
|
| 569 |
+
Vision N/A
|
| 570 |
+
|
| 571 |
+
ons: (A) a car that moved 445miles in 10hours
|
| 572 |
+
|
| 573 |
+
(B) a car that moved 170miles in 10hours
|
| 574 |
+
|
| 575 |
+
Rationale : Look at the distance each car moved and the time it took to move that distance. One car moved 170 miles in 10 hours. The other car moved 445 miles in 10 hours. Notice that each car spent the same amount of time moving. The car that moved 170 miles moved a shorter distance in that time. So, that car must have moved at a lower speed.
|
| 576 |
+
|
| 577 |
+
Answer: The answer is (B).
|
| 578 |
+
|
| 579 |
+
# Prediction
|
| 580 |
+
|
| 581 |
+
Rationale: Look at the distance each car moved and the time it took to move that distance. One car moved 445 miles in 10 hours. The other car moved 170 miles in 10 hours. Notice that each car spent the same amount of time moving. The car that moved 445 miles moved a shorter distance in that time. So, that car must have moved at a lower speed.
|
| 582 |
+
|
| 583 |
+
Answer: The answer is (A).
|
| 584 |
+
|
| 585 |
+
# Problem
|
| 586 |
+
|
| 587 |
+
(a) Logical mistake where the model fails at comparisons.
|
| 588 |
+
|
| 589 |
+
Question: Based on this information, what is Sage's phenotype for the coat color trait? Context: In a group of horses, some individuals have a black coat and others have a reddish-brown coat. In this group, the gene for the coat color trait has two alleles. The allele for a reddish-brown coat (l) is recessive to the allele for a black coat (L). Sage is a horse from this group. Sage has the homozygous genotype ll for the coat color gene.
|
| 590 |
+
|
| 591 |
+
Vision N/A
|
| 592 |
+
|
| 593 |
+
Options: (A) a black coat (B) a reddish-brown coat
|
| 594 |
+
|
| 595 |
+
Rationale : Sage's genotype for the coat color gene is ll. Sage's genotype of ll has only l alleles. The l allele is for a reddish-brown coat. So, Sage's phenotype for the coat color trait must be a reddish-brown coat. To check this answer, consider whether Sage's alleles are dominant or recessive.
|
| 596 |
+
The allele for a reddish-brown coat (l) is recessive to the allele for a black coat (L). This means L is a dominant allele, and l is a recessive allele.
|
| 597 |
+
Sage's genotype of ll has only recessive alleles. An organism with only recessive alleles for a gene will have the recessive allele's version of the trait.
|
| 598 |
+
So, Sage's phenotype for the coat color trait must be a reddish-brown coat.
|
| 599 |
+
|
| 600 |
+
Answer: The answer is (B).
|
| 601 |
+
|
| 602 |
+
# Prediction
|
| 603 |
+
|
| 604 |
+
Rationale: Sage's genotype for the coat color gene is ll. Sage's genotype of ll has only l alleles. The l allele is for a reddish-brown coat. So, Sage's phenotype for the coat color trait must be a reddish-brown coat. To check this answer, consider whether Sage's alleles are dominant or recessive.
|
| 605 |
+
The allele for a reddish-brown coat (l) is recessive to the allele for a black coat (L). This means L is a dominant allele, and l is a recessive allele.
|
| 606 |
+
Sage's genotype of ll has only recessive alleles. An organism with only recessive alleles for a gene will have the recessive allele's version of the trait.
|
| 607 |
+
So, Sage's phenotype for the coat color trait must be a black coat.
|
| 608 |
+
|
| 609 |
+
Answer: The answer is (A).
|
| 610 |
+
|
| 611 |
+
(b) Logical mistake where the there is a contradiction in the rationale.
|
| 612 |
+
|
| 613 |
+
# Problem
|
| 614 |
+
|
| 615 |
+
Question: Which trait did Palaeopython have? Select the trait you can observe on the fossil. Context: This picture shows a fossil of an ancient animal called Palaeopython. Palaeopython lived in trees and could grow more than six feet long.
|
| 616 |
+
|
| 617 |
+

|
| 618 |
+
Figure 13: Examples of logical mistakes.
|
| 619 |
+
|
| 620 |
+
Vision
|
| 621 |
+
|
| 622 |
+
Options: (A) black stripes on its skin (B) large fins on its body (C) a long, thin body
|
| 623 |
+
|
| 624 |
+
Rationale : The way an organism looks or acts is called a trait. Scientists use fossils to learn more about the traits of ancient organisms. Fossils can preserve the remains of body parts and activities. A fossil of a body part, such as a tail or a wing, can tell you what an organism looked like. A fossil of an organism's activities, such as a burrow or a footprint, can tell you about the organism's behavior. Here are three examples of fossils and the traits that you can observe from them: This is a fossil of an animal. This fossil tells you that the animal had a spiral-shaped shell. This is a fossil of a plant. This fossil tells you that the plant had small leaves arranged in a branched pattern. This is a fossil of an animal's footprint. This fossil tells you that the animal could walk on land. An organism's fossil may not show all of the organism's traits. This is because most body parts are destroyed during fossil formation. When an organism's body turns into a fossil, only a few body parts are usually preserved.
|
| 625 |
+
|
| 626 |
+
Answer: The answer is (C).
|
| 627 |
+
|
| 628 |
+
# Prediction
|
| 629 |
+
|
| 630 |
+
Rationale : The way an organism looks or acts is called a trait. Scientists use fossils to learn more about the traits of ancient organisms. Fossils can preserve the remains of body parts and activities. A fossil of a body part, such as a tail or a wing, can tell you what an organism looked like. A fossil of an organism's activities, such as a burrow or a footprint, can tell you about the organism's behavior. Here are three examples of fossils and the traits that you can observe from them: This is a fossil of an animal. This fossil tells you that the animal had a spiral-shaped shell. This is a fossil of a plant. This fossil tells you that the plant had small leaves arranged in a branched pattern. This is a fossil of an animal's footprint. This fossil tells you that the animal could walk on land. An organism's fossil may not show all of the organism's traits. This is because most body parts are destroyed during fossil formation. When an organism's body turns into a fossil, only a few body parts are usually preserved.
|
| 631 |
+
Answer: The answer is (B).
|
| 632 |
+
|
| 633 |
+
Figure 14: Examples of answers are incorrect while the CoT is correct.
|
md/test/iSAgvYhZzg/iSAgvYhZzg.md
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# YOU ONLY LOOK AT SCREENS: MULTIMODAL CHAIN-OF-ACTION AGENTS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Autonomous user interface (UI) agents aim to facilitate task automation by interacting with the user interface without manual intervention. Recent studies have investigated eliciting the capabilities of large language models (LLMs) for effective engagement in diverse environments. To align with the input-output requirement of LLMs, existing approaches are developed under a sandbox setting where they rely on external tools and application-specific APIs to parse the environment into textual elements and interpret the predicted actions. Consequently, those approaches often grapple with inference inefficiency and error propagation risks. To mitigate the challenges, we introduce Auto-UI, a multimodal solution that directly interacts with the interface, bypassing the need for environment parsing or reliance on applicationdependent APIs. Moreover, we propose a chain-of-action technique—leveraging a series of intermediate previous action histories and future action plans—to help the agent decide what action to execute. We evaluate our approach on a new devicecontrol benchmark AITW with $3 0 K$ unique instructions, spanning multi-step tasks such as application operation, web searching, and web shopping. Experimental results show that Auto-UI achieves state-of-the-art performance with an action type prediction accuracy of $90 \%$ and an overall action success rate of $74 \%$ . Code is publicly available at Anonymous.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Building intelligent autonomous agents that are capable of task planning, decision making, and action execution in a particular environment is a long-standing goal of artificial intelligence (AI) (Searle, 1969; Wooldridge & Jennings, 1995; Maes, 1995; Hendler, 1999). The advent of large language models (LLMs) (Brown et al., 2020; Chowdhery et al., 2022; OpenAI, 2023) has flourished promising opportunities for developing autonomous agents to assist users in completing tasks in distinct environments such as operation systems, specific applications, and web browsers (Adept, 2022; Rawles et al., 2023; Liu et al., 2023; Zhou et al., 2023; Wang et al., 2023c).
|
| 12 |
+
|
| 13 |
+
Recent studies have explored prompt engineering (Richards, 2023; Nakajima, 2023; Reworkd, 2023; Sumers et al., 2023; Liu et al., 2023) and fine-tuning techniques (Rawles et al., 2023; Wen et al., 2023; Sun et al., 2022) to elicit the capability of language models to execute actions in interactive environments. However, there are at least two major challenges that have limited realworld applications of autonomous agents.
|
| 14 |
+
|
| 15 |
+
First, existing approaches commonly rely on external tools such as optical character recognition (OCR) and icon detectors (Zhang et al., 2021; Sunkara et al., 2022) to parse the environment into textual elements (e.g., HTML layouts) as inputs to a language model (Figure 1(a)) (Rawles et al., 2023; Wen et al., 2023). On the one hand, the parsed elements generate lengthy inputs, thus leading to inference inefficiency. Since computational latency is a key measure in deployment, using lengthy inputs would increase inference cost and may even exceed the input length limit of the language model. On the other hand, parsing the visual environment into textual elements may also be prone to error propagation or information loss because parsing mistakes are inevitable using external tools.
|
| 16 |
+
|
| 17 |
+
Second, most existing approaches are under the sand-box setting that requires accessing internal APIs to interact with the environment (Zhou et al., 2023; Gur et al., 2023), e.g., using a JavaScript element selection on a webpage or a Python interpreter to execute actions. However in practice, the API interface is often inaccessible in third-party applications (Apps).
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Comparison of two autonomous agent paradigms. The sandbox paradigm depends on the intermediate transformation between environments and agents, i.e., needing access to intermediate environment parsing or interval application-dependent APIs. In contrast, our first principles thinking paradigm allows direct interactions on the screen without intermediate transformation. Details of the action types and action points are presented in Section 3.3.
|
| 21 |
+
|
| 22 |
+
These challenges have motivated more advanced techniques that are capable of first principles thinking (Aristotle; Irwin, 1989)—allowing direct interactions on the screen without needing access to intermediate environment parsing or interval application-dependent APIs (Figure 1(b)). To address the challenges, we introduce Auto-UI, a multimodal approach that directly interacts with the interface. To improve the agent’s action prediction capability, we propose a novel chain-of-action technique, where a chain of action is a series of intermediate previous action histories and future action plans that lead to action prediction.
|
| 23 |
+
|
| 24 |
+
We evaluate Auto-UI on a new device-control benchmark AITW (Rawles et al., 2023) with $3 0 K$ unique instructions, spanning multi-step tasks of application operation, web searching, and web shopping. Experimental results show that Auto-UI achieves state-of-the-art performance with an action type prediction accuracy of $90 \%$ and an action success rate of $74 \%$ .
|
| 25 |
+
|
| 26 |
+
In summary, our work makes the following technical contributions:
|
| 27 |
+
|
| 28 |
+
(i) We introduce Auto-UI, a multimodal agent for autonomous UI control that can directly interact with the screens, thus circumventing the constraints of environment parsing and application-specific API access.
|
| 29 |
+
|
| 30 |
+
(ii) We propose a chain-of-action technique that leverages the previously executed actions and future action plans to help the agent decide what action to execute at each step.
|
| 31 |
+
|
| 32 |
+
(iii) Auto-UI achieves state-of-the-art performance with an action type prediction accuracy of $90 \%$ and an action success rate of $74 \%$ . Notably, Auto-UI can infer an action as fast as within less than one second.
|
| 33 |
+
|
| 34 |
+
# 2 RELATED WORK
|
| 35 |
+
|
| 36 |
+
Our work falls into the field of language agents. This section will first review the recent progress in building language agents and then discuss the approaches to conduct user interface control with language agents.
|
| 37 |
+
|
| 38 |
+
# 2.1 LANGUAGE AGENTS
|
| 39 |
+
|
| 40 |
+
Language agents refer to those agents that can follow user instructions and interact with environments to complete tasks. Such agents expand the landscape of language models to compete in specific fields, including application operation, web searching, and web shopping. There are two popular types of language agents, autonomous agents and communicative agents. Autonomous agents aim to assist humans to achieve specific goals in the real world. Typical examples of autonomous agents are AutoGPT (Richards, 2023), BabyAGI (Nakajima, 2023), and AgentGPT (Reworkd, 2023). In contrast, communicative agents are personalized and socialized agents (Park et al., 2023; Wang et al., 2023b; Zhu et al., 2023; Hong et al., 2023) with human behaviors that can communicate and collaborate with each other. They are often deployed in immersive environments. Inspired by the potential in real-world applications, this work focuses on autonomous agents, especially those working in mobile devices. We aim to assist users by completing multi-step tasks (e.g., manipulating Apps, web shopping, and question answering) without any manual intervention. Given a user instruction in natural language, the agent is required to interpret the instruction and execute actions by directly controlling its user interface. Due to the requirement in real-world applications, the agent is expected to be both effective and efficient.
|
| 41 |
+
|
| 42 |
+
# 2.2 UI CONTROL WITH NATURAL LANGUAGE
|
| 43 |
+
|
| 44 |
+
Recently, LLMs have shown promise in building autonomous UI agents with abilities of instruction following (Sanh et al., 2021; Taori et al., 2023b; Chiang et al., 2023) and chain-of-thought (CoT) prompting (Nye et al., 2022; Wei et al., 2022). Especially, CoT prompting (Wei et al., 2022; Kojima et al., 2022; Zhang et al., 2023a) elicit LLMs’ capacities of step-by-step planning, decision making, and action execution. Those capacities have been shown to be effective in UI control tasks (Rawles et al., 2023). However, the task environments are graphical user interfaces (GUIs), instead of natural language that LLMs can directly process. Therefore, the GUI states and actions are required to be converted to textual formats to conform to the input and output formats of LLMs. For example, it is feasible to parse the UI screens by icon recognition and OCR (Zhang et al., 2021; Sunkara et al., 2022) and organize the parsed elements into HTML layouts. As a compromise, existing approaches are restricted in a sandbox setting where they rely on external tools (Rawles et al., 2023; Wen et al., 2023) and application-specific APIs (Zhou et al., 2023; Gur et al., 2023) for environment parsing and action interpretation; thus, commonly suffer from inference inefficiency and error propagation. Although there are studies that have considered multimodal architecture to process inputs in different modalities (Sun et al., 2022), however, those studies still rely on fine-grained environment parsing to ensure competitive performance. In contrast, this work is established upon first principles thinking, which directly reads the UI without additional environment parsing and provides the action (e.g., action type, gesture coordinate, and typed text) that can be executed without needing any extra APIs.
|
| 45 |
+
|
| 46 |
+
# 3 METHODOLOGY
|
| 47 |
+
|
| 48 |
+
In this section, we will first introduce the basic concepts for the UI control task and then describe the design of our proposed Auto-UI framework.
|
| 49 |
+
|
| 50 |
+
# 3.1 PROBLEM FORMALIZATION
|
| 51 |
+
|
| 52 |
+
Given a user instruction (also known as a goal), the agent needs to complete the task with multiple steps of interactions. The entire process is called an episode, which is composed of a series of screens. For each step in the episode, the agent will be provided with a screenshot, and the agent is required to predict the action until the task is complete. Detailed examples can be found in Appendix A.2.
|
| 53 |
+
|
| 54 |
+
# 3.2 FRAMEWORK OVERVIEW
|
| 55 |
+
|
| 56 |
+
Auto-UI is a multimodal agent that decides what action to take given the input screenshot and a user instruction. To empower the agent’s decision making capability, we introduce a chain-of-action approach by leveraging a series of intermediate previous action histories and future action plans to predict actions.
|
| 57 |
+
|
| 58 |
+
The model architecture of Auto-UI is illustrated in Figure 2. On a high level, Auto-UI consists of three stages. First, we acquire encoded features from both vision and language inputs. Specifically, the vision input, i.e., a screenshot, is encoded by a frozen vision encoder. Meanwhile, the language input, consisting of the goal and a chain of previous action histories—each history contains a tuple {action type, touch point, lift point, and typed text}, is encoded by a language encoder. Second, the encoded vision and language representations are integrated by a self-attention module. Third, the fused representation is fed to the decoder to generate a chain of future action plans (i.e., action types to execute in future steps) followed by action prediction. A chain of action consists of two parts in the procedure above: a chain of previous action histories on the input side and a chain of future action plans on the output side. In the following, we describe the entire procedure in detail.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Model architecture of Auto-UI. A chain of action consists of a chain of previous action histories $X _ { \mathrm { h i s t o r y } }$ and a chain of future action plans $Y _ { \mathrm { p l a n } }$ in the illustration.
|
| 62 |
+
|
| 63 |
+
Encoding Suppose that an episode consists of $k$ steps of interactions. Given a screenshot $X _ { \mathrm { s c r e e n } } \in$ $\mathbb { R } ^ { h \times w \times 3 }$ with height $h$ and width $w$ at step $t \in [ 1 , k ]$ , we first feed it to a frozen image encoder (e.g., BLIP-2 (Li et al., 2023)) and extract vision features $H _ { \mathrm { s c r e e n } } \in \mathbb { R } ^ { 1 \times d _ { s } }$ where $d _ { s }$ is the dimension of the vision features. Additionally, we leverage a language encoder to extract the language features $H _ { \mathrm { l a n g u a g e } } \in \mathbb { R } ^ { n \times d _ { l } }$ of the input goal $X _ { \mathrm { g o a l } }$ where $n$ is the number of tokens and $d _ { l }$ is the dimension of the language features. If $t > 1$ , there will be a chain-of-action history already executed before step $t$ . We denote the chain of action histories as $X _ { \mathrm { h i s t o r y } } = [ m _ { 1 } , \dots , m _ { t } ]$ where $m _ { i }$ contains a tuple of action type, touch point, lift point, and typed text. Otherwise, if $t = 1$ , $X _ { \mathrm { h i s t o r y } }$ will be set empty:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
X _ { \mathrm { h i s t o r y } } = { \left\{ \begin{array} { l l } { [ m _ { 1 } , \ldots , m _ { t } ] , } & { { \mathrm { i f ~ } } t > 1 } \\ { < \mathrm { e m p t y } > , } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
We concatenate $X _ { \mathrm { g o a l } }$ and $X _ { \mathrm { h i s t o r y } }$ as the input to the language encoder: $X _ { \mathrm { l a n g u a g e } } = \{ X _ { \mathrm { g o a l } } , X _ { \mathrm { h i s t o r y } } \}$ Then, we obtain the encoded representations of the vision and language inputs as follows:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r c l } { { \cal H } _ { \mathrm { s c r e e n } } } & { = } & { \mathrm { V i s i o n E x t r a c t o r } ( X _ { \mathrm { s c r e e n } } ) , } \\ { { \cal H } _ { \mathrm { s c r e e n } } ^ { ' } } & { = } & { W H _ { \mathrm { s c r e e n } } , } \\ { { \cal H } _ { \mathrm { l a n g u a g e } } } & { = } & { \mathrm { L a n g u a g e E n c o d e r } ( X _ { \mathrm { l a n g u a g e } } ) , } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $W$ is a trainable projection matrix to convert $H _ { \mathrm { s c r e e n } }$ into the same dimensionality as $H _ { \mathrm { l a n g u a g e } }$
|
| 76 |
+
|
| 77 |
+
Interaction We correlate $H _ { \mathrm { { s c r e e n } } } ^ { ' }$ and $H _ { \mathrm { l a n g u a g e } }$ with a single-head self-attention network (Vaswani et al., 2017), where the query $( Q )$ , key $( K )$ , and value $( V )$ are $H _ { \mathrm { l a n g u a g e } }$ , $H _ { \mathrm { { s c r e e n } } } ^ { ' }$ , and $H _ { \mathrm { { s c r e e n } } } ^ { ' }$ , respectively. The attention output $H _ { \mathrm { s c r e e n } } ^ { \mathrm { a t t n } } \in \mathbb { R } ^ { n \times d }$ is defined as: $\begin{array} { r } { H _ { \mathrm { s c r e e n } } ^ { \mathrm { a t t n } } = \mathrm { S o f t m a x } ( \frac { Q K ^ { \top } } { \sqrt { d _ { k } } } ) V } \end{array}$ , where $d _ { k }$ is the same as the dimension of $H _ { \mathrm { l a n g u a g e } }$ because a single head is used.
|
| 78 |
+
|
| 79 |
+
Then, a gated fusion mechanism is adopted following prior studies (Zhang et al., 2020; Wu et al., 2021; Zhang et al., 2023b) to fuse $H _ { \mathrm { l a n g u a g e } }$ and $H _ { \mathrm { s c r e e n } } ^ { \mathrm { a t t n } }$ . We have the fused output $H _ { \mathrm { f u s e } } \in \mathbb { R } ^ { n \times d }$ by:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r c l } { { \lambda } } & { { = } } & { { \mathrm { S i g m o i d } ( W _ { l } H _ { \mathrm { l a n g u a g e } } + W _ { v } H _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } ) , } } \\ { { { \cal H } _ { \mathrm { f u s e } } } } & { { = } } & { { ( 1 - \lambda ) \cdot { \cal H } _ { \mathrm { l a n g u a g e } } + \lambda \cdot { \cal H } _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } , } } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $W _ { l }$ and $W _ { v }$ are learnable parameters.
|
| 86 |
+
|
| 87 |
+
Decoding The fused representation $H _ { \mathrm { f u s e } }$ is fed to a Transformer decoder to generate the target predictions in a string format. The target predictions consist of a chain of future action plans $Y _ { \mathrm { p l a n } }$ and the current action prediction $Y _ { \mathrm { a c t i o n } }$ separated by specific prompts: {Action Plan: $Y _ { \mathrm { p l a n } }$ , Action Decision: $Y _ { \mathrm { a c t i o n } } \}$ . Concretely, $Y _ { \mathrm { { p l a n } } }$ is a chain of action types to execute in future steps: $Y _ { \mathrm { p l a n } } =$ [action ${ \mathrm { \Delta } } _ { \mathrm { \Delta } } \operatorname { t y p e } _ { t }$ , . . . , action_type $k ]$ ]. $Y _ { \mathrm { a c t i o n } }$ contains four components: $Y _ { \mathrm { a c t i o n } } = \left\{ \begin{array} { r l r } \end{array} \right.$ “action_type”: <action_type>, “touch_point”: <touch_point>, “lift_point”: <lift_point>, “typed_text”: <typed_text>}. These four components will be explained in the following subsection.
|
| 88 |
+
|
| 89 |
+
# 3.3 COORDINATE NORMALIZATION
|
| 90 |
+
|
| 91 |
+
Recall that a target action consists of four components: action type, touch point, lift point, and typed text. We consider six action types: dual-point gesture, type, go_back, go_home, enter, and status_complete. A dual-point gesture comprises a touch point and a lift point with $[ y , x ]$ coordinates. The gesture actions ensure a flexible action space and can represent clicks and scrolls at arbitrary locations. For example, a gesture action {“touch_point”: [0.7761, 0.7089], “lift_point”: [0.7761, 0.7089]} means clicking at the coordinate [0.7761, 0.7089], while a gesture action {“touch_point”: [0.1898, 0.4477], “lift_point”: [0.8242, 0.4077]} means scrolling down. A type action means typing a text and the text is placed in the <typed_text> field. The other action types, i.e., go_back, go_home, enter, and status_complete are system actions, whose corresponding <touch_point>, <lift_point> fields are filled with -1, and the <typed_text> is empty.
|
| 92 |
+
|
| 93 |
+
We observe that high-precision coordinates are not necessary for representing a click or scroll action. Therefore, we apply normalized values of the coordinates, which helps accelerate convergence and mitigate the ambiguity of coordinates. The normalization is applied to click and scroll actions. For click actions, we keep four decimal places. For scroll actions, we first determine the scroll direction with the touch point and lift point. Then, we transform the touch and lift points into fixed directional coordinates as follows: “up”: {[0.8, 0.5], [0.2, 0.5]}, “down”: {[0.2, 0.5], [0.8, 0.5]}, “left”: {[0.5, 0.8], [0.5, 0.2]}, “right”: {[0.5, 0.2], [0.5, 0.8]}, where {[·], [·]} consists of the touch point and lift point in the first [·] and second [·]. We provide examples of target actions in Appendix A.3.
|
| 94 |
+
|
| 95 |
+
# 4 EXPERIMENTS
|
| 96 |
+
|
| 97 |
+
# 4.1 DATASET
|
| 98 |
+
|
| 99 |
+
We use the AITW benchmark dataset (Rawles et al., 2023). AITW is a large-scale benchmark dataset for UI control, which contains natural language instructions, screenshots, and actions. There are $7 1 5 K$ episodes spanning $3 0 K$ unique instructions, covering diverse multi-step tasks such as application operation, web searching, and web shopping, on over 350 Apps and websites. This dataset covers various device types and operation systems in varying screen resolutions to ensure generality. There are five subsets in the benchmark dataset, namely, General, Install, GoogleApps, Single, and WebShopping. The details of the subsets and data statistics are presented in Appendix A.1.
|
| 100 |
+
|
| 101 |
+
# 4.2 BASELINES
|
| 102 |
+
|
| 103 |
+
We adopt three types of baselines for comparisons. The baselines encompass the In-context Learning (ICL) and fine-tuning paradigms, along with various backbone models of different sizes. This choice of baselines allows for a comprehensive comparison with our proposed approach.
|
| 104 |
+
|
| 105 |
+
(i) In-context Learning LLMs. Few-shot PaLM 2, ChatGPT (turbo-3.5) are adopted. Following previous studies (Rawles et al., 2023; Wang et al., 2023a), we feed the LLM a textual description of the screen and a user instruction. The textual description of the screen is formatted as an HTML syntax, providing the information of UI elements derived from OCR detection and icon detection from external tools (Rawles et al., 2023). The model is required to predict an action among pre-defined actions. If the action is clicking, the model will be required to provide the index of the clicked UI element. Alternatively, the model needs to provide the scroll direction if the action is scrolling. In addition, 5-shot CoT prompting is leveraged to improve the performance (Appendix A.4). In addition, we report the results of the multimodal GPT-4V by taking the vision image and action history as the input based on Yan et al. (2023).
|
| 106 |
+
|
| 107 |
+
(ii) Fine-tuned LLMs. We adopt Llama 2 (Touvron et al., 2023) as the baseline and fine-tune it with LoRA. We feed the model with the user instruction and the screen descriptions in HTML syntax (the same as adopted for in-context learning LLMs). The model is expected to predict the action in the same output format as in-context learning LLMs. As fine-tuning an LLM is expensive, we randomly sample $1 \%$ training data to help the LLM adapt to our tasks.
|
| 108 |
+
|
| 109 |
+
(iii) Specialized UI Agent. We adopted the Behavioural Cloning (BC) agent, which reported the state-of-the-art performance in Rawles et al. (2023). BC is a Transformer-based architecture that takes a task instruction, the current screen, and a stacked history of screen observations and actions as input. The task instruction and OCR-detected texts are encoded by a pre-trained BERT. The icons are represented by the embeddings for each of the bounding box points. The screen history is modeled by the $\{ x , y \}$ positions of the touch and lift actions. All the embedded representations are fused to predict the action by a decoder. There are two BC variants, BC-single and BC-history, depending on whether the model takes as input the screen-action history.
|
| 110 |
+
|
| 111 |
+
# 4.3 EVALUATION MEASURES
|
| 112 |
+
|
| 113 |
+
We compute the screen-wise action matching score as the main evaluation measure, defined as the number of correct actions divided by the episode length. A predicted action is considered correct if the action type and dual-point gesture match the gold ones. As we described in Section 3.3, the gesture actions can represent the click actions and scroll actions at arbitrary locations. Following Rawles et al. (2023), a click action is considered correct if its touch point and lift point fall within a $14 \%$ screen distance from the gold gestures or occur within the same detected bounding box with the gold gestures. A scroll action is considered correct if it has the same scroll axis as the gold gesture.
|
| 114 |
+
|
| 115 |
+
The screen-wise action matching score has been shown to correlate with the task complete score estimated by human evaluations (Rawles et al., 2023) and is appropriate to measure the action success rate for user instructions. Besides the overall matching score, we will also compare the click region accuracy, scroll direction accuracy, action type accuracy, and typed text accuracy for a more comprehensive reference (Section 5.1).
|
| 116 |
+
|
| 117 |
+
The evaluation criteria apply to the BC baselines and our Auto-UI. For the LLMs, they can only click on detected UI elements, rather than clicking at arbitrary locations. Therefore, we consider if the clicked UI element is matched for click actions instead of comparing dual-point gestures for LLMs.
|
| 118 |
+
|
| 119 |
+
# 4.4 IMPLEMENTATION DETAILS
|
| 120 |
+
|
| 121 |
+
We adopt the encoder-decoder architecture (Raffel et al., 2020) under small (60M), base (200M) and large (700M) settings in our framework. We apply FLAN-Alpaca to initialize our model weights.1 The vision features are obtained by the frozen BLIP-2 encoder (Li et al., 2023) (version: blip2_t5_instruct). We fine-tune the models up to 10 epochs, with a learning rate of 1e-4. The maximum input sequence length is 512. The batch size is 4. Our experiments are run on 8 NVIDIA Tesla V100 32G GPUs. Training the large and base models takes 75 and 25 hours, respectively.
|
| 122 |
+
|
| 123 |
+
We develop two kinds of approaches to analyze their generalization abilities, namely Auto-UIseparate, and Auto- $. \mathrm { U I } _ { \mathrm { u n i f i e d } }$ . Specifically, Auto- $\mathrm { . U I _ { s e p a r a t e } }$ is trained and evaluated independently on each subset. Auto- $\mathrm { \cdot U I _ { u n i f i e d } }$ is a unified model trained on the training sets of each subset and evaluated on each test set. As the GoogleApps subset is 10-100 times larger than the other subsets, using all the training data to train a unified model would suffer from the data imbalance issue (Zhang et al., 2022). Therefore, we only use $10 \%$ training data of GoogleApps. At the same time, the overall computation cost can also be saved by $80 \%$ . We use Auto- $\mathrm { \cdot U I _ { u n i f i e d } }$ as the default model for analysis unless otherwise stated.
|
| 124 |
+
|
| 125 |
+
# 4.5 MAIN RESULTS
|
| 126 |
+
|
| 127 |
+
Table 1 shows the main results. Auto- $\mathrm { \cdot } \mathrm { U I } _ { \mathrm { u n i f i e d } }$ achieves the best overall performance compared with all the baselines. When compared with separate (not unified) models, Auto- $\mathrm { \cdot U I _ { u n i f i e d } }$ shows general effectiveness across various task scenarios. The results show that a unified multimodal model out of first principles thinking can serve as a strong autonomous agent. Compared with previous BC models, Auto- $\mathrm { \cdot } \mathrm { U I } _ { \mathrm { u n i f i e d } }$ has two major advantages. First, Auto- $. \mathrm { U I } _ { \mathrm { u n i f i e d } }$ is a unified model that can be adapted to different scenarios without the need to train specific models for each task. Second, Auto-UIunified does not need additional annotations (screen parsing) and is easy to use. We will provide a more detailed analysis of the generality of computation efficiency in Section 5.2 and 5.4.
|
| 128 |
+
|
| 129 |
+
Table 1: Main results $( \% )$ . Segment 1: specialized agent baselines; Segment 2: in-context learning LLM baselines; Segment 3: fine-tuned Llama 2 baseline; Segment 4: our Auto-UI results. Prior published best results are marked with an underline. “Unified” means a general model that can work across subsets. “w/o Anno.” means no screen description is needed. The PaLM-CoT and BC results are from Rawles et al. (2023). The GPT-4V result is from Yan et al. (2023). The other results are based on our own implementations. The overall score is computed as the average accuracy on all the subsets. The best average result is in bold face.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Model</td><td></td><td></td><td></td><td></td><td>|Unifiedw/o Anno.|Overall|General Install GoogleAppsSingleWebShopping</td><td></td><td></td><td></td></tr><tr><td>PaLM2-CoT</td><td>√</td><td></td><td>39.6</td><td></td><td>1</td><td></td><td>1</td><td></td></tr><tr><td>ChatGPT-CoT</td><td></td><td></td><td>7.72</td><td>5.93</td><td>4.38</td><td>10.47</td><td>9.39</td><td>8.42</td></tr><tr><td>GPT-4V</td><td>√</td><td>xxx</td><td>52.96</td><td>43.01</td><td>46.14</td><td>49.18</td><td>78.29</td><td>48.18</td></tr><tr><td>Fine-tuned Llama 2 |</td><td>×</td><td>×</td><td>28.40</td><td>28.56</td><td>35.18</td><td>30.99</td><td>27.35</td><td>19.92</td></tr><tr><td>BC-single</td><td>×</td><td>×</td><td>68.7</td><td>1</td><td>1</td><td></td><td>1</td><td></td></tr><tr><td>BC-history</td><td>×</td><td>×</td><td>73.1</td><td>63.7</td><td>77.5</td><td>75.7</td><td>80.3</td><td>68.5</td></tr><tr><td>Auto-UIseparate</td><td></td><td>√</td><td>74.07</td><td>65.94</td><td>77.62</td><td>76.45</td><td>81.39</td><td>69.72</td></tr><tr><td>Auto-UIunifed</td><td>x√</td><td></td><td>74.27</td><td>68.24</td><td>76.89</td><td>71.37</td><td>84.58</td><td>70.26</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Table 2: Ablation study of Auto-UI design components. We adopt Auto-UIunified for analysis.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Model</td><td>|Overall</td><td>General</td><td>Install</td><td>GoogleApps</td><td>Single</td><td>WebShopping</td></tr><tr><td>Auto-UI</td><td>一 74.27</td><td>68.24</td><td>76.89</td><td>71.37</td><td>84.58</td><td>70.26</td></tr><tr><td> w/o chain of actions</td><td>68.53</td><td>58.99</td><td>72.06</td><td>67.50</td><td>81.25</td><td>62.86</td></tr><tr><td>w/ previous action history</td><td>73.78</td><td>67.97</td><td>76.66</td><td>71.00</td><td>83.64</td><td>69.62</td></tr><tr><td>w/ future action plan</td><td>68.81</td><td>59.01</td><td>72.34</td><td>67.95</td><td>81.53</td><td>63.24</td></tr><tr><td>w/o coordinate normalization</td><td>70.23</td><td>63.79</td><td>73.28</td><td>66.63</td><td>82.11</td><td>65.33</td></tr></table>
|
| 136 |
+
|
| 137 |
+
The ablation study in Table 2 verifies that both the chain of actions and coordinate normalization contribute to the overall performance $( + 5 . 7 4 \%$ and $4 . 0 4 \%$ , respectively). We set the maximum numbers of the previous actions and future actions to 8 and 4, respectively. The choice is made according to our analysis on the General subset with Auto-UIseparate (Figure 3). The model under those setups achieves the optimal performance and both the input and output sequence lengths would not exceed the model limit.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 3: Performance of Auto-UI with respect to varying numbers of chains of actions.
|
| 141 |
+
|
| 142 |
+
For the LLMs, using either prompting or fine-tuning techniques does not achieve competitive performance compared with the other approaches. The most plausible reason is that they learn from the parsed HTML elements of the screen so that they may suffer from information loss compared with more informative vision features of the screens. Specifically, we find that ChatGPT is quite accurate at predicting the action type but fails at lower-level executions (Appendix B.1).
|
| 143 |
+
|
| 144 |
+
It is reasonable that Auto- $\mathrm { \cdot U I _ { u n i f i e d } }$ performs relatively inferior to BC-history on the two App-centered subsets, Install and GoogleApps, because we only use $10 \%$ training data of GoogleApps considering the data balance and computation overhead. We observe that the performance does not improve when we use all the training data of GoogleApps, possibly due to the data imbalance issue (Zhang et al., 2022). In contrast, our separate model Auto- $\mathrm { . U I _ { s e p a r a t e } }$ can achieve better performance than BC-history, showing that our approach is better than BC-history under the same training setting. As we aim to study a simple and unified approach that achieves generally strong performance, we leave the treatment of the data imbalance issue in future work.
|
| 145 |
+
|
| 146 |
+
# 5 ANALYSIS
|
| 147 |
+
|
| 148 |
+
# 5.1 CATEGORY ACCURACY
|
| 149 |
+
|
| 150 |
+
To dive into the capability of Auto-UI, we calculate the click region accuracy, scroll direction accuracy, action type accuracy, and typed text accuracy. Figure 4 presents the results. We see that Auto-UI achieves over $90 \%$ action type accuracy on average. In contrast, the major challenges lie within the click region and scroll direction predictions. Although the model is able to predict the right action most of the time, it tends to click a wrong place or scroll in a wrong direction. The result reveals a future direction of improving the model’s ability to understand the screen layouts, e.g., using more advanced vision features.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 4: Category accuracy of our Auto-UI. The values in parentheses represent the average category accuracy on the subsets.
|
| 154 |
+
|
| 155 |
+
# 5.2 GENERALIZATION ABILITY
|
| 156 |
+
|
| 157 |
+
As our approach is designed under first principles thinking and does not rely on pre-defined internal APIs, it could be easily generalized to new task domains. To verify the generality, we evaluate the performance of Auto-UIseparate on each subset in Figure 5. For example, we train an Auto- $\mathbf { \cdot U I _ { s e p a r a t e } }$ model on the training set of General and then test its performance on the tests of each subset. We see that our approach is able to achieve a decent performance though the domains vary. This result reveals that the model could capture general knowledge for the UI control task; thus is applicable to different domains. In addition, the unified model Auto- $\mathrm { U I } _ { \mathrm { u n i f i e d } }$ can serve as a potential choice in real-world applications owing to more coverage of training data.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 5: Dataset transfer results of Auto-UI.
|
| 161 |
+
|
| 162 |
+
# 5.3 COMPREHENSIVE ANALYSIS
|
| 163 |
+
|
| 164 |
+
Here we present a comprehensive analysis of the choice of pre-trained features and model scale. The results are summarized in Table 3.
|
| 165 |
+
|
| 166 |
+
Table 3: Results varying vision features and pre-trained language model weights.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Model</td><td>Overall</td><td>General</td><td>Install</td><td>GoogleApps</td><td>Single</td><td>WebShopping</td></tr><tr><td>Auto-UI on CLIP</td><td>71.84</td><td>66.28</td><td>74.40</td><td>69.71</td><td>81.60</td><td>67.23</td></tr><tr><td>Auto-UI on BLIP-2</td><td>74.27</td><td>68.24</td><td>76.89</td><td>71.37</td><td>84.58</td><td>70.26</td></tr><tr><td>Auto-UIonVanilla-T5arge</td><td>72.98</td><td>66.61</td><td>75.40</td><td>70.86</td><td>83.47</td><td>68.54</td></tr><tr><td>Auto-UI on FLAN-T5large</td><td>73.36</td><td>67.59</td><td>76.35</td><td>70.71</td><td>83.01</td><td>69.12</td></tr><tr><td> Auto-UI on FLAN-Alpacalarge</td><td>74.27</td><td>68.24</td><td>76.89</td><td>71.37</td><td>84.58</td><td>70.26</td></tr><tr><td>Auto-UI on FLAN-Alpacasmall</td><td>71.38</td><td>65.26</td><td>74.90</td><td>68.70</td><td>81.20</td><td>66.83</td></tr><tr><td>Auto-UI on FLAN-Alpacabase</td><td>72.84</td><td>66.97</td><td>75.93</td><td>70.29</td><td>82.56</td><td>68.46</td></tr><tr><td>Auto-UI on FLAN-Alpacalarge</td><td>74.27</td><td>68.24</td><td>76.89</td><td>71.37</td><td>84.58</td><td>70.26</td></tr></table>
|
| 169 |
+
|
| 170 |
+
• Pre-trained Features. There are two kinds of pre-trained features used in this work, the vision features and language model weights. For vision features, we compare two popular types, CLIP (Radford et al., 2021) and BLIP-2 (Li et al., 2023). We observe that BLIP-2 achieves relatively better performance. Therefore, we use BLIP-2 by default in Auto-UI. For pre-trained language model weights, we compare initializing the model with the vanilla T5 (Raffel et al., 2020), FLAN-T5 (Chung et al., 2022), and FLAN-Alpaca (Taori et al., 2023a) weights under the large size. We see that FLAN-Alpaca achieves the best performance as it has been optimized with Stanford Alpaca synthetic instruction tuning data.
|
| 171 |
+
|
| 172 |
+
• Model Scale. Compared with the performance gains from our technique components (chain of actions and coordinate normalization) in Table 2, the benefit of scaling parameter size becomes relatively marginal. As we observe that a larger model size does not lead to dramatic improvement in performance, we do not scale the model scale but focus on the base (220M) and large (770M) models in this work. In addition, our choice is also based on other considerations, including the constriction of GPU memory and computation budget.
|
| 173 |
+
|
| 174 |
+
# 5.4 COMPUTATION COST
|
| 175 |
+
|
| 176 |
+
Table 4 compares the inference speed and GPU memory cost for Auto-UI and Llama 2. Auto-UI is able to achieve nearly real-time inference (within less than one second for an action prediction) with less than 10GB GPU memory. The inference speed is over 10 times faster than Llama 2. Our work shows the strength of the medium-sized language model in building autonomous agents, which is able to achieve competitive performance with fast inference.
|
| 177 |
+
|
| 178 |
+
Table 4: Computations cost of Auto-UI and Llama. The computation efficiency is computed by time (s) divided by the number of inferences (n). Llama 2 is hosted with 8-bit quantization and float16 precision to improve the inference speed.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>Model</td><td>Feature Extraction (s/n)</td><td>Model Inference (s/n)</td><td>Peak GPU Memory (GB)</td></tr><tr><td>Auto-UIbase</td><td>0.06</td><td>0.19 (45x)</td><td>4.6 (10x)</td></tr><tr><td>Auto-UIarge</td><td>0.06</td><td>0.59 (15x)</td><td>8.2 (6x)</td></tr><tr><td>Llama 2</td><td></td><td>8.5</td><td>49.7</td></tr></table>
|
| 181 |
+
|
| 182 |
+
# 6 CONCLUSION
|
| 183 |
+
|
| 184 |
+
This work presents an autonomous UI agent called Auto-UI that can interact in a multimodal UI environment without environment parsing or application-dependent API access. In addition, we propose a chain-of-action technique that leverages the previously executed actions and future action plans to help the agent decide what action to execute. Experimental results show that Auto-UI achieves superior performance to previous prompting-based and fine-tuning baselines. Besides the strong performance and generality across domains, Auto-UI can infer an action as fast as within less than one second.
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Adept. Act-1: Transformer for actions. https://www.adept.ai/act, 2022.
|
| 189 |
+
|
| 190 |
+
Aristotle. Physics 184a10–21.
|
| 191 |
+
|
| 192 |
+
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, 33:1877–1901, 2020.
|
| 193 |
+
|
| 194 |
+
Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E Gonzalez, et al. Vicuna: An open-source chatbot impressing gpt-4 with $9 0 \% \ast$ chatgpt quality. https://vicuna.lmsys.org, 2023.
|
| 195 |
+
|
| 196 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
|
| 197 |
+
|
| 198 |
+
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.
|
| 199 |
+
|
| 200 |
+
Izzeddin Gur, Hiroki Furuta, Austin Huang, Mustafa Safdari, Yutaka Matsuo, Douglas Eck, and Aleksandra Faust. A real-world webagent with planning, long context understanding, and program synthesis. arXiv preprint arXiv:2307.12856, 2023.
|
| 201 |
+
|
| 202 |
+
James Hendler. Is there an intelligent agent in your future? Nature, 11, 1999.
|
| 203 |
+
|
| 204 |
+
Sirui Hong, Xiawu Zheng, Jonathan Chen, Yuheng Cheng, Jinlin Wang, Ceyao Zhang, Zili Wang, Steven Ka Shing Yau, Zijuan Lin, Liyang Zhou, Chenyu Ran, Lingfeng Xiao, and Chenglin Wu. Metagpt: Meta programming for multi-agent collaborative framework, 2023.
|
| 205 |
+
|
| 206 |
+
Terence Irwin. Aristotle’s first principles. Clarendon Press, 1989.
|
| 207 |
+
|
| 208 |
+
Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. ArXiv preprint, abs/2205.11916, 2022.
|
| 209 |
+
|
| 210 |
+
Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image pretraining with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597, 2023.
|
| 211 |
+
|
| 212 |
+
Xiao Liu, Hao Yu, Hanchen Zhang, Yifan Xu, Xuanyu Lei, Hanyu Lai, Yu Gu, Hangliang Ding, Kaiwen Men, Kejuan Yang, et al. Agentbench: Evaluating llms as agents. arXiv preprint arXiv:2308.03688, 2023.
|
| 213 |
+
|
| 214 |
+
Pattie Maes. Agents that reduce work and information overload. In Readings in human–computer interaction, pp. 811–821. Elsevier, 1995.
|
| 215 |
+
|
| 216 |
+
Yohei Nakajima. Babyagi. https://github.com/yoheinakajima/babyagi, 2023.
|
| 217 |
+
|
| 218 |
+
Maxwell Nye, Anders Johan Andreassen, Guy Gur-Ari, Henryk Michalewski, Jacob Austin, David Bieber, David Dohan, Aitor Lewkowycz, Maarten Bosma, David Luan, et al. Show your work: Scratchpads for intermediate computation with language models. In Deep Learning for Code Workshop, 2022.
|
| 219 |
+
|
| 220 |
+
OpenAI. Gpt-4 technical report, 2023.
|
| 221 |
+
|
| 222 |
+
Joon Sung Park, Joseph C O’Brien, Carrie J Cai, Meredith Ringel Morris, Percy Liang, and Michael S Bernstein. Generative agents: Interactive simulacra of human behavior. arXiv preprint arXiv:2304.03442, 2023.
|
| 223 |
+
|
| 224 |
+
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, pp. 8748–8763. PMLR, 2021.
|
| 225 |
+
|
| 226 |
+
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 (JMLR), 21:1–67, 2020.
|
| 227 |
+
Christopher Rawles, Alice Li, Daniel Rodriguez, Oriana Riva, and Timothy Lillicrap. Android in the wild: A large-scale dataset for android device control. arXiv preprint arXiv:2307.10088, 2023.
|
| 228 |
+
Reworkd. Agentgpt. https://github.com/reworkd/AgentGPT, 2023.
|
| 229 |
+
Toran Bruce Richards. Auto-gpt: An autonomous gpt-4 experiment. https://github.com/SignificantGravitas/Auto-GPT, 2023.
|
| 230 |
+
Victor Sanh, Albert Webson, Colin Raffel, Stephen Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Arun Raja, Manan Dey, et al. Multitask prompted training enables zero-shot task generalization. In International Conference on Learning Representations, 2021.
|
| 231 |
+
John R Searle. Speech acts: An essay in the philosophy of language, volume 626. Cambridge university press, 1969.
|
| 232 |
+
Theodore Sumers, Shunyu Yao, Karthik Narasimhan, and Thomas L Griffiths. Cognitive architectures for language agents. arXiv preprint arXiv:2309.02427, 2023.
|
| 233 |
+
Liangtai Sun, Xingyu Chen, Lu Chen, Tianle Dai, Zichen Zhu, and Kai Yu. Meta-gui: Towards multi-modal conversational agents on mobile gui. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 6699–6712, 2022.
|
| 234 |
+
Srinivas Sunkara, Maria Wang, Lijuan Liu, Gilles Baechler, Yu-Chung Hsiao, Jindong Chen, Abhanshu Sharma, and James WW Stout. Towards better semantic understanding of mobile interfaces. In Proceedings of the 29th International Conference on Computational Linguistics, pp. 5636–5650, 2022.
|
| 235 |
+
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, 2023a.
|
| 236 |
+
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023b.
|
| 237 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023.
|
| 238 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998–6008, 2017.
|
| 239 |
+
Bryan Wang, Gang Li, and Yang Li. Enabling conversational interaction with mobile ui using large language models. In Proceedings of the 2023 CHI Conference on Human Factors in Computing Systems, pp. 1–17, 2023a.
|
| 240 |
+
Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar. Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305.16291, 2023b.
|
| 241 |
+
Lei Wang, Chen Ma, Xueyang Feng, Zeyu Zhang, Hao Yang, Jingsen Zhang, Zhiyuan Chen, Jiakai Tang, Xu Chen, Yankai Lin, et al. A survey on large language model based autonomous agents. arXiv preprint arXiv:2308.11432, 2023c.
|
| 242 |
+
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, abs/2201.11903, 2022.
|
| 243 |
+
Hao Wen, Yuanchun Li, Guohong Liu, Shanhui Zhao, Tao Yu, Toby Jia-Jun Li, Shiqi Jiang, Yunhao Liu, Yaqin Zhang, and Yunxin Liu. Empowering llm to use smartphone for intelligent task automation. arXiv preprint arXiv:2308.15272, 2023.
|
| 244 |
+
Michael Wooldridge and Nicholas R Jennings. Intelligent agents: Theory and practice. The knowledge engineering review, 10(2):115–152, 1995.
|
| 245 |
+
Zhiyong Wu, Lingpeng Kong, Wei Bi, Xiang Li, and Ben Kao. Good for misconceived reasons: An empirical revisiting on the need for visual context in multimodal machine translation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 6153–6166, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021. acl-long.480.
|
| 246 |
+
An Yan, Zhengyuan Yang, Wanrong Zhu, Kevin Lin, Linjie Li, Jianfeng Wang, Jianwei Yang, Yiwu Zhong, Julian McAuley, Jianfeng Gao, et al. Gpt-4v in wonderland: Large multimodal models for zero-shot smartphone gui navigation. arXiv preprint arXiv:2311.07562, 2023.
|
| 247 |
+
Xiaoyi Zhang, Lilian de Greef, Amanda Swearngin, Samuel White, Kyle Murray, Lisa Yu, Qi Shan, Jeffrey Nichols, Jason Wu, Chris Fleizach, et al. Screen recognition: Creating accessibility metadata for mobile applications from pixels. In Proceedings of the 2021 CHI Conference on Human Factors in Computing Systems, pp. 1–15, 2021.
|
| 248 |
+
Zhuosheng Zhang, Kehai Chen, Rui Wang, Masao Utiyama, Eiichiro Sumita, Zuchao Li, and Hai Zhao. Neural machine translation with universal visual representation. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 249 |
+
Zhuosheng Zhang, Shuohang Wang, Yichong Xu, Yuwei Fang, Wenhao Yu, Yang Liu, Hai Zhao, Chenguang Zhu, and Michael Zeng. Task compass: Scaling multi-task pre-training with task prefix. In Findings of the Association for Computational Linguistics: EMNLP 2022, pp. 5671–5685, 2022.
|
| 250 |
+
Zhuosheng Zhang, Aston Zhang, Mu Li, and Alex Smola. Automatic chain of thought prompting in large language models. In The Eleventh International Conference on Learning Representations, 2023a.
|
| 251 |
+
Zhuosheng Zhang, Aston Zhang, Mu Li, Hai Zhao, George Karypis, and Alex Smola. Multimodal chain-of-thought reasoning in language models. arXiv preprint arXiv:2302.00923, 2023b.
|
| 252 |
+
Shuyan Zhou, Frank F Xu, Hao Zhu, Xuhui Zhou, Robert Lo, Abishek Sridhar, Xianyi Cheng, Yonatan Bisk, Daniel Fried, Uri Alon, et al. Webarena: A realistic web environment for building autonomous agents. arXiv preprint arXiv:2307.13854, 2023.
|
| 253 |
+
Xizhou Zhu, Yuntao Chen, Hao Tian, Chenxin Tao, Weijie Su, Chenyu Yang, Gao Huang, Bin Li, Lewei Lu, Xiaogang Wang, et al. Ghost in the minecraft: Generally capable agents for open-world enviroments via large language models with text-based knowledge and memory. arXiv preprint arXiv:2305.17144, 2023.
|
| 254 |
+
|
| 255 |
+
# A APPENDIX
|
| 256 |
+
|
| 257 |
+
# A.1 DATA STATISTICS
|
| 258 |
+
|
| 259 |
+
We use the AITW benchmark dataset (Rawles et al., 2023). AITW is a large-scale benchmark dataset for UI control, which contains natural language instructions, screenshots, and actions. There are $7 1 5 K$ episodes spanning $3 0 K$ unique instructions, covering diverse multi-step tasks such as application operation, web searching, and web shopping, on over 350 Apps and websites. This dataset covers various device types and operation systems in varying screen resolutions to ensure generality. There are five subsets in the benchmark dataset, namely, General, Install, GoogleApps, Single, and WebShopping.
|
| 260 |
+
|
| 261 |
+
(i) General contains miscellaneous tasks that need interaction with third-party Apps and websites, as well as question answering.
|
| 262 |
+
(ii) Install contains tasks related to installing and uninstalling Apps, App login, and App login support. (iii) GoogleApps contains tasks about manipulating various Google applications such as Gmail, Calendar, Photos, and Settings.
|
| 263 |
+
(iv) Single contains atomic tasks (e.g., “upvote the post”) whose preceding actions have been already completed (e.g., opening Instagram, going to home feed, looking at a post).
|
| 264 |
+
(v) WebShopping contains tasks related to online shopping on E-commerce websites, e.g., searching for an item, adding an item to the cart, and viewing the shopping cart.
|
| 265 |
+
Table 5 presents the data statistics of the AITW dataset. Each subset is split episode-wise into a training, validation, and test set $( 8 0 / 1 0 / 1 0 \%$ ).
|
| 266 |
+
|
| 267 |
+
Table 5: Dataset statistics.
|
| 268 |
+
|
| 269 |
+
<table><tr><td>Dataset</td><td>Episodes</td><td>Screens</td><td>Instructions</td></tr><tr><td>General</td><td>9,476</td><td>85,413</td><td>545</td></tr><tr><td>Install</td><td>25,760</td><td>250,058</td><td>688</td></tr><tr><td>GoogleApps</td><td>625,542</td><td>4,903,601</td><td>306</td></tr><tr><td>Single</td><td>26,303</td><td>85,668</td><td>15,366</td></tr><tr><td>WebShopping</td><td>28,061</td><td>365,253</td><td>13,473</td></tr></table>
|
| 270 |
+
|
| 271 |
+
# A.2 TASK EXAMPLES
|
| 272 |
+
|
| 273 |
+
We show the task examples from the AITW benchmark dataset (Rawles et al., 2023). Figures 6-10 show the examples in each subset, i.e., General, Install, GoogleApps, Single, and WebShopping. The gold actions for each screen are depicted in the illustrations for reference.
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 6: An example episode from General.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 7: An example episode from Install.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Goal: turn off javascript in the chrome app
|
| 283 |
+
Figure 8: An example episode from GoogleApps.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 9: An example episode from Single.
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 10: An example episode from WebShopping.
|
| 290 |
+
|
| 291 |
+
Table 6: Target output examples after the coordinate normalization.
|
| 292 |
+
|
| 293 |
+
<table><tr><td>Action Type</td><td>Target Output</td></tr><tr><td>dual-point gesture (click)</td><td>“action_type": 4,"touch_point": [0.8497,0.5964],“lift_point": [0.8497,0.5964], “typed_text":"</td></tr><tr><td>dual-point gesture (scroll)</td><td>“action_type": 4,“touch_point": [0.2,0.5],“lift_point": [0.8,0.5],"typed_text":</td></tr><tr><td>type</td><td>“action_type":3,“touch_point”:_[-1.0,-1.0],“lift_point":[-1.0,-1.0], “typed_text":“what’s the news in chile?”</td></tr><tr><td>go_back</td><td>“action_type":5,“touch_point":[-1.0,-1.0], “lift_point”:[-1.0,-1.0], “typed_text":"</td></tr><tr><td>go_home</td><td>“action_type":6,“touch_point":[-1.0,-1.0],“lift_point":[-1.0,-1.0], “typed_text": "”</td></tr><tr><td>enter</td><td>“action_type":7,“touch_point":[-1.0,-1.0],“lift_point":[-1.0,-1.0], “typed_text":“’</td></tr><tr><td>status_complete</td><td>“action_type":10,“touch_point”:[-1.0,-1.0],“lift_point”:[-1.0,-1.0], “typed_text":’</td></tr></table>
|
| 294 |
+
|
| 295 |
+
# A.4 LLM PROMPT
|
| 296 |
+
|
| 297 |
+
# We use the following prompt for PaLM 2-CoT and ChatGPT-CoT due to its optimal performance reported in Rawles et al. (2023).
|
| 298 |
+
|
| 299 |
+
Given a mobile screen and a question, provide the action based on the screen information. Available Actions:
|
| 300 |
+
{"action_type": "click", "idx": <element_idx>}
|
| 301 |
+
{"action_type": "type", "text": <text>}
|
| 302 |
+
{"action_type": "navigate_home"}
|
| 303 |
+
{"action_type": "navigate_back"}
|
| 304 |
+
{"action_type": "scroll", "direction": "up"}
|
| 305 |
+
{"action_type": "scroll", "direction": "down"}
|
| 306 |
+
{"action_type": "scroll", "direction": "left"}
|
| 307 |
+
{"action_type": "scroll", "direction": "right"}
|
| 308 |
+
Previous Actions:
|
| 309 |
+
{"step_idx": 0, "action_description": "press [HOME key]"}
|
| 310 |
+
{"step_idx": 2, "action_description": "click [Google Icon]"}
|
| 311 |
+
{"step_idx": 3, "action_description": "click [search for hotels]"}
|
| 312 |
+
Screen:
|
| 313 |
+
<img id=0 class $= ^ { \dag }$ "IconGoogle" alt $=$ "Google Icon"> </img>
|
| 314 |
+
<img id=1 class $=$ "IconX" alt $=$ "Close Icon"> </img>
|
| 315 |
+
<p id=2 class="text" alt $=$ "search for hotels"> search for hotels </p>
|
| 316 |
+
<p id=3 class="text" alt="in"> in $< / _ { \mathrm { p } } >$
|
| 317 |
+
<p id=4 class="text" alt="mexico city mexico"> mexico city mexico </p>
|
| 318 |
+
<img id=5 class="IconMagnifyingGlass" alt="Search Icon"> </img>
|
| 319 |
+
<p id=6 class="text" alt="Share"> Share $< / _ { \mathrm { p } } >$
|
| 320 |
+
<p id=7 class="text" alt="Select alI" $>$ Select alI </p>
|
| 321 |
+
<p id=8 class="text" alt="Cut" $>$ Cut </p>
|
| 322 |
+
<p id=9 class="text" alt="Copy"> Copy </p>
|
| 323 |
+
<p id=10 class="text" alt $=$ "hotel in mex"> hotel in mex $< / _ { \mathrm { p } } >$
|
| 324 |
+
<img id=11 class="IconMagnifyingGlass" alt $=$ "Search Icon"> </img>
|
| 325 |
+
<p id=12 class="text" alt="best hotel" $>$ best hotel </p>
|
| 326 |
+
<p id=13 class="text" alt="mexico city"> mexico city </p>
|
| 327 |
+
<p id=14 class="text" alt="in"> in $< / _ { \mathrm { p } } >$
|
| 328 |
+
<img id=15 class="IconMagnifyingGlass" alt $=$ "Search Icon"> </img>
|
| 329 |
+
<p id=16 class $: =$ "text" alt="K"> K $< / _ { \mathrm { p } } >$
|
| 330 |
+
<p id=17 class $: =$ "text" alt $=$ "hotel ciudad" $>$ hotel ciudad </p>
|
| 331 |
+
<p id=18 class $=$ "text" alt="de mexico"> de mexico </p>
|
| 332 |
+
<p id=19 class="text" alt="gran"> gran $< / _ { \mathrm { p } } >$
|
| 333 |
+
<img id=20 class="IconVBackward" alt="Left Icon"> </img>
|
| 334 |
+
<img id=21 class="IconNavBarCircle" alt="Home Icon"> </img>
|
| 335 |
+
<img $\scriptstyle { \dot { 1 } } \mathrm { d } = 2 2$ class $= ^ { 1 }$ "IconNavBarRect" alt $=$ "Overview Icon"> </img>
|
| 336 |
+
Instruction: What time is it in Berlin?
|
| 337 |
+
Answer: Let’s think step by step. I see unrelated search results in the Google app, I must clear the search bar, so the action is {"action_type": "click", "idx": 1} Previous Actions:
|
| 338 |
+
{"step_idx": 0, "action_description": "click [DISMISS]"}
|
| 339 |
+
Screen:
|
| 340 |
+
<p id=0 class $=$ "text" alt $=$ "Update your"> Update your </p>
|
| 341 |
+
<p id=1 class="text" alt="Gmail app" $>$ Gmail app </p>
|
| 342 |
+
<p id=2 class="text" alt $=$ "attach files from"> attach files from </p>
|
| 343 |
+
<p id=3 class="text" alt $=$ "To"> To $< / _ { \mathrm { p } } >$
|
| 344 |
+
<p id=4 class="text" alt="download the"> download the </p>
|
| 345 |
+
<p id=5 class="text" alt="Drive,"> Drive, </p>
|
| 346 |
+
<p id=6 class="text" alt="latest"> latest $< / _ { \mathrm { p } } >$
|
| 347 |
+
<p id=7 class="text" alt="version"> version </p>
|
| 348 |
+
<p id=8 class="text" alt="of"> of </p>
|
| 349 |
+
<p id=9 class="text" alt="Gmail"> Gmail </p>
|
| 350 |
+
<p id=10 clas $; =$ "text" alt $=$ "UPDATE"> UPDATE </p>
|
| 351 |
+
<p id=11 class $=$ "text" alt $=$ "DISMISS"> DISMISS </p>
|
| 352 |
+
<p id=12 class="text" alt="Got"> Got </p>
|
| 353 |
+
<p id=13 class="text" alt="it"> it </p>
|
| 354 |
+
<img id=14 class="IconVBackward" alt="Left Icon"> </img>
|
| 355 |
+
Instruction: see creations saved in the google photos
|
| 356 |
+
Answer: Let’s think step by step. I see a popup, I need to open Google Photos, so
|
| 357 |
+
the action is {"action_type": "click", "idx": 11}
|
| 358 |
+
|
| 359 |
+
Previous Actions:
|
| 360 |
+
|
| 361 |
+
Screen:
|
| 362 |
+
<p id=0 class $=$ "text" alt $=$ "M"> M </p>
|
| 363 |
+
<p id=1 class="text" alt="New in Gmail"> New in Gmail </p>
|
| 364 |
+
<p id=2 class="text" alt $=$ "All the features you"> All the features you </p>
|
| 365 |
+
<p id=3 class="text" alt="love with"> love with $< / _ { \mathrm { p } } >$
|
| 366 |
+
<p id=4 class="text" alt="a fresh"> a fresh </p>
|
| 367 |
+
<p id=5 class="text" alt="look"> look </p>
|
| 368 |
+
<p id=6 class="text" alt="new"> new </p>
|
| 369 |
+
<p id=7 class="text" alt $=$ "GOT IT"> GOT IT </p>
|
| 370 |
+
Instruction: open app "Google Play services"
|
| 371 |
+
Answer: Let’s think step by step. I see the GMail app, I need to open the app
|
| 372 |
+
drawer, so the action is {"action_type": "navigate_home"}
|
| 373 |
+
|
| 374 |
+
Previous Actions:
|
| 375 |
+
|
| 376 |
+
Screen:
|
| 377 |
+
<p id=0 class $=$ "text" alt $= \cdot$ "Tuesday, Aug"> Tuesday, Aug </p>
|
| 378 |
+
<p id=1 class="text" alt="9"> 9 </p>
|
| 379 |
+
<img id=2 class="IconChat" alt="Chat Icon"> </img>
|
| 380 |
+
<img id=3 class $=$ "IconGoogle" alt="Google Icon"> </img>
|
| 381 |
+
|
| 382 |
+
Instruction: open app "Messenger Lite" (install if not already installed) Answer: Let’s think step by step. I see the home screen, I need to open the app drawer, I should swipe up, so the action is {"action_type": "scroll", "direction": "down"}
|
| 383 |
+
|
| 384 |
+
Previous Actions: {"step_idx": 0, "action_description": "scroll down"}
|
| 385 |
+
|
| 386 |
+
Screen:
|
| 387 |
+
<img id=0 class $=$ "IconThreeDots" alt $=$ "More Icon"> </img>
|
| 388 |
+
<p id=1 class="text" alt="Search your phone and more"> Search your phone and more $< / _ { \mathrm { p } } >$
|
| 389 |
+
<p id=2 class="text" alt="M"> M </p>
|
| 390 |
+
<p id=3 class="text" alt="O"> O </p>
|
| 391 |
+
<img id=4 class="IconPlay" alt="Play Icon"> </img>
|
| 392 |
+
<p id=5 class $=$ "text" alt $=$ "Clock" $>$ Clock </p>
|
| 393 |
+
<p id=6 class="text" alt $=$ "YouTube"> YouTube </p>
|
| 394 |
+
<p id=7 class="text" alt="Photos"> Photos </p>
|
| 395 |
+
<p id=8 class="text" alt="Gmail"> Gmail </p>
|
| 396 |
+
<p id=9 class="text" alt="All apps"> All apps $< / _ { \mathrm { p } } >$
|
| 397 |
+
<p id=10 class="text" alt="g"> g </p>
|
| 398 |
+
<p id=11 class="text" alt="O"> O </p>
|
| 399 |
+
<img id=12 class="IconTakePhoto" alt $=$ "Camera Icon"> </img>
|
| 400 |
+
<p id=13 class $: =$ "text" $\mathsf { a l t } { = } " \mathrm { 1 0 } " > \mathrm { ~ 1 0 ~ } < / \mathsf { p } >$
|
| 401 |
+
<p id=14 class $: =$ "text" alt $=$ "Calendar"> Calendar </p>
|
| 402 |
+
<p id=15 class="text" alt="Camera"> Camera </p>
|
| 403 |
+
<p id=16 class $=$ "text" alt="Chrome"> Chrome </p>
|
| 404 |
+
<p id=17 class="text" alt="Clock"> Clock $< / _ { \mathrm { p } } >$
|
| 405 |
+
<p id=18 class $: =$ "text" alt="0"> 0 </p>
|
| 406 |
+
<p id=19 clas $; =$ "text" alt="M"> M $< / _ { \mathrm { p } } >$
|
| 407 |
+
<p id=20 class $: =$ "text" alt="B"> B $< / _ { \mathrm { p } } >$
|
| 408 |
+
<img id=21 class="IconPerson" alt $=$ "Person Icon"> </img>
|
| 409 |
+
<p id=22 class $=$ "text" alt="Gmail"> Gmail </p>
|
| 410 |
+
<p id=23 class="text" alt="Drive"> Drive </p>
|
| 411 |
+
<p id=24 class="text" alt="Files"> Files </p> <p id=25 class $=$ "text" alt="Contacts"> Contacts </p>
|
| 412 |
+
<p id=26 class="text" alt="G OO"> G OO $< / _ { \mathrm { p } } >$
|
| 413 |
+
<img id=27 class="IconGoogle" alt="Google Icon"> </img>
|
| 414 |
+
<img $\scriptstyle { \dot { 1 } } \mathrm { d } = 2 8$ class $=$ "IconLocation" alt $=$ "Location Icon"> </img>
|
| 415 |
+
<img id=29 class="IconCall" alt $=$ "Phone Icon"> </img>
|
| 416 |
+
<img $\dot { \sf 1 } \dot { \sf 0 } = \sf 3 0$ class $=$ "IconChat" alt $=$ "Chat Icon"> </img>
|
| 417 |
+
<p id=31 class $=$ "text" alt $=$ "Google"> Google </p>
|
| 418 |
+
<p id=32 class="text" alt $=$ "Maps"> Maps </p>
|
| 419 |
+
Instruction: Search for hotels in Chicago.
|
| 420 |
+
Answer: Let’s think step by step. I see the app drawer, I need to search, so the action is {"action_type": "click", "idx": 27}
|
| 421 |
+
Previous Actions:
|
| 422 |
+
<HISTORY>
|
| 423 |
+
Screen:
|
| 424 |
+
<SCREEN_REPRESENTATION>
|
| 425 |
+
Instruction: <GROUNDING_GOAL>
|
| 426 |
+
Answer: Let’s think step by step. I see
|
| 427 |
+
|
| 428 |
+
# A.5 USING SCREEN DESCRIPTIONS
|
| 429 |
+
|
| 430 |
+
We are interested in whether Auto-UI can be further improved when screen annotations are available. Therefore, we incorporate screen descriptions containing icon and text information, organized in HTML syntax, into our language input $X _ { \mathrm { l a n g u a g e } }$ . Detailed examples of screen descriptions can be found in the “Screen” section in A.4.
|
| 431 |
+
|
| 432 |
+
Table 7: Results of Auto-UI when using annotated screen descriptions.
|
| 433 |
+
|
| 434 |
+
<table><tr><td>Model</td><td>Overall</td><td>General</td><td>Install</td><td>GoogleApps</td><td>Single</td><td>WebShopping</td></tr><tr><td>Auto-UIbase</td><td>72.84</td><td>66.97</td><td>75.93</td><td>70.29</td><td>82.56</td><td>68.46</td></tr><tr><td>w/ Screen Descriptions</td><td>75.54</td><td>70.30</td><td>78.05</td><td>73.04</td><td>85.31</td><td>71.00</td></tr></table>
|
| 435 |
+
|
| 436 |
+
In Table 7, we see that Auto-UI can perform better when the annotated screen descriptions are available. The results show that there is still room for performance gains for Auto-UI. However, as the annotations are not always available in real-world applications, we do not include them by default in our framework.
|
| 437 |
+
|
| 438 |
+
# B FURTHER ANALYSIS
|
| 439 |
+
|
| 440 |
+
# B.1 CATEGORY COMPARISON WITH THE ICL BASELINE
|
| 441 |
+
|
| 442 |
+
To understand how the ICL baseline performs on our task and assess the advantage of Auto-UI, we conduct a category comparison with ChatGPT.
|
| 443 |
+
|
| 444 |
+
Table 8: Category comparison with the ICL baseline on the General test.
|
| 445 |
+
|
| 446 |
+
<table><tr><td>Model</td><td>Overall</td><td>Action Type</td><td>Click</td><td>Scroll</td></tr><tr><td>ChatGPT</td><td>5.93</td><td>41.72</td><td>8.50</td><td>4.00</td></tr><tr><td>Auto-UI</td><td>68.24</td><td>87.03</td><td>58.34</td><td>82.74</td></tr></table>
|
| 447 |
+
|
| 448 |
+
We see that the ICL method (ChatGPT) is quite accurate at predicting the action type $( 4 1 . 7 2 \% )$ but fails at lower-level executions, e.g., clicking positions $( 8 . 5 \% )$ and scrolling directions $( 4 . 0 \% )$ . The results show that using HTML-based layout information is not enough to accurately execute actions. In contrast, Auto-UI has the advantage of predicting both action types and performing low-level executions by leveraging multimodal perception and the chain-of-action technique.
|
md/test/jolYuxpVn1/jolYuxpVn1.md
ADDED
|
@@ -0,0 +1,634 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FACTOOL: FACTUALITY DETECTION IN GENERATIVE AI - A TOOL AUGMENTED FRAMEWORK FOR MULTITASK AND MULTI-DOMAIN SCENARIOS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The emergence of generative pre-trained models has facilitated the synthesis of high-quality text but has also posed challenges in identifying factual errors in the generated text. In particular: (1) A wider range of tasks now face an increasing risk of containing factual errors when handled by generative models. (2) The content generated by these models tends to be lengthy and lacks clearly defined granularity for individual facts. (3) There is a scarcity of explicit evidence available during the process of fact checking. With the above challenges in mind, in this paper, we propose FACTOOL, a tool augmented multi-task and multi-domain framework for detecting factual errors of texts generated by large language models (e.g., ChatGPT). Experiments on four different tasks (knowledge-based QA, code generation, mathematical reasoning, and scientific literature review) show the efficacy of the proposed method. We release the code of FACTOOL with ChatGPT plugin at https: //anonymous.4open.science/r/factool_iclr_anon-B1A0/.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generative artificial intelligence (AI) technology (OpenAI, 2023) consolidates various tasks in natural language processing into a single sequence generation problem. This unified architecture enables users to complete multiple tasks (e.g., question answering (Thoppilan et al., 2022), code generation (Chen et al., 2021), math Self-checkproblem solving (Lewkowycz et al., 2022), and scientific literature generation (Taylor et al., 2022)) through a natural language interface (Liu et al., 2023) with both unprecedented performance (Bubeck et al., 2023) and interactivity.
|
| 12 |
+
|
| 13 |
+
However, at the same time, such a generative paradigm also introduces some unique challenges. Content that is automatically generated can often exhibit inaccuracies or deviations from the truth due to the limited capacity of large language models (LLMs) (Ji et al., 2023; Schulman, 2023). LLMs are susceptible to producing content that appears credible but factually incorrect
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Tool augmented framework for factuality detection.
|
| 17 |
+
|
| 18 |
+
or imprecise. This limitation restricts the application of generative AI in some high-stakes areas, such as healthcare, finance, and law. Therefore, it is crucial to identify these errors systematically to improve the usefulness and reliability of the generated content.
|
| 19 |
+
|
| 20 |
+
Current literature on detecting and mitigating factual errors generated by models focuses predominantly on a single task, for example, retrieval-augmented verification models for QA (Lewis et al., 2020), hallucination detection models for text summarization (Fabbri et al., 2022), and executionbased evaluation for code (Shi et al., 2022). While these methods have proven successful within their respective areas, given the versatility of tasks and domains handled by LLMs, we argue that it is essential to have a more comprehensive factuality detection framework that is similarly versatile.
|
| 21 |
+
|
| 22 |
+
Table 1: A comparison of published approaches for factuality detection in terms of generated responses and claims to be verified based on collected evidence. “Scenario” represents which task and domain the corresponding approach has been justified. “Sci.” represents “Scientific”.
|
| 23 |
+
|
| 24 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">Response</td><td colspan="2">Claim</td><td>Evidence</td><td colspan="2">Scenario</td></tr><tr><td>Length</td><td>Generated by</td><td>Granularity</td><td>Provided</td><td>Provided</td><td>Domain</td><td>Task</td></tr><tr><td>FEVER-based</td><td>7.30</td><td>Human</td><td>Fact</td><td>√</td><td>X</td><td>Wikipedia</td><td>Fact Verification</td></tr><tr><td>FactCC</td><td>20.83</td><td>Synthetic</td><td>Sentence</td><td>√</td><td>√</td><td>Newswire</td><td>Summ. Factuality</td></tr><tr><td>QAGS-based</td><td>16.11</td><td>Model</td><td>Summary</td><td>√</td><td>√</td><td>Newswire</td><td>Summ.Factuality</td></tr><tr><td>WICE-based</td><td>24.20</td><td>Human</td><td>Fact</td><td>√</td><td>√</td><td>Wikipedia</td><td>Entailment</td></tr><tr><td>RARR</td><td>-</td><td>PaLM/LaMDA</td><td>Fact</td><td>×</td><td>X</td><td>Wikipedia</td><td>QA</td></tr><tr><td rowspan="4">FACTOOL</td><td>41.80</td><td>ChatGPT</td><td>Fact</td><td>X</td><td>X</td><td>Wikipedia</td><td>QA</td></tr><tr><td>30.37</td><td></td><td>Snippet </td><td>XX</td><td></td><td></td><td></td></tr><tr><td></td><td>ChatGPT</td><td></td><td></td><td>XX</td><td>Python</td><td> Madh Prneration</td></tr><tr><td>76.34</td><td>ChatGPT</td><td>Tuple</td><td>X</td><td>X</td><td>Sci. text</td><td>Sci. Review</td></tr></table>
|
| 25 |
+
|
| 26 |
+
Moreover, in existing literature, factuality detection is usually defined as either (i) verifying the factuality of a given claim, or (ii) checking if the provided evidence supports the claim. This definition is overly simplistic as it does not encompass interactions with LLMs like ChatGPT, where we often need to verify the factuality of long-form generation without explicit claims and evidence.
|
| 27 |
+
|
| 28 |
+
In this paper, we propose a multi-task and multi-domain factuality detection framework, FACTOOL, aiming to detect factual errors in LLM-generated texts. We illustrate our framework in Fig. 1, where we connect the concept of “tool use”(Thoppilan et al., 2022; Gao et al., 2022b; Schick et al., 2023) with “factuality detection” and demonstrate that the ability to use tools in LLMs is crucial for factuality detection. Specifically, FACTOOL leverages various tools, including Google Search, Google Scholar, code interpreters, Python, to gather evidence about the factuality of the generated content. Moreover, FACTOOL employs the reasoning abilities of LLMs to assess the factuality of the content, given the gathered evidence. We develop a benchmark and perform experiments across four tasks: knowledge-based QA (KB-QA), code generation (code), math problem solving (math), and scientific literature review writing (scientific).
|
| 29 |
+
|
| 30 |
+
In summary, our contributions are:
|
| 31 |
+
|
| 32 |
+
• We revisit and extend the task of factuality detection, allowing better audit of modern LLMs. • We connect the concept of “tool use” with “factuality detection”, developing a unified and versatile framework for factuality detection across a variety of domains and tasks. • We use FACTOOL to evaluate the factuality of modern chatbots and find GPT-4 to exhibit the best factuality in most scenarios. Vicuna-13B (supervised fine-tuned chatbot) shows decent factuality in KB-QA but underperforms in more challenging scenarios such as math, code, and scientific.
|
| 33 |
+
|
| 34 |
+
# 2 RELATED WORK
|
| 35 |
+
|
| 36 |
+
Factuality Detection in Natural Language Processing Factuality detection has been a topic of intense study even before generative AI existed. Existing works can be organized by their differences on the “response” to verify, the “claim” extracted from the response, and supporting “evidence”. As illustrated in Tab. 1, the creation of the FEVER dataset (Thorne et al., 2018b) spawned models (Zhong et al., 2020; Krishna et al., 2022) that determine whether a given fine-grained claim made based on Wikipedia articles is correct. In this task setting, both the claim and related evidence are given. FactCC (Kryscinski et al., 2020) and QAGS-based models (Wang et al., 2020) adopted different task formulations to detect factual consistency, i.e., given the evidence text, and the goal is to determine if the generated summaries or summary sentences are factually consistent with the given text. WICE-based methods (Kamoi et al., 2023) decide if a fact from a Wikipedia sentence could be supported by provided evidence. RARR (Gao et al., 2022a) proposed a new approach by directly prompting LLMs to generate queries, retrieve evidence and determine factuality.
|
| 37 |
+
|
| 38 |
+
Existing works typically rely on given claims or evidences and target a specific use case. In this paper, we introduce a more challenging yet practical task setting: factuality detection without explicit claims or evidence, and propose a framework that can tackle this challenge across various scenarios.
|
| 39 |
+
|
| 40 |
+
Tool use in LLMs LLMs store limited knowledge within their parameters. To overcome this limitation, various tools have been introduced to assist LLMs to further expand their capabilities. For example, Press et al. (2022); Komeili et al. (2022) gathered information from the Internet to enhance QA and dialog systems, respectively. Schick et al. (2023) trained a model capable of interacting with five tools including a calculator, a translation system, etc. Shen et al. (2023) introduced a framework that employs LLMs to connect various AI models from the ML communities to tackle AI tasks. Liang et al. (2023) proposed a new AI ecosystem that connects LLMs with millions of existing APIs to accomplish tasks. In this work, we explore tool use in LLMs for the task of factuality detection.
|
| 41 |
+
|
| 42 |
+
# 3 REVISITING FACTUALITY IN GENERATIVE AI
|
| 43 |
+
|
| 44 |
+
# 3.1 DEFINITION
|
| 45 |
+
|
| 46 |
+
Versatile Factuality In most previous works, factuality has been defined as whether a claim in a text can be supported by evidence from a separate, trustworthy knowledge base, with applications in fact-checking (Thorne et al., 2018a) (where the knowledge base is a large source like Wikipedia) and summarization (Kryscinski et al., 2020) (where the knowledge base is an input document or documents). In this paper, we extend this definition to whether the claims made in generated signals (which could be text, code, or mathematical expressions and so on) can be supported by evidence under specific rules. Specifically, these rules can range from consistency with a knowledge base derived from Wikipedia, to a verification rule specified within a Python library, or an operational rule derived from mathematics. By adopting this broader definition, we are able to establish a unified framework for addressing factuality issues in generative AI beyond just the textual domain.
|
| 47 |
+
|
| 48 |
+
Fine-grained Factuality Typically, one can ascertain the factuality of a generated signal (e.g., text) at various levels of granularity, including sentence and document level. A more granular assessment can be especially valuable as it not only (1) enable users to pinpoint where inaccuracies occur (Liu et al., 2021) but also (2) functions as a reward model for developers to refine their generative systems (Lightman et al., 2023). Nevertheless, implementing fine-grained factuality detection is challenging for two reasons: (1) specifying the desired granularity level unambiguously, and (2) extracting claims that accord with the predetermined granularity level. In this paper, we argue that the robust instruction-following ability and natural language interface of LLMs can be effectively utilized to address the challenge of defining and extracting fine-grained claims via claim definition-based few-shot prompting. Additional details can be found in $\ S 4 . 1$ .
|
| 49 |
+
|
| 50 |
+
Structurally speaking, given a prompt (e.g., a query or instruction) and the corresponding modelgenerated response, the fine-grained factuality detection task involves the following concepts:
|
| 51 |
+
|
| 52 |
+
Prompt $( p )$ a query or instruction that users provide to the generative model.
|
| 53 |
+
|
| 54 |
+
Response $( r )$ a piece of text (usually in long form) generated by the generative model.
|
| 55 |
+
|
| 56 |
+
Claim (c) a statement inferred from the model response with granularity defined by natural language.
|
| 57 |
+
|
| 58 |
+
Evidence (e) The available information (e.g., knowledge base, pre-defined rules) that support or demonstrate the truth or validity of a claim.
|
| 59 |
+
|
| 60 |
+
Table 2: Factuality definition in different tasks.
|
| 61 |
+
|
| 62 |
+
<table><tr><td>Tasks</td><td>Prompt (p)</td><td>Response (r)</td><td>Claim (c)</td><td>Evidence (e)</td></tr><tr><td>KB-QA</td><td>Question</td><td>Long-form answer</td><td>Atomic component unit</td><td>Web searched results</td></tr><tr><td>Code Generation</td><td>Code Query</td><td>Executable code</td><td>Code snippet</td><td>Python library</td></tr><tr><td>Math Problems</td><td>Math problems</td><td>Math solution</td><td>Math calculation</td><td>Calculator</td></tr><tr><td>Scientific Literature Review</td><td>Scientific question</td><td>Long-form review</td><td>Tuple (paper title,year,authors)</td><td>Google scholar</td></tr></table>
|
| 63 |
+
|
| 64 |
+
# 3.2 INSTANTIATIONS IN DIFFERENT SCENARIOS
|
| 65 |
+
|
| 66 |
+
Using the above task definition, we define factuality in different scenarios (see also in Tab. 2).
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: Our proposed framework for factuality detection in four domains.
|
| 70 |
+
|
| 71 |
+
KB-QA Knowledge-based (KB) QA (Chen et al., 2017) aims to answer questions using a given knowledge base or open-domain data source (e.g., Wikipedia). We define factuality as how well each claim in the generated answer is supported by world knowledge. In this paper, we consider a more challenging scenario: open-domain QA that requires long-form answers, rather than short ones.
|
| 72 |
+
|
| 73 |
+
Code The code generation task (Yin & Neubig, 2017) aims to generate executable code given a user query. We define factuality in code generation as how well the generated code can be executed correctly with a specific programming language (e.g., Python) and fulfills the provided requirements. This definition is grounded in an execution-based approach to code evaluation, which measures the correctness of generated code by executing it against test case inputs and comparing its output to the golden output.
|
| 74 |
+
|
| 75 |
+
Math The math problem solving task uses automated methods to address math problems (Cobbe et al., 2021). At the claim level, factuality in math problem solving is defined as the extent to which the generated statements adhere to the calculation rules. At the response level, factuality in math problem solving is defined as how effectively the overall math solution addresses the given problem.
|
| 76 |
+
|
| 77 |
+
Scientific The scientific literature review writing task (Jha et al., 2015) aims to analyze and synthesize existing research on a specific topic in a field of study. In this task, we define factuality as whether the generated scientific literature review correctly cites existing scientific literature, including the correct mention of authors and publication years.1
|
| 78 |
+
|
| 79 |
+
# 4 APPROACH
|
| 80 |
+
|
| 81 |
+
We propose a unified, tool-augmented framework for detecting factual errors across various tasks. The motivation for using tools is twofold: (1) Each tool embodies domain expertise, assisting us in gathering evidences that help verifies the correctness of the claim. (2) The ability of LLMs to utilize multiple tools paves the way for multiple tool-augmented factuality detection. For example, by directly using ChatGPT plugins (https://openai.com/blog/chatgpt-plugins), we can integrate multiple tools into a chatbot. Our framework is illustrated in Fig. 1, which consists of five main components: claim extraction, query generation, tool querying, evidence collection, and agreement verification. We elaborate each component below.
|
| 82 |
+
|
| 83 |
+
# 4.1 CLAIM EXTRACTION
|
| 84 |
+
|
| 85 |
+
Extracting claims from responses is challenging due to the varied definitions of claims across tasks and domains. To overcome this, we propose an approach that treats claim extraction as a process guided by LLM prompts based on the specific definition of claims. This approach offers several advantages: (i) Leveraging the strong instruction-following capabilities of LLMs significantly reduce the costs of data annotation and model training for claim extraction. (ii) When creating a system or dataset that relies on the definition of claims, we just need to provide a textual definition of the claim to LLMs. (iii) Our experiments in $\ S 6 . 1$ demonstrate that the claim extraction module, implemented by ChatGPT, exhibits strong performance in extracting claims (atomic component units).
|
| 86 |
+
|
| 87 |
+
To extract all verifiable claims within the generated text $x$ , denoted as $\{ c _ { i } \} _ { i = 1 \cdots n }$ , for various tasks, we employ ChatGPT as a base LLM and apply different textual definitions of claims. Detailed prompting instructions can be found in Appendix C.
|
| 88 |
+
|
| 89 |
+
KB-QA The claim is defined using the concept of atomic content units (ACUs) (Liu et al., 2022). Each ACU corresponds to a single atomic fact within a generated answer. In practice, we leverage ChatGPT (“gpt-3.5-turbo”) to extract claims based on two criteria: (i) each claim should not exceed 15 words, and (ii) it should clearly describe a fact. We add two in-context examples from the RoSE dataset (Liu et al., 2022) in our prompt to obtain more fine-grained claims. Additionally, we ask ChatGPT to resolve any coreferences or ambiguity, such as unclear pronouns within the claims.
|
| 90 |
+
|
| 91 |
+
Code We consider each generated code snippet within the response as a single claim to be verified.
|
| 92 |
+
We extract all such code snippets that are enclosed with brackets (i.e., within a code block).
|
| 93 |
+
|
| 94 |
+
Math We define each claim in a step-by-step math solution as the arithmetic operation performed between known real numbers. Each of these operations contains two parts: the calculation and the calculated answer. We prompt ChatGPT to extract all such claims.
|
| 95 |
+
|
| 96 |
+
Scientific Each claim within the generated review is defined as a tuple of “(paper title, year, authors)” contained in generated review. We then prompt ChatGPT to extract all such tuples within the review.
|
| 97 |
+
|
| 98 |
+
# 4.2 QUERY GENERATION
|
| 99 |
+
|
| 100 |
+
For each claim $c _ { i }$ , we convert it into a list of queries $\{ q _ { i j } \} _ { j = 1 \cdots m }$ that can be used to query external tools such as search engines, the Python interpreter, or Google scholar. Detailed prompting instructions can be found in Appendix C.
|
| 101 |
+
|
| 102 |
+
KB-QA We prompt ChatGPT or GPT-4 to generate two search engine queries from each claim $c _ { i }$ These queries are intended to help humans in verifying the factuality of $c _ { i }$ .
|
| 103 |
+
|
| 104 |
+
Code For each claim $c _ { i }$ we generate two types of queries: simulated test case inputs, denoted as $\{ q _ { t _ { i j } } \} _ { j = 1 \cdots m }$ , and potential solutions, denoted as $\{ q _ { s _ { i j } } \} _ { j = 1 \cdots m }$ . Both types of queries are generated by ChatGPT or GPT-4. The simulated test case inputs are function calls generated for a given code snippet, while potential solutions are repeatedly generated solutions in response to the user prompt $p$ In our later experiments, we generate 3 simulated test case inputs and 3 potential solutions.
|
| 105 |
+
|
| 106 |
+
Math We prompt ChatGPT or GPT-4 to convert all math operations into executable Python code snippets. These snippets are designed to return “True” when the calculation matches the calculated answer and “False” if it doesn’t.
|
| 107 |
+
|
| 108 |
+
Scientific We use the paper title, found within the extracted claim tuple, as the query for Google Scholar. Our assumption here is that if a paper exists, it should appear as the first search result on Google Scholar when we use the paper title as the query.
|
| 109 |
+
|
| 110 |
+
# 4.3 TOOL QUERYING & EVIDENCE COLLECTION
|
| 111 |
+
|
| 112 |
+
We then use the queries to query various tools to collect relevant evidence statements $\{ e _ { i k } \} _ { k = 1 \cdots l _ { i } }$
|
| 113 |
+
|
| 114 |
+
KB-QA The external tool we use to help verify the factuality of the generated text is the Google Search API, which queries the internet for knowledge using the queries generated from the claims. We use the Google Search API provided by Serper $( \mathrm { h t t p s : / / s e r p e r . d e v / } )$ to search the top pages and retrieve the most relevant search snippets. We parse the response to obtain different types of snippets such as answer boxes, knowledge graphs, and organic search results.
|
| 115 |
+
|
| 116 |
+
Code For each test case input $t _ { i }$ and generated potential solution $s _ { j }$ , we execute $s _ { j }$ using $t _ { i }$ as the input and collect the execution result (output) for each $( t _ { i } , s _ { j } )$ pair. The input-output pairs are used as test cases for verifying the chatbot generated unverified solution. The process is shown in Fig. 3.
|
| 117 |
+
|
| 118 |
+
Math We collect the execution results for code snippets derived from the mathematical operations.Prompt As illustrated in Fig. 2, math claims like “30 $/ 3 = 1 0 ^ { " }$ are extracted and then converted into aWrite Python code that Python executable code, for instance, “print(round $( 3 0 / 3 , \quad 7 ) = = 1 0 )$ ”.
|
| 119 |
+
|
| 120 |
+
Scientific We use the title of each paper, extracted from the text, as the query to access relevantUnittestChatbot Inputs -2 information through the Google Scholar API provided by Scholarly (https://github.com/Unverified Solution Library GPT-4 scholarly-python-package/scholarly). This allows us to retrieve key informationdef square_a_num(n): Verify about each paper, including the paper title, author list, and publication year.return n \* n
|
| 121 |
+
|
| 122 |
+
# 4.4 AGREEMENT VERIFICATION
|
| 123 |
+
|
| 124 |
+
In the final step, each claim, $c _ { i }$ , receives a binary factuality label, $L _ { i } \in \{ \mathrm { T R U E } , \mathrm { F A L S E } \}$ , based on the level of support it receives from the collected evidence, $\{ e _ { i k } \} _ { k = 1 \cdots l _ { i } }$ . This labeling process is performed for every individual claim.
|
| 125 |
+
|
| 126 |
+
KB-QA We prompt ChatGPT or GPT-4 to judge the factuality of the claim given the retrieved evidence snippets. We follow a zero-shot CoT (Wei et al., 2023) reasoning process: First, the model attempts to reason about whether the claim is factual or not. If an error is identified, we then ask it to explain and attempt to rectify the error.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 3: Unit test library generation for detecting factual errors in code.
|
| 130 |
+
|
| 131 |
+
Code We conduct a majority vote for each test case across all solutions, establishing what we called “pseudo-golden output” for each test case. Following this, we compare the execution result of the solution that’s under verification against all the test cases with the pseudo golden output. If the results match, we classify the solution under verification as true; otherwise, it’s false.
|
| 132 |
+
|
| 133 |
+
Math We compile the results of each code snippet execution. If any snippet returns “False”, we classify the associated generated text $x$ as false. Conversely, if all snippets yield “True”, we classify the corresponding generated text $x$ as true.
|
| 134 |
+
|
| 135 |
+
Scientific We compare the extracted claim: “(paper title, year, authors)” to the evidence: “(paper title, year, authors)” retrieved from Google Scholar API. For the paper title and year of publication, we conduct an exact, case-insensitive string match. As for the authors’ match, we prompt ChatGPT or GPT-4 to judge whether the author list in the extracted claim is a subset of the retrieved author list. All the information must be matched in order to be classified as “True”, otherwise “False”.
|
| 136 |
+
|
| 137 |
+
# 5 DATASET CONSTRUCTION
|
| 138 |
+
|
| 139 |
+
# 5.1 PROMPT AND RESPONSE COLLECTION
|
| 140 |
+
|
| 141 |
+
KB-QA For KB-QA, we evaluate our framework using RoSE (Liu et al., 2022) and FactPrompts (Wang et al., 2023a). RoSE is a text summarization dataset that provides fine-grained ACUs for each reference summary. FactPrompts is a dataset that comprises real-world prompts sourced from various platforms and datasets, such as Quora and TruthfulQA (Lin et al., 2022), along with corresponding responses generated by ChatGPT. We construct the dataset using 100 reference summaries from RoSE and 50 responses from FactPrompts for our evaluation.
|
| 142 |
+
|
| 143 |
+
Code For code, we evaluate our framework using HumanEval (Chen et al., 2021). HumanEval is a programming problem dataset that contains several unit tests for each problem. We use ChatGPT to generate responses based on the processed prompts of HumanEval provided in (Chen et al., 2022) which solely contain the instruction of the prompt without input-output demonstrations.
|
| 144 |
+
|
| 145 |
+
Math For math, we evaluate our framework using GSM-Hard (Gao et al., 2022b). GSM-Hard is a dataset constructed from GSM8K (Cobbe et al., 2021) by replacing the numbers in the questions of GSM8K with larger numbers. We sampled 100 prompts from GSM-Hard. Then, we generate responses for these prompts using ChatGPT.
|
| 146 |
+
|
| 147 |
+
Scientific For scientific, we follow self-instruct (Wang et al., 2023b) to create 100 diverse prompts spanning computer science, business, law, medicine, and physics. Each prompt asks for a technical or research-oriented response that includes at least one relevant literature citation. Then, we generate responses for these prompts using ChatGPT.
|
| 148 |
+
|
| 149 |
+
# 5.2 CLAIM COLLECTION
|
| 150 |
+
|
| 151 |
+
For responses from FactPrompts and GSMHard, we follow the idea of “claim extraction as prompting” described in $\ S 4 . 1$ . We use ChatGPT for claim extraction due to its cost efficiency and effectiveness in extracting fine-grained claims. For HumanEval responses, since each response is already a code snippet, we consider the “claim” of the response to be identical to the response itself.
|
| 152 |
+
|
| 153 |
+
Table 3: Statistics of datasets used in this work. (p, n) stands for (count of positive responses or claims, count of negative responses or claims).
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Task</td><td>Datasets</td><td>Responses</td><td>Claims</td></tr><tr><td>KB-QA</td><td>RoSE</td><td>100</td><td>527</td></tr><tr><td>KB-QA</td><td>FactPrompts</td><td>50 (23:27)</td><td>233 (177:56)</td></tr><tr><td>Code</td><td>HumanEval</td><td>164 (109:55)</td><td>164 (109:55)</td></tr><tr><td>Math</td><td>GSM-Hard</td><td>100 (47:53)</td><td>284 (246:38)</td></tr><tr><td>Scientific</td><td>FactPrompts</td><td>100 (10:90)</td><td>186 (33:153)</td></tr></table>
|
| 156 |
+
|
| 157 |
+
# 5.3 CLAIM AND RESPONSE ANNOTATION
|
| 158 |
+
|
| 159 |
+
KB-QA & Scientific For claim annotation, the authors collectively annotate the extracted claims as either factual or non-factual. For response annotation, if any claim in the response is annotated as non-factual, then the response as a whole is non-factual; otherwise, the response is factual.
|
| 160 |
+
|
| 161 |
+
Code We consider the claim label to be identical to the response label since the “claim” of the response is the same as the response itself. For response annotation, we annotate ChatGPT’s responses using the execution code provided in (Chen et al., 2022) against the HumanEval test cases to distinguish between factual (those passing all tests) responses and non-factual responses.
|
| 162 |
+
|
| 163 |
+
Math For claim annotation, the authors collectively annotate the extracted claims as either factual or non-factual. For response annotation, we utilize the target values in GSM-Hard (Gao et al., 2022b).
|
| 164 |
+
|
| 165 |
+
# 6 EXPERIMENTS
|
| 166 |
+
|
| 167 |
+
We evaluate FACTOOL against two baselines that use LLMs to check their own inputs: Self-Check with 3-shot CoT (with 3 demonstrations) and zero-shot CoT (no demonstrations), which are effective on various tasks including dialogue, math, and code (Madaan et al., 2023; Chen et al., 2023). Both baselines aim to test the ability of LLM to identify its own errors without the use of external tools. We prompt ChatGPT and GPT-4 to recognize, explain, and attempt to rectify their own errors. Following this reasoning process, the models make final judgments on the factuality of the given claim.
|
| 168 |
+
|
| 169 |
+
# 6.1 EXP-I: CLAIM EXTRACTION EVALUATION
|
| 170 |
+
|
| 171 |
+
We evaluate the claim extraction module of FACTOOL on RoSE (Liu et al., 2022). We treat the reference summary as the generated text $x$ , and the reference ACUs as the golden-extracted claims. We measure the similarity between the machine-extracted (GPT-4, ChatGPT, and Flan-T5-XXL (Chung et al., 2022)) claims $\{ c _ { i } ^ { c } \} _ { i = 1 \cdots n _ { c } }$ and golden-extracted claims $\{ c _ { i } ^ { g } \} _ { i = 1 \cdots n _ { g } }$ using 4 metrics: ROUGE1, ROUGE-2, ROUGE-L (Lin, 2004), and BERTScore (Zhang et al., 2019). In Tab. 4, we report the average of the highest similarity between each ChatGPT-extracted claim and the corresponding golden-extracted claim in the same sample. (i.e., 1sample_cnt Psample 1nc P ci=1 $\begin{array} { r } { \frac { 1 } { n _ { c } } \sum _ { i = 1 } ^ { n _ { c } } \operatorname* { m a x } _ { j = 1 } ^ { n _ { g } } ( \mathrm { S i m } ( \dot { c _ { i } } , c _ { j } ^ { g } ) ) ) } \end{array}$ .
|
| 172 |
+
|
| 173 |
+
Results Tab. 4 shows that the claims extracted by GPT-4, ChatGPT, and Flan-T5-XXL closely match the ACUs annotated by humans as evaluated by ROUGE and BERTScore. In Exp-II, we choose ChatGPT as the claim extractor for two reasons: (1) The context length of Flan-T5 is too short (512 tokens) to effectively extract claims from lengthy responses in our dataset. (2) ChatGPT is more cost-efficient compared to GPT-4, while maintaining similar effectiveness.
|
| 174 |
+
|
| 175 |
+
# 6.2 EXP-II: FRAMEWORK EVALUATION
|
| 176 |
+
|
| 177 |
+
We evaluate FACTOOL and the two Self-Check baselines on the constructed dataset described in $\ S 5$ . Depending on the model used for query generation and agreement verification, we have FACTOOL
|
| 178 |
+
|
| 179 |
+
ChatGPT and FACTOOL $\mathrm { G P T } \mathrm { - } 4 ^ { 2 }$ . We report the accuracy, recall, precision, and F1-score at both the claim and response levels.
|
| 180 |
+
|
| 181 |
+
<table><tr><td rowspan="2">Tasks</td><td rowspan="2">LLMs</td><td rowspan="2">Methods</td><td colspan="4">Claim-Level</td><td colspan="4">Response-Level</td></tr><tr><td>Acc.</td><td>R</td><td>P</td><td>F1</td><td>Acc.</td><td>R</td><td>P</td><td>F1</td></tr><tr><td rowspan="6">KB-QA</td><td rowspan="2">ChatGPT</td><td>Self-Check (0)</td><td>75.54</td><td>90.40</td><td>80.00</td><td>84.88</td><td>54.00</td><td>60.87</td><td>50.00</td><td>54.90</td></tr><tr><td> Self-Check( )</td><td>69.53</td><td>8136</td><td>79.12</td><td>80.23</td><td>54.00</td><td>47.83</td><td>50.00</td><td>48.89</td></tr><tr><td rowspan="2"></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Self-Check (0)</td><td>77.25</td><td>84.75</td><td>85.23</td><td>84.99</td><td>54.00</td><td>95.65</td><td>50.00</td><td>65.67</td></tr><tr><td rowspan="2">GPT-4</td><td>Self-Check (3)</td><td>79.83</td><td>85.88</td><td>87.36</td><td>86.61</td><td>64.00</td><td>52.17</td><td>63.16</td><td>57.14</td></tr><tr><td>FACTOOL</td><td>84.12</td><td>85.31</td><td>93.21</td><td>89.09</td><td>78.00</td><td>60.87</td><td>87.50</td><td>71.79</td></tr><tr><td rowspan="6">Code</td><td rowspan="2">ChatGPT</td><td>Self-Check (0)</td><td>68.29</td><td>99.10</td><td>68.33</td><td>80.88</td><td>68.29</td><td>99.10</td><td>68.33</td><td>80.88</td></tr><tr><td>Self-Check (3)</td><td>68.90</td><td>100.00</td><td>68.52</td><td>81.32</td><td>68.90</td><td>100.00</td><td>68.52</td><td>81.32</td></tr><tr><td rowspan="2"></td><td>FACTOOL</td><td>78.05</td><td>89.19</td><td>80.49</td><td>84.62</td><td>78.05</td><td>89.19</td><td>80.49</td><td>84.62</td></tr><tr><td>Self-Check (0)</td><td>75.31</td><td>95.50</td><td>75.18</td><td>84.13</td><td>75.31</td><td>95.50</td><td>75.18</td><td>84.13</td></tr><tr><td rowspan="2">GPT-4</td><td>Self-Check (3)</td><td>77.44</td><td>96.40</td><td>76.43</td><td>85.26</td><td>77.44</td><td>96.40</td><td>76.43</td><td>85.26</td></tr><tr><td>FACTOOL</td><td>89.02</td><td>94.59</td><td>89.74</td><td>92.11</td><td>89.02</td><td>94.59</td><td>89.74</td><td>92.11</td></tr><tr><td rowspan="6">Math</td><td rowspan="2">ChatGPT</td><td>Self-Check (0)</td><td>84.15</td><td>90.24</td><td>91.36</td><td>90.80</td><td>57.00</td><td>74.47</td><td>53.03</td><td>61.95</td></tr><tr><td>Self-Cec ( 3)</td><td>87.34</td><td>94.31</td><td>9.34</td><td>92.80</td><td>61.00</td><td>99.36</td><td>55.26</td><td>68.29</td></tr><tr><td rowspan="2"></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Self-Check (0)</td><td>83.10</td><td>86.99</td><td>93.04</td><td>89.92</td><td>49.00</td><td>85.11</td><td>47.62</td><td>61.07</td></tr><tr><td rowspan="2">GPT-4</td><td>Self-Check (3)</td><td>92.61</td><td>96.75</td><td>94.82</td><td>95.77</td><td>65.00</td><td>89.36</td><td>58.33</td><td>70.59</td></tr><tr><td>FACTOOL</td><td>98.24</td><td>97.97</td><td>100.00</td><td>98.97</td><td>78.00</td><td>95.74</td><td>69.23</td><td>80.36</td></tr><tr><td rowspan="6">Scientific</td><td rowspan="2">ChatGPT</td><td>Self-Check (0)</td><td>28.69</td><td>96.00</td><td>21.82</td><td>35.56</td><td>18.00</td><td>100.00</td><td>10.87</td><td>19.61</td></tr><tr><td>Self-Check (3)</td><td>24.19</td><td>96.97</td><td>18.60</td><td>31.22</td><td>22.00</td><td>90.00</td><td>10.47</td><td>18.75</td></tr><tr><td rowspan="2"></td><td>FACTOOL</td><td>97.31</td><td>84.85</td><td>100.00</td><td>91.80</td><td>99.00</td><td>90.00</td><td>100.00</td><td>94.74</td></tr><tr><td>Self-Check (0)</td><td>35.75</td><td>84.85</td><td>20.29</td><td>32.75</td><td>19.00</td><td>100.00</td><td>10.99</td><td>19.80</td></tr><tr><td rowspan="2">GPT-4</td><td>Self-Check (3)</td><td>44.75</td><td>87.8</td><td>13.20</td><td>36.74</td><td>9.00</td><td>70.00</td><td>10.730</td><td>21.4</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 182 |
+
|
| 183 |
+
Results Tab. 5 shows the claim-and-responselevel results of FACTOOL and the self-check baselines.
|
| 184 |
+
|
| 185 |
+
Table 5: Experimental results of FACTOOL ChatGPT and FACTOOL $\mathrm { G P T } { \cdot } 4$ on KB-QA, code, math, and scientific.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Model</td><td>Metric</td><td>Precision</td><td>Recall</td><td>F1-score</td></tr><tr><td>GPT-4</td><td>ROUGE-1</td><td>0.7394</td><td>0.8758</td><td>0.7860</td></tr><tr><td></td><td>ROUGE-2</td><td>0.6304</td><td>0.7771</td><td>0.6772</td></tr><tr><td></td><td>ROUGE-L</td><td>0.7175</td><td>0.8625</td><td>0.7667</td></tr><tr><td></td><td>BERTScore</td><td>0.6632</td><td>0.7865</td><td>0.7175</td></tr><tr><td>ChatGPT</td><td>ROUGE-1</td><td>0.7770</td><td>0.8285</td><td>0.7836</td></tr><tr><td></td><td>ROUGE-2</td><td>0.6520</td><td>0.7115</td><td>0.6610</td></tr><tr><td></td><td>ROUGE-L</td><td>0.7557</td><td>0.8148</td><td>0.7655</td></tr><tr><td></td><td>BERTScore</td><td>0.6958</td><td>0.7521</td><td>0.7174</td></tr><tr><td>FLAN-T5-XXL</td><td>ROUGE-1</td><td>0.6531</td><td>0.8928</td><td>0.7326</td></tr><tr><td></td><td>ROUGE-2</td><td>0.5609</td><td>0.8157</td><td>0.6413</td></tr><tr><td></td><td>ROUGE-L</td><td>0.6428</td><td>0.8885</td><td>0.7237</td></tr><tr><td></td><td>BERTScore</td><td>0.4314</td><td>0.6661</td><td>0.5408</td></tr></table>
|
| 188 |
+
|
| 189 |
+
FACTOOL GPT-4 outperforms all other baselines across all scenarios Tab. 5 shows that FACTOOL GPT-4 outperforms all other baselines across all scenarios. FACTOOL GPT-4 achieves an 89.09 claim-level F1 / 71.79 response-level F1 on KB-QA, a 92.11 claim-level F1 / 92.11 response-level F1 on code (remember that claim-level factuality is considered equivalent to response-level factuality in our experiment for code), a 98.97 claim-level F1 / 80.36 responselevel F1 on math, and a 95.24 claim-level F1 / 94.74 response-level F1 on scientific.
|
| 190 |
+
|
| 191 |
+
Table 4: The average similarity between the extracted claims from different models and the golden ACUs on RoSE.
|
| 192 |
+
|
| 193 |
+
FACTOOL $\mathbf { G P T } { \bf - } 4$ outperforms all self-check baselines across all scenarios From Tab. 5, we show that FACTOOL with GPT-4 outperforms all self-check baselines across all scenarios. On FACTOOL GPT-4 v.s. Self-Check (3) powered by GPT-4, we observe: 71.79 v.s. 57.14 response-level F1 on KB-QA, 92.11 v.s. 85.26 response-level F1 on code, 80.36 v.s. 70.59 response-level F1 on math, and 94.74 v.s. 21.54 response-level F1 on scientific.
|
| 194 |
+
|
| 195 |
+
FACTOOL GPT-4 significantly outperforms all self-check baselines in scientific Tab. 5 shows that FACTOOL GPT-4 significantly outperforms the self-check baselines in scientific. On FACTOOL GPT-4 v.s. Self-Check (3) powered by GPT-4, we observe: 95.24 v.s. 36.71 claim-level F1 and 94.74 v.s. 21.54 response-level F1. Here, Google Scholar shows high robustness in performing its specified task of finding citations compared to LLM itself.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 4: Claim-Level Accuracy across scenarios for each chatbot.
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 5: Response-Level Accuracy across scenarios for each chatbot.
|
| 202 |
+
|
| 203 |
+
6.3 EXP-III: USING FACTOOL TO EVALUATE THE FACTUALITY OF MODERN CHATBOTS
|
| 204 |
+
|
| 205 |
+
An important objective of developing a factuality detector (like FACTOOL) is to evaluate the factuality of chatbots by examining their responses. In Exp-III, we consider FACTOOL GPT-4 as the golden evaluator, and use it to evaluate the factuality of chatbots, including GPT-4, ChatGPT, Claude-v1, Bard, and Vicuna-13B. Following the same prompt selection intuition as (Zhou et al., 2023), i.e., KB-QA is the most common scenario, we collect 30 KB-QA prompts from (Zhou et al., 2023), 10 code prompts from HumanEval, 10 math prompts from GSM8k-Hard, and 10 scientific prompts (selfgenerated) to conduct factuality evaluation on chatbots. Responses for these prompts are generated by each of the evaluated chatbots.
|
| 206 |
+
|
| 207 |
+
We report the weighted claim-level and response-level accuracies for each chatbot, evaluated by FACTOOL GPT-4. As KB-QA responses contain significantly more claims than other scenarios, to prevent over-emphasizing KB-QA, we report the weighted claim-level accuracy based on ratio of the number of prompts in each scenario. Specifically, the weighted claim-level accuracy is calculated as ${ \frac { 3 } { 6 } } \times$ claim-level accuracy in $\begin{array} { r } { \mathrm { K B - Q A } + \frac { 1 } { 6 } \times } \end{array}$ claim-level accuracy in ${ \mathrm { C o d e } } + { \frac { 1 } { 6 } } \times$ claim-level accuracy in Math $\textstyle + { \frac { 1 } { 6 } } \times$ claim-level accuracy in Scientific. Adopting the weighted-claim level accuracy evaluation provides a more holistic and fair assessment of each chatbot’s factual accuracy.
|
| 208 |
+
|
| 209 |
+
Results Tab. 6 shows that GPT-4 has the best weighted claim-level factual accuracy and response-level accuracy. Fig. 4 and 5 show the fine-grained performance w.r.t each scenario (KB-QA, code, math, scientific). We observe that (1) GPT-4 has the best claim-level accuracy and response-level accuracy in most scenarios. (2) Vicuna-13B (supervised fine-tuned chatbot) demonstrates decent factuality in KB-QA but underperforms in more challenging scenarios (math, code, and scientific).
|
| 210 |
+
|
| 211 |
+
# 7 CONCLUSION
|
| 212 |
+
|
| 213 |
+
We introduce FACTOOL, a multi-task and multidomain factaulity detection framework designed to tackle the escalating challenge of hallucination in generative AI. We expand the conventional definition of factuality, focusing particularly on auditing the capabilities of generative AI models. Recognizing that (1) the generative texts from LLMs are often lengthy and have undefined granularity for individual facts and that (2) there’s an evidence shortage during the process of fact-checking, we build FACTOOL as a 5-step tool-augmented framework that consists of claim extraction, query generation, tool
|
| 214 |
+
|
| 215 |
+
<table><tr><td>LLMs</td><td>WCL Acc.</td><td>RL Acc.</td><td>Avg. Resp. Len.</td></tr><tr><td>GPT-4</td><td>75.60</td><td>43.33</td><td>196.83</td></tr><tr><td>ChatGPT</td><td>68.63</td><td>36.67</td><td>144.05</td></tr><tr><td>Claude-v1</td><td>63.95</td><td>26.67</td><td>208.70</td></tr><tr><td>Bard</td><td>61.15</td><td>33.33</td><td>263.77</td></tr><tr><td>Vicuna-13B</td><td>50.35</td><td>21.67</td><td>207.13</td></tr></table>
|
| 216 |
+
|
| 217 |
+
Table 6: Factual accuracy of chatbots evaluated by FACTOOL. WCL Acc. stands for weighted claimlevel accuracy. RL Acc. stands for response-level accuracy. Avg. Resp. Len. stands for average response length. We consider FACTOOL as the golden evaluator that evaluates the factuality of the responses generated by each chatbot.
|
| 218 |
+
|
| 219 |
+
querying, evidence collection, and agreement verification. We incorporate tools like Google Search, Google Scholar, and code interpreters, in FACTOOL, and shows the effectiveness of FACTOOL in tasks such as KB-QA, code generation, math problem solving, scientific literature review writing. We believe our holistic, adaptable framework is easily extendable to more scenarios.
|
| 220 |
+
|
| 221 |
+
# REFERENCES
|
| 222 |
+
|
| 223 |
+
Sébastien Bubeck, Varun Chandrasekaran, Ronen Eldan, Johannes Gehrke, Eric Horvitz, Ece Kamar, Peter Lee, Yin Tat Lee, Yuanzhi Li, Scott Lundberg, et al. Sparks of artificial general intelligence: Early experiments with gpt-4. arXiv preprint arXiv:2303.12712, 2023.
|
| 224 |
+
|
| 225 |
+
Bei Chen, Fengji Zhang, Anh Nguyen, Daoguang Zan, Zeqi Lin, Jian-Guang Lou, and Weizhu Chen. Codet: Code generation with generated tests. arXiv preprint arXiv:2207.10397, 2022.
|
| 226 |
+
Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to answer open-domain questions. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1870–1879, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1171. URL https: //aclanthology.org/P17-1171.
|
| 227 |
+
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, 2021.
|
| 228 |
+
Xinyun Chen, Maxwell Lin, Nathanael Schärli, and Denny Zhou. Teaching large language models to self-debug. arXiv preprint arXiv:2304.05128, 2023.
|
| 229 |
+
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.
|
| 230 |
+
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
|
| 231 |
+
Alexander Fabbri, Chien-Sheng Wu, Wenhao Liu, and Caiming Xiong. QAFactEval: Improved QAbased factual consistency evaluation for summarization. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2587–2601, Seattle, United States, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.187. URL https://aclanthology.org/ 2022.naacl-main.187.
|
| 232 |
+
Luyu Gao, Zhuyun Dai, Panupong Pasupat, Anthony Chen, Arun Tejasvi Chaganty, Yicheng Fan, Vincent Y. Zhao, Ni Lao, Hongrae Lee, Da-Cheng Juan, and Kelvin Guu. Rarr: Researching and revising what language models say, using language models, 2022a.
|
| 233 |
+
Luyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon, Pengfei Liu, Yiming Yang, Jamie Callan, and Graham Neubig. Pal: Program-aided language models. arXiv preprint arXiv:2211.10435, 2022b.
|
| 234 |
+
Rahul Jha, Reed Coke, and Dragomir Radev. Surveyor: A system for generating coherent survey articles for scientific topics. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 29, 2015.
|
| 235 |
+
Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea Madotto, and Pascale Fung. Survey of hallucination in natural language generation. ACM Computing Surveys, 55(12):1–38, 2023.
|
| 236 |
+
Ryo Kamoi, Tanya Goyal, Juan Diego Rodriguez, and Greg Durrett. Wice: Real-world entailment for claims in wikipedia. arXiv preprint arXiv:2303.01432, 2023.
|
| 237 |
+
Mojtaba Komeili, Kurt Shuster, and Jason Weston. Internet-augmented dialogue generation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 8460–8478, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.579. URL https://aclanthology.org/ 2022.acl-long.579.
|
| 238 |
+
Amrith Krishna, Sebastian Riedel, and Andreas Vlachos. ProoFVer: Natural logic theorem proving for fact verification. Transactions of the Association for Computational Linguistics, 10:1013–1030, 2022. doi: 10.1162/tacl_a_00503. URL https://aclanthology.org/2022.tacl-1. 59.
|
| 239 |
+
Wojciech Kryscinski, Bryan McCann, Caiming Xiong, and Richard Socher. Evaluating the factual consistency of abstractive text summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 9332–9346, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.750. URL https: //aclanthology.org/2020.emnlp-main.750.
|
| 240 |
+
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. Retrieval-augmented generation for knowledge-intensive nlp tasks. Advances in Neural Information Processing Systems, 33: 9459–9474, 2020.
|
| 241 |
+
Aitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer, Henryk Michalewski, Vinay Ramasesh, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam Neyshabur, Guy Gur-Ari, and Vedant Misra. Solving quantitative reasoning problems with language models, 2022.
|
| 242 |
+
Yaobo Liang, Chenfei Wu, Ting Song, Wenshan Wu, Yan Xia, Yu Liu, Yang Ou, Shuai Lu, Lei Ji, Shaoguang Mao, Yun Wang, Linjun Shou, Ming Gong, and Nan Duan. Taskmatrix.ai: Completing tasks by connecting foundation models with millions of apis, 2023.
|
| 243 |
+
Hunter Lightman, Vineet Kosaraju, Yura Burda, Harri Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let’s verify step by step, 2023.
|
| 244 |
+
Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pp. 74–81, Barcelona, Spain, July 2004. Association for Computational Linguistics. URL https://aclanthology.org/W04-1013.
|
| 245 |
+
Stephanie Lin, Jacob Hilton, and Owain Evans. TruthfulQA: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3214–3252, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.229. URL https: //aclanthology.org/2022.acl-long.229.
|
| 246 |
+
Pengfei Liu, Jinlan Fu, Yang Xiao, Weizhe Yuan, Shuaichen Chang, Junqi Dai, Yixin Liu, Zihuiwen Ye, and Graham Neubig. ExplainaBoard: An explainable leaderboard for NLP. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing: System Demonstrations, pp. 280–289, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-demo. 34. URL https://aclanthology.org/2021.acl-demo.34.
|
| 247 |
+
Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys, 55(9):1–35, 2023.
|
| 248 |
+
Yixin Liu, Alexander R Fabbri, Pengfei Liu, Yilun Zhao, Linyong Nan, Ruilin Han, Simeng Han, Shafiq Joty, Chien-Sheng Wu, Caiming Xiong, et al. Revisiting the gold standard: Grounding summarization evaluation with robust human evaluation. arXiv preprint arXiv:2212.07981, 2022.
|
| 249 |
+
Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, Shashank Gupta, Bodhisattwa Prasad Majumder, Katherine Hermann, Sean Welleck, Amir Yazdanbakhsh, and Peter Clark. Self-refine: Iterative refinement with self-feedback, 2023.
|
| 250 |
+
|
| 251 |
+
OpenAI. Gpt-4 technical report, 2023.
|
| 252 |
+
|
| 253 |
+
Ofir Press, Muru Zhang, Sewon Min, Ludwig Schmidt, Noah A. Smith, and Mike Lewis. Measuring and narrowing the compositionality gap in language models, 2022.
|
| 254 |
+
Timo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu, Maria Lomeli, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. Toolformer: Language models can teach themselves to use tools, 2023.
|
| 255 |
+
John Schulman. Reinforcement learning from human feedback: Progress and challenges, 2023.
|
| 256 |
+
Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. Hugginggpt: Solving ai tasks with chatgpt and its friends in huggingface, 2023.
|
| 257 |
+
Freda Shi, Daniel Fried, Marjan Ghazvininejad, Luke Zettlemoyer, and Sida I. Wang. Natural language to code translation with execution. In Proceedings of the 2022 Conference on Empirical
|
| 258 |
+
Methods in Natural Language Processing, pp. 3533–3546, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.emnlp-main. 231. URL https://aclanthology.org/2022.emnlp-main.231.
|
| 259 |
+
Ross Taylor, Marcin Kardas, Guillem Cucurull, Thomas Scialom, Anthony Hartshorn, Elvis Saravia, Andrew Poulton, Viktor Kerkez, and Robert Stojnic. Galactica: A large language model for science, 2022.
|
| 260 |
+
Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, et al. Lamda: Language models for dialog applications. arXiv preprint arXiv:2201.08239, 2022.
|
| 261 |
+
James Thorne, Andreas Vlachos, Christos Christodoulopoulos, and Arpit Mittal. FEVER: a largescale dataset for fact extraction and VERification. In NAACL-HLT, 2018a.
|
| 262 |
+
James Thorne, Andreas Vlachos, Christos Christodoulopoulos, and Arpit Mittal. FEVER: a large-scale dataset for fact extraction and VERification. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 809–819, New Orleans, Louisiana, June 2018b. Association for Computational Linguistics. doi: 10.18653/v1/N18-1074. URL https://aclanthology.org/N18-1074.
|
| 263 |
+
Alex Wang, Kyunghyun Cho, and Mike Lewis. Asking and answering questions to evaluate the factual consistency of summaries. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 5008–5020, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.450. URL https://aclanthology.org/ 2020.acl-main.450.
|
| 264 |
+
Binjie Wang, Ethan Chern, and Pengfei Liu. Chinesefacteval: A factuality benchmark for chinese llms, 2023a.
|
| 265 |
+
Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, and Hannaneh Hajishirzi. Self-instruct: Aligning language models with self-generated instructions, 2023b.
|
| 266 |
+
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou. Chain-of-thought prompting elicits reasoning in large language models, 2023.
|
| 267 |
+
Pengcheng Yin and Graham Neubig. A syntactic neural model for general-purpose code generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 440–450, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1041. URL https://aclanthology.org/P17-1041.
|
| 268 |
+
Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. Bertscore: Evaluating text generation with bert. In International Conference on Learning Representations, 2019.
|
| 269 |
+
|
| 270 |
+
Wanjun Zhong, Jingjing Xu, Duyu Tang, Zenan Xu, Nan Duan, Ming Zhou, Jiahai Wang, and Jian Yin. Reasoning over semantic-level graph for fact checking. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 6170–6180, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.549. URL https://aclanthology.org/2020.acl-main.549.
|
| 271 |
+
|
| 272 |
+
Chunting Zhou, Pengfei Liu, Puxin Xu, Srini Iyer, Jiao Sun, Yuning Mao, Xuezhe Ma, Avia Efrat, Ping Yu, Lili Yu, et al. Lima: Less is more for alignment. arXiv preprint arXiv:2305.11206, 2023.
|
| 273 |
+
|
| 274 |
+
# A EXTRA ANALYSES ON EXP-II
|
| 275 |
+
|
| 276 |
+
FACTOOL GPT-4 outperforms FACTOOL ChatGPT FACTOOL GPT-4 outperforms FACTOOL ChatGPT across all scenarios. This trend is especially significant in KB-QA, where query generation and agreement verification are harder for ChatGPT but relatively easier for GPT-4 (89.09 v.s 81.25 claim-level F1 and 71.79 v.s 52.63 response-level F1). On the other hand, in scenarios where query generation and agreement verification are relatively easy for both ChatGPT and GPT-4, the performance is similarly good.
|
| 277 |
+
|
| 278 |
+
Self-check models are prone to false positives and thus less sensitive in detecting errors From Tab. 5, we observe that self-check models have lower precision compared to FACTOOL. On SelfCheck (3) powered by GPT-4 v.s. FACTOOL GPT-4, we observe: 63.16 v.s. 87.50 response-level precision on KB-QA, 76.43 v.s. 89.74 response-level precision on code generation, 58.33 v.s. 69.23 response-level precision on math problems, and 12.73 v.s. 100.00 response-level precision on scientific literature review. These figures show that self-check models tend to classify claims as “True” considerably more frequently than FACTOOL, suggesting a lower sensitivity for error detection.
|
| 279 |
+
|
| 280 |
+
Self-check models powered by ChatGPT outperform FACTOOL ChatGPT on KB-QA Tab. 5 shows that Self-Check (0) powered by ChatGPT outperforms FACTOOL ChatGPT. Through examining specific cases, we found that reasoning errors are the main reason why FACTOOL ChatGPT performs worse than the self-check baselines. Even when provided with sufficient evidence to determine whether the claim is factual or not, the agreement verification implemented by ChatGPT can become confused. For example, for the claim “The modern-day version of fortune cookies was invented in the United States.”, the reasoning of FACTOOL ChatGPT is selfcontradictory: “The given text is not entirely factual. The modern-day version of fortune cookies was not invented in the United States. Most people nowadays believe that fortune cookies were created by a Japanese man named Makoto Hagiwara in 1914 in San Francisco...” Detailed examples can be found in Fig. 9 of Appendix D.
|
| 281 |
+
|
| 282 |
+
# B PERFORMANCE AND FAILURE ANALYSIS
|
| 283 |
+
|
| 284 |
+
# B.1 PERFORMANCE ANALYSIS
|
| 285 |
+
|
| 286 |
+
We take a closer look at performance in different scenarios by examining evaluated cases.
|
| 287 |
+
|
| 288 |
+
KB-QA The fact-checking capability of FACTOOL on KB-QA is determined by several factors, including whether the search engine can return the most relevant snippets that could assist in determining the factuality of the given claim, the quality of the generated search engine queries, and the LLM’s ability to reason about the validity of the claim given the retrieved evidence. We found that FACTOOL GPT-4 is especially capable under the following situations: (1) Fact-checking recent events, discoveries, or news: FACTOOL GPT-4 successfully identify false claims such as “Argentina has not won the World Cup since $\exists 9 8 6 ^ { \prime }$ ” and “The most valuable NFT ever sold is a digital artwork called ‘Everydays: The First 5000 Days’”. (2) Factchecking high-precision statistics: FACTOOL GPT-4 successfully identify false claims such as “Ireland has an obesity rate of 26.9%” and “Everydays: The First 5000 Days’ sold for 69 million”. Detailed examples can be found in Fig. 10 of Appendix D.
|
| 289 |
+
|
| 290 |
+
Code Generation The fact-checking capability of FACTOOL on code generation is determined by the LLM’s capability to generate high-quality test cases and potential solutions. We demonstrate that due to GPT-4’s exceptional ability to generate such high-quality test cases and potential solutions, FACTOOL $\mathrm { G P T } { \cdot } 4$ outperforms other baselines. For example, in “HumanEval $^ { \prime } 3 6 ^ { \prime } { } ^ { * }$ , GPT-4 is consistently generating high quality solutions, leading to its correctly identifies the mistakes in the response, while ChatGPT fails to identify the mistake. Detailed examples can be found in Fig. 11 and Fig. 12 of Appendix D.
|
| 291 |
+
|
| 292 |
+
Math Problems The fact-checking capability of FACTOOL on math problems is determined by the LLM’s capability to generate accurate Python snippets that verify the correctness of given extracted mathematical calculations. Both FACTOOL GPT-4 and FACTOOL ChatGPT excel in this regard. For example, both FACTOOL GPT-4 and FACTOOL ChatGPT correctly identify $2 3 \times 4 3 1 9 2 1 6$ doesn’t equal to 99305768. Detailed examples can be found in Fig. 13 of Appendix D.
|
| 293 |
+
|
| 294 |
+
Scientific Literature Review The fact-checking capability of FACTOOL on Scientific Literature Review is determined by the LLM’s capability to identifying whether the author list generated is a subset of the actual author list. Both FACTOOL $\mathrm { G P T } { \cdot } 4$ and FACTOOL ChatGPT excel in this regard. For example, both FACTOOL GPT-4 and FACTOOL ChatGPT correctly identify that the paper “The Impact of Artificial Intelligence on Employment” was not written by “Acemoglu and Restrepo”. Detailed examples can be found in Fig. 14 of Appendix D.
|
| 295 |
+
|
| 296 |
+
# B.2 FAILURE ANALYSIS
|
| 297 |
+
|
| 298 |
+
To gain a comprehensive understanding of FACTOOL’s performance, we conduct analysis on cases where FACTOOL will fail.
|
| 299 |
+
|
| 300 |
+
KB-QA We summarize following sources of errors: (1) Reasoning error: Although the evidence provided is sufficient and the LLM accurately finds the most relevant information, the model fails to reason about the relationship between the claim and the provided evidence. For example, for claim “Jupiter is less dense than Saturn", FACTOOL $\mathrm { G P T } { \cdot } 4$ fails to reason the relative relationship even though the evidences provided are sufficient. (2) Conflicting evidence: Conflict in evidence can cause confusion for LLM, leading to incorrect decisions. For example, for claim “Jupiter has a density of 1.33 grams per cubic centimeter", there are conflicting evidences claiming that the density is 1.326 or $1 . 3 3 \mathrm { g / c m ^ { 3 } }$ . (3) Ambiguity in claim: Ambiguous descriptions and subjective adjectives can lead to incorrect decisions. For example, the claim “Fortune cookies are enjoyed by people all over the world." is ambiguous and can have different answers based on different interpretations. Detailed examples can be found in Fig. 15 of Appendix D.
|
| 301 |
+
|
| 302 |
+
Code Generation Errors in code generation mainly comes from: (1) Limited variety in synthetic test cases: The synthetic test cases generated by LLMs may not be fully representative or sufficiently diverse. For example, in the “HumanEval/64” sample, all the inputs of the generated synthetic test cases are composed of strings that only include lowercase letters (without uppercase letters). (2) Potential errors in code generation: The generated potential solutions could contain errors or bugs. Despite implementing a majority voting system to lessen this issue, it cannot completely eliminate the chance of bugs in the code generation process. For example, in the “HumanEval/79” sample, all the generated solutions failed to correctly “decimal_to_binary(0)” as “db0db”. Detailed examples can be found in Fig. 16 of Appendix D.
|
| 303 |
+
|
| 304 |
+
Math Problems There are two major types of errors in factuality detection for math problems: (1) Round-off error: Round-off errors can occur during numerical calculations in Python. For example, FACTOOL $\mathrm { G P T } { \cdot } 4$ incorrectly classify the math calculation $^ { \cdot \cdot } 6 0 4 4 4 0 3 4 \quad / \quad 1 2 = 5 0 3 7 0 0 2 . 8 3 ^ { \cdot }$ as “False”. (2) Reasoning error: Since the claims extracted by FACTOOL only involve mathematical calculations, FACTOOL will not verify the reasoning process of the mathematical solution. For example, for the question “Kylar went to the store to buy glasses for his new apartment. One glass costs $\$ 5$ , but every second glass costs only $60 \%$ of the price. Kylar wants to buy 5364765 glasses. How much does he need to pay for them?”, the ChatGPT generated response contains reasoning error that incorrectly substitute the total cost as $^ { * * } 5 , 3 6 4 , 7 6 5 \ \star 5 ^ { * }$ . However, since FACTOOL only checks math calculation errors, FACTOOL GPT-4 did not identify the reasoning error. Detailed examples can be found in Fig. 17 of Appendix D.
|
| 305 |
+
|
| 306 |
+
Scientific Literature Review There are two major types of errors in factuality detection for scientific literature review: (1) Errors in title matching: Title matching can sometimes be problematic due to abbreviations in the generated citations or the retrieved title. For example, although the paper “MDMA-assisted psychotherapy for treatment of PTSD: study design and rationale for phase 3 trials based on pooled analysis of six phase 2 randomized controlled trials exists, FACTOOL GPT-4 identify the paper title as incorrect. (2) Errors in author matching: the author matching process might sometimes not be robust. For example, although the authors of “Language Models are Unsupervised Multitask Learners" are indeed “Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever, FACTOOL GPT-4 identify the author list as incorrect. Detailed examples can be found in Fig. 18 of Appendix D.
|
| 307 |
+
|
| 308 |
+
# C PROMPTS
|
| 309 |
+
|
| 310 |
+
We list the claim extraction, query generation, and agreement verification prompts used in this paper. All the prompts listed are user prompts. We use the same system prompt “You are a brilliant assistant.”
|
| 311 |
+
|
| 312 |
+
# [KB-Based QA]
|
| 313 |
+
|
| 314 |
+
You are given a piece of text that includes knowledge claims. A claim is a statement that asserts something as true or false, which can be verified by humans.
|
| 315 |
+
|
| 316 |
+
# [Task]
|
| 317 |
+
|
| 318 |
+
Your task is to accurately identify and extract every claim stated in the provided text. Then, resolve any coreference (pronouns or other referring expressions) in the claim for clarity. Each claim should be concise (less than 15 words) and self-contained.
|
| 319 |
+
|
| 320 |
+
Your response MUST be a list of dictionaries. Each dictionary should contains the key "claim", which correspond to the extracted claim (with all coreferences resolved). You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH ’[’.
|
| 321 |
+
|
| 322 |
+
# [Response Format]
|
| 323 |
+
|
| 324 |
+
[{"claim": "Ensure that the claim is fewer than 15 words and conveys a complete idea. Resolve any coreference (pronouns or other referring expressions) in the claim for clarity." },... ]
|
| 325 |
+
|
| 326 |
+
# Here are two examples:
|
| 327 |
+
|
| 328 |
+
# [text]:
|
| 329 |
+
|
| 330 |
+
Tomas Berdych defeated Gael Monfis 6-1, 6- 4 on Saturday. The sixth-seed reaches Monte Carlo Masters final for the first time . Berdych will face either Rafael Nadal or Novak Djokovic in the final.
|
| 331 |
+
|
| 332 |
+
#
|
| 333 |
+
|
| 334 |
+
[{"claim": "Tomas Berdych defeated Gael Monfis 6-1, 6-4"}, {"claim": "Tomas Berdych defeated Gael Monfis 6-1, 6-4 on Saturday"}, {"claim": "Tomas Berdych reaches Monte Carlo Masters final"}, {"claim": "Tomas Berdych is the sixth-seed"}, {"claim": "Tomas Berdych reaches Monte Carlo Masters final for the first time"}, {"claim": "Berdych will face either Rafael Nadal or Novak Djokovic"}, {"claim": "Berdych will face either Rafael Nadal or Novak Djokovic in the final"}]
|
| 335 |
+
|
| 336 |
+
#
|
| 337 |
+
|
| 338 |
+
Tinder only displays the last 34 photos - but users can easily see more. Firm also said it had improved its mutual friends feature.
|
| 339 |
+
|
| 340 |
+
# [response]:
|
| 341 |
+
|
| 342 |
+
[{"claim": "Tinder only displays the last photos"}, {"claim": "Tinder only displays the last 34 photos"}, {"claim": "Tinder users can easily see more photos"}, {"claim": "Tinder said it had improved its feature"}, {"claim": "Tinder said it had improved its mutual friends feature"}] Now complete the following:
|
| 343 |
+
|
| 344 |
+
[text]: {input_text} [response]:
|
| 345 |
+
|
| 346 |
+
# [Math Problems]
|
| 347 |
+
|
| 348 |
+
You are given a math problem and a potential solution to the math problem.
|
| 349 |
+
|
| 350 |
+
# [Task]
|
| 351 |
+
|
| 352 |
+
Your task is to identify all the math calculations that involve arithmetic operations between known real numbers within the potential solution. However, do not include math calculations that contain variable(s).
|
| 353 |
+
|
| 354 |
+
Your response MUST be a list of dictionaries. Each dictionary should contains 2 key - "math_calculation" and "calculated_answer", which correspond to the extracted math calculation, and the calculated answer within the potential solution. You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH ’[’.
|
| 355 |
+
|
| 356 |
+
# [Response format]:
|
| 357 |
+
|
| 358 |
+
[{"math_calculation": "Extracted math calculation involving real numbers within the potential solution. Do not include math calculations that contains variable(s). Do not include units such as \$, $\%$ , etc.", "calculated_answer": "The calculated answer for the extracted math calculation."},...]
|
| 359 |
+
|
| 360 |
+
# Here are two examples:
|
| 361 |
+
|
| 362 |
+
# [math problem]:
|
| 363 |
+
|
| 364 |
+
What is the area of a circle with a diameter of 10 inches?
|
| 365 |
+
|
| 366 |
+
# [potential solution]:
|
| 367 |
+
|
| 368 |
+
To find the area, we first calculate the radius as the diameter divided by 2, so the radius is $1 0 / 2 = 5$ inches. Then, we use the formula for the area of a circle, which is $\pi r ^ { 2 }$ . Plugging in the radius we get, Area $\ c = \pi 5 ^ { 2 } = 7 8 . 5 \bar { 4 }$ square inches.
|
| 369 |
+
|
| 370 |
+
#
|
| 371 |
+
|
| 372 |
+
[{"math_calculation": $" 1 0 / 2 "$ , "calculated_answer": "5"}, {"math_calculation": $" \pi * 5 ^ { 2 \ : , }$ , "calculated_answer": $\mathrm { " } 7 8 . 5 4 \mathrm { " } \} ]$
|
| 373 |
+
|
| 374 |
+
# [math problem]:
|
| 375 |
+
|
| 376 |
+
A store originally sold a shirt for \$45. They are offering a $20 \%$ discount on the shirt. How much will the shirt cost now?
|
| 377 |
+
|
| 378 |
+
# [potential solution]:
|
| 379 |
+
|
| 380 |
+
# [Scientific Literature Review]
|
| 381 |
+
|
| 382 |
+
You are given a piece of text that mentions some scientific literature.
|
| 383 |
+
|
| 384 |
+
# [Task]
|
| 385 |
+
|
| 386 |
+
Your task is to accurately find all papers mentioned in the text and identify the title, author(s), and publication year for each paper. The response should be a list of dictionaries, with each dictionary having keys "paper_title", "paper_author(s)", and "paper_pub_year", which correspond to the title of the paper, the authors of the paper, and the publication year of the paper.
|
| 387 |
+
|
| 388 |
+
# The following is the given text:
|
| 389 |
+
|
| 390 |
+
#
|
| 391 |
+
|
| 392 |
+
{input_text}
|
| 393 |
+
|
| 394 |
+
You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH ’[’.
|
| 395 |
+
|
| 396 |
+
# [Response Format]:
|
| 397 |
+
|
| 398 |
+
[ { "paper_title": "Title of the paper.", "paper_author(s)": "Author(s) of the paper.", "paper_pub_year": "Year of the paper published." }, ... ]
|
| 399 |
+
|
| 400 |
+
# [KB-based QA]
|
| 401 |
+
|
| 402 |
+
You are a query generator designed to help users verify a given claim using search engines. Your primary task is to generate a Python list of two effective and skeptical search engine queries. These queries should assist users in critically evaluating the factuality of a provided claim using search engines. You should only respond in format as described below (a Python list of queries). PLEASE STRICTLY FOLLOW THE FORMAT. DO NOT RETURN ANYTHING ELSE. START YOUR RESPONSE WITH ’[’. [response format]: [’query1’, ’query2’]
|
| 403 |
+
Here are 3 examples: [claim]: The CEO of twitter is Bill Gates. [response]: ["Who is the CEO of twitter?", "CEO Twitter"]
|
| 404 |
+
[claim]: Michael Phelps is the most decorated Olympian of all time. [response]: ["Who is the most decorated Olympian of all time?", "Michael Phelps"]
|
| 405 |
+
[claim]: ChatGPT is created by Google. [response]: ["Who created ChatGPT?", "ChatGPT"]
|
| 406 |
+
Now complete the following: [claim]: input [response]:
|
| 407 |
+
|
| 408 |
+
# [Math Problems]
|
| 409 |
+
|
| 410 |
+
You are given a math calculation and its corresponding calculated answer.
|
| 411 |
+
|
| 412 |
+
# [Task]
|
| 413 |
+
|
| 414 |
+
Your task is to write an executable Python snippet that validate the accuracy of the math calculation against the calculated answer. The Python snippet should print ’True’ if the calculated answer is correct, and ’False’ otherwise.
|
| 415 |
+
Your response MUST be a dictionary with key "python_snippet", which correspond to the executable python snippet.
|
| 416 |
+
[math calculation]: {math_calculation}
|
| 417 |
+
[calculated answer]: {calculated_answer}
|
| 418 |
+
You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH ’{’.
|
| 419 |
+
|
| 420 |
+
# [Response format]:
|
| 421 |
+
|
| 422 |
+
{ "python_snippet": "An executable Python snippet that validates the accuracy of the math calculation against the calculated answer. The Python snippet should print ’True’ if the calculated answer is correct, and ’False’ otherwise." }
|
| 423 |
+
|
| 424 |
+
# [Code Potential Solution Generation]
|
| 425 |
+
|
| 426 |
+
Please solve the given coding question. Make sure that the solution is optimized and correct. You MUST use Python to solve the coding question. Your response MUST be a dictionary with keys "reasoning" and "python_solution", which correspond to the reasoning and Python implementations of the function {entry_point}. The following is the given coding question - [coding question]: {input_question} You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH ’{’. [response format]: { "reasoning": "Reasoning for solution.", "python_solution": "Python implementation of the function {entry_point}. Include only the implementation of the function itself. Ensure the output of the function aligns with its specified return type." }
|
| 427 |
+
|
| 428 |
+
# [Code Unit test Generation]
|
| 429 |
+
|
| 430 |
+
Please generate 3 distinct function calls for the given coding question to test the functionality of the function {entry_point} that attempts to solve the provided coding question.
|
| 431 |
+
Your response must be a dictionary with 3 keys - "function_call_1", "function_call_2", "function_call_3", which correspond to the 3 distinct function calls for function {entry_point}. The following is the given coding question -
|
| 432 |
+
[coding question]: {input_question}
|
| 433 |
+
You MUST only respond in the format as described below. DO NOT RESPOND WITH ANYTHING ELSE. ADDING ANY OTHER EXTRA NOTES THAT VIOLATE THE RESPONSE FORMAT IS BANNED. START YOUR RESPONSE WITH ’{’.
|
| 434 |
+
[response format]: { "function_call_1": "First function call for function {entry_point}. Do not include anything else.", "function_call ${ } _ { - 2 " }$ : "Second function call for function {entry_point}. Do not include anything else.", "function_call_3": "Third function call for function {entry_point}. Do not include anything else." }
|
| 435 |
+
|
| 436 |
+
#
|
| 437 |
+
|
| 438 |
+
You are given a piece of text. Your task is to identify whether there are any factual errors within the text. When you are judging the factuality of the given text, you could reference the provided evidences if needed. The provided evidences may be helpful. Some evidences may contradict to each other. You must be careful when using the evidences to judge the factuality of the given text. When The response should be a dictionary with four keys - "reasoning", "factuality", "error", and "correction", which correspond to the reasoning, whether the given text is factual or not (Boolean - True or False), the factual error present in the text, and the corrected text. The following is the given text [text]: claim The following is the provided evidences [evidences]: evidence You should only respond in format as described below. DO NOT RETURN ANYTHING ELSE. START YOUR RESPONSE WITH $\because \{ \{ \} ^ { * }$ . [response format]: {{ "reasoning": "Why is the given text factual or non-factual? Be careful when you said something is non-factual. When you said something is non-factual, you must provide mulitple evidences to support your decision.", "error": "None if the text is factual; otherwise, describe the error.", "correction": "The corrected text if there is an error.", "factuality": True if the given text is factual, False otherwise. }}
|
| 439 |
+
|
| 440 |
+
# [Scientific Literature Review]
|
| 441 |
+
|
| 442 |
+
Please generate 3 distinct function calls for the given coding question to test the You are provided with two inputs, a string (string1) containing several names, and a list (list1) also containing names. Your task is to assess whether all the last names mentioned in string1 are included in list1.
|
| 443 |
+
You should only respond in format as described below. DO NOT RETURN ANYTHING ELSE. START YOUR RESPONSE WITH ’{{’. [response format]: {{ "reasoning": "Explanation on whether all the last names in string1 are found within list1", "factuality": This will be True if all last names from string1 are present in list1, and False otherwise. }}
|
| 444 |
+
Example 1: [string1]: "J. Devlin and M. Chang" [list1]: ["Devlin", $\ " \mathbf { M }$ Chang", "Kristina Toutanova"] [response]: "reasoning": "string1 contains 2 last names ’Devlin’ and ’Chang’. Both of these last names are present in list1.", "factuality": True
|
| 445 |
+
Example 2: [string1]: "Tom Brown et. al" [list1]: ["Y. Lecun", "G. Hinton"] [response]: "reasoning": "string 1 contains 1 last name ’Brown’. Brown is not present in list1.", "factuality": False
|
| 446 |
+
Complete the following: [string1]: string1 [list1]: list2 [response]:
|
| 447 |
+
|
| 448 |
+
# D EXAMPLE CASES OF FACTOOL
|
| 449 |
+
|
| 450 |
+
We list the example cases of FACTOOL in each scenario.
|
| 451 |
+
|
| 452 |
+

|
| 453 |
+
|
| 454 |
+
# [Fact-checking recent events, discoveries, or news]
|
| 455 |
+
|
| 456 |
+
# [Fact-checking high-precision statistics]
|
| 457 |
+
|
| 458 |
+
{
|
| 459 |
+
"claim": "Argentina has not won the World Cup since 1986",
|
| 460 |
+
"label": false,
|
| 461 |
+
"with_tool_classification": false,
|
| 462 |
+
"with_tool_reasoning": "The given text states that Argentina has not won the World Cup since 1986. However, multiple pieces of evidence suggest that Argentina won the World Cup in 2022.",
|
| 463 |
+
"queries": ["Argentina World Cup wins since 1986", "Last time Argentina won World Cup"],
|
| 464 |
+
"evidences": ["Argentina is one of the most successful teams in the tournament’s history, having won three World Cups: in 1978, 1986, 2022. Argentina has also been runner up three times: in 1930, 1990 and 2014. In 18 World Cup tournaments, Argentina has 47 victories in 88 matches.", "Argentina is one of the most successful teams in the tournament’s history, having won three World Cups: in 1978, 1986, 2022. Argentina has also been runner up ...", "Previously, the last time Argentina won the World Cup was 1986, when it defeated Germany to win its second title in three tournaments.", "Argentina have won the FIFA World Cup three times 2013 in 1978, 1986 and ˘ 2022. They have reached the final six times, including a second-place ...", "The Argentines have won two FIFA World Cups, in 1978 and 1986. They have placed second three times before, in 1930, 1990, and 2014.", "Argentina last won the FIFA World Cup in 1986, defeating West Germany in the championship round, 3-2. Argentina World Cup Wins. Argentina’s ..."]
|
| 465 |
+
}
|
| 466 |
+
{
|
| 467 |
+
"claim": "The most valuable NFT ever sold is a digital artwork called ’Everydays: The First 5000 Days’ ",
|
| 468 |
+
"label": false,
|
| 469 |
+
"with_tool_classification": false,
|
| 470 |
+
"with_tool_reasoning": "The given text states that the most valuable NFT ever sold is ’Everydays: The First 5000 Days’. According to the provided evidence, ’The First 5000 Days’ is the second most expensive NFT ever sold, with ’Merge’ being the most expensive one.",
|
| 471 |
+
"queries": ["Most valuable NFT ever sold", "Everydays: The First 5000 Days"],
|
| 472 |
+
"evidences": ["The Most Expensive NFTs Ever Sold 1. Merge - 2014 US \$91.8M. Pak - Merge. . . . 2. The First 5000 Days - 2014 US\$69.3M. Beeple - 2014 The First 5000 Days. . . . 3. Clock - 2014 US\$52.7M. Julian Assange & Pak - 2014 Clock. . . . 4. HUMAN ONE - 2014 US\$29M. Beeple - 2014 HUMAN ONE. . . . 5. CryptoPunk #5822 - 2014 US\$23.7M. CryptoPunk #5822.", "Everydays: the First 5000 Days: Work of art.", "Everydays: the First 5000 Days is a digital work of art created by Mike Winkelmann, known professionally as Beeple. The work is a collage of 5000 digital images created by Winkelmann for his Everydays series.", "Everydays: the First 5000 Days Artist: Mike Winkelmann.", "Everydays: the First 5000 Days Owner: Vignesh Sundaresan (MetaKovan).", "Everydays: the First 5000 Days Medium: Digital (JPEG)."]
|
| 473 |
+
}
|
| 474 |
+
{
|
| 475 |
+
"task_id": "HumanEval/2",
|
| 476 |
+
"prompt":
|
| 477 |
+
|
| 478 |
+
d e f t r u n c a t e _ n u m b e r ( number : f l o a t ) $- >$ f l o a t : " " " G i v e n a p o s i t i v e f l o a t i n g p o i n t n u m b e r , i t c a n b e d e c o m p o s e d i n t o a n d i n t e g e r p a r t ( l a r g e s t i n t e g e r s m a l l e r t h a n g i v e n n u m b e r ) a n d d e c i m a l s ( l e f t o v e r p a r t a l w a y s s m a l l e r t h a n 1 ) . R e t u r n t h e d e c i m a l p a r t o f t h e n u m b e r . " " "
|
| 479 |
+
|
| 480 |
+
"entry_point": "truncate_number", "completion":
|
| 481 |
+
|
| 482 |
+
d e f t r u n c a t e _ n u m b e r ( n u m b e r : f l o a t ) $- >$ f l o a t : i n t e g e r _ p a r t $=$ n u m b e r / / 1 d e c i m a l _ p a r t $=$ n u m b e r − i n t e g e r _ p a r t r e t u r n d e c i m a l _ p a r t
|
| 483 |
+
|
| 484 |
+
"result": "passed",
|
| 485 |
+
"passed": true,
|
| 486 |
+
"with_tool_classification": true,
|
| 487 |
+
"testcases_input": ["truncate_number(4.56)", "tr
|
| 488 |
+
cate_number(0.123)", "truncate_number(19.999)"],
|
| 489 |
+
"multi_solutions": [
|
| 490 |
+
|
| 491 |
+
d e f t r u n c a t e _ n u m b e r ( n u m b e r : f l o a t ) $- >$ f l o a t : r e t u r n number − i n t ( number )
|
| 492 |
+
|
| 493 |
+
d e f t r u n c a t e _ n u m b e r ( n u m b e r : f l o a t ) $- >$ f l o a t : r e t u r n number − i n t ( number )
|
| 494 |
+
|
| 495 |
+
d e f t r u n c a t e _ n u m b e r ( number : f l o a t ) $- >$ f l o a t : r e t u r n number − i n t ( number )
|
| 496 |
+
|
| 497 |
+
d e f t r u n c a t e _ n u m b e r ( number : f l o a t ) $- >$ f l o a t : i n t e g e r _ p a r t $=$ n u m b e r / / 1 d e c i m a l _ p a r t $=$ n u m b e r − i n t e g e r _ p a r t r e t u r n d e c i m a l _ p a r t
|
| 498 |
+
|
| 499 |
+
]
|
| 500 |
+
"exec_result": [[0.5599999999999996, 0.5599999999999996, 0.5599999999999996, 0.5599999999999996], [0.123, 0.123, 0.123, 0.123], [0.9989999999999988, 0.9989999999999988, 0.9989999999999988, 0.9989999999999988]]
|
| 501 |
+
}
|
| 502 |
+
{
|
| 503 |
+
"task_id": "HumanEval/57",
|
| 504 |
+
"prompt":
|
| 505 |
+
|
| 506 |
+
d e f m o n o t o n i c ( l : l i s t ) : " " " R e t u r n T r u e i f l i s t e l e m e n t s a r e m o n o t o n i c a l l y i n c r e a s i n g o r d e c r e a s i n g . " " "
|
| 507 |
+
|
| 508 |
+
"entry_point": "monotonic", "completion":
|
| 509 |
+
|
| 510 |
+
d e f m o n o t o n i c ( l : l i s t ) : i f l e n $( \mathrm { ~ l ~ } ) \ < = \ 1$ : r e t u r n True i n c r e a s i n g $=$ a l l ( $\mathrm { ~ l ~ } [ \mathrm { ~ i ~ } ] \ \ < = \ \mathrm { ~ l ~ } [ \mathrm { ~ i ~ } + 1 ]$ f o r i i n r a n g e ( l e n ( l ) − 1 ) ) d e c r e a s i $\mathrm { ~ \bf ~ { ~ \underline { ~ } { ~ g ~ } ~ } ~ } = \mathrm { ~ \bf ~ a ~ l ~ l ~ } ( \mathrm { ~ \bf ~ l ~ } [ \mathrm { ~ i ~ } ] \mathrm { ~ \bf ~ { ~ \underline { ~ } { ~ } { ~ \bf ~ \succ ~ } ~ } ~ } = \mathrm { ~ \bf ~ l ~ } [ \mathrm { ~ i ~ } + 1 ] $ f o r i i n r a n g e ( l e n ( l ) − 1 ) ) r e t u r n i n c r e a s i n g o r d e c r e a s i n g
|
| 511 |
+
|
| 512 |
+
"result": "passed",
|
| 513 |
+
"passed": true,
|
| 514 |
+
"with_tool_classification": true,
|
| 515 |
+
"testcases_input": ["monotonic([1, 2, 3, 4, 5])", "monotonic([5, 4, 3,
|
| 516 |
+
2, 1])", "monotonic([1, 3, 5, 4, 7])"],
|
| 517 |
+
|
| 518 |
+
"multi_solutions": [
|
| 519 |
+
|
| 520 |
+
d e f m o n o t o n i c ( l : l i s t ) : i f l e n ( l ) $< ~ 2$ : r e t u r n True i n c r e a s i n g $=$ d e c r e a s i n g $=$ T r u e f o r i i n r a n g e ( l e n ( l ) − 1 ) : i f $\begin{array} { r } { \mathrm { ~ l ~ [ ~ i ~ ] ~ } < \mathrm { ~ l ~ [ ~ i ~ \ + ~ \ 1 ~ ] ~ } ; } \end{array}$ : d e c r e a s i n g $=$ F a l s e i f $\mathrm { ~ l ~ } [ \mathrm { ~ i ~ } ] ~ > ~ \mathrm { ~ l ~ } [ \mathrm { ~ i ~ } ~ + ~ 1 ]$ : i n c r e a s i n g $=$ F a l s e i f n o t i n c r e a s i n g and n o t d e c r e a s i n g : r e t u r n F a l s e r e t u r n True
|
| 521 |
+
|
| 522 |
+
d e f m o n o t o n i c ( l : l i s t ) : i f l e n $( \ 1 \ ) \ < \ 2$ : r e t u r n True d i r e c t i o n $= \mathrm { ~ l ~ } [ 1 ] \ - \ 1 [ 0 ]$ f o r i i n r a n g e ( 2 , l e n ( l ) ) : i f d i r e c t i o n $\scriptstyle = = \atop \ 0$ : d i r e c t i o n $\mathbf { \Sigma } = \mathrm { ~ l ~ } [ \mathrm { ~ i ~ } ] \ \mathbf { \Sigma } - \mathrm { ~ l ~ } [ \mathrm { ~ i ~ } - 1 ]$ c o n t i n u e i f $\begin{array} { r l } { \mathrm { ~ ( ~ l ~ [ ~ i ~ ] ~ - ~ } \mathrm { ~ l ~ [ ~ i ~ - ~ 1 ~ ] ~ ) ~ } } & { { } : } \end{array}$ $^ *$ d i r e c t i o n $< ~ 0$ : r e t u r n F a l s e r e t u r n True
|
| 523 |
+
|
| 524 |
+
d e f m o n o t o n i c ( l : l i s t ) : i f l e n $( \ 1 \ ) \ < \ 2$ : r e t u r n True d i r e c t i o n $= \mathrm { ~ l ~ } [ 1 ] \ - \ 1 [ 0 ]$ f o r i i n r a n g e ( 2 , l e n ( l ) ) : i f d i r e c t i o n $\scriptstyle = = \atop \ 0$ : d i r e c t i o n $\mathbf { \Sigma } = \mathrm { ~ l ~ [ ~ i ~ ] ~ } - \mathrm { ~ l ~ [ ~ i ~ \mathbf ~ { ~ - ~ } ~ } 1 ]$ c o n t i n u e i f $\left( \mathrm { ~ l ~ } [ \mathrm { ~ i ~ } ] \ - \ \mathrm { ~ l ~ } [ \mathrm { ~ i ~ } \ - \ \mathrm { ~ 1 ~ } ] \right)$ $| { \bf \Phi } ) { \bf \Psi } *$ d i r e c t i o n $< ~ 0$ : r e t u r n F a l s e r e t u r n True
|
| 525 |
+
|
| 526 |
+
d e f m o n o t o n i c ( l : l i s t ) : i f l e n ( l ) $\scriptstyle < = \ 1$ : r e t u r n True i n c r e a s i n $\begin{array} { r } { \mathrm { ~ ~ \gamma ~ } _ { \mathrm { ~ \bf ~ \tau ~ } } = \mathrm { ~ \bf ~ a ~ l ~ l ~ } ( \mathrm { ~ l ~ } [ \mathrm { ~ i ~ } ] \mathrm { ~ ~ \Sigma ~ } < = \mathrm { ~ \bf ~ l ~ } [ \mathrm { ~ i ~ } + 1 ] } \end{array}$ f o r i i n r a n g e ( l e n ( l ) − 1 ) ) d e c r e a s i n $\begin{array} { r } { \mathrm { ~ ~ \gamma ~ } _ { \mathrm { ~ \bf ~ \tau ~ } } = \mathrm { ~ \bf ~ a ~ l ~ l ~ } ( \mathrm { ~ \bf ~ l ~ } [ \mathrm { ~ i ~ } ] \mathrm { ~ ~ \Sigma ~ } > = \mathrm { ~ \bf ~ l ~ } [ \mathrm { ~ i ~ } + 1 ] } \end{array}$ f o r i i n r a n g e ( l e n ( l ) − 1 ) ) r e t u r n i n c r e a s i n g o r d e c r e a s i n g
|
| 527 |
+
|
| 528 |
+
]
|
| 529 |
+
"exec_result": [[true, true, true, true], [true, true, true, true], [false,
|
| 530 |
+
false, false, false]]
|
| 531 |
+
}
|
| 532 |
+
|
| 533 |
+

|
| 534 |
+
Figure 12: Examples of code claims verified by FACTOOL ChatGPT and FACTOOL GPT-4. The queries generated, evidences collected, the reasoning process, and the final decisions of FACTOOL ChatGPT and FACTOOL GPT-4 are reported.
|
| 535 |
+
|
| 536 |
+

|
| 537 |
+
Figure 13: Examples of math claims verified by FACTOOL ChatGPT and FACTOOL GPT-4. The full response of FACTOOL $\mathrm { G P T } { \cdot } 4$ is reported, including the queries generated, evidences collected, the reasoning process, and the final decision.
|
| 538 |
+
|
| 539 |
+

|
| 540 |
+
Figure 14: Examples of scientific claims verified by FACTOOL ChatGPT and FACTOOL GPT-4. The full response of FACTOOL ChatGPT and FACTOOL $\mathrm { G P T } { \cdot } 4$ is reported, including the queries generated, evidences collected, the reasoning process, and the final decision.
|
| 541 |
+
|
| 542 |
+
<table><tr><td>[Reasoning Error] "claim":"Jupiter is less dense than Saturn", "label": false, "with_tool_classification": true, "with_tool_reasoning":"The given text is fac- tual because both provided evidences support the claim that Jupiter is less dense than Saturn. The first evidence provides numerical data on the densities of Jupiter and Saturn,and the sec- ond evidence confirms that Saturn is the least</td><td>[Conflicting Evidences] "claim": "Jupiter has a density of 1.33 grams per cubic centimeter", "label": true, "with_tool_classification": false, "with_tool_reasoning":"The given text is mostly in line with the provided evidences. There is a minor discrepancy between the two evidences,with one stating the density of Jupiter as 1.326 g/cm00b3 and the other as 1.33 g/cm0ob3. However, the difference is minimal</td><td>[Ambiguity in descriptions] "claim": "Fortune cookies are enjoyed by peo- ple all over the world.", "label": false, "with_tool_classification": true, "with_tool_reasoning":"The given text states that fortune cookies are enjoyed by people all over the world. While the evidence provided does not explicitly mention the global enjoy- ment of fortune cookies,it does mention that</td></tr><tr><td>dense planet in the solar system.", "queries": ["Jupiter Vs Saturn density","Which planet is less dense Jupiter or Saturn?"], "evidences":["The density of Jupiter is 1,33 g/cmOOb3 whereas the density of Saturn is only 0,687 g/cmoob3.If Saturn were the same den- sityas Jupiter, it would have a radius of 30.079 km.","Jupiter is the largest planet in the solar system,but it's Saturn2O14the solar system's second largest planet2O14that takes the prize for least dense. Aug 1,2019"] 1</td><td>and could be due to rounding.", "queries":["Jupiter density grams per cubic centimeter","Density of Jupiter"], "evidences":["Density of Jupiter: However,at 1.326 g/cm3,it is also the second-most dense of the gas giants.Feb 17,2016","1.33 g/cm00b3"]</td><td>3 billion fortune cookies are made each year globally, with the majority consumed in the US. This suggests that fortune cookies are indeed en- joyed by people in various parts of the world.", "queries":["Originof fortune cookies","Popu- larity of fortune cookies worldwide"], "evidences":["Japan","Thereareapproxi- mately 3 billion fortune cookies made each year globally,the majority of them consumed in the US.The largest manufacturer of the cookies is Wonton Food,Inc.,headquartered in Brooklyn, New York.They make over 4.5 million fortune cookies per day."]</td></tr></table>
|
| 543 |
+
|
| 544 |
+
# [Limited variety in synthetic testcases]
|
| 545 |
+
|
| 546 |
+
"task_id": "HumanEval/64",
|
| 547 |
+
"prompt": "Write a function vowels_count(s) which takes a string representing a word as input and returns the number of vowels in the string. Vowels in this case are ’a’, ’e’, ’i’, ’o’, ’u’. Here, ’y’ is also a vowel, but only when it is at the end of the given word.", "entry_point": "vowels_count",
|
| 548 |
+
|
| 549 |
+
"completion":
|
| 550 |
+
|
| 551 |
+
d e f v o w e l s _ c o u n t ( s ) : vowels $\mathbf { \Sigma } = \mathbf { \Sigma } [ \mathbf { \Sigma } ^ { \prime } { \bf { a } } ^ { \prime }$ , ' e ' , ' i ' , ' o ' , ' u ' ] c o u n t $\mathit { \Theta } = \mathit { \Theta } 0$ f o r i i n r a n g e ( l e n ( s ) ) : i f s [ i ] i n v o w e l s : c o u n t $\scriptstyle + = \ 1$ i f i == l e n ( s ) − 1 and $\mathbf { { s } } \left[ \mathrm { ~ i ~ } \right] \mathbf { { \sigma } } = \mathbf { { \sigma } } ^ { \prime } \mathbf { { y } } ^ { \prime }$ c o u n t $\scriptstyle + = \ 1$ r e t u r n c o u n t
|
| 552 |
+
|
| 553 |
+
"result": "failed: AssertionError: Test $2 "$ ,
|
| 554 |
+
"passed": false,
|
| 555 |
+
"with_tool_classification": true,
|
| 556 |
+
"testcases_input": ["vowels_count(’encyclopedia’)", "vow
|
| 557 |
+
els_count(’rhythm’)", "vowels_count(’beautiful’)"],
|
| 558 |
+
"multi_solutions": [
|
| 559 |
+
|
| 560 |
+
d e f v o w e l s _ c o u n t ( s ) : vowels $=$ ' a e i o u ' c o u n t $\mathit { \Theta } = \mathit { \Theta } 0$ f o r i , c i n e n u m e r a t e ( s ) : i f c . l o w e r ( ) i n v o w e l s : c o u n t $\scriptstyle + = \ 1$ e l i f c . l o w e r $\mathrm { ( ) \Sigma \ = \Sigma ^ { \prime } \times \Sigma ^ { \prime } }$ and $\begin{array} { r l r } { \mathbf { i } } & { { } = } & { \mathbf { l e n } } \end{array}$ ( c o u n t $\scriptstyle + = \ 1$ r e t u r n c o u n t
|
| 561 |
+
|
| 562 |
+
d e f v o w e l s _ c o u n t ( s ) : vowels $=$ ' a e i o u ' c o u n t $\mathit { \Theta } = \mathit { \Theta } 0$ f o r c h a r i n s : i f c h a r . l o w e r ( ) i n v o w e l s : c o u n t $\scriptstyle + = \ 1$ i f s [ − 1 ] . l o w e r $\mathrm { ~ ~ ( ~ ) ~ } = = \mathrm { ~ ~ ' ~ } { \bf y } ^ { \mathrm { ~ ~ } }$ : c o u n t $\scriptstyle + = 1$ r e t u r n c o u n t
|
| 563 |
+
|
| 564 |
+
d e f v o w e l s _ c o u n t ( s ) : vowels $=$ ' a e i o u ' c o u n t $\mathit { \Theta } = \mathit { \Theta } 0$ f o r c h a r i n s : i f c h a r . l o w e r ( ) i n v o w e l s : c o u n t $\scriptstyle + = \ 1$ i f s [ − 1 ] . l o w e r $\mathrm { ~ ~ ( ~ ) ~ } = = \mathrm { ~ ~ ' ~ } { \bf y } ^ { \mathrm { ~ ~ } }$ ' : c o u n t $\scriptstyle + = 1$ r e t u r n c o u n t
|
| 565 |
+
|
| 566 |
+
d e f v o w e l s _ c o u n t ( s ) : vowels $\mathbf { \Sigma } = \mathbf { \Sigma } [ \mathbf { \Sigma } ^ { \prime } { \bf { a } } ^ { \prime }$ , ' e ' , ' i ' , ' o ' , ' u ' ] c o u n t $\mathit { \Theta } = \mathit { \Theta } 0$ f o r i i n r a n g e ( l e n ( s ) ) : i f s [ i ] i n v o w e l s : c o u n t $\scriptstyle + = \ 1$ i f $\mathbf { i } \ \mathbf { \Sigma } = \ \mathbf { l e n } \left( \textrm { s } \right) \ - \ \mathbf { l }$ and $\mathbf { { s } } \left[ \mathrm { ~ i ~ } \right] \mathbf { { \sigma } } = \mathbf { { \sigma } } ^ { \prime } \mathbf { { y } } ^ { \prime }$ : c o u n t $\scriptstyle + = \ 1$ r e t u r n c o u n t
|
| 567 |
+
|
| 568 |
+
]
|
| 569 |
+
"exec_result": [[5, 5, 5, 5], [0, 0, 0, 0], [5, 5, 5, 5]]
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
# [Potential errors in code generation]
|
| 573 |
+
|
| 574 |
+
"task_id": "HumanEval/79",
|
| 575 |
+
"prompt":
|
| 576 |
+
d e f d e c i m a l _ t o _ b i n a r y ( d e c i m a l ) :
|
| 577 |
+
" " " You w i l l b e g i v e n a n u m b e r i n d e c i m a l f o r m
|
| 578 |
+
a n d y o u r t a s k i s t o c o n v e r t i t t o b i n a r y f o r m a t .
|
| 579 |
+
T h e f u n c t i o n s h o u l d r e t u r n a s t r i n g ,
|
| 580 |
+
w i t h e a c h c h a r a c t e r r e p r e s e n t i n g a b i n a r y n u m b e r .
|
| 581 |
+
E a c h c h a r a c t e r i n t h e s t r i n g w i l l b e ' 0 ' o r ' 1 ' .
|
| 582 |
+
T h e r e w i l l b e an e x t r a c o u p l e o f
|
| 583 |
+
c h a r a c t e r s ' d b ' a t t h e b e g i n n i n g
|
| 584 |
+
a n d a t t h e e n d o f t h e s t r i n g .
|
| 585 |
+
T h e e x t r a c h a r a c t e r s a r e t h e r e
|
| 586 |
+
t o h e l p w i t h t h e f o r m a t .
|
| 587 |
+
"entry_point": "decimal_to_binary",
|
| 588 |
+
"completion":
|
| 589 |
+
d e f d e c i m a l _ t o _ b i n a r y ( d e c i m a l ) : b i n a r y _ l i s t $\begin{array} { r l } { \mathbf { \tau } } & { { } = \mathbf { \tau } \left[ \begin{array} { l } { \mathbf { \tau } } \end{array} \right] } \end{array}$ y w h i l e d e c i m a l $> ~ 0$ : r e m a i n d e r $=$ d e c i m a l $\% 2$ b i n a r y _ l i s t . a p p e n d ( s t r ( r e m a i n d e r ) ) d e c i m a l $=$ d e c i m a l / / 2 b i n a r y _ l i s t . r e v e r s e ( ) b i n a r y _ s t r i n g $=$ ' ' . j o i n ( b i n a r y _ l i s t ) r e t u r n ' db ' $^ +$ b i n a r y _ s t r i n g $^ +$ ' d b '
|
| 590 |
+
"result": "failed: AssertionError: ",
|
| 591 |
+
"passed": false,
|
| 592 |
+
s ) − 1 :"with_tool_classification": true,
|
| 593 |
+
"testcases_input": ["decimal_to_binary(10)", "deci
|
| 594 |
+
mal_to_binary(255)", "decimal_to_binary(0)"],
|
| 595 |
+
"multi_solutions": [ d e f d e c i m a l _ t o _ b i n a r y ( d e c i m a l ) : binary_num $=$ ' ' w h i l e d e c i m a l $> ~ 0$ : r e m a i n d e r $=$ d e c i m a l $\% 2$ d e c i m a l $=$ d e c i m a l / / 2 binary_num $=$ s t r ( r e m a i n d e r ) $^ +$ binary_num r e t u r n ' db ' $^ +$ binary_num $^ +$ ' d b ' d e f d e c i m a l _ t o _ b i n a r y ( d e c i m a l ) : b i n a r y $=$ w h i l e d e c i m a l $> ~ 0$ : r e m a i n d e r $=$ d e c i m a l $\% 2$ d e c i m a l $=$ d e c i m a l / / 2 b i n a r y $=$ s t r ( r e m a i n d e r ) $^ +$ b i n a r y r e t u r n ' db ' $^ +$ b i n a r y $^ +$ ' d b ' d e f d e c i m a l _ t o _ b i n a r y ( d e c i m a l ) : b i n a r y $=$ w h i l e d e c i m a l $> ~ 0$ : r e m a i n d e r $=$ d e c i m a l $\% 2$ d e c i m a l $=$ d e c i m a l / / 2 b i n a r y $=$ s t r ( r e m a i n d e r ) $^ +$ b i n a r y r e t u r n ' db ' $^ +$ b i n a r y $^ +$ ' d b ' d e f d e c i m a l _ t o _ b i n a r y ( d e c i m a l ) : b i n a r y _ l i s t $\begin{array} { r l } { \mathbf { \Psi } } & { { } = \mathbf { \Psi } \left[ \begin{array} { l } { \mathbf { \Psi } } \\ { \mathbf { \Psi } } \end{array} \right] } \end{array}$ w h i l e d e c i m a l $> ~ 0$ : r e m a i n d e r $=$ d e c i m a l $\% 2$ b i n a r y _ l i s t . a p p e n d ( s t r ( r e m a i n d e r ) ) d e c i m a l $=$ d e c i m a l / / 2 b i n a r y _ l i s t . r e v e r s e ( ) b i n a r y _ s t r i n g $=$ ' ' . j o i n ( b i n a r y _ l i s t ) r e t u r n $^ { \prime } \mathrm { d } \mathsf { b } ^ { \prime } +$ b i n a r y _ s t r i n g $\therefore \cdot \mathrm { d } \mathrm { b }$
|
| 596 |
+
],
|
| 597 |
+
"exec_result": [["db1010db", "db1010db", "db1010db",
|
| 598 |
+
"db1010db"], ["db11111111db", "db11111111db", "db11111111db",
|
| 599 |
+
"db11111111db"], ["dbdb", "dbdb", "dbdb", "dbdb"]]
|
| 600 |
+
} [Round-off error]
|
| 601 |
+
"math_calculation": "60444034 / 12",
|
| 602 |
+
"calculated_answer": "5037002.83",
|
| 603 |
+
"label": true,
|
| 604 |
+
"query": "python_snippet": "calculation $=$ 60444034 / 12; answer $=$ 5037002.83; print(abs(calculation - answer) $<$ 1e-9)",
|
| 605 |
+
"exec_result": "False",
|
| 606 |
+
"with_tool_classification": false
|
| 607 |
+
[Reasoning error]
|
| 608 |
+
"input": "Kylar went to the store to buy glasses for his new apartment. One glass costs $\$ 5$ , but every second glass costs only $60 \%$ of the price. Kylar wants to buy 5364765 glasses. How much does he need to pay for them?",
|
| 609 |
+
"target": 21459061.0,
|
| 610 |
+
"response": "Let’s assume that Kylar buys x glasses at the full price of $\$ 5$ each. Therefore, he will buy (5364765 - x) glasses at a discounted price of $60 \%$ of $\$ 5$ , which is $\$ 3$ . Now, we can set up the equation:
|
| 611 |
+
$5 \mathrm { x } + 3 ( 5 3 6 4 7 6 5 - \mathrm { x } ) = \mathrm { t o }$ tal cost
|
| 612 |
+
Simplifying the equation, we get:
|
| 613 |
+
$5 { \mathrm { x } } + 1 6 0 9 4 2 9 5 - 3 { \mathrm { x } } = { \mathrm { t } }$ otal cost
|
| 614 |
+
$2 { \mathrm { x } } + 1 6 0 9 4 2 9 5 =$ total cost
|
| 615 |
+
Therefore, the total cost of all the glasses will be $2 \mathrm { x } + 1 6 0 9 4 2 9 5$ dollars. Now, we just need to find the value of $\mathbf { X }$ . We know that Kylar wants to buy 5364765 glasses, so we can substitute this value in the equation:
|
| 616 |
+
$2 { \mathrm { x } } + 1 6 0 9 4 2 9 5 =$ total cost
|
| 617 |
+
$2 \mathrm { x } + 1 6 0 9 4 2 9 5 = 5 { , } 3 6 4 { , } 7 6 5 { ^ \circ } ^ { \circ } { } ^ { \circ } { } ^ { \circ } { }$
|
| 618 |
+
$2 \mathrm { x } + 1 6 0 9 4 2 9 5 = 2 6 8 2 3 8 2 5$
|
| 619 |
+
$2 \mathrm { x } = 1 0 7 2 9 5 3 0$
|
| 620 |
+
$\mathrm { x } = 5 3 6 4 7 6 5$
|
| 621 |
+
Therefore, Kylar needs to pay $2 \mathrm { x } + 1 6 0 9 4 2 9 5$ dollars, which is: 2 $5 3 6 4 7 6 5 ) + 1 6 0 9 4 2 9 5 = 2 6 8 2 3 8 2 \div$ 5.
|
| 622 |
+
Hence, Kylar needs to pay \$26823825 for all the glasses.",
|
| 623 |
+
"answer": "26823825",
|
| 624 |
+
"annotation": false,
|
| 625 |
+
"claims": [{"math_calculation": "5364765 - x", "calculated_answer": $" 5 3 6 4 7 6 5 \mathrm { ~ - ~ } \mathbf { x } "$ , "label": true}, {"math_calculation": " $" 0 . 6 0 \ \ast \ 5 "$ , "calculated_answer": "3", "label": true}, {"math_calculation": "5x", "calculated_answer": $" 5 \mathrm { { X } " }$ , "label": true}, {"math_calculation": "3(5364765 - x)", "calculated_answer": "16094295 - 3x", "label": true}, {"math_calculation": $" 5 x + 1 6 0 9 4 2 9 5 - 3 \mathrm { x " }$ , "calculated_answer": " $1 6 0 9 4 2 9 5 + 2 \mathbf { x } ^ { \prime \prime }$ , "label": true}, {"math_calculation": $" 2 x + 1 6 0 9 4 2 9 5 "$ , "calculated_answer": "total cost", "label": "null"}, {"math_calculation": "5364765 $^ *$ $5 "$ , "calculated_answer": "26823825", "label": true}, {"math_calculation": "2(5364765)", "calculated_answer": "10729530", "label": true}, {"math_calculation": $" 2 \mathbf { X } "$ , "calculated_answer": "10729530", "label": "null"}]
|
| 626 |
+
"math_calculation": "5364765 - $\mathbf { X } ^ { \prime \prime }$ , "calculated_answer": "5364765 - $\mathbf { X } ^ { \prime \prime }$ , "label": true, "query": "python_snippet": $\mathbf { \ddot { X } } = 0$ ; math_calculation $=$ $5 3 6 4 7 6 5 - \mathbf { X } ^ { \prime }$ ; calculated_answer $= 5 3 6 4 7 6 5 - \mathbf { X } ;$ ; print(math_calculation $= =$ calculated_answer)", "exec_result": "True", "with_tool_classification": true "math_calculation": $" 0 . 6 0 ~ \ \ast ~ 5 "$ , "calculated_answer": "3", "label": true, "query": "python_snippet": "calculation $= 0 . 6 0 ~ ^ { \ast } ~ 5$ ; answer $= 3$ ; print(calculation $= =$ answer)", "exec_result": "True", "with_tool_classification": true "math_calculation": " $\ " \mathrm { s x } \ " $ , "calculated_answer": " $" 5 \mathrm { { x } " }$ , "label": true, "query": "python_snippet": "def validate_calculation(calculation, answer): return calculation $= =$ answer; print(validate_calculation(’5x’, ’5x’))", "exec_result": "True", "with_tool_classification": true "math_calculation": $" 3 ( 5 3 6 4 7 6 5 \mathrm { ~ - ~ } \mathrm { ~ x } )$ ", "calculated_answer": $" 1 6 0 9 4 2 9 5 \ : - \ : 3 \mathrm { x } "$ , "label": true, "query": "python_snippet": $\ " \mathbf { X } = 1$ ; result1 $= 3 ~ ^ { * }$ (5364765 - x); res $\mathrm { \ u l t } 2 = 1 6 0 9 4 2 9 5 \cdot 3$ $^ { * } \textbf { X }$ ; print(result1 $= =$ result2)", "exec_result": "True", "with_tool_classification": true "math_calculation": $" 5 x + 1 6 0 9 4 2 9 5 - 3 \mathrm { x " }$ , "calculated_answer": $" 1 6 0 9 4 2 9 5 + 2 \mathbf { x } "$ , "label": true, "query": "python_snippet": $" \mathbf { X } = 1$ ; prin $( ( 5 * _ { \mathrm { ~ X ~ } } + 1 6 0 9 4 2 9 5 - 3 \mathit { \Psi } ^ { * } \mathrm { ~ X ~ } ) = = ( 1 6 0 9 4 2 9 5 + 2 \mathit { \Psi } ^ { * } \mathrm { ~ X ~ } ) ) ^ { \mathfrak { V } }$ , "exec_result": "True", "with_tool_classification": true "math_calculation": $" 2 x + 1 6 0 9 4 2 9 5 "$ , "calculated_answer": "total cost", "label": "null", "query": "python_snippet": $\ " \mathbf { X } = 5$ ; math_calculation $= 2 \ast _ { \mathrm { \mathbf { X } } } + 1 6 0 9 4 2 9 5$ ; calculated_answer $= 1 6 0 9 4 3 0 5$ ; print(math_calculation $= =$ calculated_answer)", "exec_result": "True", "with_tool_classification": true "math_calculation": $\prime 5 3 6 4 7 6 5 ^ { \ast } 5 "$ , "calculated_answer": "26823825", "label": true, "query": "python_snippet": "calculation $= 5 3 6 4 7 6 5 \ast 5$ ; answer $= 2 6 8 2 3 8 2 5$ ; print(calculation $= =$ answer)", "exec_result": "True", "with_tool_classification": true "math_calculation": "2(5364765)", "calculated_answer": $" 1 0 7 2 9 5 3 0 "$ , "label": true, "query": "python_snippet": "calculation $= 2 \ast 5 3 6 4 7 6 5$ ; answer $= 1 0 7 2 9 5 3 0$ ; print(calculation $= =$ answer)", "exec_result": "True", "with_tool_classification": true "math_calculation": $" 2 \mathbf { X } "$ , "calculated_answer": "10729530", "label": "null", "query": "python_snippet": $" \mathrm { x } = 5 3 6 4 7 6 5$ ; $\operatorname { p r i n t } ( 2 { } ^ { * } { \textbf { x } } = =$ 10729530)", "exec_result": "True", "with_tool_classification": true
|
| 627 |
+
}
|
| 628 |
+
|
| 629 |
+
Figure 17: Some error cases of FACTOOL on math. The full response of FACTOOL $\mathrm { G P T } { \cdot } 4$ is reported, including the queries generated, evidences collected, the reasoning process, and the final decision is also reported.
|
| 630 |
+
|
| 631 |
+
# [Errors in title matching]
|
| 632 |
+
|
| 633 |
+

|
| 634 |
+
Figure 18: Some error cases of FACTOOL on scientific. The full response of FACTOOL $\mathrm { G P T } { \cdot } 4$ is reported, including the queries generated, evidences collected, the reasoning process, and the final decision is also reported.
|
md/test/jxpsAj7ltE/jxpsAj7ltE.md
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FROM SPARSE TO SOFT MIXTURES OF EXPERTS
|
| 2 |
+
|
| 3 |
+
Joan Puigcerver∗ Google DeepMind
|
| 4 |
+
|
| 5 |
+
Carlos Riquelme∗ Google DeepMind
|
| 6 |
+
|
| 7 |
+
Basil Mustafa Google DeepMind
|
| 8 |
+
|
| 9 |
+
Neil Houlsby Google DeepMind
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Sparse mixture of expert architectures (MoEs) scale model capacity without significant increases in training or inference costs. Despite their success, MoEs suffer from a number of issues: training instability, token dropping, inability to scale the number of experts, or ineffective finetuning. In this work, we propose Soft MoE, a fully-differentiable sparse Transformer that addresses these challenges, while maintaining the benefits of MoEs. Soft MoE performs an implicit soft assignment by passing different weighted combinations of all input tokens to each expert. As in other MoEs, experts in Soft MoE only process a subset of the (combined) tokens, enabling larger model capacity (and performance) at lower inference cost. In the context of visual recognition, Soft MoE greatly outperforms dense Transformers (ViTs) and popular MoEs (Tokens Choice and Experts Choice). Furthermore, Soft MoE scales well: Soft MoE Huge/14 with 128 experts in 16 MoE layers has over $4 0 \times$ more parameters than ViT Huge/14, with only $2 \%$ increased inference time, and substantially better quality.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Larger Transformers improve performance at increased computational cost. Recent studies suggest that model size and training data must be scaled together to optimally use any given training compute budget (Kaplan et al., 2020; Hoffmann et al., 2022; Zhai et al., 2022a). A promising alternative that allows to scale models in size without paying their full computational cost is sparse mixtures of experts (MoEs). Recently, a number of successful approaches have proposed ways to sparsely activate token paths across the network in language (Lepikhin et al., 2020; Fedus et al., 2022), vision (Riquelme et al., 2021), and multimodal models (Mustafa et al., 2022).
|
| 18 |
+
|
| 19 |
+
Sparse MoE Transformers involve a discrete optimization problem to decide which modules should be applied to each token. These modules are commonly referred to as experts and are usually MLPs. Many techniques have been devised to find good token-to-expert matches: linear programs (Lewis et al., 2021), reinforcement learning (Bengio et al., 2015), deterministic fixed rules (Roller et al., 2021), optimal transport (Liu et al., 2022), greedy top- $k$ experts per token (Shazeer et al., 2017), or greedy top- $k$ tokens per expert (Zhou et al., 2022). Often, heuristic auxiliary losses are required to balance utilization of experts and minimize unassigned tokens. These challenges can be greater in out-of-distribution settings: small inference batch sizes, novel inputs, or in transfer learning.
|
| 20 |
+
|
| 21 |
+
We introduce Soft MoE, that overcomes many of these challenges. Rather than employing a sparse and discrete router that tries to find a good hard assignment between tokens and experts, Soft MoEs instead perform a soft assignment by mixing tokens. In particular, we compute several weighted averages of all tokens—with weights depending on both tokens and experts—and then we process each weighted average by its corresponding expert.
|
| 22 |
+
|
| 23 |
+
Soft MoE L/16 outperforms ViT H/14 on upstream, few-shot and finetuning while requiring almost half the training time, and being $2 \times$ faster at inference. Moreover, Soft MoE B/16 matches ViT H/14 on few-shot and finetuning and outperforms it on upstream metrics after a comparable amount of training. Remarkably, Soft MoE B/16 is $5 . 7 \times$ faster at inference despite having $5 . 5 \times$ the number of parameters of ViT H/14 (see Table 1 and Figure 5 for details). Section 4 demonstrates Soft MoE’s potential to extend to other tasks: we train a contrastive model text tower against the frozen vision tower, showing that representations learned via soft routing preserve their benefits for image-text alignment.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Sparse and Soft MoE layers. While the router in Sparse MoE layers (left) learns to assign individual input tokens to each of the available slots, in Soft MoE layers (right) each slot is the result of a (different) weighted average of all the input tokens. Learning to make discrete assignments introduces several optimization and implementation issues that Soft MoE sidesteps. Appendix G visualizes learned distributions of soft-assignments by Soft MoE.
|
| 27 |
+
|
| 28 |
+
# 2 SOFT MIXTURE OF EXPERTS
|
| 29 |
+
|
| 30 |
+
# 2.1 ALGORITHM DESCRIPTION
|
| 31 |
+
|
| 32 |
+
The Soft MoE routing algorithm is depicted in Figure 2. We denote the inputs tokens for one sequence by $\mathbf { X } \in \mathbb { R } ^ { m \times d }$ , where $m$ is the number of tokens and $d$ is their dimension. Each MoE layer uses a set of $n$ expert functions1 applied on individual tokens, namely $\{ f _ { i } : \mathbb { R } ^ { d } \mathbb { R } ^ { d } \} _ { 1 : n }$ . Each expert processes $p$ slots, and each slot has a corresponding $d$ -dimensional vector of parameters, Φ ∈ Rd×(n·p).
|
| 33 |
+
|
| 34 |
+
In particular, the input slots $\tilde { \mathbf { X } } \in \mathbb { R } ^ { ( n \cdot p ) \times d }$ are the result of convex combinations of all the $m$ input tokens, $\mathbf { X }$ :
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\mathbf { D } _ { i j } = \frac { \exp ( ( \mathbf { X } \Phi ) _ { i j } ) } { \sum _ { i ^ { \prime } = 1 } ^ { m } \exp ( ( \mathbf { X } \Phi ) _ { i ^ { \prime } j } ) } , \qquad \tilde { \mathbf { X } } = \mathbf { D } ^ { \top } \mathbf { X } .
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
Notice that $\mathbf { D }$ , which we call the dispatch weights, is simply the result of applying a softmax over the columns of $\mathbf { X } \Phi$ . Then, as mentioned above, the corresponding expert function is applied on each slot (i.e. on rows of $\tilde { \mathbf { X } }$ ) to obtain the output slots: $\tilde { \mathbf { Y } } _ { i } = f _ { \lfloor i / p \rfloor } ( \tilde { \mathbf { X } } _ { i } )$ .
|
| 41 |
+
|
| 42 |
+
Finally, the output tokens $\mathbf { Y }$ are computed as a convex combination of all $( n \cdot p )$ output slots, $\tilde { \mathbf Y }$ , whose weights are computed similarly as before:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\mathbf { C } _ { i j } = \frac { \exp ( ( \mathbf { X } \pmb { \Phi } ) _ { i j } ) } { \sum _ { j ^ { \prime } = 1 } ^ { n \cdot p } \exp ( ( \mathbf { X } \pmb { \Phi } ) _ { i j ^ { \prime } } ) } , \qquad \mathbf { Y } = \mathbf { C } \tilde { \mathbf { Y } } .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
We refer to $\mathbf { C }$ as the combine weights, and it is the result of applying a softmax over the rows of $\mathbf { X } \Phi$
|
| 49 |
+
|
| 50 |
+
Following the usual design for Sparse MoEs, we replace a subset of the Transformer’s MLP blocks with Soft MoE blocks. We typically replace the second half of MLP blocks. The total number of slots is a key hyperparameter of Soft MoE layers because the time complexity depends on the number of slots rather than on the number of experts. One can set the number of slots equal to the input sequence length to match the FLOPs of the equivalent dense Transformer.
|
| 51 |
+
|
| 52 |
+
# 2.2 PROPERTIES OF SOFT MOE AND CONNECTIONS WITH SPARSE MOES
|
| 53 |
+
|
| 54 |
+
Fully differentiable Sparse MoE algorithms involve an assignment problem between tokens and experts, which is subject to capacity and load-balancing constraints. Different algorithms approximate the solution in different ways: for example, the top- $k$ or “Token Choice” router (Shazeer et al., 2017;
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: Soft MoE routing details. Soft MoE computes scores or logits for every pair of input token and slot. From this it computes a slots $\times$ tokens matrix of logits, that are normalized appropriately to compute both the dispatch and combine weights. The slots themselves are allocated to experts round-robin.
|
| 58 |
+
Algorithm 1: Simple JAX (Bradbury et al., 2018) implementation of a Soft MoE layer. Full code is available at https://github.com/google-research/vmoe.
|
| 59 |
+
|
| 60 |
+
Lepikhin et al., 2020; Riquelme et al., 2021) selects the top- $k$ -scored experts for each token, while there are slots available in such expert (i.e. the expert has not filled its capacity). The “Expert Choice” router (Zhou et al., 2022) selects the top-capacity-scored tokens for each expert. Other works suggest more advanced (and often costly) algorithms to compute the assignments, such as approaches based on Linear Programming algorithms (Lewis et al., 2021), Optimal Transport (Liu et al., 2022; Clark et al., 2022) or Reinforcement Learning (Clark et al., 2022). Nevertheless virtually all of these approaches are discrete in nature, and thus non-differentiable. In contrast, all operations in Soft MoE layers are continuous and fully differentiable. We can interpret the weighted averages with softmax scores as soft assignments, rather than the hard assignments used in Sparse MoE.
|
| 61 |
+
|
| 62 |
+
def soft_moe_layer(X, Phi, experts):
|
| 63 |
+
2 # Compute the dispatch and combine weights.
|
| 64 |
+
logits $=$ jnp.einsum(’md,dnp->mnp’, X, Phi)
|
| 65 |
+
4 $\begin{array} { r l } { \mathrm { D } } & { { } = } \end{array}$ jax.nn.softmax(logits, axis $=$ (0,))
|
| 66 |
+
5 ${ \mathrm { ~ \small ~ \mathscr ~ { ~ C ~ } ~ } } =$ jax.nn.softmax(logits, axis $=$ (1, 2))
|
| 67 |
+
6 # The input slots are a weighted average of all the input tokens,
|
| 68 |
+
# given by the dispatch weights.
|
| 69 |
+
8 $\begin{array} { r l } { \mathrm { X } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } } & { { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } } \end{array}$ jnp.einsum(’md,mnp->npd’, X, D)
|
| 70 |
+
9 # Apply the corresponding expert function to each input slot.
|
| 71 |
+
10 Ys = jnp.stack([
|
| 72 |
+
11 f_i(Xs[i, :, :]) for i, f_i in enumerate(experts)],
|
| 73 |
+
12 axis ${ } = 0$ )
|
| 74 |
+
13 # The output tokens are a weighted average of all the output slots,
|
| 75 |
+
14 # given by the combine weights.
|
| 76 |
+
15 $\begin{array} { r l } { \mathrm { Y } } & { { } = } \end{array}$ jnp.einsum(’npd,mnp->md’, Ys, C)
|
| 77 |
+
16 return Y
|
| 78 |
+
|
| 79 |
+
No token dropping and expert unbalance The classical routing mechanisms tend to suffer from issues such as “token dropping” (i.e. some tokens are not assigned to any expert), or “expert unbalance” (i.e. some experts receive far more tokens than others). Unfortunately, performance can be severely impacted as a consequence. For instance, the popular top- $k$ or “Token Choice” router (Shazeer et al., 2017) suffers from both, while the “Expert Choice” router (Zhou et al., 2022) only suffers from the former (see Appendix B for some experiments regarding dropping). Soft MoEs are immune to token dropping and expert unbalance since every slot is filled with a weighted average of all tokens.
|
| 80 |
+
|
| 81 |
+
Fast The total number of slots determines the cost of a Soft MoE layer. Every input applies such number of MLPs. The total number of experts is irrelevant in this calculation: few experts with many slots per expert or many experts with few slots per expert will have matching costs if the total number of slots is identical. The only constraint we must meet is that the number of slots has to be greater or equal to the number of experts (as each expert must process at least one slot). The main advantage of Soft MoE is completely avoiding sort or top- $k$ operations which are slow and typically not well suited for hardware accelerators. As a result, Soft MoE is significantly faster than most sparse MoEs (Figure 6). See Section 2.3 for time complexity details.
|
| 82 |
+
|
| 83 |
+
Features of both sparse and dense The sparsity in Sparse MoEs comes from the fact that expert parameters are only applied to a subset of the input tokens. However, Soft MoEs are not technically sparse, since every slot is a weighted average of all the input tokens. Every input token fractionally activates all the model parameters. Likewise, all output tokens are fractionally dependent on all slots (and experts). Finally, notice also that Soft MoEs are not Dense MoEs, where every expert processes all input tokens, since every expert only processes a subset of the slots.
|
| 84 |
+
|
| 85 |
+
Per-sequence determinism Under capacity constraints, all Sparse MoE approaches route tokens in groups of a fixed size and enforce (or encourage) balance within the group. When groups contain tokens from different sequences or inputs, these tokens compete for available spots in expert buffers. Therefore, the model is no longer deterministic at the sequence-level, but only at the batch-level. Models using larger groups tend to provide more freedom to the routing algorithm and usually perform better, but their computational cost is also higher.
|
| 86 |
+
|
| 87 |
+
# 2.3 IMPLEMENTATION
|
| 88 |
+
|
| 89 |
+
Time complexity Assume the per-token cost of a single expert function is $O ( k )$ . The time complexity of a Soft MoE layer is then $O ( m n p d + n p k )$ . By choosing $p = { \cal { O } } ( m / n )$ slots per expert, i.e. the number of tokens over the number of experts, the cost reduces to $O ( m ^ { 2 } d + m k )$ . Given that each expert function has its own set of parameters, increasing the number of experts $n$ and scaling $p$ accordingly, allows us to increase the total number of parameters without any impact on the time complexity. Moreover, when the cost of applying an expert is large, the mk term dominates over $m ^ { 2 } d$ , and the overall cost of a Soft MoE layer becomes comparable to that of applying a single expert on all the input tokens. Finally, even when $m ^ { 2 } d$ is not dominated, this is the same as the (single-headed) self-attention cost, thus it does not become a bottleneck in Transformer models. This can be seen in the bottom plot of Figure 6 where the throughput of Soft MoE barely changes when the number of experts increases from 8 to 4 096 experts, while Sparse MoEs take a significant hit.
|
| 90 |
+
|
| 91 |
+
Normalization In Transformers, MoE layers are typically used to replace the feedforward layer in each encoder block. Thus, when using pre-normalization as most modern Transformer architectures (Domhan, 2018; Xiong et al., 2020; Riquelme et al., 2021; Fedus et al., 2022), the inputs to the MoE layer are “layer normalized”. This causes stability issues when scaling the model dimension $d$ , since the softmax approaches a one-hot vector as $d \to \infty$ (see Appendix E). Thus, in Line 3 of algorithm 1 we replace X and Phi with l2_normalize(X, axi $\gimel = 1$ ) and scale $\star$ l2_normalize(Phi, axi $\mathtt { S } = 0$ ), respectively; where scale is a trainable scalar, and l2_normalize normalizes the corresponding axis to have unit (L2) norm, as Algorithm 2 shows.
|
| 92 |
+
|
| 93 |
+
Algorithm 2: JAX implementation of the L2 normalization used in Soft MoE layers.
|
| 94 |
+
|
| 95 |
+
For relatively small values of $d$ , the normalization has little impact on the model’s quality. However, with the proposed normalization in the Soft MoE layer, we can make the model dimension bigger and/or increase the learning rate (see Appendix E).
|
| 96 |
+
|
| 97 |
+
Distributed model When the number of experts increases significantly, it is not possible to fit the entire model in memory on a single device, especially during training or when using MoEs on top of large model backbones. In these cases, we employ the standard techniques to distribute the model across many devices, as in (Lepikhin et al., 2020; Riquelme et al., 2021; Fedus et al., 2022) and other works training large MoE models. Distributing the model typically adds an overhead in the cost of the model, which is not captured by the time complexity analysis based on FLOPs that we derived above. In order to account for this difference, in all of our experiments we measure not only the FLOPs, but also the wall-clock time in TPUv3-chip-hours.
|
| 98 |
+
|
| 99 |
+
# 3 IMAGE CLASSIFICATION EXPERIMENTS
|
| 100 |
+
|
| 101 |
+
Training Pareto frontiers. In Section 3.3 we compare dense ViT models at the Small, Base, Large and Huge sizes with their dense and sparse counterparts based on both Tokens Choice and Experts Choice sparse routing. We study performance at different training budgets and show that Soft MoE dominates other models in terms of performance at a given training cost or time.
|
| 102 |
+
|
| 103 |
+
Inference-time optimized models. In Section 3.4, we present longer training runs (“overtraining”). Relative to ViT, Soft MoE brings large improvements in terms of inference speed for a fixed performance level (smaller models: S, B) and absolute performance (larger models: L, H).
|
| 104 |
+
|
| 105 |
+
Model ablations. In Sections 3.5 and 3.6 we investigate the effect of changing slot and expert counts, and perform ablations on the Soft MoE routing algorithm.
|
| 106 |
+
|
| 107 |
+
# 3.1 TRAINING AND EVALUATION DATA
|
| 108 |
+
|
| 109 |
+
We pretrain our models on JFT-4B (Zhai et al., 2022a), a proprietary dataset that contains more than 4B images, covering 29k classes. During pretraining, we evaluate the models on two metrics: upstream validation precision-at-1 on JFT-4B, and ImageNet 10-shot accuracy. The latter is computed by freezing the model weights and replacing the head with a new one that is only trained on a dataset containing 10 images per class from ImageNet-1k (Deng et al., 2009). Finally, we provide the accuracy on the validation set of ImageNet-1k after finetuning on the training set of ImageNet-1k (1.3 million images) at 384 resolution.
|
| 110 |
+
|
| 111 |
+
# 3.2 SPARSE ROUTING ALGORITHMS
|
| 112 |
+
|
| 113 |
+
Tokens Choice. Every token selects the top- $K$ experts with the highest routing score for the token (Shazeer et al., 2017). Increasing $K$ typically leads to better performance at increased computational cost. Batch Priority Routing (BPR) (Riquelme et al., 2021) significantly improves the model performance, especially in the case of $K = 1$ (Appendix F, Table 7). Accordingly we use Top- $K$ routing with BPR and $\dot { K } \in \{ 1 , 2 \}$ . We also optimize the number of experts (Appendix F, Figure 11).
|
| 114 |
+
|
| 115 |
+
Experts Choice. Alternatively, experts can select the top- $C$ tokens in terms of routing scores (Zhou et al., 2022). $C$ is the buffer size, and we set $E \cdot C = c \cdot T$ where $E$ is the number of experts, $T$ is the total number of tokens in the group, and $c$ is the capacity multiplier. When $c = 1$ , all tokens can be processed via the union of experts. With Experts Choice routing, it is common that some tokens are simultaneously selected by several experts whereas some other tokens are not selected at all. Figure 10, Appendix B illustrates this phenomenon. We experiment with $c = 0 . 5 , 1 , 2$ .
|
| 116 |
+
|
| 117 |
+
# 3.3 TRAINING PARETO-OPTIMAL MODELS
|
| 118 |
+
|
| 119 |
+
We trained ViT-{S/8, S/16, S/32, B/16, B/32, L/16, L/32, H/14} models and their sparse counterparts. We trained several variants (varying $K$ , $C$ and expert number), totalling 106 models. We trained for 300k steps with batch size 4096, resolution 224, using a reciprocal square root learning rate schedule.
|
| 120 |
+
|
| 121 |
+
Figures 3a and 3b show the results for models in each class that lie on their respective training cost/performance Pareto frontiers. On both metrics, Soft MoE strongly outperforms dense and other sparse approaches for any given FLOPs or time budget. Table 9, Appendix J, lists all the models, with their parameters, performance and costs, which are all displayed in Figure 19.
|
| 122 |
+
|
| 123 |
+
# 3.4 LONG TRAINING DURATIONS
|
| 124 |
+
|
| 125 |
+
We trained a number of models for much longer durations, up to 4M steps. We trained a number of Soft MoEs on JFT, following a similar setting to Zhai et al. (2022a). We replace the last half of the blocks in ViT S/16, B/16, L/16, and H/14 with Soft MoE layers with 128 experts, using one slot per expert. We train models ranging from 1B to 54B parameters. All models were trained for 4M steps, except for H/14, which was trained for 2M steps for cost reasons.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: Train Pareto frontiers. Soft MoE dominates both ViTs (dense) and popular MoEs (Experts and Tokens Choice) on the training cost / performance Pareto frontier. Larger marker sizes indicate larger models, ranging from S/32 to H/14. Cost is reported in terms of FLOPS and TPU-v3 training time. Only models on their Pareto frontier are displayed, Appendix F shows all models trained.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 4: Models with long training durations. Models trained for 4M steps (H/14 trained only for 2M steps). Equivalent model classes (S/16, B/16, etc.) have similar training costs, but Soft MoE outperforms ViT on all metrics at a fixed training budget.
|
| 132 |
+
|
| 133 |
+
Figure 4 shows the JFT-4B precision, ImageNet 10-shot accuracy, and the ImageNet finetuning accuracy for Soft MoE and ViT versus training cost. Appendix F, Table 8 contains numerical results, and Figure 16 shows performance versus core-hours, from which the same conclusions can be drawn. Soft MoE substantially outperforms dense ViT models for a given compute budget. For example, the Soft MoE S/16 performs better than ViT B/16 on JFT and 10-shot ImageNet, and it also improves finetuning scores on the full ImageNet data, even though its training (and inference) cost is significantly smaller. Similarly, Soft MoE B/16 outperforms ViT L/16 upstream, and only lags 0.5 behind after finetuning while being $3 \mathbf { x }$ faster and requiring almost $4 \mathbf { x }$ fewer FLOPs. Finally, the Soft MoE L/16 model outperforms the dense $\mathrm { H } / 1 4$ one while again being around $3 \mathbf { x }$ faster in terms of training and inference step time.
|
| 134 |
+
|
| 135 |
+
We continue training the small backbones up to 9M steps to obtain models of high quality with low inference cost. Even after additional (over) training, the overall training time with respect to larger ViT models is similar or smaller. For these runs, longer cooldowns (linear learning rate decay) works well for Soft MoE. Therefore, we increase the cooldown from 50k steps to 500k steps.
|
| 136 |
+
|
| 137 |
+
Figure 5 and Table 1 present the results. Soft MoE B/16 trained for 1k TPUv3 days matches or outperforms ViT H/14 trained on a similar budget, and is $\mathbf { 1 0 \times }$ cheaper at inference in FLOPs (32 vs. 334 GFLOPS/img) and $> 5 \times$ cheaper in wall-clock time (1.5 vs. 8.6 ms/img). Soft MoE B/16 matches the ViT H/14 model’s performance when we double ViT-H/14’s training budget (to 2k TPUdays). Soft MoE L/16 outperforms all ViT models while being almost $2 \times$ faster at inference than ViT H/14 (4.8 vs. 8.6 ms/img).
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 5: Models optimized for inference speed. Performance of models trained for more steps, thereby optimized for performance at a given inference cost (TPUv3 time or FLOPs).
|
| 141 |
+
|
| 142 |
+
Table 1: Models trained for longer durations (cooldown steps in parentheses).
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Model</td><td>Params</td><td>Train</td><td>Train steps (cd) TPU-days exaFLOP ms/img GFLOP/img</td><td>Train</td><td>Eval</td><td>Eval</td><td>JFT @1 P@1</td><td>INet 10shot finetune</td><td>INet</td></tr><tr><td>ViT S/16</td><td>33M</td><td>4M (50k)</td><td>153.5</td><td>227.1</td><td>0.5</td><td>9.2</td><td>51.3</td><td>67.6</td><td>84.0</td></tr><tr><td>ViT B/16</td><td>108M</td><td>4M(50k)</td><td>410.1</td><td>864.1</td><td>1.3</td><td>35.1</td><td>56.2</td><td>76.8</td><td>86.6</td></tr><tr><td>ViT L/16</td><td>333M</td><td>4M (50k)</td><td>1290.1</td><td>3025.4</td><td>4.9</td><td>122.9</td><td>59.8</td><td>81.5</td><td>88.5</td></tr><tr><td>ViT H/14</td><td>669M</td><td>1M (50k)</td><td>1019.9</td><td>2060.2</td><td>8.6</td><td>334.2</td><td>58.8</td><td>82.7</td><td>88.6</td></tr><tr><td>ViTH/14</td><td>669M</td><td>2M(50k)</td><td>2039.8</td><td>4120.3</td><td>8.6</td><td>334.2</td><td>59.7</td><td>83.3</td><td>88.9</td></tr><tr><td>Soft MoE S/14 256E</td><td></td><td>1.8B 10M (50k)</td><td>494.7</td><td>814.2</td><td>0.9</td><td>13.2</td><td>60.1</td><td>80.6</td><td>87.5</td></tr><tr><td>Soft MoE B/16 128E</td><td></td><td>3.7B9M (500k)</td><td>1011.4</td><td>1769.5</td><td>1.5</td><td>32.0</td><td>62.4</td><td>82.9</td><td>88.5</td></tr><tr><td>Soft MoE L/16 128E</td><td></td><td>13.1B 4M (500k)</td><td>1355.4</td><td>2734.1</td><td>4.8</td><td>111.1</td><td>63.0</td><td>84.3</td><td>89.2</td></tr></table>
|
| 145 |
+
|
| 146 |
+
# 3.5 NUMBER OF SLOTS AND EXPERTS
|
| 147 |
+
|
| 148 |
+
We study the effect of changing the number of slots and experts in the Sparse and Soft MoEs. Figure 6 shows the quality and speed of MoEs with different numbers of experts, and numbers of slots per token; the latter is equivalent to the average number of experts assigned per token for Sparse MoEs. When varying the number of experts, the models’ backbone FLOPs remain constant, so changes in speed are due to routing costs. When varying the slots-per-expert, the number of tokens processed in the expert layers increases, so the throughput decreases. First, observe that for Soft MoE, the best performing model at each number of slots-per-token is the model with the most experts (i.e. one slot per expert). For the two Sparse MoEs, there is a point at which training difficulties outweigh the benefits of additional capacity, resulting in the a modest optimum number of experts. Second, Soft MoE’s throughput is approximately constant when adding more experts. However, the Sparse MoEs’ throughputs reduce dramatically from 1k experts, see discussion in Section 2.2.
|
| 149 |
+
|
| 150 |
+
# 3.6 ABLATIONS
|
| 151 |
+
|
| 152 |
+
We study the impact of the components of the Soft MoE routing layer by running the following ablations: Identity routing: Tokens are not mixed: the first token goes to first expert, the second token goes to second expert, etc. Uniform Mixing: Every slot mixes all input tokens in the same way: by averaging them, both for dispatching and combining. Expert diversity arises from different initializations of their weights. Soft / Uniform: We learn token mixing on input to the experts to create the slots (dispatch weights), but we average the expert outputs. This implies every input token is identically updated before the residual connection. Uniform / Soft. All slots are filled with a uniform average of the input tokens. We learn slot mixing of the expert output tokens depending on the input tokens. Table 2 shows that having slots is important; Identity and Uniform routing substantially underperform Soft MoE, although they do outperform ViT. Dispatch mixing appears slightly more important than the combine mixing. See Appendix A for additional details.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 6: Top: Performance (ImageNet) for MoEs with different number of experts (columns) and slots-per-token / assignments-per-token (rows). Bottom: Training throughput of the same models. Across the columns, the number of parameters increases, however, the theoretical cost (FLOPS) for the model (not including routing cost) remains constant. Descending the rows, the expert layers become more compute intensive as more tokens/slots are processed in the MoE layers.
|
| 156 |
+
|
| 157 |
+
Table 2: Ablations using Soft MoE-S/14 with 256 experts trained for $3 0 0 \mathrm { k }$ steps.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Method</td><td>Experts</td><td>Mixing</td><td>Learned Dispatch</td><td>Learned Combine</td><td>JFT p@1</td><td>IN/10shot</td></tr><tr><td>SoftMoE</td><td>>></td><td>>></td><td>>></td><td>√</td><td>54.3%</td><td>74.8%</td></tr><tr><td>Soft /Uniform</td><td></td><td></td><td></td><td></td><td>53.6%</td><td>72.0%</td></tr><tr><td>Uniform /Soft</td><td>√</td><td>√</td><td></td><td>√</td><td>52.6%</td><td>71.8%</td></tr><tr><td>Uniform</td><td>√</td><td>√</td><td></td><td></td><td>51.8%</td><td>70.0%</td></tr><tr><td>Identity</td><td>√</td><td></td><td></td><td></td><td>51.5%</td><td>69.1%</td></tr><tr><td>ViT</td><td></td><td></td><td></td><td></td><td>48.3%</td><td>62.3%</td></tr></table>
|
| 160 |
+
|
| 161 |
+
# 4 CONTRASTIVE LEARNING
|
| 162 |
+
|
| 163 |
+
We test whether the Soft MoE’s representations are better for other tasks. For this, we try imagetext contrastive learning. Following Zhai et al. (2022b), the image tower is pre-trained on image classification, and then frozen while training the text encoder on a dataset of image-text pairs. We re-use the models trained on JFT in the previous section and compare their performance zero-shot on downstream datasets. For contrastive learning we train on WebLI (Chen et al., 2022), a proprietary dataset consisting of 10B images and alt-texts. The image encoder is frozen, while the text encoder is trained from scratch.
|
| 164 |
+
|
| 165 |
+
Table 3 shows the results. Overall, the benefits we observed on image classification are also in this setting. For instance, Soft MoE-L/16 outperforms ViT-L/16 by more than $1 \%$ and $2 \%$ on ImageNet and Cifar-100 zero-shot, respectively. However, the improvement on COCO retrieval are modest, and likely reflects the poor alignment between features learned on closed-vocabulary JFT and this open-vocabulary task.
|
| 166 |
+
|
| 167 |
+
Finally, in Appendix F.1 we show that Soft MoEs also surpass vanilla ViT and the Experts Choice router when trained from scratch on the publicly available LAION-400M (Schuhmann et al., 2021). With this pretraining, Soft MoEs also benefit from data augmentation, but neither ViT nor Experts Choice seem to benefit from it, which is consistent with our observation in Section 3.5, that Soft MoEs make a better use of additional expert parameters.
|
| 168 |
+
|
| 169 |
+
Table 3: LIT-style evaluation with a ViT- $\mathbf { g }$ text tower trained for 18B input images ( $\sim 5$ epochs).
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Model Experts IN/Oshot Cifar100/0shot Pet/Oshot Coco Img2Text Coco Text2Img</td></tr><tr><td>ViT-S/16 1 74.2% 56.6% 94.8%</td></tr><tr><td>53.6% 37.0% Soft MoE-S/16 128 81.2% 67.2% 96.6% 56.0%</td></tr><tr><td>39.0% Soft MoE-S/14 256 82.0% 75.1% 97.1% 56.5% 39.4%</td></tr><tr><td>ViT-B/16 79.6% 71.0% 96.4% 58.2% 41.5%</td></tr><tr><td>1 SoftMoE-B/16 128 82.5% 74.4% 97.6% 58.3% 41.6%</td></tr><tr><td>ViT-L/16</td></tr><tr><td>1 82.7% 77.5% 97.1% 60.7% 43.3% Soft MoE-L/16 128 83.8% 79.9% 97.3% 60.9% 43.4%</td></tr><tr><td>Souped Soft MoE-L/16 128 84.3% 81.3% 97.2% 61.1% 44.5%</td></tr><tr><td>ViT-H/14 1 83.8% 84.7% 97.5% 62.7% 45.2%</td></tr><tr><td>Soft MoE-H/14 256 84.6% 86.3% 97.4% 61.0% 44.8%</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 5 RELATED WORK
|
| 174 |
+
|
| 175 |
+
Many existing works merge, mix or fuse input tokens to reduce the input sequence length (Jaegle et al., 2021; Ryoo et al., 2021; Renggli et al., 2022; Wang et al., 2022), typically using attention-like weighted averages with fixed keys, to try to alleviate the quadratic cost of self-attention with respect to the sequence length. Although our dispatch and combine weights are computed in a similar fashion to these approaches, our goal is not to reduce the sequence length (while it is possible), and we actually recover the original sequence length after weighting the experts’ outputs with the combine weights, at the end of each Soft MoE layer.
|
| 176 |
+
|
| 177 |
+
Multi-headed attention also shows some similarities with Soft MoE, beyond the use of softmax in weighted averages: the $h$ different heads can be interpreted as different (linear) experts. The distinction is that, if $m$ is the sequence length and each input token has dimensionality $d$ , each of the $h$ heads processes $m$ vectors of size $d / \bar { h }$ . The $m$ resulting vectors are combined using different weights for each of the $m ^ { \prime }$ output tokens (i.e. the attention weights), on each head independently, and then the resulting $( d / h )$ -dimensional vectors from each head are concatenated into one of dimension $d$ . Our experts are non-linear and combine vectors of size $d$ , at the input and output of such experts.
|
| 178 |
+
|
| 179 |
+
Other MoE works use a weighted combination of the experts parameters, rather than doing a sparse routing of the examples (Yang et al., 2019; Tian et al., 2020; Muqeeth et al., 2023). These approaches are also fully differentiable, but they can have a higher cost, since 1) they must average the parameters of the experts, which can become a time and/or memory bottleneck when experts with many parameters are used; and 2) they cannot take advantage of vectorized operations as broadly as Soft (and Sparse) MoEs, since every input uses a different weighted combination of the parameters. We recommend the “computational cost” discussion in Muqeeth et al. (2023).
|
| 180 |
+
|
| 181 |
+
# 6 CURRENT LIMITATIONS
|
| 182 |
+
|
| 183 |
+
Auto-regressive decoding One of the key aspects of Soft MoE consists in learning the merging of all tokens in the input. This makes the use of Soft MoEs in auto-regressive decoders difficult, since causality between past and future tokens has to be preserved during training. Although causal masks used in attention layers could be used, one must be careful to not introduce any correlation between token and slot indices, since this may bias which token indices each expert is trained on. The use of Soft MoE in auto-regressive decoders is a promising research avenue that we leave for future work.
|
| 184 |
+
|
| 185 |
+
Lazy experts & memory consumption We show in Section 3 that one slot per expert tends to be the optimal choice. In other words, rather than feeding one expert with two slots, it is more effective to use two experts with one slot each. We hypothesize slots that use the same expert tend to align and provide small informational gains, and a expert may lack the flexibility to accommodate very different slot projections. We show this in Appendix I. Consequently, Soft MoE can leverage a large number of experts and—while its cost is still similar to the dense backbone—the memory requirements of the model can grow large.
|
| 186 |
+
|
| 187 |
+
REFERENCES
|
| 188 |
+
Emmanuel Bengio, Pierre-Luc Bacon, Joelle Pineau, and Doina Precup. Conditional computation in neural networks for faster models. arXiv preprint arXiv:1511.06297, 2015.
|
| 189 |
+
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, et al. JAX: composable transformations of Python $^ +$ NumPy programs, 2018.
|
| 190 |
+
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 preprint arXiv:2209.06794, 2022.
|
| 191 |
+
Aidan Clark, Diego De Las Casas, Aurelia Guy, Arthur Mensch, Michela Paganini, Jordan Hoffmann, Bogdan Damoc, Blake Hechtman, Trevor Cai, Sebastian Borgeaud, et al. Unified scaling laws for routed language models. In International Conference on Machine Learning, pages 4057–4086. PMLR, 2022.
|
| 192 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 193 |
+
Tobias Domhan. How much attention do you need? a granular analysis of neural machine translation architectures. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1799–1808, 2018.
|
| 194 |
+
William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. The Journal of Machine Learning Research, 23(1): 5232–5270, 2022.
|
| 195 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249–256. JMLR Workshop and Conference Proceedings, 2010.
|
| 196 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pages 1026–1034, 2015.
|
| 197 |
+
Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022.
|
| 198 |
+
Andrew Jaegle, Felix Gimeno, Andy Brock, Oriol Vinyals, Andrew Zisserman, and Joao Carreira. Perceiver: General perception with iterative attention. In International conference on machine learning, pages 4651–4664. PMLR, 2021.
|
| 199 |
+
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
|
| 200 |
+
Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. Advances in neural information processing systems, 30, 2017.
|
| 201 |
+
Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668, 2020.
|
| 202 |
+
Mike Lewis, Shruti Bhosale, Tim Dettmers, Naman Goyal, and Luke Zettlemoyer. Base layers: Simplifying training of large, sparse models. In International Conference on Machine Learning, pages 6265–6274. PMLR, 2021.
|
| 203 |
+
Tianlin Liu, Joan Puigcerver, and Mathieu Blondel. Sparsity-constrained optimal transport. arXiv preprint arXiv:2209.15466, 2022.
|
| 204 |
+
Mohammed Muqeeth, Haokun Liu, and Colin Raffel. Soft merging of experts with adaptive routing, 2023.
|
| 205 |
+
Basil Mustafa, Carlos Riquelme, Joan Puigcerver, Rodolphe Jenatton, and Neil Houlsby. Multimodal contrastive learning with limoe: the language-image mixture of experts. arXiv preprint arXiv:2206.02770, 2022.
|
| 206 |
+
Cedric Renggli, André Susano Pinto, Neil Houlsby, Basil Mustafa, Joan Puigcerver, and Carlos Riquelme. Learning to merge tokens in vision transformers. arXiv preprint arXiv:2202.12015, 2022.
|
| 207 |
+
Carlos Riquelme, Joan Puigcerver, Basil Mustafa, Maxim Neumann, Rodolphe Jenatton, André Susano Pinto, Daniel Keysers, and Neil Houlsby. Scaling vision with sparse mixture of experts. Advances in Neural Information Processing Systems, 34:8583–8595, 2021.
|
| 208 |
+
Stephen Roller, Sainbayar Sukhbaatar, Jason Weston, et al. Hash layers for large sparse models. Advances in Neural Information Processing Systems, 34:17555–17566, 2021.
|
| 209 |
+
Michael S Ryoo, AJ Piergiovanni, Anurag Arnab, Mostafa Dehghani, and Anelia Angelova. Tokenlearner: What can 8 learned tokens do for images and videos? arXiv preprint arXiv:2106.11297, 2021.
|
| 210 |
+
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.
|
| 211 |
+
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538, 2017.
|
| 212 |
+
Zhi Tian, Chunhua Shen, and Hao Chen. Conditional convolutions for instance segmentation. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part I 16, pages 282–298. Springer, 2020.
|
| 213 |
+
Yikai Wang, Xinghao Chen, Lele Cao, Wenbing Huang, Fuchun Sun, and Yunhe Wang. Multimodal token fusion for vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 12186–12195, June 2022.
|
| 214 |
+
Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tieyan Liu. On layer normalization in the transformer architecture. In International Conference on Machine Learning, pages 10524–10533. PMLR, 2020.
|
| 215 |
+
Brandon Yang, Gabriel Bender, Quoc V Le, and Jiquan Ngiam. Condconv: Conditionally parameterized convolutions for efficient inference. Advances in Neural Information Processing Systems, 32, 2019.
|
| 216 |
+
Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12104–12113, 2022a.
|
| 217 |
+
Xiaohua Zhai, Xiao Wang, Basil Mustafa, Andreas Steiner, Daniel Keysers, Alexander Kolesnikov, and Lucas Beyer. Lit: Zero-shot transfer with locked-image text tuning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 18123–18133, 2022b.
|
| 218 |
+
Yanqi Zhou, Tao Lei, Hanxiao Liu, Nan Du, Yanping Huang, Vincent Zhao, Andrew M Dai, Quoc V Le, James Laudon, et al. Mixture-of-experts with expert choice routing. Advances in Neural Information Processing Systems, 35:7103–7114, 2022.
|
md/test/nKvGCUoiuW/nKvGCUoiuW.md
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MINIGPT-V2: LARGE LANGUAGE MODEL AS A UNIFIED INTERFACE FOR VISION-LANGUAGE MULTITASK LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Large language models have shown their remarkable capabilities as a general interface for various language-related applications. Motivated by this, we target to build a unified interface for completing many vision-language tasks including image description, visual question answering, and visual grounding, among others. The challenge for achieving this is to use a single model for performing diverse vision-language tasks effectively with simple multi-modal instructions. To address this issue, we introduce MiniGPT-v2, a model can be treated a unified interface for better handling various vision-language tasks. We propose using unique identifiers for different tasks when training the model. These identifiers enable our model to distinguish each task instruction effortlessly and also improve the model learning efficiency for each task. After our three-stage training, the experimental results show that MiniGPT-v2 achieves strong performance on many visual question answering and visual grounding benchmarks compared to other vision-language generalist models. Our trained models and codes will be made available.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Multi-modal Large Language Models (LLMs) have emerged as an exciting research topic with a rich set of applications in vision-language community, such as visual AI assistant, image captioning, visual question answering (VQA), and referring expression comprehension (REC). A key feature of multimodal large language models is that they can inherit advanced capabilities (e.g., logical reasoning, common sense, and strong language expression) from the LLMs (OpenAI, 2022; Touvron et al., 2023a;b; Chiang et al., 2023). When tuned with proper vision-language instructions, multi-modal LLMs, specifically vision-language models, demonstrate strong capabilities such as producing detailed image descriptions, generating code, localizing the visual objects in the image, and even perform multi-modal reasoning to better answer complicated visual questions (Zhu et al., 2023b; Liu et al., 2023b; Ye et al., 2023; Wang et al., 2023b; Chen et al., 2023b; Dai et al., 2023; Zhu et al., 2023a; Chen et al., 2023a; Zhuge et al., 2023). This evolution of LLMs enables interactions of visual and language inputs across communication with individuals and has been shown quite effective for building visual chatbots.
|
| 12 |
+
|
| 13 |
+
However, learning to perform multiple vision-language tasks effectively and formulating their corresponding multi-modal instructions present considerable challenges due to the complexities inherent among different tasks. For instance, given a user input “tell me the location of a person”, there are many ways to interpret and respond based on the specific task. In the context of the referring expression comprehension task, it can be answered with one bounding box location of the person. For the visual question answering, the model might describe the spatial location using human natural language. For person detection, the model might identify every spatial location of a human being. To alleviate this issue, we propose a task-oriented instruction training scheme to reduce the multi-modal instructional ambiguity, and a vision-language model, MiniGPT-v2. Specifically, we provide an unique task identifier token for each task. For example, we provide a [vqa] identifier token for training all the data samples from the visual question answering tasks. In total, we provide six different task identifiers during the model training stages.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Our MiniGPT-v2 achieves state-of-the-art performances on a broad range of visionlanguage tasks compared with other generalist models.
|
| 17 |
+
|
| 18 |
+
Our model, MiniGPT-v2, has a simple architecture design. It directly takes the visual tokens from a ViT vision encoder (Fang et al., 2022) and project them into the feature space of a large language model (Touvron et al., 2023b). For better visual perception, we utilize high-resolution images $( 4 4 8 \mathrm { x } 4 4 8 )$ during training. But this will result in a larger number of visual tokens. To make the model training more efficient, we concatenate every four neighboring visual tokens into a single token, reducing the total number by $7 5 \%$ . Additionally, we utilize a three-stage training strategy to effectively train our model with a mixture of weakly-labeled, fine-grained image-text datasets, and multi-modal instructional datasets, with different training focus at each stage.
|
| 19 |
+
|
| 20 |
+
To evaluate the performance of our model, we conducted extensive experiments on diverse visionlanguage tasks, including (detailed) image/grounded captioning, vision question answering, and visual grounding. The results demonstrate that our MiniGPT-v2 can achieve SOTA or comparable performance on diverse benchmarks compared to previous vision-language generalist models, such as MiniGPT-4 (Zhu et al., 2023b), InstructBLIP (Dai et al., 2023), LLaVA (Liu et al., 2023b) and Shikra (Chen et al., 2023b). For example, our MiniGPT-v2 outperforms MiniGPT-4 by $2 1 . 7 \%$ , InstructBLIP by $1 1 . 2 \%$ , and LLaVA by $1 2 . 1 \%$ on the VSR benchmark (Liu et al., 2023a), and it also performs better than the previously established strong baseline, Shikra, in most validations on RefCOCO, RefCOCO+, and RefCOCOg. Our model establishes new state-of-the-art results on these benchmarks among vision-language generalist models, shown in Fig. 1.
|
| 21 |
+
|
| 22 |
+
# 2 RELATED WORK
|
| 23 |
+
|
| 24 |
+
We briefly review relevant works on Multi-task generalist models and multi-modal LLMs for visual aligning.
|
| 25 |
+
|
| 26 |
+
Multi-task generalist models. Recent years have witnessed significant advancements in visionlanguage learning, particularly in the development of multi-task generalist models (Hu & Singh, 2021; Yu et al., 2022; Lu et al., 2023; Singh et al., 2022; Zhang et al., 2021; Gan et al., 2020; Li et al., 2020; Yuan et al., 2021). These models act as versatile interfaces for a range of visionlanguage tasks. Unified I/O (Lu et al., 2022) integrates diverse tasks such as segmentation, depth estimation, and vision-language tasks. Florence (Yuan et al., 2021) expands the model training various representations, such as scene, object, images, videos, depths, and vision-language, via the web-scale image-text data training. BEIT-3 (Wang et al., 2022b) brings together various visionlanguage tasks through masked token prediction. FLAVA (Singh et al., 2022) pioneers a universal model by jointly pretraining on vision tasks, language tasks, and combined vision-language tasks.
|
| 27 |
+
|
| 28 |
+
ONE-PEACE (Wang et al., 2023a) aligns vision, language, and audio within a cohesive semantic framework. CLIP (Radford et al., 2021), Align Li et al. (2022), OpenCLIP (Ilharco et al., 2021), MetaCLIP (Xu et al., 2023a) align vision and language modalities in a shared semantic space, leveraging contrastive learning on extensive internet data.
|
| 29 |
+
|
| 30 |
+
Multi-modal large language model (LLM). Large language models (Radford et al., 2019; Devlin et al., 2018; Brown et al., 2020; OpenAI, 2022; Touvron et al., 2023a;b; Chowdhery et al., 2022; OpenAI, 2023) have achieved significant breakthroughs during the past few years. Their exceptional capabilities in generalization and representation have facilitated their expansion into the multi-modal domain by aligning visual inputs with LLMs. Initial efforts such as VisualGPT (Chen et al., 2022) and Frozen (Tsimpoukelli et al., 2021) used pre-trained language models to augment vision-language models for the image captioning and visual question answering. This initial exploration paved the way for subsequent vision-language research such as Flamingo (Alayrac et al., 2022) and BLIP-2 (Li et al., 2023b). More recently, GPT-4(V) (OpenAI, 2023) has been released and demonstrates many advanced multi-modal abilities, e.g., generating website code based on handwritten text instructions, based on its strong language model. Those demonstrated capabilities inspired other vision-language LLMs, including MiniGPT-4 (Zhu et al., 2023b), LLaVA (Liu et al., 2023b), mPLUG-Owl (Ye et al., 2023) and Otter Li et al. (2023a), which align the image inputs also with an advanced large language model with proper multi-modal instructional tuning. These vision-language models also showcase many advanced multi-modal capabilities similar to GPT-4(V). More recent developments include Vision-LLM (Wang et al., 2023b), Kosmos-2 (Peng et al., 2023), Shikra (Chen et al., 2023b), and our concurrent work, Qwen-VL (Bai et al., 2023). These models further explore visual grounding in the context of LLMs, pushing the boundaries of general multi-task vision-language modeling.
|
| 31 |
+
|
| 32 |
+
# 3 METHOD
|
| 33 |
+
|
| 34 |
+
In this section, we start by introducing our vision-language model, MiniGPT-v2, then discuss the basic idea of a multi-task instruction template with task identifier for training, and finally adapt our task identifier idea to achieve task-oriented instruction tuning.
|
| 35 |
+
|
| 36 |
+
# 3.1 MODEL ARCHITECTURE
|
| 37 |
+
|
| 38 |
+
Our proposed model architecture, MiniGPT-v2, is shown in Fig. 2. It consists of three components: a visual backbone, a linear projection layer, and a large language model. We describe each component as follows:
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 2: Architecture of MiniGPT-v2. The model takes a ViT visual backbone, which remains frozen during all training phases. We concatenate four adjacent visual output tokens from ViT backbone and project them into LLaMA-2 language model space via a linear projection layer.
|
| 42 |
+
|
| 43 |
+
Visual backbone. MiniGPT-v2 adapts the EVA (Fang et al., 2022) as our visual backbone model backbone. We freeze the visual backbone during the entire model training. We train our model with the image resolution $4 4 8 \mathrm { x } 4 4 8$ , and we interpolate the positional encoding to scale with higher image resolution.
|
| 44 |
+
|
| 45 |
+
Linear projection layer. We aim to project all the visual tokens from the frozen vision backbone into the language model space. However, for higher-resolution images such as $4 4 8 \mathrm { x } 4 4 8$ , projecting all the image tokens will result in a very long-sequence input (e.g., 1024 tokens) and significantly lowers the training and inference efficiency. To improve the efficiency, we simply concatenate 4 adjacent visual tokens in the embedding space and project them together into one single embedding in the same feature space of the large language model, thus reducing the number of visual input tokens by 4 times. With this operation, our MiniGPT-v2 can process high-resolution images much more efficiently during the training and inference stage.
|
| 46 |
+
|
| 47 |
+
Large language model. MiniGPT-v2 adopts the open-sourced LLaMA2-chat (7B) (Touvron et al., 2023b) as the language model backbone. In our work, the language model is treated as a unified interface for various vision-language inputs. We directly rely on the LLaMA-2 language tokens to perform various vision-language tasks. For the visual grounding tasks that necessitate the generation of spatial locations, we directly ask the language model to produce textual representations of bounding boxes to denote their spatial positions.
|
| 48 |
+
|
| 49 |
+
# 3.2 MULTI-TASK INSTRUCTION TEMPLATE
|
| 50 |
+
|
| 51 |
+
When training a single unified model for multiple different tasks such as visual question answering, image caption, referring expression, grounded image caption, and region identification, the multimodal model might fail to distinguish each task by just aligning visual tokens to language models. For instance, when you ask “Tell me the spatial location of the person wearing a red jacket?”, the model can either respond you the location in a bounding box format (e.g., $< \mathrm { X } _ { l e f t } > < \mathrm { Y } _ { t o p } > <$ ${ \mathrm { X } } _ { r i g h t } > < { \mathrm { Y } } _ { b o t t o m } > )$ or describe the object location using natural language (e.g., upper right corner). To reduce such ambiguity and make each task easily distinguishable, we introduce taskspecific tokens in our designed multi-task instruction template for training. We now describe our multi-task instruction template in more details.
|
| 52 |
+
|
| 53 |
+
General input format. We follow the LLaMA-2 conversation template design and adapt it for the multi-modal instructional template. The template is denoted as follows,
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
( I N S T J < I m g > < I m a g e F e a t u r e > < I I m g > ( T a s k ~ I d e n t i f i e r ] ~ I n s t r u c t i o n ~ [ / I N S T J ]
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
In this template, [INST] is considered as the user role, and [/INST] is considered as the assistant role. We structure the user input into three parts. The first part is the image features, the second part is the task identifier token, and the third part is the instruction input.
|
| 60 |
+
|
| 61 |
+
Task identifier tokens. Our model takes a distinct identifier for each task to reduce the ambiguity across various tasks. As illustrated in Table 1, we have proposed six different task identifiers for visual question answering, image caption, grounded image captioning, referring expression comprehension, referring expression generation, and phrase parsing and grounding respectively. For vision-irrelevant instructions, our model does not use any task identifier token.
|
| 62 |
+
|
| 63 |
+
<table><tr><td>Tasks</td><td>VQA</td><td>Caption</td><td>Grounded Caption</td><td>REC</td><td>REG</td><td>Object Parsing and Grounding</td></tr><tr><td>Identifiers</td><td>[vqa]</td><td>[caption]</td><td>[grounding]</td><td>[refer]</td><td>[identify]</td><td>[detection]</td></tr></table>
|
| 64 |
+
|
| 65 |
+
Table 1: Task identifier tokens for 6 different tasks, including visual question answering, image captioning, , grounded image captioning, referring expression comprehension (REC), referring expression generation (REG), and object parsing and grounding (where the model extracts objects from the input text and determines their bounding box locations).
|
| 66 |
+
|
| 67 |
+
Spatial location representation. For tasks such as referring expression comprehension (REC), referring expression generation (REG), and grounded image captioning, our model is required to identify their spatial location of objects accurately. We represent the spatial location through the textual formatting of bounding boxes in our setting and do not use any new vocabulary tokens, specifically: $\mathrm { { ' } } \bigcup \ { \mathrm { X } } _ { l e f t } \ > < { \bar { \mathrm { Y } } } _ { t o p } \ > < \ { \mathrm { X } } _ { r i g h t } \ > < \ { \mathrm { Y } } _ { b o t t o m } > \} ^ { , }$ . Coordinates for $\mathrm { X }$ and $\mathrm { Y }$ are represented by integer values normalized in the range [0,100]. $< X _ { l e f t } >$ and $< \Upsilon _ { t o p } >$ denote the $\mathbf { X }$ and y coordinate top-left corner of the generated bounding box, and $< \mathrm { X } _ { r i g h t } >$ and $< \Upsilon _ { b o t t o m } >$ denote the $\mathbf { X }$ and y coordinates of the bottom-right corner.
|
| 68 |
+
|
| 69 |
+
# 3.3 MULTI-TASK INSTRUCTION TRAINING
|
| 70 |
+
|
| 71 |
+
We now adapt our designed multi-task instruction template for instruction training. The basic idea is to take instruction with task-specific identifier token as input for task-oriented instruction training of MiniGPT-v2. When input instructions have task identifier tokens, our model will become more prone to multiple-task understanding during training. We train our model with task identifier instructions for better visual aligment in three stages. The first stage is to help MiniGPT-v2 build broad vision-language knowledge through many weakly-labeled image-text datasets, and highquality fine-grained vision-language annotation datasets as well (where we will assign a high data sampling ratio for weakly-labeled image-text datasets). The second stage is to improve the model with only fine-grained data for multiple tasks. The third stage is to finetune our model with more multi-modal instruction and language datasets for answering diverse multi-modal instructions better and behaving as a multi-modal chatbot. The datasets used for training at each stage are listed in the Table 2.
|
| 72 |
+
|
| 73 |
+
Table 2: The training datasets used for our model three-stage training.
|
| 74 |
+
|
| 75 |
+
<table><tr><td>Data types</td><td>Dataset</td><td>Stage1</td><td>Stage2</td><td>Stage3</td></tr><tr><td>Wround-la apton</td><td>GRIT-20M (REC and REG), LAION, CC3M, SBU</td><td></td><td></td><td>xxv</td></tr><tr><td></td><td></td><td><√</td><td>xx</td><td></td></tr><tr><td>Caption</td><td>COCO caption, TextCaps</td><td>√</td><td>√</td><td></td></tr><tr><td>REC</td><td>RefCOCO, RefCOCO+,RefCOCOg, Visual Genome</td><td>√</td><td>√</td><td>√</td></tr><tr><td>REG</td><td>RefCOCO, RefCOCO+,RefCOCOg</td><td>√</td><td>√</td><td>√</td></tr><tr><td>VQA</td><td>GQA, VQAV2, OCR-VQA, OK-VQA, AOK-VQA</td><td>√</td><td>√</td><td>√</td></tr><tr><td>Multimodal instruction</td><td>LLaVA dataset,Flickr3Ok,Multi-task conversation</td><td>X</td><td>X</td><td>√</td></tr><tr><td>Langauge dataset</td><td>Unnatural Instructions</td><td>X</td><td>X</td><td>I</td></tr></table>
|
| 76 |
+
|
| 77 |
+
Stage 1: Pretraining. To have broad vision-language knowledge, our model is trained on a mix of weakly-labeled and fine-grained datasets. We give a high sampling ratio for weakly-labeled datasets to gain more diverse knowledge in the first-stage.
|
| 78 |
+
|
| 79 |
+
For the weakly-labeled datasets, we use LAION (Schuhmann et al., 2021), CC3M (Sharma et al., 2018), SBU (Ordonez et al., 2011), and GRIT-20M from Kosmos v2 (Peng et al., 2023) that built the dataset for referring expression comprehension (REC), referring expression generation (REG), and grounded image captioning. The format for grounded image caption is represented like this: a $< p >$ wooden table $\cdot < p > \{ < X _ { l e f t } > < Y _ { t o p } > < X _ { r i g h t } > < Y _ { b o t t o m } > \}$ in the center of the room.
|
| 80 |
+
|
| 81 |
+
For fine-grained datasets, we use datasets like COCO caption (Lin et al., 2014) and TextCaps (Sidorov et al., 2020) for image captioning, RefCOCO (Kazemzadeh et al., 2014), Re$\mathrm { f C O C O + }$ (Yu et al., 2016), and $\operatorname { R e f C O C O g }$ (Mao et al., 2016) for REC. For REG, we restructured the data from ReferCOCO and its variants, reversing the order from phrase bounding boxes to bounding boxes phrase. For VQA datasets, our training takes a variety of datasets, such as GQA (Hudson & Manning, 2019), VQA-v2 (Goyal et al., 2017), OCR-VQA (Mishra et al., 2019), OK-VQA (Marino et al., 2019), and AOK-VQA (Schwenk et al., 2022).
|
| 82 |
+
|
| 83 |
+
Stage 2: Multi-task training. To improve the performance of MiniGPT-v2 on each task, we only focus on using fine-grained datasets to train our model at this stage. We exclude the weakly-supervised datasets such as GRIT-20M and LAION from stage-1 and update the data sampling ratio according to frequency of each task. This strategy enables our model to prioritize high-quality aligned imagetext data for superior performance across various tasks.
|
| 84 |
+
|
| 85 |
+
Stage 3: Multi-modal instruction tuning. Subsequently, we focus on tuning our model with more multi-modal instruction dataset and enhance its conversation ability as a chatbot. We continue using the datasets from the second stage, and add instructional datasets, including LLaVA (Liu et al., 2023b), Flickr30k dataset (Plummer et al., 2015), our constructed mixing multi-task dataset, and the language dataset, Unnatural Instruction (Honovich et al., 2022). We give a lower data sampling ratio for the fine-grained datasets from stage-2 and a higher data sampling ratio for the new instruction datasets.
|
| 86 |
+
|
| 87 |
+
– LLaVA instruction data. We add the multi-modal instruction tuning datasets, including the detailed descriptions and complex reasoning from LLaVA (Liu et al., 2023b), with 23k and 58k data examples respectively.
|
| 88 |
+
|
| 89 |
+
– Flicker $\mathbf { 3 0 k }$ . After the second-stage training, our MiniGPT-v2 can effectively generate the grounded image caption. Nevertheless, these descriptions tend to be short and often cover very few number of visual objects. This is because the GRIT-20M dataset from KOSMOS-v2 (Peng et al., 2023) that our model was trained with, features a limited number of grounded visual objects in each caption, and our model lacks proper multi-modal instruction tuning to teach it to recognize more visual objects. To improve this, we fine-tune our model using the Flickr30k dataset (Plummer et al., 2015), which provides more contextual grounding of entities within its captions.
|
| 90 |
+
|
| 91 |
+
We prepare the Flickr30k dataset in two distinct formats for training our model to perform grounded image caption and a new task “object parsing and grounding”:
|
| 92 |
+
|
| 93 |
+
1) Grounded image caption. We select captions with a minimum of five grounded phrases, containing around $3 \mathrm { k }$ samples, and we directly instruct the model to produce the grounded image caption. a $< p >$ wooden table ${ < } \boldsymbol { { J } } p > \{ { < } X _ { l e f t } > { < } Y _ { t o p } > { < } X _ { r i g h t } > { < } Y _ { b o t t o m } > \}$ in the center of the room. The format for grounded image caption is
|
| 94 |
+
|
| 95 |
+
2) Object parsing and grounding. This new task is to parse all the objects from an input caption and then ground each object. To enable this, we simply use the task identifier[detection] to differentiate this capability from other tasks. Also, we use Flickr30k to construct two types of instruction datasets: caption grounded phrases and phrase grounded phrase, each containing around $3 \mathrm { k }$ and $4 \mathrm { k \Omega }$ samples. Then we prompt our model with the instruction: “[detection] description”, the model will directly parse the objects from the input image description and also ground the objects into bounding boxes.
|
| 96 |
+
|
| 97 |
+
– Mixing multi-task dataset. After extensive training with single-round instruction-answer pairs, the model might not handle multiple tasks well during multi-round conversations since the context becomes more complex. To alleviate this situation, we create a new multi-round conversation dataset by mixing the data from different tasks. We include this dataset into our third-stage model training.
|
| 98 |
+
|
| 99 |
+
– Unnatural instruction. The conversation abilities of language model can be reduced after extensive vision-language training. To fix this, we add the language dataset, Unnatural Instruction (Honovich et al., 2022) into our model’s third-stage training for helping recover the language generation ability.
|
| 100 |
+
|
| 101 |
+
# 4 EXPERIMENTS
|
| 102 |
+
|
| 103 |
+
In this section, we present experimental settings and results. We primarily conduct experiments on (detailed) image/grounded captioning, vision question answering, and visual grounding tasks, including referring expression comprehension. We present both quantitative and qualitative results.
|
| 104 |
+
|
| 105 |
+
Implementation details. Throughout the entire training process, the visual backbone of MiniGPTv2 remains frozen. We focus on training the linear projection layer and efficient finetuning the language model using LoRA (Hu et al., 2021). With LoRA, we finetune ${ \mathcal { W } } _ { q }$ and $\mathcal { W } _ { v }$ via lowrank adaptation. In our implementation, we set the rank, $r = 6 4$ . We trained the model with an image resolution of $4 4 8 \mathrm { x } 4 4 8$ during all stages. During each stage, we use our designed multi-modal instructional templates for various vision-language tasks during the model training.
|
| 106 |
+
|
| 107 |
+
Training and hyperparameters. We use AdamW optimizer with a cosine learning rate scheduler to train our model. In the initial stage, we train on 8xA100 GPUs for 400,000 steps with a global batch size of 96 and an maximum learning rate of 1e-4. This stage takes around 90 hours. During the second stage, the model is trained for 50,000 steps on 4xA100 GPUs with a maximum learning rate of 1e-5, adopting a global batch size of 64, and this training stage lasts roughly 20 hours. For the last stage, training is executed for another 50,000 steps on 4xA100 GPUs, using a global batch size of 24 and this training stage took around 10 hours, maintaining the same maximum learning rate of 1e-5.
|
| 108 |
+
|
| 109 |
+
# 4.1 QUANTITATIVE EVALUATION
|
| 110 |
+
|
| 111 |
+
Dataset and evaluation metrics. We evaluate our model across a range of VQA and visual grounding benchmarks. For VQA benchmarks, we consider OKVQA (Schwenk et al., 2022), GQA (Hudson & Manning, 2019), VSR (Liu et al., 2023a), IconVQA (Lu et al., 2021), VizWiz (Gurari et al., 2018), HatefulMemes (Kiela et al., 2020), and TextVQA (Singh et al., 2019). For visual grounding, we evaluate our model on RefCOCO (Kazemzadeh et al., 2014) and RefCOCO $^ { | + | }$ (Yu et al., 2016), and RefCOCOg(Mao et al., 2016) benchmarks. More details about the dataset and evaluation metrics can be found in the appendix.
|
| 112 |
+
|
| 113 |
+
Visual question answering results. Table 3 presents our experimental results on multiple VQA benchmarks. Our results compare favorably to baselines including MiniGPT-4 (Zhu et al., 2023b), Shikra (Chen et al., 2023b), LLaVA (Liu et al., 2023b), mPLUG-Owl (Ye et al., 2023), Otter (Li et al., 2023a) and InstructBLIP (Dai et al., 2023) across all the VQA tasks. The results for mPLUGOwl, Otter and MiniGPT-4 are borrowed from (Xu et al., 2023b) For example, on QKVQA, our MiniGPT-v2 outperforms MiniGPT-4, Shikra, LLaVA, mPLUG-Owl, Otter and BLIP-2 by $1 9 . 4 \%$ , $9 . 7 \%$ , $2 . 5 \%$ , $34 \%$ , $7 . 9 \%$ and $11 \%$ . These results indicate the strong visual question answering capabilities of our model. Furthermore, we find that our MiniGPT-v2 (chat) variant shows higher performance than the version trained after the second stage. On VSR, TextVQA, IconVQA, VizWiz, and HM, MiniGPT-v2 (chat) outperforms MiniGPT-v2 by $2 . 7 \%$ , $0 . 4 \%$ , $1 . 7 \%$ , $1 2 . 1 \%$ , and $1 . 3 \%$ . We believe that the better performance can be attributed to the improved language skills during the thirdstage training, which is able to benefit visual question comprehension and response, especially on VizWiz with $1 2 . 1 \%$ top-1 accuracy increase.
|
| 114 |
+
|
| 115 |
+
Table 3: Results on multiple VQA tasks. We report top-1 accuracy for each task. Grounding column indicates whether the model incorporates visual localization capability. The best performance for each benchmark is indicated in bold.
|
| 116 |
+
|
| 117 |
+
<table><tr><td>Method</td><td>Grounding</td><td>OKVQA</td><td>GQA</td><td>VSR (zero-shot)</td><td>TextVQA (zero-shot)</td><td>IconVQA (zero-shot)</td><td>VizWiz (zero-shot)</td><td>HM (zero-shot)</td></tr><tr><td>Flamingo-9B</td><td>X</td><td>44.7</td><td></td><td>31.8</td><td></td><td></td><td>28.8</td><td>57.0</td></tr><tr><td>BLIP-2 (13B)</td><td>×</td><td>45.9</td><td>41.0</td><td>50.9</td><td>42.5</td><td>40.6</td><td>19.6</td><td>53.7</td></tr><tr><td>mPLUG-Owl (7B)</td><td>X</td><td>22.9</td><td>14.0</td><td>11.6</td><td>38.8</td><td>11.6</td><td>39.0</td><td></td></tr><tr><td>Otter (7B)</td><td>X</td><td>49.0</td><td>38.1</td><td>6.4</td><td>21.5</td><td>38.2</td><td>50.0</td><td>=</td></tr><tr><td>InstructBLIP (13B)</td><td>X</td><td>-</td><td>49.5</td><td>52.1</td><td>50.7</td><td>44.8</td><td>33.4</td><td>57.5</td></tr><tr><td>MiniGPT-4 (13B)</td><td>X</td><td>37.5</td><td>30.8</td><td>41.6</td><td>19.4</td><td>37.6</td><td>-</td><td>-</td></tr><tr><td>LLaVA (13B)</td><td>X</td><td>54.4</td><td>41.3</td><td>51.2</td><td>38.9</td><td>43.0</td><td>-</td><td></td></tr><tr><td>Shikra (13B)</td><td>√</td><td>47.2</td><td>-</td><td>-</td><td>-</td><td></td><td>-</td><td>-</td></tr><tr><td>Ours (7B)</td><td>√</td><td>56.9</td><td>60.3</td><td>60.6</td><td>51.9</td><td>47.7</td><td>30.3</td><td>58.2</td></tr><tr><td>Ours (7B)-chat</td><td>√</td><td>55.9</td><td>58.8</td><td>63.3</td><td>52.3</td><td> 49.4</td><td>53.0</td><td>59.5</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 4: Results on referring expression comprehension tasks. Our MiniGPT-v2 outperforms many VL-generalist models including VisionLLM (Wang et al., 2023b), OFA (Wang et al., 2022a) and Shikra (Chen et al., 2023b) and reduces the accuracy gap comparing to specialist models including UNINEXT (Yan et al., 2023) and G-DINO (Liu et al., 2023c).
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Model types</td><td colspan="3">RefCOCO</td><td colspan="3">RefCOCO+</td><td colspan="2">RefC0COg</td><td rowspan="2">Avg</td></tr><tr><td>val</td><td>test-A</td><td>test-B</td><td>val</td><td>test-A</td><td>test-B</td><td>val</td><td>test</td></tr><tr><td>UNINEXT G-DINO-L</td><td>Specialist models</td><td>92.64 90.56</td><td>94.33 93.19</td><td>91.46 88.24</td><td>85.24 82.75</td><td>89.63 88.95</td><td>79.79 75.92</td><td>88.73 86.13</td><td>89.37 87.02</td><td>88.90 86.60</td></tr><tr><td>VisionLLM-H OFA-L</td><td></td><td>- 79.96</td><td>86.70 83.67</td><td>76.39</td><td>- 68.29</td><td>76.00</td><td>- 61.75</td><td>- 67.57</td><td>- 67.58</td><td>1 72.65</td></tr><tr><td>Shikra (7B) Shikra (13B)</td><td>Generalist models</td><td>87.01 87.83</td><td>90.61 91.11</td><td>80.24</td><td>81.60</td><td>87.36</td><td>72.12</td><td>82.27</td><td>82.19</td><td>82.93</td></tr><tr><td>Ours (7B)</td><td></td><td>88.69</td><td>91.65</td><td>81.81</td><td>82.89</td><td>87.79</td><td>74.41</td><td>82.64</td><td>83.16</td><td>83.96</td></tr><tr><td></td><td></td><td></td><td></td><td>85.33</td><td>79.97</td><td>85.12</td><td>74.45</td><td>84.44</td><td>84.66</td><td>84.29</td></tr><tr><td> Ours (7B)-chat</td><td></td><td>87.18</td><td>90.51</td><td>84.57</td><td>78.69</td><td>84.25</td><td>73.23</td><td>81.88</td><td>83.25</td><td>82.95</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 122 |
+
|
| 123 |
+
Referring expression comprehension results. Table 4 compares our model to baselines on REC benchmarks. Our MiniGPT-v2 shows strong REC performance on RefCOCO, $\operatorname { R e f C O C O + }$ , and RefCOCOg, performing better than other vision-language generalist models. MiniGPTv2 outperforms OFA-L (Wang et al., 2022a) by over $8 \%$ accuracy across all tasks of RefC $\mathrm { \ O C O / R e f C O C O + / R e f C O C O g }$ . Compared with a strong baseline, Shikra (13B) (Chen et al., 2023b), our model still shows better results, e.g., $8 4 . 2 9 \%$ vs $8 3 . 9 6 \%$ accuracy in average. These results provide direct evidence for the competing visual grounding capabilities of MiniGPT-v2. Although our model underperforms specialist models, the promising performance indicates its growing competence in visual grounding.
|
| 124 |
+
|
| 125 |
+
Ablation on task identifier. We conduct ablation studies on the effect of the task identifier on the performance of MiniGPT-v2. We compare our model with the variant without using task identifiers on VQA benchmarks. Both models were trained on 4xA100 GPUs for 24 hours with an equal number of training steps for multiple vision-language tasks. Results in Table 5 demonstrate the performance on multiple VQA benchmarks and consistently show that token identifier training benefits the overall performance of MiniGPT-v2. Specifically, our MiniGPT-v2 with task-oriented instruction training achieves $1 . 2 \%$ top-1 accuracy improvement on average. These ablation results can validate the clear advantage of adding task identifier tokens and support the use of multi-task identifiers for multi-task learning efficiency.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: Examples for various multi-modal capabilities of MiniGPT-v2. We showcase that our model is capable of completing multiple tasks such as referring expression comprehension, referring expression generation, detailed grounded image caption, visual question answering, detailed image description, and directly parsing phrase and grounding from a given input text.
|
| 129 |
+
|
| 130 |
+
Table 5: Task identifier ablation study on VQA benchmarks. With task identifier during the model training can overall improve VQA performances from multiple VQA benchmarks
|
| 131 |
+
|
| 132 |
+
<table><tr><td></td><td>OKVQA</td><td>GQA</td><td>VizWiz</td><td>VSR</td><td>IconVQA</td><td>HM</td><td>Average</td></tr><tr><td>Ours w/o task identifier</td><td>50.5</td><td>53.4</td><td>28.6</td><td>57.5</td><td>44.8</td><td>56.8</td><td>48.6</td></tr><tr><td>Ours</td><td>52.1</td><td>54.6</td><td>29.4</td><td>59.9</td><td>45.6</td><td>57.4</td><td>49.8</td></tr></table>
|
| 133 |
+
|
| 134 |
+
Hallucination. We measure the hallucination of our model on image description generation and compare the results with other vision-language baselines, including MiniGPT-4 (Zhu et al., 2023b), mPLUGOwl (Ye et al., 2023), LLaVA (Liu et al., 2023b), and MultiModal-GPT (Gong et al., 2023). Following the methodology from (Li et al., 2023c), we use CHAIR (Rohrbach et al., 2018) to assess hallucination at both object and sentence levels. As shown in Table 6, we find that our MiniGPT-v2 tends to generate the image description with reduced hallucination compared to other baselines. We have evaluated three types of prompts in MiniGPT-v2. First, we use the prompt generate a brief description of the given image without any specific task identifier
|
| 135 |
+
|
| 136 |
+
Table 6: Results on hallucination. We evaluate the hallucination of MiniGPT-v2 with different instructional templates and output three versions of captions for evaluation. For the “long” version, we use the prompt generate a brief description of the given image. For the “grounded” version, the instruction is [grounding] describe this image in as detailed as possible. For the “short” version, the prompt is [caption] briefly describe the image.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Method</td><td>CHAIR1↓</td><td>CHAIRs↓</td><td>Len</td></tr><tr><td>MiniGPT-4</td><td>9.2</td><td>31.5</td><td>116.2</td></tr><tr><td>mPLUG-Owl</td><td>30.2</td><td>76.8</td><td>98.5</td></tr><tr><td>LLaVA</td><td>18.8</td><td>62.7</td><td>90.7</td></tr><tr><td>MultiModal-GPT</td><td>18.2</td><td>36.2</td><td>45.7</td></tr><tr><td>MiniGPT-v2 (long)</td><td>8.7</td><td>25.3</td><td>56.5</td></tr><tr><td>MiniGPT-v2 (grounded)</td><td>7.6</td><td>12.5</td><td>18.9</td></tr><tr><td>MiniGPT-v2 (short)</td><td>4.4</td><td>7.1</td><td>10.3</td></tr></table>
|
| 139 |
+
|
| 140 |
+
which tends to produce more detailed image descriptions. Then we provide the instruction prompt [grounding] describe this image in as detailed as possible for evaluating grounded image captions. Lastly, we prompt our model with [caption] briefly describe the image. With these task identifiers, MiniGPT-v2 is able to produce a variety of image descriptions with different levels of hallucination. As a result, all these three instruction variants have lower hallucination than our baseline, especially with the task specifiers of [caption] and [grounding].
|
| 141 |
+
|
| 142 |
+
# 4.2 QUALITATIVE RESULTS
|
| 143 |
+
|
| 144 |
+
We now provide the qualitative results for a complementary understanding of our model’s multimodal capabilities. Some examples can be seen in Fig. 3. Specifically, we demonstrated various abilities in the examples including a) object identification; b) detailed grounded image captioning; c) visual question answering; d) referring expression comprehension; e) visual question answering under task identifier; f) detailed image description; g) object parsing and grounding from an input text. More qualitative results can be found in the Appendix. These results demonstrate that our model has competing vision-language understanding capabilities. Moreover, notice that we train our model only with a few thousand of instruction samples on object parsing and grounding tasks at the third-stage, and our model can effectively follow the instructions and generalize on the new task. This indicates that our model has the flexibility to adapt on many new tasks.
|
| 145 |
+
|
| 146 |
+
# 5 CONCLUSION AND DISCUSSION
|
| 147 |
+
|
| 148 |
+
In this paper, we introduce MiniGPT-v2, a multi-modal LLM that can serve as a unified interface for various vision-language multi-tasking learning. To develop a single model capable of handling multiple vision-language tasks, we propose using distinct identifiers for each task during the training and inference. These identifiers help our model easily differentiate various tasks and also improve the learning efficiency. Our MiniGPT-v2 achieves strong results across many visual question answering and referring expression comprehension benchmarks. We also found that our model can efficiently adapt to new vision-language task, which suggests that MiniGPT-v2 has many potential applications in vision-language community.
|
| 149 |
+
|
| 150 |
+
However, our model still occasionally shows hallucinations when generating the image description, visual grounding or answering visual questions. e.g., our model may sometimes produce descriptions of non-existent visual objects or generate inaccurate visual locations of grounded objects. We believe aligning the models with more high-quality image-text aligned data, and integrating with a stronger vision backbone and large language model hold the potential for alleviating this issue.
|
| 151 |
+
|
| 152 |
+
In the appendix, we provide more qualitative results that are generated from our model to demonstrate the vision-language multi-tasking capabilities.
|
| 153 |
+
|
| 154 |
+
# A EVALUATION METRICS
|
| 155 |
+
|
| 156 |
+
Visual Question Answering (VQA): For the VQA benchmarks, we adopted the standard openended VQA evaluation metrics. This involves comparing the model’s response directly with the ground truth, and we report the top-1 accuracy as a measure of performance.
|
| 157 |
+
|
| 158 |
+
$\mathbf { R e f C O C O } / + / \mathbf { g } ;$ : In assessing visual grounding, we implemented a two-step process. Initially, our model generates a bounding box for each answer, which is then evaluated through the Intersection over Union (IoU) method. We specifically measure the overlap between the generated and groundtruth bounding boxes, considering overlaps greater than 0.5 as indicative of correct grounding.
|
| 159 |
+
|
| 160 |
+
Hallucination Evaluation: To address the critical aspect of hallucination in generated responses, we employed $C H A I R _ { i }$ and $C H A I R _ { s }$ metrics. $C H A I R _ { i }$ calculates the proportion of hallucinated objects relative to all mentioned objects, offering insight into the frequency of hallucination occurrences. Conversely, $C H A I R _ { s }$ assesses the ratio of captions containing hallucinated objects to the total number of captions, providing a broader view of the model’s overall tendency towards hallucination. Here is how $C H A I R _ { i }$ and $C H A I R _ { s }$ are calculated
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
C H A I R _ { i } = { \frac { | \{ { \mathrm { h a l l u c i n a t e d ~ o b j e c t s } } \} | } { | \{ { \mathrm { a l l ~ m e n t i o n e d ~ o b j e c t s } } \} | } } ,
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
C H A I R _ { s } = \frac { | \{ { \mathrm { c a p t i o n s ~ w i t h ~ h a l l u c i n a t e d ~ o b j e c t s } } \} | } { | \{ { \mathrm { a l l ~ c a p t i o n s } } \} | } ,
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
# B DATASET DETAILS
|
| 171 |
+
|
| 172 |
+
Training data. Here we demonstrate the statistics
|
| 173 |
+
|
| 174 |
+
• GQA (Hudson & Manning, 2019): VQA on scene understanding and reasoning. 22M questions.
|
| 175 |
+
• VQAv2 (Goyal et al., 2017): VQA on natural images. 443,757 questions.
|
| 176 |
+
• OCR-VQA (Mishra et al., 2019): VQA on images of book covers. 1,002,146 questions.
|
| 177 |
+
• OK-VQA (Schwenk et al., 2022): VQA on natural images requiring outside knowledge. 14K questions.
|
| 178 |
+
• AOK-VQA (Schwenk et al., 2022): Augmented VQA on natural images requiring outside knowledge. 25K questions.
|
| 179 |
+
• LLaVA (Liu et al., 2023b) instruction: 23k detailed descriptions and 58k complex reasoning examples.
|
| 180 |
+
• LAION (Schuhmann et al., 2021): CLIP-filtered 400 million image-text pairs.
|
| 181 |
+
• CC3M (Sharma et al., 2018): It contains 3.3M web images annotated with captions.
|
| 182 |
+
• SBU (Ordonez et al., 2011): A large captioned photo collection with 1 million images on Flickr.
|
| 183 |
+
• COCO caption (Lin et al., 2014): It consists of a half million captions describing over 330,000 images.
|
| 184 |
+
• TextCaps (Sidorov et al., 2020): It contains 28,408 images from OpenImages, 142,040 captions.
|
| 185 |
+
• Flickr30K (Plummer et al., 2015) contains 31,783 images.
|
| 186 |
+
• RefCOCO (Kazemzadeh et al., 2014) contains 142,209 referring expression for 50,000 objects in 19,994 images.
|
| 187 |
+
• RefCOCOg (Mao et al., 2016) contains 85,474 referring expression for 54,822 objects in 26,711 images
|
| 188 |
+
• RefCOCO $^ +$ (Yu et al., 2016) contains 141,564 referring expression for 49,856 objects in 19,992 images
|
| 189 |
+
• GRIT 20M (Peng et al., 2023) it contains around 20M grounded image caption.
|
| 190 |
+
|
| 191 |
+
C INSTRUCTION TEMPLATE FOR VARIOUS VISION-LANGUAGE TASKS
|
| 192 |
+
|
| 193 |
+
RefCOCO/RefCOCO+/RefCOCOg: [refer] give me the location of {question}
|
| 194 |
+
VizWiz: [vqa] Based on the image, respond to this question with a short answer: {question} and
|
| 195 |
+
reply ’unanswerable’ if you could not answer it
|
| 196 |
+
Hateful Meme: [vqa] This is an image with: {question} written on it. Is it hateful? Answer:
|
| 197 |
+
VSR: [vqa] Based on the image, is this statement true or false? {question}
|
| 198 |
+
IconQA, GQA, OKVQA: [vqa] Based on the image, respond to this question with a short answer:
|
| 199 |
+
{question}
|
| 200 |
+
|
| 201 |
+
D MINIGPT-V2 CONVERSATION EVALUATION
|
| 202 |
+
|
| 203 |
+
We evaluate MiniGPT-v2 under a multi-round conversation, and we demonstrate the conversation in the Fig. 4
|
| 204 |
+
|
| 205 |
+
# E ADDITIONAL QUALITATIVE RESULTS
|
| 206 |
+
|
| 207 |
+
To study how well our model is able to take visual input and answer questions based on task-oriented identifier, we use our model to perform multiple vision-language tasks including grounded image captioning in Fig. 5, Fig. 6, Fig. 7 and Fig. 8; Object parsing and grounding in Fig. 9, Fig. 10, Fig. 11 and Fig. 12; Referring expression comprehension in Fig. 13, Fig. 14, Fig. 15 and Fig. 16; Object identification in Fig. 17, Fig. 18, Fig. 19 and Fig. 20.
|
| 208 |
+
|
| 209 |
+
For each task, we share 4 examples for showing the vision-language capabilities of our model. The results in the demo provide direct evidence for the competing visual understanding capabilities of MiniGPT-v2 on multiple vision-language tasks. For example, in the cases of grounded caption, our model is able to give correct grounded image caption with detailed spatial locations of objects. In the cases of identify, the model also generates our expected object names. MiniGPT-v2 can understand the new scenes and follow the question identifier to respond. But we also need to note that our model still has some hallucination e.g., In Fig. 7, several persons are not grounded accurately, and in Fig. 8, there does not exist a vase in the image.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 4: Conversation evaluation.
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
[grounding] please describe this image as detailed as possible
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
<p>A homelessmar $< / p >$ {<14><23><57><81>}in <p>a blue jacket</p> $\cdot \{ < 1 4 > < 3 5 > < 3 6 > < 5 9 > \}$ and<p>black umbrella $< / { \mathsf { p } } >$ $\scriptstyle \left\{ < 3 7 > < 2 3 > < 6 8 > < 4 4 > \right\}$ sits at $\tt { < p > a }$ picnic table</p> $\scriptstyle \left\{ < 3 0 > < 4 5 > \ < 1 0 0 > < 7 9 > \right\}$ while <p>his backpack</p> $( < 7 > < 4 0 > < 2 7 > < 6 2 > )$ is beside him.
|
| 219 |
+
Figure 5: Detail grounded image caption example.
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
[grounding]please describe this image asdetailed as possible
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
|
| 226 |
+
$\angle P > A$ youngAfrican-American businessmar $| < / { \mathsf { p } } >$ $\{ < 8 > < 1 > < 6 4 > < 8 9 > \}$ in $\angle P = \alpha$ blue blazer $< / p >$ $\{ < 7 > < 3 1 > < 5 2 > < 8 9 > \}$ looks up at the camera with $< { \mathsf { p } } > { \mathsf { a } }$ pleased smile $< / { \mathsf { p } } >$ $\scriptstyle \left( < 3 4 > < 3 2 > < 4 5 > < 4 3 > \right]$ while workingat his desk, using $\tt { < p > a }$ laptop computer $< / { \mathsf { p } } >$
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 6: Detail grounded image caption example
|
| 230 |
+
[grounding]pleasedescribe this imageasdetailedas possible
|
| 231 |
+
Figure 7: Detail grounded image caption example
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
<p>People</p>{<13><63><18><74>}<delim>{<57><69><66><75 >}<delim>{<2><66><8><74>}<delim>{<65><69><70><75>}<deli m>{<1><68><3><73>}<delim>{<49><68><51><71>} sit and lay on<p>beach chairs</p>{<55><64><97><92>}<delim> $< 2 4 > < 7$ 1><55><88>}<delim>{<56><74><92><90>} while
|
| 235 |
+
|
| 236 |
+

|
| 237 |
+
[grounding] please describe this image as detailed as possible
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
<p>Acrepe</p $> \{ < 3 8 > < 5 1 > < 9 0 > < 7 8 > \}$ sits on $\angle P = \alpha$ white plate</p>{ $: 2 9 > < 4 5 > < 1 0 0 > < 8 3 > \}$ nearacupof ${ < } { \mathsf { p } } { > } { \mathsf { \ell } }$ orange juice $\angle 1 9 >$ $\scriptstyle : < 1 6 > < 2 0 > < 3 7 > < 6 3 > \}$ and $< \mathsf { p } > \mathsf { a }$ vase $\angle 1 9 >$ $\{ < 1 5 > < 1 1 > < 3 7 > < 5 2 > \}$ with a stem in the background.
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 8: Detail grounded image caption example
|
| 244 |
+
[detection] clocks
|
| 245 |
+
Figure 9: Object parsing and grounding example
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
<p>clocks</p>{<40><68><58><91>}<delim>{<32><27><57><42 >}<delim>{<13><43><32><63>}<delim>{<65><49><79><65>}<de lim>{<63><48><78><65>}
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
[detection] A woman in a colorful dress is sitting in a plane and typing on a calculator
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 10: Object parsing and grounding example
|
| 255 |
+
|
| 256 |
+
$\angle P > A$ woman</p>{<9><15><100><100>}<p>a colorful dress $< / { \mathsf { p } } >$ {<12><44><100><100>}<p>aplane</p> $\{ < 0 > < 0 > < 1 0 0 > < 9 8 > \}$ <p>acalculator</p>{<7><74><53><87>}
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 11: Object parsing and grounding example
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
<p>s0fas</p>{<28><43><41><72>}<delim>{<69><50><98><73> }<delim>{<47><56><59><70>}
|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
Figure 12: Object parsing and grounding example
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 13: Referring expression comprehension example
|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
Figure 14: Referring expression comprehension example
|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
Figure 15: Referring expression comprehension example
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
Figure 16: Referring expression comprehension example
|
| 278 |
+
|
| 279 |
+

|
| 280 |
+
Figure 17: object identification example
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
Figure 18: object identification example
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 19: object identification example
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 20: object identification example
|
| 290 |
+
|
| 291 |
+
REFERENCES
|
| 292 |
+
Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. In Advances in Neural Information Processing Systems, 2022.
|
| 293 |
+
Jinze Bai, Shuai Bai, Shusheng Yang, Shijie Wang, Sinan Tan, Peng Wang, Junyang Lin, Chang Zhou, and Jingren Zhou. Qwen-vl: A frontier large vision-language model with versatile abilities. arXiv preprint arXiv:2308.12966, 2023.
|
| 294 |
+
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, 33:1877–1901, 2020.
|
| 295 |
+
Jun Chen, Han Guo, Kai Yi, Boyang Li, and Mohamed Elhoseiny. Visualgpt: Data-efficient adaptation of pretrained language models for image captioning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 18030–18040, 2022.
|
| 296 |
+
Jun Chen, Deyao Zhu, Kilichbek Haydarov, Xiang Li, and Mohamed Elhoseiny. Video chatcaptioner: Towards the enriched spatiotemporal descriptions. arXiv preprint arXiv:2304.04227, 2023a.
|
| 297 |
+
Keqin Chen, Zhao Zhang, Weili Zeng, Richong Zhang, Feng Zhu, and Rui Zhao. Shikra: Unleashing multimodal llm’s referential dialogue magic. arXiv preprint arXiv:2306.15195, 2023b.
|
| 298 |
+
Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An open-source chatbot impressing gpt-4 with $9 0 \% *$ chatgpt quality, March 2023. URL https://vicuna.lmsys.org.
|
| 299 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
|
| 300 |
+
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, 2023.
|
| 301 |
+
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.
|
| 302 |
+
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.
|
| 303 |
+
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, 33: 6616–6628, 2020.
|
| 304 |
+
Tao Gong, Chengqi Lyu, Shilong Zhang, Yudong Wang, Miao Zheng, Qian Zhao, Kuikun Liu, Wenwei Zhang, Ping Luo, and Kai Chen. Multimodal-gpt: A vision and language model for dialogue with humans. arXiv preprint arXiv:2305.04790, 2023.
|
| 305 |
+
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 Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6904–6913, 2017.
|
| 306 |
+
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, pp. 3608–3617, 2018.
|
| 307 |
+
Or Honovich, Thomas Scialom, Omer Levy, and Timo Schick. Unnatural instructions: Tuning language models with (almost) no human labor. arXiv preprint arXiv:2212.09689, 2022.
|
| 308 |
+
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.
|
| 309 |
+
Ronghang Hu and Amanpreet Singh. Unit: Multimodal multitask learning with a unified transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1439–1449, 2021.
|
| 310 |
+
|
| 311 |
+
Drew A Hudson and Christopher D Manning. Gqa: A new dataset for real-world visual reasoning and compositional question answering. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6700–6709, 2019.
|
| 312 |
+
|
| 313 |
+
Gabriel Ilharco, Mitchell Wortsman, Ross Wightman, Cade Gordon, Nicholas Carlini, Rohan Taori, Achal Dave, Vaishaal Shankar, Hongseok Namkoong, John Miller, Hannaneh Hajishirzi, Ali Farhadi, and Ludwig Schmidt. Openclip, July 2021. URL https://doi.org/10.5281/zenodo.5143773. If you use this software, please cite it as below.
|
| 314 |
+
Sahar Kazemzadeh, Vicente Ordonez, Mark Matten, and Tamara Berg. Referitgame: Referring to objects in photographs of natural scenes. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 787–798, 2014.
|
| 315 |
+
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. Advances in neural information processing systems, 33:2611–2624, 2020.
|
| 316 |
+
Bo Li, Yuanhan Zhang, Liangyu Chen, Jinghao Wang, Jingkang Yang, and Ziwei Liu. Otter: A multi-modal model with in-context instruction tuning. arXiv preprint arXiv:2305.03726, 2023a.
|
| 317 |
+
Dongxu Li, Junnan Li, Hongdong Li, Juan Carlos Niebles, and Steven CH Hoi. Align and prompt: Video-andlanguage pre-training with entity prompts. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4953–4963, 2022.
|
| 318 |
+
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, 2023b.
|
| 319 |
+
Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part XXX 16, pp. 121–137. Springer, 2020.
|
| 320 |
+
Yifan Li, Yifan Du, Kun Zhou, Jinpeng Wang, Wayne Xin Zhao, and Ji-Rong Wen. Evaluating object hallucination in large vision-language models. arXiv preprint arXiv:2305.10355, 2023c.
|
| 321 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and ´ C Lawrence Zitnick. Microsoft coco: Common objects in context. In Computer Vision–ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V 13, pp. 740–755. Springer, 2014.
|
| 322 |
+
Fangyu Liu, Guy Emerson, and Nigel Collier. Visual spatial reasoning. Transactions of the Association for Computational Linguistics, 11:635–651, 2023a.
|
| 323 |
+
Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. arXiv preprint arXiv:2304.08485, 2023b.
|
| 324 |
+
Shilong Liu, Zhaoyang Zeng, Tianhe Ren, Feng Li, Hao Zhang, Jie Yang, Chunyuan Li, Jianwei Yang, Hang Su, Jun Zhu, et al. Grounding dino: Marrying dino with grounded pre-training for open-set object detection. arXiv preprint arXiv:2303.05499, 2023c.
|
| 325 |
+
Jiasen Lu, Christopher Clark, Rowan Zellers, Roozbeh Mottaghi, and Aniruddha Kembhavi. UNIFIED-IO: A unified model for vision, language, and multi-modal tasks. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=E01k9048soZ.
|
| 326 |
+
Pan Lu, Liang Qiu, Jiaqi Chen, Tony Xia, Yizhou Zhao, Wei Zhang, Zhou Yu, Xiaodan Liang, and Song-Chun Zhu. Iconqa: A new benchmark for abstract diagram understanding and visual language reasoning. arXiv preprint arXiv:2110.13214, 2021.
|
| 327 |
+
Junhua Mao, Jonathan Huang, Alexander Toshev, Oana Camburu, Alan L Yuille, and Kevin Murphy. Generation and comprehension of unambiguous object descriptions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 11–20, 2016.
|
| 328 |
+
Kenneth Marino, Mohammad Rastegari, Ali Farhadi, and Roozbeh Mottaghi. Ok-vqa: A visual question answering benchmark requiring external knowledge. In Proceedings of the IEEE/cvf conference on computer vision and pattern recognition, pp. 3195–3204, 2019.
|
| 329 |
+
Anand Mishra, Shashank Shekhar, Ajeet Kumar Singh, and Anirban Chakraborty. Ocr-vqa: Visual question answering by reading text in images. In 2019 international conference on document analysis and recognition (ICDAR), pp. 947–952. IEEE, 2019.
|
| 330 |
+
OpenAI. Introducing chatgpt. https://openai.com/blog/chatgpt, 2022.
|
| 331 |
+
OpenAI. Gpt-4 technical report, 2023.
|
| 332 |
+
Vicente Ordonez, Girish Kulkarni, and Tamara Berg. Im2text: Describing images using 1 million captioned photographs. Advances in neural information processing systems, 24, 2011.
|
| 333 |
+
Zhiliang Peng, Wenhui Wang, Li Dong, Yaru Hao, Shaohan Huang, Shuming Ma, and Furu Wei. Kosmos-2: Grounding multimodal large language models to the world. arXiv preprint arXiv:2306.14824, 2023.
|
| 334 |
+
Bryan A Plummer, Liwei Wang, Chris M Cervantes, Juan C Caicedo, Julia Hockenmaier, and Svetlana Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In Proceedings of the IEEE international conference on computer vision, pp. 2641–2649, 2015.
|
| 335 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 336 |
+
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, pp. 8748–8763. PMLR, 2021.
|
| 337 |
+
Anna Rohrbach, Lisa Anne Hendricks, Kaylee Burns, Trevor Darrell, and Kate Saenko. Object hallucination in image captioning. arXiv preprint arXiv:1809.02156, 2018.
|
| 338 |
+
Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. Laion- $4 0 0 \mathrm { m }$ : Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021.
|
| 339 |
+
Dustin Schwenk, Apoorv Khandelwal, Christopher Clark, Kenneth Marino, and Roozbeh Mottaghi. A-okvqa: A benchmark for visual question answering using world knowledge. In European Conference on Computer Vision, pp. 146–162. Springer, 2022.
|
| 340 |
+
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 (Volume 1: Long Papers), pp. 2556–2565, 2018.
|
| 341 |
+
Oleksii Sidorov, Ronghang Hu, Marcus Rohrbach, and Amanpreet Singh. Textcaps: a dataset for image captioningwith reading comprehension. 2020.
|
| 342 |
+
Amanpreet Singh, Vivek Natarajan, Meet Shah, Yu Jiang, Xinlei Chen, Dhruv Batra, Devi Parikh, and Marcus Rohrbach. Towards vqa models that can read. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 8317–8326, 2019.
|
| 343 |
+
Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela. Flava: A foundational language and vision alignment model. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15638–15650, 2022.
|
| 344 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, ´ Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation \` language models. arXiv preprint arXiv:2302.13971, 2023a.
|
| 345 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023b.
|
| 346 |
+
Maria Tsimpoukelli, Jacob L Menick, Serkan Cabi, SM Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. Advances in Neural Information Processing Systems, 34: 200–212, 2021.
|
| 347 |
+
Peng Wang, An Yang, Rui Men, Junyang Lin, Shuai Bai, Zhikang Li, Jianxin Ma, Chang Zhou, Jingren Zhou, and Hongxia Yang. Ofa: Unifying architectures, tasks, and modalities through a simple sequence-tosequence learning framework. In International Conference on Machine Learning, pp. 23318–23340. PMLR, 2022a.
|
| 348 |
+
Peng Wang, Shijie Wang, Junyang Lin, Shuai Bai, Xiaohuan Zhou, Jingren Zhou, Xinggang Wang, and Chang Zhou. One-peace: Exploring one general representation model toward unlimited modalities. arXiv preprint arXiv:2305.11172, 2023a.
|
| 349 |
+
Wenhai Wang, Zhe Chen, Xiaokang Chen, Jiannan Wu, Xizhou Zhu, Gang Zeng, Ping Luo, Tong Lu, Jie Zhou, Yu Qiao, et al. Visionllm: Large language model is also an open-ended decoder for vision-centric tasks. arXiv preprint arXiv:2305.11175, 2023b.
|
| 350 |
+
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, 2022b.
|
| 351 |
+
Hu Xu, Saining Xie, Xiaoqing Ellen Tan, Po-Yao Huang, Russell Howes, Vasu Sharma, Shang-Wen Li, Gargi Ghosh, Luke Zettlemoyer, and Christoph Feichtenhofer. Demystifying clip data. arXiv preprint arXiv:2309.16671, 2023a.
|
| 352 |
+
Peng Xu, Wenqi Shao, Kaipeng Zhang, Peng Gao, Shuo Liu, Meng Lei, Fanqing Meng, Siyuan Huang, Yu Qiao, and Ping Luo. Lvlm-ehub: A comprehensive evaluation benchmark for large vision-language models. arXiv preprint arXiv:2306.09265, 2023b.
|
| 353 |
+
Bin Yan, Yi Jiang, Jiannan Wu, Dong Wang, Ping Luo, Zehuan Yuan, and Huchuan Lu. Universal instance perception as object discovery and retrieval. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15325–15336, 2023.
|
| 354 |
+
Qinghao Ye, Haiyang Xu, Guohai Xu, Jiabo Ye, Ming Yan, Yiyang Zhou, Junyang Wang, Anwen Hu, Pengcheng Shi, Yaya Shi, et al. mplug-owl: Modularization empowers large language models with multimodality. arXiv preprint arXiv:2304.14178, 2023.
|
| 355 |
+
Jiahui Yu, Zirui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, and Yonghui Wu. Coca: Contrastive captioners are image-text foundation models. arXiv preprint arXiv:2205.01917, 2022.
|
| 356 |
+
Licheng Yu, Patrick Poirson, Shan Yang, Alexander C Berg, and Tamara L Berg. Modeling context in referring expressions. In Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part II 14, pp. 69–85. Springer, 2016.
|
| 357 |
+
Lu Yuan, Dongdong Chen, Yi-Ling Chen, Noel Codella, Xiyang Dai, Jianfeng Gao, Houdong Hu, Xuedong Huang, Boxin Li, Chunyuan Li, et al. Florence: A new foundation model for computer vision. arXiv preprint arXiv:2111.11432, 2021.
|
| 358 |
+
Pengchuan Zhang, Xiujun Li, Xiaowei Hu, Jianwei Yang, Lei Zhang, Lijuan Wang, Yejin Choi, and Jianfeng Gao. Vinvl: Revisiting visual representations in vision-language models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5579–5588, 2021.
|
| 359 |
+
Deyao Zhu, Jun Chen, Kilichbek Haydarov, Xiaoqian Shen, Wenxuan Zhang, and Mohamed Elhoseiny. Chatgpt asks, blip-2 answers: Automatic questioning towards enriched visual descriptions. arXiv preprint arXiv:2303.06594, 2023a.
|
| 360 |
+
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, 2023b.
|
| 361 |
+
Mingchen Zhuge, Haozhe Liu, Francesco Faccio, Dylan R Ashley, Robert Csord ´ as, Anand Gopalakrishnan, ´ Abdullah Hamdi, Hasan Abed Al Kader Hammoud, Vincent Herrmann, Kazuki Irie, et al. Mindstorms in natural language-based societies of mind. arXiv preprint arXiv:2305.17066, 2023.
|
md/test/sllU8vvsFF/sllU8vvsFF.md
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LRM: LARGE RECONSTRUCTION MODEL FORSINGLE IMAGE TO 3D
|
| 2 |
+
|
| 3 |
+
Yicong $\mathbf { H o n g ^ { 1 2 * } }$ Kai Zhang1 Jiuxiang $\mathbf { G u } ^ { 1 }$ Sai $\mathbf { B i } ^ { 1 }$ Yang Zhou1
|
| 4 |
+
Difan Liu1 Feng Liu1 Kalyan Sunkavalli1 Trung Bui1 Hao Tan1
|
| 5 |
+
|
| 6 |
+
1Adobe Research 2Australian National Univeristy
|
| 7 |
+
mr.yiconghong@gmail.com
|
| 8 |
+
{kaiz,jigu,sbi,yazhou,diliu,fengl,sunkaval,bui,hatan}@adobe.com
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
We propose the first Large Reconstruction Model (LRM) that predicts the 3D model of an object from a single input image within just 5 seconds. In contrast to many previous methods that are trained on small-scale datasets such as ShapeNet in a category-specific fashion, LRM adopts a highly scalable transformer-based architecture with 500 million learnable parameters to directly predict a neural radiance field (NeRF) from the input image. We train our model in an end-to-end manner on massive multi-view data containing around 1 million objects, including both synthetic renderings from Objaverse and real captures from MVImgNet. This combination of a high-capacity model and large-scale training data empowers our model to be highly generalizable and produce high-quality 3D reconstructions from various testing inputs, including real-world in-the-wild captures and images created by generative models. Video demos and interactable 3D meshes can be found on our LRM project webpage: https://yiconghong.me/LRM.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Imagine if we could instantly create a 3D shape from a single image of an arbitrary object. Broad applications in industrial design, animation, gaming, and AR/VR have strongly motivated relevant research in seeking a generic and efficient approach towards this long-standing goal. Due to the underlying ambiguity of 3D geometry in a single view, early learning-based methods usually perform well on specific categories, utilizing the category data prior to infer the overall shape (Yu et al., 2021). Recently, advances in image generation, such as DALL-E (Ramesh et al., 2021) and Stable Diffusion (Rombach et al., 2022), have inspired research that leverages the remarkable generalization capability of 2D diffusion models to enable multi-view supervision (Liu et al., 2023b; Tang et al., 2023). However, many of these methods require delicate parameter tuning and regularization, and their results are limited by the pre-trained 2D generative models. Meanwhile, there are many approaches that rely on per-shape optimization (e.g. optimize a NeRF (Mildenhall et al., 2021; Chan et al., 2022; Chen et al., 2022a; Muller et al., 2022; Sun et al., 2022)) to construct a consistent ¨ geometry; this process is often slow and impractical.
|
| 17 |
+
|
| 18 |
+
On the other hand, the great success in natural language processing (Devlin et al., 2018; Brown et al., 2020; Chowdhery et al., 2022) and image processing (Caron et al., 2021; Radford et al., 2021; Alayrac et al., 2022; Ramesh et al., 2022) can be largely credited to three critical factors: (1) using highly scalable and effective neural networks, such as the Transformers (Vaswani et al., 2017), for modeling the data distribution, (2) enormous datasets for learning generic priors, as well as (3) self-supervised-like training objectives that encourage the model to discover the underlying data structure while maintaining high scalability. For instance, the GPT (generative pre-trained transformer) series (Radford et al., 2019; Brown et al., 2020; OpenAI, 2023) build large language models with huge transformer networks, large-scale data, and the simple next-word prediction task. In light of this, we pose the same question for 3D: given sufficient 3D data and a large-scale training framework, is it possible to learn a generic 3D prior for reconstructing an object from a single image?
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a Large Reconstruction Model (LRM) for single-image to 3D. Our method adopts a large transformer-based encoder-decoder architecture for learning 3D representations of objects from a single image in a data-driven manner. Our method takes an image as input and regresses a NeRF in the form of a triplane representation (Chan et al., 2022). Specifically, LRM utilizes the pre-trained visual transformer DINO (Caron et al., 2021) as the image encoder to generate the image features, and learns an image-to-triplane transformer decoder to project the 2D image features onto the 3D triplane via cross-attention and model the relations among the spatially-structured triplane tokens via self-attention. The output tokens from the decoder are reshaped and upsampled to the final triplane feature maps. Afterwards, we can render the images at an arbitrary view by decoding the triplane feature of each point with an additional shared multi-layer perception (MLP) to get its color and density and performing volume rendering.
|
| 21 |
+
|
| 22 |
+
The overall design of LRM maintains high scalability and efficiency. In addition to the use of a fully transformer-based pipeline, a triplane NeRF is a concise and scalable 3D representation since it is computationally friendly compared to other representations such as volumes and point clouds. It also has a better locality with respect to the image input compared to tokenizing the NeRF’s model weights as in Shap-E (Jun & Nichol, 2023). Moreover, our LRM is trained by simply minimizing the difference between the rendered images and ground truth images at novel views, without excessive 3D-aware regularization or delicate hyper-parameter tuning, allowing the model to be very efficient in training and adaptable to a wide range of multi-view image datasets.
|
| 23 |
+
|
| 24 |
+
To the best of our knowledge, LRM is the first large-scale 3D reconstruction model; it contains more than 500 million learnable parameters, and it is trained on approximately one million 3D shapes and video data across diverse categories (Deitke et al., 2023; Yu et al., 2023); this is substantially larger than recent methods that apply relatively shallower networks and smaller datasets (Chang et al., 2015; Reizenstein et al., 2021; Downs et al., 2022). Through experiments, we show that LRM can reconstruct high-fidelity 3D shapes from a wide range of images captured in the real world, as well as images created by generative models. LRM is also a highly practical solution for downstream applications since it can produce a 3D shape in just five seconds1 without post-optimization.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Single Image to 3D Reconstruction Extensive efforts have been devoted to address this problem, including early learning-based methods that explore point clouds (Fan et al., 2017; Wu et al., 2020), voxels (Choy et al., 2016; Tulsiani et al., 2017; Chen & Zhang, 2019), and meshes (Wang et al., 2018; Gkioxari et al., 2019), as well as various approaches that learn implicit representations such as SDFs (Park et al., 2019; Mittal et al., 2022), occupancy networks (Mescheder et al., 2019), and NeRF (Jang & Agapito, 2021; Muller et al., 2022). Leveraging 3D templates (Roth et al., ¨ 2016; Goel et al., 2020; Kanazawa et al., 2018; Kulkarni et al., 2020), semantics (Li et al., 2020), and poses (Bogo et al., 2016; Novotny et al., 2019) as shape priors have also been widely studied in category-specific reconstruction. Category-agnostic methods show great generalization potential (Yan et al., 2016; Niemeyer et al., 2020), but they often unable to produce fine-grained details even when exploiting spatially-aligned local image features (Xu et al., 2019; Yu et al., 2021).
|
| 29 |
+
|
| 30 |
+
Very recently, there is an emerging trend of using pre-trained image/language models (Radford et al., 2021; Li et al., 2022; 2023b; Saharia et al., 2022; Rombach et al., 2022), to introduce semantics and multi-view guidance for image-to-3D reconstruction (Liu et al., 2023b; Tang et al., 2023; Deng et al., 2023; Shen et al., 2023b; Anciukevicius et al., 2023; Melas-Kyriazi et al., 2023; Metzer et al., 2023; ˇ Xu et al., 2023; Qian et al., 2023; Li et al., 2023a). For instance, Zero-1-to-3 fine-tunes the Stable Diffusion model to generate novel views by conditioning on the input image and camera poses (Liu et al., 2023b); its view consistency and reconstruction efficiency have been further improved by Liu et al. (2023a). Make-It-3D (Tang et al., 2023) uses BLIP to generate text descriptions for the input image (which is applied to guide the text-to-image diffusion) and trains the model with score distillation sampling loss (Poole et al., 2022) and CLIP image loss to create geometrically and semantically plausible shapes.
|
| 31 |
+
|
| 32 |
+
In contrast to all these methods, our LRM is a purely data-driven approach that learns to reconstruct arbitrary objects in the wild. It is trained with minimal and extensible 3D supervision (i.e., rendered or captured 2D images of 3D objects) and does not rely on any guidance from pre-trained visionlanguage contrastive or generative models.
|
| 33 |
+
|
| 34 |
+
Learning 3D Representations from Images 3D reconstruction from a single image is an ill-posed problem that has been frequently addressed by models with generative properties. Many previous works apply an encoder-decoder framework to model the image-to-3D data distribution (Choy et al., 2016; Yan et al., 2016; Dai et al., 2017; Xu et al., 2019; Wu et al., 2020; Muller et al., 2022; Sajjadi ¨ et al., 2022; Goel et al., 2023), where a compact latent code is trained to carry the texture, geometry, and pose details of the target. However, learning such an expressive representation usually requires a capable network and abundant 3D data which is very expensive to acquire. Hence most of these methods only focus on a few categories and produce very coarse results. GINA-3D (Shen et al., 2023a) implements a model that applies a visual transformer encoder and cross-attention (instead of a transformer decoder as in LRM) to translate images to triplane representations. However, the model and training are much smaller in scale, and their work has a different focus on categoryspecific generation. Recent data-driven approach MCC (Wu et al., 2023) trains a generalizable transformer-based decoder with CO3D-v2 data (Reizenstein et al., 2021) to predict occupancy and color from the input image and its unprojected point cloud. Although MCC can handle real and generated images and scenes, the results are usually over-smooth and lose details.
|
| 35 |
+
|
| 36 |
+
Multimodal 3D Motivated by the great advances in 2D multimodal learning (Tan & Bansal, 2019; Chen et al., 2020; 2022b; Yu et al., 2022; Singh et al., 2022; Wang et al., 2022; Alayrac et al., 2022; Girdhar et al., 2023), LRM considers 3D as a new modality and directly grounds 2D feature maps onto 3D triplane via cross-attention. There are early attempts in this direction that minimize the difference between encoded image and 3D representations (Girdhar et al., 2016; Mandikal et al., 2018), as well as recent research, ULIP (Xue et al., 2023) and $\mathrm { C L I P ^ { 2 } }$ (Zeng et al., 2023), which bridges 3D, language, and images via contrastive learning. LERF (Kerr et al., 2023) learns a language field inside NeRF by rendering CLIP embeddings along training rays. In contrast, our method focuses on generic single image-to-3D reconstruction. We would like to mention the concurrent work Cap3D (Luo et al., 2023) that produces descriptions for 3D shapes by applying BLIP (Li et al., 2023b) to generate captions of different views, uses GPT-4 (OpenAI, 2023) to summarize them, and then employs these language-3D pairs for training text-to-3D generative models (Nichol et al., 2022; Poole et al., 2022; Jun & Nichol, 2023). There are also recent works in connecting 3D and large language models, such as 3D-LLM (Hong et al., 2023) and LLM-Grounder (Yang et al., 2023).
|
| 37 |
+
|
| 38 |
+
# 3 METHOD
|
| 39 |
+
|
| 40 |
+
In this section, we detail the proposed LRM architecture (Fig. 1). LRM contains an image encoder that encodes the input image to patch-wise feature tokens (Sec. 3.1), followed by an image-totriplane decoder that projects image features onto triplane tokens via cross-attention (Sec. 3.2). The output triplane tokens are upsampled and reshaped into the final triplane representation, which is used to query 3D point features. Lastly, the 3D point features are passed to a multi-layer perception to predict RGB and density for volumetric rendering (Sec. 3.3). The training objectives and data are described in Sec. 3.4 and Sec. 4.1.
|
| 41 |
+
|
| 42 |
+
# 3.1 IMAGE ENCODER
|
| 43 |
+
|
| 44 |
+
Given an RGB image as input, LRM first applies a pre-trained visual transformer (ViT) (Dosovitskiy et al., 2020) to encode the image to patch-wise feature tokens $\{ h _ { i } \} _ { i = 1 } ^ { n } \in \mathbb { R } ^ { d _ { E } }$ , where $i$ denotes the $i$ -th image patch, $n$ is the total number of patches, and $d _ { E }$ is the latent dimension of the encoder. Specifically, we use DINO (Caron et al., 2021), a model trained with self-distillation that learns interpretable attention over the structure and texture of the salient content in images. Compared to other semantic-oriented representations such as the visual features from ImageNet-pretrained ResNet (He et al., 2016) or CLIP (Radford et al., 2021), the detailed structural and texture information in DINO is more important in our case since LRM can use it to reconstruct the geometry and color in 3D space.
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 1: The overall architecture of LRM, a fully-differentiable transformer-based encoder-decoder framework for single-image to NeRF reconstruction. LRM applies a pre-trained vision model (DINO) to encode the input image (Sec. 3.1), where the image features are projected to a 3D triplane representation by a large transformer decoder via cross-attention (Sec. 3.2), followed by a multi-layer perceptron to predict the point color and density for volumetric rendering (Sec. 3.3). The entire network is trained end-to-end on around a million of 3D data (Sec. 4.1) with simple image reconstruction losses (Sec. 3.4).
|
| 48 |
+
|
| 49 |
+
As a result, instead of only using the ViT pre-defined class token [CLS] that aggregates patch-wise features, we also utilize the entire feature sequence $\{ h _ { i } \} _ { i = 1 } ^ { n }$ to better preserve this information2.
|
| 50 |
+
|
| 51 |
+
# 3.2 IMAGE-TO-TRIPLANE DECODER
|
| 52 |
+
|
| 53 |
+
We implement a transformer decoder to project image and camera features onto learnable spatialpositional embeddings and translate them to triplane representations. This decoder can be considered as a prior network that is trained with large-scale data to provide necessary geometric and appearance information to compensate for the ambiguities of single-image reconstruction.
|
| 54 |
+
|
| 55 |
+
Camera Features We construct the camera feature $\boldsymbol { c } \in \mathbb { R } ^ { 2 0 }$ of the input image by flattening out the 4-by-4 camera extrinsic matrix $\pmb { { \cal E } }$ (that represents the camera-to-world transformation) and concatenate it with the camera focal length foc and principal point $p p$ as $c = [ { E _ { 1 \times 1 6 } , f o c _ { x } , f o c _ { y } , p p _ { x } , p p _ { y } } ]$ . Moreover, we normalize the camera extrinsic $\pmb { \cal E }$ by similarity transformations so that all the input cameras are aligned on the same axis (with the lookup direction aligned with the $z$ -axis). Note that, LRM does not depend on a canonical pose of the object, and the ground truth $^ c$ is only applied in training. Conditioning on normalized camera parameters greatly reduces the optimization space of triplane features and facilitates model convergence (see details in Sec. 4.2). To embed the camera feature, we further implement a multi-layer perceptron (MLP) to map the camera feature to a highdimensional camera embedding c˜. The intrinsics (focal and principal point) are normalized by the image’s height and width before sending to the MLP layer.
|
| 56 |
+
|
| 57 |
+
Triplane Representation We follow previous works (Chan et al., 2022; Gao et al., 2022) to apply triplane as a compact and expressive feature representation of the reconstruction subject. A triplane $_ { \mathbf { T } }$ contains three axis-aligned feature planes $\pmb { T } _ { X Y }$ , $\mathbf { \Delta } \mathbf { T } _ { Y Z }$ and $\pmb { T } _ { X Z }$ . In our implementation, each plane is of dimension $( 6 4 \times 6 4 ) \times d _ { T }$ where $6 4 \times 6 4$ is the spatial resolution, and $d _ { T }$ is the number of feature channels. For any 3D point in the NeRF object bounding box $[ - 1 , 1 ] ^ { 3 }$ , we can project it onto each of the planes and query the corresponding point features $( T _ { x y } , T _ { y z } , T _ { x z } )$ via bilinear interpolation, which is then decoded by an $\mathrm { M L P } ^ { n e r f }$ into the NeRF color and density (Sec. 3.3).
|
| 58 |
+
|
| 59 |
+
To obtain the triplane representation $_ { \mathbf { T } }$ , we define learnable spatial-positional embeddings $f ^ { \mathit { i n i t } }$ of dimension $( 3 \times 3 2 \times 3 2 ) \times d _ { D }$ which guide the image-to-3D projection and are used to query the image features via cross-attention, where $d _ { D }$ is the hidden dimension of the transformer decoder. The number of tokens in $f ^ { i n i t }$ is smaller than the number of final triplane tokens $( 3 \times 6 4 \times 6 4 )$ ; we will upsample the output of the transformer $f ^ { o u t }$ to the final $\mathbf { T }$ . In the forward pass, conditioning on the camera features $\tilde { c }$ and image features $\{ h _ { i } \} _ { i = 1 } ^ { n }$ , each layer of our image-to-triplane transformer decoder gradually updates the initial positional embedding $f ^ { i n i t }$ to the final triplane features via modulation and cross-attention, respectively. The reason for applying two different conditional operations is that the camera controls the orientation and distortion of the whole shape, whereas the image features carry the fine-grained geometric and color information that need to be embedded onto the triplane. Details of the two operations are explained below.
|
| 60 |
+
|
| 61 |
+
Modulation with Camera Features Our camera modulation is inspired by DiT (Peebles & Xie, 2022) which implements an adaptive layer norm (adaLN) to modulate image latents with denoising timesteps and class labels. Suppose $\{ f _ { j } \}$ is a sequence of vectors in transformer, we define our modulation function $\operatorname { M o d L N } _ { \mathrm { c } } ( f _ { j } )$ with camera feature $^ c$ as
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\begin{array} { c } { { \gamma , \beta = \mathrm { M L P } ^ { \mathrm { m o d } } ( \tilde { c } ) } } \\ { { \mathrm { M o d L N } _ { \mathrm { c } } ( \mathbf { f } _ { j } ) = \mathrm { L N } ( \mathbf { f } _ { j } ) \cdot ( 1 + \gamma ) + \beta } } \end{array}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\gamma$ and $\beta$ are the scale and shift (Huang & Belongie, 2017) output by $\mathrm { M L P ^ { m o d } }$ and LN is the Layer Normalization (Ba et al., 2016). Such modulation is applied to each attention sub-layer which will be specified next.
|
| 68 |
+
|
| 69 |
+
Transformer Layers Each transformer layer contains a cross-attention sub-layer, a self-attention sub-layer, and a multi-layer perceptron sub-layer (MLP), where the input tokens to each sub-layer are modulated by the camera features. Suppose feature sequence $\pmb { f } ^ { i n }$ is the input of an transformer layer, we can consider $f ^ { i n }$ as the triplane hidden features since they are corresponding to the final triplane features $\mathbf { T }$ . As shown in the decoder part of Fig. 1, the cross-attention module firstly attends from the triplane hidden features $\pmb { f } ^ { i n }$ to the image features $\{ h _ { i } \} _ { i = 1 } ^ { n }$ , which can help linking image information to the triplane. Note that we here do not explicitly define any spatial alignment between the 2D images and 3D triplane hidden features, but consider 3D as an independent modality and ask the model to learn the 2D-to-3D correspondence by itself. The updated triplane hidden features will be passed to a self-attention sub-layer that further models the intra-modal relationships across the spatially-structured triplane entries. Then, a multi-layer perceptron sub-layer $\left( \mathrm { M L P } ^ { t f m \setminus } \right)$ follows as in the original Transformer (Vaswani et al., 2017) design. Lastly, the output triplane features $f ^ { o u t }$ will become the input to the next transformer layer.
|
| 70 |
+
|
| 71 |
+
Such a design is similar to the Perceiver network (Jaegle et al., 2021) while our model maintains a high-dimensional representation across the attention layers instead of projecting the input to a latent bottleneck. Overall, we can express this process for each $j$ -th triplane entry in each layer as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r l } & { \pmb { f } _ { j } ^ { c r o s s } = \mathrm { C r o s s A t t n } ( \mathrm { M o d L N } _ { c } ( \pmb { f } _ { j } ^ { i n } ) ; \{ \pmb { h } _ { i } \} _ { i = 1 } ^ { n } ) + \pmb { f } _ { j } ^ { i n } } \\ & { \pmb { f } _ { j } ^ { s e l f } = \mathrm { S e l f A t t n } ( \mathrm { M o d L N } _ { c } ( \pmb { f } _ { j } ^ { c r o s s } ) ; \{ \mathrm { M o d L N } _ { c } ( \pmb { f } _ { j } ^ { c r o s s } ) \} _ { j } ) + \pmb { f } _ { j } ^ { c r o s s } } \\ & { \pmb { f } _ { j } ^ { o u t } = \mathrm { M L P } ^ { t f m } ( \mathrm { M o d L N } _ { c } ( \pmb { f } _ { j } ^ { s e l f } ) ) + \pmb { f } _ { j } ^ { s e l f } } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
The ModLN operators in sub-layers (i.e., CrossAttn, SelfAttn, $\mathrm { M L P } ^ { t f m }$ ) use different set of learnable parameters in the layer normalization and the modulation $\mathrm { M L P } ^ { m o d }$ . We do not add additional superscript to differentiate them for clarity.
|
| 78 |
+
|
| 79 |
+
The transformer layers are processed sequentially. After all the transformer layers, we obtain the output triplane features $f ^ { \mathrm { o u t } }$ from the last layer as the output of the decoder. This final output is upsampled by a learnable de-convolution layer and reshaped to the final triplane representation $\mathbf { T }$ .
|
| 80 |
+
|
| 81 |
+
# 3.3 TRIPLANE-NERF
|
| 82 |
+
|
| 83 |
+
We employ the triplane-NeRF formulation (Chan et al., 2022) and implement an $\mathrm { M L P } ^ { n e r f }$ to predict RGB and density $\sigma$ from the point features queried from the triplane representation $_ { \mathbf { T } }$ . The $\mathrm { M L P } ^ { n e r f }$ contains multiple linear layers with ReLU (Nair & Hinton, 2010) activation. The output dimension of the $\mathrm { M L P } ^ { n e r f }$ is 4 where the first three dimensions are RGB colors and the last dimension corresponds to the density of the field. We refer to the Appendix for the details of NeRF volumetric rendering.
|
| 84 |
+
|
| 85 |
+
# 3.4 TRAINING OBJECTIVES
|
| 86 |
+
|
| 87 |
+
LRM produces the 3D shape from a single input image and leverages additional side views to guide the reconstruction during training. For each shape in the training data, we consider $( V - 1 )$ randomly chosen side views for supervision; we apply simple image reconstruction objectives between the $V$ rendered views $\hat { \pmb x }$ and the ground-truth views ${ \pmb x } ^ { \hat { G } T }$ (include the input view and side views). More precisely, for every input image $_ { \textbf { \em x } }$ , we minimize:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathcal { L } _ { \mathrm { r e c o n } } ( \pmb { x } ) = \frac { 1 } { V } \sum _ { v = 1 } ^ { V } \left( \mathcal { L } _ { \mathrm { M S E } } ( \hat { \pmb { x } } _ { v } , \pmb { x } _ { v } ^ { G T } ) + \lambda \mathcal { L } _ { \mathrm { L P I P S } } ( \hat { \pmb { x } } _ { v } , \pmb { x } _ { v } ^ { G T } ) \right)
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\mathcal { L } _ { \mathrm { M S E } }$ is the normalized pixel-wise L2 loss, $\mathcal { L } _ { \mathrm { L P I P S } }$ is the perceptual image patch similarity (Zhang et al., 2018) and $\lambda$ is a customized weight coefficient.
|
| 94 |
+
|
| 95 |
+
# 4 EXPERIMENTS
|
| 96 |
+
|
| 97 |
+
# 4.1 DATA
|
| 98 |
+
|
| 99 |
+
LRM relies on abundant 3D data from Objaverse (Deitke et al., 2023) and MVImgNet (Yu et al., 2023), consisting of synthetic 3D assets and videos of objects in the real world, respectively, to learn a generalizable cross-shape 3D prior. For each 3D asset in Objaverse, we normalize the shape to the box $[ - 1 , 1 ] ^ { 3 }$ in world space and render 32 random views with the same camera pointing toward the shape at arbitrary poses. The rendered images are of resolution $1 0 2 4 \times 1 0 2 4$ , and the camera poses are sampled from a ball of radius r1.5, 3.0s and with height in range $[ - 0 . 7 5 , 1 . 6 0 ] ^ { 3 }$ . For each video, we utilize the extracted frames from the dataset. Since the target shape in those frames can be at random positions, we crop and resize all of them using the predicted object mask4 so that the object is at the center of the resulting frames; we adjust the camera parameters accordingly. Note that our method does not model background, hence we render images from Objaverse with a pure white background, and use an off-the-shelf package4 to remove the background of video frames. In total, we pre-processed 730,648 3D assets and 220,219 videos for training.
|
| 100 |
+
|
| 101 |
+
To evaluate the performance of LRM on arbitrary images, we collected novel images from Objaverse (Deitke et al., 2023), MvImgNet (Yu et al., 2023), ImageNet (Deng et al., 2009), Google Scanned Objects (Downs et al., 2022), Amazon Berkeley Objects (Collins et al., 2022), captured new images in the real world, and generated images with Adobe Firefly5 for reconstruction. We visualize their results in Sec. 4.3.1 and Appendix. To numerically study the design choices of our approach, we randomly acquired 50 unseen 3D shapes from the Objaverse and 50 unseen videos from the MvImgNet dataset, respectively. For each shape, we pre-process 15 reference views and pass five of them to our model one by one to reconstruct the same object, and evaluate the rendered images using all 15 reference views (see analyses in Appendix).
|
| 102 |
+
|
| 103 |
+
# 4.2 IMPLEMENTATION DETAILS
|
| 104 |
+
|
| 105 |
+
Camera Normalization We normalize the camera poses corresponding to the input images to facilitate the image-to-triplane modeling. Specifically, for the images rendered from synthetic 3D assets in Objaverse, regardless of the corresponding positions of the cameras, we normalize the input camera poses to position $[ 0 , - 2 , 0 ]$ with the camera vertical axis aligned with the upward $z$ -axis in the world frame. For the video data, since the camera can be at an arbitrary distance from the target and the object is not at the image center, we only normalize the camera pose to $[ 0 , - d i s , 0 ]$ where dis is the original distance between world origin and camera origin.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 2: Rendered novel views (RGB and depth) of shapes reconstructed by our LRM from single images. None of the images are observed by the model during training. Generated images are created using Adobe Firefly. The last two rows compare our results to the rendered ground truth images of Objaverse objects (GT). Please zoom in for clearer visualization.
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 3: Comparison to One-2-3-45 (Liu et al., 2023a). To avoid cherry-picking, input images in the first three rows are selected from the examples provided in One-2-3-45’s paper or demo page. None of the images are observed by our model during training. Please zoom in for clearer visualization.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 4: Failure cases of our method. All three examples show blurry textures for occluded regions, and distortion due to the largely inaccurate assumption of the camera parameters.
|
| 115 |
+
|
| 116 |
+
Network Architecture We apply the ViT-B/16 model of pre-trained DINO as the image encoder, which takes $5 1 2 \times 5 1 2$ RGB images as input and produces 1025 feature tokens (1024 patch-wise features plus one [CLS] features) of dimension 768 $( d _ { E } )$ (Caron et al., 2021). The image-totriplane decoder and the $\mathrm { M L P } ^ { n e r f }$ are of 16 and 10 layers with hidden dimensions 1024 $( d _ { D } )$ and 64, respectively. The triplane dimension is 80 $( d _ { T } )$ . For neural rendering, LRM uniformly samples 128 points for each ray and renders $1 2 8 \times 1 2 8$ resolution images for supervision. We also use the deferred back-propagation introduced in ARF (Zhang et al., 2022) to save GPU memory.
|
| 117 |
+
|
| 118 |
+
Training We train LRM on 128 NVIDIA (40G) A100 GPUs with batch size 1024 (1024 different shapes per iteration) for 30 epochs, taking about 3 days to complete. Each epoch contains one copy of the rendered image data from Objaverse and three copies of the video frame data from MvImgNet to balance the amount of synthetic and real data. For each sample, we use 3 randomly chosen side views (i.e., the total views $V = 4$ ) to supervise the shape reconstruction, and we set the coefficient $\lambda { = } 2 . 0$ for $\mathcal { L } _ { \mathrm { L P I P S } }$ . We apply the AdamW optimizer (Loshchilov & Hutter, 2017) and set the learning rate to $4 \times 1 0 ^ { - 4 }$ with a cosine schedule (Loshchilov & Hutter, 2016). We numerically analyze the influence of data, training, and model hyper-parameters in the Appendix.
|
| 119 |
+
|
| 120 |
+
Inference During inference, LRM takes an arbitrary image as input (squared and background removed) and assumes the unknown camera parameters to be the normalized cameras that we applied to train the Objaverse data. We query a resolution of $3 8 4 \times 3 8 4 \times 3 8 4$ points from the reconstructed triplane-NeRF and extract the mesh using Marching Cubes (Lorensen & Cline, 1998). This entire process only takes less than 5 seconds to complete on a single NVIDIA A100 GPU.
|
| 121 |
+
|
| 122 |
+
# 4.3 RESULTS
|
| 123 |
+
|
| 124 |
+
We visualize the novel views of shapes reconstructed from real, generated, and rendered images from various datasets (Fig. 2), compare our method with a concurrent work (Liu et al., 2023a) (Fig. 3), and summarize some failure cases of our method (Sec. 4.3.2). Numerical comparisons to other methods, and analyses of data, model architecture, and supervision can be found in the Appendix.
|
| 125 |
+
|
| 126 |
+
Figure 2 visualizes some examples of the shapes reconstructed from single images. Overall, the results show very high fidelity for diverse inputs, including real, generated, and rendered images of various subjects with distinct textures. Not only is complex geometry correctly modeled (e.g. flower, flagon, and wipe), but also the high-frequency details, such as the texture of the wood peafowl, are preserved, both reflecting the great generalization ability of our model. From the asymmetric examples, giraffe, penguin, and bear, we can see that LRM can infer semantically reasonable occluded portion of the shapes, which implies effective cross-shape priors have been learned.
|
| 127 |
+
|
| 128 |
+
In Figure 3, we compare LRM with One-2-3-45, a concurrent work to ours that achieves stateof-the-art single image to 3D reconstruction by generating multi-view images with 2D diffusion models (Liu et al., 2023a). To avoid cherry-picking, we directly test our method on the example images provided in their paper or demo page6. We can see that our method produces much sharper details and consistent surfaces. In the last row of the figure, we test One-2-3-45 with two examples used in Figure 2, showing much worse reconstruction results.
|
| 129 |
+
|
| 130 |
+
# 4.3.2 LIMITATIONS
|
| 131 |
+
|
| 132 |
+
Despite the high-quality single-image-to-3D results we have shown, our method still has a few limitations. First, our LRM tends to produce blurry textures for occluded regions, as shown in Figure 4. We conjecture that this is due to the fact that the single-image-to-3D problem is inherently probabilistic, i.e., multiple plausible solutions exist for the unseen region, but our model is deterministic and is likely producing averaged modes of the unseens. Second, during inference time, we assign a set of fixed camera intrinsics and extrinsics (same as our Objaverse training data) to the test images. These camera parameters may not align well with the ground truth, especially when the images are cropped and resized, causing large changes to Field-of-View (FoV) and principal points. Figure 4 shows that incorrect assumptions of the camera parameters can lead to distorted shape reconstruction. Third, we only address images of objects without background; handling the background (Zhang et al., 2020; Barron et al., 2022), as well as complex scenes, is beyond the scope of this work. Finally, we assume Lambertian objects and omit the view-dependent modelling (Mildenhall et al., 2021) in our predicted NeRF. Therefore, we cannot faithfully reconstruct the view-dependent appearance of some real-world materials, e.g., shiny metals, glossy ceramics, etc.
|
| 133 |
+
|
| 134 |
+
# 5 CONCLUSION
|
| 135 |
+
|
| 136 |
+
In this paper, we propose LRM, the first large transformer-based framework to learn an expressive 3D prior from a million 3D data to reconstruct objects from single images. LRM is very efficient in training and inference; it is a fully-differentiable network that can be trained end-to-end with simple image reconstruction losses and only takes five seconds to render a high-fidelity 3D shape, thus enabling a wide range of real-world applications. In the era of large-scale learning, we hope our idea can inspire future research to explore data-driven 3D large reconstruction models that generalize well to arbitrary in-the-wild images.
|
| 137 |
+
|
| 138 |
+
Future Directions In addition to addressing the limitations mentioned in Sec. 4.3.2, we suggest two future directions of our research; (1) Scaling up the model and training data: with the simplest transformer-based design and minimal regularization, LRM can be easily scaled to a larger and more capable network, including but not limited to applying a larger image encoder, adding more attention layers to the image-to-triplane decoder, and increasing the resolution of triplane representations. On the other hand, LRM only requires multi-view images for supervision, hence a wide range of 3D, video, and image datasets can be exploited in training. We expect both approaches to be promising in improving the model’s generalization ability and the quality of reconstruction. (2) Extension to multimodal 3D generative models: LRM model builds a pathway for generating novel 3D shapes from language by leveraging a text-to-image generation model to first create 2D images. But more interestingly, we suggest the learned expressive triplane representations could be applied to directly bridge language descriptions and 3D to enable efficient text-to-3D generation and editing (e.g., via latent diffusion (Rombach et al., 2022)). We will explore these ideas in our future research.
|
| 139 |
+
|
| 140 |
+
# ETHICS STATEMENT
|
| 141 |
+
|
| 142 |
+
LRM proposed in this paper is a deterministic model in which, given the same image as input, the model will infer the identical 3D shape. Unlike generative models that can be used to easily synthesize various undesirable contents (e.g., from language inputs), LRM requests the specific 2D content to exist in the first place. LRM is trained on Objaverse (Deitke et al., 2023) and MvImgNet (Yu et al., 2023) data, which mostly contain ethical content. However, given an unethical or misleading image, LRM could produce unethical 3D objects or 3D disinformation that may be more convincing than the 2D input images (although the reconstructed objects are less realistic than real-world objects).
|
| 143 |
+
|
| 144 |
+
Image-to-3D reconstruction models like LRM hold the potential to automate tasks currently performed by 3D designers. However, it’s worth noting that these tools also have the capacity to foster growth and enhance accessibility within the creative industry.
|
| 145 |
+
|
| 146 |
+
# REPRODUCIBILITY STATEMENT
|
| 147 |
+
|
| 148 |
+
Our LRM is built by integrating the publicly available codebases of threestudio7 (Guo et al., 2023), x-transformers8, and $\mathrm { D I N O } ^ { \mathrm { 9 } }$ (Caron et al., 2021), and the model is trained using publicly available data from Objaverse (Deitke et al., 2023) and MvImgNet (Yu et al., 2023). We include very comprehensive data pre-processing, network architecture, and training details in this paper, which greatly facilitate reproducing our LRM.
|
| 149 |
+
|
| 150 |
+
# ACKNOWLEDGMENT
|
| 151 |
+
|
| 152 |
+
We want to thank Nathan Carr, Scott Cohen, Hailin Jin, Aseem Agarwala, Tong Sun for their support, and thank Duygu Ceylan, Zexiang Xu, Paul Guerrero, Chun-Hao Huang, Niloy Mitra, Radomir Mech, Vova Kim, Thibault Groueix for constructive feedback on this project. Hao wants to thank Xin for the inspiration as he ran on this road. Yicong wants to thank Prof. Stephen Gould and Ms. Ziwei Wang for their great advice.
|
| 153 |
+
|
| 154 |
+
# REFERENCES
|
| 155 |
+
|
| 156 |
+
Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. Advances in Neural Information Processing Systems, 35:23716– 23736, 2022.
|
| 157 |
+
|
| 158 |
+
Titas Anciukevicius, Zexiang Xu, Matthew Fisher, Paul Henderson, Hakan Bilen, Niloy J Mitra, and ˇ Paul Guerrero. Renderdiffusion: Image diffusion for 3d reconstruction, inpainting and generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12608–12618, 2023.
|
| 159 |
+
|
| 160 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 161 |
+
|
| 162 |
+
Jonathan T. Barron, Ben Mildenhall, Dor Verbin, Pratul P. Srinivasan, and Peter Hedman. Mip-nerf 360: Unbounded anti-aliased neural radiance fields. CVPR, 2022.
|
| 163 |
+
|
| 164 |
+
Federica Bogo, Angjoo Kanazawa, Christoph Lassner, Peter Gehler, Javier Romero, and Michael J Black. Keep it smpl: Automatic estimation of 3d human pose and shape from a single image. In Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part V 14, pp. 561–578. Springer, 2016.
|
| 165 |
+
|
| 166 |
+
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, 33:1877–1901, 2020.
|
| 167 |
+
|
| 168 |
+
Mathilde Caron, Hugo Touvron, Ishan Misra, Herve J ´ egou, Julien Mairal, Piotr Bojanowski, and ´ Armand Joulin. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9650–9660, 2021.
|
| 169 |
+
|
| 170 |
+
Eric R Chan, Connor Z Lin, Matthew A Chan, Koki Nagano, Boxiao Pan, Shalini De Mello, Orazio Gallo, Leonidas J Guibas, Jonathan Tremblay, Sameh Khamis, et al. Efficient geometry-aware 3d generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16123–16133, 2022.
|
| 171 |
+
Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
|
| 172 |
+
Anpei Chen, Zexiang Xu, Andreas Geiger, Jingyi Yu, and Hao Su. Tensorf: Tensorial radiance fields. In European Conference on Computer Vision (ECCV), 2022a.
|
| 173 |
+
Jun Chen, Han Guo, Kai Yi, Boyang Li, and Mohamed Elhoseiny. Visualgpt: Data-efficient adaptation of pretrained language models for image captioning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 18030–18040, 2022b.
|
| 174 |
+
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 European conference on computer vision, pp. 104–120. Springer, 2020.
|
| 175 |
+
Zhiqin Chen and Hao Zhang. Learning implicit fields for generative shape modeling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5939–5948, 2019.
|
| 176 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
|
| 177 |
+
Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3d-r2n2: A unified approach for single and multi-view 3d object reconstruction. In Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part VIII 14, pp. 628–644. Springer, 2016.
|
| 178 |
+
Jasmine Collins, Shubham Goel, Kenan Deng, Achleshwar Luthra, Leon Xu, Erhan Gundogdu, Xi Zhang, Tomas F Yago Vicente, Thomas Dideriksen, Himanshu Arora, et al. Abo: Dataset and benchmarks for real-world 3d object understanding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 21126–21136, 2022.
|
| 179 |
+
Angela Dai, Charles Ruizhongtai Qi, and Matthias Nießner. Shape completion using 3d-encoderpredictor cnns and shape synthesis. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5868–5877, 2017.
|
| 180 |
+
Matt Deitke, Dustin Schwenk, Jordi Salvador, Luca Weihs, Oscar Michel, Eli VanderBilt, Ludwig Schmidt, Kiana Ehsani, Aniruddha Kembhavi, and Ali Farhadi. Objaverse: A universe of annotated 3d objects. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13142–13153, 2023.
|
| 181 |
+
Congyue Deng, Chiyu Jiang, Charles R Qi, Xinchen Yan, Yin Zhou, Leonidas Guibas, Dragomir Anguelov, et al. Nerdi: Single-view nerf synthesis with language-guided diffusion as general image priors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 20637–20647, 2023.
|
| 182 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
|
| 183 |
+
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.
|
| 184 |
+
|
| 185 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 186 |
+
|
| 187 |
+
Laura Downs, Anthony Francis, Nate Koenig, Brandon Kinman, Ryan Hickman, Krista Reymann, Thomas B McHugh, and Vincent Vanhoucke. Google scanned objects: A high-quality dataset of 3d scanned household items. In 2022 International Conference on Robotics and Automation (ICRA), pp. 2553–2560. IEEE, 2022.
|
| 188 |
+
Haoqiang Fan, Hao Su, and Leonidas J Guibas. A point set generation network for 3d object reconstruction from a single image. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 605–613, 2017.
|
| 189 |
+
Jun Gao, Tianchang Shen, Zian Wang, Wenzheng Chen, Kangxue Yin, Daiqing Li, Or Litany, Zan Gojcic, and Sanja Fidler. Get3d: A generative model of high quality 3d textured shapes learned from images. Advances In Neural Information Processing Systems, 35:31841–31854, 2022.
|
| 190 |
+
Rohit Girdhar, David F Fouhey, Mikel Rodriguez, and Abhinav Gupta. Learning a predictable and generative vector representation for objects. In Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part VI 14, pp. 484–499. Springer, 2016.
|
| 191 |
+
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 Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15180–15190, 2023.
|
| 192 |
+
Georgia Gkioxari, Jitendra Malik, and Justin Johnson. Mesh r-cnn. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9785–9795, 2019.
|
| 193 |
+
Shubham Goel, Angjoo Kanazawa, and Jitendra Malik. Shape and viewpoint without keypoints. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part XV 16, pp. 88–104. Springer, 2020.
|
| 194 |
+
Shubham Goel, Georgios Pavlakos, Jathushan Rajasegaran, Angjoo Kanazawa, and Jitendra Malik. Humans in 4d: Reconstructing and tracking humans with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 14783–14794, 2023.
|
| 195 |
+
Yuan-Chen Guo, Ying-Tian Liu, Ruizhi Shao, Christian Laforte, Vikram Voleti, Guan Luo, ChiaHao Chen, Zi-Xin Zou, Chen Wang, Yan-Pei Cao, and Song-Hai Zhang. threestudio: A unified framework for 3d content generation. https://github.com/threestudio-project/ threestudio, 2023.
|
| 196 |
+
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, pp. 770–778, 2016.
|
| 197 |
+
Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus), 2023.
|
| 198 |
+
Yining Hong, Haoyu Zhen, Peihao Chen, Shuhong Zheng, Yilun Du, Zhenfang Chen, and Chuang Gan. 3d-llm: Injecting the 3d world into large language models. arXiv, 2023.
|
| 199 |
+
Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In Proceedings of the IEEE international conference on computer vision, pp. 1501–1510, 2017.
|
| 200 |
+
Andrew Jaegle, Felix Gimeno, Andy Brock, Oriol Vinyals, Andrew Zisserman, and Joao Carreira. Perceiver: General perception with iterative attention. In International conference on machine learning, pp. 4651–4664. PMLR, 2021.
|
| 201 |
+
Wonbong Jang and Lourdes Agapito. Codenerf: Disentangled neural radiance fields for object categories. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 12949–12958, 2021.
|
| 202 |
+
Heewoo Jun and Alex Nichol. Shap-e: Generating conditional 3d implicit functions. arXiv preprint arXiv:2305.02463, 2023.
|
| 203 |
+
Angjoo Kanazawa, Shubham Tulsiani, Alexei A Efros, and Jitendra Malik. Learning categoryspecific mesh reconstruction from image collections. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 371–386, 2018.
|
| 204 |
+
Justin Kerr, Chung Min Kim, Ken Goldberg, Angjoo Kanazawa, and Matthew Tancik. Lerf: Language embedded radiance fields. arXiv preprint arXiv:2303.09553, 2023.
|
| 205 |
+
Nilesh Kulkarni, Abhinav Gupta, David F Fouhey, and Shubham Tulsiani. Articulation-aware canonical surface mapping. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 452–461, 2020.
|
| 206 |
+
Jiahao Li, Hao Tan, Kai Zhang, Zexiang Xu, Fujun Luan, Yinghao Xu, Yicong Hong, Kalyan Sunkavalli, Greg Shakhnarovich, and Sai Bi. Instant3d: Fast text-to-3d with sparse-view generation and large reconstruction model. arXiv preprint arXiv:2311.06214, 2023a.
|
| 207 |
+
Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. Blip: Bootstrapping language-image pretraining for unified vision-language understanding and generation. In International Conference on Machine Learning, pp. 12888–12900. PMLR, 2022.
|
| 208 |
+
Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping languageimage pre-training with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597, 2023b.
|
| 209 |
+
Xueting Li, Sifei Liu, Kihwan Kim, Shalini De Mello, Varun Jampani, Ming-Hsuan Yang, and Jan Kautz. Self-supervised single-view 3d reconstruction via semantic consistency. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part XIV 16, pp. 677–693. Springer, 2020.
|
| 210 |
+
Minghua Liu, Chao Xu, Haian Jin, Linghao Chen, Zexiang Xu, Hao Su, et al. One-2-3-45: Any single image to 3d mesh in 45 seconds without per-shape optimization. arXiv preprint arXiv:2306.16928, 2023a.
|
| 211 |
+
Ruoshi Liu, Rundi Wu, Basile Van Hoorick, Pavel Tokmakov, Sergey Zakharov, and Carl Vondrick. Zero-1-to-3: Zero-shot one image to 3d object. arXiv preprint arXiv:2303.11328, 2023b.
|
| 212 |
+
William E Lorensen and Harvey E Cline. Marching cubes: A high resolution 3d surface construction algorithm. In Seminal graphics: pioneering efforts that shaped the field, pp. 347–353. 1998.
|
| 213 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 214 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
|
| 215 |
+
Tiange Luo, Chris Rockwell, Honglak Lee, and Justin Johnson. Scalable 3d captioning with pretrained models. arXiv preprint arXiv:2306.07279, 2023.
|
| 216 |
+
Priyanka Mandikal, KL Navaneet, Mayank Agarwal, and R Venkatesh Babu. 3d-lmnet: Latent embedding matching for accurate and diverse 3d point cloud reconstruction from a single image. arXiv preprint arXiv:1807.07796, 2018.
|
| 217 |
+
Luke Melas-Kyriazi, Iro Laina, Christian Rupprecht, and Andrea Vedaldi. Realfusion: 360deg reconstruction of any object from a single image. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8446–8455, 2023.
|
| 218 |
+
Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4460–4470, 2019.
|
| 219 |
+
Gal Metzer, Elad Richardson, Or Patashnik, Raja Giryes, and Daniel Cohen-Or. Latent-nerf for shape-guided generation of 3d shapes and textures. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12663–12673, 2023.
|
| 220 |
+
Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. Communications of the ACM, 65(1):99–106, 2021.
|
| 221 |
+
Paritosh Mittal, Yen-Chi Cheng, Maneesh Singh, and Shubham Tulsiani. Autosdf: Shape priors for 3d completion, reconstruction and generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 306–315, 2022.
|
| 222 |
+
Norman Muller, Andrea Simonelli, Lorenzo Porzi, Samuel Rota Bulo, Matthias Nießner, and Peter ¨ Kontschieder. Autorf: Learning 3d object radiance fields from single view observations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3971– 3980, 2022.
|
| 223 |
+
Thomas Muller, Alex Evans, Christoph Schied, and Alexander Keller. Instant neural graphics prim- ¨ itives with a multiresolution hash encoding. ACM Trans. Graph., 41(4):102:1–102:15, July 2022. doi: 10.1145/3528223.3530127. URL https://doi.org/10.1145/3528223. 3530127.
|
| 224 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pp. 807–814, 2010.
|
| 225 |
+
Alex Nichol, Heewoo Jun, Prafulla Dhariwal, Pamela Mishkin, and Mark Chen. Point-e: A system for generating 3d point clouds from complex prompts. arXiv preprint arXiv:2212.08751, 2022.
|
| 226 |
+
Michael Niemeyer, Lars Mescheder, Michael Oechsle, and Andreas Geiger. Differentiable volumetric rendering: Learning implicit 3d representations without 3d supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3504–3515, 2020.
|
| 227 |
+
David Novotny, Nikhila Ravi, Benjamin Graham, Natalia Neverova, and Andrea Vedaldi. C3dpo: Canonical 3d pose networks for non-rigid structure from motion. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7688–7697, 2019.
|
| 228 |
+
OpenAI. Gpt-4 technical report, 2023.
|
| 229 |
+
Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 165–174, 2019.
|
| 230 |
+
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, highperformance deep learning library. Advances in neural information processing systems, 32, 2019.
|
| 231 |
+
William Peebles and Saining Xie. Scalable diffusion models with transformers. arXiv preprint arXiv:2212.09748, 2022.
|
| 232 |
+
Ben Poole, Ajay Jain, Jonathan T Barron, and Ben Mildenhall. Dreamfusion: Text-to-3d using 2d diffusion. arXiv preprint arXiv:2209.14988, 2022.
|
| 233 |
+
Guocheng Qian, Jinjie Mai, Abdullah Hamdi, Jian Ren, Aliaksandr Siarohin, Bing Li, HsinYing Lee, Ivan Skorokhodov, Peter Wonka, Sergey Tulyakov, et al. Magic123: One image to high-quality 3d object generation using both 2d and 3d diffusion priors. arXiv preprint arXiv:2306.17843, 2023.
|
| 234 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 235 |
+
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, pp. 8748–8763. PMLR, 2021.
|
| 236 |
+
|
| 237 |
+
Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In International Conference on Machine Learning, pp. 8821–8831. PMLR, 2021.
|
| 238 |
+
|
| 239 |
+
Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical textconditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022.
|
| 240 |
+
Jeremy Reizenstein, Roman Shapovalov, Philipp Henzler, Luca Sbordone, Patrick Labatut, and David Novotny. Common objects in 3d: Large-scale learning and evaluation of real-life 3d category reconstruction. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 10901–10911, 2021.
|
| 241 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High- ¨ resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684–10695, 2022.
|
| 242 |
+
Joseph Roth, Yiying Tong, and Xiaoming Liu. Adaptive 3d face reconstruction from unconstrained photo collections. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4197–4206, 2016.
|
| 243 |
+
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghasemipour, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in Neural Information Processing Systems, 35:36479–36494, 2022.
|
| 244 |
+
Mehdi SM Sajjadi, Henning Meyer, Etienne Pot, Urs Bergmann, Klaus Greff, Noha Radwan, Suhani Vora, Mario Luciˇ c, Daniel Duckworth, Alexey Dosovitskiy, et al. Scene representation trans- ´ former: Geometry-free novel view synthesis through set-latent scene representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6229–6238, 2022.
|
| 245 |
+
Bokui Shen, Xinchen Yan, Charles R Qi, Mahyar Najibi, Boyang Deng, Leonidas Guibas, Yin Zhou, and Dragomir Anguelov. Gina-3d: Learning to generate implicit neural assets in the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4913–4926, 2023a.
|
| 246 |
+
Qiuhong Shen, Xingyi Yang, and Xinchao Wang. Anything-3d: Towards single-view anything reconstruction in the wild. arXiv preprint arXiv:2304.10261, 2023b.
|
| 247 |
+
Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela. Flava: A foundational language and vision alignment model. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15638–15650, 2022.
|
| 248 |
+
Cheng Sun, Min Sun, and Hwann-Tzong Chen. Direct voxel grid optimization: Super-fast convergence for radiance fields reconstruction. In CVPR, 2022.
|
| 249 |
+
Hao Tan and Mohit Bansal. Lxmert: Learning cross-modality encoder representations from transformers. arXiv preprint arXiv:1908.07490, 2019.
|
| 250 |
+
Junshu Tang, Tengfei Wang, Bo Zhang, Ting Zhang, Ran Yi, Lizhuang Ma, and Dong Chen. Make-it-3d: High-fidelity 3d creation from a single image with diffusion prior. arXiv preprint arXiv:2303.14184, 2023.
|
| 251 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee´ Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and \` efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
|
| 252 |
+
Shubham Tulsiani, Tinghui Zhou, Alexei A Efros, and Jitendra Malik. Multi-view supervision for single-view reconstruction via differentiable ray consistency. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2626–2634, 2017.
|
| 253 |
+
|
| 254 |
+
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.
|
| 255 |
+
|
| 256 |
+
Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei Liu, and Yu-Gang Jiang. Pixel2mesh: Generating 3d mesh models from single rgb images. In Proceedings of the European conference on computer vision (ECCV), pp. 52–67, 2018.
|
| 257 |
+
Yi Wang, Kunchang Li, Yizhuo Li, Yinan He, Bingkun Huang, Zhiyu Zhao, Hongjie Zhang, Jilan Xu, Yi Liu, Zun Wang, et al. Internvideo: General video foundation models via generative and discriminative learning. arXiv preprint arXiv:2212.03191, 2022.
|
| 258 |
+
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.
|
| 259 |
+
Chao-Yuan Wu, Justin Johnson, Jitendra Malik, Christoph Feichtenhofer, and Georgia Gkioxari. Multiview compressive coding for 3d reconstruction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9065–9075, 2023.
|
| 260 |
+
Rundi Wu, Yixin Zhuang, Kai Xu, Hao Zhang, and Baoquan Chen. Pq-net: A generative part seq2seq network for 3d shapes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 829–838, 2020.
|
| 261 |
+
Dejia Xu, Yifan Jiang, Peihao Wang, Zhiwen Fan, Yi Wang, and Zhangyang Wang. Neurallift-360: Lifting an in-the-wild 2d photo to a 3d object with 360deg views. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4479–4489, 2023.
|
| 262 |
+
Qiangeng Xu, Weiyue Wang, Duygu Ceylan, Radomir Mech, and Ulrich Neumann. Disn: Deep implicit surface network for high-quality single-view 3d reconstruction. Advances in neural information processing systems, 32, 2019.
|
| 263 |
+
Le Xue, Mingfei Gao, Chen Xing, Roberto Mart´ın-Mart´ın, Jiajun Wu, Caiming Xiong, Ran Xu, Juan Carlos Niebles, and Silvio Savarese. Ulip: Learning a unified representation of language, images, and point clouds for 3d understanding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1179–1189, 2023.
|
| 264 |
+
Xinchen Yan, Jimei Yang, Ersin Yumer, Yijie Guo, and Honglak Lee. Perspective transformer nets: Learning single-view 3d object reconstruction without 3d supervision. Advances in neural information processing systems, 29, 2016.
|
| 265 |
+
Jianing Yang, Xuweiyi Chen, Shengyi Qian, Nikhil Madaan, Madhavan Iyengar, David F. Fouhey, and Joyce Chai. Llm-grounder: Open-vocabulary 3d visual grounding with large language model as an agent, 2023.
|
| 266 |
+
Alex Yu, Vickie Ye, Matthew Tancik, and Angjoo Kanazawa. pixelnerf: Neural radiance fields from one or few images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4578–4587, 2021.
|
| 267 |
+
Jiahui Yu, Zirui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, and Yonghui Wu. Coca: Contrastive captioners are image-text foundation models. arXiv preprint arXiv:2205.01917, 2022.
|
| 268 |
+
Xianggang Yu, Mutian Xu, Yidan Zhang, Haolin Liu, Chongjie Ye, Yushuang Wu, Zizheng Yan, Chenming Zhu, Zhangyang Xiong, Tianyou Liang, et al. Mvimgnet: A large-scale dataset of multi-view images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9150–9161, 2023.
|
| 269 |
+
Yihan Zeng, Chenhan Jiang, Jiageng Mao, Jianhua Han, Chaoqiang Ye, Qingqiu Huang, Dit-Yan Yeung, Zhen Yang, Xiaodan Liang, and Hang Xu. Clip2: Contrastive language-image-point pretraining from real-world point cloud data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15244–15253, 2023.
|
| 270 |
+
Kai Zhang, Gernot Riegler, Noah Snavely, and Vladlen Koltun. Nerf+ $^ +$ : Analyzing and improving neural radiance fields. arXiv preprint arXiv:2010.07492, 2020.
|
| 271 |
+
Kai Zhang, Nick Kolkin, Sai Bi, Fujun Luan, Zexiang Xu, Eli Shechtman, and Noah Snavely. Arf: Artistic radiance fields. In European Conference on Computer Vision, pp. 717–733. Springer, 2022.
|
| 272 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
|
| 273 |
+
|
| 274 |
+
# APPENDICES
|
| 275 |
+
|
| 276 |
+
# A BACKGROUND OF MODEL COMPONENTS
|
| 277 |
+
|
| 278 |
+
A.1 NERF
|
| 279 |
+
|
| 280 |
+
We adopt NeRF (Mildenhall et al., 2021), specifically the compact triplane NeRF variant (Chan et al., 2022), as our 3D representation to predict in LRM. NeRF, when coupled with differentiable volume rendering, can be optimized with just image reconstruction losses.
|
| 281 |
+
|
| 282 |
+
At the core of NeRF (Mildenhall et al., 2021) and its variants (Chan et al., 2022; Chen et al., 2022a; Muller et al., 2022; Sun et al., 2022) is a spatially-varying color (modeling appearance) and density ¨ (modeling geometry) field function. 10 Given a 3D point $\mathbf { p }$ , the color and density field $( \mathbf { u } , \sigma )$ can be written as:
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
( \mathbf { u } , \sigma ) = \mathrm { M L P } ^ { n e r f } ( f _ { \theta } ( \mathbf { p } ) ) ,
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
where the spatial encoding $f _ { \theta }$ is used to facilitate the $\mathrm { M L P } ^ { n e r f }$ to learn high-frequency signals. Different NeRF variants (Chan et al., 2022; Chen et al., $2 0 2 2 \mathrm { a }$ ; Muller et al., 2022; Sun et al., 2022) ¨ typically differ from each other in terms of the choice of the spatial encoding and the size of the MLP. In this work, we use the triplane spatial encoding function proposed by EG3D (Chan et al., 2022), because of its low tokenization complexity $( \bar { O ( N ^ { 2 } ) }$ as opposed to a voxel grid’s $O ( N ^ { 3 } )$ complexity, where $N$ is spatial resolution).
|
| 289 |
+
|
| 290 |
+
Images are rendered from NeRF using volume rendering that’s trivially differentiable. In detail, for each pixel to render, we cast a ray $\mathbf { r }$ through a NeRF, and use finite point samples $\mathbf { p } _ { i }$ along the ray to compute the volume rendering integral to get the rendered color $\mathbf { u } ( \mathbf { r } )$ :
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array} { l } { { \displaystyle { \bf u } ( { \bf r } ) = \sum _ { i } T _ { i } \big ( 1 - \exp ( - \sigma _ { i } \delta _ { i } ) \big ) { \bf u } _ { i } } , \ ~ } \\ { { \displaystyle T _ { i } = \exp ( - \sum _ { j = 1 } ^ { i - 1 } \sigma _ { j } \delta _ { j } ) } , \ ~ } \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
where $( \mathbf { u } _ { i } , \sigma _ { i } ) = \mathrm { M L P } _ { \phi } ( f _ { \theta } ( \mathbf { p } _ { i } ) )$ and $\delta _ { i }$ is the distance between point $\mathbf { p } _ { i }$ and $\mathbf { p } _ { i + 1 }$
|
| 297 |
+
|
| 298 |
+
# A.2 TRANSFORMER LAYERS
|
| 299 |
+
|
| 300 |
+
In this subsection, we provide the details of the layers used in the transformer decoder (Vaswani et al., 2017) as a background. For the Vision Transformer encoder, please refer to the original DINO paper (Caron et al., 2021) for implementation details.
|
| 301 |
+
|
| 302 |
+
Attention operator Attention operator is an expressive neural operator which converts an input feature $x$ with condition to a sequence of other features $\left\{ y _ { i } \right\}$ . It first computes the attention score $\alpha _ { i }$ by using the dot product between the input $x$ and each condition feature $y _ { i }$ . An additional softmax is added after the dot products to normalize the weights to a summation of 1. This attention score measures the relationship between input and conditions. Then the output is the weighted summation of the conditions $\left\{ y _ { i } \right\}$ with respect to the attention score $\alpha _ { i }$ .
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { r } { \alpha _ { i } = \mathrm { s o f t m a x } _ { i } \{ x ^ { \top } y _ { i } \} } \\ { \mathrm { A t t n } ( x ; \{ y _ { i } \} _ { i } ) = \displaystyle \sum _ { i } \alpha _ { i } y _ { i } } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
For some specific cases (e.g., in the transformer attention layer below), the attention operator wants to differentiate the vectors used in calculating the attention score and the vectors for final outputs. Thus it will introduce another set of ‘value’ vectors $\{ z _ { i } \} _ { i }$ , and treat the $\{ y _ { i } \} _ { i }$ as corresponding ‘key’ vectors. Taking this into consideration, the formula would become
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\begin{array} { c } { \displaystyle \alpha _ { i } = \mathrm { s o f t m a x } _ { i } \{ { x ^ { \top } y _ { i } } \} } \\ { \displaystyle \mathrm { A t t n } ( x ; \{ y _ { i } \} _ { i } , \{ z _ { i } \} _ { i } ) = \sum _ { i } \alpha _ { i } z _ { i } } \end{array}
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 5: Visual illustration of the cross-attention and self-attention in LRM’s image-to-triplane decoder.
|
| 316 |
+
|
| 317 |
+
Multi-head Attention The attention operator described above only attends to the condition features once to get the attention vector. However, the actual attention might contain multiple modes. Thus, the multi-head attention (Vaswani et al., 2017) is proposed. The multi-head attention is implemented by first splitting the input features into smaller queries.
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
[ x ^ { 1 } , \ldots , x ^ { n h } ] = x
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
where nh is the number of heads. Meanwhile, $y _ { i }$ and $z _ { i }$ are split into $\{ y _ { i } ^ { k } \} _ { k }$ and $\{ z _ { i } ^ { k } \} _ { k }$ in a similar way. After that, the output of each head is computed independently and the final output is a concatenation of heads’ outputs.
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { c } { o u t ^ { k } = \mathrm { A t t n } ( x ^ { k } ; \{ y _ { i } ^ { k } \} _ { i } , \{ z _ { i } ^ { k } \} _ { i } ) } \\ { \mathrm { M u l t i H e a d A t t n } ( x ; \{ y _ { i } \} _ { i } , \{ z _ { i } \} _ { i } ) = [ o u t ^ { 1 } , \dots , o u t ^ { n h } ] } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
Attention Layers in Transformer The detailed attention layers in transformer utilize the above multi-head attention with more linear layers. Here are the formulas for the self-attention layer (see the right yellow ‘Self-Attention’ block in Fig. 5). The layer first projects the input feature sequence $f = \{ f _ { j } \} _ { j }$ to query $q$ , key $k$ , and value $v$ vectors with linear layers. Then the multi-head attention is applied. There is one more linear layer over the output. We also follow the recent papers (Chowdhery et al., 2022; Touvron et al., 2023) to remove the bias terms in the attention layers.
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\begin{array} { r l } & { q _ { j } = W _ { \mathrm { q } } f _ { j } } \\ & { k _ { i } = W _ { \mathrm { k } } f _ { i } } \\ & { v _ { i } = W _ { \mathrm { v } } f _ { i } } \\ & { o _ { j } = \mathrm { M u l t i H e a d A t t n } ( q _ { j } ; \{ k _ { i } \} _ { i } , \{ v _ { i } \} _ { i } ) } \\ & { \mathrm { S e l f A t t n } ( f _ { j } ; \{ f _ { j } \} _ { j } ) = W _ { \mathrm { o u t } } o _ { j } } \end{array}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
The cross-attention layer is defined similarly (see the left blue ‘Cross-Attention’ block in Fig. 5). The only difference to the self-attention layer is that the $W _ { \mathrm { k } }$ and $W _ { \mathrm { v } }$ is applied to the condition vectors (e.g., the image features $h$ in our example).
|
| 336 |
+
|
| 337 |
+
MLP layers in Transformer The Transformer model architecture applies the MLP layer (multilayer perceptron) to do channel mixing (i.e., mix the information from different feature dimensions). We follow the original transformer paper (Vaswani et al., 2017) for the implementation. The MLP layer contains two linear layers with a GELU (Hendrycks & Gimpel, 2023) activation in between. The intermediate hidden dimension is 4 times of the model dimension.
|
| 338 |
+
|
| 339 |
+
Layer Normalization We take the default LayerNorm (LN) implementation in PyTorch (Paszke et al., 2019). Besides the LN layers in ModLN as in Sec. 3.2, we follow the Pre-LN architecture to also apply LN to the final output of transformers, e.g., the output of ViT and also the output of transformer decoder.
|
| 340 |
+
|
| 341 |
+
Positional Encoding The positional embedding in ViT (Dosovitskiy et al., 2020) is bilinearly upsampled from its original resolution ( $1 4 \times 1 4$ for input $2 2 4 \times 2 2 4$ ) to match our higher input resolution $3 2 \times 3 2$ for input $5 1 2 \times 5 1 2$ ).
|
| 342 |
+
|
| 343 |
+
# B TRAINING SETUP
|
| 344 |
+
|
| 345 |
+
We specify the training setup of our LRM. Apart from the information that we provided in Sec. 4.2, we apply a cosine schedule (Loshchilov & Hutter, 2016) with 3000 warm-up iterations. We set the second beta parameter $( \beta _ { 2 } )$ of the AdamW optimizer (Loshchilov & Hutter, 2017) to be 0.95. We apply a gradient clipping of 1.0 and a weight decay of 0.05. The weight decay are only applied on the weights that are not bias and not in the layer normalization layer. We use BF16 precision in in the mixed precision training. To save computational cost in training, we resize the reference novel views from $5 1 2 \times 5 1 2$ to a randomly chosen resolution between $1 2 8 \times 1 2 8$ and $3 8 4 \times 3 8 4$ and only ask the model to reconstruct a randomly selected $1 2 8 \times 1 2 8$ region. With this design, we can possibly increase the effective resolution of the model.
|
| 346 |
+
|
| 347 |
+
# C COMPARISON WITH SOTA
|
| 348 |
+
|
| 349 |
+
We provide a quantitative comparison to the stat-of-the-art methods Point-E (Nichol et al., 2022), Shap-E (Jun & Nichol, 2023), and One-2-3-45 (Liu et al., 2023a). Point-E trains an image-to-3D point cloud diffusion model, Shap-E encodes point clouds to latent representations and trains a diffusion model on the latents to generate parameters of a 3D implicit function, and One-2-3-45 reconstructs multi-view images generated with a 2D diffusion model. We randomly selected 100 objects from the Google Scanned Objects (GSO) dataset (Downs et al., 2022) and measured the novel view synthetic quality of 20 reference views (FID, CLIP-Similarity (Radford et al., 2021), PSNR, LPIPS (Zhang et al., 2018)) and the geometric quality (Chamfer Distance), as shown in the Table below. We can see that our LRM consistently outperforms previous approaches in all metrics.
|
| 350 |
+
|
| 351 |
+
Table 1: Comparison between LRM and state-of-the-art 3D generative models on Google Scanned Objects dataset (100 randomly selected objects and 20 reference views).
|
| 352 |
+
|
| 353 |
+
<table><tr><td rowspan="2">Models</td><td colspan="5">GSO Evaluation</td></tr><tr><td>FID↓</td><td>CLIP-Similarity↑</td><td>PSNR↑</td><td>LPIPS↓</td><td>Chamfer Distance↓</td></tr><tr><td>Point-E</td><td>123.70</td><td>0.741</td><td>15.60</td><td>0.308</td><td>0.099</td></tr><tr><td>Shap-E</td><td>97.05</td><td>0.805</td><td>14.36</td><td>0.289</td><td>0.085</td></tr><tr><td>One-2-3-45</td><td>139.24</td><td>0.713</td><td>12.42</td><td>0.448</td><td>0.123</td></tr><tr><td>LRM (ours)</td><td>31.44</td><td>0.902</td><td>19.60</td><td>0.163</td><td>0.053</td></tr></table>
|
| 354 |
+
|
| 355 |
+
We would like to discuss further the difference between LRM and the large-scale approaches PointE and Shap-E. The models of Point-E and Shap-E contain hundreds of millions of learnable parameters and are trained with several million 3D assets (unknown data source and unknown computational cost from their papers). In terms of the network and dataset sizes, our LRM has 500 million learnable parameters, and it is trained on 1 million 3D data (publicly accessible), which does not show an advantage. In terms of the network architecture, Point-E, Shap-E, and LRM all use transformer-based models and apply cross-attention for inter-modality modeling (i.e., image-topoint cloud, point cloud+image-to-3D latents, and image-to-triplane, respectively). We hypothesize it is the choice of very compact and expressive triplane representation together with an end-to-end trainable framework that enables the effective scaling of LRM and its adequate learning on large datasets (Objaverse and MvImgNet). Compared to the unstructured point cloud representation applied in Point-E and Shap-E, LRM applies the structured triplane representation that is aligned with the world frame, which naturally facilitates 2D-to-3D projection. It is also worth mentioning that Point-E uses 4K points (as tokens) and Shap-E uses 16K points (as tokens), but our LRM only uses
|
| 356 |
+
|
| 357 |
+
$3 { \times } 3 2 { \times } 3 2 { = } 3 0 7 2$ triplane tokens, which largely reduce the modeling complexity. Additionally, compared to the two-stage approach in Shape-E, which attempts to generate latents that can produce the parameters of implicit 3D functions through a diffusion model, our LRM directly maps 2D images to triplanes, which should be much more stable and efficient to learn. Overall, we suggest that LRM is a more data-friendly and efficient model than Point-E and Shap-E.
|
| 358 |
+
|
| 359 |
+
# D ANALYSES
|
| 360 |
+
|
| 361 |
+
We evaluate the effect of data, model hyper-parameters, and training methods on the performance of LRM, measuring by PSNR, CLIP-Similarity (Radford et al., 2021), SSIM (Wang et al., 2004) and LPIPS (Zhang et al., 2018) of the rendered novel views. Note that due to the large training cost of our final model, the following analytic experiments use a much smaller version of LRM model as the baseline (indicated by orange shaded rows in the tables). Specifically, we scale down the image-to-triplane decoder to 12 cross-attention layers, change the input image resolution to 256, triplane latent dimension to 32, rendering resolution in training to 64, and use 96 samples per ray for rendering $6 4 \times 6 4$ images for supervision. We only train each model on 32 NVIDIA A100 GPUs for 15 epochs, and the resulting difference can be seen in Table 2. We are aware that some observations might change if we scale up the model, but most of the conclusions should be general and consistent.
|
| 362 |
+
|
| 363 |
+
Table 2: Comparison between the final model and the baseline for analysis.
|
| 364 |
+
|
| 365 |
+
<table><tr><td rowspan="2">Models</td><td colspan="4">Unseen Evaluation</td></tr><tr><td>PSNR↑</td><td>CLIP-Similarity↑</td><td>SSIM↑</td><td>LPIPS</td></tr><tr><td>Final</td><td>20.1</td><td>91.0</td><td>79.7</td><td>16.0</td></tr><tr><td>Baseline</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr></table>
|
| 366 |
+
|
| 367 |
+
# D.1 SYNTHETIC VS. REAL DATA
|
| 368 |
+
|
| 369 |
+
Table 3 compares the influence of using synthetic 3D data from the Objaverse (Deitke et al., 2023) and real video data from the MvImgNet (Yu et al., 2023) in training. Results show that removing real data causes an obvious drop for all the metrics, despite the fact our synthetic 3D dataset contains $3 \times$ more shapes than MvImgNet. One potential reason is that the real data have much more variation in the lighting, the size of the target, and the camera poses, which effectively benefits the learning. Future work could augment the rendering of synthetic shapes to adequately utilize those abundant data. Nevertheless, combining the two datasets leads to substantially better results than training on any one of them alone.
|
| 370 |
+
|
| 371 |
+
Table 3: Influence of training datasets.
|
| 372 |
+
|
| 373 |
+
<table><tr><td rowspan="2">Data</td><td colspan="4">CLIP-Siminlaity SSIM1</td></tr><tr><td>PSNR↑</td><td></td><td></td><td>LPIPS↓</td></tr><tr><td>Synthetic(Objaverse)</td><td>15.5</td><td>84.7</td><td>70.3</td><td>29.3</td></tr><tr><td>Real (MvImgNet)</td><td>17.5</td><td>85.7</td><td>75.7</td><td>22.0</td></tr><tr><td> Synthetic+Real</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr></table>
|
| 374 |
+
|
| 375 |
+
# D.2 NUMBER OF VIEWS IN TRAINING DATA
|
| 376 |
+
|
| 377 |
+
In Table 4, we conduct experiments with all data but limit the number of training views per shape. For example, for Train Views ${ } ^ { : = 8 }$ , we use only a random subset of 8 views per shape and keep randomly sampling 4 views from the above subset at each training step. The results show that more views can lead to better results, possibly because of more diverse data. While the growth is saturated at 16 views, adding more views does not lead to worse results.
|
| 378 |
+
|
| 379 |
+
# D.3 MODEL HYPER-PARAMETERS
|
| 380 |
+
|
| 381 |
+
Table 5 presents the results of having a different number of cross-attention layers in the image-totriplane decoder. There is a slight trend indicating that the scores can be improved by having a deeper model, especially for the latent semantic and perceptual similarity measurements CLIP and LPIPS, implying that the network models better representations for reconstructing higher-quality images.
|
| 382 |
+
|
| 383 |
+
Table 4: Effect of the number of different views per shape in training. $^ { 3 2 + }$ indicates some video data in MvImgNet contain more than 32 views per shape, which we apply all of them in training.
|
| 384 |
+
|
| 385 |
+
<table><tr><td rowspan="2">Train Views</td><td colspan="4">Unseen Evaluation</td></tr><tr><td>PSNR↑</td><td>CLIP-Similarity↑</td><td>SSIM↑</td><td>LPIPS1</td></tr><tr><td>4</td><td>18.8</td><td>86.7</td><td>77.5</td><td>19.8</td></tr><tr><td>8</td><td>18.9</td><td>87.3</td><td>77.5</td><td>19.4</td></tr><tr><td>16</td><td>19.1</td><td>87.9</td><td>77.6</td><td>19.0</td></tr><tr><td>32+</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr></table>
|
| 386 |
+
|
| 387 |
+
We also evaluate the influence of the number of MLP layers in NeRF (Table 6). Results show that it is unnecessary to have a very large network, and there seems to be a sweet spot around two to four layers. This observation is consistent with EG3D (Chan et al., 2022) where the information of shapes is encoded by the triplane and such MLP is only a shallow model for projecting triplane features to color and density.
|
| 388 |
+
|
| 389 |
+
As shown in Table 7, we found that increasing the triplane resolution leads to better image quality. Note that, in this experiment, we only use a deconvolution layer to upsample the $3 2 \times 3 2 \times 3 2$ triplane produced by LRM’s decoder, whereas we suspect a large improvement could be seen by increasing the quantity of input spatial-positional embeddings to query more fine-grained image details. However, such an approach will dramatically increase the computational cost, we leave this exploration to future research.
|
| 390 |
+
|
| 391 |
+
Table 5: Effect of the number of cross-attention layers in image-to-triplane decoder.
|
| 392 |
+
|
| 393 |
+
<table><tr><td rowspan="2">CrossAttn Layers</td><td colspan="4">Unseen Evaluation</td></tr><tr><td>PSNR↑</td><td>CLIP-Similarity↑</td><td>SSIM↑</td><td>LPIPS↓</td></tr><tr><td>6</td><td>19.0</td><td>87.7</td><td>77.6</td><td>19.1</td></tr><tr><td>16</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr><tr><td>24</td><td>19.1</td><td>88.0</td><td>77.6</td><td>18.9</td></tr></table>
|
| 394 |
+
|
| 395 |
+
Table 6: Effect of the number of MLP layers in NeRF.
|
| 396 |
+
|
| 397 |
+
<table><tr><td rowspan="2">NeRFMLP Layers</td><td colspan="4">Unseen Evaluation</td></tr><tr><td>PSNR↑</td><td>CLIP-Similarity↑</td><td>SSIM↑</td><td>LPIPS↓</td></tr><tr><td></td><td>19.2</td><td>87.7</td><td>77.8</td><td>18.9</td></tr><tr><td>26</td><td>19.1</td><td>88.0</td><td>77.6</td><td>19.0</td></tr><tr><td>12</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr><tr><td>14</td><td>19.1</td><td>87.2</td><td>77.6</td><td>19.0</td></tr></table>
|
| 398 |
+
|
| 399 |
+
Table 7: Effect of the resolution of triplane. For 64up and $I 2 8 u p$ , we apply additional $2 \times 2$ and $4 \times 4$ deconvolution layers, respectively, to upsample a Res. 32 triplane.
|
| 400 |
+
|
| 401 |
+
<table><tr><td rowspan="2">Triplane Res.</td><td colspan="4">Unseen Evaluation</td></tr><tr><td>PSNR↑</td><td>CLIP-Similarity↑</td><td>SSIM↑</td><td>LPIPS↓</td></tr><tr><td>32</td><td>18.9</td><td>86.3</td><td>77.2</td><td>19.7</td></tr><tr><td>64up</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr><tr><td>128up</td><td>19.0</td><td>88.3</td><td>77.5</td><td>19.0</td></tr></table>
|
| 402 |
+
|
| 403 |
+
# D.4 CAMERA POSE
|
| 404 |
+
|
| 405 |
+
As we have discussed in the Main Paper, normalizing camera poses in training has a huge impact on the generalization of input views. We can see from Table 8 that when no modification is applied (None), LRM produces the worst results. Augmenting camera poses with a Random rotation greatly improves the results since the model learns a more general image-to-triplane projection via decoupled views and camera poses. However, such unconstrained projection is very difficult to learn. We therefore Normalized all camera poses so that all images are projected onto the triplane from the same direction, allowing the model to adequately learn and utilize the cross-shape prior for reconstruction.
|
| 406 |
+
|
| 407 |
+
Table 8: Effect of camera pose normalization.
|
| 408 |
+
|
| 409 |
+
<table><tr><td rowspan="2">Camera Pose</td><td colspan="4">Unseen Evaluation</td></tr><tr><td>PSNR↑</td><td>CLIP-Similarity↑</td><td>SSIM↑</td><td>LPIPS↓</td></tr><tr><td>None</td><td>15.3</td><td>83.4</td><td>70.1</td><td>28.9</td></tr><tr><td>Random</td><td>18.0</td><td>85.6</td><td>75.7</td><td>21.1</td></tr><tr><td>Normalized</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr></table>
|
| 410 |
+
|
| 411 |
+
# D.5 IMAGE QUANTITY AND RESOLUTION
|
| 412 |
+
|
| 413 |
+
Table 9 and Table 10 study the influence of the number of side views supervision for each sample and the effect of image rendering resolution in training. Results indicate that as the quantity of side views increases, the reconstructed image quality improves. Having more views allows the model to better correlate the appearance and geometry of different parts of the same shape, and facilitates inferring multi-view consistent results. Moreover, using a higher rendering resolution of images in training largely improves the results, as the model is encouraged to learn more high-frequency details.
|
| 414 |
+
|
| 415 |
+
Table 9: Influence of the number of side views applied for each training sample.
|
| 416 |
+
|
| 417 |
+
<table><tr><td rowspan="2">Side Views</td><td colspan="4">Unseen Evaluation</td></tr><tr><td>PSNR↑</td><td>CLIP-Similarity↑</td><td>SSIM↑</td><td>LPIPS↓</td></tr><tr><td>1</td><td>18.7</td><td>87.7</td><td>77.2</td><td>19.7</td></tr><tr><td>2</td><td>18.7</td><td>87.5</td><td>77.2</td><td>19.6</td></tr><tr><td>3</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr><tr><td>4</td><td>19.1</td><td>87.8</td><td>77.6</td><td>18.9</td></tr></table>
|
| 418 |
+
|
| 419 |
+
Table 10: Influence of the rendering resolution of images in training.
|
| 420 |
+
|
| 421 |
+
<table><tr><td rowspan="2">Render Res.</td><td colspan="4">Unseen Evaluation</td></tr><tr><td>PSNR↑</td><td>CLIP-Similarity↑</td><td>SSIM↑</td><td>LPIPS↓</td></tr><tr><td>32</td><td>18.8</td><td>86.3</td><td>77.0</td><td>20.1</td></tr><tr><td>64</td><td>19.0</td><td>87.8</td><td>77.4</td><td>19.1</td></tr><tr><td>128</td><td>19.4</td><td>89.0</td><td>78.3</td><td>18.0</td></tr></table>
|
| 422 |
+
|
| 423 |
+
# D.6 LPIPS LOSS
|
| 424 |
+
|
| 425 |
+
Lastly, we found that our LPIPS objective (Zhang et al., 2018) has a huge impact on the results. Removing it from training will decrease the CLIP-Similarity, SSIM, and LPIPS scores to 74.7, 76.4, and 29.4, respectively.
|
| 426 |
+
|
| 427 |
+
# E VISUALIZATIONS
|
| 428 |
+
|
| 429 |
+
We present more visualizations of the reconstructed 3D shapes in the following pages. The input images include photos captured by our phone camera, images from Objaverse (Deitke et al., 2023), MvImgNet (Yu et al., 2023), ImageNet (Deng et al., 2009), Google Scanned Objects (Downs et al., 2022), Amazon Berkeley Objects (Collins et al., 2022), and images generated by the Adobe Firefly11. We implement a heuristic function to pre-process the camera-captured images, generated images, and images from MvImgNet and ImageNet. The function removes the image background with an off-the-shelf package12, followed by cropping out the target object, rescaling the target to a suitable size and centering the target on a square white figure. All input images are never seen by the model in training. Please visit our project webpage https://yiconghong.me/LRM/ for video demonstrations and interactable 3D meshes.
|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
Figure 6: Comparison between LRM rendered novel views and the ground truth images (GT). None of the images are observed by the model during training. The GT depth images of Objaverse are rendered from the 3D models. Please zoom in for clearer visualization.
|
| 433 |
+
|
| 434 |
+

|
| 435 |
+
Figure 7: Rendered novel views (RGB and Depth) of shapes reconstructed by our LRM from single images. None of the images are observed by the model during training. Generated images are created by the Adobe Firefly. Please zoom in for clearer visualization.
|
md/test/t0L4xG4aGC/t0L4xG4aGC.md
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Encoding Hierarchical Information in Neural Networks helps in Subpopulation Shift
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Over the past decade, deep neural networks have proven to be adept in image classification tasks, often surpassing humans in terms of accuracy. However, standard neural networks often fail to understand the concept of hierarchical structures and dependencies among different classes for vision related tasks. Humans on the other hand, seem to intuitively learn categories conceptually, progressively growing from understanding high-level concepts down to granular levels of categories. One of the issues arising from the inability of neural networks to encode such dependencies within its learned structure is that of subpopulation shift – where models are queried with novel unseen classes taken from a shifted population of the training set categories. Since the neural network treats each class as independent from all others, it struggles to categorize shifting populations that are dependent at higher levels of the hierarchy. In this work, we study the aforementioned problems through the lens of a novel conditional supervised training framework. We tackle subpopulation shift by a structured learning procedure that incorporates hierarchical information conditionally through labels. Furthermore, we introduce a notion of hierarchical distance to model the catastrophic effect of mispredictions. We show that learning in this structured hierarchical manner results in networks that are more robust against subpopulation shifts, with an improvement up to $3 \%$ in terms of accuracy and up to $1 1 \%$ in terms of hierarchical distance over standard models on subpopulation shift benchmarks.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Deep learning has been tremendously successful at image classification tasks, often outperforming humans when the training and testing distributions are the same. In this work, we focus on tackling the issues that arise when the testing distribution is shifted at a subpopulation level from the training distribution, a problem called subpopulation shift introduced recently in BREEDS (Santurkar et al., 2021). Subpopulation shift is a specific kind of shift under the broader domain adaptation umbrella. In domain adaptation, the task of a classifier remains the same over the source and target domains, but there is a slight change in the distribution of the target domain (Goodfellow et al., 2016; Quionero-Candela et al., 2009; Saenko et al., 2010; Ganin $\&$ Lempitsky, 2015). In the general setting, the target domain is a slightly changed version of the source domain. For example, an object detector that has been trained to detect objects during day time for a self-driving car application is used to perform the same task, but now on a shifted set of night time images. The task remains the same i.e. to identify and detect objects, but the target domain (night time) is a shifted version of the source domain (day-time), provided all other conditions (such as weather, region, etc.) remain constant. There are other forms of shifts as well such as shifts in the marginal distribution of labels (Tachet des Combes et al., 2020) or shifts under data imbalance (Li et al., 2019). These are broadly denoted as label and target shifts respectively.
|
| 12 |
+
|
| 13 |
+
However, in the setting of subpopulation shift, both the source and target domains remain constant. The shift here occurs at a more granular level, that of subpopulations. Consider the source distribution described above, that of a self-driving car. Let’s say the categories for classification included small vehicles and large vehicles. Under small-vehicles, the source set included samples of golf car and race car, and under large vehicles, the source samples were from firetrucks and double decker buses. In the target domain for testing, the classes remain unaltered; the classifier is still learning to categorize vehicles into small or large categories. However, the testing samples are now drawn from different subpopulations of each class which were not present during training, such as coupe and sedan for small vehicles and dumpster truck and school bus for large vehicles.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: An example hierarchical representation of a custom subset of ImageNet. The classes for the classification task are at the intermediate level, denoted by ‘class’. The constituent subpopulations of each class are particular classes from the ImageNet dataset and are marked at the leaf level as ‘subpopulations’. The labels for these are not shown to the network. The letter ‘S’ denotes ‘Seen’ distribution and ‘U’ denotes ’Unseen’ shifted distributions. One-hot labels are provided at each level of the tree. The colored arrows indicate the hierarchical distance from one leaf node to the other. This shows that mispredicting a Felidae as a Canis (two graph traversals) is less catastrophic than predicting the same as an Salamander (four graph traversals). For illustration we provide the names of one set of subpopulations for each class.
|
| 17 |
+
|
| 18 |
+
Additionally, the current way of classification, in which each class is considered separate and independent of others, treats the impact of all mispredictions as equal. This is counter-intuitive, since a husky and a beagle are more similar to each other than to a bullfrog. The impact of misclassifications becomes quite important in critical use cases. The cost of mispredicting an animate object for an inanimate object can be disastrous for a self-driving car. To address this, we introduce ‘catastrophic coefficient’, a quantitative measure of the impact of mispredictions that follows intuitively from a hierarchical graph. It is defined as the normalized length of the shortest path between the true and the predicted classes as per the graphical structure of the underlying hierarchy. We show that incorporating hierarchical information during training reduces the catastrophic coefficient of all considered datasets, under subpopulation shift.
|
| 19 |
+
|
| 20 |
+
We explicitly incorporate the hierarchical information into learning by re-engineering the dataset to reflect the proposed hierarchical graph, a subset of which is sketched out in Figure 1. We modify the neural network architectures by assigning intermediate heads (one fully connected layer) corresponding to each level of hierarchy, with one-hot labels assigned to the classes at each level individually, as shown in Figure 2. We ensure that only samples correctly classified by a head are passed on for learning to the next heads (corresponding to descendants in the hierarchy graph) by a conditional learning mechanism. We first show results on a custom dataset we create out of ImageNet, and then scale up to three subpopulation benchmark datasets introduced by BREEDS (Santurkar et al., 2021) that cover both living and non-living entities. We also show results on the BREEDS LIVING-17 dataset by keeping the hierarchical structure, but changing the target subpopulations to cover a more diverse range. We show that given a hierarchy, our learning methodology can result in both better accuracy and lower misprediction impact under subpopulation shift.
|
| 21 |
+
|
| 22 |
+
• To the best of our knowledge, this is the first attempt to tackle the problem of subpopulation shift by hierarchical learning methods. Our method incorporates hierarchical information in two ways: 1) allowing independent inference at each level of hierarchy and 2) enabling collaboration between these levels by training them conditionally via filtering (Deng et al. (2011). This ensures that each level only trains on samples that are correctly classified on all previous levels. This is similar to anytime inference (Karayev et al. (2014)), but the goal is no longer to enable efficient inference or early exit strategies, but to propagate conditional probabilities.
|
| 23 |
+
• Framing the problem in a hierarchical setting allows us to quantify the misprediction impact, measured by the shortest hierarchical distance between the true and predicted labels for inference. While this has been considered in works on cost-sensitive classification (Verma et al. (2012), Bertinetto et al. (2020)), we only use it as an evaluation metric to study the impact of hierarchies on subpopulation shift, instead of directly optimizing it.
|
| 24 |
+
• We evaluate the performance of deep models under subpopulation shift and show that our training algorithm outperforms classical training in both accuracy and misprediction impact.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
Subpopulation shift is a specific variant of domain adaptation where the models need to adapt to unseen data samples during testing, but the samples arrive from the same distribution of the classes, changed only at the subpopulation levels. BREEDS (Santurkar et al., 2021) introduced the problem of subpopulation shift along with tailored benchmarks constructed from the ImageNet (Deng et al., 2009) dataset. WILDS (Koh et al., 2021) provides a subpopulations shift benchmark but for toxicity classification across demographic identities. Cai et al. (2021) tackle the problem through a label expansion algorithm similar to Li et al. (2020) but tackles subpopulation shift by using the FixMatch (Sohn et al., 2020) method. The algorithm uses semi-supervised learning concepts such as pseudo-labelling and consistency loss. Cai et al. (2021) expands upon this and showed how consistency based loss is suitable for tackling the subpopulation shift problem. But these semi-supervised approaches require access to the target set, albeit unlabelled, as the algorithm makes use of these unlabelled target set to further improve upon a teacher classifier. We restrict ourselves to the supervised training framework where we have no access to the target samples. Moreover, we tackle the subpopulation shift problem by incorporating hierarchical information into the models.
|
| 29 |
+
|
| 30 |
+
Hierarchical modeling is a well-known supervised learning strategy to learn semantic concepts in vision datasets. Under this section, we cover methods that are shown on smaller datasets under small-scale methods and works that show results on ImageNet-scale datasets as large-scale methods.
|
| 31 |
+
|
| 32 |
+
Large-scale hierarchical methods:Hierarchical modeling is a well-known supervised learning strategy to learn semantic concepts in vision datasets. Under this section, we cover methods that are shown on smaller datasets under small-scale methods and works that show results on ImageNet-scale datasets as large-scale methods. Yan et al. (2015) introduce HD-CNN, which uses a base classifier to distinguish between coarser categories whereas for distinguishing between confusing classes, the task is pushed further downstream to the fine category classifiers. HD-CNN was novel in its approach to apply hierarchical training for large scale datasets but suffers from a different scalabilty problem. Its training requires copies of network parts for each subtree, and therefore the network size continues to grow with bigger hierarchies. Furthermore, there is sequential pre-training, freezing, training and finetuning required for each level of hierarchy, and hence the authors limit their heirarchies to a depth of 2. Deng et al. (2010) showed that the classification performance can be improved by leveraging semantic information as provided by the WordNet hierarchy. Deng et al. (2014) further introduced Hierarchy and Exclusion Graphs to capture semantic relations between two labels (parent and children). Although this work relabels leaf nodes to intermediate parent nodes, they train models only on the leaf node labels (single label). Blocks (Alsallakh et al., 2018) visually demonstrates via confusion matrices how learning hierarchies is an implicit method of learning for convolutional neural networks and similar classes are mapped close to one another along the diagonal of the learnt confusion matrix. Song & Chai (2018) shows how multiple heads of a neural network can collaborate among each other in order reach a consensus on image classification tasks. Verma et al. (2020) introduces a dataset with hierarchical labels for Human Pose classification known as Yoga-82 and trains hierarchical variants of DenseNet (Huang et al., 2017) to benhcmark classification accuracy on this set.In contrast, our work can be extended to multiple levels of hierarchy without the need for changing architecture, while employing a conditional training approach to link multiple labels of a single image as per the provided hierarchy. We show, by utilizing the hierarchy in this manner we are able to mitigate the effect of subpopulation shift, both under accuracy and impact of mispredictions. Hierarchical inference has often been used to enable efficient inference strategies in the scheme of anytime inference algorithms (Deng et al. (2011); Karayev et al. (2014) ). Additionally, Deng et al. (2011) can also learn a label hierarchy. However with these the aim is to make the inference pipeline more efficient by exiting early for easier examples. We perform inference at all levels of hierarchy to learn coarse-to-fine grained features to help with sub-population shift.
|
| 33 |
+
|
| 34 |
+
Small-scale hierarchical methods: B-CNN (Zhu & Bain, 2017) learns multi-level concepts via a branch training strategy through weighted loss of the individual branches on small-scale datasets. H-CNN (Seo & shik Shin, 2019) leverages hierarchical information to learn coarse to fine features on the Fashion-MNIST (Xiao et al., 2017) dataset. Condition CNN (Kolisnik et al., 2021) learns a conditional probability weight matrix to learn related features to help classification results on Kaggle Fashion Product Images dataset. VT-CNN (Liu et al., 2018) introduces a new training strategy that pays attention to more confusing classes in CIFAR-10 and CIFAR-100 based on a Confusion Visual Tree (CVT) that captures semantic level information of closely related categories. Inoue et al. (2020) show slight improvements on B-CNN by providing hierarchical semantic information to improve fine level accuracy on CIFAR-100 and Fashion-MNIST. CFCNN (Park et al., 2021) proposes a multilevel label augmentation method along with a fine and several coarse sub-networks to improve upon corresponding base networks. In our experiments we provide an approach to hierarchically train deep models which scales to ImageNet based subpopulation shift benchmarks.
|
| 35 |
+
|
| 36 |
+
Hierarchical knowledge to make better predictions: There are works done to learn similarity metrics in the context of hierarchical settings such as in Verma et al. (2012). Another recent work, Bertinetto et al. (2020) introduced a similar notion of impact of mispredictions. Shkodrani et al. (2021) designed a theoretical framework for hierarchical image classification with a hierarchical cross-entropy model to show a slight improvement over Bertinetto et al. (2020). On the other hand, we use the misprediction distance only as an evaluation metric to quantify the impact of our conditional training framework on the degree of catastrophic predictions, and instead look at the role that hierarchical learning plays in mitigating issues across domain shifts during inference.
|
| 37 |
+
|
| 38 |
+
# 3 Methodology: Hierarchies to Mitigate the Effect of Subpopulation Shift
|
| 39 |
+
|
| 40 |
+
# 3.1 Subpopulation Shift
|
| 41 |
+
|
| 42 |
+
As described in Section 1, subpopulation shift is a specific branch of the broader domain adaptation problem. In subpopulation shift the training and the testing distributions differ at the level of subpopulations. Let’s focus on an n-way classification problem, with each class denoted by $i$ ; $i = \{ 1 , 2 . . . n \}$ . The data consisting of image-label pairs for the source seen and the target unseen domain are denoted by $\{ \mathbb { X } ^ { s } , \mathbb { Y } ^ { s } \}$ and $\{ \mathbb { X } ^ { u } , \mathbb { Y } ^ { u } \}$ respectively. Each class $i$ draws from $s$ different subpopulations. The different subpopulations of class $i$ for training seen domain are denoted by $S _ { i } ^ { s }$ and for testing unseen domain by $S _ { i } ^ { u }$ . We reiterate that between seen and unseen domains, the $n$ classes remain the same, since the classification task is unchanged. However the data drawn for each class at the subpopulation level shifts, with no overlap between the seen and unseen subpopulations. This reflects that the subpopulations used for testing are never observed during training, i.e. $S _ { i } ^ { s } ~ \cup ~ S _ { i } ^ { u } = \emptyset$ .
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: Figure shows our conditional training framework applied to a multi-headed neural network architecture, on the instance subtree shown on the top left. The bottom of the figure shows conditional training for a single instance of a class ‘Carnivores’, subclass ‘Dog’. The shifting subpopulations are located one level below and are not exposed to the training methodology. The conditional training methodology is shown alongside. Conv blocks 1 and 2 make up the backbone that will be used for all 3 heads. We get the superclass prediction from head 1 located after Conv block 2. The multiplier between Conv block 2 and 3 denotes that the output of Conv block 2 only passes to Conv block 3 if the prediction of head 1 (i.e. the superclass) is correct. If head1 predicts the incorrect superclass, the rest of the network does not train on the instance. Similarly, head 2 predicts the class at the next hierarchy level, and dictates whether the fourth Conv block will be trained on this instance or not. The blocking or passing of the instance to different parts of the architecture is implemented in a batch setting via the validity mask, described in Figure 3.
|
| 46 |
+
|
| 47 |
+
# 3.2 Hierarchical View to tackle Subpopulation Shift
|
| 48 |
+
|
| 49 |
+
We tackle the subpopulation shift problem by explicitly incorporating hierarchical knowledge into learning via labels. Intuitively, if a neural network can grasp the concept of structural hierarchies, it will not overfit to the observed subpopulations. Instead, the network will have a notion of multiple coarse-to-fine level distributions that the subpopulation belongs to. The coarser distributions would likely cover a much larger set of distributions, hopefully helping in generalization under shift. For instance, a network trained with the knowledge that both a fire-truck and a race-car fall under vehicles, and a human and a dog fall under living things, will not overfit to the particular subpopulation but have a notion of vehicles and living things. This will allow it to generalize to a newer large-vehicle such as school-bus and predict it as a vehicle rather than a living thing, since the network has learned a much broader distribution of vehicles one level of hierarchy above. Even if there is a misprediction, it is more likely to be at the lower levels of hierarchy, confusing things that are less catastrophic to mispredict.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 3: Practical implementation of conditional training for a batch of images. The validity mask serves to ensure that the blocks corresponding to a particular level are trained only on the instances that are correctly classified at the previous level. Instead of blocking representations by multiplying with zeros as shown in Figure 2, we implement conditional training via multiplication of losses with the corresponding validity masks, resulting in the same outcome. Validity masks $V _ { l _ { 1 } - l _ { 2 } }$ represent the propagation of correctly classified instances from level $l _ { 1 }$ to $l _ { 2 }$ , and contain a 1 where the instance was correctly classified by all levels between $l _ { 1 }$ and $l _ { 2 }$ and 0 otherwise. They can be built from the composition of several validity masks. For instance, as shown in the figure, the validity mask for propagation from level 1 to level 3 is calculated by multiplying the validity mask from level 1 to level 2 with the validity mask from level 2 to level 3.
|
| 53 |
+
|
| 54 |
+
# 3.3 Vision Datasets as Hierarchical Trees
|
| 55 |
+
|
| 56 |
+
ImageNet (Deng et al., 2009) is a large-scale image database collected on the basis of an underlying hierarchy called WordNet (Miller, 1992). It consists of twelve different subtrees created by querying synsets from the WordNet hierarchy. To motivate the problem of subpopulation shift, we create two custom datasets from ImageNet, which are shifted versions of each other at the subpopulation level. The datasets have a balanced hierarchical structure of depth 3 as shown in Figure 1, starting from coarse concepts such as mammals and amphibians at a higher level, to fine grained specific subpopulations at the leaf nodes.
|
| 57 |
+
|
| 58 |
+
The hierarchical structure has 5 nodes at the highest level of superclasses, 10 nodes at the class level ( $n = 1 0$ ), and each class draws from 3 subpopulations each ( $s = 3$ ), leading to a total of 30 subpopulations per dataset. Each subpopulation is a class from ImageNet. Figure 1 shows a partial hierarchy from the dataset, showing one out of the three subclasses for seen and unseen datasets at the leaf nodes per class. This is a ten-way classification task. Each class consists of shifting subpopulations, shown one level below. During testing under shift, the 10 classes at the class level remain the same, but the 30 subpopulations that samples are drawn from are changed.
|
| 59 |
+
|
| 60 |
+
Given a tree, we start at the root node and traverse downwards to the first level of hierarchy, which consists of superclasses such as mammals, fish, reptiles, etc. The custom dataset, for instance, has five superclasses, labelled $0 - 4$ . Next we traverse to the level of classes. These are the actual tasks that the network has to classify. At this level, finer concepts are captured, conditioned on the previous level. For instance, the task now becomes: given an amphibian, is it a frog or a salamander; or given a bird, is it aquatic or aviatory. Each superclass in our custom dataset has only 2 classes, making up the $n = 1 0$ classes for classification. This level has one-hot encoding of all ten classes. Thus, the categorical labels are presented in a level-wise concatenated format as shown in Figure 1. The label for frog is ‘ $4 8$ ’, with the label 4 encoding that it belongs to the superclass of amphibians and 8 encoding that conditioned on being an amphibian, it is a frog. The models only see labels till the class level; the subpopulations labels are hidden from the networks. Finally, we reach the leaf nodes of the tree, where there are three subpopulations per class (figure only shows 1 from seen and unseen distributions). This overall encoding represents each label as a path arising from the root to the classes. The class labels always occur at $\mathit { l e v e l } = d e p t h - 1$ , one level above the subpopulations. For datasets such as LIVING-17 with a $d e p t h = 4$ , classes occur at $\ l e v e l = 3$ and we show an instance of this hierarchy in Figure 2.
|
| 61 |
+
|
| 62 |
+
Accuracy and catastrophic coefficients are reported for the 10 classes, similar to BREEDS. The custom trees are simple and balanced, capturing the hierarchical structure found in the dataset. We use them to lay the foundations on which we implement our conditional training framework. The two custom datasets are flipped versions of each other, created by keeping the hierarchical structure fixed. In one dataset, one subpopulation set becomes the seen distribution whereas the other one becomes the unseen one, and this is reversed for the second dataset. We then show how our method translates well to complicated hierarchies such as the LIVING-17, Non-LIVING-26, and ENTITY-30 (Santurkar et al., 2021) subpopulation shift benchmarks. This illustrates that our algorithm is compatible with any hierarchy chosen according to the task of interest.
|
| 63 |
+
|
| 64 |
+
# 3.4 Catastrophic Distance
|
| 65 |
+
|
| 66 |
+
In this section, we introduce the concept of catastrophic coefficient as a measure of the impact of misprediction. It is the shortest hierarchical distance between the true label and the predicted label in our hierarchy, normalized by the number of samples. It implicitly quantifies whether there is a notion of semantic structure in the model’s predictions. Subpopulation shift occurs at a lower level of a hierarchical tree where unseen subclasses are introduced during evaluation. So, if the hierarchically trained networks can grasp the concepts of superclasses and classes, the mispredictions during the shift will not be catastrophic. This is because they will tend to be correct at the higher levels, and hence ‘closer’ to the ground truth node in terms of graph traversal.
|
| 67 |
+
|
| 68 |
+
Neural networks trained via standard supervised learning have no explicit knowledge of inter-class dependencies. Thus, for flat models, mispredicting a specific sub-breed of a dog as a sub-breed of a cat is as catastrophic as mispredicting the same as a specific species of a snake. hierarchical distance between the true and predicted classes intuitively captures the catastrophic impact of a misprediction and accounts for the semantic correctness of the prediction. This serves as an additional metric to accuracy for evaluating the performance of models under subpopulation shifts. Additionally, it illustrates that the improvement in accuracy is truly due to incorporating better hierarchical information, rather than model architecture changes or the conditional training framework. It is pictorially illustrated by the colored arrows in Figure 1.
|
| 69 |
+
|
| 70 |
+
A higher hierarchical distance between a misprediction and its ground truth signifies a more catastrophic impact. We average the graph traversal distances of all predictions ( $= 0$ if sample classified correctly) over the entire dataset and call it the catastrophic coefficient, thus quantifying the impact of mispredictions for a network-dataset pair. Formally, let $g _ { k }$ be the graph traversals needed for sample k in the shortest path between its true and predicted label. Let there be $N$ samples for evaluation. Then, the catastrophic coefficient is defined as $\begin{array} { r } { C a t = \frac { \sum _ { k = 1 } ^ { N } g _ { k } } { N } } \end{array}$ . We note that we use this distance just to evaluate, and not during training. For evaluation, we take the final classifier level predictions and run it via our graph to check for distances, irrespective of whether they have been shown the hierarchy or not.
|
| 71 |
+
|
| 72 |
+
# 3.5 Architecture
|
| 73 |
+
|
| 74 |
+
We modify the standard ResNet (He et al., 2016) architectures to make them suitable for our conditional training framework. Since our network makes classification decisions at each level of the hierarchy, we introduce a separate head to predict the one-hot encoded vectors at each level. In a hierarchical subtree, the concept of a dog class is is represented as a mammal at the superclass level, a carnivore at the class level and a dog at the subclass level. We want to train a multi-headed network where each head is trained on level wise concepts starting from the superclass level, all the way down to the subclass level maintaining the path in the subtree. Thus if we want to represent the hierarchical concept of a dog as shown in Figure 2, we want the Head $\bot$ of our network to predict if it is a mammal (superclass), Head $^ 2$ to predict if it is a carnivore (class) and finally Head3 to predict that it is a dog (subclass). Convolutional Neural Networks learn coarse to fine features as they go deeper, capturing local concepts of images in the early layers and global concepts in the later layers (Zeiler & Fergus, 2014). This lines up well with our hierarchical structure, and hence we connect the different heads at different depths of the model. The concept is pictorially depicted in Figure 2. Since we use Residual Networks in our work, the individual convolutional blocks here are residual blocks. The locations of these heads are determined experimentally. We got best results with Head $\bot$ attached after the third residual block, Head $^ 2$ and Head3 after the fourth residual blocks for the subtree shown in Figure 2. We further want to ensure collaboration between these heads, done via a conditional training approach which we describe next.
|
| 75 |
+
|
| 76 |
+
Table 1: Details of the Subpopulation Shift Datasets
|
| 77 |
+
|
| 78 |
+
<table><tr><td>Datasets</td><td>Depth</td><td>Subpopulations (s)</td><td>Classes (n)</td></tr><tr><td>Custom</td><td>3</td><td>3</td><td>10</td></tr><tr><td>LIVING-17</td><td>4</td><td>2</td><td>17</td></tr><tr><td>Non-LIVING-26</td><td>5</td><td>2</td><td>26</td></tr><tr><td>ENTITY-30</td><td>5</td><td>4</td><td>30</td></tr></table>
|
| 79 |
+
|
| 80 |
+
# 3.6 Conditional Training Details
|
| 81 |
+
|
| 82 |
+
Here we describe the conditional training framework, illustrated in Figure 3, which is independent of subpopulation shift. Let us assume we have 3 levels in our hierarchy, with the levels enumerated by $l = { 1 , 2 , 3 }$ . Let the labels at each of these levels (treated as one-hot) be denoted by $y _ { l }$ . Let $F$ be the neural network that we pass a batch of images $X$ to. Here $X \in \mathbb { R } ^ { B \times d }$ where $\mathrm { B }$ is the batch-size and d is the dimension of the input data. Further, let $F _ { l }$ be the neural network up to head $\it l$ , corresponding to predicting at level $\it l$ of our hierarchical graph. Note that all $F _ { l }$ have overlap since the neural network is shared, rather than an ensemble, as illustrated in Figure 2. The conditional loss at head $\it l$ , $L _ { l }$ is calculated as:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
L _ { l } = C r o s s E n t r o p y ( F _ { l } ( x ) , y _ { l } ) * ( V _ { 1 - l } )
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $V _ { 1 - l }$ is the validity mask. $V _ { l } \ \in \ R ^ { B }$ contains all zeros, except ones at locations where the samples have been correctly classified by all heads until the head at level $\textit { l }$ . Each $V _ { l }$ is generated by element-wise multiplication of the individual constituent masks, $| V _ { 1 - 2 } * V _ { 2 - 3 } * \ldots * V _ { l - 1 - l } |$ , allowing for an incorrect classification at any head to block further propagation of the incorrect instance to all deeper heads, shown pictorially in Figure 3. This validity mask is what enforces our conditional training framework. Multiplying this validity mask with the current head’s loss before backpropagation ensures that learning for $F _ { l }$ only occurs on samples that are meaningful at that head. In other words, $V$ propagates only correctly classified samples, as per its name. This ensures that the prediction at the $l - t h$ head is not just $p ( y _ { l } )$ , but $p ( y _ { l } \mid F _ { k } ( x ) =$ $y _ { k }$ ) $\forall k = 1 , 2 . . . , l - 1$ . In other words, it allows each head’s outcome to represent the probability of the current head’s prediction given that prediction of all levels until the current one were correct, allowing the network to learn progressively refining predictions. The network until a particular head is trained progressively on the conditional loss corresponding to that head. That means that during backpropagation, each layer get gradients from all conditional losses of heads located after that layer. This allows us to learn a shared backbone, but progressively refine features from coarser to finer as pertaining to the hierarchy.
|
| 89 |
+
|
| 90 |
+
# 4 Experiments & Results
|
| 91 |
+
|
| 92 |
+
In Section 3, we described in detail our conditional training framework, where we train multi-headed networks to incorporate the notion of hierarchies in vision datasets. In this section, we empirically demonstrate how models trained with our approach perform better under subpopulation shift than models trained in a traditional flat learning setup. As a proof of concept, we first show results on two custom datasets created by querying the ImageNet on living entities. We then show the efficacy of our approach by expanding to three subpopulation shift benchmarks introduced in BREEDS (LIVING-17, Non-LIVING-26 and ENTITY-30). Each of these subpopulation shift benchmarks have varying structures in terms of depth and width and each captures a diverse set of relationships among their entities. We explain each benchmark in details in the following, corresponding subsections. We compare our approach with a baseline model trained in the classical manner on all classes without any hierarchical information. We additionally compare with BranchCNN (Zhu & Bain, 2017), trained as per the branch training strategy outlined by the authors. In Section 2, we mentioned HD-CNN (Yan et al., 2015) in terms of its novelty in training hierarchical deep models but as mentioned, it suffers from the issue of scalability and memory footprint with expanding hierarchies. The method is limited to hierarchies of depth 2, whereas each subpopulation benchmark exhibits trees of depth 3 or more. The method requires training one coarse classifier and multiple fine classifiers depending on how many coarse categories there are. With the current architectures of deep models, having multiple pretrained coarse and fine classifiers will vastly increase memory footprint and training time. Hence, we do not compare with H-CNN. In terms of both accuracy and catastrophic coefficient, we show that our hierarchical models are superior to baseline class models and Branch-CNN in tackling the subpopulation shift problem in all the five cases considered. We note that in 3 out of 5 sets of results, the trend of improvement in the subpoplation shifted (unseen) dataset was tracked by the unshifted (seen)) dataset as well. However, the trend is not unanimous. For instance, improvements in accuracies track each other roughly in both custom datasets and LIVING-17 datasets, but not for non-LIVING-26 and ENTITY-30 datasets. We believe that the kind of shifted subpopulation itself has an impact on this, as evidenced by the different results we get by shifting one source to three targets in LIVING17-A, B and C. We also believe that the classes where the shift occurs determine how easy the categorization under shift is, and hence see different trends for say, LIVING-17 and Non-LIVING-26 datasets.
|
| 93 |
+
|
| 94 |
+
# 4.1 Overall Setup
|
| 95 |
+
|
| 96 |
+
As mentioned, we consider subpopulation shift one level below the class level of a hierarchy. In this section we briefly describe the setup with the custom datasets as example. We provide the exact details of each benchmark in the subsequent sections, summarized in Table 1. Consider an n-way classification problem, with each class denoted by $i$ ; $i = \{ 1 , 2 . . . n \}$ . For our custom datasets, $n = 1 0$ . The total number of levels of hierarchy including the subpopulation levels, $\it l$ , is $_ 3$ . The $n$ classes are located at $l = 2$ in our custom tree. Now, we create the shift by sampling subpopulations of each class $i$ from $s$ different subpopulations. For the custom datasets, $s = 3$ and thus, for the custom datasets we have a 10-way classification problem with a total of $S _ { i } ^ { s }$ (seen) and $n \times s = 3 0$ $S _ { i } ^ { u }$ (unseen) domain. Let’s consider subpopulations. More concretely, the subpopulations for class $i = \{ \mathrm { d o g s } \}$ , $S _ { d o g s } ^ { s } =$ [Bloodhound, Pekinese] and are distributed over $S _ { d o g s } ^ { u } =$ [Great-Pyreness, Papillon]. Thus the learning problem is that by training on just the seen subpopulations $S _ { d o g s } ^ { s }$ , the model should be able to identify that the unseen subpopulations of $S _ { d o g s } ^ { u }$ belong to $i = \{ \mathrm { d o g s } \}$ .
|
| 97 |
+
|
| 98 |
+
We use accuracy and catastrophic coefficient described in Section 3.4 to measure performance, both in the presence and absence of subpopulations shift. The higher the accuracy of a model, the better it is. On the contrary, the lower the catastrophic co-efficient the better it is for a model. The number of graph traversals from the predicted node to the ground-truth node represents the value of a single misprediction impact, which varies from a minimum value of $0$ (correct prediction) up to a maximum value of $2 \times ( d e p t h - 1 )$ (worst case prediction, where predictions are made one level above subpopulations, and hence at a level of $( d e p t h - 1 )$ ). For example, for a dataset with $d e p t h = 4$ such as LIVING-17 the worst case misprediction value for a single instance is 6, whereas for Non-LIVING-26, the same is 8. Both accuracy and catastrophic coefficient are reported mainly under two different settings, differentiated by the subscript. The prefix of the subscript determines the domain the model was trained on and the suffix denotes the domain it is evaluated on. There are two combinations, ‘ $s - s ^ { \prime }$ and $s - u ^ { \prime }$ , with ‘s’ representing seen data and ‘u’ representing unseen data. ‘ $s - s$ ’ does not evaluate subpopulation shift, but shows the results of using our method as a general training methodology. It is trained on the standard training data of the seen domain, and evaluated on the validation set in the same seen domain. ‘ $s - u$ ’ evaluates results under subpopulation shift: training is performed on seen domain, and testing on unseen domain. Details of hierarchies and code will be made available soon.
|
| 99 |
+
|
| 100 |
+
Table 2: Results on Custom Dataset 1 (left) and Custom Dataset 2 (right). Corresponding catastrophic coefficients are shown in the bar plot on the right.
|
| 101 |
+
Figure 4: Results on Custom Datasets 1 and 2. Accuracy is shown on the left, and corresponding catastrophic coefficients on the right. Our model outperforms the other in both accuracy and catastrophic coefficient on both ‘s-s’ and ‘s-u’ populations.
|
| 102 |
+
|
| 103 |
+
<table><tr><td>Model</td><td>AcCs-s</td><td>AcCs-u</td><td>Accs-s</td><td>Accs-u</td><td>2 1.5</td></tr><tr><td>Baseline-18</td><td>83.47</td><td>48.69</td><td>77.73</td><td>55.0</td><td>1</td></tr><tr><td>BCNN-18</td><td>87.87</td><td>51.33</td><td>81.73</td><td>58.96</td><td>0.5</td></tr><tr><td>Hierarchical-18</td><td>88.27</td><td>53.76</td><td>82.48</td><td>59.35</td><td>0</td></tr></table>
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
|
| 107 |
+
# 4.2 Model Setup
|
| 108 |
+
|
| 109 |
+
Throughout our experiments we focus mainly on three sets of training, which result in the Baseline, the Branch-CNN and the Hierarchical Models. The Baseline models are trained in a flat manner, and evaluated as per the hyper-parameters and training details as mentioned in BREEDS (Santurkar et al., 2021), except bootstrapping. The classification task is on the $_ i$ classes, enumerated at the level of ‘classes’ mentioned in the hierarchy. The subpopulation shift occurs one level below. The subpopulations labels are never shown to the network. The Hierarchical and Branch-CNN models, have been trained on the complete hierarchical information present in the tree, using our conditional training framework and the Branch Training Strategy (Zhu & Bain, 2017) respectively. The method oversees training to teach coarse to fine concepts as per the hierarchical structure of the target classes. The method invokes a weighted summation of a joint loss where each loss contribution comes from each branch (head) of a multi-headed network. There is a loss weight factor associated with each branch which dictates how much of each branch contributes towards the final loss as training continues. A head in our case is analogous to a branch in theirs. A branch represents a conceptual level in the hierarchy, and the training scheme dictates how much weight each branch contributes to the weighted loss as training goes on. In our conditional training framework, we sequentially train each head of our multi-headed network with the subsequent conditional loss as discussed in Figure 2. In this manner we teach the top-down hierarchical structure to networks and the conditional taxonomic relationships among its entities.
|
| 110 |
+
|
| 111 |
+
We use ResNet-18 as our network architecture backbones for modifications as mentioned in subsection 3.5. For enumerating results, we use ‘Hierarchical-18‘ to denote a modified ResNet-18 model trained conditionally. Similarly ‘Baseline-18’ signifies a ResNet-18 architecture trained for flat classification on the $n$ categories found at the level of ‘classes’ in the hierarchy. BCNN-18 refers to the modified ResNet-18 architecture trained via the Branch Training Strategy (Zhu & Bain, 2017).
|
| 112 |
+
|
| 113 |
+
# 4.3 Results on Custom Datasets
|
| 114 |
+
|
| 115 |
+
In this section, we discuss the results on the two custom datasets, shown in Figure 4. We train the models on each dataset for 120 epochs with a batch size of 32, starting with a learning rate of 0.1, and a 10 fold drop every 40 epochs thereafter. We do not use data augmentation on our custom datasets. All models have been trained on three random seeds each and the mean numbers are reported. $A c c _ { s - u }$ and $C a t _ { s - u }$ denote the accuracy and catastrophic coefficient of the model during the $s - u$ shift at the class level. As shown in Figure 4, our Hierarchical-18 model performs better than the others, both in terms of accuracy and catastrophic coefficient, as well as both in the presence and absence of subpopulation shift. Moreover, the performance gap is significant under shift indicating that the imparted hierarchical information is helpful in correctly predicting unseen subpopulation classes. The models trained conditionally have $\sim 4 - 5 \%$ improvement in terms of accuracy and an improvement of $\sim ( 0 . 2 5 - 0 . 3 1 )$ in hierarchical distance, translating into $1 0 . 0 \%$ and $7 . 9 \%$ improvement in terms of catastrophic coefficient over the flat baseline class level models under shift for the two custom sets. Figure 4 highlights another interesting fact. Both the custom datasets have the same hierarchical structure and model the same semantic relationships among the entities; the difference is created by populating each set with different subpopulations. All models suffer performance drops from custom set 1 to 2, showing the adverse effects of the distribution spanning a particular set, implying that some subpopulation shifts are just inherently harder to tackle.
|
| 116 |
+
|
| 117 |
+
Table 3: Results on LIVING-17, with and without shift is shown on the left. Results for shift on Living-17-B and Living-17-C are shown as well. Corresponding catastrophic coefficients are shown in the bar plot on the right.
|
| 118 |
+
Figure 5: Results on Living-17. Accuracy is shown on the left, and corresponding catastrophic coefficients on the right. Additional experiments for shift on 2 variants, Living-17-B and -C are also shown. Our model outperforms the others in both accuracy and catastrophic coefficient on both ‘s-s’ and ‘s-u’ populations, including shifted performance on the -B and -C variants.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>Model</td><td></td><td></td><td>Accs-s Accs-u Accs-u(B) Accs-u(C)</td></tr><tr><td>Baseline-18</td><td>92.3</td><td>57.02</td><td>53.54 53.04</td></tr><tr><td>BCNN-18</td><td>92.88</td><td>58.8</td><td>55.66 55.1</td></tr><tr><td>Hierarchical-18</td><td>93.17</td><td>60.53</td><td>56.6 55.62</td></tr></table>
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Catastrophic Co-efficient Levels on LIVING-17,-B and -C
|
| 124 |
+
|
| 125 |
+
# 4.4 Results on LIVING-17
|
| 126 |
+
|
| 127 |
+
In this section we discuss the results on the BREEDS LIVING-17 dataset, enumerated in Figure 5. For the LIVING-17 dataset, $n = 1 7$ , depth is 4 and $s = 2$ . The $n$ classes are located at depth $l = 3$ and the subpopulations at $l = 4$ respectively. This subpopulation shift benchmark, introduced in BREEDS (Santurkar et al., 2021), captures finer details of hierarchy that encode richer relationships between the entities. We show that our methodology is applicable to complex hierarchies and outperforms class level baseline and BCNN-18 models both on $A c c _ { s - u }$ and $C a t _ { s - u }$ . We train each architecture and model on five random seeds and report the mean numbers. We report numbers without bootstrapping, but follow all their other hyperparameters reported by BREEDS. Under the shift, Hierarchical models achieve $\sim 1 . 7 - 3 . 5 \%$ and $0 . 1 7 - 0 . 2 0$ improvement in terms of accuracy and hierarchical distance respectively over other techniques. This results around 4% and $1 1 \%$ in terms of catastrophic coefficient over BCNN-18 and Baseline-18 respectively, as seen in Figure 5.
|
| 128 |
+
|
| 129 |
+
Results on Shifted LIVING-17 To cover a more diverse shift, we retain the hierarchy introduced in LIVING-17 but consider 2 more sets of different subpopulations. We call these LIVING-17-B and LIVING17-C. These two shifted versions of the unseen set of LIVING-17 are formed by varying the $S _ { i } ^ { u }$ subclasses. We do this either by adding disjoint subclasses of the ImageNet (Deng et al., 2009) or by creating different combinations of the existing $S _ { i } ^ { u }$ with new disjoint subclasses. We reuse some of the $S _ { i } ^ { u }$ subclasses due to the unavailability of the same in the ImageNet database. All the subpopulations of $i = \{ \mathrm { w o l f } \}$ from the
|
| 130 |
+
|
| 131 |
+
Table 4: Results on Non-LIVING-26, with and without shift. Corresponding catastrophic coefficients are shown in the bar plot on the right. The L3 Hierarchy is the same hierarchy with the first two levels collapsed into a single level.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Model</td><td>Accs-s</td><td>Accs-u</td></tr><tr><td>Baseline-18</td><td>88.39</td><td>42.13</td></tr><tr><td>BCNN-18</td><td>88.1</td><td>42.4</td></tr><tr><td>L3 Hierarchical-18</td><td>87.71</td><td>42.44</td></tr><tr><td>Hierarchical-18</td><td>87.41</td><td>42.94</td></tr></table>
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Catastrophic Co-efficient Levels on NON-LIVING-26
|
| 137 |
+
|
| 138 |
+
Figure 6: Results on Non-LIVING-26 dataset. Accuracy is shown on the left, and corresponding catastrophic coefficients on the right. Our model outperforms the others in both accuracy and catastrophic coefficient on both ‘s-u’ evaluation, but shows slightly worse performance on ‘s-s’ evaluation.
|
| 139 |
+
|
| 140 |
+
ImageNet database have already been covered in the $S _ { w o l f } ^ { s }$ and $S _ { w o l f } ^ { u }$ set, so we just reuse the $S _ { w o l f } ^ { u }$ in the sets B and C.
|
| 141 |
+
|
| 142 |
+
$A c c _ { s - u } ( B )$ denotes the model accuracy for the shift ‘ $s - u$ ’ from set A to B. As can be seen from Figure 5, Hierarchical-18 models have better accuracy and catastrophic coefficients than the other models for all three shifted sets. This shows that imparting hierarchical knowledge helps deep models to adapt to various degrees of the subpopulation shift.
|
| 143 |
+
|
| 144 |
+
# 4.5 Results on Non-LIVING-26
|
| 145 |
+
|
| 146 |
+
In this section, we describe results on the Non-LIVING-26 dataset, tabulated in Figure 6. The dataset has $n = 2 6$ classes, a depth of 5 and number of subpopulation, $s = 2$ . The $n$ classes are located at depth $l = 4$ and the subpopulations at $l = 5$ respectively. For comparison, we train Baseline-18 and BCNN-18. We know that depth might hinder our conditional training process, since we limit samples that pass down from a level to the next contingent on their correct prediction at that head. To test this, we create a collapsed version of this hierarchy. We collapse levels 1 and 2 into a single level and create a new hierarchy with the same amount of information and term this as L3 Hierarchical-18. All models are trained on three random seeds each and the mean numbers are reported.
|
| 147 |
+
|
| 148 |
+
As seen from Figure 6, BCNN-18 outperforms our hierarchical model on ‘ $s - s$ ’ performance, while our framework performs better under both kinds of shift. In our conditional training framework, we only train subsequent heads if the previous heads have correctly classified the sample. As the depth of the hierarchical tree increases, fewer samples reach the final head for training, affecting the final classification performance on ‘ $s \mathrm { ~ - ~ } s ^ { \mathrm { ~ } }$ models. Despite that, we outperform aseline-18 and BCNN-18 both in terms of accuracy and catastrophic co-efficient on the ‘subpopulation shift ‘ $s - u$ ’ set. Since, the L3 Hierarchical18 model is trained on one less level of hierarchical information, the final head gets to classify some more samples than Hierarchical-18 and has slightly better ‘ $s - s ^ { \prime }$ ’ performance. We evaluate the catastrophic coefficient of each model under two different settings. As the name suggests $C a t ( 3 ) _ { s - s }$ quantifies the effect of catastrophic mispredictions calculated on the collapsed L3-Hierarchy. The BCNN-18 model was trained with all four levels of hierarchical information. Yet, under $s - u ^ { \prime }$ , the L3 Hierarchical-18 model performs slightly better than the former, which shows the benefits of our conditional training framework.
|
| 149 |
+
|
| 150 |
+
Table 5: Accuracy results on ENTITY-30, with and without shift. The networks are trained on a collapsed hierarchy of 2 levels, but catastrophic coefficients are evaluated on both the collapsed and original, uncollapsed hierarchy of levels 2 and 4, respectively, shown in brackets on the right
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Model</td><td>AcCg-s</td><td>Accs-u</td></tr><tr><td>Baseline-18</td><td>87.98</td><td>49.52</td></tr><tr><td>Hierarchical-18</td><td>87.93</td><td>50.24</td></tr></table>
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Catastrophic Co-efficient Levels on ENTITY-30
|
| 156 |
+
|
| 157 |
+
Figure 7: Results on training networks on the collapsed version of ENTITY-30. Accuracy is shown on the left, and corresponding catastrophic coefficients on the right. Our model outperforms the flat baseline in both accuracy and catastrophic coefficient on both the collapsed and un-collapsed versions of ENTITY-30 under shift.
|
| 158 |
+
|
| 159 |
+
# 4.6 Results on ENTITY-30
|
| 160 |
+
|
| 161 |
+
We saw the effect of collapsing hierarchy with the previous set of experiments on Non-LIVING-26. Now, we attempt to understand the results of doing the reverse. In this case, we endeavor to answer that if we train a model on the collapsed version of a hierarchy, would the model still perform better on the original uncollapsed hierarchy that it did not get to see. To perform this experiment, we train on a collapsed version of the ENTITY-30 dataset and test on both the collapsed version and the un-collapsed (original) version. The dataset has $n = 3 0$ , a depth of 5 and $s = 4$ . The $n$ classes are located at depth $l = 4$ and the subpopulations at $\iota = 5$ respectively. The hierarchical tree encapsulates both living and non-living entities and the more meaningful information is embedded between levels 3 and 4. Hence, we collapse the hierarchical information from levels $1 - 3$ to a single level. We train the Hierarchical-18 models on these two levels only and the Baseline-18 models are trained flat on all the classes. All models have been trained on three random seeds each and the mean numbers are reported in Figure 7. The catastrophic coefficients are reported for ‘ $s - s ^ { \gamma }$ and $s - u ^ { \prime }$ cases with the number of levels for evaluation in the hierarchy in brackets. To summarize, the networks are trained on 2 levels, but evaluated additionally on an expanded 4 level hierarchy. We note that the Hierarchical-18 has a comparable performance with Baseline-18 on ’ $s - s$ ’ set but on the shifted unseen distribution, there is a boost in both accuracy and catastrophic co-efficient. Under both the collapsed and expanded hierarchies, our models have has less catastrophic mispredictions under both ‘s-s’ and ‘s-u’ settings.
|
| 162 |
+
|
| 163 |
+
# 5 Conclusion
|
| 164 |
+
|
| 165 |
+
In this paper, we target the problem of subpopulation shift, which is a specific kind of shift under the broader umbrella of domain adaptation. The subpopulations that make up the categories for the classification task change between training and testing. For instance, the testing distribution may contain new breeds of dogs not seen during training, but all samples will be labeled ‘dog’. We note an implicit notion of hierarchy in the framing of the problem itself; in the knowledge of all constituent subpopulations sharing the common immediate ancestry. In line with this, we extend the notion of hierarchy and make it explicit to better tackle the issue of subpopulation shift. We consider the underlying hierarchical structure of vision datasets, in the form of both our own custom subsets and benchmark datasets for subpopulation shift. We incorporate this information explicitly into training via labeling each level with an individual one-hot label, and then encourage collaboration between multiple heads of a model via a conditional training framework. In this framework, each head is only trained on samples that were correctly classified at all levels before the present one. We further introduce a metric to capture the notion of semantic correctness of predictions. It uses the shortest hierarchical distance between the misprediction and the true label as per the hierarchy to quantify the catastrophic impact of mispredictions. We show that our hierarchy-aware conditional training setup outperforms flat baselines by around $\sim ( 1 - 5 ) \%$ in terms of accuracy and $\sim ( 3 - 1 1 ) \%$ in terms of catastrophic coefficient over standard models across two custom datasets and three subpopulation shift benchmarks.
|
| 166 |
+
|
| 167 |
+
# References
|
| 168 |
+
|
| 169 |
+
Hana Ajakan, Pascal Germain, H. Larochelle, François Laviolette, and Mario Marchand. Domain-adversarial neural networks. ArXiv, abs/1412.4446, 2014.
|
| 170 |
+
Bilal Alsallakh, Amin Jourabloo, Mao Ye, Xiaoming Liu, and Liu Ren. Do convolutional neural networks learn class hierarchy? IEEE Transactions on Visualization and Computer Graphics, 2018.
|
| 171 |
+
Martín Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. ArXiv, abs/1907.02893, 2019.
|
| 172 |
+
Björn Barz and Joachim Denzler. Hierarchy-based image embeddings for semantic image retrieval. IEEE Winter Conference on Applications of Computer Vision (WACV), 2019.
|
| 173 |
+
Björn Barz and Joachim Denzler. Content-based image retrieval and the semantic gap in the deep learning era. In ICPR Workshops, 2020.
|
| 174 |
+
Shai Ben-David, John Blitzer, Koby Crammer, and Fernando C Pereira. Analysis of representations for domain adaptation. In NeurIPS, 2006.
|
| 175 |
+
Luca Bertinetto, Romain Mueller, Konstantinos Tertikas, Sina Samangooei, and Nicholas A. Lord. Making better mistakes: Leveraging class hierarchies with deep networks. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 176 |
+
Tianle Cai, Ruiqi Gao, J. Lee, and Qi Lei. A theory of label propagation for subpopulation shift. In ICML, 2021.
|
| 177 |
+
Tao Chen, Shijian Lu, and Jiayuan Fan. Ss-hcnn: Semi-supervised hierarchical convolutional neural network for image classification. IEEE Transactions on Image Processing, 2019.
|
| 178 |
+
Yining Chen, Colin Wei, Ananya Kumar, and Tengyu Ma. Self-training avoids using spurious features under domain shift. NeurIPS, 2020.
|
| 179 |
+
Nicolas Courty, Rémi Flamary, Devis Tuia, and Alain Rakotomamonjy. Optimal transport for domain adaptation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017.
|
| 180 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, K. Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. IEEE Conference on Computer Vision and Pattern Recognition, 2009.
|
| 181 |
+
Jia Deng, Alexander C. Berg, K. Li, and Li Fei-Fei. What does classifying more than 10, 000 image categories tell us? In ECCV, 2010.
|
| 182 |
+
Jia Deng, Sanjeev Satheesh, Alexander Berg, and Fei Li. Fast and balanced: Efficient label tree learning for large scale object recognition. In J. Shawe-Taylor, R. Zemel, P. Bartlett, F. Pereira, and K.Q. Weinberger (eds.), Advances in Neural Information Processing Systems, volume 24. Curran Associates, Inc., 2011. URL https://proceedings.neurips.cc/paper/2011/file/ 5a4b25aaed25c2ee1b74de72dc03c14e-Paper.pdf.
|
| 183 |
+
Jia Deng, Nan Ding, Yangqing Jia, Andrea Frome, Kevin Murphy, Samy Bengio, Yuan Li, Hartmut Neven, and Hartwig Adam. Large-scale object classification using label relation graphs. In ECCV, 2014.
|
| 184 |
+
Ankit Dhall. Learning representations for images with hierarchical labels. ArXiv, abs/2004.00909, 2020.
|
| 185 |
+
Ankit Dhall, Anastasia Makarova, Octavian-Eugen Ganea, Dario Pavllo, Michael Greeff, and Andreas Krause. Hierarchical image classification using entailment cone embeddings. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2020.
|
| 186 |
+
Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In ICML, 2014.
|
| 187 |
+
Andrea Frome, Gregory S. Corrado, Jonathon Shlens, Samy Bengio, Jeffrey Dean, Marc’Aurelio Ranzato, and Tomas Mikolov. Devise: A deep visual-semantic embedding model. In NeurIPS, 2013.
|
| 188 |
+
Yaroslav Ganin and Victor S. Lempitsky. Unsupervised domain adaptation by backpropagation. ArXiv, abs/1409.7495, 2015.
|
| 189 |
+
Yaroslav Ganin, E. Ustinova, Hana Ajakan, Pascal Germain, H. Larochelle, François Laviolette, Mario Marchand, and Victor S. Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 2016.
|
| 190 |
+
Muhammad Ghifary, W. Kleijn, Mengjie Zhang, and David Balduzzi. Domain generalization for object recognition with multi-task autoencoders. IEEE International Conference on Computer Vision (ICCV), 2015.
|
| 191 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In ICML, 2011.
|
| 192 |
+
Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. IEEE Conference on Computer Vision and Pattern Recognition, 2012.
|
| 193 |
+
Mingming Gong, Kun Zhang, Tongliang Liu, Dacheng Tao, Clark Glymour, and Bernhard Schölkopf. Domain adaptation with conditional transferable components. JMLR workshop and conference proceedings, 2016.
|
| 194 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT Press, 2016.
|
| 195 |
+
Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Domain adaptation for object recognition: An unsupervised approach. International Conference on Computer Vision, 2011.
|
| 196 |
+
Peter Hase, Chaofan Chen, Oscar Li, and Cynthia Rudin. Interpretable image recognition with hierarchical prototypes. ArXiv, abs/1906.10651, 2019.
|
| 197 |
+
Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 198 |
+
Gao Huang, Zhuang Liu, and Kilian Q. Weinberger. Densely connected convolutional networks. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 199 |
+
Matheus Inoue, Carlos Henrique Quartucci Forster, and Antonio Carlos dos Santos. Semantic hierarchybased convolutional neural networks for image classification. International Joint Conference on Neural Networks (IJCNN), 2020.
|
| 200 |
+
Xiang Jiang, Mohammad Havaei, Farshid Varno, Gabriel Chartrand, Nicolas Chapados, and Stan Matwin. Learning to learn with conditional class dependencies. In ICLR, 2019.
|
| 201 |
+
Sergey Karayev, Mario Fritz, and Trevor Darrell. Anytime recognition of objects and scenes. In 2014 IEEE Conference on Computer Vision and Pattern Recognition, pp. 572–579, 2014. doi: 10.1109/CVPR.2014.80.
|
| 202 |
+
Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Wei hua Hu, Michihiro Yasunaga, Richard L. Phillips, Sara Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. Wilds: A benchmark of in-the-wild distribution shifts. In ICML, 2021.
|
| 203 |
+
Brendan Kolisnik, Isaac Hogan, and Farhana H. Zulkernine. Condition-cnn: A hierarchical multi-label fashion image classification model. Expert Syst. Appl., 2021.
|
| 204 |
+
Ananya Kumar, Tengyu Ma, and Percy Liang. Understanding self-training for gradual domain adaptation. In ICML, 2020.
|
| 205 |
+
Bo Li, Yezhen Wang, Tong Che, Shanghang Zhang, Sicheng Zhao, Pengfei Xu, Wei Zhou, Yoshua Bengio, and Kurt Keutzer. Rethinking distributional matching based domain adaptation. ArXiv, abs/2006.13352, 2020.
|
| 206 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M. Hospedales. Learning to generalize: Meta-learning for domain generalization. ArXiv, abs/1710.03463, 2018.
|
| 207 |
+
Yitong Li, Michael Murias, Samantha Major, Geraldine Dawson, and David Edwin Carlson. On target shift in adversarial domain adaptation. In AISTATS, 2019.
|
| 208 |
+
Yuntao Liu, Yong Dou, Ruochun Jin, and Peng Qiao. Visual tree convolutional neural network in image classification. 24th International Conference on Pattern Recognition (ICPR), 2018.
|
| 209 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. Learning transferable features with deep adaptation networks. ArXiv, abs/1502.02791, 2015.
|
| 210 |
+
James L. McClelland, Zahra Sadeghi, and Andrew M. Saxe. A critique of pure hierarchy: Uncovering cross-cutting structure in a natural dataset. 2016.
|
| 211 |
+
George A. Miller. Wordnet: A lexical database for english. Commun. ACM, 1992.
|
| 212 |
+
Jinho Park, Heegwang Kim, and Joonki Paik. Cf-cnn: Coarse-to-fine convolutional neural network. Applied Sciences, 11, 2021.
|
| 213 |
+
Hieu Pham, Tung T. Le, Dat Thanh Ngo, Dat Q. Tran, and Ha Q. Nguyen. Interpreting chest x-rays via cnns that exploit hierarchical disease dependencies and uncertainty labels, 2021.
|
| 214 |
+
Yanyun Qu, Li Lin, Fumin Shen, Chang Lu, Yang Wu, Yuan Xie, and Dacheng Tao. Joint hierarchical category structure learning and large-scale image classification. IEEE Transactions on Image Processing, 2017.
|
| 215 |
+
Joaquin Quionero-Candela, Masashi Sugiyama, Anton Schwaighofer, and Neil D. Lawrence. Dataset shift in machine learning. 2009.
|
| 216 |
+
Ali Sharif Razavian, Hossein Azizpour, Josephine Sullivan, and Stefan Carlsson. Cnn features off-the-shelf: An astounding baseline for recognition. IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2014.
|
| 217 |
+
Deboleena Roy, Priyadarshini Panda, and Kaushik Roy. Tree-cnn: A hierarchical deep convolutional neural network for incremental learning. Neural Networks, 2020.
|
| 218 |
+
Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In ECCV, 2010.
|
| 219 |
+
Shibani Santurkar, Dimitris Tsipras, and Aleksander Madry. {BREEDS}: Benchmarks for subpopulation shift. In International Conference on Learning Representations, 2021.
|
| 220 |
+
Andrew M. Saxe, James L. McClelland, and Surya Ganguli. Learning hierarchical categories in deep neural networks. Cognitive Science, 2013.
|
| 221 |
+
Sang-Il Seo and Juntae Kim. Hierarchical semantic loss and confidence estimator for visual-semantic embedding-based zero-shot learning. Applied Sciences, 2019.
|
| 222 |
+
Yian Seo and Kyung shik Shin. Hierarchical convolutional neural networks for fashion image classification. Expert Systems with Applications, 2019.
|
| 223 |
+
|
| 224 |
+
Sindi Shkodrani, Yu Wang, Marco Manfredi, and Nóra Baka. United we learn better: Harvesting learning improvements from class hierarchies across tasks. ArXiv, abs/2107.13627, 2021.
|
| 225 |
+
|
| 226 |
+
Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin Dogus Cubuk, Alexey Kurakin, Han Zhang, and Colin Raffel. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. ArXiv, abs/2001.07685, 2020.
|
| 227 |
+
Guocong Song and Wei Chai. Collaborative learning for deep neural networks. In NeurIPS, 2018.
|
| 228 |
+
Remi Tachet des Combes, Han Zhao, Yu-Xiang Wang, and Geoffrey J Gordon. Domain adaptation with conditional distribution matching and generalized label shift. In Advances in Neural Information Processing Systems, 2020.
|
| 229 |
+
Salma Taoufiq, Balázs Nagy, and Csaba Benedek. Hierarchynet: Hierarchical cnn-based urban building classification. Remote Sensing, 2020.
|
| 230 |
+
Manisha Verma, Sudhakar Kumawat, Yuta Nakashima, and Shanmuganathan Raman. Yoga-82: A new dataset for fine-grained classification of human poses. IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2020.
|
| 231 |
+
Nakul Verma, Dhruv Mahajan, Sundararajan Sellamanickam, and Vinod Nair. Learning hierarchical similarity metrics. In IEEE conference on computer vision and pattern recognition. IEEE, 2012.
|
| 232 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017. URL http://arxiv.org/abs/1708.07747.
|
| 233 |
+
Zhicheng Yan, Hao Zhang, Robinson Piramuthu, Vignesh Jagadeesh, Dennis DeCoste, Wei Di, and Yizhou Yu. Hd-cnn: Hierarchical deep convolutional neural networks for large scale visual recognition. IEEE International Conference on Computer Vision, 2015.
|
| 234 |
+
Hao-Tong Ye, Chuanlong Xie, Tianle Cai, Ruichen Li, Zhenguo Li, and Liwei Wang. Towards a theoretical framework of out-of-distribution generalization. ArXiv, abs/2106.04496, 2021.
|
| 235 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In ECCV, 2014.
|
| 236 |
+
Quanshi Zhang, Yu Yang, Ying Nian Wu, and Song-Chun Zhu. Interpreting cnns via decision trees. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 237 |
+
Yu Zheng, Jianping Fan, Ji Zhang, and Xinbo Gao. Hierarchical learning of multi-task sparse metrics for large-scale image classification. Pattern Recognition, 2017.
|
| 238 |
+
Xinqi Zhu and Michael Bain. B-cnn: Branch convolutional neural network for hierarchical classification. ArXiv, abs/1709.09890, 2017.
|
| 239 |
+
|
| 240 |
+
# A Appendix
|
| 241 |
+
|
| 242 |
+
We mention some additional related literature in this section.
|
| 243 |
+
|
| 244 |
+
# A.1 Additional Related Work
|
| 245 |
+
|
| 246 |
+
Hierarchy based Semantic Embedding. DeVise (Frome et al., 2013) presents a deep visual-semantic embedded model which learns similarity between classes in the semantic space both from images as well as unannotated text. Barz & Denzler (2019; 2020) demonstrates how prior knowledge can be leveraged based on hierarchy of classes such as WordNet to learn semantically discriminating features. Such learnt class embeddings projected on a unit hypersphere proved to be beneficial for both novel class predictions as well as image retrieval tasks.
|
| 247 |
+
|
| 248 |
+
Domain Adaptation and its variants are a well studied set of problems in deep learning. One direction of works (Ben-David et al. (2006), Saenko et al. (2010), Ganin $\&$ Lempitsky (2015), Courty et al. (2017), Gong et al. (2016), Donahue et al. (2014), Razavian et al. (2014)) is aimed at tackling the problem of adapting to target domains by learning on a selective set of samples from the target domain itself. Another line of work aims to match the source and target distributions in the feature space (Glorot et al. (2011), Ajakan et al. (2014), Long et al. (2015), Ganin et al. (2016)). The main motive behind these set of works is to tackle out-of-support domain adaptation tasks by sharing a common representation between the two. To adapt to newer environments, deep models are trained gradually to make them more suitable for transition to these newer environments (Gopalan et al. (2011), Gong et al. (2012), Glorot et al. (2011), Kumar et al. (2020), Chen et al. (2020)). Domain generalization enables the use of multiple different environments during training, but requires having a prior knowledge on the target distribution (Ghifary et al. (2015), Li et al. (2018), Arjovsky et al. (2019), Ye et al. (2021)). We on the other hand, focus on a more specific problem of distribution shift, wherein the shift occurs at a subpopulation level in the target domain.
|
| 249 |
+
|
| 250 |
+
Hierarchical Learning for in Non-Supervised Approaches. Tree-CNN (Roy et al., 2020) tackles the incremental learning problem where the model expands as a tree to accommodate new classes. Zheng et al. (2017) and Qu et al. (2017) tackle the problem of metric learning via hierarchical concepts on large scale image datasets. Chen et al. (2019) applies a semi-supervised approach to learn cluster level concepts at higher level of a hierarchy and categorical features at leaf node levels. Jiang et al. (2019) proposes a Conditional class-aware Meta Learning framework that conditionally learns better representations through modeling inter-class dependencies. Seo & Kim (2019) incorporates a hierarchical semantic loss function together with a confidence estimator to improve performance of zero-shot learning in terms of hit@k accuracy. Works such as McClelland et al. (2016) and Saxe et al. (2013) tried to understand the importance of hierarchical learning from a theoretical perspective and demonstrated an implementation on a neural network based model.
|
| 251 |
+
|
| 252 |
+
Hierarchical Learning for Interpretability. Interpreting predictions from CNNs has been key in understanding what features models look at in order to make predictions. Zhang et al. (2019) provide a semantic as well as quantitative explanations for CNN predictions based on a decision tee in a coarse-to-fine manner at different fine-grained levels. Building on this concept, Hase et al. (2019) introduces a model that leverages a predefined taxonomy to explain the predictions at each level of the taxonomy essentially showing how a Capuchin is gradually classified first as an animal, followed by a primate and finally as a Capuchin as per the hierarchy.
|
| 253 |
+
|
| 254 |
+
Applications of Hierarchical Learning. Dhall et al. (2020), Dhall (2020) show how an image classifier augmented with hierarchical information based on entailment cone embeddings outperforms flat classifiers on an Entomological Dataset. Pham et al. (2021) takes advantage of the relationship between diseases in chest X-rays to learn conditional probabilities through image classifiers. Taoufiq et al. (2020) adapts a similar approach to learn urban structural relationships.
|
| 255 |
+
|
| 256 |
+
# A.2 Experiments
|
| 257 |
+
|
| 258 |
+
# A.2.1 Custom Datasets
|
| 259 |
+
|
| 260 |
+
Results on Custom Dataset 1 (left) and Custom Dataset 2 (right). Mean and standard deviations are reported for five random trials.
|
| 261 |
+
|
| 262 |
+
<table><tr><td>Model</td><td>Accs-s</td><td>Accs-u</td><td>Accs-s</td><td>Accs-u</td></tr><tr><td>Baseline-18</td><td>83.47 ± 0.95</td><td>48.69 ± 1.32</td><td>77.73 ± 2.01</td><td>55.0 ± 0.87</td></tr><tr><td>BCNN-18</td><td>87.87 ± 0.71</td><td>51.33 ± 1.22</td><td>81.73 ± 0.51</td><td>58.96 ± 1.47</td></tr><tr><td>Hierarchical-18</td><td>88.27 ± 0.88</td><td>53.76 ± 0.47</td><td>82.48 ± 0.54</td><td>59.35 ± 1.65</td></tr></table>
|
| 263 |
+
|
| 264 |
+
# A.2.2 LIVING-17
|
| 265 |
+
|
| 266 |
+
Results on LIVING-17, with and without shift is shown on the left. Results for shift on Living-17-B and Living-17-C are shown as well. Mean and standard deviations are reported for five random trials.
|
| 267 |
+
|
| 268 |
+
<table><tr><td>Model</td><td>Accs-s</td><td>Accs-u</td><td> Accs-u(B)</td><td>Accs-u(C)</td></tr><tr><td>Baseline-18</td><td>92.3 ± 0.84</td><td>57.02 ± 1.48</td><td>53.54 ± 2.28</td><td>53.04 ± ± 1.9</td></tr><tr><td>BCNN-18</td><td>92.88 ± 0.29</td><td>58.8 ± 0.51</td><td>55.66 ± 0.52</td><td>55.1 ± 0.96</td></tr><tr><td>Hierarchical-18</td><td>93.17 ± 0.34</td><td>60.53 ± 0.89</td><td>56.6 ± 0.96</td><td>55.62 ± 0.82</td></tr></table>
|
| 269 |
+
|
| 270 |
+
# A.2.3 Non-LIVING-26
|
| 271 |
+
|
| 272 |
+
Results on Non-LIVING-26, with and without shift. The L3 Hierarchy is the same hierarchy with the first two levels collapsed into a single level. Mean and standard deviations are reported for five random trials.
|
| 273 |
+
|
| 274 |
+
<table><tr><td>Model</td><td>Accs-s</td><td>Accs-u</td></tr><tr><td>Baseline-18</td><td>88.39 ± 0.32</td><td>42.13 ± 0.93</td></tr><tr><td>BCNN-18</td><td>88.1 ± 0.43</td><td>42.4 ± 0.28</td></tr><tr><td>L3 Hierarchical-18</td><td>87.71 ± 0.16</td><td>42.44 ± 0.31</td></tr><tr><td>Hierarchical-18</td><td>87.41 ± 0.34</td><td>42.94 ± 0.46</td></tr></table>
|
| 275 |
+
|
| 276 |
+
# A.2.4 ENTITY-30
|
| 277 |
+
|
| 278 |
+
Accuracy results on ENTITY-30, with and without shift. Mean and standard deviations are reported for five random trials.
|
| 279 |
+
|
| 280 |
+
<table><tr><td>Model</td><td>Accs-s</td><td>Accs-u</td></tr><tr><td>Baseline-18</td><td>87.98 ± 0.1</td><td>49.52 ± 0.16</td></tr><tr><td>Hierarchical-18</td><td>87.93 ± 0.09</td><td>50.24 ± 0.26</td></tr></table>
|
md/test/u6jbcaCHqO/u6jbcaCHqO.md
ADDED
|
@@ -0,0 +1,507 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SCIBENCH: EVALUATING COLLEGE-LEVEL SCIENTIFIC PROBLEM-SOLVING ABILITIES OF LARGE LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent advances in Large Language Models (LLMs) have demonstrated notable progress on many mathematical benchmarks. However, most of these benchmarks only contain problems grounded in junior and senior high school subjects, contain only multiple-choice questions, and are confined to a limited scope of elementary arithmetic operations. To address these issues, this paper introduces an expansive benchmark suite SCIBENCH that aims to systematically examine the reasoning capabilities required for solving complex scientific problems. SCIBENCH contains two carefully curated datasets: an open set featuring a range of collegiate-level scientific problems drawn from mathematics, chemistry, and physics textbooks, and a closed set comprising problems from undergraduate-level exams in computer science and mathematics. Based on the two datasets, we conduct an in-depth benchmarking study of five representative LLMs with various prompting strategies. The results reveal that current LLMs fall short of delivering satisfactory performance, with the best overall score of merely $3 5 . 8 0 \%$ . Furthermore, through a detailed user study, we categorize the errors made by LLMs into ten problem-solving abilities. Our analysis indicates that no single prompting strategy significantly outperforms the others and some strategies that demonstrate improvements in certain problemsolving skills could result in declines in other skills. We envision that SCIBENCH will catalyze further developments in the reasoning abilities of LLMs, thereby ultimately contributing to scientific research and discovery.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent advancements in Large Language Models (LLMs) have dramatically expanded the boundaries of artificial intelligence [1–8]. They have demonstrated outstanding performance in many mathematical reasoning tasks that are typically considered challenging even for well-educated individuals [9–13]. Notably, GPT-4 achieves a remarkable score of 163 out of 170 on GRE Quantitative Exam, placing it at the 80th percentile ranking [3].
|
| 12 |
+
|
| 13 |
+
While the remarkable improvements in these benchmark performances might suggest that LLMs are capable of performing mathematical reasoning tasks, we argue that this assertion might be overly optimistic due to the inherent limitations of the current benchmarks. Firstly, many existing benchmarks such as ScienceQA [14] and GSM8K [15] only contain problems grounded in grade-level subjects, thereby lacking enough complexity. Although other benchmarks like MATH [16] introduce high-school level problems, they only involve a restricted range of operations — addition, subtraction, multiplication, and exponentiation — which do not adequately assess the depth of reasoning abilities of LLMs. Secondly, recent works including MMLU [17], AGIEval [18], and CEval [19], despite introducing challenging problems that span a wide range of disciplines, mainly focus on multiplechoice questions without providing detailed solutions. This setup could inadvertently mislead benchmark evaluation, as it allows LLMs to guess the answers from candidate choices and appear knowledgeable in comprehending the questions. Moreover, the lack of detailed solutions prevents us from understanding the limitations of LLMs and discerning why they commit certain errors. Furthermore, these benchmarks often source problems from online material, where questions are closely followed by answers. As these problems could already be a part of the training data, the models, trained in an autoregressive manner, may directly predict the answer without genuinely understanding the problem. This potential data leakage provides a shortcut for LLM evaluation, further compromising its validity.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: An example problem from Physical Chemistry with solutions generated under two prompting strategies. GPT-4 with Chain-of-Thought (CoT) prompting shows calculation errors, while GPT-4 that prompts Python as external tools misunderstands mathematical equations. Errors are highlighted in red and the corrections are shown in purple.
|
| 17 |
+
|
| 18 |
+
On the other hand, many studies propose various prompting strategies aimed at enhancing the reasoning abilities for mathematical problem solving. For example, the representative strategy chainof-thought (CoT) instructs LLMs using specific examples to generate step-by-step solutions that prompt deeper problem thinking [9, 20–22], while other strategies propose to enable LLMs to utilize external tools [23, 24] that improve the numerical computation capability. However, even these strategic approaches, each with its specific strengths, struggle to fully address complex scientific problems. Consider an example problem from college-level Physical Chemistry [25] that requires the use of the Planck distribution to derive certain quantities. As shown in Figure 1, LLMs with CoT prompts accurately generate the correct formula, but fail in the final numerical calculation. Further, when explicitly instructed to generate a Python program to solve this problem alongside the reasoning process of CoT, the LLM derives an incorrect equation, misplacing $\lambda _ { 1 }$ in the numerator rather than the denominator. This error illustrates that LLMs struggle to comprehend mathematical relationships when employing external tools. This example underscores the need for a fine-grained analysis of the essential skill set required for complex scientific problem solving.
|
| 19 |
+
|
| 20 |
+
To mitigate the aforementioned deficiencies in existing LLM evaluation, this paper introduces a novel college-level Scientific problem solving Benchmark, referred to as SCIBENCH. Our SCIBENCH contains two datasets of college-level scientific problems. The open dataset includes 695 problems collected from widely-used textbooks in college-level Chemistry, Physics, and Math courses. To simulate real-world evaluation, we also include a closed dataset that encompasses seven sets of midterm and final examination questions from three college courses in Computer Science and Mathematics. Distinct from existing benchmarks, all of the problems in SCIBENCH are open-ended, free-response questions. They require multiple steps of reasoning and the computation therein involve complex arithmetic operations such as differentiation and integration. To ensure the integrity of our evaluation, these datasets have been manually extracted from PDF documents and formatted into LaTeX documents, thereby minimizing the possibility of their leakage in LLM training data. Importantly, SCIBENCH also includes detailed solution steps, facilitating detailed error analysis.
|
| 21 |
+
|
| 22 |
+
Our evaluation includes five representative LLMs: two open-source models LLaMA-2-7B and LLaMA-2-70B, and three close-source models Claude2, GPT-3.5, and GPT-4, with various prompting strategies, including CoT, zero-shot learning, and few-shot learning. In addition, we also prompt LLMs to utilize external tools such as Python and Wolfram languages. The experimental results indicate that the complexity and difficulty of our dataset are sufficient to differentiate the performance levels of different LLMs. With the strongest configuration, which combines both CoT prompting and external tools, GPT-4 achieves an average score of $3 5 . 8 0 \%$ on the open dataset and $5 1 . 5 7 \%$ on the closed exam dataset. These results suggest a considerable potential for improvement in future LLMs.
|
| 23 |
+
|
| 24 |
+
Table 1: Comparison of SCIBENCH with other benchmarks. “Level” represents the grade level of problems. “Computation” represents the level of computational type that problems use. “Solution” represents whether datasets contain detailed solutions. “Type” represents the type of most problems provided in the dataset: “MT” denotes multiple-choice questions and “Free” denotes free-response questions. “Human” indicates whether the analysis process employs a human annotation process. “Auto” represents whether the analysis process uses an automatic annotation process.
|
| 25 |
+
|
| 26 |
+
<table><tr><td rowspan="2"> Benchmark</td><td colspan="4"></td><td colspan="4">FEew-Shot CoT</td><td colspan="2">Haunanysiato</td></tr><tr><td>Level</td><td>Domputation</td><td>Solution</td><td>Type</td><td>Zero-Shot</td><td></td><td></td><td>Tool</td><td></td><td></td></tr><tr><td>ScienceQA [14]</td><td>Grade 1-12</td><td>Algebra</td><td>Yes</td><td>MT</td><td>Yes</td><td>Yes</td><td>Yes</td><td>No</td><td>No</td><td>No</td></tr><tr><td>IconQA [26]</td><td>Grade 1-12</td><td>Algebra</td><td>No</td><td>MT</td><td>No</td><td>Yes</td><td>No</td><td>No</td><td>No</td><td>No</td></tr><tr><td>TabMWP [27]</td><td>Grade 1-12</td><td>Algebra</td><td>Yes</td><td>Free</td><td>No</td><td>Yes</td><td>No</td><td>No</td><td>No</td><td>No</td></tr><tr><td>GSM8K[15]</td><td>Grade 1-12</td><td>Algebra</td><td>Yes</td><td>Free</td><td>No</td><td>Yes</td><td>No</td><td>No</td><td>No</td><td>No</td></tr><tr><td>MATH [16]</td><td>High School</td><td>Exponentiation</td><td>Yes</td><td>Free</td><td>No</td><td>Yes</td><td>No</td><td>No</td><td>No</td><td>No</td></tr><tr><td>LILA [28]</td><td>High School</td><td>Exponentiation</td><td>Yes</td><td>Free</td><td>Yes</td><td>Yes</td><td>No</td><td>No</td><td>No</td><td>No</td></tr><tr><td>SciEval [29]</td><td>High School</td><td>Exponentiation</td><td>No</td><td>MT</td><td>Yes</td><td>Yes</td><td>Yes</td><td>No</td><td>No</td><td>No</td></tr><tr><td>MMLU [17]</td><td> High School + College</td><td>Exponentiation</td><td>No</td><td>MT</td><td>No</td><td>Yes</td><td>No</td><td>No</td><td>No</td><td>No</td></tr><tr><td>CEval[19]</td><td>High School + College</td><td>Differentiation</td><td>No</td><td>MT</td><td>No</td><td>Yes</td><td>Yes</td><td>No</td><td>No</td><td>No</td></tr><tr><td>AGIEval[18]</td><td>High School + College</td><td>Exponentiation</td><td>No</td><td>MT</td><td>Yes</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td><td>No</td></tr><tr><td>TheroemQA [30]</td><td>College</td><td>Differentiation</td><td>No</td><td>Free</td><td>No</td><td>Yes</td><td>Yes</td><td>Yes</td><td>No</td><td>No</td></tr><tr><td>ScIBENCH</td><td>College</td><td>Differentiation</td><td>Yes</td><td>Free</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td></tr></table>
|
| 27 |
+
|
| 28 |
+
In order to gain a comprehensive understanding of the limitations of LLMs in scientific problem solving, we propose a novel self-refinement method to uncover the deficient skills in the solutions made by LLMs. Firstly, we compare the correct solutions with the solutions generated by LLMs and, with the assistance of human annotators, summarize ten essential skills requisite for successful scientific problem-solving. These skills include proficiency in domain knowledge, mathematical reasoning, numerical calculation abilities, and comprehension of common sense concepts. Subsequently, we employ an LLM-empowered self-critic approach to automatically classify the lacking skills in the solutions made by the benchmarked LLMs under each experiment configuration. Our analysis finds that (1) although CoT significantly improves the calculation ability, it is less effective in other aspects; (2) prompts with the use of external tools could potentially compromise the other fundamental skills; (3) few-shot learning does not universally improve scientific problem-solving skills.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Recently, many benchmarks focus on assessing problem-solving skills of LLMs, particularly in scientific and mathematical domains [17, 18, 27, 28, 30–33]. GSM8K [15] is a widely used math dataset containing 8.5K grade school math word problems. ScienceQA [14] is a multimodal questionanswering dataset with accompanying lecture and explanation annotations. MATH [16] presents a challenging collection of 12.5K math problems gathered from math competitions. LILA [28] extends 20 datasets by including task instructions and Python program solutions. However, the majority of those benchmarks concentrates on the grade or high school level tasks involving basic arithmetic operations such as addition, multiplication, and exponentiation, rather than more sophisticated operations like differentiation. TheroemQA [30] is a theorem-oriented dataset comprising 800 high-quality questions that aim to evaluate the ability of LLMs to apply theorems to solve problems. However, it lacks an in-depth qualitative analysis of their benchmark. Galactica [34] provides a set of scientific tasks, including LaTeX equation conversions, domain knowledge probes, citation prediction and chemical QA. BIG-Bench [35] is a large-scale general-purpose test suite comprising 204 multiple-choice or exact-match tasks, while BIG-Bench [36] Hard poses particularly challenging chain-of-thought prompts. C-EVAL [19] focuses on evaluating LLMs in Chinese, offering questions from humanities to science and engineering. SciEval [29] includes a mix of objective and subjective questions across multiple scientific fields to assess understanding, application, and research capabilities. AGIEval [18] evaluates the performance of LLMs in human-centric standardized exams, such as college entrance exams and lawyer qualification tests. It also provides human annotated qualitative analysis to analyze the capabilities of the model. However, relying on human labor for direct solution analysis can be costly. Our evaluation protocol, based on predefined fundamental problem solving skills, enables automated classification of deficient skills for each incorrectly answered question. This approach enables an affordable, large-scale of qualitative analysis over model solutions. We include the comparison between different benchmarks in Table 1.
|
| 33 |
+
|
| 34 |
+
Table 2: Summary of the open textbook dataset. We report the number of problems and the ratio of problems with detailed solutions in the fourth and fifth columns respectively.
|
| 35 |
+
|
| 36 |
+
<table><tr><td>Subject</td><td>Title</td><td>Acronym</td><td>#Problems</td><td>%Solutions</td></tr><tr><td rowspan="3">Physics</td><td>Fundamentalsof Physics [37]</td><td>fund</td><td>83</td><td>12.0%</td></tr><tr><td>Statistical Thermodynamics [38]</td><td>thermo</td><td>84</td><td>20.2%</td></tr><tr><td>Classical Dynamics of Particles and Systems [39]</td><td>class</td><td>54</td><td>13.0%</td></tr><tr><td rowspan="4"> Chemistry</td><td> Quantum Chemistry [40]</td><td> quan</td><td>42</td><td>19.0%</td></tr><tr><td>Qugmtum Chemistyta41</td><td></td><td></td><td>18.0%</td></tr><tr><td></td><td>chemms</td><td>48</td><td></td></tr><tr><td> Physical Chemistry, Quanta, Matter, and Change [25]</td><td> matter</td><td>59</td><td>16.9%</td></tr><tr><td rowspan="3">Math</td><td>Calculus: Early Transcendentals [43]</td><td>calc</td><td>52</td><td>19.2%</td></tr><tr><td>Probability and Statistical Inference [44]</td><td>stat</td><td>95</td><td>21.1%</td></tr><tr><td>Elementary Differential Equations and Boundary Value Problems [45]</td><td>diff</td><td>55</td><td>9.1%</td></tr></table>
|
| 37 |
+
|
| 38 |
+
# 3 THE SCIBENCH DATASET
|
| 39 |
+
|
| 40 |
+
To evaluate the capabilities and analyze the limitations of Large Language Models (LLMs) to solve scientific computing problems, we collect a new dataset consisting of college-level textbooks and course exams in a variety of domains. This section details the dataset construction process.
|
| 41 |
+
|
| 42 |
+
Data selection. Our dataset aims to improve the previous benchmarks by including more challenging problems, which require more reasoning steps, and more advanced types of computations. Specifically, the selected dataset should fulfill the following requirements:
|
| 43 |
+
|
| 44 |
+
• Inclusion of college-level problems. The chosen problems demand a solid understanding of domain-specific knowledge, proficiency in reasoning capability, adept calculation skills, and the ability to comprehend complex concepts.
|
| 45 |
+
• Inclusion of detailed solutions. To facilitate a thorough analysis of the limitations of LLMs, detailed solutions should be provided as well, which could facilitate a finer-grained examination of the capacity of LLMs to handle complex problem-solving tasks.
|
| 46 |
+
• Inaccessibility in text formats. To ensure an unbiased evaluation, questions should not be readily accessible online and cannot be easily extracted or transformed into text. This aims to mitigate any potential information leakage from the exposure of LLMs to pre-existing online question banks, such as those found in standardized tests like the SAT exams.
|
| 47 |
+
• Enabling of assessing advanced problem solving ability. The problems to benchmark should not be confined to basic arithmetic operations like addition and multiplication. Rather, they should enable evaluating the capability of LLMs in performing advanced computations such as integration and differentiation, particularly when dealing with exceptionally small or large floating numbers.
|
| 48 |
+
|
| 49 |
+
Accordingly, we select ten textbooks that have been extensively used in college courses as the open textbook dataset from three scientific fields Physics, Chemistry, and Math. We report the number of problems and the ratio of problems with detailed solutions of each title in Table 2. For brevity, we will be using their acronyms when referring to specific textbooks throughout the paper. Furthermore, in order to simulate real-world evaluation, we collect a closed set of exam questions from college courses from Computer Science and Math departments, including Data Mining, Machine Learning, and Differential Equations. The statistics of the problems in each exam is detailed in Table 3. We refer readers of interest to Appendix A for details on these textbooks and exams.
|
| 50 |
+
|
| 51 |
+
To reduce the likelihood of correct answers being merely guessed from candidates, we choose to mainly include questions with more challenging, free-response answers, rather than multiple-choice questions in previous works [14, 30, 46]. In order to facilitate standardized and automated evaluation, we focus on answers that only contain single numerical numbers to avoid ambiguity for the textbook dataset. Further, we convert the answer to floating-point numbers rounded to three decimal places. For example, the answer 2π will be converted to the decimal representation of 0.450. We also treat scientific notation as a unit to avoid overflow issues. For example, if the answer is $2 . 2 \times 1 0 ^ { - 3 1 } \mathrm { m }$ we take 2.2 as the final answer and $1 0 ^ { - 3 1 }$ m as the unit.
|
| 52 |
+
|
| 53 |
+
Table 3: Statistics of the close exam dataset. We report the number of problem instances in each exam and the ratio of problems in the exam that include detailed solutions. We further report the ratio of problems in different formats, including free-response, multiple-choice, and true-false. For reference, the number in parentheses denotes the grading points assigned to the problems.
|
| 54 |
+
|
| 55 |
+
<table><tr><td rowspan="2"></td><td colspan="2">DataMining</td><td colspan="2">Machine Learning</td><td colspan="3">DifferentialEquations</td></tr><tr><td>Midterm</td><td>Final</td><td>Midterm</td><td>Final</td><td>Exam 1</td><td>Exam 2</td><td>Final</td></tr><tr><td>#Problems</td><td>25 (90)</td><td>24 (75)</td><td>12 (56)</td><td>16 (75)</td><td>8(100)</td><td>8(100)</td><td>11 (95)</td></tr><tr><td>% Solutions</td><td>56.0% (58)</td><td>16.7% (19)</td><td>100.0% (56)</td><td>31.2% (26)</td><td>100.0% (100)</td><td>100.0% (100)</td><td>90.9% (90)</td></tr><tr><td>% Free-response</td><td>40.0% (46)</td><td>33.3% (29)</td><td>66.7% (38)</td><td>81.3% (62)</td><td>100.0% (100)</td><td>100.0% (100)</td><td>90.9% (90)</td></tr><tr><td> % Multiple-choice</td><td>28.0% (28)</td><td>29.2% (28)</td><td>33.3% (18)</td><td>18.7% (13)</td><td>0.0% (0)</td><td>0.0% (0)</td><td>9.1% (5)</td></tr><tr><td>% True-false</td><td>32.0% (16)</td><td>37.5% (18)</td><td>0.0% (0)</td><td>0.0% (0)</td><td>0.0% (0)</td><td>0.0% (0)</td><td>0.0% (0)</td></tr></table>
|
| 56 |
+
|
| 57 |
+
Data preprocessing. We collect each problem from the original textbooks in PDF documents and manually process them into LaTeX documents using an OCR tool Mathpix. The data is manually collected by human annotators using a web-based annotation tool [46], whose user interface is shown in Appendix B. All problems are carefully verified by human annotators to ensure that LaTeX documents can be compiled without any syntax errors. For reference, we also provide the original numbers in textbooks. For every problem, we provide the answer in two forms: the numerical value and the corresponding LaTeX expression with mathematical notations retained (e.g., 0.450 and ${ \frac { \sqrt { 2 } } { \pi } } .$ ); the unit of each answer is saved as a separate attribute. The detailed step-by-step solutions are also provided in LaTeX. For problems having multiple answers, we either keep only the first subproblem and discard the remaining subproblems or convert each subproblem into a separate problem.
|
| 58 |
+
|
| 59 |
+
# 4 EXPERIMENTS
|
| 60 |
+
|
| 61 |
+
# 4.1 EXPERIMENT SETUP
|
| 62 |
+
|
| 63 |
+
We evaluate three close-source LLMs: Claude2 (claude2) [47], GPT-3.5 (gpt-3.5-turbo) [2], GPT-4 (gpt-4) [3], along with two open LLMs: LLaMA-2-7B (llama-2-7b-chat) and LLaMA-2- 70B (llama-2-70b-chat) [48] on two benchmark datasets. We consider two prompting strategies, including the Chain-of-Thought (CoT) prompting and prompting to use external tools, under both zero-shot and few-shot learning paradigms.
|
| 64 |
+
|
| 65 |
+
• Zero-shot and few-shot learning. In the zero-shot learning setting, models are not provided with any prior examples, which evaluates their inherent problem-solving capabilities with background knowledge and reasoning abilities. In the few-shot setting, a few of examples are given to the models before the test example. This aims to assess their capability to learn new information from the demonstrations and incorporate it into their problem-solving processes.
|
| 66 |
+
|
| 67 |
+
• Prompting-based approaches. In the zero-shot setting, we evaluate both with and without the system prompt, which describes the types and categories of questions, along with instructions; all other settings incorporate the system prompt. Additionally, we utilize CoT as our prompting strategy in the zero-shot setting. Besides, we further explore an answer-only strategy in the few-shot setting, where the prompt solely provides questions and answers without any intermediate solutions.
|
| 68 |
+
|
| 69 |
+
• Tool-augmented approaches. Given that LLMs are limited to acquiring exact knowledge and performing precise calculations, some recent approaches, such as Toolformer [23] and Chameleon [24], explored the use of external tools to enhance the capabilities of solving complex reasoning tasks. In line with this approach and acknowledging the limitations of LLMs in performing precise calculations, we also include a setting that prompts the model to convert its solution steps in natural language into either Wolfram Language2 or Python code, aiming to achieve more accurate results for certain computation steps. This prompt is only tested in the few-shot learning setting. We manually construct Python and Wolfram Language code that produces the correct answer.
|
| 70 |
+
|
| 71 |
+
In summary, we consider seven combinations of prompting strategies and learning paradigms: zeroshot learning without the system prompt $( Z e r o { - } S )$ , zero-shot learning with the system prompt (Zero), few-shot learning $( F e w )$ , CoT prompting under zero-shot $( Z e r o { + } C o T )$ and few-shot learning $( F e w { + } C o T )$ scenarios, few-shot learning that prompts to use Python $( F e w { + } P y )$ , and Wolfram
|
| 72 |
+
|
| 73 |
+
Table 4: Experimental results in terms of accuracy $( \% )$ on the textbook dataset. The best performing score is highlighted in bold and second-best is underlined.
|
| 74 |
+
|
| 75 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2"> Setting</td><td colspan="4">Chemistry</td><td colspan="3">Physics</td><td colspan="3">Math</td><td rowspan="2">Avg.</td></tr><tr><td>atkins</td><td>chemmc</td><td>quan</td><td>matter</td><td>fund</td><td>class</td><td>thermo</td><td>diff</td><td>stat</td><td>calc</td></tr><tr><td rowspan="7">LLaMA-2-7B</td><td>Zero-S</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>1.37</td><td>0.00</td><td>0.00</td><td>2.00</td><td>2.67</td><td>4.76</td><td>0.60</td></tr><tr><td>Zero</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>1.37</td><td>0.00</td><td>0.00</td><td>2.00</td><td>5.33</td><td>0.00</td><td>0.60</td></tr><tr><td>Zero+CoT</td><td>0.00</td><td>2.56</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>4.00</td><td>0.00</td><td>0.40</td></tr><tr><td>Few</td><td>3.74</td><td>5.13</td><td>5.99</td><td>2.04</td><td>4.11</td><td>0.00</td><td>1.49</td><td>6.00</td><td>8.00</td><td>0.00</td><td>2.20</td></tr><tr><td>Few+CoT</td><td>1.87</td><td>5.13</td><td>2.94</td><td>0.00</td><td>5.48</td><td>0.00</td><td>0.00</td><td>0.00</td><td>12.00</td><td>7.14</td><td>2.10</td></tr><tr><td>Few+Py</td><td>0.93</td><td>2.56</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>6.67</td><td>0.00</td><td>0.70</td></tr><tr><td>Few+Wol</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td></tr><tr><td rowspan="7">LLaMA-2-70B</td><td>Zero-S</td><td>1.87</td><td>2.56</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>2.67</td><td>0.00</td><td>0.50</td></tr><tr><td>Zero</td><td>1.87</td><td>2.56</td><td>0.00</td><td>0.00</td><td>1.40</td><td>0.00</td><td>0.00</td><td>0.00</td><td>10.70</td><td>4.76</td><td>1.41</td></tr><tr><td> Zero+CoT</td><td>0.93</td><td>2.56</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>1.49</td><td>0.00</td><td>10.70</td><td>0.00</td><td>1.10</td></tr><tr><td>Few</td><td>9.30</td><td>12.83</td><td>14.71</td><td>2.04</td><td>15.07</td><td>6.38</td><td>2.94</td><td>8.00</td><td>21.33</td><td>9.52</td><td>6.09</td></tr><tr><td>Few+CoT</td><td>13.10</td><td>12.83</td><td>14.71</td><td>4.08</td><td>12.33</td><td>0.00</td><td>0.00</td><td>0.00</td><td>13.30</td><td>9.52</td><td>4.90</td></tr><tr><td>Few+Py</td><td>0.93</td><td>7.69</td><td>2.94</td><td>0.00</td><td>9.59</td><td>0.00</td><td>1.49</td><td>0.00</td><td>17.30</td><td>9.52</td><td>2.99</td></tr><tr><td>Few+Wol</td><td>1.87</td><td>0.00</td><td>0.00</td><td>0.00</td><td>1.39</td><td>0.00</td><td>0.00</td><td>2.00</td><td>5.33</td><td>11.90</td><td>1.30</td></tr><tr><td rowspan="8">Claude2</td><td>Zero-S</td><td>16.82</td><td>17.95</td><td>8.82</td><td>8.16</td><td>6.85</td><td>12.77</td><td>7.46</td><td>4.00</td><td>37.33</td><td>9.52</td><td>8.20</td></tr><tr><td>Zero</td><td>15.00</td><td>12.83</td><td>14.71</td><td>10.20</td><td>12.33</td><td>6.40</td><td>9.00</td><td>4.00</td><td>38.70</td><td>16.70</td><td>8.71</td></tr><tr><td>Zero+CoT</td><td>20.56</td><td>15.38</td><td>8.82</td><td>4.08</td><td>8.23</td><td>4.26</td><td>5.97</td><td>6.00</td><td>36.00</td><td>14.29</td><td>8.10</td></tr><tr><td>Few</td><td>15.87</td><td>20.51</td><td>8.82</td><td>8.16</td><td>6.85</td><td>10.64</td><td>8.51</td><td>4.00</td><td>32.00</td><td>11.90</td><td>6.09</td></tr><tr><td>Few+CoT</td><td>15.89</td><td>25.64</td><td>14.65</td><td>6.12</td><td>9.59</td><td>6.38</td><td>10.45</td><td>8.00</td><td>33.33</td><td>19.05</td><td>8.90</td></tr><tr><td>Few+Py</td><td>6.54</td><td>12.82</td><td>14.71</td><td>4.08</td><td>17.81</td><td>8.51</td><td>5.97</td><td>20.00</td><td>40.00</td><td>16.67</td><td>8.70</td></tr><tr><td>Few+Wol</td><td>9.35</td><td>0.00</td><td>2.94</td><td>0.00</td><td>1.39</td><td>0.00</td><td>0.00</td><td>2.00</td><td>5.33</td><td>11.90</td><td>2.20</td></tr><tr><td>Zero-S</td><td>8.41</td><td>28.21</td><td>5.88</td><td>4.08</td><td>12.33</td><td>2.13</td><td>5.97</td><td>4.00</td><td>21.33</td><td>13.95</td><td>10.62</td></tr><tr><td rowspan="7">GPT-3.5</td><td>Zero</td><td>4.67</td><td>20.51</td><td>8.82</td><td>2.04</td><td>10.96</td><td>2.13</td><td>2.94</td><td>6.00</td><td>28.00</td><td>9.30</td><td>9.59</td></tr><tr><td> Zero+CoT</td><td>6.54</td><td>23.08</td><td>2.94</td><td>10.20</td><td>12.33</td><td>2.12</td><td>5.97</td><td>12.00</td><td>33.33</td><td>9.30</td><td>12.17</td></tr><tr><td>Few</td><td>5.61</td><td>15.38</td><td>11.76</td><td>4.08</td><td>8.22</td><td>0.00</td><td>1.49</td><td>10.00</td><td>26.67</td><td>13.95</td><td>9.60</td></tr><tr><td>Few+CoT</td><td>8.41</td><td>20.51</td><td>8.82</td><td>6.12</td><td>10.96</td><td>2.12</td><td>1.49</td><td>10.00</td><td>38.67</td><td>6.98</td><td>11.99</td></tr><tr><td>Few+Py</td><td>13.08</td><td>33.33</td><td>8.82</td><td>16.33</td><td>26.01</td><td>4.26</td><td>7.46</td><td>16.00</td><td>44.00</td><td>26.19</td><td>19.91</td></tr><tr><td>Few+Wol</td><td>3.74</td><td>7.69</td><td>2.94</td><td>18.37</td><td>17.81</td><td>6.38</td><td>2.99</td><td>12.00</td><td>5.33</td><td>2.38</td><td>7.87</td></tr><tr><td>Zero-S</td><td>14.95</td><td>25.64</td><td>8.82</td><td>18.37</td><td>21.92</td><td>12.77</td><td>7.46</td><td>8.00</td><td>28.00</td><td>19.05</td><td>16.81</td></tr><tr><td rowspan="7">GPT-4</td><td>Zero</td><td>27.10</td><td>23.08</td><td>14.71</td><td>22.45</td><td>15.07</td><td>8.51</td><td>11.94</td><td>18.00</td><td>56.00</td><td>42.86</td><td>25.09</td></tr><tr><td>Zero+CoT</td><td>28.04</td><td>43.59</td><td>14.71</td><td>20.41</td><td>21.92</td><td>19.15</td><td>17.91</td><td>22.00</td><td>50.67</td><td>42.86</td><td>28.52</td></tr><tr><td>Few Few+CoT</td><td>15.87</td><td>30.77</td><td>17.65</td><td>12.24</td></table>
|
| 76 |
+
|
| 77 |
+
Language $( F e w + W o l )$ as external tools. Regarding the exam dataset, to replicate a real-world exam environment, we only consider two specific settings: zero-shot learning (Zero) and zero-shot learning supplemented with CoT prompting $( Z e r o { + } C o T )$ .
|
| 78 |
+
|
| 79 |
+
Implementation details. We set temperature to zero for all models to reduce the randomness of the predictions. Few-shot examples, including solutions, are randomly selected from problems within each textbook. When external tools are used, we add a code snippet that translates the solution into specific programming languages in all few-shot examples. The code snippets are verified by human annotators that will produce the correct output. In terms of evaluation metrics, we compare the model outputs with the correct answers, allowing a relative tolerance of 0.05. In particular to the exam dataset, the model solutions are graded using the rubrics provided by the instructors. Readers may refer to Appendix C for all prompts and the implementation details for utilizing external tools.
|
| 80 |
+
|
| 81 |
+
# 4.2 RESULTS AND ANALYSIS
|
| 82 |
+
|
| 83 |
+
We report the model performance in terms of accuracy score for each textbook and an average score over all problems. The results of all LLMs in various settings on the textbook and the exam dataset are summarized in Tables 4 and 5 respectively. We have the following observations.
|
| 84 |
+
|
| 85 |
+
• Observation 1. SCIBENCH is complex enough to differentiate among LLMs. Our findings show that open-source models LLaMA-2-7B and LLaMA-2-70B do not yet rival closed-source counterparts on both textbook and exam datasets, where the best performance is obtained with GPT-4 with Python as the external tool in the few-shot learning setting. Within both the LLaMA and GPT series, we also observe a clear correlation between increased model capacity (i.e., larger
|
| 86 |
+
|
| 87 |
+
Table 5: Experimental results in terms of total scores under zero-shot learning on the exam dataset. The best performing score is highlighted in bold.
|
| 88 |
+
|
| 89 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2"> Setting</td><td colspan="2">MiDaraMininal</td><td colspan="2">Machine Learmiag</td><td colspan="3">Ditrenial iainsal</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="2">LLaMA-2-7B</td><td>Zero</td><td>24/90</td><td>14/75</td><td>6/56</td><td>6/75</td><td>5/100</td><td>0/100</td><td>0/95</td></tr><tr><td>Zero+CoT</td><td>18/90</td><td>14/75</td><td>2/56</td><td>10 /75</td><td>10/100</td><td>0/100</td><td>10/95</td></tr><tr><td rowspan="2">LLaMA-2-70B</td><td>Zero</td><td>23 /90</td><td>18 /75</td><td>18 /56</td><td>12/75</td><td>20/100</td><td>5/100</td><td>0/95</td></tr><tr><td>Zero+CoT</td><td>31/90</td><td>18 /75</td><td>10 /56</td><td>11/ 75</td><td>35 /100</td><td>10 /100</td><td>0/95</td></tr><tr><td rowspan="2">Claude2</td><td>Zero</td><td>37/90</td><td>26/75</td><td>28/56</td><td>35/75</td><td>35/100</td><td>30/100</td><td>20/95</td></tr><tr><td>Zero+CoT</td><td>33/90</td><td>38/75</td><td>22/56</td><td>41/75</td><td>25 /100</td><td>15 /100</td><td>20/95</td></tr><tr><td rowspan="2">GPT-3.5</td><td>Zero</td><td>44 /90</td><td>39/75</td><td>16 /56</td><td>32/75</td><td>0/100</td><td>45/100</td><td>15 /95</td></tr><tr><td>Zero+CoT</td><td>38 /90</td><td>33 /75</td><td>32 / 56</td><td>37 /75</td><td>28 /100</td><td>30 /100</td><td>10 /95</td></tr><tr><td rowspan="2">GPT-4</td><td>Zero</td><td>56/90</td><td>44/75</td><td>30/56</td><td>37/75</td><td>25/100</td><td>80/100</td><td>25/95</td></tr><tr><td>Zero+CoT</td><td>58/90</td><td>32/75</td><td>40/56</td><td>35/75</td><td>50 /100</td><td>70/100</td><td>15/95</td></tr></table>
|
| 90 |
+
|
| 91 |
+
parameter sizes) and improved performance. This observation demonstrates that the complexity of SCIBENCH is able to differentiate the capacities of different LLMs.
|
| 92 |
+
• Observation 2. The zero-shot learning setting exhibits comparable performance to the fewshot learning setting. For example, with CoT prompting, Claude2 achieves average scores of $8 . 1 0 \%$ and $8 . 9 0 \%$ , and GPT-4 achieves $2 8 . 5 2 \%$ and $2 8 . 3 5 \%$ in zero- and few-shot settings respectively. Moreover, in many textbooks such as Quantum Chemistry (quan and chemmc), which focus on a specialized subdomain within each field, few-shot learning outperforms zero-shot learning, with improvements of $2 . 9 4 \%$ and $2 . 5 6 \%$ in GPT-4 and $1 4 . 7 \%$ and $1 0 . 2 0 \%$ in LLaMA-2-70B under the CoT setting, for instance. This could be attributed to the selected prompt examples being representative and informative to the domain.
|
| 93 |
+
• Observation 3. Utilizing advanced prompting strategies like CoT brings advantages over vanilla LLMs. For the textbook dataset, the CoT prompting yields average improvements of $2 . 5 8 \%$ and $2 . 3 9 \%$ under zero-shot and few-shot learning for GPT-3.5, and $3 . 4 3 \%$ and $6 . 8 9 \%$ for GPT-4, respectively. This improvement suggests that encouraging LLMs to generate detailed solution steps helps obtain correct final answers, though its effectiveness varies across different models and settings. However, this trend is less obvious in LLaMA models with $6 . 0 9 \%$ and $4 . 9 0 \%$ i n LLaMA-2-70B under the few-shot setting, possibly due to their inherent inadequacy.
|
| 94 |
+
Observation 4. Prompts that utilize Python yield improvements in certain models while those using Wolfram diminish performance. Under few-shot learning scenarios, utilizing Python as an external tool results in an improvement of $7 . 9 2 \%$ compared to the CoT prompting for GPT-3.5, and an improvement of $7 . 4 5 \%$ for GPT-4. However, in Claude2, this trend is less evident with average scores of $8 . 9 0 \%$ and $8 . 7 0 \%$ with and without utilizing Python. Similarly, LLaMA models exhibit a decrease in performance from $4 . 9 0 \%$ to $2 . 9 9 \%$ in LLaMA-2-70B. Utilizing Wolfram Language does not help few-shot learning and even results in a deteriorated performance, with a decrease of $6 . 7 0 \%$ compared to the CoT prompting for Claude2, and a decrease of $1 2 . 7 9 \%$ for GPT-4. We note that converting the solution steps to Wolfram Language often introduces syntax issues and thus fails to produce satisfactory results, particularly in textbooks like Quantum Chemistry (chemmc), which involve numerous variables.
|
| 95 |
+
|
| 96 |
+
# 5 ERROR ANALYSIS OF VARIOUS PROMPTING STRATEGIES
|
| 97 |
+
|
| 98 |
+
Considering the substantial advancements of current LLMs, an in-depth analysis of the particular skills that are either enhanced or limited under certain settings becomes imperative. Previous works have relied on human labor to annotate error reasons into different categories, which is both expensive and time-consuming [18]. In this section, we present an evaluation protocol that automates the classification of error reasons into deficient skills. This time-efficient approach enables large-scale analyses in future research.
|
| 99 |
+
|
| 100 |
+
In order to quantify the impact of each setting on scientific problem-solving, we first define an essential skill set that is required by solving scientific problems. Then, an LLM verifier is employed to automatically classify each incorrectly solved problem based on the absence of a specific skill from the essential skill set. This approach generates error profiles, showcasing a direct comparison of different strategies. This evaluation protocol is summarized in Figure 2.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 2: Pipeline of the evaluation protocol. The evaluation protocol involves analyzing both LLMs and reference (correct) solutions with the assistance of human annotators to identify error reasons. These reasons are then summarized into ten essential scientific problem-solving skills in which LLM may face challenges. Subsequently, a LLM verifier is employed to automatically attribute each incorrectly answered problem to a lack of a specific skill. The resulting error profiles enable the interpretation of the improved skills by certain prompting strategies and the direct comparison of various strategies.
|
| 104 |
+
|
| 105 |
+
Firstly, we analyze the incorrect solutions made by GPT-3.5 for problems that provide detailed solutions. We hire two college students, who are highly familiar with the problems in our datasets, to annotate the source of the error for each problem, indicating the specific line where the model makes a mistake and why. From 112 such error annotations and with the assistance of GPT-4, we distill these errors into ten essential skills that GPT-3.5 might lack:
|
| 106 |
+
|
| 107 |
+
• Logical decomposition and analysis skills. This ability involves decomposing the problem into smaller, manageable parts, and understanding the relationships between these parts.
|
| 108 |
+
• Identification of assumptions. This skill involves the ability to recognize relevant and necessary assumptions in the problem.
|
| 109 |
+
• Spatial perception. This is important for understanding problems in areas such as Physics and Chemistry, where models need to visualize molecules, forces, fields, etc.
|
| 110 |
+
• Causal reasoning. This is the ability to understand cause and effect relationships.
|
| 111 |
+
• Problem deduction skills. This pertains to the ability to infer and deduce potential solutions or underlying principles from the given information in a problem.
|
| 112 |
+
• Abstract reasoning. This skill involves the ability to understand complex concepts that cannot be perceived physically, and to recognize patterns or relationships beyond concrete examples.
|
| 113 |
+
• Scientific literacy. This skill involves a comprehensive understanding of key scientific principles, terminology, and methodologies across a range of disciplines.
|
| 114 |
+
• Code conversion skills. This involves the ability to accurately translate solution steps into different programming languages, like Python or Wolfram Language.
|
| 115 |
+
• Logical reasoning. This is the ability to make a reasoned argument and to identify fallacies or inconsistencies in an argument or set of data.
|
| 116 |
+
• Calculation skills. This involves the ability to accurately carry out mathematical operations and computations.
|
| 117 |
+
|
| 118 |
+
After identifying this essential skill set, we assess the performance of the LLMs under different settings to discern the specific problem-solving skills they lack. Given the high cost of human annotations required to attribute the cause of incorrect solutions to specific skill deficiencies, we propose a novel self-critique protocol: we design a specific prompt that outlines these abilities, and employ another LLM to serve as a classifier and determine whether a specific error results from the lack of a particular problem-solving skill. Finally, we ask human annotators to scrutinize the classification results, which results in approximately $20 \%$ of incorrectly classified skills being discarded. To be specific, we utilize a GPT-3.5 model as the verifier to determine the reason behind each error and pinpoint the missing skill. The details regarding the specific prompts used are provided in Appendix C.1. This verification process is conducted for six settings, with results represented in bar charts (Figure 3). Additional examples of the evaluation protocol are elaborated in Appendix D.
|
| 119 |
+
|
| 120 |
+
Overall, our findings suggest that there is a lack of a universally effective setting: each configuration only enhances some specific abilities and occasionally even hurts other skills that the original GPT models possess. First, CoT prompting significantly improves calculation skills in both zero- and few-shot scenarios, with $7 . 1 \%$ and $8 . 0 \%$ error rates caused by calculation ability respectively, considerably lower than the $2 4 . 1 \%$ error rate of the vanilla zero-shot baseline. However, CoT shows limitations in improving other skills, with $\cdot$ error rates in both casual ability and logical decomposition ability in the zero-shot CoT setting, respectively, compared to $1 7 . 0 \%$ and $1 3 . 4 \%$ in the zero-shot setting. This contradicts previous claims about universal skill enhancement through zero-shot CoT and carefully-designed few-shot CoT prompts [9]. In Appendix, we show an example in Figure S3, where the zero-shot learning setting without CoT has generated the correct formula but fails in the calculation steps. In this case, CoT prompting is even unable to use the correct formula as it misinterprets the specific conditions (non-necessity) in the problem. Second, while the use of external tools significantly reduces calculation errors, they can weaken other skills, particularly the code conversion skills, i.e., generating the correct programs for the solution. This issue becomes particularly prominent when using the Wolfram Language, with $4 1 . 1 \%$ error rate in code conversion skill comparing $0 . 9 \%$ in the few-shot CoT setting. Despite providing grammar specifications in system prompts and a few examples as demonstrations, most attempts of code conversion result in syntax errors. In Wolfram Language, the error mainly comes from the violation of variable rules (for instance, Wolfram Language reserves certain letters such as $E$ as protected symbols and disallows underscores in variable names) or incorrect usage of certain functions.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 3: Error profiles of GPT-3.5 on the text dataset under six settings, which reveal the distribution of their deficiencies in ten essential problem-solving abilities.
|
| 124 |
+
|
| 125 |
+
Additionally, few-shot learning does not universally improve scientific problem-solving skills, as indicated in the comparison between zero-shot and few-shot CoT settings. The improvement in one skill is offset by the shortcomings in others: although the few-shot CoT setting results in a reduction of $6 . 3 \%$ in errors related to causal reasoning, it also leads to an increase in errors associated with other skills, such as logical decomposition and calculation.
|
| 126 |
+
|
| 127 |
+
Moreover, the skill of identifying assumptions appears to be most lacking in the zero-shot setting without a system prompt. In this scenario, the LLM does not have any predefined direction to follow. However, when a system prompt with instructions about which scientific domain the model is tackling, this issue can be significantly mitigated, decreasing this error from $1 1 . 6 \%$ to $5 . 4 \%$ .
|
| 128 |
+
|
| 129 |
+
# 6 CONCLUSION
|
| 130 |
+
|
| 131 |
+
In conclusion, this paper presents SCIBENCH, a college-level dataset that includes scientific problems from Mathematics, Physics, and Chemistry, as well as exam questions in Computer Science and Mathematics. We also conduct extensive experiments on five representative models, LLaMA-2- 7B, LLaMA-2-70B, Claude2, GPT-3.5, and GPT4. The evaluation protocol we employ serves as a framework for evaluating advanced problem-solving skills of LLMs in scientific domains. The findings of this study highlight that while large language models (LLMs) exhibit impressive performance on introductory mathematical benchmarks, their mastery of problem solving ability remains weak. These findings underscore the limitations of current LLMs in achieving satisfactory performance, even with the assistance of various tools. We envision that the SCIBENCH benchmark dataset and evaluation protocol presented in this paper could lay a foundation for future research and enable advancements in understanding and enhancing problem-solving capabilities of LLMs.
|
| 132 |
+
|
| 133 |
+
# REPRODUCIBILITY STATEMENT
|
| 134 |
+
|
| 135 |
+
To foster reproducible research, we include all dataset processing and experiment details of SCIBENCH. We detail data processing in Section 3 and provide the UI design of data collection in Appendix B. We include all experiment details with LLM prompts in Appendix C. Finally, we make our dataset and code publicly available at this anonymous repository.
|
| 136 |
+
|
| 137 |
+
# ETHICAL STATEMENT
|
| 138 |
+
|
| 139 |
+
The questions of SCIBENCH are sourced from science textbooks and exams. We conduct a manual examination of our dataset to ensure the absence of potential sensitive background or ethical concerns. The inclusion of exam questions has been authorized by the instructors of the respective courses. To the best of our knowledge, there are no ethical concerns or sensitive information present in the dataset.
|
| 140 |
+
|
| 141 |
+
# REFERENCES
|
| 142 |
+
|
| 143 |
+
[1] 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, 33:1877–1901, 2020. 1
|
| 144 |
+
[2] OpenAI. Chatgpt: Optimizing language models for dialogue. https://openai.com/blog/chatgpt/., 2022. 1, 5
|
| 145 |
+
[3] OpenAI. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023. 1, 5
|
| 146 |
+
[4] Zhuosheng Zhang, Aston Zhang, Mu Li, Hai Zhao, George Karypis, and Alex Smola. Multimodal chain-of-thought reasoning in language models. arXiv preprint arXiv:2302.00923, 2023. 1
|
| 147 |
+
[5] 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. 1
|
| 148 |
+
[6] Renrui Zhang, Jiaming Han, Aojun Zhou, Xiangfei Hu, Shilin Yan, Pan Lu, Hongsheng Li, Peng Gao, and Yu Qiao. Llama-adapter: Efficient fine-tuning of language models with zero-init attention. arXiv preprint arXiv:2303.16199, 2023. 1
|
| 149 |
+
[7] 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. arXiv preprint arXiv:2304.15010, 2023. 1
|
| 150 |
+
[8] Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. arXiv preprint arXiv:2304.08485, 2023. 1
|
| 151 |
+
[9] 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. 1, 2, 9
|
| 152 |
+
[10] Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. arXiv preprint arXiv:2205.11916, 2022. 1
|
| 153 |
+
[11] Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021. 1
|
| 154 |
+
[12] Wenhu Chen, Xueguang Ma, Xinyi Wang, and William W Cohen. Program of thoughts prompting: Disentangling computation from reasoning for numerical reasoning tasks. arXiv preprint arXiv:2211.12588, 2022. 1
|
| 155 |
+
[13] Luyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon, Pengfei Liu, Yiming Yang, Jamie Callan, and Graham Neubig. PAL: Program-aided language models. arXiv preprint arXiv:2211.10435, 2022. 1
|
| 156 |
+
[14] Pan Lu, Swaroop Mishra, Tanglin Xia, Liang Qiu, Kai-Wei Chang, Song-Chun Zhu, Oyvind Tafjord, Peter Clark, and Ashwin Kalyan. Learn to explain: Multimodal reasoning via thought chains for science question answering. Advances in Neural Information Processing Systems, 35:2507–2521, 2022. 1, 3, 4
|
| 157 |
+
[15] Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021. 1, 3
|
| 158 |
+
[16] 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. arXiv preprint arXiv:2103.03874, 2021. 1, 3
|
| 159 |
+
[17] Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300, 2020. 1, 3
|
| 160 |
+
[18] Wanjun Zhong, Ruixiang Cui, Yiduo Guo, Yaobo Liang, Shuai Lu, Yanlin Wang, Amin Saied, Weizhu Chen, and Nan Duan. Agieval: A human-centric benchmark for evaluating foundation models. arXiv preprint arXiv:2304.06364, 2023. 1, 3, 7, 25
|
| 161 |
+
[19] Yuzhen Huang, Yuzhuo Bai, Zhihao Zhu, Junlei Zhang, Jinghan Zhang, Tangjun Su, Junteng Liu, Chuancheng Lv, Yikai Zhang, Jiayi Lei, et al. C-eval: A multi-level multi-discipline chinese evaluation suite for foundation models. arXiv preprint arXiv:2305.08322, 2023. 1, 3
|
| 162 |
+
[20] Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171, 2022. 2
|
| 163 |
+
[21] Denny Zhou, Nathanael Schärli, Le Hou, Jason Wei, Nathan Scales, Xuezhi Wang, Dale Schuurmans, Olivier Bousquet, Quoc Le, and Ed Chi. Least-to-most prompting enables complex reasoning in large language models. arXiv preprint arXiv:2205.10625, 2022. 2
|
| 164 |
+
[22] Jiaxin Huang, Shixiang Shane Gu, Le Hou, Yuexin Wu, Xuezhi Wang, Hongkun Yu, and Jiawei Han. Large language models can self-improve. arXiv preprint arXiv:2210.11610, 2022. 2
|
| 165 |
+
[23] Timo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu, Maria Lomeli, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. Toolformer: Language models can teach themselves to use tools. arXiv preprint arXiv:2302.04761, 2023. 2, 5
|
| 166 |
+
[24] Pan Lu, Baolin Peng, Hao Cheng, Michel Galley, Kai-Wei Chang, Ying Nian Wu, Song-Chun Zhu, and Jianfeng Gao. Chameleon: Plug-and-play compositional reasoning with large language models. arXiv preprint arXiv:2304.09842, 2023. 2, 5
|
| 167 |
+
[25] Peter Atkins, Julio De Paula, and Ronald Friedman. Physical chemistry: quanta, matter, and change. Oxford University Press, USA, 2014. 2, 4, 13
|
| 168 |
+
[26] Pan Lu, Liang Qiu, Jiaqi Chen, Tony Xia, Yizhou Zhao, Wei Zhang, Zhou Yu, Xiaodan Liang, and Song-Chun Zhu. Iconqa: A new benchmark for abstract diagram understanding and visual language reasoning. arXiv preprint arXiv:2110.13214, 2021. 3
|
| 169 |
+
[27] Pan Lu, Liang Qiu, Kai-Wei Chang, Ying Nian Wu, Song-Chun Zhu, Tanmay Rajpurohit, Peter Clark, and Ashwin Kalyan. Dynamic prompt learning via policy gradient for semi-structured mathematical reasoning. In International Conference on Learning Representations (ICLR), 2023. 3
|
| 170 |
+
[28] Swaroop Mishra, Matthew Finlayson, Pan Lu, Leonard Tang, Sean Welleck, Chitta Baral, Tanmay Rajpurohit, Oyvind Tafjord, Ashish Sabharwal, Peter Clark, et al. Lila: A unified benchmark for mathematical reasoning. In The 2022 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2022. 3
|
| 171 |
+
[29] Liangtai Sun, Yang Han, Zihan Zhao, Da Ma, Zhennan Shen, Baocai Chen, Lu Chen, and Kai Yu. Scieval: A multi-level large language model evaluation benchmark for scientific research. arXiv preprint arXiv:2308.13149, 2023. 3
|
| 172 |
+
[30] Wenhu Chen, Ming Yin, Max Ku, Pan Lu, Elaine Wan, Xueguang Ma, Jianyu Xu, Tony Xia, and Xinyi Wang. Theoremqa: A theorem-driven question answering dataset. arXiv preprint arXiv:2305.12524, 2023. 3, 4
|
| 173 |
+
[31] Pan Lu, Liang Qiu, Wenhao Yu, Sean Welleck, and Kai-Wei Chang. A survey of deep learning for mathematical reasoning. In The 61st Annual Meeting of the Association for Computational Linguistics (ACL), 2023. 3
|
| 174 |
+
[32] Yao Fu, Litu Ou, Mingyu Chen, Yuhao Wan, Hao Peng, and Tushar Khot. Chain-of-thought hub: A continuous effort to measure large language models’ reasoning performance. arXiv preprint arXiv:2305.17306, 2023. 3
|
| 175 |
+
[33] Taicheng Guo, Kehan Guo, Zhengwen Liang, Zhichun Guo, Nitesh V Chawla, Olaf Wiest, Xiangliang Zhang, et al. What indeed can gpt models do in chemistry? a comprehensive benchmark on eight tasks. arXiv preprint arXiv:2305.18365, 2023. 3
|
| 176 |
+
[34] Ross Taylor, Marcin Kardas, Guillem Cucurull, Thomas Scialom, Anthony Hartshorn, Elvis Saravia, Andrew Poulton, Viktor Kerkez, and Robert Stojnic. Galactica: A large language model for science. arXiv preprint arXiv:2211.09085, 2022. 3
|
| 177 |
+
[35] Ahmad Ghazal, Tilmann Rabl, Minqing Hu, Francois Raab, Meikel Poess, Alain Crolotte, and Hans-Arno Jacobsen. Bigbench: Towards an industry standard benchmark for big data analytics. In Proceedings of the 2013 ACM SIGMOD international conference on Management of data, pages 1197–1208, 2013. 3
|
| 178 |
+
[36] Mirac Suzgun, Nathan Scales, Nathanael Schärli, Sebastian Gehrmann, Yi Tay, Hyung Won Chung, Aakanksha Chowdhery, Quoc V Le, Ed H Chi, Denny Zhou, et al. Challenging big-bench tasks and whether chain-of-thought can solve them. arXiv preprint arXiv:2210.09261, 2022. 3
|
| 179 |
+
[37] David Halliday, Robert Resnick, and Jearl Walker. Fundamentals of physics. John Wiley & Sons, 2013. 4, 14
|
| 180 |
+
[38] Thomas Engel and Philip J Reid. Thermodynamics, statistical thermodynamics, and kinetics. Prentice Hall Upper saddle River, 2010. 4, 13
|
| 181 |
+
[39] Stephen T Thornton and Jerry B Marion. Classical dynamics of particles and systems. Cengage Learning, 2021. 4, 13
|
| 182 |
+
[40] Ira N Levine, Daryle H Busch, and Harrison Shull. Quantum chemistry, volume 6. Pearson Prentice Hall Upper Saddle River, NJ, 2009. 4, 13
|
| 183 |
+
[41] Donald A McQuarrie. Quantum chemistry. University Science Books, 2008. 4, 13
|
| 184 |
+
[42] Peter Atkins, Peter William Atkins, and Julio de Paula. Atkins’ physical chemistry. Oxford university press, 2014. 4, 13
|
| 185 |
+
[43] James Stewart, Saleem Watson, and Daniel Clegg. Calculus: Early transcendentals, 8th. Edition, Brooks/- Cole, Cengae learning, 2012. 4, 14
|
| 186 |
+
[44] Robert V Hogg, Elliot A Tanis, and Dale L Zimmerman. Probability and statistical inference, volume 993. Macmillan New York, 1977. 4, 14
|
| 187 |
+
[45] William E Boyce, Richard C DiPrima, and Douglas B Meade. Elementary differential equations and boundary value problems. John Wiley & Sons, 2021. 4, 14
|
| 188 |
+
[46] Pan Lu, Ran Gong, Shibiao Jiang, Liang Qiu, Siyuan Huang, Xiaodan Liang, and Song-Chun Zhu. Intergps: Interpretable geometry problem solving with formal language and symbolic reasoning. In The Joint Conference of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (ACL-IJCNLP 2021), 2021. 4, 5
|
| 189 |
+
[47] Anthropic. Claude2. https://www.anthropic.com/index/claude-2, 2023. 5
|
| 190 |
+
[48] Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023. 5
|
| 191 |
+
|
| 192 |
+
# Supplementary Material for SCIBENCH
|
| 193 |
+
|
| 194 |
+
A SciBench: Textbook Sources 13
|
| 195 |
+
A.1 Textbook 13
|
| 196 |
+
A.2 Examination . 14
|
| 197 |
+
A.3 Textbook Examples 14
|
| 198 |
+
B SciBench: More Statistics 14
|
| 199 |
+
B.1 UI Design 14
|
| 200 |
+
C Experimental Details 14
|
| 201 |
+
C.1 Prompting . 14
|
| 202 |
+
C.2 Experiment Process 17
|
| 203 |
+
D Problem Solving Abilities of Current LLMs 18
|
| 204 |
+
D.1 Example . 18
|
| 205 |
+
D.2 Assessment of evaluation protocol 19
|
| 206 |
+
D.3 Comparison 21
|
| 207 |
+
|
| 208 |
+
A SCIBENCH: TEXTBOOK SOURCES
|
| 209 |
+
|
| 210 |
+
# A.1 TEXTBOOK
|
| 211 |
+
|
| 212 |
+
• PHYSICAL CHEMISTRY, ATKINS ET AL. [42] (atkins) provides an exploration of equilibrium, structure, and reactions, integrating contemporary techniques like nanoscience, spectroscopy, and computational chemistry.
|
| 213 |
+
QUANTUM CHEMISTRY, MCQUARRIE [41] (chemmc) meticulously covers Quantum Mechanics, from foundational principles like blackbody radiation and Heisenberg’s Uncertainty Principle to complex topics such as Schrödinger’s equation, quantum mechanical operators, and the application of quantum mechanics in chemical bonding.
|
| 214 |
+
QUANTUM CHEMISTRY, LEVINE ET AL. [40] (quan) explores quantum chemistry, providing a detailed understanding of the Schrödinger equation, particle behavior in various scenarios, quantum mechanics operators, and other foundational quantum principles. It delves into specific applications like the electronic structure of diatomic and polyatomic molecules, variation methods, perturbation theory, electron spin and its implications in quantum mechanics, as well as various computational methods for molecular quantum mechanics.
|
| 215 |
+
PHYSICAL CHEMISTRY, QUANTA, MATTER, AND CHANGE, ATKINS ET AL. [25] (matter) combines physics and mathematics, beginning with basics like differentiation and integration, advancing through quantum mechanics and atomic structure, then exploring thermodynamics, molecular motion, and chemical kinetics. Each section is supplemented with mathematical concepts such as differential equations, vectors, and probability theory.
|
| 216 |
+
CLASSICAL DYNAMICS OF PARTICAL AND SYSTEMS, THORNTON AND MARION [39] (class) initiates with an exploration of fundamental mathematical concepts, discussing scalars, vectors, matrix operations, coordinate transformations, differentiation, and integration of vectors, using these constructs to illustrate concepts like velocity, acceleration, and angular velocity. It then transitions into the realm of Newtonian mechanics, detailing Newton’s laws, frames of reference, and the equation of motion for a single particle.
|
| 217 |
+
• THERMODYNAMICS, STATISTICAL THERMODYNAMICS, AND KINETICS, [38] (thermo) navigates through thermodynamics’ principles, from fundamental concepts to complex laws, further discussing real and ideal gases, solutions, electrochemical cells, and statistical thermodynamics. It
|
| 218 |
+
|
| 219 |
+
concludes with an examination of the kinetic theory of gases, transport phenomena, and chemical kinetics.
|
| 220 |
+
|
| 221 |
+
• FUNDAMENTALS OF PHYSICS, HALLIDAY ET AL. [37] (fund) covers undergraduate physics topics, ranging from fundamental concepts like motion and energy to more advanced areas such as quantum physics and nuclear physics.
|
| 222 |
+
• ELEMENTARY DIFFERENTIAL EQUATIONS AND BOUNDARY VALUE PROBLEMS, [45] (diff) provides a detailed exploration of differential equations, progressing from basic mathematical models to advanced topics like the Laplace Transform, linear systems, numerical methods, and Fourier series. It culminates with a deep dive into nonlinear equations, partial differential equations, and boundary value problems.
|
| 223 |
+
• PROBABILITY AND STATISTICAL INFERENCE, [44] (stat) covers probability and statistics, including fundamental concepts, discrete and continuous distributions, bivariate distributions, functions of random variables, and estimation techniques.
|
| 224 |
+
• CALCULUS: EARLY TRANSCENDENTALS, [43] (calculus) begins with diagnostic tests in foundational topics, and explores functions from multiple perspectives. It comprehensively covers calculus concepts from limits to three-dimensional analytic geometry, incorporating applications in various fields.
|
| 225 |
+
|
| 226 |
+
# A.2 EXAMINATION
|
| 227 |
+
|
| 228 |
+
• INTRODUCTION TO DATA MINING provides an introductory survey of data mining, which involves the automatic discovery of patterns, associations, changes, and anomalies in large databases. It explores various application areas of data mining, including bioinformatics, e-commerce, environmental studies, financial markets, multimedia data processing, network monitoring, and social service analysis.
|
| 229 |
+
|
| 230 |
+
• FUNDAMENTALS ARTIFICIAL INTELLIGENCE provides an introduction to the core problemsolving and knowledge representation paradigms in artificial intelligence. It covers Lisp programming with regular assignments, as well as topics such as search methods, planning techniques, knowledge structures, natural language processing, expert systems, vision, and parallel architectures.
|
| 231 |
+
|
| 232 |
+
• DIFFERENTIAL EQUATIONS covers various topics in differential equations, including first-order and second-order linear equations with constant coefficients, power series solutions, and linear systems. Students will explore the principles and applications of these mathematical concepts.
|
| 233 |
+
|
| 234 |
+
A.3 TEXTBOOK EXAMPLES
|
| 235 |
+
|
| 236 |
+
# B SCIBENCH: MORE STATISTICS
|
| 237 |
+
|
| 238 |
+
# B.1 UI DESIGN
|
| 239 |
+
|
| 240 |
+
We employed a team of seven individuals to gather data from textbooks using an annotation tool. Each individual was responsible for 1-2 books, encompassing approximately 100 examples. The user interface of the annotation tool is depicted in Figure S2. For subsequent verification, we preserved images of problems and their corresponding answers. To ensure clarity in future references, we have maintained the original sequence of problems as they appear in the textbooks.
|
| 241 |
+
|
| 242 |
+
# C EXPERIMENTAL DETAILS
|
| 243 |
+
|
| 244 |
+
# C.1 PROMPTING
|
| 245 |
+
|
| 246 |
+
ChatGPT and GPT-4’s API have three message parameters: SYSTEM, USER, and ASSISTANT. The SYSTEM parameter represents the system prompt, which provides context and instructions to the model. The USER parameter is the training prompt or input provided by the user, and the ASSISTANT parameter contains the model’s output or response. We provide all system prompts and training prompts used in our experiments as below.
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
Figure S1: Textbook examples with acronym highlighted in brown.
|
| 250 |
+
|
| 251 |
+
# System Prompt for Zero-Shot, Few-Shot, and Chain-of-Thought setting:
|
| 252 |
+
|
| 253 |
+
Please provide a clear and step-by-step solution for a scientific problem in the categories of Chemistry, Physics, or Mathematics. The problem will specify the unit of measurement, which should not be included in the answer. Express the final answer as a decimal number with three digits after the decimal point. Conclude the answer by stating "The answer is therefore \boxed[ANSWER]."
|
| 254 |
+
|
| 255 |
+
# System Prompt for Python setting:
|
| 256 |
+
|
| 257 |
+
Please provide a clear and step-by-step solution for a scientific problem in the categories of Chemistry, Physics, or Mathematics. The problem will specify the unit of measurement. Please translate the solution steps into Python code and encase the Python code within triple backticks for clarity.
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure S2: The UI design of data annotation.
|
| 261 |
+
|
| 262 |
+
# System Prompt for Wolfram setting:
|
| 263 |
+
|
| 264 |
+
Please provide a clear and step-by-step solution for a scientific problem in the categories of Chemistry, Physics, or Mathematics. The problem will specify the unit of measurement. Please translate the solution steps into Wolfram code and encase the Wolfram Language code within triple backticks for clarity.
|
| 265 |
+
|
| 266 |
+
# System Prompt for Evaluation Protocol:
|
| 267 |
+
|
| 268 |
+
Examine the given problem, the correct solution, and the model’s solution. Identify the reason for the error in the model’s solution based on the following 10 categories:
|
| 269 |
+
1. Logical Decomposition and Analysis Skills: This ability involves decomposing the problem into smaller, manageable parts, and understanding the relationships between these parts.
|
| 270 |
+
2. Identification of Assumptions: This skill involves the AI’s ability to recognize relevant and necessary assumptions in the problem.
|
| 271 |
+
3. Spatial Perception: This is important for understanding problems in areas such as physics and chemistry, where you need to visualize molecules, forces, fields, etc.
|
| 272 |
+
4. Causal Reasoning: This is the ability to understand cause and effect relationships.
|
| 273 |
+
5. Problem Deduction Skills: This pertains to the ability to infer and deduce potential solutions or underlying principles from the given information in a problem.
|
| 274 |
+
6. Abstract Reasoning: This skill involves the ability to understand complex concepts that can’t be perceived physically, and to recognize patterns or relationships beyond concrete examples. 7. Scientific Literacy: This skill involves a comprehensive understanding of key scientific principles, terminology, and methodologies across a range of disciplines.
|
| 275 |
+
8. Code Conversion Skills: This denotes the ability to accurately translate solution steps into different programming languages, like Python or Wolfram, without syntax errors.
|
| 276 |
+
9. Logical Reasoning: This is the ability to make a reasoned argument and to identify fallacies or inconsistencies in an argument or set of data.
|
| 277 |
+
10. Calculation Skills: This involves the ability to accurately carry out mathematical operations and computations.
|
| 278 |
+
Conclude your final error reason category number within \boxed.
|
| 279 |
+
|
| 280 |
+
# Training Prompt for Zero-Shot Chain-of-Thought:
|
| 281 |
+
|
| 282 |
+
Stage 1:
|
| 283 |
+
|
| 284 |
+
Input: [input-question] Let’s think step by step.
|
| 285 |
+
Output: <explanation>
|
| 286 |
+
Stage 2:
|
| 287 |
+
Input: [input-question] Let’s think step by step. [explanation] $^ +$ Therefore, the answer is:
|
| 288 |
+
|
| 289 |
+
Output: <answer>
|
| 290 |
+
|
| 291 |
+
# Training Prompt for Few-Shot:
|
| 292 |
+
|
| 293 |
+
# Input:
|
| 294 |
+
|
| 295 |
+
Problem 1: [Question 1] The answer is \boxed{[Answer 1]}.
|
| 296 |
+
Problem 2: [Question 2] The answer is \boxed{[Answer 2]}.
|
| 297 |
+
Problem n: [Question n] The answer is \boxed{[Answer n]}.
|
| 298 |
+
Problem $\mathrm { n } { + } 1$ : [Question $\mathrm { n } { + } 1$ ] Output: The answer is \boxed{<answer>}.
|
| 299 |
+
|
| 300 |
+
# Training Prompt for Few-Shot Chain-of-Thought:
|
| 301 |
+
|
| 302 |
+
# Input:
|
| 303 |
+
|
| 304 |
+
Problem 1: [Question 1] Explanation for Problem 1: [Explanation 1]. The answer is \boxed{[Answer 1]}.
|
| 305 |
+
Problem 2: [Question 2] Explanation for Problem 2: [Explanation 2]. The answer is \boxed{[Answer 2]}.
|
| 306 |
+
...
|
| 307 |
+
Problem n: [Question n] Explanation for Problem n: [Explanation n]. The answer is \boxed{[Answer n]}.
|
| 308 |
+
Problem $\mathrm { n } { + } 1$ : [Question $\mathrm { n } { + } 1$ ]
|
| 309 |
+
Output: Explanaiton for Problem $\mathrm { n } { + } 1$ : <explanation>. The answer is \boxed{<answer>}.
|
| 310 |
+
|
| 311 |
+
# Training Prompt for Few-Shot Python/Wolfram:
|
| 312 |
+
|
| 313 |
+
# Input:
|
| 314 |
+
|
| 315 |
+
Problem 1: [Question 1] Explanation for Problem 1: [Explanation 1]. Python/Wolfram language for Problem 1: \`\`\`[Python/Wolfram code 1]\`
|
| 316 |
+
Problem 2: [Question 2] Explanation for Problem 2: [Explanation 2]. Python/Wolfram language for Problem 2: \`\`\`[Python/Wolfram code 2]\`\`
|
| 317 |
+
...
|
| 318 |
+
Problem n: [Question n] Explanation for Problem n: [Explanation n]. Python/Wolfram language for Problem n: \`\`\`[Python/Wolfram code n]\`\`\`
|
| 319 |
+
Problem $\mathrm { n } { + } 1$ : [Question $\mathrm { n } { + } 1$ ]
|
| 320 |
+
Output: Explanaiton for Problem $\mathrm { n } { + } 1$ : <explanation>. Python/Wolfram language for Problem $\mathrm { n } { + } 1$ : \`[Python/Wolfram code $\mathfrak { n } { + } \mathbb { 1 } \mathbf { \setminus } \mathbf { \Omega }$
|
| 321 |
+
|
| 322 |
+
# Training Prompt for Evaluation Protocol:
|
| 323 |
+
|
| 324 |
+
Input: The question is [input-question]. The correct solution is [Correct-Solution]. The model solution is [Model-Solution].
|
| 325 |
+
Output: <Error Type>
|
| 326 |
+
|
| 327 |
+
# Training Prompt for Evaluation Protocol in Python/Wolfram:
|
| 328 |
+
|
| 329 |
+
Input: The question is [input-question]. The correct solution is [Correct-Solution]. The model solution is [Model-Solution]. The translated program generates the answer as [Program Generated Answer], which is treated as model’s output answer.
|
| 330 |
+
|
| 331 |
+
Output: <Error Type>
|
| 332 |
+
|
| 333 |
+
# C.2 EXPERIMENT PROCESS
|
| 334 |
+
|
| 335 |
+
All model output is extracted using \boxed{} notation. To prevent any missed extractions, we supplement this process with a manual check. For both Python and Wolfram settings, we extract the programming language with the triple backtick \`\`\`method, subsequently executing it within the corresponding language. The entirety of our code can be accessed via the following URL: https://anonymous.4open.science/r/anonymous-4FFB.
|
| 336 |
+
|
| 337 |
+
# D PROBLEM SOLVING ABILITIES OF CURRENT LLMS
|
| 338 |
+
|
| 339 |
+
# D.1 EXAMPLE
|
| 340 |
+
|
| 341 |
+
# Correct Solution
|
| 342 |
+
|
| 343 |
+
The mass of an electron is $9 . 1 0 9 \times 1 0 ^ { - 3 1 } \mathrm { k g }$ . One percent of the speed of light is
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
v = ( 0 . 0 1 0 0 ) \left( 2 . 9 9 8 \times { 1 0 } ^ { 8 } { \mathrm { m } } \cdot { \mathrm { s } } ^ { - 1 } \right) = 2 . 9 9 8 \times { 1 0 } ^ { 6 } { \mathrm { m } } \cdot { \mathrm { s } } ^ { - 1 }
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
The momentum of the electron is given by
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
p = m _ { \mathrm { e } } v = { \Big ( } 9 . 1 0 9 \times 1 0 ^ { - 3 1 } { \mathrm { k g } } { \Big ) } \left( 2 . 9 9 8 \times 1 0 ^ { 6 } { \mathrm { m } } \cdot { \mathrm { s } } ^ { - 1 } \right) = 2 . 7 3 \times 1 0 ^ { - 2 4 } { \mathrm { k g } } \cdot { \mathrm { m } } \cdot { \mathrm { s } } ^ { - 1 }
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
The de Broglie wavelength of this electron is
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\lambda = { \frac { h } { p } } = { \frac { 6 . 6 2 6 \times 1 0 ^ { - 3 4 } { \mathrm { ~ J } } \cdot { \mathrm { ~ s } } } { 2 . 7 3 \times 1 0 ^ { - 2 4 } { \mathrm { ~ k g } } \cdot { \mathrm { m } } \cdot { \mathrm { s } } ^ { - 1 } } } = 2 . 4 3 \times 1 0 ^ { - 1 0 } { \mathrm { ~ m } } = 2 4 3 { \mathrm { p m } }
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
This wavelength is of atomic dimensions.
|
| 362 |
+
|
| 363 |
+
Final Answer: 243
|
| 364 |
+
|
| 365 |
+
# Chatgpt Solution with Chain-of-Thought Method
|
| 366 |
+
|
| 367 |
+
Let’s start by recalling the de Broglie wavelength formula: $\begin{array} { r } { \lambda = \frac { h } { p } } \end{array}$ where $\lambda$ is the de Broglie wavelength, $h$ is Planck’s constant, and $p$ is the momentum of the particle. To calculate the momentum of the electron, we can use the relativistic momentum formula:
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
p = { \frac { m _ { e } v } { \sqrt { 1 - { \frac { v ^ { 2 } } { c ^ { 2 } } } } } }
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
where $m _ { e }$ is the mass of the electron, $_ v$ is its velocity, and $^ c$ is the speed of light. Plugging in the given values, we get:
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
p = { \frac { ( 9 . 1 1 \times 1 0 ^ { - 3 1 } { \mathrm { k g } } ) ( 0 . 0 1 c ) } { { \sqrt { 1 - ( 0 . 0 1 c ) ^ { 2 } / c ^ { 2 } } } } } = 8 . 1 9 \times 1 0 ^ { - 2 3 } { \mathrm { k g } } \cdot { \mathrm { m / s } }
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
Now we can plug this momentum into the de Broglie wavelength formula:
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\lambda = { \frac { h } { p } } = { \frac { 6 . 6 2 6 \times 1 0 ^ { - 3 4 } { \mathrm { J } } \cdot { \mathrm { s } } } { 8 . 1 9 \times 1 0 ^ { - 2 3 } { \mathrm { k g } } \cdot { \mathrm { m } } / { \mathrm { s } } } } = 8 . 0 9 { \mathrm { p m } }
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
# ChatGPT Solution without Chain-of-Thought Method
|
| 386 |
+
|
| 387 |
+
The de Broglie wavelength of a particle is given by the equation: $\begin{array} { r } { \lambda = { \frac { h } { p } } } \end{array}$ where $^ h$ is the Planck constant and $p$ is the momentum of the particle. The momentum of an electron is given by:
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
p = m v
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
where $_ m$ is the mass of the electron and $_ v$ is its velocity. We are given that the electron is traveling at $1 . 0 0 \%$ of the speed of light, which is: $v = 0 . 0 1$ cwhere $^ c$ is the speed of light. The mass of an electron is: $m = 9 . 1 1 \times 1 0 ^ { - 3 1 }$ , kgPutting it all together, we have:
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\lambda = { \frac { h } { m v } } = { \frac { h } { m ( 0 . 0 1 c ) } }
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
Substituting the values of $h , m ,$ , and $^ c$ , we get:
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\lambda = { \frac { 6 . 6 2 6 \times 1 0 ^ { - 3 4 } , \mathbf { J } \cdot \mathbf { s } } { 9 . 1 1 \times 1 0 ^ { - 3 1 } , \mathbf { k g } \cdot 0 . 0 1 \cdot 2 . 9 9 8 \times 1 0 ^ { 8 } , \mathbf { m } / \mathbf { s } } } = 3 . 3 1 \times 1 0 ^ { - 1 2 } \mathbf { m } = 3 . 3 1 \mathbf { p m }
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
In the context of each specific capability, we present several exemplary errors accompanied by their corresponding classifications and explanations derived from the GPT model. Referencing Figure S3, the ChatGPT solution employing the Chain-of-Thought method corresponds to error category 4, "Causal Reasoning". The model explanation posits that "The error reason category is 4. Causal Reasoning. The model solution uses the relativistic momentum formula to calculate the momentum of the electron, which is not necessary for this problem since the electron is traveling at only $1 . 0 0 \%$ of the speed of light. The relativistic momentum formula is only needed when the velocity of the particle is a significant fraction of the speed of light. Therefore, using this formula in this problem leads to an incorrect value for the momentum and consequently an incorrect value for the de Broglie wavelength." Meanwhile, the ChatGPT solution that doesn’t utilize the Chain-of-Thought method is categorized under error case 10, "Calculation Skills". This example is further highlighted as an illustrative showcase for explanations of the Chain-of-Thought method in Section 5. More examples resulting in different error types are shown in Figure S4, S5, S6, S7, S8, S9, S10, S11, S12,S13.
|
| 406 |
+
|
| 407 |
+
<table><tr><td>Problem Find the length of the cardioid r =1+ sinθ.</td></tr><tr><td>Correct Solution The cardioid's fullength is given by the parameter interval O ≤θ≤ 2π,so Formula 5 gives 2π</td></tr><tr><td>L = +()0= 2π √(1+sin0)² +cos2 0d0= √2+2sin0de Jo 0 0 Wecouldevaluate tis itegralbymultiplyinganddividingthentegrandby2-2sin,orwecoulduseacomputeralgebrasystem.In</td></tr><tr><td>any event, we find that the length of the cardioid is L = 8. Final Answer: 8 Model Solution</td></tr><tr><td>To find the length of the cardioid, we use the formula for arc length in polar coordinates:</td></tr><tr><td>L=J ²+()2,d,</td></tr><tr><td>he andβare he agleshat orsrod toinflp f he carid i.e ad = r).First sefin dr d</td></tr><tr><td>d d(1+ sinθ) = cos0. Then,we plug in r =1 + sin θ and = cos θ into he formula for ac length:</td></tr><tr><td>2π L = √(1+ sin 0)²+cos²0</td></tr><tr><td>0</td></tr><tr><td>d0= ² √1+2sin0 +sin20+cos²θ J0</td></tr><tr><td>d0= ²√2+2sin0</td></tr><tr><td>J0</td></tr><tr><td>d0=4 √2+2sin0 0</td></tr><tr><td>d (due to symmetry) = 8 |"/²√2 + 2sinθ J0 π/2</td></tr><tr><td>0-2 d0=8 4cos2 J0 π/2 0</td></tr><tr><td>d0(using thehaf-ageformula)=16 cos2 π/2</td></tr><tr><td>d0= 32 sin 2 = 32.</td></tr><tr><td>Therefore,thelengthofthecardioidis32,andtheunitoftheansweriswhateverunit wasusedforr(e.gmeters,centimeters,etc.).</td></tr><tr><td>Final Answer: 32</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>ThemodelsouioaerieiofttalS2ind.corretsoutiotylifedhs</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>Error Reason</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>integralto4+2sinduetothesymmetryofthtegandandthenusedasubstutiontoevaluatetheintegraleodel</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr></table>
|
| 408 |
+
|
| 409 |
+
# D.2 ASSESSMENT OF EVALUATION PROTOCOL
|
| 410 |
+
|
| 411 |
+
In order to assess the effectiveness of our evaluation protocol’s classification, we enlisted the assistance of two annotators to determine whether the errors identified by the model verifier were accurate or
|
| 412 |
+
|
| 413 |
+
<table><tr><td>Problem Use Simpson's Rule with n = 10 to approximate S²2(1/𝑥)dx. Correct Solution Putting f(x)=1/𝑥,n =10,and△x = 0.1 in Simpson's Rule, we obtain</td></tr><tr><td>3 ( 4 2 4 2 4 2 4 二 3 +11+1.2+1.3+1.4+1.5 1.6 1.7+1.8+1.9+ ~0.693150 Final Answer: 0.693150</td></tr><tr><td>ExplanationforProblem6: Withn =10we haveh=21=andxi =1+fri =0,1,2.,10.ThenSimpson'sule gives ↑²dx~[f(x)+4f(x1)+2f(x2)+4f(x3)+.+2f(xs)+4f(x)+f(x1)] J1 x wheref(x)=1. wolfram language for Problem 6: (*Constants *) n = 10; a=1; b=2;</td></tr></table>
|
| 414 |
+
|
| 415 |
+
Figure S5: An example problem is inaccurately solved by error reason 8. Code Conversion Skills.
|
| 416 |
+
"Error Reason" denotes the output from the LLM Verifier utilized in the classification of error causes.
|
| 417 |
+
In the example, the mistaken step is highlighted in red.
|
| 418 |
+
|
| 419 |
+
<table><tr><td colspan="2">Problem Use Simpson's Rule with n = 10 to approximate S²2(1/𝑥)dx.</td></tr><tr><td colspan="2">Correct Solution</td></tr><tr><td colspan="2">The equations for c1 and c2 are C1(α-E)+c2β=0 and c1β+c2(α-E)=0</td></tr><tr><td colspan="2">ForE=α+β,eitherequationyieldsC1=C2.Thus,b=C1(2pz1+2pz2).ThevalueofC1canbefoundbyrequiringthatthe wavefunctionbenormalized.Thenormalizationconditionongivesc²(1+2S+1)=1.UsingtheHuckelssumptionthatS=0,</td></tr><tr><td colspan="2">we find that c1 =1/√2.Substituting E=α-βinto eitherof the equations for c1 and c2 yields c1 =-C2,or a=c1(2pz1-2pz2)</td></tr><tr><td colspan="2">The normalization condition gives c²(1- 2S +1) = 1,or c1 = 1/√2. Final Answer: 0.7071067</td></tr><tr><td colspan="2">Model Solution therefore not provided as this problem requires visual representations and cannot be solved through text alone.</td></tr><tr><td colspan="2">Error Reason</td></tr><tr><td colspan="2">The error reason category is|3. Spatial Perception molecularorialsfeeneeodel'ssolutioisicompleteasitonlyproidesuatiosanddoesoprovidayvisualeprtatio</td></tr><tr><td></td><td>This problem requires visual representations to find the bonding and antibonding Huickel</td></tr></table>
|
| 420 |
+
|
| 421 |
+
not. Through the annotation of 151 samples across different settings, we observed that 123 of them were correctly classified, resulting in an accuracy rate of $8 1 . 4 5 \%$ .
|
| 422 |
+
|
| 423 |
+
Figure S7: An example problem is inaccurately solved by error reason 7. Scientific Literacy. "Error Reason" denotes the output from the LLM Verifier utilized in the classification of error causes. In the example, the mistaken step is highlighted in red, while the correct step is highlighted in blue.
|
| 424 |
+
|
| 425 |
+
<table><tr><td colspan="2">Problem What is the mean speed,c,of N2 molecules in air at 25C Correct Solution</td></tr><tr><td colspan="2">The integral required is =4π 2MT )3/2 ʃ8-Mv2/2Rr du =4π )²×(2)²= (8RT)1/2</td></tr><tr><td colspan="2">πM where we have used the standard result from tables of integrals (or software) that xe 1 dx= -ax2</td></tr><tr><td colspan="2">J0 2a² Substitution of the data then gives (8× (8.3141JK-1 mol-1) × (298K) 1/2 C= = 475ms-1</td></tr><tr><td colspan="2">π × (28.02 × 10-3 kg mol-1) where we have used 1J=1kg m² s-2. Final Answer: 475</td></tr></table>
|
| 426 |
+
|
| 427 |
+
<table><tr><td colspan="2">Problem What is the number of possible four-letter code words,selecting from the 26 letters in the alphabet?</td></tr><tr><td colspan="2">CorrectSolution The numberofpossblefour-ettercodewords,selectingfromthe26lettersinthealphabet,inhchallfourletersarediferentis</td></tr><tr><td colspan="2">26P4 = (26)(25)(24)(23) = 26 =358,800. 22!</td></tr><tr><td colspan="2">Final Answer: 358800</td></tr><tr><td colspan="2">Model Solution Explanation forProblem6:The numberof possible four-lettr code words,selecting fromthe26 leters in thealphabetis</td></tr><tr><td colspan="2">264=456,976.</td></tr><tr><td colspan="2">Final Answer: 456976</td></tr><tr><td>ErrorReason The model's error reason category is|9. Logical Reasoning</td><td></td></tr><tr><td></td><td>.The model did not consider the condition that all four lettrs should be different. Thecorectsolutionconsiders thisonditionanduses thepermutationformula tocalculateteumberofposiblefour-letercode ords.</td></tr></table>
|
| 428 |
+
|
| 429 |
+
Figure S8: An example problem is inaccurately solved by error reason 9. Logical reasoning. “Error Reason” denotes the output from the LLM Verifier utilized in the classification of error causes. In the example, the mistaken step is highlighted in red.
|
| 430 |
+
|
| 431 |
+
# D.3 COMPARISON
|
| 432 |
+
|
| 433 |
+
<table><tr><td colspan="2">Problem Find the bonding and antibonding Huckel molecular orbitals for ethene.</td></tr><tr><td colspan="2">Correct Solution</td></tr><tr><td colspan="2">The equations for C1 and C2 associated with Equation 11.7 are</td></tr><tr><td colspan="2">C1(α-E)+c2β=O and ciβ+c2(α-E)=0</td></tr><tr><td colspan="2">For E=α+ β,either equation yields c1 =C2. Thus,</td></tr><tr><td colspan="2">b=c1(2pz1+2pz2) Thevalueofc1canbefoundbyrequiring hathe wavefunctionbenomalized.Thenormalizationconditionongivesc²(1+2S+1)=</td></tr><tr><td colspan="2">1.UsingtheHuckelassumptionthatS=O,wefindthatc1=1/2.SubstitutingE=α-βintoeitheroftheequationsforandC2 yieldsc1 =-c2,or a=c1(2pz1-2pz2)</td></tr><tr><td colspan="2">The normalization condition gives c²(1- 2S +1)= 1,or c1 = 1/√2. Final Answer: 0.70710678</td></tr><tr><td colspan="2">Model Solution twobondingdtoibongckelolelaobalsf.Thitftsrisotaplblesisualitietion of the molecular orbitals.</td></tr><tr><td colspan="2">Final Answer: None Error Reason</td></tr><tr><td colspan="2">The error reason category for the model's solution is|6.Abstract Reasoning .The model's solution is incorrect because it did not consider theHuckelmoleculaobalhoryichpredicts attereareolytomolecularobialsforeteoeodingadetibodng</td></tr></table>
|
| 434 |
+
|
| 435 |
+
Figure S9: An example problem is inaccurately solved by error reason 6. Abstract Reasoning. “Error Reason” denotes the output from the LLM Verifier utilized in the classification of error causes.
|
| 436 |
+
|
| 437 |
+
<table><tr><td colspan="2">Problem Alivingromhasfoordimensionsof3.5mand4.2mandaheightof2.4m.Whatdoestheairintheroom weighwhentheairpresure is 1.0atm? CorrectSolution</td></tr><tr><td>The air's weightisequaltomg,wheremisitsmassMasmisrelatedtotheairdensityandtheairvolumeV(=m/V).Calculation: Putting the two ideas together and taking the density of air at 1.O atm, we find mg = (pV)g = (1.21 kg/m³) (3.5 m × 4.2 m × 2.4 m) (9.8 m/s2)= 418 N Final Answer: 418</td></tr><tr><td>ModelSolution 101,640N.Tofindtheweghtoftheairineroom,wedtofstcalculatethevolumef heoo:V=lh=3.54.2m 2.4m=35.28mNextwecanusetheidealgaslwtofindthe massoftheairintheroom:PV=nRTwherePisthepressure,Vis thevolume,nisteumberofolesofas,Risthesostant,ndTis tetempeature.Aumigootmperatureof(93K), wecansolve forn: PV (1.0atm)(35.28m3) m=RT = (0.0821 L atm/mol K)(293 K) = 1,610 mol Finally,we can find the weight of the air using the molar mass of air(approximately 28.97 g/mol):</td></tr></table>
|
| 438 |
+
|
| 439 |
+
Figure S10: An example problem is inaccurately solved by error reason 2. Identification of Assumptions. "Error Reason" denotes the output from the LLM Verifier utilized in the classification of error causes. In the example, the mistaken step is highlighted in red.
|
| 440 |
+
|
| 441 |
+
<table><tr><td>Problem Fromardiarydeckofplaingcads,cardsaretoedrasucesivelyatandomaditouteplacement.Whatistheprobbilitytat the third spade appears on the sixth draw?</td></tr><tr><td>Correct Solution LetAbetheevetoftwospadesitefrstfvecardsdra,ndtBbeteeventofspadeotesithdr.us,theprobabilittat we wish to compute is P(A B). It is reasonable to take</td></tr><tr><td>P()=(132)((3 = 0.274 and P(B|A)= 17 =0.234</td></tr><tr><td>The desired probability,P(A B),is the productof those numbers:P(An B)= (0.274)(0.234) = 0.064 Final Answer: 0.064</td></tr><tr><td>Model Solution The probability that the third spade appears on the sixth draw is</td></tr><tr><td>13C2·39C4 78·741,948 1,441</td></tr><tr><td>52C6 20,358,520 5,577</td></tr><tr><td></td></tr><tr><td>Final Answer: 0.258</td></tr><tr><td>Error Reason</td></tr><tr><td>Themodel'ssolutionisicorctbecauseitcalculatesthprobabilityofgetigtwospadesinthefrstfivecadsandayspadeonthesixth</td></tr><tr><td>draw,insteadofspeciicallycalculatingtheprobabilityoftetirdspadeappearingontesixthdragiventhattwspadeshavealeady</td></tr><tr><td>appeared in the first five draws.Therefore,the error reason category is|4. Causal Reasoning</td></tr></table>
|
| 442 |
+
|
| 443 |
+
Figure S11: An example problem is inaccurately solved by error reason 4. Causal Reasoning. The mistaken step is highlighted in red.
|
| 444 |
+
|
| 445 |
+
<table><tr><td>Problem Gas cylinders of COare sold in terms of weightofCO2.Acylindercontains5Olb(22.7kg)ofCO2.Howlong can this cylinderbe usedinanexperiment hatrequiresfowingCO2at293K(n=146μP)througha1.-m-long ube(diameter=0.75mm)withan input pressure of 1.O5 atm and output pressure of 1.OO atm ?The flow is measured at the tube output</td></tr><tr><td>CorrectSolution The gas flowrate△V/△t is</td></tr><tr><td>△V (P²-P²) 2.76 × 10-6 3 -1 △t 16nLP 二 ms Tr4</td></tr><tr><td>Converting the CO2 contained in the cylinder to the volume occupied at 298 K and 1 atm pressure,we get (10</td></tr><tr><td>ncoz = 22.7 kg (0.044kgmol-1 = 516 mol, V=𝑛RT = 1.24× 104 L</td></tr><tr><td></td></tr><tr><td>GiventheeffectivevolumeofCO2contaiedinthecylinder,the durationoverwhichthecylindercabeusedis2.76×1-4 4.49 × 10 s. This time corresponds to roughly 52 days. Final Answer: 52 days</td></tr><tr><td>Model Solution The volume of CO2 in the cylinder is given by</td></tr><tr><td>m 22.7 kg = 11.5m³</td></tr><tr><td>p 1.98 kg m-3</td></tr><tr><td>The volume of CO2 that flows through the tube is given by</td></tr><tr><td>Πd²L (0.75 × 10-3m)²(1.00m) = 1.77 × 10-7m² 4 V</td></tr><tr><td>1.710-7(104gmD) = 2.08 x 10s.The</td></tr><tr><td>The time required to flow V volume of CO2 isgiven byt = = P1</td></tr><tr><td>2.08x106</td></tr><tr><td>numberof seconds inayearis3.15×107s.Therefore,thecylindercanbeusedfor.110r-1=0.066yr =24.1days</td></tr><tr><td></td></tr><tr><td>Final Answer: 24.1 days</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>Error Reason</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>Themodel’ssolutionisicorectbcasetcalulatesthetierequedtofowvolumeofCOtroughtetubeutitdoesottakeit</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>accountthetotal volumefCOinthecyliderThecorrctslutioncalulates thetotalvolumeofCOintecylinderanddividestbythe</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>flowratetodeterinetheurationoerichtecyldercanbeuedTerefore,theeroreasoncategoryis」.ProblemDeductioSkills</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr></table>
|
| 446 |
+
|
| 447 |
+
Figure S12: An example problem is inaccurately solved by error reason 5. Problem Deduction Skills.
|
| 448 |
+
The mistaken step is highlighted in red.
|
| 449 |
+
|
| 450 |
+
# Problem
|
| 451 |
+
|
| 452 |
+
# Correct Solution
|
| 453 |
+
|
| 454 |
+
We can approximate Earth as a uniform sphere of mass $M _ { E }$ . Then, from Eq. 13-11, the gravitational acceleration at any distance $r$ from the center of Earth is
|
| 455 |
+
|
| 456 |
+
$$
|
| 457 |
+
a _ { g } = { \frac { G M _ { E } } { r ^ { 2 } } }
|
| 458 |
+
$$
|
| 459 |
+
|
| 460 |
+
We might simply apply this equation twice, first with $r = 6 . 7 7 \times 1 0 ^ { 6 }$ m for the location of the feet and then with $r = 6 . 7 7 \times 1 0 ^ { 6 } \mathrm { m } +$ $1 . 7 0 \mathrm { m }$ for the location of the head. However, a calculator may give us the same value for $a _ { g }$ twice, and thus a difference of zero, because $^ h$ is so much smaller than $r$ . Here’s a more promising approach: Because we have a differential change $d r$ in $_ r$ between the astronaut’s feet and head, we should differentiate Eq. 13-15 with respect to $_ r$ .Calculations: The differentiation gives us
|
| 461 |
+
|
| 462 |
+
$$
|
| 463 |
+
d a _ { g } = - 2 { \frac { G M _ { E } } { r ^ { 3 } } } d r
|
| 464 |
+
$$
|
| 465 |
+
|
| 466 |
+
where $d \boldsymbol { a } _ { g }$ is the differential change in the gravitational acceleration due to the differential change $d r$ in $_ r$ . For the astronaut, $d r = h$ and $r = 6 . 7 \bar { 7 } \times 1 0 ^ { 6 } \mathrm { ~ m ~ }$ . Substituting data into Eq.13-16, we find
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
d a _ { g } = - 2 { \frac { \left( 6 . 6 7 \times 1 0 ^ { - 1 1 } { \bf m } ^ { 3 } / \mathrm { k g } \cdot \mathrm { s } ^ { 2 } \right) \left( 5 . 9 8 \times 1 0 ^ { 2 4 } \mathrm { k g } \right) } { ( 6 . 7 7 \times 1 0 ^ { 6 } \mathrm { m } ) ^ { 3 } } } \left( 1 . 7 0 \mathrm { m } \right) \quad = - 4 . 3 7 \times 1 0 ^ { - 6 } \mathrm { m / s } ^ { 2 }
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
Final Answer: $- 4 . 3 7 \times 1 0 ^ { - 6 } \mathrm { m / s } ^ { 2 }$
|
| 473 |
+
|
| 474 |
+
# Model Solution
|
| 475 |
+
|
| 476 |
+
We can use the equation for the gravitational acceleration due to a point mass, given by Eq. 13-2 $( g = G M / r ^ { 2 } )$ , to find the gravitational acceleration at the astronaut’s feet and head. Because the astronaut is in free fall, the difference between these two accelerations is the tidal acceleration, given by Eq. 13-22 $\Delta g = 2 G M h / r ^ { 3 } )$ .Calculations: The gravitational acceleration at the astronaut’s feet is
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
g _ { \mathrm { f e e t } } = { \frac { G M } { r ^ { 2 } } } = { \frac { \left( 6 . 6 7 \times 1 0 ^ { - 1 1 } { \mathrm { N } } \cdot { \mathrm { m } } ^ { 2 } / { \mathrm { k g } } ^ { 2 } \right) \left( 5 . 9 8 \times 1 0 ^ { 2 4 } { \mathrm { k g } } \right) } { \left( 6 . 7 7 \times 1 0 ^ { 6 } { \mathrm { m } } \right) ^ { 2 } } } = 9 . 7 8 { \mathrm { m } } / { \mathrm { s } } ^ { 2 } .
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
The gravitational acceleration at the astronaut’s head is
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
g _ { \mathrm { h e a d } } = { \frac { G M } { ( r + h ) ^ { 2 } } } = { \frac { \left( 6 . 6 7 \times 1 0 ^ { - 1 1 } { \mathrm { ~ N } } \cdot { \mathrm { m } } ^ { 2 } / { \mathrm { k g } } ^ { 2 } \right) \left( 5 . 9 8 \times 1 0 ^ { 2 4 } { \mathrm { ~ k g } } \right) } { \left( 6 . 7 7 \times 1 0 ^ { 6 } { \mathrm { ~ m } } + 1 . 7 0 { \mathrm { ~ m } } \right) ^ { 2 } } } = 9 . 7 7 { \mathrm { m / s } } ^ { 2 } .
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
The difference between these two accelerations is
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\Delta g = g _ { \mathrm { f e e t } } - g _ { \mathrm { h e a d } } \mathrm { ~ \rho ~ = 9 . 7 8 ~ m / s ^ { 2 } - 9 . 7 7 ~ m / s ^ { 2 } = 0 . 0 1 ~ m / s ^ { 2 } ~ } = 1 . 0 \times 1 0 ^ { - 5 } ~ \mathrm { m / s ^ { 2 } } .
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
Final Answer: $1 . 0 \times 1 0 ^ { - 5 } \mathrm { m / s ^ { 2 } }$
|
| 495 |
+
|
| 496 |
+
# Error Reason
|
| 497 |
+
|
| 498 |
+
The model’s solution is incorrect because it uses the equation for the gravitational acceleration due to a point mass, which is not applicable in this case since the Earth is not a point mass. The correct equation to use is the one given in the correct solution, which takes into account the fact that the Earth is a uniform sphere of mass. Therefore, the error reason category is 1. Logical Decomposition and Analysis Skills
|
| 499 |
+
|
| 500 |
+
Figure S13: An example problem is inaccurately solved by error reason 1. Logical Decomposition and Analysis Skills. “Error Reason” denotes the output from the LLM Verifier utilized in the classification of error causes. In the example, the mistaken step is highlighted in red.
|
| 501 |
+
|
| 502 |
+

|
| 503 |
+
Figure S14: Comparison of error reasons between different subjects. The qualitative analysis of incorrect answers provided by the model revealed ten dimensions of problem-solving abilities. The "Correct" category, representing the proportion of accurately answered questions by the model, is included for comparison. A smaller chart representation indicates a lower number of erroneously answered questions.
|
| 504 |
+
|
| 505 |
+
<table><tr><td>Problem 3x +4y =-23,2y-x =-19.What is the solution(x,y) to the system of equations above? Options: (A).(-5,2) (B). (3,-8) (C).(4,-6) (D). (9,-6) Final Answer: B</td></tr><tr><td>Problem What is the mean speed, c,of N2 molecules in air at 25C Correct Solution The integral required is</td></tr><tr><td>c=4π (M)3/2√08-M2/2RT d =4π )³²×(2)²= ()/2 where we have used the standard result from tables of integrals (or software) that</td></tr><tr><td>xe dx =22 1ax2</td></tr><tr><td>Substitution of the data then gives Jo</td></tr><tr><td>(8× (8.3141JK-1 mol-1) × (298K) 1/2 c= = 475ms-1</td></tr><tr><td>π× (28.02×10-3kg mol-1)</td></tr><tr><td>Final Answer: 475 where we have used 1 J = 1 kg m2 s-2.</td></tr></table>
|
| 506 |
+
|
| 507 |
+
Figure S15: Example from AGIEval [18] (top) and SCIBENCH (bottom). The problem from AGIEval is of high school difficulty with basic algebraic computations involved. In contrast, the problem from our dataset is of a college-level complexity, requiring not only an understanding of background equations but also proficiency in differentiation calculations.
|
md/test/vqIH0ObdqL/vqIH0ObdqL.md
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAN LARGE LANGUAGE MODELS INFER CAUSATION FROM CORRELATION?
|
| 2 |
+
|
| 3 |
+
Zhijing $\mathbf { J i n } ^ { 1 , 2 , \ast , \ddagger }$ Jiarui $\mathbf { L i u } ^ { 3 , * }$ Zhiheng Lyu4 Spencer Poff5 Mrinmaya Sachan2 Rada Mihalcea6 Mona Diab3,‡,† Bernhard Schölkopf1,† 1Max Planck Institute for Intelligent Systems, Tübingen, Germany 2ETH Zürich 3LTI, CMU 4University of Hong Kong 5Meta AI 6University of Michigan jinzhi@ethz.ch jiarui@cmu.edu zhihenglyu.cs@gmail.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Causal inference is one of the hallmarks of human intelligence. While the field of Causal NLP has attracted much interest in the recent years, existing causal inference datasets in NLP primarily rely on discovering causality from empirical knowledge (e.g., commonsense knowledge). In this work, we propose the first benchmark dataset to test the pure causal inference skills of large language models (LLMs). Specifically, we formulate a novel task CORR2CAUSE, which takes a set of correlational statements and determines the causal relationship between the variables. We curate a large-scale dataset of more than 200K samples, on which we evaluate seventeen existing LLMs. Through our experiments, we identify a key shortcoming of LLMs in terms of their causal inference skills, and show that these models achieve almost close to random performance on the task. This shortcoming is somewhat mitigated when we try to re-purpose LLMs for this skill via finetuning, but we find that these models still fail to generalize – they can only perform causal inference in in-distribution settings when variable names and textual expressions used in the queries are similar to those in the training set, but fail in out-of-distribution settings generated by perturbing these queries. CORR2CAUSE is a challenging task for LLMs, and can be helpful in guiding future research on improving LLMs’ pure reasoning skills and generalizability.1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Causal inference, i.e., the ability to establish the correct causal relationships between variables or events, is fundamental to human intelligence. There are two distinct ways this causal inference capability can be acquired: one through empirical knowledge, e.g., we know from common sense that touching a hot stove will get us burned; the other through pure causal reasoning, as causality can be formally argued and reasoned about using known procedures and rules from causal inference (Spirtes et al., 2000; Pearl, 2009; Peters et al., 2017). One example is that we have the a priori knowledge that the correlation between A and B does not necessarily imply causality. This is a formal rule that holds true regardless of the realizations of the variables A and B.
|
| 12 |
+
|
| 13 |
+
With the rise of large language models (LLMs) (Radford et al., 2019; Devlin et al., 2019; Ouyang et al., 2022; Zhang et al., 2022; OpenAI, 2023, inter alia), a crucial research question is whether they can do causal reasoning well. Recent studies have pointed out that LLMs are “causal parrots,” which recite the causal knowledge in the training data (Zecevi ˇ c et al., 2023). Moreover, the vast ´ majority of studies frame causal reasoning as a skill to navigate around empirical knowledge (Gordon et al., 2012; Sap et al., 2019a;b; Qin et al., 2019; Bhagavatula et al., 2020), and also treat LLMs as a knowledge base when evaluating its causal skills (Kıcıman et al., 2023; Tu et al., 2023; Xie et al., 2023). However, all the above lines of research frame causality as empirical knowledge, thus relying heavily on the quality and the coverage of the training data, overlooking the great potential of the formal causal reasoning skills to process correlational information to causal conclusions.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Illustration of the motivation behind our task and dataset.
|
| 17 |
+
|
| 18 |
+
Drawing inspirations from technical studies on causal discovery (Spirtes et al., 2000; Spirtes & Zhang, 2016; Glymour et al., 2019), we formulate a novel task for NLP, correlation-to-causation inference (CORR2CAUSE), which is an important skill for LLMs. Imagine the scenario in Figure 1, where the training corpus does not tediously cover every causal relation, but more pervasively talk about correlations, such as which events tend to co-occur. Learning a good CORR2CAUSE skill can enable LLMs to draw causal relations behind the mere correlational information on the surface. For example, several decades ago, there might be an observation that female university students tend to perform better, but behind the correlational statistics is the causal graph that female students have to achieve extra good performance to get into universities as the first place.
|
| 19 |
+
|
| 20 |
+
To this end, we collect the CORR2CAUSE dataset, the first dataset to test the pure causal reasoning abilities of LLMs. All the questions in this dataset are centered around testing when it is valid or invalid to infer causation from correlation. To systematically compose this dataset, we ground our generalization process in the formal framework of causal discovery (Spirtes et al., 1993; 2000; Glymour et al., 2016; Spirtes & Zhang, 2016), which provides rules about how to deduce causal relations among variables given their statistical correlation in the observational data. We generate more than 200K data points, and label a correlation-causation statement pair as valid if and only if there is a bijective mapping between the statistical correlation and the underlying causality.
|
| 21 |
+
|
| 22 |
+
Based on our CORR2CAUSE dataset with 200K samples, we investigate two main research questions: (1) How well do existing LLMs perform on this task? (2) Can existing LLMs be re-trained or re-purposed on this task and obtain robust causal inference skills? Through extensive experiments, we show empirically that none of the 17 existing LLMs we investigate perform well on this pure causal inference task. We also show that although LLMs can demonstrate better performance after being finetuned on the data, the causal inference skills attained by them are not robust. In summary, our contributions are as follows:
|
| 23 |
+
|
| 24 |
+
1. We propose the novel task of CORR2CAUSE, to probe an aspect of LLM’s reasoning ability, pure causal inference;
|
| 25 |
+
2. We compose a dataset of over 200K samples, using insights from causal discovery;
|
| 26 |
+
3. We evaluate the performance of 17 LLMs on our dataset, finding that all of them perform poorly, close to the random baseline;
|
| 27 |
+
4. We further explored whether LLMs can learn the skill through finetuning, and find that LLMs fail to robustly acquire this skill in out-of-distribution settings. Finally, we suggest future work to explore more ways to enhance the pure causal inference skill in LLMs.
|
| 28 |
+
|
| 29 |
+
# 2 PRELIMINARIES: CAUSAL INFERENCE
|
| 30 |
+
|
| 31 |
+
# 2.1 DIRECTED GRAPHICAL CAUSAL MODELS (DGCMS)
|
| 32 |
+
|
| 33 |
+
A directed graphical causal model (DGCM) is a commonly used representation to express the causal relations among a set of variables. Given a set of $N$ variables $\pmb { X } \doteq \{ X _ { 1 } , \ldots , X _ { N } \}$ , we can encode the causal relations among them using a directed graph $\mathcal { G } : = ( \boldsymbol { X } , \boldsymbol { E } )$ , where $\pmb { { \cal E } }$ is the set of directed edges. Each edge $e _ { i , j } \in E$ represents a causal link $X _ { i } \to X _ { j }$ , meaning that $X _ { i }$ is a direct cause of $X _ { j }$ . In the context of this work, we take the common assumption of directed acyclic graphs (DAGs), which most causal discovery methods use (Glymour et al., 2019), as graphs with cycles can make the causal discovery process arbitrarily hard.
|
| 34 |
+
|
| 35 |
+
Following the graph-theoretic terminology, we use an analogy of the ancestry tree to denote the relations between two variables. For example, we call $X _ { i }$ as a parent of $X _ { j }$ if there is a directed edge $X _ { i } \to X _ { j }$ in the graph, and, thus, $X _ { j }$ is a child of $X _ { i }$ . Similarly, we denote $X _ { i }$ as an ancestor of $X _ { j }$ if there exists a directed path from $X _ { i }$ to $X _ { j }$ , and, thus, $X _ { j }$ is a descendent of $X _ { i }$ . Note that a parent is a special case of an ancestor where the directed path has a length of 1.
|
| 36 |
+
|
| 37 |
+
For convenience, we also introduce the notions for some special three-variable relations. Given two variables $X _ { i }$ and $X _ { j }$ , we call a third variable $X _ { k }$ a confounder (i.e., common cause) if $X _ { k }$ is a parent of both $X _ { i }$ and $X _ { j }$ ; a collider (i.e., common effect) if $X _ { k }$ is a child of both $X _ { i }$ and $X _ { j }$ ; and a mediator if $X _ { k }$ is both a child of $X _ { i }$ , and a parent of $X _ { j }$ .
|
| 38 |
+
|
| 39 |
+
# 2.2 D-SEPARATION AND MARKOV PROPERTY
|
| 40 |
+
|
| 41 |
+
D-Separation D-separation (Pearl, 1988) is a fundamental concept in graphical models used to determine whether two sets of nodes $\boldsymbol { X }$ and $\mathbf { Y }$ in a DAG $\mathcal { G }$ are conditionally independent given a third set of nodes $z$ , where the three sets are disjoint. We say that $\boldsymbol { X }$ and $\mathbf { Y }$ are d-separated by $z$ if all paths between any node in $\boldsymbol { X }$ and any node in $\mathbf { Y }$ are blocked by the conditioning set $z$ . A path between $\boldsymbol { X }$ and $\mathbf { Y }$ is blocked by $z$ if there exists a node $A \in { \mathbf { Z } }$ which satisfies one of the following conditions: $A$ is the parent node in a fork structure on the path (i.e., $\cdot \left. A \right. \cdot )$ ; $A$ is the mediator node in a chain structure on the path (i.e., $\cdot A \cdot )$ ; or in any collider structure on the path (i.e., $\cdot \right. A \left. \cdot$ ), $z$ does not contain $A$ or its descendants.
|
| 42 |
+
|
| 43 |
+
Markov Property The Markov property in a DAG $\mathcal { G }$ states that each node $X _ { i }$ is conditionally independent of its non-descendants given its parents, namely $X _ { i }$ ⊥⊥ $\mathbf { N o n D e } ( X _ { i } ) | \mathbf { P a } ( X _ { i } )$ , where $\mathbf { N o } \bar { \mathbf { n } } \mathbf { D } \mathbf { e } ( X _ { i } )$ denotes the non-descendants of $X _ { i }$ excluding itself, and $\mathbf { P a } ( X _ { i } )$ denotes the parents of $X _ { i }$ . Using the Markov property, we can factorize the joint distribution of all the nodes in the graph into $\begin{array} { r } { P ( X _ { 1 } , \ldots , X _ { N } ) = \prod _ { i = 1 } ^ { N } P ( X _ { i } | \mathbf { P A } ( X _ { i } ) ) } \end{array}$ . To infer the causal graph from probability distributions, a common assumption is faithfulness, namely the validity to infer all the d-separation sets in the graph from the independence relations in the probability distribution. In our work, we also take this broadly taken assumption which holds for most real-world scenarios.
|
| 44 |
+
|
| 45 |
+
Markov Equivalence of Graphs We denote two DAGs as Markov equivalent if they induce the same joint distribution $P ( X )$ . The set of DAGs that are Markov equivalent to each other is called a Markov equivalence class (MEC). Causal graphs in the same MEC can be easily identified since they have the same skeleton (i.e., undirected edges) and V-structures (i.e., structures in the form of $A \right. B \left. C$ where $A$ and $C$ are not connected).
|
| 46 |
+
|
| 47 |
+
Obviously, there is a one-to-many mapping (i.e., surjection) between the causal graph and statistical distribution. Namely, each causal graph sufficiently determines a statistical distribution, but from a statistical distribution, we cannot necessarily induce a unique causal graph. This is why we say “correlation does not necessarily mean causation”.
|
| 48 |
+
|
| 49 |
+
# 2.3 CAUSAL DISCOVERY
|
| 50 |
+
|
| 51 |
+
Causal discovery aims to learn the causal relations by analyzing statistical properties in the observational data (Spirtes et al., 1993; 2000; Glymour et al., 2016; Spirtes & Zhang, 2016; Glymour et al., 2019). It can be achieved through constraint-based methods (Spirtes et al., 2000), score-based methods (Chickering, 2002), or other methods taking advantage of the functional causal models (Shimizu et al., 2006; Hoyer et al., 2008; Zhang & Hyvärinen, 2009).
|
| 52 |
+
|
| 53 |
+
To fit for the spirit of this paper to infer from correlation (expressed in natural language) to causation, we base our dataset design on the widely-used Peter-Clark (PC) algorithm (Spirtes et al., 2000). The PC algorithm is based on the principles of conditional independence and the causal Markov assumption, which allows it to efficiently identify causal relationships among variables in a given dataset. The algorithm first starts with a fully connected undirected graph among all the variables. Then it removes the edge between two variables if there is an unconditional or conditional independence relationship between them. Afterwards, it orients the directed edges whenever there is a V-structure. And finally, it iteratively checks the direction of the other edges until the entire causal graph is consistent with all the statistical correlations.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 2: Pipeline of the data construction process.
|
| 57 |
+
|
| 58 |
+
# 3 DATASET CONSTRUCTION
|
| 59 |
+
|
| 60 |
+
We introduce the construction of our dataset in this section. We start with our task formulation for CORR2CAUSE, and then briefly give an overview of the data generation process, followed by detailed descriptions of each step. We conclude the section with the overall statistics of the dataset.
|
| 61 |
+
|
| 62 |
+
# 3.1 TASK FORMULATION
|
| 63 |
+
|
| 64 |
+
Given a set of $N$ variables $\pmb { X } = \{ X _ { 1 } , \ldots , X _ { N } \}$ , we have a statement $\pmb { s }$ about all the correlations among the variables, and a hypothesis $^ { h }$ describing the causal relation $r$ between the pair of variables $X _ { i }$ and $X _ { j }$ . The task is to learn a function $f : ( s , h ) \mapsto v$ which maps the correlation statement $\pmb { s }$ and the causal relation hypothesis $^ { h }$ to their validity $v \in \{ 0 , 1 \}$ , which takes the value 0 if this inference is invalid, and the value 1 if this inference is valid.
|
| 65 |
+
|
| 66 |
+
# 3.2 OVERVIEW OF THE DATA GENERATION PROCESS
|
| 67 |
+
|
| 68 |
+
We base the construction our dataset on several concepts of causal inference, including the DGCM, d-separation, and MECs, as introduced in Section 2.
|
| 69 |
+
|
| 70 |
+
As in the overview of our data generation process in Figure 2, we first choose the number $N$ of variables (Step 1) and generate all the unique DGCMs with $N$ nodes (Step 2), which we will introduce in the Section 3.3. Then we collect all the d-separation sets from these graphs to identify MECs (Step 3) in Section 3.4. Then, in Step 4, we create the formal form of data in Section 3.5. For each correspondence of the MEC to causal graphs, we compose the correlation statement based on the statistical relations in the MEC, and hypothesize a causal relation between two variables, and produce the validity $v = 1$ if the hypothesis is a shared property of all causal graphs in the MEC, and $v = 0$ if the hypothesis is not necessarily true for all the MEC graphs. Finally, we introduce the verbalization process in Section 3.6.
|
| 71 |
+
|
| 72 |
+
# 3.3 CONSTRUCTING THE GRAPHS WITH ISOMORPHISM CHECKS
|
| 73 |
+
|
| 74 |
+
The first step of the data generation is to compose the causal graphs, as in Step 1 and 2 of Figure 2. For a set of $N$ variables $\mathbf { \bar { X } } = \{ X _ { 1 } , \ldots , X _ { N } \}$ , there are $N ( N - 1 )$ possible directed edges, since each node can link to any node other than itself. To remove cycles in the graph, we make the nodes in topological order, which only allows edges $X _ { i } \to X _ { j }$ , where $i < j$ . We achieve this by limiting the adjacency matrix of the graph to only having non-zero values above the diagonal, resulting in $N ( N - 1 ) / 2$ possible directed edges for the DAGs.
|
| 75 |
+
|
| 76 |
+
At the first glance, for $N$ nodes, there should be $2 ^ { N ( N - 1 ) / 2 }$ possible DAGs (i.e., the power set of all edges). However, there could be isomorphic graphs in this set. To avoid this, we perform a graph
|
| 77 |
+
|
| 78 |
+
<table><tr><td># Nodes</td><td># Unique DAGs</td><td>#Edges/DAG</td><td>#MECs</td><td>#DAGs/MEC</td></tr><tr><td>2</td><td>2 out of 2</td><td>0.50</td><td>2</td><td>1.0</td></tr><tr><td>3</td><td>6 out of 23</td><td>1.67</td><td>5</td><td>1.2</td></tr><tr><td>4</td><td>31 out of 26</td><td>3.48</td><td>20</td><td>1.55</td></tr><tr><td>5</td><td>302 out of 210</td><td>5.89</td><td>142</td><td>2.13</td></tr><tr><td>6</td><td>5,984 out of 215</td><td>8.77</td><td>2,207</td><td>2.71</td></tr><tr><td>Total</td><td>6,325</td><td>8.60</td><td>2,376</td><td>2.66</td></tr></table>
|
| 79 |
+
|
| 80 |
+
Table 1: Statistics about the source causal graphs in our dataset. Given the number of nodes, we report the number of unique DAGs, average number of edges per DAG, number of MECs, and average number of DAGs per MEC.
|
| 81 |
+
|
| 82 |
+
isomorphism check (McKay & Piperno, 2014), and reduce the set so that only unique DAGs are retained, and we show their statistics in Table 1. Although we can handle large graphs, we mostly focus on smaller graphs that can still lead to a reasonably sized dataset, so we empirically set $N = 6$ but future work can use our open-sourced codes to extend to more nodes.
|
| 83 |
+
|
| 84 |
+
# 3.4 PROGRAMMATICALLY GENERATING THE D-SEPARATION SETS
|
| 85 |
+
|
| 86 |
+
Based on the set of unique DAGs, we then programmatically generate the d-separation sets by graph theoretical conditions, as in Step 3 of Figure 2. To realize this step, we code an efficient graph-theoretic algorithm to check for all the chain, fork, and collider structures to automatically identify the set of nodes that d-separate each pair of nodes. Using the d-separation sets and the faithfulness assumption, we form the statistical correlations as follows. For each pair of nodes, they are conditionally independent given the variables in the d-separation set. If the d-separation set is empty, then the two nodes are unconditionally independent. If no d-separation set can be found for the two nodes, then they are directly correlated.
|
| 87 |
+
|
| 88 |
+
Moreover, using the d-separation sets, we are able to cluster causal graphs to MECs. We achieve it by tracing the mapping between the causal graphs and the set of statistical correlations, and backtracking the graphs with the same d-separation sets to group them in the same MEC. We show in Table 1 that each MEC contains on average 2.66 DAGs.
|
| 89 |
+
|
| 90 |
+
# 3.5 COMPOSING THE HYPOTHESES AND LABEL
|
| 91 |
+
|
| 92 |
+
After generating the set of correlations based on the d-separation sets, we now generate the causal hypotheses. For the causal relation $r$ , we focus on six common causal relations between two nodes introduced in Section 2.1: Is-Parent, Is-Child, Is-Ancestor (excluding the parents), Is-Descendant (excluding the children), Has-Confounder (i.e., there exists a confounder, or common cause, of the two nodes), and Has-Collider (i.e., there exists a collider, or common effect, of the two nodes). In this way, the set of hypotheses contains all six meaningful causal relations between every pair of variables, resulting in a total size of $6 \cdot N ( N - 1 ) / 2 = 3 \bar { N } ( N - 1 )$ hypotheses for a graph with $N$ variables.
|
| 93 |
+
|
| 94 |
+
To generate the ground-truth validity label, we start from the correlation sets in Step 3, then look up all the causal graphs in the same MEC corresponding to the given set of correlations, and check the necessity of the hypothesized causal relation. If the causal relationship proposed in the hypothesis is valid for all causal graphs within the MEC, then we generate the validity $v = 1$ ; otherwise, we generate $v = 0$ . A special case of valid samples is that when the size of the MEC is 1, then there is a bijective mapping between the causal graph and the $\mathrm { d }$ -separation sets, so any hypothesis stating the causal properties of that unique causal graph is valid.
|
| 95 |
+
|
| 96 |
+
# 3.6 VERBALIZING INTO LANGUAGE
|
| 97 |
+
|
| 98 |
+
Finally, as in the last step of Figure 2, we convert all the information above to text data for our CORR2CAUSE task. For the correlation statement, we verbalize the set of correlations in Step 3 into a natural language statement $\pmb { s }$ . When two variables cannot be d-separated, i.e., $A \not \perp B$ , then we describe them as $^ { 6 6 } A$ correlates with $B ^ { \prime \prime }$ since they are directly correlated and cannot be independent by any condition. And if two variables have a valid d-separation set $C$ , then we describe them as $^ { 6 6 } A$ is independent of $B$ given $C$ .” In the special case when the d-separation set is empty, we directly say “ $A$ is independent of $B$ .” In addition, we disambiguate the setting by starting the correlation statement with the setup of a closed system of the given variables, and no hidden variables: “Suppose there is a closed system of $N$ variables, A, B, . . . All the statistical relations among these $N$ variables are as follows:”. Finally, to verbalize the hypothesis, we feed the causal relation triplet $( X _ { i } , r , X _ { j } )$
|
| 99 |
+
|
| 100 |
+
<table><tr><td>Causal Relation</td><td>Hypothesis Template</td></tr><tr><td>Is-Parent</td><td>{Vari} directly causes {Var j}.</td></tr><tr><td>Is-Ancestor</td><td>{Var i} causes something else which causes {Var j}.</td></tr><tr><td>Is-Child</td><td>{Var j} directlycauses {Var i}.</td></tr><tr><td>Is-Descendant</td><td>{Varj} isacause for {Vari},but not a direct one.</td></tr><tr><td>Has-Collider</td><td>There exists at least one collider (i.e.,common effect) of {Var i} and {Varj}.</td></tr><tr><td>Has-Confounder</td><td>There exists at least one confounder (i.e., common cause) of {Var i} and {Varj}.</td></tr></table>
|
| 101 |
+
|
| 102 |
+
Table 2: Templates for each causal relation in the hypothesis. We use {Var i} and $\{ \mathrm { V a r ~ \normalfont ~ \div ~ } \}$ as placeholders for the two variables.
|
| 103 |
+
|
| 104 |
+
into their hypothesis templates in Table 2. For example, we turn the triplet (A, Is-Parent, $B$ ) into “A directly causes $B ^ { \ast }$ , as in the example of Figure 2.
|
| 105 |
+
|
| 106 |
+
# 3.7 STATISTICS OF THE RESULTING DATA
|
| 107 |
+
|
| 108 |
+
We show the statistics of our CORR2CAUSE dataset in Table 3. Overall, our dataset contains 207,972 samples, where $1 8 . 5 7 \%$ of the samples have the positive label (i.e., with validity $= 1$ ). The average length of the premise is 424.11 tokens, and hypothesis 10.83 tokens. We split the data into 205,734 training samples, 1,076 development and 1,162 test samples.2 Since the main purpose of the dataset is to benchmark the performance of LLMs, we prioritize the test and development sets to have a comprehensive coverage over all sizes of graphs. Specifically, we iterate through the subset of our data for each $N$ , and split it entirely for only the test and development sets if the data is less than 1K, which is the case for $N = 2$ and 3. For the other subsets that are larger, we randomly sample up to 1K or $10 \%$ of the data, whichever is smaller, to the test and development sets. We set the cap to be 1K in order to form a reasonable computation budget, since many LLMs are expensive to query in the inference mode. Aside from the test and valid sets, all the rest of the data goes into the training set.
|
| 109 |
+
|
| 110 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Overall</td><td colspan="5">Statistics by the Number of Nodes N</td></tr><tr><td>N=2</td><td>N=3</td><td>N=4</td><td>N=5</td><td>N=6</td></tr><tr><td>#Samples</td><td>207,972</td><td>12</td><td>90</td><td>720</td><td>8,520</td><td>198,630</td></tr><tr><td>#Test</td><td>1,162</td><td>6</td><td>48</td><td>72</td><td>514</td><td>522</td></tr><tr><td># Dev</td><td>1,076</td><td>6</td><td>42</td><td>72</td><td>482</td><td>474</td></tr><tr><td>#Train</td><td>205,734</td><td>0</td><td>0</td><td>576</td><td>7,524</td><td>197,634</td></tr><tr><td># Tokens/Premise</td><td>424.11</td><td>31.5</td><td>52.0</td><td>104.0</td><td>212.61</td><td>434.54</td></tr><tr><td># Tokens/Hypothesis</td><td>10.83</td><td>10.83</td><td>10.83</td><td>10.83</td><td>10.83</td><td>10.83</td></tr><tr><td>% Positive Labels</td><td>18.57</td><td>0.00</td><td>3.33</td><td>7.50</td><td>13.01</td><td>18.85</td></tr><tr><td>Vocab Size</td><td>65</td><td>49</td><td>53</td><td>55</td><td>57</td><td>61</td></tr></table>
|
| 111 |
+
|
| 112 |
+
Table 3: Statistics of our CORR2CAUSE dataset, and by subsets. We report the total number of samples (# Samples); splits of the test (# Test), developement (# Dev) and training sets (# Train); number of tokens per premise (# Tokens/Premise) and hypothesis (# Tokens/Hypothesis); percentage of the positive labels $\%$ Positive Labels), and vocabulary size by the number of unique tokens (Vocab Size). Note that the number of unique graphs and MECs are in Table 1.
|
| 113 |
+
|
| 114 |
+
# 4 EXPERIMENTS
|
| 115 |
+
|
| 116 |
+
# 4.1 EXPERIMENTAL SETUP
|
| 117 |
+
|
| 118 |
+
We set up a diverse list of LLMs for the experiments on our CORR2CAUSE dataset. To test existing LLMs, we first include six commonly used BERT-based NLI models in the transformers library (Wolf et al., 2020): BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019), BART (Lewis et al., 2020), DeBERTa (He et al., 2021), DistilBERT (Sanh et al., 2019), and DistilBART (Shleifer & Rush, 2020). Apart from these BERT-based NLI models, we also evaluate the general-purpose autoregressive LLMs based on GPT (Radford et al., 2019): GPT-3 Ada, Babbage, Curie, Davinci (Brown et al., 2020); its instruction-tuned versions (Ouyang et al., 2022), text-davinci-001, text-davinci-002, and text-davinci-003; and GPT-3.5 (i.e., ChatGPT), and the latest GPT-4 (OpenAI, 2023) by April 2023,
|
| 119 |
+
|
| 120 |
+
<table><tr><td></td><td>F1</td><td>Precision</td><td>Recall</td><td>Accuracy</td></tr><tr><td>Random Baselines</td><td></td><td></td><td></td><td></td></tr><tr><td>Always Majority</td><td>0.0</td><td>0.0</td><td>0.0</td><td>84.77</td></tr><tr><td>Random (Proportional)</td><td>13.5</td><td>12.53</td><td>14.62</td><td>71.46</td></tr><tr><td>Random (Uniform)</td><td>20.38</td><td>15.11</td><td>31.29</td><td>62.78</td></tr><tr><td>BERT-Based Models</td><td></td><td></td><td></td><td></td></tr><tr><td>BERTMNLI</td><td>2.82</td><td>7.23</td><td>1.75</td><td>81.61</td></tr><tr><td>RoBERTaMNLI</td><td>22.79</td><td>34.73</td><td>16.96</td><td>82.50</td></tr><tr><td>DeBERTaMNLI</td><td>14.52</td><td>14.71</td><td>14.33</td><td>74.31</td></tr><tr><td>DistilBERTMNLI</td><td>20.70</td><td>24.12</td><td>18.13</td><td>78.85</td></tr><tr><td>DistilBARTMNLI</td><td>26.74</td><td>15.92</td><td>83.63</td><td>30.23</td></tr><tr><td>BARTMNLI</td><td>33.38</td><td>31.59</td><td>35.38</td><td>78.50</td></tr><tr><td>LLaMa-BasedModels</td><td></td><td></td><td></td><td></td></tr><tr><td>LLaMa-7B</td><td>26.81</td><td>15.50</td><td>99.42</td><td>17.36</td></tr><tr><td>Alpaca-7B</td><td>27.37</td><td>15.93</td><td>97.37</td><td>21.33</td></tr><tr><td>GPT-Based Models</td><td></td><td></td><td></td><td></td></tr><tr><td>GPT-3 Ada</td><td>0.00</td><td>0.00</td><td>0.00</td><td>84.77</td></tr><tr><td>GPT-3 Babbage</td><td>27.45</td><td>15.96</td><td>97.95</td><td>21.15</td></tr><tr><td>GPT-3 Curie</td><td>26.43</td><td>15.23</td><td>100.00</td><td>15.23</td></tr><tr><td>GPT-3 Davinci</td><td>27.82</td><td>16.57</td><td>86.55</td><td>31.61</td></tr><tr><td>GPT-3 Instruct (text-davinci-001)</td><td>17.99</td><td>11.84</td><td>37.43</td><td>48.04</td></tr><tr><td>GPT-3 Instruct (text-davinci-002)</td><td>21.87</td><td>13.46</td><td>58.19</td><td>36.69</td></tr><tr><td>GPT-3 Instruct (text-davinci-003)</td><td>15.72</td><td>13.4</td><td>19.01</td><td>68.97</td></tr><tr><td>GPT-3.5</td><td>21.69</td><td>17.79</td><td>27.78</td><td>69.46</td></tr><tr><td>GPT-4</td><td>29.08</td><td>20.92</td><td>47.66</td><td>64.60</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Table 4: Overall performance. We report F1 (main metric), precision, recall and accuracy. For the main metric, F1 score, we use the bold font to highlight the overall best performance, and underline to highlight the best performance within each category of models.
|
| 123 |
+
|
| 124 |
+
using the OpenAI API (https://openai.com/api/) with temperature 0. We also evaluate the recent, more efficient models, LLaMa (Touvron et al., 2023) and Alpaca (Taori et al., 2023).
|
| 125 |
+
|
| 126 |
+
When inspecting the behavior of finetuned models, we adopt a large set of models, including GPTbased models (GPT-3 Ada, Babbage, Curie, and Davinci) using the OpenAI finetuning API for classification at https://platform.openai.com/docs/guides/fine-tuning, open-sourced decoder-only models (GPT2, GPT2-Large, GPT2-XL, LLaMA-7B, and LLaMA2-7B), BERT-based models from scratch (BERT-Base, BERT-Large, RoBERTa-Base, and RoBERTa-Large), and BERTBased NLI models (BERT-Base MNLI, BERT-Large MNLI, RoBERTa-Base MNLI, and RoBERTaLarge MNLI) using the transformers library (Wolf et al., 2020). See training details in Appendix A.
|
| 127 |
+
|
| 128 |
+
For the random baselines, we provide “always majority” to predict the majority class $100 \%$ of the time, “random (uniform)” to uniformly sample a label (i.e., $50 \%$ for each), and “random (proportional)” to sample a label from a Bernouli distribution proportional to the development set label distribution.
|
| 129 |
+
|
| 130 |
+
# 4.2 THE CORR2CAUSE SKILL IN EXISTING LLMS
|
| 131 |
+
|
| 132 |
+
We show the performance of seventeen LLMs in Table 4. We can see that pure causal inference is a very challenging task across all existing LLMs. Among all the LLMs, the best performance is $3 3 . 3 8 \%$ F1 by BART MNLI, which is even higher than the latest GPT-based model, GPT-4. Notably, many models are worse than random guess, which means that they totally fail at this pure causal inference task. The observation still holds for few-shot chain-of-thought prompts tested in Appendix G.
|
| 133 |
+
|
| 134 |
+
# 4.3 FINETUNED PERFORMANCE
|
| 135 |
+
|
| 136 |
+
Next, we address the question: Can we re-purpose LLMs to learn this task? The experimental results in Table 5a of 17 models finetuned on our CORR2CAUSE seem very strong at first sight. Most models see a substantial increase, among which the finetuned BERT-based NLI models demonstrate the strongest performance. The best-performing one, RoBERTa-Large MNLI, achieves $9 4 . 7 4 \%$ F1 score on this task, as well as very high precision, recall and accuracy scores.
|
| 137 |
+
|
| 138 |
+
<table><tr><td colspan="4">F1 Precison Recall Accuracy</td></tr><tr><td colspan="4">Finetuned GPT-Based Models Using OpenAI API</td></tr><tr><td>GPT-3 Ada</td><td>79.85 70.47</td><td>92.11</td><td>92.92</td></tr><tr><td>GPT-3 Babbage</td><td>78.19 69.98</td><td>88.60</td><td>92.48</td></tr><tr><td>GPT-3 Curie</td><td>81.23 75.00</td><td>88.60</td><td>93.77</td></tr><tr><td>GPT-3Davinci 85.52</td><td>80.26</td><td>91.52</td><td>95.28</td></tr><tr><td colspan="4">Finetuned Open-Sourced Decoder-Only Models</td></tr><tr><td>GPT2</td><td>89.18 88.03</td><td>90.35</td><td>96.66</td></tr><tr><td>GPT2-Large</td><td>94.29 92.18</td><td>96.49</td><td>98.22</td></tr><tr><td>GPT2-XL</td><td>94.30 91.94</td><td>96.78</td><td>98.22</td></tr><tr><td>LLaMA-7B</td><td>91.98 88.62</td><td>95.61</td><td>97.46</td></tr><tr><td>LLaMA2-7B</td><td>92.92 90.11</td><td>95.91</td><td>97.77</td></tr><tr><td colspan="4">Finetuned BERT-Based Models</td></tr><tr><td>BERT-Base</td><td>69.29 54.42</td><td>95.32</td><td>87.13</td></tr><tr><td>BERT-Large</td><td>85.26 77.51</td><td>94.74</td><td>95.01</td></tr><tr><td>RoBERTa-Base</td><td>87.60 78.47</td><td>99.12</td><td>95.73</td></tr><tr><td>RoBERTa-Large</td><td>89.10 82.54</td><td>96.78</td><td>96.39</td></tr><tr><td colspan="4">Finetuned BERT-Based NLI Models</td></tr><tr><td>BERT-Base MNLI</td><td>89.88 85.49</td><td>94.74</td><td>86.51</td></tr><tr><td>BERT-Large MNLI</td><td>90.19 84.44</td><td>96.78</td><td>96.79</td></tr><tr><td>RoBERTa-Base MNLI</td><td>94.27 90.35</td><td>98.54</td><td>98.17</td></tr><tr><td>RoBERTa-Large MNLI</td><td>94.74 92.24</td><td>97.37</td><td>98.35</td></tr><tr><td></td><td></td><td></td><td></td></tr></table>
|
| 139 |
+
|
| 140 |
+
(a) Performance of finetuned models on the original test set.
|
| 141 |
+
|
| 142 |
+
<table><tr><td>F1 (Paraph.)</td><td>F1 (Var. Ref.)</td></tr><tr><td>61.73 62.34</td><td>41.57 43.28</td></tr><tr><td>64.93 65.01</td><td>45.32 46.96</td></tr><tr><td>56.76 55.95 60.32</td><td>31.70 31.99 43.95 53.92</td></tr><tr><td>56.41 52.24</td><td>49.47 35.20</td></tr><tr><td>61.13 63.64 65.58</td><td>38.54 53.12</td></tr><tr><td>65.05</td><td>60.20</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>65.56</td><td></td></tr><tr><td></td><td>31.50</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>67.24</td><td>52.04</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>57.42</td><td>62.83</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>55.45</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>67.87</td></tr></table>
|
| 143 |
+
|
| 144 |
+
(b) F1 scores of finetuned models on the perturbed test sets by paraphrasing (Paraph.) and variable refactorization (Var. Ref.).
|
| 145 |
+
|
| 146 |
+
Table 5: Performance of finetuned models on the original test set and perturbed test sets.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Relation Type</td><td>F1</td><td>Precision</td><td>Recall</td><td>Accuracy</td></tr><tr><td>Is-Parent</td><td>96.18</td><td>95.45</td><td>96.92</td><td>98.67</td></tr><tr><td>Is-Ancestor</td><td>93.94</td><td>93.94</td><td>93.94</td><td>98.93</td></tr><tr><td>Is-Child</td><td>95.73</td><td>94.92</td><td>96.56</td><td>98.67</td></tr><tr><td>Is-Descendant</td><td>96.55</td><td>93.33</td><td>100</td><td>99.47</td></tr><tr><td>Has-Collider</td><td>92.19</td><td>87.41</td><td>97.52</td><td>94.64</td></tr><tr><td>Has-Confounder</td><td>98.67</td><td>97.37</td><td>100</td><td>99.73</td></tr></table>
|
| 149 |
+
|
| 150 |
+
(a) Fine-grained performance of RoBERTa-Large by causal relation type on the original test set.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>F1</td><td>Precision</td><td>Recall</td><td>Accuracy</td></tr><tr><td>74.80</td><td>79.31</td><td>70.77</td><td>91.73</td></tr><tr><td>45.45</td><td>90.91</td><td>30.30</td><td>93.60</td></tr><tr><td>73.39</td><td>78.43</td><td>68.97</td><td>92.27</td></tr><tr><td>29.41</td><td>83.33</td><td>17.86</td><td>93.60</td></tr><tr><td>70.70</td><td>75.00</td><td>66.90</td><td>82.04</td></tr><tr><td>70.42</td><td>73.53</td><td>67.57</td><td>94.37</td></tr></table>
|
| 153 |
+
|
| 154 |
+
(b) Its fine-grained performance by relation type after variable refactorization.
|
| 155 |
+
|
| 156 |
+
Table 6: Fine-grained analysis of the best-performing model, RoBERTa-Large MNLI.
|
| 157 |
+
|
| 158 |
+
# 4.4 FINE-GRAINED PERFORMANCE BY CAUSAL RELATION
|
| 159 |
+
|
| 160 |
+
In addition to the overall results mentioned above, we conduct a fine-grained analysis to check the performance of the strongest finetuned model, RoBERTa-Large MNLI, by our six causal relation types. As in Table 6a, the model is very good at judging relations such as Is-Parent, Is-Descendant and Has-Confounder, all with more than $96 \%$ F1 scores, whereas it is several points weaker on the Has-Collider relations. This could be due to that the collider relation is the most special type, requiring identification of the V-structure based on both the unconditional independence based on the two variables only and correlations whenever conditioned on a common descendant. We also conduct error analysis for non-finetuned models in Appendix F.
|
| 161 |
+
|
| 162 |
+
# 4.5 ROBUSTNESS ANALYSIS
|
| 163 |
+
|
| 164 |
+
Looking at the very high performance of the finetuned models, we raise the next question: Did the models really robustly learn the causal inference skills?
|
| 165 |
+
|
| 166 |
+
Two Robustness Tests We design two simple robustness tests: (1) paraphrasing, and (2) variable refactorization. For (1) paraphrasing, we simply paraphrase the hypothesis by changing the text template for each causal relation to some semantically-equivalent alternatives in Appendix C. For (2) variable refactorization, we reverse the alphabet of the variable names, namely flipping A, B, C, to Z, Y, X and so on. The inspiration behind the two robustness tests comes from the spurious correlation analysis described in Appendix E.
|
| 167 |
+
|
| 168 |
+
Specifically, we adopt the common setup of text adversarial attack (Morris et al., 2020; Jin et al., 2020) to preserve the training set and keep the same saved models, but run the inference on the perturbed test set. In this way, we separate the possibilities of the models only overfitting on the training data vs. mastering the reasoning skills.
|
| 169 |
+
|
| 170 |
+
Results after Perturbation We can see from Table 5b that all the models drop drastically, by up to 39.29 on the paraphrased test set, and up to 62.30 after variable refactorization. The best-performing model, RoBERTa-Large MNLI, is especially sensitive towards paraphrasing, demonstrating the most drop among all models; however, it is the most robust against the variable refactorization, maintaining a high F1 score of 67.87. We conduct fine-grained analysis for RoBERTa-Large MNLI under perturbation in Table 6b. We can see the the main source of the performance drop of the model comes from the two classes, Is-Ancestor (decreasing to $4 5 . 4 5 \%$ ) and Is-Descendant (decreasing to $2 9 . 4 1 \%$ ), while the other classes stay relatively robust, keeping their F1 scores over $70 \%$ .
|
| 171 |
+
|
| 172 |
+
From this analysis, we make the following suggestions to future studies testing this CORR2CAUSE skill of LLMs. First, it is safe to use it as a test set to benchmark existing LLMs’ performance, since the data we generate is out-of-distribution from the training data of the current LLMs. Then, when testing finetuned models, it is very important to accompany adversarial attack together with the i.i.d. test set. We open-source our perturbed test sets for future work to test the generalizability skill.
|
| 173 |
+
|
| 174 |
+
# 4.6 EXTENSION TO NATURAL STORIES
|
| 175 |
+
|
| 176 |
+
We envision our CORR2CAUSE dataset to be a foundation for future extensions to various settings, such as instantiating the variables with actual phenomena and situating the story in a more natural setting. For example, the correlation does not imply causation rule can be instantiated with the ice cream sales and swimming pool attendance as the two variables, and argue that ice cream sales does not necessarily affect swimming pool attendance, because their correlation could be due to a third variable, such as hot weather. We provide a case study for how to instantiate the symbolic expressions in our dataset to more natural stories, and find that LLMs such as GPT-4 can generate realistic, daily life stories that has foreseeably broad applications. See more details in Appendix B.
|
| 177 |
+
|
| 178 |
+
# 5 RELATED WORK
|
| 179 |
+
|
| 180 |
+
Existing Causal Reasoning Tasks A large body of existing research of causal reasoning in NLP focuses on leveraging empirical knowledge to do tasks such as inferring the cause and effect of why an agent perform certain tasks (Sap et al., 2019a), the motivation and emotional reaction in a social context (Sap et al., 2019b), how people achieve a given goal with a set of concrete steps (Zhang et al., 2020), the development of a story given a different beginning (Qin et al., 2019), and how in general LLMs serve as a knowledge base of cause and effect (Willig et al., 2023; Kıcıman et al., 2023). In contrast, our CORR2CAUSE task focuses on the pure causal inference skill of models, which is a knowledge-dependent reasoning skill based on formally correct rules from causal inference.
|
| 181 |
+
|
| 182 |
+
Existing Logical and Inference Tasks Another related area of literature is logical and inference tasks, of which a well-established one is natural language inference (NLI), to identify the semantic relationship between a pair of sentences (MacCartney & Manning, 2008; Bowman et al., 2015). NLI datasets mainly focus on the set and paraphrase relations. For example, “a group of boys are playing football” can entail “some guys are playing football,” where “boys” are a sub-concept of “guys,” and “a group of” and “some” are paraphrases. Recently, there have been increasing efforts to extend the inference task to various logical inference skills such as deductive logic and propaganda techniques (Jin et al., 2022; Alhindi et al., 2022). Our CORR2CAUSE dataset is the first dataset testing the correlation-to-causation inference skill, which is unique of its type.
|
| 183 |
+
|
| 184 |
+
# 6 CONCLUSION
|
| 185 |
+
|
| 186 |
+
In this work, we introduced a novel task, CORR2CAUSE, to infer causation from correlation, and collected a large-scale dataset of over 200K samples. We evaluated an extensive list of LLMs on this new task, and showed that off-the-shelf LLMs perform poorly on this task. We also show that it is possible to re-purpose LLMs on this task by finetuning, but future work needs to be aware of the out-of-distribution generalization problem. To avoid the Goodhart’s law, we recommend using this dataset to benchmark the pure causal inference skills for LLMs that have not seen this dataset. Given the limited reasoning abilities of current LLMs, and the difficulty of separating actual reasoning from training-corpus-derived knowledge, it is imperative that our community focus on work aiming to accurately disentangle and measure both abilities. We believe the present work is a first such step.
|
| 187 |
+
|
| 188 |
+
# LIMITATIONS AND FUTURE WORK
|
| 189 |
+
|
| 190 |
+
We identify several limitations of this work and open future directions: First, in the context of this work, we limit the causal graphs to two to six nodes, but future work can feel free to explore larger graphs. Another aspect is that we do not assume hidden confounders in this inference problem, so we welcome future work to generate an even more challenging dataset to infer the existence of hidden confounders, analogous to the causal discovery algorithm of fast causal inference (FCI) (Spirtes et al., 2000). And also in general, explorations of other causal discovery algorithms are welcomed too. Finally, a lot of motivation behind proposing this task is inspired by the problem of invalid reasoning patterns in our daily reasoning (Jin et al., 2022), which could fertilize the ground for more pervasive spread of fake news. We believe false causal inference is a prevalent type of fallacious beliefs, and welcome future work to connect the idea of this benchmark to more real-world false beliefs based on confusing correlation with causation.
|
| 191 |
+
|
| 192 |
+
# ACKNOWLEDGMENT
|
| 193 |
+
|
| 194 |
+
We thank Riley Goodside for valuable suggestions to improve our prompts to LLMs. We thank Luigi Gresele and Amir Hossein Karimi for their suggestions to help us improve the formulation of our causal discovery questions.
|
| 195 |
+
|
| 196 |
+
This material is based in part upon work supported by the German Federal Ministry of Education and Research (BMBF): Tübingen AI Center, FKZ: 01IS18039B; by the Machine Learning Cluster of Excellence, EXC number 2064/1 – Project number 390727645; by a National Science Foundation award (#2306372); by a Swiss National Science Foundation award (#201009) and a Responsible AI grant by the Haslerstiftung. Zhijing Jin is supported by PhD fellowships from the Future of Life Institute and Open Philanthropy. We also thank OpenAI for granting Zhijing quota to their API of GPT series through the Researcher Access Program.
|
| 197 |
+
|
| 198 |
+
# REFERENCES
|
| 199 |
+
|
| 200 |
+
Tariq Alhindi, Tuhin Chakrabarty, Elena Musi, and Smaranda Muresan. Multitask instruction-based prompting for fallacy recognition. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 8172–8187, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/ 2022.emnlp-main.560. 9
|
| 201 |
+
|
| 202 |
+
Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Wen-tau Yih, and Yejin Choi. Abductive commonsense reasoning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id= Byg1v1HKDB. 1
|
| 203 |
+
|
| 204 |
+
Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 632–642, Lisbon, Portugal, September 2015. Association for Computational Linguistics. doi: 10.18653/v1/D15-1075. URL https: //aclanthology.org/D15-1075. 9
|
| 205 |
+
|
| 206 |
+
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 H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877–1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf. 6
|
| 207 |
+
|
| 208 |
+
David Maxwell Chickering. Optimal structure identification with greedy search. J. Mach. Learn. Res., 3:507–554, 2002. URL http://jmlr.org/papers/v3/chickering02b.html. 3
|
| 209 |
+
|
| 210 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171��4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https: //aclanthology.org/N19-1423. 1, 6
|
| 211 |
+
|
| 212 |
+
Clark Glymour, Kun Zhang, and Peter Spirtes. Review of causal discovery methods based on graphical models. Frontiers in Genetics, 10:524, 2019. ISSN 1664-8021. doi: 10.3389/fgene.2019. 00524. URL https://www.frontiersin.org/article/10.3389/fgene.2019. 00524. 2, 3
|
| 213 |
+
Madelyn Glymour, Judea Pearl, and Nicholas P Jewell. Causal inference in statistics: A primer. John Wiley and Sons, 2016. 2, 3
|
| 214 |
+
Andrew Gordon, Zornitsa Kozareva, and Melissa Roemmele. SemEval-2012 task 7: Choice of plausible alternatives: An evaluation of commonsense causal reasoning. In \*SEM 2012: The First Joint Conference on Lexical and Computational Semantics – Volume 1: Proceedings of the main conference and the shared task, and Volume 2: Proceedings of the Sixth International Workshop on Semantic Evaluation (SemEval 2012), pp. 394–398, Montréal, Canada, 7-8 June 2012. Association for Computational Linguistics. URL https://aclanthology.org/S12-1052. 1
|
| 215 |
+
Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced Bert with disentangled attention. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https:// openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ XPZIaotutsD. 6
|
| 216 |
+
Patrik O. Hoyer, Dominik Janzing, Joris M. Mooij, Jonas Peters, and Bernhard Schölkopf. Nonlinear causal discovery with additive noise models. In Daphne Koller, Dale Schuurmans, Yoshua Bengio, and Léon Bottou (eds.), Advances in Neural Information Processing Systems 21, Proceedings of the Twenty-Second Annual Conference on Neural Information Processing Systems, Vancouver, British Columbia, Canada, December 8-11, 2008, pp. 689–696. Curran Associates, Inc., 2008. URL https://proceedings.neurips.cc/paper/2008/hash/ f7664060cc52bc6f3d620bcedc94a4b6-Abstract.html. 3
|
| 217 |
+
Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. Is BERT really robust? A strong baseline for natural language attack on text classification and entailment. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pp. 8018– 8025. AAAI Press, 2020. URL https://aaai.org/ojs/index.php/AAAI/article/ view/6311. 9
|
| 218 |
+
Zhijing Jin, Abhinav Lalwani, Tejas Vaidhya, Xiaoyu Shen, Yiwen Ding, Zhiheng Lyu, Mrinmaya Sachan, Rada Mihalcea, and Bernhard Schölkopf. Logical fallacy detection. In Findings of the Association for Computational Linguistics: EMNLP 2022, pp. $\mathrm { \dot { 7 } 1 8 0 } \mathrm { \tilde { A } \mathrm { \acute { a } } }$ ‚¬âCœ–7198, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://arxiv.org/abs/2202.13758. 9, 10
|
| 219 |
+
Emre Kıcıman, Robert Ness, Amit Sharma, and Chenhao Tan. Causal reasoning and large language models: Opening a new frontier for causality. arXiv preprint arXiv:2305.00050, 2023. 1, 9
|
| 220 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7871–7880, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.703. URL https://aclanthology.org/2020.acl-main.703. 6
|
| 221 |
+
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. CoRR, abs/1907.11692, 2019. URL http://arxiv.org/abs/1907.11692. 6
|
| 222 |
+
|
| 223 |
+
Bill MacCartney and Christopher D. Manning. Modeling semantic containment and exclusion in natural language inference. In Proceedings of the 22nd International Conference on Computational Linguistics (Coling 2008), pp. 521–528, Manchester, UK, August 2008. Coling 2008 Organizing Committee. URL https://aclanthology.org/C08-1066. 9
|
| 224 |
+
|
| 225 |
+
Brendan D. McKay and Adolfo Piperno. Practical graph isomorphism, II. J. Symb. Comput., 60: 94–112, 2014. doi: 10.1016/j.jsc.2013.09.003. URL https://doi.org/10.1016/j.jsc. 2013.09.003. 5
|
| 226 |
+
John Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. TextAttack: A framework for adversarial attacks, data augmentation, and adversarial training in NLP. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 119–126, Online, October 2020. Association for Computational Linguistics. doi: 10.18653/v1/ 2020.emnlp-demos.16. URL https://aclanthology.org/2020.emnlp-demos.16. 9
|
| 227 |
+
OpenAI. GPT-4 technical report. CoRR, abs/2303.08774, 2023. doi: 10.48550/arXiv.2303.08774. URL https://doi.org/10.48550/arXiv.2303.08774. 1, 6
|
| 228 |
+
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F. Christiano, Jan Leike, and Ryan Lowe. Training language models to follow instructions with human feedback. CoRR, abs/2203.02155, 2022. doi: 10.48550/arXiv.2203.02155. URL https://doi.org/10. 48550/arXiv.2203.02155. 1, 6
|
| 229 |
+
Judea Pearl. Probabilistic reasoning in intelligent systems: Networks of plausible inference. Morgan Kaufmann, 1988. 3
|
| 230 |
+
Judea Pearl. Causality: Models, reasoning and inference (2nd ed.). Cambridge University Press, 2009. 1
|
| 231 |
+
Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference: Foundations and learning algorithms. The MIT Press, 2017. URL https://mitpress.mit.edu/ books/elements-causal-inference. 1
|
| 232 |
+
Lianhui Qin, Antoine Bosselut, Ari Holtzman, Chandra Bhagavatula, Elizabeth Clark, and Yejin Choi. Counterfactual story reasoning and generation. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 5043–5053, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1509. URL https: //aclanthology.org/D19-1509. 1, 9
|
| 233 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019. 1, 6
|
| 234 |
+
Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter. CoRR, abs/1910.01108, 2019. URL http: //arxiv.org/abs/1910.01108. 6
|
| 235 |
+
Maarten Sap, Ronan Le Bras, Emily Allaway, Chandra Bhagavatula, Nicholas Lourie, Hannah Rashkin, Brendan Roof, Noah A. Smith, and Yejin Choi. ATOMIC: an atlas of machine commonsense for if-then reasoning. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pp. 3027–3035. AAAI Press, 2019a. doi: 10.1609/aaai.v33i01.33013027. URL https://doi.org/10.1609/aaai.v33i01. 33013027. 1, 9
|
| 236 |
+
Maarten Sap, Hannah Rashkin, Derek Chen, Ronan Le Bras, and Yejin Choi. Social iqa: Commonsense reasoning about social interactions. In EMNLP 2019, 2019b. 1, 9
|
| 237 |
+
|
| 238 |
+
Shohei Shimizu, Patrik O. Hoyer, Aapo Hyvärinen, and Antti J. Kerminen. A linear non-gaussian acyclic model for causal discovery. J. Mach. Learn. Res., 7:2003–2030, 2006. URL http: //jmlr.org/papers/v7/shimizu06a.html. 3
|
| 239 |
+
|
| 240 |
+
Sam Shleifer and Alexander M. Rush. Pre-trained summarization distillation. CoRR, abs/2010.13002, 2020. URL https://arxiv.org/abs/2010.13002. 6
|
| 241 |
+
Peter Spirtes and Kun Zhang. Causal discovery and inference: Concepts and recent methodological advances. In Applied informatics, volume 3, pp. 1–28. SpringerOpen, 2016. 2, 3
|
| 242 |
+
Peter Spirtes, Clark Glymour, and Richard Scheines. Causation, prediction, and search. 1993. 2, 3
|
| 243 |
+
Peter Spirtes, Clark Glymour, and Richard Scheines. Causation, Prediction, and Search, Second Edition. Adaptive computation and machine learning. MIT Press, 2000. ISBN 978-0-262-19440-2. 1, 2, 3, 10
|
| 244 |
+
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023. 7
|
| 245 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurélien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. Llama: Open and efficient foundation language models. CoRR, abs/2302.13971, 2023. doi: 10.48550/arXiv.2302.13971. URL https://doi. org/10.48550/arXiv.2302.13971. 7
|
| 246 |
+
Ruibo Tu, Chao Ma, and Cheng Zhang. Causal-discovery performance of chatgpt in the context of neuropathic pain diagnosis. arXiv preprint arXiv:2301.13819, 2023. 1
|
| 247 |
+
Moritz Willig, Matej Zecevi ˇ c, Devendra Singh Dhami, and Kristian Kersting. Probing for correlations ´ of causal facts: Large language models and causality, 2023. URL https://openreview. net/forum?id $=$ UPwzqPOs4-. 9
|
| 248 |
+
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 Rush. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 38–45, Online, October 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-demos.6. URL https://aclanthology.org/2020.emnlp-demos.6. 6, 7, 14
|
| 249 |
+
Yuxi Xie, Guanzhen Li, and Min-Yen Kan. Echo: Event causality inference via human-centric reasoning. arXiv preprint arXiv:2305.14740, 2023. 1
|
| 250 |
+
Matej Zecevi ˇ c, Moritz Willig, Devendra Singh Dhami, and Kristian Kersting. Causal parrots: Large ´ language models may talk causality but are not causal. arXiv preprint arXiv:2308.13067, 2023. 1
|
| 251 |
+
Kun Zhang and Aapo Hyvärinen. Causality discovery with additive disturbances: An informationtheoretical perspective. In Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2009, Bled, Slovenia, September 7-11, 2009, Proceedings, Part II 20, pp. 570–585. Springer, 2009. 3
|
| 252 |
+
Li Zhang, Qing Lyu, and Chris Callison-Burch. Reasoning about goals, steps, and temporal ordering with WikiHow. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 4630–4639, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.374. URL https://aclanthology.org/ 2020.emnlp-main.374. 9
|
| 253 |
+
Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona T. Diab, Xian Li, Xi Victoria Lin, Todor Mihaylov, Myle Ott, Sam Shleifer, Kurt Shuster, Daniel Simig, Punit Singh Koura, Anjali Sridhar, Tianlu Wang, and Luke Zettlemoyer. OPT: open pre-trained transformer language models. CoRR, abs/2205.01068, 2022. doi: 10.48550/ arXiv.2205.01068. URL https://doi.org/10.48550/arXiv.2205.01068. 1
|
| 254 |
+
|
| 255 |
+
# A IMPLEMENTATION DETAILS
|
| 256 |
+
|
| 257 |
+
When finetuning on our data, for GPT-based models, we use the default settings of the OpenAI finetuning API; and for BERT-based models, we use the transformers library (Wolf et al., 2020) and train the models on a server with an NVIDIA Tesla A100 GPU with 40G of memory. To fit for the GPU memory, we set the batch size to be 8. We use the validation set to tune the learning rate, which takes value in {2e-6, 5e-6, 1e-5, 2e-5, 5e-5}; dropout rate, which takes value in $\{ 0 , 0 . 1 , 0 . 2$ , 0.3}; and weight decay, which takes value in {1e-4, 1e-5}. We train the models until convergence, which is usually around ten epochs.
|
| 258 |
+
|
| 259 |
+
Prompts When querying the autoregressive LLMs, we formulate the prompt as follows:
|
| 260 |
+
|
| 261 |
+
Question: [premise]
|
| 262 |
+
|
| 263 |
+
Can we deduct the following: [hypothesis]? Just answer "Yes" or "No."
|
| 264 |
+
|
| 265 |
+
Answer:
|
| 266 |
+
|
| 267 |
+
# B GENERATING NATURAL STORIES
|
| 268 |
+
|
| 269 |
+
To generate the natural stories based on our symbolic expressions, we utilize the state-of-the-art LLM, GPT-4, which is very good at story generation. We design detailed instructions in the prompt, and generate around 200 stories in our case study. We show two examples stories in Table 7, and the report the overall statistics in Table 8.
|
| 270 |
+
|
| 271 |
+
<table><tr><td>Example 1 (Label=Negative)</td><td>Symbolic Premise: Suppose there is a closed system</td><td>Example 2 (Label=Positive) Premise: Suppose there is a closed system</td></tr><tr><td>Form Natural</td><td>of 2 variables,A and B.All the statistical relations among these 2 variables are as fol- lows:A correlates with B. Hypothesis:A directly affects B. Relation between the promise and hypothe- sis: The premise does not a necessary con- dition for the hypothesis. Premise: Suppose there is a closed system</td><td>of3 variables,A,B and C.All the statisti- cal relations among these 3 variables are as follows: A correlates with C.B correlates with C.However,Ais independent ofB. Hypothesis: A directly affects C. Relation between the promise and hypoth- esis: The premise is a necessary condition for the hypothesis. So if the premise is true, the hypothesis must be true. Premise:Let's consider three factors: eat-</td></tr><tr><td>Story</td><td>of 2 variables,ice cream sales and swim- ming pool attendance.All the statistical relations among these 2 variables are as fol- lows: ice cream sales correlate with swim- ming pool attendance. Hypothesis:Ice cream sales directly affect swimming pool attendance. Relation between the premise and hypoth- esis: The premise does not provide a nec- essary condition for the hypothesis. The correlation between ice cream sales and swimming pool attendance could be due to a third variable,such as hot weather, which increases both ice cream sales and swim- ming pool attendance.Therefore, it is not necessarily true that ice cream sales directly affect swimming pool attendance.</td><td>ing junk food (A), obesity (C),and watch- ing television (B). There is a correlation between eating junk food and obesity, and between watching television and obesity. However, eating junk food and watching television are independent from each other. Hypothesis: Eating junk food directly af- fects obesity. Relation between the premise and hypoth- esis: The premise provides the necessary conditions for the hypothesis.It establishes the independent variables A (eating junk food) and B (watching television) and their correlations with obesity. Given that these are true,it supports the hypothesis that eat- ing junk food directly affects obesity.</td></tr></table>
|
| 272 |
+
|
| 273 |
+
Table 7: Examples of natural stories generated based on the symbolic form in our CORR2CAUSE dataset, showing the broad application value of our dataset as the starting point for various verbalizations of the correlation-to-causation inference task.
|
| 274 |
+
|
| 275 |
+
Table 8: Statistics of our generated natural stories. We report the number of samples in the test and development sets; number of tokens per premise (# Tokens/Premise), hypothesis (# Tokens/Hypothesis), and explanation (# Tokens/Explanation); and percentage of the positive labels $\%$ Positive Labels).
|
| 276 |
+
|
| 277 |
+
<table><tr><td>Test Set Size Dev Set Size</td><td>102 102</td></tr><tr><td># Tokens/Premise</td><td>64.88</td></tr><tr><td># Tokens/Hypothesis</td><td>13.54</td></tr><tr><td># Tokens/Explanation</td><td>64.66</td></tr><tr><td>% Positive Labels</td><td>1.67</td></tr></table>
|
| 278 |
+
|
| 279 |
+
For more information, the exact prompt we use is “Here is a causal inference rule: [symbolic form] Please provide a real-world example instantiating this phenomenon. Format it also as "Premise:", "Hypothesis:", and "Relation between the promise and hypothesis:".”
|
| 280 |
+
|
| 281 |
+
# C TEMPLATES AND PARAPHRASES
|
| 282 |
+
|
| 283 |
+
We use the verbalization templates in Table 9 to compose the hypotheses for all six causal relations.
|
| 284 |
+
|
| 285 |
+
<table><tr><td>Causal Relation</td><td colspan="2">Hypothesis Template</td></tr><tr><td>Is-Parent</td><td></td><td>{Vari} directly causes {Var j}.</td></tr><tr><td>Is-Ancestor</td><td></td><td>{Vari} causes something else which causes {Var j}.</td></tr><tr><td>Is-Child</td><td></td><td>{Varj} directly causes {Var i}.</td></tr><tr><td>Is-Descendant</td><td></td><td>{Varj} isa cause for{Var i},but nota direct one.</td></tr><tr><td>Has-Collider</td><td></td><td>There exists at least one collider (i.e., common effect) of {Var i} and {Varj}.</td></tr><tr><td>Has-Confounder</td><td></td><td>There exists at least one confounder (i.e.,common cause)of {Var i} and {Varj}.</td></tr><tr><td colspan="2">Paraphrases</td><td></td></tr><tr><td>Is-Parent</td><td></td><td>{Vari}directlyaffects{Var j}.</td></tr><tr><td>Is-Ancestor</td><td></td><td>{Var i} influences {Var j} through some mediator(s).</td></tr><tr><td>Is-Child</td><td></td><td>{Varj} directly affects {Var i}.</td></tr><tr><td>Is-Descendant</td><td></td><td>{Varj} influences {Var i} through some mediator(s).</td></tr><tr><td>Has-Collider</td><td></td><td>{Vari} and {Var j} together cause some other variable(s).</td></tr><tr><td>Has-Confounder</td><td></td><td>Some variable(s) cause(s) both {Var i} and {Var j}.</td></tr></table>
|
| 286 |
+
|
| 287 |
+
Table 9: Templates and their paraphrases for each causal relation in the hypothesis. We use {Var i} and {Var j} as placeholders for the two variables.
|
| 288 |
+
|
| 289 |
+
D CHANGE LOG FOR THE DATASET VERSION UPDATE
|
| 290 |
+
Table 10: De-duplication methods for the six causal relation types and their verbalizations.
|
| 291 |
+
|
| 292 |
+
<table><tr><td>Two Equivalent Forms</td><td>Duplication Property</td><td>De-Duplication Method</td></tr><tr><td>{ Is-Parid(j, )</td><td>Two exact same strings</td><td>Keep only one, by forcing i< j</td></tr><tr><td>{Is-Ancestor(i,j) (Original) (Is-Descendent(j,i) (Original)</td><td>Two different strings, but semantically equivalent</td><td>Randomly sample one out of the two</td></tr><tr><td>( Is-Asetor(i,j)(araphraded)</td><td>Two exact same strings</td><td>Keep only one, by forcing i< j</td></tr><tr><td>{Has-Collider(i,j) (Has-Collider(j,i)</td><td>Two different strings, but semantically equivalent</td><td>Randomly sample one out of the two</td></tr><tr><td>{Has-Confounder(i,j) { Has-Confounder(j,i)</td><td>Two different strings, but semantically equivalent</td><td>Randomly sample one out of the two</td></tr></table>
|
| 293 |
+
|
| 294 |
+
De-Duplication Strategy As mentioned in Section 3.7 in the main paper, our original dataset (v1.0) has duplication due to symmetric relations and verbalizations. We introduce in Table 10 several reasons for why duplicated hypotheses exist in our original data. One typical reason is symmetric relations such as Is-Parent(A, B) and Is-Child(B, A), and, similarly, the paraphrased version of
|
| 295 |
+
|
| 296 |
+
Is-Ancestor(A, B) and Is-Descendent(B, A). Another typical reason is the semantic equivalence in the verbalization templates, which applies to the Has-Collider and Has-Confounder relations. For example, the verbalized texts of Has-Collider(A, B) and Collider(B, A) are “There exists at least one collider (i.e., common effect) of {A and B, B and A},” respectively, which are semantically-equivalent paraphrases of each other, so we randomly keep one out of the two.
|
| 297 |
+
|
| 298 |
+
# Resulting Dataset Statistics after De-Duplication
|
| 299 |
+
|
| 300 |
+
Since the reason for duplication in the first place is due to symmetry in the causal relation, or verbalization, the resulting new data, CORR2CAUSE v2.0, is exactly a half of the original data. As we reported previously in Table 3 of Section 3.7, the total number of samples cuts down to half, while the label distribution and all other properties are the same. To compose each split, we apply the same de-duplication method for the test, train, and development sets. We notice that some duplicates are across the splits, so we prioritize keeping the test and training sets untouched (to minimally affect the experimental results), and then reduce the development set by removing the cross-split duplicates, namely:
|
| 301 |
+
|
| 302 |
+
• test_ $2 . 0 =$ deduplicate(test_1.0) • train_ $2 . 0 =$ deduplicate(train_1.0) • dev_ $2 . 0 =$ deduplicate(dev_1.0) \ {test_2.0, train_2.0}
|
| 303 |
+
|
| 304 |
+
We expect minimal or almost no change to the experimental results. In case of the slight possibility that this change in the development set might affect the model selection in the training process, future work can feel free to re-train the models and update the exact performance number.
|
| 305 |
+
|
| 306 |
+
# E SPURIOUS CORRELATION ANALYSIS
|
| 307 |
+
|
| 308 |
+
The inspirations of our two robustness tests (paraphrasing and variable refactorization) come from our data analysis. We check for spurious correlations in the data by reporting in Table 11 the point-wise mutual information (PMI) between the label and any n-gram with no more than four tokens. In addition, we also report the difference of the PMI with the two labels in the |Diff| column of Table 11, and report the top $1 0 \mathrm { n }$ -grams.
|
| 309 |
+
|
| 310 |
+
The design spirit for our robustness test is that if the models’ correct judgment relies on exploiting these spurious correlations, then such reliance will be broken in our perturbations.
|
| 311 |
+
|
| 312 |
+
<table><tr><td>N-Gram</td><td>PMI w/Non-Ent.Label</td><td>PMI w/Ent. Label</td><td>[Diff]</td></tr><tr><td>a cause</td><td>1.692209</td><td>-1.025611</td><td>2.717820</td></tr><tr><td>a cause for</td><td>1.663640</td><td>-0.983790</td><td>2.647430</td></tr><tr><td>A causes</td><td>1.640679</td><td>-0.951610</td><td>2.592289</td></tr><tr><td>A causes something</td><td>1.621820</td><td>-0.926075</td><td>2.547895</td></tr><tr><td>a direct</td><td>1.606052</td><td>-0.905316</td><td>2.511369</td></tr><tr><td>a direct one</td><td>1.592673</td><td>-0.888107</td><td>2.480781</td></tr><tr><td>forD</td><td>1.584826</td><td>-0.878180</td><td>2.463006</td></tr><tr><td>for D but</td><td>1.583897</td><td>-0.877014</td><td>2.460911</td></tr><tr><td>forE</td><td>1.582980</td><td>-0.875864</td><td>2.458844</td></tr><tr><td>for E but</td><td>1.582074</td><td>-0.874728</td><td>2.456802</td></tr></table>
|
| 313 |
+
|
| 314 |
+
Table 11: PMI between the labels and n-grams. The labels include non-entailment (Non-Ent.) and entailment (Ent.). And the n-grams include all with no more than four words. The |Diff| column shows the absolute value of the difference between the PMIs with two labels. We show the top 10 n-grams with the largest differences of their PMIs with the two classes in the |Diff| column.
|
| 315 |
+
|
| 316 |
+
We can see that some spurious correlations are rooted in the framing of the hypothesis, such as “a cause (for)”, and “a direct (one)” (which we use the paraphrasing task to break), and others are connected to the variable names, such as “for D (but)” and “for E (but)” (which we use the variable refactorization to break).
|
| 317 |
+
|
| 318 |
+
# F FINE-GRAINED ERROR ANALYSIS
|
| 319 |
+
|
| 320 |
+
In addition to the fine-grained analysis by causal relation type in Table 6a for fine-tuned models, we also report such error analysis for non-finetuned models in Table 12.
|
| 321 |
+
|
| 322 |
+
Table 12: Fine-grained evaluation results for some selected non-fine-tuned models.
|
| 323 |
+
|
| 324 |
+
<table><tr><td>Selected Models</td><td>Relation Type</td><td>F1</td><td>Precision</td><td>Recall</td><td>Accuracy</td></tr><tr><td>GPT-3.5</td><td>All</td><td>21.69</td><td>17.79</td><td>27.78</td><td>69.46</td></tr><tr><td>GPT-3.5</td><td>Is-Parent</td><td>8.82</td><td>100</td><td>4.62</td><td>83.47</td></tr><tr><td>GPT-3.5</td><td>Is-Ancestor</td><td>0</td><td>0</td><td>0</td><td>90.67</td></tr><tr><td>GPT-3.5</td><td>Is-Child</td><td>9.84</td><td>100</td><td>5.17</td><td>85.33</td></tr><tr><td>GPT-3.5</td><td>Is-Descendant</td><td>14.29</td><td>11.9</td><td>17.86</td><td>84</td></tr><tr><td>GPT-3.5</td><td>Has-Collider</td><td>34.24</td><td>25.51</td><td>52.07</td><td>35.12</td></tr><tr><td>GPT-3.5</td><td>Has-Confounder</td><td>15.33</td><td>8.86</td><td>56.76</td><td>37.8</td></tr><tr><td>GPT-4</td><td>All</td><td>29.08</td><td>20.92</td><td>47.66</td><td>64.6</td></tr><tr><td>GPT-4</td><td>Is-Parent</td><td>0</td><td>0</td><td>0</td><td>82.67</td></tr><tr><td>GPT-4</td><td>Is-Ancestor</td><td>30.77</td><td>31.25</td><td>30.3</td><td>88</td></tr><tr><td>GPT-4</td><td>Is-Child</td><td>0</td><td>0</td><td>0</td><td>84.53</td></tr><tr><td>GPT-4</td><td>Is-Descendant</td><td>26.98</td><td>17.35</td><td>60.71</td><td>75.47</td></tr><tr><td>GPT-4</td><td>Has-Collider</td><td>44.1</td><td>30.18</td><td>81.82</td><td>32.71</td></tr><tr><td>GPT-4</td><td>Has-Confounder</td><td>20.67</td><td>11.53</td><td>100</td><td>23.86</td></tr><tr><td>RoBERTaMNLI</td><td>All</td><td>22.79</td><td>34.73</td><td>16.96</td><td>82.5</td></tr><tr><td>RoBERTaMNLI</td><td>Is-Parent</td><td>0</td><td>0</td><td>0</td><td>82.67</td></tr><tr><td>RoBERTaMNLI</td><td>Is-Ancestor</td><td>0</td><td>0</td><td>0</td><td>91.2</td></tr><tr><td>RoBERTaMNLI</td><td>Is-Child</td><td>0</td><td>0</td><td>0</td><td>84.53</td></tr><tr><td>RoBERTaMNLI</td><td>Is-Descendant</td><td>0</td><td>0</td><td>0</td><td>92.53</td></tr><tr><td>RoBERTaMNLI</td><td>Has-Collider</td><td>43.45</td><td>39.73</td><td>47.93</td><td>59.52</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RoBERTaMNLI</td><td>Has-Confounder</td><td>0</td><td>0</td><td>0</td><td>84.45</td></tr></table>
|
| 325 |
+
|
| 326 |
+
These results are particularly revealing, showing how off-the-shelf models perform in recognizing specific relations. Specifically, GPT-3.5 cannot recognize ancestor relations, whereas GPT-4 fails at all direct causation recognition with parents and children. And RoBERTa MNLI only did collider relation relatively correctly. Note that, when the F1 score is zero, the accuracy number is a result of always predicting the negative class of that relation.
|
| 327 |
+
|
| 328 |
+
# G LLM PERFORMANCE OPTIMIZATION
|
| 329 |
+
|
| 330 |
+
Since our experiments in Section 4.2 are based on plain, zero-shot prompts, we explore whether better prompting strategies could improve the performance. We enhance the query prompt by incorporating several strategies: (1) Utilizing a system prompt that specifies the model’s expertise (“You are a highly intelligent question-answering bot with profound knowledge of causal inference.”); (2) Including a pair of few-shot examples, one positive and one negative; (3) Implementing chain-of-thought prompting with “Let’s think step by step.” to encourage the language model to generate step-by-step reasoning. In Table 13, we present the evaluation results on the relatively affordable model, GPT-3.5, where the optimized prompt leads to a 4-point improvement in F1 over the original performance. However, we can see that despite the deployment of all three strategies, the model continues to struggle with this challenging task.
|
| 331 |
+
|
| 332 |
+
Table 13: Performance of GPT-3.5 with different queries. We quote the original performance from Table 4.
|
| 333 |
+
|
| 334 |
+
<table><tr><td></td><td>F1</td><td>Precision</td><td>Recall</td><td>Accuracy</td></tr><tr><td>GPT-3.5 (plain query; original)</td><td>21.69</td><td>17.79</td><td>27.78</td><td>69.46</td></tr><tr><td>GPT-3.5 (enhanced query)</td><td>25.44</td><td>17.29</td><td>48.11</td><td>52.01</td></tr></table>
|
md/test/y1pPWFVfvR/y1pPWFVfvR.md
ADDED
|
@@ -0,0 +1,670 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Multimodal Chain-of-Thought Reasoning in Language Models
|
| 2 |
+
|
| 3 |
+
Zhuosheng Zhang∗
|
| 4 |
+
School of Electronic Information and Electrical Engineering,
|
| 5 |
+
Shanghai Jiao Tong University
|
| 6 |
+
|
| 7 |
+
zhangzs@sjtu.edu.cn
|
| 8 |
+
|
| 9 |
+
Aston Zhang∗ GenAI, Meta
|
| 10 |
+
|
| 11 |
+
az@astonzhang.com
|
| 12 |
+
|
| 13 |
+
Mu Li Amazon Web Services
|
| 14 |
+
|
| 15 |
+
muli@cs.cmu.edu
|
| 16 |
+
|
| 17 |
+
Hai Zhao
|
| 18 |
+
Department of Computer Science and Engineering,
|
| 19 |
+
Shanghai Jiao Tong University
|
| 20 |
+
|
| 21 |
+
zhaohai@cs.sjtu.edu.cn
|
| 22 |
+
|
| 23 |
+
George Karypis Amazon Web Services
|
| 24 |
+
|
| 25 |
+
gkarypis@amazon.com
|
| 26 |
+
|
| 27 |
+
Alex Smola Amazon Web Services
|
| 28 |
+
|
| 29 |
+
alex@smola.org
|
| 30 |
+
|
| 31 |
+
Reviewed on OpenReview: https: // openreview. net/ forum? id= y1pPWFVfvR
|
| 32 |
+
|
| 33 |
+
# Abstract
|
| 34 |
+
|
| 35 |
+
Large language models (LLMs) have shown impressive performance on complex reasoning by leveraging chain-of-thought (CoT) prompting to generate intermediate reasoning chains as the rationale to infer the answer. However, existing CoT studies have primarily focused on the language modality. We propose Multimodal-CoT that incorporates language (text) and vision (images) modalities into a two-stage framework that separates rationale generation and answer inference. In this way, answer inference can leverage better generated rationales that are based on multimodal information. Experimental results on ScienceQA and A-OKVQA benchmark datasets show the effectiveness of our proposed approach. With MultimodalCoT, our model under 1 billion parameters achieves state-of-the-art performance on the ScienceQA benchmark. Our analysis indicates that Multimodal-CoT offers the advantages of mitigating hallucination and enhancing convergence speed. Code is publicly available at https://github.com/amazon-science/mm-cot.
|
| 36 |
+
|
| 37 |
+
# 1 Introduction
|
| 38 |
+
|
| 39 |
+
Imagine reading a textbook with no figures or tables. Our ability to knowledge acquisition is greatly strengthened by jointly modeling diverse data modalities, such as vision, language, and audio. Recently, large language models (LLMs) (Brown et al., 2020; Thoppilan et al., 2022; Rae et al., 2021; Chowdhery et al., 2022) have shown impressive performance in complex reasoning by generating intermediate reasoning steps before inferring the answer. The intriguing technique is called chain-of-thought (CoT) reasoning (Wei et al., 2022b; Kojima et al., 2022; Zhang et al., 2023d).
|
| 40 |
+
|
| 41 |
+
However, existing studies related to CoT reasoning are largely isolated in the language modality (Wang et al., 2022c; Zhou et al., 2022; Lu et al., 2022b; Fu et al., 2022), with little consideration of multimodal scenarios. To elicit CoT reasoning in multimodality, we advocate a Multimodal-CoT paradigm. Given the inputs in different modalities, Multimodal-CoT decomposes multi-step problems into intermediate reasoning steps (rationale) and then infers the answer. Since vision and language are the most popular modalities, we focus on those two modalities in this work. An example is shown in Figure 1.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: Example of the multimodal CoT task.
|
| 45 |
+
|
| 46 |
+
In general, Multimodal-CoT reasoning can be elicited through two primary paradigms: (i) prompting LLMs and (ii) fine-tuning smaller models.1 We will delve into these paradigms and delineate their associated challenges as follows.
|
| 47 |
+
|
| 48 |
+
The most immediate way to perform Multimodal-CoT is to transform the input of different modalities into a unified modality and prompt LLMs to perform CoT (Zhang et al., 2023a; Lu et al., 2023; Liu et al., 2023; Alayrac et al., 2022; Hao et al., 2022; Yasunaga et al., 2022). For example, it is possible to generate a caption for an image by a captioning model and then concatenate the caption with the original language input to be fed into LLMs (Lu et al., 2022a). The development of large multimodal models such as GPT-4V (OpenAI, 2023) and Gemini (Reid et al., 2024) has notably enhanced the quality of generated captions, resulting in finer-grained and more detailed descriptions. However, the captioning process still incurs significant information loss when transforming vision signals into textual descriptions. Consequently, using image captions rather than vision features may suffer from a lack of mutual synergy in the representation space of different modalities. In addition, LLMs either have paywalls or resource-consuming to deploy locally.
|
| 49 |
+
|
| 50 |
+
To facilitate the interaction between modalities, another potential solution is to fine-tune smaller language models (LMs) by fusing multimodal features (Zhang et al., 2023c; Zhao et al., 2023). As this approach allows the flexibility of adjusting model architectures to incorporate multimodal features, we study fine-tuning models in this work instead of prompting LLMs. The key challenge is that language models under 100 billion parameters tend to generate hallucinated rationales that mislead the answer inference (Ho et al., 2022; Magister et al., 2022; Ji et al., 2022; Zhang et al., 2023b).
|
| 51 |
+
|
| 52 |
+
To mitigate the challenge of hallucination, we propose Multimodal-CoT that incorporates language (text) and vision (images) modalities into a two-stage framework that separates rationale generation and answer inference.2 In this way, answer inference can leverage better generated rationales that are based on multimodal information. Our experiments were conducted on the ScienceQA (Lu et al., 2022a) and A-OKVQA (Schwenk et al., 2022) datasets, which are the latest multimodal reasoning benchmarks with annotated reasoning chains.
|
| 53 |
+
|
| 54 |
+
Our method achieves state-of-the-art performance on the ScienceQA benchmark upon the release. We find that Multimodal-CoT is beneficial in mitigating hallucination and boosting convergence. Our contributions are summarized as follows:
|
| 55 |
+
|
| 56 |
+
(i) To the best of our knowledge, this work is the first to study CoT reasoning in different modalities in scientific peer-reviewed literature.
|
| 57 |
+
(ii) We propose a two-stage framework by fine-tuning language models to fuse vision and language representations to perform Multimodal-CoT. The model is able to generate informative rationales to facilitate inferring final answers.
|
| 58 |
+
(iii) We elicit the analysis of why the naive way of employing CoT fails in the context and how incorporating vision features alleviates the problem. The approach has been shown to be generally effective across tasks and backbone models.
|
| 59 |
+
|
| 60 |
+
Table 1: Representative CoT techniques (FT: fine-tuning; KD: knowledge distillation). Segment 1: in-context learning techniques; Segment 2: fine-tuning techniques. To the best of our knowledge, our work is the first to study CoT reasoning in different modalities in scientific peer-reviewed literature. Besides, we focus on 1B-models, without relying on the outputs of LLMs.
|
| 61 |
+
|
| 62 |
+
<table><tr><td>Models</td><td>Mutimodal Model /Engine Training CoT Role</td><td></td><td></td><td></td><td>CoT Source</td></tr><tr><td>Zero-Shot-CoT (Kojima et al., 2022)</td><td>X</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Template</td></tr><tr><td>Few-Shot-CoT (Wei et al., 2022b)</td><td></td><td>PaLM (540B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Self-Consistency-CoT (Wang et al., 2022b)</td><td>xx</td><td>Codex (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Least-to-Most Prompting (Zhou et al., 2022)</td><td>×</td><td>Codex (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Retrieval-CoT (Zhang et al., 2023d)</td><td>X</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Auto-generated</td></tr><tr><td>PromptPG-CoT (Lu et al., 2022b)</td><td>X</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Auto-CoT (Zhang et al., 2023d)</td><td>X</td><td>Codex (175B)</td><td>ICL</td><td>Reasoning</td><td>Auto-generated</td></tr><tr><td>Complexity-CoT (Fu et al., 2022)</td><td>×</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>Few-Shot-PoT (Chen et al., 2022)</td><td>×</td><td>GPT-3.5 (175B)</td><td>ICL</td><td>Reasoning</td><td>Hand-crafted</td></tr><tr><td>UnifiedQA (Lu et al., 2022a)</td><td>X</td><td>T5 (770M)</td><td>FT</td><td>Explanation</td><td>Crawled</td></tr><tr><td>Fine-Tuned T5 XXL (Magister et al., 2022)</td><td>X</td><td>T5 (11B)</td><td>KD</td><td>Reasoning</td><td>LLM-generated</td></tr><tr><td>Fine-Tune-CoT (Ho et al., 2022)</td><td>X</td><td>GPT-3 (6.7B)</td><td>KD</td><td>Reasoning</td><td>LLM-generated</td></tr><tr><td>Multimodal-CoT (our work)</td><td>√</td><td>T5 (770M)</td><td>FT</td><td>Reasoning</td><td>Crawled</td></tr></table>
|
| 63 |
+
|
| 64 |
+
# 2 Background
|
| 65 |
+
|
| 66 |
+
This section reviews studies eliciting CoT reasoning by prompting and fine-tuning language models.
|
| 67 |
+
|
| 68 |
+
# 2.1 CoT Reasoning with LLMs
|
| 69 |
+
|
| 70 |
+
Recently, CoT has been widely used to elicit the multi-step reasoning abilities of LLMs (Wei et al., 2022b). Concretely, CoT techniques encourage the LLM to generate intermediate reasoning chains for solving a problem. Studies have shown that LLMs can perform CoT reasoning with two major paradigms of techniques: Zero-Shot-CoT (Kojima et al., 2022) and Few-Shot-CoT (Wei et al., 2022b; Zhang et al., 2023d). For Zero-Shot-CoT, Kojima et al. (2022) showed that LLMs are decent zero-shot reasoners by adding a prompt like “Let’s think step by step” after the test question to invoke CoT reasoning. For Few-Shot-CoT, a few step-by-step reasoning demonstrations are used as conditions for inference. Each demonstration has a question and a reasoning chain that leads to the final answer. The demonstrations are commonly obtained by hand-crafting or automatic generation. These two techniques, hand-crafting and automatic generation are thus referred to as Manual-CoT (Wei et al., 2022b) and Auto-CoT (Zhang et al., 2023d).
|
| 71 |
+
|
| 72 |
+
With effective demonstrations, Few-Shot-CoT often achieves stronger performance than Zero-Shot-CoT and has attracted more research interest. Therefore, most recent studies focused on how to improve Few-Shot-CoT. Those studies are categorized into two major research lines: (i) optimizing the demonstrations; (ii) optimizing the reasoning chains. Table 1 compares typical CoT techniques.
|
| 73 |
+
|
| 74 |
+
Optimizing Demonstrations The performance of Few-Shot-CoT relies on the quality of demonstrations. As reported in Wei et al. (2022b), using demonstrations written by different annotators results in dramatic accuracy disparity in reasoning tasks. Beyond hand-crafting the demonstrations, recent studies have investigated ways to optimize the demonstration selection process. Notably, Rubin et al. (2022) retrieved the semantically similar demonstrations with the test instance. However, this approach shows a degraded performance when there are mistakes in the reasoning chains (Zhang et al., 2023d). To address the limitation, Zhang et al. (2023d) found that the key is the diversity of demonstration questions and proposed Auto-CoT: (i) partition questions of a given dataset into a few clusters; (ii) sample a representative question from each cluster and generate its reasoning chain using Zero-Shot-CoT with simple heuristics. In addition, reinforcement learning (RL) and complexity-based selection strategies were proposed to obtain effective demonstrations. Fu et al. (2022) chose examples with complex reasoning chains (i.e., with more reasoning steps) as the demonstrations. Lu et al. (2022b) trained an agent to find optimal in-context examples from a candidate pool and maximize the prediction rewards on given training examples when interacting with GPT-3.5.
|
| 75 |
+
|
| 76 |
+
Optimizing Reasoning Chains A notable way to optimize reasoning chains is problem decomposition. Zhou et al. (2022) proposed least-to-most prompting to decompose complex problems into sub-problems and then solve these sub-problems sequentially. As a result, solving a given sub-problem is facilitated by the answers to previously solved sub-problems. Similarly, Khot et al. (2022) used diverse decomposition structures and designed different prompts to answer each sub-question. In addition to prompting the reasoning chains as natural language texts, Chen et al. (2022) proposed program-of-thoughts (PoT), which modeled the reasoning process as a program and prompted LLMs to derive the answer by executing the generated programs. Another trend is to vote over multiple reasoning paths for a test question. Wang et al. (2022b) introduced a self-consistency decoding strategy to sample multiple outputs of LLMs and then took a majority over the final answers. Wang et al. (2022c) and Li et al. (2022c) introduced randomness in the input space to produce more diverse outputs for voting.
|
| 77 |
+
|
| 78 |
+
# 2.2 Eliciting CoT Reasoning by Fine-Tuning Models
|
| 79 |
+
|
| 80 |
+
A recent interest is eliciting CoT reasoning by fine-tuning language models. Lu et al. (2022a) fine-tuned the encoder-decoder T5 model on a large-scale dataset with CoT annotations. However, a dramatic performance decline is observed when using CoT to infer the answer, i.e., generating the reasoning chain before the answer (reasoning). Instead, CoT is only used as an explanation after the answer. Magister et al. (2022) and Ho et al. (2022) employed knowledge distillation by fine-tuning a student model on the chain-of-thought outputs generated by a larger teacher model. Wang et al. (2022a) proposed an iterative context-aware prompting approach to dynamically synthesize prompts conditioned on the current step’s contexts.
|
| 81 |
+
|
| 82 |
+
There is a key challenge in training 1B-models to be CoT reasoners. As observed by Wei et al. (2022b), models under 100 billion parameters tend to produce illogical CoT that leads to wrong answers. In other words, it might be harder for 1B-models to generate effective CoT than directly generating the answer. It becomes even more challenging in a multimodal setting where answering the question also requires understanding the multimodal inputs. In the following part, we will explore the challenge of Multimodal-CoT and investigate how to perform effective multi-step reasoning.
|
| 83 |
+
|
| 84 |
+
# 3 Challenge of Multimodal-CoT
|
| 85 |
+
|
| 86 |
+
Existing studies have suggested that the CoT reasoning ability may emerge in language models at a certain scale, e.g., over 100 billion parameters (Wei et al., 2022a). However, it remains an unresolved challenge to elicit such reasoning abilities in 1B-models, let alone in the multimodal scenario. This work focuses on 1B-models as they can be fine-tuned and deployed with consumer-grade GPUs (e.g., 32G memory). In this section, we will investigate why 1B-models fail at CoT reasoning and study how to design an effective approach to overcome the challenge.
|
| 87 |
+
|
| 88 |
+
# 3.1 Towards the Role of CoT
|
| 89 |
+
|
| 90 |
+
To begin with, we fine-tune a text-only baseline for CoT reasoning on the ScienceQA benchmark (Lu et al., 2022a). We adopt FLAN-AlpacaBase as the backbone language model.3 Our task is modeled as a text generation problem, where the model takes the textual information as the input and generates the output sequence that consists of the rationale and the answer.
|
| 91 |
+
|
| 92 |
+
As an example shown in Figure 1, the model takes the concatenation of tokens of the question text (Q), the context text (C), and multiple options (M) as the input. To study the effect of CoT, we compare the performance with three variants: (i) No-CoT which predicts the answer directly (QCM ${ } \mathrm { A }$ ); (ii) Reasoning where answer inference is conditioned to the rationale (QCM
|
| 93 |
+
|
| 94 |
+
Table 2: Effects of CoT in the one-stage setting.
|
| 95 |
+
|
| 96 |
+
<table><tr><td>Method</td><td>Format</td><td>Accuracy</td></tr><tr><td>No-CoT</td><td>QCM→A</td><td>81.63</td></tr><tr><td>Reasoning</td><td>QCM→RA</td><td>69.32</td></tr><tr><td>Explanation</td><td>QCM→AR</td><td>69.68</td></tr></table>
|
| 97 |
+
|
| 98 |
+
RA); (iii) Explanation where the rationale is used for explaining the answer inference (QCM AR).
|
| 99 |
+
|
| 100 |
+
# Problem
|
| 101 |
+
|
| 102 |
+
Question: Will these magnets attract or repel each other?
|
| 103 |
+
Context: Two magnets are placed as shown. Hint: Magnets that attract pull together. Magnets that repel push apart.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
|
| 107 |
+
Options: (A) attract
|
| 108 |
+
|
| 109 |
+
(B) repel
|
| 110 |
+
|
| 111 |
+
Gold Rationale: Will these magnets attract or repel? To find out, look at which poles are closest to each other. The north pole of one magnet is closest to the south pole of the other magnet. Poles that are different attract. So, these magnets will attract each other. Answer: The answer is (A).
|
| 112 |
+
|
| 113 |
+
# Baseline
|
| 114 |
+
|
| 115 |
+
# + Vision Features
|
| 116 |
+
|
| 117 |
+
Generated Rationale: Will these magnets attract or repel? To find out, look at which poles are closest to each other. The south pole of one magnet is closest to the south pole of the other magnet. Poles that are the same repel. So, these magnets will repel each other.
|
| 118 |
+
|
| 119 |
+
Answer: The answer is (B).
|
| 120 |
+
|
| 121 |
+
Generated Rationale: Will these magnets attract or repel? To find out, look at which poles are closest to each other. The north pole of one magnet is closest to the south pole of the other magnet. Poles that are different attract. So, these magnets will attract each other.
|
| 122 |
+
|
| 123 |
+
Answer: The answer is (A).
|
| 124 |
+
|
| 125 |
+
Figure 2: Example of the two-stage framework without vision features (baseline) and with vision features (ours) for generating rationales and predicting answers. The upper part presents the problem details with a gold rationale, and the lower part shows the outputs of the baseline and our method incorporated with vision features. We observe that the baseline fails to predict the right answer due to the misleading by hallucinated rationales. More examples are shown in Appendix A.1.
|
| 126 |
+
|
| 127 |
+
Surprisingly, as shown in Table 2, we observe a $\downarrow 1 2 . 3 1 \%$ accuracy decrease (81.63%→69.32 $\%$ ) if the model predicts rationales before answers (QCM RA). The results imply that the rationales might not necessarily contribute to predicting the right answer. According to Lu et al. (2022a), the plausible reason might be that the model exceeds the maximum token limits before obtaining the required answer or stops generating the prediction early. However, we find that the maximum length of the generated outputs (RA) is always less than 400 tokens, which is below the length limit of language models (i.e., 512 in T5 models). Therefore, it deserves a more in-depth investigation into why the rationales harm answer inference.
|
| 128 |
+
|
| 129 |
+
# 3.2 Misleading by Hallucinated Rationales
|
| 130 |
+
|
| 131 |
+
To dive into how the rationales affect the answer prediction, we separate the CoT problem into two stages, rationale generation and answer inference.4 We report the RougeL score and accuracy for the rationale generation and answer inference, respectively. Table 3 shows the results based on the two-stage framework. Although the two-stage baseline model achieves a 90.73 RougeL score of the rationale generation, the answer
|
| 132 |
+
|
| 133 |
+
Table 3: Two-stage setting of (i) rationale generation (RougeL) and (ii) answer inference (Accuracy).
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Method</td><td>(i) QCM→ R(ii) QCMR→A</td></tr><tr><td>Two-Stage Framework</td><td>90.73</td></tr><tr><td>w/ Captions</td><td>90.88</td></tr><tr><td>w/ Vision Features</td><td>93.46</td></tr></table>
|
| 136 |
+
|
| 137 |
+
inference accuracy is only $7 8 . 5 7 \%$ . Compared with the QCM→A variant $( 8 1 . 6 3 \%$ ) in Table 2, the result shows that the generated rationale in the two-stage framework does not improve answer accuracy.
|
| 138 |
+
|
| 139 |
+
Then, we randomly sample 50 error cases and find that the model tends to generate hallucinated rationales that mislead the answer inference. As an example shown in Figure 2, the model (left part) hallucinates that, “The south pole of one magnet is closest to the south pole of the other magnet”, due to the lack of reference to the vision content. We find that such mistakes occur at a ratio of $5 6 \%$ among the error cases (Figure 3(a)).
|
| 140 |
+
|
| 141 |
+
# 3.3 Multimodality Contributes to Effective Rationales
|
| 142 |
+
|
| 143 |
+
We speculate that such a phenomenon of hallucination is due to a lack of necessary vision contexts for performing effective Multimodal-CoT. To inject vision information, a simple way is to transform the image into a caption (Lu et al., 2022a) and then append the caption in the input of both stages.
|
| 144 |
+
|
| 145 |
+
However, as shown in Table 3, using captions only yields marginal performance gains (↑0.80%). Then, we explore an advanced technique by incorporating vision features into the language model. Concretely, we feed the image to the ViT model (Dosovitskiy et al., 2021b) to extract vision features. Then we fuse the vision features with the encoded language representations before feeding the decoder (more details will be presented in Section 4). Interestingly, with vision features, the RougeL score of the rationale generation has boosted to $9 3 . 4 6 \%$ (QCM R), which correspondingly contributes to better answer accuracy of 85.31% (QCMR A).
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 3: The ratio of (a) hallucination mistakes and (b) correction rate w/ vision features.
|
| 149 |
+
|
| 150 |
+
With those effective rationales, the phenomenon of hallucination is mitigated — $6 0 . 7 \%$ hallucination mistakes in Section 3.2 have been corrected (Figure 3(b)), as an example shown in Figure 2 (right part).5 The analysis so far compellingly shows that vision features are indeed beneficial for generating effective rationales and contributing to accurate answer inference. As the two-stage method achieves better performance than one-stage methods, we choose the two-stage method in our Multimodal-CoT framework.
|
| 151 |
+
|
| 152 |
+
# 4 Multimodal-CoT
|
| 153 |
+
|
| 154 |
+
In light of the discussions in Section 3, we propose Multimodal-CoT. The key motivation is the anticipation that the answer inference can leverage better generated rationales that are based on multimodal information. In this section, we will overview the procedure of the framework and elaborate on the technical design of the model architecture.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 4: Overview of our Multimodal-CoT framework. Multimodal-CoT consists of two stages: (i) rationale generation and (ii) answer inference. Both stages share the same model structure but differ in the input and output. In the first stage, we feed the model with language and vision inputs to generate rationales. In the second stage, we append the original language input with the rationale generated from the first stage. Then, we feed the updated language input with the original vision input to the model to infer the answer.
|
| 158 |
+
|
| 159 |
+
# 4.1 Framework Overview
|
| 160 |
+
|
| 161 |
+
Multimodal-CoT consists of two operation stages: (i) rationale generation and (ii) answer inference. Both stages share the same model structure but differ in the input $X$ and output $Y$ . The overall procedure is illustrated in Figure 4. We will take vision-language as an example to show how Multimodal-CoT works.
|
| 162 |
+
|
| 163 |
+
In the rationale generation stage, we feed the model with $X = \{ X _ { \mathrm { l a n g u a g e } } ^ { 1 } , X _ { \mathrm { v i s i o n } } \}$ where $X _ { \mathrm { l a n g u a g e } } ^ { \mathrm { 1 } }$ represents the language input in the first stage and $X _ { \mathrm { v i s i o n } }$ represents the vision input, i.e., the image. For example, $X$ can be instantiated as a concatenation of question, context, and options of a multiple choice reasoning problem (Lu et al., 2022a) as shown in Figure 4. The goal is to learn a rationale generation model $R = F ( X )$ where $R$ is the rationale.
|
| 164 |
+
|
| 165 |
+
In the answer inference stage, the rationathe language input in the second stage, $R$ iginal la where guage input denotes con $X _ { \mathrm { l a n g u a g e } } ^ { 1 }$ to constructn. Then, we pdated input . $X ^ { \prime } = \{ X _ { \mathrm { l a n g u a g e } } ^ { \mathrm { 2 } } , X _ { \mathrm { v i s i o n } } \}$ $X _ { \mathrm { l a n g u a g e } } ^ { \mathrm { 2 } } = X _ { \mathrm { l a n g u a g e } } ^ { \mathrm { 1 } } \circ R$ e = X1language to the answer inference model to infer the final answer catenatio $A = F ( X ^ { \prime } )$
|
| 166 |
+
|
| 167 |
+
In both stages, we train two models with the same architecture independently. They take the annotated elements (e.g., $X R$ , $X R A$ , respectively) from the training set for supervised learning. During inference, given $X$ , the rationales for the test sets are generated using the model trained in the first stage; they are used in the second stage for answer inference.
|
| 168 |
+
|
| 169 |
+
# 4.2 Model Architecture
|
| 170 |
+
|
| 171 |
+
Given language input of generating target t $X _ { \mathrm { l a n g u a g e } } \in \{ X _ { \mathrm { l a n g u a g e } } ^ { 1 } , X _ { \mathrm { l a n g u a g e } } ^ { 2 } \}$ and vision input answer in Figure $X _ { \mathrm { v i s i o n } }$ , we cength pute the probabilityby $Y$ $N$
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
p ( { \cal Y } | { \cal X } _ { \mathrm { l a n g u a g e } } , { \cal X } _ { \mathrm { v i s i o n } } ) = \prod _ { i = 1 } ^ { N } p _ { \theta } ( Y _ { i } \mid { \cal X } _ { \mathrm { l a n g u a g e } } , { \cal X } _ { \mathrm { v i s i o n } } , { \cal Y } _ { < i } ) ,
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
where $p _ { \theta } \left( Y _ { i } \mid X _ { \mathrm { l a n g u a g e } } , X _ { \mathrm { v i s i o n } } , Y _ { < i } \right)$ is implemented with a Transformer-based network (Vaswani et al., 2017). The network has three major procedures: encoding, interaction, and decoding. Specifically, we feed the language text into a Transformer encoder to obtain a textual representation, which is interacted and fused with the vision representation before being fed into the Transformer decoder.
|
| 178 |
+
|
| 179 |
+
Encoding The model $F ( X )$ takes both the language and vision inputs and obtains the text representation $H _ { \mathrm { l a n g u a g e } }$ and the image feature $H _ { \mathrm { v i s i o n } }$ by the following functions:
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\begin{array} { r l r } { H _ { \mathrm { l a n g u a g e } } } & { = } & { \mathrm { L a n g u a g e E n c o d e r } ( X _ { \mathrm { l a n g u a g e } } ) , } \\ { H _ { \mathrm { v i s i o n } } } & { = } & { W _ { h } \cdot \mathrm { V i s i o n E x t r a c t o r } ( X _ { \mathrm { v i s i o n } } ) , } \end{array}
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
where LanguageEncoder $( \cdot )$ is implemented as a Transformer model. We use the hidden states of the last layer in the Transformer encoder as the language representation $H _ { \mathrm { l a n g u a g e } } \in \mathbb { R } ^ { n \times d }$ where $n$ denotes the length of the language input, and $d$ is the hidden dimension. Meanwhile, VisionExtractor $( \cdot )$ is used to vectorize the input image into vision features. Inspired by the recent success of Vision Transformers (Dosovitskiy et al., 2021a), we fetch the patch-level features by frozen vision extraction models, such as ViT (Dosovitskiy et al., 2021b). After obtaining the patch-level vision features, we apply a learnable projection matrix $W _ { h }$ to convert the shape of VisionExtractor( $X _ { \mathrm { v i s i o n . } }$ ) into that of $H _ { \mathrm { l a n g u a g e } }$ ; thus we have $H _ { \mathrm { v i s i o n } } \in \mathbb { R } ^ { m \times d }$ where $m$ is the number of patches.
|
| 186 |
+
|
| 187 |
+
Note that our approach is general to both scenarios with or without image context. For the questions without associated images, we use all-zero vectors as the “blank features” with the same shape as the normal image features to tell the model to ignore them.
|
| 188 |
+
|
| 189 |
+
Interaction After obtaining language and vision representations, we use a single-head attention network to correlate text tokens with image patches, where the query ( $Q$ ), key ( $K$ ) and value ( $V$ ) are $H _ { \mathrm { l a n g u a g e } }$ , $H _ { \mathrm { v i s i o n } }$ and $H _ { \mathrm { v i s i o n } }$ , respectively. The attention output $H _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } \in \mathbb { R } ^ { n \times d }$ is defined as: $\begin{array} { r } { H _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } = \mathrm { S o f t m a x } ( \frac { Q K ^ { \top } } { \sqrt { d _ { k } } } ) V } \end{array}$ where $d _ { k }$ is the same as the dimension of $H _ { \mathrm { l a n g u a g e } }$ because a single head is used.
|
| 190 |
+
|
| 191 |
+
Then, we apply the gated fusion mechanism (Zhang et al., 2020; Wu et al., 2021; Li et al., 2022a) to fuse $H _ { \mathrm { l a n g u a g e } }$ and $H _ { \mathrm { v i s i o n } }$ . The fused output $H _ { \mathrm { f u s e } } \in \mathbb { R } ^ { n \times d }$ is obtained by:
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
\begin{array} { r c l } { { \lambda } } & { { = } } & { { \mathrm { S i g m o i d } ( W _ { l } H _ { \mathrm { l a n g u a g e } } + W _ { v } H _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } ) , } } \\ { { { \cal H } _ { \mathrm { f u s e } } } } & { { = } } & { { ( 1 - \lambda ) \cdot { \cal H } _ { \mathrm { l a n g u a g e } } + \lambda \cdot { \cal H } _ { \mathrm { v i s i o n } } ^ { \mathrm { a t t n } } , } } \end{array}
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
where $W _ { l }$ and $W _ { v }$ are learnable parameters.
|
| 198 |
+
|
| 199 |
+
Decoding Finally, the fused output $H _ { \mathrm { f u s e } }$ is fed into the Transformer decoder to predict the target $Y$ .
|
| 200 |
+
|
| 201 |
+
# 5 Experiments
|
| 202 |
+
|
| 203 |
+
This section will present the benchmark dataset, the implementation of our technique, and the baselines for comparisons. Then, we will report our main results and findings.
|
| 204 |
+
|
| 205 |
+
# 5.1 Dataset
|
| 206 |
+
|
| 207 |
+
Our method is evaluated on the ScienceQA (Lu et al., 2022a) and A-OKVQA (Schwenk et al., 2022) benchmark datasets. We choose those datasets because they are latest multimodal reasoning benchmarks with annotated reasoning chains. ScienceQA is a large-scale multimoda science question dataset with annotated lectures and explanations. It contains $2 1 k$ multimodal multiple choice questions with rich domain diversity across 3 subjects, 26 topics, 127 categories, and 379 skills. There are $1 2 k$ , $4 k$ , and $4 k$ questions in the training, validation, and test splits, respectively. A-OKVQA is a knowledge-based visual question answering benchmark, which has $2 5 k$ questions requiring a broad base of commonsense and world knowledge to answer. It has $1 7 k / 1 k / 6 k$ questions for train/val/test. As A-OKVQA provides multiple-choice and direct answer evaluation settings, we use the multiple-choice setting to keep consistency with ScienceQA.
|
| 208 |
+
|
| 209 |
+
# 5.2 Implementation
|
| 210 |
+
|
| 211 |
+
The following part presents the experimental settings of Multimodal-CoT and the baseline methods.
|
| 212 |
+
|
| 213 |
+
Experimental Settings We adopt the T5 encoder-decoder architecture (Raffel et al., 2020) under Base (200M) and large (700M) settings in our framework. We apply FLAN-Alpaca to initialize our model weights.6 We will show that Multimodal-CoT is generally effective with other backbone LMs, such as UnifiedQA (Khashabi et al., 2020) and FLAN-T5 (Chung et al., 2022) (Section 6.3). The vision features are obtained by the frozen ViT-large encoder (Dosovitskiy et al., 2021b). We fine-tune the models up to 20 epochs, with a learning rate of 5e-5. The maximum input sequence length is 512. The batch size is 8. Our experiments are run on 8 NVIDIA Tesla V100 32G GPUs. More details are presented in Appendix B.
|
| 214 |
+
|
| 215 |
+
Baseline Models We utilized three categories of methods as our baselines:
|
| 216 |
+
|
| 217 |
+
(i) Visual question answering (VQA) models, including MCAN (Yu et al., 2019), Top-Down (Anderson et al., 2018), BAN (Kim et al., 2018), DFAF (Gao et al., 2019), ViLT (Kim et al., 2021), Patch-TRM (Lu et al., 2021), and VisualBERT (Li et al., 2019). These VQA baselines take the question, context, and choices as textual input, while utilizing the image as visual input. They employ a linear classifier to predict the score distribution over the choice candidates.
|
| 218 |
+
|
| 219 |
+
(ii) LMs, including the text-to-text UnifiedQA model (Khashabi et al., 2020) and few-shot learning LLMs (GPT-3.5, ChatGPT, GPT-4, and Chameleon (Lu et al., 2023)). UnifiedQA (Khashabi et al., 2020) is adopted as it is the best fine-tuning model in Lu et al. (2022a). UnifiedQA takes the textual information as the input and outputs the answer choice. The image is converted into a caption extracted by an image captioning model following Lu et al. (2022a). UnifiedQA treats our task as a text generation problem. In Lu et al. (2022a), it is trained to generate a target answer text, i.e., one of the candidate options. Then, the most similar option is selected as the final prediction to evaluate the question answering accuracy. For GPT-3.5 models (Chen et al., 2020), we use the text-davinci-002 and text-davinci-003 engines due to their strong performance. In addition, we also include the comparison with ChatGPT and GPT-4. The inference is based on the few-shot prompting, where two in-context examples from the training set are concatenated before the test instance. The few-shot demonstrations are the same as those in Lu et al. (2022a).
|
| 220 |
+
|
| 221 |
+
(iii) Fine-tuned large vision-language model. We select the recently released LLaMA-Adapter (Zhang et al., 2023a), LLaVA (Liu et al., 2023), and InstructBLIP (Dai et al., 2023) as the competitive large vision-language baselines. For LLaMA-Adapter, the backbone model is the 7B LLaMA model fine-tuned with $5 2 k$ self-instruct demonstrations. To adapt to our tasks, the model is further fine-tuned on the ScienceQA dataset.
|
| 222 |
+
|
| 223 |
+
Table 4: Main results ( $\%$ ). Size $-$ backbone model size from the ScienceQA leaderboard (“-” means unavailable or unknown). Question classes: NAT $-$ natural science, SOC = social science, LAN = language science, TXT = text context, IMG = image context, NO = no context, G1- $6 =$ grades 1-6, G7-12 = grades 7-12. Segment 1: Human performance; Segment 2: VQA baselines; Segment 3: LM baselines, i.e., UnifiedQA and few-shot learning LLMs; Segment 4: Fine-tuned large vision-language models; Segment 5: Our Multimodal-CoT results. Prior published best results are marked with an underline. Our best average result is in bold face. † denotes concurrent studies, either through citation or comparison with Multimodal-CoT.
|
| 224 |
+
|
| 225 |
+
<table><tr><td>Model</td><td>Size</td><td>NAT</td><td>SOC</td><td>LAN</td><td>TXT</td><td>IMG</td><td>NO</td><td>G1-6</td><td>G7-12</td><td>Avg</td></tr><tr><td>Human</td><td></td><td>90.23</td><td>84.97</td><td>87.48</td><td>89.60</td><td>87.50</td><td>88.10</td><td>91.59</td><td>82.42</td><td>88.40</td></tr><tr><td>MCAN (Yu et al., 2019)</td><td>95M</td><td>56.08</td><td>46.23</td><td>58.09</td><td>59.43</td><td>51.17</td><td>55.40</td><td>51.65</td><td>59.72</td><td>54.54</td></tr><tr><td>Top-Down (Anderson et al., 2018)</td><td>70M</td><td>59.50</td><td>54.33</td><td>61.82</td><td>62.90</td><td>54.88</td><td>59.79</td><td>57.27</td><td>62.16</td><td>59.02</td></tr><tr><td>BAN (Kim et al., 2018)</td><td>112M</td><td>60.88</td><td>46.57</td><td>66.64</td><td>62.61</td><td>52.60</td><td>65.51</td><td>56.83</td><td>63.94</td><td>59.37</td></tr><tr><td>DFAF (Gao et al., 2019)</td><td>74M</td><td>64.03</td><td>48.82</td><td>63.55</td><td>65.88</td><td>54.49</td><td>64.11</td><td>57.12</td><td>67.17</td><td>60.72</td></tr><tr><td>ViLT (Kim et al., 2021)</td><td>113M</td><td>60.48</td><td>63.89</td><td>60.27</td><td>63.20</td><td>61.38</td><td>57.00</td><td>60.72</td><td>61.90</td><td>61.14</td></tr><tr><td>Patch-TRM (Lu et al., 2021)</td><td>90M</td><td>65.19</td><td>46.79</td><td>65.55</td><td>66.96</td><td>55.28</td><td>64.95</td><td>58.04</td><td>67.50</td><td>61.42</td></tr><tr><td>VisualBERT (Li et al., 2019)</td><td>111M</td><td>59.33</td><td>69.18</td><td>61.18</td><td>62.71</td><td>62.17</td><td>58.54</td><td>62.96</td><td>59.92</td><td>61.87</td></tr><tr><td>UnifiedQA (Lu et al., 2022a)</td><td>223M</td><td>71.00</td><td>76.04</td><td>78.91</td><td>66.42</td><td>66.53</td><td>81.81</td><td>77.06</td><td>68.82</td><td>74.11</td></tr><tr><td>GPT-3.5 (text-davinci-002) (Lu et al., 2022a)</td><td>173B</td><td>75.44</td><td>70.87</td><td>78.09</td><td>74.68</td><td>67.43</td><td>79.93</td><td>78.23</td><td>69.68</td><td>75.17</td></tr><tr><td>GPT-3.5 (text-davinci-003)</td><td>173B</td><td>77.71</td><td>68.73</td><td>80.18</td><td>75.12</td><td>67.92</td><td>81.81</td><td>80.58</td><td>69.08</td><td>76.47</td></tr><tr><td>ChatGPT (Lu et al., 2023)</td><td></td><td>78.82</td><td>70.98</td><td>83.18</td><td>77.37</td><td>67.92</td><td>86.13</td><td>80.72</td><td>74.03</td><td>78.31</td></tr><tr><td>GPT-4 (Lu et al., 2023)</td><td></td><td>85.48</td><td>72.44</td><td>90.27</td><td>82.65</td><td>71.49</td><td>92.89</td><td>86.66</td><td>79.04</td><td>83.99</td></tr><tr><td>Chameleon (ChatGPT) (Lu et al., 2023)t</td><td></td><td>81.62</td><td>70.64</td><td>84.00</td><td>79.77</td><td>70.80</td><td>86.62</td><td>81.86</td><td>76.53</td><td>79.93</td></tr><tr><td>Chameleon (GPT-4) (Lu et al., 2023)t</td><td></td><td>89.83</td><td>74.13</td><td>89.82</td><td>88.27</td><td>77.64</td><td>92.13</td><td>88.03</td><td>83.72</td><td>86.54</td></tr><tr><td>LLaMA-Adapter (Zhang et al., 2023a)†</td><td>6B</td><td>84.37</td><td>88.30</td><td>84.36</td><td>83.72</td><td>80.32</td><td>86.90</td><td>85.83</td><td>84.05</td><td>85.19</td></tr><tr><td>LLaVA (Liu et al., 2023)t</td><td>13B</td><td>90.36</td><td>95.95</td><td>88.00</td><td>89.49</td><td>88.00</td><td>90.66</td><td>90.93</td><td>90.90</td><td>90.92</td></tr><tr><td>InstructBLIP (Dai et al., 2023)t</td><td>11B</td><td>1</td><td>-</td><td>1</td><td>1</td><td>90.70</td><td>1</td><td>-</td><td></td><td></td></tr><tr><td>Mutimodal-CoTBase</td><td>223M</td><td>84.06</td><td>92.35</td><td>82.18</td><td>82.75</td><td>82.75</td><td>84.74</td><td>85.79</td><td>84.44</td><td>85.31</td></tr><tr><td>Mutimodal-CoTLarge</td><td>738M</td><td>91.03</td><td>93.70</td><td>86.64</td><td>90.13</td><td>88.25</td><td>89.48</td><td>91.12</td><td>89.26</td><td>90.45</td></tr></table>
|
| 226 |
+
|
| 227 |
+
# 5.3 Main Results
|
| 228 |
+
|
| 229 |
+
Table 4 shows the main results in the ScienceQA benchmark. We observe that Mutimodal-CoTLarge achieves substantial performance gains over the prior best model in publications $8 6 . 5 4 \% 9 0 . 4 5 \%$ ). The efficacy of Multimodal-CoT is further supported by the results obtained from the A-OKVQA benchmark in Table 5.
|
| 230 |
+
|
| 231 |
+
It is worth noting that Chameleon, LLaMA-Adapter, LLaVA, and InstructBLIP are concurrent works released several months after our work. In the subsequent Section 6.2, we will show that our method is orthogonal to those multimodal models (e.g., InstructBLIP) and can be potentially used with them together to improve generality further, i.e., scaled to scenarios where human-annotated rationales are unavailable, thereby establishing the effectiveness across diverse tasks.
|
| 232 |
+
|
| 233 |
+
Ablation study results in Table 6 show that both the
|
| 234 |
+
|
| 235 |
+
Table 5: Results on A-OKVQA. Baseline results are from (Chen et al., 2023) and Schwenk et al. (2022).
|
| 236 |
+
|
| 237 |
+
<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>BERT</td><td>32.93</td></tr><tr><td>GPT-3 (Curie)</td><td>35.07</td></tr><tr><td>IPVR (OPT-66B)</td><td>48.6</td></tr><tr><td>ViLBERT</td><td>49.1</td></tr><tr><td> Language-only Baseline</td><td>47.86</td></tr><tr><td>Multimodal-CoTBase</td><td>50.57</td></tr></table>
|
| 238 |
+
|
| 239 |
+
ntegration of vision features and the two-stage framework design contribute to the overall performance.
|
| 240 |
+
|
| 241 |
+
Furthermore, we find that Multimodal-CoT demonstrates the ability to mitigate hallucination (Section 3.3) and improve convergence (Section 6.1).
|
| 242 |
+
|
| 243 |
+
Table 6: Ablation results of Multimodal-CoT.
|
| 244 |
+
|
| 245 |
+
<table><tr><td>Model</td><td>Base</td><td>Large</td></tr><tr><td>Multimodal-CoT</td><td>85.31</td><td>90.45</td></tr><tr><td>w/o Two-Stage Framework</td><td>82.62</td><td>84.56</td></tr><tr><td>w/o Vision Features</td><td>78.57</td><td>83.97</td></tr></table>
|
| 246 |
+
|
| 247 |
+
# 6 Analysis
|
| 248 |
+
|
| 249 |
+
The following analysis will first show that Multimodal-CoT helps enhance convergence speed and has the feasibility of adaptation to scenarios without human-annotated rationales. Then, we investigate the general effectiveness of Multimodal-CoT with different backbone models and vision features. We will also conduct an error analysis to explore the limitations to inspire future studies. We use models under the base size for analysis unless otherwise stated.
|
| 250 |
+
|
| 251 |
+
# 6.1 Multimodality Boosts Convergence
|
| 252 |
+
|
| 253 |
+
Figure 5 shows the validation accuracy curve of the baseline and Multimodal-CoT across different training epochs. “One-stage” is based on the QCM A input-output format as it achieves the best performance in Table 2 and “Two-stage” is our two-stage framework. We find that the twostage methods achieve relatively higher accuracy at the beginning than the one-stage baselines that generate the answer directly without CoT. However, without the vision features, the twostage baseline could not yield better results as the training goes on due to low-quality rationales (as observed in Section 3). In contrast, using vision features helps generate more effective rationales that contribute to better answer accuracy in our two-stage multimodal variant.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 5: Accuracy curve of the No-CoT baseline and Multimodal-CoT variants.
|
| 257 |
+
|
| 258 |
+
# 6.2 When Multimodal-CoT Meets Large Models
|
| 259 |
+
|
| 260 |
+
A recent flame is to leverage large language models or large vision-language models to generate reasoning chains for multimodal question answering problems (Zhang et al., 2023a; Lu et al., 2023; Liu et al., 2023; Alayrac et al., 2022; Hao et al., 2022; Yasunaga et al., 2022). We are interested in whether we can use large models to generate the rationales for Multimodal-CoT; thus breaking the need for datasets with human-annotated rationales. During the first-stage training of Multimodal-CoT, our target rationales are based on human annotation in the benchmark datasets. Now, we replace the target rationales with those generated ones. As ScienceQA contains questions with images and without images, we leverage InstructBLIP and ChatGPT to generate the rationales for questions with paired images and questions without paired images, respectively.7 Then, we combine both of the generated pseudo-rationales as the target rationales for training (Multimodal-CoT w/ Generation) instead of relying on the human annotation of reasoning chains (Multimodal-CoT w/ Annotation).
|
| 261 |
+
|
| 262 |
+
Table 7 shows the comparison results. We see that using the generated rationales achieves comparable performance to using human-annotated rationales for training. In addition, the performance is also much better than directly prompting those baseline models to obtain the answer (in the QCM A inference format).
|
| 263 |
+
|
| 264 |
+
Table 7: Result comparison with large models. We also present the results of InstructBLIP and ChatGPT baselines for reference. The inference format for the two baselines is QCM A.
|
| 265 |
+
|
| 266 |
+
<table><tr><td>Model</td><td>IMG</td><td>TXT</td><td>AVG</td></tr><tr><td>InstructBLIP ChatGPT</td><td>60.50</td><td>1</td><td>1</td></tr><tr><td></td><td>56.52</td><td>67.16</td><td>65.95</td></tr><tr><td>Multimodal-CoT w/ Annotation</td><td>88.25</td><td>90.13</td><td>90.45</td></tr><tr><td>Multimodal-CoT w/ Generation</td><td>83.54</td><td>85.73</td><td>87.76</td></tr></table>
|
| 267 |
+
|
| 268 |
+
We see that Multimodal-CoT can work effectively with large models. The findings above compellingly show the feasibility of adaptation to scenarios without human-annotated rationales, thereby establishing the effectiveness of our approach across diverse tasks.
|
| 269 |
+
|
| 270 |
+
# 6.3 Effectiveness Across Backbones
|
| 271 |
+
|
| 272 |
+
To test the generality of the benefits of our approach to other backbone models, we alter the underlying LMs to other variants in different types. As shown in Table 8, our approach is generally effective for the widely used backbone models.
|
| 273 |
+
|
| 274 |
+
Table 8: Using different backbone LMs.
|
| 275 |
+
|
| 276 |
+
<table><tr><td colspan="2">Method Accuracy</td></tr><tr><td> Prior Best (Lu et al., 2022a)</td><td>75.17</td></tr><tr><td>MM-CoT on UnifiedQA</td><td>82.55</td></tr><tr><td> MM-CoT on FLAN-T5</td><td>83.19</td></tr><tr><td> MM-CoT on FLAN-Alpaca</td><td>85.31</td></tr></table>
|
| 277 |
+
|
| 278 |
+
Table 9: Using different vision features.
|
| 279 |
+
|
| 280 |
+
<table><tr><td>Feature</td><td>Feature Shape</td><td>Accuracy</td></tr><tr><td>ViT</td><td>(145,1024)</td><td>85.31</td></tr><tr><td>CLIP</td><td>(49,2048)</td><td>84.27</td></tr><tr><td>DETR</td><td>(100, 256)</td><td>83.16</td></tr><tr><td>ResNet</td><td>(512, 2048)</td><td>82.86</td></tr></table>
|
| 281 |
+
|
| 282 |
+
# 6.4 Using Different Vision Features
|
| 283 |
+
|
| 284 |
+
Different vision features may affect the model performance. We compare three widely-used types of vision features, ViT (Dosovitskiy et al., 2021b), CLIP (Radford et al., 2021), DETR (Carion et al., 2020), and ResNet (He et al., 2016). ViT, CLIP, and DETR are patch-like features. For the ResNet features, we repeat the pooled features of ResNet-50 to the same length with the text sequence to imitate the patch-like features, where each patch is the same as the pooled image features. More details of the vision features are presented in Appendix B.1.
|
| 285 |
+
|
| 286 |
+
Table 9 shows the comparative results of vision features. We observe that ViT achieves relatively better performance. Therefore, we use ViT by default in Multimodal-CoT.
|
| 287 |
+
|
| 288 |
+
# 6.5 Alignment Strategies for Multimodal Interaction
|
| 289 |
+
|
| 290 |
+
We are interested in whether using different alignment strategies for multimodal interaction may contribute to different behaviors of multimodal-CoT. To this end, we tried another alignment strategy, i.e., image-grounded text encoder, in BLIP Li et al. (2022b). This alignment approach injects visual information by inserting one additional cross-attention layer between the self-attention layer and the feed-forward network for each transformer block of the text encoder. Our current strategy in the paper is similar to the unimodal encoder as in BLIP, which is used for comparison. In Table 10, we see that using other alignment strategies also contributes to better performance than direct answering.
|
| 291 |
+
|
| 292 |
+
Table 10: Result comparison with different alignment strategies for multimodal interaction.
|
| 293 |
+
|
| 294 |
+
<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>Direct Answering</td><td>82.62</td></tr><tr><td>Unimodal encoder</td><td>85.31</td></tr><tr><td>Image-grounded text encoder</td><td>84.60</td></tr></table>
|
| 295 |
+
|
| 296 |
+
# 6.6 Generalization to Other Multimodal Reasoning Benchmarks
|
| 297 |
+
|
| 298 |
+
We are interested in evaluating the generalization capability of Multimodal-CoT to datasets outside its training domain. For this purpose, we utilize the widely-recognized multimodal reasoning benchmark, MMMU (Yue et al., 2024), and conduct an evaluation of Multimodal-CoT on MMMU without further training.
|
| 299 |
+
|
| 300 |
+
Table 11: Generalization performance on MMMU.
|
| 301 |
+
|
| 302 |
+
<table><tr><td>Model</td><td>Size</td><td>Accuracy</td></tr><tr><td>Kosmos-2 (Peng et al., 2024)</td><td>1.6B</td><td>24.4</td></tr><tr><td>Fuyu (Bavishi et al., 2024)</td><td>8B</td><td>27.9</td></tr><tr><td>OpenFlamingo-2 (Awadalla et al., 2023)</td><td>9B</td><td>28.7</td></tr><tr><td>MiniGPT4-Vicuna (Zhu et al., 2023)</td><td>13B</td><td>26.8</td></tr><tr><td>Multimodal-CoT</td><td>738M</td><td>28.7</td></tr><tr><td>GPT-4V(ision) (OpenAI, 2023)</td><td>=</td><td>56.8</td></tr><tr><td>Gemini Ultra (Reid et al., 2024)</td><td></td><td>59.4</td></tr></table>
|
| 303 |
+
|
| 304 |
+
As shown in Table 11, it is evident that Multimodal-CoT demonstrates effective generalization to MMMU, achieving better performance than various larger models around 8B.
|
| 305 |
+
|
| 306 |
+
# 6.7 Error Analysis
|
| 307 |
+
|
| 308 |
+
To gain deeper insights into the behavior of Multimodal-CoT and facilitate future research, we manually analyzed randomly selected examples generated by our approach. The categorization results are illustrated in Figure 6. We examined 50 samples that yielded incorrect answers and categorized them accordingly. The examples from each category can be found in Appendix D.
|
| 309 |
+
|
| 310 |
+
The most prevalent error type is commonsense mistakes, accounting for $8 0 \%$ of the errors. These mistakes occur when the model is faced with questions that require commonsense knowledge, such as interpreting maps, counting objects in images, or utilizing the alphabet. The second error type is logical mistakes, constituting $1 4 \%$ of the errors, which involve contradictions in the reasoning process. Additionally, we have observed cases where incorrect answers are provided despite the CoT being either empty or correct, amounting to 6% of the errors. The CoT in these cases may not necessarily influence the final answer.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 6: Categorization analysis.
|
| 314 |
+
|
| 315 |
+
The analysis reveals potential avenues for future research. Enhancements can be made to Multimodal-CoT by: (i) integrating more informative visual features and strengthening the interaction between language and vision to enable comprehension of maps and numerical counting; (ii) incorporating commonsense knowledge; and (iii) implementing a filtering mechanism, such as using only relevant CoTs to infer answers and disregarding irrelevant ones.
|
| 316 |
+
|
| 317 |
+
# 7 Conclusion
|
| 318 |
+
|
| 319 |
+
This paper formally studies the problem of multimodal CoT. We propose Multimodal-CoT that incorporates language and vision modalities into a two-stage framework that separates rationale generation and answer inference, so answer inference can leverage better generated rationales from multimodal information. With Multimodal-CoT, our model under 1 billion parameters achieves state-of-the-art performance on the ScienceQA benchmark. Analysis shows that Multimodal-CoT has the merits of mitigating hallucination and enhancing convergence speed. Our error analysis identifies the potential to leverage more effective vision features, inject commonsense knowledge, and apply filtering mechanisms to improve CoT reasoning in future studies.
|
| 320 |
+
|
| 321 |
+
# References
|
| 322 |
+
|
| 323 |
+
Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. Advances in Neural Information Processing Systems, 35:23716–23736, 2022.
|
| 324 |
+
Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 6077–6086. IEEE Computer Society, 2018. doi: 10.1109/CVPR.2018.00636.
|
| 325 |
+
Anas Awadalla, Irena Gao, Josh Gardner, Jack Hessel, Yusuf Hanafy, Wanrong Zhu, Kalyani Marathe, Yonatan Bitton, Samir Gadre, Shiori Sagawa, et al. Openflamingo: An open-source framework for training large autoregressive vision-language models. arXiv preprint arXiv:2308.01390, 2023.
|
| 326 |
+
Rohan Bavishi, Erich Elsen, Curtis Hawthorne, Maxwell Nye, Augustus Odena, Arushi Somani, and Sağnak Taşırlar. Fuyu-8b: A multimodal architecture for ai agents, 2024.
|
| 327 |
+
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. 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.
|
| 328 |
+
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part I, pp. 213–229, 2020.
|
| 329 |
+
Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey E. Hinton. Big self-supervised models are strong semi-supervised learners. 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.
|
| 330 |
+
Wenhu Chen, Xueguang Ma, Xinyi Wang, and William W Cohen. Program of thoughts prompting: Disentangling computation from reasoning for numerical reasoning tasks. ArXiv preprint, abs/2211.12588, 2022.
|
| 331 |
+
Zhenfang Chen, Qinhong Zhou, Yikang Shen, Yining Hong, Hao Zhang, and Chuang Gan. See, think, confirm: Interactive prompting between vision and language models for knowledge-based visual reasoning. ArXiv preprint, abs/2301.05226, 2023.
|
| 332 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts,
|
| 333 |
+
|
| 334 |
+
Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi,
|
| 335 |
+
|
| 336 |
+
Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben 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 Garcia, 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 Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. Palm: Scaling language modeling with pathways. ArXiv preprint, abs/2204.02311, 2022.
|
| 337 |
+
|
| 338 |
+
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, abs/2210.11416, 2022.
|
| 339 |
+
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, 2023.
|
| 340 |
+
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 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021a.
|
| 341 |
+
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 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021b.
|
| 342 |
+
Yao Fu, Hao Peng, Ashish Sabharwal, Peter Clark, and Tushar Khot. Complexity-based prompting for multi-step reasoning. ArXiv preprint, abs/2210.00720, 2022.
|
| 343 |
+
Peng Gao, Zhengkai Jiang, Haoxuan You, Pan Lu, Steven C. H. Hoi, Xiaogang Wang, and Hongsheng Li. Dynamic fusion with intra- and inter-modality attention flow for visual question answering. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 6639–6648. Computer Vision Foundation / IEEE, 2019. doi: 10.1109/CVPR.2019.00680.
|
| 344 |
+
Yaru Hao, Haoyu Song, Li Dong, Shaohan Huang, Zewen Chi, Wenhui Wang, Shuming Ma, and Furu Wei. Language models are general-purpose interfaces. ArXiv preprint, abs/2206.06336, 2022.
|
| 345 |
+
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. doi: 10.1109/CVPR.2016.90.
|
| 346 |
+
Namgyu Ho, Laura Schmid, and Se-Young Yun. Large language models are reasoning teachers. ArXiv preprint, abs/2212.10071, 2022.
|
| 347 |
+
Jie Huang and Kevin Chen-Chuan Chang. Towards reasoning in large language models: A survey. ArXiv preprint, abs/2212.10403, 2022.
|
| 348 |
+
Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Yejin Bang, Andrea Madotto, and Pascale Fung. Survey of hallucination in natural language generation. ACM Computing Surveys, 2022.
|
| 349 |
+
Daniel Khashabi, Sewon Min, Tushar Khot, Ashish Sabharwal, Oyvind Tafjord, Peter Clark, and Hannaneh Hajishirzi. UNIFIEDQA: Crossing format boundaries with a single QA system. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 1896–1907, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.171.
|
| 350 |
+
Tushar Khot, Harsh Trivedi, Matthew Finlayson, Yao Fu, Kyle Richardson, Peter Clark, and Ashish Sabharwal. Decomposed prompting: A modular approach for solving complex tasks. ArXiv preprint, abs/2210.02406, 2022.
|
| 351 |
+
Jin-Hwa Kim, Jaehyun Jun, and Byoung-Tak Zhang. Bilinear attention networks. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 1571–1581, 2018.
|
| 352 |
+
Wonjae Kim, Bokyung Son, and Ildoo Kim. Vilt: Vision-and-language transformer without convolution or region supervision. 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. 5583–5594. PMLR, 2021.
|
| 353 |
+
Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. ArXiv preprint, abs/2205.11916, 2022.
|
| 354 |
+
Bei Li, Chuanhao Lv, Zefan Zhou, Tao Zhou, Tong Xiao, Anxiang Ma, and JingBo Zhu. On vision features in multimodal machine translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 6327–6337, Dublin, Ireland, 2022a. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.438.
|
| 355 |
+
Junnan Li, Dongxu Li, Caiming Xiong, and Steven C. H. Hoi. BLIP: bootstrapping language-image pretraining for unified vision-language understanding and generation. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato (eds.), International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 12888–12900. PMLR, 2022b.
|
| 356 |
+
Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. Visualbert: A simple and performant baseline for vision and language. ArXiv preprint, abs/1908.03557, 2019.
|
| 357 |
+
Yifei Li, Zeqi Lin, Shizhuo Zhang, Qiang Fu, Bei Chen, Jian-Guang Lou, and Weizhu Chen. On the advance of making language models better reasoners. ArXiv preprint, abs/2206.02336, 2022c.
|
| 358 |
+
Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. ArXiv preprint, abs/2304.08485, 2023.
|
| 359 |
+
Pan Lu, Liang Qiu, Jiaqi Chen, Tony Xia, Yizhou Zhao, Wei Zhang, Zhou Yu, Xiaodan Liang, and Song-Chun Zhu. Iconqa: A new benchmark for abstract diagram understanding and visual language reasoning. In The 35th Conference on Neural Information Processing Systems (NeurIPS) Track on Datasets and Benchmarks, 2021.
|
| 360 |
+
Pan Lu, Swaroop Mishra, Tony Xia, Liang Qiu, Kai-Wei Chang, Song-Chun Zhu, Oyvind Tafjord, Peter Clark, and Ashwin Kalyan. Learn to explain: Multimodal reasoning via thought chains for science question answering. Advances in Neural Information Processing Systems, 35:2507–2521, 2022a.
|
| 361 |
+
Pan Lu, Liang Qiu, Kai-Wei Chang, Ying Nian Wu, Song-Chun Zhu, Tanmay Rajpurohit, Peter Clark, and Ashwin Kalyan. Dynamic prompt learning via policy gradient for semi-structured mathematical reasoning. ArXiv preprint, abs/2209.14610, 2022b.
|
| 362 |
+
Pan Lu, Liang Qiu, Wenhao Yu, Sean Welleck, and Kai-Wei Chang. A survey of deep learning for mathematical reasoning. ArXiv preprint, abs/2212.10535, 2022c.
|
| 363 |
+
Pan Lu, Baolin Peng, Hao Cheng, Michel Galley, Kai-Wei Chang, Ying Nian Wu, Song-Chun Zhu, and Jianfeng Gao. Chameleon: Plug-and-play compositional reasoning with large language models. In The Thirty-seventh Conference on Neural Information Processing Systems (NeurIPS 2023), 2023.
|
| 364 |
+
Lucie Charlotte Magister, Jonathan Mallinson, Jakub Adamek, Eric Malmi, and Aliaksei Severyn. Teaching small language models to reason. ArXiv preprint, abs/2212.08410, 2022.
|
| 365 |
+
|
| 366 |
+
OpenAI. Gpt-4v(ision) system card, 2023.
|
| 367 |
+
|
| 368 |
+
Zhiliang Peng, Wenhui Wang, Li Dong, Yaru Hao, Shaohan Huang, Shuming Ma, Qixiang Ye, and Furu Wei. Grounding multimodal large language models to the world. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=lLmqxkfSIw.
|
| 369 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. 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. 8748–8763. PMLR, 2021.
|
| 370 |
+
Jack W. Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, Eliza Rutherford, Tom Hennigan, Jacob Menick, Albin Cassirer, Richard Powell, George van den Driessche, Lisa Anne Hendricks, Maribeth Rauh, Po-Sen Huang, Amelia Glaese, Johannes Welbl, Sumanth Dathathri, Saffron Huang, Jonathan Uesato, John Mellor, Irina Higgins, Antonia Creswell, Nat McAleese, Amy Wu, Erich Elsen, Siddhant Jayakumar, Elena Buchatskaya, David Budden, Esme Sutherland, Karen Simonyan, Michela Paganini, Laurent Sifre, Lena Martens, Xiang Lorraine Li, Adhiguna Kuncoro, Aida Nematzadeh, Elena Gribovskaya, Domenic Donato, Angeliki Lazaridou, Arthur Mensch, Jean-Baptiste Lespiau, Maria Tsimpoukelli, Nikolai Grigorev, Doug Fritz, Thibault Sottiaux, Mantas Pajarskas, Toby Pohlen, Zhitao Gong, Daniel Toyama, Cyprien de Masson d’Autume, Yujia Li, Tayfun Terzi, Vladimir Mikulik, Igor Babuschkin, Aidan Clark, Diego de Las Casas, Aurelia Guy, Chris Jones, James Bradbury, Matthew Johnson, Blake Hechtman, Laura Weidinger, Iason Gabriel, William Isaac, Ed Lockhart, Simon Osindero, Laura Rimell, Chris Dyer, Oriol Vinyals, Kareem Ayoub, Jeff Stanway, Lorrayne Bennett, Demis Hassabis, Koray Kavukcuoglu, and Geoffrey Irving. Scaling language models: Methods, analysis & insights from training gopher. ArXiv preprint, abs/2112.11446, 2021.
|
| 371 |
+
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. J. Mach. Learn. Res., 21:140:1–140:67, 2020.
|
| 372 |
+
Machel Reid, Nikolay Savinov, Denis Teplyashin, Dmitry Lepikhin, Timothy Lillicrap, Jean-baptiste Alayrac, Radu Soricut, Angeliki Lazaridou, Orhan Firat, Julian Schrittwieser, et al. Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context. arXiv preprint arXiv:2403.05530, 2024.
|
| 373 |
+
Ohad Rubin, Jonathan Herzig, and Jonathan Berant. Learning to retrieve prompts for in-context learning. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 2655–2671, Seattle, United States, 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.naacl-main.191.
|
| 374 |
+
Dustin Schwenk, Apoorv Khandelwal, Christopher Clark, Kenneth Marino, and Roozbeh Mottaghi. A-okvqa: A benchmark for visual question answering using world knowledge. In Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part VIII, pp. 146–162. Springer, 2022.
|
| 375 |
+
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.
|
| 376 |
+
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, Vincent Zhao, Yanqi Zhou, Chung-Ching Chang, Igor Krivokon, Will Rusch, Marc Pickett, Pranesh Srinivasan, Laichee Man, Kathleen MeierHellstern, Meredith Ringel Morris, Tulsee Doshi, Renelito Delos Santos, Toju Duke, Johnny Soraker, Ben Zevenbergen, Vinodkumar Prabhakaran, Mark Diaz, Ben Hutchinson, Kristen Olson, Alejandra Molina,
|
| 377 |
+
|
| 378 |
+
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, abs/2201.08239, 2022.
|
| 379 |
+
|
| 380 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998–6008, 2017.
|
| 381 |
+
Boshi Wang, Xiang Deng, and Huan Sun. Iteratively prompt pre-trained language models for chain of thought. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 2714–2730, Abu Dhabi, United Arab Emirates, 2022a. Association for Computational Linguistics.
|
| 382 |
+
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. Self-consistency improves chain of thought reasoning in language models. ArXiv preprint, abs/2203.11171, 2022b.
|
| 383 |
+
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. Rationale-augmented ensembles in language models. ArXiv preprint, abs/2207.00747, 2022c.
|
| 384 |
+
Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, Ed H. Chi, Tatsunori Hashimoto, Oriol Vinyals, Percy Liang, Jeff Dean, and William Fedus. Emergent abilities of large language models. Transactions on Machine Learning Research, 2022a. Survey Certification.
|
| 385 |
+
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, abs/2201.11903, 2022b.
|
| 386 |
+
Zhiyong Wu, Lingpeng Kong, Wei Bi, Xiang Li, and Ben Kao. Good for misconceived reasons: An empirical revisiting on the need for visual context in multimodal machine translation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 6153–6166, Online, 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.480.
|
| 387 |
+
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. Proceedings of the 40th International Conference on Machine Learning, PMLR, pp. 39755–39769, 2022.
|
| 388 |
+
Zhou Yu, Jun Yu, Yuhao Cui, Dacheng Tao, and Qi Tian. Deep modular co-attention networks for visual question answering. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 6281–6290. Computer Vision Foundation / IEEE, 2019. doi: 10.1109/CVPR.2019.00644.
|
| 389 |
+
Xiang Yue, Yuansheng Ni, Kai Zhang, Tianyu Zheng, Ruoqi Liu, Ge Zhang, Samuel Stevens, Dongfu Jiang, Weiming Ren, Yuxuan Sun, Cong Wei, Botao Yu, Ruibin Yuan, Renliang Sun, Ming Yin, Boyuan Zheng, Zhenzhu Yang, Yibo Liu, Wenhao Huang, Huan Sun, Yu Su, and Wenhu Chen. Mmmu: A massive multi-discipline multimodal understanding and reasoning benchmark for expert agi. In Proceedings of CVPR, 2024.
|
| 390 |
+
Renrui Zhang, Jiaming Han, Aojun Zhou, Xiangfei Hu, Shilin Yan, Pan Lu, Hongsheng Li, Peng Gao, and Yu Qiao. Llama-adapter: Efficient fine-tuning of language models with zero-init attention. ArXiv preprint, abs/2303.16199, 2023a.
|
| 391 |
+
Yue Zhang, Yafu Li, Leyang Cui, Deng Cai, Lemao Liu, Tingchen Fu, Xinting Huang, Enbo Zhao, Yu Zhang, Yulong Chen, et al. Siren’s song in the ai ocean: A survey on hallucination in large language models. arXiv preprint arXiv:2309.01219, 2023b.
|
| 392 |
+
Zhuosheng Zhang, Kehai Chen, Rui Wang, Masao Utiyama, Eiichiro Sumita, Zuchao Li, and Hai Zhao. Neural machine translation with universal visual representation. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 393 |
+
Zhuosheng Zhang, Kehai Chen, Rui Wang, Masao Utiyama, Eiichiro Sumita, Zuchao Li, and Hai Zhao. Universal multimodal representation for language understanding. IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 1–18, 2023c. doi: 10.1109/TPAMI.2023.3234170.
|
| 394 |
+
Zhuosheng Zhang, Aston Zhang, Mu Li, and Alex Smola. Automatic chain of thought prompting in large language models. In The Eleventh International Conference on Learning Representations, 2023d.
|
| 395 |
+
Haozhe Zhao, Zefan Cai, Shuzheng Si, Xiaojian Ma, Kaikai An, Liang Chen, Zixuan Liu, Sheng Wang, Wenjuan Han, and Baobao Chang. Mmicl: Empowering vision-language model with multi-modal in-context learning. arXiv preprint arXiv:2309.07915, 2023.
|
| 396 |
+
Denny Zhou, Nathanael Schärli, Le Hou, Jason Wei, Nathan Scales, Xuezhi Wang, Dale Schuurmans, Olivier Bousquet, Quoc Le, and Ed Chi. Least-to-most prompting enables complex reasoning in large language models. ArXiv preprint, abs/2205.10625, 2022.
|
| 397 |
+
Deyao Zhu, Jun Chen, Xiaoqian Shen, Xiang Li, and Mohamed Elhoseiny. Minigpt-4: Enhancing visionlanguage understanding with advanced large language models. In The Twelfth International Conference on Learning Representations, 2023.
|
| 398 |
+
|
| 399 |
+
# A Extended Analysis for the Challenge of Multimodal-CoT
|
| 400 |
+
|
| 401 |
+
# A.1 Additional Examples of Misleading through Hallucinated Rationales
|
| 402 |
+
|
| 403 |
+
Based on our case studies (Section 3.2), we have observed a tendency for the baseline model to generate hallucinated rationales. Here, we present additional examples to illustrate this phenomenon, as depicted in Figure 7.
|
| 404 |
+
|
| 405 |
+
# Problem
|
| 406 |
+
|
| 407 |
+
Question: Which solution has a higher concentration of yellow particles? Context: The diagram below is a model of two solutions. Each yellow ball represents one particle of solute.
|
| 408 |
+
|
| 409 |
+
Options: (A) Solution B (B) Solution A
|
| 410 |
+
|
| 411 |
+
(C) neither; their concentrations are the same
|
| 412 |
+
|
| 413 |
+
Gold Rationale: In Solution A and Solution B, the yellow particles represent the solute. To figure out which solution has a higher concentration of yellow particles, look at both the number of yellow particles and the volume of the solvent in each container. Use the concentration formula to find the number of yellow particles per milliliter. Solution B has more yellow particles per milliliter. So, Solution B has a higher concentration of yellow particles.
|
| 414 |
+
|
| 415 |
+
Answer: The answer is (A).
|
| 416 |
+
|
| 417 |
+

|
| 418 |
+
|
| 419 |
+
# Baseline
|
| 420 |
+
|
| 421 |
+
Rationale: In Solution A and Solution B, the yellow particles represent the solute. To figure out which solution has a higher concentration of yellow particles, look at both the number of yellow particles and the volume of the solvent in each container. Use the concentration formula to find the number of yellow particles per milliliter. Solution A has more yellow particles per milliliter. So, Solution A has a higher concentration of yellow particles.
|
| 422 |
+
|
| 423 |
+
Answer: The answer is (B).
|
| 424 |
+
|
| 425 |
+
# $^ +$ Vision Features
|
| 426 |
+
|
| 427 |
+
Rationale: In Solution A and Solution B, the yellow particles represent the solute. To figure out which solution has a higher concentration of yellow particles, look at both the number of yellow particles and the volume of the solvent in each container. Use the concentration formula to find the number of yellow particles per milliliter. Solution B has more yellow particles per milliliter. So, Solution B has a higher concentration of yellow particles.
|
| 428 |
+
|
| 429 |
+
Answer: The answer is (A).
|
| 430 |
+
|
| 431 |
+
# Problem
|
| 432 |
+
|
| 433 |
+
Question: Think about the magnetic force between the magnets in each pair. Which of the following statements is true?
|
| 434 |
+
|
| 435 |
+
Context: The images below show two pairs of magnets. The magnets in different pairs do not affect each other. All the magnets shown are made of the same material.
|
| 436 |
+
|
| 437 |
+
<table><tr><td rowspan="3" colspan="2">nS:</td></tr><tr><td>(A)The magnitude of the magnetic force is smaller in Pair 2. (B) The magnitude of the magnetic force is smaller in Pair 1.</td></tr><tr><td>(C) The magnitude of the magnetic force is the same in both pairs.</td></tr></table>
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
|
| 441 |
+
Gold Rationale: The magnets in Pair 1 attract. The magnets in Pair 2 repel. But whether the magnets attract or repel affects only the direction of the magnetic force. It does not affect the magnitude of the magnetic force. Both magnet sizes and distance affect the magnitude of the magnetic force. The sizes of the magnets in Pair 1 are the same as in Pair 2. The distance between the magnets is also the same. So, the magnitude of the magnetic force is the same in both pairs.
|
| 442 |
+
|
| 443 |
+
Answer: The answer is (C).
|
| 444 |
+
|
| 445 |
+
# Baseline
|
| 446 |
+
|
| 447 |
+
Rationale: Distance affects the magnitude of the magnetic force. When there is a greater distance between magnets, the magnitude of the magnetic force between them is smaller. There is a greater distance between the magnets in Pair 2 than in Pair 1. So, the magnitude of the magnetic force is smaller in Pair 2 than in Pair 1.
|
| 448 |
+
|
| 449 |
+
Answer: The answer is (B).
|
| 450 |
+
|
| 451 |
+
# $^ +$ Vision Features
|
| 452 |
+
|
| 453 |
+
Rationale: The magnets in Pair 1 attract. The magnets in Pair 2 repel. But whether the magnets attract or repel affects only the direction of the magnetic force. It does not affect the magnitude of the magnetic force. Both magnet sizes and distance affect the magnitude of the magnetic force. The sizes of the magnets in Pair 1 are the same as in Pair 2. The distance between the magnets is also the same. So, the magnitude of the magnetic force is the same in both pairs. Answer: The answer is (C).
|
| 454 |
+
|
| 455 |
+
Figure 7: Examples of the two-stage framework without vision features (baseline) and with vision features (ours) for generating rationales and predicting answers. The upper part presents the problem details, and the lower part shows the outputs of the baseline and our method.
|
| 456 |
+
|
| 457 |
+
# A.2 Two-Stage Training Performance with Different Sizes of LMs
|
| 458 |
+
|
| 459 |
+
In Section 3, we observed that the inclusion of vision features has a positive impact on the generation of more effective rationales, consequently resulting in improved answer accuracy. In addition to incorporating vision features, another approach to addressing the issue of incorrect rationales is to scale the size of the language model (LM). Figure 8 showcases the answer accuracy achieved by our two-stage training framework, both with and without the integration of vision features. Notably, when employing a larger LM, the baseline accuracy (without vision features) experiences a significant enhancement. This finding suggests that scaling the LM size could potentially alleviate the problem of incorrect rationales. However, it is crucial to acknowledge that the performance still falls considerably short of utilizing vision features. This outcome further validates the effectiveness of our Multimodal-CoT methodology across varying LM sizes.
|
| 460 |
+
|
| 461 |
+

|
| 462 |
+
Figure 8: Answer accuracy with different sizes of LMs.
|
| 463 |
+
|
| 464 |
+
# A.3 Discussion of the Possible Paradigms to Achieve Multimodal-CoT
|
| 465 |
+
|
| 466 |
+
As discussed in Section 1, there are two primary approaches to facilitate Multimodal-CoT reasoning: (i) prompting LLMs and (ii) fine-tuning small models. The common approach in the first approach is to unify the input from different modalities and prompt LLMs to perform reasoning (Zhang et al., 2023a; Lu et al., 2023; Liu et al., 2023; Alayrac et al., 2022; Hao et al., 2022; Yasunaga et al., 2022). For instance, one way to achieve this is by extracting the caption of an image using a captioning model and then concatenating the caption with the original language input to feed LLMs. By doing so, visual information is conveyed to LLMs as text, effectively bridging the gap between modalities. This approach can be represented as the input-output format $<$ <image $\longrightarrow$ caption, question $^ +$ caption $\longrightarrow$ answer $>$ . We refer to this approach as Caption-based Reasoning (Figure 9a). It is worth noting that the effectiveness of this approach depends on the quality of the image caption, which may be susceptible to errors introduced during the transfer from image captioning to answer inference.
|
| 467 |
+
|
| 468 |
+
In contrast, an intriguing aspect of CoT is the ability to decompose complex problems into a series of simpler problems and solve them step by step. This transformation leads to a modification of the standard format <question answer $>$ into <question $\longrightarrow$ rationale answer>. Rationales, being more likely to reflect the reasoning processes leading to the answer, play a crucial role in this paradigm. Consequently, we refer to approaches following this paradigm as CoT-based Reasoning. The nomenclature has been widely adopted in the literature (Huang & Chang, 2022; Zhang et al., 2023d; Lu et al., 2022c).
|
| 469 |
+
|
| 470 |
+
Our work aligns with the paradigms of CoT-based Reasoning in the context of multimodal scenarios, specifically employing the <question $^ +$ image rationale answer $>$ framework (Figure 9b). This approach confers advantages on two fronts. Firstly, the Multimodal-CoT framework leverages feature-level interactions between vision and language inputs, enabling the model to gain a deeper understanding of the input information and facilitating more effective inference of answers by incorporating well-founded rationales. Our analysis has demonstrated that Multimodal-CoT offers notable benefits by mitigating hallucination and enhancing convergence, resulting in superior performance on our benchmark datasets. Secondly, the lightweight nature of Multimodal-CoT renders it compatible with resource constraints and circumvents any potential paywalls.
|
| 471 |
+
|
| 472 |
+

|
| 473 |
+
Figure 9: Paradigms to achieve Multimodal-CoT.
|
| 474 |
+
|
| 475 |
+
# B Experimental Details
|
| 476 |
+
|
| 477 |
+
# B.1 Details of Vision Features
|
| 478 |
+
|
| 479 |
+
In Section 6.2, we compared four types of vision features, ViT (Dosovitskiy et al., 2021b), CLIP (Radford et al., 2021), DETR (Carion et al., 2020), and ResNet (He et al., 2016). The specific models are: (i) ViT: vit_large_patch32_384,8 (ii) CLIP: RN101;9 (iii) DETR: detr_resnet101_dc5 ; $^ { 1 0 }$ (iv) ResNet: we use the averaged pooled features of a pre-trained ResNet50 CNN.
|
| 480 |
+
|
| 481 |
+
Table 12 presents the dimension of the vision features (after the function VisionExtractor $( \cdot )$ in Eq. 3). For ResNet-50, we repeat the pooled features of ResNet-50 to the same length as the text sequence to imitate the patch-like features, where each patch is the same as the pooled image features.
|
| 482 |
+
|
| 483 |
+
Table 12: Feature shape of vision features
|
| 484 |
+
|
| 485 |
+
<table><tr><td>Method</td><td>Feature Shape</td></tr><tr><td>ViT</td><td>(145, 1024)</td></tr><tr><td>CLIP</td><td>(49,2048)</td></tr><tr><td>DETR</td><td>(100, 256)</td></tr><tr><td>ResNet</td><td>(512, 2048)</td></tr></table>
|
| 486 |
+
|
| 487 |
+
# B.2 Datasets
|
| 488 |
+
|
| 489 |
+
Our method is evaluated on the ScienceQA (Lu et al., 2022a) and A-OKVQA (Schwenk et al., 2022) benchmark datasets.
|
| 490 |
+
|
| 491 |
+
$\bullet$ ScienceQA is a large-scale multimodal science question dataset with annotated lectures and explanations. It contains $2 1 k$ multimodal multiple choice questions with rich domain diversity across 3 subjects, 26 topics, 127 categories, and 379 skills. The dataset is split into training, validation, and test splits with $1 2 k$ , $4 k$ , and $4 k$ questions, respectively.
|
| 492 |
+
|
| 493 |
+
$\bullet$ A-OKVQA is a knowledge-based visual question answering benchmark, which has $2 5 k$ questions requiring a broad base of commonsense and world knowledge to answer. Each question is annotated with rationales that explain why a particular answer was correct according to necessary facts or knowledge. It has $1 7 k / 1 k / 6 k$ questions for train/val/test.
|
| 494 |
+
|
| 495 |
+
For ScienceQA, our model is evaluated on the test set. For A-OKVQA, our model is evaluated on the validation set as the test set is hidden.
|
| 496 |
+
|
| 497 |
+
# B.3 Implementation Details of Multimodal-CoT
|
| 498 |
+
|
| 499 |
+
As the Multimodal-CoT task requires generating the reasoning chains and leveraging the vision features, we adopt the T5 encoder-decoder architecture (Raffel et al., 2020) under Base (200M) and large (700M) settings in our framework. We apply FLAN-Alpaca to initialize our model weights.11 We will show that Multimodal-CoT is generally effective with other backbone LMs, such as UnifiedQA (Khashabi et al., 2020) and FLAN-T5 (Chung et al., 2022) (Section 6.1). The vision features are obtained by the frozen ViT-large encoder (Dosovitskiy et al., 2021b). Since using image captions can slightly improve model performance, as shown in Section 3.3, we append the image captions to the context following Lu et al. (2022a). The captions are generated by InstructBLIP (Dai et al., 2023). We fine-tune the models up to 20 epochs, with a learning rate selected in {5e-5, 8e-5}. The maximum input sequence lengths for rationale generation and answer inference are 512 and 64, respectively. The batch size is 8. Our experiments are run on 8 NVIDIA Tesla V100 32G GPUs.
|
| 500 |
+
|
| 501 |
+
# C Further Analysis
|
| 502 |
+
|
| 503 |
+
# C.1 Examples of Rationale Generation with Large Models
|
| 504 |
+
|
| 505 |
+
A recent flame is to leverage large language models or large vision-language models to generate reasoning chains for multimodal question answering problems (Zhang et al., 2023a; Lu et al., 2023; Liu et al., 2023; Alayrac et al., 2022; Hao et al., 2022; Yasunaga et al., 2022). We are interested in whether we can use large models to generate the rationales for Multimodal-CoT; thus breaking the need for datasets with human-annotated rationales. During the first-stage training of Multimodal-CoT, our target rationales are based on human annotation in the benchmark datasets. Now, we replace the target rationales with those generated by an LLM or a vision-language model. Concretely, we feed the questions with images (IMG) and the question without images (TXT) to InstructBLIP (Dai et al., 2023) (Figure 10a) and ChatGPT (Figure 10b) for zero-shot inference, respectively. Then, we use the generated pseudo-rationales as the target rationales for training instead of relying on the human annotation of reasoning chains.
|
| 506 |
+
|
| 507 |
+
(a) Rationale generated by InstructBLIP (b) Rationale generated by ChatGPT
|
| 508 |
+
|
| 509 |
+

|
| 510 |
+
Figure 10: Rationale generation examples.
|
| 511 |
+
|
| 512 |
+
# C.2 Detailed Results of Multimodal-CoT on Different Backbone Models
|
| 513 |
+
|
| 514 |
+
To test the generality of the benefits of our approach to other backbone models, we alter the underlying LMs to other variants of different types. As detailed results shown in Table 13, our approach is generally effective for the widely used backbone models.
|
| 515 |
+
|
| 516 |
+
Table 13: Detailed results of Multimodal-CoT on different backbone models.
|
| 517 |
+
|
| 518 |
+
<table><tr><td>Model</td><td>NAT</td><td>SOC</td><td>LAN</td><td>TXT</td><td>IMG</td><td>NO</td><td>G1-6</td><td>G7-12</td><td>Avg</td></tr><tr><td>MM-CoT on UnifiedQA</td><td>80.60</td><td>89.43</td><td>81.00</td><td>80.50</td><td>80.61</td><td>81.74</td><td>82.38</td><td>82.86</td><td>82.55</td></tr><tr><td> MM-CoT on FLAN-T5</td><td>81.39</td><td>90.89</td><td>80.64</td><td>80.79</td><td>80.47</td><td>82.58</td><td>83.48</td><td>82.66</td><td>83.19</td></tr><tr><td> MM-CoT on FLAN-Alpaca</td><td>84.06</td><td>92.35</td><td>82.18</td><td>82.75</td><td>82.75</td><td>84.74</td><td>85.79</td><td>84.44</td><td>85.31</td></tr></table>
|
| 519 |
+
|
| 520 |
+
# D Examples of Case Studies
|
| 521 |
+
|
| 522 |
+
To gain deeper insights into the behavior of Multimodal-CoT and facilitate future research, we manually analyzed randomly selected examples generated by our approach. The categorization results are illustrated in Figure 11. We examined 50 samples that yielded incorrect answers and categorized them accordingly.
|
| 523 |
+
|
| 524 |
+

|
| 525 |
+
Figure 11: Categorization analysis.
|
| 526 |
+
|
| 527 |
+
The most prevalent error type is commonsense mistakes, accounting for 80% of the errors. These mistakes occur when the model is faced with questions that require commonsense knowledge, such as interpreting maps (Figure 12a), counting objects in images (Figure 12b), or utilizing the alphabet (Figure 12c).
|
| 528 |
+
|
| 529 |
+
The second error type is logical mistakes, constituting 14% of the errors, which involve comparison mistakes (Figure 13a) and contradictions in the reasoning process (Figure 13b).
|
| 530 |
+
|
| 531 |
+
Additionally, we have observed cases where incorrect answers are provided despite the CoT being either empty or correct, amounting to 6% of the errors. The CoT in these cases may not necessarily influence the final answer (Figure 14).
|
| 532 |
+
|
| 533 |
+
The analysis reveals potential avenues for future research. Enhancements can be made to Multimodal-CoT by: (i) integrating more informative visual features and strengthening the interaction between language and vision to enable comprehension of maps and numerical counting; (ii) incorporating commonsense knowledge; and (iii) implementing a filtering mechanism, such as using only relevant CoTs to infer answers and disregarding irrelevant ones.
|
| 534 |
+
|
| 535 |
+
# Problem
|
| 536 |
+
|
| 537 |
+
Question: Which of these cities is marked on the map?
|
| 538 |
+
|
| 539 |
+
Context: N/A
|
| 540 |
+
|
| 541 |
+
<table><tr><td>Options:</td><td>(A) Las Vegas</td></tr></table>
|
| 542 |
+
|
| 543 |
+
(B) San Francisco
|
| 544 |
+
|
| 545 |
+
(C) Phoenix
|
| 546 |
+
|
| 547 |
+
(D) Salt Lake City
|
| 548 |
+
|
| 549 |
+
Rationale : The city is Las Vegas, Nevada. Salt Lake City, Phoenix, and San Francisco are marked with gray circles on the map below.
|
| 550 |
+
|
| 551 |
+
Answer: The answer is (A).
|
| 552 |
+
|
| 553 |
+

|
| 554 |
+
|
| 555 |
+
# Prediction
|
| 556 |
+
|
| 557 |
+
Rationale: The city is San Francisco, California. Salt Lake City, Las Vegas, and Phoenix are marked with gray circles on the map below.
|
| 558 |
+
Answer: The answer is (B).
|
| 559 |
+
|
| 560 |
+
(a) Mistakes about maps.
|
| 561 |
+
|
| 562 |
+
# Problem
|
| 563 |
+
|
| 564 |
+
Question: Complete the text to describe the diagram. Solute particles moved in both directions across the permeable membrane. But more solute particles moved across the membrane (). When there was an equal concentration on both sides, the particles reached equilibrium.
|
| 565 |
+
|
| 566 |
+
Context: The diagram below shows a solution with one solute. Each solute particle is represented by a green ball. The solution fills a closed container that is divided in half by a membrane. The membrane, represented by a dotted line, is permeable to the solute particles. The diagram shows how the solution can change over time during the process of diffusion.
|
| 567 |
+
|
| 568 |
+
Options: (A) to the left than to the right (B) to the right than to the left
|
| 569 |
+
|
| 570 |
+
Rationale : (extract) It shows you how the solution changed during the process of diffusion. Before the solute particles reached equilibrium, there were 3 solute particles on the left side of the membrane and 5 solute particles on the right side of the membrane. When the solute particles reached equilibrium, there were 4 solute particles on each side of the membrane. There was 1 more solute particle on the left side of the membrane than before. So, for the solute particles to reach equilibrium, more solute particles must have moved across the membrane to the left than to the right.
|
| 571 |
+
|
| 572 |
+
Answer: The answer is (A).
|
| 573 |
+
|
| 574 |
+
# Prediction
|
| 575 |
+
|
| 576 |
+
Rationale: (extract) It shows you how the solution changed during the process of diffusion. Before the solute particles reached equilibrium, there were 5 solute particles on the left side of the membrane and 4 solute particles on the right side of the membrane. When the solute particles reached equilibrium, there were 5 solute particles on each side of the membrane. There was 1 more solute particle on the right side of the membrane than before. So, for the solute particles to reach equilibrium, more solute particles must have moved across the membrane to the right than to the right. Answer: The answer is (B).
|
| 577 |
+
|
| 578 |
+
(b) Mistakes about counting numbers in the image.
|
| 579 |
+
|
| 580 |
+
# Problem
|
| 581 |
+
|
| 582 |
+

|
| 583 |
+
Figure 12: Examples of commonsense mistakes.
|
| 584 |
+
|
| 585 |
+
Question: Which word would you find on a dictionary page with the following guide words? helping - hunter Context: The diagram below shows a solution with one solute. Each solute particle is represented by a green ball. The solution fills a closed container that is divided in half by a membrane. The membrane, represented by a dotted line, is permeable to the solute particles. The diagram shows how the solution can change over time during the process of diffusion.
|
| 586 |
+
|
| 587 |
+

|
| 588 |
+
|
| 589 |
+
(B) hardship
|
| 590 |
+
|
| 591 |
+
Rationale : Put the words in alphabetical order. Since hospital is between the guide words helping - hunter, it would be found on that page.
|
| 592 |
+
Answer: The answer is (A).
|
| 593 |
+
|
| 594 |
+
# Prediction
|
| 595 |
+
|
| 596 |
+
Rationale: Put the words in alphabetical order. Since hardship is between the guide words helping - hunter, it would be found on that page.
|
| 597 |
+
Answer: The answer is (B).
|
| 598 |
+
|
| 599 |
+
(c) Mistakes about utilizing alphabet.
|
| 600 |
+
|
| 601 |
+
# Problem
|
| 602 |
+
|
| 603 |
+
Question: Compare the motion of two cars. Which car was moving at a lower speed?
|
| 604 |
+
|
| 605 |
+
Vision N/A
|
| 606 |
+
|
| 607 |
+
Options: (A) a car that moved 445miles in 10hours
|
| 608 |
+
|
| 609 |
+
(B) a car that moved 170miles in 10hours
|
| 610 |
+
|
| 611 |
+
Rationale : Look at the distance each car moved and the time it took to move that distance. One car moved 170 miles in 10 hours. The other car moved 445 miles in 10 hours. Notice that each car spent the same amount of time moving. The car that moved 170 miles moved a shorter distance in that time. So, that car must have moved at a lower speed.
|
| 612 |
+
|
| 613 |
+
Answer: The answer is (B).
|
| 614 |
+
|
| 615 |
+
# Prediction
|
| 616 |
+
|
| 617 |
+
Rationale: Look at the distance each car moved and the time it took to move that distance. One car moved 445 miles in 10 hours. The other car moved 170 miles in 10 hours. Notice that each car spent the same amount of time moving. The car that moved 445 miles moved a shorter distance in that time. So, that car must have moved at a lower speed.
|
| 618 |
+
|
| 619 |
+
Answer: The answer is (A).
|
| 620 |
+
|
| 621 |
+
(a) Logical mistake where the model fails at comparisons.
|
| 622 |
+
|
| 623 |
+
# Problem
|
| 624 |
+
|
| 625 |
+
Question: Based on this information, what is Sage's phenotype for the coat color trait? Context: In a group of horses, some individuals have a black coat and others have a reddish-brown coat. In this group, the gene for the coat color trait has two alleles. The allele for a reddish-brown coat (l) is recessive to the allele for a black coat (L). Sage is a horse from this group. Sage has the homozygous genotype ll for the coat color gene.
|
| 626 |
+
|
| 627 |
+

|
| 628 |
+
|
| 629 |
+
Options: (A) a black coat (B) a reddish-brown coat
|
| 630 |
+
|
| 631 |
+
Rationale : Sage's genotype for the coat color gene is ll. Sage's genotype of ll has only l alleles. The l allele is for a reddish-brown coat. So, Sage's phenotype for the coat color trait must be a reddish-brown coat. To check this answer, consider whether Sage's alleles are dominant or recessive.
|
| 632 |
+
The allele for a reddish-brown coat (l) is recessive to the allele for a black coat (L). This means L is a dominant allele, and l is a recessive allele.
|
| 633 |
+
Sage's genotype of ll has only recessive alleles. An organism with only recessive alleles for a gene will have the recessive allele's version of the trait.
|
| 634 |
+
So, Sage's phenotype for the coat color trait must be a reddish-brown coat.
|
| 635 |
+
|
| 636 |
+
Answer: The answer is (B).
|
| 637 |
+
|
| 638 |
+
# Prediction
|
| 639 |
+
|
| 640 |
+
Rationale: Sage's genotype for the coat color gene is ll. Sage's genotype of ll has only l alleles. The l allele is for a reddish-brown coat. So, Sage's phenotype for the coat color trait must be a reddish-brown coat. To check this answer, consider whether Sage's alleles are dominant or recessive.
|
| 641 |
+
The allele for a reddish-brown coat (l) is recessive to the allele for a black coat (L). This means L is a dominant allele, and l is a recessive allele.
|
| 642 |
+
Sage's genotype of ll has only recessive alleles. An organism with only recessive alleles for a gene will have the recessive allele's version of the trait.
|
| 643 |
+
So, Sage's phenotype for the coat color trait must be a black coat.
|
| 644 |
+
|
| 645 |
+
Answer: The answer is (A).
|
| 646 |
+
|
| 647 |
+
(b) Logical mistake where the there is a contradiction in the rationale.
|
| 648 |
+
|
| 649 |
+
# Problem
|
| 650 |
+
|
| 651 |
+
Question: Which trait did Palaeopython have? Select the trait you can observe on the fossil.
|
| 652 |
+
|
| 653 |
+
Context: This picture shows a fossil of an ancient animal called Palaeopython. Palaeopython lived in trees and could grow more than six feet long.
|
| 654 |
+
|
| 655 |
+

|
| 656 |
+
Figure 13: Examples of logical mistakes.
|
| 657 |
+
|
| 658 |
+
Options: (A) black stripes on its skin (B) large fins on its body (C) a long, thin body
|
| 659 |
+
|
| 660 |
+
Rationale : The way an organism looks or acts is called a trait. Scientists use fossils to learn more about the traits of ancient organisms. Fossils can preserve the remains of body parts and activities. A fossil of a body part, such as a tail or a wing, can tell you what an organism looked like. A fossil of an organism's activities, such as a burrow or a footprint, can tell you about the organism's behavior. Here are three examples of fossils and the traits that you can observe from them: This is a fossil of an animal. This fossil tells you that the animal had a spiral-shaped shell. This is a fossil of a plant. This fossil tells you that the plant had small leaves arranged in a branched pattern. This is a fossil of an animal's footprint. This fossil tells you that the animal could walk on land. An organism's fossil may not show all of the organism's traits. This is because most body parts are destroyed during fossil formation. When an organism's body turns into a fossil, only a few body parts are usually preserved.
|
| 661 |
+
|
| 662 |
+
Answer: The answer is (C).
|
| 663 |
+
|
| 664 |
+
# Prediction
|
| 665 |
+
|
| 666 |
+
Rationale : The way an organism looks or acts is called a trait. Scientists use fossils to learn more about the traits of ancient organisms. Fossils can preserve the remains of body parts and activities. A fossil of a body part, such as a tail or a wing, can tell you what an organism looked like. A fossil of an organism's activities, such as a burrow or a footprint, can tell you about the organism's behavior. Here are three examples of fossils and the traits that you can observe from them: This is a fossil of an animal. This fossil tells you that the animal had a spiral-shaped shell. This is a fossil of a plant. This fossil tells you that the plant had small leaves arranged in a branched pattern. This is a fossil of an animal's footprint. This fossil tells you that the animal could walk on land. An organism's fossil may not show all of the organism's traits. This is because most body parts are destroyed during fossil formation. When an organism's body turns into a fossil, only a few body parts are usually preserved.
|
| 667 |
+
|
| 668 |
+
Answer: The answer is (B).
|
| 669 |
+
|
| 670 |
+
Figure 14: Examples of answers are incorrect while the CoT is correct.
|
md/test/yzfi15eVI7/yzfi15eVI7.md
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IHYPERTIME: INTERPRETABLE TIME SERIES GENERATION WITH IMPLICIT NEURAL REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Implicit neural representations (INRs) have emerged as a powerful tool that provides an accurate and resolution-independent encoding of data. Their robustness as general approximators has been shown across diverse data modalities, such as images, video, audio, and 3D scenes. However, little attention has been given to leveraging these architectures for time series data. Addressing this gap, we propose an approach for time series generation based on two novel architectures: TSNet, an INR network for interpretable trend-seasonality time series representation, and iHyperTime, a hypernetwork architecture that leverages TSNet for time series generalization and synthesis. Through evaluations of fidelity and usefulness metrics, we demonstrate that iHyperTime outperforms current state-of-the-art methods in challenging scenarios that involve long or irregularly sampled time series, while performing on par on regularly sampled data. Furthermore, we showcase iHyperTime fast training speed, comparable to the fastest existing methods for short sequences and significantly superior for longer ones. Finally, we empirically validate the quality of the model’s unsupervised trend-seasonality decomposition by comparing against the well-established STL method.
|
| 8 |
+
|
| 9 |
+
Code available at: https://anonymous.4open.science/r/iHyperTime-8186/README.md
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Modeling time series data has been a key topic of research for many years, constituting a crucial component in a wide variety of areas such as climate modeling, medicine, biology, retail and finance (Lim & Zohren, 2021). Traditional methods for time series modeling have relied on parametric models informed by expert knowledge. However, the development of modern machine learning methods has provided purely data-driven techniques to learn temporal relationships. In particular, neural network-based methods have gained popularity in recent times, with applications to a wide range of tasks, such as time series classification (Ismail Fawaz et al., 2020), clustering (Alqahtani et al., 2021), segmentation (Zeng et al., 2022), anomaly detection (Choi et al., 2021), upsampling (Oh et al., 2020), imputation (Cao et al., 2018), forecasting (Torres et al., 2021) and generation (Coletta et al., 2023). In particular, generation of synthetic time series has recently gained attention due to the large number of applications in medical and financial fields, where data cannot be shared, either due to privacy reasons or proprietary restrictions (Jordon et al., 2021; Assefa et al., 2020). Moreover, synthetic time series can be used to augment training datasets to improve model generalization on downstream tasks, such as classification (Fons et al., 2021), forecasting and anomaly detection. In these fields, having a disentangled representation of time series can be critical for applications with regulatory focus, which often require transparency and interpretability of proposed machine learning solutions as well as injection of expert knowledge as constraints into the training process (Vyetrenko & Xu, 2019).
|
| 14 |
+
|
| 15 |
+
The task of generating realistic time-series data poses considerable challenges, particularly due to the diverse nature of time series, which may vary along dimensions such as univariate vs. multivariate, short vs. long, and regularly vs. irregularly sampled. Although numerous solutions have been proposed to address the problem of time-series data generation (Alaa et al., 2021; Yoon et al., 2019; Esteban et al., 2017), the focus has predominantly been on generating data for well-structured scenarios, such as short and regularly sampled time series. Such an approach is often conflicting with the complexities of real-world time-series data, where irregularities, missing values and diverse sequence lengths are commonplace (Fang & Wang, 2020). Recent methods have addressed some of these shortcomings (Jeon et al., 2022; Zhou et al., 2023; Coletta et al., 2023). However, no single approach has shown a consistent performance across all these challenging scenarios. Furthermore, the scalability of many existing methods to longer sequences is constrained by escalating computational costs that correlate with series length.
|
| 16 |
+
|
| 17 |
+
In recent years, implicit neural representations (INRs) have gained popularity as an accurate and flexible method to parameterize signals from diverse sources, such as images, video, audio and 3D scene data (Sitzmann et al., 2020b; Mildenhall et al., 2020). Conventional methods for data encoding often rely on discrete representations, such as data grids, which are limited by their spatial resolution and present inherent discretization artifacts. In contrast, INRs encode data in terms of continuous functional relationships between signals, and thus are uncoupled to spatial resolution. In practical terms, INRs provide a data representation framework that is resolution-independent, which makes them ideally suited to deal with the aforementioned challenges in real-world time series. While there have been a few recent works exploring the application of INRs to time series data (Jeong & Shin, 2022; Woo et al., 2023), there is no work on leveraging these architectures for generating synthetic time series.
|
| 18 |
+
|
| 19 |
+
In this paper, we propose a novel method for time series generation based on two novel architectures: 1) TSNet, an INR tailored for resolution-agnostic encoding of time series data, offering a trendseasonality-residual disentangling of single time series. 2) iHyperTime, a hypernetwork architecture for generalization of time series datasets, that leverages TSNet to produce interpretable latent representations of the signals. Together, these architectures form a unified approach for disentangled representation and generation of multiple forms of time series data, including challenging cases such as multivariate, irregularly sampled, and long time series.
|
| 20 |
+
|
| 21 |
+
Generation quality Through empirical evaluations, we demonstrate that iHyperTime outperforms existing state-of-the-art methods for time series generation. Our method excels in complex scenarios such as irregularly sampled or long sequences, while performing on par with state-of-the-art for regularly sampled time series.
|
| 22 |
+
|
| 23 |
+
Efficiency We show that our architecture achieves rapid training speeds, comparable to the fastest methods for short sequences, and substantially faster for longer ones.
|
| 24 |
+
|
| 25 |
+
TSR Decomposition We validate the unsupervised decomposition capabilities of our method by benchmarking it against the widely-used STL decomposition technique.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Implicit Neural Representations Implicit Neural Representations (INRs) provide a continuous representation of multidimensional data, by encoding a functional relationship between input coordinates and signal values, avoiding possible discretization artifacts. They have recently gained popularity in visual computing (Mescheder et al., 2019; Mildenhall et al., 2020) due to the key development of positional encodings (Tancik et al., 2020) and SIREN periodic activations (Sitzmann et al., 2020b), which have proven to be critical for the learning of high-frequency details. Whilst INRs have been shown to produce accurate reconstructions in a wide variety of data sources, such as video, images and audio (Sitzmann et al., 2020b; Chen et al., 2021; Rott Shaham et al., 2021), few works have leveraged them for time series representation (Jeong & Shin, 2022; Woo et al., 2023), and none have focused on interpretability and generation.
|
| 30 |
+
|
| 31 |
+
Hypernetworks Hypernetworks are neural network architectures that are trained to predict the parameters of secondary networks, referred to as hyponetworks (Ha et al., 2017; Sitzmann et al., 2020a). In the last few years, some works have leveraged different hypernetwork architectures for the prediction of INR weights, in order to learn priors over image data (Skorokhodov et al., 2021) and 3D scene data (Littwin & Wolf, 2019; Sitzmann et al., 2019; Sztrajman et al., 2021). Sitzmann et al. (2020b) leverage a set encoder and a hypernetwork decoder to learn a prior over SIRENs encoding image data, and apply it for image in-painting.
|
| 32 |
+
|
| 33 |
+
Time Series Generation Synthesis of time series data using deep generative models has been previously studied in the literature. Examples include the TimeGAN architecture (Yoon et al., 2019), GT-GAN (Jeon et al., 2022), and QuantGAN (Wiese et al., 2020). More recently, as an alternative to GAN-based time series generation, Desai et al. (2021) proposed TimeVAE, based on a variational autoencoder, while Coletta et al. (2023) proposed a diffusion model architecture called DiffTime. Alaa et al. (2021) introduced Fourier Flows, a normalizing flow model for time series data that leverages the frequency domain representation, which is currently considered together with TimeGAN as state-of-the-art for time series generation. In the last few years, multiple methods have used INRs for data generation, with applications on image synthesis (Skorokhodov et al., 2021), super-resolution (Chen et al., 2021) and panorama synthesis (Anokhin et al., 2021). However, there are currently no applications of INRs on the generation of time series data.
|
| 34 |
+
|
| 35 |
+
Interpretable Time Series Seasonal-trend decomposition is a standard tool in time series analysis. The trend encapsulates the slow time-varying behavior of the signal, while seasonal components capture periodicity. These techniques introduce interpretability in time series, which plays an important role in downstream tasks such as forecasting and anomaly detection. The classic approaches for decomposition are the widely used STL algorithm (Cleveland et al., 1990), and its variants (Wen et al., 2019; Bandara et al., 2022). Relevant to this work is the recent N-BEATS architecture (Oreshkin et al., 2020), a deep learning-based model for univariate time series forecasting that provides interpretability capabilities. The model explicitly encodes seasonal-trend decomposition into the network by defining separate trend and seasonal blocks, which fit a low degree polynomial and a Fourier series.
|
| 36 |
+
|
| 37 |
+
# 3 FORMULATION
|
| 38 |
+
|
| 39 |
+
In this Section, we describe the TSNet network architecture for time series representation and TSR decomposition, and the iHyperTime network leveraged for generalization and new data generation.
|
| 40 |
+
|
| 41 |
+
# 3.1 TIME SERIES REPRESENTATION
|
| 42 |
+
|
| 43 |
+
We consider a time series signal encoded by a discrete sequence of $N$ observations $\mathbf { y } = ( \mathbf { y } _ { 1 } , . . . , \mathbf { y } _ { N } )$ where $\mathbf { y } _ { i } \in \mathbb { R } ^ { m }$ is the $m$ -dimensional observation at time $t _ { i }$ . This time series defines a dataset $\boldsymbol { \mathcal { D } } = \{ ( t _ { i } , \mathbf { y } _ { i } ) \} _ { i = 1 } ^ { N }$ of time coordinates $t _ { i }$ associated with observations $\mathbf { y } _ { i }$ . We want to find a continuous mapping $f : \mathbb { R } \to \mathbb { R } ^ { m } , t \to f ( t )$ that parameterizes the discrete time series, so that $\mathbf { y } _ { i } = f ( t _ { i } )$ for $i = 1 , \ldots , N$ . The function $f$ can be approximated by an implicit neural representation (INR) architecture conditioned on the training loss $\begin{array} { r } { \mathcal { L } = \sum _ { i } \Vert \mathbf { y } _ { i } - \hat { f } ( t _ { i } ) \Vert ^ { 2 } } \end{array}$ . Input and output of the INR are of dimensions 1 and $m$ , corresponding to the time coordinate $t$ and the prediction ${ \hat { f } } ( t )$ . After training, the network encodes a continuous representation of the functional relationship $f ( t )$ for a single time series.
|
| 44 |
+
|
| 45 |
+
# 3.1.1 TSNET
|
| 46 |
+
|
| 47 |
+
We propose an interpretable architecture to encode time series that reuses the described INR. In particular, we assume that our INR follows a classic time series additive decomposition, i.e.,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
f ( t ) = f _ { T } ( t ) + f _ { S } ( t ) + f _ { R } ( t ) ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $f _ { T }$ , $f _ { s }$ , $f _ { R }$ correspond to the trend, seasonality and residual components of $f ( t )$ . Note that this is a standard assumption for time series decomposition techniques, such as STL and others (Cleveland et al., 1990). We elaborate on our modeling of these three components in the following.
|
| 54 |
+
|
| 55 |
+
Trend and Seasonality Blocks Following the work by Oreshkin et al. (2020), we model trend and seasonality via basis decompositions with coefficients learned by fully-connected networks. The trend component of a time series aims to model slow-varying (and occasionally monotonic) behavior, thus we consider a polynomial regressor, i.e.,
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
f _ { T } \mathopen { } \mathclose \bgroup \left( t \aftergroup \egroup \right) = \sum _ { p = 0 } ^ { P } \mathbf { w } _ { p } ^ { ( T ) } t ^ { p } ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $P$ denotes the degree of the polynomial, and $\mathbf { w } _ { p } ^ { ( T ) }$ denotes the learned weight associated with the pth degree. In practice, $P$ is chosen to be small (e.g., $P = 2$ ) to capture low frequency behavior.
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
Figure 1: iHyperTime architecture. The Set Encoder processes a set of tuples $\{ ( t _ { i } , \mathbf { y } _ { i } ) \} _ { i = 1 } ^ { N }$ representing a time series, and encodes it as embeddings $Z _ { T }$ , $Z _ { S }$ , $Z _ { R }$ associated to the components of the TSR decomposition. The hypernetwork decoders learn to predict the weights of their corresponding TSNet blocks from the embeddings. During training, the output of the hypernetworks is used to instantiate a TSNet hyponetwork, and the loss is computed as a difference between y and the output of TSNet ${ \hat { f } } ( t )$ , in terms of signal and spectral distribution.
|
| 65 |
+
|
| 66 |
+
The seasonal component of the time series $f _ { s } ( t )$ aims to capture the periodic behavior of the signal, and thus we leverage a learnable Fourier decomposition:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
f _ { s } ( t ) = \sum _ { i = 0 } ^ { N / 2 - 1 } \left( \mathbf { w } _ { i } ^ { ( s ) } \cos \left( 2 \pi i t \right) + \mathbf { w } _ { N / 2 + i } ^ { ( s ) } \sin \left( 2 \pi i t \right) \right)
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
$\mathbf { w } _ { i } ^ { ( s ) }$ are the weights predicted by the network.
|
| 73 |
+
|
| 74 |
+
Residual Block The residual of a time series comprises the high-frequency non-periodic components of the signal. In order to model it, we leverage a fully-connected network of $K$ layers with sine activations (SIREN), as defined by Sitzmann et al. (2020b):
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r l } & { \mathbf q _ { k + 1 } = \sin \left( \omega _ { 0 } \mathbf w _ { k } ^ { ( R ) } \mathbf q _ { k } + \mathbf b _ { k } ^ { ( R ) } \right) , \qquad k = 0 , . . . , K - 1 } \\ & { f _ { R } ( t ) = \mathbf w _ { K } ^ { ( R ) } \mathbf q _ { K } + \mathbf b _ { K } ^ { ( R ) } } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\mathbf { w } _ { k } ^ { ( R ) }$ , $\mathbf { b } _ { k } ^ { ( R ) }$ and $\mathbf { q } _ { k }$ are the weights, biases, and outputs of the $k$ layer, with ${ \bf q } _ { 0 } = t$ corresponding to the input of the network. A general factor $\omega _ { 0 }$ multiplying the network weights determines the order of magnitude of the frequencies that will be used to encode the signal. As shown by Sitzmann et al. (2020b), SIRENs mitigate the spectral bias of regular fully-connected networks, and thus are well suited for learning and representation of high-frequencies. We refer to Appendix D.2 for the TSNet model implementation details.
|
| 81 |
+
|
| 82 |
+
# 3.2 TIME SERIES GENERATION WITH IHYPERTIME
|
| 83 |
+
|
| 84 |
+
In Fig. 1, we show a diagram of our iHyperTime architecture, which can be used to learn a prior over implicit neural representations (TSNet) of time series data. Next, we will detail its components and describe how iHyperTime can be used for time series generation. Additional details on the model implementation can be found in Appendix D.2.
|
| 85 |
+
|
| 86 |
+
Set Encoder The set encoder is composed of SIREN layers (Sitzmann et al., 2020b) and takes as input an arbitrary set of tuples $\{ ( t _ { i } , \mathbf { y } _ { i } ) \} _ { i = 1 } ^ { N }$ , where $t$ denotes the time-coordinate and $\mathbf { y } _ { i }$ the corresponding univariate or multivariate time series value. Each tuple is encoded into a fixed-size embedding $Z _ { i } = g ( t _ { i } , \mathbf { y } _ { i } )$ , and the sample set is reduced to a single embedding $Z$ by applying a symmetric operation $\bigoplus$ (e.g., averaging): $Z = \textstyle \bigoplus _ { i = 1 } ^ { N } Z _ { i }$ , where the function $g : \mathbb { R } \times \mathbb { R } ^ { m } \to \mathbb { R } ^ { d z }$ , used to determine the embedding of each tuple, is parameterized by the SIREN layers (model details in Appendix D.2). The use of a set encoder introduces permutation invariance in the computation, and provides a high degree of flexibility in terms of the input (Zaheer et al., 2017), enabling the encoding of data with missing values or irregular sampling, which are common occurrences in time series.
|
| 87 |
+
|
| 88 |
+
Hypernetwork decoders The embedding $Z$ is modeled as a concatenation of three sub-embeddings $Z _ { T }$ , $Z _ { S }$ , and $Z _ { R }$ with $Z _ { T } \in \mathbb { R } ^ { d _ { T } }$ denoting the trend embedding, $Z _ { S } \in \mathbb { R } ^ { d _ { S } }$ denoting the seasonality embedding, and $Z _ { R } \in \mathbb { R } ^ { d _ { R } }$ denoting the residual embedding with $d _ { Z } = d _ { T } + d _ { S } + d _ { R }$ . Each embedding component is pass through its own hypernetwork decoder, which outputs the weights of its corresponding block in the TSNet INR. For example, $Z _ { T }$ is passed into the Trend Hypernetwork to output the weights of the trend block in TSNet. The output of TSNet sums the three signals from each block into a single predicted time series, which is compared against the ground truth signal via the reconstruction and spectral losses ( $\mathcal { L } _ { R e c }$ and $\mathcal { L } _ { F F T }$ ) during training.
|
| 89 |
+
|
| 90 |
+
iHyperTime training During training, we use the weights predicted by the hypernetwork decoders to instantiate a TSNet hyponetwork and evaluate it on the input time-coordinate $t$ , to produce the predicted time series value ${ \hat { f } } ( t )$ . We then compare the TSNet hyponetwork prediction with the ground truth signal via the reconstruction and spectral losses $\mathcal { L } _ { R e c }$ and $\mathcal { L } _ { F F T }$ .
|
| 91 |
+
|
| 92 |
+
The training of iHyperTime is performed in three stages, in order to improve stability: 1) we train the Trend networks (Trend hypernetwork, Trend block) for 100 epochs, computing the MSE loss between the ground truth time series $\mathbf { y }$ and the output of the block: $\begin{array} { r } { \mathcal { L } _ { 1 } = \sum _ { i } \Vert \mathbf { y } _ { i } - \hat { f } _ { T } ( t _ { i } ) \Vert ^ { 2 } } \end{array}$ . This leads to a smooth approximation of the time series, which we use as initial guess for the second stage. 2) We then train the Trend and Seasonality blocks together, computing the MSE reconstruction loss $\mathcal { L } _ { \mathrm { r e c } }$ and the FFT loss $\mathcal { L } _ { \mathrm { F F T } }$ between the ground truth and the added output of both TSNet blocks. 3) Finally, we train the three blocks together.
|
| 93 |
+
|
| 94 |
+
Training Loss The training of iHyperTime is done by optimizing the following loss, which contains an MSE reconstruction term ${ \mathcal { L } } _ { \mathrm { r e c } }$ , a spectral loss $\mathcal { L } _ { \mathrm { F F T } }$ and two regularization terms $\mathcal { L } _ { \mathrm { w e i g h t s } }$ and $\mathcal { L } _ { \mathrm { l a t e n t } }$ for the network weights and the latent embeddings, respectively:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } = \underbrace { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left\| \mathbf { y } _ { i } - \hat { f } ( t _ { i } ) \right\| ^ { 2 } } _ { \mathcal { L } _ { \mathrm { r e c } } } + \lambda _ { 1 } \underbrace { \frac { 1 } { W } \sum _ { j = 1 } ^ { W } w _ { j } ^ { 2 } } _ { \mathcal { L } _ { \mathrm { w e i g h s } } } + \lambda _ { 2 } \underbrace { \frac { 1 } { Z } \sum _ { l = 1 } ^ { Z } z _ { l } ^ { 2 } } _ { \mathcal { L } _ { \mathrm { l a t e n t } } } + \lambda _ { 3 } \underbrace { \frac { 1 } { N } \sum _ { k = 0 } ^ { N - 1 } \| F _ { k } - \hat { F } _ { k } \| } _ { \mathcal { L } _ { \mathrm { F F T } } } .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $F _ { k } = \vert \mathcal { F } _ { T } \{ \mathbf { f } \} \vert _ { k }$ corresponds to the coefficient of the $k$ th frequency in the discrete Fourier transform (DFT) of the time series. The term $\mathcal { L } _ { \mathrm { F F T } }$ penalizes deviations of the signal’s frequency spectrum with respect to ground truth. Thus, we ensure a high-fidelity reconstruction not only of the time series values, but also of its spectral composition. We refer to Appendices C and D for further details on $\mathcal { L } _ { \mathrm { F F T } }$ and the implementation details of the iHyperTime architecture.
|
| 101 |
+
|
| 102 |
+
Time Series Generation After training, we leverage the hypernetwork architecture to generate latent representations of the time series from our training set. Generation of new time series is produced by randomly selecting pairs of time series, and performing linear a interpolation between their embeddings $Z ^ { ( 1 ) }$ and $Z ^ { ( 2 ) }$ :
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
Z ^ { \mathrm { g e n } } = Z ^ { ( 1 ) } + \lambda \left( Z ^ { ( 2 ) } - Z ^ { ( 1 ) } \right)
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\lambda$ is also sampled randomly. Optionally, the interpolation can be performed on individual components $Z _ { T }$ , $Z _ { S }$ , $Z _ { R }$ of the embeddings, enabling the conditional generation of time series.
|
| 109 |
+
|
| 110 |
+
# 4 EXPERIMENTS
|
| 111 |
+
|
| 112 |
+
We present our evaluation of time series generation on regular and irregular data, covering time series of diverse lengths and numbers of channels. Additionally, we perform an analysis of our model’s TSR decomposition, and we compare training and inference times with previous works.
|
| 113 |
+
|
| 114 |
+
# 4.1 BASELINES AND EVALUATION
|
| 115 |
+
|
| 116 |
+
Datasets We test the performance of iHT using multiple datasets with varying characteristics such as periodicity, level of noise, number of features and length of the series. Stock corresponds to Google stock price data from 2004 to 2019, where each observation has 6 features. Energy is a UCI appliance prediction dataset (Candanedo et al., 2017) with 28 features. Additionally, we also consider Monash dataset (Godahewa et al., 2021), from which we choose FRED-MD, NN5 Daily, Temperature Rain, and Solar Weekly datasets. A complete description of the datasets can be found in Appendix B.
|
| 117 |
+
|
| 118 |
+
Additionally, we conduct experiments on irregularly sampled time series, achieved by randomly removing fixed percentages of values from each time series. We create the datasets by removing 30, 50 and $7 0 \%$ of each time series.
|
| 119 |
+
|
| 120 |
+
Baselines We compare our method with TimeGAN (Yoon et al., 2019), GT-GAN (Jeon et al., 2022), Fourier Flows (FF) (Alaa et al., 2021), LS4 (Zhou et al., 2023), DiffTime (Coletta et al., 2023), and RCGAN (Esteban et al., 2017). TimeGAN and GT-GAN have shown strong performance on multivariate time series with short sequence lengths and are able to handle missing data. LS4, DiffTime, and Fourier Flows have shown strong performance on time series with longer sequence length, generating distributions of frequencies that closely resemble the original data. We refer to Appendix D.1 for further details on baselines and the adjusted DiffTime and RCGAN architectures, introduced to deal with missing data and longer time series, respectively.
|
| 121 |
+
|
| 122 |
+
Evaluation metrics To asses the quality of the synthesized data, we adopt the predictive and discriminative scores used in TimeGAN (Yoon et al., 2019). The predictive score measures the usefulness of the generated data by using a train on synthetic, test on real (TSRT) approach: a model is trained using the synthetic data to predict the next step in a sequence, and then it is evaluated using the real data. The mean absolute error (MAE) between the predicted values and the ground truth is used for the evaluation. The discriminative score serves as a measurement of fidelity of the generated data, where the aim is to assess if the synthetic data is indistinguishable from real data. For this purpose, a discriminative model is trained to classify real and fake samples, and then used to test whether the original and generated data are correctly classified. The discriminative score is computed as |Accuracy − 0.5|, where a low value means that the classification is challenging, and therefore, the model cannot tell which samples are real and which are generated. For a qualitative evaluation, we analyze the synthesized and original time series by employing t-SNE visualizations which project the data into a two-dimensional space (van der Maaten & Hinton, 2008). Additionally, we perform a kernel density estimation (Jeon et al., 2022) to compare the data distributions. For the experiments on longer real-world time series from the Monash dataset, we also consider the marginal score (Zhou et al., 2023) that computes the absolute difference between the real and synthetic empirical probability density functions.
|
| 123 |
+
|
| 124 |
+
# 4.2 EXPERIMENTAL RESULTS ON REGULAR TIME SERIES SYNTHESIS
|
| 125 |
+
|
| 126 |
+
Performance results for regularly sampled time series are provided in Table 1, for univariate and multivariate datasets of varying lengths. The results indicate that iHT outperforms all methods in terms of the predictive score. This highlights the usefulness of the data generated by our method as a source of synthetic data for learning. In terms of discriminative score, iHT is competitive with stateof-the-art methods across all datasets, although no method emerges as a definitively superior approach. In Figure 2, the t-SNE visualizations show that the time series generated by iHT closely resemble the ground truth data distribution. We refer to Appendix I for additional qualitative comparisons.
|
| 127 |
+
|
| 128 |
+
Table 1: Regular time series generation performance in terms of predictive and discriminative scores.
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Method</td><td></td><td>Energy24</td><td>Stock24</td><td>Stocks72</td><td>Stock360</td></tr><tr><td></td><td>iHT</td><td>.251 ± .000</td><td>.037± .000</td><td>.188 ± .000</td><td>.168 ± .000</td></tr><tr><td></td><td>GT-GAN</td><td>.321 ± .002</td><td>.040 ± .000</td><td>.207 ± .000</td><td>.188 ± .000</td></tr><tr><td></td><td>TimeGAN</td><td>.273 ± .004</td><td>.038 ± .001</td><td>.226± .002</td><td>.206±.000</td></tr><tr><td></td><td>RCGAN</td><td>.292 ± .005</td><td>.040 ± .001</td><td>.192 ± .001</td><td>.189 ± .000</td></tr><tr><td></td><td>DiffTime</td><td>.252± .000</td><td>.038 ± .001</td><td>.213± .000</td><td>.215 ± .000</td></tr><tr><td>LS4</td><td></td><td>.295 ± .001</td><td>.103 ± .001</td><td>.194 ± .000</td><td>.168 ± .000</td></tr><tr><td>FF</td><td></td><td>.251 ± .000</td><td>.076 ± .001</td><td>.191 ± .000</td><td>.169 ± .000</td></tr><tr><td></td><td>Original</td><td>.250 ± .003</td><td>.036 ± .001</td><td>.186 ± .001</td><td>.167 ± .001</td></tr><tr><td></td><td>iHT</td><td>.245± .019</td><td>.044 ± .011</td><td>.014 ± .009</td><td>.018 ± .015</td></tr><tr><td></td><td>GT-GAN</td><td>.221 ± .068</td><td>.077 ± .031</td><td>.058 ± .017</td><td>.085± .064</td></tr><tr><td></td><td>TimeGAN</td><td>.236 ± .012</td><td>.102 ± .021</td><td>.073 ± .047</td><td>.042 ± .074</td></tr><tr><td>RCGAN</td><td></td><td>.336 ± .017</td><td>.196 ± .027</td><td>.012 ± .09</td><td>.014 ±.007</td></tr><tr><td></td><td>DiffTime</td><td>.445± .004</td><td>.097 ± .016</td><td>.097 ± .012</td><td>.101 ± .018</td></tr><tr><td>LS4</td><td></td><td>.499 ± .000</td><td>.363± .027</td><td>.089 ± .081</td><td>.088 ± .081</td></tr><tr><td>FF</td><td></td><td>.499 ± .001</td><td>.349 ± .113</td><td>.016 ± .018</td><td>.015 ± .014</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Table 2: Irregular time series generation performance: predictive and discriminative scores. $3 0 \%$ missing data.
|
| 133 |
+
|
| 134 |
+
<table><tr><td>Method</td><td>Energy24</td><td>Stock24</td><td>Stocks72</td><td>Stock360</td></tr><tr><td>iHT</td><td>.049 ± .001</td><td>.013 ±.001</td><td>.188 ±.000</td><td>.168 ± .000</td></tr><tr><td>GT-GAN</td><td>.066 ± .001</td><td>.021 ± .003</td><td>.206 ±.000</td><td>.196 ± .000</td></tr><tr><td>DiffTime</td><td>.052 ± .001</td><td>.019 ± .006</td><td>.200±.000</td><td>.188 ± .000</td></tr><tr><td>LS4</td><td>.063 ± .001</td><td>.022 ± .005</td><td>.198 ± .000</td><td>.229 ± .000</td></tr><tr><td>FF</td><td>.148 ± .007</td><td>.137 ± .029</td><td>.210 ±.000</td><td>.184 ± .000</td></tr><tr><td>Original</td><td>.045 ± .001</td><td>.011 ± .002</td><td>.186 ± .001</td><td>.167 ± .001</td></tr><tr><td>iHT</td><td>.452 ± .003</td><td>.059 ± .046</td><td>.017 ± .007</td><td>.014 ± .010</td></tr><tr><td></td><td>.333± .063</td><td>.251± .097</td><td>.068± .007</td><td>.111 ± .026</td></tr><tr><td>DiffTime</td><td>.298 ± .010</td><td>.215 ± .010</td><td>.110 ± .045</td><td>.057 ± .070</td></tr><tr><td>LS4</td><td>.500± .000</td><td>.495± .004</td><td>.203 ± .028</td><td>.067± .016</td></tr><tr><td>FF</td><td>.500± .000</td><td>.497 ± .005</td><td>.223± .092</td><td>.156 ± .102</td></tr></table>
|
| 135 |
+
|
| 136 |
+
# 4.3 EXPERIMENTAL RESULTS ON IRREGULAR TIME SERIES SYNTHESIS
|
| 137 |
+
|
| 138 |
+
Tables 2, 3 and 4 shows the results for the irregular time series generation with different percentages of missing values. iHT outperforms all methods in terms of predictive score across all datasets. In regards to fidelity (predictive score), our method shows the best performance in 3 out of 4 datasets. In particular, it shows the best scores for long time series datasets, showing its versatility on time series beyond 24 time steps. Furthermore, the performance of iHT does not degrade significantly with the percentage of missing values, even in the extreme case of $7 0 \%$ missing data. The top row in Figure 3 compares the distributions of original and synthetic data for the Stock24 dataset with $5 0 \%$ of missing values. iHT shows the best performance, with the closest match to the original data distribution. The bottom row shows the corresponding t-SNE visualizations, where we can see that iHT and GT-GAN show the best overlap between original and generated data, with iHT showing more data diversity, covering a wider area across the original data. Additional plots for other missing rates are shown in Appendix I, where we observe a similar behavior with iHT showing the best overlap in both distribution and t-SNE visualization.
|
| 139 |
+
|
| 140 |
+
Table 3: Irregular time series generation performance: predictive and discriminative scores. $5 0 \%$ missing data.
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Method</td><td>Energy24</td><td>Stock24</td><td>Stocks72</td><td>Stock360</td></tr><tr><td></td><td>iHT (Ours) .051 ± .002</td><td>.014 ± .001</td><td>.187 ± .000</td><td>.168 ± .000</td></tr><tr><td></td><td>.064± .001</td><td>.018±.002</td><td>.195±.000</td><td>.195 ±.000</td></tr><tr><td>DiffTime</td><td>.057 ± .001</td><td>.024 ± .002</td><td>.278± .000</td><td>.186 ± .000</td></tr><tr><td>LS4</td><td>.065±.002</td><td>.033± .005</td><td>.212 ± .000</td><td>.197 ± .000</td></tr><tr><td>FF</td><td>.227 ± .004</td><td>.169 ± .018</td><td>.236± .000</td><td>.215± .000</td></tr><tr><td>Original</td><td>.045 ± .001</td><td>.011 ± .002</td><td>.186± .001</td><td>.167 ± .001</td></tr><tr><td>iHT (Ours)</td><td>.472 ± .004</td><td>.102 ± .051</td><td>.011 ± .003</td><td>.004 ± .003</td></tr><tr><td></td><td>.317±.010</td><td>.265± .073</td><td>.026± .012</td><td>.081± .023</td></tr><tr><td>DiffTime</td><td>.422 ± .011</td><td>.332 ± .034</td><td>.284± .137</td><td>.110 ± .061</td></tr><tr><td>LS4</td><td>.500 ± .000</td><td>.498± .000</td><td>.144 ± .034</td><td>.027 ±.015</td></tr><tr><td>FF</td><td>.500 ± .002</td><td>.498± .003</td><td>.376± .130</td><td>.422 ± .058</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Table 4: Irregular time series generation performance: predictive and discriminative scores. $7 0 \%$ missing data.
|
| 145 |
+
|
| 146 |
+
<table><tr><td>Method</td><td></td><td>Energy24</td><td>Stock24</td><td>Stocks72</td><td>Stock360</td></tr><tr><td rowspan="5"></td><td>iHT (Ours)</td><td>.053 ± .000</td><td>.014 ± .013</td><td>.187 ± .000</td><td>.168 ± .000</td></tr><tr><td>GT-GAN</td><td>.076±.001</td><td>.020±.005</td><td>.205±.000</td><td>.196± .000</td></tr><tr><td>LS4</td><td>.084± .003</td><td>.024 ± .002</td><td>.188 ± .000</td><td>.188± .000</td></tr><tr><td>DiffTime</td><td>.065 ± .001</td><td>.068± .063</td><td>.284± .000</td><td>.196± .000</td></tr><tr><td>FF</td><td>.304 ± .005</td><td>.205 ± .001</td><td>.267 ± .000</td><td>.245 ± .000</td></tr><tr><td rowspan="5"></td><td>Original</td><td>.045 ± .001</td><td>.011 ± .002</td><td>.186± .001</td><td>.167 ± .001</td></tr><tr><td>iHT(Ours)</td><td>.482 ± .003</td><td>.115 ± .052</td><td>.020 ± .019</td><td>.011 ± .012</td></tr><tr><td></td><td>.325±.047</td><td>.230±.053</td><td>.058±.002</td><td>.091±.013</td></tr><tr><td>LS4</td><td>.499 ± .002</td><td>.455 ± .011</td><td>.036± .026</td><td>.183 ± .017</td></tr><tr><td>DiffTime</td><td>.444 ± .001</td><td>.421 ± .003</td><td>.436± .009</td><td>.148± .018</td></tr><tr><td colspan="2">FF</td><td>.500± .003</td><td>.498 ± .008</td><td>.424 ± .083</td><td>.369 ± .163</td></tr></table>
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 2: t-SNE visualizations on Stock24 data, where a greater overlap of blue and red dots shows a better distributional-similarity between the original and generated data. Our approach shows the best performance. (See Appendix 21 for high resolution charts)
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: (Top) Data distribution on irregular Stock24 data (Missing $5 0 \%$ ). (Bottom) t-SNE visualizations on irregular Stock24 data (Missing $5 0 \%$ ), where a greater overlap of blue and red dots shows a better distributional-similarity between the generated data and original data. Our approach shows the best performance.
|
| 153 |
+
|
| 154 |
+
# 4.4 EXPERIMENTAL RESULTS ON LONGER REAL-WORLD TIME SERIES SYNTHESIS
|
| 155 |
+
|
| 156 |
+
Table 5 shows additional generation results for 4 real-world datasets from the Monash dataset, where 3 of the datasets contain time series with lengths over 700 time steps. We report comparisons with LS4, which has shown state-of-art performance on these datasets (Zhou et al., 2023), while we leave the full evaluation table in Appendix E. In this scenario, the Classification (fidelity) and Prediction (usefulness) scores are computed using a 1-layer S4 model (Zhou et al., 2023). The results show the ability of iHT to deal with long time series, with superior performance in 3 out of 4 datasets w.r.t. the state-of-art LS4.
|
| 157 |
+
|
| 158 |
+
Table 5: Generation results on Monash datasets.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Data</td><td>Metric</td><td>LS4</td><td>iHT(Ours)|</td><td>Data</td><td>Metric</td><td>LS4</td><td>iHT (Ours)</td></tr><tr><td rowspan="3">FRED-MD</td><td>Marginal↓</td><td>0.0221</td><td>0.0177</td><td rowspan="3">Temp Rain</td><td>Marginal ↓</td><td>0.0834</td><td>0.2978</td></tr><tr><td>Class个</td><td>0.544</td><td>1.3278</td><td>Class 个</td><td>0.976</td><td>11.2493</td></tr><tr><td>Prediction ↓</td><td>0.0373</td><td>0.0181</td><td>Prediction ↓</td><td>0.521</td><td>0.132</td></tr><tr><td rowspan="3">NN5 Daily</td><td>Marginal ↓</td><td>0.00671</td><td>0.00893</td><td rowspan="3">Solar Weekly</td><td>Marginal ↓</td><td>0.0459</td><td>0.03273</td></tr><tr><td>Class ↑</td><td>0.636</td><td>0.4982</td><td>Class </td><td>0.683</td><td>1.2413</td></tr><tr><td>Prediction↓</td><td>0.241</td><td>0.2349</td><td>Prediction ↓</td><td>0.141</td><td>0.0739</td></tr></table>
|
| 161 |
+
|
| 162 |
+
# 4.5 RUNTIME
|
| 163 |
+
|
| 164 |
+
In Figure 4, we show that the strong performance of iHT on long time series does not impact its computational time. We consider a set of synthetic datasets with lengths $\{ 8 0 , 3 2 0 , 1 2 8 0 , 5 1 2 0 , \hat { 2 } 0 4 8 0 \}$ and we evaluate the training time for 100 iterations, and the inference time on one batch (Zhou et al., 2023). The figure shows that iHT has among the lowest computational times w.r.t. existing approaches. Moreover, iHT training times are almost unaffected by the length of the time series, with negligible changes even for 20,480 time steps, making it the fastest method for long sequences. Additional details and the overall training times are presented in Appendix F.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 4: Training and inference time comparison for time series of different lengths.
|
| 168 |
+
|
| 169 |
+
# 4.6 TREND-SEASONALITY DECOMPOSITION ANALYSIS
|
| 170 |
+
|
| 171 |
+
iHT provides a controllable method for time series generation based on an interpretable trendseasonality-residual decomposition of latent embeddings. We explore the interpretable decomposition of iHT on analytically generated time series datasets that have trend (T), seasonal (S) and noise (R) components, or a combination of two of them. The synthetic datasets are generated by uniformly sampling trend values, frequencies and levels of noise. We compute the decomposition error as the MSE between the output of each block of iHT and the corresponding TSR analytic component. In table 6, we compare against the traditional STL method, which requires the period of seasonality as an additional parameter. In STL (exact), we compute STL with the exact period of the analytic signal. In STL (approx), we provide STL with an approximate period estimated by analyzing the Fourier spectrum of the signal, a more realistic setting for time series decomposition. Our method shows the lowest trend error, with a small standard deviation with respect to STL (approx), and shows comparable results with STL (exact). Additionally, our method shows similar performance on the seasonality component when there is seasonality present in the dataset with respect to STL (approx), and shows much better agreement when there is no seasonality present $_ \mathrm { T + R }$ dataset).
|
| 172 |
+
|
| 173 |
+
In Figure 5 (a) and (c), we show the distribution of the trend, and residuals outputs from iHT against the ground truth components for the $\mathrm { T } { + } \mathrm { S } { + } \mathrm { R }$ dataset. In the case of the seasonality component (b), we plot the histogram for the frequencies of the time series, where we estimate the frequency of each time series by finding the dominant frequency component in the discrete Fourier transform. The trend and seasonality histograms show very good agreement with the ground truth, while the residuals show slightly wider tails. Finally, we visualize the learned representations via t-SNE of the embeddings. Figure 5 (d) and (e) shows that iHT is able to learn the trend and seasonal patterns from the dataset. In plot (d) the color separation corresponds to positive and negative trend, while plot (e) shows the separation in frequencies. We refer to Appendix G and H for further details on the synthetic datasets and for additional results.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 5: (a,b,c): Distribution of the trend, seasonality and residual outputs of iHT vs ground truth. (d,e): t-SNE visualization of trend and seasonality embeddings in iHT. All cases correspond to the $\mathrm { T } { + } \mathrm { S } { + } \mathrm { R }$ dataset.
|
| 177 |
+
|
| 178 |
+
Table 6: Ablation study for trend-seasonality-residual decomposition of time series. We compare iHT against STL decomposition, for three dataset configurations: trend $^ +$ seasonality $( \mathrm { T } { + } \mathrm { S } )$ , trend+residual $( \mathrm { T } + \mathrm { R } )$ and all three components $( \mathrm { T } + \mathrm { S } + \mathrm { R } )$ ).
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan="2">MSE (x10-3)</td><td colspan="3">T+S+R</td><td colspan="3">T+R</td><td colspan="3">T+S</td></tr><tr><td>STL (exact)</td><td>STL (approx)</td><td>iHT (Ours)</td><td>STL (exact)</td><td>STL (approx)</td><td>iHT(Ours)</td><td>STL (exact)</td><td>STL (approx)</td><td>iHT (Ours)</td></tr><tr><td>Trend</td><td>0.46± 2.08</td><td>1.04 ± 4.69</td><td>0.60±0.50</td><td>0.07 ±0.07</td><td>1.26 ± 5.70</td><td>0.20±0.27</td><td>0.46± 2.10</td><td>1.17 ± 5.12</td><td>0.46±0.48</td></tr><tr><td>Seasonality</td><td>0.57± 2.10</td><td>1.19 ± 4.73</td><td>1.21 ± 0.68</td><td>0.03±0.02</td><td>1.35± 5.74</td><td>0.17 ±0.29</td><td>0.44 ± 2.09</td><td>1.18 ± 5.11</td><td>1.25 ± 0.77</td></tr><tr><td>Residuals</td><td>0.17 ± 0.15</td><td>0.18 ±0.12</td><td>1.29 ± 0.62</td><td>0.15 ±0.09</td><td>0.18 ±0.13</td><td>0.41 ±0.26</td><td>0.03 ±0.10</td><td>0.04 ±0.07</td><td>1.25± 0.71</td></tr></table>
|
| 181 |
+
|
| 182 |
+
# 4.7 ABLATION STUDIES
|
| 183 |
+
|
| 184 |
+
In Table 7, we change the architecture of iHT to create simpler ablation models, and report predictive and discriminative metrics for multiple datasets. iHT corresponds to our full proposed model. In iHT (no FFT) we have removed the FFT loss from the training. In iHT-SIREN we remove the TSR decomposition from iHT, replacing TSNet with a SIREN network. We observe that the predictive scores are comparable for all configurations, while discriminative scores improve for all datasets when we incorporate the interpretable decomposition. The error reduces further when we add the FFT loss to the training process.
|
| 185 |
+
|
| 186 |
+
Table 7: Ablation study for model architecture: comparison of iHT against simpler configurations: iHT (no FFT) without FFT loss, and iHT-SIREN without TSR decomposition.
|
| 187 |
+
|
| 188 |
+
<table><tr><td></td><td>Energy24</td><td>Stock24</td><td>Stock72</td><td>Stock360</td><td></td><td>Energy24</td><td>Stock24</td><td>Stock72</td><td>Stock360</td></tr><tr><td>Predictive Score</td><td colspan="9">Disc.Score</td></tr><tr><td>iHT</td><td>0.047</td><td>0.013</td><td>0.188</td><td>0.168</td><td>iHT</td><td>0.245</td><td>0.044</td><td>0.014</td><td>0.009</td></tr><tr><td>iHT (no FFT)</td><td>0.046</td><td>0.014</td><td>0.188</td><td>0.168</td><td>iHT (no FFT)</td><td>0.278</td><td>0.073</td><td>0.015</td><td>0.011</td></tr><tr><td>iHT-SIREN</td><td>0.048</td><td>0.013</td><td>0.188</td><td>0.169</td><td>iHT-SIREN</td><td>0.341</td><td>0.108</td><td>0.022</td><td>0.024</td></tr></table>
|
| 189 |
+
|
| 190 |
+
# 5 DISCUSSION AND CONCLUSIONS
|
| 191 |
+
|
| 192 |
+
We presented iHyperTime, a versatile and efficient framework for generating time series with a wide range of characteristics. Unlike existing generative models that excel either in short or long sequences, our model demonstrates superior performance across both types of datasets. Our evaluations reveal its efficacy in handling irregularly sampled data, where it consistently surpasses current benchmarks. For regularly sampled sequences, iHyperTime’s performance is competitive with the best available models, regardless of time series length. One of the model’s notable strengths is its rapid training speed, which is not only comparable to the quickest existing methods for short sequences but also significantly faster for longer ones. Importantly, our architecture incorporates inductive biases that facilitate unsupervised decomposition of time series into trend, seasonality, and residual components, a capability we validated against the established STL decomposition method. Additionally, we illustrated iHyperTime’s ability to learn semantically meaningful representations, opening the door for applications that involve generating time series conditioned on interpretable factors.
|
| 193 |
+
|
| 194 |
+
REFERENCES
|
| 195 |
+
Ahmed Alaa, Alex James Chan, and Mihaela van der Schaar. Generative time-series modeling with fourier flows. In ICLR, 2021.
|
| 196 |
+
Ali Alqahtani, Mohammed Ali, Xianghua Xie, and Mark W. Jones. Deep time-series clustering: A review. Electronics, 10(23), 2021.
|
| 197 |
+
Ivan Anokhin, Kirill V. Demochkin, Taras Khakhulin, Gleb Sterkin, Victor S. Lempitsky, and Denis Korzhenkov. Image generators with conditionally-independent pixel synthesis. CVPR, pp. 14273–14282, 2021.
|
| 198 |
+
Samuel A. Assefa, Danial Dervovic, Mahmoud Mahfouz, Robert E. Tillman, Prashant Reddy, and Manuela Veloso. Generating synthetic data in finance: Opportunities, challenges and pitfalls. In International Conference on AI in Finance, 2020.
|
| 199 |
+
Kasun Bandara, Rob J. Hyndman, and C. Bergmeir. Mstl: A seasonal-trend decomposition algorithm for time series with multiple seasonal patterns. International Journal of Operational Research, 2022.
|
| 200 |
+
Luis M Candanedo, Veronique Feldheim, and Dominique Deramaix. Data driven prediction models ´ of energy use of appliances in a low-energy house. Energy and buildings, 140:81–97, 2017.
|
| 201 |
+
Wei Cao, Dong Wang, Jian Li, Hao Zhou, Lei Li, and Yitan Li. Brits: Bidirectional recurrent imputation for time series. In NeurIPS, volume 31, 2018.
|
| 202 |
+
Yinbo Chen, Sifei Liu, and Xiaolong Wang. Learning continuous image representation with local implicit image function. In CVPR, pp. 8628–8638, 2021.
|
| 203 |
+
Kukjin Choi, Jihun Yi, Changhwa Park, and Sungroh Yoon. Deep learning for anomaly detection in time-series data: Review, analysis, and guidelines. IEEE Access, 9:120043–120065, 2021.
|
| 204 |
+
Robert B. Cleveland, William S. Cleveland, Jean E. McRae, and Irma Terpenning. Stl: A seasonaltrend decomposition procedure based on loess (with discussion). Journal of Official Statistics, 6: 3–73, 1990.
|
| 205 |
+
Andrea Coletta, Sriram Gopalakrishan, Daniel Borrajo, and Svitlana Vyetrenko. On the constrained time-series generation problem. In NeurIPS, 2023.
|
| 206 |
+
Abhyuday Desai, Cynthia Freeman, Zuhui Wang, and Ian Beaver. Timevae: A variational autoencoder for multivariate time series generation. arXiv:2111.08095, 2021.
|
| 207 |
+
Cristobal Esteban, Stephanie L. Hyland, and Gunnar R ´ atsch. Real-valued (medical) time series ¨ generation with recurrent conditional gans, 2017.
|
| 208 |
+
Chenguang Fang and Chen Wang. Time series data imputation: A survey on deep learning approaches. ArXiv, abs/2011.11347, 2020.
|
| 209 |
+
Elizabeth Fons, Paula Dawson, Xiao-jun Zeng, John Keane, and Alexandros Iosifidis. Adaptive weighting scheme for automatic time-series data augmentation, 2021.
|
| 210 |
+
Rakshitha Wathsadini Godahewa, Christoph Bergmeir, Geoffrey I Webb, Rob Hyndman, and Pablo Montero-Manso. Monash time series forecasting archive. In NeurIPS, 2021.
|
| 211 |
+
David Ha, Andrew M. Dai, and Quoc V. Le. Hypernetworks. In ICLR, 2017.
|
| 212 |
+
Hassan Ismail Fawaz, Benjamin Lucas, Germain Forestier, Charlotte Pelletier, Daniel F. Schmidt, Jonathan Weber, Geoffrey I. Webb, Lhassane Idoumghar, Pierre-Alain Muller, and Franc¸ois Petitjean. Inceptiontime: Finding alexnet for time series classification. Data Mining and Knowledge Discovery, 2020.
|
| 213 |
+
Jinsung Jeon, Jeonghak Kim, Haryong Song, Seunghyeon Cho, and Noseong Park. GT-GAN: General purpose time series synthesis with generative adversarial networks. In NeurIPS, 2022.
|
| 214 |
+
Kyeong-Joong Jeong and Yong-Min Shin. Time-series anomaly detection with implicit neural representation. CoRR, abs/2201.11950, 2022.
|
| 215 |
+
James Jordon, Daniel Jarrett, Evgeny Saveliev, Jinsung Yoon, Paul Elbers, Patrick Thoral, Ari Ercole, Cheng Zhang, Danielle Belgrave, and Mihaela van der Schaar. Hide-and-seek privacy challenge: Synthetic data generation vs. patient re-identification. In NeurIPS, volume 133, pp. 206–215, 06–12 Dec 2021.
|
| 216 |
+
Bryan Lim and Stefan Zohren. Time-series forecasting with deep learning: a survey. Phylosophical Transactions of the Royal Society A, 2021.
|
| 217 |
+
Gidi Littwin and Lior Wolf. Deep meta functionals for shape representation. In ICCV, pp. 1824–1833, 10 2019.
|
| 218 |
+
Lars Mescheder, Michael Oechsle, Michael Niemeyer, Sebastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In CVPR, 2019.
|
| 219 |
+
Ben Mildenhall, Pratul P. Srinivasan, Matthew Tancik, Jonathan T. Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020.
|
| 220 |
+
Cheolhwan Oh, Seungmin Han, and Jongpil Jeong. Time-series data augmentation based on interpolation. Procedia Computer Science, 175:64–71, 2020.
|
| 221 |
+
Boris N. Oreshkin, Dmitri Carpov, Nicolas Chapados, and Yoshua Bengio. N-beats: Neural basis expansion analysis for interpretable time series forecasting. In ICLR, 2020.
|
| 222 |
+
Tamar Rott Shaham, Michael Gharbi, Richard Zhang, Eli Shechtman, and Tomer Michaeli. Spatiallyadaptive pixelwise networks for fast image translation. In CVPR, 2021.
|
| 223 |
+
Vincent Sitzmann, Michael Zollhofer, and Gordon Wetzstein. Scene representation networks: Contin- ¨ uous 3d-structure-aware neural scene representations. In NeurIPS, 2019.
|
| 224 |
+
Vincent Sitzmann, Eric R. Chan, Richard Tucker, Noah Snavely, and Gordon Wetzstein. Metasdf: Meta-learning signed distance functions. In NeurIPS, 2020a.
|
| 225 |
+
Vincent Sitzmann, Julien N.P. Martel, Alexander W. Bergman, David B. Lindell, and Gordon Wetzstein. Implicit neural representations with periodic activation functions. In NeurIPS, 2020b.
|
| 226 |
+
Ivan Skorokhodov, Savva Ignatyev, and Mohamed Elhoseiny. Adversarial generation of continuous images. In CVPR, pp. 10753–10764, June 2021.
|
| 227 |
+
Alejandro Sztrajman, Gilles Rainer, Tobias Ritschel, and Tim Weyrich. Neural brdf representation and importance sampling. Computer Graphics Forum, 40(6):332–346, 2021.
|
| 228 |
+
Matthew Tancik, Pratul P. Srinivasan, Ben Mildenhall, Sara Fridovich-Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan T. Barron, and Ren Ng. Fourier features let networks learn high frequency functions in low dimensional domains. NeurIPS, 2020.
|
| 229 |
+
Jose F. Torres, Dalil Hadjout, Abderrazak Sebaa, Francisco Mart ´ ´ınez-Alvarez, and Alicia Troncoso ´ Lora. Deep learning for time series forecasting: A survey. Big data, 2021.
|
| 230 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9:2579–2605, 2008.
|
| 231 |
+
Svitlana Vyetrenko and Shaojie Xu. Risk-sensitive compact decision trees for autonomous execution in presence of simulated market response, 2019.
|
| 232 |
+
Qingsong Wen, Jingkun Gao, Xiaomin Song, Liang Sun, Huan Xu, and Shenghuo Zhu. Robuststl: A robust seasonal-trend decomposition algorithm for long time series. AAAI Conference on Artificial Intelligence, 33(01):5409–5416, Jul. 2019.
|
| 233 |
+
Magnus Wiese, Robert Knobloch, Ralf Korn, and Peter Kretschmer. Quant gans: deep generation of financial time series. Quantitative Finance, pp. 1–22, Apr 2020.
|
| 234 |
+
Gerald Woo, Chenghao Liu, Doyen Sahoo, Akshat Kumar, and Steven C. H. Hoi. Learning deep time-index models for time series forecasting. In ICML, 2023.
|
| 235 |
+
Jinsung Yoon, Daniel Jarrett, and Mihaela van der Schaar. Time-series generative adversarial networks. In NeurIPS, 2019.
|
| 236 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. In NeurIPS, 2017.
|
| 237 |
+
Li Zeng, Baifan Zhou, Mohammad Al-Rifai, and Evgeny Kharlamov. Segtime: Precise time series segmentation without sliding window, 2022.
|
| 238 |
+
Linqi Zhou, Michael Poli, Winnie Xu, Stefano Massaroli, and Stefano Ermon. Deep latent state space models for time-series generation. In International Conference on Machine Learning, pp. 42625–42643. PMLR, 2023.
|
| 239 |
+
|
| 240 |
+
# A ADDITIONAL RELATED WORK
|
| 241 |
+
|
| 242 |
+
Implicit Neural Representations INRs (or coordinate-based neural networks) have recently gained popularity in computer vision applications. The usual implementation of INRs consists of a fullyconnected neural network (MLP) that maps coordinates (e.g. xyz-coordinates) to the corresponding values of the data, essentially encoding their functional relationship in the network. One of the main advantages of this approach for data representation, is that the information is encoded in a continuous/grid-free representation, that provides a built-in non-linear interpolation of the data. This avoids the usual artifacts that arise from discretization, and has been shown to combine flexible and accurate data representation with high memory efficiency (Sitzmann et al., 2020b; Tancik et al., 2020). Whilst INRs have been shown to work on data from diverse sources, such as video, images and audio (Sitzmann et al., 2020b; Chen et al., 2021; Rott Shaham et al., 2021), their recent popularity has been motivated by multiple applications in the representation of 3D scene data, such as 3D geometry (Park et al., 2019; Mescheder et al., 2019; Sitzmann et al., 2020a; 2019) and object appearance (Mildenhall et al., 2020; Sztrajman et al., 2021). In early architectures, INRs showed a lack of accuracy in the encoding of high-frequency details of signals. Mildenhall et al. (2020) proposed positional encodings to address this issue, and Tancik et al. (2020) further explored them, showing that by using Fourier-based features in the input layer, the network is able to learn the full spectrum of frequencies from data. Concurrently, Sitzmann et al. (2020b) tackled the encoding of high-frequency data by proposing the use of sinusoidal activation functions (SIREN: Sinusoidal Representation Networks), and ? showed the equivalence between Fourier features and single-layer SIRENs. Our INR architecture for time series data (Section 3) is based on the SIREN architecture by Sitzmann et al.
|
| 243 |
+
|
| 244 |
+
Hypernetworks A hypernetwork is a neural network architecture designed to predict the weight values of a secondary neural network, denominated a hyponetwork (Sitzmann et al., 2020a). The concept of hypernetwork was formalized by Ha et al. (2017), drawing inspiration from methods in evolutionary computing (Stanley et al., 2009). Moreover, while convolutional encoders have been likened to the function of the human visual system (Skorokhodov et al., 2021), the analogy cannot be extended to convolutional decoders, and some researchers have argued that hypernetworks much more closely match the behavior of the prefrontal cortex (Russin et al., 2020). Hypernetworks have been praised for their expressivity, compression due to weight sharing, and for their fast inference times(Skorokhodov et al., 2021). They have been leveraged for multiple applications, including few-shot learning (Rusu et al., 2019; Zhao et al., 2020), continual learning (von Oswald et al., 2020) and architecture search (Zhang et al., 2019; Brock et al., 2018). Moreover, in the last two years some works have started to leverage hypernetworks for the training of INRs, enabling the learning of latent encodings of data, while also maintaining the flexible and accurate reconstruction of signals provided by INRs. This approach has been implemented with different hypernetwork architectures, to learn priors over image data (Sitzmann et al., 2020b; Skorokhodov et al., 2021), 3D scene geometry (Littwin & Wolf, 2019; Sitzmann et al., 2019; 2020a) and material appearance (Sztrajman et al., 2021). Tancik et al. (2021) leverage hypernetworks to speed-up the training of INRs by providing learned initializations of the network weights. Sitzmann et al. (2020b) combine a set encoder with a hypernetwork decoder to learn a prior over INRs representing image data, and apply it for image in-painting. Our hypernetwork architecture from Section 3 is similar to Sitzmann et al.’s, however we learn a prior over the space of time series and leverage it for new data synthesis through interpolation of the learned embeddings.
|
| 245 |
+
|
| 246 |
+
Interpretable Time Series Seasonal-trend decomposition techniques are standard tools in time series analysis used to decompose a time series into trend, seasonal, and remainder components. The trend component encapsulates the slow time-varying behavior of the time series, while seasonal components capture recurring (i.e., periodic) fluctuations in the data. These techniques enable an intuitive and interpretable analysis of time series data which play an important role in a variety of downstream tasks, including forecasting and anomaly detection. The classic approach for performing the decomposition is the widely used STL algorithm (Cleveland et al., 1990). To account for outliers and distributional shifts, a robust version of the algorithm, called Robust STL, has also been proposed (Wen et al., 2019). Additional challenges in seasonal-trend decomposition involve dealing with complex time series data that exhibit multiple seasonal components, to which techniques such as multiple STL (MSTL) have been proposed (Bandara et al., 2022). The ability to break time series into interpretable components has been a topic of recent interest in the context of anomaly detection, forecasting, and generation. Relevant to this work is the recently proposed NBEATS architecture (Oreshkin et al., 2020), a deep learning-based univariate time series forecasting solution that provides time series interpretability capabilities without considerable loss in predictive performance. The N-BEATS architecture explicitly encodes seasonal-trend decomposition into the network by defining two blocks: a trend block which uses a small ordered polynomial to capture slow varying behaviors, and a seasonality block which uses a Fourier series to capture cyclical patterns. Little work, however, has been done in the design of generation schemes that allow for decomposition of time series data into interpretable components. While TimeVAE (Desai et al., 2021) proposes a VAE architecture where the decoder has trend and seasonality blocks to allow for interpretable generation, no results highlighting the advantage of this capability were demonstrated.
|
| 247 |
+
|
| 248 |
+
# B DATASETS
|
| 249 |
+
|
| 250 |
+
Here we introduce in detail the datasets used in our evaluation. We use publicly available Google stocks data from Yahoo finance, and the UCI Energy dataset (Candanedo et al., 2017). Google stock dataset contains daily observations from 2004 to 2019 with 6 features, namely open, high, low, close, adjusted close, and volume. The energy data contains 28 features with 10-minute resolution. Finally, we consider 4 datasets with longer real-world time-series from Monash repository (Godahewa et al., 2021), namely FRED-MD, NN5 Daily, Temperature Rain, and Solar Weekly. The first three datasets have time-series of length of around 700, while the latter one has time-series with length of 52. The datasets characteristics are summarized in Table 8.
|
| 251 |
+
|
| 252 |
+
In order to make a fair comparison with current state-of-the-art methods, we process the Stock and Energy in two different ways: in line with Yoon et al. (2019) and Jeon et al. (2022), we slice the data using a window of 24 time steps, corresponding to datasets Stock24 and Energy24. Following Coletta et al. (2023), we select one feature per dataset (univariate) and slice it using windows of 72 and 360 time steps, which correspond to Stock72 and Energy360.
|
| 253 |
+
|
| 254 |
+
Table 8: Main characteristics of the datasets used.
|
| 255 |
+
|
| 256 |
+
<table><tr><td>Dataset</td><td>Number of Samples</td><td>Length of Time series</td><td>No of Features</td><td>Source</td></tr><tr><td>Stock24</td><td>3661</td><td>24</td><td>6</td><td></td></tr><tr><td>Stock72</td><td>3613</td><td>72</td><td>1</td><td>Link</td></tr><tr><td>Stock360</td><td>3325</td><td>360</td><td>1</td><td></td></tr><tr><td>Energy</td><td>19635</td><td>24</td><td>28</td><td>Link</td></tr><tr><td>FRED-MD</td><td>107</td><td>728</td><td>1</td><td>Link</td></tr><tr><td>NN5 Daily</td><td>111</td><td>791</td><td>1</td><td>Link</td></tr><tr><td>Temp Rain</td><td>32072</td><td>725</td><td>1</td><td>Link</td></tr><tr><td>Solar Weekly</td><td>137</td><td>52</td><td>1</td><td>Link</td></tr></table>
|
| 257 |
+
|
| 258 |
+
# C FOURIER-BASED LOSS
|
| 259 |
+
|
| 260 |
+
As part of the training of our iHyperTime architecture, we propose a Fourier spectrum reconstruction loss. For a discrete-time signal $\mathbf { \tilde { f } } = \{ f _ { 0 } = f ( 0 ) , f _ { 1 } = f ( 1 ) , \ldots , f _ { N } = f ( N ) \bar \}$ , the $N$ -point discrete Fourier transform (DFT) is utilized to obtain the corresponding frequency domain representation of f through the following operation:
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
F _ { k } = \left[ \mathcal { F } _ { T } \{ \mathbf { f } \} \right] _ { k } = \sum _ { n = 0 } ^ { N - 1 } f _ { n } e ^ { - 2 \pi i \left( \frac { k n } { N } \right) } , \quad 0 \leq k \leq N - 1 ,
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
where $i = \sqrt { - 1 }$ corresponds to the imaginary unit of a complex number. The coefficient $F _ { k } \in \mathbb { C }$ quantifies the strength in representation of the $k \mathrm { t h }$ frequency component of the signal. The DFT has a time complexity of $\mathcal { O } ( N ^ { 2 } )$ . In practice, an algorithm called the fast Fourier transform (FFT) is used to compute the DFT due to its lower time complexity (i.e., $\mathcal { O } ( N \log N ) )$ . Using the FFT to obtain the frequency domain representations of two discrete-time signals f and $\hat { \mathbf { f } } .$ , we introduce a Fourier-based reconstruction loss as follows:
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\mathcal { L } _ { \mathrm { F F T } } = \frac { 1 } { N } \sum _ { k = 0 } ^ { N - 1 } \| F _ { k } - \hat { F } _ { k } \| .
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
Here, we utilized the PyTorch implementation of the FFT to obtain the DFT for each signal. It is important to note that the DFT is only well-defined for regularly sampled signals. In the case of this work, the discrete-time signal f is obtained by deterministically sampling the function $f ( t )$ via a discretized grid of time steps $t \in \{ 0 , 1 , \ldots , N \}$ .
|
| 273 |
+
|
| 274 |
+
# D IMPLEMENTATION $\&$ REPRODUCIBILITY DETAILS
|
| 275 |
+
|
| 276 |
+
# D.1 BASELINES
|
| 277 |
+
|
| 278 |
+
We use the following methods with publicly available code as benchmark for our method:
|
| 279 |
+
|
| 280 |
+
• Fourier Flows (Alaa et al., 2021): https://github.com/ahmedmalaa/Fourier-flows • TimeGAN (Yoon et al., 2019): https://github.com/jsyoon0823/TimeGAN • GT-GAN(Jeon et al., 2022): https://github.com/Jinsung-Jeon/GT-GAN • RCGAN (Esteban et al., 2017): https://github.com/3778/Ward2ICU • LS4(Zhou et al., 2023): https://github.com/alexzhou907/ls4/tree/main • DiffTime(Coletta et al., 2023): https://arxiv.org/abs/2307.01717
|
| 281 |
+
|
| 282 |
+
We adapted TimeGAN, RCGAN, and GT-GAN for longer time-series by setting the hidden dimensions to be equal to the time-series length, as suggested by authors and empirically evaluated. Moreover, we improve RCGAN discriminator to handle longer time-series more effectively using the CSDI transformer architecture (Tashiro et al., 2021). For DiffTime we reach out the authors to get access to their code, and to handle missing data we dynamically mask the input time-series to let the model learn to reconstruct the whole original time-series, similarly to CSDI approach for imputation (Tashiro et al., 2021).
|
| 283 |
+
|
| 284 |
+
# D.2 IMPLEMENTATION DETAILS
|
| 285 |
+
|
| 286 |
+
iHyperTime is composed of a set encoder, three decoder (hypernetworks) whose outputs corresponds to the weights of each of the blocks in TSNet. Below we explain each component in detail.
|
| 287 |
+
|
| 288 |
+
Set Encoder The set encoder is a SIREN with two hidden layers of 128 neurons and an output layer (embedding) of 40 neurons. It takes as input an arbitrary set of tuples $\{ ( t _ { i } , \mathbf { y } _ { i } ) \} _ { i = 1 } ^ { N }$ , where $t$ denotes the time-coordinate and $\mathbf { y } _ { i }$ the corresponding univariate or multivariate time series value. We use a single floating point value as temporal coordinate (time $t$ ). As data pre-processing, the values are scaled to the interval $\lfloor - 1 , 1 \rfloor$ , with a common global factor for all time series of a dataset. MinMax scaling is also applied to the time series amplitudes, although in the interval $[ 0 , 1 ]$ . In all cases, regardless of sequence length, the time series is fed to the set encoder as a single set, and is hence converted into a single embedding $Z$ .
|
| 289 |
+
|
| 290 |
+
Decoder (Hypernetwork) Each decoder block (hypernetwork) is a one-layer MLP with ReLU activations, with a hidden layer of dimension 128. The output of each hypernetwork is a vector that contains the weights of its corresponding decomposition block. Table 9 shows the dimension details, where $n _ { t }$ , $n _ { S }$ and $n _ { R }$ correspond to the number of weights in the trend, seasonality and residuals blocks, which form TSNet.
|
| 291 |
+
|
| 292 |
+
Table 9: Architecture of the hypernetworks in the decoder.
|
| 293 |
+
|
| 294 |
+
<table><tr><td>Hypernet block</td><td>Design</td><td>Input size</td><td>Output size</td></tr><tr><td rowspan="2">Trend Hypernet</td><td>Relu</td><td>10</td><td>128</td></tr><tr><td>Linear</td><td>128</td><td>nT</td></tr><tr><td rowspan="2">Season Hypernet</td><td>Relu</td><td>15</td><td>128</td></tr><tr><td>Linear</td><td>128</td><td>ns</td></tr><tr><td rowspan="2">Res. Hypernet</td><td>Relu</td><td>15</td><td>128</td></tr><tr><td>Linear</td><td>128</td><td>nR</td></tr></table>
|
| 295 |
+
|
| 296 |
+
TSnet Architecture TSnet is an implicit neural representation of univariate/multivariate time series data. It is composed of three distinctive blocks that perform a trend-seasonality-residual additive decomposition of the time series signal. Table 10 shows the network details of each component of TSNet. In the trend block, $p$ corresponds to the degree of the polynomial, $L$ corresponds to the max length of the time series, and $m$ corresponds to the number of features.
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 6: Diagram of the TSnet architecture.
|
| 300 |
+
|
| 301 |
+
Table 10: Architecture of TSNet.
|
| 302 |
+
|
| 303 |
+
<table><tr><td></td><td>Layer</td><td>Design</td><td> Input size</td><td>Output size</td></tr><tr><td>Trend block</td><td>1</td><td>Linear</td><td>p</td><td>m</td></tr><tr><td>Seasonality block</td><td>1</td><td>Linear</td><td>L</td><td>m</td></tr><tr><td>Residual block</td><td>1</td><td> Sine(Linear)</td><td>1</td><td>60</td></tr><tr><td></td><td>2</td><td>Sine(Linear)</td><td>60</td><td>60</td></tr><tr><td></td><td>3</td><td>Sine(Linear)</td><td>60</td><td>60</td></tr><tr><td></td><td>4</td><td>Sine(Linear)</td><td>60</td><td>60</td></tr><tr><td></td><td>5</td><td>Linear</td><td>60</td><td>m</td></tr></table>
|
| 304 |
+
|
| 305 |
+
Training The training of iHT is performed in three stages to improve stability: 1) we train the Trend HyperNetwork, Trend Block for 100 epochs, computing the MSE loss between the ground truth time series y and the output of the block: $\begin{array} { r } { \mathcal { L } _ { 1 } = \sum _ { i } \Vert y _ { i } - \hat { f } _ { \mathrm { t r } } ( t ) \Vert ^ { 2 } } \end{array}$ . This leads to a smooth approximation of the time series, which we use as initial guess for the second stage. 2) We then train the Trend and Seasonality blocks together, computing the MSE reconstruction loss $\mathcal { L } _ { \mathrm { r e c } }$ and the FFT loss $\mathcal { L } _ { \mathrm { F F T } }$ between the ground truth and the added output of both TSnet blocks. 3) Finally, we train the three blocks together.
|
| 306 |
+
|
| 307 |
+
• Stage 1 training: – Number of epochs: 100 – Learning rate: $1 e - 3$
|
| 308 |
+
• Stage 2 training: – Number of epochs: 150 – Learning rate: 5e − 5
|
| 309 |
+
• Stage 3 training: – Number of epochs: 150 – Learning rate: 5e − 5
|
| 310 |
+
• Batch size: 256
|
| 311 |
+
$\begin{array} { l } { \bullet \lambda _ { 1 } = 1 . 0 \times 1 0 ^ { - 3 } } \\ { \bullet \lambda _ { 2 } = 1 . 0 } \\ { \bullet \lambda _ { 3 } = 1 . 0 \times 1 0 ^ { - 2 } } \end{array}$
|
| 312 |
+
|
| 313 |
+
We train Energy24, Stock24, Stock72, Stock360 and Solar Weekly datasets for 400 epochs, with Adam optimizer. For the NN5 daily, and Fred MD datasets we trained for 500 epochs, and for the Temperature Rain dataset we train iHT for 1500 epochs.
|
| 314 |
+
|
| 315 |
+
Hardware and Software We implement our method in Python and the experiments are ran using a g4dn.2xlarge AWS instance with a NVIDIA T4 GPU, 8 CPU and 32gb of RAM.
|
| 316 |
+
|
| 317 |
+
# E ADDITIONAL EXPERIMENTAL RESULTS ON REAL-WORLD TIME SERIES SYNTHESIS
|
| 318 |
+
|
| 319 |
+
We show additional comparisons of time series synthesis the four Monash datasets in Table 11. Out method still shows competitive results across most datasets, with best predictive score in three cases, only loosing against Latent ODE in the FRED-MD dataset.
|
| 320 |
+
|
| 321 |
+
<table><tr><td>Data</td><td>Metric</td><td>RNN-VAE</td><td>GP-VAE</td><td>ODE²VAE</td><td>Latent ODE</td><td>TimeGAN</td><td>SDEGAN</td><td>SaShiMi</td><td>LS4</td><td>iHT(Ours)</td></tr><tr><td>FRED-MD</td><td>Marginal ↓</td><td>0.132</td><td>0.152</td><td>0.122</td><td>0.0416</td><td>0.0813</td><td>0.0841</td><td>0.0482</td><td>0.0221</td><td>0.0177</td></tr><tr><td></td><td>Class. ↑</td><td>0.0362</td><td>0.0158</td><td>0.0282</td><td>0.327</td><td>0.0294</td><td>0.501</td><td>0.00119</td><td>0.544</td><td>1.3278</td></tr><tr><td></td><td>Prediction ↓</td><td>1.47</td><td>2.05</td><td>0.567</td><td>0.0132</td><td>0.0575</td><td>0.677</td><td>0.232</td><td>0.0373</td><td>0.0181</td></tr><tr><td>NN5 Daily</td><td>Marginal ↓</td><td>0.137</td><td>0.117</td><td>0.211</td><td>0.107</td><td>0.0396</td><td>0.0852</td><td>0.0199</td><td>0.00671</td><td>0.00893</td></tr><tr><td></td><td>Class. 个</td><td>0.000339</td><td>0.00246</td><td>0.00102</td><td>0.000381</td><td>0.00160</td><td>0.0852</td><td>0.0446</td><td>0.636</td><td>0.4982</td></tr><tr><td></td><td>Prediction ↓</td><td>0.967</td><td>1.169</td><td>1.19</td><td>1.04</td><td>1.34</td><td>1.01</td><td>0.849</td><td>0.241</td><td>0.2349</td></tr><tr><td>Temp Rain</td><td>Marginal↓</td><td>0.0174</td><td>0.183</td><td>1.831</td><td>0.0106</td><td>0.498</td><td>0.990</td><td>0.758</td><td>0.0834</td><td>0.2978</td></tr><tr><td></td><td>Class. 个</td><td>0.00000212</td><td>0.0000123</td><td>0.0000319</td><td>0.0000419</td><td>0.00271</td><td>0.0169</td><td>0.0000167</td><td>0.976</td><td>11.2493</td></tr><tr><td></td><td>Prediction ↓</td><td>159</td><td>2.305</td><td>1.133</td><td>145</td><td>1.96</td><td>2.46</td><td>2.12</td><td>0.521</td><td>0.132</td></tr><tr><td>Solar Weekly</td><td>Marginal↓</td><td>0.0903</td><td>0.308</td><td>0.153</td><td>0.0853</td><td>0.0496</td><td>0.147</td><td>0.173</td><td>0.0459</td><td>0.03273</td></tr><tr><td></td><td>Class. ↑</td><td>0.0524</td><td>0.000731</td><td>0.0998</td><td>0.0521</td><td>0.6489</td><td>0.591</td><td>0.00102</td><td>0.683</td><td>1.2413</td></tr><tr><td></td><td>Prediction ↓</td><td>1.25</td><td>1.47</td><td>0.761</td><td>0.973</td><td>0.237</td><td>0.976</td><td>0.578</td><td>0.141</td><td>0.0739</td></tr></table>
|
| 322 |
+
|
| 323 |
+
Table 11: Generation results on FRED-MD, NN5 Daily, Temperature Rain, and Solar Weekly.
|
| 324 |
+
|
| 325 |
+
# F TRAINING TIME COMPARISON
|
| 326 |
+
|
| 327 |
+
Table 12 shows the training time of iHT and all the other baselines for the Energy and Stock datasets. iHT has the lowest training time across all datasets, with Fourier Flows having a similar performance in the Stock datasets. In the case of Energy, given that Fourier Flows trains on each feature separately, this sequential training increases the computational time because of the large number of features present in the dataset. The training times of TimeGAN and GTGAN are orders of magnitude larger for the datasets with the longest time series, in the case of TimeGAN because it based on RNNs, whilst GTGAN’s needs to solve various differential equations.
|
| 328 |
+
|
| 329 |
+
# G ADDITIONAL TREND-SEASONALITY DECOMPOSITION ANALYSIS
|
| 330 |
+
|
| 331 |
+
In this section we provide further details of the analysis of iHT decomposition.
|
| 332 |
+
|
| 333 |
+
Synthetic dataset We generated time series datasets that have trend (T), seasonal (S) and noise (R) components, or a combination of two of them. The trend was generated by randomly choosing the degree of the polynomial, a sign and a slope. A code example with the parameters is shown in Code Snippet 1. To model the seasonality component we use a Sine function with the frequency sampled uniformly within [1,10]. Finally, for the residual component we used Gaussian noise, with the standard deviation sampled between 0 and 0.2. For each dataset, we generated 2000 time series of 200 time steps. Figure 7 shows examples of each dataset.
|
| 334 |
+
|
| 335 |
+
Table 12: Comparison of training time. iHT shows the shortest training time on all datasets.
|
| 336 |
+
Code Snippet 1: Trend generation
|
| 337 |
+
|
| 338 |
+
<table><tr><td> Training Time (HH:MM)</td><td>Energy24</td><td>Stock24</td><td>Stock72</td><td>Stock360</td></tr><tr><td>iHT (Ours)</td><td>00:15</td><td>00:03</td><td>00:03</td><td>00:04</td></tr><tr><td>GTGAN</td><td>10:39</td><td>12:20</td><td>04:32</td><td>21:23</td></tr><tr><td>TimeGAN</td><td>12:28</td><td>11:40</td><td>34:30</td><td>65:00</td></tr><tr><td>FourierFlows</td><td>02:48</td><td>00:07</td><td>00:03</td><td>00:05</td></tr><tr><td>LS4</td><td>04:19</td><td>00:57</td><td>01:16</td><td>02:09</td></tr><tr><td>DiffTime</td><td>17:03</td><td>02:52</td><td>01:42</td><td>02:13</td></tr></table>
|
| 339 |
+
|
| 340 |
+
1 def generate_trend():
|
| 341 |
+
2 trend_slope $=$ np.random.uniform(1.5,2)
|
| 342 |
+
3 degree $=$ np.random.choice([1,2,3])
|
| 343 |
+
4 sign $=$ np.random.choice((-1, 1))
|
| 344 |
+
5 trend $=$ sign $\star$ (trend_slope\*regular_time_samples) $\star \star$ degree
|
| 345 |
+
6 return trend
|
| 346 |
+
|
| 347 |
+
Table 13, we compare iHT with STL (exact) and STL (approx), in the previous dataset TSR, $\mathrm { T } { \mathrm { + R } }$ , $\mathbf { T } { \mathrel { + } } S$ the additional dataset of $\mathbf { S } { \mathrm { + R } }$ dataset. We can observe that in the $\mathrm { S } { \mathrm { + R } }$ dataset iHT shows the worst performance in all three components. Interestingly, both STL (exact) and STL (approx) show higher errors than in the other datasets, showing that this is a more challenging case.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 7: Example of synthetic datasets with trend (T), seasonal (S) and noise (R) components, or a combination of two of them.
|
| 351 |
+
|
| 352 |
+
<table><tr><td>MSE (×10-3)</td><td>STL (exact)</td><td>TSR STL (approx)</td><td>iHT (Ours)</td><td>STL (exact)</td><td>T+R</td><td></td><td></td><td>T+S</td><td></td><td></td><td>S+R</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>STL (approx)</td><td>iHT (Ours)</td><td>STL (exact)</td><td>STL (approx)</td><td>iHT (Ours)</td><td>STL (exact)</td><td>STL (approx)</td><td>iHT (Ours)</td></tr><tr><td>Trend Seasonality</td><td>0.46 ± 2.08 0.57 ± 2.1</td><td>1.04 ± 4.69 1.19 ± 4.73</td><td>0.6±0.5 1.21 ± 0.68</td><td>0.07 ± 0.07 0.03 ±0.02</td><td>1.26 ± 5.7 1.35 ± 5.74</td><td>0.2 ± 0.27 0.17 ± 0.29</td><td>0.46 ± 2.1 0.44 ± 2.09</td><td>1.17 ± 5.12 1.18 ± 5.11</td><td>0.46 ± 0.48 1.25 ± 0.77</td><td>0.18 ± 0.19 2.54 ± 2.68</td><td>0.71 ± 1.9 3.89 ± 3.93</td><td>8.11 ± 8.31 14.86 ± 11.49</td></tr><tr><td>Residuals</td><td>0.17 ± 0.15</td><td>0.18 ± 0.12</td><td>1.29 ± 0.62</td><td>0.15 ± 0.09</td><td>0.18 ± 0.13</td><td>0.41 ± 0.26</td><td>0.03 ± 0.1</td><td>0.04 ± 0.07</td><td>1.25 ± 0.71</td><td>2.64 ± 2.73</td><td>3.45 ± 3.07</td><td>13.98 ± 5.71</td></tr></table>
|
| 353 |
+
|
| 354 |
+
Table 13: Ablation study for trend-seasonality-residual decomposition of time series. We compare iHT against STL decomposition, for three dataset configurations: trend+seasonality $\left( \mathrm { T } { + } \mathrm { S } \right)$ , trend+residual $( \mathrm { T } + \mathrm { R } )$ , seasonality+residual $( \mathsf { S } { + } \mathsf { R } )$ and all three components (TSR).
|
| 355 |
+
|
| 356 |
+
In Figures 8, 9, 10 and 11 we show the evaluation of the output of iHT for each dataset. The first three plots on each row correspond to the distribution of trend, seasonality and residuals outputs from iHT against the ground truth components. We can see in Figures 9 and 10 that for the $\mathrm { T } { + } \boldsymbol { \mathrm { S } }$ and $\mathrm { T } { \ + } \mathbf { R }$ datasets, the trend shows good agreement, and in the case of no residuals, we observe a narrow distribution close to zero, while in the case of no seasonality, the frequency histogram is also very narrow around zero. In Figure 11, which corresponds to $_ { \mathrm { S + R } }$ we can observe that the distribution of trend is quite broad, and this is in line with the results on Table 13. Even in the seasonality distribution we can observe a slightly worse match with regards to the other cases. The plots on the right show the learned representations via t-SNE of the embeddings. We can still observe a separation in trend up and down on the $\mathrm { T } { \ + } \mathbf { R }$ dataset, although the separation in high and low frequency in the $_ { \mathrm { S + R } }$ plot is less obvious.
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
Figure 8: (a,b,c): Distribution of the trend, seasonality and residual outputs of iHT vs ground truth. (d,e): t-SNE visualization of trend and seasonality embeddings in iHT for the TSR dataset.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 9: (a,b,c): Distribution of the trend, seasonality and residual outputs of iHT vs ground truth. (d,e): t-SNE visualization of trend and seasonality embeddings in iHT for the $\mathrm { T } { + } \boldsymbol { \mathrm { S } }$ dataset.
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure 10: (a,b,c): Distribution of the trend, seasonality and residual outputs of iHT vs ground truth. (d): t-SNE visualization of trend embeddings in iHT for the $\mathrm { T } { \ + } \mathbf { R }$ dataset.
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
Figure 11: (a,b,c): Distribution of the trend, seasonality and residual outputs of iHT vs ground truth. (d): t-SNE visualization of seasonality embeddings in iHT for the $_ { \mathrm { S + R } }$ dataset.
|
| 369 |
+
|
| 370 |
+
# H TIME SERIES GENERATION USING TREND COMPONENT
|
| 371 |
+
|
| 372 |
+
Here we consider a peculiar capability of iHT that enables the user to provide an input trend component to generate time-series accordingly. iHT generates new time series by performing interpolation in the embedding space between two time series, and then generating the novel weights of TSNet that represents the novel time series. This allows us to control the generation by projecting a desired trend pattern in iHT to use in the generation process. To evaluate the performance of this guided generation, we use iHT trained on Stock24. We provide an input trend and generate 1000 time series using iHT. In this experiment we consider the following baselines: DiffTime, RCGAN, TimeGAN, GT-GAN. While DiffTime (Coletta et al., 2023) is naturally designed for constrained time-series generation, we adapted RCGAN, TimeGAN, GT-GAN architectures to deal with the input trend. In detail, we re-trained them as conditioned models using an additional input trend, computed as a polynomial interpolation from original data during the training. In Figure 12 we show how the generated time-series follow the trend. For each approach we generate 1000 samples and we plot their 5-95th percentile values as the light-blue shaded area, while trend is the dotted orange line. In Table 14 we report the quantitative metrics, which evaluate how much each generated time-series deviate from the input trend by computing the L2 distance and Dynamic-Time-Warping (DTW) distance between the generated sample and the input trend. The results show that iHT has among the best performance and it is competitive w.r.t. to DiffTime, which is specifically designed to incorporate such trend constraints.
|
| 373 |
+
|
| 374 |
+
Table 14: Time-Series Trend Generation on Stock24 dataset.
|
| 375 |
+
|
| 376 |
+
<table><tr><td>Alg0</td><td>L2 Distance</td><td>DTW Distance</td></tr><tr><td>iHT (Ours)</td><td>23.68±18.6</td><td>14.43±13.60</td></tr><tr><td>DiffTime</td><td>19.83±5.40</td><td>15.42±4.79</td></tr><tr><td>GT-GAN</td><td>1304.2±1026.9</td><td>1303.9±1303.1</td></tr><tr><td>TimeGAN</td><td>88.18±12.10</td><td>87.29±12.35</td></tr><tr><td>RCGAN</td><td>60.56±9.20</td><td>32.94±6.05</td></tr></table>
|
| 377 |
+
|
| 378 |
+
Figure 12 shows additional qualitative results using iHT trained on Stock72 with a wide diversity of input trends. We can see that in all cases, the input trend is within the 5-95th percentile values of the generated time series, showing a good agreement of the synthetic time series with the input trend.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 12: A visualizations of time-series generated according the input Trend. The orange dotted time-series is the trend, and the shaded blue area shows the $5 \%$ and $9 5 \%$ percentiles of the generated synthetic time-series. Our approaches show among the best performance with time-series closer to the input trend.
|
| 382 |
+
|
| 383 |
+
# I VISUALIZATIONS WITH TSNE AND DATA DISTRIBUTIONS
|
| 384 |
+
|
| 385 |
+
In this section we report an additional evaluation of the synthetic and real data distributions. We evaluate the synthetic distributions on Stock24, including missing data from $30 \%$ to $70 \%$ ; then we analyse synthetic data on longer stock time-series, i.e., stock72 and stock360; and finally we evaluate the synthetic distributions for Energy data, which has 28 dimensions.
|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
Figure 13: A visualizations of time-series generated by iHT according to an input Trend, on the Stock72 dataset. The orange dotted time-series is the trend, and the shaded blue area shows the $5 \%$ and $9 5 \%$ percentiles of the generated synthetic time-series.
|
| 389 |
+
|
| 390 |
+
# I.1 DATA DISTRIBUTION
|
| 391 |
+
|
| 392 |
+
First we plot the real (blue) and synthetic (orange) distributions empirically evaluated through a kernel-density estimation of real and generated data. Figure 14 shows the empirical distributions for Stock24, where iHT has among the closest match with original data. The superior performance of iHT is more evident with irregular data, from Figure 15 to Figure 17, where iHT is always able to closely resemble the real data distributions.
|
| 393 |
+
|
| 394 |
+
The performance of iHT is consistent with longer time-series (Figure 18 and Figure 19) and highly dimensional data like Energy in Figure 20.
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
Figure 14: Data distribution on Stock24 data.
|
| 398 |
+
|
| 399 |
+
# I.2 TSNE VISUALIZATION
|
| 400 |
+
|
| 401 |
+
We now evaluate the real (blue) and synthetic (red) distributions through t-SNE visualizations. Figure 21 shows the t-SNE plots for Stock24, where iHT has among the best performance (i.e., the synthetic data almost completely overlap with real data). As mentioned in the previous section, the superior performance of iHT is more evident with irregular data, from Figure 22 to Figure 24, where iHT is the only method to closely resemble the real data distribution. While GT-GAN reproduces similarly the real data distributions, the synthetic distributions are more condensed around the original data, and don’t cover the full space.
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 15: Data distribution on irregular Stock24 data (Missing $70 \%$ ).
|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
Figure 16: Data distribution on irregular Stock24 data (Missing $50 \%$ ).
|
| 408 |
+
|
| 409 |
+

|
| 410 |
+
Figure 17: Data distribution on irregular Stock24 data (Missing $30 \%$ ).
|
| 411 |
+
|
| 412 |
+

|
| 413 |
+
Figure 18: Data distribution on regular Stock72 data.
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 19: Data distribution on regular Stock360 data.
|
| 417 |
+
|
| 418 |
+
For longer time-series (Figure 25 and Figure 26) the t-SNE plots show that iHT is able to better reproduce the original data distributions. Finally, Figure 27 shows the t-SNE plots for energy data where with consistent performance for iHT.
|
| 419 |
+
|
| 420 |
+

|
| 421 |
+
Figure 20: Data distribution on Energy data.
|
| 422 |
+
|
| 423 |
+

|
| 424 |
+
Figure 21: t-SNE visualizations on Stock24 data, where a greater overlap of blue and red dots shows a better distributional-similarity between the generated data and original data. Our approach shows the best performance.
|
| 425 |
+
|
| 426 |
+

|
| 427 |
+
Figure 22: t-SNE visualizations on irregular Stock24 data (Missing $70 \%$ ), where a greater overlap of blue and red dots shows a better distributional-similarity between the generated data and original data. Our approach shows the best performance.
|
| 428 |
+
|
| 429 |
+

|
| 430 |
+
Figure 23: t-SNE visualizations on irregular Stock24 data (Missing $5 0 \%$ ), where a greater overlap of blue and red dots shows a better distributional-similarity between the generated data and original data. Our approach shows the best performance.
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 24: t-SNE visualizations on irregular Stock24 data (Missing $30 \%$ ), where a greater overlap of blue and red dots shows a better distributional-similarity between the generated data and original data. Our approach shows the best performance.
|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
Figure 25: t-SNE visualizations on Stock72 data, where a greater overlap of blue and red dots shows a better distributional-similarity between the generated data and original data. Our approach shows the best performance.
|
| 437 |
+
|
| 438 |
+

|
| 439 |
+
Figure 26: t-SNE visualizations on Stock360 data, where a greater overlap of blue and red dots shows a better distributional-similarity between the generated data and original data. Our approach shows the best performance.
|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
Figure 27: t-SNE visualizations on Energy data, where a greater overlap of blue and red dots shows a better distributional-similarity between the generated data and original data. Our approach shows the best performance.
|
| 443 |
+
|
| 444 |
+
# J FINANCIAL RETURNS AND AUTOCORRELATION
|
| 445 |
+
|
| 446 |
+
We now evaluate the distributions of two well known properties (i.e., stylized facts) of financial time-series, namely the returns and autocorrelation. We consider stock uni-variate data with length of 72. Figure 28 and Figure 29 show the returns and the autocorrelation of returns distributions, respectively. The two figures confirm the ability of iHT to learn the real data properties (i.e., the real and synthetic distributions mostly overlap).
|
| 447 |
+
|
| 448 |
+

|
| 449 |
+
Figure 28: Returns distribution of stock time-series with length 72.
|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
Figure 29: Autocorrelation of returns distributions of stock time-series with length 72.
|
| 453 |
+
|
| 454 |
+
# K VISUALIZATIONS OF GENERATED SAMPLES
|
| 455 |
+
|
| 456 |
+
Finally we report examples of generated time-series. It is worth to mention that in Figure 30 the synthetic time-series from iHT effectively respect the open-high-low-close relationship from the real data – high (low) is the highest (lowest) series. Such data property is preserved also when the model is trained on missing data, as shown in Figure 31, Figure 32, and Figure 33. With the exception of DiffTime, which is specifically designed for constrained time-series generation, most of the existing approaches do not preserve such property.
|
| 457 |
+
|
| 458 |
+
Energy data is shown in Figure 34 for regular time-series, and in Figure 35, Figure 36, and Figure 37 for irregular time-series. Considering that Energy has 28 features, with different scales, we plot only the first 5 normalized features.
|
| 459 |
+
|
| 460 |
+
Finally, we plot longer-times for regular stock72 in Figure 38. While we plot the irregular stock72 in Figure 39, Figure 40, and Figure 41.
|
| 461 |
+
|
| 462 |
+

|
| 463 |
+
Figure 30: An example of Regular Stock24 samples.
|
| 464 |
+
|
| 465 |
+

|
| 466 |
+
Figure 31: An example of Irregular Stock24 samples $7 0 \%$ missing data).
|
| 467 |
+
|
| 468 |
+

|
| 469 |
+
Figure 32: An example of Irregular Stock24 samples $5 0 \%$ missing data).
|
| 470 |
+
|
| 471 |
+

|
| 472 |
+
Figure 33: An example of Irregular Stock24 samples $3 0 \%$ missing data).
|
| 473 |
+
|
| 474 |
+

|
| 475 |
+
Figure 34: An example of Regular Energy24 samples.
|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
Figure 35: An example of Irregular Energy24 samples $7 0 \%$ missing data).
|
| 479 |
+
|
| 480 |
+

|
| 481 |
+
Figure 36: An example of Irregular Energy24 samples $5 0 \%$ missing data).
|
| 482 |
+
|
| 483 |
+

|
| 484 |
+
Figure 37: An example of Irregular Energy24 samples $3 0 \%$ missing data).
|
| 485 |
+
|
| 486 |
+

|
| 487 |
+
Figure 38: An example of Regular Stock72 samples.
|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
Figure 39: An example of Irregular Stock72 samples $7 0 \%$ missing data).
|
| 491 |
+
|
| 492 |
+

|
| 493 |
+
Figure 40: An example of Irregular Stock72 samples $5 0 \%$ missing data).
|
| 494 |
+
|
| 495 |
+

|
| 496 |
+
Figure 41: An example of Irregular Stock72 samples $3 0 \%$ missing data).
|
| 497 |
+
|
| 498 |
+
SUPPLEMENTAL REFERENCES
|
| 499 |
+
|
| 500 |
+
Andrew Brock, Theo Lim, J.M. Ritchie, and Nick Weston. SMASH: One-shot model architecture search through hypernetworks. In ICLR, 2018.
|
| 501 |
+
Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In CVPR, June 2019.
|
| 502 |
+
Jacob Russin Russin, Randall O’Reilly, and Yoshua Bengio Bengio. Deep learning needs a prefrontal cortex. In Bridging AI and Cognitive Science ICLR 2020 Workshop, 2020.
|
| 503 |
+
Andrei A. Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. In ICLR, 2019.
|
| 504 |
+
Kenneth O. Stanley, David B. D’Ambrosio, and Jason Gauci. A Hypercube-Based Encoding for Evolving Large-Scale Neural Networks. Artificial Life, 15(2):185–212, 04 2009.
|
| 505 |
+
Matthew Tancik, Ben Mildenhall, Terrance Wang, Divi Schmidt, Pratul P. Srinivasan, Jonathan T. Barron, and Ren Ng. Learned initializations for optimizing coordinate-based neural representations. In CVPR, 2021.
|
| 506 |
+
Yusuke Tashiro, Jiaming Song, Yang Song, and Stefano Ermon. Csdi: Conditional score-based diffusion models for probabilistic time series imputation. NeurIPS, 34:24804–24816, 2021.
|
| 507 |
+
Johannes von Oswald, Christian Henning, Benjamin F. Grewe, and Joao Sacramento. Continual ˜ learning with hypernetworks. In ICLR, 2020.
|
| 508 |
+
Chris Zhang, Mengye Ren, and Raquel Urtasun. Graph hypernetworks for neural architecture search. In ICLR, 2019.
|
| 509 |
+
Dominic Zhao, Seijin Kobayashi, Joao Sacramento, and Johannes von Oswald. Meta-learning via ˜ hypernetworks. In 4th Workshop on Meta-Learning at NeurIPS 2020 (MetaLearn 2020). NeurIPS, 2020. doi: 10.3929/ethz-b-000465883.
|
md/train/5CGPY2VeEGb/5CGPY2VeEGb.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Semi-Supervised Semantic Segmentation via Adaptive Equalization Learning
|
| 2 |
+
|
| 3 |
+
Hanzhe $\mathbf { H } \mathbf { u } ^ { 1 , 4 * }$ Fangyun Wei2† Han $\mathbf { H } \mathbf { u } ^ { 2 }$ Qiwei $\mathbf { Y e } ^ { 2 }$ Jinshi Cui1 Liwei Wang1,3†
|
| 4 |
+
|
| 5 |
+
1Key Laboratory of Machine Perception (MOE), School of EECS, Peking University 2Microsoft Research Asia 3Institute for Artificial Intelligence, Peking University 4Zhejiang Lab huhz@pku.edu.cn {fawe, hanhu, qiwye}@microsoft.com {cjs, wanglw}@cis.pku.edu.cn
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Due to the limited and even imbalanced data, semi-supervised semantic segmentation tends to have poor performance on some certain categories, e.g., tailed categories in Cityscapes dataset which exhibits a long-tailed label distribution. Existing approaches almost all neglect this problem, and treat categories equally. Some popular approaches such as consistency regularization or pseudo-labeling may even harm the learning of under-performing categories, that the predictions or pseudo labels of these categories could be too inaccurate to guide the learning on the unlabeled data. In this paper, we look into this problem, and propose a novel framework for semi-supervised semantic segmentation, named adaptive equalization learning (AEL). AEL adaptively balances the training of well and badly performed categories, with a confidence bank to dynamically track category-wise performance during training. The confidence bank is leveraged as an indicator to tilt training towards under-performing categories, instantiated in three strategies: 1) adaptive Copy-Paste and CutMix data augmentation approaches which give more chance for under-performing categories to be copied or cut; 2) an adaptive data sampling approach to encourage pixels from under-performing category to be sampled; 3) a simple yet effective re-weighting method to alleviate the training noise raised by pseudo-labeling. Experimentally, AEL outperforms the state-of-the-art methods by a large margin on the Cityscapes and Pascal VOC benchmarks under various data partition protocols. Code is available at https://github.com/hzhupku/SemiSeg-AEL.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Supervised semantic segmentation requires pixel-level labeling, which is expensive and timeconsuming. This paper is interested in semi-supervised semantic segmentation, which can greatly reduce the efforts of pixel-level annotation, yet may maintain reasonably high accuracy. One problem of common semantic segmentation datasets is that the pixel categories tend to be imbalanced, e.g., the pixel amount of head classes can be hundreds of times larger than that of tailed classes in the widely used Cityscapes dataset [1]. The situation is more serious in the semi-supervised setting where tailed classes may have extremely few samples. We note that recent approaches are mainly dedicated to the design of consistency regularization [2, 3, 4, 5, 6, 7] and pseudo-labeling [8], almost all of which neglect the imbalance problem and treat each category equally, leading to a biased training. These approaches may even harm the learning of tailed classes, as inaccurate predictions or pseudo labels of under-performing categories could falsely guide the learning on unlabeled data.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: We count the the training samples of each category on Cityscapes train set under 1/16 and 1/32 data partition protocols, and compare the proposed AEL with a strong semi-supervised learning baseline described in Section 3.2 which treats each category equally. Our method strives to tilt training towards tailed categories which usually tend to be under-performing.
|
| 17 |
+
|
| 18 |
+
This paper aims to alleviate this biased training problem. We propose a novel Adaptive Equalization Learning (AEL) framework, which adaptively balance the training of different categories as shown in Figure 1. Our design follows two main principles: 1) increasing the proportion of training samples from the under-performing categories; 2) tilting training towards under-performing categories. Concretely, we maintain a confidence bank to dynamically record the category-wise performance at each training step, which indicates the current performance of each category. Following principle 1), we propose two data augmentation approaches named adaptive Copy-Paste and adaptive CutMix, which give more chance for under-performing categories to be copied or cut. Following principle 2), we present an adaptive equalization sampling strategy to encourage pixels from under-performing categories to be sufficiently trained. In addition, we also introduce a simple yet effective re-weighting strategy which takes the model predictions into account to alleviate the issue that semi-supervised learning usually suffers from the training noise.
|
| 19 |
+
|
| 20 |
+
Experimentally, by using the DeepLabv $^ { 3 + }$ with ResNet-101 backbone, the proposed AEL outperforms state-of-the-art methods by a large margin on the Cityscapes and PASCAL VOC 2012 benchmarks under various data partition protocols. Specifically, it achieves $7 4 . 2 8 \%$ , $7 5 . 8 3 \%$ and $7 7 . 9 0 \%$ on Cityscapes dataset under 1/32, 1/16 and 1/8 protocols, which is $+ 1 6 . 3 9 \%$ , $+ 1 2 . 8 7 \%$ and $+ 8 . 0 9 \%$ better than the supervised baseline. When evaluated on PASCAL VOC 2012 benchmark, it achieves $7 6 . 9 7 \%$ , $7 7 . 2 0 \%$ and $7 7 . 5 7 \%$ under 1/32, 1/16 and 1/8 protocols, which is $+ 6 . 8 3 \%$ , $+ 6 . 6 0 \%$ and $+ 4 . 4 5 \%$ better than the supervised baseline. Moreover, the proposed approach also proves to improve the segmentation model trained on the full Cityscapes train set by $+ 1 . 0 3 \%$ by leveraging $5 , 0 0 0$ images from the Cityscapes coarse set as unlabeled data, achieving $8 1 . 9 5 \%$ .
|
| 21 |
+
|
| 22 |
+
# 2 Related Work
|
| 23 |
+
|
| 24 |
+
Semi-Supervised Learning. Recent years have witnessed a significant progress in the SSL field. Most of them can be categorized into consistency regularization, entropy minimization [9] and pseudo-labeling. Consistency regularization [10, 11, 12] enforces consistency in predictions between different views of unlabeled data. Pseudo-labeling [13, 14] trains the model on the unlabeled data with pseudo labels generated from the model’s own predictions. Furthermore, [10, 15, 16, 17, 18] use a low softmax temperature to sharpen the predictions of unlabeled set. Our method refers to Mean Teacher [11] and FixMatch [14] when designing our basic framework.
|
| 25 |
+
|
| 26 |
+
Semi-Supervised Semantic Segmentation. Existing semi-supervised semantic segmentation methods mainly focus on the design of consistency regularization and pseudo-labeling. Cutmix-Seg [2] applies CutMix augmentation on the unlabeled data. CCT [4] introduces a feature-level perturbation and enforces consistency among the predictions of different decoders. GCT [19] performs network perturbation by using two differently initialized segmentation models and encourages consistency between the predictions from the two models. PseudoSeg [8] focuses on improving the quality of pseudo labels. Though achieving satisfactory improvements over the supervised baseline, none of the aforementioned methods explore the biased learning issue in semi-supervised semantic segmentation.
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Figure 2: Overview of AEL. We adopt the teacher-student architecture as our basic framework. The teacher model is updated by the exponential moving average (EMA) of the student model. Confidence bank is uesd to dynamically record the category-wise performance during training. Adaptive CutMix and adaptive Copy-Paste are applied on the unlabeled and labeled data respectively to provide sufficient training samples from the under-performing categories. Adaptive equalization sampling (AES) encourages the training to involve more samples from the under-performing categories to make the training unbiased. Dynamic re-weighting strategy aims to alleviate the noise of pseudo-labeling.
|
| 30 |
+
|
| 31 |
+
Class Imbalance in Semi-Supervised Learning. Although SSL has been extensively studied, class imbalance problem in SSL is relatively under-explored, especially for semantic segmentation. Yang et al. [20] demonstrate that leveraging unlabeled data can alleviate imbalance issue. Hyun et al. [21] propose a suppressed consistency loss for class-imbalanced image classification problems. CReST [22] introduces a self-training framework for imbalanced SSL. Our method, though not explicitly targeting at the class imbalance problem, focuses on improving the performance of underperforming categories which are mostly tailed classes. Moreover, we refer to the ideas of resampling [23, 24] and re-weighting [25, 26], which are designed for class imbalance problem.
|
| 32 |
+
|
| 33 |
+
# 3 Method
|
| 34 |
+
|
| 35 |
+
Given a labeled set $\mathcal { D } ^ { l } = \{ ( \boldsymbol { \mathbf { \mathit { x } } } _ { i } ^ { l } , \boldsymbol { \mathbf { \mathit { y } } } _ { i } ^ { l } ) \}$ and an unlabeled set $\mathcal { D } ^ { u } = \{ \pmb { x } _ { i } ^ { u } \}$ , the objective of semisupervised semantic segmentation is to learn a segmentation model by efficiently leveraging both labeled and unlabeled data. In this section, we first present an overview of the proposed AEL in Section 3.1. Then we describe our basic framework for semi-supervised semantic segmentation in Section 3.2. Finally, the details of AEL are introduced in Section 3.3.
|
| 36 |
+
|
| 37 |
+
# 3.1 Overview
|
| 38 |
+
|
| 39 |
+
Figure 2 displays an overview of AEL, which is a data-efficient framework for semi-supervised semantic segmentation. It is composed of two parts: 1) a basic framework which contains a teacher model for pseudo-labeling and a student model for online learning; 2) dedicated modules which encourages the under-performing categories to be sufficiently trained by effectively leveraging both labeled and unlabeled data. We use the proposed confidence bank to dynamically record the categorywise performance during training, and thus we can easily identify which categories are not sufficiently trained. For those unsatisfactory categories, we present two data augmentation methods to increase their frequency of occurrence in a training batch, namely adaptive CutMix which is applied on the unlabeled data, and adaptive Copy-Paste which is applied on the labeled data. To make the model towards the unbiased learning, we propose the adaptive equalization sampling and dynamic re-weighting strategies to involve enough samples from the under-performing categories into the training, and alleviate the noise raised by pseudo-labeling simultaneously.
|
| 40 |
+
|
| 41 |
+
# 3.2 Basic Framework
|
| 42 |
+
|
| 43 |
+
We first set up a basic framework for semi-supervised semantic segmentation. The framework consists of a student model and a teacher model. The teacher model has the same architecture as the student model, but uses a different set of weights which are updated by exponential moving average (EMA) of the student model [11]. Following FixMatch [14], we use the teacher model to generate a set of pseudo labels $\hat { \mathcal { V } } = \{ \hat { y } _ { i } \}$ on the weakly augmented unlabeled data $\mathcal { D } ^ { u }$ . Subsequently, the student model is trained on both labeled data $\mathcal { D } ^ { l }$ (of weak augmentation) with the ground-truth and unlabeled data $\mathcal { D } ^ { u }$ (of strong augmentation) with the generated pseudo labels $\hat { \mathcal { V } }$ . We use standard random resize and random horizontal flip as the weak augmentation. Strong augmentation includes CutMix [27] and all data augmentation strategies used in the weak augmentation.
|
| 44 |
+
|
| 45 |
+
The overall loss consists of the supervised loss $\mathcal { L } _ { s }$ and the unsupervised loss $\mathcal { L } _ { u }$ :
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { l } { { \displaystyle { \mathcal { L } } _ { s } = \frac { 1 } { N _ { l } } \sum _ { i = 1 } ^ { N _ { l } } \frac { 1 } { W H } \sum _ { j = 1 } ^ { W H } \ell _ { c e } ( y _ { i j } , { p } _ { i j } ) } , } \\ { { \displaystyle { \mathcal { L } } _ { u } = \frac { 1 } { N _ { u } } \sum _ { i = 1 } ^ { N _ { u } } \frac { 1 } { W H } \sum _ { j = 1 } ^ { W H } \ell _ { c e } ( \hat { y } _ { i j } , { p } _ { i j } ) } , } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\pmb { p } _ { i j }$ is the prediction of the $j$ -th pixel in the $i$ -th labeled (or unlabeled) image, $N _ { l }$ and $N _ { u }$ denote the number of labeled images and unlabeled images in a training batch, $W$ and $H$ represent the width and height of the input image, and $\ell _ { c e }$ denotes the standard pixel-wise cross-entropy loss. We define the overall loss function as:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathcal { L } = \mathcal { L } _ { s } + \alpha \mathcal { L } _ { u } ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\alpha$ controls the contribution of the unsupervised loss.
|
| 58 |
+
|
| 59 |
+
# 3.3 Adaptive Equalization Learning
|
| 60 |
+
|
| 61 |
+
The baseline framework, though achieving competitive results compared with previous related works, neglects the key issues in semi-supervised semantic segmentation. Due to the limited labeled data, semi-supervised learning tends to have poor performance on some certain categories, e.g., tailed categories in Cityscapes dataset which exhibits a long-tailed label distribution. Insufficient training on these categories introduces more noise of pseudo labels which can disrupt the learning process. The proposed AEL framework aims to alleviate the degradation of under-performing categories during the semi-supervised training. Concretely, we maintain a confidence bank to record the performance of each category during training. The confidence bank enables us to identify the under-performing categories. To improve the performance of these categories and further make the training unbiased, we propose a series of technologies to efficiently leverage both labeled and unlabeled data, namely adaptive CutMix, adaptive Copy-Paste, adaptive equalization sampling and dynamic re-weighting.
|
| 62 |
+
|
| 63 |
+
Confidence Bank. To tackle the biased training, previous methods [25, 26, 22, 28] always rely on the prior knowledge such as the number of training samples of each category to design the ad hoc sampling and weighting strategies. However, the performance of each category is not always strictly proportional to the number of training samples, because some categories tend to have discriminative features and thus fewer samples are required for training. Inspired by the recent progress [29] which applies active learning on semantic segmentation, we propose to maintain a confidence bank to record the category-wise performance during training. An indicator is needed to assess the performance of each category.
|
| 64 |
+
|
| 65 |
+
We consider several indicators, namely Confidence, Margin and Entropy. Formally, we define Confidence indicator as:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathrm { C o n f } ^ { c } = \frac { 1 } { N _ { l } } \sum _ { i = 1 } ^ { N _ { l } } \frac { 1 } { N _ { i } ^ { c } } \sum _ { j = 1 } ^ { N _ { i } ^ { c } } p _ { i j } ^ { c } , c \in \{ 1 , \dots , C \}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $C$ is the category number, $N _ { i } ^ { c }$ denotes the number of pixels belonging to category $c$ according to its ground-truth ${ \bf { \it y } } _ { i } , { \bf { \it p } } _ { i j } ^ { c }$ denotes the $c$ -th channel prediction of the $j$ -th pixel in the $i$ -th image.
|
| 72 |
+
|
| 73 |
+
Define Margin indicator as:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathrm { M a r g i n } ^ { c } = \frac { 1 } { N _ { l } } \sum _ { i = 1 } ^ { N _ { l } } \frac { 1 } { N _ { i } ^ { c } } \sum _ { j = 1 } ^ { N _ { i } ^ { c } } ( p _ { i j } ^ { c } - \operatorname * { m a x } _ { c ^ { \prime } \in \{ 1 , \dots , C \} } p _ { i j } ^ { c ^ { \prime } } ) , ~ c \in \{ 1 , \dots , C \}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\mathrm { m a x 2 ( \cdot ) }$ denotes the second largest value operator. At last, we define Entropy indicator as:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathrm { E n t } ^ { c } = - \frac { 1 } { N _ { l } } \sum _ { i = 1 } ^ { N _ { l } } \frac { 1 } { N _ { i } ^ { c } } \sum _ { j = 1 } ^ { N _ { i } ^ { c } } \sum _ { c ^ { \prime } = 1 } ^ { C } p _ { i j } ^ { c ^ { \prime } } \log p _ { i j } ^ { c ^ { \prime } } , c \in \{ 1 , \ldots , C \} .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
For all of the indicators, we only take into account predictions from labeled data. Experimentally, the confidence indicator serves best in our AEL and thus we adopt it by default (see Section 4.3 for the comparison). We use EMA to update the category-wise confidence at each training step:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathrm { C o n f } _ { k } ^ { c } \gets \tau \mathrm { C o n f } _ { k - 1 } ^ { c } + ( 1 - \tau ) \mathrm { C o n f } _ { k } ^ { c } , \ c \in \{ 1 , \ldots , C \} ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $k$ denotes the $k$ -th iteration, $\tau \in [ 0 , 1 )$ is the momentum coefficient which is set to 0.999 experimentally. Through the confidence bank, we can easily identify the under-performing categories for the current model.
|
| 92 |
+
|
| 93 |
+
Adaptive CutMix. Here we introduce the proposed adaptive CutMix (see Figure 2 for illustration) which is applied on the unlabeled data. It aims to increase the frequency of occurrence of the under-performing samples from the unlabeled data. We first formulate the original CutMix [27] as:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r } { \hat { I } = \mathbf { C u t M i x } ( \mathbf { C r o p } ( I _ { 1 } ) , I _ { 2 } ) , } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $I _ { 1 }$ and $I _ { 2 }$ denote randomly selected unlabeled images, $\hat { I }$ is the augmented image, and Crop(·) represents the random crop operation.
|
| 100 |
+
|
| 101 |
+
Different from the original CutMix where unlabeled images are randmoly selected, the proposed adaptive CutMix gives under-performing categories a higher sampling probability. Specifically, we first convert the category-wise confidence stored in the confidence bank to the normalized sampling probability $\pmb { r } \in \mathbb { R } ^ { C }$ , which can be formulated as:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
r = \mathrm { S o f t m a x } ( 1 - \mathrm { C o n f } ) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
According to the sampling probability, we randomly select an unlabeled image containing the sampled category as $I _ { 1 }$ , and another unlabeled image from the training batch is randomly selected as $I _ { 2 }$ . The Crop(·) operation is performed on the region containing the chosen category. After that, we can generate the augmented image by Eq 8. Since the adaptive CutMix is performed on the unlabeled data without any annotations, we use predictions as approximate ground-truth, which works well in practice.
|
| 108 |
+
|
| 109 |
+
Adaptive Copy-Paste. Copy-Paste [30] is an effective data augmentation strategy for instance segmentation. It yields significant gains on the challenging LVIS benchmark [31], especially for rare object categories. The key idea behind the Copy-Paste augmentation is to paste objects from the source image to the target image. Inspired by this, we further propose the adaptive Copy-Paste (see Figure 2 for illustration) for semi-supervised semantic segmentation. Different from adaptive CutMix, adaptive Copy-Paste augmentation strives for efficiently leveraging the labeled data. Similarly, we involve confidence bank to assess category-wise performance and use $\mathrm { E q } 9$ to compute sampling probability. The under-performing categories have higher probability to be selected for Copy-Paste. Experimentally, the proposed adaptive Copy-Paste augmentation yields slightly better performance in the category level than the instance level. Thus we copy all pixels belonging to the sampled category in the source image and paste them on the target image. Following [30], the augmented image is composed of two randomly selected images from the labeled data and a large scale jittering is applied.
|
| 110 |
+
|
| 111 |
+
Adaptive Equalization Sampling. As described in Section 1, due to the limited and unbalanced labeled data, the training tends to be biased. To alleviate the training bias, we propose a novel adaptive equalization sampling strategy which focuses training on a sparse set of under-performing samples and prevents the vast number of well-trained samples from overwhelming the model during training. Concretely, we define the sampling rate $s ^ { c }$ for category $c$ as:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
s ^ { c } = \left[ \frac { 1 - \mathrm { C o n f } ^ { c } } { \operatorname* { m a x } _ { c \in \{ 1 , \dots , C \} } \left( 1 - \mathrm { C o n f } ^ { c } \right) } \right] ^ { \beta } , \ c \in \{ 1 , \dots , C \} ,
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $\beta$ denotes a tunable parameter. Instead of using all pixels to compute the unsupervised loss, for category $c$ with the sampling rate $s ^ { c }$ , we randomly sample a subset of pixels according to their predictions. Then the unsupervised loss in Eq 2 can be reformulated as:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\mathcal { L } _ { u } = \frac { 1 } { { { N _ { u } } } } { \sum _ { i = 1 } ^ { { N _ { u } } } { \frac { 1 } { { \sum _ { j = 1 } ^ { { W H } } { \mathbb { 1 } _ { i j } } } } \sum _ { j = 1 } ^ { { W H } } { \ell _ { c e } ( { \hat { y } _ { i j } } , { { p _ { i j } } } ) \mathbb { 1 } _ { i j } } } } ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $\mathbb { 1 } _ { i j } = 1$ indicates that the $j$ -th pixel in the $i$ -th image is sampled according to the sampling rate, otherwise $\mathbb { 1 } _ { i j }$ is set to 0, the other terms are the same as in $\operatorname { E q }$ .
|
| 124 |
+
|
| 125 |
+
Dynamic Re-Weighting. The performance of the model depends on the quality of pseudo labels. Existing methods [2, 4, 19] usually adopt a higher threshold on classification score to filter out most of the pixels with low-confidence. Though this strategy could alleviate the noise raised by pseudolabeling, the strict criteria leads to lower recall for the pixels from under-performing categories, which hinders the training. Another option is to discard the threshold and involve all pixels into the training. However, much more noise is introduced simultaneously. To alleviate this issue, we propose a dynamic re-weighting strategy which adds a modulating factor to the unsupervised loss in the way of semi-supervised learning. On the basis of Eq 11, we formulate our final unsupervised loss as:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\begin{array} { r } { \mathcal { L } _ { u } = \displaystyle \frac { 1 } { N _ { u } } \sum _ { i = 1 } ^ { N _ { u } } \frac { 1 } { \sum _ { j = 1 } ^ { W H } w _ { i j } } \sum _ { j = 1 } ^ { W H } w _ { i j } \ell _ { c e } ( \hat { \pmb { y } } _ { i j } , { \pmb { p } } _ { i j } ) , } \\ { w _ { i j } = \displaystyle \operatorname* { m a x } _ { c \in \{ 1 , \dots , C \} } ( p _ { i j } ^ { c } ) ^ { \gamma } \mathbb { 1 } _ { i j } , } \end{array}
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
where $\gamma$ is the tunable parameter. Different from the Focal Loss [32] where the modulating factor is used for reducing the loss contribution from easy samples, our formulation aims to allocate more contributions for the convincing samples. The combination of adaptive equalization sampling and dynamic re-weighting not only involves more samples from the under-performing categories into the training, but also alleviate the noise raised by pseudo-labeling.
|
| 132 |
+
|
| 133 |
+
# 4 Experiments
|
| 134 |
+
|
| 135 |
+
# 4.1 Setup
|
| 136 |
+
|
| 137 |
+
Datasets. Cityscapes [1] dataset is designed for urban scene understanding. It contains 30 classes and only 19 classes of them are used for scene parsing evaluation. The dataset contains 5, 000 finely annotated images and 20, 000 coarsely annotated images. The finely annotated 5, 000 images are split into 2, 975, 500 and 1, 525 images for training, validation and testing respectively.
|
| 138 |
+
|
| 139 |
+
PASCAL VOC 2012 [33] dataset is a standard object-centric semantic segmentation dataset. It contains 20 foreground object classes and a background class. The strand training, validation and testing sets consist of 1, 464, 1, 449 and 1, 556 images, respectively. Following common practice, we use the augmented set [34] which contains 10, 582 images as the training set.
|
| 140 |
+
|
| 141 |
+
ADE20K dataset [35] is a large scale scene parsing benchmark which contains dense labels of 150 stuff/object categories. The dataset includes 20K/2K/3K images for training, validation and testing.
|
| 142 |
+
|
| 143 |
+
For both Cityscapes and PASCAL VOC 2012 datasets, 1/2, 1/4, 1/8, 1/16 and 1/32 training images are randomly sampled as the labeled training data, and the remaining images are used as the unlabeled data. For each protocol, AEL provides 5 different data folds and the final performance is the average of 5 folds. In addition, we also evaluate our method on the setting where the full Cityscapes train set is used as the labeled data and 1, 000, 3, 000 and 5, 000 images and randomly selected from the Cityscapes coarse set as the unlabeled data.
|
| 144 |
+
|
| 145 |
+
Evaluation. We use single scale testing and adopt mean of Intersection over Union (mIoU) as the metric to evaluate the performance. We report the results on the Cityscapes val set and PASCAL VOC 2012 val set in comparisons with state-of-the-art methods. All ablation studies are conducted on the Cityscapes val set under 1/16 and 1/32 partition protocols.
|
| 146 |
+
|
| 147 |
+
Implementation Details. We use ResNet-101 pretrained on ImageNet [36] as our backbone, remove the last two down-sampling operations and employ dilated convolutions in the subsequent convolution layers, making the output stride equal to 8. We use DeepLabv $^ { 3 + }$ [37] as the segmentation head. For
|
| 148 |
+
|
| 149 |
+
Table 1: Comparison with state-of-the-art methods on the Cityscapes val set under different partition protocols. All the methods are based on DeepLabv $^ { 3 + }$ with ResNet-101 backbone.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Method</td><td>1/32 (93)</td><td>1/16 (186)</td><td>1/8 (372)</td><td>1/4 (744)</td><td>1/2 (1488)</td></tr><tr><td>Supervised</td><td>57.89</td><td>62.96</td><td>69.81</td><td>74.23</td><td>77.46</td></tr><tr><td>MT [11]</td><td>64.07</td><td>68.05</td><td>73.56</td><td>76.66</td><td>78.39</td></tr><tr><td>CCT [4]</td><td>66.35</td><td>69.32</td><td>74.12</td><td>75.99</td><td>78.10</td></tr><tr><td>Cutmix-Seg [2]</td><td>69.11</td><td>72.13</td><td>75.83</td><td>77.24</td><td>78.95</td></tr><tr><td>GCT[19]</td><td>63.21</td><td>66.75</td><td>72.66</td><td>76.11</td><td>78.34</td></tr><tr><td>AEL (Ours)</td><td>74.28</td><td>75.83</td><td>77.90</td><td>79.01</td><td>80.28</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Table 2: Comparison with state-of-the-art methods on the PASCAL VOC 2012 val set under different partition protocols. All the methods are based on DeepLabv $^ { 3 + }$ with ResNet-101 backbone.
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan=1 colspan=2>Method</td><td rowspan=1 colspan=1>1/32 (331)</td><td rowspan=1 colspan=3>1/16 (662)</td><td rowspan=1 colspan=1>1/8 (1323)</td><td rowspan=1 colspan=1>1/4 (2646)</td><td rowspan=1 colspan=1>1/2 (5291)</td></tr><tr><td rowspan=1 colspan=2>Supervised</td><td rowspan=1 colspan=1>70.14</td><td rowspan=1 colspan=3>70.60</td><td rowspan=1 colspan=1>73.12</td><td rowspan=1 colspan=1>76.35</td><td rowspan=1 colspan=1>77.21</td></tr><tr><td rowspan=2 colspan=2>MT [11]CCT[4]</td><td rowspan=1 colspan=1>70.56</td><td rowspan=1 colspan=3>71.29</td><td rowspan=2 colspan=1>73.3373.68</td><td rowspan=2 colspan=1>76.6176.51</td><td rowspan=2 colspan=1>78.0877.40</td></tr><tr><td rowspan=3 colspan=2>CCT[4]Cutmix-Seg [2]GCT [19]</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>71.22</td><td rowspan=1 colspan=1>71.86</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>73.3970.32</td><td rowspan=2 colspan=3>73.5670.90</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>73.96</td><td rowspan=1 colspan=1>77.58</td><td rowspan=1 colspan=1>78.12</td></tr><tr><td rowspan=1 colspan=1>73.29</td><td rowspan=1 colspan=1>76.66</td><td rowspan=1 colspan=1>77.98</td></tr><tr><td rowspan=1 colspan=2>AEL (Ours)</td><td rowspan=1 colspan=1>76.97</td><td rowspan=1 colspan=3>77.20</td><td rowspan=1 colspan=1>77.57</td><td rowspan=1 colspan=1>78.06</td><td rowspan=1 colspan=1>80.29</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Cityscapes dataset, we use stochastic gradient descent (SGD) optimizer with initial learning rate 0.01, weight decay 0.0005 and momentum 0.9. Moreover, we adopt the ‘poly’ learning rate policy, where the initial learning rate is multiplied by $\begin{array} { r } { ( 1 - \frac { \mathrm { i t e r } } { \mathrm { m a x i t e r } } ) ^ { 0 . 9 } } \end{array}$ . We adopt the crop size as $7 6 9 \times 7 6 9$ , batch size as 16 and training iterations as $1 8 \mathrm { k }$ . For PASCAL VOC 2012 dataset, we set the initial learning rate as 0.001, weight decay as 0.0001, crop size as $5 1 3 \times 5 1 3$ , batch size as 16 and training iterations as $3 0 \mathrm { k }$ . We use random horizontal flip and random resize as the default data augmentation if not specified. All the supervised baselines are trained on the labeled data.
|
| 158 |
+
|
| 159 |
+
# 4.2 Comparison with State-of-the-Art Methods
|
| 160 |
+
|
| 161 |
+
We compare our method with recent semi-supervised semantic segmentation methods, including Mean Teacher (MT) [11], Cross-Consistency Training (CCT) [4], Guided Collaborative Training (GCT) [19] and Cutmix-Seg [2]. For a fair comparison, we re-implement all above methods and adopt the same network architecture (DeepLabv $^ { 3 + }$ with ResNet-101 backbone).
|
| 162 |
+
|
| 163 |
+
Results on Cityscapes Dataset. Table 1 compares AEL with state-of-the-art methods on the Cityscapes val set. Without leveraging any unlabeled data, the performance of the supervised baseline is unsatisfactory under various data partition protocols, especially for the fewer data settings, e.g., 1/32 and 1/16 protocols. Our method consistently promotes the baseline, achieving the improvements of $+ 1 6 . 4 \%$ , $+ 1 2 . 9 \%$ , $+ 8 . 1 \%$ , $+ 4 . 8 \%$ and $+ 2 . 8 \%$ under 1/32, 1/16, 1/8, 1/4 and 1/2 partition protocols respectively. Our method also significantly outperforms the existing state-of-the-art methods by a large margin under all data partition protocols. In particular, AEL outperforms the existing best method Cutmix-Seg by $+ 5 . 2 \%$ under extremely few data setting (1/32 protocol), and surpasses Cutmix-Seg by $+ 1 . 3 \%$ under the $1 / 2$ protocol.
|
| 164 |
+
|
| 165 |
+
Results on PASCAL VOC 2012 Dataset. Table 2 shows comparison with state-of-the-art methods on the PASCAL VOC 2012 val dataset. AEL achieves consistent performance gains over the supervised baseline, obtaining an improvements of $+ 6 . 8 \%$ , $+ 7 . 0 \%$ , $+ 4 . 1 \%$ , $+ 1 . 7 \%$ and $+ 3 . 1 \%$ under 1/32, 1/16, 1/8, 1/4 and $1 / 2$ partition protocols respectively. We can see that over all protocols, AEL outperforms the state-of-the-art methods. For example, our method outperforms the previous best method by $+ 3 . 6 \%$ and $+ 2 . 2 \%$ under the 1/32 and $1 / 2$ partition protocols.
|
| 166 |
+
|
| 167 |
+
Table 3: Ablation study on the effectiveness of different components: Dynamic Re-weighting (DR), Adaptive Equalization Sampling(AES), Adaptive CutMix (ACM), Adaptive Copy-Paste (ACP).
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan=1 colspan=1>DR</td><td rowspan=1 colspan=1>AES</td><td rowspan=1 colspan=1>ACM</td><td rowspan=1 colspan=2>ACP</td><td rowspan=1 colspan=1>1/32 (93)</td><td rowspan=1 colspan=1>1/16 (186)</td></tr><tr><td rowspan=7 colspan=1>√√√√</td><td rowspan=7 colspan=1>厂√厂√</td><td rowspan=6 colspan=1>4√</td><td rowspan=5 colspan=2>√</td><td rowspan=1 colspan=1>69.11</td><td rowspan=1 colspan=1>72.13</td></tr><tr><td rowspan=1 colspan=1>70.27</td><td rowspan=1 colspan=1>73.85</td></tr><tr><td rowspan=1 colspan=1>71.65</td><td rowspan=2 colspan=1>74.1273.8972.64</td></tr><tr><td rowspan=1 colspan=1>70.4969.69</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=2 colspan=1>72.5173.43</td><td rowspan=2 colspan=1>74.3975.12</td></tr><tr><td rowspan=1 colspan=2></td></tr><tr><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=2>√</td><td rowspan=1 colspan=1>74.28</td><td rowspan=1 colspan=1>75.83</td></tr></table>
|
| 170 |
+
|
| 171 |
+
# 4.3 Ablation Study
|
| 172 |
+
|
| 173 |
+
To further understand the advantages of AEL, we conduct a series of ablation studies that examine the effectiveness of different components and different hyper-parameters. All experiments are conducted on the validation set of Cityscapes dataset.
|
| 174 |
+
|
| 175 |
+
The Effectiveness of Different Components. We ablate each component of AEL step by step. Table 3 reports the studies. We use the basic framework described in Section 3.2 as our baseline, which achieves $6 9 . 1 1 \%$ and $7 2 . 1 3 \%$ under 1/32 and 1/16 protocols respectively. We first evaluate the effectiveness of each single component. As shown in the table, Dynamic Re-weighting (DR) improves the baseline by $+ 1 . 1 \%$ and $+ 1 . 7 \%$ under 1/32 and 1/16 partition protocols. Adaptive Equalization Sampling (AES) alleviates the biased training issue, achieving the improvements of $+ 2 . 5 \%$ and $+ 2 . 0 \%$ over the baseline. Adaptive CutMix (ACM) and Adaptive Copy-Paste (ACP) data augmentation approaches give more chance for under-performing categories to be sampled, and bring the improvements of $+ 1 . 3 \% / + 1 . 7 \%$ and $+ 0 . 5 \% / + 0 . 5 \%$ respectively. Furthermore, we present the performance gains in a progressive manner. On top of the DR, by leveraging AES strategy on the unsupervised loss, our method obtains improvements of $+ 2 . 3 \%$ and $+ 0 . 5 \%$ under 1/32 and 1/16 protocols. The two proposed data augmentation approaches further boost the performance to $7 4 . 2 8 \%$ and $7 5 . 8 3 \%$ , demonstrating the effectiveness of our adaptive learning.
|
| 176 |
+
|
| 177 |
+
Ablation Study on Hyper-Parameters. Table 5 ablates the tunable parameter $\gamma$ in dynamic reweighting (in Eq 13), where $\gamma = 2$ yields slightly better performance. Dynamic re-weighting is found to be insensitive to $\gamma$ .
|
| 178 |
+
|
| 179 |
+
Table 6 ablates the influence of different indicators, including Confidence (in Eq 4), Margin (in Eq 5), and Entropy (in Eq 6). We use the Confidence as the default indicator to assess the category-wise performance during training due to its best performance.
|
| 180 |
+
|
| 181 |
+
Adaptive CutMix requires a criteria to identify whether an unlabeled image contains a certain class. We use the ratio between pseudo labels of a certain category and total pixels of the input image as the criteria. Table 7 ablates different ratios.
|
| 182 |
+
|
| 183 |
+
Table 8 studies the number of sampled categories $K$ in the Adaptive Copy-Paste. We find that $K = 3$ achieves the best performance. One potential reason is that a smaller $K$ provides less training samples from the under-performing categories while a larger $K$ may increase the difficulty for training.
|
| 184 |
+
|
| 185 |
+
Table 9 ablates the loss weight $\alpha$ which is used to balance the supervised loss and unsupervised loss as shown in Eq 3. As illustrated in the table, $\alpha = 1$ achieves the best performance. We use $\alpha = 1$ in our approach for all the experiments.
|
| 186 |
+
|
| 187 |
+
# 4.4 Per-class Results
|
| 188 |
+
|
| 189 |
+
Since the class imbalance problem is severe in the Cityscapes dataset, we provide per-class results under 1/32 data partition protocol in Table 4. We choose 9 classes with the least training samples in the Cityscapes dataset as tail classes, i.e. wall, traffic light, traffic sign, rider, truck, bus, train, motorcycle and bicycle. As shown in the table, our method not only achieves the best overall mIoU, but also obtains significant improvements on tail classes. In particular, Our method outperforms the existing best method Cutmix-Seg by $+ 5 . 2 \%$ in overall mIoU and $+ 9 . 2 \%$ in mIoU for tail classes under 1/32 partition protocol.
|
| 190 |
+
|
| 191 |
+
Table 4: Per-class results on Cityscapes val set under 1/32 data partition protocol. All the methods are based on DeepLabv $^ { 3 + }$ with ResNet-101 backbone.
|
| 192 |
+
|
| 193 |
+
<table><tr><td></td><td></td><td></td><td></td><td></td><td>Head Classes</td><td></td><td></td><td></td><td colspan="10">Tail Classes</td></tr><tr><td>Methods</td><td></td><td></td><td>meno </td><td>seeaara Buping </td><td>Vegeee </td><td>Eirllrn 灵</td><td>uosiad</td><td>3u</td><td></td><td>igre</td><td></td><td>rs grgen</td><td></td><td></td><td></td><td></td><td>meroreite</td><td>eaelbir</td></tr><tr><td>Supervised</td><td></td><td>57.9</td><td>39.8 94.6</td><td>72.5 87.4</td><td>42.4 51.6</td><td>88.3 49.8</td><td>91.1</td><td>74.5</td><td>89.4</td><td>21.7</td><td>47.7</td><td>59.1</td><td>33.7</td><td>43.3</td><td>37.2</td><td></td><td>11.4 42.1</td><td>62.2</td></tr><tr><td>GCT[19]</td><td>63.2</td><td>48.1</td><td>96.9</td><td>75.8 89.8</td><td>40.3 57.5 91.1</td><td>53.5</td><td>93.1 78.1</td><td>91.6</td><td></td><td>23.6 58.9</td><td></td><td>70.1</td><td>43.4</td><td>25.8</td><td>45.7</td><td>49.2</td><td>45.0</td><td>71.4</td></tr><tr><td>MT [11]</td><td>64.1</td><td>50.4</td><td>96.7</td><td>75.6 89.5</td><td>40.0 57.3 91.0</td><td>53.2</td><td>92.80 77.9</td><td>91.3</td><td></td><td>26.2 61.1</td><td></td><td>72.3</td><td>45.8</td><td>28.0</td><td>48.1</td><td>51.6</td><td>47.1</td><td>73.8</td></tr><tr><td>CCT [4]</td><td>66.4</td><td>54.2</td><td>95.7</td><td>77.2 88.6</td><td>46.5 58.5 90.1</td><td>55.5</td><td>91.5</td><td>77.9 91.8</td><td></td><td>27.9</td><td>60.5</td><td>71.8</td><td>48.0</td><td>44.5</td><td>61.4</td><td>50.7</td><td>52.0</td><td>70.5</td></tr><tr><td>Cutmix-Seg [2]</td><td>69.1</td><td>58.7</td><td>97.2</td><td>78.6 90.1</td><td>48.1 60.1 91.5</td><td>57.2</td><td>93.0 79.6</td><td>93.3</td><td></td><td>32.4</td><td>64.8</td><td>76.5</td><td>52.3</td><td>49.4</td><td>66.0</td><td>54.8</td><td>56.7</td><td>75.1</td></tr><tr><td>AEL (Ours)</td><td>74.3</td><td>67.9</td><td>97.1</td><td>78.7 90.3</td><td>52.3 62.0 91.7</td><td>59.2</td><td>93.8</td><td>81.6 94.0</td><td></td><td>37.3</td><td>67.9</td><td>77.6</td><td>60.5</td><td>65.6</td><td>83.8</td><td>74.3</td><td>66.9</td><td>77.0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 194 |
+
|
| 195 |
+
Table 5: Study on $\gamma$ of dynamic re-weighting.
|
| 196 |
+
|
| 197 |
+
<table><tr><td>Y</td><td>1/32</td><td>1/16</td></tr><tr><td>0</td><td>69.11</td><td>72.13</td></tr><tr><td>0.5</td><td>69.74</td><td>73.28</td></tr><tr><td>1</td><td>69.35</td><td>73.67</td></tr><tr><td>2</td><td>70.27</td><td>73.85</td></tr><tr><td>3</td><td>70.26</td><td>73.40</td></tr></table>
|
| 198 |
+
|
| 199 |
+
Table 6: Study on different indicators for AES.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Indicator</td><td>1/32</td><td>1/16</td></tr><tr><td>None</td><td>70.27</td><td>73.85</td></tr><tr><td>Ent</td><td>71.38</td><td>73.21</td></tr><tr><td>Conf</td><td>72.51</td><td>74.39</td></tr><tr><td>Margin</td><td>70.86</td><td>73.05</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Table 7: Study on different ratios in ACM.
|
| 204 |
+
|
| 205 |
+
<table><tr><td>Ratio</td><td>1/32</td><td>1/16</td></tr><tr><td>0.001</td><td>73.27</td><td>74.28</td></tr><tr><td>0.003</td><td>73.29</td><td>74.36</td></tr><tr><td>0.005</td><td>73.43</td><td>75.12</td></tr><tr><td>0.01</td><td>72.78</td><td>73.66</td></tr></table>
|
| 206 |
+
|
| 207 |
+
# 4.5 Performance on the Full Labeled Set
|
| 208 |
+
|
| 209 |
+
We conduct experiments where the full Cityscapes train set is used as the labeled dataset and the Cityscapes coarse set is used as the unlabeled dataset. We do not leverage any annotations from the coarse set though it provides coarsely annotated ground-truth. We randomly sample 1,000, 3,000 and 5,000 images from the coarse set to verify the proposed method. As shown in Table 10, the proposed AEL can still improve the supervised baselines by leveraging the unlabeled data though a large amount of labeled data is provided.
|
| 210 |
+
|
| 211 |
+
# 4.6 Results on ADE20K Dataset
|
| 212 |
+
|
| 213 |
+
We further provide results on the ADE20K dataset [35]. Since no previous methods in semi-supervised segmentation conducted experiments on ADE20K dataset, we compare our method with supervised baseline and existing best method Cutmix-Seg on the dataset. As shown in Table 11, our method consistently promotes the supervised baseline by $6 . 3 6 \%$ , $5 . 7 0 \%$ , $5 . 6 7 \%$ , $3 . 1 8 \%$ and $1 . 4 5 \%$ , and outperforms the Cutmix-Seg by $2 . 2 5 \%$ , $3 . 3 8 \%$ , $2 . 4 8 \%$ , $1 . 3 1 \%$ and $1 . 2 6 \%$ under 1/32, 1/16, 1/8, 1/4 and 1/2 partition protocols, respectively.
|
| 214 |
+
|
| 215 |
+
# 4.7 Qualitative Results
|
| 216 |
+
|
| 217 |
+
Figure 3 shows the visualization results of different methods evaluated on the Cityscapes val set. We compare the proposed AEL with ground-truth, supervised baseline and our basic framework described in Section 3.2. Benefiting from a series of technologies designed for the balanced training, AEL achieves great performance on not only head categories (e.g. Road), but also tailed categories (e.g. Rider and Bicycle).
|
| 218 |
+
|
| 219 |
+
Table 8: Study on number of sampled categories $K$ in ACP.
|
| 220 |
+
|
| 221 |
+
<table><tr><td>K</td><td>1/32</td><td>1/16</td></tr><tr><td>1</td><td>72.18</td><td>74.85</td></tr><tr><td>2</td><td>72.84</td><td>74.95</td></tr><tr><td>3</td><td>74.28</td><td>75.83</td></tr><tr><td>4</td><td>73.43</td><td>74.10</td></tr></table>
|
| 222 |
+
|
| 223 |
+
Table 9: Study on loss weight $\alpha$ .
|
| 224 |
+
|
| 225 |
+
<table><tr><td>α</td><td>1/32</td><td>1/16</td></tr><tr><td>0.5</td><td>71.85</td><td>74.61</td></tr><tr><td>1.0</td><td>74.28</td><td>75.83</td></tr><tr><td>1.5</td><td>74.10</td><td>73.44</td></tr><tr><td>2.0</td><td>73.79</td><td>72.86</td></tr></table>
|
| 226 |
+
|
| 227 |
+
Table 10: Performance on the full Cityscapes train set.
|
| 228 |
+
|
| 229 |
+
<table><tr><td rowspan=1 colspan=1>Number</td><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>AEL</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=2 colspan=1>80.1680.22</td><td rowspan=2 colspan=1>80.28</td></tr><tr><td rowspan=1 colspan=1>1000</td></tr><tr><td rowspan=1 colspan=1>3000</td><td rowspan=1 colspan=1>80.55</td><td rowspan=1 colspan=1>81.36</td></tr><tr><td rowspan=1 colspan=1>5000</td><td rowspan=1 colspan=1>80.92</td><td rowspan=1 colspan=1>81.95</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Table 11: Comparison with supervised baseline and Cutmix-Seg on the ADE20K val set under different partition protocols. All the methods are based on DeepLabv $^ { 3 + }$ with ResNet-101 backbone.
|
| 232 |
+
|
| 233 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>1/32 (631)</td><td rowspan=1 colspan=1>1/16 (1263)</td><td rowspan=1 colspan=1>1/8 (2526)</td><td rowspan=1 colspan=1>1/4 (5052)</td><td rowspan=1 colspan=1>1/2 (10105)</td></tr><tr><td rowspan=1 colspan=1>Supervised</td><td rowspan=1 colspan=1>22.04</td><td rowspan=1 colspan=1>27.52</td><td rowspan=1 colspan=1>32.36</td><td rowspan=1 colspan=1>36.39</td><td rowspan=1 colspan=1>41.97</td></tr><tr><td rowspan=1 colspan=1>Cutmix-Seg [2]</td><td rowspan=1 colspan=1>26.15 一</td><td rowspan=1 colspan=1>29.84</td><td rowspan=1 colspan=1>35.55</td><td rowspan=1 colspan=1>38.26</td><td rowspan=1 colspan=1>42.16</td></tr><tr><td rowspan=1 colspan=1>AEL (Ours)</td><td rowspan=1 colspan=1>28.40</td><td rowspan=1 colspan=1>33.22</td><td rowspan=1 colspan=1>38.03</td><td rowspan=1 colspan=1>39.57</td><td rowspan=1 colspan=1>43.42</td></tr></table>
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
Figure 3: Qualitative results on the Cityscapes val set. From left to right: input image, ground-truth, predictions of the supervised baseline, predictions of our basic framework and predictions of the proposed AEL. Orange rectangles highlight the unsatisfactory segmentation results.
|
| 237 |
+
|
| 238 |
+
# 5 Conclusion
|
| 239 |
+
|
| 240 |
+
In this paper, we propose a novel Adaptive Equalization Learning (AEL) framework for semisupervised semantic segmentation. Different from the existing methods dedicating to the design of consistency regularization or pseudo-labeling, AEL aims to adaptively balance the training based on the fact that pixel categories in common semantic segmentation datasets tend to be imbalanced. We introduce a confidence bank to dynamically record the category-wise performance at each training step, which enables us to identify the under-performing categories and adaptively tilt training towards these categories. Several technologies are proposed to make the training unbiased, namely adaptive Copy-Paste and CutMix, adaptive equalization sampling and dynamic re-weighting. Through the adaptive design, AEL outperforms the state-of-the-art methods by a large margin on the Cityscapes and Pascal VOC benchmarks under various data partition protocols.
|
| 241 |
+
|
| 242 |
+
# Acknowledgment
|
| 243 |
+
|
| 244 |
+
This work was supported by the National Key R&D Program of China under grant 2017YFB1002804 and National Natural Science Foundation of China (No. 31771230).
|
| 245 |
+
|
| 246 |
+
References
|
| 247 |
+
[1] 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 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 3213–3223. IEEE Computer Society, 2016.
|
| 248 |
+
[2] Geoffrey French, Samuli Laine, Timo Aila, Michal Mackiewicz, and Graham D. Finlayson. Semi-supervised semantic segmentation needs strong, varied perturbations. In 31st British Machine Vision Conference 2020, BMVC 2020, Virtual Event, UK, September 7-10, 2020. BMVA Press, 2020.
|
| 249 |
+
[3] Jongmok Kim, Jooyoung Jang, and Hyunwoo Park. Structured consistency loss for semisupervised semantic segmentation. CoRR, abs/2001.04647, 2020.
|
| 250 |
+
[4] Yassine Ouali, Céline Hudelot, and Myriam Tami. Semi-supervised semantic segmentation with cross-consistency training. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 12671–12681. IEEE, 2020.
|
| 251 |
+
[5] Zhanghan Ke, Daoye Wang, Qiong Yan, Jimmy S. J. Ren, and Rynson W. H. Lau. Dual student: Breaking the limits of the teacher in semi-supervised learning. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pages 6727–6735. IEEE, 2019.
|
| 252 |
+
[6] Jianlong Yuan, Yifan Liu, Chunhua Shen, Zhibin Wang, and Hao Li. A simple baseline for semi-supervised semantic segmentation with strong data augmentation. arXiv preprint arXiv:2104.07256, 2021.
|
| 253 |
+
[7] Xiaokang Chen, Yuhui Yuan, Gang Zeng, and Jingdong Wang. Semi-supervised semantic segmentation with cross pseudo supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2613–2622, 2021.
|
| 254 |
+
[8] Yuliang Zou, Zizhao Zhang, Han Zhang, Chun-Liang Li, Xiao Bian, Jia-Bin Huang, and Tomas Pfister. Pseudoseg: Designing pseudo labels for semantic segmentation. arXiv preprint arXiv:2010.09713, 2020.
|
| 255 |
+
[9] Yves Grandvalet, Yoshua Bengio, et al. Semi-supervised learning by entropy minimization. In CAP, pages 281–296, 2005.
|
| 256 |
+
[10] Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 257 |
+
[11] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 1195–1204, 2017.
|
| 258 |
+
[12] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: A regularization method for supervised and semi-supervised learning. IEEE Trans. Pattern Anal. Mach. Intell., 41(8):1979–1993, 2019.
|
| 259 |
+
[13] Dong-Hyun Lee et al. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, ICML, volume 3, 2013.
|
| 260 |
+
[14] Kihyuk Sohn, David Berthelot, Nicholas Carlini, Zizhao Zhang, Han Zhang, Colin Raffel, Ekin Dogus Cubuk, Alexey Kurakin, and Chun-Liang Li. Fixmatch: Simplifying semisupervised learning with consistency and confidence. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 261 |
+
|
| 262 |
+
[15] David Berthelot, Nicholas Carlini, Ian J. Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. 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, pages 5050–5060, 2019.
|
| 263 |
+
|
| 264 |
+
[16] Qizhe Xie, Zihang Dai, Eduard H. Hovy, Thang Luong, and Quoc Le. Unsupervised data augmentation for consistency training. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 265 |
+
|
| 266 |
+
[17] David Berthelot, Nicholas Carlini, Ekin D. Cubuk, Alex Kurakin, Kihyuk Sohn, Han Zhang, and Colin Raffel. Remixmatch: Semi-supervised learning with distribution matching and augmentation anchoring. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 267 |
+
|
| 268 |
+
[18] Qizhe Xie, Minh-Thang Luong, Eduard H. Hovy, and Quoc V. Le. Self-training with noisy student improves imagenet classification. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 10684–10695. IEEE, 2020.
|
| 269 |
+
|
| 270 |
+
[19] Zhanghan Ke, Di Qiu, Kaican Li, Qiong Yan, and Rynson W. H. Lau. Guided collaborative training for pixel-wise semi-supervised learning. In Computer Vision - ECCV 2020 - 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XIII, volume 12358 of Lecture Notes in Computer Science, pages 429–445. Springer, 2020.
|
| 271 |
+
|
| 272 |
+
[20] Yuzhe Yang and Zhi Xu. Rethinking the value of labels for improving class-imbalanced learning. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 273 |
+
|
| 274 |
+
[21] Minsung Hyun, Jisoo Jeong, and Nojun Kwak. Class-imbalanced semi-supervised learning. CoRR, abs/2002.06815, 2020.
|
| 275 |
+
|
| 276 |
+
[22] Chen Wei, Kihyuk Sohn, Clayton Mellina, Alan L. Yuille, and Fan Yang. Crest: A class-rebalancing self-training framework for imbalanced semi-supervised learning. CoRR, abs/2102.09559, 2021.
|
| 277 |
+
|
| 278 |
+
[23] Mateusz Buda, Atsuto Maki, and Maciej A. Mazurowski. A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks, 106:249–259, 2018.
|
| 279 |
+
|
| 280 |
+
[24] Jonathon Byrd and Zachary Chase Lipton. What is the effect of importance weighting in deep learning? In 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, pages 872–881. PMLR, 2019.
|
| 281 |
+
|
| 282 |
+
[25] Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Aréchiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. 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, pages 1565–1576, 2019.
|
| 283 |
+
|
| 284 |
+
[26] Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, and Serge J. Belongie. Class-balanced loss based on effective number of samples. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 9268–9277. Computer Vision Foundation / IEEE, 2019.
|
| 285 |
+
|
| 286 |
+
[27] Sangdoo Yun, Dongyoon Han, Sanghyuk Chun, Seong Joon Oh, Youngjoon Yoo, and Junsuk Choe. Cutmix: Regularization strategy to train strong classifiers with localizable features. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pages 6022–6031. IEEE, 2019.
|
| 287 |
+
|
| 288 |
+
[28] Yu Li, Tao Wang, Bingyi Kang, Sheng Tang, Chunfeng Wang, Jintao Li, and Jiashi Feng. Overcoming classifier imbalance for long-tail object detection with balanced group softmax. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 289 |
+
[29] Gyungin Shin, Weidi Xie, and Samuel Albanie. All you need are a few pixels: semantic segmentation with pixelpick. CoRR, abs/2104.06394, 2021.
|
| 290 |
+
[30] Golnaz Ghiasi, Yin Cui, Aravind Srinivas, Rui Qian, Tsung-Yi Lin, Ekin D. Cubuk, Quoc V. Le, and Barret Zoph. Simple copy-paste is a strong data augmentation method for instance segmentation. CoRR, abs/2012.07177, 2020.
|
| 291 |
+
[31] Agrim Gupta, Piotr Dollar, and Ross Girshick. Lvis: A dataset for large vocabulary instance segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5356–5364, 2019.
|
| 292 |
+
[32] Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pages 2999–3007. IEEE Computer Society, 2017.
|
| 293 |
+
[33] Mark Everingham, Luc Van Gool, Christopher K. I. Williams, John M. Winn, and Andrew Zisserman. The pascal visual object classes (VOC) challenge. Int. J. Comput. Vis., 88(2):303– 338, 2010.
|
| 294 |
+
[34] Bharath Hariharan, Pablo Arbelaez, Lubomir D. Bourdev, Subhransu Maji, and Jitendra Malik. Semantic contours from inverse detectors. In IEEE International Conference on Computer Vision, ICCV 2011, Barcelona, Spain, November 6-13, 2011, pages 991–998. IEEE Computer Society, 2011.
|
| 295 |
+
[35] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 633–641, 2017.
|
| 296 |
+
[36] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097– 1105, 2012.
|
| 297 |
+
[37] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoder-decoder with atrous separable convolution for semantic image segmentation. In Proceedings of the European conference on computer vision (ECCV), pages 801–818, 2018.
|
md/train/79zWncwO2p/79zWncwO2p.md
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Collaborating with Humans without Human Data
|
| 2 |
+
|
| 3 |
+
DJ Strouse⇤, Kevin R. McKee, Matt Botvinick, Edward Hughes, Richard Everett⇤ DeepMind {strouse, kevinrmckee, botvinick, edwardhughes, reverett}@deepmind.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Collaborating with humans requires rapidly adapting to their individual strengths, weaknesses, and preferences. Unfortunately, most standard multi-agent reinforcement learning techniques, such as self-play (SP) or population play (PP), produce agents that overfit to their training partners and do not generalize well to humans. Alternatively, researchers can collect human data, train a human model using behavioral cloning, and then use that model to train “human-aware” agents (“behavioral cloning play”, or BCP). While such an approach can improve the generalization of agents to new human co-players, it involves the onerous and expensive step of collecting large amounts of human data first. Here, we study the problem of how to train agents that collaborate well with human partners without using human data. We argue that the crux of the problem is to produce a diverse set of training partners. Drawing inspiration from successful multi-agent approaches in competitive domains, we find that a surprisingly simple approach is highly effective. We train our agent partner as the best response to a population of self-play agents and their past checkpoints taken throughout training, a method we call Fictitious Co-Play (FCP). Our experiments focus on a two-player collaborative cooking simulator that has recently been proposed as a challenge problem for coordination with humans. We find that FCP agents score significantly higher than SP, PP, and BCP when paired with novel agent and human partners. Furthermore, humans also report a strong subjective preference to partnering with FCP agents over all baselines.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Generating agents which collaborate with novel partners is a longstanding challenge for Artificial Intelligence (AI) [4, 16, 37, 52]. Achieving ad-hoc, zero-shot coordination [31, $\bar { 6 6 } ]$ is especially important in situations where an AI must generalize to novel human partners [6, 61]. Many successful approaches have employed human models, either constructed explicitly [14, 35, 53] or learnt implicitly [12, 60]. By contrast, recent work in competitive domains has shown that it is possible to reach humanlevel using model-free reinforcement learning (RL) without human data, via self-play [8, 9, 63, 64]. This begs the question: Can model-free RL without human data generate agents that can collaborate with novel humans?
|
| 12 |
+
|
| 13 |
+
We seek an answer to this question in the space of common-payoff games, where all agents work towards a shared goal and receive the same reward. Self-play (SP), in which an agent learns from repeated games played against copies of itself, does not produce agents that generalize well to novel co-players [10, 11, 21, 44]. Intuitively, this is because agents trained in self-play only ever need to coordinate with themselves, and so make for brittle and stubborn collaborators with new partners who act differently. Population play (PP) trains a population of agents, all of whom interact with each other $\pmb { \| 3 9 \| }$ . While PP can generate agents capable of cooperation with humans in competitive team games $\textcircled { 1 3 4 } \textcircled { 1 }$ , it still fails to produce robust partners for novel humans in pure common-payoff settings [12]. PP in common-payoff settings naturally encourages agents to play the same way, reducing strategic diversity and producing agents not so different from self-play $\dot { \mathbb { B } } \dot { \mathbb { 4 } } \mathbb { I }$ .
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: In this work, we evaluate a variety of agent training methods (Section 2) in zero-shot coordination with agents (Section 4). We then run a human-agent collaborative study designed to elicit human preferences over agents (Section 5)
|
| 17 |
+
|
| 18 |
+
Our approach starts with the intuition that the key to producing robust agent collaborators is exposure to diverse training partners. We find that a surprisingly simple strategy is effective in generating sufficient diversity. We train $N$ self-play agents varying only their random seed for neural network initialization. Periodically during training, we save agent “checkpoints” representing their strategy at that point in time. Then, we train an agent partner as the best-response to both the fully-trained agents and their past checkpoints. The different checkpoints simulate different skill levels, and the different random seeds simulate breaking symmetries in different ways. We refer to this agent training procedure as Fictitious $\mathbf { C o }$ -Play (FCP) for its relationship to fictitious self-play [7, 27, 28, 69].
|
| 19 |
+
|
| 20 |
+
We evaluate FCP in a fully-observable two-player common-payoff collaborative cooking simulator. Based on the game Overcooked $\boldsymbol { \left[ \left[ 2 5 \right] \right] }$ , it has recently been proposed as a coordination challenge for AI [12, 50, 70]. State-of-the-art performance in producing agents capable of generalization to novel humans was achieved in $[ \mathbb { 1 2 } ]$ via behavioral cloning (BC) of human data. More precisely, BC was used to produce models that can stand in as human proxies during training in simulation, a method we call behavioral cloning play (BCP). We demonstrate that FCP outperforms BCP in generalizing to both novel agent and human partners, and that humans express a significant preference for partnering with FCP over BCP. Our method avoids the cost and potential privacy concerns of collecting human data for training, while achieving better outcomes for humans at test time.
|
| 21 |
+
|
| 22 |
+
We summarize the novel contributions of this paper as follows:
|
| 23 |
+
|
| 24 |
+
1. We propose Fictitious Co-Play (FCP) to train agents capable of zero-shot coordination with humans (Section 2.1).
|
| 25 |
+
2. We demonstrate that FCP agents generalize better than SP, PP, and BCP in zero-shot coordination with a variety of held-out agents (Section 4.2).
|
| 26 |
+
3. We propose a rigorous human-agent interaction study with behavioral analysis and participant feedback (Section $\boxed { 5 . 1 }$ .
|
| 27 |
+
4. We demonstrate that FCP significantly outperforms the BCP state-of-the-art, both in task score and in human partner preference (Section $5 . 2 )$ .
|
| 28 |
+
|
| 29 |
+
# 2 Methods
|
| 30 |
+
|
| 31 |
+
# 2.1 Fictitious Co-Play (FCP)
|
| 32 |
+
|
| 33 |
+
Diverse training conditions have been shown to make agents more robust, from environmental variations (i.e. domain randomization $\textcircled { 1 5 4 } , \textcircled { 5 6 } , \textcircled { 6 7 } \textcircled { 1 }$ to heterogeneity in training partners $\left[ \left[ 6 9 \right] \right]$ . We seek to train agents that are robust partners for humans in common-payoff games, and so extend this line of work to that setting.
|
| 34 |
+
|
| 35 |
+
One important challenge in collaborating with novel partners is dealing with symmetries $\textcircled { \left| 3 1 \right| }$ . For example, two agents A and B facing each other may move past each other by A going left and B going right, or vice versa. Both are valid solutions, but a good agent partner will adaptively switch between these conventions if a human clearly prefers one over the other. A second important challenge is dealing with variations in skill level. Good agent partners should be able to assist both highly-skilled partners, as well as partners who are still learning.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 2: The four agent training methods we evaluate in this work. Self-play (SP) where an agent learns with itself, population-play (PP) where a population of agents are co-trained together, and behavioral cloning play (BCP) where data from human games is used to create a behaviorally cloned agent with which an RL agent is then trained. In our method, Fictitious Co-Play (FCP), $N$ self-play agents are trained independently and checkpointed throughout training. An agent is then trained to best respond to the entire population of SP agents and their checkpoints.
|
| 39 |
+
|
| 40 |
+
Fictitious co-play (FCP) is a simple two-stage approach for training agents that overcomes both of these challenges (Figure $\bigstar$ right). In the first stage, we train a diverse pool of partners. To allow the pool to represent different symmetry breaking conventions, we train $N$ partner agents in self-play. Since these partners are trained independently, they can arrive at different arbitrary conventions for breaking symmetries. To allow the pool to represent different skill levels, we use multiple checkpoints of each self-play partner throughout training. The final checkpoint represents a fully-trained “skillful” partner, while earlier checkpoints represent less skilled partners. Notably, by using multiple checkpoints per partner, this additional diversity in skill incurs no extra training cost.
|
| 41 |
+
|
| 42 |
+
In the second stage, we train an FCP agent as the best response to the pool of diverse partners created in the first stage. Importantly, the partner parameters are frozen and thus FCP must learn to adapt to partners, rather than expect partners to adapt to it. In this way, FCP agents are prepared to follow the lead of human partners, and learn a general policy across a range of strategies and skills. We call our method “fictitious” co-play for its relationship to fictitious self-play in which competitive agents are trained with past checkpoints (in that case, to avoid strategy cycling) [7, 27, 28, 39, 69].
|
| 43 |
+
|
| 44 |
+
# 2.2 Baselines and ablations
|
| 45 |
+
|
| 46 |
+
We compare FCP agents to the three baseline training methods listed below, each varying only in their set of training partners, with the RL algorithm and architecture consistent across all agents:
|
| 47 |
+
|
| 48 |
+
1. Self-play (SP), where agents learn solely through interaction with themselves.
|
| 49 |
+
2. Population-play (PP), where a population of agents are co-trained through random pairings.
|
| 50 |
+
3. Behavioral cloning play (BCP), where an agent is trained with a BC model of a human [12].
|
| 51 |
+
|
| 52 |
+
We also evaluate three variations on FCP to better understand the conditions for its success:
|
| 53 |
+
|
| 54 |
+
1. To test the importance of including past checkpoints in training, we evaluate an ablation of FCP in which agents are trained only with the converged checkpoints of their partners $\mathrm { F C P } _ { - T }$ for “FCP minus time”). 2. To test whether FCP would benefit from additional diversity in its partner population, we evaluate an augmentation of FCP in which the population of SP partners varies not just in random seed, but also in architecture $\operatorname { F C P } _ { + A }$ for “FCP plus architectural variation”). 3. To test whether architectural variation can serve as a full replacement for playing with past checkpoints, we evaluate the combination of both modifications $( \mathrm { F C P } _ { - T , + A } )$ .
|
| 55 |
+
|
| 56 |
+
# 2.3 Environment
|
| 57 |
+
|
| 58 |
+
Following prior work on zero-shot coordination in human-agent interaction, we study the Overcooked environment (see Figure 3) [12, 13, 38, 50, 70]. We draw particular inspiration from the environment in Carroll et al. [12]. For full details, see Appendix A.
|
| 59 |
+
|
| 60 |
+
In this environment, players are placed into a gridworld kitchen as chefs and tasked with delivering as many cooked dishes of tomato soup as possible within an episode. This involves a series of sequential high-level actions to which both players can contribute: collecting tomatoes, depositing them into cooking pots, letting the tomatoes cook into soup, collecting a dish, getting the soup, and delivering it. Upon a successful delivery, both players are rewarded equally.
|
| 61 |
+
|
| 62 |
+
To effectively complete the task, players must learn to navigate the kitchen and interact with objects in the correct order, all while maintaining awareness of their partner’s behavior to coordinate with them. This environment therefore presents the challenges of both movement and strategic coordination.
|
| 63 |
+
|
| 64 |
+
Each player observes an egocentric RGB view of the world, and at every step can perform one of six actions: stand still, move {up, down, left, right}, interact. The behavior ofLÈ¡áyÒįŘįºµòµÒ¡y® interact varies based on the cell which the player is facing (e.g. place tomato on counter).
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 3: The Overcooked environment: a two-player common-payoff game in which players must coordinate to cook and deliver soup.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 4: Layouts: the kitchens which agents and humans play in, each emphasizing different coordination strategies. Highlighted in bold are the terms used to refer to each in the rest of this paper.
|
| 71 |
+
|
| 72 |
+
# 2.4 Implementation details
|
| 73 |
+
|
| 74 |
+
Here we highlight several key implementation details for our training methods. For full details, including the architectures, hyperparameters, and compute used, please see Appendix B.
|
| 75 |
+
|
| 76 |
+
For our reinforcement learning agents, we use the V-MPO $\pmb { \Vert 6 5 \Vert }$ algorithm along with a ResNet [26] plus LSTM $\mathbb { \left| \bigstar \bigstar \right\| }$ architecture which we found led to optimal behavior across all layouts. Agents are trained using a distributed set of environments running in parallel $\textcircled { 1 1 7 }$ , each sampling two agents from the training population to play together every episode.
|
| 77 |
+
|
| 78 |
+
Both PP and FCP are trained with a population size of $N = 3 2$ agents which are sampled uniformly. For FCP, we use 3 checkpoints for each agent, therefore incurring no additional training burden: (1) at initialization (i.e. a low-skilled agent), (2) at the end of training (i.e. a fully-trained expert agent), and (3) at the middle of training, defined as when the agent reaches $50 \%$ of its final reward (i.e. an average-skilled agent). When varying architecture for the training partners of the $\operatorname { F C P } _ { + A }$ and $\mathrm { F C P } _ { - T , + A }$ variants, we vary whether the partners use memory (i.e. LSTM vs not) and the width of their policy and value networks (i.e. 16 vs 256). In total, we train 8 agents for each of the 4 combinations, leaving the total population size of $N = 3 2$ unchanged, ensuring a fair comparison.
|
| 79 |
+
|
| 80 |
+
To train agents via behavioral cloning $\left[ \left[ 5 8 \right] \right]$ , we use the open-source Acme $\pmb { \mathbb { B } } 0 \|$ to learn a policy from human gameplay data. Specifically, we collected 5 human-human trajectories of length 1200 time steps for each of the 5 layouts, resulting in 60k total environment steps. We divide this data in half and train two BC agents: (1) a partner for training a BCP agent, and (2) a “human proxy” partner for agent-agent evaluation. Following Carroll et al. $\mathbb { \overline { { \lVert \lambda \rVert } } }$ , we use a set of feature-based observations for the agents (as opposed to RGB) and generate comparable results: performance is higher on 3 layouts (asymmetric, cramped, and ring) but poorer on the other 2 (circuit and forced).
|
| 81 |
+
|
| 82 |
+
# 3 Related work
|
| 83 |
+
|
| 84 |
+
Ad-hoc team play There is a large and diverse body of literature on ad-hoc team-play $ { \mathbb { B } } , { \mathbb { G } } 6 { \mathbb { I } }$ , also known as zero-shot coordination $[ \overbrace { 3 \mathrm { 1 } } ]$ . Prior work based in game-theoretic settings has suggested the benefits of planning $\mathbb { [ [ \mathrm { { 7 1 } ] } }$ , online learning $\mathbb { \left[ \left. 5 1 \right] \right. }$ , and novel solution concepts $\bar { \mathbb { D } }$ , to name a few examples. More recently, multi-agent deep reinforcement learning has provided the tools to scale to more complex gridworld or continuous control settings, leading to work on hierarchical social planning $\widehat { \left\| 3 6 \right\| }$ , adapting to existing social conventions $\checkmark$ , trajectory diversity $\lVert \boldsymbol { \mathsf { A } } \boldsymbol { \mathsf { S } } \rVert$ , and theory of mind [14]. Ad-hoc team-play among novel agent partners is also an object of active study in the emergent communication literature [10, 11, 43]. This prior work has tended to focus on generalization to held-out agent partners as a proxy for human co-players.
|
| 85 |
+
|
| 86 |
+
Collaborative play with novel humans has been evaluated more actively in the context of training agent assistants; see for instance [57, 68]. To our knowledge, our FCP agents represent the stateof-the-art in coordinating with novel human partners on an equal footing of capabilities in a rich gridworld environment, as measured by the challenge tasks in Carroll et al. [12].
|
| 87 |
+
|
| 88 |
+
Diversity in multi-agent reinforcement learning In multi-agent reinforcement learning, agents that train with behaviorally diverse populations of game partners tend to demonstrate stronger performance than their self-play counterparts. For example, across a range of multi-agent games, generalization to held-out populations can be improved by training larger and more diverse populations [13, 42, 50]. In mixed-motive settings, cooperation among agents can be encouraged through social diversity, such as in player preferences and rewards [3, 47, 49]. Similarly, competitiveness can be optimized through selective matchmaking between increasingly diverse agents $\pm \boxed { 1 2 4 } \boxed { 3 9 } \boxed { 6 9 }$ .
|
| 89 |
+
|
| 90 |
+
Despite the increased focus on improving multi-agent performance, evaluation has typically been constrained to agent-agent settings. High-performing agents have infrequently been evaluated with humans, particularly in non-competitive domains $\dot { \left. \overline { { \dot { \left. \dot { \theta } \right\| } } } \right. }$ . We add to this growing literature, showing that training with diversity is a powerful approach for effective human-agent collaboration.
|
| 91 |
+
|
| 92 |
+
Human-agent interaction In recent years, increased attention has been directed toward designing machine learning agents capable of collaborating with humans [41, 57, 68, 72] (see also $\textcircled { 1 1 6 } \textcircled { }$ for a broader review on Cooperative AI). Tylkin et al. $\lVert \overline { { 6 8 } } \rVert$ is particularly notable in also demonstrating that partially trained agents can be useful learning targets for human helpers, although in a different domain (cooperative Atari). Our method, FCP, can be seen as extending theirs by training with multiple “skill levels” and random seeds, rather than just one, which we demonstrate to be crucial to our agents’ performance (Tables 1 and 2 and Figure 7b).
|
| 93 |
+
|
| 94 |
+
A key preceding entry in this research area is Carroll et al. $[ \mathbb { 1 2 } ]$ , who similarly investigated humanagent coordination in Overcooked. We use their method (BCP) as a baseline throughout our experiments (Section $\boxed { 2 . 2 }$ . Relative to BCP, our approach removes the need for the expensive step of human data collection for agent training. Furthermore, through our novel human-agent experimental design, we go beyond objective performance metrics to compare the subjective preferences that agents generate. For a detailed comparison of methods and results, see Appendix E.
|
| 95 |
+
|
| 96 |
+
# 4 Zero-shot coordination with agents
|
| 97 |
+
|
| 98 |
+
In this section, we evaluate our FCP agent, its ablations, and the baselines with held-out agents.
|
| 99 |
+
|
| 100 |
+
# 4.1 Evaluation method: collaborative evaluation with agent partners
|
| 101 |
+
|
| 102 |
+
Our primary concern in this work is generalization to novel human partners (as investigated in Section $\textcircled{5}$ . However, just as collecting human-human data for behavioral cloning is expensive, so too is evaluating agents with humans. Consequently, we instead use generalization to held-out agent partners as a cheap proxy of performance with humans. This is then used to guide our model selection process, allowing us to be more targeted with the agents we select for our human-agent evaluations.
|
| 103 |
+
|
| 104 |
+
We evaluate with three held-out populations:
|
| 105 |
+
|
| 106 |
+
1. A BC model trained on human data, $H _ { \mathrm { p r o x y } }$ , intended as a proxy of generalization to humans, as done by Carroll et al. $[ \overbrace { | 1 2 | }$ . 2. A set of self-play agents varying in seed, architecture, and training time (specifically, heldout seeds of the $N = 3 2$ partners trained for the $\mathrm { F C P } _ { + A }$ agent; see Section 2.4). These are intended to test generalization to a diverse yet still skillful population. 3. Randomly initialized agents intended to test generalization to low-skill partners.
|
| 107 |
+
|
| 108 |
+
For all results, we report the average number of deliveries made by both players within an episode, aggregated across the 5 different layouts from Figure $\boxed { 4 }$ (with the per-layout results reported in Appendix $\underline { { \overline { { ( \mathrm { C . 2 } ) } } } }$ . We estimate mean and standard deviation across 5 random seeds. For each seed, we evaluate the agent with all members of the held-out population for 10 episodes per agent-partner pair.
|
| 109 |
+
|
| 110 |
+
# 4.2 Results
|
| 111 |
+
|
| 112 |
+
# Finding 1: FCP significantly outperforms all baselines
|
| 113 |
+
|
| 114 |
+
To begin, we compare our FCP agent and the baselines when partnered with the three held-out populations introduced above. As can be seen in Figure $\boxed { 5 }$ FCP significantly outperforms all baselines when partnered with all three held-out populations. Notably, it performs better than BCP with $H _ { \mathrm { p r o x y } }$ even though BCP trains with such a model and FCP does not. Similar to Carroll et al. $\mathbb { \lVert 1 2 \rVert }$ , we find that BCP significantly outscores SP.
|
| 115 |
+
|
| 116 |
+
When paired with a randomly initialized partner which behaves suboptimally, we see an even greater difference between FCP and the baselines. Given that FCP is trained with non-held-out versions of such agents, it may not be surprising that it does so well with partners that behave poorly. However, what is surprising is how brittle the other training methods are. This suggests that they may not perform well with humans who are not highly skilled players, which we will see in Section 5.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 5: Agent-agent collaborative evaluation: Performance of each agent when partnered with each of the held-out populations (Section $4 . 1 )$ in episodes of length $T = 5 4 0$ . Importantly, FCP scores higher than all baselines with a variety of test partners. Error bars represent standard deviation over five random training seeds. Plots aggregate data across kitchen layouts; results calculated by individual layout can be found in Appendix C.2.
|
| 120 |
+
|
| 121 |
+
Finding 2: Training with past checkpoints is the most beneficial variation for performance Next, we investigate how the different training partner variations influence FCP’s performance. In particular, we separately ablate the past checkpoints $( T )$ and architecture $( A )$ variations, evaluating them with the same partners as in Figure 5. The results of this evaluation are presented in Table 1. Comparing the FCP and $\mathrm { F C P } _ { - T }$ columns, we see that removing past checkpoints from training significantly reduces performance. Comparing the FCP and $\operatorname { F C P } _ { + A }$ columns, we see that adding architectural variation to the training population offers no improvement over training with past
|
| 122 |
+
|
| 123 |
+
<table><tr><td>Partner</td><td>FCP</td><td>FCP-T</td><td>FCP+A</td><td>FCP-T,+A</td></tr><tr><td>Hproxy</td><td>10.6± 0.5</td><td>4.7± 0.4</td><td>9.9±0.6</td><td>7.0±0.8</td></tr><tr><td>Diverse SP</td><td>11.2 ± 0.1</td><td>6.9 ± 0.1</td><td>11.1 ± 0.4</td><td>8.6 ± 0.4</td></tr><tr><td>Random</td><td>8.6± 0.2</td><td>1.0 ± 0.1</td><td>8.4±0.4</td><td>3.2 ± 0.5</td></tr></table>
|
| 124 |
+
|
| 125 |
+
Table 1: Ablation results: Performance of each variation of FCP – training with past partner checkpoints $T$ for time) and adding partner variation in architecture $( A )$ . Scores are mean deliveries with standard deviation over 5 random seeds. Notably, we find that the inclusion of past checkpoints is essential for strong performance $( \mathrm { F C P } > \mathrm { F C P } _ { - T }$ ), and additionally including architectural variation does not improve performance $( \mathrm { F C P } \approx \mathrm { F C P } _ { + A . }$ ). However, architectural variation is better than no variation, improving performance when past checkpoints are not available $( \mathrm { F C P } _ { - T , + A } > \mathrm { F C P } _ { - T , }$ ).
|
| 126 |
+
|
| 127 |
+
checkpoints. However, comparing the $\mathrm { F C P } _ { - T }$ and $\mathrm { F C P } _ { - T , + A }$ columns, we see that without training with past checkpoints, architectural variation in the population does improve performance.
|
| 128 |
+
|
| 129 |
+
# 5 Zero-shot coordination with humans
|
| 130 |
+
|
| 131 |
+
Ultimately, our goal is to develop agents capable of coordinating with novel human partners. In this section, we run an online study to evaluate our FCP agent and the baseline agents in collaborative play with human partners.
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 6: Human-agent collaborative study: For our human-agent collaboration study, we recruited participants online to play games with FCP and baseline agents. Participants played a randomized sequence of episodes with different agent partners and kitchen layouts. After every two episodes, participants reported the direction and strength of their preference between their last two partners.
|
| 135 |
+
|
| 136 |
+
# 5.1 Evaluation method: collaborative evaluation with human participants
|
| 137 |
+
|
| 138 |
+
To test how effectively FCP’s performance generalizes to human partners, we recruited participants from Prolific $\mathbb { 1 1 8 } , \lvert 5 5 \rvert$ for an online collaboration study $N = 1 1 4$ ; $3 7 . 7 \%$ female, $5 9 . 6 \%$ male, $1 . 8 \%$ nonbinary; median age between 25–34 years). We used a within-participant design for the study: each participant played with a full cohort of agents (i.e. generated through every training method). This design allowed us to evaluate both objective performance as well as subjective preferences.
|
| 139 |
+
|
| 140 |
+
Participants first read game instructions and played a short tutorial episode guiding them through the dish preparation sequence (see Appendix $\underline { { \overline { { \mathbb { D . 1 . 1 } } } } }$ for instruction text and study screenshots). Participants then played 20 episodes with a randomized sequence of agent partners and kitchen layouts. Episodes lasted $T = 3 0 0$ steps (1 minute) each. After every two episodes, participants reported their preference over the agent partners from those episodes on a five-point Likert-type scale. After playing all 20 episodes, participants completed a debrief questionnaire collecting standard demographic information and open-ended feedback on the study. Our statistical analysis below primarily relies upon the repeated-measures analysis of variance (ANOVA) method. See Appendix D for additional details of our study design and analysis, including independent ethical review.
|
| 141 |
+
|
| 142 |
+
# 5.2 Results
|
| 143 |
+
|
| 144 |
+
Finding 1: FCP coordinates best with humans, achieving the highest score across maps To begin, we compare the objective team performance supported by our FCP and baseline agents. The strong FCP performance observed in agent-agent play generalizes to human-agent collaboration:
|
| 145 |
+
|
| 146 |
+
the FCP-human teams significantly outperform all other agent-human teams, achieving the highest average scores across maps, every $p < 0 . 0 0 1$ (Figure $\lvert \overline { { 7 \mathrm { a } } } \rvert$ , while performing as well as or better than the other teams on each individual map (see Appendix $\mathbf { D } . 3 )$ . Echoing the results from our agent-agent ablation experiments (Table $^ { 1 ) }$ , the inclusion of past checkpoints in training proves critical to FCP’s strong performance, $p < 0 . 0 { \overline { { 0 1 } } }$ (Figure $\textcircled { 7 6 }$ . Similar to Carroll et al. $\mathbb { \lVert \rVert }$ , we find that BCP outscores SP when collaborating with human players, $p < 0 . 0 0 1$ .
|
| 147 |
+
|
| 148 |
+
# Finding 2: Participants prefer FCP over all baselines
|
| 149 |
+
|
| 150 |
+
FCP’s strong collaborative performance carries over to our participants’ subjective partner preferences. Participants expressed a significant preference for FCP partners over all other agents, including BCP, with every $p < 0 . 0 5$ (Figure $\bar { 7 \mathrm { c } } )$ . Notably, while human-BCP and human-PP teams did not significantly differ in their completed deliveries, participants reported significantly preferring BCP over PP, $p = 0 . 0 0 3$ , highlighting the informativeness of our subjective analysis.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 7: Human-agent collaborative evaluation: Evaluation and preference metrics from humanagent play in episodes of length $T = 3 0 0$ . Error bars represents $9 5 \%$ confidence intervals, calculated over episodes. Plots aggregate data across kitchen layouts; results calculated by individual layout can be found in Appendix D.3.
|
| 154 |
+
|
| 155 |
+
# 5.3 Exploratory behavioral analysis
|
| 156 |
+
|
| 157 |
+
To better understand how the human-agent scores and preferences may have arisen, here we analyze the resulting action trajectories of each human and agent player in our experiment.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
|
| 161 |
+
Figure 8: Behavioral analysis: (a) FCP is able to move most frequently $3 5 \%$ of the time), corresponding to the best movement coordination with human partners. (b) FCP exhibits the most equal preferences over cooking pots (0.11 difference), aligning with human preferences. Values are calculated as the absolute difference in preferences between the two pots; 1 indicates that the player only uses one of the two available pots, while 0 indicates that the player uses both pots equally.
|
| 162 |
+
|
| 163 |
+
# Finding 1: FCP exhibits the best movement coordination with humans
|
| 164 |
+
|
| 165 |
+
First, we investigate how much each player moves in an episode (Figure $\textcircled { 8 \mathrm { a } }$ , where moving in a higher fraction of timesteps may suggest fewer collisions and thus better coordination with a partner. Notably, we observe two results: (1) humans rarely move, a behavior which is out-of-distribution for typical training methods (e.g. SP, PP) but is seen in the training distribution for BCP and FCP.
|
| 166 |
+
|
| 167 |
+
(2) FCP moves the most on all layouts other than Forced, suggesting it is better at coordinating its movement strategy with its partner. This result was also reported by human participants, for example: “I noticed that some of my partners seemed to know they needed to move around me, while others seemed to get ‘stuck’ until I moved out of their way” (see Appendix D for more examples).
|
| 168 |
+
|
| 169 |
+
# Finding 2: FCP’s preferences over cooking pots aligns best with that of humans
|
| 170 |
+
|
| 171 |
+
Next, we investigate whether there was a preference for a specific cooking pot in the layouts which included two cooking pots (Figure $\textcircled { 8 6 }$ . To do this, we calculate the difference in the number of times each pot was used by each player, where a high value indicates a strong preference for one pot and a low value indicates more equal preference for the two pots.
|
| 172 |
+
|
| 173 |
+
As can be seen in the FCP column, our agent typically has the most aligned preferences with that of humans (0.11 for FCP to 0.14 for humans). Behaviorally speaking, this means that our agent prefers one cooking pot over the other $5 5 . 5 \%$ of the time (i.e. a 0.11 point difference). In contrast, all other agents have a strong preference for a single pot. This is a non-adaptive strategy which generalizes poorly to typical human behavior of using both pots, leading to worse performance.
|
| 174 |
+
|
| 175 |
+
# 6 Discussion
|
| 176 |
+
|
| 177 |
+
Summary In this work, we investigated the challenging problem of zero-shot collaboration with humans without using human data in the training pipeline. To accomplish this, we introduced Fictitious Co-Play (FCP) – a surprisingly simple yet effective method based on creating a diverse set of training partners. We found that FCP agents scored significantly higher than all baselines when partnered with both novel agent and human partners. Furthermore, through a rigorous human-agent experimental design, we also found that humans reported a strong subjective preference to partnering with FCP agents over all baselines.
|
| 178 |
+
|
| 179 |
+
Limitations and future work Our method currently relies on the manual process of initially training and selecting a diverse set of partners. This is not only time consuming, but also prone to researcher biases that may negatively influence the behavior of the created agents. Additionally, while we found FCP with a partner population size of $N = 3 2$ sufficient here, for more complex games, FCP may require an unrealistically large partner population size to represent sufficiently diverse strategies. To address these concerns, methods for automatically generating partner diversity for common-payoff games may be important. Possibilities include adaptive population matchmaking as been used in competitive zero-sum games $\mathbb { \lVert 6 9 \rVert }$ , as well as auxiliary objectives that explicitly encourage behavioral diversity [19, 45, 46].
|
| 180 |
+
|
| 181 |
+
Our method requires a known and fixed reward function. We also focus on one domain in order to compare with prior work which has argued that human-in-the-loop training is necessary. Consequently, the resulting agents are only designed to adaptively collaborate on a single task, and not to infer human preferences in general $\textcircled { 1 1 } \textcircled { 3 3 } \textcircled { 5 9 }$ . Moreover, if a task’s reward function is poorly aligned with how humans approach the task, our method may well produce subpar partners, as would any method without access to human data. Thus, additional domains and tasks should be studied to better understand how our method generalizes. Targeted experiments to test specific forms of generalization may be especially helpful in this regard $\overline { { \| 3 8 \| } }$ , as could approaches that procedurally generate environment layouts requiring diverse solutions $\lVert 2 2 \rVert$
|
| 182 |
+
|
| 183 |
+
Finally, it may be possible to produce even stronger agent assistants by combining the strengths of FCP (i.e. diversity) and BCP (i.e. human-like play). Indeed, Knott et al. $\pmb { \Vert 3 8 \Vert }$ recently demonstrated that modifying BCP to train with multiple BC partners produces more robust collaboration with held-out agents, a finding that would be interesting to test with human partners.
|
| 184 |
+
|
| 185 |
+
Societal impact A challenge for this line of work is ensuring agent behavior is aligned with human values (i.e. the AI value alignment problem [23, 59]). Our method has no guarantees that the resulting policy aligns with the preferences, intentions, or welfare of its potential partners. It likewise does not exclude the possibility that the target being optimized for is harmful (e.g. if the agent’s partner expresses preferences or intentions to harm others). This could therefore produce negative societal effects either if training leads to poor alignment or if agents are optimized for harmful metrics.
|
| 186 |
+
|
| 187 |
+
One potential strategy for mitigating these risks is the use of human preference data [15]. Such data could be used to fine-tune and filter trained agents before deployment, encouraging better alignment with human values. A key question in this line of research is how human preference data should be aggregated—or selected, in the case of expert preferences—when our aim is to create socially aligned agents (i.e. agents that are sufficiently aligned for everyone). Relatedly, targeted research on human beliefs and perceptions of AI $\pm 8 \jmath$ , and how they steer human-agent interaction, would help inform agent design for positive societal impact. For instance, developers could incorporate specific priors into agents to reinforce tendencies for fair outcomes $\pm \mathbb { Z } 0 . \pm \mathbb { B } 2 \mathbb { I }$ .
|
| 188 |
+
|
| 189 |
+
Conclusion We proposed a method which is both effective at collaborating with humans and simple to implement. We also presented a rigorous and general methodology for evaluating with humans and eliciting their preferences. Together, these establish a strong foundation for future research on the important challenge of human-agent collaboration for benefiting society.
|
| 190 |
+
|
| 191 |
+
# Acknowledgements
|
| 192 |
+
|
| 193 |
+
The authors would like to thank Mary Cassin for creating the game sprite art; Rohin Shah, Thore Graepel, and Iason Gabriel for feedback on the draft; Lucy Campbell-Gillingham, Tina Zhu, and Saffron Huang for support in evaluating agents with humans; and Max Kleiman-Weiner, Natasha Jaques, Marc Lanctot, Mike Bowling, and Dan Roberts for useful discussions.
|
| 194 |
+
|
| 195 |
+
# Funding disclosure
|
| 196 |
+
|
| 197 |
+
This work was funded solely by DeepMind. The authors declare no competing interests.
|
| 198 |
+
|
| 199 |
+
# References
|
| 200 |
+
|
| 201 |
+
[1] J. Abramson, A. Ahuja, I. Barr, A. Brussee, F. Carnevale, M. Cassin, R. Chhaparia, S. Clark, B. Damoc, A. Dudzik, et al. Imitating interactive intelligence. arXiv preprint arXiv:2012.05672, 2020.
|
| 202 |
+
[2] S. V. Albrecht and S. Ramamoorthy. A game-theoretic model and best-response learning method for ad hoc coordination in multiagent systems. In International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2013.
|
| 203 |
+
[3] B. Baker. Emergent reciprocity and team formation from randomized uncertain social preferences. In Neural Information Processing Systems (NeurIPS), 2020.
|
| 204 |
+
[4] N. Bard, J. N. Foerster, S. Chandar, N. Burch, M. Lanctot, H. F. Song, E. Parisotto, V. Dumoulin, S. Moitra, E. Hughes, et al. The Hanabi challenge: A new frontier for AI research. Artificial Intelligence, 280:103216, 2020.
|
| 205 |
+
[5] S. Barrett, A. Rosenfeld, S. Kraus, and P. Stone. Making friends on the fly: Cooperating with new teammates. Artificial Intelligence, 242:132–171, 2017.
|
| 206 |
+
[6] A. Bauer, D. Wollherr, and M. Buss. Human–robot collaboration: A survey. International Journal of Humanoid Robotics, 5(01):47–66, 2008.
|
| 207 |
+
[7] G. W. Brown. Iterative solution of games by fictitious play. Activity analysis of production and allocation, 13(1):374–376, 1951.
|
| 208 |
+
[8] N. Brown and T. Sandholm. Superhuman AI for heads-up no-limit poker: Libratus beats top professionals. Science, 359(6374):418–424, 2018.
|
| 209 |
+
[9] N. Brown and T. Sandholm. Superhuman AI for multiplayer poker. Science, 365(6456):885–890, 2019.
|
| 210 |
+
[10] K. Bullard, F. Meier, D. Kiela, J. Pineau, and J. Foerster. Exploring zero-shot emergent communication in embodied multi-agent populations. arXiv preprint arXiv:2010.15896, 2020.
|
| 211 |
+
[11] K. Bullard, D. Kiela, J. Pineau, and J. Foerster. Quasi-equivalence discovery for zero-shot emergent communication. arXiv preprint arXiv:2103.08067, 2021.
|
| 212 |
+
[12] M. Carroll, R. Shah, M. K. Ho, T. Griffiths, S. Seshia, P. Abbeel, and A. Dragan. On the utility of learning about humans for human-AI coordination. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 213 |
+
[13] R. Charakorn, P. Manoonpong, and N. Dilokthanakul. Investigating partner diversification methods in cooperative multi-agent deep reinforcement learning. In International Conference on Neural Information Processing, 2020.
|
| 214 |
+
[14] R. Choudhury, G. Swamy, D. Hadfield-Menell, and A. D. Dragan. On the utility of model learning in HRI. In ACM/IEEE International Conference on Human-Robot Interaction (HRI), 2019.
|
| 215 |
+
[15] P. F. Christiano, J. Leike, T. B. Brown, M. Martic, S. Legg, and D. Amodei. Deep reinforcement learning from human preferences. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 4302–4310, 2017.
|
| 216 |
+
[16] A. Dafoe, E. Hughes, Y. Bachrach, T. Collins, K. R. McKee, J. Z. Leibo, K. Larson, and T. Graepel. Open problems in cooperative AI. arXiv preprint arXiv:2012.08630, 2020.
|
| 217 |
+
[17] L. Espeholt, H. Soyer, R. Munos, K. Simonyan, V. Mnih, T. Ward, Y. Doron, V. Firoiu, T. Harley, I. Dunning, S. Legg, and K. Kavukcuoglu. IMPALA: Scalable distributed deep-RL with importance weighted actor-learner architectures. In International Conference on Machine Learning (ICML), 2018.
|
| 218 |
+
[18] P. Eyal, R. David, G. Andrew, E. Zak, and D. Ekaterina. Data quality of platforms and panels for online behavioral research. Behavior Research Methods, pages 1–20, 2021.
|
| 219 |
+
[19] B. Eysenbach, A. Gupta, J. Ibarz, and S. Levine. Diversity is all you need: Learning skills without a reward function. In International Conference on Learning Representations (ICLR), 2019.
|
| 220 |
+
[20] E. Fehr and K. M. Schmidt. A theory of fairness, competition, and cooperation. The Quarterly Journal of Economics, 114(3):817–868, 1999.
|
| 221 |
+
[21] J. Foerster, F. Song, E. Hughes, N. Burch, I. Dunning, S. Whiteson, M. Botvinick, and M. Bowling. Bayesian action decoder for deep multi-agent reinforcement learning. In International Conference on Machine Learning (ICML), 2019.
|
| 222 |
+
[22] M. Fontaine, Y.-C. Hsu, Y. Zhang, B. Tjanaka, and S. Nikolaidis. On the importance of environments in human-robot coordination. In Robotics: Science and Systems (RSS), 2021.
|
| 223 |
+
[23] I. Gabriel. Artificial intelligence, values, and alignment. Minds and Machines, 30(3):411–437, 2020.
|
| 224 |
+
[24] M. Garnelo, W. M. Czarnecki, S. Liu, D. Tirumala, J. Oh, G. Gidel, H. van Hasselt, and D. Balduzzi. Pick your battles: Interaction graphs as population-level objectives for strategic diversity. In International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2021.
|
| 225 |
+
[25] Ghost Town Games. Overcooked, 2016.
|
| 226 |
+
[26] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 227 |
+
[27] J. Heinrich and D. Silver. Deep reinforcement learning from self-play in imperfect-information games. In NIPS Deep Reinforcement Learning (DRL) Workshop, 2016.
|
| 228 |
+
[28] J. Heinrich, M. Lanctot, and D. Silver. Fictitious self-play in extensive-form games. In International Conference on Machine Learning (ICML), 2015.
|
| 229 |
+
[29] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8): 1735–1780, 1997.
|
| 230 |
+
[30] M. Hoffman, B. Shahriari, J. Aslanides, G. Barth-Maron, F. Behbahani, T. Norman, A. Abdolmaleki, A. Cassirer, F. Yang, K. Baumli, S. Henderson, A. Novikov, S. G. Colmenarejo, S. Cabi, C. Gulcehre, T. L. Paine, A. Cowie, Z. Wang, B. Piot, and N. de Freitas. Acme: A research framework for distributed reinforcement learning. arXiv preprint arXiv:2006.00979, 2020.
|
| 231 |
+
[31] H. Hu, A. Lerer, A. Peysakhovich, and J. Foerster. “Other-Play” for zero-shot coordination. In International Conference on Machine Learning (ICML), 2020.
|
| 232 |
+
[32] E. Hughes, J. Z. Leibo, M. G. Phillips, K. Tuyls, E. A. Duéñez-Guzmán, A. G. Castañeda, I. Dunning, T. Zhu, K. R. McKee, R. Koster, H. Roff, and T. Graepel. Inequity aversion improves cooperation in intertemporal social dilemmas. In Neural Information Processing Systems (NeurIPS), 2018.
|
| 233 |
+
[33] B. Ibarz, J. Leike, T. Pohlen, G. Irving, S. Legg, and D. Amodei. Reward learning from human preferences and demonstrations in Atari. In Neural Information Processing Systems (NeurIPS), 2018.
|
| 234 |
+
[34] M. Jaderberg, W. M. Czarnecki, I. Dunning, L. Marris, G. Lever, A. G. Castaneda, C. Beattie, N. C. Rabinowitz, A. S. Morcos, A. Ruderman, et al. Human-level performance in 3D multiplayer games with population-based reinforcement learning. Science, 364(6443):859–865, 2019.
|
| 235 |
+
[35] S. Javdani, S. S. Srinivasa, and J. A. Bagnell. Shared autonomy via hindsight optimization. Robotics Science and Systems, 2015.
|
| 236 |
+
[36] M. Kleiman-Weiner, M. K. Ho, J. L. Austerweil, M. L. Littman, and J. B. Tenenbaum. Coordinate to cooperate or compete: abstract goals and joint intentions in social interaction. In Conference of the Cognitive Science Society (CogSci), 2016.
|
| 237 |
+
[37] G. Klien, D. D. Woods, J. M. Bradshaw, R. R. Hoffman, and P. J. Feltovich. Ten challenges for making automation a “team player” in joint human-agent activity. IEEE Intelligent Systems, 19 (6):91–95, 2004.
|
| 238 |
+
[38] P. Knott, M. Carroll, S. Devlin, K. Ciosek, K. Hofmann, A. Dragan, and R. Shah. Evaluating the robustness of collaborative agents. In International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2021.
|
| 239 |
+
[39] M. Lanctot, V. Zambaldi, A. Gruslys, A. Lazaridou, K. Tuyls, J. Pérolat, D. Silver, and T. Graepel. A unified game-theoretic approach to multiagent reinforcement learning. In Neural Information Processing Systems (NIPS), 2017.
|
| 240 |
+
[40] A. Lerer and A. Peysakhovich. Learning existing social conventions via observationally augmented self-play. In AAAI/ACM Conference on Artificial Intelligence, Ethics, and Society (AIES), 2019.
|
| 241 |
+
[41] E. Lockhart, N. Burch, N. Bard, S. Borgeaud, T. Eccles, L. Smaira, and R. Smith. Human-agent cooperation in bridge bidding. arXiv preprint arXiv:2011.14124, 2020.
|
| 242 |
+
[42] R. Lowe, Y. Wu, A. Tamar, J. Harb, P. Abbeel, and I. Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Neural Information Processing Systems (NIPS), 2017.
|
| 243 |
+
[43] R. Lowe, A. Gupta, J. Foerster, D. Kiela, and J. Pineau. Learning to learn to communicate. In ICML Adaptive & Multitask Learning Workshop, 2019.
|
| 244 |
+
[44] R. Lowe, A. Gupta, J. Foerster, D. Kiela, and J. Pineau. On the interaction between supervision and self-play in emergent communication. In International Conference on Learning Representations (ICLR), 2020.
|
| 245 |
+
[45] A. Lupu, H. Hu, and J. Foerster. Trajectory diversity for zero-shot coordination. In International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2021.
|
| 246 |
+
[46] A. Mahajan, T. Rashid, M. Samvelyan, and S. Whiteson. Maven: Multi-agent variational exploration. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 247 |
+
[47] K. R. McKee, I. Gemp, B. McWilliams, E. A. Duèñez-Guzmán, E. Hughes, and J. Z. Leibo. Social diversity and social preferences in mixed-motive reinforcement learning. In International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2020.
|
| 248 |
+
[48] K. R. McKee, X. Bai, and S. Fiske. Understanding human impressions of artificial intelligence. PsyArXiv, 2021.
|
| 249 |
+
[49] K. R. McKee, E. Hughes, T. O. Zhu, M. J. Chadwick, R. Koster, A. G. Castaneda, C. Beattie, T. Graepel, M. Botvinick, and J. Z. Leibo. Deep reinforcement learning models the emergent dynamics of human cooperation. arXiv preprint arXiv:2103.04982, 2021.
|
| 250 |
+
[50] K. R. McKee, J. Z. Leibo, C. Beattie, and R. Everett. Quantifying environment and population diversity in multi-agent reinforcement learning. arXiv preprint arXiv:2102.08370, 2021.
|
| 251 |
+
[51] F. Melo and A. Sardinha. Ad hoc teamwork by learning teammates’ task. International Conference on Autonomous Agents and Multi-Agent Systems (AAMAS), 2015.
|
| 252 |
+
[52] B. Mutlu, A. Terrell, and C.-M. Huang. Coordination mechanisms in human-robot collaboration. In HRI Collaborative Manipulation Workshop, 2013.
|
| 253 |
+
[53] S. Nikolaidis and J. Shah. Human-robot cross-training: Computational formulation, modeling and evaluation of a human team training strategy. In ACM/IEEE International Conference on Human-Robot Interaction (HRI), 2013.
|
| 254 |
+
[54] OpenAI, I. Akkaya, M. Andrychowicz, M. Chociej, M. Litwin, B. McGrew, A. Petron, A. Paino, M. Plappert, G. Powell, R. Ribas, J. Schneider, N. Tezak, J. Tworek, P. Welinder, L. Weng, Q. Yuan, W. Zaremba, and L. Zhang. Solving Rubik’s Cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019.
|
| 255 |
+
[55] E. Peer, L. Brandimarte, S. Samat, and A. Acquisti. Beyond the Turk: Alternative platforms for crowdsourcing behavioral research. Journal of Experimental Social Psychology, 70:153–163, 2017.
|
| 256 |
+
[56] X. B. Peng, M. Andrychowicz, W. Zaremba, and P. Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. In IEEE International Conference on Robotics and Automation (ICRA), 2018.
|
| 257 |
+
[57] P. M. Pilarski, A. Butcher, M. Johanson, M. M. Botvinick, A. Bolt, and A. S. Parker. Learned human-agent decision-making, communication and joint action in a virtual reality environment. In Multidisciplinary Conference on Reinforcement Learning and Decision Making (RLDM), 2019.
|
| 258 |
+
[58] D. A. Pomerleau. Efficient training of artificial neural networks for autonomous navigation. Neural Computation, 3(1):88–97, 1991.
|
| 259 |
+
[59] S. Russell. Human Compatible: Artificial Intelligence and the Problem of Control. Penguin, 2019.
|
| 260 |
+
[60] D. Sadigh, N. Landolfi, S. S. Sastry, S. A. Seshia, and A. D. Dragan. Planning for cars that coordinate with people: leveraging effects on human actions for planning and active information gathering over human internal state. Autonomous Robots, 42(7):1405–1426, 2018.
|
| 261 |
+
[61] N. Schurr, J. Marecki, M. Tambe, and P. Scerri. Towards flexible coordination of human-agent teams. Multiagent and Grid Systems, 1(1):3–16, 2005.
|
| 262 |
+
[62] A. Shih, A. Sawhney, J. Kondic, S. Ermon, and D. Sadigh. On the critical role of conventions in adaptive human-AI collaboration. In International Conference on Learning Representations (ICLR), 2021.
|
| 263 |
+
[63] D. Silver, J. Schrittwieser, K. Simonyan, I. Antonoglou, A. Huang, A. Guez, T. Hubert, L. Baker, M. Lai, A. Bolton, Y. Chen, T. Lillicrap, F. Hui, L. Sifre, G. van den Driessche, T. Graepel, and D. Hassabis. Mastering the game of go without human knowledge. Nature, 550(7676):354–359, 2017.
|
| 264 |
+
[64] D. Silver, T. Hubert, J. Schrittwieser, I. Antonoglou, M. Lai, A. Guez, M. Lanctot, L. Sifre, D. Kumaran, T. Graepel, T. Lillicrap, K. Simonyan, and D. Hassabis. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419): 1140–1144, 2018.
|
| 265 |
+
[65] H. F. Song, A. Abdolmaleki, J. T. Springenberg, A. Clark, H. Soyer, J. W. Rae, S. Noury, A. Ahuja, S. Liu, D. Tirumala, N. Heess, D. Belov, M. Riedmiller, and M. M. Botvinick. VMPO: On-policy maximum a posteriori policy optimization for discrete and continuous control. In International Conference on Learning Representations (ICLR), 2020.
|
| 266 |
+
[66] P. Stone, G. Kaminka, S. Kraus, and J. Rosenschein. Ad hoc autonomous agent teams: Collaboration without pre-coordination. In AAAI Conference on Artificial Intelligence, 2010.
|
| 267 |
+
[67] J. Tobin, R. Fong, A. Ray, J. Schneider, W. Zaremba, and P. Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2017.
|
| 268 |
+
[68] P. Tylkin, G. Radanovic, and D. C. Parkes. Learning robust helpful behaviors in two-player cooperative Atari environments. In International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2021.
|
| 269 |
+
[69] O. Vinyals, I. Babuschkin, W. M. Czarnecki, M. Mathieu, A. Dudzik, J. Chung, D. H. Choi, R. Powell, T. Ewalds, P. Georgiev, J. Oh, D. Horgan, M. Kroiss, I. Danihelka, A. Huang, L. Sifre, T. Cai, J. P. Agapiou, M. Jaderberg, A. S. Vezhnevets, R. Leblond, T. Pohlen, V. Dalibard, D. Budden, Y. Sulsky, J. Molloy, T. L. Paine, C. Gulcehre, Z. Wang, T. Pfaff, Y. Wu, R. Ring, D. Yogatama, D. Wünsch, K. McKinney, O. Smith, T. Schaul, T. Lillicrap, K. Kavukcuoglu, D. Hassabis, C. Apps, and D. Silver. Grandmaster level in StarCraft II using multi-agent reinforcement learning. Nature, 575(7782):350–354, 2019.
|
| 270 |
+
[70] R. E. Wang, S. A. Wu, J. A. Evans, J. B. Tenenbaum, D. C. Parkes, and M. Kleiman-Weiner. Too many cooks: Coordinating multi-agent collaboration through inverse planning. In International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2020.
|
| 271 |
+
[71] F. Wu, S. Zilberstein, and X. Chen. Online planning for ad hoc autonomous agent teams. In International Joint Conference on Artificial Intelligence (IJCAI), 2011.
|
| 272 |
+
[72] S. Zheng, A. Trott, S. Srinivasa, N. Naik, M. Gruesbeck, D. C. Parkes, and R. Socher. The AI economist: Improving equality and productivity with AI-driven tax policies. arXiv preprint arXiv:2004.13332, 2020.
|
md/train/8yKEo06dKNo/8yKEo06dKNo.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/Ad7Gv5NkBPz/Ad7Gv5NkBPz.md
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A Distance Covariance-based Kernel for Nonlinear Causal Clustering in Heterogeneous Populations
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 We consider the problem of causal structure learning in the setting of heterogeneous
|
| 11 |
+
2 populations, i.e., populations in which a single causal structure does not adequately
|
| 12 |
+
3 represent all population members, as is common in biological and social sciences.
|
| 13 |
+
4 To this end, we introduce a distance covariance-based kernel designed specifically
|
| 14 |
+
5 to measure the similarity between the underlying nonlinear causal structures of
|
| 15 |
+
6 different samples. This kernel enables us to perform clustering to identify the
|
| 16 |
+
7 homogeneous subpopulations. Indeed, we prove the corresponding feature map is
|
| 17 |
+
8 a statistically consistent estimator of nonlinear independence structure, rendering
|
| 18 |
+
9 the kernel itself a statistical test for the hypothesis that sets of samples come from
|
| 19 |
+
10 different generating causal structures. We can then use existing methods to learn
|
| 20 |
+
11 a causal structure for each of these subpopulations. We demonstrate using our
|
| 21 |
+
12 kernel for causal clustering with an application in genetics, allowing us to reason
|
| 22 |
+
13 about the latent transcription factor networks regulating measured gene expression
|
| 23 |
+
14 levels.
|
| 24 |
+
|
| 25 |
+
# 15 1 Introduction
|
| 26 |
+
|
| 27 |
+
16 Learning causal relationships from observational and experimental data is one of the fundamental
|
| 28 |
+
17 goals of scientific research, and causal inference methods are thus used in a wide variety of fields. The
|
| 29 |
+
18 resulting variety of applications nevertheless share some common difficulties, such as causal inference
|
| 30 |
+
19 from complex time-series data (Eichler, 2012) or the underlying causal structure being obscured
|
| 31 |
+
20 by unmeasured confounders (Greenland et al., 1999). Another common difficulty, especially for
|
| 32 |
+
21 applications in the biological and social sciences, is causal inference from heterogeneous populations
|
| 33 |
+
22 (Xie, 2013; Brand and Thomas, 2013)—addressing this difficulty is our main motivation.
|
| 34 |
+
23 In general terms, we understand a heterogeneous population to be one whose members are not
|
| 35 |
+
24 adequately described by a single model but rather better described by a collection of models. Within
|
| 36 |
+
25 our context of causal structure learning, this means a population is heterogeneous if some samples
|
| 37 |
+
26 are generated by different causal structures—we call this structural heterogeneity. We note that there
|
| 38 |
+
27 are other kinds of heterogeneity, such as that in samples generated by different joint distributions
|
| 39 |
+
28 over the same causal structure, which are not the scope of this work.
|
| 40 |
+
29 A specific example of structural heterogeneity can be found in genetics: causal methods are used to
|
| 41 |
+
30 learn the structure of gene regulatory networks (Emmert-Streib et al., 2012), and gene expression data
|
| 42 |
+
31 from a single recording or experiment may include thousands of genes, many of which are involved
|
| 43 |
+
32 in entirely different networks (Liu, 2015); thus, attempting to learn a single causal structure for all of
|
| 44 |
+
33 the genes will obscure the fact that different sets of them have different structures.
|
| 45 |
+
34 The bulk of our work in this paper, and our main contribution, is to introduce the dependence
|
| 46 |
+
35 contribution kernel, which facilitates a flexible and easily extensible approach to causal clustering:
|
| 47 |
+
36 first perform clustering to identify structurally homogeneous subsets of samples, and then proceed
|
| 48 |
+
37 with the actual learning task on each cluster. We prove that our kernel is a statistically consistent
|
| 49 |
+
38 estimator of the similarity of the causal structures underlying different samples and can thus be used
|
| 50 |
+
39 to find clusters that minimize structural heterogeneity for causal structure learning tasks. Furthermore,
|
| 51 |
+
40 the kernel is derived from the distance covariance (Székely et al., 2007), imbuing it with the ability
|
| 52 |
+
41 to detect nonlinear dependence. It can easily be used in a wide array of clustering algorithms, such
|
| 53 |
+
42 as $k$ -means, DBSCAN, spectral clustering, or any other method that analogously makes use of a
|
| 54 |
+
43 similarity (or distance) measure between samples (Filippone et al., 2008).
|
| 55 |
+
44 The rest of the paper is organized as follows: We finish this section by discussing some of the most
|
| 56 |
+
45 relevant related work from the causal inference and statistics literature. All of Section 2 is devoted to
|
| 57 |
+
46 the theory underlying our dependence contribution kernel, including a comparison of the familiar
|
| 58 |
+
47 product-moment covariance with the distance covariance (Section 2.1), defining an equivalence
|
| 59 |
+
48 class of causal models with a convenient representation in the kernel space (Section 2.2), and the
|
| 60 |
+
49 actual definition of our kernel and proofs of its relevant properties (Section 2.3). Next, in Section
|
| 61 |
+
50 3, we demonstrate causal clustering with the kernel on a heterogeneous gene expression data set,
|
| 62 |
+
51 finding structurally homogeneous clusters for which we then learn latent causal measurement models,
|
| 63 |
+
52 allowing us to reason about the different transcription factor networks responsible for regulating the
|
| 64 |
+
53 measured gene expression levels. Finally, we conclude in Section 4 mentioning possible future work.
|
| 65 |
+
|
| 66 |
+
# 54 1.1 Related Work
|
| 67 |
+
|
| 68 |
+
55 Causal inference in heterogeneous populations sometimes refers to data-fusion (Bareinboim and
|
| 69 |
+
56 Pearl, 2016), i.e., combining known homogeneous subpopulations and performing causal inference
|
| 70 |
+
57 on the resulting heterogeneous population, or similarly, it can refer to meta-learning using known
|
| 71 |
+
58 subpopulations (Sharma et al., 2019). Other times, it refers to estimating heterogeneous treatment
|
| 72 |
+
59 effects (Xie et al., 2012; Athey and Imbens, 2015). However, in our case, the subpopulations are not
|
| 73 |
+
60 known and we rather consider the problem of learning which samples come from which subpopulation,
|
| 74 |
+
61 and these are differentiated according to structure instead of treatment effect.
|
| 75 |
+
62 Previous work on causal clustering has focused more on the causal modeling aspect, using stronger
|
| 76 |
+
63 assumptions about the underlying structures to learn more detailed models. For example, Kummerfeld
|
| 77 |
+
64 et al. (2014); Kummerfeld and Ramsey (2016) focus on causal clustering in measurement models,
|
| 78 |
+
65 with the goal of clustering different features together to study their latent causal structure, based on
|
| 79 |
+
66 tetrad constraints within the linear product-moment covariance matrix. Huang and Zhang (2019)
|
| 80 |
+
67 define a class of causal models facilitating mechanism-based clustering, learning causal models both
|
| 81 |
+
68 for clusters of samples as well as a shared one for all samples, assuming the underlying structures
|
| 82 |
+
69 are linear non-Gaussian. Saeed et al. (2020) characterize distributions arising from mixtures of
|
| 83 |
+
70 directed acyclic graph (DAG) causal models (i.e., causal models without latent or selection variables),
|
| 84 |
+
71 trying to learn both the component DAGs and a representation of how they are mixed. All of these
|
| 85 |
+
72 approaches, like most causal inference methods, make specific (and for some applications, restrictive)
|
| 86 |
+
73 assumptions about the underlying distributions or causal structures.
|
| 87 |
+
74 In contrast, our method is not tied to specific distributional assumptions such as linearity or
|
| 88 |
+
75 (non)Gaussianity—we assume there are enough samples for statistical inference, as well as the
|
| 89 |
+
76 usual causal Markov and faithfulness assumptions. For the first step, we cluster samples together if
|
| 90 |
+
77 they (implicitly, in the kernel space) have similar nonlinear independence structures. For the second
|
| 91 |
+
78 step, causal structure learning, any existing method (along with its corresponding assumptions) can in
|
| 92 |
+
79 principle be used. In our gene expression data application (Section 3), the measurement dependence
|
| 93 |
+
80 inducing latent (MeDIL) causal model framework (Markham and Grosse-Wentrup, 2020), which
|
| 94 |
+
81 assumes the data consists of measurement variables that are causally connected only through latent
|
| 95 |
+
82 variables, seems appropriate, however other applications can easily use other methods. For example,
|
| 96 |
+
83 component and mixture DAGs (Saeed et al., 2020) can be better learned when one first knows which
|
| 97 |
+
84 samples come from which component—clustering with our kernel ensures samples in different
|
| 98 |
+
85 clusters come from different DAGs, and so using their method instead of the MeDIL framework
|
| 99 |
+
86 would be a natural choice for applications in which a DAG (without any latents) is more appropriate.
|
| 100 |
+
|
| 101 |
+
# 2 Theory
|
| 102 |
+
|
| 103 |
+
# 2.1 Product-moment Covariance, Distance Covariance, and Dependence Contribution
|
| 104 |
+
|
| 105 |
+
Though there is more to causal relationships than probabilistic dependence, causal inference methods based on graphical models ultimately rely on at least implicitly learning conditional independence (CI) relations. CI relations can be estimated in many ways, with different dependence measures and tests each having their own theoretical guarantees and being better suited for distributions of various different kinds of data (e.g., categorical, discrete, or continuous) and with various kinds of relationships (e.g., linear, monotonic nonlinear, arbitrary nonlinear) and with different testing assumptions (see Tjøstheim et al., 2018, for a comprehensive overview).
|
| 106 |
+
|
| 107 |
+
A widely used measure of dependence is the product-moment covariance, often just called covariance, which is defined for two zero-mean random variables $X _ { 1 }$ and $X _ { 2 }$ as the scalar value $\operatorname { c o v } ( X _ { 1 } , X _ { 2 } ) =$ $\operatorname { E } [ X _ { 1 } X _ { 2 } ]$ . This can be extended from a pair of random variables to every pair of variables in a random vector, thus returning a matrix instead of a scalar. The covariance matrix for a vector of zero-mean random variables $\mathbf { X } = ( X _ { 1 } , \ldots , X _ { m } )$ can be estimated from a set $S \in \mathbb { R } ^ { n , m }$ of $n$ samples as $\textstyle { \hat { \Sigma } } _ { \mathbf { X } } = { \frac { 1 } { n } } S ^ { \top } S$ , and the ${ j , j ^ { \prime } }$ -th value of $\hat { \Sigma } _ { \mathbf { X } }$ is thus the estimate $\operatorname { c o v } ( X _ { j } , X _ { j } ^ { \prime } )$ .
|
| 108 |
+
|
| 109 |
+
102 Two random variables being probabilistically independent (denoted $\perp \perp$ ) implies that their product
|
| 110 |
+
103 moment covariance is zero, i.e., $X _ { j } \perp \perp X _ { j ^ { \prime } } \implies \operatorname { c o v } ( X _ { j } , X _ { j ^ { \prime } } ) = 0$ (importantly, the inverse of this
|
| 111 |
+
104 does not hold). Thus, the estimated product-moment covariance can be used in statistical hypothesis
|
| 112 |
+
105 testing for probabilistic independence (Wasserman, 2013, Ch. 10): $X _ { j }$ and $X _ { j ^ { \prime } }$ are assumed to
|
| 113 |
+
106 be independent if and only if $\operatorname { c o v } ( X _ { j } , X _ { j ^ { \prime } } )$ is sufficiently close to 0. However, this method has
|
| 114 |
+
107 an important problem: the product-moment covariance is only a valid test statistic against linear
|
| 115 |
+
108 dependence.
|
| 116 |
+
109 Székely et al. (2007) introduce the distance covariance to remedy this problem: random variables are
|
| 117 |
+
110 probabilistically independent if and only if their distance covariance is zero, i.e., $X _ { j } \perp \perp X _ { j ^ { \prime } } \iff$
|
| 118 |
+
111 $\operatorname { d C o v } ( X _ { j } , X _ { j ^ { \prime } } ) = 0$ , resulting in the estimated distance covariance being a valid test statistic against
|
| 119 |
+
112 all types of dependence. The distance covariance is related to the product-moment covariance by
|
| 120 |
+
113 $\mathrm { d } \mathrm { C o v } ^ { 2 } ( X _ { j } , X _ { j ^ { \prime } } ) = \mathrm { c o v } ( | X _ { j } - X _ { j } ^ { \prime } | , | X _ { j ^ { \prime } } - X _ { j ^ { \prime } } ^ { \prime } | ) - 2 \mathrm { c o v } ( | X _ { j } - X _ { j } ^ { \prime } | , | X _ { j ^ { \prime } } - X _ { j ^ { \prime } } ^ { \prime \prime } | ) .$ , where $( X _ { j } ^ { \prime } , X _ { j ^ { \prime } } ^ { \prime } )$
|
| 121 |
+
114 and $( X _ { j } ^ { \prime \prime } , X _ { j ^ { \prime } } ^ { \prime \prime } )$ are independent and identically distributed (iid) copies of $( X _ { j } , X _ { j ^ { \prime } } )$ (Székely and
|
| 122 |
+
115 Rizzo, 2014). The key intuition here is that the distances (e.g., $| X _ { j } - X _ { j } ^ { \prime } | )$ constitute a nonlinear
|
| 123 |
+
116 projection, so that using the linear product-moment covariance in this projected space allows for the
|
| 124 |
+
117 detection of nonlinear dependence in the original space.
|
| 125 |
+
118 Note that dCov is typically defined to be a scalar value when taken between two arbitrary-dimensional
|
| 126 |
+
119 random vectors, but our restricted presentation of it above in terms of random variables is to make
|
| 127 |
+
120 it more obviously analogous to the product-moment covariance between random variables. Thus,
|
| 128 |
+
121 corresponding to $\hat { \Sigma } _ { \mathbf { X } }$ for random vectors, we define the following:
|
| 129 |
+
22 Definition 1 Let $S \in \mathbb { R } ^ { n , m }$ be a set of $n$ samples from the vector of random variables ${ \textbf { X } } =$
|
| 130 |
+
23 $( X _ { 1 } , \ldots , X _ { m } )$ . For each $j \in \{ 1 , \dots , m \}$ and $i , i ^ { \prime } \in \{ 1 , \ldots , n \}$ , define the pairwise distance matrix
|
| 131 |
+
24 $D ^ { j }$ , with values given by $D _ { i , i ^ { \prime } } ^ { \jmath } : = | S _ { i , j } - S _ { i ^ { \prime } , j } |$ . Now define the corresponding doubly-centered
|
| 132 |
+
25 matrices $C _ { i , i ^ { \prime } } ^ { j } : = { D } _ { i , i ^ { \prime } } ^ { j } - \bar { D ^ { j } } _ { i , \cdot } - \bar { D ^ { j } } _ { \cdot , i ^ { \prime } } + \bar { D ^ { j } } _ { \cdot , \cdot }$ , where putting a bar over the matrix and replacing
|
| 133 |
+
26 an index $i$ or $i ^ { \prime }$ with $\cdot$ denotes taking the mean over that index. Define the matrix $L \in \mathbb { R } ^ { n ^ { 2 } , m }$ so
|
| 134 |
+
27 that each column is a flattened doubly-centered distance matrix, $L : = ( \operatorname { v e c } ( C ^ { 1 } ) , \dots , \operatorname { v e c } ( C ^ { m } ) )$ ,
|
| 135 |
+
28 where $\mathrm { v e c } ( C ^ { j } )$ denotes “flattening” matrix $C ^ { j }$ into a column vector. Finally, the estimated distance
|
| 136 |
+
29 covariance matrix over sample $S$ is defined as $\begin{array} { r } { \hat { \Delta } \mathbf { x } : = \frac { 1 } { n ^ { 2 } } L ^ { \top } L } \end{array}$ .
|
| 137 |
+
|
| 138 |
+
Analogous to 130 $\hat { \Sigma } _ { \mathbf { X } }$ , the ${ j , j ^ { \prime } }$ -th entry of $\hat { \Delta } _ { \mathbf { X } }$ corresponds to $\mathrm { d } \hat { \mathrm { C o v } } ^ { 2 } ( X _ { j } , X _ { j ^ { \prime } } ) .$ —indeed it is mathemati131 cally equivalent to computing each pairwise distance covariance value and then manually filling in
|
| 139 |
+
|
| 140 |
+
132 the matrix. The novelty of our Definition 1 is in finding a matrix of pairwise values instead of a single
|
| 141 |
+
133 value for the distance covariance between random vectors, which helps provide an intuition for our
|
| 142 |
+
134 next definition:
|
| 143 |
+
|
| 144 |
+
Definition 2 Let $S \in \mathbb { R } ^ { n , m }$ be a set of $n$ samples from the vector of random variables ${ \textbf { X } } =$ $( X _ { 1 } , \ldots , X _ { m } )$ ; note that we consistently use indices $i , i ^ { \prime } \in \{ 1 , \ldots , n \}$ and $j , j ^ { \prime } \in \{ 1 , \ldots , m \}$ . Let $D \in \mathbb { R } ^ { n , n , m }$ denote the 3-dimensional array of stacked pairwise distance matrices defined by $D _ { i , i ^ { \prime } , j } : = | S _ { i , j } - S _ { i ^ { \prime } , j } |$ , and use $C \in \mathbb { R } ^ { n , n , m }$ to denote these same distance matrices after being doubly-centered, i.e., $\tilde { C } _ { i , i ^ { \prime } , j } : = D _ { i , i ^ { \prime } , j } - \bar { D } _ { i , \cdot , j } - \bar { D } _ { \cdot , i ^ { \prime } , j } + \bar { D } _ { \cdot , \cdot , j }$ , where replacing an index $i$ or $i ^ { \prime }$ with · denotes the entire (lower-dimensional) subarray over that index, and writing a bar, $\bar { D }$ , denotes taking the mean over that subarray. Then standardize the doubly-centered distances to get $\begin{array} { r } { Z _ { i , i ^ { \prime } , j } : = \frac { C _ { i , i ^ { \prime } , j } } { \bar { D } \cdot \underline { { \mathbf { \Pi } } } _ { \cdot , j } } } \end{array}$ Finally, the dependence contribution map, $\varphi : \mathbb { R } ^ { m } \mathbb { R } ^ { m , m }$ , is defined as
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\varphi ( S _ { i , \cdot } ) : = Z _ { i , \cdot , \cdot } ^ { \top } Z _ { i , \cdot , \cdot } - \mathcal { T } ( \alpha ) ,
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
where 135 $\mathcal { T } ( \alpha ) \in \mathbb { R } ^ { m , m }$ is a matrix of scaled critical values corresponding to a given significance level 136 $\alpha$ with zeros along the diagonal, i.e., $\begin{array} { r } { \mathcal { T } ( \alpha ) _ { j , j ^ { \prime } } = \left\{ \begin{array} { l l } { 0 , } \\ { \frac { 1 } { n } \chi _ { 1 - \alpha } ^ { 2 } ( 1 ) } \end{array} \right. } \end{array}$ if , ot $j = j ^ { \prime }$ e , with $\chi _ { 1 - \alpha } ^ { 2 } ( 1 )$ being the 137 $1 - \alpha$ quantile of the chi-square distribution with 1 degree of freedom.
|
| 151 |
+
|
| 152 |
+
138 Notice the similarity bestandardization (i.e., use $C$ een Defininstead of $Z$ ons 2 a), then $\begin{array} { r } { \frac { 1 } { n ^ { 2 } } \sum _ { i = 1 } ^ { n } \varphi ( S _ { i , \cdot } ) = \hat { \Delta } _ { \mathbf { X } } } \end{array}$ $\mathcal { T } ( \alpha )$ be a matrix of 0s and. Now, the differences: $\hat { \Delta } _ { \mathbf { X } } \hat { }$ gois
|
| 153 |
+
140 a single matrix computed over an entire set of samples, whereas $\varphi$ is a map that projects each given
|
| 154 |
+
141 sample to a new feature space; each entry of $\hat { \Delta } _ { \mathbf { X } }$ is simply a distance covariance value, whereas each
|
| 155 |
+
142 entry of the sum of $\varphi ( S _ { i , \cdot } )$ over $i$ , by using standardization (using $Z$ instead of $C$ ) and subtracting a
|
| 156 |
+
143 critical value, corresponds to the result of using a distance covariance value in a statistical hypothesis
|
| 157 |
+
144 test for independence—indeed:
|
| 158 |
+
|
| 159 |
+
Lemma 3 Let $S \in \mathbb { R } ^ { n , m }$ be a set of $n$ iid samples from random variables $X _ { 1 } , \ldots , X _ { m }$ with finite first moments. For a given significance level $\alpha$ , under the null hypothesis of $X _ { j } \perp \perp X _ { j ^ { \prime } }$ , the test
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\mathrm { r e j e c t } h _ { \varnothing } \mathrm { i f } \quad \big ( \sum _ { i = 1 } ^ { n } \varphi ( S _ { i , \cdot } ) \big ) _ { j , j ^ { \prime } } > 0
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
145 is statistically consistent against all types of dependence.
|
| 166 |
+
|
| 167 |
+
146 Proof. This follows from (Székely and Rizzo, 2009, Theorem 5 and Corollary 2) and how $\varphi$ is
|
| 168 |
+
147 defined to correspond to the difference between distance covariance and critical values.
|
| 169 |
+
148 These differences between $\hat { \Delta } _ { \mathbf { X } }$ and $\varphi$ serve two important purposes: first, they ensure $\varphi$ maps to a
|
| 170 |
+
149 Hilbert space so that our Definition 9 is a corresponding kernel function (Schölkopf et al., 2001); and
|
| 171 |
+
150 second, as the name “dependence contribution map” suggests, they ensure $\varphi ( S _ { i , \cdot } )$ is informative not
|
| 172 |
+
151 just about distance covariance but about nonlinear dependence and about how the inclusion of sample
|
| 173 |
+
152 $S _ { i , \astrosun }$ ,· in a set of samples $S$ contributes to the dependence patterns estimated from $S _ { \ l }$ — this is the key
|
| 174 |
+
153 intuition behind how our kernel function is used to learn structurally homogeneous sample subsets,
|
| 175 |
+
154 as explicated in the following sections.
|
| 176 |
+
|
| 177 |
+
# 2.2 Causal Graphs in Kernel Space
|
| 178 |
+
|
| 179 |
+
In general, a full causal structure can only be learned with sufficient data about the effects of interventions, and thus causal structure learning from purely observational data is usually possible only up to an equivalence class of causal graphs (Spirtes et al., 2000; Pearl, 2009). For example, the classic PC and IC algorithms, under the assumptions of no selection bias and no confounding by latent variables, do not necessarily return a fully-specified DAG but instead return a mixed graph, containing possibly directed and undirected edges, representing the Markov equivalence class (Spirtes and Glymour, 1991; Pearl and Verma, 1995).
|
| 180 |
+
|
| 181 |
+
163 We now define a set of equivalence classes for ancestral graphs (AGs), which—unlike causal DAGs—
|
| 182 |
+
164 do not assume the absence of selection bias and latent confounders (Richardson et al., 2002):
|
| 183 |
+
|
| 184 |
+
Definition 4 Consider an arbitrary ancestral graph $\mathcal { A }$ with the set of vertices $V ^ { A }$ and edge function $E ^ { A }$ , and denote the set of unconditional $m$ -connection statements entailed by their corresponding unique maximal ancestral graph as $M ^ { A } = \{ ( j , j ^ { \prime } ) : j \mathcal { L } _ { m } j ^ { \prime } | \emptyset \} \subseteq V ^ { A } \times \dot { V } ^ { A }$ . For any ancestral graph $\mathcal { A } ^ { \prime }$ such that $V ^ { \mathcal { A ^ { \prime } } } = \bar { V } ^ { \mathcal { A } }$ , define the unconditional equivalence relation denoted by $^ \bullet \sim _ { \mathrm { U } }$ ’ as
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\mathcal { A } \sim _ { \mathrm { U } } \mathcal { A } ^ { \prime } \quad \mathrm { i f ~ a n d ~ o n l y ~ i f } \quad M ^ { A } = M ^ { A ^ { \prime } } .
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
165 Lemma 5 This lemma has two parts: (i) the relation ${ \sim } _ { \mathrm { U } }$ is an equivalence relation over the set of
|
| 191 |
+
166 ancestral graphs A; (ii) for an arbitrary ancestral graph $\mathcal A \in \mathbb A$ , the bidirected graph $\mathcal { U } ^ { A } = ( V ^ { A } , E ^ { \mathcal { U } } )$ ,
|
| 192 |
+
167 where $E ^ { \mathcal { U } }$ maps all pairs $( j , j ^ { \prime } ) \in M ^ { A }$ to the bidirected edge symbol $\cdot $ , is a unique representative
|
| 193 |
+
168 of the equivalence class $[ A ]$ .
|
| 194 |
+
169 Proof. For (i), recall that an equivalence relation is any relation satisfying reflexivity, symmetry,
|
| 195 |
+
170 and transitivity (Devlin, 2003), all of which are satisfied by ${ \sim } _ { \mathrm { U } }$ because of its correspondence to
|
| 196 |
+
171 the relation $" = "$ between sets. Thus, to prove (ii), it suffices to show that the map $s : \mathbb { A } / \sim _ { \mathrm { U } } \to$
|
| 197 |
+
172 A, $[ \mathcal { A } ] \mapsto \mathcal { U } ^ { A }$ is injective (i.e, that it is a section) and that $[ s ( [ A ] ) ] = [ A ]$ (Mac Lane, 2013). The
|
| 198 |
+
173 key to the proof is the observation that $\mathcal { U } ^ { A }$ , because it contains only bidirected edges, is maximal
|
| 199 |
+
174 and therefore entails exactly the unconditional $m$ -separation statements $M ^ { A }$ , thus by (i) we have
|
| 200 |
+
175 ${ \mathcal { U } } ^ { A } \sim _ { \mathrm { U } } { \mathcal { A } }$ or equivalently $\mathcal { U } ^ { A } \in [ A ]$ or equivalently $[ \mathcal { U } ^ { A } ] = [ \mathcal { A } ]$ . Let $\mathcal { A } , \mathcal { A } ^ { \prime }$ be arbitrary AGs, and
|
| 201 |
+
176 assume $s ( [ \mathcal { A } ] ) = s ( [ \mathcal { A } ^ { \prime } ] )$ . Then by definition of $s$ we have $\bar { \mathcal { U } } ^ { A } \bar { = } \bar { \mathcal { U } } ^ { A ^ { \prime } }$ , and by the observation above,
|
| 202 |
+
177 $\mathcal { U } ^ { A } \in [ \mathcal { A } ^ { \prime } ]$ and thus $[ A ] = [ A ^ { \prime } ]$ , making $s$ injective. And finally, by the definition of $s$ and also by
|
| 203 |
+
178 the observation above, $[ s ( [ A ] ) ] = [ \mathcal { U } ^ { A } ] = [ A ]$ , completing the proof.
|
| 204 |
+
179 This equivalence relation and its representatives has some important but perhaps subtle properties.
|
| 205 |
+
180 First, it is different from Markov equivalence over AGs (which is characterized by partial ancestral
|
| 206 |
+
181 graphs, PAGs) (Zhang, 2007)—it uses only unconditional $m$ -separation while PAGs are learned from
|
| 207 |
+
182 conditional $m$ -separation statements. Second, because all DAGs are AGs, ${ \sim } _ { \mathrm { U } }$ is also an equivalence
|
| 208 |
+
183 relation over DAGs. Third, being a representative means that every equivalence class includes exactly
|
| 209 |
+
184 one fully bidirected graph (along with other equivalent AGs). Fourth, because each representative is
|
| 210 |
+
185 formed by considering $m$ -connected paths, $\mathcal { U } ^ { A }$ is not equivalent to what would be generated by some
|
| 211 |
+
186 “edge-wise” procedure, such as simply replacing every edge in a PAG/AG/DAG/Markov random
|
| 212 |
+
187 field/moralized DAG with bidirected edges.Finally, its most important property is that it facilitates
|
| 213 |
+
188 Theorem 8, for which we first need a few more definitions.
|
| 214 |
+
|
| 215 |
+
Definition 6 Given arbitrary ancestral graphs $\mathcal { A } , \mathcal { A } ^ { \prime } \in \mathbb { A }$ over the same set of vertices, define the Hamming similarity product, denoted $\bullet _ { \bullet } ,$ as
|
| 216 |
+
|
| 217 |
+
$$
|
| 218 |
+
\bullet : \mathbb { A } \times \mathbb { A } \to \mathbb { A } \quad { \mathrm { a n d } } \quad \mathcal { A } \bullet \mathcal { A } ^ { \prime } \mapsto \mathcal { H } ,
|
| 219 |
+
$$
|
| 220 |
+
|
| 221 |
+
where 189 $\mathcal { H } = ( V ^ { A } , E ^ { \mathcal { H } } )$ and the function $E ^ { \mathcal { H } } ( j , j ^ { \prime } ) = \ ' ^ { \prime }$ if and only if $E ^ { A } ( j , j ^ { \prime } ) = E ^ { A ^ { \prime } } ( j , j ^ { \prime } )$ .
|
| 222 |
+
|
| 223 |
+
190 In words, the Hamming similarity product between two ancestral graphs returns a fully bidirected
|
| 224 |
+
191 graph, with edges only where the two graphs have the same edge type. Now, shifting from ancestral
|
| 225 |
+
192 graphs to real-valued square matrices:
|
| 226 |
+
|
| 227 |
+
Definition 7 Let $\cdot _ { \sim _ { \mathrm { O } } }$ ’ denote the orthant equivalence relation (‘orthant’ is the generalization of ‘quadrant’ from $\mathbb { R } ^ { 2 }$ to arbitrarily higher dimensions) in square real matrices, i.e., for matrices Y, Y 0 ∈ Rm,m and with the element-wise function sign(Y )j,j0 = $\mathrm { s i g n } ( Y ) _ { j , j ^ { \prime } } = \left\{ { \begin{array} { l l } { 1 , } \\ { - \ } \end{array} } \right.$ 1, otherwise if $Y _ { j , j ^ { \prime } } > 0$ or $j = j ^ { \prime }$
|
| 228 |
+
|
| 229 |
+
$$
|
| 230 |
+
Y \sim _ { \mathrm { { o } } } Y ^ { \prime } \quad { \mathrm { i f ~ a n d ~ o n l y ~ i f } } \quad \mathrm { s i g n } ( Y ) _ { j , j ^ { \prime } } = \mathrm { s i g n } ( Y ^ { \prime } ) _ { j , j ^ { \prime } }
|
| 231 |
+
$$
|
| 232 |
+
|
| 233 |
+
193 Theorem 8 Let $a$ be the map from the set of unconditional equivalence classes over ancestral graphs
|
| 234 |
+
194 with $m$ vertices, $\mathbb { A } ^ { m } / \sim _ { \mathrm { U } } = \mathbb { U } ^ { m }$ , to the set of orthant equivalence classes over the image of $\varphi$
|
| 235 |
+
195 i.e., $m \times m$ symmetric real matrices with positive diagonal entries, $\varphi ( \mathbb { R } ^ { m } ) / { \sim } _ { 0 } = \mathbb { O } ^ { m }$ , defined by
|
| 236 |
+
196 $a : \mathcal { U } \mapsto O$ , where $O _ { j , j ^ { \prime } } = \left\{ { 1 , \atop - 1 } \right.$ if , ot EU (j, j0) = ‘↔’ or j = j0 . Then a is a group isomorphism
|
| 237 |
+
between 197 $( \mathbb { U } ^ { m } , \bullet )$ and $( \mathbb { O } ^ { m } , \odot )$ , where $\ast _ { \odot } \cdot$ ’ denotes the element-wise product.
|
| 238 |
+
198 Proof. First, note that $( \mathbb { U } ^ { m } , \bullet )$ is indeed a group, satisfying the three group axioms (Artin, 2011):
|
| 239 |
+
199 the representative of its identity element is the fully connected bidirected graph over $m$ vertices, $\mathcal { U } ^ { \mathbb { 1 } }$ ;
|
| 240 |
+
200 each element is its own inverse; and $\bullet$ is associative. Likewise, $( \mathbb { O } ^ { m } , \odot )$ is a group with identity
|
| 241 |
+
201 element $\left[ \mathbb { 1 } ^ { m , m } \right]$ , each element its own inverse, and the associative element-wise product operator.
|
| 242 |
+
|
| 243 |
+
Now, to show the two groups are isomorphic, it suffices to show (i) that $a$ is bijective and (ii) that for arbitrary $\mathcal { U } , \mathcal { U } ^ { \prime } \in \mathbb { U } ^ { m }$ $\mathbb { U } ^ { m } , a ( \mathcal { U } ) \odot a ( \mathcal { U } ^ { \prime } ) = a ( \mathcal { U } \bullet \mathcal { U } ^ { \prime } )$ . For (i) notice that if $U \neq U ^ { \prime }$ , then there must be at least one pair of vertices ${ j , j ^ { \prime } }$ such that $\dot { E } ^ { \mathcal { U } } ( j , \dot { j } ^ { \prime } ) \neq E ^ { \mathcal { U } ^ { \prime } } ( j , \dot { j } ^ { \prime } )$ and thus clearly $O _ { j , j ^ { \prime } } \neq O _ { j , j ^ { \prime } } ^ { \prime }$ so $a$ in injective. Furthermore, notice that every distinct $O \in \mathbb { O } ^ { m }$ is the image of some graph $\mathcal { U }$ , so $a$ is also surjective. For (ii), for every $j , j ^ { \prime } \in \{ 1 , \ldots , m \}$ , the definitions of $a , \odot$ , and $\bullet$ ensure $a ( \mathcal { U } ) _ { j , j ^ { \prime } } \odot a ( \mathcal { U } ^ { \prime } ) _ { j , j ^ { \prime } } = 1 \iff E ^ { \mathcal { U } } ( j , j ^ { \prime } ) = E ^ { \mathcal { U } ^ { \prime } } ( j , j ^ { \prime } ) \iff 1 = a ( \mathcal { U } \bullet \mathcal { U } ^ { \prime } )$ , completing the proof.
|
| 244 |
+
|
| 245 |
+
209 For causal inference, which (often, but not necessarily) amounts to taking several samples in real
|
| 246 |
+
210 space and inferring a single corresponding member in the space of ancestral graphs (or, more often,
|
| 247 |
+
211 its quotient set by some equivalence relation), Theorem 8 means we can compare the different graphs
|
| 248 |
+
212 of different sample sets without having to first move to the ancestral graph space.
|
| 249 |
+
|
| 250 |
+
Finally, notice the space of real square matrices is not a typical sample space but rather precisely (a superspace of) the space that our dependence contribution map $\varphi$ (Definition 2) maps samples to—this means that mapping samples with $\varphi$ allows us to make use of the group isomorphism. Though this already provides an intuition for why using $\varphi$ would help with causal clustering, explicitly mapping each sample with it would be unnecessarily computationally expensive, and we are ultimately interested in morphisms between metric spaces (not just groups) of samples and graphs. To address this, we thus now move on to defining a kernel for $\varphi$ .
|
| 251 |
+
|
| 252 |
+
# 220 2.3 The Dependence Contribution Kernel
|
| 253 |
+
|
| 254 |
+
Definition 9 Let $S , Z , \mathcal { T }$ , and $\varphi$ be as in Definition 2. We define the dependence contribution kernel using the Frobenius (denoted by the subscript $\mathrm { F }$ ) inner product and norm:
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
\kappa ( S _ { i , \cdot } , S _ { i ^ { \prime } , \cdot } ) = \frac { \langle \varphi ( S _ { i , \cdot } ) , \varphi ( S _ { i ^ { \prime } , \cdot } ) \rangle _ { \mathrm { F } } } { \| \varphi ( S _ { i , \cdot } ) \\| _ { \mathrm { F } } \| \varphi ( S _ { i ^ { \prime } , \cdot } ) \| _ { \mathrm { F } } }
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
221 A more convenient expression for applying the kernel to a data set is obtained by first defining a
|
| 261 |
+
222 helper kernel, $\gamma$ along with vec from Definition 1:
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\begin{array} { r l } & { \gamma ( S _ { i , \cdot } , S _ { i ^ { \prime } , \cdot } ) = \langle \varphi ( S _ { i , \cdot } ) , \varphi ( S _ { i ^ { \prime } , \cdot } ) \rangle _ { \mathrm { F } } } \\ & { \qquad = \left( ( \mathrm { v e c } ( Z _ { i , \cdot } ) ^ { \top } \mathrm { v e c } ( Z _ { i ^ { \prime } , \cdot } ) \right) ^ { 2 } - Z _ { i , \cdot } { \mathcal { T } } Z _ { i , \cdot } ^ { \top } - Z _ { i ^ { \prime } , \cdot } { \mathcal { T } } Z _ { i ^ { \prime } , \cdot } ^ { \top } + \| { \mathcal { T } } \| _ { 2 } ^ { 2 } } \end{array}
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
This allows us to write
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
\kappa ( s , s ^ { \prime } ) = \frac { \gamma ( S _ { i , \cdot } , S _ { i ^ { \prime } , \cdot } ) } { \gamma ( S _ { i , \cdot } , S _ { i , \cdot } ) ^ { \frac { 1 } { 2 } } \gamma ( S _ { i ^ { \prime } , \cdot } , S _ { i ^ { \prime } , \cdot } ) ^ { \frac { 1 } { 2 } } }
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
223 Finally, note that $\kappa$ can be readily implemented on an entire set of samples, returning an entire
|
| 274 |
+
224 Gram (kernel) matrix instead of a scalar value, by replacing the matrix operations above with tensor
|
| 275 |
+
225 operations and specifying the correct axes along which summation occurs—an implementation can
|
| 276 |
+
226 be found in our open source Python package at https://non-anonymous-link.after-review.
|
| 277 |
+
227 A proper distance metric can also be obtained from this kernel through function composition:
|
| 278 |
+
228 arccos $_ { \mathrm { ~ O ~ } \kappa }$ . The key idea behind the kernel is that it is the cosine similarity in the space that $\varphi$ maps
|
| 279 |
+
229 to, meaning for arbitrary sample points $x , x ^ { \prime }$ it evaluates to $\cos ( \theta )$ , where $\theta$ is the angle between
|
| 280 |
+
230 $\varphi ( x )$ and $\varphi ( x ^ { \prime } )$ . In this space, $\theta$ represents the dissimilarity of the dependence patterns underlying
|
| 281 |
+
231 $x$ and $x ^ { \prime }$ , without being biased by the possibly different magnitudes of $\varphi ( x )$ and $\varphi ( x ^ { \prime } )$ due to
|
| 282 |
+
232 differing variances. Indeed, it can be used as a statistical test of whether samples come from different
|
| 283 |
+
233 dependence structures and therefore causal models:
|
| 284 |
+
|
| 285 |
+
Theorem 10 Let $S \in \mathbb { R } ^ { n , m }$ , $S ^ { \prime } \in \mathbb { R } ^ { n ^ { \prime } , m }$ be sets of $n , n ^ { \prime }$ iid samples drawn respectively from the random variables $X = ( X _ { 1 } , \ldots , X _ { m } )$ and $X ^ { \prime } = ( X _ { 1 } ^ { \prime } , \ldots , X _ { m } ^ { \prime } )$ with finite first moments. Then,
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\sum _ { i = 1 } ^ { n } \sum _ { i ^ { \prime } = 1 } ^ { n ^ { \prime } } \kappa ( S _ { i \cdot } , S _ { i ^ { \prime } \cdot } ^ { \prime } ) < 0 \implies \exists j , j ^ { \prime } \in \{ 1 , \dots , m \} \mathrm { ~ s u c h ~ t h a t ~ } \mathcal { Z } ( X _ { j } , X _ { j ^ { \prime } } , \emptyset ) \neq \mathcal { Z } ( X _ { j } ^ { \prime } , X _ { j ^ { \prime } } ^ { \prime } , \emptyset ) .
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
Proof. Through Slutsky’s Theorem (see Takeshi, 1985, Theorem 3.2.7) and the continuous mapping theorem (see Van der Vaart, 2000, Theorem 2.3), the consistency of $\varphi$ (Lemma 3) guarantees the consistency of $\kappa$ . Because the numerator of $\kappa$ is a Frobenius inner product of $\varphi$ ,
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\sum _ { i = 1 } ^ { n } \sum _ { i ^ { \prime } = 1 } ^ { n ^ { \prime } } \kappa ( S _ { i , \cdot } , S _ { i ^ { \prime } , \cdot } ^ { \prime } ) \propto \sum _ { i = 1 } ^ { n } \sum _ { i ^ { \prime } = 1 } ^ { n ^ { \prime } } \sum _ { j = 1 } ^ { m } \sum _ { j ^ { \prime } = 1 } ^ { m } \varphi ( S _ { i , \cdot } ) _ { j , j ^ { \prime } } \varphi ( S _ { i ^ { \prime } , \cdot } ^ { \prime } ) _ { j , j ^ { \prime } } .
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
Thus, in order for $\begin{array} { r } { \sum _ { i , i ^ { \prime } } \kappa ( S _ { i , \cdot } , S _ { i ^ { \prime } , \cdot } ^ { \prime } ) < 0 } \end{array}$ , there must be a $j$ and $j ^ { \prime }$ for which $\varphi ( S _ { i , \cdot } ) _ { j , j ^ { \prime } } > 0$ but $\varphi ( S _ { i ^ { \prime } , \cdot } ^ { \prime } ) _ { j , j ^ { \prime } } \ : < \ : 0$ (or vice versa), and thus the hypothesis test in Lemma 3 would reject the null hypothesis that $X _ { j } \perp \perp X _ { j \prime }$ but fail to reject that $X _ { j } ^ { \prime } \perp \perp X _ { j ^ { \prime } } ^ { \prime }$ .
|
| 298 |
+
|
| 299 |
+
Corollary 11 Due to the relationship between independence structure and causal structure, an immediate of result of Theorem 10 is that $\begin{array} { r } { \sum _ { i , i } \kappa ( S _ { i , \cdot } , S _ { i ^ { \prime } , \cdot } ^ { \prime } ) < 0 } \end{array}$ implies $X$ and $X ^ { \prime }$ have different causal structures.
|
| 300 |
+
|
| 301 |
+
Theorem 12 Let $d$ be the distance measure between unconditional equivalence classes of ancestral graphs over $m$ vertices, $d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) = m ^ { 2 } - | \{ ( j , j ^ { \prime } ) : E ^ { \mathcal { U } \bullet \mathcal { U } ^ { \prime } } ( j , j ^ { \prime } ) = { ^ { * } } \} | - m$ . For given sample sets $S , S ^ { \prime }$ (i.e., real $n \times m$ matrices), use $\bar { \varphi } ( S )$ to denote the mean of the sample in kernel space, $\textstyle \sum _ { i } \varphi ( S _ { i , . } )$ , and say $S \sim _ { \mathrm { K } } \ S ^ { \prime }$ if and only if $\bar { \varphi } ( S ) \sim _ { 0 } \bar { \varphi } ( S ^ { \prime } )$ ; denote the corresponding quotient set by this equivalence class as $\mathbb { R } ^ { n , m } / \sim _ { \mathrm { K } } = \mathbb { K } ^ { n , m }$ and a representative from each equivalence class as $Q \in [ S ]$ . Let $\delta$ be the distance between sets of samples in $\mathbb { K }$ defined as $\begin{array} { r } { \delta ( Q , Q ^ { \prime } ) = m ^ { 2 } - \frac { 1 } { 2 n ^ { 2 } } \sum _ { i , i ^ { \prime } } \gamma ( Q _ { i , \cdot } , Q _ { i , \cdot } ^ { \ j } ) } \end{array}$ Let $b : \mathbb { U } ^ { m } \mathbb { K } ^ { n , m } , b : \mathcal { U } \mapsto \Omega$ , where $\Omega$ is the unique element in $\mathbb { K }$ such that $\mathrm { s i g n } ( \bar { \varphi } ( \Omega ) ) = a ( \mathcal { U } )$ . Then $b$ is a distance-preserving map (i.e., an isometry) from the metric space $( \mathbb { U } ^ { m } , d )$ to $( \mathbb { K } ^ { n , m } , \delta )$ .
|
| 302 |
+
|
| 303 |
+
Proof. Notice that $( \mathbb { U } ^ { m } , d )$ is indeed a metric space (Choudhary, 1993, Ch. 2): $d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) = 0$ iff $\varkappa ^ { - 1 } \bullet \mathcal { U } ^ { \prime }$ is the empty graph, which happens iff $\mathcal { U } = \mathcal { U } ^ { \prime }$ ; the symmetry of $d$ follows from the symmetry •; and for subadditivity of $d$ , observe that for vertices ${ j , j ^ { \prime } }$ in arbitrary 2-vertex graphs $\boldsymbol { { u } } , \boldsymbol { { u } } ^ { \prime } , \boldsymbol { { u } } ^ { \ast }$ we have either $d ( \mathcal { U } , \mathcal { U } ^ { \ast } ) = 2$ , in which case $d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) + d ( \mathcal { U } ^ { \prime } , \mathcal { U } ^ { \prime \prime } ) = 4$ , or we have $d ( \mathcal { U } , \mathcal { U } ^ { \mathfrak { V } } ) = 0$ , in which case $d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) + d ( \mathcal { U } ^ { \prime } , \mathcal { U } ^ { \prime \prime } )$ is either 0 or 4—in both cases $d ( \mathcal { U } , \mathcal { U } ^ { \prime \prime } ) \leq d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) + d ( \mathcal { U } ^ { \prime } , \mathcal { U } ^ { \prime \prime } )$ ; this easily extends to graphs of arbitrary numbers of vertices. Likewise, $( \mathbb { K } ^ { n , m } , \delta )$ is a metric space: $\delta ( Q , Q ^ { \prime } ) = 0 \longleftrightarrow \frac { 1 } { 2 n ^ { 2 } } \sum _ { i , i ^ { \prime } } \gamma ( Q _ { i , \cdot } , Q _ { i , \cdot } ^ { \prime } ) = m ^ { 2 } \Longleftrightarrow \bar { \varphi } ( Q ) _ { j , j ^ { \prime } } = \bar { \varphi } ( Q ) _ { j , j ^ { \prime } } ,$ , for all ${ j , j ^ { \prime } }$ , so iff $Q = Q ^ { \prime }$ ; symmetry and subadditivity of $\delta$ follow from the symmetry and subadditivity of $\gamma$ .
|
| 304 |
+
|
| 305 |
+
Finally, to show $b$ is an isometry, we must show (i) that it is bijective and (ii) that for all $\boldsymbol { \mathcal { U } } , \boldsymbol { \mathcal { U } } ^ { \prime } \in \mathbf { U } ^ { m }$ , $d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) = \delta ( b ( \mathcal { U } ) , b ( \mathcal { U } ^ { \prime } ) )$ . For (i), observe that by the group isomorphism $a$ and definition of $b$ , we have ${ \mathcal { U } } \neq { \mathcal { U } } ^ { \prime } \implies a ( { \mathcal { U } } ) \neq a ( { \mathcal { U } } ^ { \prime } ) \implies Q \neq Q ^ { \prime } \implies b ( { \mathcal { U } } ) \neq b ( { \mathcal { U } } ^ { \prime } )$ and so $b$ is injective. Also observe that because $\mathbb { K }$ is exactly the set of representatives of orthant equivalence classes of sample sets in kernel space, then for every $Q \in \mathbb { K }$ , there exists a $\mathcal { U }$ such that $b ( \mathcal { U } ) = Q$ , and so $b$ is surjective.
|
| 306 |
+
|
| 307 |
+
For (ii), isomorphism $a$ and the relation between element-wise product and Frobenius inner product allow us to write $\begin{array} { r } { d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) = m ^ { 2 } - \sum _ { j , j ^ { \prime } } ( O \odot O ^ { \prime } ) _ { j , j ^ { \prime } } = m ^ { 2 } - \langle O , O ^ { \prime } \rangle _ { \mathrm { F } } } \end{array}$ . Substituting $O , O ^ { \prime }$ with their corresponding $\Omega , \Omega ^ { \prime }$ , and because the Frobenius inner product is a sesquilinear form, we can write $\begin{array} { r } { d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) = m ^ { 2 } - \frac { 1 } { n ^ { 2 } } \sum _ { i , i ^ { \prime } } \langle \varphi ( \Omega _ { i , \cdot } ) , \varphi ( \Omega _ { i , \cdot } ^ { \prime } ) \rangle _ { \mathrm { F } } . } \end{array}$ , which by Definition 10 finally gives us that $d ( \mathcal { U } , \mathcal { U } ^ { \prime } ) = \delta ( \Omega , \Omega ^ { \prime } )$ , completing the proof.
|
| 308 |
+
|
| 309 |
+
In less formal terms, Theorem 12 shows how the space of unconditional equivalence classes of ancestral graph corresponds to the space of real matrices, which is a common space for samples to lie in. More specifically, it shows how the structure defined by distances between graphs is the same as the structure defined by distances between sets of samples and how this sample distance is related to our kernel $\kappa$ . Note that this is much stronger than Theorem 10: not only can $\kappa$ tell us that two sets of samples come from different causal models, it gives a measure of just how different the causal models are, in terms of their differing unconditional nonlinear independencies/m-separation statements.
|
| 310 |
+
|
| 311 |
+
273 To summarize, we began by defining $\varphi$ (Definition 2), which maps a given data set into a new
|
| 312 |
+
274 higher-dimensional feature space. This feature space corresponds to a space of causal graphical
|
| 313 |
+
275 models, such that samples which are similar in the new feature space must come from similar causal
|
| 314 |
+
276 models (Theorem 8). Our main contribution then is to propose the dependence contribution kernel
|
| 315 |
+
277 $\kappa$ (Definition 9).This kernel $\kappa$ is guaranteed not only to tell us that two sets of samples come from
|
| 316 |
+
278 different causal models (Theorem 10 and Corollary 11) but furthermore exactly how different the
|
| 317 |
+
279 causal models are (Theorem 12), all without the computational expense of explicitly projecting
|
| 318 |
+
280 samples or learning causal models. Thus, $\kappa$ is well-suited for addressing the causal clustering
|
| 319 |
+
problem and ensures that resulting clusters will be structurally homogeneous so that subsequent
|
| 320 |
+
causal structure learning will be more informative.
|
| 321 |
+
|
| 322 |
+
# 283 3 Application
|
| 323 |
+
|
| 324 |
+
We use kernel $k$ -means with our dependence contribution kernel to cluster a gene expression data set and then use the measurement dependence inducing latent (MeDIL) causal model framework for structure learning within each cluster (Markham and Grosse-Wentrup, 2020). The goal of causal clustering here is to reason about the different latent transcription factor (TF) networks governing gene expression (see Verny et al., 2017; Hackett et al., 2020, for other latent causal model approaches to learning TF networks). The original data set comes from Iyer (1999) and can be found at genome-www.stanford.edu/serum/data/fig2clusterdata.txt, with subsequent analysis by Dhillon et al. (2003, 2004). All of the code for our analysis is open source and available at https://non-anonymous-link.after-review.
|
| 325 |
+
|
| 326 |
+
The data consists of the measured gene expression levels of 517 different genes from human fibroblast cells in response to serum exposure, measured at 11 different time points, i.e., there are 517 samples and 11 different features. In genetics applications, it is not unusual to consider genes to be samples and expression (over time) to be features—indeed the three previous analyses of this data all have this approach—and the intuition is simply that we wish to cluster genes based on patterns in their expression levels over time, in order to identify subsets of genes that are controlled by the same gene regulatory network. Also notice that such data exemplifies the structurally heterogeneous populations discussed in Section 1: different genes can of course be regulated by different TFs, and so we can better represent the data by first clustering it into subpopulations that are more homogeneous and then performing causal structure learning on each subpopulation.
|
| 327 |
+
|
| 328 |
+
For clustering, we used $k = 6$ , which we found by looking at both the Variance Ratio Criterion (Calinski and Harabasz, 1974) and the Silhouette Coefficients (Rousseeuw, 1987), computed with the ´ scikit-learn machine learning toolbox (Pedregosa et al., 2011). We implemented (unweighted) kernel $k$ -means ourselves, using the pseudocode given by Dhillon et al. (2004), with initial mean points drawn uniformly at random from the sample set, and with significance level $\alpha = 0 . 1$ for the kernel parameter $\tau ( \alpha )$ . We then used the MeDIL (Markham et al., 2020) package to learn the dependence structure and latent causal models for each cluster.
|
| 329 |
+
|
| 330 |
+
Figure 1 shows an example of our results for three of the six gene clusters: Figure 1a shows their distance covariance heatmaps and estimated nonlinear dependence structure with significance level $\alpha = 0 . 1$ (so the axes are the 11 different features, i.e. the time, in hours, at which gene expression level was measured), while Figure 1b shows their corresponding causal structures, with measurement variables $M _ { 0 } { - } M _ { 1 0 }$ for each of the features and learned latent variables $L$ for different posited TFs.
|
| 331 |
+
|
| 332 |
+
The results show a clear difference in causal structure for the different clusters and allow us to reason about the latent TFs regulating genes in different clusters: notice that the latents in cluster K1 each cause only two or three measurement variables that tend to be close together—e.g., $L _ { 1 }$ causes $M _ { 1 }$ and $M _ { 2 }$ , indicating the TF corresponding to $L _ { 1 }$ is “short-acting”, only affecting gene expression from 30 minutes $( M _ { 1 } )$ to 1 hour $( M _ { 2 } )$ after serum exposure; in contrast, the latents in cluster K3 each cause between two and seven measurement variables that tend to be more spread out—e.g., $L _ { 1 }$ causes $M _ { 1 }$ and $M _ { 7 }$ , indicating the corresponding TF is more complicated, “long-acting” but not
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 1: Results of dependence contribution kernel clustering with significance level $\alpha = 0 . 1$ .
|
| 336 |
+
|
| 337 |
+
322 continuously so, affecting gene expression 30 minutes $( M _ { 1 } )$ and 12 hours $( M _ { 7 } )$ after serum exposure,
|
| 338 |
+
323 but independently of gene expression in the time between.
|
| 339 |
+
|
| 340 |
+
Our results are especially noteworthy compared what happens if one ignores the heterogeneity of the data and learns a causal structure for the entire data set without first clustering with our kernel: in that case, all of the measurement variables are dependent, with a single latent causing all of them, and no meaningful conclusions can be drawn about how unmeasured transcription factors regulate measured gene expression, i.e., the heterogeneity obscures the underlying causal structures.
|
| 341 |
+
|
| 342 |
+
# 4 Discussion
|
| 343 |
+
|
| 344 |
+
We address the problem of causal clustering—that is, finding the different causal structures underlying a structurally heterogeneous data set. Our main contribution is to develop the dependence contribution kernel and prove its suitability for the causal clustering task. This allows us to first use the kernel with existing clustering methods, such as kernel $k$ -means or DBSCAN, to identify homogeneous subpopulations. Then we use existing causal structure learning methods on each subpopulation. The kernel guarantees that each subpopulation is more structurally homogeneous and therefore the resulting causal structures better capture the causal structures within the data than if a single model were learned for the entire heterogeneous population.
|
| 345 |
+
|
| 346 |
+
338 Furthermore, we prove several interesting theoretical properties of our kernel, including (i) that
|
| 347 |
+
339 it can be used as a statistical test for the hypothesis that two sets of samples come from different
|
| 348 |
+
340 causal structures, as well as (ii) how it induces a metric space that is isometric to the one defined
|
| 349 |
+
341 by Hamming distance between ancestral graphs, i.e., comparing sets of samples with our kernel is
|
| 350 |
+
342 equivalent to first estimating the causal graphs of the different sets and then comparing those graphs.
|
| 351 |
+
343 Beyond the practical applications of our kernel, as shown by our application in reasoning about latent
|
| 352 |
+
344 transcription factor networks that regulate gene expression, this work also draws from and suggests
|
| 353 |
+
345 further fruitful connections between a variety of fields, including causal inference, kernel methods,
|
| 354 |
+
346 and algebraic statistics.
|
| 355 |
+
|
| 356 |
+
#
|
| 357 |
+
|
| 358 |
+
References
|
| 359 |
+
Artin, M. (2011). Algebra. Pearson Prentice Hall.
|
| 360 |
+
Athey, S. and Imbens, G. W. (2015). Machine learning methods for estimating heterogeneous causal effects. Stat, 1050(5):1–26.
|
| 361 |
+
Bareinboim, E. and Pearl, J. (2016). Causal inference and the data-fusion problem. Proceedings of the National Academy of Sciences, 113(27):7345–7352.
|
| 362 |
+
Brand, J. E. and Thomas, J. S. (2013). Causal effect heterogeneity. In Handbook of Causal Analysis for Social Research, pages 189–213. Springer.
|
| 363 |
+
Cai, H., Zheng, V. W., and Chang, K. C.-C. (2018). A comprehensive survey of graph embedding: Problems, techniques, and applications. IEEE Transactions on Knowledge and Data Engineering, 30(9):1616–1637.
|
| 364 |
+
Calinski, T. and Harabasz, J. (1974). A dendrite method for cluster analysis. ´ Communications in Statistics, 3(1):1–27.
|
| 365 |
+
Choudhary, B. (1993). The Elements of Complex Analysis. New Age International.
|
| 366 |
+
Devlin, K. (2003). Sets, functions, and logic: An introduction to abstract mathematics. CRC Press.
|
| 367 |
+
Dhillon, I. S., Guan, Y., and Kulis, B. (2004). Kernel k-means, spectral clustering and normalized cuts. Proceedings of the 2004 ACM SIGKDD International Conference on Knowledge Discovery and Data Mining - KDD ’04.
|
| 368 |
+
Dhillon, I. S., Marcotte, E. M., and Roshan, U. (2003). Diametrical clustering for identifying anti-correlated gene clusters. Bioinformatics, 19(13):1612–1619.
|
| 369 |
+
Eichler, M. (2012). Causal inference in time series analysis. Wiley Series in Probability and Statistics, page 327–354.
|
| 370 |
+
Emmert-Streib, F., Glazko, G., Gökmen, A., and De Matos Simoes, R. (2012). Statistical inference and reverse engineering of gene regulatory networks from observational expression data. Frontiers in Genetics, 3:8.
|
| 371 |
+
Filippone, M., Camastra, F., Masulli, F., and Rovetta, S. (2008). A survey of kernel and spectral methods for clustering. Pattern recognition, 41(1):176–190.
|
| 372 |
+
Greenland, S., Pearl, J., and Robins, J. M. (1999). Confounding and collapsibility in causal inference. Statistical Science, 14(1).
|
| 373 |
+
Gretton, A., Bousquet, O., Smola, A., and Schölkopf, B. (2005). Measuring statistical dependence with hilbert-schmidt norms. Algorithmic Learning Theory, pages 63–77.
|
| 374 |
+
Gretton, A., Fukumizu, K., Teo, C., Song, L., Schölkopf, B., and Smola, A. (2008). A kernel statistical test for independence. In Platt, J., Koller, D., Singer, Y., and Roweis, S., editors, Advances in Neural Information Processing Systems 20, pages 585–592. MIT Press.
|
| 375 |
+
Hackett, S. R., Baltz, E. A., Coram, M., Wranik, B. J., Kim, G., Baker, A., Fan, M., Hendrickson, D. G., Berndl, M., and McIsaac, R. S. (2020). Learning causal networks using inducible transcription factors and transcriptome-wide time series. Molecular Systems Biology, 16(3):e9174.
|
| 376 |
+
Huang, B. and Zhang, K. (2019). Specific and shared causal relation modeling and mechanism-based clustering. Advances in Neural Information Processing Systems (NeurIPS).
|
| 377 |
+
Iyer, V. R. (1999). The transcriptional program in the response of human fibroblasts to serum. Science, 283(5398):83–87.
|
| 378 |
+
388 Kummerfeld, E. and Ramsey, J. (2016). Causal clustering for 1-factor measurement models. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1655–1664. ACM.
|
| 379 |
+
391 Kummerfeld, E., Ramsey, J., Yang, R., Spirtes, P., and Scheines, R. (2014). Causal clustering for 2-factor measurement models. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 34–49. Springer. Liu, Z.-P. (2015). Reverse engineering of genome-wide gene regulatory networks from gene expression data. Current Genomics, 16(1):3–22.
|
| 380 |
+
Mac Lane, S. (2013). Categories for the working mathematician, volume 5. Springer Science & Business Media.
|
| 381 |
+
398 Markham, A., Chivukula, A., and Grosse-Wentrup, M. (2020). MeDIL: A Python package for causal modelling. In Proceedings of the 10th International Conference on Probabilistic Graphical Models (PGM). PMLR.
|
| 382 |
+
401 Markham, A. and Grosse-Wentrup, M. (2020). Measurement dependence inducing latent causal models. In Conference on Uncertainty in Artificial Intelligence (UAI), pages 590–599. PMLR.
|
| 383 |
+
403 Pearl, J. (2009). Causality. Cambridge University Press.
|
| 384 |
+
404 Pearl, J. and Verma, T. (1995). A theory of inferred causation. In Studies in Logic and the Foundations of Mathematics, volume 134, pages 789–811. Elsevier. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830.
|
| 385 |
+
410 Richardson, T., Spirtes, P., et al. (2002). Ancestral graph markov models. The Annals of Statistics, 30(4):962–1030.
|
| 386 |
+
412 Rousseeuw, P. J. (1987). Silhouettes: A graphical aid to the interpretation and validation of cluster analysis. Journal of Computational and Applied Mathematics, 20:53–65. Saeed, B., Panigrahi, S., and Uhler, C. (2020). Causal structure discovery from distributions arising from mixtures of dags. In International Conference on Machine Learning, pages 8336–8345. PMLR.
|
| 387 |
+
417 Schölkopf, B., Herbrich, R., and Smola, A. J. (2001). A generalized representer theorem. In International Conference on Computational Learning Theory, pages 416–426. Springer.
|
| 388 |
+
419 Sejdinovic, D., Sriperumbudur, B., Gretton, A., and Fukumizu, K. (2013). Equivalence of distancebased and RKHS-based statistics in hypothesis testing. The Annals of Statistics, pages 2263–2291.
|
| 389 |
+
421 Sharma, A., Gupta, G., Prasad, R., Chatterjee, A., Vig, L., and Shroff, G. (2019). MetaCI: Metalearning for causal inference in a heterogeneous population. CoRR, abs/1912.03960.
|
| 390 |
+
423 Spirtes, P. and Glymour, C. (1991). An algorithm for fast recovery of sparse causal graphs. Social Science Computer Review, 9(1):62–72.
|
| 391 |
+
425 Spirtes, P., Glymour, C., and Scheines, R. (2000). Causation, Prediction, and Search. MIT Press.
|
| 392 |
+
426 Székely, G. J., Rizzo, M. L., and Bakirov, N. K. (2007). Measuring and testing dependence by correlation of distances. The Annals of Statistics, 35(6):2769–2794.
|
| 393 |
+
428 Székely, G. J. and Rizzo, M. L. (2009). Brownian distance covariance. The Annals of Applied Statistics, 3(4):1236–1265.
|
| 394 |
+
Székely, G. J. and Rizzo, M. L. (2014). Partial distance correlation with methods for dissimilarities. The Annals of Statistics, 42(6):2382–2412.
|
| 395 |
+
Takeshi, A. (1985). Advanced econometrics, volume 1. Harvard university press.
|
| 396 |
+
Tjøstheim, D., Otneim, H., and Støve, B. (2018). Statistical dependence: Beyond pearson’s $\rho$ . arXiv preprint arXiv:1809.10455.
|
| 397 |
+
Van der Vaart, A. W. (2000). Asymptotic statistics, volume 3. Cambridge university press.
|
| 398 |
+
Verny, L., Sella, N., Affeldt, S., Singh, P. P., and Isambert, H. (2017). Learning causal networks with latent variables from multivariate information in genomic data. PLoS computational biology, 13(10):e1005662.
|
| 399 |
+
Wasserman, L. (2013). All of statistics: a concise course in statistical inference. Springer Science & Business Media.
|
| 400 |
+
Xie, Y. (2013). Population heterogeneity and causal inference. Proceedings of the National Academy of Sciences, 110(16):6262–6268.
|
| 401 |
+
Xie, Y., Brand, J. E., and Jann, B. (2012). Estimating heterogeneous treatment effects with observational data. Sociological Methodology, 42(1):314–347.
|
| 402 |
+
Zhang, J. (2007). A characterization of markov equivalence classes for directed acyclic graphs with latent variables. In Conference on Uncertainty in Artificial Intelligence (UAI).
|
| 403 |
+
|
| 404 |
+
# Checklist
|
| 405 |
+
|
| 406 |
+
1. For all authors...
|
| 407 |
+
|
| 408 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] The first, fifth, and sixth sentences are covered thoroughly in Sections 1, 3, and 4, while the rest are covered thoroughly in Section 2.
|
| 409 |
+
(b) Did you describe the limitations of your work? [Yes] In Section 1.1 and throughout Section 2
|
| 410 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] Our work has no direct potential negative societal impact—just the same indirect potential most theoretical work has
|
| 411 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 412 |
+
|
| 413 |
+
2. If you are including theoretical results...
|
| 414 |
+
|
| 415 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] Yes, general assumptions in Section 1.1 as well as more specific assumptions within the statement of each relevant theorem/lemma/etc.
|
| 416 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] Proofs follow each Theorem and Lemma in the text
|
| 417 |
+
|
| 418 |
+
3. If you ran experiments...
|
| 419 |
+
|
| 420 |
+
(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] Though the linked pages contain identifying information, so we’ve included only placeholder “https://non-anonymous-link.after-review” links
|
| 421 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 422 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] We didn’t run an experiment multiple times but rather analyzed a real data set
|
| 423 |
+
|
| 424 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No] It runs in just a few seconds, even on an old, underpowered laptop
|
| 425 |
+
|
| 426 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 427 |
+
|
| 428 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 429 |
+
(b) Did you mention the license of the assets? [Yes] We mentioned that it’s all open source; details can be found in their respective repos/documentation
|
| 430 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
|
| 431 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] The data is publicly available
|
| 432 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] It’s gene expression data, so neither of these are an issue
|
| 433 |
+
|
| 434 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 435 |
+
|
| 436 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 437 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 438 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/B1eCk1StPH/B1eCk1StPH.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THE GENERALIZATION-STABILITY TRADEOFF IN NEURAL NETWORK PRUNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Pruning neural network parameters is often viewed as a means to compress models, but pruning has also been motivated by the desire to prevent overfitting. This motivation is particularly relevant given the perhaps surprising observation that a wide variety of pruning approaches increase test accuracy despite sometimes massive reductions in parameter counts. To better understand this phenomenon, we analyze the behavior of pruning over the course of training, finding that pruning’s effect on generalization relies more on the instability it generates (defined as the drops in test accuracy immediately following pruning) than on the final size of the pruned model. We demonstrate that even the pruning of unimportant parameters can lead to such instability, and show similarities between pruning and regularizing by injecting noise, suggesting a mechanism for pruning-based generalization improvements that is compatible with the strong generalization recently observed in over-parameterized networks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Pruning weights and/or convolutional filters from deep neural networks (DNNs) can substantially shrink parameter counts with minimal loss in accuracy (LeCun et al., 1990; Hassibi & Stork, 1993; Han et al., 2015a; Li et al., 2016; Molchanov et al., 2017; Louizos et al., 2017; Liu et al., 2017; Ye et al., 2018), enabling broader application of DNNs via reductions in memory-footprint and inference-FLOPs requirements. Moreover, many pruning methods have been found to actually improve generalization (measured by model accuracy on previously unobserved inputs) (Narang et al., 2017; Frankle & Carbin, 2018; You et al., 2019). Consistent with this, pruning was originally motivated as a means to prevent over-parameterized networks from overfitting to comparatively small datasets (LeCun et al., 1990).
|
| 12 |
+
|
| 13 |
+
Concern about over-parameterizing models has weakened, however, as many recent studies have found that adding parameters can actually reduce a DNN’s generalization-gap (the drop in performance when moving from previously seen to previously unseen inputs), even though it has been shown that the same networks have enough parameters to fit large datasets of randomized data (Neyshabur et al., 2014; Zhang et al., 2016). Potential explanations for this unintuitive phenomenon have come via experiments (Keskar et al., 2016; Morcos et al., 2018; Yao et al., 2018; Belkin et al., 2018; Nagarajan & Kolter, 2019), and the derivation of bounds on DNN generalization-gaps that suggest less overfitting might occur as parameter counts increase (Neyshabur et al., 2018). This research has implications for neural network pruning, where a puzzling question has arisen: if larger parameter counts don’t increase overfitting, how does pruning parameters throughout training improve generalization?
|
| 14 |
+
|
| 15 |
+
To address this question we first introduce the notion of pruning instability, which we define to be the size of the drop in network accuracy caused by a pruning iteration (Section 3). We then empirically analyze the instability and generalization associated with various magnitude-pruning (Han et al., 2015b) algorithms in different settings, making the following contributions:
|
| 16 |
+
|
| 17 |
+
1. We find a tradeoff between the stability and potential generalization benefits of pruning, and show iterative pruning’s similarity to regularizing with noise—suggesting a mechanism unrelated to parameter counts through which pruning appears to affect generalization. 2. We characterize the properties of pruning algorithms which lead to instability and correspondingly higher generalization.
|
| 18 |
+
|
| 19 |
+
3. We derive a batch-normalized-parameter pruning algorithm to better control pruning stability.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
There are various approaches to pruning neural networks. Pruning may be performed post-hoc (LeCun et al., 1990; Hassibi & Stork, 1993; Han et al., 2015b; Liu et al., 2017), or iteratively throughout training, such that there are multiple pruning events as the model trains (Hochreiter & Schmidhuber, 1997; Narang et al., 2017; Zhu & Gupta, 2017). Most methods prune parameters that appear unimportant to the function computed by the neural network, though means of identifying importance vary. Magnitude pruning (Han et al., 2015b) uses small-magnitude to indicate unimportance and has been shown to perform competitively with more sophisticated approaches (Gale et al., 2019).
|
| 24 |
+
|
| 25 |
+
Many pruning studies have shown that the pruned model has heightened generalization (Narang et al., 2017; Frankle & Carbin, 2018; You et al., 2019), consistent with the fact that pruning may be framed as a regularization (rather than compression) approach. For example, variational Bayesian approaches to pruning via sparsity-inducing priors (Molchanov et al., 2017; Louizos et al., 2017) can describe weight removal as a process that reduces model description length, which in theory may help improve generalization (Rissanen, 1978). Similarly, the idea that models may be described more succinctly at flat minima has motivated pruning in service of flat minimum search (Hochreiter & Schmidhuber, 1997). Though Dinh et al. (2017) notes, however, that flatness can be arbitrarily modified by reparameterizing the function, and sharp minima can generalize well.
|
| 26 |
+
|
| 27 |
+
VC dimension (a measure of model capacity) has motivated the use of iterative pruning to improve generalization (LeCun et al., 1990; Hassibi & Stork, 1993). Overfitting can be bounded above by an increasing function of VC dimension, which itself often increases with parameter counts, so fewer parameters can lead to a guarantee of less overfitting (Shalev-Shwartz & Ben-David, 2014). Unfortunately, such bounds can be so loose in practice that tightening them by reducing parameter counts need not translate to better generalization (Dziugaite & Roy, 2017).
|
| 28 |
+
|
| 29 |
+
Rather than support parameter-count-based arguments for generalization in DNNs, our results suggest iterative DNN pruning may improve generalization by creating various noisy versions of the internal representation of the data, which unpruned parameters try to fit to, as in noise-injection regularization (Srivastava et al., 2014; Poole et al., 2014). Dropout creates particularly similar noise, as it temporarily sets random subsets of layer outputs to zero (likely changing an input’s internal representation every epoch). Indeed, applying dropout-like zeroing noise to a subset of features during training can encourage robustness to a post-hoc pruning of that subset (Leclerc et al., 2018; Gomez et al., 2018). Iterative DNN pruning noise ultimately differs, however, as it is: applied less frequently, not temporary (except in algorithms with weight re-entry), usually not random, and less well studied.
|
| 30 |
+
|
| 31 |
+
# 3 APPROACH
|
| 32 |
+
|
| 33 |
+
Given a neural network and set of test data, let $t$ be the top-1 test accuracy, the fraction of test data examples correctly classified multiplied by 100. We define a pruning algorithm’s instability on pruning iteration $i$ in terms of $t$ measured immediately before $( t _ { \mathrm { p r e } , i } )$ and immediately after $( { t _ { \mathrm { p o s t } } } , i )$ pruning: instability $\mathbf { \Phi } _ { i } = t _ { \mathrm { p r e } , i } - t _ { \mathrm { p o s t } , i }$ . In other words, the instability is the size of the accuracy drop caused by a particular pruning event.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
This measure is related to a weight’s importance (sometimes referred to as “saliency”; LeCun et al. (1990); Hassibi & Stork (1993)) to the test accuracy, in that less stable pruning algorithms target more important sets of weights (all else equal). The stability of a pruning algorithm may be affected by many factors. Our experiments (Section 4) explore the effects of the following: pruning target, pruning schedule, iterative pruning rate, and model. The remainder of this section provides an overview of these factors and demonstrates a need for a novel pruning target, which we derive.
|
| 38 |
+
|
| 39 |
+
# 3.1 PRUNING TARGET
|
| 40 |
+
|
| 41 |
+
In all of our experiments, we use iterative magnitude pruning (Han et al., 2015b), which removes weights according to some magnitude-based rule, retrains the resulting smaller network to recover from the pruning, and repeats until the desired size reduction is met. We denote pruning algorithms that target the smallest-magnitude parameters with an "S" subscript (e.g. pruneS), random parameters with an "R" subscript, and the largest-magnitude parameters with an "L" subscript. The usual approach to pruning involves removing parameters that have the smallest magnitudes (Li et al., 2016; Gale et al., 2019), or, similarly, those parameters least important to the loss function as determined by some other metric (LeCun et al., 1990; Hassibi & Stork, 1993; Molchanov et al., 2016; 2017; Louizos et al., 2017; Ye et al., 2018; Yu et al., 2018; You et al., 2019).
|
| 42 |
+
|
| 43 |
+
# 3.1.1 IDENTIFYING IMPORTANT BATCH-NORMALIZED PARAMETERS
|
| 44 |
+
|
| 45 |
+
The correlation between parameter magnitude and importance weakens in the presence of batch normalization (BN) (Ioffe & Szegedy, 2015). Without batch normalization, a convolutional filter with weights $W$ will produce feature map activations with half the magnitude of a filter with weights $2 W$ : filter magnitude clearly scales the output. With batch normalization, however, the feature maps are normalized to have zero mean and unit variance, and their ultimate magnitudes depend on the BN affine-transformation parameters $\gamma$ and $\beta$ . As a result, in batch normalized networks, filter magnitude does not scale the output, and equating small magnitude and unimportance may therefore be particularly flawed. This has motivated approaches to use the scale parameter $\gamma$ ’s magnitude to find the convolutional filters that are important to the network’s output (Ye et al., 2018; You et al., 2019). Here, we derive a novel approach to determining filter importance/magnitude that incorporates both $\gamma$ and $\beta$ .
|
| 46 |
+
|
| 47 |
+
To approximate the expected value/magnitude of a batch-normalized, post-ReLU feature map activation, we start by defining the 2D feature map produced by convolution with BN:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
M = \gamma \mathrm { B N } ( W * x ) + \beta .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
We approximate the activations within this feature map as $M _ { i j } \sim \mathcal { N } ( \beta , \gamma )$ . This approximation is justified if central limit theorem assumptions are met by the dot products in $W * x$ , and we empirically show in Figure A.1 that this approximation is highly accurate early in training, though it becomes less accurate as training progresses. Given this approximation, the post-ReLU feature map
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
R = \operatorname* { m a x } \{ 0 , M \}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
has elements $R _ { i j }$ that are either 0 or samples from a truncated normal distribution with left truncation point $l = 0$ , right truncation point $r = \infty$ , and mean $\mu$ where
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { c } { \displaystyle { \mu = \gamma \frac { \phi ( \lambda ) - \phi ( \rho ) } { Z } + \beta , } } \\ { \displaystyle { \lambda = \frac { l - \beta } { \gamma } , \rho = \frac { r - \beta } { \gamma } , Z = \Phi ( \rho ) - \Phi ( \lambda ) , } } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
and $\phi ( x )$ and $\Phi ( x )$ are the standard normal distribution’s PDF and CDF (respectively) evaluated at $x$ Thus, an approximation to the expected value of $R _ { i j }$ is given by
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathbb { E } [ R _ { i j } ] \approx \Phi ( \lambda ) 0 + ( 1 - \Phi ( \lambda ) ) \mu .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
We use the phrase "E[BN] pruning" to denote magnitude pruning that computes filter magnitude using this derived estimate of $\mathbb { E } [ R _ { i j } ]$ . E[BN] pruning has two advantages. First, this approach avoids the problematic assumption that filter importance is tied to filter $\ell _ { 2 }$ norm in a batch-normalized network. Accordingly, we hypothesize that E[BN] pruning can grant better control of the stability of the neural network’s output than pruning based on filters’ $\ell _ { 2 }$ norms. Second, the complexity of the calculation is negligible as it requires (per filter) just a handful of arithmetic operations on scalars, and two PDF and CDF evaluations, which makes it cheaper than a data-driven approach (e.g. approximating the expected value via the sample mean of feature map activations for a batch of feature maps).
|
| 72 |
+
|
| 73 |
+
# 3.2 SUMMARY OF MODELS
|
| 74 |
+
|
| 75 |
+
We consider three basic model classes: a simple network with convolutions (2x32, pool, 2x64, pool) and fully connected layers (512, 10) that we denote Conv4, VGG11 (Simonyan & Zisserman, 2014) with its fully-connected layers replaced by a single fully-connected layer, and ResNet18 (He et al., 2016). All convolutions are $3 \mathrm { x } 3$ . We trained these models using Adam (Kingma & Ba, 2014) with initial learning rate $l r = 0 . 0 0 1$ , as we found Adam more helpful than SGD for recovering from unstable pruning (seemingly consistent with the observation in Zhu & Gupta (2017) that recovery from pruning is more difficult when learning rates are low).
|
| 76 |
+
|
| 77 |
+
# 3.3 ITERATIVE PRUNING RATE AND SCHEDULE
|
| 78 |
+
|
| 79 |
+
For Conv4, we apply pruning to its first linear layer (which contains $94 \%$ of Conv4’s 1,250,858 parameters). For VGG/ResNet, pruning targets the final four convolutional layers (which contain $90 \%$ of VGG11’s 9,231,114 parameters, and $74 \%$ of ResNet18’s 11,173,962 parameters). Pruning focused on later layers partly because, as also found in Li et al. (2016); You et al. (2019), it allowed the network to recover more easily.
|
| 80 |
+
|
| 81 |
+
The pruning algorithms we consider are iterative: we define a pruning schedule that describes the epochs on which pruning events occur, and set a corresponding (constant) iterative pruning rate that will ensure the total pruning percentage is met by the end of training (please see Appendix A.5 for rate and schedule details). Thus, throughout training, pruning steadily removes DNN parameters, with the iterative pruning rate determining the number pruned per event. While our plots label each pruning configuration with its iterative pruning rate, the total pruning percentages were: $42 \%$ of VGG11, $46 \%$ of ResNet18, and $10 \%$ of Conv4 (except in Appendix A.4, wherein we prune $8 5 \%$ of Conv4).
|
| 82 |
+
|
| 83 |
+
# 4 EXPERIMENTS
|
| 84 |
+
|
| 85 |
+
Pruning studies often aim to compress pre-trained models that generalize well, and consequently, much work has focused on metrics to identify parameter importance: if you can find the parameters that matter the least to the function computed by the DNN, then you can prune more parameters without significantly harming accuracy. As a bonus, such pruning methods can sometimes even increase generalization (Narang et al., 2017; Frankle & Carbin, 2018; You et al., 2019). However, the mechanism by which pruning induces higher generalization remains unclear. Here, rather than investigate how to best maintain accuracy when pruning the network, we instead focus on understanding the mechanisms underlying these generalization improvements.
|
| 86 |
+
|
| 87 |
+
# 4.1 THE GENERALIZATION-STABILITY TRADEOFF
|
| 88 |
+
|
| 89 |
+
Can improved generalization in pruned DNNs be explained by parameter-count reduction alone, or rather, do the properties of the pruning algorithm play an important role in generalization? As removing parameters from a DNN via pruning may make the DNN less capable of fitting to the noise in the training data, as originally suggested in LeCun et al. (1990); Hassibi & Stork (1993), we might expect that the generalization improvements observed in pruned DNNs are entirely explained by the number of parameters removed. In which case, methods that prune equal amounts of parameters would generalize similarly.
|
| 90 |
+
|
| 91 |
+
Alternatively, perhaps some aspect of the pruning algorithm itself is responsible for increased generalization. This seems plausible as the reported generalization benefits of pruning vary widely across studies. One possible explanation for this variability is differences in the pruning algorithms themselves. A key differentiator of these algorithms is their stability: more stable approaches may compute a very close approximation to the way the loss changes with respect to each parameter and prune a single parameter at a time (Hassibi & Stork, 1993), while less stable approaches may assume that parameter magnitude and importance are roughly similar and prune many weights all at once (Han et al., 2015b). Therefore, to the extent that differences in pruning algorithms explain differences in pruning-based generalization improvements, we might expect to observe a relationship between generalization and pruning stability.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 1: Pruning instability improves generalization of (Top) VGG11 and (Bottom) ResNet18 when training on CIFAR-10 (10 runs per configuration). (Left) Test accuracy during training of several models illustrates how adaptation to more unstable pruning leads to better generalization. (Right) Means reduce along the epoch dimension (creating one point per run-configuration combination).
|
| 95 |
+
|
| 96 |
+
To determine whether pruning algorithm stability affects generalization, we compared the instability and final top-1 test accuracy of several pruning algorithms with varying pruning targets and iterative pruning rates (Figure 1). Consistent with the nature of the pruning algorithm playing a role in generalization, we observed that more unstable pruning algorithms created higher final test accuracies than those which were stable (Figure 1, right; VGG11: Pearson’s correlation $r \ = \ . 8 4$ , $\mathsf { p } \cdot$ -value $= 1 . 6 \mathrm { e } { - 1 1 }$ ; ResNet18: $r = . 6 5$ , $\mathsf { p }$ -value $= 5 \mathrm { { e - 5 } }$ ). While many pruning approaches have aimed to induce as little instability as possible, these results suggest that pruning techniques may actually facilitate better generalization when they induce more instability. Furthermore, these results suggest that parameter-count based arguments may not be sufficient to explain generalization in pruned DNNs, and suggest that the precise pruning method plays a critical role in this process.
|
| 97 |
+
|
| 98 |
+
Figure 1 also demonstrates that pruning events for pruneL with a high iterative pruning rate (red curve, pruning as much as $13 \%$ of a given convolutional layer per pruning iteration) are substantially more destabilizing than other pruning events, but despite the dramatic pruning-induced drops in performance, the network recovers to higher performance within a few epochs. Several of these pruning events are highlighted with red arrows. Please see Appendix A.2 for visualization of the epoch-wise instabilities of each method in VGG11, and Appendix A.3 for an $\ell _ { 2 }$ -norm pruning version of Figure 1, which has qualitatively similar results.
|
| 99 |
+
|
| 100 |
+
Interestingly, we initially observed that ResNet18 adapted to pruning events more quickly than VGG11 (accuracy rebounded after pruning then flattened soon after instead of climbing steadily). Thinking that shortcut connections were allowing the network to adapt to pruning events too easily, we tried pruning a larger amount of the penultimate block’s output layer: this reduced the number of shortcut connections to the final block’s output layer, lengthened the adaptation period, and improved generalization. This simple improvement of pruning hyperparameters suggests a potential for further optimization of the results shown. Please see Appendix A.5.1 for all hyperparameters/details of these experiments.
|
| 101 |
+
|
| 102 |
+
# 4.2 THE ROLE OF WEIGHT MAGNITUDE IN PRUNING REGULARIZATION
|
| 103 |
+
|
| 104 |
+
We have demonstrated that, perhaps surprisingly, pruning larger magnitude weights via the E[BN] algorithm can result in larger test accuracy improvements (Figure 1). This suggests a positive correlation between pruning target magnitude and pruning’s regularization effect. However, it’s not clear whether this relationship holds more generally; i.e., perhaps it was caused by a feature of our
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: When pruning $10 \%$ of Conv4’s largest dense layer, the final generalization gap depends on the magnitude of the weights that were pruned during training. This is particularly true when using unstructured pruning (left) rather than structured pruning (right).
|
| 108 |
+
|
| 109 |
+
E[BN] algorithm or the networks examined. Alternatively, this effect may be dependent on whether nodes/filters (structured pruning) or individual parameters (unstructured pruning) are pruned.
|
| 110 |
+
|
| 111 |
+
As such, we tested whether target weight magnitude correlates with pruning’s regularizing effect when using both unstructured and structured magnitude pruning on the penultimate linear layer of a small network without batch normalization (Conv4). Specifically, we constructed a pruning target for each weight-magnitude decile (see Appendix A.5.2 for details), used each target to prune ten separate networks as they trained, and compared the generalization gaps (test-train accuracy) of the pruned networks to the target pruned (Figure 2).
|
| 112 |
+
|
| 113 |
+
For both unstructured and structured pruning (Figure 2 left and right, respectively), we found that pruning larger weights led to better generalization gaps, though, interestingly, this effect was much more dramatic in the context of unstructured pruning than structured pruning. One possible explanation for this is that, in structured pruning, the $\ell _ { 2 }$ norm of pruned neurons did not vary dramatically past the fifth decile, whereas the unstructured deciles were approximately distributed exponentially. As a result, the top $50 \%$ of filters for the structured case were not clearly distinguished, making magnitude pruning much more susceptible to small sources of noise. These results suggest that, when weight magnitudes vary considerably, pruning large magnitude weights may lead to improved generalization.
|
| 114 |
+
|
| 115 |
+
Interestingly, for ResNet18, we actually found that structured pruneL (red line) performed better than unstructured pruneL (green line) (Figure 3). The worse performance of unstructured prune $\mathrm { L }$ may stem from its harming the helpful inductive bias provided by convolutional filters (i.e., perhaps removing the most important connections in all convolutional filters degrades performance more than pruning the same number of connections via removal of several entire filters) or its lower instability.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: The top-1 test accuracy during training with multiple approaches to pruning ResNet18.
|
| 119 |
+
|
| 120 |
+
# 4.3 THE ROLE OF ITERATIVE PRUNING RATE IN PRUNING INSTABILITY
|
| 121 |
+
|
| 122 |
+
While pruning large magnitude weights appears to play a role in pruning’s ability to improve generalization, more commonly used pruning algorithms often see generalization improvements when targeting the smallest magnitude or least important parameters, suggesting that target magnitude/importance is not the only characteristic of pruning algorithms relevant to generalization. One possibility is that, given a pruning target, pruning more parameters per pruning iteration (while holding constant the total pruning percentage) may lead to greater instability. If this is the case, the generalization-stability tradeoff suggests that the increase in instability from raising the iterative pruning rate would coincide with improved generalization performance. Alternatively, if the pruning target or total pruning percentage is all that matters, we may expect that changing the iterative pruning rate (while keeping the pruning target and total pruning percentage fixed) would not affect generalization.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 4: In VGG11, increasing the iterative pruning rate (and decreasing the number of pruning events in order to hold total pruning percentage constant) leads to more instability, and can allow methods that target less important parameters to generalize better. Additionally, E[BN] magnitude better approximates parameter importance than $\ell _ { 2 }$ -norm magnitude (see Figure A2 for another example and discussion of this phenomenon). An unpruned baseline model has $8 5 . 2 1 \%$ accuracy.
|
| 126 |
+
|
| 127 |
+
To test this, we plotted mean instability and test accuracy as a function of different iterative pruning rates for both $\ell _ { 2 }$ -norm and E[BN] pruning (Figure 4). Consistent with iterative pruning rate playing a role in instability, we find that (given a pruning target) more instability is induced by using larger iterative pruning rates (Figure 4 left). Moreover, pruning random or small magnitude parameters performs best at the largest iterative rate $( 3 0 \% )$ , supporting the idea that these methods require a source of instability to boost generalization. Note this suggests that, when targeting less important weights, higher iterative pruning rates during training can be an effective way to induce additional instability and generalization. (Algorithm and experiment details are available in Appendix A.5.4.)
|
| 128 |
+
|
| 129 |
+
Perhaps strangely, higher iterative pruning rates did not translate to improved generalization when targeting the largest magnitude weights (pruneL) with $\ell _ { 2 }$ -norm pruning. The fact that pruneL does not generalize the best at the highest iterative pruning rate may be due to the reduction in pruning iterations required by the large iterative pruning rate (i.e., when the iterative rate is at $30 \%$ , the number of pruning events is capped at three, which removes $90 \%$ of a layer). Thus, while this rate grants more instability (Figure 4 left) per iteration, pruning affects the network less often. The idea that the regularizing effect of pruning is enhanced by pruning more often may also help explain the observation that methods that prune iteratively can generalize better (Han et al., 2015b).
|
| 130 |
+
|
| 131 |
+
Another possibility is that, since raising the iterative pruning rate (and consequently the duration between pruning events) tends to make the $\ell _ { 2 }$ -norm worse for differentiating parameters by their importance to accuracy1, raising the iterative pruning rate causes pruneL with $\ell _ { 2 }$ -norm pruning to target less important weights. Consequently, prune $\mathrm { L }$ with $\ell _ { 2 }$ -norm pruning may generalize worse at higher iterative rates by leaving unpruned more important weights, the presence of which can harm model generalization (Hinton & Van Camp, 1993; Morcos et al., 2018). Relatedly, this also means that pruneS with $\ell _ { 2 }$ -norm pruning may increase (in networks with batch normalization at least) instability and generalization by failing to avoid the pruning of important parameters.
|
| 132 |
+
|
| 133 |
+
# 4.4 ITERATIVE PRUNING AS NOISE INJECTION
|
| 134 |
+
|
| 135 |
+
Our results thus far suggest that pruning improves generalization when it creates instability throughout training. These prior results, though, involved damaging model capacity simply by the nature of pruning, which decreases the number of model parameters. It therefore remains possible that the generalization benefits we’ve seen rely upon the reduction in capacity conferred by pruning. Here, we examine this critical question.
|
| 136 |
+
|
| 137 |
+
We first note that iterative pruning can be viewed as noise injection (Srivastava et al., 2014; Poole et al., 2014), with the peculiarity that the noise permanently zeroes a subset of weights. Removing the permanence of this zeroing can mitigate some of the capacity effect of pruning2 and, therefore, help us isolate and study how iterative pruning regularizes through noise injection.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 5: Generalization improvements from pruning bear resemblance to those obtained by using temporary (Left) multiplicative zeroing noise, and (Right) additive Gaussian noise, as long as the noise is applied for enough batches/steps.
|
| 141 |
+
|
| 142 |
+
As a baseline, we consider pruneL applied to VGG11, judging filter magnitude via the $\ell _ { 2 }$ -norm (additional experimental details are in Appendix A.5.5). We then modify this algorithm such that, rather than permanently prune filters, it simply multiplies the filter weights by zero, then allows the zeroed weights to immediately resume training in the network ("Zeroing $0 "$ in Figure 5 Left). However, by allowing pruned weights to immediately recover, this experiment also removes a key, potentially regularizing aspect of pruning noise: the requirement that the rest of the network adapts to fit the new representations generated by pruning. To encourage this potentially important facet of pruning noise, we also added variants that held weights to zero for 50 and 1500 consecutive batches3. As a related experiment, we also measured the impact of adding Gaussian noise to the weights in Figure 5, right. Noise was applied either once (Gaussian 0) or repeatedly over a series of training batches (Gaussian 50/1500).
|
| 143 |
+
|
| 144 |
+
If the capacity effects of weight removal are not necessary to explain pruning’s effect on generalization, then we would expect that the generalization behavior of these non-permanent noise injection algorithms could mimic the generalization behavior of pruneL. Alternatively, if weight removal is a necessary component of pruning-based generalization improvements, then we would not expect close similarities between the generalization phenomena of pruneL and non-permanent pruning noise injection.
|
| 145 |
+
|
| 146 |
+
Consistent with the capacity effects of weight removal not being necessary to explain generalization in pruned DNNs, applying zeroing noise for 50 batches to filters (rather than pruning them completely) generates strikingly similar accuracy to pruneL (Figure 5 Left). Specifically, the patterns in instability are qualitatively and quantitatively similar, as are the generalization levels throughout training.
|
| 147 |
+
|
| 148 |
+
Importantly, we found that applying zeroing noise once (Zeroing 0; brown line) was not sufficient to generate better performance, suggesting that the regularization induced by forcing weights to adapt to noised representations is critical to pruning’s ability to improve generalization. Moreover, we found that, while applying Gaussian noise could increase generalization if applied for long enough (Gaussian 1500; purple line), it still did not match the performance of pruneL, suggesting that multiplicative zeroing noise is substantially more effective than additive Gaussian noise4. Together, these results demonstrate that pruning induced generalization benefits are not merely explained by weight removal, but rather are dependent on the regularization conferred by forcing networks to adapt to noised representations over a sufficiently long period throughout training.
|
| 149 |
+
|
| 150 |
+
# 5 DISCUSSION
|
| 151 |
+
|
| 152 |
+
In this study, we defined the notion of pruning algorithm instability, and applied several pruning approaches5 to multiple neural networks, assessing the approaches’ effects on instability and generalization. Throughout these experiments, we observed that pruning algorithms that generated more instability led to better generalization (as measured by test accuracy). For a given pruning target and total pruning percentage, instability and generalization could be fueled by raising iterative pruning rates (Figure 4, Section 4.3). Additionally, targeting more important weights, again holding total parameters pruned constant, led to more instability and generalization than targeting less important weights (Figure 1, Section 4.1).
|
| 153 |
+
|
| 154 |
+
These results support the idea that the generalization benefits of pruning cannot be explained solely by pruning’s effect on parameter counts—the properties of the pruning algorithm must be taken into account. Our analysis also suggests that the capacity effects of weight-removal may not even be necessary to explain how pruning improves generalization. Indeed, we provide an interpretation of iterative pruning as noise injection, a popular approach to regularizing DNNs, and find that making pruning noise impermanent provides pruning-like generalization benefits while not removing as much capacity as permanent pruning (Figure 5, Section 4.4).
|
| 155 |
+
|
| 156 |
+
# 5.1 CAVEATS AND FUTURE WORK
|
| 157 |
+
|
| 158 |
+
While not emphasized in our discussion, pruning algorithm stability can be a desirable property, as recovery from pruning damage is not guaranteed. Indeed, pruning too many large/important weights can lead to worse final generalization (Li et al., 2016). Recovery appears to be a function of several factors, including: learning rate (Zhu & Gupta, 2017)); presence of an ongoing regularization effect (Figure 3, Section 4.2); preservation of helpful inductive biases (Figure 3, Section 4.2); and damage to network capacity (e.g., removing too much of an important layer could cause underfitting).
|
| 159 |
+
|
| 160 |
+
A better understanding of the factors which aid recovery from pruning instability could aid the design of novel pruning algorithms. For example, pruning methods that allow weights to re-enter the network (Narang et al., 2017) could perhaps prune important weights occasionally to enhance generalization improvements, without risking permanent damage to the pruned networks (see Appendix A.4).
|
| 161 |
+
|
| 162 |
+
In describing how pruning regularizes a model, we touched on similarities between pruning and noise injection. Our results, however, may also be consistent with other parameter-count-independent approaches to understanding generalization in neural networks, as pruning may reduce the information stored in the network’s weights (Hinton & Van Camp, 1993), and make the network more distributed (Morcos et al., 2018; Dettmers & Zettlemoyer, 2019). This raises the possibility that pruning noise engenders helpful properties in DNNs, though it remains unclear whether such properties might be identical to those achieved with more common noise injection schemes (Srivastava et al., 2014; Poole et al., 2014). Further exploration will be necessary to better understand the relationship between these approaches.
|
| 163 |
+
|
| 164 |
+
One important caveat of our results is that they were generated with CIFAR-10, a relatively small dataset, so future work will be required to evaluate whether the presented phenomena hold in larger datasets. Relatedly, we only studied pruning’s regularizing effect in isolation and did not include commonly used regularizers (e.g., weight decay) in our setups. In future work, it would be interesting to examine whether pruning complements the generalization improvements of other commonly used regularization techniques.
|
| 165 |
+
|
| 166 |
+
# REFERENCES
|
| 167 |
+
|
| 168 |
+
Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machine learning and the bias-variance trade-off. arXiv preprint arXiv:1812.11118, 2018.
|
| 169 |
+
|
| 170 |
+
Tim Dettmers and Luke Zettlemoyer. Sparse networks from scratch: Faster training without losing performance. arXiv preprint arXiv:1907.04840, 2019.
|
| 171 |
+
|
| 172 |
+
Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. arXiv preprint arXiv:1703.04933, 2017.
|
| 173 |
+
|
| 174 |
+
Gintare Karolina Dziugaite and Daniel M Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. arXiv preprint arXiv:1703.11008, 2017.
|
| 175 |
+
|
| 176 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
|
| 177 |
+
|
| 178 |
+
Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. CoRR, abs/1902.09574, 2019. URL http://arxiv.org/abs/1902.09574.
|
| 179 |
+
|
| 180 |
+
Aidan N Gomez, Ivan Zhang, Kevin Swersky, Yarin Gal, and Geoffrey E Hinton. Targeted dropout. 2018.
|
| 181 |
+
|
| 182 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015a.
|
| 183 |
+
|
| 184 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, pp. 1135–1143, 2015b.
|
| 185 |
+
|
| 186 |
+
Babak Hassibi and David G Stork. Second order derivatives for network pruning: Optimal brain surgeon. In Advances in neural information processing systems, pp. 164–171, 1993.
|
| 187 |
+
|
| 188 |
+
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, pp. 770–778, 2016.
|
| 189 |
+
|
| 190 |
+
Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the sixth annual conference on Computational learning theory, pp. 5–13. ACM, 1993.
|
| 191 |
+
|
| 192 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural Computation, 9(1):1–42, 1997.
|
| 193 |
+
|
| 194 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 195 |
+
|
| 196 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
|
| 197 |
+
|
| 198 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 199 |
+
|
| 200 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 201 |
+
|
| 202 |
+
Guillaume Leclerc, Manasi Vartak, Raul Castro Fernandez, Tim Kraska, and Samuel Madden. Smallify: Learning network size while training. arXiv preprint arXiv:1806.03723, 2018.
|
| 203 |
+
|
| 204 |
+
Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems, pp. 598–605, 1990.
|
| 205 |
+
|
| 206 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016.
|
| 207 |
+
|
| 208 |
+
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In Computer Vision (ICCV), 2017 IEEE International Conference on, pp. 2755–2763. IEEE, 2017.
|
| 209 |
+
|
| 210 |
+
Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. In Advances in Neural Information Processing Systems, pp. 3290–3300, 2017.
|
| 211 |
+
|
| 212 |
+
Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. arXiv preprint arXiv:1701.05369, 2017.
|
| 213 |
+
|
| 214 |
+
Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient transfer learning. arXiv preprint arXiv:1611.06440, 2016.
|
| 215 |
+
|
| 216 |
+
Ari Morcos, David GT Barrett, Neil C Rabinowitz, and Matthew Botvinick. On the importance of single directions for generalization. In Proceeding of the International Conference on Learning Representations, 2018.
|
| 217 |
+
|
| 218 |
+
Vaishnavh Nagarajan and J Zico Kolter. Generalization in deep networks: The role of distance from initialization. arXiv preprint arXiv:1901.01672, 2019.
|
| 219 |
+
|
| 220 |
+
Sharan Narang, Gregory Diamos, Shubho Sengupta, and Erich Elsen. Exploring sparsity in recurrent neural networks. arXiv preprint arXiv:1704.05119, 2017.
|
| 221 |
+
|
| 222 |
+
Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. arXiv preprint arXiv:1412.6614, 2014.
|
| 223 |
+
|
| 224 |
+
Behnam Neyshabur, Zhiyuan Li, Srinadh Bhojanapalli, Yann LeCun, and Nathan Srebro. Towards understanding the role of over-parametrization in generalization of neural networks. arXiv preprint arXiv:1805.12076, 2018.
|
| 225 |
+
|
| 226 |
+
Ben Poole, Jascha Sohl-Dickstein, and Surya Ganguli. Analyzing noise in autoencoders and deep networks. arXiv preprint arXiv:1406.1831, 2014.
|
| 227 |
+
|
| 228 |
+
Jorma Rissanen. Modeling by shortest data description. Automatica, 14(5):465–471, 1978.
|
| 229 |
+
|
| 230 |
+
Shai Shalev-Shwartz and Shai Ben-David. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014.
|
| 231 |
+
|
| 232 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 233 |
+
|
| 234 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014.
|
| 235 |
+
|
| 236 |
+
Zhewei Yao, Amir Gholami, Qi Lei, Kurt Keutzer, and Michael W Mahoney. Hessian-based analysis of large batch training and robustness to adversaries. In Advances in Neural Information Processing Systems, pp. 4949–4959, 2018.
|
| 237 |
+
|
| 238 |
+
Jianbo Ye, Xin Lu, Zhe Lin, and James Z Wang. Rethinking the smaller-norm-less-informative assumption in channel pruning of convolution layers. arXiv preprint arXiv:1802.00124, 2018.
|
| 239 |
+
|
| 240 |
+
Zhonghui You, Jinmian Yan, Kun; Ye, Meng Ma, and Ping Wang. Gate decorator: Global filter pruning method for accelerating deep convolutional neural networks. In Advances in Neural Information Processing Systems, 2019.
|
| 241 |
+
|
| 242 |
+
Ruichi Yu, Ang Li, Chun-Fu Chen, Jui-Hsin Lai, Vlad I Morariu, Xintong Han, Mingfei Gao, Ching-Yung Lin, and Larry S Davis. Nisp: Pruning networks using neuron importance score propagation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9194–9203, 2018.
|
| 243 |
+
|
| 244 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 245 |
+
|
| 246 |
+
Michael Zhu and Suyog Gupta. To prune, or not to prune: exploring the efficacy of pruning for model compression. arXiv preprint arXiv:1710.01878, 2017.
|
| 247 |
+
|
| 248 |
+
# A APPENDIX
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
Figure A1: We examined the normalized activations (shown in blue histograms) of feature maps in the final eight convolutional layers of VGG19 before (left) and after (right) training to convergence. We found that the approximation to standard normality (shown in orange) of these activations is reasonable early on but degrades with training (particularly in layers near the output).
|
| 252 |
+
|
| 253 |
+
The main drawback to the E[BN] approach (Section 3.1.1) is the sometimes poor approximation $M _ { i j } \sim N ( \beta , \gamma )$ . In Figure A.1, the approximation’s quality depends on layer and training epoch. A less serious drawback is that this approach does not account for the strength of connections to the post-BN feature map, which could have activations with a large expected value but low importance if relatively small-magnitude weights connected the map to the following layer.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure A2: In VGG11, pruneS E[BN] is more stable than pruneS, which uses filter- $\cdot \ell _ { 2 }$ -norm to compare parameter magnitudes. Methods with higher iterative pruning rates create more instability on a given iteration. Means reduce along the run dimension (10 runs per configuration).
|
| 257 |
+
|
| 258 |
+
Note that this graph uses a method (pruneS) that was included in Figure 1 right, but was not displayed in Figure 1 left due to its similarity to pruneS E[BN]. Additional experimental details are in Section A.5.1.
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure A3: Pruning instability improves generalization of (Top) VGG11 and (Bottom) ResNet18 when training on CIFAR-10 (10 runs per configuration). (Left) Test accuracy during training of several models illustrates how adaptation to more unstable pruning leads to better generalization. (Right) Means reduce along the epoch dimension (creating one point per run-configuration combination).
|
| 262 |
+
|
| 263 |
+
Here we use the same training and pruning configurations that were used for Figure 1, but we replace E[BN] pruning with $\ell _ { 2 }$ -norm pruning. Qualitatively, the two figures’ results are similar. Interestingly, though, the correlation between instability and generalization is somewhat weaker with $\ell _ { 2 }$ -norm pruning. This may be explained by the fact that $\ell _ { 2 }$ -norm pruning generates a narrower spectrum of instabilities, which is perhaps due to $\ell _ { 2 }$ -norm scoring’s inability to accurately assess parameter importance (illustrated in Figure 4).
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure A4: When training Conv4 on CIFAR10, unstable pruning can significantly improve the baseline’s generalization. The training accuracies and test accuracies (the latter were calculated immediately after pruning) illustrate how much each pruning algorithm disturbs the neural network’s output during training.
|
| 267 |
+
|
| 268 |
+
While it’s unclear how much unstable pruning, which is particularly damaging to capacity, can be sustained at high sparsity levels, prune $L$ can lead to generalization several percentage points above the baseline/prune $S$ when pruning $85 \%$ of Conv4. Please see Section A.5.6 for experimental setup details.
|
| 269 |
+
|
| 270 |
+
# A.5 EXPERIMENTAL DETAILS
|
| 271 |
+
|
| 272 |
+
Unstructured magnitude pruning entails removing individual weights (subsets of filters/neurons), which are selected for pruning based on their magnitude. Our unstructured pruning approach does not allow previously pruned weights to reenter the network (Narang et al., 2017; Zhu & Gupta, 2017; Gale et al., 2019). Structured magnitude pruning removes entire filters/neurons, which are selected based on their $\ell _ { 2 }$ -norms or via the E[BN] calculation. Except where noted, we use structured pruning for VGG11 and ResNet18.
|
| 273 |
+
|
| 274 |
+
We denote the pruning of $n$ layers of a network by specifying a series of epochs at which pruning starts $s = ( s _ { 1 } , . . . , s _ { n } )$ , a series of epochs at which pruning ends $\boldsymbol { e } = ( e _ { 1 } , . . . , e _ { n } )$ , a series of fractions of parameters to remove $p = ( p _ { 1 } , . . . , p _ { n } )$ , and an inter-pruning-iteration retrain period $r \in \mathbb N$ . For a given layer $l$ , the retrain period $r$ and fraction $p _ { l }$ jointly determine the iterative pruning percentage $i _ { l }$ . Our experiments prune the same number of parameters $i _ { l } \times \mathrm { s i z e } ( l a y e r _ { l } )$ per pruning iteration, ultimately removing $p _ { l } \times 1 0 0 \%$ of the parameters by the end of epoch $e _ { l }$ .
|
| 275 |
+
|
| 276 |
+
Our approach is designed to study the effects of changing factors such as the iterative pruning rate and lacks some practically helpful features, e.g. hyperparameters indicating how many parameters can be safely pruned (Liu et al., 2017; Molchanov et al., 2017). When layerwise iterative pruning percentages differ (i.e., when there exists an $a$ and $b$ such that $i _ { a }$ and $i _ { b }$ are unequal), our figures state the largest iterative pruning rate that was used in any of the layers.
|
| 277 |
+
|
| 278 |
+
For ResNet, our pruning algorithms did not account for the magnitude of incoming shortcut connections when judging filter magnitude/importance. Though we did prune the incoming and outgoing shortcut connections associated with any pruned feature maps.
|
| 279 |
+
|
| 280 |
+
We used only the CIFAR-10 dataset (Krizhevsky & Hinton, 2009) in our experiments, a limitation of our study. We used batch size 128, and only used data augmentation in the decile experiment (Figure 2). For some experiments, we give multi-step learning rate schedules $l r _ { s } = ( x , y )$ , which means we shrink the learning rate by a factor of 10 at epochs $x$ and $y$ .
|
| 281 |
+
|
| 282 |
+
# A.5.1 FIGURE 1
|
| 283 |
+
|
| 284 |
+
We used E[BN] pruning in all models that were pruned, except for one model that used $\ell _ { 2 }$ -norm magnitude pruning, which was included in Figure 1 right but not displayed in Figure 1 left due to its qualitative similarity to pruneS E[BN]. We leave out "E[BN]" in the legend of Figure 1 left, but all models nonetheless used E[BN] pruning.
|
| 285 |
+
|
| 286 |
+
The models were trained on CIFAR-10 with Adam for 325 epochs with $l r _ { s } = ( 1 5 0 , 3 0 0 )$ . The error bars are $9 5 \%$ confidence intervals for the mean, bootstrapped from 10 distinct runs of each experiment.
|
| 287 |
+
|
| 288 |
+
Since the layerwise pruning percentages varied, pruning required multiple iterative pruning percentages, the largest of which is denoted in the legend (rounded to the nearest integer).
|
| 289 |
+
|
| 290 |
+
VGG11 Pruning targeted the final four convolutional layers during training with (layerwise) starting epochs $s = ( 3 , 4 , 5 , 6 )$ , ending epochs $e = ( 1 5 0 , 1 5 0 , 1 5 0 , 2 7 5 )$ , and pruning fractions $p = ( 0 . 3 , 0 . 3 , 0 . 3 , 0 . 9 )$ . To allow for the same amount of pruning among models with differing iterative pruning percentages, we adjusted the number of inter-pruning retraining epochs. The models with the maximum iterative pruning percentage of $1 \%$ had $r = 4$ , while the models with the maximum iterative pruning percentage of $13 \%$ had $r = 4 0$ . The model pruned with $\ell _ { 2 }$ -norm magnitude pruning, which only appeared in Figure 1 right, had $r = 4$ as well.
|
| 291 |
+
|
| 292 |
+
ResNet18 Pruning targeted the final four convolutional layers of ResNet18 during training with (layerwise) starting epochs $s = ( 3 , 4 , 5 , 6 )$ , ending epochs $e = ( 1 5 0 , 1 5 0 , 1 7 0 , 2 7 5 )$ , and pruning fractions $p = ( 0 . 2 5 , 0 . 4 , 0 . 2 5 , 0 . 9 5 )$ . As noted in Section 4.1, we increased the pruning rate of the output layer of the penultimate block to remove shortcut connections to the last layer, thinking that it should increase the duration of adaptation to pruning. The models with the maximum iterative pruning percentage of $1 \%$ had $r = 4$ , while the models with the maximum iterative pruning percentage of $13 \%$ had $r = 4 0$ .
|
| 293 |
+
|
| 294 |
+
# A.5.2 FIGURE 2
|
| 295 |
+
|
| 296 |
+
Each experiment in Figure 2 targeted one of ten weight-magnitude deciles in the post-convolutional linear layer of the Conv4 network during training on CIFAR-10 with data augmentation.
|
| 297 |
+
|
| 298 |
+
While there are just ten deciles, the iterative nature of our pruning algorithms required the creation of eleven different pruning targets: ten methods pruned from the bottom of the decile upward (one experiment for each decile’s starting point: 0th percentile, 10th percentile, etc.), and one (D10) pruned from the last decile’s ending point downward (pruning the very largest collection of weights each iteration). In other words, D9 and D10 targeted the same decile (90th percentile to maximum value), but only D10 actually removed the largest weights on a given iteration (weights in the 100th-99th percentiles, for example). The D9 experiment would target weights starting from the 90th percentile (e.g. it may prune the 90th-91st percentiles on a particular iteration).
|
| 299 |
+
|
| 300 |
+
The training/pruning setup used the Adam optimizer, $s = ( 4 )$ , $e = ( 5 2 )$ , $p = ( 0 . 1 )$ , $r = 3$ , and $l r _ { s } = ( 3 0 , \bar { 6 } 0 )$ . We calculated the generalization gap on epoch 54 and sampled average pruned magnitudes on epoch 35. We obtained qualitatively similar results regardless of whether we used fewer training epochs or data augmentation. The error bars are $9 5 \%$ confidence intervals for the means, bootstrapped from 10 distinct runs of each configuration.
|
| 301 |
+
|
| 302 |
+
# A.5.3 FIGURE 3
|
| 303 |
+
|
| 304 |
+
In Figure 3, prune $\mathrm { L }$ was applied to the final four convolutional layers of ResNet18 during training with (layerwise) starting epochs $s = ( 3 , 4 , 5 , 6 )$ , ending epochs $e = ( 1 5 0 , 1 5 0 , 1 7 0 , 2 7 5 )$ , and pruning fractions $p = ( 0 . 2 5 , 0 . 4 , 0 . 2 5 , 0 . 9 5 )$ . Since the layerwise pruning percentages varied, pruning required multiple iterative pruning percentages, the largest of which is denoted in the legend (rounded to the nearest integer). The models with the maximum iterative pruning percentage of $1 \%$ had $r = 4$ , the models with the maximum iterative pruning percentage of $13 \%$ had $r = 4 0$ , and the "One Shot" model pruned all its targeted parameters at once on epoch 246.
|
| 305 |
+
|
| 306 |
+
When performing unstructured pruning, we pruned individual weights from filters based on their magnitude. The structured pruning experiments used E[BN] pruning.
|
| 307 |
+
|
| 308 |
+
The models were trained on CIFAR-10 with Adam for 325 epochs with $l r _ { s } = ( 1 5 0 , 3 0 0 )$ . The error bars are $9 5 \%$ confidence intervals for the means, bootstrapped from 10 distinct runs of each experiment.
|
| 309 |
+
|
| 310 |
+
# A.5.4 FIGURE 4
|
| 311 |
+
|
| 312 |
+
In Figure 4, pruning targeted the final four convolutional layers of VGG11 during training with (layerwise) starting epochs $s = ( 3 , 4 , 5 , 6 )$ , ending epochs $e = ( 1 5 0 , 1 5 0 , 1 5 0 , 2 7 5 )$ , and pruning fractions $p = ( 0 . 3 , 0 . 3 , 0 . 3 , 0 . 9 )$ . To create the different iterative pruning rates, we used models with inter-pruning retrain periods $r = 4$ , $r = 2 0$ , $r = 4 0$ , $r = 6 0$ , and $r = 1 0 0$ . Since the layerwise pruning percentages varied, pruning required multiple iterative pruning percentages, the largest of which is denoted on the horizontal axis. An unpruned baseline model average (10 runs) is plotted on the dotted line.
|
| 313 |
+
|
| 314 |
+
The models were trained on CIFAR-10 with Adam for 325 epochs with $l r _ { s } = ( 1 5 0 , 3 0 0 )$ . The error bars are $9 5 \%$ confidence intervals for the means, bootstrapped from 10 distinct runs of each experiment.
|
| 315 |
+
|
| 316 |
+
# A.5.5 FIGURE 5
|
| 317 |
+
|
| 318 |
+
In Figure 5, pruning targeted the final four convolutional layers of VGG11 during training with (layerwise) starting epochs $s = ( 3 , 4 , 5 , 6 )$ , ending epochs $e = ( 1 5 0 , 1 5 0 , 1 5 0 , 2 7 5 )$ , pruning fractions $p = ( 0 . 3 , 0 . 3 , \bar { 0 } . 3 , 0 . 9 )$ , and inter-pruning-iteration retrain period $r = 4 0$ . When injecting pruning noise, we used the same pruning schedule and percentages, but applied noise to the parameters instead of removing them. The Gaussian noise had mean 0 and standard deviation equal to the empirical standard deviation of a noiseless filter from the same layer. Prune $\mathrm { L }$ used $\ell _ { 2 }$ -norm pruning.
|
| 319 |
+
|
| 320 |
+
The models were trained on CIFAR-10 with Adam for 325 epochs with $l r _ { s } = ( 1 5 0 , 3 0 0 )$ . The error bars are $9 5 \%$ confidence intervals for the means, bootstrapped from 10 distinct runs of each experiment.
|
| 321 |
+
|
| 322 |
+
# A.5.6 APPENDIX A.4
|
| 323 |
+
|
| 324 |
+
Each experiment in Appendix A.4 targeted the post-convolutional linear layer of the Conv4 network during training on CIFAR-10 with the Adam optimizer. The pruning algorithms start on epoch $s = ( 3 )$ , end on epoch $e = ( 1 8 )$ , prune the percentage $p = ( 0 . 9 )$ , and prune every epoch via retrain period $r = 1$ . These relatively simple experiments were conducted to show that, at higher sparsity (pruning $85 \%$ of the model’s parameters), unstable pruning can improve the generalization of the baseline. The error bars are $9 5 \%$ confidence intervals for the means, bootstrapped from 20 distinct runs of each configuration.
|
md/train/B1evfa4tPB/B1evfa4tPB.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BJg7x1HFvB/BJg7x1HFvB.md
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WELL-READ STUDENTS LEARN BETTER: ON THE IMPORTANCE OF PRE-TRAINING COMPACT MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent developments in natural language representations have been accompanied by large and expensive models that leverage vast amounts of general-domain text through self-supervised pre-training. Due to the cost of applying such models to down-stream tasks, several model compression techniques on pre-trained language representations have been proposed (Sun et al., 2019a; Sanh, 2019). However, surprisingly, the simple baseline of just pre-training and fine-tuning compact models has been overlooked. In this paper, we first show that pre-training remains important in the context of smaller architectures, and fine-tuning pre-trained compact models can be competitive to more elaborate methods proposed in concurrent work. Starting with pre-trained compact models, we then explore transferring task knowledge from large fine-tuned models through standard knowledge distillation. The resulting simple, yet effective and general algorithm, Pre-trained Distillation, brings further improvements. Through extensive experiments, we more generally explore the interaction between pre-training and distillation under two variables that have been under-studied: model size and properties of unlabeled task data. One surprising observation is that they have a compound effect even when sequentially applied on the same data. To accelerate future research, we will make our 24 pre-trained miniature BERT models publicly available.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Self-supervised learning on a general-domain text corpus followed by end-task learning is the twostaged training approach that enabled deep-and-wide Transformer-based networks (Vaswani et al., 2017) to advance language understanding (Devlin et al., 2018; Yang et al., 2019b; Sun et al., 2019b; Liu et al., 2019). However, state-of-the-art models have hundreds of millions of parameters, incurring a high computational cost. Our goal is to realize their gains under a restricted memory and latency budget. We seek a training method that is well-performing, general and simple and can leverage additional resources such as unlabeled task data.
|
| 12 |
+
|
| 13 |
+
Before considering compression techniques, we start with the following research question: Could we directly train small models using the same two-staged approach? In other words, we explore the idea of applying language model (LM) pre-training and task fine-tuning to compact architectures directly. This simple baseline has so far been overlooked by the NLP community, potentially based on an underlying assumption that the limited capacity of compact models is capitalized better when focusing on the end task rather than a general language model objective. Concurrent work to ours proposes variations of the standard pre-training+fine-tuning procedure, but with limited generality (Sun et al., 2019a; Sanh, 2019). We make the surprising finding that pre-training+fine-tuning in its original formulation is a competitive method for building compact models.
|
| 14 |
+
|
| 15 |
+
For further gains, we additionally leverage knowledge distillation (Hinton et al., 2015), the standard technique for model compression. A compact student is trained to recover the predictions of a highly accurate teacher. In addition to the posited regularization effect of these soft labels (Hinton et al., 2015), distillation provides a means of producing pseudo-labels for unlabeled data. By regarding LM pre-training of compact models as a student initialization strategy, we can take advantage of both methods. The resulting algorithm is a sequence of three standard training operations: masked LM (MLM) pre-training (Devlin et al., 2018), task-specific distillation, and optional fine-tuning. From here on, we will refer to it as Pre-trained Distillation (PD) (Figure 1). As we will show in
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Pre-trained Distillation
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
|
| 22 |
+
Section 6.2, PD outperforms the pre-training $^ +$ fine-tuning (PF) baseline, especially in the presence of a large transfer set for distillation.
|
| 23 |
+
|
| 24 |
+
In a controlled study following data and model architecture settings in concurrent work (Section 4), we show that Pre-trained Distillation outperforms or is competitive with more elaborate approaches which use either more sophisticated distillation of task knowledge (Sun et al., 2019a) or more sophisticated pre-training from unlabeled text (Sanh, 2019). The former distill task knowledge from intermediate teacher activations, starting with a heuristically initialized student. The latter fine-tune a compact model that is pre-trained on unlabeled text with the help of a larger LM teacher.
|
| 25 |
+
|
| 26 |
+
One of the most noteworthy contributions of our paper are the extensive experiments that examine how Pre-trained Distillation and its baselines perform under various conditions. We investigate two axes that have been under-studied in previous work: model size and amount/quality of unlabeled data. While experimenting with 24 models of various sizes ( $4 \mathrm m$ to $1 1 0 \mathrm { m }$ parameters) and depth/width trade-offs, we observe that pre-trained students can leverage depth much better than width; in contrast, this property is not visible for randomly-initialized models. For the second axis, we vary the amount of unlabeled data, as well as its similarity to the labeled set. Interestingly, Pretrained Distillation is more robust to these variations in the transfer set than standard distillation.
|
| 27 |
+
|
| 28 |
+
Finally, in order to gain insight into the interaction between LM pre-training and task-specific distillation, we sequentially apply these operations on the same dataset. In this experiment, chaining the two operations performs better than any one of them applied in isolation, despite the fact that a single dataset was used for both steps. This compounding effect is surprising, indicating that pre-training and distillation are learning complementary aspects of the data.
|
| 29 |
+
|
| 30 |
+
Given the effectiveness of LM pre-training on compact architectures, we will make our 24 pretrained miniature BERT models publicly available in order to accelerate future research.
|
| 31 |
+
|
| 32 |
+
# 2 PROBLEM STATEMENT
|
| 33 |
+
|
| 34 |
+
Our high-level goal is to build accurate models which fit a given memory and latency budget. There are many aspects to explore: the parametric form of the compact model (architecture, number of parameters, trade-off between number of hidden layers and embedding size), the training data (size, distribution, presence or absence of labels, training objective), etc. Since an exhaustive search over this space is impractical, we fix the model architecture to bidirectional Transformers, known to be suitable for a wide range of NLP tasks (Vaswani et al., 2017; Devlin et al., 2018). The rest of this section elaborates on the training resources we assume to have at our disposal.
|
| 35 |
+
|
| 36 |
+
The teacher is a highly accurate but large model for an end task, that does not meet the resource constraints. Prior work on distillation often makes use of an ensemble of networks (Hinton et al., 2015). For faster experimentation, we use a single teacher, without making a statement about the best architectural choice. In Section 4, the teacher is pre-trained BERTBASE fine-tuned on labeled end-task data. In Section 6, we use BERTLARGE instead.
|
| 37 |
+
|
| 38 |
+
Students are compact models that satisfy resource constraints. Since model size qualifiers are relative (e.g., what is considered small in a data center can be impractically large on a mobile device),
|
| 39 |
+
|
| 40 |
+
(a) Millions of parameters
|
| 41 |
+
|
| 42 |
+
Table 1: Student models with various numbers of transformer layers $\mathbf { \Pi } ( \mathbf { L } )$ and hidden embedding sizes $\mathbf { \Pi } ( \mathbf { H } )$ . Latency is computed on Cloud TPUs with batch size 1 and sequence length 512. For readability, we focus on five models (underlined) for most figures: Tiny ( $_ { \mathrm { L } = 2 }$ , $\mathrm { H } { = } 1 2 \bar { 8 }$ ), Mini $\mathrm { L } { = } 4$ , $_ { \mathrm { H } = 2 5 6 }$ ), Small $\mathrm { L } { = } 4$ , $_ { \mathrm { H } = 5 1 2 }$ ), Medium $\mathrm { L } { = } 8$ , $_ { \mathrm { H } = 5 1 2 }$ ), and Base ( $_ { \mathrm { L } = 1 2 }$ , $_ { \mathrm { H } = 7 6 8 }$ ).
|
| 43 |
+
|
| 44 |
+
<table><tr><td></td><td>H=128</td><td>H=256</td><td>H=512</td><td>H=768</td></tr><tr><td>L=2</td><td>4.4</td><td>9.7</td><td>22.8</td><td>39.2</td></tr><tr><td>L=4</td><td>4.8</td><td>11.3</td><td>29.1</td><td>53.4</td></tr><tr><td>L=6</td><td>5.2</td><td>12.8</td><td>35.4</td><td>67.5</td></tr><tr><td>L=8</td><td>5.6</td><td>14.4</td><td>41.7</td><td>81.7</td></tr><tr><td>L=10</td><td>6.0</td><td>16.0</td><td>48.0</td><td>95.9</td></tr><tr><td>L=12</td><td>6.4</td><td>17.6</td><td>54.3</td><td>110.1</td></tr></table>
|
| 45 |
+
|
| 46 |
+
<table><tr><td></td><td>H=128</td><td>H=256</td><td>H=512</td><td>H=768</td></tr><tr><td>L=2</td><td>65.24</td><td>31.25</td><td>14.44</td><td>7.46</td></tr><tr><td>L=4</td><td>32.37</td><td>15.96</td><td>7.27</td><td>3.75</td></tr><tr><td>L=6</td><td>21.87</td><td>10.67</td><td>4.85</td><td>2.50</td></tr><tr><td>L=8</td><td>16.42</td><td>8.01</td><td>3.64</td><td>1.88</td></tr><tr><td>L=10</td><td>13.05</td><td>6.37</td><td>2.90</td><td>1.50</td></tr><tr><td>L=12</td><td>11.02</td><td>5.35</td><td>2.43</td><td>1.25</td></tr></table>
|
| 47 |
+
|
| 48 |
+
(b) Relative speedup wrt BERTLARGE on TPU v2
|
| 49 |
+
|
| 50 |
+
we investigate an array of 24 model sizes, from our TransformerTINY ( $4 \mathrm m$ parameters) all the way up to TransformerBASE ( $1 1 0 \mathrm { m }$ parameters)1. The student model sizes and their relative speed-up compared to the BERTLARGE teacher can be found in Table 1. Interested readers can situate themselves on this spectrum based on their resource constraints. For readability, most plots show a selection of 5 models, but we verify that our conclusions hold for all 24.
|
| 51 |
+
|
| 52 |
+
Labeled data $( \mathcal { D } _ { L } )$ is a set of $N$ training examples $\left\{ ( x _ { 1 } , y _ { 1 } ) , . . . , ( x _ { N } , y _ { N } ) \right\}$ , where $x _ { i }$ is an input and $y _ { i }$ is a label. For most NLP tasks, labeled sets are hard to produce and thus restricted in size.
|
| 53 |
+
|
| 54 |
+
Unlabeled transfer data $( \mathcal { D } _ { T } )$ is a set of $M$ input examples of the form $\{ x _ { 1 } ^ { \prime } , . . . , x _ { M } ^ { \prime } \}$ sampled from a distribution that is similar to but possibly not identical to the input distribution of the labeled set. During distillation, the teacher transfers knowledge to the student by exposing its label predictions for instances $ { \boldsymbol { { x } } } _ { m } ^ { \prime }$ . $\mathcal { D } _ { T }$ can also include the input portion of labeled data $\mathcal { D } _ { L }$ instances. Due to the lack of true labels, such sets are generally easier to produce and consequently larger than labeled ones. Note, however, that task-relevant input text is not readily available for key tasks requiring paired texts such as natural language inference and question answering, as well as domain-specific dialog understanding. In addition, for deployed systems, input data distribution shifts over time and existing unlabeled data becomes stale (Kim et al., 2017).
|
| 55 |
+
|
| 56 |
+
Unlabeled language model data $( \mathcal { D } _ { L M } )$ is a collection of natural language texts that enable unsupervised learning of text representations. We use it for unsupervised pre-training with a masked language model objective (Devlin et al., 2018). Because no labels are needed and strong domain similarity is not required, these corpora are often vast, containing thousands of millions of words.
|
| 57 |
+
|
| 58 |
+
The distinction between the three types of datasets is strictly functional. Note they are not necessarily disjunct. For instance, the same corpus that forms the labeled data can also be part of the unlabeled transfer set, after its labels are discarded. Similarly, corpora that are included in the transfer set can also be used as unlabeled LM data.
|
| 59 |
+
|
| 60 |
+
# 3 PRE-TRAINED DISTILLATION
|
| 61 |
+
|
| 62 |
+
Pre-trained Distillation (PD) (Figure 1) is a general, yet simple algorithm for building compact models that can leverage all the resources enumerated in Section 2. It consists of a sequence of three standard training operations that can be applied to any choice of architecture:
|
| 63 |
+
|
| 64 |
+
1. Pre-training on $\mathcal { D } _ { L M }$ . A compact model is trained with a masked LM objective (Devlin et al., 2018), capturing linguistic phenomena from a large corpus of natural language texts.
|
| 65 |
+
2. Distillation on $\mathcal { D } _ { T }$ . This well-read student is now prepared to take full advantage of the teacher expertise, and is trained on the soft labels (predictive distribution) produced by the teacher. As we will show in Section 6.2, randomly initialized distillation is constrained by the size and distribution of its unlabeled transfer set. However, the previous pre-training step mitigates to some extent the negative effects caused by an imperfect transfer set.
|
| 66 |
+
3. (Optional) fine-tuning on $\mathcal { D } _ { L }$ . This step makes the model robust to potential mismatches between the distribution of the transfer and labeled sets. We will refer to the two-step algorithm as PD, and to the three-step algorithm as PDF.
|
| 67 |
+
|
| 68 |
+
Table 2: Training Strategies that build compact models by applying language model (LM) pretraining before knowledge distillation (KD). The first two rows apply distillation on task data. The third row applies distillation with an LM objective on general-domain data.
|
| 69 |
+
|
| 70 |
+
<table><tr><td>Model</td><td>Step 1 (DLm)</td><td>Step 2(Dr = DL)</td><td>Architecture-agnostic</td></tr><tr><td>PD (our work)</td><td>LM pre-training</td><td>KD</td><td>√</td></tr><tr><td>Sun et al. (2019a)</td><td>BERTBASE truncated</td><td>Patient-KD</td><td>X</td></tr><tr><td>Sanh (2019)</td><td>BERTBASE truncated + LM-KD</td><td>Fine-tuning</td><td>×</td></tr></table>
|
| 71 |
+
|
| 72 |
+
<table><tr><td>Model</td><td></td><td>SST-2 (acc)</td><td>MRPC (f1/acc)</td><td>QQP (f1/acc)</td><td>MNLI (acc m/mm)</td><td>QNLI (acc)</td><td>RTE (acc)</td><td>Meta Score</td></tr><tr><td></td><td>TF (baseline)</td><td>90.7</td><td>85.9/80.2</td><td>69.2/88.2</td><td>80.4/79.7</td><td>86.7</td><td>63.6</td><td>80.5</td></tr><tr><td>5</td><td>PF (baseline)</td><td>92.5</td><td>86.8/81.8</td><td>70.1/88.5</td><td>81.8/81.1</td><td>87.9</td><td>64.2</td><td>81.6</td></tr><tr><td></td><td>PD (our work)</td><td>91.8</td><td>86.8/81.7</td><td>70.4/88.9</td><td>82.8/82.2</td><td>88.9</td><td>65.3</td><td>82.1</td></tr><tr><td></td><td>Sun et al. (2019a)</td><td>92.0</td><td>85.0/79.9</td><td>70.7/88.9</td><td>81.5/81.0</td><td>89.0</td><td>65.5</td><td>81.7</td></tr><tr><td>哥</td><td>PF (baseline)</td><td>91.1</td><td>87.9/82.5</td><td>86.6/90.0</td><td>81.1/81.7</td><td>87.8</td><td>63.0</td><td>82.8</td></tr><tr><td></td><td>PD (our work)</td><td>91.1</td><td>89.4/84.9</td><td>87.4/90.7</td><td>82.5/83.4</td><td>89.4</td><td>66.7</td><td>84.4</td></tr><tr><td></td><td>Sanh (2019)</td><td>92.7</td><td>88.3/82.4</td><td>87.7/90.6</td><td>81.6/81.1</td><td>85.5</td><td>60.0</td><td>82.3</td></tr></table>
|
| 73 |
+
|
| 74 |
+
Table 3: Model Quality. All students are 6/768 BERT models, trained by 12/768 BERT teachers. Concurrent results are cited as reported by their authors. Our dev results are averaged over 5 runs. Our test results are evaluated on the GLUE server, using the model that performed best on dev. For anchoring, we also provide our results for MLM pre-training followed by fine-tuning (PF) and cite results from Sun et al. (2019a) for BERTBASE truncated and fine-tuned (TF). The meta score is computed on 6 tasks only, and is therefore not directly comparable to the GLUE leaderboard.
|
| 75 |
+
|
| 76 |
+
Figure 3: Pre-trained Distillation (PD) and concurrent work on model compression.
|
| 77 |
+
|
| 78 |
+
While we are treating our large teachers as black boxes, it is worth noting that they are produced by pre-training and fine-tuning. Since the teacher could potentially transfer the knowledge it has obtained via pre-training to the student through distillation, it is a priori unclear whether pre-training the student would bring additional benefits. As Section 6.2 shows, pre-training students is surprisingly important, even when millions of samples are available for transfer.
|
| 79 |
+
|
| 80 |
+
# 4 COMPARISON TO CONCURRENT WORK
|
| 81 |
+
|
| 82 |
+
There are concurrent efforts to ours aiming to leverage both pre-training and distillation in the context of building compact models. Though inspired by the two-stage pre-training+fine-tuning approach that enabled deep-and-wide architectures to advance the state-of-the-art in language understanding, they depart from this traditional method in several key ways.
|
| 83 |
+
|
| 84 |
+
Patient Knowledge Distillation (Sun et al., 2019a) initializes a student from the bottom layers of a deeper pre-trained model, then performs task-specific patient distillation. The training objective relies not only on the teacher output, but also on its intermediate layers, thus making assumptions about the student and teacher architectures. In a parallel line of work, DistilBert (Sanh, 2019) applies the same truncation-based initialization method for the student, then continues its LM pre-training via distillation from a more expensive LM teacher, and finally fine-tunes on task data. Its downside is that LM distillation is computationally expensive, as it requires a softmax operation over the entire vocabulary to compute the expensive LM teacher’s predictive distribution. A common limitation in both studies is that the initialization strategy constrains the student to the teacher embedding size. Table 2 summarizes the differences between concurrent work and Pre-trained Distillation (PD).
|
| 85 |
+
|
| 86 |
+
To facilitate direct comparison, in this section we perform an experiment with the same model architecture, sizes and dataset settings used in the two studies mentioned above. We perform Pretrained Distillation on a 6-layer BERT student with task supervision from a 12-layer BERTBASE teacher, using embedding size 768 for both models. For distillation, our transfer set coincides with the labeled set $( \mathcal { D } _ { T } = \mathcal { D } _ { L } )$ ). Table 3 reports results on the 6 GLUE tasks selected by Sun et al. (2019a) and shows that, on average, PD performs best. For anchoring, we also provide quality numbers for pre-training+fine-tuning (PF), which is surprisingly competitive to the more elaborate alternatives in this setting where $\mathcal { D } _ { T }$ is not larger than $\mathcal { D } _ { L }$ . Remarkably, PF does not compromise generality or simplicity for quality. Its downside is, however, that it cannot leverage unlabeled task data and teacher model predictions.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 4: Baselines for building compact models, used for analysis (Section 6).
|
| 90 |
+
|
| 91 |
+
# 5 ANALYSIS SETTINGS
|
| 92 |
+
|
| 93 |
+
Given these positive results, we aim to gain more insight into Pre-trained Distillation. We perform extensive analyses on two orthogonal axes—model sizes and properties of unlabeled data, thus departing from the settings used in Section 4.
|
| 94 |
+
|
| 95 |
+
All our models follow the Transformer architecture (Vaswani et al., 2017) and input processing used in BERT (Devlin et al., 2018). We denote the number of hidden layers as $L$ and the hidden embedding size as $H$ , and refer to models by their $L / H$ dimensions. We always fix the number of self-attention heads to $H / 6 4$ and the feed-forward/filter size to $4 H$ . The end-task models are obtained by stacking a linear classifier on top of the Transformer architectures.
|
| 96 |
+
|
| 97 |
+
The teacher, BERTLARGE, has dimensions 24L/1024H and 340M parameters. We experiment with 24 student models, with sizes and relative latencies listed in Table 1. The most expensive student, TransformerBASE, is 3 times smaller and 1.25 times faster than the teacher; the cheapest student, TransformerSMALL, is 77 times smaller and 65 times faster. For readability, we report results on a selection of 5 students, but verify that all conclusions hold across the entire 24-model grid.
|
| 98 |
+
|
| 99 |
+
# 5.1 ANALYSIS BASELINES
|
| 100 |
+
|
| 101 |
+
We select three baselines for Pre-trained Distillation that can provide insights into the contributions made by each of its constituent operations.
|
| 102 |
+
|
| 103 |
+
Basic Training (Figure 4a) is the standard supervised learning method: a compact model is trained directly on the labeled set.
|
| 104 |
+
|
| 105 |
+
Knowledge Distillation (Figure 4b) (Bucila et al., 2006; Hinton et al., 2015) (or simply “distil- ˘ lation”) transfers information from a highly-parameterized and accurate teacher model to a more compact and thus less expressive student. For classification tasks, distillation exposes the student to soft labels, namely the class probabilities produced by the teacher $p _ { l } = \mathrm { s o f t m a x } ( z _ { l } / T )$ , where $p _ { l }$ is the output probability for class $l$ , $z _ { l }$ is the logit for class $l$ , and $T$ is a constant called temperature that controls the smoothness of the output distribution. The softness of the labels enables better generalization than the gold hard labels. For each end task, we train: $( i )$ a teacher obtained by fine-tuning pre-trained BERTLARGE (24L/1024H) on the labeled dataset (note teachers do not learn from the transfer set), and $( i i )$ 24 students of various sizes. Students are always distilled on the soft labels produced by the teacher with a temperature of $1 ^ { 2 }$ .
|
| 106 |
+
|
| 107 |
+
Pre-training+Fine-tuning (Figure 4c) (Dai & Le, 2015; Devlin et al., 2018), or simply PF, leverages large unlabeled general-domain corpora to pre-train models that can be fine-tuned for end tasks.
|
| 108 |
+
|
| 109 |
+
Following BERT, we perform pre-training with the masked LM (MLM) and next sentence objectives (collectively referred to as ${ \bf M } { \bf L } { \bf M } ^ { + }$ from here on). The resulting model is fine-tuned on end-task labeled data. While pre-training large models has been shown to provide substantial benefits, we are unaware of any prior work systematically studying its effectiveness on compact architectures.
|
| 110 |
+
|
| 111 |
+
# 5.2 ANALYSIS TASKS AND DATASETS
|
| 112 |
+
|
| 113 |
+
The tasks and associated datasets are summarized in Table 4.
|
| 114 |
+
|
| 115 |
+
Sentiment classification aims to classify text according to the polarities of opinions it contains. We perform 3-way document classification on Amazon Book Reviews (He & McAuley, 2016). Its considerable size $( 8 \mathrm { m } )$ allows us to closely follow the standard distillation setting, where there is a large number of unlabeled examples for transfer. Additionally, we test our algorithm on SST-2 (Socher et al., 2013),
|
| 116 |
+
|
| 117 |
+
Table 4: Datasets used for analysis. A star indicates that hard labels are discarded. $\mathrm { N L I ^ { * } }$ refers to the collection of MNLI (390k), SNLI (570k) and QQP (400k). The reviews datasets are part of Amazon Product Data. Unless otherwise stated, $\mathcal { D } _ { L M }$ consists of BookCorpus & English Wikipedia.
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Labeled Data (DL)</td><td>Unlabeled Transfer Data (DT)</td></tr><tr><td>MNLI (390k)</td><td>NLI* (1.3m samples)</td></tr><tr><td>RTE (2.5k)</td><td>NLI* (1.3m samples)</td></tr><tr><td>SST-2 (68k)</td><td>Movie Reviews*(1.7m samples)</td></tr><tr><td>Book Reviews (50k)</td><td>Book Reviews* (8m samples)</td></tr></table>
|
| 120 |
+
|
| 121 |
+
which is a binary sentence classification task, and our results are directly comparable with prior work on the GLUE leaderboard (Wang et al., 2018). We use whole documents from Amazon Movie Reviews $\mathrm { ( 1 . 7 m ) }$ as unlabeled transfer data (note that SST-2 consists of single sentences).
|
| 122 |
+
|
| 123 |
+
Natural language inference involves classifying pairs of sentences (a premise and a hypothesis) as entailment, contradiction, or neutral. This task is representative of the scenario in which proxy data is non-trivial to gather (Gururangan et al., 2018). We chose MNLI (Williams et al., 2018) as our target dataset. Since strictly in-domain data is difficult to obtain, we supplement $\mathcal { D } _ { T }$ with two other sentence-pair datasets: SNLI (Bowman et al., 2015) and QQP (Chen et al., 2018).
|
| 124 |
+
|
| 125 |
+
Textual entailment is similar to NLI, but restricted to binary classification (entailment vs nonentailment). The most popular RTE dataset (Bentivogli et al., 2009) is two orders of magnitude smaller than MNLI and offers an extreme test of robustness to the amount of transfer data.
|
| 126 |
+
|
| 127 |
+
# 6 ANALYSIS
|
| 128 |
+
|
| 129 |
+
In this section, we conduct experiments that help us understand why Pre-trained Distillation is successful and how to attribute credit to its constituent operations.
|
| 130 |
+
|
| 131 |
+
6.1 THERE ARE NO SHORTCUTS: WHY FULL PRE-TRAINING IS NECESSARY
|
| 132 |
+
|
| 133 |
+
As later elaborated in Section 7, earlier efforts to leverage pre-training in the context of compact models simply feed pre-trained (possibly contextual) input representations into randomly-initialized students (Hu et al., 2018; Chia et al., 2018; Tang et al., 2019). Concurrent work initializes shallowand-wide students from the bottom layers of their deeper pre-trained counterparts (Yang et al., 2019a; Sun et al., 2019a). The experiments below indicate these strategies are suboptimal, and that LM pre-training is necessary in order to unlock the full student potential.
|
| 134 |
+
|
| 135 |
+
Is it enough to pre-train word embeddings? No. In order to prove that pre-training Transformer layers is important, we compare two flavors of Pre-trained Distillation3: PD with pre-trained word embeddings and PD with pre-trained word embeddings and Transformer layers. We produce wordpiece embeddings by pre-training one-layer Transformers for each embedding size. We then discard the single Transformer layer and keep the embeddings to initialize our students.
|
| 136 |
+
|
| 137 |
+
For MNLI (Figure 5), less than $24 \%$ of the gains PD brings over distillation can be attributed to the pre-trained word embeddings (for TransformerTINY, this drops even lower, to $5 \%$ ). The rest of the benefits come from additionally pre-training the Transformer layers.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 5: Pre-training outperforms truncation. Students initialized via LM pre-training (green) outperform those initialized from the bottom layers of 12-layer pre-trained models (gray). When only word embeddings are pre-trained (red), performance is degraded even further.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 6: Depth outweighs width when models are pre-trained (PD and PF), as emphasized by the sharp drops in the plot. For instance, the 6L/512H $3 5 . 4 \mathrm { m }$ parameters) model outperforms the 2L/768H model $( 3 9 . 2 \mathrm { m }$ parameters). Randomly initialized models take poor advantage of extra parameters.
|
| 144 |
+
|
| 145 |
+
Is it worse to truncate deep pre-trained models? Yes, especially for shallow students. Given that pre-training is an expensive process, an exhaustive search over model sizes in the pursuit of the one that meets a certain performance threshold can be impractical. Instead of pre-training all (number of layers, embedding size) combinations of students, one way of short-cutting the process is to pre-train a single deep (e.g. 12-layer) student for each embedding size, then truncate it at various heights. Figure 5 shows that this can be detrimental especially to shallow architectures; TransformerTINY loses more than $73 \%$ of the pre-training gains over distillation. As expected, losses fade away as the number of layers increases.
|
| 146 |
+
|
| 147 |
+
What is the best student for a fixed parameter size budget? As a rule of thumb, prioritize depth over width, especially with pre-trained students. Figure 6 presents a comparison between 24 student model architectures on SST-2, demonstrating how well different students utilize model capacity. They are sorted first by the hidden size, then by the number of layers. This roughly corresponds to a monotonic increase in the number of parameters, with a few exceptions for the largest students. The quality of randomly initialized students (i.e. basic training and distillation) is closely correlated with the number of parameters. With pre-training (i.e. PD and PF), we observe two intuitive findings: (1) pre-trained models are much more effective at using more parameters, and (2) pre-trained models are particularly efficient at utilizing depth, as indicated by the sharp drops in performance when moving to wider but shallower models.
|
| 148 |
+
|
| 149 |
+
This is yet another argument against initialization via truncation: for instance, truncating the bottom two layers of BERTBASE would lead to a suboptimal distribution of parameters: the 2L/768H model $( 3 9 . 2 \mathrm { m }$ parameters) is dramatically worse than e.g. 6L/512H $3 5 . 4 \mathrm { { m } }$ parameters).
|
| 150 |
+
|
| 151 |
+
# 6.2 UNDER THE HOOD: DISSECTING PRE-TRAINED DISTILLATION
|
| 152 |
+
|
| 153 |
+
In the previous section, we presented empirical evidence for the importance of the initial LM pretraining step. In this section, we show that distillation brings additional value, especially in the presence of a considerably-sized transfer set, and that fine-tuning ensures robustness when the unlabeled data diverges from the labeled set.
|
| 154 |
+
|
| 155 |
+
Comparison to analysis baselines First, we quantify how much Pre-trained Distillation improves upon its constituent operations applied in isolation. We compare it against the baselines established in Section 5.1 (basic training, distillation, and pre-training+fine-tuning) on the three NLP tasks described in Section 5.2. We use the BookCorpus (Zhu et al., 2015) and English Wikipedia as our unlabeled LM set, following the same pre-training procedure as Devlin et al. (2018).
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 7: Comparison against analysis baselines. Pre-trained Distillation out-performs all baselines: pretraining $^ +$ fine-tuning, distillation, and basic training over five different student sizes. Pre-training is performed on a large unlabeled LM set (BookCorpus & English Wikipedia). Distillation uses the task-specific unlabeled transfer sets listed in Table 4. Teachers are pre-trained BERTLARGE, fine-tuned on labeled data.
|
| 159 |
+
|
| 160 |
+
Results in Figure 7 confirm that PD outperforms these baselines, with particularly remarkable results on the Amazon Book Reviews corpus, where TransformerMINI recovers the accuracy of the teacher at a 31x decrease in model size and 16x speed-up. Distillation achieves the same performance with TransformerBASE, which is $1 0 \mathrm { x }$ larger than TransformerMINI. Thus PD can compress the model more effectively than distillation. On RTE, Pre-trained Distillation improves TransformerTINY by more than $5 \%$ absolute over the closest baseline (pre-training+fine-tuning) and is the only method to recover teacher accuracy with TransformerBASE.
|
| 161 |
+
|
| 162 |
+
It is interesting to note that the performance of the baseline systems is closely related to the size of the transfer set. For the sentence-pair tasks such as MNLI and RTE, where the size of the transfer set is moderate $( 1 . 3 \mathrm { m } )$ and slightly out-of-domain (see Table 4), pre-training $^ +$ fine-tuning out-performs distillation across all student sizes, with an average of $12 \%$ for MNLI and $8 \%$ on RTE. Interestingly, the order is inverted on Amazon Book Reviews, where the large transfer set $( 8 \mathrm { m } )$ is strictly indomain: distillation is better than pre-training+fine-tuning by an average of $3 \%$ . On the other hand, Pre-trained Distillation is consistently best in all cases. We will examine the robustness of Pre-trained Distillation in the rest of the section.
|
| 163 |
+
|
| 164 |
+
Robustness to transfer set size It is generally accepted that distillation is reliant upon a large transfer set. For instance, distillation for speech recognition is performed on hundreds of millions of data points (Li et al., 2014; Hinton et al., 2015).
|
| 165 |
+
|
| 166 |
+
We reaffirm this statement through experiments on Amazon Book Reviews in Figure 8, given that Amazon Book Reviews have the biggest transfer set. Distillation barely recovers teacher accuracy with the largest student (TransformerBASE), using the entire $8 \mathrm { m }$ transfer set. When there is only 1m transfer set, the performance is $4 \%$ behind the teacher model. In contrast, PD achieves the same performance with TransformerMINI on $5 \mathrm { m }$ instances. In other words, PD can match the teacher model with $1 0 \mathrm { x }$ smaller model and $1 . 5 \mathrm { x }$ less transfer data, compared to distillation.
|
| 167 |
+
|
| 168 |
+
Robustness to domain shift To the best of our knowledge, there is no prior work that explicitly studies how distillation is impacted by the mismatch between training and transfer sets (which we will refer to as domain shift). Many previous distillation efforts focus on tasks where the two sets come from the same distribution (Romero et al., 2014; Hinton et al., 2015), while others simply acknowledge the importance of and strive for a close match between them (Bucila et al., 2006).˘
|
| 169 |
+
|
| 170 |
+
We provide empirical evidence that out-of-domain data degrades distillation and that our algorithm is more robust to mismatches between $\mathcal { D } _ { L }$ and $\mathcal { D } _ { T }$ . We measure domain shift using the Spearman rank correlation coefficient (which we refer to as Spearman or simply $S$ ), introduced as a general metric in (Spearman, 1904) and first used as a corpus similarity metric in (Johansson et al., 1989). To compute corpus similarity, we follow the procedure described in (Kilgarriff & Rose, 1998): for two datasets $X$ and $Y$ , we compute the corresponding frequency ranks $F _ { X }$ and $F _ { Y }$ of their most computed. The final statistic is given by the following formula: common $n = 1 0 0$ words. For each of these words, the difference $\textstyle 1 - \sum _ { i = 1 } ^ { 1 0 0 } d _ { i } ^ { 2 } / ( n ( n ^ { 2 } - \bar { 1 } ) )$ $d$ between ranks in $F _ { X }$ and . $F _ { Y }$ is
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 8: Robustness to transfer set size. We verify that distillation requires a large transfer set: $8 \mathrm { m }$ instances are needed to match the performance of the teacher using TransformerBASE. PD achieves the same performance with TransformerMINI, on a $5 \mathrm { m }$ transfer set $_ { 1 0 \mathrm { x } }$ smaller, 13x faster, $1 . 5 \mathrm { x }$ less data).
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 9: Robustness to domain shift in transfer set. By keeping $| \mathcal { D } _ { T } |$ fixed $( 1 . 7 \mathrm { m } )$ and varying the correlation between $\mathcal { D } _ { L }$ and $\mathcal { D } _ { T }$ (denoted by $S$ ), we show that distillation requires an in-domain transfer set. PD and PD-F are more robust to transfer set domain.
|
| 177 |
+
|
| 178 |
+
To measure the effect of domain shift, we again experiment on the Amazon Book Reviews task. Instead of varying the size of the transfer sets, this time we keep size fixed (to $1 . 7 \mathrm { m }$ documents) and vary the source of the unlabeled text used for distillation. Transfer set domains vary from not task-related (paragraphs from Wikipedia with $S { = } 0 . 4 3$ ), to reviews for products of unrelated category (electronics reviews with $S { = } 0 . 5 2 \rangle$ ), followed by reviews from a related category (movie reviews with $S { = } 0 . 7 6 $ ), and finally in-domain book reviews $( S { = } 1 . 0 )$ . Results in Figure 9 show a direct correlation between accuracy and the Spearman coefficient for both distillation and PD. When $S$ drops to 0.43, distillation on $\mathcal { D } _ { T }$ is $1 . 8 \%$ worse than basic training on $\mathcal { D } _ { L }$ , whereas PD suffers a smaller loss over pre-training+fine-tuning, and a gain of about $1 . 5 \%$ when a final fine-tuning step is added. When reviews from an unrelated product are used as a transfer set ${ \it S } { = } 0 . 5 2 )$ , PD obtains a much larger gain from learning from the teacher, compared to distillation.
|
| 179 |
+
|
| 180 |
+
We investigate the interaction between pretraining and distillation by applying them sequentially on the same data. We compare the following two algorithms: Pre-training+Finetuning with $\mathcal { D } _ { L M } = X$ and Pre-trained Distillation with $\mathcal { D } _ { L M } = \mathcal { D } _ { T } = X$ . Any additional gains that the latter brings over the former must be attributed to distillation, providing evidence that the compound effect still exists.
|
| 181 |
+
|
| 182 |
+
For MNLI, we set $\mathcal { D } _ { L M } = \mathcal { D } _ { T } = \mathrm { N L I ^ { * } }$ and continue the experiment above by taking the students pre-trained on $\mathcal { D } _ { L M } = \mathrm { N L I ^ { * } }$ and distilling them on $\mathcal { D } _ { T } = \mathrm { N L I ^ { * } }$ . As shown in Figure 10, PD is better than PF by $2 . 2 \%$ on average over all student sizes. Note that even when pretraining and then distilling on the same data, PD outperforms the two training strategies applied in isolation. The two methods are thus learning different linguistic aspects, both useful for the end task.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
6.3 BETTER TOGETHER: THE COMPOUND EFFECT OF PRE-TRAINING AND DISTILLATION
|
| 186 |
+
Figure 10: Pre-training complements distillation. PD outperforms the baselines even when we pre-train and distill on the same dataset $\mathcal { D } _ { L M } = \mathcal { D } _ { T } = \mathrm { N L I ^ { * } }$ ).
|
| 187 |
+
|
| 188 |
+
# 7 RELATED WORK
|
| 189 |
+
|
| 190 |
+
Pre-training Decades of research have shown that unlabeled text can help learn language representations. Word embeddings were first used (Mikolov et al., 2013; Pennington et al., 2014), while subsequently contextual word representations were found more effective (Peters et al., 2018). Most recently, research has shifted towards fine-tuning methods (Radford et al., 2018; Devlin et al., 2018; Radford et al., 2019), where entire large pre-trained representations are fine-tuned for end tasks together with a small number of task-specific parameters. While feature-based unsupervised representations have been successfully used in compact models (Johnson & Zhang, 2015; Gururangan et al., 2019), inter alia, the pretraining+fine-tuning approach has not been studied in depth for such small models.
|
| 191 |
+
|
| 192 |
+
Learning compact models In this work we built on model compression (Bucila et al., 2006) and ˘ its variant knowledge distillation (Hinton et al., 2015). Other related efforts introduced ways to transfer more information from a teacher to a student model, by sharing intermediate layer activations (Romero et al., 2014; Yim et al., 2017; Sun et al., 2019a). We experimented with related approaches, but found only slight gains which were dominated by the gains from pre-training and were not complementary. Prior works have also noted the unavailability of in-domain large-scale transfer data and proposed the use of automatically generated pseudo-examples (Bucila et al., 2006; ˘ Kimura et al., 2018). Here we showed that large-scale general domain text can be successfully used for pre-training instead. A separate line of work uses pruning or quantization to derive smaller models (Han et al., 2016; Gupta et al., 2015). Gains from such techniques are expected to be complementary to PD.
|
| 193 |
+
|
| 194 |
+
Distillation with unsupervised pre-training Early efforts to leverage both unsupervised pretraining and distillation provide pre-trained (possibly contextual) word embeddings as inputs to students, rather than pre-training the student stack. For instance, Hu et al. (2018) use ELMo embeddings, while (Chia et al., 2018; Tang et al., 2019) use context-independent word embeddings. Concurrent work initializes Transformer students from the bottom layers of a 12-layer BERT model (Yang et al., 2019a; Sun et al., 2019a; Sanh, 2019). The latter continues student LM pre-training via distillation from a more expensive LM teacher. For a different purpose of deriving a single model for multiple tasks through distillation, Clark et al. (2019) use a pre-trained student model of the same size as multiple teacher models. However, none of the prior work has analyzed the impact of unsupervised learning for students in relation to the model size and domain of the transfer set.
|
| 195 |
+
|
| 196 |
+
# 8 CONCLUSION
|
| 197 |
+
|
| 198 |
+
We conducted extensive experiments to gain understanding of how knowledge distillation and the pre-training+fine-tuning algorithm work in isolation, and how they interact. We made the finding that their benefits compound, and unveiled the power of Pre-trained Distillation, a simple yet effective method to maximize the utilization of all available resources: a powerful teacher, and multiple sources of data (labeled sets, unlabeled transfer sets, and unlabeled LM sets).
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
Luisa Bentivogli, Ido Dagan, Hoa Trang Dang, Danilo Giampiccolo, and Bernardo Magnini. The fifth pascal recognizing textual entailment challenge. In Proc Text Analysis Conference (TAC09, 2009.
|
| 203 |
+
|
| 204 |
+
Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 2015.
|
| 205 |
+
|
| 206 |
+
C Bucila, R Caruana, and A Niculescu-Mizil. Model compression. In ˘ Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 535– 541, 2006.
|
| 207 |
+
|
| 208 |
+
Z. Chen, H. Zhang, X. Zhang, and L. Zhao. Quora question pairs. 2018.
|
| 209 |
+
|
| 210 |
+
Yew Ken Chia, Sam Witteveen, and Martin Andrews. Transformer to cnn: Label-scarce distillation for efficient text classification. 2018.
|
| 211 |
+
|
| 212 |
+
Kevin Clark, Minh-Thang Luong, Urvashi Khandelwal, Christopher D. Manning, and Quoc V. Le. BAM! born-again multi-task networks for natural language understanding. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, Italy, July 2019. Association for Computational Linguistics.
|
| 213 |
+
|
| 214 |
+
Andrew M Dai and Quoc V Le. Semi-supervised sequence learning. In Advances in neural information processing systems, pp. 3079–3087, 2015.
|
| 215 |
+
|
| 216 |
+
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.
|
| 217 |
+
|
| 218 |
+
Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In ICML, 2015.
|
| 219 |
+
|
| 220 |
+
Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A. Smith. Annotation artifacts in natural language inference data. In NAACL, 2018.
|
| 221 |
+
|
| 222 |
+
Suchin Gururangan, Tam Dang, Dallas Card, and Noah A. Smith. Variational pretraining for semisupervised text classification. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, Italy, July 2019.
|
| 223 |
+
|
| 224 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In NIPS, 2016.
|
| 225 |
+
|
| 226 |
+
Ruining He and Julian McAuley. Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In proceedings of the 25th international conference on world wide web, pp. 507–517. International World Wide Web Conferences Steering Committee, 2016.
|
| 227 |
+
|
| 228 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 229 |
+
|
| 230 |
+
Minghao Hu, Yuxing Peng, Furu Wei, Zhen Huang, Dongsheng Li, Nan Yang, and Ming Zhou. Attention-guided answer distillation for machine reading comprehension. arXiv preprint arXiv:1808.07644, 2018.
|
| 231 |
+
|
| 232 |
+
Johansson, Stig, and Knut Hofland. Frequency Analysis of English vocabulary and grammar, based on the LOB corpus. Claredon, Oxford, 1989.
|
| 233 |
+
|
| 234 |
+
Rie Johnson and Tong Zhang. Semi-supervised convolutional neural networks for text categorization via region embedding. In Advances in neural information processing systems, pp. 919–927, 2015.
|
| 235 |
+
|
| 236 |
+
Adam Kilgarriff and Tony Rose. Measures for corpus similarity and homogeneity. In Proceedings of the Third Conference on Empirical Methods for Natural Language Processing, pp. 46–52, 1998.
|
| 237 |
+
|
| 238 |
+
Young-Bum Kim, Karl Stratos, and Dongchan Kim. Adversarial adaptation of synthetic or stale data. In ACL, 2017.
|
| 239 |
+
|
| 240 |
+
Akisato Kimura, Zoubin Ghahramani, Koh Takeuchi, Tomoharu Iwata, and Naonori Ueda. Fewshot learning of neural networks from scratch by pseudo example optimization. arXiv preprint arXiv:1802.03039, 2018.
|
| 241 |
+
|
| 242 |
+
Jinyu Li, Rui Zhao, Jui-Ting Huang, and Yifan Gong. Learning small-size dnn with outputdistribution-based criteria. In Fifteenth annual conference of the international speech communication association, 2014.
|
| 243 |
+
|
| 244 |
+
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, 2019.
|
| 245 |
+
|
| 246 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
|
| 247 |
+
|
| 248 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543, 2014.
|
| 249 |
+
|
| 250 |
+
Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
|
| 251 |
+
|
| 252 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openaiassets/research-covers/languageunsupervised/language understanding paper. pdf, 2018.
|
| 253 |
+
|
| 254 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. URL https://openai. com/blog/better-languagemodels, 2019.
|
| 255 |
+
|
| 256 |
+
Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014.
|
| 257 |
+
|
| 258 |
+
Victor Sanh. Smaller, faster, cheaper, lighter: Introducing DistilBERT, a distilled version of BERT. https://medium.com/huggingface/distilbert-8cf3380435b5, 2019.
|
| 259 |
+
|
| 260 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ , 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, pp. 1631–1642, 2013.
|
| 261 |
+
|
| 262 |
+
Spearman. The proof and measurement of association between two things. In American Journal of Psychology., pp. 72–101, 1904.
|
| 263 |
+
|
| 264 |
+
Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. Patient knowledge distillation for bert model compression. arXiv preprint arXiv:1908.09355, 2019a.
|
| 265 |
+
|
| 266 |
+
Yu Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Hao Tian, Hua Wu, and Haifeng Wang. Ernie 2.0: A continual pre-training framework for language understanding, 2019b.
|
| 267 |
+
|
| 268 |
+
Raphael Tang, Yao Lu, Linqing Liu, Lili Mou, Olga Vechtomova, and Jimmy Lin. Distilling taskspecific knowledge from bert into simple neural networks, 2019.
|
| 269 |
+
|
| 270 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 271 |
+
|
| 272 |
+
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. arXiv preprint arXiv:1804.07461, 2018.
|
| 273 |
+
|
| 274 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. 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), pp. 1112–1122. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/N18-1101.
|
| 275 |
+
|
| 276 |
+
Ze Yang, Linjun Shou, Ming Gong, Wutao Lin, and Daxin Jiang. Model compression with multi-task knowledge distillation for web-scale question answering system. arXiv preprint arXiv:1904.09636, 2019a.
|
| 277 |
+
|
| 278 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237, 2019b.
|
| 279 |
+
|
| 280 |
+
Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 281 |
+
|
| 282 |
+
Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision, pp. 19–27, 2015.
|
md/train/Bk8ZcAxR-/Bk8ZcAxR-.md
ADDED
|
@@ -0,0 +1,401 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EIGENOPTION DISCOVERY THROUGH THEDEEP SUCCESSOR REPRESENTATION
|
| 2 |
+
|
| 3 |
+
Marlos C. Machado1∗, Clemens Rosenbaum2, Xiaoxiao Guo3
|
| 4 |
+
Miao Liu3, Gerald Tesauro3, Murray Campbell3
|
| 5 |
+
1 University of Alberta, Edmonton, AB, Canada
|
| 6 |
+
2 University of Massachusetts, Amherst, MA, USA
|
| 7 |
+
3 IBM Research, Yorktown Heights, NY, USA
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Options in reinforcement learning allow agents to hierarchically decompose a task into subtasks, having the potential to speed up learning and planning. However, autonomously learning effective sets of options is still a major challenge in the field. In this paper we focus on the recently introduced idea of using representation learning methods to guide the option discovery process. Specifically, we look at eigenoptions, options obtained from representations that encode diffusive information flow in the environment. We extend the existing algorithms for eigenoption discovery to settings with stochastic transitions and in which handcrafted features are not available. We propose an algorithm that discovers eigenoptions while learning non-linear state representations from raw pixels. It exploits recent successes in the deep reinforcement learning literature and the equivalence between proto-value functions and the successor representation. We use traditional tabular domains to provide intuition about our approach and Atari 2600 games to demonstrate its potential.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Sequential decision making usually involves planning, acting, and learning about temporally extended courses of actions over different time scales. In the reinforcement learning framework, options are a well-known formalization of the notion of actions extended in time; and they have been shown to speed up learning and planning when appropriately defined (e.g., Brunskill & Li, 2014; Guo et al., 2017; Solway et al., 2014). In spite of that, autonomously identifying good options is still an open problem. This problem is known as the problem of option discovery.
|
| 16 |
+
|
| 17 |
+
Option discovery has received ample attention over many years, with varied solutions being proposed (e.g., Bacon et al., 2017; S¸ imsek & Barto, 2004; Daniel et al., 2016; Florensa et al., 2017; Konidaris & Barto, 2009; Mankowitz et al., 2016; McGovern & Barto, 2001). Recently, Machado et al. (2017) and Vezhnevets et al. (2017) proposed the idea of learning options that traverse directions of a latent representation of the environment. In this paper we further explore this idea.
|
| 18 |
+
|
| 19 |
+
More specifically, we focus on the concept of eigenoptions (Machado et al., 2017), options learned using a model of diffusive information flow in the environment. They have been shown to improve agents’ performance by reducing the expected number of time steps a uniform random policy needs in order to traverse the state space. Eigenoptions are defined in terms of proto-value functions (PVFs; Mahadevan, 2005), basis functions learned from the environment’s underlying state-transition graph. PVFs and eigenoptions have been defined and thoroughly evaluated in the tabular case. Currently, eigenoptions can be used in environments where it is infeasible to enumerate states only when a linear representation of these states is known beforehand.
|
| 20 |
+
|
| 21 |
+
In this paper we extend the notion of eigenoptions to stochastic environments with non-enumerated states, which are commonly approximated by feature representations. Despite methods that learn representations generally being more flexible, more scalable, and often leading to better performance, current algorithms for eigenoption discovery cannot be combined with representation learning. We introduce an algorithm that is capable of discovering eigenoptions while learning representations. The learned representations implicitly approximate the model of diffusive information flow (hereafter abbreviated as the DIF model) in the environment. We do so by exploiting the equivalence between PVFs and the successor representation (SR; Dayan, 1993). Notably, by using the SR we also start to be able to deal with stochastic transitions naturally, a limitation of previous algorithms.
|
| 22 |
+
|
| 23 |
+
We evaluate our algorithm in a tabular domain as well as on Atari 2600 games. We use the tabular domain to provide intuition about our algorithm and to compare it to the algorithms in the literature. Our evaluation in Atari 2600 games provides promising evidence of the applicability of our algorithm in a setting in which a representation of the agent’s observation is learned from raw pixels.
|
| 24 |
+
|
| 25 |
+
# 2 BACKGROUND
|
| 26 |
+
|
| 27 |
+
In this section we discuss the reinforcement learning setting, the options framework, and the set of options known as eigenoptions. We also discuss the successor representation, which is the main concept used in the proposed algorithm.
|
| 28 |
+
|
| 29 |
+
# 2.1 REINFORCEMENT LEARNING AND OPTIONS
|
| 30 |
+
|
| 31 |
+
We consider the reinforcement learning (RL) problem in which a learning agent interacts with an unknown environment in order to maximize a reward signal. RL is often formalized as a Markov decision process (MDP), described as a 5-tuple: $\langle \mathcal { S } , \mathcal { A } , p , r , \gamma \rangle$ . At time $t$ the agent is in state $s _ { t } \in \mathcal S$ where it takes action $a _ { t } \in \mathcal A$ that leads to the next state $s _ { t + 1 } ~ \in ~ \mathcal { S }$ according to the transition probability kernel $p ( s ^ { \prime } | s , a )$ . The agent also observes a reward $R _ { t + 1 }$ generated by the function $r : \mathcal { S } \times \mathcal { A } \mathbb { R }$ . The agent’s goal is to learn a policy $\pi : \mathcal { S \times A } \to [ 0 , 1 ]$ that maximizes the expected discounted return $\begin{array} { r } { G _ { t } \doteq \mathbb { E } _ { \pi , p } \big [ \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } R _ { t + k + 1 } | s _ { t } \big ] } \end{array}$ , where $\gamma \in [ 0 , 1 ]$ is the discount factor.
|
| 32 |
+
|
| 33 |
+
In this paper we are interested in the class of algorithms that determine the agent’s policy by being greedy with respect to estimates of value functions; either w.r.t. the state value $v _ { \pi } ( s )$ , or w.r.t. the state-action value function $q _ { \pi } ( s , a )$ . Formally, $\begin{array} { r } { v _ { \pi } ( s ) = \mathbb { E } _ { \pi , p } [ G _ { t } | s ] = \sum _ { a } \pi ( a | s ) q _ { \pi } ( s , a ) } \end{array}$ . Notice that in large problems these estimates have to be approximated because it is infeasible to learn a value for each state-action pair. This is generally done by parameterizing $q _ { \pi } ( s , a )$ with a set of weights $\pmb \theta$ such that $q ( s , a , \pmb \theta ) \approx q _ { \pi } ( s , a )$ . Currently, neural networks are the most successful parametrization approach in the field (e.g., Mnih et al., 2015; Tesauro, 1995). One of the better known instantiations of this idea is the algorithm called Deep Q-network (DQN; Mnih et al., 2015), which uses a neural network to estimate state-action value functions from raw pixels.
|
| 34 |
+
|
| 35 |
+
Options (Sutton et al., 1999) are our main topic of study. They are temporally extended actions that allow us to represent courses of actions. An option $\omega \in \Omega$ is a 3-tuple $\omega = \langle { \mathcal { T } } _ { \omega } , { \pi } _ { \omega } , { \mathcal { T } } _ { \omega } \rangle$ where $\mathcal { T } _ { \omega } \subseteq \mathcal { S }$ denotes the option’s initiation set, $\pi _ { \omega } : \mathcal { S } \times \mathcal { A } \to [ 0 , 1 ]$ denotes the option’s policy, and $\mathcal { T } _ { \omega } \subseteq \mathcal { S }$ denotes the option’s termination set. We consider the call-and-return option execution model in which a meta-policy $\mu : \mathcal { S } \Omega$ dictates the agent’s behavior (notice ${ \mathcal { A } } \subseteq \Omega$ ). After the agent decides to follow option $\omega$ from a state in $\mathcal { T } _ { \omega }$ , actions are selected according to $\pi _ { \omega }$ until the agent reaches a state in $\mathcal { T } _ { \omega }$ . We are interested in learning $\mathcal { T } _ { \omega } , \pi _ { \omega }$ , and $\mathcal { T } _ { \omega }$ from scratch.
|
| 36 |
+
|
| 37 |
+
# 2.2 PROTO-VALUE FUNCTIONS AND EIGENOPTIONS
|
| 38 |
+
|
| 39 |
+
Eigenoptions are options that maximize eigenpurposes $r _ { i } ^ { \mathbf { e } }$ , intrinsic reward functions obtained from the DIF model (Machado et al., 2017). Formally,
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\begin{array} { r l r } { r _ { i } ^ { \bf e } ( s , s ^ { \prime } ) } & { { } = } & { { \bf e } ^ { \top } \Big ( \phi ( s ^ { \prime } ) - \phi ( s ) \Big ) , } \end{array}
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\phi ( \cdot )$ denotes a feature representation of a given state (e.g., one-hot encoding in the tabular case) and e denotes an eigenvector encoding the DIF model at a specific timescale. Each intrinsic reward function, defined by the eigenvector being used, incentivizes the agent to traverse a different latent dimension of the state space.
|
| 46 |
+
|
| 47 |
+
In the tabular case, the algorithms capable of learning eigenoptions encode the DIF model through the combinatorial graph Laplacian $\bar { \mathcal { L } } = D ^ { - 1 / 2 } ( D \bar { - } \bar { W } ) D ^ { \bar { - } 1 / 2 }$ , where $W$ is the graph’s weight matrix and $D$ is the diagonal matrix whose entries are the row sums of $W$ . The weight matrix is a square matrix where the $i j$ -th entry represents the connection between states $i$ and $j$ . Notice that this approach does not naturally deal with stochastic or unidirectional transitions because $W$ is generally defined as a symmetric adjacency matrix. Importantly, the eigenvectors of $\mathcal { L }$ are also known as proto-value functions (PVFs; Mahadevan, 2005; Mahadevan & Maggioni, 2007).
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: Successor representation, with respect to the uniform random policy, of state A (left). This example is similar to Dayan’s (1993). The red color represents larger values while the blue color represents smaller values (states that are temporally further away).
|
| 51 |
+
|
| 52 |
+
In settings in which states cannot be enumerated, the DIF model is represented through a matrix of transitions $T$ , with row $i$ encoding the transition vector $\phi ( s _ { t } ) - \phi ( \bar { s } _ { t - 1 } )$ , where $\phi ( \cdot )$ denotes a fixed linear feature representation known beforehand ( $i$ can be different from $t$ if transitions are observed more than once). Machado et al. (2017) justifies this sampling strategy with the fact that, in the tabular case, if every transition is sampled once, the right eigenvectors of matrix $T$ converge to PVFs. Because transitions are added only once, regardless of their frequency, this algorithm is not well suited to stochastic environments. In this paper we introduce an algorithm that naturally deals with stochasticity and that does not require $\phi ( \cdot )$ to be known beforehand. Our algorithm learns the environment’s DIF model while learning a representation of the environment from raw pixels.
|
| 53 |
+
|
| 54 |
+
# 2.3 THE SUCCESSOR REPRESENTATION
|
| 55 |
+
|
| 56 |
+
The successor representation (SR; Dayan, 1993) determines state generalization by how similar its successor states are. It is defined to be the expected future occupancy of state $s ^ { \prime }$ given the agent’s policy is $\pi$ and its starting state is $s$ . It can be seen as defining state similarity in terms of time. See Figure 1 for an example. The Euclidean distance between state A and state C is smaller than the Euclidean distance between state A and state B. However, if one considers the gray tiles to be walls, an agent in state A can reach state B much quicker than state C. The SR captures this distinction, ensuring that state A is more similar to state $\mathbf { B }$ than it is to state C.
|
| 57 |
+
|
| 58 |
+
Let $\mathbb { 1 } _ { \{ \cdot \} }$ denote the indicator function, the SR, $\Psi _ { \pi } ( s , s ^ { \prime } )$ , is formally defined, for $\gamma < 1$ , as :
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { r l l } { \Psi _ { \pi } ( s , s ^ { \prime } ) } & { = } & { \mathbb { E } _ { \pi , p } \Bigg [ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { 1 } _ { \{ S _ { t } = s ^ { \prime } \} } \Big | S _ { 0 } = s \Bigg ] . } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
This expectation can be estimated from samples with temporal-difference error (Sutton, 1988):
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { r l r } { \hat { \Psi } ( s , j ) } & { \longleftarrow } & { \hat { \Psi } ( s , j ) + \eta \Biggl [ \mathbb { 1 } _ { \{ s = j \} } + \gamma \hat { \Psi } ( s ^ { \prime } , j ) - \hat { \Psi } ( s , j ) \Biggr ] , } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\eta$ is the step-size. In the limit, the SR converges to $\Psi _ { \pi } = ( I { - } \gamma T _ { \pi } ) ^ { - 1 }$ . This lets us decompose the value function into the product between the SR and the immediate reward (Dayan, 1993):
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
v _ { \pi } ( s ) = \sum _ { s ^ { \prime } \in S } \Psi _ { \pi } ( s , s ^ { \prime } ) r ( s ^ { \prime } ) .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
The SR is directly related to several other ideas in the field. It can be seen as the dual approach to dynamic programming and to value-function based methods in reinforcement learning (Wang et al., 2007). Moreover, the eigenvectors generated from its eigendecomposition are equivalent to proto-value functions (Stachenfeld et al., 2014; 2017) and to slow feature analysis (Sprekeler, 2011).
|
| 77 |
+
|
| 78 |
+
Alg. 1 Eigenoption discovery through the SR
|
| 79 |
+
|
| 80 |
+
<table><tr><td>←LEARNREPRESENTATION() E←EXTRACTEIGENPURPOSES(亚)</td></tr><tr><td>for each eigepurpose ei ∈Edo</td></tr><tr><td>{Ie;,Te,Te>←LEARNEIGENOPTION(ei)</td></tr><tr><td>end for</td></tr></table>
|
| 81 |
+
|
| 82 |
+
Alg. 2 LEARNREPRESENTATION() with the SR
|
| 83 |
+
|
| 84 |
+
<table><tr><td>fora given number of steps n do Observes ∈S,take action α ∈A selected ac- cording to π(s),and observe a next state s' ∈ S for each state j ∈ S do</td></tr><tr><td>重(s,j)←(s,j)+ n(l{s=j}+γ亚(s',j)-Φ(s,j))</td></tr><tr><td>end for</td></tr><tr><td>end for return 业</td></tr></table>
|
| 85 |
+
|
| 86 |
+
Such equivalences play a central role in the algorithm we describe in the next section. The SR may also have an important role in neuroscience. Stachenfeld et al. (2014; 2017) recently suggested that the successor representation is encoded by the hippocampus, and that a low-dimensional basis set representing it is encoded by the enthorhinal cortex. Interestingly, both hippocampus and entorhinal cortex are believed to be part of the brain system responsible for spatial memory and navigation.
|
| 87 |
+
|
| 88 |
+
# 3 EIGENOPTION DISCOVERY
|
| 89 |
+
|
| 90 |
+
In order to discover eigenoptions, we first need to obtain the eigenpurposes through the eigenvectors encoding the DIF model in the environment. This is currently done through PVFs, which the agent obtains by either explicitly building the environment’s adjacency matrix or by enumerating all of the environment’s transitions $\cdot f .$ Section 2.2). Such an approach is fairly effective in deterministic settings in which states can be enumerated and uniquely identified, i.e., the tabular case. However, there is no obvious extension of this approach to stochastic settings. It may be hard for the agent to explicitly model the environment dynamics in a weight matrix. The existent alternative, to enumerate the environment’s transitions, may have a large cost. These issues become worse when states cannot be enumerated, i.e., the function approximation case. The existing algorithm that is applicable to the function approximation setting requires a fixed representation as input, not being able to learn a representation while estimating the DIF model.
|
| 91 |
+
|
| 92 |
+
In this paper we introduce an algorithm that addresses the aforementioned issues by estimating the DIF model through the SR. Also, we introduce a new neural network that is capable of approximating the SR from raw pixels by learning a latent representation of game screens. The learned SR is then used to discover eigenoptions, replacing the need for knowing the combinatorial Laplacian. In this section we discuss the proposed algorithm in the tabular case, the equivalence between PVFs and the SR, and the algorithm capable of estimating the SR, and eigenoptions, from raw pixels.
|
| 93 |
+
|
| 94 |
+
# 3.1 THE TABULAR CASE
|
| 95 |
+
|
| 96 |
+
The general structure of the algorithms capable of discovering eigenoptions is fairly straightforward, as shown in Alg. 1. The agent learns (or is given) a representation that captures the DIF model (e.g., the combinatorial Laplacian). It then uses the eigenvectors of this representation to define eigenpurposes (EXTRACTEIGENPURPOSES), the intrinsic reward functions described by Equation 1 that it will learn how to maximize. The option’s policy is the one that maximizes this new reward function, while a state $s$ is defined to be terminal with respect to the eigenpurpose $\mathbf { e } _ { i }$ if $q _ { * } ^ { \mathbf { e } _ { i } } ( s , a ) \leq 0$ for all $a \in { \mathcal { A } }$ . The initiation set of an option $\mathbf { e } _ { i }$ is defined to be $\mathcal { S } \setminus \mathcal { T } _ { { \mathbf { e } } _ { i } } ^ { \overline { { \mathbf { \Theta } } } }$ .
|
| 97 |
+
|
| 98 |
+
In the tabular case, our proposed algorithm is also fairly simple. Instead of assuming the matrix $\hat { \Psi }$ is given in the form of the graph Laplacian, or trying to estimate the graph Laplacian from samples by stacking the row vectors corresponding to the different observed transitions, we estimate the DIF model through the successor representation $\left( c . f . \right.$ Alg. 2). This idea is supported by the fact that, for our purposes, the eigenvectors of the normalized Laplacian and the eigenvectors of the SR are equivalent. Below we formalize this concept and discuss its implications. We show that the eigenvectors of the normalized Laplacian are equal to the eigenvectors of the SR scaled by $\gamma ^ { - 1 } D ^ { 1 / 2 }$ .
|
| 99 |
+
|
| 100 |
+
The aforementioned equivalence ensures that the eigenpurposes extraction and the eigenoption learning steps remain unchanged. That is, we still obtain the eigenpurposes from the eigendecomposition1 of matrix $\hat { \Psi }$ , and we still use each eigenvector $\mathbf { e } _ { i } \in E$ to define the new learning problem in which the agent wants to maximize the eigenpurpose, defined in Equation 1.
|
| 101 |
+
|
| 102 |
+
Importantly, the use of the SR addresses some other limitations of previous work: 1) it deals with stochasticity in the environment and in the agent’s policy naturally; 2) its memory cost is independent on the number of samples drawn by the agent; and 3) it does not assume that for every action there is another action the agent can take to return to the state it was before, i.e., $W$ is symmetric.
|
| 103 |
+
|
| 104 |
+
# 3.2 RELATIONSHIP BETWEEN PVFS AND THE SR
|
| 105 |
+
|
| 106 |
+
As aforementioned, PVFs (the eigenvectors of the normalized Laplacian) are equal to the eigenvectors of the successor representation scaled by $\gamma ^ { - 1 } D ^ { 1 / 2 }$ . To the best of our knowledge, this equivalence was first explicitly discussed by Stachenfeld et al. (2014). We provide below a more formal statement of such an equivalence, for the eingevalues and the eigenvectors of both approaches. We use the proof to further discuss the extent of this interchangeability.
|
| 107 |
+
|
| 108 |
+
Theorem. Stachenfeld et al. (2014): Let $0 < \gamma < 1$ s.t. $\Psi = ( I - \gamma T ) ^ { - 1 }$ denotes the matrix encoding the $S R$ , and let $\mathcal { L } = D ^ { - 1 / 2 } ( D - W ) D ^ { - 1 / 2 }$ denote the matrix corresponding to the normalized Laplacian, both obtained under a uniform random policy. The $i$ -th eigenvalue $( \lambda _ { S R , i } )$ of the SR and the $j$ -th eigenvalue $( \lambda _ { P V F , j } )$ of the normalized Laplacian are related as follows:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\lambda _ { P V F , j } = \left[ 1 - ( 1 - { \lambda _ { S R , i } } ^ { - 1 } ) \gamma ^ { - 1 } \right]
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
The $i$ -th eigenvector $( \mathbf { e } _ { S R , i } )$ of the $S R$ and the $j$ -th eigenvector $( \mathbf { e } _ { P V F , j } )$ of the normalized Laplacian, where $i + j = n + 1$ , with $n$ being the total number of rows (and columns) of matrix $T$ , are related as follows:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
{ \bf e } _ { P V F , j } = ( \gamma ^ { - 1 } D ^ { 1 / 2 } ) { \bf e } _ { S R , i }
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Proof. Let $\lambda _ { i }$ , $\mathbf { e } _ { i }$ denote the $i$ -th eigenvalue and eigenvector of the SR, respectively. Using the fact that the SR is known to converge, in the limit, to $( I { \bar { - } } \gamma T ) ^ { - 1 }$ (through the Neumann series), we have:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r l } { { ( I - \gamma T ) ^ { - 1 } { \bf e } _ { i } ~ = ~ \lambda _ { i } { \bf e } _ { i } } } & { { } } \\ { { ( I - \gamma T ) { \bf e } _ { i } ~ = ~ \lambda _ { i } ^ { - 1 } { \bf e } _ { i } } } & { { } } \\ { { ( I - T ) \gamma ^ { - 1 } { \bf e } _ { i } ~ = ~ [ 1 - ( 1 - \lambda _ { i } ^ { - 1 } ) \gamma ^ { - 1 } ] \gamma ^ { - 1 } { \bf e } _ { i } } } & { { } } \\ { { ( I - T ) \gamma ^ { - 1 } { \bf e } _ { i } ~ = ~ \lambda _ { j } ^ { \prime } \gamma ^ { - 1 } { \bf e } _ { i } } } & { { } } \\ { { ( I - D ^ { - 1 } W ) \gamma ^ { - 1 } { \bf e } _ { i } ~ = ~ \lambda _ { j } ^ { \prime } \gamma ^ { - 1 } { \bf e } _ { i } } } & { { } } \\ { { { \cal D } ^ { - 1 / 2 } ( D - W ) D ^ { - 1 / 2 } D ^ { 1 / 2 } \gamma ^ { - 1 } { \bf e } _ { i } ~ = ~ \lambda _ { j } ^ { \prime } \gamma ^ { - 1 } D ^ { 1 / 2 } { \bf e } _ { i } } } & { { } } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Importantly, when using PVFs we are first interested in the eigenvectors with the corresponding smallest eigenvalues, as they are the “smoothest” ones. However, when using the SR we are interested in the eigenvectors with the largest eigenvalues. The change of variables in Eq. 3 highlights this fact i.e., $\lambda _ { j } ^ { \overline { { \prime } } } = [ 1 - ( 1 - \lambda _ { i } ^ { - 1 } ) \gamma ^ { - 1 } ]$ . The indices $j$ are sorted in the reverse order of the indices $i$ . This distinction can be very important when trying to estimate the relevant eigenvectors. Finding the largest eigenvalues/eigenvectors is statistically more robust to noise in estimation and does not depend on the lowest spectrum of the matrix. Moreover, notice that the scaling by $D ^ { 1 / 2 }$ does not change the direction of the eigenvectors when the size of the action set is constant across all states. This is often the case in the RL problems being studied.
|
| 127 |
+
|
| 128 |
+
3.3 THE FUNCTION APPROXIMATION CASE: THE SR THROUGH DEEP NEURAL NETWORKS
|
| 129 |
+
|
| 130 |
+
The tabular case is interesting to study because it provides intuition about the problem and it is easier to analyze, both empirically and theoretically. However, the tabular case is only realizable in toy domains. In real-world situations the number of states is often very large and the ability to generalize and to recognize similar states is essential. In this section, inspired by Kulkarni et al.’s (2016b) and Oh et al.’s (2015) work, we propose replacing Alg. 2 by a neural network that is able to estimate the successor representation from raw pixels. Such an approach circumvents the limitations of previous work that required a linear feature representation to be provided beforehand.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 2: Neural network architecture used to learn the SR. The symbols $\otimes$ and $\varnothing$ denote elementwise multiplication and the fact that gradients are not propagated further back, respectively.
|
| 134 |
+
|
| 135 |
+
The SR with non-enumerated states: Originally, the SR was not defined in the function approximation setting, where states are described in terms of feature vectors. Successor features are the natural extension of the SR to this setting. We use Barreto et al.’s (2017) definition of successor features, where $\psi _ { \pi , i } ( s )$ denotes the successor feature $i$ of state $s \in \mathcal { S }$ when following a policy $\pi$ :
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\begin{array} { r c l } { \psi _ { \pi , i } ( s ) } & { = } & { \mathbb { E } _ { \pi , p } \Bigg [ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \phi _ { i } ( S _ { t } ) \Big | S _ { 0 } = s \Bigg ] . } \end{array}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
In words, $\psi _ { \pi , i } ( s )$ encodes the discounted expected value of the $i$ -th feature in the vector $\phi ( \cdot )$ when the agent starts in state $s$ and follows the policy $\pi$ . The update rule presented in Eq. 2 can be naturally extended to this definition. The temporal-difference error in the update rule can be used as a differentiable loss function, allowing us to estimate the successor features with a neural network.
|
| 142 |
+
|
| 143 |
+
Neural network architecture: The architecture we used is depicted in Fig 2. The reconstruction module is the same as the one introduced by Oh et al. (2015), but augmented by the SR estimator (the three layers depicted at the bottom). The SR estimator uses the learned latent representation as input i.e., the output of the representation learning module.
|
| 144 |
+
|
| 145 |
+
The proposed neural network receives raw pixels as input and learns to estimate the successor features of a lower-dimension representation learned by the neural network. The loss function $\mathcal { L } _ { S R }$ we use to learn the successor features is:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\mathcal { L } _ { S R } ( s , s ^ { \prime } ) = \mathbb { E } \Bigg [ \Big ( \phi ^ { - } ( s ) + \gamma \psi ^ { - } \left( \phi ^ { - } ( s ^ { \prime } ) \right) - \psi \left( \phi ( s ) \right) \Big ) ^ { 2 } \Bigg ] ,
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where $\phi ( s )$ denotes the feature vector encoding the learned representation of state $s$ and $\psi ( \cdot )$ denotes the estimated successor features. In practice, $\phi ( \cdot )$ is the output of the representation learning module and $\psi ( \cdot )$ is the output of the SR estimator, as shown in Fig. 2. The loss function above also highlights the fact that we have two neural networks. We use $-$ to represent a target network (Mnih et al., 2015), which is updated at a slower rate for stability purposes.
|
| 152 |
+
|
| 153 |
+
We cannot directly estimate the successor features from raw pixels using only $\mathcal { L } _ { S R }$ because zero is one of its fixed points. This is the reason we added Oh et al.’s (2015) reconstruction module in the proposed network. It behaves as an auxiliary task (Jaderberg et al., 2017) that predicts the next state to be observed given the current state and action. By predicting the next state we increase the likelihood the agent will learn a representation that takes into consideration the pixels that are under its control, which has been shown to be a good bias in RL problems (Bellemare et al., 2012). Such an auxiliary task is defined through the network’s reconstruction error $\mathcal { L } _ { R E }$ :
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\begin{array} { r } { \mathcal { L } _ { R E } ( s , a , s ^ { \prime } ) = \Big ( \zeta \big ( \phi ( s ) , a \big ) - s ^ { \prime } \Big ) ^ { 2 } , } \end{array}
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
where $\zeta ( \cdot )$ denotes the output of the reconstruction module, as shown in Fig. 2. The final loss being optimized is $\begin{array} { r } { \mathcal { L } ( s , a , s ^ { \prime } ) = \bar { \mathcal L } _ { R E } ( s , a , s ^ { \prime } ) + \mathcal { L } _ { S R } ( s , s ^ { \prime } ) } \end{array}$ .
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 3: Results in the rooms domain. The rightmost figure depicts the diffusion time as eigenoptions are added to the agent’s action set (sorted by eigenvalues corresponding to the eigenpurposes).
|
| 163 |
+
|
| 164 |
+
Finally, to ensure that the SR will not interfere with the learned features, we zero the gradients coming from the SR estimator (represented with the symbol $\phi$ in Fig. 2). We trained our model with RMSProp and we followed the same protocol Oh et al. (2015) used to initialize the network.
|
| 165 |
+
|
| 166 |
+
Eigenoption learning: In Alg. 1, the function EXTRACTEIGENPURPOSES returns the eigenpurposes described by Eq. 1. Eigenpurposes are defined in terms of a feature representation $\phi ( s _ { t } )$ of the environment and of the eigenvectors $\mathbf { e } _ { i }$ of the DIF model (the SR in our case). We use the trained network to generate both. It is trivial to obtain $\phi ( s _ { t } )$ as we just use the output of the appropriate layer in the network as our feature representation. To obtain $\mathbf { e } _ { i }$ we first need to generate a meaningful matrix since our network outputs a vector of successor features instead of a matrix. We do so by having the agent follow the uniform random policy while we store the network outputs $\psi ( s _ { t } )$ , which correspond to the network estimate of the successor features of state $s _ { t }$ . We then create a matrix $T$ where row $t$ corresponds to $\psi ( s _ { t } )$ and we define $\mathbf { e } _ { i }$ to be its right eigenvectors.
|
| 167 |
+
|
| 168 |
+
Once we have created the eigenpurposes, the option discovery problem is reduced to a regular RL problem where the agent aims to maximize the cumulative sum of rewards. Any learning algorithm can be used for that. We provide details about our approach in the next section.
|
| 169 |
+
|
| 170 |
+
# 4 EXPERIMENTS
|
| 171 |
+
|
| 172 |
+
We evaluate the discovered eigenoptions quantitatively and qualitatively in this section. We use the traditional rooms domain to evaluate the impact, on the eigenvectors and on the discovered options, of approximating the DIF model through the SR. We then use Atari 2600 games to demonstrate how the proposed network does discover purposeful options from raw pixels.
|
| 173 |
+
|
| 174 |
+
# 4.1 TABULAR CASE
|
| 175 |
+
|
| 176 |
+
Our first experiment evaluates the impact of estimating the SR from samples instead of assuming the DIF model was given in the form of the normalized Laplacian. We use the rooms domain (Fig. 3a; Sutton et al., 1999) to evaluate our method. Fig. 4b depicts the first eigenvector obtained from the SR while Fig. 4c depicts the corresponding eigenoption. We followed the uniform random policy for 1,000 episodes to learn the SR. Episodes were 100 time steps long. We used a stepsize of 0.1, and we set $\gamma = 0 . 9$ . The estimated eigenvector is fairly close to the true one and, as expected, the obtained eigenvector is fairly similar to the PVFs that are obtained for this domain. In the Appendix we provide the plots for the true SR and the PVF, as well as plots for different eigenvectors, comparing them to those obtained from $( I - \gamma T ) ^ { - 1 }$ .
|
| 177 |
+
|
| 178 |
+
Eigenoptions are known for improving the agent’s ability to explore the environment. We use the metric diffusion time to validate whether such an ability is preserved with our method. The diffusion time can be seen as a proxy for how hard it is for an agent to reach the goal state when following a uniform random policy. It is defined as the expected number of decisions (action selection steps) an agent needs to take, when following the uniform random policy, to navigate between two randomly chosen states. We compared the agent’s diffusion time when using eigenoptions obtained with PVFs to the diffusion time when using eigenoptions obtained with estimates of the SR. As we can see in Fig 3d, the eigenoptions obtained with the SR do help the agent to explore the environment. The gap between the diffusion time when using PVFs and when using the SR is likely due to different ways of dealing with corners. The SR implicitly models self-loops in the states adjacent to walls, since the agent takes an action and it observes it did not move.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 4: Different environments (varying start and goal locations) used in our evaluation (a), as well as the learning curves obtained in each one of these environments (b, c) for different number of options obtained from the SR when estimated after 100 episodes. See text for more details.
|
| 182 |
+
|
| 183 |
+
We also evaluated how the estimates of the SR evolve as more episodes are used during learning, and its impact in the diffusion time (Fig 3d). In the Appendix we present more results, showing that the local structure of the graph is generally preserved. Naturally, more episodes allow us to learn more accurate estimates of the SR as a more global facet of the environment is seen, since the agent has more chances to further explore the state space. However, it seems that even the SR learned from few episodes allow us to discover useful eigenoptions, as depicted in Fig. 3d. The eigenoptions obtained from the SR learned using only 100 episodes are already capable of reducing the agent’s diffusion time considerably. Finally, it is important to stress that the discovered options do more than randomly selecting subgoal states. “Random options” only reduce the agent’s diffusion time when hundreds of them are added to the agent’s action set (Machado et al., 2017).
|
| 184 |
+
|
| 185 |
+
Finally, we evaluated the use of the discovered eigenoptions to maximize reward. In our experiments the agent learned, off-policy, the greedy policy over primitive actions (target policy) while following the uniform random policy over actions and eigenoptions (behavior policy). We used Qlearning (Watkins & Dayan, 1992) in our experiments – parameters $\lambda = 0$ , $\alpha = 0 . 1$ , and $\gamma = 0 . 9$ . As before, episodes were 100 time steps long. Figure 4 summarizes the obtained results comparing the performance of our approach to regular Q-learning over primitive actions. The eigenoptions were extracted from estimates of the SR obtained after 100 episodes. The reported results are the average over 24 independent runs when learning the SR, with each one of these runs encoding 100 runs evaluating Q-Learning. The options were added following the sorting provided by the eigenvalues. For example, 4 options denotes an agent with the action set used in the behavior policy being composed of the four primitive actions and the four eigenoptions generated by the top 2 eigenvalues (both directions are being used). Notice that these results do not try to take the sample efficiency of our approach into consideration, they are only meant to showcase how eigenoptions, once discovered, can speed up learning. The sample complexity of learning options is generally justified in lifelong learning settings where they are re-used over multiple tasks (e.g., Brunskill & Li, 2014). This is beyond the scope of this paper.
|
| 186 |
+
|
| 187 |
+
The obtained results clearly show that eigenoptions are not only capable of reducing the diffusion time in the environment but of also improving the agent’s control performance. They do so by increasing the likelihood that the agent will cover a larger part of the state space given the same amount of time. Moreover, as before, it seems that a very accurate estimate of the successor representation is not necessary for the eigenoptions to be useful. Similar results can be obtained for different locations of the start and goal states, and when the estimates of the SR are more accurate. These results can be seen in the Appendix.
|
| 188 |
+
|
| 189 |
+
# 4.2 ATARI 2600
|
| 190 |
+
|
| 191 |
+
This second set of experiments evaluates the eigenoptions discovered when the SR is obtained from raw pixels. We obtained the SR through the neural network described in Section 3. We used four
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 5: Plots of density of state visitation of eigenoptions discovered in three Atari 2600 games. States visited more frequently show darker images of the avatar. Note that an eigenoption’s overwhelming mass of visitations corresponds to its terminal state, and that disparate options have different terminal states.
|
| 195 |
+
|
| 196 |
+
Atari 2600 games from the Arcade Learning Environment (Bellemare et al., 2013) as testbed: BANK HEIST, FREEWAY, MONTEZUMA’S REVENGE, and MS. PAC-MAN.
|
| 197 |
+
|
| 198 |
+
We followed the protocol described in the previous section to create eigenpurposes. We trained the network in Fig. 2 to estimate the SR under the uniform random policy. Since the network does not impact the policy being followed, we built a dataset of 500, 000 samples for each game and we used this dataset to optimize the network weights. We passed through the shuffled dataset 10 times, using RMSProp with a step size of $1 0 ^ { - 4 }$ . Once we were done with the training, we let the agent follow a uniform random policy for $5 0 , 0 0 0$ steps while we stored the SR output by the network for each observed state as a row of matrix $T$ . We define e, in the eigenpurposes we maximize $\cdot \cdot f .$ , Eq. 1), to be the right eigenvectors of the matrix $T$ , while $\phi ( \cdot )$ is extracted at each time step from the network in Fig. 2. Due to computational constraints, we approximated the final eigenoptions. We did so by using the ALE’s internal emulator to do a one-step lookahead and act greedily with respect to each eigenpurpose (in practice, this is equivalent to learning with $\gamma = 0$ ). This is not ideal because the options we obtain are quite limited, since they do not deal with delayed rewards. However, even in such limiting setting we were able to obtain promising results, as we discuss below.
|
| 199 |
+
|
| 200 |
+
Following Machado et al. (2017), we evaluate the discovered eigenoptions qualitatively. We execute all options following the procedure described above (greedy one-step lookahead) while tracking the avatar’s position on the screen. Figure 5 summarizes the behavior of some of the meaningful options discovered. The trajectories generated by different options are represented by different colors and the color’s intensity at a given location represents how often the agent was at that location. Eigenoptions were introduced as options that generate purposeful behavior and that help agents explore the environment. We can clearly see that the discovered eigenoptions are indeed purposeful. They aim to reach a specific location and stay there. If this was not the case the agent’s trajectory would be much more visible. Instead, what we actually observe is that the mass of visitation is concentrated on one location on the screen, dominating (color intensity) all the others. The location the agent is spending most of its time on can in fact be seen as the option’s terminal state. Constantly being in a state suggests the agent has arrived to a myopic local maximum for that eigenpurpose.
|
| 201 |
+
|
| 202 |
+
In three out of four games (BANK HEIST, MONTEZUMA’S REVENGE, MS. PACMAN) our algorithm discovers options that clearly push the agent to corners and to other relevant parts of the state space, corroborating the intuition that eigenoptions also improve exploration. In MONTEZUMA’S REVENGE, the terminal state of the highlighted options even correspond to what are considered good subgoals for the game (Kulkarni et al., 2016a). It is likely that additional subgoals, such as the key, were not found due to our myopic greedy approach. This approach may also explain why our algorithm was ineffective in FREEWAY. Avoiding cars may be impossible without longer-term planning. A plot depicting the two meaningful options discovered in this game is in the Appendix. Importantly, the fact that myopic policies are able to navigate to specific locations and stay there also suggests that, as in the tabular case, the proposed approach gives rise to dense intrinsic rewards that are very informative. This is another important constrast between randomly assigned subgoals and our approach. Randomly assigned subgoals do not give rise to such dense rewards. Thus, one can argue that our approach does not only generate useful options but it also gives rise to dense eigenpurposes, making it easier to build the policies associated with them.
|
| 203 |
+
|
| 204 |
+
It is important to stress that our algorithm was able to discover eigenoptions, from raw pixels, similar to those obtained by algorithms that use the RAM state of the game as a feature representation. The RAM state of the game often uses specific bytes to encode important information of the game, such as the position of the player’s avatar in the game. Our algorithm had to implicitly learn what were the meaningful parts of the screen. Also, different from previous algorithms, our approach is not constrained by the dimensionality of the state representation nor to binary features. Based on this discussion, we consider our results to be very promising, even though we only depict options that have effect on the initial state of the games. We believe that in a more general setting (e.g., using DQN to learn policies) our algorithm has the potential to discover even better options.
|
| 205 |
+
|
| 206 |
+
# 5 RELATED WORK
|
| 207 |
+
|
| 208 |
+
Our work was directly inspired by Kulkarni et al. (2016b), the first to propose approximating the SR using a neural network. We use their loss function in a novel architecture. Because we are not directly using the SR for control, we define the SR in terms of states, instead of state-action pairs. Different from Kulkarni et al. (2016b), our network does not learn a reward model and it does not use an autoencoder to learn a representation of the world. It tries to predict the next state the agent will observe. The prediction module we used was introduced by Oh et al. (2015). Because it predicts the next state, it implicitly learns representations that take into consideration the parts of the screen that are under the agent’s control. The ability to recognize such features is known as contingency awareness, and it is known to have the potential to improve agents’ performance (Bellemare et al., 2012). Kulkarni et al. (2016b) did suggest the deep SR could be used to find bottleneck states, which are commonly used as subgoals for options, but such an idea was not further explored. Importantly, Jong et al. (2008) and Machado et al. (2017) have shown that options that look for bottleneck states can be quite harmful in the learning process.
|
| 209 |
+
|
| 210 |
+
The idea of explicitly building hierarchies based on the learned latent representation of the state space is due to Machado et al. (2017) and Vezhnevets et al. (2017). Machado et al. (2017) proposed the concept of eigenoptions, but limited to the linear function approximation case. Vezhnevets et al. (2017) do not explicitly build options with initiation and termination sets. Instead, they learn a hierarchy through an end-to-end learning system that does not allow us to easily retrieve options from it. Finally, Kompella et al. (2017) has proposed the use of slow feature analysis (SFA; Wiskott & Sejnowski, 2002) to discover options. Sprekeler (2011) has shown that, given a specific choice of adjacency function, PVFs (and consequently the SR) are equivalent to SFA. However, their work is limited to linear function approximation. Our method also differs in how we define the initiation and termination sets. The options they discover look for bottleneck states, which is not our case.
|
| 211 |
+
|
| 212 |
+
# 6 CONCLUSION
|
| 213 |
+
|
| 214 |
+
In this paper we introduced a new algorithm for eigenoption discovery in RL. Our algorithm uses the successor representation (SR) to estimate the model of diffusive information flow in the environment, leveraging the equivalence between proto-value functions (PVFs) and the SR. This approach circumvents several limitations from previous work: (i) it builds increasingly accurate estimates using a constant-cost update-rule; (ii) it naturally deals with stochastic MDPs; (iii) it does not depend on the assumption that the transition matrix is symmetric; and (iv) it does not depend on handcrafted feature representations. The first three items were achieved by simply using the SR instead of the PVFs, while the latter was achieved by using a neural network to estimate the SR.
|
| 215 |
+
|
| 216 |
+
The proposed framework opens up multiple possibilities for investigation in the future. It would be interesting to evaluate the compositionality of eigenoptions, or how transferable they are between similar environments, such as the different modes of Atari 2600 games (Machado et al., 2018). Finally, now that the fundamental algorithms have been introduced, it would be interesting to investigate whether one can use eigenoptions to accumulate rewards instead of using them for exploration.
|
| 217 |
+
|
| 218 |
+
# ACKNOWLEDGMENTS
|
| 219 |
+
|
| 220 |
+
The authors would like to thank Craig Sherstan and Martha White for feedback on an earlier draft, Kamyar Azizzadenesheli, Marc G. Bellemare and Michael Bowling for useful discussions, and the anonymous reviewers for their feedback and suggestions.
|
| 221 |
+
|
| 222 |
+
# REFERENCES
|
| 223 |
+
|
| 224 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The Option-Critic Architecture. In Proc. of the AAAI Conference on Artificial Intelligence (AAAI), pp. 1726–1734, 2017.
|
| 225 |
+
|
| 226 |
+
Andre Barreto, Will Dabney, R ´ emi Munos, Jonathan Hunt, Tom Schaul, David Silver, and Hado ´ van Hasselt. Successor Features for Transfer in Reinforcement Learning. In Advances in Neural Information Processing Systems (NIPS), pp. 4058–4068, 2017.
|
| 227 |
+
|
| 228 |
+
Marc G. Bellemare, Joel Veness, and Michael Bowling. Investigating Contingency Awareness Using Atari 2600 Games. In Proc. of the AAAI Conference on Artificial Intelligence (AAAI), 2012.
|
| 229 |
+
|
| 230 |
+
Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The Arcade Learning Environment: An Evaluation Platform for General Agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
|
| 231 |
+
|
| 232 |
+
Emma Brunskill and Lihong Li. PAC-inspired Option Discovery in Lifelong Reinforcement Learning. In Proc. of the International Conference on Machine Learning (ICML), pp. 316–324, 2014.
|
| 233 |
+
|
| 234 |
+
Ozg ¨ ur S¸ imsek and Andrew G. Barto. Using Relative Novelty to Identify Useful Temporal Abstrac- ¨ tions in Reinforcement Learning. In Proc. of the International Conference on Machine Learning (ICML), 2004.
|
| 235 |
+
|
| 236 |
+
Christian Daniel, Herke van Hoof, Jan Peters, and Gerhard Neumann. Probabilistic Inference for Determining Options in Reinforcement Learning. Machine Learning, 104(2-3):337–357, 2016.
|
| 237 |
+
|
| 238 |
+
Peter Dayan. Improving Generalization for Temporal Difference Learning: The Successor Representation. Neural Computation, 5(4):613–624, 1993.
|
| 239 |
+
|
| 240 |
+
Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic Neural Networks for Hierarchical Reinforcement Learning. In Proc. of the International Conference on Learning Representations (ICLR), 2017.
|
| 241 |
+
|
| 242 |
+
Zhaohan Daniel Guo, Philip S. Thomas, and Emma Brunskill. Using Options and Covariance Testing for Long Horizon Off-Policy Policy Evaluation. In Advances in Neural Information Processing Systems (NIPS), pp. 2489–2498, 2017.
|
| 243 |
+
|
| 244 |
+
Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z. Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement Learning with Unsupervised Auxiliary Tasks. In Proc. of the International Conference on Learning Representations (ICLR), 2017.
|
| 245 |
+
|
| 246 |
+
Nicholas K. Jong, Todd Hester, and Peter Stone. The Utility of Temporal Abstraction in Reinforcement Learning. In Proc. of the International Joint Conference on Autonomous Agents and Multiagent Systems (AAMAS), pp. 299–306, 2008.
|
| 247 |
+
|
| 248 |
+
Varun Raj Kompella, Marijn F. Stollenga, Matthew D. Luciw, and Jurgen Schmidhuber. Continual ¨ Curiosity-driven Skill Acquisition from High-Dimensional Video Inputs for Humanoid Robots. Artificial Intelligence, 247:313–335, 2017.
|
| 249 |
+
|
| 250 |
+
George Konidaris and Andrew G. Barto. Skill Discovery in Continuous Reinforcement Learning Domains using Skill Chaining. In Advances in Neural Information Processing Systems (NIPS), pp. 1015–1023, 2009.
|
| 251 |
+
|
| 252 |
+
Tejas D. Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical Deep Reinforcement Learning: Integrating Temporal Abstraction and Intrinsic Motivation. In Advances in Neural Information Processing Systems (NIPS), pp. 3675–3683, 2016a.
|
| 253 |
+
|
| 254 |
+
Tejas D. Kulkarni, Ardavan Saeedi, Simanta Gautam, and Samuel J. Gershman. Deep Successor Reinforcement Learning. CoRR, abs/1606.02396, 2016b.
|
| 255 |
+
|
| 256 |
+
Marlos C. Machado, Marc G. Bellemare, and Michael Bowling. A Laplacian Framework for Option Discovery in Reinforcement Learning. In Proc. of the International Conference on Machine Learning (ICML), pp. 2295–2304, 2017.
|
| 257 |
+
|
| 258 |
+
Marlos C. Machado, Marc G. Bellemare, Erik Talvitie, Joel Veness, Matthew Hausknecht, and Michael Bowling. Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents. Journal of Artificial Intelligence Research (JAIR), In press, 2018.
|
| 259 |
+
|
| 260 |
+
Sridhar Mahadevan. Proto-value Functions: Developmental Reinforcement Learning. In Proc. of the International Conference on Machine Learning (ICML), pp. 553–560, 2005.
|
| 261 |
+
|
| 262 |
+
Sridhar Mahadevan and Mauro Maggioni. Proto-value Functions: A Laplacian Framework for Learning Representation and Control in Markov Decision Processes. Journal of Machine Learning Research (JMLR), 8:2169–2231, 2007.
|
| 263 |
+
|
| 264 |
+
Daniel J. Mankowitz, Timothy Arthur Mann, and Shie Mannor. Adaptive Skills Adaptive Partitions (ASAP). In Advances in Neural Information Processing Systems (NIPS), pp. 1588–1596, 2016.
|
| 265 |
+
|
| 266 |
+
Amy McGovern and Andrew G. Barto. Automatic Discovery of Subgoals in Reinforcement Learning using Diverse Density. In Proc. of the International Conference on Machine Learning (ICML), pp. 361–368, 2001.
|
| 267 |
+
|
| 268 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level Control through Deep Reinforcement Learning. Nature, 518(7540):529–533, 2015.
|
| 269 |
+
|
| 270 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L. Lewis, and Satinder P. Singh. ActionConditional Video Prediction using Deep Networks in Atari Games. In Advances in Neural Information Processing Systems (NIPS), pp. 2863–2871, 2015.
|
| 271 |
+
|
| 272 |
+
Alec Solway, Carlos Diuk, Natalia Cordova, Debbie Yee, Andrew G. Barto, Yael Niv, and ´ Matthew M. Botvinick. Optimal Behavioral Hierarchy. PLOS Computational Biology, 10(8): 1–10, 2014.
|
| 273 |
+
|
| 274 |
+
Henning Sprekeler. On the Relation of Slow Feature Analysis and Laplacian Eigenmaps. Neural Computation, 23(12):3287–3302, 2011.
|
| 275 |
+
|
| 276 |
+
Kimberly L. Stachenfeld, Matthew Botvinick, and Samuel J. Gershman. Design Principles of the Hippocampal Cognitive Map. In Advances in Neural Information Processing Systems (NIPS), pp. 2528–2536, 2014.
|
| 277 |
+
|
| 278 |
+
Kimberly L. Stachenfeld, Matthew M Botvinick, and Samuel J. Gershman. The Hippocampus as a Predictive Map. Nature Neuroscience, 20:1643–1653, 2017.
|
| 279 |
+
|
| 280 |
+
Richard S. Sutton. Learning to Predict by the Methods of Temporal Differences. Machine Learning, 3:9–44, 1988.
|
| 281 |
+
|
| 282 |
+
Richard S. Sutton, Doina Precup, and Satinder P. Singh. Between MDPs and Semi-MDPs: A Framework for Temporal Abstraction in Reinforcement Learning. Artificial Intelligence, 112(1-2):181– 211, 1999.
|
| 283 |
+
|
| 284 |
+
Gerald Tesauro. Temporal Difference Learning and TD-Gammon. Communications of the ACM, 38 (3):58–68, 1995.
|
| 285 |
+
|
| 286 |
+
Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. FeUdal Networks for Hierarchical Reinforcement Learning. In Proc. of the International Conference on Machine Learning (ICML), pp. 3540–3549, 2017.
|
| 287 |
+
|
| 288 |
+
T. Wang, M. Bowling, and D. Schuurmans. Dual Representations for Dynamic Programming and Reinforcement Learning. In Proc. of the IEEE International Symposium on Approximate Dynamic Programming and Reinforcement Learning (ADPRL), pp. 44–51, 2007.
|
| 289 |
+
|
| 290 |
+
Christopher J. C. H. Watkins and Peter Dayan. Technical Note: Q-Learning. Machine Learning, 8 (3-4), May 1992.
|
| 291 |
+
|
| 292 |
+
Laurenz Wiskott and Terrence J. Sejnowski. Slow Feature Analysis: Unsupervised Learning of Invariances. Neural Computation, 14(4):715–770, 2002.
|
| 293 |
+
|
| 294 |
+
# APPENDIX: SUPPLEMENTARY MATERIAL
|
| 295 |
+
|
| 296 |
+
This supplementary material contains details omitted from the main text due to space constraints. The list of contents is below:
|
| 297 |
+
|
| 298 |
+
• A more detailed proof of the theorem in the paper;
|
| 299 |
+
• Empirical results evaluating how the number of episodes used to learn the successor representation impacts the obtained eigenvectors and their corresponding eigenoptions;
|
| 300 |
+
• Evaluation of the reconstruction module (auxiliary task) that learns the latent representation that is used to estimate the successor representation.
|
| 301 |
+
|
| 302 |
+
# A MORE DETAILED PROOF OF THE THEOREM IN THE MAIN PAPER
|
| 303 |
+
|
| 304 |
+
Theorem. Stachenfeld et al. (2014): Let $0 < \gamma < 1$ s.t. $\Psi = ( I - \gamma T ) ^ { - 1 }$ denotes the matrix encoding the $S R$ , and let $\mathcal { L } = D ^ { - 1 / 2 } ( D - W ) D ^ { - 1 / 2 }$ denote the matrix corresponding to the normalized Laplacian, both obtained under a uniform random policy. The $i$ -th eigenvalue $( \lambda _ { S R , i } )$ of the $S R$ and the $j$ -th eigenvalue $( \lambda _ { P V F , j } )$ of the normalized Laplacian are related as follows:
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\lambda _ { P V F , j } = \left[ 1 - ( 1 - { \lambda _ { S R , i } } ^ { - 1 } ) \gamma ^ { - 1 } \right]
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
The i-th eigenvector $( \mathbf { e } _ { S R , i } )$ of the $S R$ and the $j$ -th eigenvector $( \mathbf { e } _ { P V F , j } )$ of the normalized Laplacian, where $i + j = n + 1$ , with $n$ being the total number of rows (and columns) of matrix $T$ , are related as follows:
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
{ \bf e } _ { P V F , j } = ( \gamma ^ { - 1 } D ^ { 1 / 2 } ) { \bf e } _ { S R , i }
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
Proof. This proof is more detailed than the one presented in the main paper. Let $\lambda _ { i } , \mathbf { e } _ { i }$ denote the $i$ -th eigenvalue and eigenvector of the SR. Using the fact that the SR is known to converge, in the limit, to $( I - \gamma T ) ^ { - 1 }$ (through the Neumann series), we have:
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\begin{array} { r l } { \frac { ( 1 - \sqrt { 2 } - \sqrt { 3 } ) ! } { 2 } \langle x - y \rangle _ { i } } & { = - \lambda _ { 0 } ! } \\ { ( 1 - \sqrt { 2 } - \sqrt { 3 } ) ! } & { = - \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 2 - \sqrt { 3 } - \Gamma _ { i } ) \Gamma _ { i } } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 3 - \sqrt { 3 } - \Gamma _ { i } ) \Gamma _ { i } } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 4 - \sqrt { 3 } - \Gamma _ { i } ) \Gamma _ { i } } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 5 - \sqrt { 3 } - \Gamma _ { i } ) \Gamma _ { i } } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 4 - \sqrt { 3 } - \Gamma _ { i } ) \Gamma _ { i } } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 5 - \sqrt { 3 } - \Gamma _ { i } ) \Gamma _ { i } } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 6 - \sqrt { 3 } - \Gamma _ { i } ) \Gamma _ { i } } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 7 - \sqrt { 3 } ) ! } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 7 - \sqrt { 3 } ) ! } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 7 - \sqrt { 3 } ) ! } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 5 - \sqrt { 3 } ) ! } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 7 - \sqrt { 3 } ) ! } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ { ( 4 - \sqrt { 3 } - \Gamma _ { i } ) ! } \\ { ( 5 - \sqrt { 3 } ) ! } & { = \lambda _ { 0 } ! ^ { 2 } \sqrt { 3 } \Gamma _ { i } } \\ ( 6 - \sqrt { 3 } - \Gamma _ { i } ) \end{array}
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
THE IMPACT THE NUMBER OF EPISODES HAS IN LEARNING THE SR AND THE EIGENOPTIONS
|
| 323 |
+
|
| 324 |
+
In Section 4.1 we briefly discussed the impact of estimating the successor representation from samples instead of assuming the agent has access to the normalized Laplacian. It makes much more sense to use the successor representation as the DIF model in the environment if we can estimate it quickly. The diffusion time was the main evidence we used in Section 4.1 to support our claim that early estimates of the successor representation are useful for eigenoption discovery. In order to be concise we did not actually plot the eigenvectors of the estimates of the successor representation at different moments, nor explicitly compared them to proto-value functions or to the eigenvectors of the matrix $( I - \gamma T ) ^ { - 1 }$ . We do so in this section.
|
| 325 |
+
|
| 326 |
+
Figures 7–10 depict the first four eigenvectors of the successor representation in the Rooms domain, after being learned for different number of episodes (episodes were 100 time steps long, $\eta = 0 . 1$ , $\gamma = 0 . 9$ ). We also depict the corresponding eigenvectors of the $( I - \gamma T ) ^ { - 1 } \ \mathrm { m a t r i x } ^ { 2 }$ , and of the normalized Laplacian (Machado et al., 2017). Because the eigenvectors orientation (sign) is often arbitrary in an eigendecomposition, we matched their orientation to ease visualization.
|
| 327 |
+
|
| 328 |
+
Overall, after 500 episodes we already have an almost perfect estimate of the first eigenvectors in the environment; while 100 episodes seem to not be enough to accurately learn the DIF model in all rooms. However, learning the successor representation for 100 episodes seems to be enough to generate eigenoptions that reduce the agent’s diffusion time, as we show in Figure 3d. We can better discuss this behavior by looking at Figures 11–14, which depict the options generated by the obtained eigenvectors.
|
| 329 |
+
|
| 330 |
+
With the exception of the options generated after learning the successor representation for 100 episodes, all the eigenoptions obtained from estimates of the successor representation already move the agent towards the “correct” room(s). Naturally, they do not always hit the corners, but the general structure of the policies can be clearly seen. We also observe that the eigenoptions obtained from proto-value functions are shifted one tile from the corners. As discussed in the main paper, this is a consequence of how Machado et al.’s (2017) dealt with corners. They did not model selfloops in the MDP, despite the fact that the agent can be in the same state for two consecutive steps. The successor representation captures this naturally. Finally, we use Figure 11a to speculate why the options learned after 100 episodes are capable of reducing the agent’s diffusion time. The first eigenoption learned by the agent moves it to the parts of the state space it has never been to, this may be the reason that the combination of these options is so effective. It also suggests that incremental methods for option discovery and exploration are a promising path for future work.
|
| 331 |
+
|
| 332 |
+
# USING EIGENOPTIONS TO ACCUMULATE REWARD IN THE ENVIRONMENT
|
| 333 |
+
|
| 334 |
+
In Section 4.1 we also evaluated the agent’s ability to accumulate reward after the eigenoptions have been learned. We further analyze this topic here. As in Section 4.1, the agent learned, off-policy, the greedy policy over primitive actions (target policy) while following the uniform random policy over actions and eigenoptions (behavior policy). We used Q-learning (Watkins $\&$ Dayan, 1992) in our experiments – parameters $\lambda = 0$ , $\alpha = 0 . 1$ , and $\gamma = 0 . 9$ . Episodes were 100 time steps long. Figures 16–19 summarize the obtained results comparing the performance of our approach to regular Q-learning over primitive actions in four different environments ( $\cdot \cdot f .$ Figure 15). We evaluate the agent’s performance when using eigenoptions extracted from estimates of the SR obtained after 100, 500, and 1000 episodes, as well eigenoptions obtained from the true SR, i.e., $( I - \gamma T ) ^ { - 1 }$ . The reported results are the average over 24 independent runs when learning the SR, with each one of these runs encoding 100 runs evaluating Q-Learning. The options were added following the sorting provided by the eigenvalues. For example, 4 options denotes an agent with the action set used in the behavior policy being composed of the four primitive actions and the four eigenoptions generated by the top 2 eigenvalues (both directions are being used).
|
| 335 |
+
|
| 336 |
+
We can see that eigenoptions are not only capable of reducing the diffusion time in the environment but of also improving the agent’s control performance. They do so by increasing the likelihood that the agent will cover a larger part of the state space given the same amount of time. Interestingly, few eigenoptions seem to be enough for the agent. Moreover, although rough estimates of the SR seem to be enough to improve the agent’s performance (e.g., estimates obtained after only 100 episodes).
|
| 337 |
+
|
| 338 |
+
More accurate predictions of the SR are able to further improve the agent’s performance, mainly when dozens of eigenoptions are being used. The first eigenoptions to be accurately estimated are those with larger eigenvalues, which are the ones we add first.
|
| 339 |
+
|
| 340 |
+
# EVALUATION OF THE RECONSTRUCTION TASK
|
| 341 |
+
|
| 342 |
+
In Section 4.2 we analyzed the eigenoptions we are able to discover in four games of the Arcade Learning Environment. We did not discuss the performance of the proposed network in the auxiliary tasks we defined. We do so here. Figures 20–23 depict a comparison between the target screen that should be predicted and the network’s actual prediction for ten time steps in each game. We can see that it accurately predicts the general structure of the environment and it is able to keep track of most moving sprites on the screen. The prediction is quite noisy, different from Oh et al.’s (2015) result. Still, it is interesting to see how even an underperforming network is able to learn useful representations for our algorithm. It is likely better representations would result in better options.
|
| 343 |
+
|
| 344 |
+
# EIGENOPTIONS DISCOVERED IN FREEWAY
|
| 345 |
+
|
| 346 |
+
Figure 6 depicts the two meaningful eigenoptions we were able to discover in the game FREEWAY. As in Figure 5, each option is represented by the normalized count of the avatar’s position on the screen in a trajectory. The trajectories generated by different options are represented by different colors and the color’s intensity at a given location represents how often the agent was at that location.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 6: Eigenoptions discovered in the game FREEWAY.
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 7: Evolution of the first eigenvector being estimated by the SR and baselines.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 8: Evolution of the second eigenvector being estimated by the SR and baselines.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 9: Evolution of the third eigenvector being estimated by the SR and baselines.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 10: Evolution of the fourth eigenvector being estimated by the SR and baselines.
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 11: Evolution of the first eigenoption being estimated by the SR and baselines.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 12: Evolution of the second eigenoption being estimated by the SR and baselines.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 13: Evolution of the third eigenoption being estimated by the SR and baselines.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 14: Evolution of the fourth eigenoption being estimated by the SR and baselines.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 15: Different environments (varying start and goal locations) used when evaluating the agent’s ability to accumulate reward with and without eigenoptions.
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Figure 16: Plot depicting the agent’s performance when following options obtained through estimates of the SR (100, 500, and 1, 000 episodes), as well as through the true SR, in environment 1.
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
Figure 17: Plot depicting the agent’s performance when following options obtained through estimates of the SR (100, 500, and 1, 000 episodes), as well as through the true SR, in environment 2.
|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
Figure 18: Plot depicting the agent’s performance when following options obtained through estimates of the SR (100, 500, and 1, 000 episodes), as well as through the true SR, in environment 3.
|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
|
| 389 |
+
Figure 19: Plot depicting the agent’s performance when following options obtained through estimates of the SR (100, 500, and 1, 000 episodes), as well as through the true SR, in environment 4.
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Figure 20: Final 1-step predictions in the game BANK HEIST. We use the task of predicting the next game screen as an auxiliary task when estimating the successor representation.
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 21: Final 1-step predictions in the game FREEWAY. We use the task of predicting the next game screen as an auxiliary task when estimating the successor representation.
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Figure 22: Final 1-step predictions in the game MONTEZUMA’S REVENGE. We use the task of predicting the next game screen as an auxiliary task when estimating the successor representation.
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 23: Final 1-step predictions in the game MS. PACMAN. We use the task of predicting the next game screen as an auxiliary task when estimating the successor representation.
|
md/train/BkVsEMYel/BkVsEMYel.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BkedwoC5t7/BkedwoC5t7.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FORMAL LIMITATIONS ON THE MEASUREMENT OF MUTUAL INFORMATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Motivated by applications to unsupervised learning, we consider the problem of measuring mutual information. Recent analysis has shown that naive kNN estimators of mutual information have serious statistical limitations motivating more refined methods. In this paper we prove that serious statistical limitations are inherent to any measurement method. More specifically, we show that any distributionfree high-confidence lower bound on mutual information cannot be larger than $O ( \ln N )$ where $N$ is the size of the data sample. We also analyze the DonskerVaradhan lower bound on KL divergence in particular and show that, when simple statistical considerations are taken into account, this bound can never produce a high-confidence value larger than $\ln { N }$ . While large high-confidence lower bounds are impossible, in practice one can use estimators without formal guarantees. We suggest expressing mutual information as a difference of entropies and using cross entropy as an entropy estimator. We observe that, although cross entropy is only an upper bound on entropy, cross-entropy estimates converge to the√ true cross entropy at the rate of $1 / \sqrt { N }$ .
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Motivated by maximal mutual information (MMI) predictive coding (McAllester, 2018; Stratos, 2018; Oord et al., 2018), we consider the problem of measuring mutual information. A classical approach to this problem is based on estimating entropies by computing the average log of the distance to the kth nearest neighbor in a sample (Kraskov et al., 2003). It has recently been shown that the classical kNN methods have serious statistical limitations and more refined kNN methods have been proposed (Gao et al., 2014). Here we establish serious statistical limitations on any method of estimating mutual information. More specifically, we show that any distribution-free high-confidence lower bound on mutual information cannot be larger than $O ( \ln N )$ where $N$ is the size of the data sample.
|
| 12 |
+
|
| 13 |
+
Prior to proving the general case, we consider the particular case of the Donsker-Varadhan lower bound on KL divergence (Donsker & Varadhan, 1983; Belghazi et al., 2018). We observe that when simple statistical considerations are taken into account, this bound can never produce a highconfidence value larger than $\ln { N }$ . Similar comments apply to lower bounds based on contrastive estimation. The contrastive estimation lower bound given in Oord et al. (2018) does not establish mutual information of more than $\ln k$ where $k$ is number of negative samples used in the contrastive choice.
|
| 14 |
+
|
| 15 |
+
The difficulties arise in cases where the mutual information $I ( x , y )$ is large. Since $I ( x , y ) =$ $H ( y ) - H ( y | x )$ we are interested in cases where $H ( y )$ is large and $H ( y | x )$ is small. For example consider the mutual information between an English sentence and its French translation. Sampling English and French independently will (almost) never yield two sentences where one is a plausible translation of the other. In this case the DV bound is meaningless and contrastive estimation is trivial. In this example we need a language model for estimating $H ( y )$ and a translation model for estimating $H ( y | x )$ . Language models and translation models are both typically trained with crossentropy loss. Cross-entropy loss can be used as an (upper bound) estimate of entropy and we get an estimate of mutual information as a difference of cross-entropy estimates. Note that the upper-bound guarantee for the cross-entropy estimator yields neither an upper bound nor a lower bound guarantee for a difference of entropies. Similar observations apply to measuring the mutual information for pairs of nearby frames of video or pairs of sound waves for utterances of the same sentence.
|
| 16 |
+
|
| 17 |
+
We are motivated by the problem of maximum mutual information predictive coding (McAllester, 2018; Stratos, 2018; Oord et al., 2018). One can formally define a version of MMI predictive coding by considering a population distribution on pairs $( x , y )$ where we think of $x$ as past raw sensory signals (images or sound waves) and $y$ as a future sensory signal. We consider the problem of learning stochastic coding functions $C _ { x }$ and $C _ { y }$ so as to maximize the mutual information $I ( C _ { x } ( x ) , C _ { y } ( y ) )$ while limiting the entropies $H ( C _ { x } ( x ) )$ and $H ( C _ { y } ( y ) )$ . The intuition is that we want to learn representations $C _ { x } ( x )$ and $C _ { y } ( y )$ that preserve “signal” while removing “noise”. Here signal is simply defined to be a low entropy representation that preserves mutual information with the future. Forms of MMI predictive coding have been independently introduced in (McAllester, 2018) under the name “information-theoretic cotraining” and in (Oord et al., 2018) under the name “contrastive predictive coding”. It is also possible to interpret the local version of DIM (DIM(L)) (Hjelm et al., 2018) as a variant of MMI predictive coding.
|
| 18 |
+
|
| 19 |
+
A closely related framework is the information bottleneck (Tishby et al., 2000). Here one again assumes a population distribution on pairs $( x , y )$ . The objective is to learn a stochastic coding function $C _ { x }$ so as to maximize $I ( C _ { x } ( x ) , y )$ while minimizing $I ( C _ { x } ( x ) , x )$ . Here one does not ask for a coding function on $y$ and one does not limit $H ( C _ { x } ( x ) )$ .
|
| 20 |
+
|
| 21 |
+
Another related framework is INFOMAX (Linsker, 1988; Bell & Sejnowski, 1995; Hjelm et al., 2018). Here we consider a population distribution on a single random variable $x$ . The objective is to learn a stochastic coding function $C _ { x }$ so as to maximize the mutual information $I ( x , C _ { x } ( x ) )$ subject to some constraint or additional objective.
|
| 22 |
+
|
| 23 |
+
As mentioned above, in cases where $I ( C _ { x } ( x ) , C _ { y } ( y ) )$ is large it seems best to train a model of the marginal distribution of $P ( C _ { y } )$ and a model of the conditional distribution $P ( C _ { y } | C _ { x } )$ where both models are trained with cross-entropy loss. Section 5 gives various high confidence upper bounds on cross-entropy loss for learned models. The main point is that, unlike lower bounds on entropy, high-confidence upper bounds on cross-entropy loss can be guaranteed to be close to the true cross entropy.
|
| 24 |
+
|
| 25 |
+
Out theoretical analyses will assume discrete distributions. However, there is no loss of generality in this assumption. Rigorous treatments of probability (measure theory) treat integrals (either Riemann or Lebesgue) as limits of increasingly fine binnings. A continuous density can always be viewed as a limit of discrete distributions. Although our proofs are given for discrete case, all our formal limitations on the measurement of mutual information apply to continuous case as well. See Marsh (2013) for a discussion of continuous information theory. Additional comments on this point are given in section 4.
|
| 26 |
+
|
| 27 |
+
# 2 THE DONSKER-VARADHAN LOWER BOUND
|
| 28 |
+
|
| 29 |
+
Mutual information can be written as a $\mathrm { K L }$ divergence.
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
I ( X , Y ) = K L ( P _ { X , Y } , P _ { X } P _ { Y } )
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
Here $P _ { X , Y }$ is a joint distribution on the random variables $X$ and $Y$ and $P _ { X }$ and $P _ { Y }$ are the marginal distributions on $X$ and $Y$ respectively. The DV lower bound applies to KL-divergence generally. To derive the DV bound we start with the following observation for any distributions $P , Q$ , and $G$ on the same support. Our theoretical analyses will assume discrete distributions.
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\begin{array} { l l l } { { K L ( P , Q ) } } & { { = } } & { { \displaystyle { E _ { z \sim P } \ \ln \frac { P ( z ) } { { \cal Q } ( z ) } } } } \\ { { } } & { { = } } & { { \displaystyle { E _ { z \sim P } \ \ln \left( \frac { { \cal G } ( z ) } { { \cal Q } ( z ) } \frac { P ( z ) } { { \cal G } ( z ) } \right) } } } \\ { { } } & { { = } } & { { \displaystyle { E _ { z \sim P } \ \ln \frac { { \cal G } ( z ) } { { \cal Q } ( z ) } + K L ( P , G ) } } } \\ { { } } & { { \geq } } & { { \displaystyle { E _ { z \sim P } \ \ln \frac { { \cal G } ( z ) } { { \cal Q } ( z ) } } } } \end{array}
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
Note that (1) achieves equality for $G ( z ) = P ( z )$ and hence we have
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
K L ( P , Q ) = \operatorname* { s u p } _ { G } \ E _ { z \in P } \ \ln { \frac { G ( z ) } { Q ( z ) } }
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Here we can let $G$ be a parameterized model such that $G ( z )$ can be computed directly. However, we are interested in $K L ( P _ { X , Y } , P _ { X } P _ { Y } )$ where our only access to the distribution $P$ is through sampling. If we draw a pair $( x , y )$ and ignore $y$ we get a sample from $P _ { X }$ . We can similarly sample from $P _ { Y }$ . So we are interested in a KL-divergence $K L ( P , Q )$ where our only access to the distributions $P$ and $Q$ is through sampling. Note that we cannot evaluate (1) by sampling from $P$ because we have no way of computing $Q ( z )$ . But through a change of variables we can convert this to an expression restricted to sampling from $Q$ . More specifically we define $G ( z )$ in terms of an unconstrained function $F ( z )$ as
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
G ( z ) = \frac { 1 } { Z } Q ( z ) e ^ { F ( z ) } ~ Z = \sum _ { z } Q ( z ) e ^ { F ( z ) } = E _ { z \sim Q } ~ e ^ { F ( z ) }
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Substituting (3) into (2) gives
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
K L ( P , Q ) = \operatorname* { s u p } _ { F } \ E _ { z \sim P } \ F ( z ) - \ln E _ { z \sim Q } \ e ^ { F ( z ) }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Equation (4) is the Donsker-Varadhan lower bound. Applying this to mutual information we get
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { l c l } { { I ( X , Y ) } } & { { = } } & { { K L ( P _ { X , Y } , P _ { X } P _ { Y } ) } } \\ { { } } & { { } } & { { } } \\ { { } } & { { = } } & { { \underset { F } { \operatorname* { s u p } } \ E _ { x , y \sim P _ { X , Y } } \ F ( x , y ) - \ln E _ { x \sim P _ { X } , y \sim P _ { Y } } \ e ^ { F ( x , y ) } } } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
This is the equation underlying the MINE approach to maximizing mutual information (Belghazi et al., 2018). It would seem that we can estimate both terms in (5) through sampling and be able to maximize $I ( X , Y )$ by stochastic gradient ascent on this lower bound.
|
| 66 |
+
|
| 67 |
+
# 3 STATISTICAL LIMITATIONS OF KL-DIVERGENCE LOWER BOUNDS
|
| 68 |
+
|
| 69 |
+
In this section we show that the DV bound (4) cannot be used to measure KL-divergences of more than tens of bits. In fact we will show that no high-confidence distribution-free lower bound on KL divergence can be used for this purpose.
|
| 70 |
+
|
| 71 |
+
As a first observation note that (4) involves $E _ { z \sim Q } ~ e ^ { F ( z ) }$ . This expression has the same form as the moment generating function used in analyzing large deviation probabilities. The utility of expectations of exponentials in large deviation theory is that such expressions can be dominated by extremely rare events (large deviations). The rare events dominating the expectation will never be observed by sampling from $Q$ . It should be noted that the optimal value for $F ( z )$ in (4) is $\ln ( P ( z ) / Q ( z ) )$ in which case the right hand side of (4) simplifies to $K L ( P , Q )$ . But for large KL divergence we will have that $F ( z ) \stackrel { - } { = } \ln ( P ( z ) / Q ( z ) )$ is typically hundreds of bits and this is exactly the case where $E _ { z \sim Q } ~ e ^ { F ( z ) }$ cannot be measured by sampling from $Q$ . If $E _ { z \sim Q } ~ e ^ { F ( z ) }$ is dominated by events that will never occur in sampling from $Q$ then the optimization of $F$ through the use of (4) and sampling from $Q$ cannot possibly lead to a function $F ( z )$ that accurately models the desired function $\ln ( P ( z ) / Q ( z ) )$ .
|
| 72 |
+
|
| 73 |
+
To quantitatively analyze the risk of unseen outlier events we will make use of the following simple lemma where we write $P _ { z \sim Q } ( \Phi [ z ] )$ for the probability over drawing $z$ from $Q$ that the statement $\Phi [ z ]$ holds.
|
| 74 |
+
|
| 75 |
+
Outlier Risk Lemma: For a sample $S ~ \sim ~ Q ^ { N }$ with $N \ \geq \ 2$ , and a property $\Phi [ z ]$ such that $P _ { z \sim Q } ( \Phi [ z ] ) \leq 1 / N$ , the probability over the draw of $S$ that no $z \in S$ satisfies $\Phi [ z ]$ is at least $1 / 4$ .
|
| 76 |
+
|
| 77 |
+
Proof: The probability that $\Phi [ z ]$ is unseen in the sample is at least $( 1 - 1 / N ) ^ { N }$ which is at least $1 / 4$ for $N \geq 2$ and where we have $\begin{array} { r } { \operatorname* { l i m } _ { N \to \infty } ( 1 - 1 / N ) ^ { N ^ { \bullet } } = 1 / e } \end{array}$ . Q.E.D.
|
| 78 |
+
|
| 79 |
+
We can use the outlier risk lemma to perform a quantitative risk analysis of the DV bound (4). We can rewrite (4) as
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r c l } { K L ( P , Q ) } & { \geq } & { { \cal B } ( P , Q , F ) } \\ { { \cal B } ( P , Q , F ) } & { = } & { { \cal E } _ { z \sim P } ~ F ( z ) - \ln { \cal E } _ { z \sim Q } ~ e ^ { F ( z ) } } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
We can try to estimate $B ( P , Q , G )$ from samples $S _ { P }$ and $S _ { Q }$ , each of size $N$ , from the population distributions $P$ and $Q$ respectively.
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\hat { B } ( S _ { P } , S _ { Q } , F ) = \frac { 1 } { N } \sum _ { z \in S _ { P } } F ( z ) - \ln \frac { 1 } { N } \sum _ { z \in S _ { Q } } e ^ { F ( z ) }
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
While $B ( P , Q , F )$ is a lower bound on $K L ( P , Q )$ , the sample estimate $\hat { B } ( S _ { P } , S _ { Q } , F )$ is not. To get a high confidence lower bound on $K L ( P , Q )$ we have to handle unseen outlier risk. For a fair comparison with our analysis of cross-entropy estimators in section 5, we will limit the outlier risk by bounding $F ( z )$ to the interval $[ 0 , F _ { \mathrm { m a x } } ]$ . The largest possible value of $\hat { B } ( S _ { P } , S _ { q } , F )$ occurs when $F ( z ) = F _ { \operatorname* { m a x } }$ for all $z \in S _ { P }$ and $F ( z ) = 0$ for all $z \in S _ { Q }$ . In this case we get $\hat { B } ( S _ { P } , S _ { Q } , F ) =$ $F _ { \mathrm { m a x } }$ . But by the outlier risk lemma there is still at least a 1/4 probability that
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
E _ { z \sim Q } ~ e ^ { F ( z ) } \geq \frac { 1 } { N } e ^ { F _ { \mathrm { m a x } } } .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Any high confidence lower bound $\tilde { B } ( S _ { P } , S _ { Q } , F )$ must account for the unseen outlier risk. In particular we must have
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r c l } { \tilde { B } ( S _ { P } , S _ { Q } , F ) } & { \leq } & { F _ { \operatorname* { m a x } } - \ln \frac { e ^ { F _ { \operatorname* { m a x } } } } { N } } \\ & & { } & \\ & { = } & { \ln N } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Our negative results can be strengthened by considering the preliminary bound (1) where $G ( z )$ is viewed as a model of $P ( z )$ . We can consider the extreme case of perfect modeling of the population $P$ with a model $G ( z )$ where $G ( z )$ is computable. In this case we have essentially complete access to the distribution $P$ . But even in this setting we have the following negative result.
|
| 104 |
+
|
| 105 |
+
Theorem 1 Let $B$ be any distribution-free high-confidence lower bound on $K L ( P , Q )$ computed with complete knowledge of $P$ but only a sample from $Q$ .
|
| 106 |
+
|
| 107 |
+
More specifically, let $B ( P , S , \delta )$ be any real-valued function of a distribution $P$ , a multiset $S$ , and $a$ confidence parameter $\delta$ such that, for any $P$ , $Q$ and $\delta$ , with probability at least $( 1 - \delta )$ over a draw of $S$ from $Q ^ { N }$ we have
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
K L ( P , Q ) \ge B ( P , S , \delta ) .
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
For any such bound, and for $N \geq 2$ , with probability at least $1 - 4 \delta$ over the draw of $S$ from $Q ^ { N }$ we have
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
B ( P , S , \delta ) \leq \ln { N } .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Proof. Consider distributions $P$ and $Q$ and $N \geq 2$ . Define $\tilde { Q }$ by
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\tilde { Q } ( z ) = \left( 1 - \frac { 1 } { N } \right) Q ( z ) + \frac { 1 } { N } P ( z ) .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
We now have $K L ( P , { \tilde { Q } } ) \leq \ln N$ . We will prove that from a sample $S \sim Q ^ { N }$ we cannot reliably distinguish between $Q$ and $\tilde { Q }$ .
|
| 126 |
+
|
| 127 |
+
We first note that by applying the high-confidence guarantee of the bound to $\tilde { Q }$ have
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
P _ { S \sim \tilde { Q } ^ { N } } ( B ( P , S , \delta ) \leq K L ( P , \tilde { Q } ) ) \geq 1 - \delta .
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
The distribution $\tilde { Q }$ equals the marginal on $z$ of a distribution on pairs $( s , z )$ where $s$ is the value of Bernoulli variable with bias $1 / N$ such that if $s = 1$ then $z$ is drawn from $P$ and otherwise $z$ is drawn
|
| 134 |
+
|
| 135 |
+
from $Q$ . By the outlier risk lemma the probability that all coins are zero is at least 1/4. Conditioned on all coins being zero the distributions $\tilde { Q } ^ { N }$ and $Q ^ { N }$ are the same. Let $\mathrm { P u r e } ( S )$ represent the event that all coins are 0 and let $\operatorname { S m a l l } ( S )$ represent the event that $B ( P , S , \delta ) \leq \ln { N }$ . We now have
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\begin{array} { r l } { P _ { S \sim Q ^ { N } } ( \mathrm { S n a l l } ( \mathrm { S } ) ) } & { = \phantom { P } P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { S n a l l } ( S ) ) \mathrm { P u r e } ( S ) ) } \\ { = } & { \frac { P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { P u r e } ( S ) \times \mathrm { S u n a l } ( \mathrm { S } ) ) } { P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { P u r e } ( S ) ) } } \\ { \ge } & { \frac { P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { P u r e } ( S ) ) - P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { - S u n a l l } ( \mathrm { S } ) ) } { P _ { S \sim Q ^ { N } } ( \mathrm { P u r e } ( S ) ) } } \\ { \ge } & { \frac { P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { P u r e } ( S ) ) - \hat { Q } } { P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { P u r e } ( S ) ) } } \\ { = } & { \frac { P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { P u r e } ( S ) ) - \hat { Q } } { P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { P u r e } ( S ) ) } } \\ { = } & { 1 - \frac { \hat { Q } } { P _ { S \sim \hat { Q } ^ { N } } ( \mathrm { P u r e } ( S ) ) } } \\ { \ge } & { 1 - 4 \delta . } \end{array}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
# 4 STATISTICAL LIMITATIONS ON ENTROPY LOWER BOUNDS
|
| 142 |
+
|
| 143 |
+
Mutual information is a special case of KL-divergence. It is possible that tighter lower bounds can be given in this special case. In this section we show similar limitations on lower bounding mutual information. We first note that a lower bound on mutual information implies a lower bound on entropy. The mutual information between $X$ and $Y$ cannot be larger than information content of $X$ alone.
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
I ( X , Y ) = H ( X ) - H ( X | Y ) \leq H ( X )
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
So a lower bound on $I ( X , Y )$ gives a lower bound on $H ( X )$ . We show that any distribution-free high-confidence lower bound on entropy requires a sample size exponential in the size of the bound.
|
| 150 |
+
|
| 151 |
+
The above argument seems problematic for the case of continuous densities as differential entropy can be negative. However, for the continuous case we have
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
I ( x , y ) = \operatorname* { s u p } _ { C _ { x } , C _ { y } } I ( C _ { x } ( x ) , C _ { y } ( y ) )
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where $C _ { x }$ and $C _ { y }$ range over all maps from the underlying continuous space to discrete sets (all binnings of the continuous space). Hence an $O ( \ln N )$ upper bound on the measurement of mutual information for the discrete case applies to the continuous case as well.
|
| 158 |
+
|
| 159 |
+
The type of a sample $S$ , denoted $\mathcal { T } ( S )$ , is defined to be a function on positive integers (counts) where $\bar { \mathcal { T } } ( S ) ( i )$ is the number of elements of $S$ that occur $i$ times in $S$ . For a sample of $N$ draws we have $\begin{array} { r } { \tilde { N } \stackrel { \cdot } { = } \sum _ { i } i \mathcal { T } ( S ) ( i ) } \end{array}$ . The type $\mathcal { T } ( S )$ contains all information relevant to estimating the actual probability of the items of a given count and of estimating the entropy of the underlying distribution. The problem of estimating distributions and entropies from sample types has been investigated by various authors (McAllester & Schapire, 2000; Orlitsky et al., 2003; Orlitsky & Suresh, 2015; Arora et al., 2018). Here we give the following negative result on lower bounding the entropy of a distribution by sampling.
|
| 160 |
+
|
| 161 |
+
Theorem 2 Let $B$ be any distribution-free high-confidence lower bound on $H ( P )$ computed from a sample type T (S) with S ∼ P N .
|
| 162 |
+
|
| 163 |
+
More specifically, let $B ( \tau , \delta )$ be any real-valued function of a type $\tau$ and a confidence parameter $\delta$ such that for any $P$ , with probability at least $( 1 - \delta )$ over a draw of $S$ from $P ^ { \tilde { N } }$ , we have
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
H ( P ) \geq B ( { \mathcal { T } } ( S ) , \delta ) .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
For any such bound, and for $N \geq 5 0$ and $k \geq 2$ , with probability at least $1 - \delta - 1 . 0 1 / k$ over the draw of $S$ from $P ^ { N }$ we have
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
B ( { \mathcal { T } } ( S ) , \delta ) \leq \ln 2 k N ^ { 2 } .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
Proof: Consider a distribution $P$ and $N \geq 1 0 0$ . If the support of $P$ has fewer than $2 k N ^ { 2 }$ elements then $H ( P ) < \ln 2 k N ^ { 2 }$ and by the premise of the theorem we have that, with probability at least $1 - \delta$ over the draw of $S$ , $B ( { \dot { \mathcal { T } } } ( S ) , { \bar { \delta } } ) \leq H ( P )$ and the theorem follows. If the support of $P$ has at least $2 k N ^ { 2 }$ elements then we sort the support of $P$ into a (possibly infinite) sequence $x _ { 1 } , \ x _ { 2 } , \ x _ { 3 } , . . . .$ so that $P ( x _ { i } ) \geq P ( x _ { i + 1 } )$ . We then define a distribution $\tilde { P }$ on the elements $x _ { 1 }$ $, \ldots , x _ { 2 k N ^ { 2 } }$ by
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\tilde { P } ( x _ { i } ) = \left( \begin{array} { l l } { { P ( x _ { i } ) } } & { { \mathrm { f o r } i \leq k N ^ { 2 } } } \\ { { } } & { { } } \\ { { \frac { P ( i > k N ^ { 2 } ) } { k N ^ { 2 } } } } & { { \mathrm { f o r } k N ^ { 2 } < i \leq 2 k N ^ { 2 } } } \end{array} \right)
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
We will let $\operatorname { S m a l l } ( S )$ denote the event that $B ( \mathcal T ( S ) , \delta ) \le \ln 2 k N ^ { 2 }$ and let ${ \mathrm { P u r e } } ( S )$ abbreviate the event that no element $x _ { i }$ for $i > k N ^ { 2 }$ occurs twice in the sample. Since $\tilde { P }$ has a support of size $2 k N ^ { 2 }$ we have $H ( \tilde { P } ) \leq \ln 2 k N ^ { 2 }$ . Applying the premise of the lemma to $\tilde { P }$ gives
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
P _ { S \sim \tilde { P } ^ { N } } ( \operatorname { S m a l l } ( S ) ) \geq 1 - \delta
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
For a type $\tau$ let $P _ { S \sim P ^ { N } } ( \mathcal { T } )$ denote the probability over drawing $S \sim P ^ { N }$ that $\mathcal { T } ( S ) = \mathcal { T }$ . We now have
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
P _ { S \sim P ^ { N } } ( \mathcal { T } | \mathrm { P u r e } ( S ) ) = P _ { S \sim \tilde { P } ^ { N } } ( \mathcal { T } | \mathrm { P u r e } ( S ) ) .
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
This gives the following.
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\begin{array} { r c l } { P _ { S \sim P ^ { N } } ( \mathrm { S m a l l } ( S ) ) } & { \geq } & { P _ { S \sim P ^ { N } } ( \mathrm { P u r e } ( S ) \wedge \mathrm { S m a l l } ( S ) ) } \\ & { = } & { P _ { S \sim P ^ { N } } ( \mathrm { P u r e } ( S ) ) P _ { S \sim P ^ { N } } ( \mathrm { S m a l l } ( S ) \mid \mathrm { P u r e } ( S ) ) } \\ & { = } & { P _ { S \sim P ^ { N } } ( \mathrm { P u r e } ( S ) ) P _ { S \sim \tilde { P } ^ { N } } ( \mathrm { S m a l l } ( S ) \mid \mathrm { P u r e } ( S ) ) } \\ & { \geq } & { P _ { S \sim P ^ { N } } ( \mathrm { P u r e } ( S ) ) P _ { S \sim \tilde { P } ^ { N } } ( \mathrm { P u r e } ( S ) \wedge \mathrm { S m a l l } ( S ) ) } \end{array}
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
For $i > k N ^ { 2 }$ we have $\tilde { P } ( x _ { i } ) \leq 1 / ( k N ^ { 2 } )$ which gives
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
P _ { S \sim \tilde { P } ^ { N } } ( \mathrm { P u r e } ( S ) ) \geq \prod _ { j = 1 } ^ { N - 1 } \left( 1 - \frac { j } { k N ^ { 2 } } \right)
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
Using $( 1 - P ) \ge e ^ { - 1 . 0 1 \ P }$ for $P \leq 1 / 1 0 0$ we have the following birthday paradox calculation.
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
\begin{array} { l c l } { { \ln P _ { S \sim \tilde { P } ^ { N } } ( \mathrm { P u r e } ( S ) ) } } & { { \geq } } & { { \displaystyle - \frac { 1 . 0 1 } { k N ^ { 2 } } \sum _ { j = 1 } ^ { N - 1 } j } } \\ { { } } & { { } } & { { } } \\ { { \displaystyle } } & { { = } } & { { \displaystyle - \frac { 1 . 0 1 } { k N ^ { 2 } } \frac { ( N - 1 ) N } { 2 } \ ~ } } \\ { { } } & { { \geq } } & { { \displaystyle - 5 0 5 / k } } \\ { { P _ { S \sim \tilde { P } ^ { N } } ( \mathrm { P u r e } ( S ) ) } } & { { \geq } } & { { \displaystyle e ^ { - . 5 0 5 / k } \geq 1 - . 5 0 5 / k } } \end{array}
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
Applying the union bound to (7) and (9) gives.
|
| 212 |
+
|
| 213 |
+
$$
|
| 214 |
+
P _ { S \sim \tilde { P } ^ { N } } ( \mathrm { P u r e } ( S ) \wedge \mathrm { S m a l l } ( S ) ) \geq 1 - \delta - . 5 0 5 / k
|
| 215 |
+
$$
|
| 216 |
+
|
| 217 |
+
By a derivation similar to that of (9) we get
|
| 218 |
+
|
| 219 |
+
$$
|
| 220 |
+
P _ { S \sim P ^ { N } } ( \mathrm { P u r e } ( S ) ) \geq 1 - . 5 0 5 / k
|
| 221 |
+
$$
|
| 222 |
+
|
| 223 |
+
Combining (8), (10) and (11) gives
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
P _ { S \sim P ^ { N } } ( \operatorname { S m a l l } ( S ) ) \geq 1 - \delta - 1 . 0 1 / k
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
# 5 CROSS ENTROPY AS AN ENTROPY ESTIMATOR
|
| 230 |
+
|
| 231 |
+
Since mutual information can be expressed as a difference of entropies, the problem of measuring mutual information can be reduced to the problem of measuring entropies. In this section we show that, unlike high-confidence distribution-free lower bounds, high-confidence distribution-free upper bounds on entropy can approach the true cross entropy at modest sample sizes even when the true cross entropy is large. More specifically we consider the cross-entropy upper bound.
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
\begin{array} { l l l } { \displaystyle H ( P ) } & { = } & { \displaystyle { E _ { x \sim P } \ln \frac { 1 } { P ( x ) } } } \\ { \displaystyle } & { = } & { \displaystyle E _ { x \sim P } \ln \left( \frac { 1 } { G ( x ) } \frac { G ( x ) } { P ( x ) } \right) } \\ { \displaystyle } & { = } & { \displaystyle H ( P , G ) - K L ( P , G ) } \\ { \displaystyle } & { \le } & { \displaystyle H ( P , G ) } \end{array}
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
For $G = P$ we get ${ \cal H } ( P , G ) = { \cal H } ( P )$ and hence we have
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
H ( P ) = \operatorname* { i n f } _ { G } ~ H ( P , G )
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
In practice $P$ is a population distribution and $G$ is model of $P$ . For example $P$ might be a population distribution on paragraphs and $G$ might be an autoregressive RNN language model. In practice $G$ will be given by a network with parameters $\Phi$ . In this setting we have the following upper bound entropy estimator.
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
\hat { H } ( P ) \quad = \quad \underset { \Phi } { \operatorname* { i n f } } H ( P , G _ { \Phi } )
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
The gap between ${ \hat { H } } ( P )$ and $H ( P )$ depends on the expressive power of the model class.
|
| 250 |
+
|
| 251 |
+
The statistical limitations on distribution-free high-confidence lower bounds on entropy do not arise for cross-entropy upper bounds. For upper bounds we can show that naive sample estimates of the cross-entropy loss produce meaningful (large entropy) results. We first define the cross-entropy estimator from a sample $S$ .
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
{ \hat { H } } ( S , G ) = { \frac { 1 } { | S | } } \sum _ { x \in S } - \ln G ( x )
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
We can bound the loss of a model $G$ by ensuring a minimum probability $e ^ { - F _ { \operatorname* { m a x } } }$ where $F _ { \mathrm { m a x } }$ is then the maximum possible log loss in the cross-entropy objective. In language modeling a loss bound exists for any model that ultimately backs off to a uniform distribution on characters. Given a loss bound of $F _ { \mathrm { m a x } }$ we have that ${ \hat { H } } ( S , G )$ is just the standard sample mean estimator of an expectation of a bounded variable. In this case we have the following standard confidence interval.
|
| 258 |
+
|
| 259 |
+
Theorem 3 For any population distribution $P$ , and model distribution $G$ with $- l n G ( x )$ bounded to the interval $[ 0 , F _ { \mathrm { m a x } } ]$ , with probability at least $1 - \delta$ over the draw of $S \sim P ^ { N }$ we have
|
| 260 |
+
|
| 261 |
+
$$
|
| 262 |
+
H ( P , G ) \in { \hat { H } } ( S , G ) \pm F _ { \operatorname* { m a x } } { \sqrt { \frac { \ln { \frac { 2 } { \delta } } } { 2 N } } }
|
| 263 |
+
$$
|
| 264 |
+
|
| 265 |
+
It is also possible to give PAC-Bayesian bounds on ${ \cal H } ( P , G _ { \Phi } )$ that take into account the fact that $G _ { \Phi }$ is typically trained so as to minimize the empirical loss on the training data. The PAC-Bayesian bounds apply to“broad basin” losses and loss estimates such as the following.
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\begin{array} { r c l } { { { \cal H } _ { \sigma } ( S , G _ { \Phi } ) } } & { { = } } & { { E _ { x \sim P } ~ E _ { \epsilon \sim N ( 0 , \sigma I ) } ~ - \ln ~ G _ { \Phi + \epsilon } ( x ) } } \\ { { \hat { H } _ { \sigma } ( S , G _ { \Phi } ) } } & { { = } } & { { \displaystyle { \frac { 1 } { | S | } \sum _ { x \in S } ~ E _ { \epsilon \sim N ( 0 , \sigma I ) } ~ - \ln ~ G _ { \Phi + \epsilon } ( x ) } } } \end{array}
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
Under mild smoothness conditions on $G _ { \Phi } ( x )$ as a function of $\Phi$ we have
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
\begin{array} { r c l } { { \displaystyle \operatorname * { l i m } _ { \sigma \to 0 } ~ H _ { \sigma } ( P , G _ { \Phi } ) } } & { { = } } & { { H ( P , G _ { \Phi } ) } } \\ { { \displaystyle \operatorname * { l i m } _ { \sigma \to 0 } ~ \hat { H } _ { \sigma } ( S , G _ { \Phi } ) } } & { { = } } & { { \hat { H } ( S , G _ { \Phi } ) } } \end{array}
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
An L2 PAC-Bayesian generalization bound (McAllester (2013)) gives that for any parameterized class of models and any bounded notion of loss, and any $\lambda > 1 / 2$ and $\sigma > 0$ , with probability at least $1 - \delta$ over the draw of $S$ from $P ^ { N }$ we have the following simultaneously for all parameter vectors $\Phi$ .
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
H _ { \sigma } ( P , G _ { \Phi } ) \leq \frac { 1 } { 1 - \frac { 1 } { 2 \lambda } } \left( \hat { H } _ { \sigma } ( S , G _ { \Phi } ) + \frac { \lambda F _ { \operatorname* { m a x } } } { N } \left( \frac { | | \Phi | | ^ { 2 } } { 2 \sigma ^ { 2 } } + \ln \frac { 1 } { \delta } \right) \right)
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
It is instructive to set $\lambda = 5$ in which case the bound becomes.
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
H _ { \sigma } ( P , G _ { \Phi } ) \leq \frac { 1 0 } { 9 } \left( \hat { H } _ { \sigma } ( S , G _ { \Phi } ) + \frac { 5 F _ { \operatorname* { m a x } } } { N } \left( \frac { | | \Phi | | ^ { 2 } } { 2 \sigma ^ { 2 } } + \ln \frac { 1 } { \delta } \right) \right)
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
While this bound is linear in $1 / N$ , and tighter in practice than square root bounds, note that there is a small residual gap when holding $\lambda$ fixed at 5 while taking $N \to \infty$ . In practice the regularization parameter $\lambda$ can be tuned on holdout data. One point worth noting is the form of the dependence of the regularization coefficient on $F _ { \mathrm { m a x } }$ , $N$ and the basin parameter $\sigma$ .
|
| 290 |
+
|
| 291 |
+
It is also worth noting that the bound can be given in terms of “distance traveled” in parameter space from an initial (random) parameter setting $\Phi _ { 0 }$ .
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
H _ { \sigma } ( P , G _ { \Phi } ) \leq { \frac { 1 0 } { 9 } } \left( { \hat { H } } _ { \sigma } ( S , G _ { \Phi } ) + { \frac { 5 F _ { \operatorname* { m a x } } } { N } } \left( { \frac { | | \Phi - \Phi _ { 0 } | | ^ { 2 } } { 2 \sigma ^ { 2 } } } + \ln { \frac { 1 } { \delta } } \right) \right)
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
Evidence is presented in Dziugaite & Roy (2017) that the distance traveled bounds are tighter in practice than traditional L2 generalization bounds.
|
| 298 |
+
|
| 299 |
+
# 6 MMI PREDICTIVE CODING
|
| 300 |
+
|
| 301 |
+
Recall that in MMI predictive coding we assume a population distribution on pairs $( x , y )$ where we think of $x$ as past raw sensory signals (images or sound waves) and $y$ as a future sensory signal. We then consider the problem of learning stochastic coding functions $C _ { x }$ and $C _ { y }$ that maximizes the mutual information $I ( C _ { x } ( x ) , C _ { y } ( y ) )$ while limiting the entropies $H ( C _ { x } ( x ) )$ and $H ( C _ { y } ( y ) )$ . Here we propose representing the mutual information as a difference of entropies.
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
I ( C _ { x } ( x ) , C _ { y } ( y ) ) = H ( C _ { y } ( y ) ) - H ( C _ { y } ( y ) | C _ { x } ( x ) )
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
When the coding functions are parameterized by a function $\Psi$ , the above quantities become a function of $\Psi$ . We can then formulate the following nested optimization problem.
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
\begin{array} { r c l } { \Psi ^ { * } } & { = } & { \underset { \Psi } { \mathrm { a r g m a x } } \ \hat { H } ( C _ { y } ( y ) ; \ \Psi ) - \hat { H } ( C _ { y } ( y ) | C _ { x } ( x ) ; \Psi ) } \\ & & \\ { \hat { H } ( C _ { y } ( y ) ; \ \Psi ) } & { = } & { \underset { \Theta } { \mathrm { i n f } } \ H ( C _ { y } ( y ) , G _ { \Theta } ; \ \Psi ) } \\ { \hat { H } ( C _ { y } ( y ) | C _ { x } ( x ) ; \ \Psi ) } & { = } & { \underset { \Phi } { \mathrm { i n f } } \ H ( C _ { y } ( y ) , G _ { \Phi } | C _ { x } ( x ) ; \ \Psi ) } \end{array}
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
The above quantities are expectations over the population distribution on pairs $( x , y )$ . In practice we have only a finite sample form the population. But the preceding section presents theoretical evidence that, unlike lower bound estimators, upper bound cross-entropy estimators can meaningfully estimate large entropies from feasible samples.
|
| 314 |
+
|
| 315 |
+
# 7 CONCLUSIONS
|
| 316 |
+
|
| 317 |
+
Maximum mutual information (MMI) predictive coding seems well motivated as a method of unsupervised pretraining of representations that maintain semantic signal while dropping uninformative noise. However, the maximization of mutual information is a difficult training objective. We have given theoretical arguments that representing mutual information as a difference of entropies, and estimating those entropies by minimizing cross-entropy loss, is a more statistically justified approach than maximizing a lower bound on mutual information.
|
| 318 |
+
|
| 319 |
+
Unfortunately cross-entropy upper bounds on entropy fail to provide either upper or lower bounds on mutual information — mutual information is a difference of entropies. We cannot rule out the possible existence of superintelligent models, models beyond current expressive power, that dramatically reduce cross-entropy loss. Lower bounds on entropy can be viewed as proofs of the non-existence of superintelligence. We should not surprised that such proofs are infeasible.
|
| 320 |
+
|
| 321 |
+
# REFERENCES
|
| 322 |
+
|
| 323 |
+
Sanjeev Arora, Andrej Risteski, and Yi Zhang. Do gans learn the distribution? some theory and empirics. ICLR, 2018.
|
| 324 |
+
|
| 325 |
+
Ishmael Belghazi, Sai Rajeswar, Aristide Baratin, R Devon Hjelm, and Aaron Courville. Mine: mutual information neural estimation. arXiv preprint arXiv:1801.04062, 2018.
|
| 326 |
+
|
| 327 |
+
Anthony J Bell and Terrence J Sejnowski. An information-maximization approach to blind separation and blind deconvolution. Neural computation, 7(6):1129–1159, 1995.
|
| 328 |
+
|
| 329 |
+
M. Donsker and S. Varadhan. Asymptotic evaluation of certain markov process expectations for large time, iv. Communications on Pure and Applied Mathematics, 36(2):183–212, 1983.
|
| 330 |
+
|
| 331 |
+
Gintare Karolina Dziugaite and Daniel M. Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. arXiv preprint arXiv:1703.11008, 2017.
|
| 332 |
+
|
| 333 |
+
Shuyang Gao, Greg Ver Steeg, and Aram Galstyan. Efficient estimation of mutual information for strongly dependent variables. arXiv preprint arXiv:1411.2003, 2014.
|
| 334 |
+
|
| 335 |
+
R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
|
| 336 |
+
|
| 337 |
+
Alexander Kraskov, Harald Stoegbaue, and Peter Grassberger. Estimating mutual information. arXiv preprint arXiv:cond-mat/0305641, 2003.
|
| 338 |
+
|
| 339 |
+
Ralph Linsker. Self-organization in a perceptual network. Computer, 21(3):105–117, 1988.
|
| 340 |
+
|
| 341 |
+
Charles Marsh. Introduction to continuous entropy. www.crmarsh.com/static/pdf/Charles Marsh Continuous Entropy.pdf, 2013.
|
| 342 |
+
|
| 343 |
+
David McAllester. A pac-bayesian tutorial with a dropout bound. arXiv preprint arXiv:1307:2118, 2013.
|
| 344 |
+
|
| 345 |
+
David McAllester. Information Theoretic Co-Training. arXiv preprint arXiv:1802.07572, 2018.
|
| 346 |
+
|
| 347 |
+
David McAllester and Robert Schapire. On the convergence rate of good-turing estimators. COLT, 2000.
|
| 348 |
+
|
| 349 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 350 |
+
|
| 351 |
+
Alon Orlitsky and Ananda Theertha Suresh. Competitive distribution estimation: Why is goodturing good. NIPS, 2015.
|
| 352 |
+
|
| 353 |
+
Alon Orlitsky, Narayana Santhanam, and Junan Zhang1. Always good turing: Asymptotically optimal probability estimation. Science, 302(5644), 2003.
|
| 354 |
+
|
| 355 |
+
Karl Stratos. Mutual information maximization for simple and accurate part-of-speech induction. arXiv preprint arXiv:1804.07849, 2018.
|
| 356 |
+
|
| 357 |
+
Naftali Tishby, Fernando C Pereira, and William Bialek. The information bottleneck method. arXiv preprint physics/0004057, 2000.
|
md/train/BklfR3EYDH/BklfR3EYDH.md
ADDED
|
@@ -0,0 +1,401 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# KEYFRAMING THE FUTURE: DISCOVERING TEMPORAL HIERARCHY WITH KEYFRAME-INPAINTER PREDICTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
To flexibly and efficiently reason about temporal sequences, abstract representations that compactly represent the important information in the sequence are needed. One way of constructing such representations is by focusing on the important events in a sequence. In this paper, we propose a model that learns both to discover such key events (or keyframes) as well as to represent the sequence in terms of them. We do so using a hierarchical Keyframe-Inpainter (KEYIN) model that first generates keyframes and their temporal placement and then inpaints the sequences between keyframes. We propose a fully differentiable formulation for efficiently learning the keyframe placement. We show that KEYIN finds informative keyframes in several datasets with diverse dynamics. When evaluated on a planning task, KEYIN outperforms other recent proposals for learning hierarchical representations.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
When thinking about the future, humans focus their thoughts on the important things that may happen (When will the plane depart?) without fretting about the minor details that fill each intervening moment (What is the last word I will say to the taxi driver?). Because the vast majority of elements in a temporal sequence contains redundant information, a temporal abstraction can make reasoning and planning both easier and more efficient. How can we build such an abstraction? Consider the example of a lead animator who wants to show what happens in the next scene of a cartoon. Before worrying about every low-level detail, the animator first sketches out the story by keyframing, drawing the moments in time when the important events occur. The scene can then be easily finished by other animators who fill in the rest of the sequence from the story laid out by the keyframes. In this paper, we argue that learning to discover such informative keyframes from raw sequences is an efficient and powerful way to learn to reason about the future.
|
| 12 |
+
|
| 13 |
+
Our goal is to learn such an abstraction for future image prediction. In contrast, much of the work on future image prediction has focused on frame-by-frame synthesis (Oh et al. (2015); Finn et al. (2016)). This strategy puts an equal emphasis on each frame, irrespective of the redundant content it may contain or its usefulness for reasoning relative to the other predicted frames. Other recent work has considered predictions that “jump” more than one step into the future, but these approaches either used fixed-offset jumps (Buesing et al., 2018) or used heuristics to select the predicted frames (Neitz et al., 2018; Jayaraman et al., 2019; Gregor et al., 2019). In this work, we propose a method that selects the keyframes that are most informative about the full sequence, so as to allow us to reason about the sequence holistically while only using a small subset of the frames. We do so by ensuring that the full sequence can be recovered from the keyframes with an inpainting strategy, similar to how a supporting animator finishes the story keyframed by the lead.
|
| 14 |
+
|
| 15 |
+
One possible application for a model that discovers informative keyframes is in long-horizon planning. Recently, predictive models have been employed for model-based planning and control (Ebert et al. (2018)). However, they reason about every single future time step, limiting their applicability to short horizon tasks. In contrast, we show that a model that reasons about the future using a small set of informative keyframes enables visual predictive planning for horizons much greater than previously possible by using keyframes as subgoals in a hierarchical planning framework.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Keyframing the future. Instead of predicting one frame after the other, we propose to represent the sequence with the keyframes that depict the interesting moments of the sequence. The remaining frames can be inpainted given the keyframes.
|
| 19 |
+
|
| 20 |
+
To discover informative frames in raw sequence data, we formulate a hierarchical probabilistic model in which a sequence is represented by a subset of its frames (see Fig. 1). In this two-stage model, a keyframing module represents the keyframes as well as their temporal placement with stochastic latent variables. The images that occur at the timepoints between keyframes are then inferred by an inpainting module. We parametrize this model with a neural network and formulate a variational lower bound on the sequence log-likelihood. Optimizing the resulting objective leads to a model that discovers informative future keyframes that can be easily inpainted to predict the full future sequence.
|
| 21 |
+
|
| 22 |
+
Our contributions are as follows. We formulate a hierarchical approach for the discovery of informative keyframes using joint keyframing and inpainting (KEYIN). We propose a soft objective that allows us to train the model in a fully differentiable way. We first analyze our model on a simple dataset with stochastic dynamics in a controlled setting and show that it can reliably recover the underlying keyframe structure on visual data. We then show that our model discovers hierarchical temporal structure on more complex datasets of demonstrations: an egocentric gridworld environment and a simulated robotic pushing dataset, which is challenging for current approaches to visual planning. We demonstrate that the hierarchy discovered by KEYIN is useful for planning, and that the resulting approach outperforms other proposed hierarchical and non-hierarchical planning schemes on the pushing task. Specifically, we show that keyframes predicted by KEYIN can serve as useful subgoals that can be reached by a low-level planner, enabling long-horizon, hierarchical control.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
Hierarchical temporal structure. Hierarchical neural models for efficiently modeling sequences were proposed in Liu et al. (2015); Buesing et al. (2018). These approaches were further extended to predict with an adaptive step size so as to leverage the natural hierarchical structure in language data (Chung et al., 2016; Kádár et al., 2018). However, these models rely on autoregressive techniques for text generation and applying them to structured data, such as videos, might be impractical.
|
| 27 |
+
|
| 28 |
+
The video processing community has used keyframe representations as early as 1991 in the MPEG codec (Gall, 1991). Wu et al. (2018) adapted this algorithm in the context of neural compression; however, these approaches use constant offsets between keyframes and thus do not fully reflect the temporal structure of the data. Recently, several neural methods were proposed to leverage such temporal structure. Neitz et al. (2018) and Jayaraman et al. (2019) propose models that find and predict the least uncertain “bottleneck” frames. Gregor et al. (2019) construct a representation that can be used to predict any number of frames into the future. In contrast, we propose an approach for hierarchical video representation that discovers the keyframes that best describe a certain sequence.
|
| 29 |
+
|
| 30 |
+
In parallel to our work, Kipf et al. (2019) propose a related method for video segmentation via generative modeling. Kipf et al. (2019) focus on using the discovered task boundaries for training hierarchical RL agents, while we show that our model can be used to perform efficient hierarchical planning by representing the sequence with only a small set of keyframes. Also concurrently, Kim et al. (2019) propose a similar method to KEYIN for learning temporal abstractions. While Kim et al. (2019) focuses on learning hierarchical state-space models, we propose a model that operates directly in the observation space and performs joint keyframing and inpainting.
|
| 31 |
+
|
| 32 |
+
Video modeling. Early approaches to probabilistic video modeling include autoregressive models that factorize the distribution by considering pixels sequentially (Kalchbrenner et al., 2017; Reed et al., 2017). To reason about the images in the video holistically, latent variable approaches were developed based on variational inference (Chung et al., 2015; Rezende et al., 2014; Kingma & Welling, 2014), including (Babaeizadeh et al., 2018; Denton & Fergus, 2018; Lee et al., 2018) and large-scale models such as (Castrejon et al., 2019; Villegas et al., 2019). Kumar et al. (2019) is a recently proposed approach that uses exact inference based on normalizing flows (Dinh et al., 2014; Rezende & Mohamed, 2015). We build on existing video modeling approaches and show how they can be used to learn temporal abstractions with a novel keyframe-based generative model.
|
| 33 |
+
|
| 34 |
+
Visual planning and model predictive control. We build on recent work that explored applications of learned visual predictive models to planning and control. Several groups (Oh et al., 2015; Finn et al., 2016; Chiappa et al., 2017) have proposed models that predict the consequences of actions taken by an agent given its control output. Recent work (Byravan et al., 2017; Hafner et al., 2018; Ebert et al., 2018) has shown that visual model predictive control based on such models can be applied to a variety of different settings. In this work, we show that the hierarchical representation of a sequence in terms of keyframes improves planning performance in the hierarchical planning setting.
|
| 35 |
+
|
| 36 |
+
# 3 KEYFRAMING THE FUTURE
|
| 37 |
+
|
| 38 |
+
Our goal is to develop a model that generates sequences by first predicting key observations and the time steps when they occur and then filling in the remaining observations in between. To achieve this goal, in the following we (i) define a probabilistic model for joint keyframing and inpainting, and (ii) show how a maximum likelihood objective leads to the discovery of keyframe structure.
|
| 39 |
+
|
| 40 |
+
# 3.1 A PROBABILISTIC MODEL FOR JOINT KEYFRAMING AND INPAINTING
|
| 41 |
+
|
| 42 |
+
We first describe a probabilistic model for joint keyframing and inpainting of a sequence $I _ { 1 : T }$ . The model consists of two parts: the keyframe predictor and the sequence inpainter (see Fig. 2).
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: A probabilistic model for jointly keyframing and inpainting a future sequence. First, a sequence of keyframes $K ^ { 1 : N }$ is generated, as well as corresponding temporal indices $\tau ^ { 1 : N }$ , defining the structure of the underlying sequence. In the second stage, for each pair of keyframes $K ^ { n }$ and $K ^ { n + 1 }$ , the frames $I _ { \tau ^ { n } : \tau ^ { n + 1 } - 1 }$ are inpainted.
|
| 46 |
+
|
| 47 |
+
The keyframe predictor takes in $C$ conditioning frames $I _ { c o }$ and produces $N$ keyframes $K ^ { 1 : N }$ as well as the corresponding time indices τ 1:N :
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
p ( K ^ { 1 : N } , \tau ^ { 1 : N } | I _ { c o } ) = \prod _ { n } p ( K ^ { n } , \tau ^ { n } | K ^ { 1 : n - 1 } , \tau ^ { 1 : n - 1 } , I _ { c o } ) .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
From each pair of keyframes, the sequence inpainter generates the sequence of frames in between:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
p ( I _ { \tau ^ { n } : \tau ^ { n + 1 } - 1 } | K ^ { n } , K ^ { n + 1 } , \tau ^ { n + 1 } - \tau ^ { n } ) = \prod _ { n } p ( I _ { t } | K ^ { n } , K ^ { n + 1 } , I _ { \tau ^ { n } : t - 1 } , \tau ^ { n + 1 } - \tau ^ { n } ) ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
which completes the generation of the full sequence. The inpainter additionally observes the number of frames it needs to generate $\tau ^ { n + 1 } - \tau ^ { n }$ . The temporal spacing of the most informative keyframes is data-dependent: shorter keyframe intervals might be required in cases of rapidly fluctuating motion, while longer intervals can be sufficient for steadier motion. Our model handles this by predicting the keyframe indices $\tau$ and inpainting $\tau ^ { n + 1 } - \tau ^ { n }$ frames between each pair of keyframes. We parametrize the prediction of $\tau ^ { n }$ in relative terms by predicting offsets $\delta ^ { n }$ : $\tau ^ { n } \stackrel { - } { = } \tau ^ { n - 1 } \stackrel { . } { + } \delta ^ { n }$ .
|
| 60 |
+
|
| 61 |
+
# 3.2 KEYFRAME DISCOVERY
|
| 62 |
+
|
| 63 |
+
To produce a complex multimodal distribution over $K$ we use a per-keyframe latent variable $z$ with prior distribution $p ( z )$ and approximate posterior $q ( z | I , I _ { c o } )$ .1 We construct a variational lower bound
|
| 64 |
+
|
| 65 |
+
on the likelihood of both $I$ and $K$ as follows2:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r l } & { \displaystyle \ln p ( I , K | I _ { c o } ) \geq \mathbb { E } _ { q ( z | I , I _ { c o } ) } \left[ \sum _ { n = 1 } ^ { N } \underbrace { \ln \mathbb { E } _ { p ( \tau ^ { n } , \tau ^ { n + 1 } | z ^ { 1 : n } , I _ { c o } ) } \left[ p ( I _ { \tau ^ { n } : \tau ^ { n + 1 } } | K ^ { n , n + 1 } , \tau ^ { n + 1 } - \tau ^ { n } ) \right] } _ { \mathrm { i n p a i n i t i g } } \right. } \\ & { \quad \quad \quad \left. + \underbrace { \ln p ( K | z , I _ { c o } ) } _ { \mathrm { k e y f r a m i n g } } \right] - \underbrace { D _ { \mathrm { K L } } \left( q ( z | I , I _ { c o } ) | | p ( z ) \right) } _ { \mathrm { r e g u l a r i z a t i o n } } . } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
In practice, we use a weight $\beta$ on the KL-divergence term, as is common in amortized variational inference (Higgins et al., 2017; Alemi et al., 2018; Denton & Fergus, 2018).
|
| 72 |
+
|
| 73 |
+
If a simple model is used for inpainting, most of the representational power of the model has to come from the keyframe predictor. We use a relatively powerful latent variable model for the keyframe predictor and a simpler Gaussian distribution produced with a neural network for inpainting. Because of this structure, the keyframe predictor has to predict keyframes that describe the underlying sequence well enough to allow a simpler inpainting process to maximize the likelihood. We will show that pairing a more flexible keyframe predictor with a simpler inpainter allows our model to discover semantically meaningful keyframes in video data.
|
| 74 |
+
|
| 75 |
+
# 4 CONTINUOUS RELAXATION BY LINEAR INTERPOLATION IN TIME
|
| 76 |
+
|
| 77 |
+
Our model can dynamically predict the keyframe placement $\tau ^ { n }$ . However, learning a distribution over the discrete variable $\tau ^ { n }$ is challenging due to the expensive evaluation of the expectation over $p ( \tau ^ { n } | z ^ { 1 : n } , I _ { c o } )$ in the objective in Eq. 3. To be able to evaluate this term efficiently and in a differentiable manner while still learning the keyframe placement, we propose a continuous relaxation of the objective. The placement distribution $\cdot$ defines a probability for each predicted frame to match to a certain frame in the ground truth sequence. Instead of sampling from this distribution to pick a target frame we produce a soft target for each predicted frame by computing the expected target frame, i.e. the weighted sum of all frames in the true sequence, each multiplied with the probability of matching to the predicted frame. When the
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 3: Soft keyframe loss in the relaxed formulation. For each predicted keyframe ${ \hat { K } } ^ { n }$ we compute a target image ${ \tilde { K } } ^ { n }$ as the sum of the ground truth images weighted with the corresponding distribution over index $\tau ^ { n }$ . Finally, we compute the reconstruction loss between the estimated image ${ \hat { K } } ^ { n }$ and the soft target ${ \tilde { K } } ^ { n }$ .
|
| 81 |
+
|
| 82 |
+
entropy of $\tau ^ { n }$ converges to zero, the continuous relaxation objective is equivalent to the original, discrete objective. 3
|
| 83 |
+
|
| 84 |
+
Keyframe targets. To produce a keyframe target, ${ \tilde { K } } ^ { n }$ , we linearly interpolate between the ground truth images according to the predicted distribution over the keyframe’s temporal placement $\tau ^ { n }$ : $\begin{array} { r } { \tilde { K } ^ { n } = et { } { ' } \sum _ { t } \tau _ { t } ^ { n } I _ { t } } \end{array}$ , where $\tau _ { t } ^ { n }$ is the probability that the $n ^ { t h }$ keyframe occurs at timestep $t$ . This process is depicted in Fig. 3.
|
| 85 |
+
|
| 86 |
+
We parametrize temporal placement prediction in terms of offsets $\delta$ with a maximum offset of $J$ Because of this, the maximum possible length of the predicted sequence is $N J$ . It is desirable for $J$ to be large enough to be able to capture the distribution of keyframes in the data, but this may lead to the generation of sequences longer than the target $N J > T$ . To correctly compute the value of the relaxed objective in this case, we discard predicted frames at times $> T$ and normalize the placement probability output by the network so that it sums to one over the first $T$ steps. Specifically, for each keyframe we compute this probability as $c ^ { n }$ : $\begin{array} { r } { c ^ { n } = \sum _ { t \leq T } \tau _ { t } ^ { n } } \end{array}$ . The loss corresponding to the last two terms of Eq. (3) then becomes:
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 4: Sequences generated by KEYIN and a method with constant temporal keyframe offset (Jumpy) on Brownian Motion data. Generation is conditioned on the first five frames. The first half of the sequence is shown. Movement direction changes are marked red in the ground truth sequence and predicted keyframes are marked blue. We see that KEYIN can correctly reconstruct the motion as it selects an informative set of keyframes. The sequence generated by the Jumpy method does not reproduce the direction changes since they cannot be inferred from the selected keyframes.
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathcal { L } _ { k e y } = \frac { \sum _ { n } c ^ { n } \left( | | \hat { K } ^ { n } - \tilde { K } ^ { n } | | ^ { 2 } + \beta D _ { \mathrm { K L } } \left( q ( z ^ { n } | I _ { - C + 1 : T } , z ^ { 1 : n - 1 } ) | | p ( z ^ { n } ) \right) \right) } { \sum _ { n } c ^ { n } } .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
Inpainting targets. To complete our relaxed objective, for each ground truth frame, we produce a target image composed from the inpainted frames.4 We note that as offsets $\delta$ have a maximum range of $\cdot$ , and in general have non-zero probability on each timestep, the inpainting network needs to produce $J$ frames $\cdot$ between each pair of keyframes $\cdot$ . As in the previous section, the targets for ground truth images are given as an interpolation between generated images weighted by the probability of the predicted frame $\hat { I } _ { j } ^ { n }$ being matched to ground truth frame $I _ { t }$ : $\begin{array} { r } { \tilde { I } _ { t } \ = \ ( \sum _ { n , j } m _ { j , t } ^ { n } \hat { I } _ { j } ^ { n } ) / \sum _ { n , j } m _ { j , t } ^ { n } } \end{array}$ . Here, $m _ { j , t } ^ { n }$ is the probability that the $j$ -th predicted image in segment $n$ has an offset of $t$ from the beginning of the predicted sequence, which can be computed from $\tau ^ { n }$ . To obtain a probability distribution over produced frames, we normalize the result with $\textstyle \sum _ { n , j } m _ { j , t } ^ { n }$ . The full loss for our model is:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\mathcal { L } _ { t o t a l } = \mathcal { L } _ { k e y } + \beta _ { I } \sum _ { t } | | I _ { t } - \tilde { I } _ { t } | | ^ { 2 } .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
# 5 DEEP VIDEO KEYFRAMING
|
| 102 |
+
|
| 103 |
+
We show how to instantiate KEYIN with deep neural networks and train it on high-dimensional observations, such as images. We further describe an effective training procedure for KEYIN.
|
| 104 |
+
|
| 105 |
+
# 5.1 ARCHITECTURE
|
| 106 |
+
|
| 107 |
+
We use a common encoder-recurrent-decoder architecture (Denton & Fergus (2018); Hafner et al. (2018)). Video frames are first processed with a convolutional encoder module to produce image embeddings $\iota _ { t } = \mathbf { C } \mathbf { N } \mathbf { N } _ { e n c } ( I _ { t } )$ . Inferred frame embeddings $\hat { \iota }$ are decoded with a convolutional decoder $\hat { I } _ { j } ^ { n } = \mathbf { C } \mathbf { N } \mathbf { N } _ { d e c } ( \hat { \iota } _ { j } ^ { n } )$ . The keyframe predictor $p ( K ^ { 1 : N } , \tau ^ { 1 : N } | z ^ { 1 : N } , I _ { c o } )$ is parametrized with a Long Short-Term Memory network (LSTM, Hochreiter & Schmidhuber (1997)). To condition the keyframe predictor on past frames, we initialize its state with the final state of another LSTM that processes the conditioning frames. Similarly, we parametrize the sequence inpainter $p ( I _ { \tau ^ { n } : \tau ^ { n + 1 } } | \dot { K } ^ { n } , K ^ { n + 1 } , \tau ^ { n + 1 } - \tau ^ { n } )$ with an LSTM. We condition the inpainting on both keyframe embeddings, $\hat { \kappa } ^ { n - 1 }$ and $\hat { \kappa } ^ { n }$ , as well as the temporal offset between the two, $\delta ^ { n }$ , by passing these inputs through a multi-layer perceptron that produces the initial state of the inpainting LSTM.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 5: Example generations by KEYIN on (top) Pushing and (bottom) Gridworld data. The generation is conditioned on a single ground truth frame. Twelve of the 30 predicted frames are shown. We observe that for each transition between pushes and each action of the Gridworld agent our network predicts a keyframe either exactly at the timestep of the event or one timestep apart. Note, although agent position is randomized, objects not visible in the first image can be predicted in Gridworld because the maze is fixed across episodes.
|
| 111 |
+
|
| 112 |
+
We use a Gaussian distribution with identity variance as the output distribution for both the keyframe predictor and the inpainting model and a multinomial distribution for $\delta ^ { n }$ . We parametrize the inference $q ( z ^ { 1 : N } | I _ { - C + 1 : T } )$ with an LSTM with attention over the entire input sequence. The inference distribution is a diagonal covariance Gaussian, and the prior $p ( z ^ { 1 : N } )$ is a unit Gaussian. Further details of the inference procedure are given in Sec. B and Fig. 8 of the Appendix.
|
| 113 |
+
|
| 114 |
+
# 5.2 TRAINING PROCEDURE
|
| 115 |
+
|
| 116 |
+
We train our model in two stages. First, we train the sequence inpainter to inpaint between ground truth frames sampled with random offsets, thus learning interpolation strategies for a variety of different inputs. In the second stage, we train the keyframe predictor using the loss from Eq. 5 by feeding the predicted keyframe embeddings to the inpainter. In this stage, the weights of the inpainter are frozen and are only used to backpropagate errors to the rest of the model. We found that this simple two-stage procedure improves optimization of the model.
|
| 117 |
+
|
| 118 |
+
We use L1 reconstruction losses to train the keyframe predictor. We found that this and adding a reconstruction loss on the predicted embeddings of the keyframes, weighted with a factor $\beta _ { \kappa }$ , improved the ability of the model to produce informative keyframes. Target embeddings are computed using the same soft relaxation used for the target keyframes. More details of the loss computation are given in Sec. E and Algorithm 1 of the Appendix.
|
| 119 |
+
|
| 120 |
+
# 6 EXPERIMENTS
|
| 121 |
+
|
| 122 |
+
We evaluate the quality of KEYIN’s representation for future sequences by addressing the following questions: (i) Can it discover and predict informative keyframes? (ii) Can it model complex data distributions? (iii) Is the discovered hierarchy useful for long-horizon hierarchical planning?
|
| 123 |
+
|
| 124 |
+
Datasets. We evaluate our model on three datasets containing structured long-term behavior. The Structured Brownian motion (SBM) dataset consists of binary image sequences of size $3 2 \times 3 2$ pixels in which a ball randomly changes directions after periods of straight movement of six to eight frames.
|
| 125 |
+
|
| 126 |
+
The Gridworld Dataset consists of $2 0 \mathrm { k }$ sequences of an agent traversing a maze with different objects. The agent sequentially navigates to objects and interacts with them following a task sketch.We use the same maze for all episodes and randomize the initial position of the agent and the task sketch. We use $6 4 \times 6 4$ pixel image observations and further increase visual complexity by constraining the field of view to a $5 \times 5$ -cells egocentric window.
|
| 127 |
+
|
| 128 |
+
The Pushing Dataset consists of $5 0 \mathrm { k }$ sequences of a robot arm pushing a puck towards a goal on the opposite side of a wall. Each sequence consists of six consecutive pushes. We vary start and target position of the puck, as well as the placement of the wall. The demonstrations were generated with the MuJoCo simulator (Todorov et al., 2012) at a resolution of $6 4 \times 6 4$ pixels. For more details on the data generation process, see Sec.D of the Appendix.
|
| 129 |
+
|
| 130 |
+
Further details about the experimental setup are given in Sec. C of the Appendix.
|
| 131 |
+
|
| 132 |
+
# 6.1 KEYFRAME DISCOVERY
|
| 133 |
+
|
| 134 |
+
To evaluate KEYIN’s ability to discover keyframes, we train KEYIN on all three datasets with $N = 6$ , which can be interpreted as selecting the $N$ most informative frames from a sequence. We show qualitative examples of keyframe discovery for the SBM dataset in Fig. 4 and for the Gridworld and Pushing datasets in Fig. 5.
|
| 135 |
+
|
| 136 |
+
Table 1: F1 accuracy score for keyframe discovery on all three datasets. Higher is better.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>METHOD</td><td>BROWNIAN</td><td>PUSH</td><td>GRIDWORLD</td></tr><tr><td>RANDOM</td><td>0.15</td><td>0.18</td><td>0.12</td></tr><tr><td>STATIC</td><td>0.21</td><td>0.18</td><td>0.25</td></tr><tr><td>SURPRISE</td><td>0.73</td><td>0.10</td><td>0.32</td></tr><tr><td>KEYIN (OURS)</td><td>0.94</td><td>0.43</td><td>0.42</td></tr></table>
|
| 139 |
+
|
| 140 |
+
On all datasets the model discovers meaningful keyframes which mark direction changes of the ball, transitions between pushes or interactions with objects, adapting its keyframe prediction patterns to the data. Consequently, the inpainter network is able to produce frames of high visual quality. Misplaced keyframes yield blurry interpolations, as can be seen for the jumpy prediction in Fig. 4. This suggests that keyframes found by KEYIN describe the overall sequences better.
|
| 141 |
+
|
| 142 |
+
To show that KEYIN discovers informative keyframes, we compare keyframe predictions against an alternative approach that measures the surprise associated with observing a frame given the previous frames. This approach selects keyframes as the $N$ frames with the largest peaks in “surprise” as measured by the KL-divergence $\mathsf { \bar { D } } _ { \mathrm { K L } } [ q ( z _ { t } | I _ { 1 : t } ) | | p ( z _ { t } ) ]$ between the prior and the posterior of a stochastic predictor based on Denton & Fergus (2018) (see Sec. F and Algorithm 2 of the Appendix for details). We provide comparisons to alternative formulations of surprise in Appendix Sec. F, Tab. 3.
|
| 143 |
+
|
| 144 |
+
For quantitative analysis, we define approximate ground truth keyframes to be the points of direction change for the SBM dataset, the moments when the robot lifts its arm to transitions between pushes, or when the agent interacts with objects in the gridworld. We report F1 scores that capture both the precision and recall of keyframe discovery.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 6: Distribution of trajectories sampled from KEYIN. Each black line denotes one of 100 trajectories of the manipulated object. The obstacle is shown in blue and the initial position in pink. We see that our model covers both modes of the distribution, producing both trajectories that go to the right and to the left of the obstacle.
|
| 148 |
+
|
| 149 |
+
We additionally compare to random keyframe placement, and a learned but static baseline that is the same for all sequences. The evaluation in Tab. 1 shows that KEYIN discovers better keyframes than alternative methods. The difference is especially large on the more complex Pushing and Gridworld datasets. The surprise-based method does not reason about which frames are most helpful to reconstruct the entire trajectory and thus is unable to discover the correct structure on the more complex datasets. In addition to the F1 scores, we report temporal distance between predicted and annotated keyframes in Appendix, Tab. 4, also indicating that KEYIN is better able to discover the temporal structure in both datasets.
|
| 150 |
+
|
| 151 |
+
# 6.2 KEYFRAME-BASED VIDEO MODELING
|
| 152 |
+
|
| 153 |
+
Even though the focus of this work is on discovering temporal structure via keyframing and not on improving video prediction quality, we verify that KEYIN can represent complex data distributions in terms of discovered keyframes and attains high diversity and visual quality. We show sample generations from our model on the Pushing and Gridworld datasets on the supplementary website5.
|
| 154 |
+
|
| 155 |
+
We see that KeyIn is able to faithfully model complex distributions of video sequences. We further visualize multiple sampled Pushing sequences from our model conditioned on the same start position in Fig. 6, showing that KEYIN is able to cover both modes of the demonstration distribution. We further show that KEYIN compares favorably to prior work on video prediction metrics on sequence modeling in Tab. 5 of the Appendix, and outperforms prior approaches in terms of keyframe modeling in Appendix, Tab. 6.
|
| 156 |
+
|
| 157 |
+
# 6.3 ROBUSTNESS OF KEYFRAME DETECTION
|
| 158 |
+
|
| 159 |
+
In the previous sections, we showed that when the sequence can indeed be summarized with $N$ keyframes, KEYIN predicts the keyframes that correspond to our notion of salient frames. However, what happens if we train KEYIN to select a larger or a smaller amount of keyframes?
|
| 160 |
+
|
| 161 |
+
To evaluate this, we measure KEYIN recall with extra and precision with fewer available keyframes. We note that high precision is unachievable in the first case and high recall is unachievable in the second case, since these problems are misspecified. As these numbers are not
|
| 162 |
+
|
| 163 |
+
Table 2: Keyframe discovery for varied number of predicted keyframes. The data has approximately 6 keyframes. Uninterpretable entries are omitted for clarity: see the text for details.
|
| 164 |
+
|
| 165 |
+
<table><tr><td colspan="2"># KEYFRAMES</td><td>4</td><td>6</td><td>8</td></tr><tr><td>BROWNIAN</td><td>PRECISION RECALL</td><td>0.92 -</td><td>0.92 0.96</td><td>- 0.90</td></tr><tr><td>PUSH</td><td>PRECISION RECALL</td><td>0.30</td><td>0.38</td><td>-</td></tr><tr><td rowspan="2">GRIDWORLD</td><td>PRECISION</td><td>1 0.37</td><td>0.48 0.43</td><td>0.46 -</td></tr><tr><td>RECALL</td><td>1</td><td>0.41</td><td>0.40</td></tr></table>
|
| 166 |
+
|
| 167 |
+
informative, we do not report them. In Tab. 2, we see that KEYIN is able to find informative keyframes even when $N$ does not exactly match the structure of the data. We further qualitatively show that KEYIN selects a superset or a subset of the original keyframes respectively in Sec. G. This underlines that our method’s ability to discover keyframe structure is robust to the choice of the number of predicted keyframes.
|
| 168 |
+
|
| 169 |
+
As a first step towards analyzing the robustness of KEYIN under more realistic conditions we report keyframe discovery when trained and tested on sequences with additive Gaussian noise, a noise characteristic commonly found in real-world camera sensors. We find that KEYIN is still able to discover the temporal structure on both the Pushing and the Gridworld dataset. For qualitative and quantitative results, see Appendix Fig. 11 and Tab. 7.
|
| 170 |
+
|
| 171 |
+
# 6.4 HIERARCHICAL KEYFRAME-BASED PLANNING
|
| 172 |
+
|
| 173 |
+
We have seen that KEYIN can find frames that correspond to an intuitive notion of keyframes. This demonstrates that the keyframes discovered by KEYIN do indeed capture an abstraction that compactly describes the sequence. In light of this, we hypothesize that an informative set of keyframes contains sufficient information about a sequence to effectively follow the trajectory it shows. To test this, we use the inferred keyframes as subgoals for hierarchical planning in the pushing environment. During task execution, we first plan a sequence of keyframes that reaches the target using our learned keyframe predictor. Specifically, we generate keyframe trajectories from our model by sampling latent variables $z$ from the prior and using them to roll out the keyframe prediction model. We optimize for a sequence of latent variables $z$ that results in a keyframe trajectory which reaches the goal using the Cross-Entropy Method (CEM, Rubinstein & Kroese (2004)). We then execute the plan by using the keyframes as subgoals for a low-level planner. This planner reaches each subgoal via model predictive control using ground truth dynamics, again employing CEM for optimization of the action trajectory. This planning procedure is illustrated in Fig. 7 (left). For more details, see Sec. I and Algs. 3 and 4 of the Appendix.
|
| 174 |
+
|
| 175 |
+
We find that KEYIN is able to plan coherent subgoal paths towards the final goal that often lead to successful task execution (executions are shown on the supplementary website6). To quantitatively evaluate the keyframes discovered, we compare to alternative subgoal selection schemes: fixed time offset (Jumpy, similar to Buesing et al. (2018)), a method that determines points of peak surprise (Surprise, see Sec. 6.1), and a bottleneck-based subgoal predictor (time-agnostic prediction or TAP, Jayaraman et al. (2019)). We additionally compare to an approach that plans directly towards the final goal using the low-level planner (Flat). We evaluate all methods with the shortest path between the target and the actual position of the object after the plan is executed. All compared methods use the same low-level planner as we only want to measure the quality of the predicted subgoals.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 7: Hierarchical planning on the Pushing dataset. Left: We use the model to produce keyframes that represent the sequence between the current observation image and the goal. A low-level planner based on model predictive control produces the actions, $a _ { t }$ , executed to reach each keyframe, until the final goal is reached. Right: Planning performance on a Pushing task. The hierarchy discovered by KEYIN outperforms comparable planning approaches.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>METHOD</td><td>POSITION ERROR</td><td>SUCCESS RATE</td></tr><tr><td>INTITIAL</td><td>1.32 ± 0.06</td><td></td></tr><tr><td>RANDOM</td><td>1.32 ± 0.07</td><td>-</td></tr><tr><td>FLAT</td><td>0.90 ±0.14</td><td>15.0%</td></tr><tr><td>TAP</td><td>0.80 ±0.16</td><td>23.3%</td></tr><tr><td>SURPRISE</td><td>0.64±0.28</td><td>50.8%</td></tr><tr><td>JUMPY</td><td>0.62 ±0.33</td><td>58.8%</td></tr><tr><td>KEYIN (OURS)</td><td>0.50 ±0.26</td><td>64.2%</td></tr></table>
|
| 181 |
+
|
| 182 |
+
As shown in Fig. 7 (right), our method outperforms all prior approaches. TAP shows only a moderate increase in performance over the Flat planner, which we attribute to the fact that it fails to predict good subgoals and often simply predicts the final image as the bottleneck. This is likely due to the relatively large stochasticity of our dataset and the absence of the clear bottlenecks that TAP is designed to find. Our method outperforms the planners that use Jumpy and Surprise subgoals. This further confirms that KEYIN is able to produce keyframes that are informative about the underlying trajectory, such that planning toward these keyframes makes it easier to follow the trajectory.
|
| 183 |
+
|
| 184 |
+
# 7 DISCUSSION
|
| 185 |
+
|
| 186 |
+
We presented KEYIN, a method for representing a sequence by its informative keyframes by jointly keyframing and inpainting. KEYIN first generates the keyframes of a sequence and their temporal placement and then produces the full sequence by inpainting between keyframes. We showed that KEYIN discovers informative keyframes on several datasets with stochastic dynamics. Furthermore, by using the keyframes for planning, we showed our method outperforms several other hierarchical planning schemes. Our method opens several avenues for future work. First, an improved training procedure that allows end-to-end training is desirable. Second, more powerful hierarchical planning approaches can be designed using the keyframe representation to scale to long-term real-world tasks. Finally, the proposed keyframing method can be applied to a variety of applications, including video summarization, video understanding, and multi-stage hierarchical video prediction.
|
| 187 |
+
|
| 188 |
+
# REFERENCES
|
| 189 |
+
|
| 190 |
+
Alexander Alemi, Ben Poole, Ian Fischer, Joshua Dillon, Rif A. Saurous, and Kevin Murphy. Fixing a broken ELBO. In Proceedings of International Conference on Machine Learning (ICML), 2018.
|
| 191 |
+
|
| 192 |
+
Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H. Campbell, and Sergey Levine. Stochastic variational video prediction. In Proceedings of International Conference on Learning Representations (ICLR), 2018.
|
| 193 |
+
|
| 194 |
+
D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. Proceedings of International Conference on Learning Representations (ICLR), 2015.
|
| 195 |
+
|
| 196 |
+
Lars Buesing, Theophane Weber, Sébastien Racanière, S. M. Ali Eslami, Danilo Jimenez Rezende, David P. Reichert, Fabio Viola, Frederic Besse, Karol Gregor, Demis Hassabis, and Daan Wierstra. Learning and querying fast generative models for reinforcement learning. arXiv:1802.03006, 2018.
|
| 197 |
+
|
| 198 |
+
Arunkumar Byravan, Felix Leeb, Franziska Meier, and Dieter Fox. Se3-pose-nets: Structured deep dynamics models for visuomotor planning and control. Proceedings of IEEE International Conference on Robotics and Automation, 2017.
|
| 199 |
+
|
| 200 |
+
Lluis Castrejon, Nicolas Ballas, and Aaron Courville. Improved conditional vrnns for video prediction. arXiv preprint arXiv:1904.12165, 2019.
|
| 201 |
+
|
| 202 |
+
Silvia Chiappa, Sébastien Racanière, Daan Wierstra, and Shakir Mohamed. Recurrent environment simulators. In Proceedings of International Conference on Learning Representations (ICLR), 2017.
|
| 203 |
+
|
| 204 |
+
Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In Proceedings of Neural Information Processing Systems (NeurIPS), 2015.
|
| 205 |
+
|
| 206 |
+
Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. 2016.
|
| 207 |
+
|
| 208 |
+
E. Denton and R. Fergus. Stochastic video generation with a learned prior. In Proceedings of International Conference on Machine Learning (ICML), 2018.
|
| 209 |
+
|
| 210 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 211 |
+
|
| 212 |
+
Frederik Ebert, Chelsea Finn, Alex X Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. In Conference on Robotic Learning (CoRL), 2017.
|
| 213 |
+
|
| 214 |
+
Frederik Ebert, Chelsea Finn, Sudeep Dasari, Annie Xie, Alex Lee, and Sergey Levine. Visual foresight: Model-based deep reinforcement learning for vision-based robotic control. arXiv:1812.00568, 2018.
|
| 215 |
+
|
| 216 |
+
Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In Proceedings of IEEE International Conference on Robotics and Automation, 2017.
|
| 217 |
+
|
| 218 |
+
Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Proceedings of Neural Information Processing Systems (NeurIPS), 2016.
|
| 219 |
+
|
| 220 |
+
D. Le Gall. MPEG: A video compression standard for multimedia applications. Commun. ACM, 34 (4):46–58, 1991.
|
| 221 |
+
|
| 222 |
+
Karol Gregor, George Papamakarios, Frederic Besse, Lars Buesing, and Theophane Weber. Temporal difference variational auto-encoder. 2019.
|
| 223 |
+
|
| 224 |
+
Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. arXiv preprint arXiv:1811.04551, 2018.
|
| 225 |
+
|
| 226 |
+
Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-VAE: Learning basic visual concepts with a constrained variational framework. In Proceedings of International Conference on Learning Representations (ICLR), 2017.
|
| 227 |
+
|
| 228 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 229 |
+
|
| 230 |
+
D. Jayaraman, F. Ebert, A. A. Efros, and S. Levine. Time-agnostic prediction: Predicting predictable video frames. Proceedings of International Conference on Learning Representations (ICLR), 2019.
|
| 231 |
+
|
| 232 |
+
Akos Kádár, Marc-Alexandre Côté, Grzegorz Chrupała, and Afra Alishahi. Revisiting the hierarchical multiscale lstm. arXiv preprint arXiv:1807.03595, 2018.
|
| 233 |
+
|
| 234 |
+
Nal Kalchbrenner, Aäron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1771–1779. JMLR. org, 2017.
|
| 235 |
+
|
| 236 |
+
Taesup Kim, Sungjin Ahn, and Yoshua Bengio. Variational temporal abstraction. In Proceedings of Neural Information Processing Systems (NeurIPS), 2019.
|
| 237 |
+
|
| 238 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of International Conference on Learning Representations (ICLR), 2015.
|
| 239 |
+
|
| 240 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In Proceedings of International Conference on Learning Representations (ICLR), 2014.
|
| 241 |
+
|
| 242 |
+
Thomas Kipf, Yujia Li, Hanjun Dai, Vinicius Zambaldi, Edward Grefenstette, Pushmeet Kohli, and Peter Battaglia. Compositional imitation learning: Explaining and executing one task at a time. Proceedings of International Conference on Machine Learning (ICML), 2019.
|
| 243 |
+
|
| 244 |
+
Manoj Kumar, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, and Durk Kingma. Videoflow: A flow-based generative model for video. arXiv preprint arXiv:1903.01434, 2019.
|
| 245 |
+
|
| 246 |
+
A. X. Lee, R. Zhang, F. Ebert, P. Abbeel, C. Finn, and S. Levine. Stochastic adversarial video prediction. arXiv:1804.01523, abs/1804.01523, 2018.
|
| 247 |
+
|
| 248 |
+
Pengfei Liu, Xipeng Qiu, Xinchi Chen, Shiyu Wu, and Xuanjing Huang. Multi-timescale long short-term memory neural network for modelling sentences and documents. In Proceedings of the 2015 conference on empirical methods in natural language processing, pp. 2326–2335, 2015.
|
| 249 |
+
|
| 250 |
+
Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attention-based neural machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1412–1421, 2015.
|
| 251 |
+
|
| 252 |
+
Alexander Neitz, Giambattista Parascandolo, Stefan Bauer, and Bernhard Schölkopf. Adaptive skip intervals: Temporal abstraction for recurrent dynamical models. In Proceedings of Neural Information Processing Systems (NeurIPS), 2018.
|
| 253 |
+
|
| 254 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Proceedings of Neural Information Processing Systems (NeurIPS), 2015.
|
| 255 |
+
|
| 256 |
+
Scott Reed, Aäron van den Oord, Nal Kalchbrenner, Sergio Gómez Colmenarejo, Ziyu Wang, Yutian Chen, Dan Belov, and Nando de Freitas. Parallel multiscale autoregressive density estimation. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2912–2921. JMLR. org, 2017.
|
| 257 |
+
|
| 258 |
+
Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In Proceedings of International Conference on Machine Learning (ICML), 2015.
|
| 259 |
+
|
| 260 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of International Conference on Machine Learning (ICML), 2014.
|
| 261 |
+
|
| 262 |
+
Reuven Y. Rubinstein and Dirk P. Kroese. The Cross-Entropy Method: A Unified Approach to Combinatorial Optimization, Monte-Carlo Simulation and Machine Learning. Springer-Verlag New York, 2004.
|
| 263 |
+
|
| 264 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Proceedings of IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
|
| 265 |
+
|
| 266 |
+
Ruben Villegas, Arkanath Pathak, Harini Kannan, Dumitru Erhan, Quoc V. Le, and Honglak Lee. High fidelity video prediction with large neural nets. In Proceedings of Neural Information Processing Systems (NeurIPS), 2019.
|
| 267 |
+
|
| 268 |
+
Chao-Yuan Wu, Nayan Singhal, and Philipp Krahenbuhl. Video compression through image interpolation. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 416–431, 2018.
|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
Figure 8: Structure of the keyframe inference network. This diagram depicts the procedure to infer the embedding of the $n$ -th keyframe, $\kappa ^ { n }$ , given the previously inferred keyframe embedding $\kappa ^ { n - 1 }$ and the future images. The initial state of $\mathrm { L S T M _ { \mathrm { k e y } } }$ is produced by $\mathrm { L S T M _ { \mathrm { c o n d } } }$ (not shown), which takes the embedding of past images as input. This ensures that the See the text for more details.
|
| 272 |
+
|
| 273 |
+
A VIDEOS
|
| 274 |
+
|
| 275 |
+
We include video results on the supplementary website at https://sites.google.com/ view/keyin. The website includes inference samples, prior samples, and exectued trajectories for all methods.
|
| 276 |
+
|
| 277 |
+
# B ARCHITECTURE DETAILS
|
| 278 |
+
|
| 279 |
+
We found simple attention over LSTM outputs to be an effective inference procedure. Our approximate inference network $\mathrm { L S T M } _ { i n f }$ outputs $( \kappa _ { t } ^ { i n f } , \zeta _ { t } ) _ { t \leq T }$ , where $\kappa ^ { i n f }$ is an embedding used to compute an attention weight and the $\zeta _ { t }$ are values to be attended over. We compute the posterior distribution over $z ^ { t }$ using a key-value attention mechanism (Bahdanau et al., 2015; Luong et al., 2015):
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
\begin{array} { c } { \displaystyle { a _ { n , t } = \exp ( d ( \hat { \kappa } ^ { n - 1 } , \kappa _ { t } ^ { i n f } ) ) } } \\ { \displaystyle { \mu ^ { n } , \sigma ^ { n } = ( \sum _ { t } a _ { n , t } \zeta _ { t } ) / \sum _ { t } a _ { n , t } . } } \end{array}
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
The distance metric, $d$ , is the standard inner product. The architecture used for keyframe inference, including the attention mechanism, is depicted in Supplemental Fig. 8.
|
| 286 |
+
|
| 287 |
+
# C EXPERIMENTAL SETUP
|
| 288 |
+
|
| 289 |
+
We set the prediction horizon to $T = 3 0$ frames and predict $N = 6$ segments with $J = 1 0$ frames each for the SBM dataset and 6 frames each for the Pushing dataset. We pre-train the interpolator on segments of two to eight frames for Structured Brownian motion data, and two to six frames for Pushing data. The weight on the KL-divergence term for the interpolator VAE is 1e−3. For training the keyframe predictor, we set $\beta _ { K } = 0$ , $\beta _ { \kappa } = 1 , \beta = 5 \mathrm { e } { - 2 }$ . The hyperparameters were hand-tuned. We activate the generated images with a sigmoid and use BCE losses on each color channel to avoid saturation. The convolutional encoder and decoder both have three layers for the Structured Brownian motion dataset and four layers for the Pushing dataset. We use a simple two-layer LSTM with a 256-dimensional state in each layer for all recurrent modules. Each LSTM has a linear projection layer before and after it that projects the observations to and from the correct dimensions. We use the Adam optimizer (Kingma & Ba, 2015) with $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ , batch size of 30, and a learning rate of 2e−4. For more details please refer to the appendix. Each network was trained on a single high-end NVIDIA GPU. We trained the interpolator for 100K iterations, and the keyframe predictor for 200K iterations. The toal training time took about a day.
|
| 290 |
+
|
| 291 |
+
In the Pushing environment, we use a held-out test set of 120 of sequences. The Structured Brownian Motion dataset is generated automatically and is potentially infinite. We used 1000 testing samples on the Structured Brownian Motion generated using a different random seed.
|
| 292 |
+
|
| 293 |
+
# D DATA COLLECTION IN THE MUJOCO ENVIRONMENT
|
| 294 |
+
|
| 295 |
+
The data collection for our pushing dataset was performed in an environment simulated in MuJoCo Todorov et al. (2012). In the environment, a robot arm initialized at the center of the table pushes an object to a goal position located at the other side of a wall-shaped obstacle.
|
| 296 |
+
|
| 297 |
+
The demonstrations followed a rule-based algorithm that first samples subgoals between the initial position of the object and the goal and then runs a deterministic pushing procedure to the subgoals in order. The ground truth keyframes of the demonstrations were defined by frames at which subgoals were completed.
|
| 298 |
+
|
| 299 |
+
We subsampled demonstration videos by a factor of two when saving them to the dataset, dropping every other frame in the trajectory and averaging actions of every two consecutive frames. For all datasets we generated for this environment following a rule-based algorithm, we only kept successful demonstrations and dropped the ones that fail to push the object to the goal position within a predefined horizon.
|
| 300 |
+
|
| 301 |
+
# E DETAILS OF THE LOSS COMPUTATION ALGORITHM
|
| 302 |
+
|
| 303 |
+
We describe the details of the continuous relaxation loss computation in Algorithm 1.
|
| 304 |
+
|
| 305 |
+
Note that we efficiently implement computing of the cumulative distributions $\tau$ as a convolution, which allows us to vectorize much of the computation. Computational complexity of the proposed implementation scales linearly with the number of keyframes $N$ , and number of allowed frames per segment $J$ and number of ground truth frames $T$ . The final complexity is $\mathcal { O } ( N T J )$ , which we find in practice to be negligible compared to the time needed for the forward and backward pass.
|
| 306 |
+
|
| 307 |
+
# F SURPRISE BASELINE
|
| 308 |
+
|
| 309 |
+
Standard stochastic video prediction methods do not attempt to estimate keyframes, as they are designed to densely estimate future videos frame-by-frame. Accordingly, they cannot be used directly as baselines for keyframe prediction methods, such as KEYIN. However, Denton & Fergus (2018) observe that the variance of the learned prior of a stochastic video prediction model tends to spike before an uncertain event happens. We exploit this observation to find the points of high uncertainty for our strong Surprise baseline. We use the KL divergence between the prior and the approximate posterior $\mathrm { K L } [ q ( \boldsymbol { z } _ { t } | I _ { 1 : t } ) | | p ( \boldsymbol { z } _ { t } ) ]$ to measure the surprise. This quantity can be interpreted as the number of bits needed to encode the latent variable describing the next state, it will be larger if the next state is more stochastic.
|
| 310 |
+
|
| 311 |
+
We train a stochastic video prediction network with a fixed prior (SVG-FP, Denton & Fergus (2018)) with the same architectures of encoder, decoder, and LSTM as our model. We found that selecting the peaks of suprise works the best for finding true keyframes. The procedure we use to select the keyframes is described in Algorithm 2. In order to find the keyframes in a sequence sampled from the prior, we run the inference network on the generated sequence.
|
| 312 |
+
|
| 313 |
+
Algorithm 1 Continuous relaxation loss computation
|
| 314 |
+
|
| 315 |
+
Parameters: Number of ground truth frames $T$ , Number of keyframes $N$
|
| 316 |
+
|
| 317 |
+
Input: Ground truth frames $I _ { 1 : T }$ , Generated frames $\hat { I } _ { i } ^ { t }$ , generated offset distributions $\delta ^ { n }$ Convert the distributions of interframe offsets $\delta ^ { n }$ to keyframe timesteps $\tau ^ { n }$ . For the first keyframe, $\tau ^ { 1 } = \delta ^ { 1 }$ .
|
| 318 |
+
|
| 319 |
+
for $t = 2 \dots M$ do
|
| 320 |
+
|
| 321 |
+
Compute further $\tau ^ { n }$ with chain rule. This can be efficiently computed via convolution:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\tau ^ { n } = \tau ^ { n - 1 } * \delta ^ { n } , \mathrm { i . e . } \tau _ { t } ^ { n } = \sum _ { j } \tau _ { n - j + 1 } ^ { n - 1 } \delta _ { j } ^ { n } .
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
# end for
|
| 328 |
+
|
| 329 |
+
Compute probabilities of keyframes being within the predicted sequence: $\begin{array} { r } { c ^ { n } = \sum _ { t \leq T } \tau _ { t } ^ { n } } \end{array}$
|
| 330 |
+
|
| 331 |
+
Compute soft keyframe targets: $\begin{array} { r } { \tilde { K } ^ { n } = \sum _ { t } \tau _ { t } ^ { n } I _ { t } } \end{array}$ .
|
| 332 |
+
Compute the keyframe loss: $\textstyle \bigl ( \sum _ { n } c ^ { n } | | \hat { K } ^ { n } - \tilde { K } ^ { n } | | ^ { 2 } \bigr ) / \sum _ { n } c ^ { n }$ . Get probabilities of segments ending after particular frames: $\begin{array} { r } { e _ { j } ^ { n } = \sum _ { j > i } \delta _ { j } ^ { n } } \end{array}$ Get distributions of individual frames timesteps: $m _ { j , t } ^ { n } \propto \tau _ { t - j + 1 } ^ { n - 1 } e _ { j } ^ { n }$ .
|
| 333 |
+
Compute soft individual frames: $\begin{array} { r } { \tilde { I } _ { t } = \sum _ { t , i } m _ { j , t } ^ { n } \hat { I } _ { i } ^ { t } } \end{array}$
|
| 334 |
+
Compute the sequence loss: $\begin{array} { r } { \sum _ { t } | | I _ { t } - \tilde { I } _ { t } | | ^ { 2 } } \end{array}$ .
|
| 335 |
+
|
| 336 |
+
# Algorithm 2 Selecting keyframes via Surprise
|
| 337 |
+
|
| 338 |
+
<table><tr><td>Parameters:Number of ground truth frames N,Desired number of keyframes M Input: Input sequence I1:T, Stochastic Video Prediction model SVG(.) add M - |S| maximum surprise points to S.</td></tr><tr><td>Run the inference network over the sequence: q(z1:T|I1:T) = SVG(I1:T).</td></tr><tr><td>Get the surprise measure: St = KL[q(zt|I1:t)llp(zt)]. Find the set of peak surprise points S where: St > St+1 ∧ St < St-1· if |S|<M then</td></tr></table>
|
| 339 |
+
|
| 340 |
+
# G ABLATION OF THE NUMBER OF PREDICTED KEYFRAMES
|
| 341 |
+
|
| 342 |
+
We show qualitative results of training KEYIN with $N = 4$ , 6 (optimal number), and 8 on the SBM dataset in Fig. 9. We observe that if we train KEYIN to select a smaller or a larger number of keyframes than needed, it learns to predict a subset or a superset of the true keyframes, respectively. This property follows from the structure of the model, which encourages the model to predict the keyframes that allow the full sequence to be inpainted. When too few keyframes are available, the model will be unable to put keyframes at all important times, but those it picks must still be good for inpainting. When more keyframes are available than necessary, the model can place the additional keyframes at any time, as only a subset of the keyframes are needed to ensure good inpainting.
|
| 343 |
+
|
| 344 |
+
<table><tr><td rowspan=1 colspan=1>····</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>+</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>+</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>+</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1>:</td></tr><tr><td rowspan=1 colspan=2>4 Keyframes</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=2>6Keyframes</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>·</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=2>8Keyframes</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr></table>
|
| 345 |
+
|
| 346 |
+
Figure 9: Qualitative keyframe discovery on the Structured Brownian Motion dataset for varying number of predicted keyframes. Top: Ground truth sequence, keyframes with bold white frame. Bottom: KEYIN keyframe predictions at their predicted temporal placement. Even if the number of predicted keyframes does not match the true number of keyframes KEYIN correctly discovers the keyframes and their temporal placement.
|
| 347 |
+
|
| 348 |
+
Table 3: We compare different formulations for a surprise-based keyframe detection method: (1) detecting maxima of the KL divergence between prior and posterior in a stochastic prediction model, (2) detecting maxima in the lower bound on data likelihood $\log p$ (ELBO) of a stochastic prediction model, (3) the formulation proposed in Denton & Fergus (2018) that detects maxima of the variance of a learned prior distribution.
|
| 349 |
+
|
| 350 |
+
<table><tr><td rowspan="2">DATASET METHOD</td><td colspan="3">PUSH</td><td colspan="3">GRIDWORLD</td></tr><tr><td>F1个</td><td>mind</td><td>mindD √</td><td>F1个</td><td>mind</td><td>mindED √</td></tr><tr><td>KL-SUPRISE</td><td>0.25</td><td>1.44</td><td>2.05</td><td>0.32</td><td>1.42</td><td>1.86</td></tr><tr><td>log p-SURPRISE</td><td>0.24</td><td>1.42</td><td>2.08</td><td>0.31</td><td>1.45</td><td>1.83</td></tr><tr><td>DENTON& FERGUS(2018)</td><td>0.17</td><td>1.73</td><td>2.01</td><td>0.35</td><td>1.10</td><td>1.53</td></tr></table>
|
| 351 |
+
|
| 352 |
+
Table 4: In addition to the F1 scores we report the minimal temporal distance to the next keyframe as an additional metric that is more graceful with respect to "close misses". Specifically, we report the distance to the next annotated keyframe averaged across predicted keyframes, $\operatorname* { m i n } d _ { \mathrm { K F } } ^ { \mathrm { t r u e } }$ , and, inversely, the distance to the next predicted keyframe for each annotated keyframe, min $d _ { \mathrm { K F } } ^ { \mathrm { p r e d } }$ . For both datasets the distance metrics support the F1 results: KEYIN discovers keyframes that are better aligned with the annotated keyframes than the baselines.
|
| 353 |
+
|
| 354 |
+
<table><tr><td rowspan="2">DATASET METHOD</td><td colspan="3">PUSH</td><td colspan="3">GRIDWORLD</td></tr><tr><td>F1↑</td><td>mind ←</td><td>min dKFD</td><td>F1↑</td><td></td><td>4</td></tr><tr><td>STATIC</td><td>0.18</td><td>1.67</td><td>1.25</td><td>0.25</td><td>1.22</td><td>1.07</td></tr><tr><td>SURPRISE</td><td>0.25</td><td>1.44</td><td>2.05</td><td>0.32</td><td>1.42</td><td>1.86</td></tr><tr><td>KEYIN (OURS)</td><td>0.43</td><td>1.25</td><td>1.86</td><td>0.42</td><td>1.03</td><td>0.99</td></tr></table>
|
| 355 |
+
|
| 356 |
+
# H VIDEO MODELING PERFORMANCE
|
| 357 |
+
|
| 358 |
+
We further report quantitative results on standard video prediction metrics, Structural Similarity Index (SSIM) and Peak Signal-to-Noise Ratio (PSNR), in Tab. 5. KEYIN is able to match performance of two comparable prior approaches, showing that the keyframe-based modeling is able to represent complex data distributions.
|
| 359 |
+
|
| 360 |
+
# I PLANNING ALGORITHM
|
| 361 |
+
|
| 362 |
+
<table><tr><td>Algorithm 3 Planning in the subgoal space.</td></tr><tr><td>Input:Keyframe model KEYIN(.,.),cost function c Input: Start and target images Il and Itarget Set the sampling distribution to the prior: μi=0,Oi=I fori=1...Hdo</td></tr><tr><td>Sample L sequences of latent variables: z1:N~N(μi,Oi)</td></tr><tr><td>Produce L subgoal plans: K1:N = KEYIN(I1, z1:N) Compute cost between generated and true targets: c(KN,Itarget)</td></tr><tr><td>Choose L'best plans,refit sampling distribution: μi+1,Oi+1= fit(z')</td></tr><tr><td>end for Return: Best subgoal plan K1:N</td></tr></table>
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure 10: A training sequence and two samples from our model on the Structured Brownian motion dataset. Each image shows an entire trajectory. Our model first samples the keyframes (shown in red), and then deterministically predicts the rest of the sequence. The image resolution was enhanced for viewability.
|
| 366 |
+
|
| 367 |
+
Table 5: SSIM and PSNR scores on pushing and gridworld dataset. Higher is better.
|
| 368 |
+
|
| 369 |
+
<table><tr><td rowspan="2">DATASET METHOD</td><td colspan="2">PUSH</td><td colspan="2">GRIDWORLD</td></tr><tr><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td></tr><tr><td>DENTON & FERGUS (2018)</td><td>33.3 ± 0.1</td><td>0.956 ± 0.001</td><td>29.4±0.1</td><td>0.812 ±0.01</td></tr><tr><td>JUMPY</td><td>33.7 ± 0.1</td><td>0.960 ± 0.001</td><td>29.9 ± 0.1</td><td>0.831 ±0.001</td></tr><tr><td>KEYIN (OURS)</td><td>33.4 ± 0.7</td><td>0.959 ± 0.001</td><td>29.3 ±0.1</td><td>0.820 ±0.001</td></tr></table>
|
| 370 |
+
|
| 371 |
+
To apply the KEYIN model for planning, we use the approach for visual planning outlined in Algorithm 1. At the initial timestep, we use the cross-entropy method (CEM) Rubinstein & Kroese (2004) to select subgoals for the task. To do so, we sample $\tilde { M }$ latent sequences $z _ { \mathrm { 0 } }$ from the prior $\mathcal { N } ( 0 , I )$ and use the keyframe model to retrieve $\tilde { M }$ corresponding keyframe sequences, each with $L$ frames. We define the cost of an image trajectory as the distance between the target image and the final image of each keyframe sequence defined under a domain-specific distance function (see below). In the update step of the CEM algorithm, we rank the trajectories based on their cost and fit a diagonal Gaussian distribution to the latents $z ^ { \prime }$ that generated the $\tilde { M } ^ { \prime } = r \tilde { M }$ best sequences, where $r$ is the elite ratio. We repeat the procedure above for a total of $N$ iterations.
|
| 372 |
+
|
| 373 |
+

|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 11: Example keyframe detections on noisy sequences. Red frames mark annotated keyframes. Top: Pushing dataset. Bottom: Gridworld dataset. Each triplet depicts top: ground truth sequence with additive Gaussian noise, middle: predicted keyframes at the predicted time steps, bottom: predicted full sequence. KEYIN is reliably able to detect keyframes and reconstruct the full sequence.
|
| 377 |
+
|
| 378 |
+
Table 6: Keyframe SSIM and PSNR scores on pushing and gridworld dataset. Higher is better.
|
| 379 |
+
|
| 380 |
+
<table><tr><td rowspan="2">DATASET METHOD</td><td colspan="2">PUSH</td><td colspan="2">GRIDWORLD</td></tr><tr><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td></tr><tr><td>JUMPY</td><td>28.25 ± 0.11</td><td>0.904 ± 0.001</td><td>16.3 ± 0.17</td><td>0.632 ± 0.001</td></tr><tr><td>KEYIN (OURS)</td><td>29.5 ± 0.16</td><td>0.911 ± 0.001</td><td>18.4 ± 0.17</td><td>0.636 ± 0.001</td></tr></table>
|
| 381 |
+
|
| 382 |
+
Table 7: F1 score and distance to closest annotated / predicted keyframe when trained and tested on sequences with additive Gaussian noise. KEYIN is able to reliably find keyframes on both datasets even when trained and tested on noisy sequences. Even though the F1 score is lower on the Pushing dataset, the distances indicate that the discovered keyframes are well aligned with the annotated keyframes even under noise.
|
| 383 |
+
|
| 384 |
+
<table><tr><td>DATASET</td><td colspan="3">PUSH</td><td colspan="3">GRIDWORLD</td></tr><tr><td>METHOD</td><td>F1↑</td><td>mind ↓</td><td>mind ↓</td><td>F1↑</td><td>mind</td><td>mind</td></tr><tr><td>KEYIN,NO-NOISE</td><td>0.43</td><td>1.25</td><td>1.86</td><td>0.42</td><td>1.03</td><td>0.99</td></tr><tr><td>KEYIN, GAUSS-NOISE</td><td>0.25</td><td>1.21</td><td>1.34</td><td>0.43</td><td>1.00</td><td>0.96</td></tr></table>
|
| 385 |
+
|
| 386 |
+
We define the cost between two frames used during planning as the Euclidean distance between the center pixels of the object in both frames. We recover the center pixel via color-based segmentation of the object. While this cost function is designed for the particular planning environment we are testing on, our algorithm can be easily extended to use alternative, more domain-agnostic cost formulations that have been proposed in the literature Finn & Levine (2017); Ebert et al. (2017; 2018).
|
| 387 |
+
|
| 388 |
+
After subgoals are selected, we use a CEM based planner to produce rollout trajectories. Similar to the subgoal generation procedure, at each time step, we initially sample $M$ action sequences $\mathbf { \delta } \mathbf { \em u } _ { 0 }$ from the prior $\mathcal { N } ( 0 , I )$ and use the ground truth dynamics of the simulator to retrieve $M$ corresponding image sequences, each with $l$ frames7. We define the cost of an image trajectory as the distance between the target image and the final image of each trajectory. In the update step, we rank the trajectories based on their cost and fit a diagonal Gaussian distribution to the actions $\mathbf { { \boldsymbol { u } } } ^ { \prime }$ that generated the $M ^ { \prime } = r M$ best sequences. After sampling a new set of actions ${ \pmb u } _ { n + 1 }$ from the fitted Gaussian distributions we repeat the procedure above for a total of $N$ iterations.
|
| 389 |
+
|
| 390 |
+
Finally, we execute the first action in the action sequence corresponding to the best rollout of the final CEM iteration. The action at the next time step is chosen using the same procedure with the next observation as input and reinitialized action distributions. The algorithm terminates when the specified maximal number of planning steps $T _ { \mathrm { m a x } }$ has been executed or the distance to the goal is below a set threshold.
|
| 391 |
+
|
| 392 |
+
Table 8: Hyperparameters for the visual planning experiments.
|
| 393 |
+
|
| 394 |
+
<table><tr><td>planning Parameters</td><td></td></tr><tr><td>Max. planning timesteps (Tmax) Max. per subgoal timesteps (Ts,max) Keyframe prediction horizon (L)</td><td>60 10 6</td></tr><tr><td># keyframe sequences (M)</td><td>200</td></tr><tr><td>planning horizon (l) # planning sequences (M)</td><td>8</td></tr><tr><td>Elite fraction (r = M'/M)</td><td>200</td></tr><tr><td># refit iterations (N)</td><td>0.05 3</td></tr><tr><td>max.action (amax) dswitch</td><td>1.0 5</td></tr></table>
|
| 395 |
+
|
| 396 |
+
We switch between planned subgoals if (i) the subgoal is reached, i.e. the distance to the subgoal is below a threshold $d _ { \mathrm { s w i t c h } }$ measured in pixels, or (ii) the current subgoal was not reached for $T _ { s , \mathrm { m a x } }$ execution steps. We use the true goal image as an additional, final subgoal.
|
| 397 |
+
|
| 398 |
+
<table><tr><td>Algorithm 4 Full two-stage planning algorithm</td></tr><tr><td>Input: Keyframe model K1:L = LSTMkey(I, z1:L)</td></tr><tr><td>Input: Video prediction model It:t+l = LSTMinter(I1:t-1, U2:t+l)</td></tr><tr><td>Input: Subgoal index update heuristics ixt+1 = f(ixt,It,K1:L)</td></tr><tr><td>Input: Start and goal images I1 and Igoal:</td></tr><tr><td>Initialize latents from prior: zo ~ N(O, I). for i=1...Nit do</td></tr><tr><td>Rollout keyframe model for L steps,obtain M future keyframe sequences K1:L.</td></tr><tr><td>Compute distance between final and goal image: c = dist(KL, Igoal).</td></tr><tr><td>Choose M' best sequences, refit Gaussian distribution: μi+1,oi+1 key key = fit(K).</td></tr><tr><td>key)</td></tr><tr><td>end for Feed best sequence of latents into keyframe model to obtain subgoals: K1L</td></tr><tr><td>LSTMkey(I1, zNit,0).</td></tr><tr><td>Set current subgoal to ix1 = 1.</td></tr><tr><td>for t = 1...Tplan do Perform subgoal update ixt = f(ixt-1,It-1,K:L).</td></tr><tr><td></td></tr><tr><td>Initialize latents from prior: uo ~ N(O,I). fori=O...Nit do</td></tr><tr><td>Rollout prediction model for l steps, obtain M future sequences It:t+l·</td></tr><tr><td></td></tr><tr><td>Compute distance between final and subgoal image: c = dist(It+t, Kixt).</td></tr><tr><td>Choose M' best sequences, refit Gaussian distribution: μi+1, Oi+1 = fit(ui). Sample new latents from updated distribution: Ui+1 ~ N(μi+1, Oi+1).</td></tr><tr><td>end for Execute uNit,0 and observe next image It.</td></tr></table>
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 13: Sample planning task executions from the test set. From a start state depicted on the left, the robot arm successfully pushes the object into the goal position (semi-transparent object) guided by the KEYIN subgoals. The right side of the figure shows intermediate frames of the execution trajectories.
|
md/train/BkmM8Dceg/BkmM8Dceg.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WARPED CONVOLUTIONS: EFFICIENT INVARIANCE TO SPATIAL TRANSFORMATIONS
|
| 2 |
+
|
| 3 |
+
João F. Henriques & Andrea Vedaldi
|
| 4 |
+
Visual Geometry Group
|
| 5 |
+
University of Oxford
|
| 6 |
+
{joao,vedaldi}@robots.ox.ac.uk
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Convolutional Neural Networks (CNNs) are extremely efficient, since they exploit the inherent translation-invariance of natural images. However, translation is just one of a myriad of useful spatial transformations. Can the same efficiency be attained when considering other spatial invariances? Such generalized convolutions have been considered in the past, but at a high computational cost. We present a construction that is simple and exact, yet has the same computational complexity that standard convolutions enjoy. It consists of a constant image warp followed by a simple convolution, which are standard blocks in deep learning toolboxes. With a carefully crafted warp, the resulting architecture can be made equivariant to a wide range of 2-parameters spatial transformations. We show encouraging results in realistic scenarios, including the estimation of vehicle poses in the Google Earth dataset (rotation and scale), and face poses in Annotated Facial Landmarks in the Wild (3D rotations under perspective).
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
A crucial aspect of current deep learning architectures is the encoding of invariances. This fact is epitomized in the success of convolutional neural networks (CNN), where equivariance to image translation is key: translating the input results in a translated output. When invariances are present in the data, encoding them explicitly in an architecture provides an important source of regularization, which allows to reduce the amount of training data required for learning. Invariances may also be used to improve the efficiency of implementations; for instance, a convolutional layer requires orders of magnitude less memory and also less computation compared to an equivalent fully-connected layer.
|
| 15 |
+
|
| 16 |
+
The success of CNNs indicates that translation invariance is an important property of images. However, this does not explain why translation equivariant operators work well for image understanding. The common interpretation is that such operators are matched to the statistics of natural images, which are well known to be translation invariant (Hyvärinen et al., 2009). However, natural image statistics are also (largely) invariant to other transformations such as isotropic scaling and rotation, which suggests that alternative neural network designs may also work well with images. Furthermore, in specific applications, invariances other than translation may be more appropriate.
|
| 17 |
+
|
| 18 |
+
Therefore, it is natural to consider generalizing convolutional architectures to other image transformations, and this has been the subject of extensive study (Kanazawa et al., 2014; Bruna et al., 2013; Cohen & Welling, 2016). Unfortunately these approaches do not possess the same memory and speed benefits that CNNs enjoy. The reason is that, ultimately, they have to transform (warp) an image or filter several times (Kanazawa et al., 2014; Marcos et al., 2016; Dieleman et al., 2015), incurring a high computational burden. Another approach is to consider a basis of filters (analogous to eigen-images) encoding the desired invariance (Cohen & Welling, 2014; Bruna et al., 2013; Cohen & Welling, 2016), which requires more storage than a convolutional filter.
|
| 19 |
+
|
| 20 |
+
Although they are able to handle transformations with many pose parameters, in practice most recent proposals are limited to very coarsely discretized transformations, such as horizontal/vertical flips and $9 0 ^ { \circ }$ rotations (Dieleman et al., 2015; Cohen & Welling, 2014).
|
| 21 |
+
|
| 22 |
+
In this work we propose a generalization of CNNs that overcomes these disadvantages. Our main result shows that a linear layer with equivariance w.r.t. a large class of 2-parameters transformations can always be implemented efficiently, using a standard convolution in a warped image space. The image warp can be implemented using bilinear resampling, a simple and fast operation that has been popularized by spatial transformer networks (Jaderberg et al., 2015), and is part of most deep learning toolboxes. Unlike previous proposals, the proposed warped convolutions can handle continuous transformations, such as fine rotation and scaling.
|
| 23 |
+
|
| 24 |
+
This makes generalized convolution easily implementable in neural networks, including using fast convolution algorithms on GPU hardware, such as Winograd (Lavin, 2015) or the Fast Fourier Transform (Lyons, 2010). We present these notions in the simplest possible way (sections 2 to 4), but we note that they can be derived in broader generality from well know concepts of group theory (section 4.2).
|
| 25 |
+
|
| 26 |
+
# 2 GENERALIZING CONVOLUTION
|
| 27 |
+
|
| 28 |
+
# 2.1 CONVOLUTIONS OF CONTINUOUS IMAGES
|
| 29 |
+
|
| 30 |
+
We start by looking at the basic building block of CNNs, i.e. the convolution operator. This operator computes the inner product of an image $\boldsymbol { I } \in \mathbb { R } ^ { m \times n }$ with a translated version of the filter $\boldsymbol { F } \in \mathbb { R } ^ { r \times s }$ , producing a new image as output:
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
H _ { j } = \sum _ { k } I _ { k } F _ { k + j } ,
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
where $k$ ${ \mathfrak { a } } , { \mathfrak { j } } \in \mathbb { Z } ^ { 2 }$ are two-dimensional vectors of indexes, and the summation ranges inside the extents of both arrays.1 To handle continuous deformations of the input, it is more natural to express eq. 1 as an integral over continuous rather than discrete inputs:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
H ( u ; I ) = \int I ( x ) F ( x + u ) d x ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $I ( x )$ and $F ( x )$ are continuous functions over a bounded 2D region $\Omega \subset \mathbb { R } ^ { 2 }$ , that is: $I , F :$ $\Omega \to \mathbb { R }$ . The real-valued 2D vectors $x \in \Omega$ now play the role of the indexes $k \in { \mathbb { Z } } ^ { 2 }$ . Equation 2 reduces to the discrete case of eq. 1 if we define $I ( x )$ and $F ( x )$ as the sum of delta functions on grids. Intermediate values can be obtained by interpolation, such as bilinear (which amounts to convolution of the delta functions with a triangle filter (Jaderberg et al., 2015)). Importantly, such continuous images can be deformed by very rich continuous transformations of the input coordinates, whereas strictly discrete operations would be more limiting.
|
| 43 |
+
|
| 44 |
+
Over the next sections it will be more convenient to translate the image $I$ instead of the filter $F$ . This alternative form of eq. 2 is obtained by replacing $x + u x$ :
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
H ( u ; I ) = \int I ( x - u ) F ( x ) d x .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
# 2.2 BEYOND IMAGE TRANSLATIONS
|
| 51 |
+
|
| 52 |
+
The standard convolution operator of eq. 3 can be interpreted as applying the filter to translated versions of the image. Translations can be replaced by other transformations as follows (Henriques et al., 2014):
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
H ( t ; I ) = \int I ( t ( x ) ) F ( x ) d x , \quad t \in G
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $G$ is a set of transformation functions $t : \Omega \to \Omega$ (assumed to be invertible). Intuitively, this generalized convolution performs an exhaustive search for a pattern, at many different poses (Henriques et al., 2014; Kanazawa et al., 2014). The interest in this definition lies in the fact that it makes convolution equivariant (Lenc & Vedaldi, 2015):
|
| 59 |
+
|
| 60 |
+
Lemma 1 (Equivariance). Consider the generalized convolution operator $H ( t ; I )$ of eq. 4. Generalized convolution “commutes” with any transformation $q \in G$ of the image:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
H ( t ; I \circ q ) = H ( q \circ t ; I ) .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Proof. One has immediately $\begin{array} { r } { H ( t ; I \circ q ) = \int I ( q ( t ( x ) ) ) F ( x ) d x = H ( q \circ t ; I ) . } \end{array}$
|
| 67 |
+
|
| 68 |
+
A notable case is when transformations have an additive parametrization $t : \Omega \times \mathbb { R } ^ { 2 } \to \Omega$ , with $( x , u ) \mapsto t _ { u } ( x )$ and $t _ { u } \circ t _ { v } = t _ { u + v }$ . In this case, the equivariance relation can be written as
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
H ( u ; I \circ t _ { v } ) = H ( v + u ; I ) .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
In particular, standard convolution is obtained when $t _ { u } ( x ) = x - u$ is the translation operator. In this case, the lemma above simply states that any translation of the input of the convolution results in a corresponding translation of the output.
|
| 75 |
+
|
| 76 |
+
In section 5, we will look in more detail at a few concrete examples of transformations other than translations. Although we will not do so explicitly, in this construction it is also possible to let one or more dimensions of the parameter space $\mathbb { R } ^ { \bar { 2 } }$ be given modulus a period $Q$ , in the sense of replacing $\mathbb { R }$ with $\mathbb { R } / \mathbb { Z } ( Q )$ ; the latter is required to parameterise transformations such as rotation.
|
| 77 |
+
|
| 78 |
+
# 3 COMPUTATIONAL EFFICIENCY
|
| 79 |
+
|
| 80 |
+
Unfortunately, what eq. 4 gains us in generality, it loses in both performance and ease of implementation. Most works in computer vision that looked at filtering under generalized transformations (e.g. scale pyramids (Kanazawa et al., 2014) or rotated filter banks (Marcos et al., 2016; Cohen & Welling, 2014; 2016; Henriques et al., 2014)) compute eq. 4 directly by evaluating a large number of transformations $t \in G$ . This entails warping (transforming) either the image or the filter once per transformation $t$ , which can be expensive.
|
| 81 |
+
|
| 82 |
+
Opting to transform the filter instead of the image can be advantageous, since it is smaller in size. On the other hand, the filter and its domain then become spatially-varying, which foregoes the benefit of the regular, predictable, and local pattern of computations in standard convolution. It precludes the use of fast convolution routines such as Winograd’s algorithm (Lavin, 2015), or the Fast Fourier Transform (Lyons, 2010), which has lower computational complexity than exhaustive search (eq. 3).
|
| 83 |
+
|
| 84 |
+
In practice, most recent works focus on very coarse transformations that do not change the filter support and can be implemented strictly via permutations, like horizontal/vertical flips and $9 0 ^ { \circ }$ rotations (Dieleman et al., 2015; Cohen & Welling, 2014). Such difficulties explain why generalized convolutions are not as widespread as CNNs.
|
| 85 |
+
|
| 86 |
+
In section 4 we will show that, for an important class of transformations, including the ones considered in previous works (such as Kanazawa et al. (2014); Cohen & Welling (2014); Marcos et al. (2016)) it is possible to perform generalized convolution by composing a single warp with a standard convolution, instead of several warps. Thus, we are able to take full advantage of modern convolution implementations (Lavin, 2015; Lyons, 2010), including those with lower computational complexity.
|
| 87 |
+
|
| 88 |
+
# 4 MAIN RESULT
|
| 89 |
+
|
| 90 |
+
Our main contribution is to show that the generalized convolution operator of eq. 4 can be implemented efficiently by a standard convolution, by pre-warping the input image and filter appropriately. The warp is the same for any image, depending solely on the nature of the relevant transformations, and can be written in closed form. This result, given in theorem 1, allows us to implement very efficient generalized convolutions using simple computational blocks, as shown in section 4.1. We name this method warped convolution.
|
| 91 |
+
|
| 92 |
+
The strongest assumption is that transformations must have an additive parametrization. By this, we mean that there exists a bijection $t _ { u } : \Omega \to \Omega$ such that, for any $u , v \in \mathbb { R } ^ { 2 }$ , parameters compose additively $t _ { u } \circ t _ { v } = t _ { u + v }$ . The second assumption is that there exists a pivot point $x _ { 0 } \in \Omega$ such that $u \mapsto t _ { u } ( x _ { 0 } )$ defines a bijection $\mathbb { R } ^ { 2 } \to \Omega$ from the parameter space to the real plane. The latter requirements means that any point $x \in \Omega$ can be “reached” by transforming $x _ { 0 }$ under a suitable $t _ { u }$ . We then have that:
|
| 93 |
+
|
| 94 |
+
Theorem 1. Consider the generalized convolution of eq. 4. Assume that the transformation is additive $( t _ { u } \circ t _ { v } = t _ { u + v . }$ ). Assume also that, for a fixed pivot point $x _ { 0 }$ , the function $u \mapsto t _ { u } ( x _ { 0 } )$ is bijective. Then we can rewrite generalized convolution (eq. 4) as the standard convolution
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
H ( u ; I ) = \int \hat { I } ( u + v ) \hat { F } ( v ) d v ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\hat { I }$ and $\hat { F }$ are the warped image and filter given by:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\hat { I } ( u ) = I ( t _ { u } ( x _ { 0 } ) ) , \qquad \hat { F } ( u ) = F ( t _ { u } ( x _ { 0 } ) ) \left| \frac { d t _ { u } ( x _ { 0 } ) } { d u } \right| .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Proof. We use the variable substitution $x = t _ { v } ( x _ { 0 } )$ in eq. 4. Then:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { l } { H ( u ; I ) = \displaystyle \int I ( t _ { u } ( x ) ) F ( x ) d x } \\ { \displaystyle = \int I ( t _ { u } ( t _ { v } ( x _ { 0 } ) ) ) F ( t _ { v } ( x _ { 0 } ) ) \left| \frac { d t _ { v } ( x _ { 0 } ) } { d v } \right| d v } \\ { \displaystyle = \int \underbrace { I ( t _ { u + v } ( x _ { 0 } ) ) } _ { \hat { I } ( u + v ) } \underbrace { F ( t _ { v } ( x _ { 0 } ) ) \left| \frac { d t _ { v } ( x _ { 0 } ) } { d v } \right| } _ { \hat { F } ( v ) } d v } \\ { \displaystyle = \int \hat { I } ( u + v ) \hat { F } ( v ) d v . } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
The warp that is applied to both inputs in eq. 7 can be interpreted as follows. We start with an arbitrary pivot point $x _ { 0 }$ in the image and them sample other points by repeatedly applying the transformation $t _ { u } ( x _ { 0 } )$ to the pivot (by varying $u$ ). When discretized, this sampling is performed over a 2D grid of parameters $u$ . Finally, sampling the input at these points (for example, by bilinear interpolation) yields the warped input.
|
| 113 |
+
|
| 114 |
+
An illustration is given in fig. 1, for various transformations (each one is discussed in more detail in section 5). The red dot shows the pivot point $x _ { 0 }$ , and the two arrows pointing away from it show the two directions of increasing $u$ values (recall that transformation parameters are two-dimensional). The grids were generated by sampling $u$ at regular intervals. Note that the warp grids are independent of the image contents – they can be computed once offline and then applied to any image.
|
| 115 |
+
|
| 116 |
+
The last factor in eq. 7 is the determinant of the Jacobian of the image transformation $t$ . It rescales the image values to account for the stretching and shrinking of space due to non-linear warps. It can also be computed offline, and its application amounts to an element-wise product by a constant array. A generalization using group theory is discussed in section 4.2.
|
| 117 |
+
|
| 118 |
+
# 4.1 PRACTICAL CONSIDERATIONS
|
| 119 |
+
|
| 120 |
+
There are a few interesting aspects that simplify the use of theorem 1 in practice.
|
| 121 |
+
|
| 122 |
+
First, since in most applications the filter $F$ is learned, we are free to ignore the constant warp and Jacobian in eq. 7 (which amounts to a simple reparametrization), and learn $\hat { F }$ directly. In practice, this means that we warp only the input image $I$ to obtain $\hat { I }$ , and then perform a standard convolution with a filter $\hat { F }$ . The learned warped filter $\hat { F }$ has a one-to-one correspondence to an image-space filter $F$ by means of eq. 7, although there is no real need to build the latter explicitly.
|
| 123 |
+
|
| 124 |
+
Second, we can choose either one or two spatial transformations for the generalized convolution (e.g. scale and rotation, simultaneously). The reason is that the input image is 2D, so the parameterspace after warping is also 2D. The choice is not arbitrary though: the two transformations must commute, in order to respect additivity. This will be the case of the pairs we study in section 5.
|
| 125 |
+
|
| 126 |
+
# Algorithm 1 Warped convolution.
|
| 127 |
+
|
| 128 |
+
Grid generation (offline)
|
| 129 |
+
|
| 130 |
+
• Apply the spatial transformation $t$ repeatedly to a pivot point $x _ { 0 }$ , using a 2D grid of parameters $\stackrel { \cdot } { u } = \{ \bar { ( } u _ { 1 } + i \delta _ { 1 } , u _ { 2 } + j \delta _ { 2 } ) : i = 0 , \ldots , m , j = 0 , \bar { \ldots } , n \}$ , obtaining the 2D warp grid $t _ { u } ( x _ { 0 } )$ .
|
| 131 |
+
|
| 132 |
+
Warped convolution
|
| 133 |
+
|
| 134 |
+
1. Resample input image $I$ using the warp grid $t _ { u } ( x _ { 0 } )$ , by bilinear interpolation.
|
| 135 |
+
|
| 136 |
+
2. Convolve the warped image $\hat { I }$ with filter $\hat { F }$ .
|
| 137 |
+
|
| 138 |
+
By theorem 1, these steps are equivalent to a generalized convolution, which performs an exhaustive search across the pose-space of transformation $t$ , but at a much lower computational cost.
|
| 139 |
+
|
| 140 |
+
# 4.2 RELATIONSHIP TO GROUP THEORY
|
| 141 |
+
|
| 142 |
+
This section relates our results, which have been presented using a simple formalism and in a restricted setting, to a more general approach based on group theory (Folland, 1995).
|
| 143 |
+
|
| 144 |
+
To this end, let $G$ be a group of transformations. Under very mild conditions (the group has to be locally compact and Hausdorff), there exists a unique measure on the group, the Haar measure, which is invariant to the group action, in the sense that, given a measurable function ${ \tilde { I } } : G \to$ $\mathbb { R }$ , then $\begin{array} { r } { \int \tilde { I } ( g ^ { \prime } g ) d g = \int \overline { { \tilde { I } } } ( g ) \dot { } d g } \end{array}$ . Using this measure, one can define generalized convolution as $\begin{array} { r } { ( \tilde { I } * \tilde { F } ) ( t ) = \int _ { G } \tilde { I } ( t g ) \tilde { F } ( g ^ { - 1 } ) d g } \end{array}$ . This resembles our definition (4), although image and filter are defined on the group $G$ instead of the spatial domain $\mathbb { R } ^ { 2 }$ . Lemma 1 translates immediately to this case (Folland, 1995).
|
| 145 |
+
|
| 146 |
+
In order to extend Theorem 1, we need to make this general but abstract construction concrete. Here one assumes that the group acts transitively on a subset $X \subset \mathbb { R } ^ { 2 }$ (which means that any point $x \in X$ can be written as $x = g x _ { 0 }$ , for a fixed point $x _ { 0 } \in X$ and a suitable transformation $g \in G$ ). Then one can define the image as $\tilde { I } ( g ) = I ( g \bar { ( } x _ { 0 } ) )$ , where $I$ is a function of the spatial domain $X$ instead of the group $G$ , and likewise for the filter. Next, it is necessary to explicitly calculate the integral over $G$ . If the group is an Abelian (commutative) Lie group, then one can show that there exists a map $\exp : V \to G$ , the exponential map, defined on a vector space $V$ . Under commutativity, this map is also additive, in the sense that $\exp ( u ) \exp ( v ) = \exp ( u + v )$ . The structure of $V$ depends on the specific group, but under such restrictive conditions, it is a torus, which allows the calculation of $\textstyle \int { \tilde { I } } ( { \bar { g } } ) d g$ as $\begin{array} { r } { \int \tilde { I } ( \exp ( u ) x _ { 0 } ) d u . } \end{array}$ .
|
| 147 |
+
|
| 148 |
+
Finally, in order to swap integration over the group parameters with integration over space, one assumes that $x \ = \ \exp ( u ) x _ { 0 }$ defines a smooth bijection $V \ \ X$ , so that it is possible to use the change of variable $\dot { u } u ( x )$ where $\mathrm { e x p } ( u ( x ) ) x _ { 0 } = x$ . This allows writing the integral as $\begin{array} { r } { \int { \tilde { I } } ( \exp ( u ) x _ { 0 } ) d u = \int I ( x ) \left| d u / d x \right| d x } \end{array}$ . Note that this Jacobian is the inverse of the one found in (1) due to the fact that we started by defining our convolution using $I$ instead of $\tilde { I }$ .
|
| 149 |
+
|
| 150 |
+
# 5 EXAMPLES OF SPATIAL TRANSFORMATIONS
|
| 151 |
+
|
| 152 |
+
We now give some concrete examples of pairs of spatial transformations that obey the conditions of theorem 1, and can be useful in practice.
|
| 153 |
+
|
| 154 |
+
# 5.1 SCALE AND ASPECT RATIO
|
| 155 |
+
|
| 156 |
+
Detection tasks require predicting the extent of an object as a bounding box. While the location can be found accurately by a standard CNN, which is equivariant to translation, the size prediction could similarly benefit from equivariance to horizontal and vertical scale (equivalently, scale and aspect ratio).
|
| 157 |
+
|
| 158 |
+
Such a spatial transformation, from which a warp can be constructed, is given by:
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 1: First row: Sampling grids that define the warps associated with different spatial transformations. Second row: An example image (a) after warping with each grid (b-d). Third row: A small translation is applied to each warped image, which is then mapped back to the original space (by an inverse warp). Translation in one axis of the appropriate warped space is equivalent to (b) horizontal scaling; (c) planar rotation; (d) 3D rotation around the vertical axis.
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
t _ { u } ( x ) = { \left[ \begin{array} { l } { x _ { 1 } s ^ { u _ { 1 } } } \\ { x _ { 2 } s ^ { u _ { 2 } } } \end{array} \right] }
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
The $s$ constant controls the total degree of scaling applied. Notice that the output must be exponential in the scale parameters $u$ ; this ensures the additive structure required by theorem 1: $t _ { u } ( \bar { t } _ { v } ( x ) ) =$ $t _ { u + v } ( x )$ . The resulting warp grid can be visualized in fig. 1-b. In this case, the domain of the image must be $\Omega \in \mathbb { R } _ { + } ^ { 2 }$ , since a pivot $x _ { 0 }$ in one quadrant cannot reach another quadrant by any amount of (positive) scaling.
|
| 168 |
+
|
| 169 |
+
# 5.2 SCALE AND ROTATION (LOG-POLAR WARP)
|
| 170 |
+
|
| 171 |
+
Planar scale and rotation are perhaps the most obvious spatial transformations in images, and are a natural test case for works on spatial transformations (Kanazawa et al., 2014; Marcos et al., 2016). Rotating a point $x$ by $u _ { 1 }$ radians and scaling it by $u _ { 2 }$ , around the origin, can be performed with
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
t _ { u } ( x ) = \left[ \begin{array} { l } { s ^ { u _ { 2 } } \left\| x \right\| \cos ( \mathrm { a t a n } _ { 2 } ( x _ { 2 } , x _ { 1 } ) + u _ { 1 } ) } \\ { s ^ { u _ { 2 } } \left\| x \right\| \sin ( \mathrm { a t a n } _ { 2 } ( x _ { 2 } , x _ { 1 } ) + u _ { 1 } ) } \end{array} \right] ,
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
where atan $^ 2$ is the standard 4-quadrant inverse tangent function (atan2). The domain in this case must exclude the origin $( \Omega \in \dot { \mathbb { R } } ^ { 2 } \setminus \{ 0 \} )$ , since a pivot $x _ { 0 } = 0$ cannot reach any other points in the image by rotation or scaling.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 2: Equivariant pose estimation strategy used in the experiments (section 6). With an appropriate warp and a standard CNN, the shaded block becomes equivalent to a generalized CNN (by theorem 1), which performs exhaustive searches across pose-space instead of image-space.
|
| 181 |
+
|
| 182 |
+
The resulting warp grid can be visualized in fig. 1-c. It is interesting to observe that it corresponds exactly to the log-polar domain, which is used in the signal processing literature to perform correlation across scale and rotation (Tzimiropoulos et al., 2010; Reddy & Chatterji, 1996). In fact, it was the source of inspiration for this work, which can be seen as a generalization of the log-polar domain to other spatial transformations.
|
| 183 |
+
|
| 184 |
+
# 5.3 3D SPHERE ROTATION UNDER PERSPECTIVE
|
| 185 |
+
|
| 186 |
+
We will now tackle a more difficult spatial transformation, in an attempt to demonstrate the generality of theorem 1. The transformations we will consider are yaw and pitch rotations in 3D space, as seen by a perspective camera. In the experiments (section 6) we will show how to apply it to face pose estimation.
|
| 187 |
+
|
| 188 |
+
In order to maintain additivity, the rotated 3D points must remain on the surface of a sphere. We consider a simplified camera and world model, whose only hyperparameters are a focal length $f$ , the radius of a sphere $r$ , and its distance from the camera center $d$ . The equations for the spatial transformation corresponding to yaw and pitch rotation under this model are in appendix A.
|
| 189 |
+
|
| 190 |
+
The corresponding warp grid can be seen in fig. 1-d. It can be observed that the grid corresponds to what we would expect of a 3D rendering of a sphere with a discrete mesh. An intuitive picture of the effect of the warp grid in such cases is that it wraps the 2D image around the surface of the 3D object, so that translation in the warped space corresponds to moving between vertexes of the 3D geometry.
|
| 191 |
+
|
| 192 |
+
# 6 EXPERIMENTS
|
| 193 |
+
|
| 194 |
+
# 6.1 ARCHITECTURE
|
| 195 |
+
|
| 196 |
+
As mentioned in section 2.2, generalized convolution performs an exhaustive search for patterns across spatial transformations, by varying pose parameters. For tasks where invariance to that transformation is important, it is usual to pool the detection responses across all poses (Marcos et al., 2016; Kanazawa et al., 2014).
|
| 197 |
+
|
| 198 |
+
In the experiments, however, we will test the framework in pose prediction tasks. As such, we do not want to pool the detection responses (e.g. with a max operation) but rather find the pose with the strongest response (i.e., an argmax operation). To perform this operation in a differentiable manner, we implement a soft argmax operation, defined as follows:
|
| 199 |
+
|
| 200 |
+
$$
|
| 201 |
+
s _ { 1 } ( a ) = \sum _ { i j } ^ { m n } \frac { i } { m } \sigma _ { i j } ( a ) , \qquad s _ { 2 } ( a ) = \sum _ { i j } ^ { m n } \frac { j } { n } \sigma _ { i j } ( a ) ,
|
| 202 |
+
$$
|
| 203 |
+
|
| 204 |
+
where $\sigma ( a ) \in \mathbb { R } ^ { m \times n }$ is the softmax over all spatial locations, and $\sigma _ { i j } ( a )$ indexes the element at $( i , j )$ . The outputs are the two spatial coordinates of the maximum value, $s ( a ) \in \mathbb { R } ^ { 2 }$ .
|
| 205 |
+
|
| 206 |
+
Our base architecture then consists of the following blocks, outlined in fig. 2. First, the input image is warped with a pre-generated grid, according to section 4. The warped image is then processed by a standard CNN, which is now equivariant to the spatial transformation that was used to generate the warp grid. A soft argmax (eq. 10) then finds the maximum over pose-space. To ensure the pose prediction is well registered to the reference coordinate system, a learnable scale and bias are applied to the outputs. Training proceeds by minimizing the $L ^ { 1 }$ loss between the predicted pose and ground truth pose.
|
| 207 |
+
|
| 208 |
+
Table 1: Results of scale and rotation pose estimation of vehicles in the Google Earth dataset.
|
| 209 |
+
|
| 210 |
+
<table><tr><td></td><td>CNN+FC</td><td>CNN+softargmax</td><td> Warped CNN</td></tr><tr><td>Rotation error (degrees)</td><td>28.87</td><td>30.6</td><td>26.44</td></tr><tr><td>Scale error (px)</td><td>17.51</td><td>5.783</td><td>5.4</td></tr></table>
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 3: Example pose estimates (rotation and scale) on the Google Earth dataset (Section 6.2).
|
| 214 |
+
|
| 215 |
+
# 6.2 GOOGLE EARTH
|
| 216 |
+
|
| 217 |
+
For the first task in our experiments, we will consider aerial photos of vehicles, which have been used in several works that deal with rotation invariance (Liu et al., 2014; Schmidt & Roth, 2012; Henriques et al., 2014).
|
| 218 |
+
|
| 219 |
+
Dataset. The Google Earth dataset (Heitz & Koller, 2008) contains bounding box annotations, supplemented with angle annotations from (Henriques et al., 2014), for 697 vehicles in 15 large images. We use the first 10 for training and the rest for validation. Going beyond these previous works, we focus on the estimation of both rotation and scale parameters. The object scale is taken to be the diagonal length of the bounding box.
|
| 220 |
+
|
| 221 |
+
Implementation. A $4 8 \times 4 8$ image around each vehicle is cropped and downscaled by $50 \%$ , and then fed to a network for pose prediction. The proposed method, Warped CNN, follows the architecture of section 6.1 (visualized in fig. 2). The CNN block contains 3 convolutional layers with $5 \times 5$ filters, with 20, 50 and 1 output channels respectively. Recall that the output of the CNN block is a single-channel response map over 2D pose-space, which in this case consists of rotation and scale. Between the convolutional layers there are $3 \times 3$ max-pooling operators, with a stride of 2, and a ReLU before the last layer. All networks are trained for 20 epochs with SGD, using hyperparameters chosen by cross-validation.
|
| 222 |
+
|
| 223 |
+
Baselines and results. The results of the experiments are presented in table 1, which shows angular and scale error in the validation set. Qualitative results are shown in fig. 3. To verify whether the proposed warped convolution is indeed responsible for a boost in performance, rather than other architectural details, we compare it against a number of baselines with different components removed. The first baseline, CNN $^ +$ softargmax, consists of the same architecture but without the warp (section 5.2). This is a standard CNN, with the soft argmax at the end. Since CNNs are equivariant to translation, rather than scale and rotation, we observe a drop in performance. For the second baseline, $\mathrm { C N N + F C }$ , we replace the soft argmax with a fully-connected layer, to allow a prediction that is not equivariant with translation. The FC layer improves the angular error, but not the scale error. The proposed Warped CNN has a similar (slightly lower) capacity to the $\mathrm { C N N + F C }$ baseline, but we see it achieve better performance, since its architectural equivariance seems to be better matched to the data distribution.
|
| 224 |
+
|
| 225 |
+
Table 2: Results of yaw and pitch pose estimation of faces on the AFLW dataset.
|
| 226 |
+
|
| 227 |
+
<table><tr><td></td><td>CNN+FC</td><td>STN+FC</td><td> STN+softargmax</td><td> Warped CNN</td></tr><tr><td>Yaw err. (deg.)</td><td>13.87</td><td>16.92</td><td>15.01</td><td>10.65</td></tr><tr><td>Pitch err. (deg.)</td><td>7.23</td><td>10.17</td><td>6.88</td><td>6.351</td></tr></table>
|
| 228 |
+
|
| 229 |
+
# 6.3 FACES
|
| 230 |
+
|
| 231 |
+
We now turn to face pose estimation in unconstrained photos, which requires handling more complex 3D rotations under perspective.
|
| 232 |
+
|
| 233 |
+
Dataset. For this task we use the Annotated Facial Landmarks in the Wild (AFLW) dataset (Koestinger et al., 2011). It contains about 25K faces found in Flickr photos, and includes yaw (left-right) and pitch (up-down) annotations. We removed 933 faces with yaw larger than 90 degrees (i.e., facing away from the camera), resulting in a set of 24,384 samples. $20 \%$ of the faces were set aside for validation.
|
| 234 |
+
|
| 235 |
+
Implementation. The region in each face’s bounding box is resized to a $6 4 \times 6 4$ image, which is then processed by the network. Recall that our simplified 3D model of yaw and pitch rotation (section 5.3) assumes a spherical geometry. Although a person’s head roughly follows a spherical shape, the sample images are centered around the face, not the head. As such, we use an affine Spatial Transformer Network (STN) (Jaderberg et al., 2015) as a first step, to center the image correctly. Similarly, because the optimal camera parameters $( f , r$ and $d$ ) are difficult to set by hand, we let the network learn them, by computing their derivatives numerically (which has a low overhead, since they are scalars). The rest of the network follows the same diagram as before (fig. 2). The main CNN has 4 convolutional layers, the first two with $5 \times 5$ filters, the others being $9 \times 9$ . The numbers of output channels are 20, 50, 20 and 1, respectively. A $3 \times 3$ max-pooling with a stride of 2 is performed after the first layer, and there are ReLU non-linearities between the others. As for the STN, it has 3 convolutional layers $\mathrm { ( 5 \times 5 ) }$ , with 20, 50 and 6 output channels respectively, and $3 \times 3$ max-pooling (stride 2) between them.
|
| 236 |
+
|
| 237 |
+
Baselines and results. The angular error of the proposed equivariant pose estimation, Warped CNN, is shown in table 2, along with a number of baselines. Qualitative results are shown in fig. 4. The goal of these experiments is to demonstrate that it is possible to achieve equivariance to complex 3D rotations. We also wish to disentangle the performance benefits of the warped convolution from the other architectural aspects. The first baseline, $\mathrm { S T N + s }$ oftargmax, is the same as the proposed method, but without the warp. The large performance drop indicates that the spherical model incorporates important domain knowledge, which is ignored by a translation-equivariant STN. To allow nonequivariant models, we also test two other baselines where the softargmax is replaced with a fullyconnected (FC) layer. The $\mathrm { S T N + F C }$ includes an affine Spatial Transformer, while the $\mathrm { C N N + F C }$ does not, corresponding to a standard CNN of equivalent capacity. We observe that neither the FC or the STN components can account up for the performance of the warped convolution, which better exploits the natural 3D rotation equivariance of the data.
|
| 238 |
+
|
| 239 |
+
# 7 CONCLUSIONS
|
| 240 |
+
|
| 241 |
+
In this work we show that it is possible to reuse highly optimized convolutional blocks, which are equivariant to image translation, and coax them to exhibit equivariance to other operators, including 3D transformations. This is achieved by a simple warp of the input image, implemented with off-the-shelf components of deep networks, and can be used for image recognition tasks involving a large range of image transformations. Compared to other works, warped convolutions are simpler, relying on highly optimized convolution routines, and can flexibly handle many types of continuous transformations. Studying generalizations that support more than two parameters seems like a fruitful direction for future work. In addition to the practical aspects, our analysis offers some insights into the fundamental relationships between arbitrary image transformations and convolutional architectures.
|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
Figure 4: Example pose estimates (yaw and pitch) on the AFLW dataset (Section 6.3).
|
| 245 |
+
|
| 246 |
+
# REFERENCES
|
| 247 |
+
|
| 248 |
+
Joan Bruna, Arthur Szlam, and Yann LeCun. Learning stable group invariant representations with convolutional networks. arXiv preprint arXiv:1301.3537, 2013.
|
| 249 |
+
|
| 250 |
+
Taco Cohen and Max Welling. Learning the Irreducible Representations of Commutative Lie Groups. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), 2014.
|
| 251 |
+
|
| 252 |
+
Taco Cohen and Max Welling. Group equivariant convolutional networks. In Proceedings of the 33rd International Conference on Machine Learning (ICML-16), 2016.
|
| 253 |
+
|
| 254 |
+
Sander Dieleman, Kyle W Willett, and Joni Dambre. Rotation-invariant convolutional neural networks for galaxy morphology prediction. Monthly notices of the royal astronomical society, 450 (2):1441–1459, 2015.
|
| 255 |
+
|
| 256 |
+
Gerald B Folland. A course in abstract harmonic analysis. 1995.
|
| 257 |
+
|
| 258 |
+
Geremy Heitz and Daphne Koller. Learning spatial context: Using stuff to find things. In European Conference on Computer Vision, pp. 30–43. Springer, 2008.
|
| 259 |
+
|
| 260 |
+
J. F. Henriques, P. Martins, R. Caseiro, and J. Batista. Fast training of pose detectors in the fourier domain. In Advances in Neural Information Processing Systems, 2014.
|
| 261 |
+
|
| 262 |
+
Aapo Hyvärinen, Jarmo Hurri, and Patrick O Hoyer. Natural Image Statistics: A Probabilistic Approach to Early Computational Vision., volume 39. Springer Science & Business Media, 2009.
|
| 263 |
+
|
| 264 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in Neural Information Processing Systems, pp. 2017–2025, 2015.
|
| 265 |
+
|
| 266 |
+
Angjoo Kanazawa, Abhishek Sharma, and David Jacobs. Locally scale-invariant convolutional neural networks. arXiv preprint arXiv:1412.5104, 2014.
|
| 267 |
+
|
| 268 |
+
Martin Koestinger, Paul Wohlhart, Peter M. Roth, and Horst Bischof. Annotated facial landmarks in the wild: A large-scale, real-world database for facial landmark localization. In First IEEE International Workshop on Benchmarking Facial Image Analysis Technologies, 2011.
|
| 269 |
+
|
| 270 |
+
Andrew Lavin. Fast algorithms for convolutional neural networks. arXiv preprint arXiv:1509.09308, 2015.
|
| 271 |
+
|
| 272 |
+
Karel Lenc and Andrea Vedaldi. Understanding image representations by measuring their equivariance and equivalence. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 991–999, 2015.
|
| 273 |
+
|
| 274 |
+
Kun Liu, Henrik Skibbe, Thorsten Schmidt, Thomas Blein, Klaus Palme, Thomas Brox, and Olaf Ronneberger. Rotation-Invariant HOG Descriptors Using Fourier Analysis in Polar and Spherical Coordinates. International Journal of Computer Vision, 106(3):342–364, February 2014. ISSN 0920-5691, 1573-1405. doi: 10.1007/s11263-013-0634-z.
|
| 275 |
+
|
| 276 |
+
Richard G Lyons. Understanding digital signal processing. Pearson Education, 2010.
|
| 277 |
+
|
| 278 |
+
Diego Marcos, Michele Volpi, and Devis Tuia. Learning rotation invariant convolutional filters for texture classification. arXiv preprint arXiv:1604.06720, 2016.
|
| 279 |
+
|
| 280 |
+
B. Srinivasa Reddy and Biswanath N. Chatterji. An FFT-based technique for translation, rotation, and scale-invariant image registration. IEEE Transactions on Image Processing, 5(8):1266–1271, 1996.
|
| 281 |
+
|
| 282 |
+
Uwe Schmidt and Stefan Roth. Learning rotation-aware features: From invariant priors to equivariant descriptors. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pp. 2050–2057, 2012.
|
| 283 |
+
|
| 284 |
+
Georgios Tzimiropoulos, Vasileios Argyriou, Stefanos Zafeiriou, and Tania Stathaki. Robust FFTbased scale-invariant image registration with image gradients. IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(10):1899–1906, 2010.
|
| 285 |
+
|
| 286 |
+
# A SPATIAL TRANSFORMATION FOR 3D SPHERE ROTATION UNDER PERSPECTIVE
|
| 287 |
+
|
| 288 |
+
Our simplified model consists of a perspective camera with focal length $f$ and all other camera parameters equal to identity, at a distance $d$ from a centered sphere of radius $r$ (see fig. 1-d).
|
| 289 |
+
|
| 290 |
+
A 2D point $x$ in image-space corresponds to the 3D point
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
p = ( x _ { 1 } , x _ { 2 } , f ) .
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
Raycasting it along the $z$ axis, it will intersect the sphere surface at the 3D point
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
q = { \frac { p } { \| p \| } } \left( k - { \sqrt { k ^ { 2 } - d ^ { 2 } + r ^ { 2 } } } \right) , k = { \frac { f d } { \| p \| } } .
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
If the argument of the square-root is negative, the ray does not intersect the sphere and so the point transformation is undefined. This means that the domain of the image $\Omega$ should be restricted to the sphere region. In practice, in such cases we simply leave the point unmodified.
|
| 303 |
+
|
| 304 |
+
Then, the yaw and pitch coordinates of the point $q$ on the surface of the sphere are
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\phi _ { 1 } = \cos ^ { - 1 } \left( - \frac { q _ { 2 } } { r } \right) , \phi _ { 2 } = \mathrm { a t a n _ { 2 } } \left( - \frac { q _ { 1 } } { d - q _ { 3 } } \right) .
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
These polar coordinates are now rotated by the spatial transformation parameters, $\phi ^ { \prime } = \phi + u$
|
| 311 |
+
|
| 312 |
+
Converting the polar coordinates back to a 3D point $q ^ { \prime }$
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\begin{array} { r } { q ^ { \prime } = \left[ \begin{array} { c } { r \sin \phi _ { 1 } ^ { \prime } \sin \phi _ { 2 } ^ { \prime } } \\ { - r \cos \phi _ { 1 } ^ { \prime } } \\ { r \sin \phi _ { 1 } ^ { \prime } \cos \phi _ { 2 } ^ { \prime } - d } \end{array} \right] . } \end{array}
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
Finally, projection of $q ^ { \prime }$ into image-space yields
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
t _ { u } ( x ) = - { \frac { f } { q _ { 3 } ^ { \prime } } } \left[ \begin{array} { c } { { q _ { 1 } ^ { \prime } } } \\ { { q _ { 2 } ^ { \prime } } } \end{array} \right] .
|
| 322 |
+
$$
|
md/train/ByQPVFull/ByQPVFull.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING GROUP ORTHOGONAL NEURAL NETWORKS WITH PRIVILEGED INFORMATION
|
| 2 |
+
|
| 3 |
+
Yunpeng Chen1, Xiaojie $\mathbf { J i n ^ { 1 } }$ , Jiashi Feng1, Shuicheng Yan2,1
|
| 4 |
+
|
| 5 |
+
1National University of Singapore
|
| 6 |
+
2Qihoo 360 AI Institute
|
| 7 |
+
{chenyunpeng,xiaojie.jin}@u.nus.edu
|
| 8 |
+
elefjia@nus.edu.sg
|
| 9 |
+
yanshuicheng@360.cn
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Learning rich and diverse feature representation are always desired for deep convolutional neural networks (CNNs). Besides, when auxiliary annotations are available for specific data, simply ignoring them would be a great waste. In this paper, we incorporate these auxiliary annotations as privileged information and propose a novel CNN model that is able to maximize inherent diversity of a CNN model such that the model can learn better feature representation with a stronger generalization ability. More specifically, we propose a group orthogonal convolutional neural network (GoCNN) to learn features from foreground and background in an orthogonal way by exploiting privileged information for optimization, which automatically emphasizes feature diversity within a single model. Experiments on two benchmark datasets, ImageNet and PASCAL VOC, well demonstrate the effectiveness and high generalization ability of our proposed GoCNN models.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Deep convolutional neural networks (CNNs) have brought a series of breakthroughs in image classification tasks (He et al., 2015; Girshick, 2015; Zheng et al., 2015). Many recent works (Simonyan & Zisserman, 2014; He et al., 2015; Krizhevsky et al., 2012) have observed that CNNs with different architectures or even different weight initializations may learn slightly different feature representations. Combining these heterogeneous models can provide richer and more diverse feature representation which can further boost the final performance. Such observation motivate us to directly pursue feature diversity within a single model in the work.
|
| 18 |
+
|
| 19 |
+
Besides, many existing datasets (Everingham et al., 2010; Deng et al., 2009; Xiao et al., 2010) provide more than one types of annotations. For example, the PASCAL VOC (Everingham et al., 2010) provides image level tags, object bounding box, and image segmentation masks; the ImageNet dataset (Deng et al., 2009) provide image level tags and a small portion of bounding box. Only using the image level tags for training image classification model would be a great waste on the other annotation resources. Therefore, in this work, we investigate whether these auxiliary annotations could also help a CNN model learn richer and more diverse feature representation.
|
| 20 |
+
|
| 21 |
+
In particular, we take advantage of these extra annotated information during training a CNN model for obtaining a single CNN model with sufficient inherent diversity, with the expectation that the model is able to learn more diverse feature representations and offers stronger generalization ability for image classification than vanilla CNNs. We therefore propose a group orthogonal convolutional neural network (GoCNN) model that is able to exploit these extra annotated information as privileged information. The idea is to learn different groups of convolutional functions which are “orthogonal” to the ones in other groups. Here by “orthogonal”, we mean there is no significant correlation among the produced features. By “privileged information”, we mean these auxiliary information only been used during the training phase. Optimizing orthogonality among convolutional functions reduces redundancy and increases diversity within the architecture.
|
| 22 |
+
|
| 23 |
+
Properly defining the groups of convolutional functions in the GoCNN is not an easy task. In this work, we propose to exploit available privileged information for identifying the proper groups. Specifically, in the context of image classification, object segmentation annotations which are (partially) available in several public datasets give richer information.
|
| 24 |
+
|
| 25 |
+
In addition, the background contents are usually independent on foreground objects within an image. Thus, splitting convolutional functions into different groups and enforcing them to learn features from the foreground and background separately can help construct orthogonal groups with small correlations. Motivated by this, we introduce the GoCNN architecture which explores to learn discriminative features from foreground and background separately where the foreground-background segregation is offered by the privileged segmentation annotation for training GoCNN. In this way, inherent diversity of the GoCNN can be explicitly enhanced. Moreover, benefiting from pursuing the group orthogonality, the learned convolutional functions within GoCNN are demonstrated to be foreground and background diagnostic even for extracting features from new images in the testing phase.
|
| 26 |
+
|
| 27 |
+
To the best of our knowledge, this work is the first to explore a principled way to train a deep neural network with desired inherent diversity and the first to investigate how to use the segmentation privileged information to assist image classification within a deep learning architecture. Experiments on ImageNet and PASCAL VOC clearly demonstrate GoCNN improves upon vanilla CNN models significantly, in terms of classification accuracy.
|
| 28 |
+
|
| 29 |
+
As a by-product of implementing GoCNN, we also provide positive answers to the following two prominent questions about image classification: (1) Does background information indeed help object recognition in deep learning? (2) Can a more precise annotation with richer information, e.g., segmentation annotation, assist the image classification training process non-trivially?
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Learning rich and diverse feature representations is always desired while training CNNs for gaining stronger generalization ability. However, most existing works mainly focus on introducing handcrafted cost functions to implicitly pursue diversity (Tang, 2013), or modifying activation functions to increase model non-linearity (Jin et al., 2015) or constructing a more complex CNN architecture (Simonyan & Zisserman, 2014; He et al., 2015; Krizhevsky et al., 2012). Methods that explicitly encourage inherent diversity of CNN models are still rare so far.
|
| 34 |
+
|
| 35 |
+
Knowledge distillation (Hinton et al., 2015) can be seen as an effective way to learn more discriminative and diverse feature representations. The distillation process compresses knowledge and thus encourages a weak model to learn more diverse and discriminative features. However, knowledge distillation works in two stages which are isolated from each other and has to rely on pre-training a complicated teacher network model. This may introduce undesired computation overhead. In contrast, our proposed approach can learn a diverse network in a single stage without requiring an extra network model. Similar works, e.g. the Diversity Networks (Sra & Hosseini), also squeeze the knowledge by preserving the most diverse features to avoid harming the performance.
|
| 36 |
+
|
| 37 |
+
More recently, Cogswell et al. (2016) proposed the DeCov approach to reduce over-fitting risk of a deep neural network model by reducing feature covariance. DeCov also agrees with increasing generalization ability of a model by pursuing feature diversity. This is consistent with our motivation. However, DeCov penalizes the covariance in an unsupervised fashion and cannot utilize extra available annotations, leading to insignificant performance improvement over vanilla models (Cogswell et al., 2016).
|
| 38 |
+
|
| 39 |
+
Using privileged information to learn better features during the training process is similar in spirit with our method. Both our proposed method and Lapin et al. (2014) introduce privileged information to assist the training process. However, almost all existing works (Lapin et al., 2014; Lopez-Paz et al., 2016; Sharmanska et al., 2014) are based on $\mathbf { S V M ^ { + } }$ which only focuses on training a better classifier and is not able to do the end-to-end training for better features.
|
| 40 |
+
|
| 41 |
+
Several works (Andrew et al., 2013; Srivastava & Salakhutdinov, 2012) about canonical correlation analysis (CCA) for CNNs provide a way to constrain feature diversity. However, the goal of CCA is to find linear projections for two random vectors that are maximally correlated, which is different from ours.
|
| 42 |
+
|
| 43 |
+
It is also worth to notice that simply adding a segmentation loss to image classification neural network is not equivalent to a GoCNN model. This is because image segmentation requires each pixel within the target area to be activated and the others stay silent for dense prediction, while GoCNN does not require the each pixel within the target area to be activated. GoCNN is specifically designed for classification tasks, not for segmentation ones. Moreover, our proposed GoCNN supports learning from partial privileged information wile the CNN above needs a fully annotated training set.
|
| 44 |
+
|
| 45 |
+
# 3 MODEL DIVERSITY OF CONVOLUTIONAL NEURAL NETWORKS
|
| 46 |
+
|
| 47 |
+
Throughout the paper, we use $f ( \cdot )$ to denote a convolutional function (or filter) and $k$ to index the layers in a multi-layer network. We use $c ^ { ( k ) }$ to denote the total number of convolutional functions at the $k$ -th layer and use $i$ and $j$ to index different functions, i.e., $f _ { i } ^ { ( k ) } ( \cdot )$ denotes the $i$ -th convolutional function at the $k$ -th layer of the network. The function $f$ maps an input feature map to another new feature map. The height and the width of a feature map output at the layer $k$ are denoted as $h ^ { ( k ) }$ and $w ^ { ( k ) }$ respectively. We consider a network model consisting of $N$ layers in total.
|
| 48 |
+
|
| 49 |
+
Under a standard CNN architecture, the elements within the same feature map are produced by the same convolutional function $f _ { i } ^ { ( k ) }$ and thus they represent the same type of features across different locations. Therefore, encouraging the feature variance or diversity within a single feature map does not make sense. In this work, our target is to enhance the diversity among different convolutional functions. Here we first give a formal description of model diversity for an $N$ -layer CNN.
|
| 50 |
+
|
| 51 |
+
Definition 1 (Model Diversity). Let $f _ { i } ^ { ( k ) }$ denote the $i$ -th convolutional function at the $k$ -th layer of a neural network model, and then the model diversity of the $k$ -th layer is defined as
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\zeta ^ { ( k ) } \triangleq 1 - \frac { 1 } { c ^ { ( k ) ^ { 2 } } } \sum _ { i , j = 1 } ^ { c ^ { ( k ) } } \mathrm { c o r } \left( f _ { i } ^ { ( k ) } , f _ { j } ^ { ( k ) } \right) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Here the operator $\displaystyle \mathrm { c o r } ( \cdot , \cdot )$ denotes the statistical correlation.
|
| 58 |
+
|
| 59 |
+
In other words, the inherent diversity of a network model that we are going to maximize is evaluated across all the convolutional functions within the same layer.
|
| 60 |
+
|
| 61 |
+
The most straightforward way to maximize the above diversity for each layer is to directly maximize the quantity of $\zeta ^ { ( k ) }$ during training the network. However, it is quite involved to optimize the hard diversity in (1) due to the large combination number of different convolutional functions. Thus, we propose to solve this problem by learning the convolutional functions in different groups separately. Different functions from different groups are uncorrelated to each other and we do not need to consider their correlation. Suppose the convolutional functions at each layer are partitioned into $m$ different groups, denoted as ${ \mathcal { G } } = \{ G _ { 1 } , . . . , G _ { m } \}$ . Then, we instead maximize the following Group-wise Model Diversity.
|
| 62 |
+
|
| 63 |
+
Definition 2 (Group-wise Model Diversity). Given a pre-defined group partition set $\begin{array} { r l } { \mathcal { G } } & { { } = } \end{array}$ $\{ G _ { 1 } , \dots , G _ { m } \}$ of convolutional functions at a specific layer, the group-wise model diversity of this layer is defined as
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\zeta _ { g } ^ { ( k ) } \triangleq 1 - \frac { 1 } { c ^ { ( k ) ^ { 2 } } } \sum _ { s , t = 1 } ^ { | \mathcal { G } | } \sum _ { i \in G _ { s } , j \in G _ { t } } \operatorname { c o r } \left( f _ { i } ^ { ( k ) } , f _ { j } ^ { ( k ) } \right) .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Instead of directly optimizing the model diversity, we consider optimizing the group-wise model diversity by finding a set of orthogonal groups $\{ G _ { 1 } ^ { * } , \ldots , G _ { m } ^ { * } \}$ , where convolutional functions within each group are uncorrelated with others within different groups. In the scenario of image representation learning, one typical example of such orthogonal groups is the foreground group and background group pair — partitioning the functions into two groups and letting them learn features from foreground and background contents respectively.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: Architectures of the proposed GoCNN used in the training (top) and testing (bottom) phase. The two groups are colored by blue (foreground) and purple (background) respecively. FC represents the fully connected layer.
|
| 73 |
+
|
| 74 |
+
In this work, we use segmentation annotation as privileged information for finding orthogonal groups of convolutional functions $G _ { 1 } ^ { * } , \ldots , G _ { m } ^ { * }$ . In particular, we derive the foreground and background segregation from the privileged information for an image. Then we partition convolutional functions at a specific layer of a CNN model into foreground and background groups respectively, and train a GoCNN model to learn the foreground and background features separately. Details about the architecture of the GoCNN and the training procedure of GoCNN are given in the following section.
|
| 75 |
+
|
| 76 |
+
# 4 GROUP ORTHOGONAL CONVOLUTIONAL NEURAL NETWORKS
|
| 77 |
+
|
| 78 |
+
We introduce the group orthogonal constraint to maximize group-wise diversity among different groups of convolutional functions explicitly by constructing a group orthogonal convolutional neural network (GoCNN). Details on the architecture of GoCNN are shown in Figure 1. GoCNN is built upon a standard CNN architecture. The convolutional functions at the final convolution layer are explicitly divided into two groups: the foreground group which concentrates on learning the foreground feature and the background group which learns the background feature. The output features of these two groups are then aggregated by a fully connected layer.
|
| 79 |
+
|
| 80 |
+
In the following subsections, we give more details of the foreground and background groups construction. After that, we will describe how to combine these two components and build them into a unified network architecture — the GoGNN.
|
| 81 |
+
|
| 82 |
+
# 4.1 FOREGROUND AND BACKGROUND GROUPS
|
| 83 |
+
|
| 84 |
+
To learn convolutional functions that are specific for foreground content of an image, we propose the following two constraints for the foreground group of functions. The first constraint forces the functions to be learned from the foreground only and free of any contamination from the background, and the second constraint encourages the learned functions to be discriminative for image classification.
|
| 85 |
+
|
| 86 |
+
We learn features that only lie in the foreground by suppressing any contamination from the background. As aforementioned, here we use the object segmentation annotations (denoted as Mask) as the privileged information in the training phase to help identify the background features where the foreground convolutional functions should not respond to. The background contamination is extracted by an extractor adopted on each feature map within the foreground group. In particular, we define an extractor $\varphi ( \cdot , \cdot )$ as follows:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\varphi ( f _ { i } ^ { ( k ) } ( x ) , \mathrm { M a s k } ) \triangleq f _ { i } ^ { ( k ) } ( x ) \odot \mathrm { M a s k } ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $x$ denotes the raw input and $\odot$ denotes the element-wise multiplication.
|
| 93 |
+
|
| 94 |
+
In the above operator, we use the background object mask $\mathrm { M a s k } _ { b }$ to extract background features. Each element in $\mathrm { M a s k } _ { b }$ is equal to one if the corresponding position lies on a background object or zero otherwise. Here, we assume the masks are already re-sized to have compatible dimensionality with the output feature map $f _ { i } ^ { ( k ) } ( x )$ by the interpolation method so that the element-wise multiplication is valid here. The extracted background features are then suppressed by a regression loss defined as follows:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\operatorname* { m i n } _ { \theta } \sum _ { i } \| \varphi ( f _ { i } ^ { ( k ) } ( x ; \theta ) , \mathrm { M a s k } _ { b } ) \| _ { F } .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Here $\theta$ parameterizes the convolution function $f _ { i } ^ { ( k ) }$ . Since the target value for this regression is zero, we also call it a suppression term. It will only suppress the response output by $f _ { i } ^ { ( k ) }$ at the locations outside the foreground.
|
| 101 |
+
|
| 102 |
+
For the second constraint, i.e., encouraging the functions to learn discriminative features, we simply use the standard softmax classification loss to supervise the learning phase.
|
| 103 |
+
|
| 104 |
+
The role of the background group is complementary to the foreground one. It aims to learn convolutional functions that are only specific for background contents. Thus, the functions within the background group have a same suppression term as in Eqn. (3), in which $\mathrm { M a s k } _ { b }$ is replaced with $\mathrm { M a s k } _ { f }$ to restrict the learned features to make them only lie in the background space. The $\mathrm { M a s k } _ { f }$ is simply computed as ${ \mathrm { M a s k } } _ { f } = 1 - { \mathrm { M a s k } } _ { b }$ . Also, a softmax linear classifier is attached during training to guarantee that these learned background functions are useful for predicting image categories.
|
| 105 |
+
|
| 106 |
+
# 4.2 ARCHITECTURE AND IMPLEMENTATION DETAILS OF THE GOCNN
|
| 107 |
+
|
| 108 |
+
In GoCNN, the size ratio of foreground group and background group is fixed to be 3:1 during training, since intuitively the foreground contents are much more informative than the background contents in classifying images. A single fully connected layer (or multiple layers depending on the basic CNN architecture) is used to unify the functional learning within different groups and combine features learned from different groups. It aggregates the information from different feature spaces and produces the final image category prediction. More details are given in Figure 1.
|
| 109 |
+
|
| 110 |
+
Because we are dealing with the classification problem, a main classifier with a standard classification loss function is adopted at the top layer of GoCNN. In our experiments, the standard softmax loss is used for single-label image classification and the logistic regression loss is used for multiplelabel image classification, e.g., images from the Pascal VOC dataset (Everingham et al., 2010).
|
| 111 |
+
|
| 112 |
+
During the testing stage, parts unrelated to the final main output will be removed, as shown in Figure 1 (b). Therefore, in terms of testing, neither extra parameters nor extra computational cost is introduced. The GoCNN is exactly the same as the adopted CNN in the testing phase.
|
| 113 |
+
|
| 114 |
+
In summary, for an incoming training sample, it passes through all the layers to the final convolution layer. Then the irrelevant features for each group (foreground or background) will be filtered out by privileged segmentation masks. Those filtered features will then flow into a suppressor (see Eqn. (3)). For the output features from each group, it will flow up along two paths: one leads to the group-wise classifier, and the other one leads to the main classifier. The three gradients from the suppressors, the group-wise classifiers and the main classifier will be used for updating the network parameters.
|
| 115 |
+
|
| 116 |
+
Applications with Incomplete Privileged Information Our proposed GoCNN can also be applied for semi-supervised learning. When only a small subset of images have the privileged segmentation annotations in a dataset, we simply set the segmentations of images without annotations to be $\mathrm { M a s k } _ { f } = \mathrm { M a s k } _ { b } = { \bf 1 }$ , where 1 is the matrix with all of its elements being 1. In other words, we disable both the suppression terms (ref. Eqn. (3)) on foreground and background parts as well as the extractors on the back propagation path. By doing so, fully annotated training samples with privileged information will supervise GoCNN to learn both discriminative and diverse features while the samples with only image tags only guide GoCNN to learn category discriminative features.
|
| 117 |
+
|
| 118 |
+
# 5 EXPERIMENTS
|
| 119 |
+
|
| 120 |
+
# 5.1 EXPERIMENT SETTINGS AND IMPLEMENTATION DETAILS
|
| 121 |
+
|
| 122 |
+
Datasets We evaluate the performance of GoCNN in image classification on two benchmark datasets, i.e., the ImageNet (Deng et al., 2009) dataset and the Pascal VOC 2012 dataset (Everingham et al., 2010).
|
| 123 |
+
|
| 124 |
+
• ImageNet ImageNet contains 1,000 fine-grained classes with about 1,300 images for each class and 1.2 million images in total, but without any image segmentation annotations. To collect privileged information, we randomly select 130 images from each class and manually annotate the object segmentation masks for them. Since our focus is on justifying the effectiveness of our proposed method, rather than pushing the state-of-the-art, we only collect privileged information for $10 \%$ data (overall $1 3 0 \mathrm { k }$ training images) to show performance improvement brought by our model. We call the new dataset consisting of these segmented images as ImageNet- $. 0 . I m$ . For evaluation, we use the original validation set of ImageNet which contains 50,000 images. Note that neither our baselines nor the proposed GoCNN needs segmentation information in testing phase.
|
| 125 |
+
|
| 126 |
+
• PASCAL VOC 2012 The PASCAL VOC 2012 dataset contains 11,530 images from 20 classes. For the classification task, there are 5,717 images for training and 5,823 images for validation. We use this dataset to further evaluate the generalization ability of different models including GoCNN trained on the ImageNet-0.1m: we pre-train the evaluated models on the ImageNet$0 . 1 \mathrm { m }$ dataset and fine-tune them using the logistic regression loss on PASCAL VOC 2012 training set. We evaluate their performance on the validation set.
|
| 127 |
+
|
| 128 |
+
The Basic Architecture of GoCNN In our experiments, we use the ResNet (He et al., 2015) as the basic architecture to build GoCNN. Since the deepest ResNet contains 152 layers which will cost several weeks to train, we choose a light version of architecture (ResNet-18 (He et al., 2015)) that contains 18 layers as our basic model for most cases. We also use the ResNet-152 (He et al., 2015) for experiments on the full ImageNet dataset. The final convolution layer gives a $7 \times 7$ output and is pooled into a $1 \times 1$ feature map by average pooling. Then a fully connected layer is added to perform linear classification. The used loss function for the single class classification on ImageNet dataset is the standard softmax loss. When performing multi-label classification on PASCAL VOC, we use the logistic regression loss.
|
| 129 |
+
|
| 130 |
+
Training and Testing Strategy We use MXNet (Chen et al., 2015) to conduct model training and testing. The GoCNN weights are initialized as in He et al. (2015) and we train GoCNN from scratch. Images are resized with a shorter side randomly sampled within [256, 480] for scale augmentation and $2 2 4 \times 2 2 4$ crops are randomly sampled during training (He et al., 2015). We use SGD with base learning rate equal to 0.1 at the beginning and reduce the learning rate by a factor of 10 when the validation accuracy saturates. For the experiments on ResNet-18 we use single node with a minibatch size of 512. For the ResNet-152 we use 48 GPUs with mini-batch size of 32 for each GPU. Following He et al. (2015), we use a weight decay of 0.0001 and a momentum of 0.9 in the training.
|
| 131 |
+
|
| 132 |
+
We evaluate the performance of GoCNN on two different testing settings: the complete privileged information setting and the partial privileged information setting. We perform 10-crop testing (Krizhevsky et al., 2012) for the complete privileged information scenario, and do a single crop testing for the partial privileged information scenario for convenience.
|
| 133 |
+
|
| 134 |
+
Compared Baseline Models Our proposed GoCNN follows the Learning Using Privileged Information (LUPI) paradigm (Lapin et al., 2014), which exploits additional information to facilitate learning but does not require extra information in testing. There are a few baseline models falling into the same paradigm that we can compare with. One is the $\mathbf { S V M + }$ method (Pechyony & Vapnik, 2011) and the other one is the standard model (i.e., the ResNet-18). We simply refer to ResNet-18 by baseline if no confusion occurs. In the experiments, we implement the $\mathbf { S V M + }$ using the code provided by Pechyony & Vapnik (2011) with default parameter settings and linear kernel. We follow the scheme as described in Lapin et al. (2014) to train the $\mathbf { S V M + }$ model. More concretely, we train multiple one-versus-rest $\mathbf { S V M + }$ models upon the deep features extracted from both the entire images and the foreground regions (used as the privileged information). We use the averaged pooling over 10 crops on the feature maps before the $F C$ layer as the deep feature for training $\mathbf { S V M + }$ . It is worth noting that all of these models (including $\mathbf { S V M + }$ and GoCNN) use a linear classifier and thus have the same number of parameters, or more concretely, GoCNN does not require more parameters than $\mathbf { S V M + }$ and the vanilla ResNet.
|
| 135 |
+
|
| 136 |
+
Table 1: Validation accuracy (for 10-crop validation) of different models on ImageNet validation set. All the compared models are trained on the ImageNet- $. 0 . 1 \mathrm { m }$ dataset with complete privileged information.
|
| 137 |
+
|
| 138 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>Top-1 Accuracy (%)</td><td rowspan=1 colspan=3>Top-5 Accuracy (%)</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Main_classifier</td><td rowspan=1 colspan=1>Fg_classifier</td><td rowspan=1 colspan=1>Bg_classifier</td><td rowspan=1 colspan=1>Main_classifier</td><td rowspan=1 colspan=1>Fg_Classifier</td><td rowspan=1 colspan=1>Bg-Classifier</td></tr><tr><td rowspan=1 colspan=1>SVM+Baseline</td><td rowspan=1 colspan=1>37.5346.00</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>70.05</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>Full GoCNN</td><td rowspan=1 colspan=1>50.39</td><td rowspan=1 colspan=1>49.60</td><td rowspan=1 colspan=1>40.03</td><td rowspan=1 colspan=1>75.00</td><td rowspan=1 colspan=1>74.21</td><td rowspan=1 colspan=1>66.98</td></tr></table>
|
| 139 |
+
|
| 140 |
+
# 5.2 TRAINING MODELS WITH COMPLETE PRIVILEGED INFORMATION
|
| 141 |
+
|
| 142 |
+
In this subsection, we consider the scenario where every training sample has complete privileged segmentation information. Firstly, we evaluate the performance of our proposed GoCNN on the ImageNet- $. 0 . 1 \mathrm { m }$ dataset. Table 1 summarizes the accuracy of different models. As can be seen from the results, given the complete privileged information, our proposed GoCNN presents much better performance than compared models. The group orthogonal constraints successfully regularize the learned feature to be within the foreground and background. The trained GoCNN thus presents a stronger generalization ability. It is also interesting (although not surprising) to observe that, when foreground features with background features are combined, the performance of GoCNN can be further improved from $4 9 . 6 0 \%$ to $5 0 . 3 9 \%$ in terms of top-1 accuracy. One can observe that the background information indeed benefits object recognition to some extent. To further investigate the contribution of each component within GoCNN to final performance, we conduct another experiment and show the results in Table 2. In the experiments, we purposively prevent the gradient propagation from the other components except the one being investigated during training, and perform another setting on the baseline method where the background is removed and only the foreground object is reserved in each training sample, noted as Baseline-obj. Comparing the result of Full GoCNN between different classifiers, we can see that learning background features can actually improve the overall performance. And when we compare the $F g$ classifier between Baseline-obj, Only $F g$ and Full GoCNN, we can see the importance of the background information in training more robust and richer foreground features.
|
| 143 |
+
|
| 144 |
+
Secondly, to verify the effectiveness of learning features in two different groups with our proposed method, we visualize the maximum activation value within each group of feature maps of several testing images. The feature maps are generated by the final convolution layer with $3 8 4 \times 3 8 4$ resolution input testing images. Then, the final convolution layer gives $1 2 \times 1 2$ output maps. We aggregate feature maps within the same group into one feature map by max operation. As can be seen from Figure 2, foreground and background features are well separated and the result looks just like the semantic segmentation mask. Compared with the baseline model, more neurons are activated in our proposed method in the two orthogonal spaces. This indicates that more diverse and discriminative features are learned in our framework compared with the baseline method. Finally, we further evaluate the generalization ability of our proposed method on the PASCAL VOC dataset. It is well known that an object shares many common properties with others even if they are not from the same category. A well-performing CNN model should be able to learn robust features rather than just fit the training images. In this experiment, we fine-tune different models on the PASCAL VOC images to test whether the learned features are able to generalize well to another dataset. Note that we add another convolution layer with a $1 \times 1$ kernel size and 512 outputs as an adaptive layer on all models. It is not necessary to add such a layer in networks without a residual structure (He et al., 2015). As can be seen from Table 3, our proposed network shows better results and higher average precision across all categories, which means our proposed GoCNN learns more representative and richer features that are easier to transfer from one domain to another.
|
| 145 |
+
|
| 146 |
+
Table 2: Validation accuracy (for 10-crop validations) of different components of GoCNN on ImageNet validation set. Baseline-obj refers to the baseline model trained on pure object ImageNet- $0 . 1 \mathrm { m }$ dataset, Only $B g$ refers to our proposed model with foreground part gradient blocked, and Only $F g$ refers to our proposed model with background part gradient blocked. (∗ marks the part which shares the same classifier with the main classifier.)
|
| 147 |
+
|
| 148 |
+
<table><tr><td></td><td colspan="3">Top-1 Accuracy (%)</td><td colspan="3">Top-5 Accuracy (%)</td></tr><tr><td></td><td>Main_classifier</td><td>Fg_classifier</td><td>Bg_classifier</td><td>Main_classifier</td><td>Fg_Classifier</td><td>Bg_Classifier</td></tr><tr><td>Baseline-obj</td><td>12.45</td><td>12.45*</td><td>1</td><td>24.43</td><td>24.43 *</td><td>1</td></tr><tr><td>Only Bg</td><td>40.36</td><td>1</td><td>40.36*</td><td>67.24</td><td>1</td><td>67.24*</td></tr><tr><td>OnlyFg</td><td>49.15</td><td>49.15*</td><td>二</td><td>73.70</td><td>73.70*</td><td>二</td></tr><tr><td>Full GoCNN</td><td>50.39</td><td>49.60</td><td>40.03</td><td>75.00</td><td>74.21</td><td>66.98</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 3: Classification results on PASCAL VOC 2012 (train/val). The performance is measured by Average Precision (AP, in $\%$ ).
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Model</td><td>areo</td><td>bike</td><td>bird</td><td>boat</td><td>bottle</td><td>bus</td><td>car</td><td>cat</td><td>chair</td><td>cow</td><td>table</td><td>dog</td><td>horse</td><td>mbk</td><td>prsn</td><td>plant</td><td>sheep sofa</td><td>train</td><td>tv</td><td>mean</td></tr><tr><td>Baseline</td><td>95.2</td><td>79.3</td><td>90.2</td><td>82.8</td><td>52.6</td><td>90.9</td><td>78.5</td><td>90.2</td><td>62.3</td><td>64.9 64.5</td><td>84.2</td><td>81.1</td><td>82.0</td><td>91.4</td><td>50.0</td><td>78.0</td><td>61.1</td><td>92.7</td><td>77.5</td><td>77.5</td></tr><tr><td>GoCNN</td><td>96.1</td><td>81.0</td><td>90.8</td><td>85.3</td><td>56.0</td><td>92.8</td><td>78.9</td><td>91.5</td><td>63.6 69.7</td><td>65.1</td><td>84.8</td><td>84.0</td><td>83.9</td><td>92.3</td><td>52.0</td><td>83.9</td><td>64.2</td><td>93.8</td><td>78.6</td><td>79.4</td></tr></table>
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 2: Activation maps of foreground feature maps (GoCNN-Fg), background feature maps (GoCNN-Bg) and all feature maps (GoCNN-Full) produced by our proposed GoCNN on ImageNet validation set. The bottom row shows the activation maps produced by the baseline model.
|
| 156 |
+
|
| 157 |
+
# 5.3 TRAINING GOCNN WITH PARTIAL PRIVILEGED INFORMATION
|
| 158 |
+
|
| 159 |
+
In this subsection, we investigate the performance of different models with only using partial privileged information. The experiment is also conducted on the ImageNet- $0 . 1 \mathrm { m }$ dataset. We evaluate the performance of our proposed GoCNN by varying the percentage of privileged information (i.e., percentage of training images with segmentation annotations) from $2 0 \%$ to $1 0 \hat { 0 } \%$ .
|
| 160 |
+
|
| 161 |
+
The validation accuracies of GoCNN and the baseline model (i.e., the ResNet-18) are shown in Table 4. From the results, one can observe that with the increasing percentage of privileged information, the accuracy will continuously increase until the percentage of privileged information reaches $8 0 \%$ . The performance on increasing the percentage from $4 0 \%$ to $1 0 0 \%$ is only $0 . 7 1 \%$ compared with $0 . 9 2 \%$ on the increasing from $2 0 \%$ to $4 0 \%$ . This is probably because the suppression losses are more effective than we expected; that is, with very little guidance from the suppression loss, the network can already be able to separate foreground and background features and explore new features within each group.
|
| 162 |
+
|
| 163 |
+
To verify the effectiveness of GoCNN on very large training dataset with more complex CNN architectures, we conducted another experiment on the complete ImageNet-1k dataset with only $10 \%$ privileged information, and we use the 152-layer ResNet as our basic model. As can be seen from Table 5, our proposed GoCNN achieves $2 1 . 8 \%$ top-1 error while the vanilla ResNet-152 has $2 3 . 0 \%$ top-1 error. Such performance boost is consistent with the results shown in Table 4, which again confirms the effectiveness of the GoCNN.
|
| 164 |
+
|
| 165 |
+
Table 4: Validation accuracy (Top-1, in $\%$ , 1 crop validation) with $20 \%$ , $40 \%$ , $60 \%$ , $80 \%$ and $100 \%$ privileged information. Since the baseline method (ResNet-18) does not use privileged information, its validation accuracy remains the same across different tests.
|
| 166 |
+
|
| 167 |
+
<table><tr><td>Model</td><td>20%</td><td>40%</td><td>60%</td><td>80%</td><td>100%</td></tr><tr><td>Baseline (ResNet-18)</td><td>44.26</td><td>44.26</td><td>44.26</td><td>44.26</td><td>44.26</td></tr><tr><td>GoCNN-18</td><td>47.00</td><td>47.92</td><td>48.18</td><td>48.61</td><td>48.63</td></tr></table>
|
| 168 |
+
|
| 169 |
+
Table 5: Validation error rate (in $\%$ , 1 crop validation) with $10 \%$ privileged information on full ImageNet-1k dataset.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Model</td><td>Top-1 err.</td><td>Top-5 err.</td></tr><tr><td>ResNet-101 He et al. (2015)</td><td>23.6</td><td>7.1</td></tr><tr><td>ResNet-152 He et al. (2015)</td><td>23.0</td><td>6.7</td></tr><tr><td>GoCNN-152</td><td>21.8</td><td>6.1</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 6 DISCUSSIONS
|
| 174 |
+
|
| 175 |
+
Based on our experimental results, we can also provide answers to the following two important questions.
|
| 176 |
+
|
| 177 |
+
Does background information indeed help object recognition for deep learning methods? Based on our experiments, we give a positive answer. Intuitively, background information may provide some “hints” for object recognition. However, though several works (Song et al., 2011; Russakovsky et al., 2012) have proven the usefulness of background information when using handcraft features, few works have studied the effectiveness of background information on deep learning methods for object recognition tasks. Based on the experimental results shown in Table 2, both the foreground classification accuracy and the overall classification accuracy can be further boosted with our proposed framework. This means that the background deep features can also provide useful information for foreground object recognition.
|
| 178 |
+
|
| 179 |
+
Can a more precise annotation with richer information, e.g., segmentation annotation, assist the image classification training process? The answer is clearly yes. In fact, in recent years, several works have explored how object detection and segmentation can benefit each other (Dai et al., 2015; Hariharan et al., 2014). However, none of existing works has studied how image segmentation information can help train a better classification deep neural network. In this work, by treating the segmentation annotations as the privileged information, we first demonstrate a possible way to utilize segmentation annotations to assist image classification training.
|
| 180 |
+
|
| 181 |
+
# 7 CONCLUSION
|
| 182 |
+
|
| 183 |
+
We proposed a group orthogonal neural network for image classification which encourages learning more diverse feature representations. Privileged information is utilized to train the proposed GoCNN model. To the best of our knowledge, we are the first to explore how to use image segmentation as privileged information to assist CNN training for image classification.
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
Galen Andrew, Raman Arora, Jeff Bilmes, and Karen Livescu. Deep canonical correlation analysis. In Proceedings of the 30th International Conference on Machine Learning, pp. 1247–1255, 2013.
|
| 188 |
+
|
| 189 |
+
Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv preprint arXiv:1512.01274, 2015.
|
| 190 |
+
|
| 191 |
+
Michael Cogswell, Faruk Ahmed, Ross Girshick, Larry Zitnick, and Dhruv Batra. Reducing overfitting in deep networks by decorrelating representations. ICLR, 2016.
|
| 192 |
+
|
| 193 |
+
Jifeng Dai, Kaiming He, and Jian Sun. Boxsup: Exploiting bounding boxes to supervise convolutional networks for semantic segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1635–1643, 2015.
|
| 194 |
+
|
| 195 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. IEEE, 2009.
|
| 196 |
+
|
| 197 |
+
Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. International journal of computer vision, 88(2): 303–338, 2010.
|
| 198 |
+
|
| 199 |
+
Ross Girshick. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1440–1448, 2015.
|
| 200 |
+
|
| 201 |
+
Bharath Hariharan, Pablo Arbelaez, Ross Girshick, and Jitendra Malik. Simultaneous detection and ´ segmentation. In Computer vision–ECCV 2014, pp. 297–312. Springer, 2014.
|
| 202 |
+
|
| 203 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
| 204 |
+
|
| 205 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 206 |
+
|
| 207 |
+
Xiaojie Jin, Chunyan Xu, Jiashi Feng, Yunchao Wei, Junjun Xiong, and Shuicheng Yan. Deep learning with s-shaped rectified linear activation units. arXiv preprint arXiv:1512.07030, 2015.
|
| 208 |
+
|
| 209 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 210 |
+
|
| 211 |
+
Maksim Lapin, Matthias Hein, and Bernt Schiele. Learning using privileged information: Svm+ and weighted svm. Neural Networks, 53:95–108, 2014.
|
| 212 |
+
|
| 213 |
+
David Lopez-Paz, Leon Bottou, Bernhard Sch ´ olkopf, and Vladimir Vapnik. Unifying distillation ¨ and privileged information. stat, 1050:26, 2016.
|
| 214 |
+
|
| 215 |
+
Dmitry Pechyony and Vladimir Vapnik. Fast optimization algorithms for solving svm+. Stat. Learning and Data Science, 2011.
|
| 216 |
+
|
| 217 |
+
Olga Russakovsky, Yuanqing Lin, Kai Yu, and Li Fei-Fei. Object-centric spatial pooling for image classification. In Computer Vision–ECCV 2012, pp. 1–15. Springer, 2012.
|
| 218 |
+
|
| 219 |
+
Viktoriia Sharmanska, Novi Quadrianto, and Christoph H Lampert. Learning to transfer privileged information. arXiv preprint arXiv:1410.0389, 2014.
|
| 220 |
+
|
| 221 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 222 |
+
|
| 223 |
+
Zheng Song, Qiang Chen, Zhongyang Huang, Yang Hua, and Shuicheng Yan. Contextualizing object detection and classification. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pp. 1585–1592. IEEE, 2011.
|
| 224 |
+
|
| 225 |
+
Suvrit Sra and Reshad Hosseini. Geometric optimization in machine learning.
|
| 226 |
+
|
| 227 |
+
Nitish Srivastava and Ruslan R Salakhutdinov. Multimodal learning with deep boltzmann machines. In Advances in neural information processing systems, pp. 2222–2230, 2012.
|
| 228 |
+
|
| 229 |
+
Yichuan Tang. Deep learning using linear support vector machines. arXiv preprint arXiv:1306.0239, 2013.
|
| 230 |
+
|
| 231 |
+
Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In Computer vision and pattern recognition (CVPR), 2010 IEEE conference on, pp. 3485–3492. IEEE, 2010.
|
| 232 |
+
|
| 233 |
+
Shuai Zheng, Sadeep Jayasumana, Bernardino Romera-Paredes, Vibhav Vineet, Zhizhong Su, Dalong Du, Chang Huang, and Philip HS Torr. Conditional random fields as recurrent neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1529–1537, 2015.
|
md/train/ByeWogStDS/ByeWogStDS.md
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SUB-POLICY ADAPTATION FOR HIERARCHICALREINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Alexander C. Li∗, Carlos Florensa∗, Ignasi Clavera, Pieter Abbeel University of California, Berkeley {alexli1, florensa, iclavera, pabbeel}@berkeley.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Hierarchical reinforcement learning is a promising approach to tackle long-horizon decision-making problems with sparse rewards. Unfortunately, most methods still decouple the lower-level skill acquisition process and the training of a higher level that controls the skills in a new task. Leaving the skills fixed can lead to significant sub-optimality in the transfer setting. In this work, we propose a novel algorithm to discover a set of skills and continuously adapt them along with the higher level even when training on a new task. Our main contributions are two-fold. First, we derive a new hierarchical policy gradient with an unbiased latent-dependent baseline, and we introduce Hierarchical Proximal Policy Optimization (HiPPO), an on-policy method to efficiently train all levels of the hierarchy jointly. Second, we propose a method of training time-abstractions that improves the robustness of the obtained skills to environment changes. Code and videos are available. 1.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reinforcement learning (RL) has made great progress in a variety of domains, from playing games such as Pong and Go (Mnih et al., 2015; Silver et al., 2017) to automating robotic locomotion (Schulman et al., 2015; Heess et al., 2017), dexterous manipulation (Florensa et al., 2017b; OpenAI et al., 2018), and perception (Nair et al., 2018; Florensa et al., 2018). Yet, most work in RL is still learning from scratch when faced with a new problem. This is particularly inefficient when tackling multiple related tasks that are hard to solve due to sparse rewards or long horizons.
|
| 12 |
+
|
| 13 |
+
A promising technique to overcome this limitation is hierarchical reinforcement learning (HRL) (Sutton et al., 1999). In this paradigm, policies have several modules of abstraction, allowing to reuse subsets of the modules. The most common case consists of temporal hierarchies (Precup, 2000; Dayan & Hinton, 1993), where a higher-level policy (manager) takes actions at a lower frequency, and its actions condition the behavior of some lower level skills or sub-policies. When transferring knowledge to a new task, most prior works fix the skills and train a new manager on top. Despite having a clear benefit in kick-starting the learning in the new task, having fixed skills can considerably cap the final performance on the new task (Florensa et al., 2017a). Little work has been done on adapting pre-trained sub-policies to be optimal for a new task.
|
| 14 |
+
|
| 15 |
+
In this paper, we develop a new framework for simultaneously adapting all levels of temporal hierarchies. First, we derive an efficient approximated hierarchical policy gradient. The key insight is that, despite the decisions of the manager being unobserved latent variables from the point of view of the Markovian environment, from the perspective of the sub-policies they can be considered as part of the observation. We show that this provides a decoupling of the manager and sub-policy gradients, which greatly simplifies the computation in a principled way. It also theoretically justifies a technique used in other prior works (Frans et al., 2018). Second, we introduce a sub-policy specific baseline for our hierarchical policy gradient. We prove that this baseline is unbiased, and our experiments reveal faster convergence, suggesting efficient gradient variance reduction. Then, we introduce a more stable way of using this gradient, Hierarchical Proximal Policy Optimization (HiPPO). This method helps us take more conservative steps in our policy space (Schulman et al., 2017), critical in hierarchies because of the interdependence of each layer. Results show that HiPPO is highly efficient both when learning from scratch, i.e. adapting randomly initialized skills, and when adapting pretrained skills on a new task. Finally, we evaluate the benefit of randomizing the time-commitment of the sub-policies, and show it helps both in terms of final performance and zero-shot adaptation on similar tasks.
|
| 16 |
+
|
| 17 |
+
# 2 PRELIMINARIES
|
| 18 |
+
|
| 19 |
+
We define a discrete-time finitehorizon discounted Markov decision process (MDP) by a tuple $\begin{array} { r l } { M } & { { } = } \end{array}$ $( \boldsymbol { \bar { s } } , \boldsymbol { \mathcal { A } } , \mathcal { P } , \boldsymbol { r } , \rho _ { 0 } , \gamma , \boldsymbol { \dot { H } } )$ , where $s$ is a state set, $\mathcal { A }$ is an action set, $\mathcal { P } :$ $S \times \mathcal { A } \times \mathcal { S } \to \mathbb { R } _ { + }$ is the transition probability distribution, $\gamma ~ \in ~ [ 0 , 1 ]$ is a discount factor, and $H$ the horizon. Our objective is to find a stochastic policy $\pi _ { \theta }$ that maximizes the expected discounted return within the MDP, $\begin{array} { r } { \eta ( \pi _ { \theta } ) = \mathbb { E } _ { \tau } [ \sum _ { t = 0 } ^ { H } \gamma ^ { t } r ( s _ { t } , a _ { t } ) ] } \end{array}$ We use ${ \boldsymbol \tau } = ( s _ { 0 } , a _ { 0 } , . . . , )$ to denote the entire state-action trajectory, where $s _ { 0 } ~ \sim ~ \rho _ { 0 } ( s _ { 0 } )$ , $a _ { t } \sim \dot { \pi } _ { \theta } ( a _ { t } | s _ { t } )$ , and $s _ { t + 1 } \sim \mathcal { P } ( s _ { t + 1 } | s _ { t } , a _ { t } )$ .
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Temporal hierarchy studied in this paper. A latent code $z _ { t }$ is sampled from the manager policy $\bar { \pi _ { \boldsymbol { \theta } _ { h } } ( \boldsymbol { z } _ { t } | \boldsymbol { s } _ { t } ) }$ every $p$ time-steps, using the current observation $s _ { k p }$ . The actions $a _ { t }$ are sampled from the sub-policy $\pi _ { \boldsymbol { \theta } _ { l } } ( a _ { t } | \bar { s } _ { t } , z _ { k p } )$ conditioned on the same latent code from $t = k p$ to $( k \bar { + } 1 ) p - 1$
|
| 23 |
+
|
| 24 |
+
In this work, we propose a method to learn a hierarchical policy and efficiently adapt all the levels in the hierarchy to perform a new task. We study hierarchical policies composed of a higher level, or manager $\pi _ { \boldsymbol { \theta } _ { h } } \big ( \boldsymbol { z } _ { t } | \boldsymbol { s } _ { t } \big )$ , and a lower level, or sub-policy $\pi _ { \theta _ { l } } ( a _ { t ^ { \prime } } | z _ { t } , s _ { t ^ { \prime } } )$ . The higher level does not take actions in the environment directly, but rather outputs a command, or latent variable $z _ { t } \in \mathcal { Z }$ , that conditions the behavior of the lower level. We focus on the common case where ${ \mathcal { Z } } = \mathbb { Z } _ { n }$ making the manager choose among $n$ sub-policies, or skills, to execute. The manager typically operates at a lower frequency than the sub-policies, only observing the environment every $p$ time-steps. When the manager receives a new observation, it decides which low level policy to commit to for $p$ environment steps by the means of a latent code $z$ . Figure 1 depicts this framework where the high level frequency $p$ is a random variable, which is one of the contribution of this paper as described in Section 4.4. Note that the class of hierarchical policies we work with is more restrictive than others like the options framework, where the time-commitment is also decided by the policy. Nevertheless, we show that this loss in policy expressivity acts as a regularizer and does not prevent our algorithm from surpassing other state-of-the art methods.
|
| 25 |
+
|
| 26 |
+
# 3 RELATED WORK
|
| 27 |
+
|
| 28 |
+
There has been growing interest in HRL for the past few decades (Sutton et al., 1999; Precup, 2000), but only recently has it been applied to high-dimensional continuous domains as we do in this work (Kulkarni et al., 2016; Daniel et al., 2016). To obtain the lower level policies, or skills, most methods exploit some additional assumptions, like access to demonstrations (Le et al., 2018; Merel et al., 2019; Ranchod et al., 2015; Sharma et al., 2018), policy sketches (Andreas et al., 2017), or task decomposition into sub-tasks (Ghavamzadeh & Mahadevan, 2003; Sohn et al., 2018). Other methods use a different reward for the lower level, often constraining it to be a “goal reacher” policy, where the signal from the higher level is the goal to reach (Nachum et al., 2018; Levy et al., 2019; Vezhnevets et al., 2017). These methods are very promising for state-reaching tasks, but might require access to goal-reaching reward systems not defined in the original MDP, and are more limited when training on tasks beyond state-reaching. Our method does not require any additional supervision, and the obtained skills are not constrained to be goal-reaching.
|
| 29 |
+
|
| 30 |
+
When transferring skills to a new environment, most HRL methods keep them fixed and simply train a new higher-level on top (Hausman et al., 2018; Heess et al., 2016). Other work allows for building on previous skills by constantly supplementing the set of skills with new ones (Shu et al., 2018), but they require a hand-defined curriculum of tasks, and the previous skills are never fine-tuned.
|
| 31 |
+
|
| 32 |
+
Our algorithm allows for seamless adaptation of the skills, showing no trade-off between leveraging the power of the hierarchy and the final performance in a new task. Other methods use invertible functions as skills (Haarnoja et al., 2018), and therefore a fixed skill can be fully overwritten when a new layer of hierarchy is added on top. This kind of “fine-tuning” is promising, although similar to other works (Peng et al., 2019), they do not apply it to temporally extended skills as we do here.
|
| 33 |
+
|
| 34 |
+
One of the most general frameworks to define temporally extended hierarchies is the options framework (Sutton et al., 1999), and it has recently been applied to continuous state spaces (Bacon et al., 2017). One of the most delicate parts of this formulation is the termination policy, and it requires several regularizers to avoid skill collapse (Harb et al., 2017; Vezhnevets et al., 2016). This modification of the objective may be difficult to tune and affects the final performance. Instead of adding such penalties, we propose to have skills of a random length, not controlled by the agent during training of the skills. The benefit is two-fold: no termination policy to train, and more stable skills that transfer better. Furthermore, these works only used discrete action MDPs. We lift this assumption, and show good performance of our algorithm in complex locomotion tasks. There are other algorithms recently proposed that go in the same direction, but we found them more complex, less principled (their per-action marginalization cannot capture well the temporal correlation within each option), and without available code or evidence of outperforming non-hierarchical methods (Smith et al., 2018).
|
| 35 |
+
|
| 36 |
+
The closest work to ours in terms of final algorithm structure is the one proposed by Frans et al. (2018). Their method can be included in our framework, and hence benefits from our new theoretical insights. We introduce a modification that is shown to be highly beneficial: the random timecommitment mentioned above, and find that our method can learn in difficult environments without their complicated training scheme.
|
| 37 |
+
|
| 38 |
+
# 4 EFFICIENT HIERARCHICAL POLICY GRADIENTS
|
| 39 |
+
|
| 40 |
+
When using a hierarchical policy, the intermediate decision taken by the higher level is not directly applied in the environment. Therefore, technically it should not be incorporated into the trajectory description as an observed variable, like the actions. This makes the policy gradient considerably harder to compute. In this section we first prove that, under mild assumptions, the hierarchical policy gradient can be accurately approximated without needing to marginalize over this latent variable. Then, we derive an unbiased baseline for the policy gradient that can reduce the variance of its estimate. Finally, with these findings, we present our method, Hierarchical Proximal Policy Optimization (HiPPO), an on-policy algorithm for hierarchical policies, allowing learning at all levels of the policy jointly and preventing sub-policy collapse.
|
| 41 |
+
|
| 42 |
+
# 4.1 APPROXIMATE HIERARCHICAL POLICY GRADIENT
|
| 43 |
+
|
| 44 |
+
Policy gradient algorithms are based on the likelihood ratio trick (Williams, 1992) to estimate the gradient of returns with respect to the policy parameters as
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { c l } { \displaystyle \nabla _ { \theta } \eta ( \pi _ { \theta } ) = \mathbb E _ { \tau } \big [ \nabla _ { \theta } \log P ( \tau ) R ( \tau ) \big ] \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { n } \nabla _ { \theta } \log P ( \tau _ { i } ) R ( \tau _ { i } ) } \\ { \displaystyle = \frac { 1 } { N } \sum _ { i = 1 } ^ { n } \frac { 1 } { H } \sum _ { t = 1 } ^ { H } \nabla _ { \theta } \log \pi _ { \theta } ( a _ { t } | s _ { t } ) R ( \tau _ { i } ) } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
In a temporal hierarchy, a hierarchical policy with a manager $\pi _ { \boldsymbol { \theta } _ { h } } \big ( \boldsymbol { z } _ { t } | \boldsymbol { s } _ { t } \big )$ selects every $p$ time-steps one of $n$ sub-policies to execute. These sub-policies, indexed by $z \in \mathbb { Z } _ { n }$ , can be represented as a single conditional probability distribution over actions $\pi _ { \boldsymbol { \theta } _ { l } } ( a _ { t } | \boldsymbol { z } _ { t } , \boldsymbol { s } _ { t } )$ . This allows us to not only use a given set of sub-policies, but also leverage skills learned with Stochastic Neural Networks (SNNs) (Florensa et al., 2017a). Under this framework, the probability of a trajectory $\tau = ( s _ { 0 } , a _ { 0 } , s _ { 1 } , \dots , s _ { H } )$ can be written as
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
P ( \tau ) = \Bigg ( \prod _ { k = 0 } ^ { H / p } \Big [ \sum _ { j = 1 } ^ { n } \pi _ { \theta _ { h } } ( z _ { j } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { j } ) \Big ] \Bigg ) \Bigg [ P ( s _ { 0 } ) \prod _ { t = 1 } ^ { H } P ( s _ { t + 1 } | s _ { t } , a _ { t } ) \Bigg ] .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
The mixture action distribution, which presents itself as an additional summation over skills, prevents additive factorization when taking the logarithm, as from Eq. 1 to 2. This can yield numerical instabilities due to the product of the $p$ sub-policy probabilities. For instance, in the case where all the skills are distinguishable all the sub-policies’ probabilities but one will have small values, resulting in an exponentially small value. In the following Lemma, we derive an approximation of the policy gradient, whose error tends to zero as the skills become more diverse, and draw insights on the interplay of the manager actions.
|
| 57 |
+
|
| 58 |
+
Lemma 1. If the skills are sufficiently differentiated, then the latent variable can be treated as part of the observation to compute the gradient of the trajectory probability. Let $\pi _ { \boldsymbol { \theta } _ { h } } ( z | s )$ and $\pi _ { \boldsymbol { \theta } _ { l } } ( a | s , z )$ be Lipschitz functions w.r.t. their parameters, and assume that $0 < \pi _ { \theta _ { l } } ( a | s , z _ { j } ) < \epsilon \forall j \neq k p$ , then
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\nabla _ { \theta } \log P ( \tau ) = \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log \pi _ { \theta _ { h } } ( z _ { k p } | s _ { k p } ) + \sum _ { t = 0 } ^ { H } \nabla _ { \theta } \log \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { k p } ) + \mathcal { O } ( n H \epsilon ^ { p - 1 } )
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Proof. See Appendix.
|
| 65 |
+
|
| 66 |
+
Our assumption can be seen as having diverse skills. Namely, for each action there is just one sub-policy that gives it high probability. In this case, the latent variable can be treated as part of the observation to compute the gradient of the trajectory probability. Many algorithms to extract lowerlevel skills are based on promoting diversity among the skills (Florensa et al., 2017a; Eysenbach et al., 2019), therefore usually satisfying our assumption. We further analyze how well this assumption holds in our experiments section and Table 2.
|
| 67 |
+
|
| 68 |
+
# 4.2 UNBIASED SUB-POLICY BASELINE
|
| 69 |
+
|
| 70 |
+
The policy gradient estimate obtained when applying the log-likelihood ratio trick as derived above is known to have large variance. A very common approach to mitigate this issue without biasing the estimate is to subtract a baseline from the returns (Peters & Schaal, 2008). It is well known that such baselines can be made state-dependent without incurring any bias. However, it is still unclear how to formulate a baseline for all the levels in a hierarchical policy, since an action dependent baseline does introduce bias in the gradient (Tucker et al., 2018). It has been recently proposed to use latent-conditioned baselines (Weber et al., 2019). Here we go further and prove that, under the assumptions of Lemma 1, we can formulate an unbiased latent dependent baseline for the approximate gradient (Eq. 5).
|
| 71 |
+
|
| 72 |
+
Lemma 2. For any functions $b _ { h } : S \mathbb { R }$ and $b _ { l } : \mathcal { S } \times \mathcal { Z } \to \mathbb { R }$ we have:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbb { E } _ { \tau } [ \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log P ( z _ { k p } | s _ { k p } ) b _ { h } ( s _ { k p } ) ] = 0 \quad a n d \quad \mathbb { E } _ { \tau } [ \sum _ { t = 0 } ^ { H } \nabla _ { \theta } \log \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { k p } ) b _ { l } ( s _ { t } , z _ { k p } ) ] = 0
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Proof. See Appendix.
|
| 79 |
+
|
| 80 |
+
Now we apply Lemma 1 and Lemma 2 to Eq. 1. By using the corresponding value functions as the function baseline, the return can be replaced by the Advantage function $A ( s _ { k p } , z _ { k p } )$ (see details in Schulman et al. (2016)), and we obtain the following approximate policy gradient expression:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\hat { g } = \mathbb { E } _ { \tau } \Big [ \big ( \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log \pi _ { \theta _ { h } } ( z _ { k p } | s _ { k p } ) A ( s _ { k p } , z _ { k p } ) \big ) + \big ( \sum _ { t = 0 } ^ { H } \nabla _ { \theta } \log \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { k p } ) A ( s _ { t } , a _ { t } , z _ { k p } ) \big ) \Big ]
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
This hierarchical policy gradient estimate can have lower variance than without baselines, but using it for policy optimization through stochastic gradient descent still yields an unstable algorithm. In the next section, we further improve the stability and sample efficiency of the policy optimization by incorporating techniques from Proximal Policy Optimization (Schulman et al., 2017).
|
| 87 |
+
|
| 88 |
+
# 4.3 HIERARCHICAL PROXIMAL POLICY OPTIMIZATION
|
| 89 |
+
|
| 90 |
+
Using an appropriate step size in policy space is critical for stable policy learning. Modifying the policy parameters in some directions may have a minimal impact on the distribution over actions, whereas small changes in other directions might change its behavior drastically and hurt training
|
| 91 |
+
|
| 92 |
+
# Algorithm 1 HiPPO Rollout
|
| 93 |
+
|
| 94 |
+
# Algorithm 2 HiPPO
|
| 95 |
+
|
| 96 |
+
1: Input: skills $\pi _ { \boldsymbol { \theta } _ { l } } ( a | s , z )$ , manager $\pi _ { \boldsymbol { \theta } _ { h } } ( z | s )$ , time
|
| 97 |
+
commitment bounds $P _ { \mathrm { m i n } }$ and $P _ { \mathrm { m a x } }$ , horizon $H$
|
| 98 |
+
2: Reset environment: $s _ { 0 } \sim \rho _ { 0 }$ , $t = 0$ .
|
| 99 |
+
3: while $t < H$ do
|
| 100 |
+
4: Sample time-commitment $p \sim \mathsf { C a t } ( [ P _ { \operatorname* { m i n } } , P _ { \operatorname* { m a x } } ] )$
|
| 101 |
+
5: Sample skill $z _ { t } \sim \pi _ { \theta _ { h } } ( \cdot | s _ { t } )$
|
| 102 |
+
6: for $t ^ { \prime } = t \ldots ( t + p )$ do
|
| 103 |
+
7: Sample action $a _ { t ^ { \prime } } \sim \pi _ { \theta _ { l } } ( \cdot | s _ { t ^ { \prime } } , z _ { t } )$
|
| 104 |
+
8: Observe new state $s _ { t ^ { \prime } + 1 }$ and reward $\boldsymbol { r } _ { t ^ { \prime } }$
|
| 105 |
+
9: end for
|
| 106 |
+
10: $t \gets t + p$
|
| 107 |
+
11: end while
|
| 108 |
+
12: Output: $\left( s _ { 0 } , z _ { 0 } , a _ { 0 } , s _ { 1 } , a _ { 1 } , \ldots , s _ { H } , z _ { H } , a _ { H } , s _ { H + 1 } \right)$
|
| 109 |
+
|
| 110 |
+
1: Input: skills $\pi _ { \boldsymbol { \theta } _ { l } } ( a | s , z )$ , manager $\pi _ { \boldsymbol { \theta } _ { h } } ( z | s )$ , horizon $H$ , learning rate $\alpha$
|
| 111 |
+
2: while not done do
|
| 112 |
+
3: for actor $= 1$ , 2, ..., N do
|
| 113 |
+
4: Obtain trajectory with HiPPO Rollout
|
| 114 |
+
5: Estimate advantages $\hat { A } ( a _ { t ^ { \prime } } , s _ { t ^ { \prime } } , z _ { t } )$ and $\bar { A } ( z _ { t } , s _ { t } )$
|
| 115 |
+
6: 7: $\theta \theta + \alpha \nabla _ { \theta } L _ { H i P P O } ^ { C L I P } ( \theta )$
|
| 116 |
+
8: end while
|
| 117 |
+
|
| 118 |
+
efficiency (Kakade, 2002). Trust region policy optimization (TRPO) uses a constraint on the KLdivergence between the old policy and the new policy to prevent this issue (Schulman et al., 2015). Unfortunately, hierarchical policies are generally represented by complex distributions without closed form expressions for the KL-divergence. Therefore, to improve the stability of our hierarchical policy gradient we turn towards Proximal Policy Optimization (PPO) (Schulman et al., 2017). PPO is a more flexible and compute-efficient algorithm. In a nutshell, it replaces the KL-divergence constraint with a cost function that achieves the same trust region benefits, but only requires the computation of the likelihood. Letting $\begin{array} { r } { w _ { t } ( \theta ) = \frac { \pi _ { \theta } \left( a _ { t } | s _ { t } \right) } { \pi _ { \theta _ { o l d } } \left( a _ { t } | s _ { t } \right) } } \end{array}$ , the PPO objective is:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
L ^ { C L I P } ( \theta ) = \mathbb { E } _ { t } \operatorname* { m i n } \left\{ w _ { t } ( \theta ) A _ { t } , \mathrm { ~ c ~ l ~ i p } ( w _ { t } ( \theta ) , 1 - \epsilon , 1 + \epsilon ) A _ { t } \right\}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
We can adapt our approximated hierarchical policy gradient with the same approach by letting $\begin{array} { r } { w _ { h , k p } ( \theta ) \ = \ \frac { \pi _ { \theta _ { h } } ( z _ { k p } | s _ { k p } ) } { \pi _ { \theta _ { h , o l d } } ( z _ { k p } | s _ { k p } ) } } \end{array}$ and $\begin{array} { r } { w _ { l , t } ( \theta ) = \frac { \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { k p } ) } { \pi _ { \theta _ { l , o l d } } ( a _ { t } | s _ { t } , z _ { k p } ) } } \end{array}$ , and using the super-index clip to denote the clipped objective version, we obtain the new surrogate objective:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\begin{array} { c } { { { \displaystyle { \cal L } _ { H i P P O } ^ { C L I P } } ( \theta ) = \mathbb { E } _ { \tau } \Big [ \displaystyle { \sum _ { k = 0 } ^ { H / p } \operatorname* { m i n } \left\{ w _ { h , k p } ( \theta ) A ( s _ { k p } , z _ { k p } ) , w _ { h , k p } ^ { \mathrm { c l i p } } ( \theta ) A ( s _ { k p } , z _ { k p } ) \right\} } \qquad } } \\ { { + \displaystyle { \sum _ { t = 0 } ^ { H } \operatorname* { m i n } \left\{ w _ { l , t } ( \theta ) A ( s _ { t } , a _ { t } , z _ { k p } ) , w _ { l , t } ^ { \mathrm { c l i p } } ( \theta ) A ( s _ { t } , a _ { t } , z _ { k p } ) \right\} } \Big ] } } \end{array}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
We call this algorithm Hierarchical Proximal Policy Optimization (HiPPO). Next, we introduce a critical additions: a switching of the time-commitment between skills.
|
| 131 |
+
|
| 132 |
+
# 4.4 VARYING TIME-COMMITMENT
|
| 133 |
+
|
| 134 |
+
Most hierarchical methods either consider a fixed time-commitment to the lower level skills (Florensa et al., 2017a; Frans et al., 2018), or implement the complex options framework (Precup, 2000; Bacon et al., 2017). In this work we propose an in-between, where the time-commitment to the skills is a random variable sampled from a fixed distribution Categorical $( T _ { \mathrm { m i n } } , T _ { \mathrm { m a x } } )$ just before the manager takes a decision. This modification does not hinder final performance, and we show it improves zero-shot adaptation to a new task. This approach to sampling rollouts is detailed in Algorithm 1. The full algorithm is detailed in Algorithm 2.
|
| 135 |
+
|
| 136 |
+
# 5 EXPERIMENTS
|
| 137 |
+
|
| 138 |
+
We designed our experiments to answer the following questions: 1) How does HiPPO compare against a flat policy when learning from scratch? 2) Does it lead to policies more robust to environment changes? 3) How well does it adapt already learned skills? and 4) Does our skill diversity assumption hold in practice?
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 2: Environments used to evaluate the performance of our method. Every episode has a different configuration: wall heights for (a)-(b), ball positions for (c)-(d)
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 3: Analysis of different time-commitment strategies on learning from scratch.
|
| 145 |
+
|
| 146 |
+
# 5.1 TASKS
|
| 147 |
+
|
| 148 |
+
We evaluate our approach on a variety of robotic locomotion and navigation tasks. The Block environments, depicted in Fig. 2a-2b, have walls of random heights at regular intervals, and the objective is to learn a gait for the Hopper and Half-Cheetah robots to jump over them. The agents observe the height of the wall ahead and their proprioceptive information (joint positions and velocities), receiving a reward of $+ 1$ for each wall cleared. The Gather environments, described by Duan et al. (2016), require agents to collect apples (green balls, $+ 1$ reward) while avoiding bombs (red balls, -1 reward). The only available perception beyond proprioception is through a LIDAR-type sensor indicating at what distance are the objects in different directions, and their type, as depicted in the bottom left corner of Fig. 2c-2d. This is challenging hierarchical task with sparse rewards that requires simultaneously learning perception, locomotion, and higher-level planning capabilities. We use the Snake and Ant robots in Gather. Details for all robotic agents are provided in Appendix B.
|
| 149 |
+
|
| 150 |
+
# 5.2 LEARNING FROM SCRATCH AND TIME-COMMITMENT
|
| 151 |
+
|
| 152 |
+
In this section, we study the benefit of using our HiPPO algorithm instead of standard PPO on a flat policy (Schulman et al., 2017). The results, reported in Figure 3, demonstrate that training from scratch with HiPPO leads to faster learning and better performance than flat PPO. Furthermore, we show that the benefit of HiPPO does not just come from having temporally correlated exploration: PPO with action repeat converges at a lower performance than our method. HiPPO leverages the time-commitment more efficiently, as suggested by the poor performance of the ablation where we set $p = 1$ , when the manager takes an action every environment step as well. Finally, Figure 4 shows the effectiveness of using the presented skill-dependent baseline.
|
| 153 |
+
|
| 154 |
+
# 5.3 COMPARISON TO OTHER METHODS
|
| 155 |
+
|
| 156 |
+
We compare HiPPO to current state-of-the-art hierarchical methods. First, we evaluate HIRO (Nachum et al., 2018), an off-policy RL method based on training a goal-reaching lower level policy. Fig. 5 shows that HIRO achieves poor performance on our tasks. As further detailed in Appendix D, this algorithm is sensitive to access to ground-truth information, like the exact $( x , y )$ position of the robot in Gather. In contrast, our method is able to perform well directly from the raw sensory inputs described in Section 5.1. We evaluate Option-Critic (Bacon et al., 2017), a variant of the options framework (Sutton et al., 1999) that can be used for continuous action-spaces. It fails to learn, and we hypothesize that their algorithm provides less time-correlated exploration and learns less diverse skills. We also compare against MLSH (Frans et al., 2018), which repeatedly samples new environment configurations to learn primitive skills. We take these hyperparameters from their Ant Twowalk experiment: resetting the environment configuration every 60 iterations, a warmup period of 20 during which only the manager is trained, and a joint training period of 40 during which both manager and skills are trained. Our results show that such a training scheme does not provide any benefits. Finally, we provide a comparison to a direct application of our Hierarchical Vanilla Policy Gradient (HierVPG) algorithm, and we see that the algorithm is unstable without PPO’s trust-region-like technique.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 4: Using a skill-conditioned baseline, as defined in Section 4.2, generally improves performance of HiPPO when learning from scratch.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 5: Comparison of HiPPO and HierVPG to prior hierarchical methods on learning from scratch.
|
| 163 |
+
|
| 164 |
+
# 5.4 ROBUSTNESS TO DYNAMICS PERTURBATIONS
|
| 165 |
+
|
| 166 |
+
We investigate the robustness of HiPPO to changes in the dynamics of the environment. We perform several modifications to the base Snake Gather and Ant Gather environments. One at a time, we change the body mass, dampening of the joints, body inertia, and friction characteristics of both robots. The results, presented in Table 1, show that HiPPO with randomized period Categorical $( [ T _ { \operatorname* { m i n } } , T _ { \operatorname* { m a x } } ] )$ is able to better handle these dynamics changes. In terms of the drop in policy performance between the training environment and test environment, it outperforms HiPPO with fixed period on 6 out of 8 related tasks. These results suggest that the randomized period exposes the policy to a wide range of scenarios, which makes it easier to adapt when the environment changes.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Gather</td><td>Algorithm</td><td>Initial</td><td>Mass</td><td>Dampening</td><td>Inertia</td><td>Friction</td></tr><tr><td rowspan="3">Snake</td><td>Flat PPO</td><td>2.72</td><td>3.16 (+16%)</td><td>2.75 (+1%)</td><td>2.11 (-22%)</td><td>2.75 (+1%)</td></tr><tr><td>HiPPO,p = 10</td><td>4.38</td><td>3.28 (-25%)</td><td>3.27 (-25%)</td><td>3.03 (-31%)</td><td>3.27 (-25%)</td></tr><tr><td>HiPPO random p</td><td>5.11</td><td>4.09 (-20%)</td><td>4.03 (-21%)</td><td>3.21 (-37%)</td><td>4.03 (-21%)</td></tr><tr><td rowspan="3">Ant</td><td>Flat PPO</td><td>2.25</td><td>2.53 (+12%)</td><td>2.13 (-5%)</td><td>2.36 (+5%)</td><td>1.96 (-13%)</td></tr><tr><td>HiPPO,p = 10</td><td>3.84</td><td>3.31 (-14%)</td><td>3.37 (-12%)</td><td>2.88 (-25%)</td><td>3.07 (-20%)</td></tr><tr><td>HiPPO random p</td><td>3.22</td><td>3.37 (+5%)</td><td>2.57 (-20%)</td><td>3.36 (+4%)</td><td>2.84 (-12%)</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 1: Zero-shot transfer performance. The final return in the initial environment is shown, as well as the average return over 25 rollouts in each new modified environment.
|
| 171 |
+
|
| 172 |
+
# 5.5 ADAPTATION OF PRE-TRAINED SKILLS
|
| 173 |
+
|
| 174 |
+
For the Block task, we use DIAYN (Eysenbach et al., 2019) to train 6 differentiated subpolicies in an environment without any walls. Here, we see if these diverse skills can improve performance on a downstream task that’s out of the training distribution. For Gather, we take 6 pretrained subpolicies encoded by a Stochastic Neural Network (Tang & Salakhutdinov, 2013) that was trained in a diversity-promoting environment (Florensa et al., 2017a). We fine-tune them with HiPPO on the Gather environment, but with an extra penalty on the velocity of the Center of Mass. This can be understood as a preference for cautious behavior. This requires adjustment of the sub-policies, which were trained with a proxy reward encouraging them to move as far as possible (and hence quickly). Fig. 6 shows that using HiPPO to simultaneously train a manager and fine-tune the skills achieves higher final performance than fixing the sub-policies and only training a manager with PPO. The two initially learn at the same rate, but HiPPO’s ability to adjust to the new dynamics allows it to reach a higher final performance. Fig. 6 also shows that HiPPO can fine-tune the same given skills better than Option-Critic (Bacon et al., 2017), MLSH (Frans et al., 2018), and HIRO (Nachum et al., 2018).
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 6: Benefit of adapting some given skills when the preferences of the environment are different from those of the environment where the skills were originally trained. Adapting skills with HiPPO has better learning performance than leaving the skills fixed or learning from scratch.
|
| 178 |
+
|
| 179 |
+
# 5.6 SKILL DIVERSITY ASSUMPTION
|
| 180 |
+
|
| 181 |
+
In Lemma 1, we derived a more efficient and numerically stable gradient by assuming that the sub-policies are diverse. In this section, we empirically test the validity of our assumption and the quality of our approximation. We run the HiPPO algorithm on Ant Gather and Snake Gather both from scratch and with given pretrained skills, as done in the previous section. In Table 2, we report the average maximum probability under other sub-policies, corresponding to $\epsilon$ from the assumption. In all settings, this is on the order of magnitude of 0.1. Therefore, under the $p \approx 1 0$ that we use in our experiments, the term we neglect has a factor $\epsilon ^ { p - 1 } = 1 0 ^ { - 1 0 }$ . It is not surprising then that the average cosine similarity between the full gradient and our approximation is almost 1, as reported in Table 2.
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Gather</td><td>Algorithm</td><td>Cosine Sim.</td><td>maxz'+zkp T0((at|st,2')</td><td>π0(at|st,2kp)</td></tr><tr><td rowspan="2">Snake</td><td>HiPPO on given skills</td><td>0.98±0.01</td><td>0.09± 0.04</td><td>0.44 ± 0.03</td></tr><tr><td>HiPPO on random skills</td><td>0.97 ± 0.03</td><td>0.12 ± 0.03</td><td>0.32 ± 0.04</td></tr><tr><td rowspan="2">Ant</td><td>HiPPO on given skills</td><td>0.96±0.04</td><td>0.11 ± 0.05</td><td>0.40±0.08</td></tr><tr><td>HiPPO on random skills</td><td>0.94 ± 0.03</td><td>0.13 ± 0.05</td><td>0.31 ± 0.09</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Table 2: Empirical evaluation of Lemma 1. In the middle and right columns, we evaluate the quality of our assumption by computing the largest probability of a certain action under other skills (), and the action probability under the actual latent. We also report the cosine similarity between our approximate gradient and the exact gradient from Eq. 3. The mean and standard deviation of these values are computed over the full batch collected at iteration 10.
|
| 186 |
+
|
| 187 |
+
# 6 CONCLUSIONS AND FUTURE WORK
|
| 188 |
+
|
| 189 |
+
In this paper, we examined how to effectively adapt temporal hierarchies. We began by deriving a hierarchical policy gradient and its approximation. We then proposed a new method, HiPPO, that can stably train multiple layers of a hierarchy jointly. The adaptation experiments suggest that we can optimize pretrained skills for downstream environments, and learn emergent skills without any unsupervised pre-training. We also demonstrate that HiPPO with randomized period can learn from scratch on sparse-reward and long time horizon tasks, while outperforming non-hierarchical methods on zero-shot transfer.
|
| 190 |
+
|
| 191 |
+
# REFERENCES
|
| 192 |
+
|
| 193 |
+
Jacob Andreas, Dan Klein, and Sergey Levine. Modular Multitask Reinforcement Learning with Policy Sketches. International Conference in Machine Learning, 2017. URL http://github. com/.
|
| 194 |
+
|
| 195 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The Option-Critic Architecture. AAAI, pp. 1726– 1734, 2017. URL http://arxiv.org/abs/1609.05140.
|
| 196 |
+
|
| 197 |
+
Christian Daniel, Herke van Hoof, Jan Peters, Gerhard Neumann, Thomas Gärtner, Mirco Nanni, Andrea Passerini, and Celine B Robardet Christian Daniel ChristianDaniel. Probabilistic inference for determining options in reinforcement learning. Machine Learning, 104(104), 2016. doi: 10.1007/s10994-016-5580-x.
|
| 198 |
+
|
| 199 |
+
Peter Dayan and Geoffrey E. Hinton. Feudal Reinforcement Learning. Advances in Neural Information Processing Systems, pp. 271–278, 1993. ISSN 0143991X. doi: 10.1108/IR-08-2017-0143. URL http://www.cs.toronto.edu/\~fritz/absps/dh93.pdf.
|
| 200 |
+
|
| 201 |
+
Yan Duan, Xi Chen, John Schulman, and Pieter Abbeel. Benchmarking Deep Reinforcement Learning for Continuous Control. International Conference in Machine Learning, 2016. URL http://arxiv.org/abs/1604.06778.
|
| 202 |
+
|
| 203 |
+
Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is All You Need: Learning Skills without a Reward Function. International Conference in Learning Representations, 2019. URL http://arxiv.org/abs/1802.06070.
|
| 204 |
+
|
| 205 |
+
Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic Neural Networks for Hierarchical Reinforcement Learning. International Conference in Learning Representations, pp. 1–17, 2017a. ISSN 14779129. doi: 10.1002/rcm.765. URL http://arxiv.org/abs/1704.03012.
|
| 206 |
+
|
| 207 |
+
Carlos Florensa, David Held, Markus Wulfmeier, Michael Zhang, and Pieter Abbeel. Reverse Curriculum Generation for Reinforcement Learning. Conference on Robot Learning, pp. 1–16, 2017b. ISSN 1938-7228. doi: 10.1080/00908319208908727. URL http://arxiv.org/ abs/1707.05300.
|
| 208 |
+
|
| 209 |
+
Carlos Florensa, Jonas Degrave, Nicolas Heess, Jost Tobias Springenberg, and Martin Riedmiller. Self-supervised Learning of Image Embedding for Continuous Control. In Workshop on Inference to Control at NeurIPS, 2018. URL http://arxiv.org/abs/1901.00943.
|
| 210 |
+
|
| 211 |
+
Kevin Frans, Jonathan Ho, Xi Chen, Pieter Abbeel, and John Schulman. Meta Learning Shared Hierarchies. International Conference in Learning Representations, pp. 1–11, 2018. ISSN 14639076. doi: 10.1039/b203755f. URL http://arxiv.org/abs/1710.09767.
|
| 212 |
+
|
| 213 |
+
Mohammad Ghavamzadeh and Sridhar Mahadevan. Hierarchical Policy Gradient Algorithms. International Conference in Machine Learning, 2003. URL http://chercheurs.lille. inria.fr/\~ghavamza/my_website/Publications_files/icml03.pdf.
|
| 214 |
+
|
| 215 |
+
Tuomas Haarnoja, Kristian Hartikainen, Pieter Abbeel, and Sergey Levine. Latent Space Policies for Hierarchical Reinforcement Learning. Internation Conference in Machine Learning, 2018. URL http://arxiv.org/abs/1804.02808.
|
| 216 |
+
|
| 217 |
+
Jean Harb, Pierre-Luc Bacon, Martin Klissarov, and Doina Precup. When Waiting is not an Option : Learning Options with a Deliberation Cost. AAAI, 9 2017. URL http://arxiv.org/abs/ 1709.04571.
|
| 218 |
+
|
| 219 |
+
Karol Hausman, Jost Tobias Springenberg, Ziyu Wang, Nicolas Heess, and Martin Riedmiller. Learning an Embedding Space for Transferable Robot Skills. International Conference in Learning Representations, pp. 1–16, 2018.
|
| 220 |
+
|
| 221 |
+
Nicolas Heess, Greg Wayne, Yuval Tassa, Timothy Lillicrap, Martin Riedmiller, David Silver, and Google Deepmind. Learning and Transfer of Modulated Locomotor Controllers. 2016. URL https://arxiv.org/abs/1610.05182.
|
| 222 |
+
|
| 223 |
+
Nicolas Heess, Dhruva TB, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, S. M. Ali Eslami, Martin Riedmiller, and David Silver. Emergence of Locomotion Behaviours in Rich Environments. 7 2017. URL http://arxiv.org/abs/ 1707.02286.
|
| 224 |
+
|
| 225 |
+
Sham Kakade. A Natural Policy Gradient. Advances in Neural Information Processing Systems, 2002.
|
| 226 |
+
|
| 227 |
+
Tejas D Kulkarni, Karthik R Narasimhan, Ardavan Saeedi CSAIL, and Joshua B Tenenbaum BCS. Hierarchical Deep Reinforcement Learning: Integrating Temporal Abstraction and Intrinsic Motivation. Advances in Neural Information Processing Systems, pp. 1–13, 2016.
|
| 228 |
+
|
| 229 |
+
Hoang M Le, Nan Jiang, Alekh Agarwal, Miroslav Dud, and Yue Hal. Hierarchical Imitation and Reinforcement Learning. International Conference in Machine Learning, 2018.
|
| 230 |
+
|
| 231 |
+
Andrew Levy, Robert Platt, and Kate Saenko. Hierarchical Actor-Critic. arXiv:1712.00948, 12 2017. URL http://arxiv.org/abs/1712.00948.
|
| 232 |
+
|
| 233 |
+
Andrew Levy, Robert Platt, and Kate Saenko. Hierarchical Reinforcement Learning with Hindsight. International Conference on Learning Representations, 5 2019. URL http://arxiv.org/ abs/1805.08180.
|
| 234 |
+
|
| 235 |
+
Josh Merel, Arun Ahuja, Vu Pham, Saran Tunyasuvunakool, Siqi Liu, Dhruva Tirumala, Nicolas Heess, and Greg Wayne. Hierarchical visuomotor control of humanoids. International Conference in Learning Representations, 2019. URL http://arxiv.org/abs/1811.09656.
|
| 236 |
+
|
| 237 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei a Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 238 |
+
|
| 239 |
+
Ofir Nachum, Honglak Lee, Shane Gu, and Sergey Levine. Data-Efficient Hierarchical Reinforcement Learning. Advances in Neural Information Processing Systems, 2018.
|
| 240 |
+
|
| 241 |
+
Ashvin Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual Reinforcement Learning with Imagined Goals. Adavances in Neural Information Processing Systems, 2018.
|
| 242 |
+
|
| 243 |
+
OpenAI, Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, and Alex Ray. Learning Dexterous In-Hand Manipulation. pp. 1–27, 2018.
|
| 244 |
+
|
| 245 |
+
Xue Bin Peng, Michael Chang, Grace Zhang, Pieter Abbeel, and Sergey Levine. MCP: Learning Composable Hierarchical Control with Multiplicative Compositional Policies. 5 2019. URL http://arxiv.org/abs/1905.09808.
|
| 246 |
+
|
| 247 |
+
Jan Peters and Stefan Schaal. Natural Actor-Critic. Neurocomputing, 71(7-9):1180–1190, 2008. ISSN 09252312. doi: 10.1016/j.neucom.2007.11.026.
|
| 248 |
+
|
| 249 |
+
Doina Precup. Temporal abstraction in reinforcement learning, 1 2000. URL https:// scholarworks.umass.edu/dissertations/AAI9978540.
|
| 250 |
+
|
| 251 |
+
Pravesh Ranchod, Benjamin Rosman, and George Konidaris. Nonparametric Bayesian Reward Segmentation for Skill Discovery Using Inverse Reinforcement Learning. 2015. ISSN 21530866. doi: 10.1109/IROS.2015.7353414.
|
| 252 |
+
|
| 253 |
+
John Schulman, Philipp Moritz, Michael Jordan, and Pieter Abbeel. Trust Region Policy Optimization. International Conference in Machine Learning, 2015.
|
| 254 |
+
|
| 255 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael I Jordan, and Pieter Abbeel. HIGHDIMENSIONAL CONTINUOUS CONTROL USING GENERALIZED ADVANTAGE ESTIMATION. International Conference in Learning Representations, pp. 1–14, 2016.
|
| 256 |
+
|
| 257 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal Policy Optimization Algorithms. 2017. URL https://openai-public.s3-us-west-2. amazonaws.com/blog/2017-07/ppo/ppo-arxiv.pdf.
|
| 258 |
+
|
| 259 |
+
Arjun Sharma, Mohit Sharma, Nicholas Rhinehart, and Kris M Kitani. Directed-Info GAIL: Learning Hierarchical Policies from Unsegmented Demonstrations using Directed Information. International Conference in Learning Representations, 2018. URL http://arxiv.org/abs/1810. 01266.
|
| 260 |
+
|
| 261 |
+
Tianmin Shu, Caiming Xiong, and Richard Socher. Hierarchical and interpretable skill acquisition in multi-task reinforcement Learning. International Conference in Learning Representations, 3:1–13, 2018. doi: 10.1109/MWC.2016.7553036.
|
| 262 |
+
|
| 263 |
+
David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, Yutian Chen, Timothy Lillicrap, Fan Hui, Laurent Sifre, George Van Den Driessche, Thore Graepel, and Demis Hassabis. Mastering the game of Go without human knowledge. Nature, 550(7676):354–359, 10 2017. ISSN 14764687. doi: 10.1038/nature24270. URL http://arxiv.org/abs/1610.00633.
|
| 264 |
+
|
| 265 |
+
Matthew J. A. Smith, Herke van Hoof, and Joelle Pineau. An inference-based policy gradient method for learning options, 2 2018. URL https://openreview.net/forum?id $=$ rJIgf7bAZ.
|
| 266 |
+
|
| 267 |
+
Sungryull Sohn, Junhyuk Oh, and Honglak Lee. Multitask Reinforcement Learning for Zero-shot Generalization with Subtask Dependencies. Advances in Neural Information Processing Systems, 2018.
|
| 268 |
+
|
| 269 |
+
Richard S Sutton, Doina Precup, and Satinder Singh. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112: 181–211, 1999. URL http://www-anw.cs.umass.edu/\~barto/courses/cs687/ Sutton-Precup-Singh-AIJ99.pdf.
|
| 270 |
+
|
| 271 |
+
Yichuan Tang and Ruslan Salakhutdinov. Learning Stochastic Feedforward Neural Networks. Advances in Neural Information Processing Systems, 2:530–538, 2013. doi: 10.1.1.63.1777.
|
| 272 |
+
|
| 273 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. MuJoCo $:$ A physics engine for model-based control. pp. 5026–5033, 2012.
|
| 274 |
+
|
| 275 |
+
George Tucker, Surya Bhupatiraju, Shixiang Gu, Richard E Turner, Zoubin Ghahramani, and Sergey Levine. The Mirage of Action-Dependent Baselines in Reinforcement Learning. Internation Conference in Machine Learning, 2018. URL http://arxiv.org/abs/1802.10031.
|
| 276 |
+
|
| 277 |
+
Alexander Vezhnevets, Volodymyr Mnih, John Agapiou, Simon Osindero, Alex Graves, Oriol Vinyals, and Koray Kavukcuoglu Google DeepMind. Strategic Attentive Writer for Learning Macro-Actions. Advances in Neural Information Processing Systems, 2016.
|
| 278 |
+
|
| 279 |
+
Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal Networks for Hierarchical Reinforcement Learning. International Conference in Machine Learning, 2017. URL https://arxiv.org/pdf/ 1703.01161.pdf.
|
| 280 |
+
|
| 281 |
+
Théophane Weber, Nicolas Heess, Lars Buesing, and David Silver. Credit Assignment Techniques in Stochastic Computation Graphs. 1 2019. URL http://arxiv.org/abs/1901.01761.
|
| 282 |
+
|
| 283 |
+
Ronald J Williams. Simple Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning. Machine Learning, 8(3-4):229–256, 1992.
|
| 284 |
+
|
| 285 |
+
# A HYPERPARAMETERS AND ARCHITECTURES
|
| 286 |
+
|
| 287 |
+
The Block environments used a horizon of 1000 and a batch size of 50,000, while Gather used a batch size of 100,000. Ant Gather has a horizon of 5000, while Snake Gather has a horizon of 8000 due to its larger size. For all experiments, both PPO and HiPPO used learning rate $3 \times 1 0 ^ { - 3 }$ , clipping parameter $\epsilon = 0 . 1$ , 10 gradient updates per iteration, and discount $\gamma = 0 . 9 9 9$ . The learning rate, clipping parameter, and number of gradient updates come from the OpenAI Baselines implementation.
|
| 288 |
+
|
| 289 |
+
HiPPO used $n = 6$ sub-policies. HiPPO uses a manager network with 2 hidden layers of 32 units, and a skill network with 2 hidden layers of 64 units. In order to have roughly the same number of parameters for each algorithm, flat PPO uses a network with 2 hidden layers with 256 and 64 units respectively. For HiPPO with randomized period, we resample $p \sim \mathrm { U n i f o r m } \{ 5 , 1 5 \}$ every time the manager network outputs a latent, and provide the number of timesteps until the next latent selection as an input into both the manager and skill networks. The single baselines and skill-dependent baselines used a MLP with 2 hidden layers of 32 units to fit the value function. The skill-dependent baseline receives, in addition to the full observation, the active latent code and the time remaining until the next skill sampling. All runs used five random seeds.
|
| 290 |
+
|
| 291 |
+
# B ROBOT AGENT DESCRIPTION
|
| 292 |
+
|
| 293 |
+
Hopper is a 3-link robot with a 14-dimensional observation space and a 3-dimensional action space. Half-Cheetah has a 20-dimensional observation space and a 6-dimensional action space. We evaluate both of these agents on a sparse block hopping task. In addition to observing their own joint angles and positions, they observe the height and length of the next wall, the $\mathbf { X }$ -position of the next wall, and the distance to the wall from the agent. We also provide the same wall observations for the previous wall, which the agent can still interact with.
|
| 294 |
+
|
| 295 |
+
Snake is a 5-link robot with a 17-dimensional observation space and a 4-dimensional action space. Ant is a quadrupedal robot with a 27-dimensional observation space and a 8-dimensional action space. Both Ant and Snake can move and rotate in all directions, and Ant faces the added challenge of avoiding falling over irrecoverably. In the Gather environment, agents also receive 2 sets of 10-dimensional lidar observations, whcih correspond to separate apple and bomb observations. The observation displays the distance to the nearest apple or bomb in each $3 6 ^ { \circ }$ bin, respectively. All environments are simulated with the physics engine MuJoCo (Todorov et al., 2012).
|
| 296 |
+
|
| 297 |
+
# C PROOFS
|
| 298 |
+
|
| 299 |
+
Lemma 1. If the skills are sufficiently differentiated, then the latent variable can be treated as part of the observation to compute the gradient of the trajectory probability. Concretely, if $\pi _ { \boldsymbol { \theta } _ { h } } ( z | s )$ and $\pi _ { \boldsymbol { \theta } _ { l } } ( a | s , z )$ are Lipschitz in their parameters, and $0 \overset { \cdot } { < } \pi _ { \theta _ { l } } ( \bar { a } _ { t } \vert s _ { t } , z _ { j } ) < \epsilon \forall j \neq k p$ , then
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\nabla _ { \theta } \log P ( \tau ) = \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log \pi _ { \theta _ { h } } ( z _ { k p } | s _ { k p } ) + \sum _ { t = 1 } ^ { p } \nabla _ { \theta } \log \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { k p } ) + \mathcal { O } ( n H \epsilon ^ { p - 1 } )
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
Proof. From the point of view of the MDP, a trajectory is a sequence $\begin{array} { r l } { \tau } & { { } = } \end{array}$ $( s _ { 0 } , a _ { 0 } , s _ { 1 } , a _ { 1 } , \ldots , a _ { H - 1 } , s _ { H } )$ . Let’s assume we use the hierarchical policy introduced above, with a higher-level policy modeled as a parameterized discrete distribution with $n$ possible outcomes $\pi _ { \boldsymbol { \theta } _ { h } } ( \bar { z } | s ) = C \bar { a } t e g o r i c a l _ { \boldsymbol { \theta } _ { h } } ( n )$ . We can expand $P ( \tau )$ into the product of policy and environment dynamics terms, with $z _ { j }$ denoting the $j$ th possible value out of the $n$ choices,
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
P ( \tau ) = \Bigg ( \prod _ { k = 0 } ^ { H / p } \Big [ \sum _ { j = 1 } ^ { n } \pi _ { \theta _ { h } } ( z _ { j } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { j } ) \Big ] \Bigg ) \Bigg [ P ( s _ { 0 } ) \prod _ { t = 1 } ^ { H } P ( s _ { t + 1 } | s _ { t } , a _ { t } ) \Bigg ]
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
Taking the gradient of $\log { P ( \tau ) }$ with respect to the policy parameters $\theta = [ \theta _ { h } , \theta _ { l } ]$ , the dynamics terms disappear, leaving:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { l } { { \displaystyle 7 _ { \theta } \log P ( \tau ) = \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log \Big ( \sum _ { j = 1 } ^ { n } \pi _ { \theta _ { l } } ( z _ { j } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { s , \theta } ( a _ { t } | s _ { t } , z _ { j } ) \Big ) } } \\ { { \displaystyle \qquad = \sum _ { k = 0 } ^ { H / p } \frac { 1 } { \sum _ { j = 1 } ^ { n } \pi _ { \theta _ { h } } ( z _ { j } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { j } ) } \sum _ { j = 1 } ^ { n } \nabla _ { \theta } \Big ( \pi _ { \theta _ { h } } ( z _ { j } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { j } ) \Big ) } } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
The sum over possible values of $z$ prevents the logarithm from splitting the product over the $p$ -step sub-trajectories. This term is problematic, as this product quickly approaches 0 as $p$ increases, and suffers from considerable numerical instabilities. Instead, we want to approximate this sum of products by a single one of the terms, which can then be decomposed into a sum of logs. For this we study each of the terms in the sum: the gradient of a sub-trajectory probability under a specific latent $\begin{array} { r } { \nabla _ { \theta } \Big ( \pi _ { \theta _ { h } } ( z _ { j } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , \bar { z } _ { j } ) \Big ) } \end{array}$ . Now we can use the assumption that the skills are easy to distinguish, $0 < \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { j } ) < \epsilon \forall j \neq k p$ . Therefore, the probability of the sub-trajectory under a latent different than the one that was originally sampled $z _ { j } \neq z _ { k p }$ , is upper bounded by $\epsilon ^ { p }$ . Taking the gradient, applying the product rule, and the Lipschitz continuity of the policies, we obtain that for all $z _ { j } \neq z _ { k p }$ ,
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { l l } { { \displaystyle 7 _ { \theta } \Big ( \pi _ { \theta _ { h } } ( z _ { j } | s _ { k p } ) } } & { { \displaystyle \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { j } ) \Big ) = \nabla _ { \theta } \pi _ { \theta _ { h } } ( z _ { j } | s _ { k p } ) } } & { { \displaystyle \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { j } ) } + } \\ { { } } & { { \displaystyle \sum _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { h } } ( z _ { j } | s _ { k p } ) \big ( \nabla _ { \theta } \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { j } ) \big ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { l } } ( a _ { t ^ { \prime } } | s _ { t ^ { \prime } } ) \Big \} } } \\ { { } } & { { \displaystyle = \mathcal { O } ( p \epsilon ^ { p - 1 } ) } } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Thus, we can across the board replace the summation over latents by the single term corresponding to the latent that was sampled at that time.
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { l } { { \displaystyle \zeta _ { \theta } \log P ( \tau ) = \sum _ { k = 0 } ^ { H / p } \frac { 1 } { \pi _ { \theta _ { h } } ( z _ { k p } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { t } } ( a _ { t } | s _ { t } , z _ { k p } ) } \nabla _ { \theta } \Big ( P ( z _ { k p } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { t } } ( a _ { t } | s _ { t } , z _ { k p } ) \Big ) } } \\ { { \displaystyle \qquad = \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log \Big ( \pi _ { \theta _ { h } } ( z _ { k p } | s _ { k p } ) \prod _ { t = k p } ^ { ( k + 1 ) p - 1 } \pi _ { \theta _ { t } } ( a _ { t } | s _ { t } , z _ { k p } ) \Big ) + \mathcal { O } ( n H \epsilon ^ { p - 1 } ) } } \\ { { \displaystyle \qquad = \mathbb { E } _ { \tau } \bigg [ \Big ( \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log \pi _ { \theta _ { h } } \big ( z _ { k p } | s _ { k p } ) + \sum _ { t = 1 } ^ { H } \nabla _ { \theta } \log \pi _ { \theta _ { t } } ( a _ { t } | s _ { t } , z _ { k p } ) \Big ) \bigg ] + \mathcal { O } ( n H \epsilon ^ { p - 1 } ) } } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
Interestingly, this is exactly $\nabla _ { \theta } P ( s _ { 0 } , z _ { 0 } , a _ { 0 } , s _ { 1 } , \dots )$ . In other words, it’s the gradient of the probability of that trajectory, where the trajectory now includes the variables $z$ as if they were observed.
|
| 330 |
+
|
| 331 |
+
Lemma 2. For any functions $b _ { h } : S \mathbb { R }$ and $b _ { l } : \mathcal { S } \times \mathcal { Z } \to \mathbb { R }$ we have:
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\mathbb { E } _ { \tau } [ \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log P ( z _ { k p } | s _ { k p } ) b ( s _ { k p } ) ] = 0
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\mathbb { E } _ { \tau } [ \sum _ { t = 0 } ^ { H } \nabla _ { \theta } \log \pi _ { \theta _ { l } } ( a _ { t } | s _ { t } , z _ { k p } ) b ( s _ { t } , z _ { k p } ) ] = 0
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
Proof. We can use the tower property as well as the fact that the interior expression only depends on $s _ { k p }$ and $z _ { k p }$ :
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\begin{array} { r l } { \mathbb { E } _ { \tau } [ \displaystyle \sum _ { k = 0 } ^ { H / p } \nabla _ { \theta } \log P ( z _ { k p } | s _ { k p } ) b ( s _ { k p } ) ] = \displaystyle \sum _ { k = 0 } ^ { H / p } \mathbb { E } _ { s _ { k p } , z _ { k p } } [ \mathbb { E } _ { \tau \setminus s _ { k p } , z _ { k p } } [ \nabla _ { \theta } \log P ( z _ { k p } | s _ { k p } ) b ( s _ { k p } ) ] } & { } \\ { \displaystyle } & { ~ = \displaystyle \sum _ { k = 0 } ^ { H / p } \mathbb { E } _ { s _ { k p } , z _ { k p } } [ \nabla _ { \theta } \log P ( z _ { k p } | s _ { k p } ) b ( s _ { k p } ) ] } \end{array}
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
Then, we can write out the definition of the expectation and undo the gradient-log trick to prove that the baseline is unbiased.
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\begin{array} { r l } { \nabla _ { \theta } \log \mathfrak { A } _ { \theta _ { 1 } } ( \mathfrak { L } _ { \mathcal { F } _ { 1 } } | \mathfrak { L } _ { \mathcal { F } _ { 1 } } ) \hat { \mathfrak { H } } ( \mathfrak { L } _ { \mathcal { F } _ { 1 } } ) \rVert ( \mathfrak { L } _ { \mathcal { F } _ { 1 } } ) } & { = \displaystyle \operatorname* { l i m } _ { \le t \le j } \int _ { ( s _ { \phi _ { 1 } , \phi _ { 2 } } , \mathfrak { L } _ { \mathcal { F } _ { 2 } } ) \in \mathcal { L } _ { \mathcal { F } _ { 1 } } } \nabla _ { ( s _ { \phi _ { 2 } } , \mathfrak { L } _ { \mathcal { F } _ { 2 } } ) \in \mathcal { L } _ { \mathcal { F } _ { 1 } } } \left. \mathfrak { L } _ { \mathcal { F } _ { 1 } } ( \mathcal { L } _ { \mathcal { F } _ { 2 } } | \mathfrak { L } _ { \mathcal { F } _ { 1 } } ) \hat { \mathfrak { H } } ( \mathfrak { L } _ { \mathcal { F } _ { 2 } } ) \hat { \mathfrak { H } } ( \mathfrak { L } _ { \mathcal { F } _ { 2 } } ) \hat { \mathfrak { H } } ( \mathfrak { L } _ { \mathcal { F } _ { 2 } } ) \hat { \mathfrak { H } } ( \mathfrak { L } _ { \mathcal { F } _ { 2 } } ) \right. } \\ & = \displaystyle \sum _ { s = 0 } ^ { \mathcal { N } _ { 0 } } \int _ { s _ { \phi _ { 2 } } \in \mathcal { L } _ { \mathcal { F } _ { 2 } } } P ( s _ { \phi _ { 3 } , \phi _ { 3 } } ) \hat { \mathfrak { H } } ( s _ { \phi _ { 3 } } ) \int _ { s _ { \phi _ { 2 } } \le s _ { \phi _ { 1 } } } \left( \mathfrak { L } _ { \mathcal { F } _ { 2 } } | \mathfrak { L } _ { \mathcal { F } _ { 3 } } \right) \nabla _ { \phi } \log \mathfrak { L } _ { \mathcal { F } _ { 3 } } ( \mathcal { L } _ { \mathcal { F } _ { 1 } } | \mathfrak { L } _ { \mathcal { F } _ { 3 } } ) \hat { \mathfrak { H } } ( \mathfrak { L } _ { \mathcal { F } _ { 2 } } | \hat { \mathfrak { L } } _ { \mathcal { F } _ { 3 } } ) \hat { \mathfrak { H } } ( \mathcal { L } _ { \mathcal { F } _ { 1 } } | \mathfrak { L } _ { \mathcal { F } _ { 1 } } ) \prod _ { s = 0 } \end{array}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
Subtracting a state- and subpolicy- dependent baseline from the second term is also unbiased, i.e.
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\mathbb { E } _ { \tau } [ \sum _ { t = 0 } ^ { H } \nabla _ { \theta } \log \pi _ { s , \theta } ( a _ { t } | s _ { t } , z _ { k p } ) b ( s _ { t } , z _ { k p } ) ] = 0
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
We’ll follow the same strategy to prove the second equality: apply the tower property, express the expectation as an integral, and undo the gradient-log trick.
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\begin{array} { r l } & { \mathbb { E } _ { x } | \displaystyle \sum _ { t = 1 } ^ { M } \nabla \cdot \nabla ^ { \theta } \log \pi _ { \theta } \{ \alpha _ { t } | s _ { t } , z _ { t , p } \} b ( s _ { t } , z _ { t , p } ) \Big | } \\ & \begin{array} { r l } & \displaystyle = \sum _ { t = 0 } ^ { H } \sum _ { \alpha _ { t } , \alpha _ { t } , z _ { t , p } \} \mathbb { E } _ { \Gamma ( s ) \cup \mathcal { L } _ { q } \cup \mathcal { L } _ { q } } [ \nabla _ { s } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z _ { t , p } ) b ( s _ { t } , z _ { t , p } ) ] \Big | } \\ & \displaystyle = \sum _ { t = 0 } ^ { H } \sum _ { \alpha _ { t } , \alpha _ { t } , z _ { t , p } \} \big [ \nabla _ { s } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z _ { t , p } ) b ( s _ { t } , z _ { t , p } ) \big ] \big ( \nabla _ { s } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z _ { t , p } ) b ( s _ { t } , z _ { t , p } ) \big ) \big | } \\ & \displaystyle = \sum _ { t = 0 } ^ { H } \mathbb { E } _ { \kappa _ { t } , \alpha _ { t } , z _ { t , p } \} \big [ \nabla _ { s } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z _ { t , p } ) b ( s _ { t } , z _ { t , p } ) \big ] \big ( \nabla _ { s } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z _ { t , p } ) \big ) } \\ & { \displaystyle = \sum _ { t = 0 } ^ { H } \int _ { ( a _ { t } , z _ { t , p } ) } P ( s _ { t } , z _ { t , p } ) b ( s _ { t } , z _ { t , p } ) \int _ { a _ { t } } \pi _ { \theta } ( a _ { t } | s _ { t } , z _ { t , p } ) \nabla _ { \theta } \log \pi _ { \theta } ( a _ { t } | s _ { t } , z _ { t , p } ) b ( a _ { t } | s _ { t } , z _ { t , p } ) d a _ { t } d a _ { t } d a _ { t } d a _ { t } } \\ & \displaystyle = \sum _ { t = 0 } ^ { H } \int _ { ( a _ { t } , z _ { t , p } ) } P ( s _ { t } , z _ { t , p } \end{array} \end{array}
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 7: HIRO performance on Ant Gather with and without access to the ground truth $( x , y )$ , which it needs to communicate useful goals.
|
| 367 |
+
|
| 368 |
+
# D HIRO SENSITIVITY TO OBSERVATION-SPACE
|
| 369 |
+
|
| 370 |
+
In this section we provide a more detailed explanation of why HIRO (Nachum et al., 2018) performs poorly under our environments. As explained in our related work section, HIRO belongs to the general category of algorithms that train goal-reaching policies as lower levels of the hierarchy (Vezhnevets et al., 2017; Levy et al., 2017). These methods rely on having a goal-space that is meaningful for the task at hand. For example, in navigation tasks they require having access to the $( x , y )$ position of the agent such that deltas in that space can be given as meaningful goals to move in the environment. Unfortunately, in many cases the only readily available information (if there’s no GPS signal or other positioning system installed) are raw sensory inputs, like cameras or the LIDAR sensors we mimic in our environments. In such cases, our method still performs well because it doesn’t rely on the goal-reaching extra supervision that is leveraged (and detrimental in this case) in HIRO and similar methods. In Figure 7, we show that knowing the ground truth location is critical for its success. We have reproduced the HIRO results in Fig. 7 using the published codebase, so we are convinced that our results showcase a failure mode of HIRO.
|
| 371 |
+
|
| 372 |
+
# E HYPERPARAMETER SENSITIVITY PLOTS
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 8: Sensitivity of HiPPO to variation in the time-commitment.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 9: Sensitivity of HiPPO to variation in the number of skills.
|
md/train/Byg1v1HKDB/Byg1v1HKDB.md
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ABDUCTIVE COMMONSENSE REASONING
|
| 2 |
+
|
| 3 |
+
Chandra Bhagavatula♦, Ronan Le Bras♦, Chaitanya Malaviya♦, Keisuke Sakaguchi♦, Ari Holtzman♦, Hannah Rashkin♦, Doug Downey♦, Scott Wen-tau $\mathbf { Y i h ^ { \alpha } }$ , Yejin Choi♦♥
|
| 4 |
+
|
| 5 |
+
♦Allen Institute for AI, Seattle, WA, USA, ♣Facebook AI, Seattle, WA, USA
|
| 6 |
+
♥Paul G. Allen School of Computer Science & Engineering, WA, USA
|
| 7 |
+
{chandrab,ronanlb,chaitanyam,keisukes}@allenai.org
|
| 8 |
+
{arih,hannahr,dougd}@allenai.org
|
| 9 |
+
{yejin}@cs.washington.edu
|
| 10 |
+
{scottyih}@fb.com∗
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Abductive reasoning is inference to the most plausible explanation. For example, if Jenny finds her house in a mess when she returns from work, and remembers that she left a window open, she can hypothesize that a thief broke into her house and caused the mess, as the most plausible explanation. While abduction has long been considered to be at the core of how people interpret and read between the lines in natural language (Hobbs et al., 1988), there has been relatively little research in support of abductive natural language inference and generation.
|
| 15 |
+
|
| 16 |
+
We present the first study that investigates the viability of language-based abductive reasoning. We introduce a challenge dataset, ART, that consists of over 20k commonsense narrative contexts and $2 0 0 \mathrm { k }$ explanations. Based on this dataset, we conceptualize two new tasks – (i) Abductive NLI: a multiple-choice question answering task for choosing the more likely explanation, and (ii) Abductive NLG: a conditional generation task for explaining given observations in natural language. On Abductive NLI, the best model achieves $6 8 . 9 \%$ accuracy, well below human performance of $9 1 . 4 \%$ . On Abductive NLG, the current best language generators struggle even more, as they lack reasoning capabilities that are trivial for humans. Our analysis leads to new insights into the types of reasoning that deep pre-trained language models fail to perform—despite their strong performance on the related but more narrowly defined task of entailment NLI—pointing to interesting avenues for future research.
|
| 17 |
+
|
| 18 |
+
# 1 INTRODUCTION
|
| 19 |
+
|
| 20 |
+
The brain is an abduction machine, continuously trying to prove abductively that the observables in its environment constitute a coherent situation. – Jerry Hobbs, ACL 2013 Lifetime Achievement Award1
|
| 21 |
+
|
| 22 |
+
Abductive reasoning is inference to the most plausible explanation for incomplete observations (Peirce, 1965a). Figure 1 illustrates an example. Given the incomplete observations about the world that $O _ { 1 }$ : “Jenny cleaned her house and went to work, leaving the window just a crack open.” and sometime later $O _ { 2 }$ : “When Jenny returned home, she saw her house was a mess.”, we can hypothesize different potential explanations and reason about which is the most likely. We can readily rule out $H _ { 3 }$ since it fails to justify the observation $O _ { 2 }$ . While $H _ { 1 }$ and $H _ { 2 }$ are both plausible, the most likely explanation based on commonsense is $H _ { 1 }$ as $H _ { 2 }$ is somewhat implausible given $O _ { 1 }$ .
|
| 23 |
+
|
| 24 |
+
One crucial observation Peirce makes about abductive reasoning is that abduction is “the only logical operation which introduces any new ideas”, which contrasts with other types of inference such as entailment, that focuses on inferring only such information that is already provided in the premise.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 1: Example of Abductive Reasoning. Given observations $O _ { 1 }$ and $O _ { 2 }$ , the $\alpha \mathbf { N L I }$ task is to select the most plausible explanatory hypothesis. Since the number of hypotheses is massive in any given situation, we make a simplifying assumption in our ART dataset to only choose between a pair of explanations.
|
| 28 |
+
|
| 29 |
+
Abductive reasoning has long been considered to be at the core of understanding narratives (Hobbs et al., 1988), reading between the lines (Norvig, 1987; Charniak & Shimony, 1990), reasoning about everyday situations (Peirce, 1965b; Andersen, 1973), and counterfactual reasoning (Pearl, 2002; Pearl & Mackenzie, 2018). Despite the broad recognition of its importance, however, the study of abductive reasoning in narrative text has very rarely appeared in the NLP literature, in large part because most previous work on abductive reasoning has focused on formal logic, which has proven to be too rigid to generalize to the full complexity of natural language.
|
| 30 |
+
|
| 31 |
+
In this paper, we present the first study to investigate the viability of language-based abductive reasoning. This shift from logic-based to language-based reasoning draws inspirations from a significant body of work on language-based entailment (Bowman et al., 2015; Williams et al., 2018b), language-based logic (Lakoff, 1970; MacCartney & Manning, 2007), and language-based commonsense reasoning (Mostafazadeh et al., 2016; Zellers et al., 2018). In particular, we investigate the use of natural language as the representation medium, and probe deep neural models on language-based abductive reasoning.
|
| 32 |
+
|
| 33 |
+
More concretely, we propose Abductive Natural Language Inference $\mathbf { \alpha } _ { \mathrm { ( \alpha } } \mathrm { \alpha } _ { \mathrm { ( \alpha } } \mathrm { \alpha } _ { \mathrm { ) } }$ and Abductive Natural Language Generation (αNLG) as two novel reasoning tasks in narrative contexts.2 We formulate $\alpha \mathbf { N L I }$ as a multiple-choice task to support easy and reliable automatic evaluation: given a context, the task is to choose the more likely explanation from a given pair of hypotheses choices. We also introduce a new challenge dataset, ART, that consists of 20K narratives accompanied by over 200K explanatory hypothesis.34 We then establish comprehensive baseline performance based on state-of-the-art NLI and language models. The best baseline for $\alpha \mathbf { N L I }$ based on BERT achieves $6 8 . 9 \%$ accuracy, with a considerable gap compared to human performance of $9 1 . 4 \% ( \ S 5 . 2 )$ . The best generative model, based on GPT2, performs well below human performance on the $\alpha \mathbf { N L G }$ task (§5.2). Our analysis leads to insights into the types of reasoning that deep pre-trained language models fail to perform — despite their strong performance on the closely related but different task of entailment NLI — pointing to future research directions.
|
| 34 |
+
|
| 35 |
+
# 2 TASK DEFINITION
|
| 36 |
+
|
| 37 |
+
Abductive Natural Language Inference We formulate $\alpha \mathbf { N L I }$ as multiple choice problems consisting of a pair of observations as context and a pair of hypothesis choices. Each instance in ART is defined as follows:
|
| 38 |
+
|
| 39 |
+
• $O _ { 1 }$ : The observation at time $t _ { 1 }$ .
|
| 40 |
+
|
| 41 |
+
• $O _ { 2 }$ : The observation at time $t _ { 2 } > t _ { 1 }$ .
|
| 42 |
+
• $h ^ { + }$ : A plausible hypothesis that explains the two observations $O _ { 1 }$ and $O _ { 2 }$ .
|
| 43 |
+
• $h ^ { - }$ : An implausible (or less plausible) hypothesis for observations $O _ { 1 }$ and $O _ { 2 }$ .
|
| 44 |
+
|
| 45 |
+
Given the observations and a pair of hypotheses, the $\alpha$ NLI task is to select the most plausible explanation (hypothesis).
|
| 46 |
+
|
| 47 |
+
Abductive Natural Language Generation αNLG is the task of generating a valid hypothesis $h ^ { + }$ given the two observations $O _ { 1 }$ and $O _ { 2 }$ . Formally, the task requires to maximize $P ( h ^ { + } | O _ { 1 } , O _ { 2 } )$ .
|
| 48 |
+
|
| 49 |
+
# 3 MODELS FOR ABDUCTIVE COMMONSENSE REASONING
|
| 50 |
+
|
| 51 |
+
# 3.1 ABDUCTIVE NATURAL LANGUAGE INFERENCE
|
| 52 |
+
|
| 53 |
+
A Probabilistic Framework for $\alpha \mathbf { N L I }$ : A distinct feature of the $\alpha \mathbf { N L I }$ task is that it requires jointly considering all available observations and their commonsense implications, to identify the correct hypothesis. Formally, the $\alpha \mathbf { N L I }$ task is to select the hypothesis $h ^ { * }$ that is most probable given the observations.
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
h ^ { * } = \arg \operatorname* { m a x } _ { h ^ { i } } P ( H = h ^ { i } | O _ { 1 } , O _ { 2 } )
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Rewriting the objective using Bayes Rule conditioned on $O _ { 1 }$ , we have:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
P ( h ^ { i } | O _ { 1 } , O _ { 2 } ) \propto P ( O _ { 2 } | h ^ { i } , O _ { 1 } ) P ( h ^ { i } | O _ { 1 } )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
We formulate a set of probabilistic models for $\alpha \mathbf { N L I }$ that make various independence assumptions on Equation 2 – starting from a simple baseline that ignores the observations entirely, and building up to a fully joint model. These models are depicted as Bayesian Networks in Figure 2.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 2: Illustration of the graphical models described in the probabilistic framework. The “Fully Connected” model can, in theory, combine information from both available observations.
|
| 69 |
+
|
| 70 |
+
Hypothesis Only: Our simplest model makes the strong assumption that the hypothesis is entirely independent of both observations, i.e. $( H \perp O _ { 1 } , O _ { 2 } )$ , in which case we simply aim to maximize the marginal $P ( H )$ .
|
| 71 |
+
|
| 72 |
+
First (or Second) Observation Only: Our next two models make weaker assumptions: that the hypothesis depends on only one of the first $O _ { 1 }$ or second $O _ { 2 }$ observation.
|
| 73 |
+
|
| 74 |
+
Linear Chain: Our next model uses both observations, but considers each observation’s influence on the hypothesis independently, i.e. it does not combine information across the observations. Formally, the model assumes that the three variables $\langle O _ { 1 } , H , O _ { 2 } \rangle$ form a linear Markov chain, where the second observation is conditionally independent of the first, given the hypothesis (i.e. $( O _ { 1 } \perp O _ { 2 } | H ) \rangle$ ). Under this assumption, we aim to maximize a somewhat simpler objective than Equation 2:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
h ^ { * } = \arg \operatorname* { m a x } _ { h ^ { i } } P ( O _ { 2 } | h ^ { i } ) P ( h ^ { i } | O _ { 1 } ) \mathrm { w h e r e } ( O _ { 1 } \perp O _ { 2 } | H )
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Fully Connected: Finally, our most sophisticated model jointly models all three random variables as in Equation 2, and can in principle combine information across both observations to choose the correct hypothesis.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 3: Overview of an αNLG model that integrates commonsense representations obtained from COMeT (Bosselut et al., 2019) with GPT2. Each observation is input to the COMeT model to obtain nine embeddings, each associated with one commonsense inference type.
|
| 84 |
+
|
| 85 |
+
To help illustrate the subtle distinction between how the Linear Chain and Fully Connected models consider both observations, consider the following example. Let observation $O _ { 1 }$ : “Carl went to the store desperately searching for flour tortillas for a recipe.” and $O _ { 2 }$ : “Carl left the store very frustrated.”. Then consider two distinct hypotheses, an incorrect $h ^ { 1 }$ : “The cashier was rude” and the correct $h ^ { 2 }$ : “The store had corn tortillas, but not flour ones.”. For this example, a Linear Chain model could arrive at the wrong answer, because it reasons about the observations separately—taking $O _ { 1 }$ in isolation, both $h ^ { 1 }$ and $h ^ { 2 }$ seem plausible next events, albeit each a priori unlikely. And for $O _ { 2 }$ in isolation—i.e. in the absence of $O _ { 1 }$ , as for a randomly drawn shopper—the $h ^ { 1 }$ explanation of a rude cashier seems a much more plausible explanation of Carl’s frustration than are the details of the store’s tortilla selection. Combining these two separate factors leads the Linear Chain to select $h ^ { 1 }$ as the more plausible explanation. It is only by reasoning about Carl’s goal in $O _ { 1 }$ jointly with his frustration in $O _ { 2 }$ , as in the Fully Connected model, that we arrive at the correct answer $h ^ { 2 }$ as the more plausible explanation.
|
| 86 |
+
|
| 87 |
+
In our experiments, we encode the different independence assumptions in the best performing neural network model. For the hypothesis-only and single observation models, we can enforce the independencies by simply restricting the inputs of the model to only the relevant variables. On the other hand, the Linear Chain model takes all three variables as input, but we restrict the form of the model to enforce the conditional independence. Specifically, we learn a discriminative classifier:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
P _ { \mathrm { L i n e a r } \mathrm { C h a i n } } ( h | O _ { 1 } , O _ { 2 } ) \propto e ^ { \phi ( O _ { 1 } , h ) + \phi ^ { \prime } ( h , O _ { 2 } ) }
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\phi$ and $\phi ^ { \prime }$ are neural networks that produce scalar values.
|
| 94 |
+
|
| 95 |
+
# 3.2 ABDUCTIVE NATURAL LANGUAGE GENERATION
|
| 96 |
+
|
| 97 |
+
Given $h ^ { + } = \lbrace w _ { 1 } ^ { h } \dots w _ { l } ^ { h } \rbrace$ , $O _ { 1 } { = } \{ w _ { 1 } ^ { o 1 } \dots w _ { m } ^ { o 1 } \}$ and $O _ { 2 } { = } \{ w _ { 1 } ^ { o 2 } \dots w _ { n } ^ { o 2 } \}$ as sequences of tokens, the $\alpha \mathbf { N L G }$ l task can be modeled as $P ( h ^ { + } | O _ { 1 } , O _ { 2 } ) = \prod P ( w _ { i } ^ { h } | w _ { < i } ^ { h } , w _ { 1 } ^ { o 1 } . . . w _ { m } ^ { o 1 } , w _ { 1 } ^ { o 2 } . . . w _ { n } ^ { o 2 } )$ Option$\kappa$ then be trained to minimize the negative log-likelihood over instances in ART:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } = - \sum _ { i = 1 } ^ { N } \log P ( w _ { i } ^ { h } | w _ { < i } ^ { h } , w _ { 1 } ^ { o 1 } \dots w _ { m } ^ { o 1 } , w _ { 1 } ^ { o 2 } \dots w _ { n } ^ { o 2 } , \mathcal { K } )
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
# 4 ART DATASET: ABDUCTIVE REASONING IN NARRATIVE TEXT
|
| 104 |
+
|
| 105 |
+
ART is the first large-scale benchmark dataset for studying abductive reasoning in narrative texts. It consists of $\sim 2 0 \mathrm { K }$ narrative contexts (pairs of observations $\langle O _ { 1 } , O _ { 2 } \rangle ,$ ) with over 200K explanatory hypotheses. Table 6 in the Appendix summarizes corpus-level statistics of the ART dataset.5 Figure 4 shows some illustrative examples from $\mathcal { A R T }$ (dev split). The best model based on BERT fails to correctly predict the first two dev examples.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 4: Examples from $\mathcal { A R T }$ (dev split). The best model based on BERT fails to correctly predict the first two examples.
|
| 109 |
+
|
| 110 |
+
Collecting Observations: The pairs $O _ { 1 }$ , $O _ { 2 }$ in $\mathcal { A R T }$ are drawn from the ROCStories dataset (Mostafazadeh et al., 2016). ROCStories is a large collection of short, manually curated fivesentence stories. It was designed to have a clear beginning and ending for each story, which naturally map to the first $( O _ { 1 } )$ and second $( O _ { 2 } )$ observations in ART.
|
| 111 |
+
|
| 112 |
+
Collecting Hypotheses Options: We crowdsourced the plausible and implausible hypotheses options on Amazon Mechanical Turk (AMT) in two separate tasks6:
|
| 113 |
+
|
| 114 |
+
1. Plausible Hypothesis Options: We presented $O _ { 1 }$ and $O _ { 2 }$ as narrative context to crowdworkers who were prompted to fill in “What happened in-between?” in natural language. The design of the task motivates the use of abductive reasoning to hypothesize likely explanations for the two given observations.
|
| 115 |
+
2. Implausible Hypothesis Options: In this task, we presented workers with observations $O _ { 1 }$ , $O _ { 2 }$ and one plausible hypothesis option $h ^ { + } \in \mathcal { H } ^ { + }$ collected from the previous task. Crowdworkers were instructed to make minimal edits (up to 5 words) to a given $\bar { h ^ { + } }$ to create implausible hypothesis variations for each plausible hypothesis.
|
| 116 |
+
|
| 117 |
+
A significant challenge in creating datasets is avoiding annotation artifacts – unintentional patterns in the data that leak information about the target label – that several recent studies (Gururangan et al., 2018; Poliak et al., 2018; Tsuchiya, 2018) have reported on crowdsourced datasets . To tackle this challenge, we collect multiple plausible and implausible hypotheses for each $\langle O _ { 1 } , O _ { 2 } \rangle$ pair (as described above) and then apply an adversarial filtering algorithm to retain one challenging pair of hypotheses that are hard to distinguish between. We describe our algorithm in detail in Appendix A.5. While our final dataset uses BERT as the adversary, preliminary experiments that used GPT as an adversary resulted in similar drops in performance of all models, including all BERT variants. We compare the results of the two adversaries in Table 1.
|
| 118 |
+
|
| 119 |
+
# 5 EXPERIMENTS AND RESULTS
|
| 120 |
+
|
| 121 |
+
We now present our evaluation of finetuned state-of-the-art pre-trained language models on the ART dataset, and several other baseline systems for both $\alpha \mathbf { N L I }$ and $\alpha \mathbf { N L G }$ . Since $\alpha \mathbf { N L I }$ is framed as a binary classification problem, we choose accuracy as our primary metric. For αNLG, we report performance on automated metrics such as BLEU (Papineni et al., 2002), CIDEr (Vedantam et al., 2015), METEOR (Banerjee & Lavie, 2005) and also report human evaluation results.
|
| 122 |
+
|
| 123 |
+
# 5.1 ABDUCTIVE NATURAL LANGUAGE INFERENCE
|
| 124 |
+
|
| 125 |
+
Despite strong performance on several other NLP benchmark datasets, the best baseline model based on BERT achieves an accuracy of just $6 8 . 9 \%$ on ART compared to human performance of $9 1 . 4 \%$ . The large gap between human performance and that of the best system provides significant scope for development of more sophisticated abductive reasoning models. Our experiments show that introducing the additional independence assumptions described in Section 3.1 over the fully connected model tends to degrade system performance (see Table 1) in general.
|
| 126 |
+
|
| 127 |
+
Human Performance We compute human performance using AMT. Each instance (two observations and two hypothesis choices) is shown to three workers who were prompted to choose the more plausible hypothesis choice.7 We compute majority vote on the labels assigned which leads to a human accuracy of $9 1 . 4 \%$ on the ART test set.
|
| 128 |
+
|
| 129 |
+
Table 1: Performance of baselines and finetuned-LM approaches on the test set of ART. Test accuracy is reported as the mean of five models trained with random seeds, with the standard deviation in parenthesis.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Model</td><td>GPTAF Acc. (%)</td><td>ART Acc. (%)</td></tr><tr><td>Random (2-way choice)</td><td>50.1</td><td>50.4</td></tr><tr><td>Majority (from dev set)</td><td>50.1</td><td>50.8</td></tr><tr><td>Infersent (Conneau et al., 2017)</td><td>50.9</td><td>50.8</td></tr><tr><td>ESIM+ELMo (Chen et al.,2017)</td><td>58.2</td><td>58.8</td></tr><tr><td>Finetuning Pre-trained LMs</td><td></td><td></td></tr><tr><td>GPT-ft</td><td>52.6 (0.9)</td><td>63.1 (0.5)</td></tr><tr><td>BERT-ft [h Only]</td><td>55.9 (0.7)</td><td>59.5 (0.2)</td></tr><tr><td>BERT-ft [O Only]</td><td>63.9 (0.8)</td><td>63.5 (0.7)</td></tr><tr><td>BERT-ft [O2 Only]</td><td>68.1 (0.6)</td><td>66.6 (0.2)</td></tr><tr><td>BERT-ft[Linear Chain]</td><td>65.3 (1.4)</td><td>68.9 (0.5)</td></tr><tr><td>BERT-ft [Fully Connected]</td><td>72.0 (0.5)</td><td>68.6 (0.5)</td></tr><tr><td>Human Performance</td><td>=</td><td>91.4</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Baselines We include baselines that rely on simple features to verify that ART is not trivially solvable due to noticeable annotation artifacts, observed in several crowdsourced datasets. The accuracies of all simple baselines are close to chance-performance on the task – indicating that the dataset is free of simple annotation artifacts.
|
| 134 |
+
|
| 135 |
+
A model for the related but distinct task of entailment NLI (e.g. SNLI) forms a natural baseline for $\alpha \mathbf { N L I }$ . We re-train the ESIM $+$ ELMo (Chen et al., 2017; Peters et al., 2018) model as its performance on entailment NLI $( 8 8 . 9 \% )$ is close to state-of-the-art models (excluding pre-trained language models). This model only achieves an accuracy of $5 8 . 8 \%$ highlighting that performing well on $\mathcal { A R T }$ requires models to go far beyond the linguistic notion of entailment.
|
| 136 |
+
|
| 137 |
+
Pre-trained Language Models BERT (Devlin et al., 2018) and GPT (Radford, 2018) have recently been shown to achieve state-of-the-art results on several NLP benchmarks (Wang et al., 2018). We finetune both BERT-Large and GPT as suggested in previous work and we present each instance in their natural narrative order. BERT-ft (fully connected) is the best performing model achieving $6 8 . 9 \%$ accuracy, compared to GPT’s $6 3 . 1 \%$ .8 Our AF approach was able to reduce BERT performance from over $8 8 \%$ by 20 points.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 5: BERT learning curve on the dev set of ART. For each point on the $\mathbf { X }$ -axis, we fine-tune BERT with five random seeds. Human performance is $9 1 . 4 \%$ .
|
| 141 |
+
|
| 142 |
+
Learning Curve and Dataset Size While there is enough scope for considerably scaling up the dataset based on ROCStories, the learning curve in Figure 5 shows that the performance of the best
|
| 143 |
+
|
| 144 |
+
model plateaus after ${ \sim } 1 0$ , 000 instances. In addition, there is still a wide gap $( \sim 2 3 \%$ ) between the performance of the best model and human performance.
|
| 145 |
+
|
| 146 |
+
Table 2: Performance of generative models on the test set of ART. All models except GPT2-Fixed are finetuned on ART.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Model</td><td>BLEU</td><td>METEOR</td><td>ROUGE</td><td>CIDEr</td><td>BERT-Score</td><td>Human</td></tr><tr><td>GPT2-Fixed</td><td>0.0</td><td>9.29</td><td>9.99</td><td>3.34</td><td>36.69</td><td>-</td></tr><tr><td>O1-Oz-Only</td><td>2.23</td><td>16.71</td><td>22.83</td><td>33.54</td><td>48.74</td><td>42.26</td></tr><tr><td>COMeT-Txt+GPT2</td><td>2.29</td><td>16.73</td><td>22.51</td><td>31.99</td><td>48.46</td><td>38.28</td></tr><tr><td>COMeT-Emb+GPT2</td><td>3.03</td><td>17.66</td><td>22.93</td><td>32.00</td><td>48.52</td><td>44.56</td></tr><tr><td>Human-written Hypotheses</td><td>8.25</td><td>26.71</td><td>30.40</td><td>53.56</td><td>53.30</td><td>96.03</td></tr></table>
|
| 149 |
+
|
| 150 |
+
GPT Adversary Table 1 also includes results of our experiments where GPT was used as the adversary. Notably, in this case, adversarially filtering the dataset brings down GPT performance under $53 \%$ . On the other hand, the best BERT model, that encodes the fully connected bayesian network performs significantly better than the BERT model that encodes the linear chain assumptions $- 7 2 \%$ compared to $65 \%$ . Therefore, we use the BERT fully connected model as the adversary in ART. The gap between the linear chain and fully connected BERT models diminishes when BERT is used as an adversary – in spite of being a more powerful model – which indicates that adversarial filtering disproportionately impacts the model used as the adversary. However, the dataset also becomes more difficult for the other models that were not used as adversaries. For example, before any filtering, BERT scores $8 8 \%$ and OpenGPT gets $8 0 \%$ , which is much higher than either model achieves in Table 1 when the other model is used for filtering. This result is a reasonable indicator, albeit not a guarantee, that ART will remain challenging for new models released in the future.
|
| 151 |
+
|
| 152 |
+
# 5.2 ABDUCTIVE NATURAL LANGUAGE GENERATION
|
| 153 |
+
|
| 154 |
+
Generative Language Models As described in Equation 4, we train GPT2 conditioned on the tokens of the two observations $O _ { 1 }$ and $O _ { 2 }$ . Both observations are enclosed with field-specific tags. ATOMIC (Sap et al., 2019), a repository of inferential $i f .$ -then knowledge is a natural source of background commonsense required to reason about narrative contexts in ART. Yet, there is no straightforward way to include such knowledge into a neural model as ATOMIC’s nodes are not canonicalized and are represented as short phrases of text. Thus, we rely on COMeT – a transformer model trained on ATOMIC that generates nine commonsense inferences of events in natural language.9 Specifically, we experiment with two ways of integrating information from COMeT in GPT2: (i) as textual phrases, and (ii) as embeddings.
|
| 155 |
+
|
| 156 |
+
Figure 3 shows how we integrate COMeT representations. Concretely, after the input tokens are embedded by the word-embedding layer, we append eighteen (corresponding to nine relations for each observation) embeddings to the sequence before passing through the layers of the Transformer architecture. This allows the model to learn each token’s representation while attending to the COMeT embeddings – effectively integrating background commonsense knowledge into a language model.10
|
| 157 |
+
|
| 158 |
+
Discussion Table 2 reports results on the αNLG task. Among automatic metrics, we report BLEU4 (Papineni et al., 2002), METEOR (Banerjee & Lavie, 2005), ROUGE (Lin, 2004), CIDEr (Vedantam et al., 2015) and BERT-Score (Zhang et al., 2019) (with the bert-base-uncased model). We establish human performance through crowdsourcing on AMT. Crowdworkers are shown pairs of observations and a generated hypothesis and asked to label whether the hypothesis explains the given observations. The last column reports the human evaluation score. The last row reports the score of a held-out human-written hypothesis and serves as a ceiling for model performance. Human-written hypotheses are found to be correct for $96 \%$ of instances, while our best generative models, even when enhanced with background commonsense knowledge, only achieve $45 \%$ – indicating that the αNLG generation task is especially challenging for current state-of-the-art text generators.
|
| 159 |
+
|
| 160 |
+
# 6 ANALYSIS
|
| 161 |
+
|
| 162 |
+
# 6.1 αNLI
|
| 163 |
+
|
| 164 |
+
Commonsense reasoning categories We investigate the categories of commonsense-based abductive reasoning that are challenging for current systems and the ones where the best model over-performs. While there have been previous attempts to categorize commonsense knowledge required for entailment (LoBue & Yates, 2011; Clark et al., 2007), crowdsourcing this task at scale with high fidelity and high agreement across annotators remains challenging. Instead, we aim to probe the model with soft categories identified by matching lists of category-specific keywords to the hypothesis choices.
|
| 165 |
+
|
| 166 |
+
Table 3: BERT’s performance and human evaluation on categories for 1,000 instances from the test set, based on commonsense reasoning domains (Numerical, Spatial, Emotional). The number in parenthesis indicates the size of the category.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Category</td><td>Human Accuracy</td><td>BERT Accuracy</td><td>△</td></tr><tr><td>All (1, 000)</td><td>91.4</td><td>68.8</td><td>22.6</td></tr><tr><td>Numerical (44)</td><td>88.6</td><td>56.8</td><td>21.8</td></tr><tr><td>Spatial (130)</td><td>91.5</td><td>65.4</td><td>26.1</td></tr><tr><td>Emotional (84)</td><td>86.9</td><td>72.6</td><td>14.3</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 3 shows the accuracy of the best model (BERT-ft) across various categories of commonsense knowledge. BERT-ft significantly underperforms on instances involving Numerical $( 5 6 . 8 \% )$ and Spatial $( 6 5 . 4 \% )$ commonsense. These two categories include reasoning about numerical quantities and the spatial location of agents and objects, and highlight some of the limitations of the language models. In contrast, it significantly overperforms on the Emotional category $( 7 2 . 6 \% )$ where the hypotheses exhibit strong textual cues about emotions and sentiments.
|
| 171 |
+
|
| 172 |
+
Implausible transitions A model for an instance of the ART dataset should discard implausible hypotheses in the context of the two given observations. In narrative contexts, there are three main reasons for an implausible hypothesis to be labeled as such:
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Story Transition</td><td>%of Dataset</td><td>BERT-ft Fully Connected Acc. (%)</td><td>BERT-ft Linear Chain Acc. (%)</td></tr><tr><td>O1h-</td><td>32.5</td><td>73.6</td><td>71.6</td></tr><tr><td>hO2</td><td>45.3</td><td>69.0</td><td>70.5</td></tr><tr><td>Plausible</td><td>22.2</td><td>62.5</td><td>58.5</td></tr><tr><td>All (1,000)</td><td>100.0</td><td>69.1</td><td>68.2</td></tr></table>
|
| 175 |
+
|
| 176 |
+
1. $O _ { 1 } \not \to h ^ { - }$ : $h ^ { - }$ is unlikely to follow after the first observation $O _ { 1 }$ . 2. $h ^ { - } \hat { \rho } O _ { 2 }$ : $h ^ { - }$ is plausible after $O _ { 1 }$ but unlikely to precede the second observation $O _ { 2 }$ . 3. Plausible: $\langle O _ { 1 } , h ^ { - } , O _ { 2 } \rangle$ is a coherent narrative and forms a plausible alternative, but it is less plausible than $\langle O _ { 1 } , h ^ { + } , O _ { 2 } \rangle$ .
|
| 177 |
+
|
| 178 |
+
Table 4: Fraction of dataset for which a particular transition in the story is broken for the negative hypothesis, for 1,000 random instances from the test set.
|
| 179 |
+
|
| 180 |
+
We analyze the prevalence of each of these reasons in ART. We design a crowdsourcing task in which we show the implausible option along with the narrative context $\langle O _ { 1 } , O _ { 2 } \rangle$ and get labels for which transition $( O _ { 1 } \not \to h ^ { - }$ , $h ^ { - } \hat { \rho } O _ { 2 }$ or neither) in the narrative chain is broken. Table 4 shows the proportion of each category from a subset of $1 , 0 0 0$ instances from the test set. While $h ^ { - } \not \to O _ { 2 }$ accounts for almost half of the implausible transitions in ART, all three categories are substantially present in the dataset. BERT performance on each of these categories indicates that the model finds it particularly hard when the narrative created by the incorrect hypothesis is plausible, but less plausible than the correct hypothesis. On that subset of the test set, the fully connected model performs better than the linear chain model where it is important to consider both observations jointly to arrive at the more likely hypothesis.
|
| 181 |
+
|
| 182 |
+
# 6.2 αNLG
|
| 183 |
+
|
| 184 |
+
Figure 6 shows some examples of generations from the trained models compared to human-written generations. The example on the left is an example of an instance that only humans could get correct, while for the one on the right, COMeT-Emb $^ +$ GPT2also generates the correct explanation for the observations.
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 6: Examples of generated hypotheses from different models and human-written hypothesis for 2 instances from ART.
|
| 188 |
+
|
| 189 |
+
# 7 TRANSFER LEARNING FROM ART
|
| 190 |
+
|
| 191 |
+
ART contains a large number of questions for the novel abductive reasoning task. In addition to serving as a benchmark, we investigate if ART can be used as a resource to boost performance on other commonsense tasks. We apply transfer learning by first training a model on ART, and subsequently training on four target datasets – WinoGrande Sakaguchi et al. (2020), WSC Levesque et al. (2011), DPR Rahman & $\mathrm { N g }$ (2012) and HellaSwag Zellers et al. (2019). We show that compared to a model that is only trained on the target dataset, a model that is sequentially trained on ART first and then on the target dataset can perform better. In particular, pre-training on ART consistently improves performance on related datasets when they have relatively few training examples.
|
| 192 |
+
|
| 193 |
+
On the other hand, for target datasets with large amounts of training data, pre-training on ART does not provide a significant improvement.
|
| 194 |
+
|
| 195 |
+
# 8 RELATED WORK
|
| 196 |
+
|
| 197 |
+
Table 5: Transfer Learning from ART
|
| 198 |
+
|
| 199 |
+
<table><tr><td>Dataset</td><td>BERT-ft(D)</td><td>BERT-ft(AR→ BERT-ft(D)</td></tr><tr><td>WinoGrande Sakaguchi et al. (2020)</td><td>65.8%</td><td>67.2%</td></tr><tr><td>WSC Levesque et al. (2011)</td><td>70.0%</td><td>74.0%</td></tr><tr><td>DPR Rahman & Ng (2012)</td><td>72.5%</td><td>86.0%</td></tr><tr><td>Hellaswag Zellers et al. (2019)</td><td>46.7%</td><td>46.1%</td></tr></table>
|
| 200 |
+
|
| 201 |
+
Cloze-Style Task vs. Abductive Reasoning Since abduction is fundamentally concerned with plausible chains of cause-and-effect, our work draws inspiration from previous works that deal with narratives such as script learning
|
| 202 |
+
|
| 203 |
+
(Schank & Abelson, 1975) and the narrative cloze test (Chambers & Jurafsky, 2009; Jans et al., 2012; Pichotta & Mooney, 2014; Rudinger et al., 2015). Rather than learning prototypical scripts or narrative chains, we instead reason about the most plausible events conditioned on observations. We make use of the ROCStories dataset (Mostafazadeh et al., 2016), which was specifically designed for the narrative cloze task. But, instead of reasoning about plausible event sequences, our task requires reasoning about plausible explanations for narrative omissions.
|
| 204 |
+
|
| 205 |
+
Entailment vs. Abductive Reasoning The formulation of $\alpha \mathbf { N L I }$ is closely related to entailment NLI, but there are two critical distinctions that make abductive reasoning uniquely challenging. First, abduction requires reasoning about commonsense implications of observations (e.g., if we observe that the “grass is wet”, a likely hypothesis is that “it rained earlier”) which go beyond the linguistic notion of entailment (also noted by Josephson (2000)). Second, abduction requires non-monotonic reasoning about a set of commonsense implications collectively, to check the potential contradictions against multiple observations and to compare the level of plausibility of different hypotheses. This makes abductive reasoning distinctly challenging compared to other forms of reasoning such as induction and deduction (Shank, 1998). Perhaps more importantly, abduction is closely related to the kind of reasoning humans perform in everyday situations, where information is incomplete and definite inferences cannot be made.
|
| 206 |
+
|
| 207 |
+
Generative Language Modeling Recent advancements in the development of large-scale pretrained language models (Radford, 2018; Devlin et al., 2018; Radford et al., 2019) have improved the quality and coherence of generated language. Although these models have shown to generate reasonably coherent text when condition on a sequence of text, our experiments highlight the limitations of these models to 1) generate language non-monotonically and 2) adhere to commonsense knowledge. We attempt to overcome these limitations with the incorporation of a generative commonsense model during hypothesis generation.
|
| 208 |
+
|
| 209 |
+
Related Datasets Our new resource ART complements ongoing efforts in building resources for natural language inference (Dagan et al., 2006; MacCartney & Manning, 2009; Bowman et al., 2015; Williams et al., 2018a; Camburu et al., 2018). Existing datasets have mostly focused on textual entailment in a deductive reasoning set-up (Bowman et al., 2015; Williams et al., 2018a) and making inferences about plausible events (Maslan et al., 2015; Zhang et al., 2017). In their typical setting, these datasets require a system to deduce the logically entailed consequences of a given premise. In contrast, the nature of abduction requires the use of commonsense reasoning capabilities, with less focus on lexical entailment. While abductive reasoning has been applied to entailment datasets (Raina et al., 2005), they have been applied in a logical theorem-proving framework as an intermediate step to perform textual entailment – a fundamentally different task than αNLI.
|
| 210 |
+
|
| 211 |
+
# 9 CONCLUSION
|
| 212 |
+
|
| 213 |
+
We present the first study that investigates the viability of language-based abductive reasoning. We conceptualize and introduce Abductive Natural Language Inference (αNLI) – a novel task focused on abductive reasoning in narrative contexts. The task is formulated as a multiple-choice questionanswering problem. We also introduce Abductive Natural Language Generation $( \alpha \mathbf { N L G } ) - \mathbf { a }$ novel task that requires machines to generate plausible hypotheses for given observations. To support these tasks, we create and introduce a new challenge dataset, ART, which consists of 20,000 commonsense narratives accompanied with over 200,000 explanatory hypotheses. In our experiments, we establish comprehensive baseline performance on this new task based on state-of-the-art NLI and language models, which leads to $6 8 . 9 \%$ accuracy with a considerable gap with human performance $( 9 1 . 4 \% )$ . The $\alpha \mathbf { N L G }$ task is significantly harder – while humans can write a valid explanation $96 \%$ of times, the best generator models can only achieve $45 \%$ . Our analysis leads to new insights into the types of reasoning that deep pre-trained language models fail to perform – despite their strong performance on the closely related but different task of entailment NLI – pointing to interesting avenues for future research. We hope that ART will serve as a challenging benchmark for future research in languagebased abductive reasoning and the $\alpha \mathbf { N L I }$ and αNLG tasks will encourage representation learning that enables complex reasoning capabilities in AI systems.
|
| 214 |
+
|
| 215 |
+
# ACKNOWLEDGMENTS
|
| 216 |
+
|
| 217 |
+
We thank the anonymous reviewers for their insightful feedback. This research was supported in part by NSF (IIS-1524371), the National Science Foundation Graduate Research Fellowship under Grant No. DGE 1256082, DARPA CwC through ARO (W911NF15-1- 0543), DARPA MCS program through NIWC Pacific (N66001-19-2-4031), and the Allen Institute for AI. Computations on beaker.org were supported in part by credits from Google Cloud.
|
| 218 |
+
|
| 219 |
+
# REFERENCES
|
| 220 |
+
|
| 221 |
+
Henning Andersen. Abductive and deductive change. Language, pp. 765–793, 1973. URL https: //www.jstor.org/stable/pdf/412063.pdf.
|
| 222 |
+
|
| 223 |
+
Satanjeev Banerjee and Alon Lavie. Meteor: An automatic metric for mt evaluation with improved correlation with human judgments. In Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization, pp. 65–72, 2005.
|
| 224 |
+
|
| 225 |
+
Antoine Bosselut, Hannah Rashkin, Maarten Sap, Chaitanya Malaviya, Asli Celikyilmaz, and Yejin Choi. Comet: Commonsense transformers for automatic knowledge graph construction. arXiv preprint arXiv:1906.05317, 2019.
|
| 226 |
+
|
| 227 |
+
Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 2015. URL https://nlp.stanford.edu/pubs/snli_paper.pdf.
|
| 228 |
+
|
| 229 |
+
Oana-Maria Camburu, Tim Rocktaschel, Thomas Lukasiewicz, and Phil Blunsom. e-snli: Natural¨ language inference with natural language explanations. In Advances in Neural Information Processing Systems, pp. 9560–9572, 2018. URL https://papers.nips.cc/paper/ 8163-e-snli-natural-language-inference-with-natural-language-explanations. pdf.
|
| 230 |
+
|
| 231 |
+
Nathanael Chambers and Dan Jurafsky. Unsupervised learning of narrative schemas and their participants. In Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP, pp. 602–610, Suntec, Singapore, August 2009. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P/P09/P09-1068.
|
| 232 |
+
|
| 233 |
+
Eugene Charniak and Solomon Eyal Shimony. Probabilistic semantics for cost based abduction. Brown University, Department of Computer Science, 1990. URL https://www.aaai.org/ Papers/AAAI/1990/AAAI90-016.pdf.
|
| 234 |
+
|
| 235 |
+
Qian Chen, Xiao-Dan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and Diana Inkpen. Enhanced lstm for natural language inference. In ACL, 2017. URL https://www.aclweb.org/anthology/ P17-1152.
|
| 236 |
+
|
| 237 |
+
Peter E. Clark, Philip Harrison, John A. Thompson, William R. Murray, Jerry R. Hobbs, and Christiane Fellbaum. On the role of lexical and world knowledge in rte3. In ACL-PASCAL@ACL, 2007. URL https://www.aclweb.org/anthology/W07-1409.
|
| 238 |
+
|
| 239 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Lo¨ıc Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 670– 680, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1070. URL https://www.aclweb.org/anthology/D17-1070.
|
| 240 |
+
|
| 241 |
+
Ido Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual entailment challenge. In Machine learning challenges. evaluating predictive uncertainty, visual object classification, and recognising tectual entailment, pp. 177–190. Springer, 2006. URL http: //u.cs.biu.ac.il/˜dagan/publications/RTEChallenge.pdf.
|
| 242 |
+
|
| 243 |
+
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. URL https://arxiv.org/abs/1810.04805.
|
| 244 |
+
|
| 245 |
+
Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A. Smith. Annotation artifacts in natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pp. 107–112, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-2017. URL https://www.aclweb.org/anthology/N18-2017.
|
| 246 |
+
|
| 247 |
+
Jerry R. Hobbs, Mark Stickel, Paul Martin, and Douglas Edwards. Interpretation as abduction. In Proceedings of the 26th Annual Meeting of the Association for Computational Linguistics, pp. 95–103, Buffalo, New York, USA, June 1988. Association for Computational Linguistics. doi: 10.3115/982023.982035. URL https://www.aclweb.org/anthology/P88-1012.
|
| 248 |
+
|
| 249 |
+
Bram Jans, Steven Bethard, Ivan Vulic, and Marie-Francine Moens. Skip n-grams and ranking func- ´ tions for predicting script events. In Proceedings of the 13th Conference of the European Chapter of the Association for Computational Linguistics, pp. 336–344, Avignon, France, April 2012. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/ E12-1034.
|
| 250 |
+
|
| 251 |
+
Susan G. Josephson. Abductive inference: Computation , philosophy , technology. 2000. URL https://philpapers.org/rec/JOSAIC.
|
| 252 |
+
|
| 253 |
+
George Lakoff. Linguistics and natural logic. Synthese, 22(1-2):151–271, 1970. URL https: //link.springer.com/article/10.1007/BF00413602.
|
| 254 |
+
|
| 255 |
+
Hector J. Levesque, Ernest Davis, and Leora Morgenstern. The winograd schema challenge. In KR, 2011.
|
| 256 |
+
|
| 257 |
+
Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. Text Summarization Branches Out, 2004.
|
| 258 |
+
|
| 259 |
+
Peter LoBue and Alexander Yates. Types of common-sense knowledge needed for recognizing textual entailment. In ACL, 2011. URL https://www.aclweb.org/anthology/ P11-2057.
|
| 260 |
+
|
| 261 |
+
Bill MacCartney and Christopher D. Manning. Natural logic for textual inference. In Proceedings of the ACL-PASCAL Workshop on Textual Entailment and Paraphrasing, pp. 193–200, Prague, June 2007. Association for Computational Linguistics. URL https://www.aclweb.org/ anthology/W07-1431.
|
| 262 |
+
|
| 263 |
+
Bill MacCartney and Christopher D. Manning. An extended model of natural logic. In Proceedings of the Eight International Conference on Computational Semantics, pp. 140–156, Tilburg, The Netherlands, January 2009. Association for Computational Linguistics. URL https://www. aclweb.org/anthology/W09-3714.
|
| 264 |
+
|
| 265 |
+
Nicole Maslan, Melissa Roemmele, and Andrew S. Gordon. One hundred challenge problems for logical formalizations of commonsense psychology. In AAAI Spring Symposia, 2015. URL http://people.ict.usc.edu/˜gordon/publications/AAAI-SPRING15.PDF.
|
| 266 |
+
|
| 267 |
+
Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong He, Devi Parikh, Dhruv Batra, Lucy Vanderwende, Pushmeet Kohli, and James Allen. A corpus and cloze evaluation for deeper understanding of commonsense stories. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL), pp. 839–849. Association for Computational Linguistics, 2016. doi: 10.18653/v1/N16-1098. URL http://aclweb.org/anthology/N16-1098.
|
| 268 |
+
|
| 269 |
+
Peter Norvig. Inference in text understanding. In AAAI, pp. 561–565, 1987. URL http:// norvig.com/aaai87.pdf.
|
| 270 |
+
|
| 271 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In ACL, 2002.
|
| 272 |
+
|
| 273 |
+
Judea Pearl. Reasoning with cause and effect. AI Magazine, 23(1):95, 2002. URL https:// ftp.cs.ucla.edu/pub/stat_ser/r265-ai-mag.pdf.
|
| 274 |
+
|
| 275 |
+
Judea Pearl and Dana Mackenzie. The Book of Why: The New Science of Cause and Effect. Basic Books, Inc., New York, NY, USA, 1st edition, 2018. ISBN 046509760X, 9780465097609. URL https://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 3238230.
|
| 276 |
+
|
| 277 |
+
Charles Sanders Peirce. Collected papers of Charles Sanders Peirce, volume 5. Harvard University Press, 1965a. URL http://www.hup.harvard.edu/catalog.php?isbn $=$ 9780674138001.
|
| 278 |
+
|
| 279 |
+
Charles Sanders Peirce. Pragmatism and pragmaticism, volume 5. Belknap Press of Harvard University Press, 1965b. URL https://www.jstor.org/stable/224970.
|
| 280 |
+
|
| 281 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1532–1543, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1162. URL https://www.aclweb.org/anthology/ D14-1162.
|
| 282 |
+
|
| 283 |
+
Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 2227–2237, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1202. URL https://www.aclweb.org/anthology/N18-1202.
|
| 284 |
+
|
| 285 |
+
Karl Pichotta and Raymond Mooney. Statistical script learning with multi-argument events. In Proceedings of the 14th Conference of the European Chapter of the Association for Computational Linguistics, pp. 220–229, Gothenburg, Sweden, April 2014. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/E14-1024.
|
| 286 |
+
|
| 287 |
+
Adam Poliak, Jason Naradowsky, Aparajita Haldar, Rachel Rudinger, and Benjamin Van Durme. Hypothesis only baselines in natural language inference. In Proceedings of the Seventh Joint Conference on Lexical and Computational Semantics, pp. 180–191, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/S18-2023. URL https: //www.aclweb.org/anthology/S18-2023.
|
| 288 |
+
|
| 289 |
+
Alec Radford. Improving language understanding by generative pre-training. 2018.
|
| 290 |
+
|
| 291 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
|
| 292 |
+
|
| 293 |
+
Altaf Rahman and Vincent Ng. Resolving complex cases of definite pronouns: The winograd schema challenge. In EMNLP-CoNLL, 2012.
|
| 294 |
+
|
| 295 |
+
Rajat Raina, Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ , and Christopher D Manning. Robust textual inference via learning and abductive reasoning. In AAAI, pp. 1099–1105, 2005. URL https://nlp.stanford.edu/ ˜manning/papers/aaai05-learnabduction.pdf.
|
| 296 |
+
|
| 297 |
+
Rachel Rudinger, Pushpendre Rastogi, Francis Ferraro, and Benjamin Van Durme. Script induction as language modeling. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1681–1686, Lisbon, Portugal, September 2015. Association for Computational Linguistics. URL http://aclweb.org/anthology/D15-1195.
|
| 298 |
+
|
| 299 |
+
Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adversarial winograd schema challenge at scale. In AAAI, 2020.
|
| 300 |
+
|
| 301 |
+
Maarten Sap, Ronan Le Bras, Emily Allaway, Chandra Bhagavatula, Nicholas Lourie, Hannah Rashkin, Brendan Roof, Noah A Smith, and Yejin Choi. Atomic: an atlas of machine commonsense for if-then reasoning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3027–3035, 2019.
|
| 302 |
+
|
| 303 |
+
Roger C. Schank and Robert P. Abelson. Scripts, plans, and knowledge. In Proceedings of the 4th International Joint Conference on Artificial Intelligence - Volume 1, IJCAI’75, pp. 151–157, San Francisco, CA, USA, 1975. Morgan Kaufmann Publishers Inc. URL http://dl.acm.org/ citation.cfm?id=1624626.1624649.
|
| 304 |
+
|
| 305 |
+
Gary Shank. The extraordinary ordinary powers of abductive reasoning. Theory & Psychology, 8(6):841–860, 1998. URL https://journals.sagepub.com/doi/10.1177/ 0959354398086007.
|
| 306 |
+
|
| 307 |
+
Masatoshi Tsuchiya. Performance impact caused by hidden bias of training data for recognizing textual entailment. CoRR, abs/1804.08117, 2018. URL http://www.lrec-conf.org/ proceedings/lrec2018/pdf/786.pdf.
|
| 308 |
+
|
| 309 |
+
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, pp. 4566–4575, 2015.
|
| 310 |
+
|
| 311 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 353–355, Brussels, Belgium, November 2018. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/W18-5446.
|
| 312 |
+
|
| 313 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. 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), pp. 1112–1122. Association for Computational Linguistics, 2018a. URL http://aclweb.org/anthology/N18-1101.
|
| 314 |
+
|
| 315 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. 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), pp. 1112–1122, New Orleans, Louisiana, June 2018b. Association for Computational Linguistics. doi: 10.18653/v1/N18-1101. URL https://www.aclweb. org/anthology/N18-1101.
|
| 316 |
+
|
| 317 |
+
Rowan Zellers, Yonatan Bisk, Roy Schwartz, and Yejin Choi. Swag: A large-scale adversarial dataset for grounded commonsense inference. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2018. URL https://aclweb. org/anthology/D18-1009.
|
| 318 |
+
|
| 319 |
+
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? In ACL, 2019.
|
| 320 |
+
|
| 321 |
+
Sheng Zhang, Rachel Rudinger, Kevin Duh, and Benjamin Van Durme. Ordinal common-sense inference. Transactions of the Association for Computational Linguistics, 5:379–395, 2017. doi: 10.1162/tacl a 00068. URL https://www.aclweb.org/anthology/Q17-1027.
|
| 322 |
+
|
| 323 |
+
Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675, 2019.
|
| 324 |
+
|
| 325 |
+
# A APPENDICES
|
| 326 |
+
|
| 327 |
+
# A.1 DATA COLLECTION DETAILS
|
| 328 |
+
|
| 329 |
+
We describe the crowdsourcing details of our data collection method.
|
| 330 |
+
|
| 331 |
+
Task 1 - Plausible Hypothesis Options In this task, participants were presented an incomplete three-part story, which consisted of the first observation $( O _ { 1 } )$ and the second observation $( O _ { 2 } )$ o f the story. They were then asked to complete the story by writing a probable middle sentence that explains why the second observation should follow after the first one. We instructed participants to make sure that the plausible middle sentence (1) is short (fewer than 10 words) and (2) simple as if narrating to a child, (3) avoids introducing any extraneous information, and (4) uses names instead of pronouns (e.g., he/she) wherever possible.
|
| 332 |
+
|
| 333 |
+
All participants were required to meet the following qualification requirements: (1) their location is in the US, (2) HIT approval rate is greater than $9 5 ( \% )$ , and (3) Number of HITs approved is greater than 5,000. The reward of this task was set to be $\$ 0.07$ per question ( $\$ 14$ hour in average), and each HIT was assigned to five different workers (i.e., 5-way redundancy).
|
| 334 |
+
|
| 335 |
+
Task 2 - Implausible Hypothesis Options In this task, participants were presented a three-part story, which consisted of the first observation $( O _ { 1 } )$ , a middle sentence $( h ^ { + } )$ collected in Task 1, and the second observation $( O _ { 2 } )$ of the story. They were then asked to rewrite the middle sentence $( h ^ { + } )$ with minimal changes, so that the story becomes unlikely, implausible or inconsistent $( h ^ { - } )$ . We asked participants to add or remove at most four words to $h ^ { + }$ , while ensuring that the new middle sentence is grammatical. In addition, we asked them to stick to the context in the given story. For example, if the story talks about “doctors”, they are welcome to talk about “health” or “diagnosis”, but not mention “aliens”. Finally, we also asked workers to verify if the given middle $( h ^ { + } )$ makes a plausible story, in order to confirm the plausibility of $h ^ { + }$ collected in Task 1.
|
| 336 |
+
|
| 337 |
+
With respect to this task’s qualification, participants were required to fulfill the following requirements: (1) their location is the US or Canada, (2) HIT approval rate is greater than or equal to $9 9 ( \% )$ , and (3) number of HITs approved is greater than or equal to $1 0 , 0 0 0$ . Participants were paid $\$ 0.1$ per question (\$14/hour in average), and each HIT was assigned to three different participants (i.e., 3-way redundancy).
|
| 338 |
+
|
| 339 |
+
Task $\mathbf { 3 } - \alpha \mathbf { N L I }$ Human Performance Human performance was evaluated by asking participants to answer the αNLI questions. Given a narrative context $\langle O _ { 1 } , O _ { 2 } \rangle$ and two hypotheses, they were asked to choose the more plausible hypothesis. They were also allowed to choose “None of the above“ when neither hypothesis was deemed plausible.
|
| 340 |
+
|
| 341 |
+
We asked each question to seven participants with the following qualification requirements: (1) their location is either in the US, UK, or Canada, (2) HIT approval rate is greater than $9 8 ( \% )$ , (3) Number of HITs approved is greater than 10, 000. The reward was set to $\$ 0.05$ per HIT. We took the majority vote among the seven participants for every question to compute human performance.
|
| 342 |
+
|
| 343 |
+
# A.2 ART DATA STATISTICS
|
| 344 |
+
|
| 345 |
+
Table 6 shows some statistics of the ART dataset.
|
| 346 |
+
|
| 347 |
+
A.3 FINE-TUNING BERT
|
| 348 |
+
|
| 349 |
+
We fine-tuned the BERT model using a grid search with the following set of hyper-parameters:
|
| 350 |
+
|
| 351 |
+
• batch size: $\{ 3 , 4 , 8 \}$ • number of epochs: $\{ 3 , 4 , 1 0 \}$ • learning rate: {1e-5, 2e-5, 3e-5, 5e-5}
|
| 352 |
+
|
| 353 |
+
The warmup proportion was set to 0.2, and cross-entropy was used for computing the loss. The best performance was obtained with a batch size of 4, learning rate of 5e-5, and number of epochs equal to 10. Table 7 describes the input format for GPT and BERT (and its variants).
|
| 354 |
+
|
| 355 |
+
Table 6: Some statistics summarizing the ART dataset. The train set includes all plausible and implausible hypotheses collected via crowdsourcing, while the dev and test sets include the hypotheses selected through the Adversarial Filtering algorithm.
|
| 356 |
+
|
| 357 |
+
<table><tr><td></td><td>Train</td><td>Dev</td><td>Test</td></tr><tr><td>Total unique occurrences</td><td></td><td></td><td></td></tr><tr><td>Contexts (O1, O2)</td><td>17,801</td><td>1,532</td><td>3,059</td></tr><tr><td>Plausible hyp. h+</td><td>72,046</td><td>1,532</td><td>3,059</td></tr><tr><td>Implausible hyp. h-</td><td>166,820</td><td>1,532</td><td>3,059</td></tr><tr><td>Avg. size per context</td><td></td><td></td><td></td></tr><tr><td>Plausible hyp. h+</td><td>4.05</td><td>1</td><td>1</td></tr><tr><td>Implausible hyp.h-</td><td>9.37</td><td>1</td><td>1</td></tr><tr><td>Avg. word length</td><td></td><td></td><td></td></tr><tr><td>Plausible hyp. h+</td><td>8.34</td><td>8.62</td><td>8.54</td></tr><tr><td>Implausible hyp.h-</td><td>8.28</td><td>8.55</td><td>8.53</td></tr><tr><td>First observation Oi</td><td>8.09</td><td>8.07</td><td>8.17</td></tr><tr><td>Second observation O2</td><td>9.29</td><td>9.3</td><td>9.31</td></tr></table>
|
| 358 |
+
|
| 359 |
+
# A.4 BASELINES
|
| 360 |
+
|
| 361 |
+
The SVM classifier is trained on simple features like word length, overlap and sentiment features to select one of the two hypothesis choices. The bag-of-words baseline computes the average of GloVe (Pennington et al., 2014) embeddings for words in each sentence to form sentence embeddings. The sentence embeddings in a story (two observations and a hypothesis option) are concatenated and passed through fully-connected layers to produce a score for each hypothesis. The accuracies of both baselines are close to $50 \%$ (SVM: 50.6; BOW: 50.5).
|
| 362 |
+
|
| 363 |
+
Specifically, we train an SVM classifier and a bag-of-words model using GLoVE embeddings. Both models achieve accuracies close to $50 \%$ . An Infersent (Conneau et al., 2017) baseline that uses sentences embedded by max-pooling over Bi-LSTM token representations achieves only $5 0 . 8 \%$ accuracy.
|
| 364 |
+
|
| 365 |
+
Table 7: Input formats for GPT and BERT fine-tuning.
|
| 366 |
+
|
| 367 |
+
<table><tr><td>Model</td><td colspan="5">Input Format</td></tr><tr><td>GPT</td><td colspan="5">[START]O+h[SEP]O2[SEP]</td></tr><tr><td>BERT-ft [Hypothesis Only]</td><td>[CLS]h[SEP]</td><td></td><td></td><td></td><td></td></tr><tr><td>BERT-ft [First Observation Only]</td><td>[CLS]</td><td>O1</td><td></td><td>[SEP]h[SEP]</td><td></td></tr><tr><td>BERT-ft [Second Observation Only]</td><td>[CLS]</td><td>h</td><td>[SEP]</td><td>O2[SEP]</td><td></td></tr><tr><td>BERT-ft [Linear Chain]</td><td>[CLS]</td><td>O1</td><td>[SEP]</td><td></td><td>h[SEP];[CLS]h[SEP]O2[SEP]</td></tr><tr><td>BERT-ft [Fully Connected]</td><td>[CLS]</td><td></td><td></td><td>O+ O2[SEP]h[SEP]</td><td></td></tr></table>
|
| 368 |
+
|
| 369 |
+
# A.5 ADVERSARIAL FILTERING OF HYPOTHESES CHOICES
|
| 370 |
+
|
| 371 |
+
Given an observation pair and sets of plausible and implausible hypotheses $\langle O _ { 1 } , O _ { 2 } , \mathcal { H } ^ { + } , \mathcal { H } ^ { - } \rangle$ , our adversarial filtering algorithm selects one plausible and one implausible hypothesis $\langle O _ { 1 } , O _ { 2 } , h ^ { + }$ , $h ^ { - } \ \rangle$ such that $h ^ { + }$ and $h ^ { - }$ are hard to distinguish between. We make three key improvements over the previously proposed Adversarial Filtering (AF) approach in Zellers et al. (2018). First, Instead of a single positive sample, we exploit a pool $\mathcal { H } ^ { + }$ of positive samples to choose from (i.e. plausible hypotheses). Second, Instead of machine generated distractors, the pool $\varkappa ^ { - }$ of negative samples (i.e. implausible hypotheses) is human-generated. Thus, the distractors share stylistic features of the positive samples as well as that of the context (i.e. observations $O _ { 1 }$ and $O _ { 2 }$ ) – making the negative samples harder to distinguish from positive samples. Finally, We use BERT (Devlin et al., 2018) as the adversary and introduce a temperature parameter that controls the maximum number of instances that can be modified in each iteration of AF. In later iterations, fewer instances get modified resulting in a smoother convergence of the AF algorithm (described in more detail below).
|
| 372 |
+
|
| 373 |
+
Algorithm 1 provides a formal description of our approach. In each iteration $i$ , we train an adversarial model $M _ { i }$ on a random subset $\tau _ { i }$ of the data and update the validation set $\nu _ { i }$ to make it more challenging for $M _ { i }$ . For a pair $( h _ { k } ^ { + } , h _ { k } ^ { - } )$ of plausible and implausible hypotheses for an instance $k$ , we denote $\delta = \Delta _ { M _ { i } } ( h _ { k } ^ { + } , h _ { k } ^ { - } )$ the difference in the model evaluation of $h _ { k } ^ { + }$ and $h _ { k } ^ { - }$ . A positive value of $\delta$ indicates that the model $M _ { i }$ favors the plausible hypothesis $h _ { k } ^ { + }$ over the implausible one $h _ { k } ^ { - }$ . With probability $t _ { i }$ , we update instance $k$ that $M _ { i }$ gets correct with a pair $( h ^ { + } , h ^ { - } ) \in \mathcal { H } _ { k } ^ { + } \times \mathcal { H } _ { k } ^ { - }$ of hypotheses that reduces the value of $\delta$ , where $\mathcal { H } _ { k } ^ { + }$ (resp. $\mathcal { H } _ { k } ^ { - }$ ) is the pool of plausible (resp. implausible) hypotheses for instance $k$ .
|
| 374 |
+
|
| 375 |
+
We ran AF for 50 iterations and the temperature $t _ { i }$ follows a sigmoid function, parameterized by the iteration number, between $t _ { s } = 1 . 0$ and $t _ { e } = 0 . 2$ . Our final dataset, ART, is generated using BERT as the adversary in Algorithm 1.
|
| 376 |
+
|
| 377 |
+
# Algorithm 1: Dual Adversarial Filtering
|
| 378 |
+
|
| 379 |
+
input : dataset $\mathcal { D } _ { 0 }$ , plausible & implausible hypothesis sets $( \mathcal { H } ^ { + } , \mathcal { H } ^ { - } )$ , number of iterations $n$ ,
|
| 380 |
+
initial & final temperatures $( t _ { s } , t _ { e } )$
|
| 381 |
+
output: dataset $\mathcal { D } _ { n }$
|
| 382 |
+
1 for iteration $i : 0 . . n - 1$ do
|
| 383 |
+
2 $\begin{array} { r } { t _ { i } = t _ { e } + \frac { t _ { s } - t _ { e } } { 1 + e ^ { 0 . 3 ( i - \frac { 3 n } { 4 } ) } } } \end{array}$
|
| 384 |
+
3 Randomly partition $\mathcal { D } _ { i }$ into $( \mathcal { T } _ { i } , \mathcal { V } _ { i } )$ .
|
| 385 |
+
4 Train model $M _ { i }$ on $\mathcal { T } _ { i }$ .
|
| 386 |
+
5 $\mathcal { S } _ { i } = \varnothing$ , the selected hypotheses for $\nu _ { i }$ .
|
| 387 |
+
6 for $( h _ { k } ^ { + } , h _ { k } ^ { - } ) \in \mathcal { V } _ { i }$ do
|
| 388 |
+
7 Pick $r$ uniformly at random in $[ 0 , 1 ]$ .
|
| 389 |
+
8 if $r > t _ { i }$ or $\Delta _ { M _ { i } } ( h _ { k } ^ { + } , h _ { k } ^ { - } ) < 0$ then
|
| 390 |
+
9 Add $( h _ { k } ^ { + } , h _ { k } ^ { - } )$ to $s _ { i }$ .
|
| 391 |
+
10 else
|
| 392 |
+
11 Pick $( h ^ { + } , h ^ { - } ) \in \mathcal { H } _ { k } ^ { + } \times \mathcal { H } _ { k } ^ { - }$ s.t. ${ \Delta } _ { M _ { i } } ( h ^ { + } , h ^ { - } ) < \Delta _ { M _ { i } } ( h _ { k } ^ { + } , h _ { k } ^ { - } )$
|
| 393 |
+
12 Add $( h ^ { + } , h ^ { - } )$ to $s _ { i }$ .
|
| 394 |
+
13 end
|
| 395 |
+
14 end
|
| 396 |
+
15 $\mathcal { D } _ { i + 1 } = \mathcal { T } _ { i } \cup \mathcal { S } _ { i }$
|
| 397 |
+
16 end
|
| 398 |
+
|
| 399 |
+
# A.6 ATOMIC RELATIONS
|
| 400 |
+
|
| 401 |
+
ATOMIC (Sap et al., 2019) represents commonsense knowledge as a graph with events are nodes and the following nine relations as edges:
|
| 402 |
+
|
| 403 |
+
1. xIntent: Why does X cause an event?
|
| 404 |
+
2. xNeed: What does X need to do before the event?
|
| 405 |
+
3. xAttr: How would X be described?
|
| 406 |
+
4. xEffect: What effects does the event have on X?
|
| 407 |
+
5. xWant: What would X likely want to do after the event?
|
| 408 |
+
6. xReaction: How does X feel after the event?
|
| 409 |
+
7. oReact: How do others’ feel after the event?
|
| 410 |
+
8. oWant: What would others likely want to do after the event?
|
| 411 |
+
9. oEffect: What effects does the event have on others?
|
| 412 |
+
|
| 413 |
+
<table><tr><td>Model</td><td>Input Format</td></tr><tr><td>GPT2-Fixed</td><td>w1...wnw² ...w Because,</td></tr><tr><td>O1-Oz-Only</td><td>{o1)wi...wn</o1)(o2)w² ...wn</o2)(h)</td></tr><tr><td>COMeT-Txt+GPT2</td><td>(pi>T1...T(pg><p²)T²...T²(p²)(o1)wi ...wn</o1)(o2)w² ...w²</02)(h)</td></tr><tr><td>COMeT-Emb+GPT2</td><td>c1...c§;c²...c²{(o1)w1 ...wn</o1)(02)w² ...w²</o2)(h)</td></tr></table>
|
| 414 |
+
|
| 415 |
+
Table 8: Input format used to training and generated text from various GPT2 based models. $c _ { i } ^ { j }$ refers to the COMeTembeddings obtained using a separate transformer model for relation $i$ and observation $j$ . Similarly, $T _ { i } ^ { j }$ is the textual phrase for relation $i$ , observation $j$ . Where appropriate, field specific start and end-tags are added to the sequence of inputs.
|
| 416 |
+
|
| 417 |
+
# A.7 GENERATION MODELS INPUT FORMAT
|
| 418 |
+
|
| 419 |
+
Table 8 describes the format of input to each variation of the generative model evaluated.
|
md/train/Bygh9j09KX/Bygh9j09KX.md
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMAGENET-TRAINED CNNS ARE BIASED TOWARDS TEXTURE; INCREASING SHAPE BIAS IMPROVES ACCURACY AND ROBUSTNESS
|
| 2 |
+
|
| 3 |
+
Robert Geirhos University of Tubingen & IMPRS-IS¨ robert.geirhos@bethgelab.org
|
| 4 |
+
|
| 5 |
+
Patricia Rubisch University of Tubingen & U. of Edinburgh ¨ p.rubisch@sms.ed.ac.uk
|
| 6 |
+
|
| 7 |
+
Claudio Michaelis University of Tubingen & IMPRS-IS¨ claudio.michaelis@bethgelab.org
|
| 8 |
+
|
| 9 |
+
Matthias Bethge∗
|
| 10 |
+
University of Tubingen ¨
|
| 11 |
+
matthias.bethge@bethgelab.org
|
| 12 |
+
|
| 13 |
+
# Felix A. Wichmann∗
|
| 14 |
+
|
| 15 |
+
# Wieland Brendel∗
|
| 16 |
+
|
| 17 |
+
University of Tubingen ¨ felix.wichmann@uni-tuebingen.de
|
| 18 |
+
|
| 19 |
+
University of Tubingen ¨ wieland.brendel@bethgelab.org
|
| 20 |
+
|
| 21 |
+
# ABSTRACT
|
| 22 |
+
|
| 23 |
+
Convolutional Neural Networks (CNNs) are commonly thought to recognise objects by learning increasingly complex representations of object shapes. Some recent studies suggest a more important role of image textures. We here put these conflicting hypotheses to a quantitative test by evaluating CNNs and human observers on images with a texture-shape cue conflict. We show that ImageNettrained CNNs are strongly biased towards recognising textures rather than shapes, which is in stark contrast to human behavioural evidence and reveals fundamentally different classification strategies. We then demonstrate that the same standard architecture (ResNet-50) that learns a texture-based representation on ImageNet is able to learn a shape-based representation instead when trained on ‘StylizedImageNet’, a stylized version of ImageNet. This provides a much better fit for human behavioural performance in our well-controlled psychophysical lab setting (nine experiments totalling 48,560 psychophysical trials across 97 observers) and comes with a number of unexpected emergent benefits such as improved object detection performance and previously unseen robustness towards a wide range of image distortions, highlighting advantages of a shape-based representation.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Classification of a standard ResNet-50 of (a) a texture image (elephant skin: only texture cues); (b) a normal image of a cat (with both shape and texture cues), and (c) an image with a texture-shape cue conflict, generated by style transfer between the first two images.
|
| 27 |
+
|
| 28 |
+
# 1 INTRODUCTION
|
| 29 |
+
|
| 30 |
+
How are Convolutional Neural Networks (CNNs) able to reach impressive performance on complex perceptual tasks such as object recognition (Krizhevsky et al., 2012) and semantic segmentation (Long et al., 2015)? One widely accepted intuition is that CNNs combine low-level features (e.g. edges) to increasingly complex shapes (such as wheels, car windows) until the object (e.g. car) can be readily classified. As Kriegeskorte (2015) puts it, “the network acquires complex knowledge about the kinds of shapes associated with each category. [...] High-level units appear to learn representations of shapes occurring in natural images” (p. 429). This notion also appears in other explanations, such as in LeCun et al. (2015): Intermediate CNN layers recognise “parts of familiar objects, and subsequent layers [...] detect objects as combinations of these parts” (p. 436). We term this explanation the shape hypothesis.
|
| 31 |
+
|
| 32 |
+
This hypothesis is supported by a number of empirical findings. Visualisation techniques like Deconvolutional Networks (Zeiler & Fergus, 2014) often highlight object parts in high-level CNN features.1 Moreover, CNNs have been proposed as computational models of human shape perception by Kubilius et al. (2016), who conducted an impressive number of experiments comparing human and CNN shape representations and concluded that CNNs “implicitly learn representations of shape that reflect human shape perception” (p. 15). Ritter et al. (2017) discovered that CNNs develop a so-called “shape bias” just like children, i.e. that object shape is more important than colour for object classification (although see Hosseini et al. (2018) for contrary evidence). Furthermore, CNNs are currently the most predictive models for human ventral stream object recognition (e.g. Cadieu et al., 2014; Yamins et al., 2014); and it is well-known that object shape is the single most important cue for human object recognition (Landau et al., 1988), much more than other cues like size or texture (which may explain the ease at which humans recognise line drawings or millennia-old cave paintings).
|
| 33 |
+
|
| 34 |
+
On the other hand, some rather disconnected findings point to an important role of object textures for CNN object recognition. CNNs can still classify texturised images perfectly well, even if the global shape structure is completely destroyed (Gatys et al., 2017; Brendel & Bethge, 2019). Conversely, standard CNNs are bad at recognising object sketches where object shapes are preserved yet all texture cues are missing (Ballester & de Araujo, 2016). Additionally, two studies suggest that ´ local information such as textures may actually be sufficient to “solve” ImageNet object recognition: Gatys et al. (2015) discovered that a linear classifier on top of a CNN’s texture representation (Gram matrix) achieves hardly any classification performance loss compared to original network performance. More recently, Brendel & Bethge (2019) demonstrated that CNNs with explicitly constrained receptive field sizes throughout all layers are able to reach surprisingly high accuracies on ImageNet, even though this effectively limits a model to recognising small local patches rather than integrating object parts for shape recognition. Taken together, it seems that local textures indeed provide sufficient information about object classes—ImageNet object recognition could, in principle, be achieved through texture recognition alone. In the light of these findings, we believe that it is time to consider a second explanation, which we term the texture hypothesis: in contrast to the common assumption, object textures are more important than global object shapes for CNN object recognition.
|
| 35 |
+
|
| 36 |
+
Resolving these two contradictory hypotheses is important both for the deep learning community (to increase our understanding of neural network decisions) as well as for the human vision and neuroscience communities (where CNNs are being used as computational models of human object recognition and shape perception). In this work we aim to shed light on this debate with a number of carefully designed yet relatively straightforward experiments. Utilising style transfer (Gatys et al., 2016), we created images with a texture-shape cue conflict such as the cat shape with elephant texture depicted in Figure 1c. This enables us to quantify texture and shape biases in both humans and CNNs. To this end, we perform nine comprehensive and careful psychophysical experiments comparing humans against CNNs on exactly the same images, totalling 48,560 psychophysical trials across 97 observers. These experiments provide behavioural evidence in favour of the texture hypothesis: A cat with an elephant texture is an elephant to CNNs, and still a cat to humans. Beyond quantifying existing biases, we subsequently present results for our two other main contributions:
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Accuracies and example stimuli for five different experiments without cue conflict.
|
| 40 |
+
|
| 41 |
+
changing biases, and discovering emergent benefits of changed biases. We show that the texture bias in standard CNNs can be overcome and changed towards a shape bias if trained on a suitable data set. Remarkably, networks with a higher shape bias are inherently more robust to many different image distortions (for some even reaching or surpassing human performance, despite never being trained on any of them) and reach higher performance on classification and object recognition tasks.
|
| 42 |
+
|
| 43 |
+
# 2 METHODS
|
| 44 |
+
|
| 45 |
+
In this section we outline the core elements of paradigm and procedure. Extensive details to facilitate replication are provided in the Appendix. Data, code and materials are available from this repository: https://github.com/rgeirhos/texture-vs-shape
|
| 46 |
+
|
| 47 |
+
# 2.1 PSYCHOPHYSICAL EXPERIMENTS
|
| 48 |
+
|
| 49 |
+
All psychophysical experiments were conducted in a well-controlled psychophysical lab setting and follow the paradigm of Geirhos et al. (2018), which allows for direct comparisons between human and CNN classification performance on exactly the same images. Briefly, in each trial participants were presented a fixation square for $3 0 0 ~ \mathrm { { m s } }$ , followed by a $3 0 0 ~ \mathrm { { m s } }$ presentation of the stimulus image. After the stimulus image we presented a full-contrast pink noise mask ( $1 / f$ spectral shape) for $2 0 0 ~ \mathrm { { m s } }$ to minimise feedback processing in the human visual system and to thereby make the comparison to feedforward CNNs as fair as possible. Subsequently, participants had to choose one of 16 entry-level categories by clicking on a response screen shown for $1 5 0 0 ~ \mathrm { { m s } }$ . On this screen, icons of all 16 categories were arranged in a $4 \times 4$ grid. Those categories were airplane, bear, bicycle, bird, boat, bottle, car, cat, chair, clock, dog, elephant, keyboard, knife, oven and truck. Those are the so-called “16-class-ImageNet” categories introduced in Geirhos et al. (2018).
|
| 50 |
+
|
| 51 |
+
The same images were fed to four CNNs pre-trained on standard ImageNet, namely AlexNet (Krizhevsky et al., 2012), GoogLeNet (Szegedy et al., 2015), VGG-16 (Simonyan & Zisserman, 2015) and ResNet-50 (He et al., 2015). The 1,000 ImageNet class predictions were mapped to the 16 categories using the WordNet hierarchy (Miller, 1995)—e.g. ImageNet category tabby cat would be mapped to cat. In total, the results presented in this study are based on 48,560 psychophysical trials and 97 participants.
|
| 52 |
+
|
| 53 |
+
# 2.2 DATA SETS (PSYCHOPHYSICS)
|
| 54 |
+
|
| 55 |
+
In order to assess texture and shape biases, we conducted six major experiments along with three control experiments, which are described in the Appendix. The first five experiments (samples visualised in Figure 2) are simple object recognition tasks with the only difference being the image features available to the participant:
|
| 56 |
+
|
| 57 |
+
Original 160 natural colour images of objects (10 per category) with white background.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 3: Visualisation of Stylized-ImageNet (SIN), created by applying AdaIN style transfer to ImageNet images. Left: randomly selected ImageNet image of class ring-tailed lemur. Right: ten examples of images with content/shape of left image and style/texture from different paintings. After applying AdaIN style transfer, local texture cues are no longer highly predictive of the target class, while the global shape tends to be retained. Note that within SIN, every source image is stylized only once.
|
| 61 |
+
|
| 62 |
+
Greyscale Images from Original data set converted to greyscale using skimage.color.rgb2gray. For CNNs, greyscale images were stacked along the colour channel.
|
| 63 |
+
|
| 64 |
+
Silhouette Images from Original data set converted to silhouette images showing an entirely black object on a white background (see Appendix A.6 for procedure).
|
| 65 |
+
|
| 66 |
+
Edges Images from Original data set converted to an edge-based representation using Canny edge extractor implemented in MATLAB.
|
| 67 |
+
|
| 68 |
+
Texture 48 natural colour images of textures (3 per category). Typically the textures consist of full-width patches of an animal (e.g. skin or fur) or, in particular for man-made objects, of images with many repetitions of the same objects (e.g. many bottles next to each other, see Figure 7 in the Appendix).
|
| 69 |
+
|
| 70 |
+
It is important to note that we only selected object and texture images that were correctly classified by all four networks. This was made to ensure that our results in the sixth experiment on cue conflicts, which is most decisive in terms of the shape vs texture hypothesis, are fully interpretable. In the cue conflict experiment we present images with contradictory features (see Figure 1) but still ask the participant to assign a single class. Note that the instructions to human observers were entirely neutral w.r.t. shape or texture (“click on the object category that you see in the presented image; guess if unsure. There is no right or wrong answer, we are interested in your subjective impression”).
|
| 71 |
+
|
| 72 |
+
Cue conflict Images generated using iterative style transfer (Gatys et al., 2016) between an image of the Texture data set (as style) and an image from the Original data set (as content). We generated a total of 1280 cue conflict images (80 per category), which allows for presentation to human observers within a single experimental session.
|
| 73 |
+
|
| 74 |
+
We define “silhouette” as the bounding contour of an object in 2D (i.e., the outline of object segmentation). When mentioning “object shape”, we use a definition that is broader than just the silhouette of an object: we refer to the set of contours that describe the 3D form of an object, i.e. including those contours that are not part of the silhouette. Following Gatys et al. (2017), we define “texture” as an image (region) with spatially stationary statistics. Note that on a very local level, textures (according to this definition) can have non-stationary elements (such as a local shape): e.g. a single bottle clearly has non-stationary statistics, but many bottles next to each other are perceived as a texture: “things” become “stuff” (Gatys et al., 2017, p. 178). For an example of a “bottle texture” see Figure 7.
|
| 75 |
+
|
| 76 |
+
# 2.3 STYLIZED-IMAGENET
|
| 77 |
+
|
| 78 |
+
Starting from ImageNet we constructed a new data set (termed Stylized-ImageNet or SIN) by stripping every single image of its original texture and replacing it with the style of a randomly selected painting through AdaIN style transfer (Huang & Belongie, 2017) (see examples in Figure 3) with a stylization coefficient of $\alpha = 1 . 0$ . We used Kaggle’s Painter by Numbers data set2 as a style source due to its large style variety and size (79,434 paintings). We used AdaIN fast style transfer rather than iterative stylization (e.g. Gatys et al., 2016) for two reasons: Firstly, to ensure that training on SIN and testing on cue conflict stimuli is done using different stylization techniques, such that the results do not rely on a single stylization method. Secondly, to enable stylizing entire ImageNet, which would take prohibitively long with an iterative approach. We provide code to create Stylized-ImageNet here:
|
| 79 |
+
|
| 80 |
+
https://github.com/rgeirhos/Stylized-ImageNet
|
| 81 |
+
|
| 82 |
+
# 3 RESULTS
|
| 83 |
+
|
| 84 |
+
# 3.1 TEXTURE VS SHAPE BIAS IN HUMANS AND IMAGENET-TRAINED CNNS
|
| 85 |
+
|
| 86 |
+
Almost all object and texture images (Original and Texture data set) were recognised correctly by both CNNs and humans (Figure 2). Greyscale versions of the objects, which still contain both shape and texture, were recognised equally well. When object outlines were filled in with black colour to generate a silhouette, CNN recognition accuracies were much lower than human accuracies. This was even more pronounced for edge stimuli, indicating that human observers cope much better with images that have little to no texture information. One confound in these experiments is that CNNs tend not to cope well with domain shifts, i.e. the large change in image statistics from natural images (on which the networks have been trained) to sketches (which the networks have never seen before).
|
| 87 |
+
|
| 88 |
+
We thus devised a cue conflict experiment that is based on images with a natural statistic but contradicting texture and shape evidence (see Methods). Participants and CNNs have to classify the images based on the features (shape or texture) that they most rely on. The results of this experiment are visualised in Figure 4. Human observers show a striking bias towards responding with the shape category $( 9 5 . 9 \%$ of correct decisions).3 This pattern is reversed for CNNs, which show a clear bias towards responding with the texture category (VGG-16: $1 7 . 2 \%$ shape vs. $8 2 . 8 \%$ texture; GoogLeNet: $3 1 . 2 \%$ vs. $6 8 . 8 \%$ ; AlexNet: $4 2 . 9 \%$ vs. $5 7 . 1 \%$ ; ResNet-50: $2 2 . 1 \%$ vs. $7 7 . 9 \%$ ).
|
| 89 |
+
|
| 90 |
+
# 3.2 OVERCOMING THE TEXTURE BIAS OF CNNS
|
| 91 |
+
|
| 92 |
+
The psychophysical experiments suggest that ImageNet-trained CNNs, but not humans, exhibit a strong texture bias. One reason might be the training task itself: from Brendel & Bethge (2019) we know that ImageNet can be solved to high accuracy using only local information. In other words, it might simply suffice to integrate evidence from many local texture features rather than going through the process of integrating and classifying global shapes. In order to test this hypothesis we train a ResNet-50 on our Stylized-ImageNet (SIN) data set in which we replaced the object-related local texture information with the uninformative style of randomly selected artistic paintings.
|
| 93 |
+
|
| 94 |
+
A standard ResNet-50 trained and evaluated on Stylized-ImageNet (SIN) achieves $7 9 . 0 \%$ top-5 accuracy (see Table 1). In comparison, the same architecture trained and evaluated on ImageNet (IN) achieves $9 2 . 9 \%$ top-5 accuracy. This performance difference indicates that SIN is a much harder task than IN since textures are no longer predictive, but instead a nuisance factor (as desired). Intriguingly, ImageNet features generalise poorly to SIN (only $1 6 . 4 \%$ top-5 accuracy); yet features learned on SIN generalise very well to ImageNet $8 2 . 6 \%$ top-5 accuracy without any fine-tuning).
|
| 95 |
+
|
| 96 |
+
In order to test wheter local texture features are still sufficient to “solve” SIN we evaluate the performance of so-called BagNets. Introduced recently by Brendel & Bethge (2019), BagNets have a ResNet-50 architecture but their maximum receptive field size is limited to $9 \times 9$ , $1 7 \times 1 7$ or $3 3 \times 3 3$
|
| 97 |
+
|
| 98 |
+
Figure 4: Classification results for human observers (red circles) and ImageNet-trained networks AlexNet (purple diamonds), VGG16 (blue triangles), GoogLeNet (turquoise circles) and ResNet-50 (grey squares). Shape vs. texture biases for stimuli with cue conflict (sorted by human shape bias). Within the responses that corresponded to either the correct texture or correct shape category, the fractions of texture and shape decisions are depicted in the main plot (averages visualised by vertical lines). On the right side, small barplots display the proportion of correct decisions (either texture or shape correctly recognised) as a fraction of all trials. Similar results for ResNet-152, DenseNet-121 and Squeezenet1 1 are reported in the Appendix, Figure 13.
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
|
| 102 |
+
pixels. This precludes BagNets from learning or using any long-range spatial relationships for classification. While these restricted networks can reach high accuracies on ImageNet, they are unable to achieve the same on SIN, showing dramatically reduced performance with smaller receptive field sizes (such as $1 0 . 0 \%$ top-5 accuracy on SIN compared to $7 0 . 0 \%$ on ImageNet for a BagNet with receptive field size of $9 \times 9$ pixels). This is a clear indication that the SIN data set we propose does actually remove local texture cues, forcing a network to integrate long-range spatial information.
|
| 103 |
+
|
| 104 |
+
Most importantly, the SIN-trained ResNet-50 shows a much stronger shape bias in our cue conflict experiment (Figure 5), which increases from $22 \%$ for a IN-trained model to $81 \%$ . In many categories the shape bias is almost as strong as for humans.
|
| 105 |
+
|
| 106 |
+
# 3.3 ROBUSTNESS AND ACCURACY OF SHAPE-BASED REPRESENTATIONS
|
| 107 |
+
|
| 108 |
+
Does the increased shape bias, and thus the shifted representations, also affect the performance or robustness of CNNs? In addition to the IN- and SIN-trained ResNet-50 architecture we here additionally analyse two joint training schemes:
|
| 109 |
+
|
| 110 |
+
• Training jointly on SIN and IN. • Training jointly on SIN and IN with fine-tuning on IN. We refer to this model as Shape-ResNet.
|
| 111 |
+
|
| 112 |
+
<table><tr><td>architecture</td><td>IN→IN</td><td>IN→SIN</td><td>SIN→SIN</td><td>SIN→IN</td></tr><tr><td>ResNet-50</td><td>92.9</td><td>16.4</td><td>79.0</td><td>82.6</td></tr><tr><td>BagNet-33 (mod.ResNet-50)</td><td>86.4</td><td>4.2</td><td>48.9</td><td>53.0</td></tr><tr><td>BagNet-17 (mod.ResNet-50)</td><td>80.3</td><td>2.5</td><td>29.3</td><td>32.6</td></tr><tr><td>BagNet-9 (mod. ResNet-50)</td><td>70.0</td><td>1.4</td><td>10.0</td><td>10.9</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Table 1: Stylized-ImageNet cannot be solved with texture features alone. Accuracy comparison (in percent; top-5 on validation data set) of a standard ResNet-50 with Bag of Feature networks (BagNets) with restricted receptive field sizes of $3 3 \times 3 3$ , $1 7 \times 1 7$ and $9 \times 9$ pixels. Arrows indicate: train data test data, e.g. $\mathrm { I N } { } \mathrm { S I N }$ means training on ImageNet and testing on Stylized-ImageNet.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 5: Shape vs. texture biases for stimuli with a texture-shape cue conflict after training ResNet50 on Stylized-ImageNet (orange squares) and on ImageNet (grey squares). Plotting conventions and human data (red circles) for comparison are identical to Figure 4. Similar results for other networks are reported in the Appendix, Figure 11.
|
| 118 |
+
Fraction of 'texture' decisions
|
| 119 |
+
|
| 120 |
+
Table 2: Accuracy comparison on the ImageNet (IN) validation data set as well as object detection performance (mAP50) on PASCAL VOC 2007 and MS COCO. All models have an identical ResNet-50 architecture. Method details reported in the Appendix, where we also report similar results for ResNet-152 (Table 4).
|
| 121 |
+
|
| 122 |
+
<table><tr><td>name</td><td>training</td><td>fine-tuning</td><td>top-1 IN accuracy (%)</td><td>top-5 IN accuracy (%)</td><td>Pascal VOC mAP50 (%)</td><td>MS COCO mAP50 (%)</td></tr><tr><td rowspan="3">vanilla ResNet</td><td>IN</td><td>=</td><td>76.13</td><td>92.86</td><td>70.7</td><td>52.3</td></tr><tr><td>SIN</td><td>=</td><td>60.18</td><td>82.62</td><td>70.6</td><td>51.9</td></tr><tr><td>SIN+IN</td><td>1</td><td>74.59</td><td>92.14</td><td>74.0</td><td>53.8</td></tr><tr><td>Shape-ResNet</td><td>SIN+IN</td><td>IN</td><td>76.72</td><td>93.28</td><td>75.1</td><td>55.2</td></tr></table>
|
| 123 |
+
|
| 124 |
+
We then compared these models with a vanilla ResNet-50 on three experiments: (1) classification performance on IN, (2) transfer to Pascal VOC 2007 and (3) robustness against image perturbations.
|
| 125 |
+
|
| 126 |
+
Classification performance Shape-ResNet surpasses the vanilla ResNet in terms of top-1 and top5 ImageNet validation accuracy as reported in Table 2. This indicates that SIN may be a useful data augmentation on ImageNet that can improve model performance without any architectural changes.
|
| 127 |
+
|
| 128 |
+
Transfer learning We tested the representations of each model as backbone features for Faster RCNN (Ren et al., 2017) on Pascal VOC 2007 and MS COCO. Incorporating SIN in the training data substantially improves object detection performance from 70.7 to $7 5 . 1 \mathrm { m A P 5 0 }$ (52.3 to 55.2 mAP50 on MS COCO) as shown in Table 2. This is in line with the intuition that for object detection, a shape-based representation is more beneficial than a texture-based representation, since the ground truth rectangles encompassing an object are by design aligned with global object shape.
|
| 129 |
+
|
| 130 |
+
Robustness against distortions We systematically tested how model accuracies degrade if images are distorted by uniform or phase noise, contrast changes, high- and low-pass filtering or eidolon perturbations.4 The results of this comparison, including human data for reference, are visualised in Figure 6. While lacking a few percent accuracy on undistorted images, the SIN-trained network outperforms the IN-trained CNN on almost all image manipulations. (Low-pass filtering / blurring is the only distortion type on which SIN-trained networks are more susceptible, which might be due to the over-representation of high frequency signals in SIN through paintings and the reliance on sharp edges.) The SIN-trained ResNet-50 approaches human-level distortion robustness—despite never seeing any of the distortions during training.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 6: Classification accuracy on parametrically distorted images. ResNet-50 trained on StylizedImageNet (SIN) is more robust towards distortions than the same network trained on ImageNet (IN).
|
| 134 |
+
|
| 135 |
+
Furthermore, we provide robustness results for our models tested on ImageNet-C, a comprehensive benchmark of 15 different image corruptions (Hendrycks & Dietterich, 2019), in Table 5 of the Appendix. Training jointly on SIN and IN leads to strong improvements for 13 corruption types (Gaussian, Shot and Impulse noise; Defocus, Glas and Motion blur; Snow, Frost and Fog weather types; Contrast, Elastic, Pixelate and JPEG digital corruptions). This substantially reduces overall corruption error from 76.7 for a vanilla ResNet-50 to 69.3. Again, none of these corruption types were explicitly part of the training data, reinforcing that incorporating SIN in the training regime improves model robustness in a very general way.
|
| 136 |
+
|
| 137 |
+
# 4 DISCUSSION
|
| 138 |
+
|
| 139 |
+
As noted in the Introduction, there seems to be a large discrepancy between the common assumption that CNNs use increasingly complex shape features to recognise objects and recent empirical findings which suggest a crucial role of object textures instead. In order to explicitly probe this question, we utilised style transfer (Gatys et al., 2016) to generate images with conflicting shape and texture information. On the basis of extensive experiments on both CNNs and human observers in a controlled psychophysical lab setting, we provide evidence that unlike humans, ImageNet-trained CNNs tend to classify objects according to local textures instead of global object shapes. In combination with previous work which showed that changing other major object dimensions such as colour (Geirhos et al., 2018) and object size relative to the context (Eckstein et al., 2017) do not have a strong detrimental impact on CNN recognition performance, this highlights the special role that local cues such as textures seem to play in CNN object recognition.
|
| 140 |
+
|
| 141 |
+
Intriguingly, this offers an explanation for a number of rather disconnected findings: CNNs match texture appearance for humans (Wallis et al., 2017), and their predictive power for neural responses along the human ventral stream appears to be largely due to human-like texture representations, but not human-like contour representations (Laskar et al., 2018; Long & Konkle, 2018). Furthermore, texture-based generative modelling approaches such as style transfer (Gatys et al., 2016), single image super-resolution (Gondal et al., 2018) as well as static and dynamic texture synthesis (Gatys et al., 2015; Funke et al., 2017) all produce excellent results using standard CNNs, while CNNbased shape transfer seems to be very difficult (Gokaslan et al., 2018). CNNs can still recognise images with scrambled shapes (Gatys et al., 2017; Brendel & Bethge, 2019), but they have much more difficulties recognising objects with missing texture information (Ballester & de Araujo, 2016; ´ Yu et al., 2017). Our hypothesis might also explain why an image segmentation model trained on a database of synthetic texture images transfers to natural images and videos (Ustyuzhaninov et al.,
|
| 142 |
+
|
| 143 |
+
2018). Beyond that, our results show marked behavioural differences between ImageNet-trained CNNs and human observers. While both human and machine vision systems achieve similarly high accuracies on standard images (Geirhos et al., 2018), our findings suggest that the underlying classification strategies might actually be very different. This is problematic, since CNNs are being used as computational models for human object recognition (e.g. Cadieu et al., 2014; Yamins et al., 2014).
|
| 144 |
+
|
| 145 |
+
In order to reduce the texture bias of CNNs we introduced Stylized-ImageNet (SIN), a data set that removes local cues through style transfer and thereby forces networks to go beyond texture recognition. Using this data set, we demonstrated that a ResNet-50 architecture can indeed learn to recognise objects based on object shape, revealing that the texture bias in current CNNs is not by design but induced by ImageNet training data. This indicates that standard ImageNet-trained models may be taking a “shortcut” by focusing on local textures, which could be seen as a version of Occam’s razor: If textures are sufficient, why should a CNN learn much else? While texture classification may be easier than shape recognition, we found that shape-based features trained on SIN generalise well to natural images.
|
| 146 |
+
|
| 147 |
+
Our results indicate that a more shape-based representation can be beneficial for recognition tasks that rely on pre-trained ImageNet CNNs. Furthermore, while ImageNet-trained CNNs generalise poorly towards a wide range of image distortions (e.g. Dodge & Karam, 2017; Geirhos et al., 2017; 2018), our ResNet-50 trained on Stylized-ImageNet often reaches or even surpasses human-level robustness (without ever being trained on the specific image degradations). This is exciting because Geirhos et al. (2018) showed that networks trained on specific distortions in general do not acquire robustness against other unseen image manipulations. This emergent behaviour highlights the usefulness of a shape-based representation: While local textures are easily distorted by all sorts of noise (including those in the real world, such as rain and snow), the object shape remains relatively stable. Furthermore, this finding offers a compellingly simple explanation for the incredible robustness of humans when coping with distortions: a shape-based representation.
|
| 148 |
+
|
| 149 |
+
# 5 CONCLUSION
|
| 150 |
+
|
| 151 |
+
In summary, we provided evidence that machine recognition today overly relies on object textures rather than global object shapes as commonly assumed. We demonstrated the advantages of a shapebased representation for robust inference (using our Stylized-ImageNet data set5 to induce such a representation in neural networks). We envision our findings as well as our openly available model weights, code and behavioural data set (49K trials across 97 observers)6 to achieve three goals: Firstly, an improved understanding of CNN representations and biases. Secondly, a step towards more plausible models of human visual object recognition. Thirdly, a useful starting point for future undertakings where domain knowledge suggests that a shape-based representation may be more beneficial than a texture-based one.
|
| 152 |
+
|
| 153 |
+
# ACKNOWLEDGMENTS
|
| 154 |
+
|
| 155 |
+
This work has been funded, in part, by the German Research Foundation (DFG; Sachbeihilfe Wi 2103/4-1 and SFB 1233 on “Robust Vision”). The authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting R.G. and C.M.; M.B. acknowledges support by the Centre for Integrative Neuroscience Tubingen (EXC 307) and by the Intelli- ¨ gence Advanced Research Projects Activity (IARPA) via Department of Interior/Interior Business Center (DoI/IBC) contract number D16PC00003.
|
| 156 |
+
|
| 157 |
+
We would like to thank Dan Hendrycks for providing the results of Table 5 (corruption robustness of our models on ImageNet-C). Furthermore, we would like to express our gratitude towards Alexander Ecker, Leon Gatys, Tina Gauger, Silke Gramer, Heike Konig, Jonas Rauber, Steffen Schneider, ¨ Heiko Schutt, Tom Wallis and Uli Wannek for support and/or useful discussions. ¨
|
| 158 |
+
|
| 159 |
+
# REFERENCES
|
| 160 |
+
|
| 161 |
+
Pedro Ballester and Ricardo Matsumura de Araujo. On the performance of GoogLeNet and AlexNet ´ applied to sketches. In AAAI, pp. 1124–1128, 2016.
|
| 162 |
+
|
| 163 |
+
Wieland Brendel and Matthias Bethge. Approximating CNNs with bag-of-local-features models works surprisingly well on ImageNet. In International Conference on Learning Representations, 2019.
|
| 164 |
+
|
| 165 |
+
Charles F Cadieu, H Hong, D L K Yamins, N Pinto, D Ardila, E A Solomon, N J Majaj, and J J DiCarlo. Deep neural networks rival the representation of primate IT cortex for core visual object recognition. PLoS Computational Biology, 10(12), 2014.
|
| 166 |
+
|
| 167 |
+
Samuel Dodge and Lina Karam. A study and comparison of human and deep learning recognition performance under visual distortions. arXiv preprint arXiv:1705.02498, 2017.
|
| 168 |
+
|
| 169 |
+
Miguel P Eckstein, Kathryn Koehler, Lauren E Welbourne, and Emre Akbas. Humans, but not deep neural networks, often miss giant targets in scenes. Current Biology, 27(18):2827–2832, 2017.
|
| 170 |
+
|
| 171 |
+
Christina M Funke, Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Synthesising dynamic textures using convolutional neural networks. arXiv preprint arXiv:1702.07006, 2017.
|
| 172 |
+
|
| 173 |
+
Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Texture synthesis using convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 262–270, 2015.
|
| 174 |
+
|
| 175 |
+
Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2414–2423, 2016.
|
| 176 |
+
|
| 177 |
+
Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Texture and art with deep neural networks. Current Opinion in Neurobiology, 46:178–186, 2017.
|
| 178 |
+
|
| 179 |
+
Robert Geirhos, David HJ Janssen, Heiko H Schutt, Jonas Rauber, Matthias Bethge, and Felix A ¨ Wichmann. Comparing deep neural networks against humans: object recognition when the signal gets weaker. arXiv preprint arXiv:1706.06969, 2017.
|
| 180 |
+
|
| 181 |
+
Robert Geirhos, Carlos M. Medina Temme, Jonas Rauber, Heiko H Schutt, Matthias Bethge, ¨ and Felix A Wichmann. Generalisation in humans and deep neural networks. arXiv preprint arXiv:1808.08750, 2018.
|
| 182 |
+
|
| 183 |
+
Aaron Gokaslan, Vivek Ramanujan, Daniel Ritchie, Kwang In Kim, and James Tompkin. Improving shape deformation in unsupervised image-to-image translation. arXiv preprint arXiv:1808.04325, 2018.
|
| 184 |
+
|
| 185 |
+
Muhammad W Gondal, Bernhard Scholkopf, and Michael Hirsch. The unreasonable effectiveness ¨ of texture transfer for single image super-resolution. arXiv preprint arXiv:1808.00043, 2018.
|
| 186 |
+
|
| 187 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
| 188 |
+
|
| 189 |
+
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019.
|
| 190 |
+
|
| 191 |
+
Hossein Hosseini, Baicen Xiao, Mayoore Jaiswal, and Radha Poovendran. Assessing shape bias property of Convolutional Neural Networks. arXiv preprint arXiv:1803.07739, 2018.
|
| 192 |
+
|
| 193 |
+
Xun Huang and Serge J Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, pp. 1510–1519, 2017.
|
| 194 |
+
|
| 195 |
+
Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast feature embedding. In Proceedings of the 22nd ACM International Conference on Multimedia, pp. 675–678. ACM, 2014.
|
| 196 |
+
|
| 197 |
+
Ivan Krasin, Tom Duerig, Neil Alldrin, Vittorio Ferrari, Sami Abu-El-Haija, Alina Kuznetsova, Hassan Rom, Jasper Uijlings, Stefan Popov, Andreas Veit, Serge Belongie, Victor Gomes, Abhinav Gupta, Chen Sun, Gal Chechik, David Cai, Zheyun Feng, Dhyanesh Narayanan, and Kevin Murphy. OpenImages: A public dataset for large-scale multi-label and multi-class image classification. Dataset available from https://github.com/openimages, 2017.
|
| 198 |
+
|
| 199 |
+
N. Kriegeskorte. Deep neural networks: A new framework for modeling biological vision and brain information processing. Annual Review of Vision Science, 1(15):417–446, 2015.
|
| 200 |
+
|
| 201 |
+
A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1097–1105, 2012.
|
| 202 |
+
|
| 203 |
+
Jonas Kubilius, Stefania Bracci, and Hans P Op de Beeck. Deep neural networks as a computational model for human shape sensitivity. PLoS Computational Biology, 12(4):e1004896, 2016.
|
| 204 |
+
|
| 205 |
+
Barbara Landau, Linda B Smith, and Susan S Jones. The importance of shape in early lexical learning. Cognitive Development, 3(3):299–321, 1988.
|
| 206 |
+
|
| 207 |
+
Md Nasir Uddin Laskar, Luis G Sanchez Giraldo, and Odelia Schwartz. Correspondence of deep neural networks and the brain for visual textures. arXiv preprint arXiv:1806.02888, 2018.
|
| 208 |
+
|
| 209 |
+
Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 210 |
+
|
| 211 |
+
Bria Long and Talia Konkle. The role of textural statistics vs. outer contours in deep CNN and neural responses to objects. http://konklab.fas.harvard.edu/ ConferenceProceedings/Long_2018_CCN.pdf, 2018.
|
| 212 |
+
|
| 213 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3431–3440, 2015.
|
| 214 |
+
|
| 215 |
+
George A Miller. WordNet: a lexical database for English. Communications of the ACM, 38(11): 39–41, 1995.
|
| 216 |
+
|
| 217 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch, 2017.
|
| 218 |
+
|
| 219 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. IEEE Transactions on Pattern Analysis & Machine Intelligence, pp. 1137–1149, 2017.
|
| 220 |
+
|
| 221 |
+
Samuel Ritter, David GT Barrett, Adam Santoro, and Matt M Botvinick. Cognitive psychology for deep neural networks: A shape bias case study. arXiv preprint arXiv:1706.08606, 2017.
|
| 222 |
+
|
| 223 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2015.
|
| 224 |
+
|
| 225 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–9, 2015.
|
| 226 |
+
|
| 227 |
+
Ivan Ustyuzhaninov, Claudio Michaelis, Wieland Brendel, and Matthias Bethge. One-shot texture segmentation. arXiv preprint arXiv:1807.02654, 2018.
|
| 228 |
+
|
| 229 |
+
Thomas SA Wallis, Christina M Funke, Alexander S Ecker, Leon A Gatys, Felix A Wichmann, and Matthias Bethge. A parametric texture model based on deep convolutional features closely matches texture appearance for humans. Journal of Vision, 17(12):5–5, 2017.
|
| 230 |
+
|
| 231 |
+
Daniel LK Yamins, Ha Hong, Charles F Cadieu, Ethan A Solomon, Darren Seibert, and James J DiCarlo. Performance-optimized hierarchical models predict neural responses in higher visual cortex. Proceedings of the National Academy of Sciences, 111(23):8619–8624, 2014.
|
| 232 |
+
|
| 233 |
+
Qian Yu, Yongxin Yang, Feng Liu, Yi-Zhe Song, Tao Xiang, and Timothy M Hospedales. Sketcha-net: A deep neural network that beats humans. International Journal of Computer Vision, 122 (3):411–425, 2017.
|
| 234 |
+
|
| 235 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European Conference on Computer Vision, pp. 818–833. Springer, 2014.
|
| 236 |
+
|
| 237 |
+
# A APPENDIX
|
| 238 |
+
|
| 239 |
+
# A.1 REPRODUCIBILITY & ACCESS TO CODE / MODELS / DATA
|
| 240 |
+
|
| 241 |
+
In this Appendix, we report experimental details for human and CNN experiments. All trained model weights reported in this paper as well as our human behavioural data set (48,560 psychophysical trials across 97 observers) are openly available from this repository:
|
| 242 |
+
|
| 243 |
+
https://github.com/rgeirhos/texture-vs-shape
|
| 244 |
+
|
| 245 |
+
# A.2 PROCEDURE
|
| 246 |
+
|
| 247 |
+
We followed the paradigm of Geirhos et al. (2018) for maximal comparability. A trial consisted of $3 0 0 ~ \mathrm { { m s } }$ presentation of a fixation square and a $2 0 0 ~ \mathrm { { m s } }$ presentation of the stimulus image, which was followed by a full-contrast pink noise mask $1 / f$ spectral shape) of the same size lasting for 200 ms. Participants had to choose one of 16 entry-level categories by clicking on a response screen shown for $1 5 0 0 ~ \mathrm { { m s } }$ . On this screen, icons of all 16 categories were arranged in a $4 \times 4$ grid. The experiments were not self-paced and therefore one trial always lasted $2 2 0 0 ~ \mathrm { { m s } }$ $3 0 0 \mathrm { m s } + 2 0 0 \mathrm { m s } +$ $2 0 0 ~ \mathrm { m s } + 1 5 0 0 ~ \mathrm { m s } = 2 2 0 0 ~ \mathrm { m s }$ . The necessary time to complete an experiment with 1280 stimuli was 47 minutes, for 160 stimuli six minutes, and for 48 stimuli two minutes. In the experiments with 1280 trials, observers were given the possibility of taking a brief break after every block of 256 trials (five blocks in total).
|
| 248 |
+
|
| 249 |
+
As preparation, participants were shown the response screen prior to an experiment and were asked to name all 16 categories in order to get an overview over the possible stimuli categories and to make sure that all categories were clear from the beginning. They were instructed to click on the category they believed was presented. Responses through clicking on a response screen could be changed within the $1 5 0 0 ~ \mathrm { { m s } }$ response interval, only the last entered response was counted as the answer. Prior to the real experiment a practice session was performed for the participants to get used to the time course of the experiment and the position of category items on the response screen. This screen was shown for an additional $3 0 0 ~ \mathrm { { m s } }$ in order to provide feedback and indicate whether the entered answer was incorrect. In that case, a short low beep sound occurred and the correct category was highlighted by setting its background to white. The practice session consisted of 320 trials. After 160 trials the participants had the chance to take a short break. In the break, their performance of the first block was shown on the screen along the percentage of trials where no answer was entered. After the practice blocks, observers were shown an example image of the manipulation (not used in the experiment) to minimise surprise. Images used in the practice session were natural images from 16-class-ImageNet (Geirhos et al., 2018), hence there was no overlap with images or manipulations used in the experiments.
|
| 250 |
+
|
| 251 |
+
# A.3 APPARATUS
|
| 252 |
+
|
| 253 |
+
Observers were shown the $2 2 4 \times 2 2 4$ pixels stimuli in a dark cabin on a $2 2 '$ , $1 2 0 \mathrm { H z }$ VIEWPixx LCD monitor (VPixx Technologies, Saint-Bruno, Canada). The screen of size $4 8 4 \times 3 0 2 \mathrm { m m }$ corresponds to $1 9 2 0 \times 1 2 0 0$ pixels, although stimuli were only presented foveally at the center of the screen $3 \times 3$ degrees of visual angle at a viewing distance of $1 0 7 \ \mathrm { c m }$ ) while the background was set to a grey value of 0.7614 in the $[ 0 , 1 ]$ range, the average greyscale value of all stimuli used in the original experiment. Participants used a chin rest to keep their head position static during an experiment. Stimulus presentation was conducted with the Psychophysics Toolbox (version 3.0.12) in MATLAB (Release 2016a, The MathWorks, Inc., Natick, Massachusetts, United States) using a 12-core desktop computer (AMD HD7970 graphics card “Tahiti” by AMD, Sunnyvale, California, United States) running Kubuntu 14.04 LTS. Participants clicked on a response screen, showing an iconic representation of all of the 16 object categories as reported in Geirhos et al. (2018), with a normal computer mouse.
|
| 254 |
+
|
| 255 |
+
Table 3: Characteristics of human participants (p.) across experiments. The symbol ‘#’ refers to “number of”; ‘rt’ stands for “median reaction time (ms)” in an experiment.
|
| 256 |
+
|
| 257 |
+
<table><tr><td>experiment</td><td>instruction</td><td>#p.</td><td>#</td><td>#</td><td>age range</td><td>mean age</td><td># stimuli</td><td>rt</td></tr><tr><td>original</td><td>neutral</td><td>5</td><td>5</td><td>0</td><td>21-27</td><td>24.2</td><td>160</td><td>772</td></tr><tr><td>greyscale</td><td>neutral</td><td>5</td><td>4</td><td>1</td><td>20-26</td><td>23.4</td><td>160</td><td>811</td></tr><tr><td> texture</td><td>neutral</td><td>5</td><td>2</td><td>3</td><td>23-36</td><td>29.0</td><td>48</td><td>769</td></tr><tr><td>silhouette</td><td>neutral</td><td>10</td><td>9</td><td>1</td><td>21-37</td><td>24.1</td><td>160</td><td>861</td></tr><tr><td>edge</td><td>neutral</td><td>10</td><td>6</td><td>4</td><td>18-30</td><td>23.0</td><td>160</td><td>791</td></tr><tr><td>cue conflict</td><td>neutral</td><td>10</td><td>7</td><td>3</td><td>20-29</td><td>23.0</td><td>1280</td><td>828</td></tr><tr><td>cue conflict control</td><td>texture</td><td>10</td><td>5</td><td>5</td><td>23-32</td><td>26.6</td><td>1280</td><td>942</td></tr><tr><td>cue conflict control</td><td>shape</td><td>10</td><td>9</td><td>1</td><td>18-25</td><td>21.8</td><td>1280</td><td>827</td></tr><tr><td>filled silhouette</td><td>neutral</td><td>32</td><td>22</td><td>10</td><td>18-30</td><td>22.3</td><td>160</td><td>881</td></tr><tr><td>overall</td><td></td><td>97</td><td>69</td><td>28</td><td>18-37</td><td>23.5</td><td>48,560 trials</td><td>857</td></tr></table>
|
| 258 |
+
|
| 259 |
+
# A.4 PARTICIPANTS
|
| 260 |
+
|
| 261 |
+
In total, 97 human observers participated in the study. For a detailed overview about how they were distributed across experiments see Table 3. No observer participated in more than one experiment, and all participants reported normal or corrected-to-normal vision. Observers participating in experiments with a cue conflict manipulation were paid $\notin 1 0$ per hour or gained course credit. Observers measured in all other experiments (with a clear ground truth category) were able to earn an additional bonus up to $\notin 5$ or equivalent further course credit based on their performance. This motivation scheme was applied to ensure reliable answer rates, and explained to observers in advance. Participant bonus, in these cases, was calculated as follows: The base level with a bonus of $\notin 0$ was set to $50 \%$ accuracy. For every additional $5 \%$ of accuracy, participants gained $_ { 1 } \notin 0 . 5 0$ bonus. This means that with a performance above $9 5 \%$ , an observer was able to gain the full bonus of $\notin 5$ or equivalent course credit. Overall, we took the following steps to prevent low quality human data: 1., using a controlled lab environment instead of an online crowdsourcing platform; 2. the payment motivation scheme as explained above; 3. displaying observer performance on the screen at regular intervals during the practice session; and 4. splitting longer experiments into five blocks, where participants could take a break in between blocks.
|
| 262 |
+
|
| 263 |
+
# A.5 CNN MODELS & TRAINING DETAILS
|
| 264 |
+
|
| 265 |
+
ResNet-50 We used a standard ResNet-50 architecture from PyTorch (Paszke et al., 2017), the torchvision.models.resnet50 implementation. For the comparison against BagNets reported in Table 1, results for IN training correspond to a ResNet-50 pre-trained on ImageNet without any modifications (model weights from torchvision.models). Reported results for SIN training correspond to the same architecture trained on SIN for 60 epochs with Stochastic Gradient Descent (torch.optim.SGD) using a momentum term of 0.9, weight decay (1e-4) and a learning rate of 0.1 which was multiplied by a factor of 0.1 after 20 and 40 epochs of training. We used a batch size of 256. This SIN-trained model is the same model that is reported in Figures 5 and 6 as well as in Table 2. In the latter, this corresponds to the second row (training performed on SIN, no fine-tuning on ImageNet). For the model reported in the third row, training was jointly performed on SIN and on IN. This means that both training data sets were treated as one big data set (exactly twice the size of the IN training data set), on which training was performed for 45 epochs with identical hyperparameters as described above, except that the initial learning rate of 0.1 was multiplied by 0.1 after 15 and 30 epochs. The weights of this model were then used to initialise the model reported in the fourth row of Table 2, which was fine-tuned for 60 epochs on ImageNet (identical hyperparameters except that the initial learning rate of 0.01 was multiplied by 0.1 after 30 epochs). We compared training models from scratch versus starting from an ImageNet-pretrained model. Empirically, using features pre-trained on ImageNet led to better results across experiments, which is why we used ImageNet pre-training throughout experiments and models (for both ResNet-50 and restricted ResNet-50 models).
|
| 266 |
+
|
| 267 |
+
BagNets Model weights (pre-trained on ImageNet) and architectures for BagNets (results reported in Table 1) were kindly provided by Brendel & Bethge (2019). For SIN training, identical settings as for the SIN-trained ResNet-50 were used to ensure comparability (training for 60 epochs with SGD and identical hyperparameters as reported above).
|
| 268 |
+
|
| 269 |
+
Faster R-CNN We used the Faster R-CNN implementation from https://github.com/ jwyang/faster-rcnn.pytorch (commit 21f28986) with all hyperparameters kept at default. The only changes we made to the model is replacing the encoder with ResNet-50 (respectively ResNet-152 for the results in Table 4) and applying custom input whitening. For Pascal VOC 2007 we trained the model for 7 epochs with a batch size of 1, a learning rate of 0.001 and a learning rate decay step after epoch 5. Images were resized to have a short edge of 600 pixels. For MS COCO we trained the same model on the 2017 train/val split for training and testing respectively. We trained for 6 epochs with a batch size of 16 on 8 GPUs employing a learning rate of 0.02 and a decay step after 4 epochs. Images were resized to have a short edge of 800 pixels.
|
| 270 |
+
|
| 271 |
+
Pre-trained AlexNet, GoogLeNet, VGG-16 We used AlexNet (Krizhevsky et al., 2012), GoogLeNet (Szegedy et al., 2015) and VGG-16 (Simonyan & Zisserman, 2015) for the evaluation reported in Figure 4. Evaluation was performed using Caffe (Jia et al., 2014). Network weights (training on ImageNet) were obtained from https://github.com/BVLC/caffe/ wiki/Model-Zoo (AlexNet & GoogLeNet) and http://www.robots.ox.ac.uk/ (VGG16).
|
| 272 |
+
|
| 273 |
+
ResNet-101 pre-trained on Open Images V2 For our comparison of biases in ImageNet vs. OpenImages (Figure 13 right) the ResNet-101 pretrained on Open Images V2 (Krasin et al., 2017) was used. It was obtained from https://github.com/openimages/dataset/blob/ master/READMEV2.md along with the inference code provided by the authors. In order to map predictions to the 16 classes, we used the parameters to $p _ { - } k = 1 0 0 0 0 0$ and score thresho $\ ' d = 0 . 0$ to obtain as all predictions, and then mapped the responses to our 16 classes using the provided label map. 15 out of our 16 classes are classes in Open Images as well; the remaining class keyboard was mapped to Open Images class computer keyboard (in this case, Open Images makes a finer distinction to separate musical keyboards from computer keyboards).
|
| 274 |
+
|
| 275 |
+
ResNet-101, ResNet-152, DenseNet-121, SqueezeNet1 1 For the comparison to other models pre-trained on ImageNet (Figure 13 left), we evaluated the pre-trained networks provided by torchvision.models.
|
| 276 |
+
|
| 277 |
+
Training AlexNet, VGG-16 on SIN For the evaluation of model biases after training on SIN (Figure 11), we obtained the model architectures from torchvision.models and trained the networks under identical circumstances as ResNet-50. This includes identical hyperparameter settings, except for the learning rate. The learning rate for AlexNet was set to 0.001 and for VGG-16 to 0.01 initially; both learning rates were multiplied by 0.1 after 20 and 40 epochs of training (60 epochs in total).
|
| 278 |
+
|
| 279 |
+
# A.6 IMAGE MANIPULATIONS AND IMAGE DATABASE
|
| 280 |
+
|
| 281 |
+
In total, we conducted nine different experiments. Here is an overview of the images and / or image manipulations for all of them. All images were saved in the png format and had a size of $2 2 4 \times 2 2 4$ pixels. Original, texture and cue conflict images are visualised in Figure 7.
|
| 282 |
+
|
| 283 |
+
Original experiment This experiment consisted of 160 coloured images, 10 per category. All of them had a single, unmanipulated object (belonging to one category) in front of a white background. This white background was especially important since these stimuli were being used as content images for style transfer, and we thus made sure that the background was neutral to produce better style transfer results. The images for this experiment as well as for the texture experiment described below were carefully selected using Google advanced image search with the criteria “labelled for noncommercial reuse with modification (free to use, share and modify)” and the search term “<entity $>$ white background” (original) or “<entity $>$ texture” (texture). In some cases where this did not lead to sufficient results, we used images from the ImageNet validation data set which were manually modified to have a white background if necessary. We made sure that both the images from this experiment as well as the texture images were all correctly recognised by all four pre-trained CNNs (if an image was not correctly recognised, we replaced it by another one). This was used to ensure that our results for cue conflict experiments are fully interpretable: if, e.g., a texture image was not correctly recognised by CNNs, there would be no point in using it as a texture (style) source for style transfer.
|
| 284 |
+
|
| 285 |
+
Greyscale experiment This experiment used the same images as the original experiment with the difference that they were converted to greyscale using skimage.color.rgb2gray. For CNNs, greyscale images were stacked three times along the colour channel.
|
| 286 |
+
|
| 287 |
+
Silhouette experiment The images from the original experiment were transformed into silhouette images showing an entirely black object on a white background. We used the following transformation procedure: First, images were converted to bmp using command line utility (convert). They were then converted to svg using potrace, and then to png using convert again. Since an entirely automatic binarization pipeline is not feasible (it takes domain knowledge to understand that a car wheel should, but a doughnut should not be filled with black colour), we then manually checked every single image and adapted the silhouette using GIMP if necessary.
|
| 288 |
+
|
| 289 |
+
Edge experiment The stimuli shown in this condition were generated by applying the “Canny” edge extractor implemented in MATLAB (Release 2016a, The MathWorks, Inc., Natick, Massachusetts, United States) to the images used in the original experiment. No further manipulations were performed on this data set. This line of code was used to detect edges and generate the stimuli used in this experiment:
|
| 290 |
+
|
| 291 |
+
imwrite(1-edge(imgaussfilt(rgb2gray(imread(filename)), 2), ’Canny’), targetFilename);
|
| 292 |
+
|
| 293 |
+
Texture experiment Images were selected using the procedure outlined above for the original experiment. Some objects have a fairly stationary texture (e.g. animals), which makes it easy to find texture images for them. For the more difficult case (e.g. man-made objects), we made use of the fact that every object can become a texture if it is used not in isolation, but rather in a clutter of many objects of the same kind (e.g. Gatys et al., 2017). That is, for a bottle texture we used images with many bottles next to each other (as visualised in Figure 7).
|
| 294 |
+
|
| 295 |
+
Cue conflict experiment This experiment used images with a texture-shape cue conflict. They were generated using iterative style transfer (Gatys et al., 2016) between a texture image (from the texture experiment described above) and a content image (from the original experiment) each. While 48 texture images and 160 content images would allow for a total of $4 8 \times 1 6 0 = 7 6 8 0$ cue conflict images (480 per category), we used a balanced subset of 1280 images instead (80 per category), which allows for presentation to human observers within a single experimental session. The procedure for selecting the style and content images was done as follows. For all possible $1 6 \times 1 6$ combinations of style and texture categories, exactly five cue conflict images were generated by randomly sampling style and content images from their respective categories. Sampling was performed without replacement for as long as possible, and then without replacement for the remaining images. The same stimuli acquired with this method were used for the cue conflict control experiments, where participants saw exactly these images but with different instructions biased towards shape and towards texture (results described later). For our analysis of texture vs. shape biases (Figure 4), we excluded trials for which no cue conflict was present (i.e., those trials where a bicycle content image was fused with a bicycle texture image, hence no texture-shape cue conflict present).
|
| 296 |
+
|
| 297 |
+
Filled silhouette experiment Style transfer is not the only possibility to generate a texture-shape cue conflict, and we here aimed at testing one other method to generate such stimuli: cropping texture images with a shape mask, such that the silhouette of an object and its texture constitute a cue conflict (visualised in Figure 7). Stimuli were generated by using the silhouette images from the silhouette experiment as a mask for texture images. If the silhouette image at a certain location has a black pixel, the texture was used at this location, and for white pixels the resulting target image pixel was white. In order to have a larger variety of textures than the 48 textures used in the texture experiment, the texture database was augmented by rotating all textures with ten different previously chosen angles uniformly distributed between 0 and 360 degrees, resulting in a texture database of 480 images. Results for this control experiment, not part of the main paper, are reported later. We ensured that no silhouette was seen more than once per observer.
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 7: Visualisation of stimuli in data sets. Top two rows: content and texture images. Bottom rows: cue conflict stimuli generated from the texture and content images above (silhouettes filled with rotated textures; style transfer stimuli).
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
Figure 8: Visualisation of image distortions. One exemplary image (class bird, original image in colour at the top left) is manipulated as follows. From left to right: additive uniform noise, low contrast, high-pass filtering, low-pass filtering. In the row below, a greyscale version for comparison; the other manipulations from left to right are: Eidolon manipulations I, II and III as well as phase noise. Figure adapted from Geirhos et al. (2018) with the authors’ permission.
|
| 304 |
+
|
| 305 |
+
Robustness experiment (distorted images) For this experiment, human accuracies for reference were provided by Geirhos et al. (2018). Human ‘error bars’ indicate the full range of results for human observers. CNNs were then evaluated on different image manipulations applied to natural images as outlined in the paper. For maximal comparability, we also used the same images. For a description of the parametric distortion we kindly refer the reader to Geirhos et al. (2018). In Figure 8, we plot one example image across manipulations.
|
| 306 |
+
|
| 307 |
+
# A.7 STYLIZED-IMAGENET (SIN)
|
| 308 |
+
|
| 309 |
+
We used AdaIN style transfer (Huang & Belongie, 2017) to generate Stylized-ImageNet. More specifically, the AdaIN implementation from https://github.com/naoto0804/ pytorch-AdaIN (commit 31e769c159d4c8639019f7db7e035a7f938a6a46) was employed to stylize the entire ImageNet training and validation data sets. Style transfer was performed once per ImageNet image. As a style source, we used images from Kaggle’s Painter by Numbers data set (https://www.kaggle.com/c/painter-by-numbers/, accessed on March 1, 2018). Style selection was performed randomly with replacement. Every ImageNet image was stylized once and only once. Paintings from the Kaggle data set were used if at least $2 2 4 \times 2 2 4$ pixels in size; the largest possible square crop was then downsampled to this size prior to using it as a style image. All accuracies are reported on the respective validation data sets. Code to generate StylizedImageNet from ImageNet (and the Kaggle paintings) is available on github in this repository:
|
| 310 |
+
|
| 311 |
+
https://github.com/rgeirhos/Stylized-ImageNet
|
| 312 |
+
|
| 313 |
+
# A.8 RESULTS: CUE CONFLICT CONTROL EXPERIMENTS (DIFFERENT INSTRUCTIONS)
|
| 314 |
+
|
| 315 |
+
We investigated the effect of different instructions to human observers. The results presented in the main paper for cue conflict stimuli correspond all to a neutral instruction, not biased w.r.t. texture or shape. In two separate experiments, participants were explicitly instructed to ignore the textures and click on the shape category of cue conflict stimuli, and vice versa. The results, presented in
|
| 316 |
+
|
| 317 |
+
Table 4: Accuracy and object detection performance for ResNet-152. Accuracy comparison on the ImageNet (IN) validation data set as well as object detection performance (mAP50) on PASCAL VOC 2007. All models have an identical ResNet-152 architecture.
|
| 318 |
+
|
| 319 |
+
<table><tr><td>training</td><td>fine-tuning</td><td>top-1 IN accuracy (%)</td><td>top-5 IN accuracy (%)</td><td>Pascal VOC mAP50 (%)</td></tr><tr><td>IN (vanilla ResNet-152)</td><td></td><td>78.31</td><td>94.05</td><td>76.9</td></tr><tr><td>SIN</td><td>=</td><td>65.26</td><td>86.31</td><td>75.0</td></tr><tr><td>SIN+IN</td><td>=</td><td>77.62</td><td>93.59</td><td>77.3</td></tr><tr><td>SIN+IN</td><td>IN</td><td>78.87</td><td>94.41</td><td>78.3</td></tr></table>
|
| 320 |
+
|
| 321 |
+
<table><tr><td></td><td></td><td></td><td colspan="3">Noise</td><td colspan="4">Blur</td></tr><tr><td>training</td><td>ft</td><td>mCE</td><td>Gaussian</td><td>Shot</td><td>Impulse</td><td>Defocus</td><td>Glas</td><td>Motion</td><td>Zoom</td></tr><tr><td>IN (vanilla ResNet-50)</td><td>1</td><td>76.7</td><td>79.8</td><td>81.6</td><td>82.6</td><td>74.7</td><td>88.6</td><td>78.0</td><td>79.9</td></tr><tr><td>SIN</td><td>1</td><td>77.3</td><td>71.2</td><td>73.3</td><td>72.1</td><td>88.8</td><td>85.0</td><td>79.7</td><td>90.9</td></tr><tr><td>SIN+IN</td><td>-</td><td>69.3</td><td>66.2</td><td>66.8</td><td>68.1</td><td>69.6</td><td>81.9</td><td>69.4</td><td>80.5</td></tr><tr><td>SIN+IN</td><td>IN</td><td>73.8</td><td>75.9</td><td>77.0</td><td>77.5</td><td>71.7</td><td>86.0</td><td>74.0</td><td>79.7</td></tr><tr><td></td><td colspan="7">Weather</td><td colspan="2">Digital</td></tr><tr><td>training</td><td>ft</td><td>Snow</td><td>Frost</td><td>Fog</td><td>Brightness</td><td>Contrast</td><td>Elastic</td><td>Pixelate</td><td>JPEG</td></tr><tr><td>IN (vanilla ResNet-50)</td><td>-</td><td>77.8</td><td>74.8</td><td>66.1</td><td>56.6</td><td>71.4</td><td>84.8</td><td>76.9</td><td>76.8</td></tr><tr><td>SIN</td><td>-</td><td>71.8</td><td>74.4</td><td>66.0</td><td>79.0</td><td>63.6</td><td>81.1</td><td>72.9</td><td>89.3</td></tr><tr><td>SIN+IN</td><td>-</td><td>68.0</td><td>70.6</td><td>64.7</td><td>57.8</td><td>66.4</td><td>78.2</td><td>61.9</td><td>69.7</td></tr><tr><td>SIN+IN</td><td>IN</td><td>74.5</td><td>72.3</td><td>66.2</td><td>55.7</td><td>67.6</td><td>80.8</td><td>75.0</td><td>73.2</td></tr></table>
|
| 322 |
+
|
| 323 |
+
Table 5: Corruption error (lower=better) on ImageNet-C (Hendrycks & Dietterich, 2019), consisting of different types of noise, blur, weather and digital corruptions. Abbreviations: $\mathbf { m } { \mathrm { C E } } = $ mean Corruption Error (average of the 15 individual corruption error values); SIN $=$ Stylized-ImageNet; $\mathbf { W } =$ ImageNet; ft $=$ fine-tuning. Results kindly provided by Dan Hendrycks.
|
| 324 |
+
|
| 325 |
+

|
| 326 |
+
Figure 9: Accuracies and example stimuli for five different experiments without cue conflict, comparing training on ImageNet (IN) to training on Stylized-ImageNet (SIN).
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 10: Classification results for human observers (red circles) and ImageNet-trained networks AlexNet (purple diamonds), VGG-16 (blue triangles), GoogLeNet (turquoise circles) and ResNet50 (grey squares) on stimuli with a texture-shape cue conflict generated with style transfer, and biased rather than neutral instructions to human observers. Plotting conventions and CNN data as in Figure 4.
|
| 330 |
+
|
| 331 |
+
Figure 10, indicate that for a shape bias instruction, human data are almost exactly the same as for the neutral instruction reported earlier (indicating that human observers are indeed using shapes per default); and if they are instructed to ignore the shapes and click on the texture category, they still show a substantial shape bias (indicating that even if they seek to ignore shapes, they find it extremely difficult to do so).
|
| 332 |
+
|
| 333 |
+
# A.9 RESULTS: FILLED SILHOUETTE EXPERIMENT
|
| 334 |
+
|
| 335 |
+
This experiment was conducted as a control experiment to make sure that the strong differences between humans and CNNs when presented with cue conflict images are not merely an artefact of the particular setup that we employed. Stimuli are visualised in Figure 7; results in Figure 12. In a nutshell, we also find a shape bias in humans when stimuli are not generated via style transfer but instead through cropping texture images with a shape mask, such that the silhouette of an object and its texture constitute a cue conflict. CNNs have a less pronounced texture bias in these experiments;
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure 11: Texture vs shape biases on of AlexNet and VGG-16 after training on Stylized-ImageNet. Plotting conventions as in Figures 4 and 5. Plot shows biases for AlexNet (purple diamonds), VGG16 (blue triangles) and human observers (red circles) for comparison. For GoogLeNet, no data is available since network training was performed in PyTorch and torchvision.models unfortunately does not provide a GoogLeNet (inception v1) architecture.
|
| 339 |
+
|
| 340 |
+
ResNet-50 trained on SIN still responds with the shape category more than ResNet-50 trained on IN. Overall, these results are much more difficult to interpret since the texture-silhouette cue conflict stimuli, visualised in Figure 7, do not have a clear-cut texture-shape distinction like the cue conflict stimuli generated via style transfer. Still, they are largely in accord with the style transfer results presented in the main paper.
|
| 341 |
+
|
| 342 |
+
# A.10 IMAGE RIGHTS & ATTRIBUTION
|
| 343 |
+
|
| 344 |
+
The images presented in Figure 7 were collected from different origins. We here indicate their URL, creator and license terms (if applicable). Some of the images presented in Figure 7 also appear in Figures 1, 2 and 9; the terms below apply accordingly. Top row, cat image: $\operatorname { h t t p s : / / p i x a b a y . c o m / p - 9 6 4 3 4 3 / }$ , released under the CC0 creative commons license as indicated on the website. The CC0 creative commons license is accessible from https://creativecommons.org/publicdomain/zero/1.0/legalcode. Car image: https://pixabay. $\mathtt { c o m / p - 1 9 3 0 2 3 7 } /$ , released under the CC0 creative commons license as indicated on the website. Bear image: ImageNet image n02132136 871.JPEG, manually modified to have a white background. Second row, elephant texture: cropped from https://www.flickr.com/photos/flowcomm/5089601226, released under the CC BY 2.0 license by user flowcomm as indicated on the website. The license is accessible from https://creativecommons.org/licenses/by/2.0/legalcode. Clock texture: cropped from https://commons.wikimedia.org/wiki/File: HK_Sheung_Wan_%E4%B8%AD%E6%BA%90%E4%B8%AD%E5%BF%83_Midland_Plaza shop_Japan_Home_City_clocks_displayed_for_sale_April-2011.jpg, released under the Creative Commons Attribution-Share Alike 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic licenses by user Ho Mei Danniel as indicated on the website. The CC Attribution-Share Alike 3.0 license is accessible from https://creativecommons. org/licenses/by-sa/3.0/legalcode. Bottle texture: cropped from https: //commons.wikimedia.org/wiki/File:Liquor_bottles.jpg, released under the CC BY 2.0 license by user scottfeldstein as indicated on the website. The CC BY 2.0 license is accessible from https://creativecommons.org/licenses/by/2.0/legalcode.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 12: Classification results for human observers and CNNs on stimuli with a texture-silhouette cue conflict (filled silhouette experiment). Plotting conventions as in Figures 4 and 5. Left: Human observers (red circles) and ImageNet-trained networks AlexNet (purple diamonds), VGG-16 (blue triangles), GoogLeNet (turquoise circles) and ResNet-50 (grey squares). Right: Human observers (red circles, data identical to the left) and ResNet-50 trained on ImageNet (grey squares) vs. ResNet-50 trained on Stylized-ImageNet (orange squares).
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 13: The texture bias on cue conflict stimuli is not specific to ImageNet-trained networks (left) and also occurs in very deep, wide and compressed networks (right).
|
| 351 |
+
|
| 352 |
+
Left: The texture bias is not specific to ImageNet-trained networks. Comparison of texture-shape biases on cue conflict stimuli generated with style transfer for ResNet-101 trained on ImageNet (grey squares) and ResNet-101 trained on the Open Images Dataset V2 (green squares) along with human data for comparison (red circles). Both networks have a qualitatively similar texture bias. We use a ResNet-101 architecture here since Open Images has released a pre-trained ResNet-101.
|
| 353 |
+
|
| 354 |
+
Right: The texture bias also appears in a very deep network (ResNet-152, grey squares), a very wide one (DenseNet-121, purple trianlges), and a very compact one (SqueezeNet1 1, brown diamonds). Human data for comparison (red circles). All networks are pre-trained on ImageNet.
|
md/train/Bym0cU1CZ/Bym0cU1CZ.md
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS INTERPRETABLE CHIT-CHAT: OPEN DOMAIN DIALOGUE GENERATION WITH DIALOGUE ACTS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Conventional methods model open domain dialogue generation as a black box through end-to-end learning from large scale conversation data. In this work, we make the first step to open the black box by introducing dialogue acts into open domain dialogue generation. The dialogue acts are generally designed and reveal how people engage in social chat. Inspired by analysis on real data, we propose jointly modeling dialogue act selection and response generation, and perform learning with human-human conversations tagged with a dialogue act classifier and a reinforcement approach to further optimizing the model for long-term conversation. With the dialogue acts, we not only achieve significant improvement over state-of-the-art methods on response quality for given contexts and long-term conversation in both machine-machine simulation and human-machine conversation, but also are capable of explaining why such achievements can be made.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Conversational agents are becoming ubiquitous recently. Through human-machine conversation, such agents either help users complete specific tasks (Young et al., 2013) or engage them in social chat (Vinyals & Le, 2015). Depending on application scenarios, various conversational agents have been designed including chatbots, personal assistants, and automated customer service, etc.
|
| 12 |
+
|
| 13 |
+
Traditional research on conversational agents focuses on task-oriented dialogue systems (Young et al., 2013) where task specific dialogue acts are handcrafted in a form of slot-value pairs. On the one hand, through slot-filling, the dialogue acts make conversations in such systems interpretable and controllable; on the other hand, they also hinder scaling such systems to new domains. To escape from the limitation, recent interest of research moves to end-to-end dialogue learning without any assumptions on dialogue acts. Most of the effort is paid to non-task-oriented chit-chat (Vinyals & Le, 2015), and there are also a few studies on task-oriented dialogues (Bordes & Weston, 2017; Eric & Manning, 2017). Without dialogue acts, these work directly constructs a response by learning from large scale data with neural networks, and thus is easy to scale to new domains. On the other hand, due to the absence of dialogue acts, it is hard to interpret the emergence of a response to a dialogue context and predict where the conversation will flow to.
|
| 14 |
+
|
| 15 |
+
In this work, we aim to achieve interpretability and controllability in non-task-oriented dialogues. To this end, we introduce dialogue acts into open domain dialogue generation. Open domain dialogue generation has been widely applied to chatbots which aim at engaging users by keeping conversation going. Existing work concentrates on generating relevant and diverse responses for a static context. However, it is not clear if relevance and diversity are sufficient to engagement in dynamic interactions. Therefore, we investigate the following problems: (1) if we can properly design dialogue acts that can enable us to understand engagement in human-human open domain conversation; (2) how to learn a dialogue generation model with the dialogue acts; and (3) how the model performs in practice and if the performance can be explained by the dialogue acts.
|
| 16 |
+
|
| 17 |
+
To examine how people engage in social chat, we establish a general dialogue act taxonomy for open domain conversation by extending the existing work with high-level dialogue acts regarding to conversational context. The taxonomy, when applied to real data, gives rise to an interesting finding that in addition to replying with relevance and diversity , people are used to driving their social chat by constantly switching to new contexts and properly asking questions. Such behaviors are less explored before, and thus are difficult for the existing end-to-end learning methods to imitate. To mimic human behaviors, we propose jointly modeling dialogue act selection and response generation in open domain dialogue generation. The dialogue model is specified with neural networks. We propose learning from human-human interactions by fitting the model to large scale real world dialogues tagged with a dialogue act classifier and further optimizing the policy of act selection for long-term conversation through a reinforcement learning approach. Our model enjoys several advantages over the existing models: (1) the dialogue acts provide interpretation to response generation from a discourse perspective; (2) the dialogue acts enhance diversity of responses by expanding the search space from language to act $\times$ language; (3) the dialogue acts manage the flow of humanmachine conversations and thus enhance human engagement; and (4) the dialogue act selection is compatible with post-engineering work (e.g., combination with rules), and thus allows engineers to flexibly control their systems through picking responses from their desired dialogue acts. Evaluation results on large scale test data indicate that our model can significantly outperform state-of-the-art methods in terms of quality of generated responses regarding to given contexts and lead to longterm conversation in both machine-machine simulation and human-machine conversation in a way similar to how human behave in their interactions.
|
| 18 |
+
|
| 19 |
+
Our contributions in this work include: (1) design of dialogue acts that represent human behavior regarding to conversational context and insights from analysis of human-human interactions with the design; (2) joint modeling of dialogue act selection and response generation in open domain dialogue generation; (3) proposal of a supervised learning approach and a reinforcement learning approach for model optimization; (4) empirical verification of the effectiveness of the model through automatic metrics, human annotations, machine-machine simulation, and human-machine conversation.
|
| 20 |
+
|
| 21 |
+
Table 1: Definition of dialogue acts.
|
| 22 |
+
|
| 23 |
+
<table><tr><td rowspan=1 colspan=1>Dialogue Acts</td><td rowspan=1 colspan=1>Definitions</td><td rowspan=1 colspan=1>Examples</td></tr><tr><td rowspan=1 colspan=1>Context Main-tain Statement(CM.S)</td><td rowspan=1 colspan=1>A user or a bot aims to maintain the current con-versational context (e.g.,topic) by giving infor-mation, suggesting something,or commentingon the previous utterances,etc.</td><td rowspan=1 colspan=1>“there are many good places inTokyo.”after"I plan to have a tourin Tokyo this summer.".</td></tr><tr><td rowspan=1 colspan=1>Context Main-tain1Question(CM.Q)</td><td rowspan=1 colspan=1>A user or a bot asks a question in the currentcontext.Questions cover 5W1H and yes-nowith various functions such as context clarifica-tion,confirmation, knowledge acquisition,andrhetorical questions, etc.</td><td rowspan=1 colspan=1>“where are you going to stay inTokyo?”after“I plan to have a tourin Tokyo this summer.".</td></tr><tr><td rowspan=1 colspan=1>Context Main-tain Answer(CM.A)</td><td rowspan=1 colspan=1>A response or an answer to the previous utter-ances in the current context.</td><td rowspan=1 colspan=1>“this summer”after “when areyou going to Tokyo?".</td></tr><tr><td rowspan=1 colspan=1>Context SwitchStatement(CS.S)</td><td rowspan=1 colspan=1>Similar to CM.S,but the user or the bot tries toswitch to a new context (e.g., topic) by bringingin new content.</td><td rowspan=1 colspan=1>“I plan to study English this sum-mer.”after“I plan to have a tour inTokyo this summer.".</td></tr><tr><td rowspan=1 colspan=1>Context SwitchQuestion(CS.Q)</td><td rowspan=1 colspan=1>A user or a bot tries to change the context ofconversation by asking a question.</td><td rowspan=1 colspan=1>“When will your summer vaca-tion start?",after“I plan to havea tour in Tokyo this summer.”</td></tr><tr><td rowspan=1 colspan=1>Context SwitchAnswer (CS.A)</td><td rowspan=1 colspan=1>The utterance not only replies to the previousturn,but also starts a new topic.</td><td rowspan=1 colspan=1>“I don't know because I have toget an A+ in my math exam."after“when are yougoing toTokyo?".</td></tr><tr><td rowspan=1 colspan=1>Others (O)</td><td rowspan=1 colspan=1>greetings, thanks,and requests, etc..</td><td rowspan=1 colspan=1>“thanks for your help."</td></tr></table>
|
| 24 |
+
|
| 25 |
+
# 2 DIALOGUE ACTS FOR OPEN DOMAIN CONVERSATION
|
| 26 |
+
|
| 27 |
+
We first define dialogue acts, and then describe the data for learning and the insights we obtain from the data. Finally, we elaborate how we build the classifier with neural networks.
|
| 28 |
+
|
| 29 |
+
# 2.1 DEFINITION OF DIALOGUE ACTS
|
| 30 |
+
|
| 31 |
+
Our dialogue acts are inherited from the existing work on 1-on-1 live chats and twitter (Kim et al., 2010; Ivanovic, 2005). Similar to (Oraby et al., 2017), we organize the 12 acts in (Ivanovic, 2005) which originate from the 42 tags (Jurafsky et al., 1997; Stolcke et al., 2006) based on the DAMSL annotation scheme (Core & Allen, 1997) into high-level dialogue acts: “statement” and “expressive” are merged as “statement”; “yes-no question” and “open question” are combined as “question”; “yes-answer”, “no-answer”, and “response-ack” are collapsed as “answer”; and other tags are treated as “others”. On top of these acts, we further define two high-level dialogue acts that describe how people behave regarding to conversational context in their interactions. As will be seen later, the extension may bring us further insights on engagement in social chat. Details of the dialogue acts are described in Table 1.
|
| 32 |
+
|
| 33 |
+
The high-level dialogue acts in Table 1 are generally applicable to open domain dialogues from various sources in different languages such as Twitter, Reddit, Facebook, Weibo (www.weibo.com), and Baidu Tieba (https://tieba.baidu.com/), etc. One can extend the taxonomy by defining finer-grained dialogue acts and learn their generation models with the approaches described later. Existing annotated data sets (e.g., the Switchboard Corpus1) do not have dialogue acts regarding to conversational context. Therefore, it is not clear how such dialogue acts depict human behavior in interactions, and there are no large scale data available for learning dialgoue generation with the dialogue acts either. To resolve these problems, we build a data set.
|
| 34 |
+
|
| 35 |
+
# 2.2 DATA SET
|
| 36 |
+
|
| 37 |
+
We crawled 30 million dyadic dialogues (conversations between two people) from Baidu Tieba. Baidu Tieba is the largest Reddit-like forum in China which allows users to post and comment on others’ post. Two people can communicate with each other through one posting a comment and the other one replying to the comment. Data in Baidu Tieba covers a large variety of topics, and thus can be viewed as a simulation of open domain conversation in a chatbot. We randomly sample 9 million dialogues as a training set, 90 thousand dialogues as a validation set, and 1000 dialogues as a test set. These data are used to learn a dialogue generation model later. We employ the Standford Chinese word segmenter2 to tokenize utterances in the data. Table 2 reports statistics of the data.
|
| 38 |
+
|
| 39 |
+
Table 2: Statistics of the experimental data sets
|
| 40 |
+
|
| 41 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>train</td><td rowspan=1 colspan=1>val</td><td rowspan=1 colspan=1>test</td></tr><tr><td rowspan=1 colspan=1>#dialogues</td><td rowspan=1 colspan=1>9M</td><td rowspan=1 colspan=1>90k</td><td rowspan=1 colspan=1>1000</td></tr><tr><td rowspan=1 colspan=1>Min. # turns per dialogue</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>Max.# turns per dialogue</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>50</td></tr><tr><td rowspan=1 colspan=1>Avg.# turns per dialogue</td><td rowspan=1 colspan=1>7.68</td><td rowspan=1 colspan=1>7.67</td><td rowspan=1 colspan=1>7.66</td></tr><tr><td rowspan=1 colspan=1>Avg.# words per utterance</td><td rowspan=1 colspan=1>15.81</td><td rowspan=1 colspan=1>15.89</td><td rowspan=1 colspan=1>15.74</td></tr></table>
|
| 42 |
+
|
| 43 |
+
For dialogue act learning, we randomly sample 500 dialogues from the training set and recruit 3 native speakers to label dialogue acts3 for each utterance according to the definitions in Table 1. Table 3 shows a labeling example from one annotator. Each utterance receives 3 labels, and the Fleiss’ kappa of the labeling work is 0.45, indicating moderate agreement among the labelers.
|
| 44 |
+
|
| 45 |
+
Table 3: An example of dialogue with labeled acts.
|
| 46 |
+
|
| 47 |
+
<table><tr><td>Turns</td><td>Dialogue Acts</td></tr><tr><td>A:万里长城很漂亮!TheGreatWallofChinais beautiful!</td><td>CM.S</td></tr><tr><td>B:你在长城看日落了吗?Did you see the sunset on the Great Wall?</td><td>CM.Q</td></tr><tr><td>A:是的,那是最漂亮的景色。Yes,it's the most beautiful scenery.</td><td>CM.A</td></tr><tr><td>B:上次我去的时候人很多。Itwas very crowded whenIvisited there last time</td><td>CS.S</td></tr><tr><td>A:我只待了一小会儿,人太多了!Ionly stayed there for a while.Too many vistors!</td><td>CM.S</td></tr></table>
|
| 48 |
+
|
| 49 |
+
# 2.3 INSIGHTS FROM THE LABELED DATA
|
| 50 |
+
|
| 51 |
+
The frequencies of the dialogue acts in terms of percentages of the total number of utterances in the labeled data are CM.S $5 5 . 8 \%$ , CM.Q $1 1 . 7 \%$ , CM.A $1 2 . 2 \%$ , CS.S $1 2 . 4 \%$ , CS.Q $4 . 8 \%$ , CS.A $2 \%$ , and O $1 . 1 \%$ . In addition to the numbers, we also get further insights from the data that are instructive to our dialogue generation learning:
|
| 52 |
+
|
| 53 |
+
Context switch is a common skill to keep conversation going. In fact, we find that $78 . 2 \%$ dialogues contain at least one CS.\* act. The average number of turns of dialogues that contain at least one CS.\* is 8.4, while the average number of turns of dialogues that do not contain a CS.\* is 7. When dialogues are shorter than 5 turns, only $47 \%$ of them contain a CS.\*, but when dialogues exceed 10 turns, more than $8 5 \%$ of them contain a CS.\*. Because there are no specific goals in their conversations, people seldom stay long in one context. The average number of turns before context switch is 3.39. We also observed consecutive context switch in many dialogues $( 4 3 . 7 \% )$ . The numbers suggest dialogue generation with smooth context switch and moderate context maintenance.
|
| 54 |
+
|
| 55 |
+
Question is an important building block in open domain conversation. In fact, $1 3 . 9 \%$ CM.\* are CM.Q and the percentage is even higher in CS.\* which is $2 0 . 2 7 \%$ . People need to ask questions in order to maintain contexts. The average number of turns of contexts with questions (i.e., consecutive CM.\* with at least one CM.Q) is 3.92, while the average number of turns of contexts without questions is only 2.95. The observation indicates that a good dialogue model should be capable of asking questions properly, as suggested by Li et al. (2017a). A further step to study human’s questioning behavior is to look into types and functions of questions. We leave it as future work.
|
| 56 |
+
|
| 57 |
+
The observations raise new challenges that are difficult for the existing end-to-end methods to tackle (e.g., smoothly interleaving context blocks with switch actions), and thus encourage us to create a new model. Note that these observations may relate to dialogue scenarios (e.g., chatting online instead of face-to-face) and cultures, but we ignore these factors and just study how to learn the conversational patterns from the data with a principled approach. The learning approach is generally applicable to other data. To perform learning, we need to build a classifier that can automatically tag large scale dialogues with dialogue acts.
|
| 58 |
+
|
| 59 |
+
# 2.4 DIALOGUE ACT CLASSIFICATION
|
| 60 |
+
|
| 61 |
+
We aim to learn a classifier $c$ from $\mathcal { D } _ { A } = \{ d _ { i } \} _ { i = 1 } ^ { N }$ where $d _ { i } \ = \ \{ ( u _ { i , 1 } , a _ { i , 1 } ) , \dotsc , ( u _ { i , n _ { i } } , a _ { i , n _ { i } } ) \}$ represents a dialogue with $u _ { i , k }$ the $k$ -th utterance and $\boldsymbol { a } _ { i , k }$ the labeled dialogue act. Given a new dialogue $d = \{ u _ { 1 } , \ldots , u _ { n } \}$ , $c$ can sequentially tag the utterances in $d$ with dialouge acts by taking $u _ { i }$ , $u _ { i - 1 }$ , and the predicted $a _ { i - 1 }$ as inputs and outputting a vector $c ( u _ { i } , u _ { i - 1 } , a _ { i - 1 } )$ where the $j$ -th element representing the probability of $u _ { i }$ being tagged as the $j$ -th dialogue act.
|
| 62 |
+
|
| 63 |
+
We parameterize $c ( \cdot , \cdot , \cdot )$ using neural networks. Specifically, $u _ { i }$ and $u _ { i - 1 }$ are first processed by bidirectional recurrent neural networks with gated recurrent units (biGRUs) (Chung et al., 2014) respectively. Then the last hidden states of the two biGRUs are concatenated with an embedding of $a _ { i - 1 }$ and fed to a multi-layer perceptron (MLP) to calculate a dialogue act distribution. Formally, suppose that $u _ { i } = ( w _ { i , 1 } , \ldots , w _ { i , n } )$ where $w _ { i , j . }$ is the embedding of the $j$ -th word, then the $j$ -th hidden state of the biGRU is given by $h _ { i , j } = [ \overset { \right. } { h } _ { i , j } ; \overset \left. { h } _ { i , j } ]$ where $\overrightarrow { h } _ { i , j }$ is the $j$ -th state of a forward GRU, is the $j$ -th state of a backward GRU, and $[ \cdot ; \cdot ]$ is a concatenation operator. $\overrightarrow { h } _ { i , j }$ and are calculated by
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \stackrel { \triangledown } { \vec { h } } _ { i , j } = f _ { \mathrm { G R U } } ( \stackrel { \triangledown } { \vec { h } } _ { i , j - 1 } , w _ { i , j } ) ; \stackrel { } { \vec { h } } _ { i , j } = f _ { \mathrm { G R U } } ( \stackrel { } { \overleftarrow { h } } _ { i , j + 1 } , w _ { i , j } ) . } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Similarly, we have $h _ { i - 1 , j }$ as the $j$ -th hidden state of $u _ { i - 1 }$ . Let $e ( a _ { i - 1 } )$ be the embedding of $a _ { i - 1 }$ then $c ( u _ { i } , u _ { i - 1 } , a _ { i - 1 } )$ is defined by a two-layer MLP:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
c ( u _ { i } , u _ { i - 1 } , a _ { i - 1 } ) = f _ { \mathrm { M L P } } ( [ h _ { i , n } ; h _ { i - 1 , n } ; e ( a _ { i - 1 } ) ] ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where we pad zeros for $u _ { 0 }$ and $a _ { 0 }$ in $c ( u _ { 1 } , u _ { 0 } , a _ { 0 } )$ . We learn $c ( \cdot , \cdot , \cdot )$ by minimizing cross entropy with $\mathcal { D } _ { A }$ . Let $p _ { j } ( a _ { i } )$ be the probability of $a _ { i }$ being the $j$ -th dialogue act and $c ( u _ { i } , u _ { i - 1 } , a _ { i - 1 } ) [ j ]$ be the $j$ -th element of $c ( u _ { i } , u _ { i - 1 } , a _ { i - 1 } )$ , then the objective function of learning is formulated as
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
- \sum _ { i = 1 } ^ { N } \sum _ { k = 1 } ^ { n _ { i } } \sum _ { j = 1 } ^ { 7 } p _ { j } \big ( a _ { i , k } \big ) \log \ ( c ( u _ { i , k } , u _ { i , k - 1 } , a _ { i , k - 1 } ) [ j ] ) .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 1: Policy network and generation network.
|
| 83 |
+
|
| 84 |
+
We randomly split the labeled dialogues as 400/30/70 dialogues with 3280/210/586 utterances for training/validation/test. Details of learning are given in Appendix 7.2. The learned classifier achieves an accuracy of $7 0 . 1 \%$ on the test data. We employ it to tag the training, validation, and test sets in Table 2.
|
| 85 |
+
|
| 86 |
+
# 3 DIALOGUE GENERATION MODEL
|
| 87 |
+
|
| 88 |
+
We present dialogue generation learning using large scale dialogues tagged with dialogue acts. Then, we describe model optimization with reinforcement learning for long-term conversation.
|
| 89 |
+
|
| 90 |
+
# 3.1 SUPERVISED LEARNING
|
| 91 |
+
|
| 92 |
+
We aim to learn a dialogue generation model $g$ from $\begin{array} { r c l } { \mathcal { D } } & { = } & { \{ d _ { i } \} _ { i = 1 } ^ { N } } \end{array}$ where $\begin{array} { r l } { d _ { i } } & { { } = } \end{array}$ $\{ ( u _ { i , 1 } , a _ { i , 1 } ) , \ldots , ( u _ { i , n _ { i } } , a _ { i , n _ { i } } ) \}$ refers to a human-human dialogue with $u _ { i , k }$ the $k$ -th utterance and $a _ { i , k }$ the dialogue act tagged by the classifier in Section 2.4. Given $s _ { i } = \{ ( u _ { 1 } , a _ { 1 } ) , \dotsc , ( u _ { i - 1 } , a _ { i - 1 } ) \}$ as a new dialogue session, $g ( s _ { i } )$ can generate a response as the next turn of the dialogue.
|
| 93 |
+
|
| 94 |
+
Our dialogue model consists of a policy network and a generation network. A dialogue act is first selected from the policy network according to the conversation history, and then a response is generated from the generation network based on the conversation history and the dialogue act. Formally, the dialogue model can be formulated as
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
g ( s _ { i } ) = p _ { r } ( r _ { i } | s _ { i } , a _ { i } ^ { \star } ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $a _ { i } ^ { \star } = O ( p _ { a } ( a _ { i } | s _ { i } ) )$ is the selected dialogue act for the $i$ -th turn, and $r _ { i }$ is the response of the $i$ -th turn. $p _ { a }$ is the policy network and $p _ { r }$ is the generation network. $O ( \cdot )$ refers to a dialogue act select operation according to the value of the policy network. A simple defintion of $O ( p _ { a } ( a _ { i } | \bar { s } _ { i } ) )$ is
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
O ( p _ { a } ( a _ { i } | s _ { i } ) ) = \arg \operatorname* { m a x } _ { a _ { i } \in \mathbb { A } } \ p _ { a } ( a _ { i } | s _ { i } ) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where A is the space of dialogue acts. One can also customize $O ( \cdot )$ with more complicated rules to achieve controllability or further optimization (e.g., improving response diveristy by selecting multiple acts) of their systems.
|
| 107 |
+
|
| 108 |
+
Figure 1(b) shows the architecture of the policy network. The utterance sequence and the act sequence are encoded with a hierarchical encoder and a GRU encoder respectively. Then, the last hidden states of the two encoders are concatenated and fed to an MLP to calculate a probability distribution of dialogue acts for the next turn. Formally, $\forall u _ { j } \in s _ { i }$ , $u _ { j }$ is first transformed to hidden vectors $\{ h _ { j , k } ^ { u } \} _ { k = 1 } ^ { n _ { j } ^ { \prime } }$ through a biGRU parameterized as Equation (1). Then, $\{ h _ { j , n _ { j } ^ { \prime } } ^ { u } \} _ { j = 1 } ^ { i - 1 }$ is processed by a GRU parameterized as $\begin{array} { r } { t _ { k } = f _ { \mathrm { G R U } } ^ { u } ( t _ { k - 1 } , h _ { k , n _ { k } ^ { \prime } } ^ { u } ) } \end{array}$ . In parallel, $\{ a _ { 1 } , \dotsc , a _ { i - 1 } \}$ is transformed to $\{ h _ { k } ^ { a } \} _ { k = 1 } ^ { i - 1 }$ by $h _ { k } ^ { a } = f _ { \mathrm { G R U } } ^ { a } ( h _ { k - 1 } ^ { a } , e ( a _ { k } ) )$ . $p _ { a } ( a _ { i } | s _ { i } )$ is then defined by
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
p _ { a } ( a _ { i } | s _ { i } ) = f _ { \mathrm { M L P } } ( [ t _ { i - 1 } ; h _ { i - 1 } ^ { a } ] ) .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
We build the generation network in a sequence-to-sequence framework. Here, we simplify $p _ { r } ( r _ { i } | \boldsymbol { s } _ { i } , a _ { i } )$ as $p _ { r } ( r _ { i } | a _ { i } , u _ { i - 1 } , u _ { i - 2 } )$ since decoding natural language responses from long conversation history is challenging. Figure 1(a) illustrates the architecture of the generation network. The only difference from the standard encoder-decoder architecture with an attention mechanism is that in encoding, we concatenate $u _ { i - 1 }$ and $u _ { i - 2 }$ , and attach $a _ { i }$ to the top of the long sentence as a special word. The technique here is similar to that in zero-shot machine translation (Johnson et al., 2016). More formulation details can be found in Appendix 7.1.
|
| 115 |
+
|
| 116 |
+
The dialogue model is then learned by minimizing the negative log likelihood of $\mathcal { D }$ :
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
- \sum _ { i = 1 } ^ { N } \sum _ { k = 1 } ^ { n _ { i } } [ \log ( p _ { r } ( u _ { i , k } | d _ { i , < k } , a _ { i , k } ) ) + \log ( p _ { a } ( a _ { i , k } | d _ { i , < k } ) ) ] ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $d _ { i , < k } = \{ ( u _ { i , 1 } , a _ { i , 1 } ) , \dots , ( u _ { i , k - 1 } , a _ { i , k - 1 } ) \}$ . Through supervised learning, we fit the dialogue model to human-human interactions in order to learn their conversational patterns. However, supervised learning does not explicitly encourage long-term conversation (e.g., $4 5 . 3 5 \%$ dialogues in our training set are no more than 5 turns). The policy network is learned by fitting to the existing conversation history, and it is not aware what is going to happen in the future when a dialogue act is selected. This motivates us to further optimize the model through a reinforcement learning approach.
|
| 123 |
+
|
| 124 |
+
# 3.2 REINFORCEMENT LEARNING
|
| 125 |
+
|
| 126 |
+
We aim to optimize the dialogue model by letting it know a possible result in the following conversation when an act and a response are generated. To avoid exhausting and expensive online optimization, we choose self-play (Li et al., 2016b; Lewis et al., 2017) where we let two models learned with the supervised approach talk to each other in order to improve their performance. In the simulation, a dialogue is initialized with a message sampled from the training set. Then, the two models continue the dialogue by alternately taking the conversation history as an input and generating a response (top one in beam search) until $T$ turns $T = 2 0$ in our experiments).
|
| 127 |
+
|
| 128 |
+
To speed up training and avoid generated responses diverging from human language, we fix the generation network and only optimize the policy network by reinforcement learning. Thus, the policy in learning is naturally defined by the policy network $p _ { a } ( a _ { i } | s _ { i } )$ with $s _ { i } = \{ ( u _ { 1 } , a _ { 1 } ) , \dotsc , ( u _ { i - 1 } , a _ { i - 1 } ) \}$ a state and $a _ { i }$ an action. We define a reward function $r ( a _ { i } , s _ { i } )$ as
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
r ( a _ { i } , s _ { i } ) = \alpha \mathbb { E } [ l e n ( a _ { i } , s _ { i } ) ] + \beta \mathbb { E } [ r e l ( a _ { i } , s _ { i } ) ] ,
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $\mathbb { E } [ l e n ( a _ { i } , s _ { i } ) ]$ is the expected conversation length after taking action $a _ { i }$ under state $s _ { i }$ , $\mathbb { E } [ r e l ( a _ { i } , s _ { i } ) ]$ is the expected response relevance within the conversation, $\alpha = 0 . 6 7$ , and $\beta = 0 . 3 3$ . Through Equation (8), we try to encourage actions that can lead to long (measured by $\mathbb { E } [ l e n ( a _ { i } , s _ { i } ) ] )$ and reasonable (measured by $\mathbb { E } [ r e l ( a _ { i } , \bar { s _ { i } } ) ]$ ) conversations.
|
| 135 |
+
|
| 136 |
+
To estimate $\mathbb { E } [ l e n ( a _ { i } , s _ { i } ) ]$ and $\mathbb { E } [ r e l ( a _ { i } , s _ { i } ) ]$ , we fix $( s _ { i } , a _ { i } )$ and construct a dialogue set $\{ d _ { i , j } ^ { \prime } \} _ { j = 1 } ^ { N }$ $ { N _ { \mathrm { ~ } } } = \ 1 0$ in our experiments) by sampling after $( s _ { i } , a _ { i } )$ with self-play. $\forall j$ , $d _ { i , j } ^ { \prime } ~ =$ $( s _ { i } , u _ { j , i + 1 } , \dotsc , u _ { j , n _ { i , j } } )$ where $\forall k$ , $u _ { j , i + k }$ is randomly sampled from the top 5 beam search results of $p _ { r }$ conditioned on the most probable dialogue act given by $p _ { a }$ for that turn. Inspired by (Li et al., 2016b), we terminate a simulated dialogue if (1) $c o s i n e ( e ( u _ { i - 1 } ) , e ( u _ { i } ) ) \ > \ 0 . 9$ && $c o s i n e ( e ( u _ { i } ) ) , e ( u _ { i + 1 } ) ) > 0 . 9 $ , or (2) $c o s i n e ( e ( u _ { i - 1 } ) , e ( u _ { i + 1 } ) ) > 0 . 9$ , or (3) the length of the dialogue reaches $T$ , where $e ( \cdot )$ denotes the representation of an utterance given by the encoder of $p _ { r }$ . Condition (1) means three consecutive turns are (semantically) repetitive, and Condition (2) means one agent gives repetitive responses in two consecutive turns. Both conditions indicate a high probability that the conversation falls into a bad infinite loop. $\mathbb { E } [ l e n ( a _ { i } , s _ { i } ) ]$ and $\mathbb { E } [ r e l ( a _ { i } , s _ { i } ) ]$ are then estimated by
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\mathbb { E } [ l e n ( a _ { i } , s _ { i } ) ] = \frac { 1 } { N } \sum _ { j = 1 } ^ { N } n _ { i , j } ; \mathbb { E } [ r e l ( a _ { i } , s _ { i } ) ] = \frac { 1 } { N } \sum _ { j = 1 } ^ { N } \frac { 1 } { n _ { i , j } } \sum _ { k = 1 } ^ { n _ { i , j } } m ( d _ { i , j < k } , u _ { j , k } ) ,
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $d _ { i , j < k } = ( u _ { 1 } , \dots , u _ { j , k - 1 } )$ , and $m ( \cdot , \cdot )$ is the dual LSTM model proposed in (Lowe et al., 2015) which measures the relevance between a response and a context. We train $m ( \cdot , \cdot )$ with the 30 million crawled data through negative sampling. The objective of learning is to maximize the expected future reward:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathcal { I } ( \theta ) = \mathbb { E } [ \sum _ { i = 1 } ^ { T } r ( a _ { i } , s _ { i } ) ] .
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
The gradient of the objective is calculated by Reinforce algorithm (Williams, 1992):
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\partial _ { \theta } \mathcal { I } \approx \sum _ { t = 1 } ^ { T } \partial _ { \theta } \mathrm { l o g } \big ( p _ { a } \big ( a _ { t } \big | s _ { t } \big ) \big ) \big ( \sum _ { i = t } ^ { T } \big ( r ( a _ { i } , s _ { i } ) - b _ { t } \big ) \big ) ,
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where the baseline $b _ { t }$ is empirically set as $\begin{array} { r } { \frac { 1 } { \left| \mathbb { A } \right| } \sum _ { a _ { t } \in \mathbb { A } } r ( a _ { t } , s _ { t } ) } \end{array}$
|
| 155 |
+
|
| 156 |
+
# 4 EXPERIMENT
|
| 157 |
+
|
| 158 |
+
# 4.1 EXPERIMENT SETUP
|
| 159 |
+
|
| 160 |
+
Our experiments are conducted with the data in Table 2. The following methods are employed as baselines: (1) S2SA: sequence-to-sequence with attention (Bahdanau et al., 2015) in which utterances in contexts are concatenated as a long sentence. We use the implementation with Blocks (https://github.com/mila-udem/blocks); (2) HRED: the hierarchical encoder-decoder model in (Serban et al., 2016) implemented with the source code available at (https://github.com/julianser/hed-dlg-truncated); (3) VHRED: the hierarchical latent variable encoder-decoder model in (Serban et al., 2017b) implemented with the source code available at (https://github.com/julianser/hed-dlg-truncated); and (4) RL-S2S: dialogue generation with reinforcement learning (Li et al., 2016b). We implement the algorihtm by finishing the code at (https://github.com/liuyuemaicha/ Deep-Reinforcement-Learning-for-Dialogue-Generation-in-tensorflow). Dull responses are defined as in (Li et al., 2016b) and listed in Appendix 7.3.
|
| 161 |
+
|
| 162 |
+
All baseline models are implemented with the recommended configurations in the existing literatures. We denote our Dialogue Act aware Generation Model with only Supervised Learning as SL-DAGM, and the full model (supervised learning $^ +$ reinforcement learning) as RL-DAGM. Implementation details are given in Appendix 7.3.
|
| 163 |
+
|
| 164 |
+
# 4.2 RESPONSE GENERATION FOR GIVEN CONTEXTS
|
| 165 |
+
|
| 166 |
+
The first experiment is to check if the proposed models can generate high-quality responses regarding to given contexts. To this end, we take the last turn of each test dialogue as ground truth, and feed the previous turns as a context to different models for response generation. Top one responses from beam search (beam size $= 2 0$ ) of different models are collected, randomly shuffled, and presented to 3 native speakers to judge their quality. Each response is rated by the three annotators under the following criteria: 2: the response is not only relevant and natural, but also informative and interesting; 1: the response can be used as a reply, but might not be informative enough (e.g.,“Yes, I see” etc.); 0: the response makes no sense, is irrelevant, or is grammatically broken.
|
| 167 |
+
|
| 168 |
+
Table 4: Evaluation Results
|
| 169 |
+
(b) Average dialogue length in machine-machine and human-machine conversations.
|
| 170 |
+
|
| 171 |
+
<table><tr><td></td><td>Machine-Machine</td><td>Human-Machine</td></tr><tr><td>RL-S2S</td><td>4.36</td><td>4.54</td></tr><tr><td>SL-DAGM</td><td>7.36</td><td>5.24</td></tr><tr><td>RL-DAGM</td><td>7.87</td><td>5.58</td></tr></table>
|
| 172 |
+
|
| 173 |
+
(a) Human annotations. Ratios are calculated by combining labels from the three judges.
|
| 174 |
+
|
| 175 |
+
<table><tr><td></td><td>0</td><td>1</td><td>2</td><td>Kappa</td></tr><tr><td>S2SA HRED VHRED</td><td>0.478 0.447 0.349</td><td>0.478 0.456 0.471</td><td>0.044 0.097</td><td>0.528 0.492</td></tr><tr><td>RL-S2S</td><td>0.393</td><td>0.462</td><td>0.180 0.142</td><td>0.494 0.501</td></tr><tr><td>SL-DAGM RL-DAGM</td><td>0.279 0.341</td><td>0.475 0.386</td><td>0.244 0.273</td><td>0.508 0.485</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Table 4(a) summarizes the annotation results. Improvements from our models over the baseline methods are statistically significant (t-test, p-value $< 0 . 0 1 $ ). In addition to human annotations, we also compare different models using automatic metrics with the the ground truth. These metrics include (1) BLEU (Papineni et al., 2002) which measures term overlap of two responses; (2) embedding based metrics (Liu et al., 2016) such as Embedding Average (Average), Embedding Extrema (Extrema), and Embedding Greedy (Greedy) which measure similarity of two responses in a semantic space; and (3) ratios of distinct unigrams (distinct-1) and bigrams (distinct-2) in the generated responses which are employed in (Li et al., 2015) to measure response diversity. Table 5 reports the automatic evaluation results.
|
| 178 |
+
|
| 179 |
+
Table 5: Automatic evaluation results. Numbers in bold mean that improvement from the model on that metric is statistically significant over the baseline methods (t-test, p-value $< 0 . 0 1$ ).
|
| 180 |
+
|
| 181 |
+
<table><tr><td></td><td>BLEU-1</td><td>BLEU-2</td><td>Average</td><td>Extrema</td><td>Greedy</td><td>Distinct-1</td><td>Distinct-2</td></tr><tr><td>S2SA HRED</td><td>4.67 3.70</td><td>1.18 1.06</td><td>21.45 16.87</td><td>16.68 13.58</td><td>21.53 20.15</td><td>0.033 0.062</td><td>0.069 0.139</td></tr><tr><td>VHRED RL-S2S SL-DAGM RL-DAGM</td><td>6.10 5.57 6.23</td><td>1.76 1.83 2.07</td><td>20.83 20.72 20.68</td><td>16.17 16.73 16.42</td><td>21.36 20.64 21.52</td><td>0.079 0.100 0.200</td><td>0.225 0.213 0.466</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Table 6: An example of response generation. Utterances in the context are split by $\because$ ”.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Context</td><td>Responses S2SA:我也是这么想的。Ithink so</td></tr><tr><td>一起吃晚餐?→中饭好吗?→中 饭只能在公司吃。→那我不能来 了。我在休假。 Have dinner together?=→ how about lunch? = Ican only have my lunch at company.= Then Icannot join you because Iam in my vaca- tion.</td><td>HRED:放假了啊?You are already in vacation? VHRED:哈哈哈。Haha. RL-S2S:我已经在吃了。Iamhaving lunch now. SL-DAGM:好吧,我刚从厦门回来,想在食堂吃碗 面。OK.Iam just back from Xiamen,and want to have noodle in cafeteria.(CS.S) RL-DAGM:放假有什么安排。What are you going to do for your vacation? (CS.Q) CM.Q:放假了吗?You are already in vacation? CM.S:我还以为你没休假呢。Ithought youwere at work.</td></tr></table>
|
| 186 |
+
|
| 187 |
+
We can see that one benefit brought by the dialogue acts is that diversity of responses is significantly improved. This is supported by the much more 2 responses from the two models in Table 4(a) and the significant improvement on distinct n-grams in Table 5. The reason is easy to understand: we search a response not only from a language space, but also from an act space. The dimension of dialogue acts provides further variations to the generated responses. On the other hand, due to the diversity, responses from our models may diverge from the ground truth sometimes. This is why improvements on other automatic metrics are not significant. To further explain the advantages of our models, we show an example in Table 6. In addition to responses from SL-DAGM and RLDAGM which are selected from the dialogue acts obtained by Equation (5), we also show responses from other reasonable but not selected acts. With dialogue acts, responses from our models become really rich, from confirmation (CM.Q) to an open question (CS.Q) and then to a long informative statement (CS.S). More importantly, the dialogue acts let us know why we have such responses: both SL-DAGM and RL-DAGM try to switch to new topics (e.g., Xiamen, noodle, and plan etc.) in order to continue the conversation. One can also change the flow of the conversation by picking responses from other dialogue acts. The example demonstrates that in addition to good performance, our models enjoy good interpretability and controllability as well. We show more such examples in Appendix 7.4.
|
| 188 |
+
|
| 189 |
+
# 4.3 ENGAGEMENT TEST
|
| 190 |
+
|
| 191 |
+
Secondly, we study conversation engagement with the proposed models. Experiments are conducted through machine-machine simulation and human-machine conversation. In both experiments, we compare SL-DAGM and RL-DAGM with RL-S2S, as RL-S2S is the only baseline optimized for future success. Responses from all models are randomly sampled from the top 5 beam search results. Average length of dialogues is employed as an evaluation metric.
|
| 192 |
+
|
| 193 |
+
Machine-machine simulation is conducted in a way similar to (Li et al., 2016b) in which we let two bots equipped with the same model talk with each other in 1000 simulated dialogues. Each dialogue is initialized with the first utterance of a test example, and terminated according to the termination conditions for reward estimation in Section 3.2. In human-machine conversation, we recruit 5 native speakers as testers and ask them to talk with the bots equipped with the three models. Every time, a bot is randomly picked for a tester, and the tester does not know which model is behind. Every tester finishes 100 dialogues with each bot. To make a fair comparison, we let the bots start dialgoues. A starting message in a dialogue is randomly sampled from the test data and copied 3 times for all the 3 bots (a tester can skip the message if he/she cannot understand it). A dialogue is terminated if (1) the tester thinks the conversation cannot be continued (e.g., due to bad relevance or repetitive content etc.); or (2) the bot gives repetitive responses in two consecutive turns (measured by $c o s i n e ( e ( u _ { i - 1 } ) , e ( u _ { i + 1 } ) ) > 0 . 9 )$ . Dialogue acts in human turns are tagged by the classifier in Section 2.4. The evaluation metric is calculated with the total 500 dialogues for each model.
|
| 194 |
+
|
| 195 |
+
Table 4(b) reports the evaluation results. In both experiments, SL-DAGM and RL-DAGM can lead to longer conversations, and the improvements from both models over the baseline are statistically significant (t-test, p-value $< 0 . 0 1$ ). Improvements in human-machine conversation are smaller than those in machine-machine simulation, indicating the gap between the simulation environment and the real conversation environment and encouraging us to consider online optimization in humanmachine conversations in the future. RL-DAGM is better than SL-DAGM in both experiments, indicating the efficacy of reinforcement learning.
|
| 196 |
+
|
| 197 |
+
The reason that our models are better is that they captured conversational patterns in human-human interactions and obtained further optimization through reinforcement learning. First, the models can pro-actively switch contexts in a smooth way. In machine-machine simulation, $6 5 . 4 \%$ (SL) and $9 4 . 4 \%$ (RL) dialogues contain at least one $\mathbf { \mathrm { C S . ^ { * } } }$ ; and in human-machine conversation, the two percentages are $3 8 . 1 \%$ (SL) and $4 8 . 1 \%$ (RL) respectively. More interestingly, in machine-machine simulation, average lengths of dialogues without CS.\* are only 4.78 (SL) and 2.67 (RL) respectively which are comparable with or even worse than RL-S2S, while average lengths of dialogues with CS.\* are 8.66 (SL) and 8.18 (RL) respectively. The results demonstrate the importance of context switch for engagement in open domain conversation and one signficant effect of RL is promoting context switch in interactions for future engagment even with a little sacrifice on relevance of the current turn (e.g., more 0 responses than SL-DAGM in Table 4(a)). Second, the models can drive conversations by asking questions. In machine-machine simulation, $3 6 . 5 \%$ (SL) and $3 2 . 4 \%$ (RL) dialogues contain at least one question. The percentages in human-machine conversation are $1 7 . 7 \%$ (SL) and $2 2 . 3 \%$ (RL) respectively. We give more analysis in Appendix 7.5.
|
| 198 |
+
|
| 199 |
+
# 4.4 DISCUSSION
|
| 200 |
+
|
| 201 |
+
Finally, we study how the generated responses are affected by the dialogue acts. We collect generated responses from a specific dialogue act for the contexts of the test dialogues, and characterize the responses with the following metrics: (1) distinct-1 and distinct-2; (2) words out of context (OOC): ratio of words that are in the generated responses but not contained by the contexts; and (3) average length of the generated responses (Ave Len).
|
| 202 |
+
|
| 203 |
+
Table 7: Characteristics of the generated responses from different dialogue acts.
|
| 204 |
+
|
| 205 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Distinct-1</td><td rowspan=1 colspan=1>Distinct-2</td><td rowspan=1 colspan=1>00C</td><td rowspan=1 colspan=1>AveLen</td></tr><tr><td rowspan=1 colspan=1>CM.S</td><td rowspan=1 colspan=1>0.114</td><td rowspan=1 colspan=1>0.262</td><td rowspan=1 colspan=1>0.091</td><td rowspan=6 colspan=1>5.575.215.588.215.858.42</td></tr><tr><td rowspan=3 colspan=1>CM.QCM.ACS.S</td><td rowspan=1 colspan=1>0.092</td><td rowspan=2 colspan=1>0.2200.269</td><td rowspan=2 colspan=1>0.0380.094</td></tr><tr><td rowspan=1 colspan=1>0.119</td></tr><tr><td rowspan=1 colspan=1>0.250</td><td rowspan=1 colspan=1>0.521</td><td rowspan=1 colspan=1>0.168</td></tr><tr><td rowspan=2 colspan=1>CS.QCS.A</td><td rowspan=1 colspan=1>0.223</td><td rowspan=1 colspan=1>0.460</td><td rowspan=1 colspan=1>0.152</td></tr><tr><td rowspan=1 colspan=1>0.244</td><td rowspan=1 colspan=1>0.500</td><td rowspan=1 colspan=1>0.166</td></tr></table>
|
| 206 |
+
|
| 207 |
+
Table 7 reports the results4. In general, responses generated from CS.\* are longer, more informative, and contain more new words than responses generated from CM.\*, which has been illustrated by the example in Table 6. Another interesting finding is that statements and answers are generally more informative than questions in both CS.\* and CM.\*. In addition to these metrics, we also calculate BLEU scores and embedding based metrics, but do not observe significant difference among responses from different dialogue acts. The reason might be that these metrics are based on comparsion of the generated responses and human responses, but human responses in the test set are inherently mixture of responses from different dialogue acts.
|
| 208 |
+
|
| 209 |
+
# 5 RELATED WORK
|
| 210 |
+
|
| 211 |
+
Existing dialogue models are either built for open domain conversation or for specific task completion. Regarding to the former, a common practice is to learn a generation model in an end-to-end fashion. On top of the basic sequence-to-sequence with attention architecture (Vinyals & Le, 2015; Shang et al., 2015), various extensions have been proposed to tackle the “safe response” problem (Li et al., 2015; Mou et al., 2016; Xing et al., 2017); to model complicated structures of conversation contexts (Serban et al., 2016; Sordoni et al., 2015); to bias responses to some specific persona or emotions (Li et al., 2016a; Zhou et al., 2017); and to pursue better optimization strategies (Li et al., 2017b; 2016b). On the other line of research, POMDP (Young et al., 2013) breaks down the development of task-oriented dialogue systems into natural language understanding (Yao et al., 2014; Henderson et al., 2014), dialogue management (Mrksiˇ c et al., 2016), and response generation ´ (Wen et al., 2015). Recently, researchers also consider learning task-oriented dialogue models in an end-to-end way (Wen et al., 2016; 2017; Bordes & Weston, 2017). In this work, we introduce dialogue acts into open domain dialogue generation. Although some previous work (Zhao et al., 2017; Serban et al., 2017a) has leveraged dialogue acts as extra features, the dialogue acts in this work are generally designed for explaining engagement in social chat and modelled as policies to manage the flow of interactions. To the best of our knowledge, we are the first who design dialogue acts to explain social interactions, control open domain response generation, and guide human-machine conversations.
|
| 212 |
+
|
| 213 |
+
Before us, some researchers have proposed analyzing open domain dialogues with dialogue acts (Kim et al., 2010; 2012; Oraby et al., 2017; Ivanovic, 2005; Wallace et al., 2013; Wu et al., 2005; Ritter et al., 2010). These work, however, stops at performing utterance classification or clustering. Our dialogue act design is inspired by these work, but we not only exploit the dialogue acts to interpret open domain dialogues, but also conduct dialogue generation with the dialogue acts.
|
| 214 |
+
|
| 215 |
+
# 6 CONCLUSION
|
| 216 |
+
|
| 217 |
+
We study open domain dialogue generation with generally designed dialogue acts that can describe human behavior in social interactions. To mimic such behavior, we propose jointly modeling dialogue act selection and response generation, and perform both supervised learning with a learned dialogue act classifier and reinforcement learning for long-term conversation. Empirical studies on response generation for given contexts, machine-machine simulation, and human-machine conversation show that the proposed models can significantly outperform state-of-the-art methods.
|
| 218 |
+
|
| 219 |
+
# REFERENCES
|
| 220 |
+
|
| 221 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. ICLR, 2015.
|
| 222 |
+
|
| 223 |
+
Antoine Bordes and Jason Weston. Learning end-to-end goal-oriented dialog. ICLR, 2017.
|
| 224 |
+
|
| 225 |
+
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
|
| 226 |
+
|
| 227 |
+
Mark G Core and James Allen. Coding dialogs with the damsl annotation scheme. In AAAI fall symposium on communicative action in humans and machines, volume 56. Boston, MA, 1997.
|
| 228 |
+
|
| 229 |
+
Mihail Eric and Christopher D Manning. Key-value retrieval networks for task-oriented dialogue. arXiv preprint arXiv:1705.05414, 2017.
|
| 230 |
+
|
| 231 |
+
Matthew Henderson, Blaise Thomson, and Steve Young. Word-based dialog state tracking with recurrent neural networks. In SIGDIAL, pp. 292–299, 2014.
|
| 232 |
+
|
| 233 |
+
Edward Ivanovic. Dialogue act tagging for instant messaging chat sessions. In Proceedings of the ACL Student Research Workshop, pp. 79–84. Association for Computational Linguistics, 2005.
|
| 234 |
+
|
| 235 |
+
Melvin Johnson, Mike Schuster, Quoc V Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viegas, Martin Wattenberg, Greg Corrado, et al. Google’s multilingual neural ´ machine translation system: enabling zero-shot translation. arXiv preprint arXiv:1611.04558, 2016.
|
| 236 |
+
|
| 237 |
+
Daniel Jurafsky, Elizabeth Shriberg, and Debra Biasca. Switchboard-damsl labeling project coder’s manual. Tech. Rep. 97-02, 1997.
|
| 238 |
+
|
| 239 |
+
Su Nam Kim, Lawrence Cavedon, and Timothy Baldwin. Classifying dialogue acts in one-on-one live chats. 2010.
|
| 240 |
+
|
| 241 |
+
Su Nam Kim, Lawrence Cavedon, and Timothy Baldwin. Classifying dialogue acts in multi-party live chats. In PACLIC, pp. 463–472, 2012.
|
| 242 |
+
|
| 243 |
+
Mike Lewis, Denis Yarats, Yann Dauphin, Devi Parikh, and Dhruv Batra. Deal or no deal? end-toend learning of negotiation dialogues. In EMNLP, pp. 2433–2443, 2017.
|
| 244 |
+
|
| 245 |
+
Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. NAACL, 2015.
|
| 246 |
+
|
| 247 |
+
Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A persona-based neural conversation model. ACL, 2016a.
|
| 248 |
+
|
| 249 |
+
Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. Deep reinforcement learning for dialogue generation. arXiv preprint arXiv:1606.01541, 2016b.
|
| 250 |
+
|
| 251 |
+
Jiwei Li, Alexander H Miller, Sumit Chopra, Jason Weston, et al. Learning through dialogue interactions by asking questions. ICLR, 2017a.
|
| 252 |
+
|
| 253 |
+
Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. EMNLP, 2017b.
|
| 254 |
+
|
| 255 |
+
Chia-Wei Liu, Ryan Lowe, Iulian V Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. EMNLP, 2016.
|
| 256 |
+
|
| 257 |
+
Ryan Lowe, Nissan Pow, Iulian Serban, and Joelle Pineau. The ubuntu dialogue corpus: A large dataset for research in unstructured multi-turn dialogue systems. arXiv preprint arXiv:1506.08909, 2015.
|
| 258 |
+
|
| 259 |
+
Lili Mou, Yiping Song, Rui Yan, Ge Li, Lu Zhang, and Zhi Jin. Sequence to backward and forward sequences: A content-introducing approach to generative short-text conversation. arXiv preprint arXiv:1607.00970, 2016.
|
| 260 |
+
|
| 261 |
+
Nikola Mrksiˇ c, Diarmuid O S ´ eaghdha, Tsung-Hsien Wen, Blaise Thomson, and Steve Young. Neu- ´ ral belief tracker: Data-driven dialogue state tracking. arXiv preprint arXiv:1606.03777, 2016.
|
| 262 |
+
|
| 263 |
+
Shereen Oraby, Pritam Gundecha, Jalal Mahmud, Mansurul Bhuiyan, and Rama Akkiraju. How may i help you?: Modeling twitter customer serviceconversations using fine-grained dialogue acts. In Proceedings of the 22nd International Conference on Intelligent User Interfaces, pp. 343–355. ACM, 2017.
|
| 264 |
+
|
| 265 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In ACL, pp. 311–318. Association for Computational Linguistics, 2002.
|
| 266 |
+
|
| 267 |
+
Alan Ritter, Colin Cherry, and Bill Dolan. Unsupervised modeling of twitter conversations. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, pp. 172–180. Association for Computational Linguistics, 2010.
|
| 268 |
+
|
| 269 |
+
Iulian V Serban, Chinnadhurai Sankar, Mathieu Germain, Saizheng Zhang, Zhouhan Lin, Sandeep Subramanian, Taesup Kim, Michael Pieper, Sarath Chandar, Nan Rosemary Ke, et al. A deep reinforcement learning chatbot. arXiv preprint arXiv:1709.02349, 2017a.
|
| 270 |
+
|
| 271 |
+
Iulian Vlad Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C. Courville, and Joelle Pineau. End-to-end dialogue systems using generative hierarchical neural network models. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, February 12-17, 2016, Phoenix, Arizona, USA., pp. 3776–3784, 2016.
|
| 272 |
+
|
| 273 |
+
Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron C Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. In AAAI, pp. 3295–3301, 2017b.
|
| 274 |
+
|
| 275 |
+
Lifeng Shang, Zhengdong Lu, and Hang Li. Neural responding machine for short-text conversation. Proceedings of Annual Meeting of the Association for Computational Linguistics (ACL), pp. 1577–1586, 2015.
|
| 276 |
+
|
| 277 |
+
Alessandro Sordoni, Michel Galley, Michael Auli, Chris Brockett, Yangfeng Ji, Margaret Mitchell, Jian-Yun Nie, Jianfeng Gao, and Bill Dolan. A neural network approach to context-sensitive generation of conversational responses. arXiv preprint arXiv:1506.06714, 2015.
|
| 278 |
+
|
| 279 |
+
Andreas Stolcke, Klaus Ries, Noah Coccaro, Elizabeth Shriberg, Rebecca Bates, Daniel Jurafsky, Paul Taylor, Rachel Martin, Carol Van Ess-Dykema, and Marie Meteer. Dialogue act modeling for automatic tagging and recognition of conversational speech. Dialogue, 26(3), 2006.
|
| 280 |
+
|
| 281 |
+
Oriol Vinyals and Quoc Le. A neural conversational model. arXiv preprint arXiv:1506.05869, 2015.
|
| 282 |
+
|
| 283 |
+
Byron C Wallace, Thomas A Trikalinos, M Barton Laws, Ira B Wilson, and Eugene Charniak. A generative joint, additive, sequential model of topics and speech acts in patient-doctor communication. In EMNLP, pp. 1765–1775, 2013.
|
| 284 |
+
|
| 285 |
+
Tsung-hsien Wen, Pei-hao Su, V David, and Steve Young. Semantically conditioned lstm-based natural language generation for spoken dialogue systems. In In EMNLP. Citeseer, 2015.
|
| 286 |
+
|
| 287 |
+
Tsung-Hsien Wen, David Vandyke, Nikola Mrksic, Milica Gasic, Lina M Rojas-Barahona, Pei-Hao Su, Stefan Ultes, and Steve Young. A network-based end-to-end trainable task-oriented dialogue system. arXiv preprint arXiv:1604.04562, 2016.
|
| 288 |
+
|
| 289 |
+
Tsung-Hsien Wen, Yishu Miao, Phil Blunsom, and Steve Young. Latent intention dialogue models. arXiv preprint arXiv:1705.10229, 2017.
|
| 290 |
+
|
| 291 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 292 |
+
|
| 293 |
+
Tianhao Wu, Faisal M Khan, Todd A Fisher, Lori A Shuler, and William M Pottenger. Posting act tagging using transformation-based learning. In Foundations of data mining and knowledge discovery, pp. 319–331. Springer, 2005.
|
| 294 |
+
|
| 295 |
+
Chen Xing, Wei Wu, Yu Wu, Jie Liu, Yalou Huang, Ming Zhou, and Wei-Ying Ma. Topic aware neural response generation. In AAAI, pp. 3351–3357, 2017.
|
| 296 |
+
|
| 297 |
+
Kaisheng Yao, Baolin Peng, Yu Zhang, Dong Yu, Geoffrey Zweig, and Yangyang Shi. Spoken language understanding using long short-term memory neural networks. In Spoken Language Technology Workshop (SLT), 2014 IEEE, pp. 189–194. IEEE, 2014.
|
| 298 |
+
|
| 299 |
+
Stephanie Young, Milica Gasic, Blaise Thomson, and John D Williams. Pomdp-based statistical spoken dialog systems: A review. Proceedings of the IEEE, 101(5):1160–1179, 2013.
|
| 300 |
+
|
| 301 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
|
| 302 |
+
|
| 303 |
+
Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. Learning discourse-level diversity for neural dialog models using conditional variational autoencoders. arXiv preprint arXiv:1703.10960, 2017.
|
| 304 |
+
|
| 305 |
+
Hao Zhou, Minlie Huang, Tianyang Zhang, Xiaoyan Zhu, and Bing Liu. Emotional chatting machine: Emotional conversation generation with internal and external memory. arXiv preprint arXiv:1704.01074, 2017.
|
| 306 |
+
|
| 307 |
+
# 7 APPENDIX
|
| 308 |
+
|
| 309 |
+
# 7.1 GENERATION NETWORK
|
| 310 |
+
|
| 311 |
+
Suppose that $x _ { i } = [ a _ { i } ; u _ { i - 1 } ; u _ { i - 2 } ] = ( w _ { i , 1 } , \ldots , w _ { i , n _ { i } ^ { \prime } } )$ where $w _ { i , k }$ is the embedding of the $k$ -th word, then the $k$ -th hidden state of the encoder is given by $v _ { i , k } = [ \overrightarrow { v } _ { i , k } ; \overleftarrow { v } _ { i , k } ]$ where
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r } { \overline { { \boldsymbol { v } } } _ { i , k } = f _ { \mathrm { G R U } } ^ { e } ( \overline { { \boldsymbol { v } } } _ { i , k - 1 } , \boldsymbol { w } _ { i , k } ) ; \overline { { \boldsymbol { v } } } _ { i , k } = f _ { \mathrm { G R U } } ^ { e } ( \overleftarrow { \boldsymbol { v } } _ { i , k + 1 } , \boldsymbol { w } _ { i , k } ) } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Positions of $u _ { - 1 }$ and $u _ { 0 }$ in $x _ { 1 }$ and $x _ { 2 }$ are padded with zeros. Let ${ \boldsymbol { r } _ { i } } = ( w _ { i , 1 } ^ { \prime } , \dots , w _ { i , T } ^ { \prime } )$ , then in decoding the $j$ -th word $w _ { i , j } ^ { \prime }$ , $\{ v _ { i , 1 } , \ldots , v _ { i , n _ { i } ^ { \prime } } \}$ is summarized as a context vector $c _ { i , j }$ through an attention mechanism:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
c _ { i , j } = \sum _ { k = 1 } ^ { n _ { i } ^ { \prime } } \alpha _ { j , k } v _ { i , k } ; ~ \alpha _ { j , k } = \frac { e x p ( e _ { j , k } ) } { \sum _ { m = 1 } ^ { n _ { i } ^ { \prime } } e x p ( e _ { j , m } ) } ; ~ e _ { j , k } = v ^ { \top } t a n h ( W _ { \alpha } [ v _ { i , k } ; v _ { i , j - 1 } ^ { \prime } ] ) ,
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
where $v$ and $W _ { \alpha }$ are parameters, and $v _ { i , j - 1 } ^ { \prime }$ is the $( j - 1 )$ -th hidden state of the decoder GRU in which $\boldsymbol { v } _ { i , j } ^ { \prime }$ is calculated by
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { r } { v _ { i , j } ^ { \prime } = f _ { \mathrm { G R U } } ^ { d } ( v _ { i , j - 1 } ^ { \prime } , w _ { i , j - 1 } ^ { \prime } , c _ { i , j } ) . } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
The generation probability of $w _ { i , j }$ is then defined as
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
p _ { r } ( w _ { i , j } ^ { \prime } | w _ { i , < j } ^ { \prime } , x _ { i } ) = \mathcal { Z } ( w _ { i , j } ^ { \prime } ) ^ { \top } s o f t m a x ( w _ { i , j - 1 } ^ { \prime } , v _ { i , j } ^ { \prime } ) ,
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
where $\mathcal { T } ( w _ { i , j } ^ { \prime } )$ is a vector with only one element 1 indicating the index of $w _ { i , j } ^ { \prime }$ in the vocabulary. $p _ { r } ( r _ { i } | a _ { i } , u _ { i - 1 } , u _ { i - 2 } )$ is finally defined as
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
p _ { r } ( r _ { i } | a _ { i } , u _ { i - 1 } , u _ { i - 2 } ) = p _ { r } ( w _ { i , 1 } ^ { \prime } | x _ { i } ) \prod _ { j = 2 } ^ { T } p _ { r } ( w _ { i , j } ^ { \prime } | w _ { i , < j } ^ { \prime } , x _ { i } ) .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
# 7.2 DETAILS OF LEARNING THE DIALOGUE ACT CLASSIFIER
|
| 342 |
+
|
| 343 |
+
We randomly split the 500 labeled dialogues as 400, 30, and 70 dialogues for training, validation, and test respectively. Utterances in the three sets are 3280, 210, and 586 respectively. In training, we represent dialogue acts as probability distributions by averaging the labels given by the three annotators. For example, if an utterance is labeled as “CM.S”, “CM.S”, and $\mathrm { ^ { 6 6 } C S . S ^ { 7 } }$ , then the probability distribution is $( \bar { 0 } . 6 7 , 0 , 0 , 0 . 3 3 , 0 , 0 , 0 )$ . In test, we predict the dialogue act of an utterance $u _ { i }$ by arg $\begin{array} { r } { \operatorname* { m a x } _ { j } g ( u _ { i } , u _ { i - 1 } , a _ { i - 1 } ) [ j ] } \end{array}$ . To avoid overfitting, we pre-train word embeddings using word2vec5 with an embedding size of 200 on the 30 million data and fix them in training. We set the embedding size of the dialogue acts and the hidden state size of the biGRUs as 100, and the dimensions of the first layer and the second layer of the MLP as 200 and 7 respectively. We optimize the objective function (3) using back-propagation and the parameters are updated by stochastic gradient descent with AdaDelta algorithm (Zeiler, 2012). The best performing model on the validation data is picked up for test.
|
| 344 |
+
|
| 345 |
+
# 7.3 DETAILS OF IMPLEMENTATION OF THE DIALOGUE GENERATION MODEL
|
| 346 |
+
|
| 347 |
+
In learning of the generation network, we set the size of word embedding as 620 and the size of hidden vectors as 1024 in both the encoder and the decoder. Both the encoder vocabulary and the decoder vocabulary contain 30, 000 words. Words out of the vocabularies are replaced by a special token “UNK”. We employ AdaDelta algorithm (Zeiler, 2012) to train the generation network with a batch size 128. We set the initial learning rate as 1.0 and reduce it by half if perplexity on validation begins to increase. We stop training if the perplexity on validation keeps increasing in two successive epochs.
|
| 348 |
+
|
| 349 |
+
In learning of the policy network, we set the size of word embedding, the size of dialogue act, and the size of hidden states of the biGRU as 100. There are 50 neurons in the first layer of the MLP and 7 neurons in the second layer of the MLP. Vectors in the policy network have smaller sizes than those in the generation network because the complexity of dialogue act prediction is much lower than language generation.
|
| 350 |
+
|
| 351 |
+
In reinforcement learning, the size of mini-batch is 60 and learning rate is fixed as 0.05. To estimate the reward, we train a dual LSTM (Lowe et al., 2015) with the size of word embedding and the size of hidden states as 100. Responses from the simulated dialogues are generated with a beam size 20.
|
| 352 |
+
|
| 353 |
+
In RL-S2S, we define 8 responses as dull responses according to the frequency of responses in the training set. Table 8 gives the responses.
|
| 354 |
+
|
| 355 |
+
Table 8: Dull responses for learning RL-S2S.
|
| 356 |
+
|
| 357 |
+
<table><tr><td>No.</td><td>Chinese responses</td><td>English translations</td></tr><tr><td>1</td><td>我不知道 我觉得你说得对</td><td>I do not know.</td></tr><tr><td>2</td><td rowspan="4">你是男的女的 嗯我知道</td><td>I think you are right.</td></tr><tr><td>3</td><td>Are you a man or a woman?</td></tr><tr><td>4</td><td>I see.</td></tr><tr><td>5</td><td>I do not know either.</td></tr><tr><td>6</td><td>我也不知道 你说的对</td><td>You are right.</td></tr><tr><td>7</td><td>我也是这么想的</td><td>I think so.</td></tr><tr><td>8</td><td>好啊</td><td>OK.</td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 358 |
+
|
| 359 |
+
# 7.4 MORE EXAMPLES OF RESPONSE GENERATION
|
| 360 |
+
|
| 361 |
+
We compare SL-DAGM and RL-DAGM with baseline models in terms of response quality for given contexts with more examples in Table 9.
|
| 362 |
+
|
| 363 |
+
# 7.5 FURTHER ANALYSIS ON ENGAGMENT TEST
|
| 364 |
+
|
| 365 |
+
Table 10 gives some examples on machine-machine simulation. Unlike the dialogues from RL-S2S which quickly converge to loops, dialogues from our models smoothly move forward under the management of the dialogue acts. The dialogue acts let us know why such responses are generated and make the simulated dialogues closer to human dialogues with moderate context continuation and jumping out of the contexts at proper timing. Table 11 and Table 12 show some examples from the test of human-machine conversation. We denote a machine turn as “M” and a human turn as “H”. After each example, we give the reason of termination in which “EOD-H” means the dialogue is terminated by the tester and “EOD-R” means the dialogue is terminated by the repetition check with the next generated turn attached. Compared to dialogues with the baseline, dialogues with our models can go deeper with much richer content, although a side-effect is that sometimes responses from CS.\* might be nonsense (e.g., the first example of SL-DAGM). This sheds light on our future direction to further improve the generation network with knowledge. In addition to the qualitative results, we also show quantitative results of human-machine conversation test in terms of different testers in Figure 2. Although there exists variance among the testers, the overall trend is consistent with the numbers in Table 4(b).
|
| 366 |
+
|
| 367 |
+
Table 9: More examples of response generation. Utterances in the context are split by $\ " \Rightarrow \mathrm { \ : }$ ”.
|
| 368 |
+
|
| 369 |
+
<table><tr><td>Context</td><td>Responses</td></tr><tr><td>你眼袋略大,常熬夜?→我大学 毕业后没有熬夜过?→早睡早起 好孩子→是的</td><td>S2SA:我也是这么想的。Ithink so HRED:哈哈。Haha. VHRED:你是在夸我吗? So you are praising me? RL-S2S:我也是好孩子。Iam a good boy too.</td></tr><tr><td>Your have dark circles under your eyes. Always stay up late? = I never stay up late after I graduate from my university. = Good boy! Early to bed,early to rise.= Yes.</td><td>SL-DAGM:我经常倒时差睡眠不好。ButIoften have poor sleep because of jet lag. (CS.S) RL-DAGM:想问你每天几点起床。Thenwhendoyou get up everyday? (CS.Q) CM.Q:你要睡了吗? Are you going to sleep?</td></tr><tr><td>我们一起合租怎么样?→ 多少 钱?→800→加我微信 How about renting an apartment to- gether? = How much? =>800. → Then add me as a contact in WeChat.</td><td>CM.S:我也是早睡。Isleep early as well. S2SA:邮件发你了。Ihave sent you an email. HRED:你加我微信可以吗?Could you please add me in your WeChat? VHRED:加我微信。Add me in your WeChat. RL-S2S:邮件发你了。Ihave sent you an email. SL-DAGM:我想和你一起玩桌游。Iwant to play board games with you. (CS.S) RL-DAGM:什么时候联系。When canIcontact you? (CM.Q) CS.Q:你在哪个区? Which district do you live in? CM.S:给我微信号。Give me your WeChat ID.</td></tr></table>
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 2: Evaluation results on human-machine conversation in terms of different testers.
|
| 373 |
+
|
| 374 |
+
Table 10: Comparison of simulated dialogues from different models.
|
| 375 |
+
|
| 376 |
+
<table><tr><td rowspan=1 colspan=1>RL-S2S</td><td rowspan=1 colspan=1>SL-DAGM</td><td rowspan=1 colspan=1>RL-DAGM</td></tr><tr><td rowspan=1 colspan=1>A:无锡妹子你好!B:我是无锡的,你在哪儿?A:我在上海。B:我也在上海。A:我也在上海。A: Hello,Wuxi girl!B: Icome from Wuxi. How aboutyou?A: I come from Shanghai.B:Icome from Shanghai too.A: I come from Shanghai too.</td><td rowspan=1 colspan=1>A:无锡妹子你好!(CM.S)B:你也无锡的? (CM.Q)A:嗯嗯,无锡的。(CM.A)B:我在无锡上学呢。(CM.S)A:无锡有什么好吃的吗? (CS.Q)A: Hello, Wuxi girl! (CM.S)B:You also come from Wuxi?(CM.Q)A: Yes,Iam. (CM.A)B: I am a college student in Wuxi.(CM.S)A: Is there any delicious food inWuxi? (CS.Q)</td><td rowspan=1 colspan=1>A:无锡妹子你好! (CM.S)B:你好,你也在江苏? (CS.Q)A:不是土著,在江苏读书。(CS.S)B:江苏本地人很多啊。(CM.S)A:但是我身边都是外地人。(CM.S)A: Hello, Wuxi girl! (CM.S)B:Hello,you also in Jiangsuprovince?(Wuxi is a cityinJiangsu) (CS.Q)A:Iam not born in Jiangsu, but Igo to college in Jiangsu. (CS.S)B:Many people in Jiangsu arenatives. (CM.S)A:But most people around meare not natives.(CM.S)</td></tr><tr><td rowspan=1 colspan=1>A:去新加坡马来西亚可以学英语.B:新加坡有好玩的吗?A:有好玩的吗?B:新加坡有什么好玩的?我想去看看。A:Ican learn English in Singa-pore and Malaysia.B: Are there any interestingplaces in Singapore?A: Are there anyinterestingplaces?B: Are there any interestingplaces in Singapore? I want tohave a tour in Singapore.</td><td rowspan=1 colspan=1>A:去新加坡马来西亚可以学英语。(CM.S)B:你英文名是什么? (CS.Q)A:我应该可以写出来。(CM.S)B:那你姓什么。(CM.S)A:我什么时候写出来?(CS.Q)A:I can learn English in Singa-pore and Malaysia. (CM.S)B:What is your English name?(CS.Q)A:I think I can write it out.(CM.S)B:What is your family name?(CM.S)A: When shall I write my Englishname? (CS.Q)</td><td rowspan=1 colspan=1>A:去新加坡马来西亚可以学英语。(CM.S)B:你也想去新加坡学英语? (CM.Q)A:一样一样。(CM.A)B:你是什么专业的? (CS.Q)A:我们学校有什么专业? (CM.Q)A: I can learn English in Singa-pore and Malaysia. (CM.S)B: You also want to go there tolearn English?(CM.Q)A: Yep. (CM.A)B: What are you major in?(CS.Q)A: What majors do we have?(CM.Q)</td></tr></table>
|
| 377 |
+
|
| 378 |
+
Table 11: Example 1 of human-machine conversation. “M” means a machine turn, and “H” means a human turn.
|
| 379 |
+
|
| 380 |
+
<table><tr><td rowspan=1 colspan=1>RL-S2S</td><td rowspan=1 colspan=1>SL-DAGM</td><td rowspan=1 colspan=1>RL-DAGM</td></tr><tr><td rowspan=1 colspan=1>M:喝汤就饱了。H:可以减肥。M:减肥会不会很痛苦啊?H:不吃不喝确实很难受。M:我都不敢吃了。H:那就不吃了?EOD-R(我也不敢吃���。)M: Iam full with only soup.H: Then you can lose weight.M: Is it tough to lose weight?H: It's indeed tough when youhave to diet.M: I have to diet.H: Then diet?EOD-R (I have to diet as well.)</td><td rowspan=1 colspan=1>M:喝汤就饱了。(CM.S)H:可以减肥。(CS.S)M:吃不胖的体质伤不起啊! (CM.S)H:羡慕。(CM.A)M:我正在增肥。(CS.S)H:多吃冰淇淋。(CM.S)M:冰与火之歌都吃过了。(CM.S)EOD-HM: I am full with only soup.(CM.S)H: Then you can lose weight.(CS.S)M: I really want to get a little fat-ter. (CM.S)H: Iam jealous of you! (CM.A)M: I am trying to gain weight.(CS.S)H: Then have more ice cream.(CM.S)M:I even ate Song of Ice andFire.(CM.S)EOD-H</td><td rowspan=1 colspan=1>M:喝汤就饱了。(CM.S)H:可以减肥。(CS.S)M:你吃蛋白粉?(CS.Q)H:我不吃蛋白粉。(CM.A)M:酵素粉是什么? (CS.Q)H:减肥神物。(CM.A)M:我去试试!(CM.S)H:快去吧,吃酵素要坚持。(CM.S)M:药店有卖酵素粉的吗?多少钱啊? (CS.Q)H:有,不贵。(CM.A)EOD-R(请问药店有卖的吗?多少钱?)M:I am full with only soup.(CM.S)H: Then you can lose weight.(CS.S)M: Do you eat albumen powder?(CS.Q)H: Nope. (CM.A)M: What is enzyme powder?(CS.Q)H: Something can make youslim. (CM.A)M: I want to try it! (CM.S)H: Go ahead,and do not give up.(CM.S)M: Can I get enzyme powderin pharmacy? How much is it?(CS.Q)H: Yes you can. It's not expen-sive. (CM.A)EOD-R (Can I get it in phar-macy?How much?)</td></tr></table>
|
| 381 |
+
|
| 382 |
+
Table 12: Example 2 of human-machine conversation. “M” means a machine turn, and “H” means a human turn.
|
| 383 |
+
|
| 384 |
+
<table><tr><td rowspan=1 colspan=5>RL-S2S</td><td rowspan=1 colspan=1>SL-DAGM</td><td rowspan=1 colspan=1>RL-DAGM</td></tr><tr><td rowspan=1 colspan=5>M:你用淡妆比较好看。H:嗯我听你的。M:谢谢你,一起努力啊。H:一起努力啊。EOD-R(一起努力!)M: Light makeup looks good foryou.H: Well, you are right.M: Thank you. Let's do it to-gether!</td><td rowspan=4 colspan=1>M:你用淡妆比较好看。(CM.S)H:嗯我听你的。(CM.A)M:只用粉底和口红吧。(CS.S)H:你推荐个粉底。(CM.S)M:资生堂的不错。(CM.S)H:这个好。(CM.S)M:因为我用过一段时间,觉得很不错(CM.S)H:那太好了。(CM.S)M:你用过几次? (CM.Q)H:我没用过(CM.A)EOD-R(你用过几次?)M: Light makeup looks good foryou. (CM.S)H: Well, you are right. (CM.A)M: Only use foundation and lip-stick. (CS.S)H: Recommend me a brand offoundation. (CM.S)M: Shiseido is good. (CM.S)H: That is great. (CM.S)M:Because I used to try it forsometime,and feel good. (CM.S)H: Sounds good. (CM.S)M:How many times have youused it? (CM.Q)H: Never. (CM.A)EOD-R (How many times haveyou used it?)</td><td rowspan=4 colspan=1>M:你用淡妆比较好看。 (CM.S)H:嗯我听你的。(CM.A)M:画浓妆会不会气色很差? (CS.Q)H:不会的。(CM.A)M:那有什么副作用?(CS.Q)H:皮肤可能不好。 (CM.S)EOD-R(有什么副作用?)M: Light makeup looks good foryou. (CM.S)H: Well, you are right. (CM.A)M:Does heavy makeup makeyourcomplexionlookbad?(CS.Q)H: Nope. (CM.S)M: Then is there any side-effect?(CS.Q)H: My skin will become worse.(CM.S)EOD-R(is there any side-effect?)</td></tr><tr><td rowspan=1 colspan=5>H: Do it together!EOD-R (Do it together!)</td></tr><tr><td></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td></td></tr><tr><td rowspan=1 colspan=5></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr></table>
|
md/train/ByxY8CNtvr/ByxY8CNtvr.md
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING NEURAL LANGUAGE GENERATION WITH SPECTRUM CONTROL
|
| 2 |
+
|
| 3 |
+
Lingxiao Wang1, Jing Huang2, Kevin Huang2, Ziniu $\mathbf { H } \mathbf { u } ^ { 1 }$ , Guangtao $\mathbf { W a n g } ^ { 2 }$ , Quanquan $\mathbf { G u } ^ { 1 }$
|
| 4 |
+
|
| 5 |
+
1Department of Computer Science, University of California, Los Ange 2JD AI Research, Mountain View, CA 94034 {lingxw,bull,qgu}@cs.ucla.edu {jing.huang,kevin.huang3,guangtao.wang}@jd.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Recent Transformer-based models such as Transformer-XL and BERT have achieved huge success on various natural language processing tasks. However, contextualized embeddings at the output layer of these powerful models tend to degenerate and occupy an anisotropic cone in the vector space, which is called the representation degeneration problem. In this paper, we propose a novel spectrum control approach to address this degeneration problem. The core idea of our method is to directly guide the spectra training of the output embedding matrix with a slow-decaying singular value prior distribution through a reparameterization framework. We show that our proposed method encourages isotropy of the learned word representations while maintains the modeling power of these contextual neural models. We further provide a theoretical analysis and insight on the benefit of modeling singular value distribution. We demonstrate that our spectrum control method outperforms the state-of-the-art Transformer-XL modeling for language model, and various Transformer-based models for machine translation, on common benchmark datasets for these tasks.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Neural language generation (NLG) is an important task with many practical applications, such as automatic speech recognition (Graves et al., 2013; Toshniwal et al., 2018), text generation (Bowman et al., 2016; Radford et al., 2019; Keskar et al., 2019), machine translation (Bahdanau et al., 2015; Vaswani et al., 2017) and dialog systems (Gao et al., $2 0 1 9 \mathrm { a }$ ; Tang et al., 2019). Most NLG models utilize a complex encoding model to map a given context into a hidden state vector, and then predict the next word distribution by multiplying the encoded vector with the output embedding layer, followed by a softmax layer. In the past few years, it has witnessed a significant progress in NLG by improving the encoding model, from the recurrent neural network (RNN) (Bahdanau et al., 2015; Jozefowicz et al., 2016; Merity et al., 2018a) based models to the current Transformer-based models (Vaswani et al., 2017; Devlin et al., 2019; Dai et al., 2019; Radford et al., 2019). However, embeddings in the softmax output layer have been shown not capable enough to model the conditional probability (Yang et al., 2018).
|
| 14 |
+
|
| 15 |
+
Recently, Gao et al. (2019b) pointed out another limitation of the output embeddings: the representation degeneration problem. They showed that the singular value distribution of the output embedding matrix tends to decay very fast, and the embedding space is squeezed into a narrow cone (as shown in Figure 1(a) and 1(c) in 2-D plots). Such anisotropic shape (Ethayarajh, 2019) is very different from what one would expect from an expressive word embedding space (Arora et al., 2016a; Mu & Viswanath, 2018). Therefore, several efforts (Gao et al., 2019b; Wang et al., 2019a) have been made to address the degeneration problem.
|
| 16 |
+
|
| 17 |
+
Unlike previous approaches that applied implicit regularization to singular values of the output embedding matrix, we propose a spectrum control (SC) approach, which was inspired by the spectral control technique used for Generative Adversarial Network (GAN) training (Jiang et al., 2019), to explicitly control the singular value distribution. We first reparameterize the output embedding matrix W by its singular value decomposition (SVD): $\mathbf { W } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { \top }$ , where $\mathbf { U } , \mathbf { V }$ are column orthonormal matrices, and $\pmb { \Sigma }$ is a diagonal matrix of singular values. Then we guide the training of $\pmb { \Sigma }$ by a predefined slow-decaying prior distribution, such as a polynomial decay distribution, or an exponential decay distribution. At the end of training, the distribution of singular values of the embedding matrix gets close to the prior distribution. Our spectrum control approach alleviates the representation degeneration problem by encouraging the diversity of word representations and improving isotropic property of these representations (see Figure 2), even on top of the powerful Transformer-based models.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Projected word embeddings1and singular value distributions. (a) and (c): 2-D visualization of word embedding matrices of Transformer-XL for language modeling and Transformer for machine translation; (b) and (d): Normalized singular value distributions of embedding matrices.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2: Projected word embeddings and singular value distributions using our spectrum control method. (a) and (c): 2-D visualization of word embedding matrices of Transformer-XL for language modeling and Transformer for machine translation; (b) and (d): Normalized singular value distributions of embedding matrices.
|
| 24 |
+
|
| 25 |
+
We further present a theoretical analysis to justify our method. The results suggest that it is beneficial to directly guide the singular value distribution of the embedding matrix throughout the training process and control the decay rate of these singular values. We demonstrate the effectiveness of our training framework with extensive experimental results on two tasks: language modeling and machine translation. Our spectrum control method outperforms the latest state-of-the-art TransformerXL model on WikiText-103 dataset for language modeling; and obtains close to 1.5 BLEU improvement on IWSLT 2014 German-English translation task compared to the Transformer baseline model.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
In this paper, we mainly focus on the output embedding matrix that is used in the softmax output layer for language generation tasks. This embedding matrix is also used as input word embeddings, which is known as weight tying trick. The weight tying not only reduces the number of parameters but also enjoys theoretical benefits (Inan et al., 2017). Thus the weight tying has been successfully applied to many state-of-the-art models for language modeling and machine translation (Merity et al., 2018a; Vaswani et al., 2017; Yang et al., 2018).
|
| 30 |
+
|
| 31 |
+
However, there are certain issues with the softmax output layer. Yang et al. (2018) first identified a problem called “softmax bottleneck” that the softmax output layer does not have enough capacity to model natural language due to its connection with the rank bottleneck in matrix factorization. A simple and effective method called Mixture of Softmaxes (MoS) was proposed to deal with this issue. Follow-up work in Kanai et al. (2018); Ganea et al. (2019) tried to replace softmax with alternative activation functions. Kanai et al. (2018) proposed to use sigsoftmax, which is composed of a multiplication of an exponential function and sigmoid function. Ganea et al. (2019) proposed a Linear-Monotonic-Softmax (LMS) model that generalized the approach in Kanai et al. (2018) by learning parametric point-wise increasing functions to optimally distort the logits before feeding them into the softmax layer. Pappas & Henderson (2019) instead resorted to a powerful deep residual nonlinear output mapping while using a single softmax function without modifying its dimensionality or rank.
|
| 32 |
+
|
| 33 |
+
Another line of work focuses on increasing the expressive power of the output embedding matrix by adding a cosine similarity regularization term (Gao et al., 2019b), or adversarial noise (Wang et al., 2019a). Gao et al. (2019b) analyzed the representation degeneration problem that the output embeddings tend to degenerate and be distributed into a narrow cone. A regularization term based on the summation of pairwise cosine similarity among all words was proposed to increase the representation power of word embeddings. Wang et al. (2019a) pointed out the computation of regularization term in (Gao et al., 2019b) depends on the size of the vocabulary and hence is costly. Instead, they proposed a simple yet highly effective adversarial training method that adds adversarial noises to the output embedding layer when training the models. They proved in theory that this adversarial training increases the distances between two different words, and thus encourages the diversity of the embedding vectors. Our work follows this line of thought, but takes a different approach: motivated by the spectrum control method for GAN training (Jiang et al., 2019), we propose to directly guide the singular values by a slow-decaying prior distribution during the model training process. We show that the anisotropic behavior of the contextualized word representations from powerful Transformer-based models (Ethayarajh, 2019) are alleviated by our spectrum control approach.
|
| 34 |
+
|
| 35 |
+
# 3 PROBLEM SETUP
|
| 36 |
+
|
| 37 |
+
In this section, we briefly introduce the neural models for language generation, and illustrate the singular value decay phenomena of existing neural language models. We first introduce some notations used in the rest of the paper.
|
| 38 |
+
|
| 39 |
+
Notation: For a $d$ -dimensional vector $\mathbf { x } \in \mathbb { R } ^ { d }$ , we use $\begin{array} { r } { \| \mathbf { x } \| _ { q } = ( \sum _ { i = 1 } ^ { d } | x _ { i } | ^ { q } ) ^ { 1 / q } } \end{array}$ , where $0 < q < \infty$ to denote its $\ell _ { q }$ -norm, and $\left\| \mathbf { x } \right\| _ { \infty } = \operatorname* { m a x } _ { i } \left| x _ { i } \right|$ to be its infinity norm. For a matrix $\mathbf { A } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 2 } }$ , let $\mathbf { A } _ { i * }$ be the $i$ -th row of $\mathbf { A }$ , and we use $\| \mathbf { A } \| _ { 2 } , \| \mathbf { A } \| _ { F } , \| \mathbf { A } \| _ { 1 }$ to denote its spectral norm, Frobenius norm, and matrix 1-norm. Given two sequences $\left\{ a _ { n } \right\}$ and $\left\{ b _ { n } \right\}$ , if there exists a constant $0 < C <$ $\infty$ such that $a _ { n } \leq C b _ { n }$ , we write $a _ { n } = O ( b _ { n } )$ , and we use ${ \widetilde { O } } ( \cdot )$ to hide the logarithmic factors.
|
| 40 |
+
|
| 41 |
+
# 3.1 NEURAL LANGUAGE GENERATION
|
| 42 |
+
|
| 43 |
+
We first briefly review the softmax output layer typically used in neural language generation models. We define the joint probability of a given length- $n$ sentence of words (tokens) $\mathbf { s } _ { n } = \left( \mathbf { y } _ { 1 } , \ldots , \mathbf { y } _ { n } \right)$ as the following product of conditional probabilities
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\mathbb { P } ( \mathbf { s } _ { n } ) = \prod _ { t = 1 } ^ { n } \mathbb { P } ( \mathbf { y } _ { t } | \mathbf { c } _ { t } ) ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\mathbf { y } _ { t } \in \mathcal { V }$ is the $t$ -th word in sentence ${ \bf s } _ { n }$ , and $\nu$ represents the word vocabulary, $\mathbf { c } _ { t } = \mathbf { y } _ { 1 : t - 1 } =$ $\left( \mathbf { y } _ { 1 } , \ldots , \mathbf { y } _ { t - 1 } \right)$ is referred to as the context of word $\mathbf { y } _ { t }$ . In addition, the context $\mathbf { c } _ { t }$ is usually modeled by a fixed size vector $\mathbf { h } _ { t } \in \mathbb { R } ^ { d }$ , which is referred to as the hidden state, using some neural networks such as LSTM (Hochreiter & Schmidhuber, 1997) and Transformer (Vaswani et al., 2017). Then, the probability distribution of the output word $\mathbf { y } _ { t }$ given the context $\mathbf { c } _ { t }$ , i.e., $\mathbb { P } ( \mathbf { y } _ { t } | \mathbf { c } _ { t } )$ in (3.1), is parameterized as the following softmax function:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\mathbb { P } ( Y _ { t } = \mathbf { y } _ { t } | \mathbf { c } _ { t } ) = \mathbb { P } ( Y _ { t } = \mathbf { y } _ { t } | \mathbf { h } _ { t } ) = \frac { \exp ( \mathbf { h } _ { t } ^ { \top } \mathbf { W } _ { \mathcal { Z } ( \mathbf { y } _ { t } ) \ast } ) } { \sum _ { i = 1 } ^ { N } \exp ( \mathbf { h } _ { t } ^ { \top } \mathbf { W } _ { i \ast } ) } ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\mathbf { W } \in \mathbb { R } ^ { N \times d }$ is the weight matrix and is usually tied with the input word embedding matrix (Press & Wolf, 2017; Inan et al., 2017), $N = | \nu |$ is the vocabulary size, $d$ is the embedding dimension, $\mathcal { T } ( \mathbf { y } _ { t } )$ represents the index of word $\mathbf { y } _ { t }$ in vocabulary $\nu$ . In the following discussion, we call output weight matrix W as the word embedding matrix of the neural language model since it is tied with the input word embedding matrix.
|
| 56 |
+
|
| 57 |
+
In this paper we focus on the output layer of the neural model for language generation, i.e., the softmax layer in (3.2), as in (Yang et al., 2018; Kanai et al., 2018; Ganea et al., 2019; Gao et al., 2019b). We will examine the singular value distribution of $\mathbf { W }$ and propose a different approach to increase the expressive power of the word embedding.
|
| 58 |
+
|
| 59 |
+
# 3.2 FAST SINGULAR VALUE DECAY
|
| 60 |
+
|
| 61 |
+
As we mentioned before, the singular values of W tend to drop very fast and it may interact with the cone-shaped embedding space. More specifically, Figure 1(b) and 1(d) illustrate the distributions of the normalized singular values of the Transformer-XL based language model2 (Dai et al., 2019) and the Transformer-based machine translation model (Vaswani et al., 2017) trained on WikiText103 (Merity et al., 2018a) and IWSLT 2014 De-En (Cettolo et al., 2014) datasets, respectively. The plots show a fast singular value decay phenomenon, i.e., there is a huge drop between the first and remaining singular values. Such a phenomenon has also been observed in some previous work (Gao et al., 2019b; Wang et al., 2019a).
|
| 62 |
+
|
| 63 |
+
Figure 1(a) and 1(c) present the distributions of the projected word embeddings of the aforementioned two models. We can see from the plots that the projected word embeddings are distributed into some narrow cone shapes, which implies an anisotropic property of the learned word representations, i.e., the embedding vectors are not uniformly distributed in the space. The detailed analysis in Ethayarajh (2019) also confirms that contextualized word embeddings learnt from ELMo (Peters et al., 2018) (LSTM-based model), BERT and GPT-2 (Devlin et al., 2019; Radford et al., 2019) (Transformer-based models) indeed tend to be anisotropic.
|
| 64 |
+
|
| 65 |
+
These contextualized word embeddings have shown great success on many NLP tasks. However, static word embeddings, such as Word2Vec (Mikolov et al., 2013) and GloVe (Pennington et al., 2014) have been shown (Arora et al., 2016b; Mu & Viswanath, 2018) to be isotropic with great expressive power. Hence it may be also beneficial to increase the expressive power of the contextualized word embedding by increasing its isotropy. This motivates us to alleviate the fast singular value decay phenomenon to increase the isotropy of the learned word representations.
|
| 66 |
+
|
| 67 |
+
# 4 PROPOSED METHOD
|
| 68 |
+
|
| 69 |
+
To alleviate the fast singular value decay phenomenon, we propose to guide the singular value distribution of the contextualized word embedding throughout the training. As a result, we can achieve a trade-off between modeling contextual information, that tends to make word representations anisotropic, and the expressive power of word representations, that tends to be isotropic.
|
| 70 |
+
|
| 71 |
+
# 4.1 SVD REPARAMETERIZATION
|
| 72 |
+
|
| 73 |
+
Following the previous work (Jiang et al., 2019), we propose to apply singular value decomposition (SVD) based reparameterization to the embedding matrix W, i.e., $\mathbf { W } \mathbf { \bar { \Phi } } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { \top }$ , where ${ \textbf { U } } \in$ $\mathbb { R } ^ { N \times d } , \mathbf { V } \in \mathbb { R } ^ { { \hat { d } } \times d }$ are column orthonormal matrices, and $\pmb { \Sigma } \in \mathbb { R } ^ { d \times d }$ is a diagonal matrix with $\Sigma _ { k k } = \sigma _ { k }$ being the $k$ -th largest singular value of $\mathbf { W }$ . Note that SVD reparameterization is standard and has been widely used in the literature such as model compression (Chen et al., 2018), training DNNs (Zhang et al., 2018), and analyzing word embeddings (Arora et al., 2016c). Given the SVD reparameterization, we can control the singular values of the embedding matrix $\mathbf { W }$ by constraining the matrix $\mathbf { E }$ , and the conditional distribution in (3.2) can be rewritten as follows:
|
| 74 |
+
|
| 75 |
+
where $\mathcal { P }$ is a feasible set to represent the singular value distribution of the embedding matrix $\mathbf { W }$ .
|
| 76 |
+
|
| 77 |
+
To ensure the orthogonal constraints in (4.1), we propose to use the orthogonal regularization for $\mathbf { U } , \mathbf { V }$ during the training process, which has been previously used in (Jiang et al., 2019). In particular, we use the following regularization, which is a linear combination of Frobenius norm and spectral norm errors: $\lambda _ { 1 } \| \mathbf { U } ^ { \mathsf { T } } \mathbf { U } ^ { - } - \mathbf { I } \| _ { F } ^ { 2 } + \lambda _ { 2 } \| \mathbf { V } ^ { \mathsf { T } } \mathbf { V } - \mathbf { I } \| _ { F } ^ { 2 } + \lambda _ { 3 } \| \mathbf { U } ^ { \mathsf { T } } \mathbf { U } - \mathbf { I } \| _ { 2 } ^ { 2 } + \lambda _ { 4 } \| \mathbf { V } ^ { \mathsf { T } } \mathbf { V } - \mathbf { I } \| _ { 2 } ^ { 2 }$ , where $\{ \lambda _ { i } \} _ { i = 1 } ^ { 4 }$ are positive regularization parameters.
|
| 78 |
+
|
| 79 |
+
# 4.2 SPECTRUM CONTROL
|
| 80 |
+
|
| 81 |
+
Recall the SVD of $\mathbf { W } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { \top }$ , and we consider the following two types of the singular value distribution for $\pmb { \Sigma }$ , which is inspired by the eigenvalue distribution of kernel methods (Wei et al., 2017; Pacchiano et al., 2019):
|
| 82 |
+
|
| 83 |
+
• Exponential decay: we say the singular values $\{ \sigma _ { k } \} _ { k = 1 } ^ { d }$ of $\mathbf { W }$ satisfy the exponential decay if $\mathbf { W } \in \mathcal { P } _ { e } ( \gamma ) = \{ \mathbf { W } \in \mathbb { R } ^ { N \times d } \mid \sigma _ { k } \leq c _ { 1 } \exp ( - c _ { 2 } \bar { k } ^ { \gamma } ) , k = 1 , \ldots , d , \gamma > 0 , c _ { 1 } , c _ { 2 } > 0 \} \mid \mathbf { W } \in \mathbb { R } ^ { N \times d } .$ 0 are universal constants}.
|
| 84 |
+
|
| 85 |
+
• Polynomial decay: we say the singular values $\{ \sigma _ { k } \} _ { k = 1 } ^ { d }$ of $\mathbf { W }$ satisfy the polynomial decay if $\mathbf { W } \in \mathcal { P } _ { p } ( \gamma ) = \left\{ \mathbf { W } \in \mathbb { R } ^ { N \times d } \mid \sigma _ { k } \leq c _ { 1 } k ^ { - \gamma } , k = 1 , \ldots , d , \gamma > 0 , c _ { 1 } > 0 \right\}$ is a universal constant $\}$ .
|
| 86 |
+
|
| 87 |
+
For $\mathcal { P } _ { e } ( \gamma )$ and $\mathcal { P } _ { p } ( \gamma )$ , the parameter $\gamma$ controls the rate of singular value decay: the larger $\gamma$ is, the faster singular value decay will be. To ensure the learned word embedding matrix W have the desired singular value distributions, we propose to add the following regularizations to our training objective: $\begin{array} { r } { \mathcal { R } _ { e } ( \Sigma ) = \lambda _ { e } \sum _ { k = 1 } ^ { d } \left( \sigma _ { k } - c _ { 1 } \exp ( - c _ { 2 } k ^ { \gamma } ) \right) ^ { 2 } } \end{array}$ for exponential decay and $\begin{array} { r } { \mathcal { R } _ { p } ( \Sigma ) = \lambda _ { p } \sum _ { k = 1 } ^ { d } \left( \sigma _ { k } - c _ { 1 } k ^ { - \gamma } \right) ^ { 2 } } \end{array}$ for polynomial decay, where $\lambda _ { e } , \lambda _ { p }$ are positive regularization parameters. Although the concept of “spectrum control” was previously used in Jiang et al. (2019) to improve the training of GANs, our spectrum control method is trying to solve a totally different problem, i.e., neural language generation, and its motivation is coming from a very different perspective, i.e., the representation degeneration of the word representations. In addition, our method of controlling the singular value with prior distributions is significantly different from the penalty function used in their method. Finally, our method is essential to improve the performance of the neural language generation, while the penalty function proposed in Jiang et al. (2019) can deteriorate the training of neural language models, as we illustrated in Appendix B.
|
| 88 |
+
|
| 89 |
+
# 4.3 THEORETICAL ANALYSIS
|
| 90 |
+
|
| 91 |
+
In this subsection, we show some theoretical insights on why our proposed method can improve the performance of the NLG model. In particular, we follow the similar setup as considered in (Gao et al., 2019b), i.e., focusing on the optimization of the embedding matrix $\mathbf { W } \in \mathbb { R } ^ { N \times d }$ and assume all the other parameters are fixed and well-optimized. In practice, we use our method to train the models from scratch. Therefore, according to the output layer in (3.2), we consider the following empirical risk minimization problem: given a training dataset $S = \{ ( \mathbf { h } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ with each example drawn i.i.d. from some unknown but fixed distribution $\mathcal { D }$ , and $\mathbf { h } _ { i } \in \mathbb { R } ^ { d }$ as a hidden state, $y _ { i } \in \{ 1 , \ldots , N \}$ as its associated label, our goal is to minimize the training loss as follows:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\operatorname* { m i n } _ { \mathbf { W } \in \mathbb { R } ^ { N \times d } } L _ { S } ( \mathbf { W } ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \ell \bigl ( \mathbf { h } _ { i } ^ { \top } \mathbf { W } , y _ { i } \bigr ) ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $\ell \big ( \mathbf { h } _ { i } ^ { \top } \mathbf { W } , y _ { i } \big )$ is the cross-entropy loss with respect to $\mathbf { h } _ { i } ^ { \top } \mathbf { W }$ and $y _ { i }$ . The cross-entropy loss defined above is widely used to train NLG models, and is also used to compute the perplexity of the trained model, which is the benchmark criterion to evaluate the performance of language models.
|
| 98 |
+
|
| 99 |
+
In addition, we define the expected loss as follows $L _ { \mathcal { D } } ( \mathbf { W } ) = \mathbb { E } [ \ell \left( \mathbf { h } ^ { \top } \mathbf { W } , y \right) ]$ , where the expectation is taken over the distribution $\mathcal { D }$ of the training data.
|
| 100 |
+
|
| 101 |
+
Let $\begin{array} { r } { \widehat { \mathbf { W } } = \arg \operatorname* { m i n } _ { \mathbf { W } \in \mathcal { P } ( \gamma ) } L _ { S } ( \mathbf { W } ) , } \end{array}$ , where $\mathcal { P } ( \gamma ) = \mathcal { P } _ { e } ( \gamma )$ for exponential decay and $\mathcal { P } ( \gamma ) = \mathcal { P } _ { p } ( \gamma )$ for polynomial decay. We assume the right singular vector matrix satisfies $\| \mathbf { V } \| _ { 1 } ~ \leq ~ V$ for all $\mathbf { W } \in \mathcal { P } ( \gamma )$ . Now, we are ready to provide the main theory of our method (The proof can be found in Appendix A).
|
| 102 |
+
|
| 103 |
+
Theorem 4.1. Under previously stated conditions, suppose that $| \ell ( \cdot ) | \leq B$ , $\ell$ is $G$ -Lipschitz continuous, and $\| \mathbf { h } _ { i } \| _ { \infty } \leq H$ for all $i = 1 , \ldots , n$ . If we choose $\gamma > 1 / 2$ , then with probability at least $1 - \delta$ , we have
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
L _ { \mathcal { D } } ( \widehat { \mathbf { W } } ) \leq \operatorname* { m i n } _ { \mathbf { W } \in \mathcal { P } ( \gamma ) } L _ { S } ( \mathbf { W } ) + \frac { C _ { 1 } A N \Big ( \sqrt { \sum _ { j = 1 } ^ { m - 1 } \sigma _ { j } ^ { 2 } } + \sqrt { m ^ { 1 - 2 \gamma } / ( 2 \gamma - 1 ) } \Big ) + C _ { 2 } B \sqrt { \log ( 1 / \delta ) } } { \sqrt { n } } ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $C _ { 1 } , C _ { 2 }$ are absolute constants, $m \in [ 2 , d ]$ , $A = G V H { \sqrt { \log d } }$ .
|
| 110 |
+
|
| 111 |
+
Remark 4.2. According to Theorem 4.1, the expected loss of the learned embedding matrix $\widehat { \bf W }$ consists of two terms. The first term represents the training loss, the second term is the generalization error gap. Specifically, the smaller the $\gamma$ , the larger the feasible set $\mathcal { P } ( \gamma )$ , thus the smaller the training loss $\mathrm { m i n } _ { \mathbf { W } \in \mathcal { P ( \gamma ) } } L _ { S } ( \mathbf { W } )$ . On the other hand, the larger the $\gamma$ , the faster the singular value decays, and the smaller the generalization error gap. Therefore, our generalization error bound demonstrates an appealing property of our proposed method: by directly controlling the singular value distribution of the learned word embedding, we are able to achieve a trade-off between the training loss and generalization error.
|
| 112 |
+
|
| 113 |
+
Remark 4.3. For the generalization error bound in (4.3), penalizing the largest singular value could reduce this upper bound. It validates the method proposed in Gao et al. (2019b), which implicitly penalizes the largest singular value (c.f. Section 5 in Gao et al. (2019b)). Compared with their method, the error term $\tilde { \cal O } ( N \sqrt { m ^ { 1 - 2 \gamma } / ( 2 \gamma - 1 ) } / \sqrt { n } )$ suggests that by explicitly manipulating the singular value distribution, our method has a better control of the tail sum of the singular values.
|
| 114 |
+
|
| 115 |
+
# 5 EXPERIMENTS
|
| 116 |
+
|
| 117 |
+
We demonstrate the effectiveness of our proposed spectrum control algorithm on two tasks: language modeling and machine translation. We compare our results with the state-of-the-art models. In our experiments, we try both exponential and polynomial singular value decays, and present the one with the better result. The performances of exponential decay and polynomial decay are very close (See Appendix D). In practice we found that for large scale dataset its better to use polynomial decay and for small scale dataset its better to use exponential decay. We also present the training time and memory cost of our method in Appendix C.
|
| 118 |
+
|
| 119 |
+
# 5.1 LANGUAGE MODELING
|
| 120 |
+
|
| 121 |
+
Datasets We consider two benchmark datasets for language modeling: WikiText-2 and WikiText103, which consist of pre-processed Wikipedia articles and were introduced by Merity et al. (2018a). WikiText-2 is a small dataset with around 2 million words and 30K vocabulary size, while WikiText103 is a significantly large dataset with around 103 million words and 260K vocabulary size.
|
| 122 |
+
|
| 123 |
+
Model Configuration On the small WikiText-2 dataset, we implement our method based on the state-of-the-art AWD-LSTM model (Merity et al., 2018a). It is a 3-layer LSTM model with 1150 dimensional hidden states and 400 dimensional embeddings. We also follow the same regularization and optimization procedures introduced in (Merity et al., 2018a). The implementation of our method is based on the open-source code3 for AWD-LSTM. On the large WikiText-103 dataset, we implement our method based on the state-of-the-art Transformer-XL based models (Dai et al., 2019). We follow the same settings reported in (Dai et al., 2019), and our implementation is based on the official code4 for Transformer-XL. To evaluate the performance of our method more thoroughly, we consider two Transformer-XL models with different number of layers. The first is the standard Transformer-XL model with 16 layers used in (Dai et al., 2019). For the second, we consider a smaller Transformer-XL model with just 4 layers and other configurations unchanged.
|
| 124 |
+
|
| 125 |
+
Parameters For the parameters $\{ \lambda _ { i } \} _ { i = 1 } ^ { 4 }$ of the orthogonal regularizations, we tune them by grid search over $\{ 0 . 0 1 , 0 . 1 , 1 , 1 0 \}$ . For the parameters $\lambda _ { e } , \lambda _ { p }$ of the spectrum control, we tune them over the grid $\{ 0 . 1 , 1 , 1 0 , 1 0 0 \}$ . We try different singular value distributions, and the best distributions for AWD-LSTM and Transformer-XL are exponential and polynomial, respectively.
|
| 126 |
+
|
| 127 |
+
Results of the LSTM Model on WikiText-2 We first present the results of language modeling on the small dataset WikiText-2 using LSTM models. In Table 1 we compare the validation/test perplexity5 of the baseline AWD-LSTM model (Merity et al., 2018a), the cosine similarity regularization (MLE-CosReg) model (Gao et al., 2019b), and the models trained using our method under three different settings (Merity et al., 2018a): without finetune, with finetune and with further continuous cache pointer. Compared with the baselines, our method achieves $2 . 3 / 2 . 9 / 2 . 3$ test perplexity reduction under all three settings; compared with the MLE-CosReg method, our method achieves $1 . 5 / 1 . 2 / 0 . 3$ test perplexity reduction under all three settings.
|
| 128 |
+
|
| 129 |
+
Results of the Transformer-XL Model on WikiText-103 We next show the results of language modeling on the large dataset WikiText-103 using Transformer-XL models. Table 2 compares the validation/test perplexity of Transformer-XL based models (Dai et al., 2019) and the models trained by our method on WikiText-103 dataset. The results demonstrate that our method consistently improves upon the small Transformer-XL model (0.9 test perplexity reduction) and the standard Transformer-XL model (0.8 test perplexity reduction).
|
| 130 |
+
|
| 131 |
+
Table 1: Comparison of different methods in terms of perplexity on WikiText-2 dataset for the task of language modeling.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Method</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td colspan="4">Existing results</td></tr><tr><td>Variational LSTM (Inan et al., 2017)</td><td>51M</td><td>91.5</td><td>87.0</td></tr><tr><td>2-layer skip connection LSTM (Mandt et al.,2017)</td><td>24M</td><td>69.1</td><td>65.9</td></tr><tr><td colspan="4">w/o finetune</td></tr><tr><td>AWD-LSTM(Merity et al.,2018a)</td><td>33M</td><td>69.1</td><td>66.0</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>68.2</td><td>65.2</td></tr><tr><td>Ours</td><td>33M</td><td>66.3</td><td>63.7</td></tr><tr><td colspan="4">+ finetune</td></tr><tr><td>AWD-LSTM (Merity et al.,2018a)</td><td>33M</td><td>68.6</td><td>65.8</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>67.1</td><td>64.1</td></tr><tr><td>Ours</td><td>33M</td><td>65.3</td><td>62.9</td></tr><tr><td colspan="4">+ continuous cache pointer</td></tr><tr><td>AWD-LSTM (Merity et al., 2018a)</td><td>33M</td><td>53.8</td><td>52.0</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>51.7</td><td>50.0</td></tr><tr><td>Ours</td><td>33M</td><td>51.1</td><td>49.7</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 2: Comparison of different methods in terms of perplexity on WikiText-103 dataset for the task of language modeling.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Method</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td colspan="4">Existing results</td></tr><tr><td>4 layer QRNN (Merity et al.,2018b) Hebbian + Cache (Rae et al.,2018)</td><td>151M 1</td><td>32.0 29.7</td><td>33.0 29.9</td></tr><tr><td>Small Transformer-XL (Dai et al., 2019) Ours</td><td>120M 120M</td><td>29.6 29.0</td><td>30.4 29.5</td></tr><tr><td>Standard Transformer-XL (Dai et al.,2019) Ours</td><td>151M 151M</td><td>23.1 22.9</td><td>24.0 23.2</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Analysis We study the output embedding matrix of Transformer-XL trained on WikiText-103 using our method. In particular, we want to evaluate the isotropy of the learned word representations. We consider the partition function $\begin{array} { r } { Z ( \mathbf { a } ) \ = \ \sum _ { i = 1 } ^ { N } \exp ( \left. \mathbf { w } _ { i } , \mathbf { a } \right. ) } \end{array}$ introduced in (Arora et al., 2016b), where $\mathbf { w } _ { i }$ is the $i$ -th row of the embedding matrix $\mathbf { W } \in \mathbb { R } ^ { N \times d }$ and $\mathbf { a } ~ \in ~ S ^ { d - 1 }$ is a unit vector. According to Lemma 2.1 in (Arora et al., 2016b), if the word representation vectors are isotropic, $Z ( \mathbf { a } )$ is close to some constant with high probability for all unit vectors. Thus to empirically measure the isotropy of the learned word representations, we consider two criteria based on $Z ( \mathbf { a } )$ :
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
I _ { 1 } ( \mathbf { W } ) = \frac { \operatorname* { m i n } _ { \mathbf { a } \in \mathcal { E } } Z ( \mathbf { a } ) } { \operatorname* { m a x } _ { \mathbf { a } \in \mathcal { E } } Z ( \mathbf { a } ) } \quad \mathrm { a n d } \quad I _ { 2 } ( \mathbf { W } ) = \sqrt { \frac { \sum _ { \mathbf { a } \in \mathcal { E } } ( Z ( \mathbf { a } ) - \bar { Z } ( \mathbf { a } ) ) ^ { 2 } } { | \mathcal { E } | \bar { Z } ( \mathbf { a } ) ^ { 2 } } } ,
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $\mathcal { E }$ is the set of eigenvectors of $\mathbf { W } ^ { \top } \mathbf { W }$ , as suggested by Mu & Viswanath (2018). We also propose to check sampled standard deviation measure $I _ { 2 } ( \mathbf { W } )$ (normalized by its average, i.e., $\bar { Z } ( \mathbf { a } ) \mathrm { . }$ ). We have $I _ { 1 } ( \mathbf { W } ) \in [ 0 , 1 ]$ and $I _ { 2 } ( \mathbf { W } ) \geq 0$ . Larger $I _ { 1 } ( \mathbf { W } )$ and smaller $I _ { 2 } ( \mathbf { W } )$ indicate more isotropic for word embeddings. We uniformly sample 40K words from the vocabulary (around 260K) of WikiText-103 to compute these two criteria. The left half of Table 3 summarizes the values of $I _ { 1 } ( \mathbf { W } )$ and $I _ { 2 } ( \mathbf { W } )$ , which are averaged over 10 runs, for the baseline method and our method. We can see from the results that our method significantly improves the isotropy of the learned word representations in terms of both criteria.
|
| 146 |
+
|
| 147 |
+
# 5.2 MACHINE TRANSLATION
|
| 148 |
+
|
| 149 |
+
We also apply our spectrum control method to machine translation tasks. Given a source sentence s, the decoder of an neural machine translation (NMT) model is to predict the next word in the target sentence t and the previous decoded words in t. In the following we use the state-of-the-art Transformer-based NMT model as our baseline.
|
| 150 |
+
|
| 151 |
+
Table 3: Comparison of different methods in terms of isotropy for the tasks of language modeling and machine translation. (For perfect isotropy, $I _ { 1 } ( { \bf W } ) = 1 , \bar { I _ { 2 } } ( { \bf W } ) = 0 .$ )
|
| 152 |
+
|
| 153 |
+
<table><tr><td colspan="3">Language Modeling</td><td colspan="3">Machine Translation</td></tr><tr><td>Method</td><td>1(W)</td><td>12(W)</td><td>Method</td><td>I1(W)</td><td>12(W)</td></tr><tr><td>Standard Transformer-XL</td><td>0.24</td><td>0.037</td><td>Transformer-Base</td><td>0.31</td><td>0.031</td></tr><tr><td>Ours</td><td>0.63</td><td>0.022</td><td>Ours</td><td>0.88</td><td>0.005</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 4: Comparison of different methods in terms of BLEU scores on the task of $\mathrm { D e } { } \mathrm { E n }$ machine translation, trained on IWSLT 2014 dataset.
|
| 156 |
+
|
| 157 |
+
<table><tr><td rowspan="2">IWSLT2014De-→En</td><td colspan="4">Method</td></tr><tr><td>Adversarial (Wang et al., 2019a)</td><td>Dual-learning (Wang et al., 2019b)</td><td>Transformer-Base (Wang et al., 2019b)</td><td>Ours</td></tr><tr><td>BLEU 1</td><td>35.18</td><td>35.44</td><td>34.01</td><td>35.50</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Datasets We compare various NMT models on the IWSLT 2014 German English (De-En) and WMT 14 English German $\left( E n – D e \right)$ datasets. For IWSLT 2014 De-En, we follow the same setup as in (Gehring et al., 2017). More specifically, we have 160K sentence pairs as the training data, 7K sentence pairs as the validation data, and we combine tst2010, tst2011, tst2012, dev2010 and dev2012 datasets to form our test data. For the large scale WMT 14 En-De, we have 4.5 million sentence pairs as our training data, and we use newstest2014 as our test data dataset (Cettolo et al., 2014).
|
| 160 |
+
|
| 161 |
+
Model Configuration We implement our method on top of Transformer model (Vaswani et al., 2017). In particular, we consider the Transformer-Base architecture (Vaswani et al., 2017) for IWSLT 2014 De-En, which has a 6-layer encoder and 6-layer decoder with 512 dimensional hidden states and embeddings, except that we choose the dimension of the inner feed-forward layer as 1024 instead of 2048 and the number of attention heads is set to be 4 rather than 8. For WMT 14 En-De, we consider the original Transformer-Base and Transformer-Big architectures (Vaswani et al., 2017), which have a 6-layer encoder and 6-layer decoder with 512 and 1024 dimensional embeddings, respectively. Our implementation is based on the open-sourced code6 provided by Ott et al. (2018). We follow the same procedures as in the language modeling task to choose the regularization parameters. The best results for this task on IWSLT 2014 De-En are from the models where the singular values are controlled by exponential distribution, and the best results for this task on WMT 14 En-De are from the models where the singular values are controlled by polynomial distribution.
|
| 162 |
+
|
| 163 |
+
Results Comparisons of different methods in terms of BLEU scores for IWSLT 2014 De-En are summarized in Table 4. Compared with the baseline models, our method improves the BLEU score7 from 34.01 to 35.50 on the German English task, close to 1.5 gain on BLEU score; our method is also better than 35.18 reported in (Wang et al., 2019a), and 35.44 reported in (Wang et al., 2019b). Table 5 summarizes different methods in terms of BLEU scores for WMT 14 En-De. The results show that our method achieves 1.15 and 0.92 BLEU score improvements on this task for base and big models, respectively. In addition, our method is also better than 28.38 and 28.94 reported in Gao et al. (2019b) for base and big models.
|
| 164 |
+
|
| 165 |
+
Analysis We also study the learned word embedding matrix of the Transformer trained on IWSLT 2014 De-En using our method in terms of isotropy. The values of $I _ { 1 } ( \mathbf { W } )$ and $I _ { 2 } ( \mathbf { W } )$ are reported in the right half of Table 3, we compute these two values based on all the tokens. It shows that the isotropy of the learned word representations using our method increases significantly in terms of these criteria, from very anisotropic to nearly isotropic. We also demonstrate the projected word embedding matrices and the singular value distributions of different methods in Figure 3. The plots show that the learned word representations from our method are distributed isotropically in the space, which is in contrast to the narrow cone distribution from the baseline method.
|
| 166 |
+
|
| 167 |
+
Table 5: Comparison of different methods in terms of BLEU scores on the task of $\mathrm { E n \to }$ De machine translation, trained on WMT 2014 dataset.
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Method</td><td>BLEU</td></tr><tr><td>Transformer-Base(Vaswani etal.,2017)</td><td>27.30</td></tr><tr><td>Transformer-Base (Gao et al.,2019b) Transformer-Base+ Ours</td><td>28.38</td></tr><tr><td></td><td>28.45</td></tr><tr><td>Transformer-Big (Vaswani et al., 2017)</td><td>28.40</td></tr><tr><td>Transformer-Big (Gao et al.,2019b) Transformer-Big+Ours</td><td>28.94 29.32</td></tr></table>
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 3: (a) Word embedding for the vanilla Transformer, which has a narrow cone distribution; (b) Word embedding for Transformer using spectrum control, which has a uniform distribution; (c) Normalized singular value for different methods, which shows a slow decay of our method.
|
| 173 |
+
|
| 174 |
+
# 6 CONCLUSIONS AND FUTURE WORK
|
| 175 |
+
|
| 176 |
+
In this paper, we tackle the degeneration problem that occurs at the output embeddings in the softmax layer used in neural language generation models. We develop a novel spectrum control method to explicitly guide the spectra training of the output embedding matrix with some slow-decaying singular value prior distributions. Our proposed method is shown to alleviate the degeneration problem and improve isotropy of the learned contextualized word representations. Thorough experimental results demonstrate the advantage of our method over the state-of-the-art neural models for language model and machine translation. Since our work is orthogonal to Wang et al. (2019a), it would be interesting to combine the adversarial softmax training with our spectrum control method, and investigate its performance. For the future work, we would also like to investigate how the frequency-agnostic word representations in (Gong et al., 2018) relate to the single value distribution of the output embedding matrix.
|
| 177 |
+
|
| 178 |
+
# REFERENCES
|
| 179 |
+
|
| 180 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. NeurIPS, 2019.
|
| 181 |
+
Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. A latent variable model approach to pmi-based word embeddings. TACL, 4:385–399, 2016a.
|
| 182 |
+
Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. A latent variable model approach to pmi-based word embeddings. TACL, 4:385–399, 2016b.
|
| 183 |
+
Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. 2016c.
|
| 184 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICML, 2015.
|
| 185 |
+
Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. JMLR, 2002.
|
| 186 |
+
Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. In Proceedings of the Twentieth Conference on Computational Natural Language Learning, 2016.
|
| 187 |
+
|
| 188 |
+
Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, and Marcello Federico. Report on ¨ the 11th iwslt evaluation campaign, iwslt 2014. In SLT, 2014.
|
| 189 |
+
|
| 190 |
+
Patrick Chen, Si Si, Yang Li, Ciprian Chelba, and Cho-Jui Hsieh. Groupreduce: Block-wise lowrank approximation for neural language model shrinking. In Advances in Neural Information Processing Systems, pp. 10988–10998, 2018.
|
| 191 |
+
|
| 192 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. ACL, 2019.
|
| 193 |
+
|
| 194 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
|
| 195 |
+
|
| 196 |
+
Kawin Ethayarajh. How contextual are contextualized word representations? comparing the geometry of bert, elmo, and gpt-2 embeddings. EMNLP, 2019.
|
| 197 |
+
|
| 198 |
+
Octavian-Eugen Ganea, Sylvain Gelly, Gary Becigneul, and Aliaksei Severyn. Breaking the softmax ´ bottleneck via learnable monotonic pointwise non-linearities. ICML, 2019.
|
| 199 |
+
|
| 200 |
+
Jianfeng Gao, Michel Galley, Lihong Li, et al. Neural approaches to conversational ai. Foundations and Trends $\textsuperscript { \textregistered }$ in Information Retrieval, 13(2-3):127–298, 2019a.
|
| 201 |
+
|
| 202 |
+
Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tieyan Liu. Representation degeneration problem in training natural language generation models. In ICLR, 2019b.
|
| 203 |
+
|
| 204 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In ICML, pp. 1243–1252, 2017.
|
| 205 |
+
|
| 206 |
+
Chengyue Gong, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. Frage: frequency-agnostic word representation. In NIPS, 2018.
|
| 207 |
+
|
| 208 |
+
A. Graves, A. Mohamed, and G. Hinton. Speech recognition with deep recurrent neural networks. In ICASSP, 2013.
|
| 209 |
+
|
| 210 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 211 |
+
|
| 212 |
+
Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. In ICLR, 2017.
|
| 213 |
+
|
| 214 |
+
Haoming Jiang, Zhehui Chen, Minshuo Chen, Feng Liu, Dingding Wang, and Tuo Zhao. On computation and generalization of generative adversarial networks under spectrum control. In ICLR, 2019.
|
| 215 |
+
|
| 216 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
|
| 217 |
+
|
| 218 |
+
Sekitoshi Kanai, Yasuhiro Fujiwara, Yuki Yamanaka, and Shuichi Adachi. Sigsoftmax: Reanalysis of the softmax bottleneck. In NIPS, 2018.
|
| 219 |
+
|
| 220 |
+
Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong, and Richard Socher. Ctrl: A conditional transformer language model for controllable generation. arXiv:1909.05858, 2019.
|
| 221 |
+
|
| 222 |
+
Percy Liang. Cs229t/stat231: Statistical learning theory (winter 2016), 2014.
|
| 223 |
+
|
| 224 |
+
Stephan Mandt, Matthew D Hoffman, and David M Blei. Stochastic gradient descent as approximate bayesian inference. JMLR, 2017.
|
| 225 |
+
|
| 226 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing LSTM language models. In ICLR, 2018a.
|
| 227 |
+
|
| 228 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. An analysis of neural language modeling at multiple scales. arXiv preprint arXiv:1803.08240, 2018b.
|
| 229 |
+
|
| 230 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013.
|
| 231 |
+
|
| 232 |
+
Jiaqi Mu and Pramod Viswanath. All-but-the-top: Simple and effective postprocessing for word representations. In ICLR, 2018.
|
| 233 |
+
|
| 234 |
+
Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation, 2018.
|
| 235 |
+
|
| 236 |
+
Aldo Pacchiano, Niladri S Chatterji, and Peter L Bartlett. Online learning with kernel losses. ICML, 2019.
|
| 237 |
+
|
| 238 |
+
Nikolaos Pappas and James Henderson. Deep residual output layers for neural language generation. In ICML, 2019.
|
| 239 |
+
|
| 240 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
|
| 241 |
+
|
| 242 |
+
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In NAACL, 2018.
|
| 243 |
+
|
| 244 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In EACL, 2017.
|
| 245 |
+
|
| 246 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
|
| 247 |
+
|
| 248 |
+
Jack Rae, Chris Dyer, Peter Dayan, and Timothy Lillicrap. Fast parametric learning with activation memorization. In ICML, 2018.
|
| 249 |
+
|
| 250 |
+
Jianheng Tang, Tiancheng Zhao, Chenyan Xiong, Xiaodan Liang, Eric P. Xing, and Zhiting Hu. Target-guided open-domain conversation. In ACL, 2019.
|
| 251 |
+
|
| 252 |
+
Shubham Toshniwal, Anjuli Kannan, Chung-Cheng Chiu, Yonghui Wu, Tara Sainath, and Karen Livescu. A comparison of techniques for language model integration in encoder-decoder speech recognition. In IEEE Workshop on Spoken Language Technology, 2018.
|
| 253 |
+
|
| 254 |
+
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, 2017.
|
| 255 |
+
|
| 256 |
+
Dilin Wang, Chengyue Gong, and Qiang Liu. Improving neural language modeling via adversarial training. In ICML, 2019a.
|
| 257 |
+
|
| 258 |
+
Yiren Wang, Yingce Xia, Tianyu He, Fei Tian, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. Multiagent dual learning. In ICLR, 2019b.
|
| 259 |
+
|
| 260 |
+
Yuting Wei, Fanny Yang, and Martin J Wainwright. Early stopping for kernel boosting algorithms: A general analysis with localized complexities. In NIPS, 2017.
|
| 261 |
+
|
| 262 |
+
Zhilin Yang, Zihang Dai, Ruslan Salakhutdinov, and William W. Cohen. Breaking the softmax bottleneck: A high-rank RNN language model. In ICLR, 2018.
|
| 263 |
+
|
| 264 |
+
Jiong Zhang, Qi Lei, and Inderjit Dhillon. Stabilizing gradients for deep neural networks via efficient svd parameterization. In International Conference on Machine Learning, pp. 5801–5809, 2018.
|
| 265 |
+
|
| 266 |
+
# APPENDIX
|
| 267 |
+
|
| 268 |
+
# A PROOF OF THEOREM 4.1
|
| 269 |
+
|
| 270 |
+
Preliminaries We briefly review the general statistical learning framework. More specifically, let $\mathcal { X }$ and $\mathcal { V }$ be the feature and label spaces, and suppose $\mathcal { D }$ is an unknown distribution over $\mathcal { X } \times \mathcal { V }$ . Let $\mathcal { F } \subseteq \mathcal { V } ^ { \mathcal { X } }$ be the hypothesis class that we use to make prediction, and $\ell : \mathcal { V } \times \mathcal { V } \mathbb { R }$ be the loss function. In addition, we define the function class $\ell _ { \mathcal { F } } = \{ ( \mathbf { x } , y ) \ell ( f ( \mathbf { x } ) , y ) : f \in \mathcal { F } \}$ as the composition of the functions in $\mathcal { F }$ and loss $\ell$ . Therefore, the goal is to minimize the expected risk $L _ { D } = \mathbb { E } _ { ( \mathbf { x } , y ) \sim \mathcal { D } } \ell ( f ( \mathbf { x } ) , y )$ with some function $f \in { \mathcal { F } }$ .
|
| 271 |
+
|
| 272 |
+
According to the problem setup in Section 4.3, we have $n$ i.i.d. training examples $S = \{ ( \mathbf { h } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ drawn from $\mathcal { D }$ , where the hidden state $\mathbf { h } _ { i } \in \mathbb { R } ^ { d }$ is the feature vector and $y _ { i }$ is the corresponding label. Suppose there exist a learning algorithm that maps the training dataset $S$ to a function $f \in { \mathcal { F } }$ , and we want to measure the gap between the empirical risk $L _ { S }$ and and the population risk $L _ { \mathcal { D } }$ , i.e., $| L _ { D } - L _ { S } |$ , where $\textstyle L _ { S } = \sum _ { i = 1 } ^ { n } \ell ( f ( \mathbf { h } _ { i } ) , y _ { i } ) / n$ . This gap is known as the generalization error.
|
| 273 |
+
|
| 274 |
+
To bound the generalization error, we use the Rademacher complexity (Bartlett & Mendelson, 2002). Let $\mathcal { F } \subseteq \mathbb { R } ^ { \mathcal { Z } }$ be a function class and $S = \{ \mathbf { z } _ { 1 } , \ldots . . . , \mathbf { z } _ { n } \}$ be a set of examples of size $n$ , the empirical Rademacher complexity is defined as
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
{ \widehat { \mathfrak { R } } } _ { S } ( { \mathcal { F } } ) : = { \frac { 1 } { n } } \mathbb { E } _ { \rho } { \biggl [ } \operatorname* { s u p } _ { f \in { \mathcal { F } } } \sum _ { i = 1 } ^ { n } \rho _ { i } f ( \mathbf { x } _ { i } ) { \biggr ] } ,
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
where $\rho _ { 1 } , \ldots , \rho _ { n }$ are i.i.d. Rademacher random variables with $\mathbb { P } ( \rho _ { i } = 1 ) = \mathbb { P } ( \rho _ { i } =$ $- 1 ) = 1 / 2$ .
|
| 281 |
+
|
| 282 |
+
According to the loss function $L _ { S }$ defined in (4.2), we are considering $N$ function classes $\{ \mathcal { F } _ { k } \} _ { k = 1 } ^ { N }$ with $\mathcal { F } _ { k } = \{ f : \mathbf { h } \langle \mathbf { w } _ { k } , \mathbf { h } \rangle$ , $\mathbf { w } _ { k } = \mathbf { e } ^ { k \top } \mathbf { W } , \mathbf { W } \in \mathcal { P } ( \gamma ) , \mathbf { h } \in \mathbb { R } ^ { d } \}$ , where $\mathbf { e } ^ { k }$ is a $d$ -dimensional vector with $k$ -th element to be one and others to be zero, and the loss $\ell : \mathbb { R } ^ { N } \to \mathbb { R }$ . We have the following Lemma to bound the generalization error based on the empirical Rademacher complexity, which was proved in Corollary A.11 in Allen-Zhu et al. (2019).
|
| 283 |
+
|
| 284 |
+
Lemma A.1. (Allen-Zhu et al., 2019) If $\mathcal { F } _ { 1 } \ldots , \mathcal { F } _ { N }$ are $_ \mathrm { N }$ classes of functions $\mathbb { R } ^ { d } \to \mathbb { R }$ , the loss function $\ell : \mathbb { R } ^ { N } \to \mathbb { R }$ is $G$ -Lipschitz continuous and $| \ell ( \cdot ) | \leq B$ for any $\mathbf { z } \sim \mathcal { D }$ , then with probability at least $1 - \delta$ , we have
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\begin{array}{c} \operatorname* { s u p } _ { f _ { 1 } \in { \mathcal { F } } _ { 1 } , \ldots , f _ { n } \in { \mathcal { F } } _ { N } } \left| { \mathbb { E } } \left[ \ell \left( f _ { 1 } ( \mathbf { z } ) , \ldots , f _ { N } ( \mathbf { z } ) \right) \right] - { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } \ell ( f ( \mathbf { z } _ { i } ) ) \right| \leq C _ { 1 } G \sum _ { k = 1 } ^ { N } { \widehat { \mathfrak { N } } } _ { S } ( { \mathcal { F } } _ { k } ) \\ { + C _ { 2 } { \frac { B \sqrt { \log ( 1 / \delta ) } } { \sqrt { n } } } , } \end{array}
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
where the expectation is taken over the distribution $\mathcal { D }$ .
|
| 291 |
+
|
| 292 |
+
Equipped with this lemma, we now present the proof of our main result.
|
| 293 |
+
|
| 294 |
+
Proof of Theorem 4.1. According to the problem setup in Section 4, we have $N$ classes of functions $\{ \mathcal { F } _ { k } \} _ { k = 1 } ^ { N }$ and let the singular value decomposition of W as
|
| 295 |
+
|
| 296 |
+
$\mathbf { W } = \mathbf { U } \boldsymbol { \Sigma } \mathbf { V } ^ { \top }$ and $\mathbf { u } _ { k }$ is the $k$ -th row of U. Therefore, we have
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\widehat { \mathfrak { M } } _ { S } ( \mathcal { F } _ { k } ) = \mathbb { E } _ { \rho } \bigg [ \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \rho _ { i } \langle \mathbf { w } _ { k } , \mathbf { h } _ { i } \rangle \bigg ] = \mathbb { E } _ { \rho } \bigg [ \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \frac { 1 } { n } \langle \mathbf { V } \Sigma \mathbf { u } _ { k } ^ { \intercal } , \mathbf { h } _ { \rho } \rangle \bigg ]
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
where $\begin{array} { r } { \mathbf { h } _ { \rho } \ : = \ : \sum _ { i = 1 } ^ { n } \rho _ { i } \mathbf { h } _ { i } } \end{array}$ and the last inequality is due to the definition of $\mathbf { w } _ { k } ~ =$ $\mathbf { V } \pmb { \Sigma } \mathbf { u } _ { k } ^ { \top }$ . Therefore, we have
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { r l } & { \widehat { \mathfrak { N } } _ { S } ( \mathcal { F } _ { k } ) \leq \mathbb { E } _ { \rho } \bigg [ \displaystyle \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \frac { 1 } { n } \| \nabla \Sigma \mathbf { u } _ { k } ^ { \intercal } \| _ { 1 } \| \mathbf { h } _ { \rho } \| _ { \infty } \bigg ] } \\ & { \qquad \leq \frac { V } { n } \mathbb { E } _ { \rho } \bigg [ \displaystyle \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \| \Sigma \mathbf { u } _ { k } ^ { \intercal } \| _ { 1 } \| \mathbf { h } _ { \rho } \| _ { \infty } \bigg ] } \\ & { \qquad \leq \frac { V \sqrt { \sum _ { j = 1 } ^ { d } \sigma _ { j } ^ { 2 } } } { n } \mathbb { E } _ { \rho } \bigg [ \displaystyle \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \| \mathbf { h } _ { \rho } \| _ { \infty } \bigg ] , } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
where the second inequality is due to $\| \mathbf { V } \| _ { 1 } \leq V$ and the last one comes from $\begin{array} { r } { \| \Sigma \mathbf { u } _ { k } ^ { \top } \| _ { 1 } = \sum _ { j = 1 } ^ { d } \sigma _ { j } | u _ { k j } | \leq \sqrt { \sum _ { j = 1 } ^ { d } \sigma _ { j } ^ { 2 } } } \end{array}$ . In addition, according to Theorem 12 in Liang (2014) , we have
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\mathbb { E } _ { \rho } \big [ \| \mathbf { h } _ { \rho } \| _ { \infty } \big ] \leq H \sqrt { 2 n \log d } ,
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
Therefore, we can get
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
{ \widehat { \mathfrak { R } } } _ { S } ( { \mathcal { F } } _ { k } ) \leq V H { \frac { { \sqrt { \sum _ { i = 1 } ^ { m } \sigma _ { i } ^ { 2 } } } + { \sqrt { \sum _ { i > m } \sigma _ { i } ^ { 2 } } } } { \sqrt { \mathfrak { n } } } } { \sqrt { 2 \log d } } .
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
As a result, we can get
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\sum _ { k = 1 } ^ { N } \widehat { \mathfrak { R } } _ { S } ( \mathcal { F } _ { k } ) \leq N V H \frac { \sqrt { \sum _ { i = 1 } ^ { m } \sigma _ { i } ^ { 2 } } + \sqrt { \sum _ { i > m } \sigma _ { i } ^ { 2 } } } { \sqrt { n } } \sqrt { 2 \log d } .
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
Since for $\mathcal { P } ( \gamma ) ~ = ~ \mathcal { P } _ { e } ( \gamma )$ , we have $\sigma _ { j } ~ \le ~ c _ { 1 } \exp ( - c _ { 2 } j ^ { \gamma } ) ~ \le ~ c _ { 1 } / ( c _ { 2 } j ^ { \gamma } )$ , and for $\mathcal { P } ( \gamma ) = \mathcal { P } _ { p } ( \gamma )$ , we have $\sigma _ { j } \leq c _ { 3 } j ^ { - \gamma }$ . Thus for $\gamma > 1 / 2$ , we have
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\sum _ { j > m } \sigma _ { j } ^ { 2 } \leq \sum _ { j > m } \frac { c _ { 4 } } { j ^ { 2 \gamma } } \leq c _ { 4 } \int _ { m + 1 } ^ { \infty } x ^ { - 2 \gamma } d x \leq \frac { c _ { 4 } } { ( 2 \gamma - 1 ) } ( m + 1 ) ^ { 1 - 2 \gamma } ,
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
where $c _ { 4 } = ( c _ { 1 } / c _ { 2 } ) ^ { 2 }$ if $\mathcal { P } ( \gamma ) = \mathcal { P } _ { e } ( \gamma )$ and $c _ { 4 } = c _ { 3 } ^ { 2 }$ if $\mathcal { P } ( \gamma ) = \mathcal { P } _ { p } ( \gamma )$
|
| 333 |
+
|
| 334 |
+
Therefore, plugging this upper bound into (A.3), we have
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\sum _ { \ k = 1 } ^ { N } \widehat { \mathfrak { R } } _ { S } ( \mathcal { F } _ { k } ) \leq \frac { N V H \sqrt { 2 \log d } \sqrt { \sum _ { j = 1 } ^ { m } \sigma _ { j } ^ { 2 } } } { \sqrt { n } } + c _ { 5 } \frac { N V H \sqrt { 2 \log d } \sqrt { m ^ { 1 - 2 \gamma } / ( 2 \gamma - 1 ) } } { \sqrt { n } } .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Where $c _ { 5 } = c 1 / c 5$ if $\mathcal { P } ( \gamma ) = \mathcal { P } _ { e } ( \gamma )$ and $c _ { 5 } = c _ { 3 }$ if $\mathcal { P } ( \gamma ) = \mathcal { P } _ { p } ( \gamma )$ .
|
| 341 |
+
|
| 342 |
+
According to Lemma A.1, since $\ell$ is $G$ -Lipschitz continuous and $| \ell ( \cdot ) | \leq B$ , we have
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\begin{array} { r l } & { \underset { \mathbf { W } \in \mathcal { P } ( \gamma ) } { \operatorname* { s u p } } \left| L _ { \mathcal { D } } ( \mathbf { W } ) - L _ { S } ( \mathbf { W } ) \right| \leq c _ { 6 } G N V H \sqrt { \log d } \frac { \sqrt { \sum _ { j = 1 } ^ { m } \sigma _ { j } ^ { 2 } } + \sqrt { \frac { m ^ { 1 - 2 \gamma } } { ( 2 \gamma - 1 ) } } } { \sqrt { n } } } \\ & { \qquad + c _ { 7 } B \sqrt { \frac { \log ( 1 / \delta ) } { n } } . } \end{array}
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
Table 6: Comparison of different penalty functions in terms of perplexity on WikiText-2 dataset.
|
| 349 |
+
|
| 350 |
+
<table><tr><td>Method</td><td>Validation</td><td>Test</td></tr><tr><td>AWD-LSTM (Merity et al., 2018a)</td><td>69.1</td><td>66.0</td></tr><tr><td>Spectrum Normalization</td><td>76.3</td><td>72.5</td></tr><tr><td>SN+D-Optimal Regularizer</td><td>98.3</td><td>94.8</td></tr><tr><td>Ours</td><td>66.3</td><td>63.7</td></tr></table>
|
| 351 |
+
|
| 352 |
+
B EXPERIMENTAL RESULTS FOR OTHER PENALTY FUNCTIONS
|
| 353 |
+
|
| 354 |
+
In this section, we also implement our method with the penalty function proposed in Jiang et al. (2019) for training GANs. We consider WikiText-2 dataset, and all the experimental settings are same as before. Table 6 demonstrates the performance of our method using the Spectrum Normalization (SN) and $\mathbf { S N + D }$ -Optimal Regularizer, which can achieve the best performance of training GANs in their paper. The results show that their proposed penalty function can deteriorate the training of neural language models. This is because their method is motivated from training GANs, and will encourage all the singular values close to the largest one. If we use such penalty function to train neural language models, the learned word representations will lose the power of modeling contextual information. Therefore, our proposed spectrum control method is essential to improve the training of neural language generation.
|
| 355 |
+
|
| 356 |
+
# C TRAINING TIME AND MEMORY COST
|
| 357 |
+
|
| 358 |
+
In this section, we compare the training time and memory cost of our method with the baseline method, i.e., AWD-LSTM (Merity et al., 2018a) and standard Trandformer-XL (Dai et al., 2019). More specifically, we test our method and the baseline method on the same machine on WikiText-2 WikiText-103, and WMT 14 datasets. For WikiText-2 dataset, we use one NVIDIA Tesla V100 GPU and set the batch size to be 80. For WikiText-103 dataset, we use four NVIDIA Tesla V100 GPU and set the batch size to be 40. For WMT 14, we use four NVIDIA Tesla V100 GPU and set the max token as 3500. The training time and memory cost for a single GPU are summarized in Table 7. The results illustrate that our method is only $1 . 1 7 \times$ , $1 . 1 8 \times$ , and $1 . 2 4 \times$ slower than the baseline methods on WikiText-2, WikiText-103 and WMT 14 datasets, respectively. In addition, our method will cost $1 . 0 6 \times , 1 . 3 2 \times$ and $1 . 1 1 \times$ memory compared with the baseline methods on WikiText2, WikiText-103, and WMT 14 datasets, respectively.
|
| 359 |
+
|
| 360 |
+
Table 7: Comparisons of our method and baseline method in terms of the average training time per epoch and the memory cost.
|
| 361 |
+
|
| 362 |
+
<table><tr><td>Method</td><td>WikiText-2</td><td>WikiText-103</td><td>WMT14</td></tr><tr><td>Training time</td><td></td><td></td><td></td></tr><tr><td>Baseline</td><td>61 sec</td><td>2681 sec</td><td>5991 sec</td></tr><tr><td>Ours</td><td>70 sec</td><td>3152 sec</td><td>7421 sec</td></tr><tr><td>Memory cost</td><td></td><td></td><td></td></tr><tr><td>Baseline</td><td>8.9 GB</td><td>11.4 GB</td><td>14.2 GB</td></tr><tr><td>Ours</td><td>9.5 GB</td><td>15.0 GB</td><td>15.7 GB</td></tr></table>
|
| 363 |
+
|
| 364 |
+
Table 8: Comparisons of different priors on different datasets.
|
| 365 |
+
|
| 366 |
+
<table><tr><td>Dataset</td><td>Exponential Decay</td><td>Polynomial Decay</td></tr><tr><td>Language Modeling</td><td>Test PPL</td><td>Test PPL</td></tr><tr><td>WikiText-2</td><td>63.7</td><td>64.2</td></tr><tr><td>WikiText-103</td><td>23.4</td><td>23.2</td></tr><tr><td>Machine Translation</td><td>BLEU</td><td>BLEU</td></tr><tr><td>IWSLT2014De-→En</td><td>35.50</td><td>35.40</td></tr><tr><td>WMT14En→De</td><td>28.37</td><td>28.45</td></tr></table>
|
| 367 |
+
|
| 368 |
+
# D COMPARISON OF TWO PRIORS
|
| 369 |
+
|
| 370 |
+
In this section we present the performance of our method on different tasks using different prior distributions. Table 8 suggests that the overall performance of these two prior distributions on different tasks are similar. In addition, the results show that it is better to use polynomial decay for large scale dataset and exponential decay for small scale dataset.
|
md/train/CaCHjsqCBJV/CaCHjsqCBJV.md
ADDED
|
@@ -0,0 +1,488 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIFFERENTIABLE OPTIMIZATION OF GENERALIZED NONDECOMPOSABLE FUNCTIONS USING LINEAR PROGRAMS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a framework which makes it feasible to directly train deep neural networks with respect to popular families of task-specific non-decomposable performance measures such as AUC, multi-class AUC, $F$ -measure and others. A common feature of the optimization model that emerges from these tasks is that it involves solving a Linear Programs (LP) during training where representations learned by upstream layers influence the constraints. The constraint matrix is not only large but the constraints are also modified at each iteration. We show how adopting a set of influential ideas proposed by Mangasarian for 1-norm SVMs – which advocates for solving LPs with a generalized Newton method – provides a simple and effective solution. In particular, this strategy needs little unrolling, which makes it more efficient during backward pass. While a number of specialized algorithms have been proposed for the models that we describe here, our module turns out to be applicable without any specific adjustments or relaxations. We describe each use case, study its properties and demonstrate the efficacy of the approach over alternatives which use surrogate lower bounds and often, specialized optimization schemes. Frequently, we achieve superior computational behavior and performance improvements on common datasets used in the literature.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Commonly used losses such as cross-entropy used in deep neural network (DNN) models can be expressed as a sum over the per-sample losses incurred by the current estimate of the model. This allows the direct use of mature optimization routines, and is sufficient for a majority of use cases. But in various applications ranging from ranking/retrieval systems to class imbalanced learning, the most suitable losses for the task do not admit a “decompose over samples” form. Examples include Area under the ROC curve (AUC), multi-class variants of AUC, $F$ -score, Precision at a fixed recall $( \mathrm { P } @ \mathrm { R } )$ and others. Optimizing such measures in a scalable manner can pose challenges even in the shallow setting. Since the compromise involved in falling back on a decomposable loss when a non-decomposable objective may be more appropriate for the task at hand can range from negligible to concerning depending on the application, the last few years have seen a number of interesting approaches proposed to efficiently deal with such structured and non-decomposable losses. To this end, recent algorithms for AUC maximization have been developed based on convex surrogate losses Liu et al. (2018); Natole et al. (2018) in a linear model or in conjuction with a deep neural network Liu et al. (2019) as well as stochastic and online variations (Ataman et al. (2006); Cortes & Mohri (2004); Gao et al. (2013); Liu et al. (2018; 2019)) are available. Methods for measures other than the AUC have also been studied – exact algorithms for optimizing $F$ -score Nan et al. (2012); Dembczynski et al. (2011), optimizing average precision through direct optimization Song et al. (2016), scalable methods for non-decomposable objectives Eban et al. (2017); Venkatesh et al. (2019) and using a structured hinge-loss upper bound to optimize average precision and NDCG Mohapatra et al. (2018). Recently, the AP-Perf method Fathony & Kolter (2020) showed how custom non-decomposable performance measures can be conveniently incorporated into differentiable pipelines.
|
| 12 |
+
|
| 13 |
+
It is known that a number of these non-decomposable objectives can be expressed in the form of an integer program that can be relaxed to a linear program (LP). Earlier approaches adapted methods for structured SVMs Joachims et al. (2009) or cutting plane techniques Yue et al. (2007) and were interesting but had difficulty scaling to larger datasets. More recently, strategies have instead focused on the stochastic setting where we operate on a mini-batch of samples. A common strategy, which is generally efficient, is to study the combinatorial form of one or more losses of interest and derive surrogate lower bounds. These are then tackled via specialized optimization routines. The arguably more direct alternative of optimizating as a module embedded in a DNN architecture remained difficult until recently – but OptNet Amos & Kolter (2017) and CVXPY now offer support for solving certain objectives as differentiable layers within a network. Further, methods based on implicit differentiation have been applied to various problems, showing impressive performance.
|
| 14 |
+
|
| 15 |
+
Our approach is based on the premise that tackling the LP form of the non-decomposable objective as a module within the DNN, one which permits forward and reverse mode differentiation and can utilize in-built support for specialized GPU hardware in modern libraries such as PyTorch, is desirable. First, as long as a suitable LP formulation for an objective is available, the module may be directly used. Second, based on which scheme is used to solve the LP, one may be able to provide guarantees for the non-decomposable objective based on simple calculations (e.g., number of constraints, primal-dual gap). The current tools, however, do not entirely address all these requirements, as we briefly describe next. A specific characteristic of the LPs that arise from the losses mentioned above is that the constraints are modified at each iteration – as a function of the updates to the representations of the data in the upstream layers. Further, the mini-batch of samples changes at each iteration. Solvers within CVXPY, are effective but due to their general-purpose nature, rely on interior point methods. OptNet is quite efficient but designed for quadratic programs (QP): the theoretical results and its efficiency depends on factorizing a matrix in the quadratic term in the objective (which is zero/noninvertible for LPs). The primal-dual properties and implicit differentiation for QPs do not easily translate to LPs, and efficient ways of dealing with constraints that are iteratively updated are not widely available at this time. In principle, of course, backpropagating through a convex optimization model (and in particular, LPs) is not an unsolved problem. For LPs, we can take derivatives of the optimal value (or the optimal solution) of the model with respect to the LP parameters, and this can be accomplished by calling a powerful external solver. Often, this would involve running the solver on the CPU, which introduces overhead. . The ideas in Meng et al. (2020) are relevant in that the optimization steps for the LP are unrolled and only involve simple linear algebra operations but the formulation is applicable when the number of constraints are about the same as the number of variables – an assumption that does not hold for the models we will study.
|
| 16 |
+
|
| 17 |
+
In $\ S 3$ , we show that the modified Newton’s algorithm in Mangasarian (2004) can be used for deep neural network (DNN) training in an end-to-end manner without requiring an external solvers where support for GPUs remains limited. Specifically, by exploiting self-concordance of the objective, we show that the algorithm can converge globally without line search strategies. On the practical side, we analyze the gradient properties, and some modifications to improve stability during backpropagation. We show that this scheme based on Mangasarian’s parametric exterior penalty formulation of the primal LP can be a computationally effective and scalable strategy to solve LPs with a large number of constraints.
|
| 18 |
+
|
| 19 |
+
# 2 NONDECOMPOSABLE FUNCTIONS AND CORRESPONDING LP MODELS
|
| 20 |
+
|
| 21 |
+
We first present a standard LP form and then reparameterize several generalized nondecomposable objectives in this way, summarized in Table 5 in the appendix. We start with the binary AUC, extend it to multi-class AUC, and then later, show a ratio objective, $F$ -score. Some other objectives are described in the appendix.
|
| 22 |
+
|
| 23 |
+
# 2.1 NOTATIONS AND GENERALIZED LP FORMULATION
|
| 24 |
+
|
| 25 |
+
Notations. We use the following notations:
|
| 26 |
+
|
| 27 |
+
(i) $n$ : number of samples used in training.
|
| 28 |
+
(ii) $\ b { X } \in \mathbb { R } ^ { n \times d }$ : the explanatory features fed to a classifier (e.g., parameterized by w);
|
| 29 |
+
(iii) $f ( x _ { i } )$ (or $f ( i ) )$ ): a score function for the classifier where $x _ { i } \in X$ such that $f ( X ) = \mathbf { w } X$ ;
|
| 30 |
+
(iv) $Y \in \{ 0 , 1 \}$ : target label and $\hat { Y } \in \{ 0 , 1 \}$ : predicted label for binary classification, both in $\mathbb { R } ^ { n }$ ;
|
| 31 |
+
(v) $\phi ( \cdot )$ : non linear function applied on $f ( X )$ ;
|
| 32 |
+
(vi) $A \otimes B$ : Kronecker product of matrices $A$ and $B$ .
|
| 33 |
+
(vii) $I _ { r }$ : Identity matrix of size $r$ and $\mathbb { 1 }$ is the indicator function.
|
| 34 |
+
(viii) $\mathbf { B } _ { k , - }$ (and $\mathbf { B } _ { | , k ^ { \prime } } )$ gives the $k$ -th row (and $k ^ { \prime }$ -th) column of $\mathbf { B }$ .
|
| 35 |
+
|
| 36 |
+
LP formulation. We consider a general linear program (LP) that contains nonnegative variables as well as inequality and equality constraints. The form of the LP is given as
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\operatorname* { m a x } _ { u , v } g ^ { T } u + h ^ { T } v \quad \mathrm { s . t } \quad E u + F v \leq p , \quad B u + G v = q \quad u , v \geq 0
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
We can write it more succinctly as
|
| 43 |
+
|
| 44 |
+
variable ${ \mathrm { } } = [ u ~ v ] ; { \mathrm { ~ c o e f f i c i e n t } } c = [ - g ~ - h ] ; { \mathrm { ~ c o n s t r a i n t s } } A = { \left[ \begin{array} { l l l } { E } & { B } & { - B } \\ { F } & { G } & { - G } \end{array} \right] } ^ { T } ; { \mathrm { ~ c o n s t a n t s } } b = [ p q ~ - q ]$ The corresponding primal LP becomes $\operatorname* { m i n } _ { x } c ^ { T } x$ s.t $A x \leq b$ , $x \geq 0$ .
|
| 45 |
+
|
| 46 |
+
# 2.2 MAXIMIZING AUC
|
| 47 |
+
|
| 48 |
+
The Area under the ROC Curve (AUC) calculates the probability that a classifier $f ( \cdot )$ will rank a randomly chosen positive sample higher than a randomly chosen negative sample. Since AUC varies between 0 and 1, where 1 represents all positives being ranked above the negatives. AUC may be estimated using the Wilcoxon-Mann-Whitney (WMW) Statistic Hanley & McNeil (1982), as
|
| 49 |
+
|
| 50 |
+
Definition 2.1 (AUC). Let $n$ be the number of samples. Let $X _ { + }$ (and $X _ { - }$ resp.) be the set of positive (and negative reAUC is given as $| X _ { + } | + | X _ { - } | = n$ $| \cdot |$ f the set. Then,. $\begin{array} { r } { \Big ( \sum _ { i = 1 } ^ { | X _ { + } | } \sum _ { i = 1 } ^ { | X _ { - } | } \mathbb { 1 } _ { f ( x _ { i } ) > f ( x _ { j } ) } \Big ) / \big ( | X _ { + } | | X _ { - } | \big ) \mathrm { ~ f o r ~ } x _ { i } : i \in \{ 1 , \cdots , n \} . } \end{array}$
|
| 51 |
+
|
| 52 |
+
Here, we follow Ataman et al. (2006) to calculate the AUC based on the WMW statistic as follows.
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\operatorname* { m i n } _ { z _ { i j } } \sum _ { i = 1 } ^ { | X _ { + } | } \sum _ { j = 1 } ^ { | X _ { - } | } z _ { i j } \quad \mathrm { s . t . } \qquad f ( x _ { i } ) - f ( x _ { j } ) \geq \epsilon - z _ { i j } \quad \mathrm { ~ w h e r e ~ } x _ { i } \in X _ { + } , x _ { j } \in X _ { - } ; \quad z _ { i j } \geq 0 ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\epsilon$ is a given constant. The model in (2), maximizes AUC indirectly, by minimizing the number of pairs (one each from the positive and negative classes) where the positive sample is not ranked higher than the negative sample: so, the number of zero entries in $z$ equals the number of pairs where this condition is not true. To compute the AUC, we do:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathbf { A U C } = ( n - \left. z \right. _ { 0 } ) / \left( \left. X _ { + } \right. \left. X _ { - } \right. \right) = \left( n - \sum _ { i } \sum _ { j } \epsilon ^ { - 1 } \mathbf { r e l u } ( 0 , - z _ { i j } + \epsilon ) \right) / \left( \left. X _ { + } \right. \left. X _ { - } \right. \right) .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
If $z _ { i j }$ is $0$ , then $\epsilon ^ { - 1 } \mathrm { r e l u } ( 0 , - z _ { i j } + \epsilon )$ equals 1. Otherwise $z _ { i j } > 0$ , it follows from the first constraint in (2), that $z _ { i j } \geq \epsilon$ , so $\epsilon ^ { - 1 } \mathrm { r e l u } ( 0 , - z _ { i j } + \epsilon )$ equals 0. Observe that in (2), the number of constraints is $| X | | X _ { - } |$ , which is quadratic in $n$ .
|
| 65 |
+
|
| 66 |
+
# 2.3 MAXIMIZING MULTI-CLASS AUC
|
| 67 |
+
|
| 68 |
+
An extension of AUC to the multi-class setting, $\operatorname { A U C } _ { \mu }$ , is defined in Kleiman & Page (2019). The $\operatorname { A U C } _ { \mu }$ objective optimizes an indicator matrix computed on the orientation function, $O _ { i , j }$ defined as,
|
| 69 |
+
|
| 70 |
+
Definition 2.2 (Orientation Function; Kleiman & Page (2019)). Assume we have $K$ classes $\{ y _ { 1 } , \cdots , y _ { K } \}$ . Let $\mathbf { f } ( x _ { i } , - ) \in \mathbb { R } ^ { K }$ indicate the model’s prediction on $x _ { i }$ for each of the $K$ classes (class-specific probability)1. Let $\boldsymbol { x } _ { i } ^ { * }$ provide the index of $x _ { i }$ ’s true class label. Let $\mathbf { P } \in \mathbb { R } ^ { k \times k }$ be a partition matrix where $\mathbf { P } _ { k , k ^ { \prime } }$ is the cost of classifying a sample as class $k$ when it should be $k ^ { \prime }$ . Define $\mathbf { v } _ { k k ^ { \prime } } = \mathbf { P } _ { k , - } - \mathbf { P } _ { k ^ { \prime } , - }$ and $\widetilde { \mathbf { v } } = \mathbf { v } _ { x _ { i } ^ { * } x _ { j } ^ { * } } \in \mathbb { R } ^ { K }$ . Then, $O _ { i , j } = ( \widetilde { \mathbf { v } } _ { x _ { i } ^ { * } } - \widetilde { \mathbf { v } } _ { x _ { j } ^ { * } } ) ( \langle \widetilde { \mathbf { v } } , \mathbf { f } ( x _ { i } , - ) \rangle - \langle \widetilde { \mathbf { v } } , \mathbf { f } ( x _ { j } , - ) \rangle )$
|
| 71 |
+
|
| 72 |
+
Here, $\mathbf { v } _ { k k ^ { \prime } }$ ranks the instances by their cost difference between assignments to class $k$ and $k ^ { \prime }$ . For two classes, say indexed by 1 and 2, $\mathbf { v } _ { 1 , 2 } \cdot \mathbf { f } = 0$ is the decision boundary between the classes. The ranking is correct for $x _ { i }$ and $x _ { j }$ (with correct labels 1 and 2 resp.) if the orientation of the points w.r.t. the decision boundary is the same as those of the class labels (converted to one-hot vectors).
|
| 73 |
+
|
| 74 |
+
Then $\begin{array} { r } { \mathrm { A U C } _ { \mu } = \sum _ { k < k ^ { \prime } } g _ { k , k ^ { \prime } } \sum _ { i \in D _ { k } , j \in D _ { k } ^ { \prime } } \mathbb { 1 } _ { O _ { i , j } \ge 0 } } \end{array}$ , where $D _ { k }$ is the index set of samples having same class label $k$ and $g$ is a constant derived from class sizes. In formulating the linear program, we observe that the model is dictated on how $\mathbf { P }$ is defined. One way is to set $\mathbf { P } ( k , k ) \mathbf { \bar { \Psi } } = \mathbf { \bar { 0 } } \forall k$ and 1 for all other entries. We can also define a $\mathbf { P }$ with arbitary entries or formulate AUC in a one-vs-all setting. Here, we show the model in the first case (the other two cases are discussed in
|
| 75 |
+
|
| 76 |
+
Appendix A.1). Similar to our previous formulation, the goal is to minimize the sum of negative values of the orientation function, rather than maximize the sum of positive values. Let $\widetilde { \mathbf { f } } ( i , j ) =$ $\mathbf { f } ( x _ { i } , x _ { i } ^ { * } ) - \mathbf { f } ( x _ { j } , x _ { i } ^ { * } ) + \mathbf { f } ( x _ { j } , x _ { j } ^ { * } ) - \mathbf { f } ( x _ { i } , x _ { i } ^ { * } ) .$ . Then the LP formulation is.
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\mathbf { A U C } _ { \mu } ^ { \mathrm { b i n } } : \operatorname* { m i n } _ { z _ { i j } } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 : x _ { i } ^ { * } < x _ { j } ^ { * } } ^ { n } z _ { i j } \quad \mathrm { s . t . } \quad \widetilde { \mathbf { d } } _ { i j } \widetilde { \mathbf { f } } ( i , j ) \geq \epsilon - z _ { i j } , \quad \forall i , j : x _ { i } ^ { * } < x _ { j } ^ { * } \qquad z _ { i j } \geq 0
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Here $\widetilde { \mathbf { d } } _ { i j } = \widetilde { \mathbf { v } } _ { { x } _ { i } ^ { * } } - \widetilde { \mathbf { v } } _ { { x } _ { j } ^ { * } }$ . This can be seen as an extension of our binary AUC model, where the $z _ { i j }$ is the ranking between a pair of points defined for multiple classes.
|
| 83 |
+
|
| 84 |
+
# 2.4 MAXIMIZING $F$ -SCORE
|
| 85 |
+
|
| 86 |
+
The $F$ -score (or $F$ -measure) is a representative of objectives expressed as ratios of some combination of True positives (TP), False positives (FP), True negatives (TN) and False negatives (FN). The general form of the ratio functions and formulations for other objectives is in the Appendix A.2. Specifically, $\cdot$ -score is defined as follows:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { F \mathrm { - s c o r e } = \frac { 2 ( \mathrm { P r e c i s i o n } \times \mathrm { R e c a l l } ) } { \mathrm { P r e c i s i o n } + \mathrm { R e c a l l } } = \frac { 2 \mathrm { T P } } { 2 \mathrm { T P } + \mathrm { F P } + \mathrm { F N } } = \frac { 2 ( Y ^ { T } \times \hat { Y } ) } { \mathbf { 1 } ^ { T } Y + \mathbf { 1 } ^ { T } \hat { Y } } } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
The second part of the equality comes from simplying the precision $\frac { T P } { T P + F P } )$ and recall $( \frac { T P } { T P + F N } )$ based formula Dembczynski et al. (2011). The last part is obtained by replacing TP with $( Y ^ { T } \times \hat { Y } )$ , FP with $( 1 - Y ) ^ { T } \times { \hat { Y } }$ and FN with $( Y ) ^ { T } \times ( 1 - \hat { Y } )$ as functions of $Y$ and $\hat { Y }$ . This leads to the following integer fractional optimization model,
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
F \mathrm { - s c o r e } = \operatorname* { m a x } _ { \hat { Y } } \frac { \mathbf { c } ^ { T } \hat { Y } } { 1 ^ { T } \hat { Y } + b } \quad \mathrm { s . t . } \quad \hat { Y _ { i } } \in [ 0 , 1 ] , \ i = 1 , \dots , n \mathrm { ~ w h e r e ~ } c = 2 Y \mathrm { a n d ~ } b = \sum _ { i = 1 } ^ { n } Y _ { i } .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
To solve this, we first relax the constraint on $\hat { Y }$ and reformulate the model as the following LP, by introducing two variables $z \in R ^ { n }$ and $t \in R ^ { 1 }$ where $\begin{array} { r } { z = \frac { b \hat { Y } } { 1 ^ { T } \hat { Y } + b } } \end{array}$ , $\begin{array} { r } { t = \frac { b } { 1 ^ { T } \hat { Y } + b } } \end{array}$ and $i \in \{ 1 , \cdots , n \}$ : ,
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\operatorname* { m a x } _ { z , t } \frac { \mathbf { c } ^ { T } z } { b } \quad \mathrm { s . t } \quad \underbrace { 1 ^ { T } z + b t = b ; } _ { ( a ) } \underbrace { z _ { i } \leq t } _ { ( b ) } ; \underbrace { \phi ( f ( x _ { i } ) ) t \leq z _ { i } \leq ( 1 + \phi ( f ( x _ { i } ) ) ) t } _ { ( c ) } ; 1 \geq z _ { i } , t \geq 0 ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Remark 1. (a) ensures the appropriate relation between $z$ , $t$ and $\hat { Y }$ and is essentially a reformulaton of the ratio objective as a linear function with a fixed denominator. $\hat { Y }$ is recovered from the solution to the linear program by computing $\begin{array} { r } { \hat { Y } _ { i } ~ = ~ \frac { z _ { i } } { t } } \end{array}$ when $t > 0$ and $\hat { Y } _ { i } ~ = ~ z _ { i }$ otherwise. $( b )$ sets an upper bound for $\hat { Y } _ { i } \leq 1 .$ . (c) ties the output of the previous layer $\phi ( f ( x _ { i } ) )$ (a classifier score for $\hat { Y _ { i } }$ , see the definition in Section 2.1) as a input in this layer. Assume $\phi ( . ) \in \{ - 1 , 1 \}$ (ensured if $\phi$ is sigmoid or tanh) is the indicator of the class label (based on sign). We want ${ \hat { Y } } _ { i } \geq \phi ( f ( x _ { i } ) )$ and $\hat { Y _ { i } } \leq 1 + \phi ( f ( x _ { i } ) )$ . If $\hat { Y _ { i } }$ is $\{ 0 , 1 \}$ , these two constraints ensures that $\hat { Y _ { i } } = 0$ when $\phi ( f ( x _ { i } ) ) \leq 0$ and $\hat { Y } _ { i } = 1$ when $\phi ( f ( x _ { i } ) ) > 0$ . When $\hat { Y _ { i } }$ is relaxed and replaced with $z$ and $t$ , we get the equivalent form (c).
|
| 105 |
+
|
| 106 |
+
This model imposes $4 n$ constraints for $n$ samples. Since this is a maximization, a solution to the LP, $O _ { \hat { Y } }$ , is an upper bound on the integer objective ${ o p t } ^ { * }$ , and serves as the loss.
|
| 107 |
+
|
| 108 |
+
# 3 BACKPROPAGATION VIA FAST EXTERIOR PENALTY OPTIMIZATION
|
| 109 |
+
|
| 110 |
+
Unlike traditional feedforward networks, where the output of each layer is a relatively simple (though non-linear) function of the previous layer, a LP layer must solve a constrained optimization problem, therefore implementing scalable and efficient backpropagation schemes that minimizes computational overhead requires more care and as reviewed in $\ S 1$ , is an active topic of research. This problem is, of course, not unique to LPs and manifests in differentiable sorting Mena et al. (2018) and formulating quadratic or cone programs Amos et al. (2017). One may unroll gradient descent steps Amos et al. (2017); Goodfellow et al. (2013); Metz et al. (2016) or use projections Zeng et al. (2019). Recently
|
| 111 |
+
|
| 112 |
+
Agrawal et al. (2019) introduced a package for differentiable constrained convex programming, which includes LPs as a special case. For LPs, Meng et al. (2020) presents an unrolled scheme and Blondel et al. (2020) shows that we can differentiate through LP formulations of sorting/ranking exactly by using smooth approximations of projection steps. Berthet et al. (2020) describes an interesting approach where one computes approximate gradients through ranking/shortest path problems by stochastic perturbation techniques.
|
| 113 |
+
|
| 114 |
+
Remark 2. Some previous works Zeng et al. (2019) have considered LPs where the constraints are deterministic (for a fixed input dimension), i.e., do not depend on the data $X$ , which is different from the LPs in $\ S 2 . 2 \mathrm { - } 2 . 4$ .
|
| 115 |
+
|
| 116 |
+
Note that such perturbation techniques in Berthet et al. (2020) are applicable to our LPs as well. For example, the Fenchel Young losses as defined in Berthet et al. (2020) is attractive because there is no need to compute the Jacobian. From the implementation standpoint, one could simply think of the backward pass as a function given the input and output of the forward pass. But the gradient expressions of the losses is an expectation and hence may require multiple calls to a LP solver in order to approximate the expectation. although parallelization and warm starts were shown to alleviate this dependency by sampling in parallel.
|
| 117 |
+
|
| 118 |
+
Rationale. Consider a LP with a large $m$ number of constraints in fixed dimensions $n$ $( n \ll m )$ ). This assumption holds in all formulations in $\ S 2$ . This is because we assume that the architecture is fixed whereas minibatch size depends on the complexity of the task (stable gradient or when noise in gradient is high). Hence, solving such LPs using off-the-shelf solvers as in Berthet et al. (2020) may slow down the training process. The strategy in Agrawal et al. (2019) does offer benefits over Amos & Kolter (2017) for sparse QPs. Our strategy is to run Mangasarian’s Newton’s method on an exterior penalty function of the LP. There are two advantages: (i) during forward pass, quadratic local convergence of Newton’s method indicates that unrolling the method may be a reasonable choice; and further (ii) based on the relationship between dual and primal variables, and the exactness of the exterior penalty we can show that backward pass is independent of $m$ . We will discuss both these results and some modifications to deal with discontinuous Hessian (and its inverse) that is required for Newton’s method. A similar approach is proposed in Amos & Kolter (2017) in which Primal-Dual Interior Point methods with implicit differentiation is used for differentiation purposes. But the exterior penalty in (6) satisfies an interesting property: primal and dual solutions are related by a closed form expression which can be exploited for efficient backpropagation.
|
| 119 |
+
|
| 120 |
+
# 3.1 FORWARD PASS USING NEWTON’S ALGORITHM
|
| 121 |
+
|
| 122 |
+
A key requirement for fast automatic (forward or reverse mode) differentiation is that we can perform the forward pass efficiently. In our setting, we seek to solve and backpropagate through an LP. We will focus on reverse mode differentiation since it is the most suitable for DNN training.
|
| 123 |
+
|
| 124 |
+
Given a primal LP, for a fixed accuracy $\epsilon > 0$ , Mangasarian (2004) solves an unconstrained problem,
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\operatorname* { m i n } _ { y } g ( y ) : = \frac { 1 } { 2 } \left\| \sigma ( A y - b ) \right\| ^ { 2 } + \epsilon c ^ { T } y ,
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $\sigma ( \cdot ) = \operatorname* { m a x } ( \cdot , 0 )$ represents the elementwise relu function. A modified Newton’s method can be use to solve equation 6 that performs the following iterations:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
y = y + \lambda d \mathrm { w h e r e } d = \tilde { H } ( y ) ^ { - 1 } \nabla g ( y ) : = ( \nabla ^ { 2 } g ( y ) + \rho I ) ^ { - 1 } \nabla g ( y ) .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
In large scale settings of $A , b$ , such Newton methods are known to perform empirically better than gradient descent Mangasarian (2006); Keerthi et al. (2007). We will discuss if this holds for our purposes shortly.
|
| 137 |
+
|
| 138 |
+
Why is Newton’s method applicable for minibatches? In general, the convergence of Newton’s method depends strongly on initialization, i.e., we can only provide local convergence results. However, this is not the case for our problems since in our examples, either the level sets are bounded from below; or the feasible set is compact, as noted in Mangasarian (2004). There are two reasons why the result, by itself, is insufficient for our purposes: (i) it assumes that we can perform line search to satisfy Armijo condition; (ii) even with line search, the result does not provide a rate of convergence. In DNN training, such line search based convergence results can be prohibitively expensive. The main difficulty is handling the discontinuity in the Hessian. As a remedy, we use self concordance of (6) to guarantee global convergence of (7) iterations for the exterior penalty formulation in (6). To do so, we first show a result (proof in Appendix) that characterizes the discrepancy between the actual Hessian of (6) and the modified one in (7) when $A$ is randomly distributed.
|
| 139 |
+
|
| 140 |
+
Lemma 1. Assume that $A$ is a random matrix, and fix some $y \in \mathbb { R } ^ { n }$ . Then with probability one, g in equation 6 is constant (given by $\tilde { H } , \nabla g ( y ) )$ over a sufficiently small neighborhood of y.
|
| 141 |
+
|
| 142 |
+
Intuitively, Lemma 1 states that with probability one, each $\cdot$ has a neighborhood in which the Hessian is constant. In addition, the modified Hessian is nonsingular at all points (in particular the optimal $y ^ { * } .$ ), and so we can then show the following global convergence result.
|
| 143 |
+
|
| 144 |
+
Theorem 2. Newton’s method converges globally at a linear rate with local quadratic convergence.
|
| 145 |
+
|
| 146 |
+
Proof. (Sketch) First, we use the fact that the objective in equation 6 is piecewise quadratic, and hence self concordant. Second, observe that the possible choice of Hessian are finite, and so we can choose $\rho > 0$ so that there is a descent direction without line search, that is, there exist a step size $\lambda > 0$ such that $\lambda \nabla g ( x ) ^ { T } d < 0$ . Finally, we use Theorem 4.1.12 in Nesterov (2013) to claim the result. □
|
| 147 |
+
|
| 148 |
+
Please see Appendix for the proof. The loss function is almost surely quadratic in the neighborhood of any $y$ , thus intuitively suggests local quadratic convergence independent of the starting point.
|
| 149 |
+
|
| 150 |
+
Remark 3. Convergence in Thm. 2 is guaranteed under standard constraint qualification assumptions. Linear Independent Constraint Qualification (LICQ) is satisfied for AUC, and Multi-class AUC formulations in $\ S 2$ . But the $F$ -score formulation does not satisfy LICQ, hence we need safeguarding principles in the initial iterations (until iterates get close to the optimal solution).
|
| 151 |
+
|
| 152 |
+
3.2 BACKWARD PASS USING OPTIMAL DUAL VARIABLES AIDED BY UNROLLING
|
| 153 |
+
|
| 154 |
+
The advantage of optimizing the exterior penalty in (6) is that given an iterate $y _ { t }$ , accuracy , we can extract the optimal dual solution $v _ { t }$ by simple thresholding, that is, $v _ { t } = 1 / \epsilon ( A ^ { T } \sigma ( A \dot { y } - b ) )$ . By complementarity slackness, the nonzero coordinates of $v _ { t }$ specify the set of active constraints in $A x \leq b$ . So, given an approximate solution $y _ { t }$ such that $\begin{array} { r } { \nabla g ( y _ { t } ) \tilde { H } ( y _ { t } ) ^ { - 1 } \nabla g ( y _ { t } ) \le \epsilon } \end{array}$ , to compute the primal solution $x ^ { * }$ , we solve the “active" linear system given by $\tilde { A } \tilde { b }$ , where $\tilde { A }$ denotes the active rows of $A$ and the corresponding subvector $\tilde { b }$ . Hence, backpropagation through the layer reduces to computing derivatives of $\tilde { A } ^ { - 1 } \tilde { b }$ which is simple via automatic differentiation.
|
| 155 |
+
|
| 156 |
+
How to choose $\epsilon ?$ If we can successfully retrieve the active constraints at the optimal solution, we do not need to store the intermediate iterates $y _ { t }$ at all during the forward pass (memory efficient). However, setting $\epsilon$ correctly can be tricky for arbitrary polyhedra since it depends on the geometric properties such as facets and vertices that may be difficult to enumerate. One possible way to get around this is to use a “burn-in” period in which we increase $\epsilon$ slightly in each iteration (of deep network training) and backpropagate through the unrolled Newton’s iterations during this period. Once we see that the convergence profile has stabilized, we can fix $\epsilon$ at that value and start using the complementarity conditions and derive the active linear system $\tilde { A } ^ { - 1 } \tilde { b }$ as discussed above.
|
| 157 |
+
|
| 158 |
+
How to backpropagate through unrolled iterations? We assume that the chain rule is applicable up to this LP layer and is $\frac { \partial L } { \partial x } \frac { \partial \Breve { x } } { \partial A }$ (for one of the parameters $A$ ), and note that it is possible to find $\textstyle { \frac { \partial L } { \partial x } }$ (either directly or using a chain rule). Therefore we focus our attention on $\frac { \partial x } { \partial A }$ , which involves the LP layer. Indeed, unrolling each iteration in (7) is equivalent to a “sublayer". So in order to backpropagate we have to show the partial derivatives of each operation or step wrt to the LP parameters $A , b$ , and $c$
|
| 159 |
+
|
| 160 |
+
Our goal is to $\frac { \partial d } { \partial A }$ where $d = Q ^ { - 1 } q$ , $Q = { \tilde { H } }$ and $\boldsymbol { u } = \nabla g ( y )$ . We can use the product rule to arrive at: $\partial d = - \left( u ^ { \check { T } } \dot { Q } ^ { - 1 } \otimes Q ^ { - 1 } \right) \partial Q + Q ^ { - 1 } \partial u$ . To see this, note that we have used the chain rule to differentiate through the inverse in the first term. The second term is easy to compute similar to the computation of Hessian. For each of these terms we eventually have to compute $\frac { \partial Q } { \partial z }$ or ∂u where $z \in \{ c , A , b \}$ which can also be done by another application of chain rule. Please see Appendix A.4 for empirical verification of unrolled gradient and the one provided by $\tilde { A } ^ { - 1 } \tilde { b }$ .
|
| 161 |
+
|
| 162 |
+
Before proceeding, we should note an issue that comes up when differentiating each step of the unrolled algorithm due to the fact that the Hessian is piecewise linear (constant) as a function of the input to that particular layer. Here, some possible numerical approximations are needed, as we describe below.
|
| 163 |
+
|
| 164 |
+
Remark 4. Note that the diagonal matrix term in $\frac { \partial Q } { \partial A }$ is nondifferentiable due to the presence of the step function. However, the step function is a piecewise constant function, and hence has zero derivative almost surely, that is, in any bounded set $S$ , $x \in S$ , if a ball (of radius $r > 0 ,$ ) $B _ { r } ( x ) \subseteq S$ , then the Lebesgue measure of the set of nondifferentiable points on $S$ is zero. Please see Appendix B.3 for a formal justification where we show this by approximating the step function using a sequence of logistic functions with increasing slope parameter at the origin.
|
| 165 |
+
|
| 166 |
+
Therefore, in this setting, Remark 4 provides a way to compute an approximate sub-gradient when using Newton’s method based LP layers. The function is a piece-wise quadratic function and differentiable everywhere, and the inverse of the Hessian acts as a preconditioner.
|
| 167 |
+
|
| 168 |
+
Summary. Our forward pass involved three steps: 1. finite steps of Newton’s method using which we 2. computed the dual variable by a thresholding operation, and 3. finally, to get the primal solution, these dual variables are first used to identify the active constraints followed by solving a linear system. In order to backpropagate through these three steps, we must differentiate through each layer of our procedure including $\tilde { A } ^ { - 1 } \tilde { b }$ , independent of whether we use unrolling or Danskin’s theorem. Using Danskin’s theorem in this setting would involve differentiating through the fixed point of the Newton’s iterations similar to (regularized) gradient descent iterations considered in the iMAML work Rajeswaran et al. (2019).
|
| 169 |
+
|
| 170 |
+
# 4 EXPERIMENTS
|
| 171 |
+
|
| 172 |
+
In this section, we conduct experiments on commonly used benchmarks to show that our framework can be used to optimize multiple different objectives within deep neural networks and lead to performance gain. We start with binary AUC optimization, and then extend to multi class AUC optimization and $F$ -score optimization. We also show that nonnegative matrix factorization can be optimized in linear programming form in our framework.
|
| 173 |
+
|
| 174 |
+
# Optimizing Binary AUC
|
| 175 |
+
|
| 176 |
+
We follow the current state-of-the-art work on AUC optimization Liu et al. (2019) to conduct experiments on optimizing AUC score directly with deep neural networks. The baseline algorithms we compare with for binary AUC are cross-entropy loss and two algorithm (PPD-SG and PPDAdaGrad) from Liu et al. (2019).
|
| 177 |
+
|
| 178 |
+
Datasets: Cat&Dog, CIFAR10, CIFAR100, and STL10. Cat&Dog is a dataset from Kaggle which contains 25000 images of cats and dogs. $8 0 \%$ of the dataset is used as training set and the rest $2 0 \%$ as test set. STL10 is inspired by the CIFAR-10 dataset but with some modifications. Each class in STL10 has fewer labeled training examples than in CIFAR-10. We follow Liu et al. (2019) to use 19k/1k, 45k/5k, $4 5 \mathrm { k } / 5 \mathrm { k }$ , 4k/1k training/validation split on Cat&Dog, CIFAR10, CIFAR100, STL10 respectively.
|
| 179 |
+
|
| 180 |
+
Table 1: Binary AUC optimization results on four benchmark datasets.
|
| 181 |
+
|
| 182 |
+
<table><tr><td>AUC(%)</td><td colspan="4">Cat&Dog</td><td colspan="4">CIFAR10</td></tr><tr><td>Positive Ratio</td><td>91%</td><td>83%</td><td>71%</td><td>50%</td><td>91%</td><td>83%</td><td>71%</td><td>50%</td></tr><tr><td>Cross-Entropy</td><td>67.6</td><td>74.6</td><td>85.1</td><td>87.4</td><td>65.2</td><td>73.3</td><td>78.1</td><td>83.7</td></tr><tr><td>PPD-SG</td><td>79.1</td><td>81.5</td><td>85.5</td><td>87.1</td><td>69.8</td><td>73.9</td><td>79.1</td><td>82.6</td></tr><tr><td>PPD-AdaGrad</td><td>77.3</td><td>80.6</td><td>83.7</td><td>86.3</td><td>69.7</td><td>74.1</td><td>78.4</td><td>83.1</td></tr><tr><td>Ours</td><td>78.6</td><td>81.3</td><td>85.6</td><td>87.8</td><td>72.5</td><td>74.4</td><td>78.3</td><td>82.7</td></tr><tr><td>AUC(%)</td><td colspan="4">CIFAR100</td><td colspan="4">STL10</td></tr><tr><td>Positive Ratio</td><td>91%</td><td>83%</td><td>71%</td><td>50%</td><td>91%</td><td>83%</td><td>71%</td><td>50%</td></tr><tr><td>Cross-Entropy</td><td>57.8</td><td>58.4</td><td>62.2</td><td>66.3</td><td>63.5</td><td>67.1</td><td>72.7</td><td>80.8</td></tr><tr><td>PPD-SG</td><td>56.5</td><td>58.9</td><td>61.6</td><td>65.2</td><td>70.7</td><td>71.6</td><td>75.1</td><td>77.4</td></tr><tr><td>PPD-AdaGrad</td><td>56.2</td><td>59.0</td><td>62.6</td><td>67.6</td><td>68.5</td><td>72.4</td><td>76.7</td><td>78.5</td></tr><tr><td>Ours</td><td>58.2</td><td>60.5</td><td>64.5</td><td>69.0</td><td>68.4</td><td>71.1</td><td>76.7</td><td>81.6</td></tr></table>
|
| 183 |
+
|
| 184 |
+
Construction of imbalanced datasets: We construct imbalanced binary classification task by using half classes as positive class and another half as negative class, and dropping samples from negative class by a certain ratio, which is reflected by the positive ratio (the ratio of the majority class to the minority class) in Table 1.
|
| 185 |
+
|
| 186 |
+
Experimental setting. We use a Resnet-18 He et al. (2016) as the deep neural network for all algorithms. During optimization, the batch size is set to 64. The initial learning rate is tuned in $\{ 0 . 1$ , $0 . { \overset { \cdot } { 0 } } 1 , 0 . 0 0 1 \}$ and decays $2 / 3$ at $2 k$ , $1 0 k$ , $2 5 k$ -th iteration. We train $4 0 k$ iterations in total. The $\epsilon$ in
|
| 187 |
+
|
| 188 |
+
Newton’s method is 0.001. We use the same random seed, learning rate and total number of iterations in all of our experiments including multi class AUC and $F$ -score experiments.
|
| 189 |
+
|
| 190 |
+
Results. The results are shown in Table 1. We can see that our method slightly outperforms Liu et al. (2019) and outperforms cross-entropy loss by a large margin, especially on imbalanced datasets, where AUC objective shows superiority over cross-entropy loss.
|
| 191 |
+
|
| 192 |
+
Table 2: Ablation study of $\epsilon$ on Cat&Dog dataset.
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Positive Ratio</td><td>91%</td><td>83%</td><td>71%</td><td>50%</td></tr><tr><td>Ours(ε= 0.1)</td><td>71.3</td><td>77.0</td><td>84.4</td><td>87.3</td></tr><tr><td>Ours(ε = 0.01)</td><td>78.6</td><td>81.3</td><td>85.6</td><td>87.8</td></tr><tr><td>Ours(ε= 0.001)</td><td>65.9</td><td>71.3</td><td>71.8</td><td>76.1</td></tr></table>
|
| 195 |
+
|
| 196 |
+
Influence of $\epsilon { _ { \mathrm { { \Omega } } } }$ . We report the influence of $\cdot$ on our algorithm in Table 2, where we choose Cat&Dog as an example to test different $\epsilon$ . We can see that $\epsilon = 0 . 1$ gets slightly worse performance than $\cdot$ , while $\epsilon = 0 . 0 0 1$ performs much worse. To choose $\epsilon$ , we follow the approach proposed by Mangasarian (2004). If for two successive values of $\epsilon _ { 1 } > \epsilon _ { 2 }$ , the value of the $\cdot$ perturbed quadratic function is the same, then it is the least 2-norm solution of the dual. Therefore, we simply choose an $\epsilon$ that satisfies this property, which is chosen to be 0.01 in our experiments.
|
| 197 |
+
|
| 198 |
+
# Optimizing Multiclass AUC
|
| 199 |
+
|
| 200 |
+
We further demonstrate our method for optimizing multiclass AUC. Similar to previous section on binary AUC, we construct imbalanced multiclass datasets by dividing datasets into 3 classes and drop samples from 2 of them and report the one-versus-all AUC (de
|
| 201 |
+
|
| 202 |
+
Table 3: Multiclass AUC optimization results on STL10 and CIFAR100. Drop rate is the proportion used when dropping samples from two of three classes.
|
| 203 |
+
|
| 204 |
+
<table><tr><td rowspan="2">AUCova(%) Drop rate</td><td colspan="3">CIFAR100</td><td colspan="5">STL10</td></tr><tr><td>90%</td><td>80%</td><td>60%</td><td>0%</td><td>90%</td><td>80%</td><td>60%</td><td>0%</td></tr><tr><td>Cross-Entropy</td><td>54.3</td><td>59.4</td><td>62.7</td><td>63.5</td><td>66.9</td><td>68.0</td><td>74.8</td><td>81.0</td></tr><tr><td>Ours</td><td>58.4</td><td>59.2</td><td>64.1</td><td>65.7</td><td>72.9</td><td>72.5</td><td>75.7</td><td>82.7</td></tr><tr><td>AUC师in(%)</td><td></td><td>CIFAR100</td><td></td><td></td><td></td><td>STL10</td><td></td><td></td></tr><tr><td>Droprate</td><td>90%</td><td>80%</td><td>60%</td><td>0%</td><td>90%</td><td>80%</td><td>60%</td><td>0%</td></tr><tr><td>Cross-Entropy</td><td>55.1</td><td>60.6</td><td>65.0</td><td>64.0</td><td>68.9</td><td>69.6</td><td>75.8</td><td>82.2</td></tr><tr><td>Ours</td><td>60.1</td><td>61.2</td><td>66.0</td><td>67.2</td><td>76.1</td><td>74.4</td><td>77.7</td><td>84.5</td></tr></table>
|
| 205 |
+
|
| 206 |
+
noted as $\mathbf { A U C } ^ { \mathrm { { o v a } } } ,$ ) and $\operatorname { A U C } _ { \mu } ^ { \mathrm { { b i n } } }$ score . For STL10, we group class $0 - 2 , 3 - 5 , 6 - 9$ into the three classes, and drop samples from the first two classes. For CIFR100, we group class $0 - 3 2$ , 33 − 65, $6 6 - 9 9$ into three classes, and also drop samples from the first two classes.
|
| 207 |
+
|
| 208 |
+
Results. Results are in Table 3. In addition to one-versus-all AUC metric, we also report the performance in terms of $\operatorname { A U C } _ { \mu }$ Kleiman & Page (2019) which is specifically designed for measuring multiclass AUC and keeps nice properties of binary AUC such as being insensitive to class skew. We can see that our method outperforms cross-entropy loss on all four datasets and under all different skewed ratios. Specifically, the performance gain tends to be larger when the dataset becomes more imbalanced.
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 1: ROC curve of multiclass AUC optimization on STL10 with $9 0 \%$ drop rate. We divide STL10 into 3 classes and use one as positive class and other two as negative class to plot the ROC.
|
| 212 |
+
|
| 213 |
+
# Optimizing $F$ -score
|
| 214 |
+
|
| 215 |
+
We show that by directly optimizing $F$ -score, we can achieve a better performance on this than when using cross entropy loss. In addition to cross entropy loss, we perform evalua
|
| 216 |
+
|
| 217 |
+
Table 4: $F .$ -score on four datasets.
|
| 218 |
+
|
| 219 |
+
<table><tr><td>F-score(%)</td><td>Cat&Dog</td><td>CIFAR10</td><td>CIFAR100</td><td>STL10</td></tr><tr><td>Cross-Entropy</td><td>76.0</td><td>70.3</td><td>60.4</td><td>71.8</td></tr><tr><td>CVXPY-SCS</td><td>70.1</td><td>66.6</td><td>66.7</td><td>66.6</td></tr><tr><td>AP-Perf</td><td>65.3</td><td>66.7</td><td>66.4</td><td>67.2</td></tr><tr><td>Ours</td><td>77.8</td><td>72.6</td><td>63.4</td><td>72.7</td></tr></table>
|
| 220 |
+
|
| 221 |
+
tions with two other methods that can also directly optimize the $F 1$ -score. First, we replace our solver with CVXPY-SCS Agrawal et al. (2019), which is a differentiable general purpose linear programming solver; second, we perform comparisons with AP-Perf Fathony & Kolter (2020) which offers differentiable optimization of $\cdot$ -score using an adversarial prediction framework. The datasets and our setup to group them into two classes remain the same as in binary AUC section. The results in Table 4 shows that our method generally yields improvement over cross-entropy loss in terms of $F$ -score. Note that different from optimizing cross entropy loss, when we optimize $\cdot$ -score directly, there exists a local optimal point where assigning all examples to the positive class leads to $F$ -score of $\cdot$ . We see this behavior on CIFAR10, CIFAR100, and STL10.
|
| 222 |
+
|
| 223 |
+
# 5 CONCLUSIONS
|
| 224 |
+
|
| 225 |
+
We demonstrated that various non-decomposable objectives can be optimized within deep neural networks in a differentiable way under the same general framework of LPs using a modified Newton’s algorithm proposed by Mangasarian. A number of recent papers have studied the general problem of backpropagating through convex optimization modules, and this literature provides several effective approaches although scalability remains a topic of active research. Our work complements these results and shows that the operations needed can be implemented to utilize the capabilities of modern deep learning libraries. While our experimental results suggest that promising results on binary AUC, multi-class AUC and $F$ -score optimization within DNNs is achievable, we believe that the module may have other applications where the number of constraints are large and data-dependent.
|
| 226 |
+
|
| 227 |
+
# REFERENCES
|
| 228 |
+
|
| 229 |
+
Akshay Agrawal, Brandon Amos, Shane Barratt, Stephen Boyd, Steven Diamond, and J Zico Kolter. Differentiable convex optimization layers. In Advances in neural information processing systems, pp. 9562–9574, 2019. 5, 9
|
| 230 |
+
|
| 231 |
+
Brandon Amos and J Zico Kolter. Optnet: Differentiable optimization as a layer in neural networks. arXiv preprint arXiv:1703.00443, 2017. 2, 5
|
| 232 |
+
|
| 233 |
+
Brandon Amos, Lei Xu, and J Zico Kolter. Input convex neural networks. In International Conference on Machine Learning, pp. 146–155, 2017. 4
|
| 234 |
+
|
| 235 |
+
Sanjeev Arora, Rong Ge, and Ankur Moitra. Learning topic models–going beyond svd. In 2012 IEEE 53rd annual symposium on foundations of computer science, pp. 1–10. IEEE, 2012. 14
|
| 236 |
+
|
| 237 |
+
Kaan Ataman, W Nick Street, and Yi Zhang. Learning to rank by maximizing auc with linear programming. In The 2006 IEEE International Joint Conference on Neural Network Proceedings, pp. 123–129. IEEE, 2006. 1, 3
|
| 238 |
+
|
| 239 |
+
Quentin Berthet, Mathieu Blondel, Olivier Teboul, Marco Cuturi, Jean-Philippe Vert, and Francis Bach. Learning with differentiable perturbed optimizers. arXiv preprint arXiv:2002.08676, 2020. 5
|
| 240 |
+
|
| 241 |
+
Mathieu Blondel, Olivier Teboul, Quentin Berthet, and Josip Djolonga. Fast differentiable sorting and ranking. In International Conference on Machine Learning, 2020. 5
|
| 242 |
+
|
| 243 |
+
Mike Brookes. The matrix reference manual. Imperial College London, 3, 2005. 16
|
| 244 |
+
|
| 245 |
+
Edo Collins, Radhakrishna Achanta, and Sabine Susstrunk. Deep feature factorization for concept discovery. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 336–352, 2018. 13, 14
|
| 246 |
+
|
| 247 |
+
Corinna Cortes and Mehryar Mohri. Auc optimization vs. error rate minimization. In Advances in neural information processing systems, pp. 313–320, 2004. 1
|
| 248 |
+
|
| 249 |
+
Krzysztof J. Dembczynski, Willem Waegeman, Weiwei Cheng, and Eyke Hüllermeier. An exact algorithm for f-measure maximization. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. Pereira, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 24, pp. 1404–1412. Curran Associates, Inc., 2011. URL http://papers.nips.cc/paper/ 4389-an-exact-algorithm-for-f-measure-maximization.pdf. 1, 4, 12
|
| 250 |
+
|
| 251 |
+
Elad Eban, Mariano Schain, Alan Mackey, Ariel Gordon, Ryan Rifkin, and Gal Elidan. Scalable learning of non-decomposable objectives. In Artificial Intelligence and Statistics, pp. 832–840, 2017. 1
|
| 252 |
+
|
| 253 |
+
Rizal Fathony and Zico Kolter. Ap-perf: Incorporating generic performance metrics in differentiable learning. In International Conference on Artificial Intelligence and Statistics, pp. 4130–4140. PMLR, 2020. 1, 9
|
| 254 |
+
|
| 255 |
+
Wei Gao, Rong Jin, Shenghuo Zhu, and Zhi-Hua Zhou. One-pass auc optimization. In International conference on machine learning, pp. 906–914, 2013. 1
|
| 256 |
+
|
| 257 |
+
Alexander I Golikov and Igor E Kaporin. Inexact newton method for minimization of convex piecewise quadratic functions. In Numerical Geometry, Grid Generation and Scientific Computing, pp. 139–155. Springer, 2019. 15
|
| 258 |
+
|
| 259 |
+
Ian Goodfellow, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Multi-prediction deep boltzmann machines. In Advances in Neural Information Processing Systems, pp. 548–556, 2013. 4
|
| 260 |
+
|
| 261 |
+
James A Hanley and Barbara J McNeil. The meaning and use of the area under a receiver operating characteristic (roc) curve. Radiology, 143(1):29–36, 1982. 3
|
| 262 |
+
|
| 263 |
+
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, pp. 770–778, 2016. 7
|
| 264 |
+
|
| 265 |
+
Thorsten Joachims, Thomas Finley, and Chun-Nam John Yu. Cutting-plane training of structural svms. Machine learning, 77(1):27–59, 2009. 1
|
| 266 |
+
|
| 267 |
+
S Sathiya Keerthi, Vikas Sindhwani, and Olivier Chapelle. An efficient method for gradient-based adaptation of hyperparameters in svm models. In Advances in neural information processing systems, pp. 673–680, 2007. 5
|
| 268 |
+
|
| 269 |
+
Ross Kleiman and David Page. Auc $\mu$ : A performance metric for multi-class machine learning models. In International Conference on Machine Learning, pp. 3439–3447, 2019. 3, 8, 12
|
| 270 |
+
|
| 271 |
+
Mingrui Liu, Xiaoxuan Zhang, Zaiyi Chen, Xiaoyu Wang, and Tianbao Yang. Fast stochastic auc maximization with $o ( 1 / n )$ -convergence rate. In International Conference on Machine Learning, pp. 3189–3197, 2018. 1
|
| 272 |
+
|
| 273 |
+
Mingrui Liu, Zhuoning Yuan, Yiming Ying, and Tianbao Yang. Stochastic auc maximization with deep neural networks. arXiv preprint arXiv:1908.10831, 2019. 1, 7, 8
|
| 274 |
+
|
| 275 |
+
OL Mangasarian. A newton method for linear programming. Journal of Optimization Theory and Applications, 121(1):1–18, 2004. 2, 5, 8
|
| 276 |
+
|
| 277 |
+
Olvi L Mangasarian. Exact 1-norm support vector machines via unconstrained convex differentiable minimization. Journal of Machine Learning Research, 7(Jul):1517–1530, 2006. 5
|
| 278 |
+
|
| 279 |
+
Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. Learning latent permutations with gumbel-sinkhorn networks. arXiv preprint arXiv:1802.08665, 2018. 4
|
| 280 |
+
|
| 281 |
+
Zihang Meng, Sathya N Ravi, and Vikas Singh. Physarum powered differentiable linear programming layers and applications. arXiv preprint arXiv:2004.14539, 2020. 2, 5
|
| 282 |
+
|
| 283 |
+
Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. arXiv preprint arXiv:1611.02163, 2016. 4
|
| 284 |
+
|
| 285 |
+
Pritish Mohapatra, Michal Rolinek, CV Jawahar, Vladimir Kolmogorov, and M Pawan Kumar. Efficient optimization for rank-based loss functions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3693–3701, 2018. 1
|
| 286 |
+
|
| 287 |
+
Ye Nan, Kian Ming Chai, Wee Sun Lee, and Hai Leong Chieu. Optimizing f-measure: A tale of two approaches. arXiv preprint arXiv:1206.4625, 2012. 1
|
| 288 |
+
|
| 289 |
+
Michael Natole, Yiming Ying, and Siwei Lyu. Stochastic proximal algorithms for auc maximization. In International Conference on Machine Learning, pp. 3710–3719, 2018. 1
|
| 290 |
+
|
| 291 |
+
Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013. 6, 15
|
| 292 |
+
|
| 293 |
+
Aravind Rajeswaran, Chelsea Finn, Sham M Kakade, and Sergey Levine. Meta-learning with implicit gradients. In Advances in Neural Information Processing Systems, pp. 113–124, 2019. 7
|
| 294 |
+
|
| 295 |
+
Ben Recht, Christopher Re, Joel Tropp, and Victor Bittorf. Factoring nonnegative matrices with linear programs. In Advances in Neural Information Processing Systems, pp. 1214–1222, 2012. 14
|
| 296 |
+
|
| 297 |
+
Yang Song, Alexander Schwing, Raquel Urtasun, et al. Training deep neural networks via direct loss minimization. In International Conference on Machine Learning, pp. 2169–2177, 2016. 1
|
| 298 |
+
|
| 299 |
+
George Trigeorgis, Konstantinos Bousmalis, Stefanos Zafeiriou, and Bjoern Schuller. A deep seminmf model for learning hidden representations. In International Conference on Machine Learning, pp. 1692–1700, 2014. 13
|
| 300 |
+
|
| 301 |
+
Sathya N Ravi Abhay Venkatesh, Glenn M Fung, and Vikas Singh. Optimizing nondecomposable data dependent regularizers via lagrangian reparameterization offers significant performance and efficiency gains. arXiv preprint arXiv:1909.12398, 2019. 1
|
| 302 |
+
|
| 303 |
+
Yisong Yue, Thomas Finley, Filip Radlinski, and Thorsten Joachims. A support vector method for optimizing average precision. In Proceedings of the 30th annual international ACM SIGIR conference on Research and development in information retrieval, pp. 271–278, 2007. 1
|
| 304 |
+
|
| 305 |
+
Xiaohui Zeng, Renjie Liao, Li Gu, Yuwen Xiong, Sanja Fidler, and Raquel Urtasun. Dmm-net: Differentiable mask-matching network for video object segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3929–3938, 2019. 4, 5
|
| 306 |
+
|
| 307 |
+
# A APPENDIX
|
| 308 |
+
|
| 309 |
+
# A.1 LP FORMULATION FOR MULTI-CLASS AUC
|
| 310 |
+
|
| 311 |
+
One way to extend binary AUC to multi-class is by considering multiple one-versus-all pairs. This leads us to the following formulation:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { l } { \displaystyle \mathrm { A U C : \operatorname* { m i n } } _ { z _ { i j } } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 : x _ { i } ^ { * } \neq x _ { j } ^ { * } } ^ { n } z _ { i j } } \\ { \displaystyle \mathrm { s . t . } \quad \left( \mathbf { f } \left( x _ { i } , x _ { i } ^ { * } \right) - \mathbf { f } \left( x _ { j } , x _ { i } ^ { * } \right) \right) \geq \epsilon - z _ { i j } \qquad \forall i , j : x _ { i } ^ { * } \neq x _ { j } ^ { * } , \quad z _ { i j } \geq 0 } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
In our multi-class AUC experiment, we use this one-versus-all AUC as training loss and report performance in both one-versus-all AUC and $\operatorname { A U C } _ { \mu } ^ { \mathrm { { b i n } } }$ . In addition, we can also consider the setting of $\mathrm { A U C } _ { \mu }$ where $\mathbf { P }$ is set arbitarily. In this case, the exact terms in orientation function $O$ proposed by Kleiman & Page (2019) can be written as follows:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { r l } { \{ \mathbf { A U C } _ { \mu } ^ { \mathrm { a t b i t } } : \displaystyle \operatorname* { m i n } _ { z _ { i j } } \displaystyle \sum _ { i = 1 } ^ { n } \sum _ { j = 1 : x _ { i } ^ { * } < x _ { j } ^ { * } } z _ { i j } } & { } \\ { \mathrm { s . t . } \quad \widetilde { \mathbf { d } } _ { i j } \displaystyle \sum _ { k = 1 } ^ { K } \widetilde { \mathbf { v } } ( k ) ( \mathbf { f } ( x _ { i } , k ) - \mathbf { f } ( x _ { j } , k ) ) \geq \epsilon - z _ { i j } \qquad } & { \forall i , j : x _ { i } ^ { * } < x _ { j } ^ { * } , z _ { i j } \geq 0 } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Note that $\mathbf { A U C } _ { \mu _ { . } } ^ { \mathrm { a r b i t } }$ has the same number of constraints and variables as $\mathbf { A U C } _ { \mu } ^ { \mathrm { { b i n } } }$ . Once the LPs are solved, the loss function is calculated the same way as binary AUC.
|
| 324 |
+
|
| 325 |
+
# A.2 FORMULATING RATIO OBJECTIVES
|
| 326 |
+
|
| 327 |
+
In this section, we study a subset of non-decomposable metrics, which are typically expressed as ratios of some combination of True Positive(TP), False Positives(FP), True Negatives(TN) and False Negatives(FN). These can be expressed in a general form as $\frac { a _ { 1 1 } T P + \bar { a _ { 1 2 } } } { a _ { 2 1 } T P + a _ { 2 2 } F P + a _ { 2 3 } F N + a _ { 2 4 } }$ , where $a _ { p q }$ are constants/cofficients which if set to 0, means the term is absent and not equal to zero in other cases. This formulation can used to define Fscore, $F _ { \beta }$ , Jaccard, IOU and Precision at fixed recall. In the following section, we describe the formulation of Fscore as a representative of this approach, other metrics can be formulated similarly.
|
| 328 |
+
|
| 329 |
+
Given $Y$ the groud truth, our goal is to compute $\hat { Y }$ both of length $n$ , which aligns with $Y$ based on the specific metric. We first show how to write TP, FP, TN and FN wrt to these vectors.
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\begin{array} { c c } { { T P = Y ^ { T } \times \hat { Y } } } & { { F P = ( 1 - Y ) ^ { T } \times \hat { Y } } } \\ { { T N = ( 1 - Y ) ^ { T } \times ( 1 - \hat { Y } ) } } & { { F N = ( Y ) ^ { T } \times ( 1 - \hat { Y } ) } } \end{array}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
# A.2.1 FORMULATING $F$ -SCORE
|
| 336 |
+
|
| 337 |
+
The $F$ -score or $F$ -measure is routinely used as a performance metric for different types of prediction problems, including binary classification and, multi-label classification. Compared to measures like error rate in binary classification and Hamming loss, it enforces a better balance between performance on the minority and the majority classes, and, therefore, it is more suitable in the case of imbalanced data Dembczynski et al. (2011). $F$ -score is defined as follows:
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
F – s c o r e ( Y , \hat { Y } ) = \frac { 2 P ( Y , \hat { Y } ) \times R ( Y , \hat { Y } ) } { P ( Y , \hat { Y } ) + R ( Y , \hat { Y } ) }
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
where $P$ is the measure of precision defined as
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
P ( Y , { \hat { Y } } ) = { \frac { T P } { T P + F P } }
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
and $R$ stands for the measure of recall, given as
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
R ( Y , \hat { Y } ) = \frac { T P } { T P + F N }
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
Plugging this in $\operatorname { E q } ( 1 )$ , and replacing the formulations for TP, FP and FN(from Eq A.2) we get
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
F \ – s c o r e ( Y , \hat { Y } ) = \frac { 2 T P } { 2 T P + F P + F N } = \frac { 2 ( Y ^ { T } \times \hat { Y } ) } { \sum _ { i = 1 } ^ { n } y _ { i } + \sum _ { i = 1 } ^ { n } \hat { y } _ { i } } = \frac { 2 ( Y ^ { T } \times \hat { Y } ) } { \mathbf { 1 } ^ { T } Y + \mathbf { 1 } ^ { T } \hat { Y } }
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
where $y _ { i }$ refers to the ith element of $Y$ (same for $\hat { y } _ { i }$ ). 1 represents an all one vector in $R ^ { n }$ . Note that in training, since $Y$ is generally provided, we can assume $\mathbf { \widehat { 1 } } ^ { T } Y = \beta$ which is constant (the number of examples in the positive class in the ground truth). We can also represent the the values of $2 Y$ as a coefficient matrix $c$ , then the optimization problem for finding $F$ -score can be written as
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\begin{array} { l l } { \underset { \hat { Y } } { \mathrm { m a x i m i z e } } } & { \qquad \frac { c ^ { T } \hat { Y } } { 1 ^ { T } \hat { Y } + b } } \\ { \mathrm { s u b j e c t ~ t o } } & { \qquad \hat { Y _ { i } } \in [ 0 , 1 ] , \ i = 1 , \dots , n . } \end{array}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
# A.2.2 MAXIMIZING JACCARD COEFFICIENT AND $F _ { \beta }$
|
| 368 |
+
|
| 369 |
+
The Jaccard Coefficient and Dice Index lead to similar formulation as $F$ -score. The Jaccard coefficient can be expressed as:
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\mathrm { J a c c } ( Y , { \hat { Y } } ) = { \frac { T P } { T P + F P + F N } } = { \frac { ( Y ^ { T } \times { \hat { Y } } ) } { \sum _ { i = 1 } ^ { n } y _ { i } + \sum _ { i = 1 } ^ { n } { \hat { y } } _ { i } - \sum _ { i = 1 } ^ { n } y _ { i } \times { \hat { y } } _ { i } } } = { \frac { ( Y ^ { T } \times { \hat { Y } } ) } { \mathbf { 1 } ^ { T } Y + ( 1 - Y ) ^ { T } { \hat { Y } } } }
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
This can be equivalently written as a linear factional program as shown in Model(10) where $c = Y$ , $d = ( 1 - Y )$ and $b = \mathbf { 1 } ^ { T } Y$ . The rest of the construction is similar to $F$ -score. Note that $F _ { \beta }$ which is defined as
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
F _ { \beta } ( Y , \hat { Y } ) = ( 1 + \beta ^ { 2 } ) \frac { P ( Y , \hat { Y } ) \times R ( Y , \hat { Y } ) } { \beta ^ { 2 } P ( Y , \hat { Y } ) + R ( Y , \hat { Y } ) }
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
where $\beta$ is a user specified parameter (balancing the importance of precision and recall) also permits a similar formulation. Here we simply set $c = \bar { ( 1 + \beta ^ { 2 } ) } Y$ , $d = \mathbf { 1 }$ and $b = \beta ^ { 2 } \mathbf { 1 } ^ { T } Y$ .
|
| 382 |
+
|
| 383 |
+
# A.2.3 MAXIMIZING P @R
|
| 384 |
+
|
| 385 |
+
We begin by defining the maximum precision at fixed minimum recall problem as
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\begin{array} { r l } { P \mathbb { Q } R \alpha = \operatorname { m a x i m i z e } } & { P \quad \mathrm { s . t . } R \ge \alpha } \\ { \mathrm { = m a x i m i z e } } & { \frac { ( Y ^ { T } \hat { Y } ) } { \mathbf { 1 } ^ { T } \hat { Y } } \quad \mathrm { s . t . } \quad Y ^ { T } \hat { Y } \ge \alpha \mathbf { 1 } ^ { T } Y } \end{array}
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
This is again a linear fractional objective with a linear constraint. So we can write it as an equivalent Linear program using the same transformation where $c = Y$ , $d = \mathbf { 1 }$ and $b = 0$ . $R @ P$ on the other hand directly leads to a linear program.
|
| 392 |
+
|
| 393 |
+
# A.3 OPTIMIZING NON-NEGATIVE MATRIX FACTORIZATION (NMF)
|
| 394 |
+
|
| 395 |
+
Nonnegative matrix factorization is different from the other objectives we presented in that it is primarily used in unsupervised learning and does not satify the criteria for a metric loss function. It can still be formulated in a generalized non-decomposable form because (i) cannot be written as a sum over individual samples, (ii) leads to a model where the constraints depend on learned features.
|
| 396 |
+
|
| 397 |
+
Note that purpose of discussing NMF in this context, is not to provide a general purpose solver for the problem, and instead to assess whether NMF layers can serve as a regularizer or a clustering module, e.g., learning more interpretable attributes, co-segmentation and a substitute for clustering, see Trigeorgis et al. (2014) and Collins et al. (2018). The following description in this section and the experimental validation in the following section is a proof of principle instantiation of this idea.
|
| 398 |
+
|
| 399 |
+
We briefly review from Arora et al. (2012) and Recht et al. (2012), how NMF is written as a LP.
|
| 400 |
+
|
| 401 |
+
We know from Arora et al. (2012) that a NMF decomposition $V = F W$ where $F$ is $s \times s ^ { \prime }$ and $W$ is $s ^ { \prime } \times w$ and $V$ and $W$ have a row sum of 1, is ‘separable’ if the rows of $W$ are simplicial and there is a permutation matrix $R \in \mathbb { R } ^ { s \times s }$ such that $\boldsymbol { R } \boldsymbol { F } = \left[ \begin{array} { l l } { \boldsymbol { I _ { r } } } & { \boldsymbol { M } } \end{array} \right] ^ { T }$ . The top $r$ rows of $F$ contains so-called anchor words. Recht et al. (2012) proposed a data-driven model where the most salient features in the data are used to express the remaining features, given as $V \sim C V$ , where $C$ is of size $s \times s$ . Assuming $V$ admits a rank- $\cdot r$ separable factorization, then $V = R ^ { T } { \left[ \begin{array} { l l } { I _ { r } } & { 0 } \\ { M } & { 0 } \end{array} \right] } R V = C V .$ . To show that thsis factorization is possible, we need to first make $\cdot$ square, which is why it is zero-padded to make it a size $s \times s$ matrix. Let $\cdot$ be any vector which is used as the coefficient in the objective in the efollowing model. According to Recht et al. (2012), any value for the entries of $\cdot$ should suffice as elong as they are distinct. with distinct values. Then the LP formulation is as follows:
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\operatorname* { m i n } _ { C } \widetilde { p } ^ { T } \mathrm { d i a g } ( C ) \quad \mathrm { s . t . } \qquad C V = V , \mathrm { t r } ( C ) = r , C _ { j j } \leq 1 \forall j , C _ { i j } \leq C _ { j j } \forall i j , C \geq 0
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
With $C$ in hand, $W$ is constructed by extracting rows of $V$ for those indices $k$ where $C _ { k k } = 1$ . $F$ is constructed by extracting rows of $C$ which correspond to $k$ where $C _ { k k } = 1$ .
|
| 408 |
+
|
| 409 |
+
# A.3.1 EXPERIMENTAL RESULTS ON NONNEGATIVE MATRIX FACTORIZATION
|
| 410 |
+
|
| 411 |
+
We demonstrate applicability of our strategy to nonnegative matrix factorization (NMF) by performing a rank $k$ factorization on Convolutional Neural Network (CNN) activations as an example, following Collins et al. (2018). Recall that the activation tensor of an image at some layer in CNN has the shape $V \in R ^ { c \times h \times w }$ where $h , w$ are the spatial sizes and $c$ is the number of channels. We can reshape it into $V \in \mathbb { R } ^ { c \times ( h \cdot w ) }$ and calculate a rank $k$ NMF for $V$ $V = F W$ . Each row $W _ { j }$ of the resultant $W \in \mathbb { R } ^ { k \times ( h \cdot w ) }$ can be reshaped into a heat map of dimension $h \times w$ which highlights regions in the image that correspond to the factor $W _ { j }$ . We show an example for $k = 1 , 2$ in Fig. 2. We can see that heatmap consistently captures a meaningful part/concept in the examples. Currently, our memory consumption increases quickly with $c$ here since the constraint matrix in our LP formulation is of size $O ( c ^ { 2 } ) \times O ( c ^ { 2 } )$ . This makes our method only work for small $c$ on a GPU with 11GB memory (here, we use $c = 2 0$ ). This scaling issue can be possibly solved by utilizing sparsity in the constraint matrix, but the sparse matrix operations are currently not well supported on mainstream deep learning platforms like PyTorch and Tensorflow. Since our method provides backward gradients for the NMF operation, the heatmap generated here can, in fact, be used to construct a loss function during training in order to learn a interpretable models.
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
Figure 2: NMF example. Three rows correspond to original images, $k = 1$ and $k = 2$ respectively.
|
| 415 |
+
|
| 416 |
+
<table><tr><td>Objective</td><td>9 h</td><td>E</td><td></td><td>F</td><td>p</td><td>B</td><td>G</td><td></td><td>q</td></tr><tr><td>AUC</td><td>1 ∈ Z/T|x|NI</td><td>- -1 ZITIxINI</td><td>E</td><td></td><td>Pij</td><td>(f(xi) f(xj)-e)</td><td>-</td><td></td><td>-</td></tr><tr><td>AUCbin</td><td>1,</td><td>-1</td><td>S</td><td></td><td>Pij S</td><td>-@</td><td></td><td></td><td></td></tr><tr><td> F-score</td><td>C</td><td>0 -1</td><td>1 1</td><td>-1 (f(xi)) -(1+Φ(f(xi)))</td><td>0</td><td></td><td>d</td><td>bb</td><td></td></tr></table>
|
| 417 |
+
|
| 418 |
+
Table 5: Table showing the general LP coefficients for each model. †: length based on problem setting; $^ \ddag$ : $\mathbf { f } _ { i j } ^ { \pm } = \widetilde { \mathbf { d } } _ { i j } ( f ( x _ { i } , y _ { C ( x _ { i } ) } ) - f ( x _ { j } , y _ { C ( x _ { i } ) } ) + f ( x _ { j } , y _ { C ( x _ { j } ) } ) - f ( x _ { i } , y _ { C ( x _ { j } ) } ) ) ;$ §: one block for each $i \in [ 1 , . . n ]$ . We do not include NMF in this table, as its formulation as a general LP is more verbose including vectorization of matrices and kronecker product calculations.
|
| 419 |
+
|
| 420 |
+
A.4 VERIFICATION OF UNROLLING GRADIENT AND THE ONE PROVIDED BY $\tilde { A } ^ { - 1 } \tilde { b }$
|
| 421 |
+
|
| 422 |
+
We use Fscore formulation as an example. For input sample $x$ , the neural network predicts a score $f ( x )$ , and then the scores of a batch of samples will be used in solving the linear programming form of Fscore and be used to construct the loss function. We compute the gradient from the final loss function back to the predicted scores from the neural network and compare two approaches: one is that we use $z = \tilde { A } ^ { - 1 } \tilde { b }$ as the solution (the one we used in our experiment) where we can compute gradient by only one step, another one is that we directly use $y _ { t }$ resulting from the Newton iterations as the solution and compute gradients by unrolling those iterations. We then compute the cosine value between these two gradient vectors. By experiments on 100 randomly sampled batches, the average cosine value is 0.9991, which means the two gradients are highly consistent.
|
| 423 |
+
|
| 424 |
+
# B PROOFS AND DETAILS OF RESULTS IN SECTION 3
|
| 425 |
+
|
| 426 |
+
In this section, we will provide the missing proofs and additional calculations in Section 3.
|
| 427 |
+
|
| 428 |
+
# B.1 PROOF OF LEMMA 1.
|
| 429 |
+
|
| 430 |
+
Lemma 1 is restated here for convenience.
|
| 431 |
+
|
| 432 |
+
Lemma 3. Assume that $A \in \mathbb { R } ^ { m \times n }$ is a random matrix, and fix some $y \in \mathbb { R } ^ { n }$ . Then with probability one, $g$ in equation $\cdot$ is quadratic (given by $\tilde { H } , \nabla g ( y ) ,$ ) over a sufficiently small neighborhood of $y$ .
|
| 433 |
+
|
| 434 |
+
Proof. Using the integral form of second order Taylor’s expansion of $\sigma ^ { 2 } ( y ) = \left( \operatorname* { m a x } ( 0 , y ) \right) ^ { 2 }$ , we can show that,
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
g ( y + h ) - g ( y ) - h ^ { T } \nabla g ( y ) = \frac { 1 } { 2 } h ^ { T } A ^ { T } \mathrm { d i a g } \left( \mathfrak { d } \right) A h
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
where
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\mathfrak { d } = \int _ { 0 } ^ { 1 } \left( \int _ { 0 } ^ { 1 } \left( \sigma \left( A y - b \right) \right) _ { * } d s \right) 2 d t .
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
See Remark 1 in Golikov & Kaporin (2019) for details. Without loss of generality, we can assume $b = 0$ by simply translating the origin. Following the same remark, the diagonal matrix coincides with the step function based diagonal in $\tilde { H }$ under the following condition on $h$ :
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
e _ { j } ^ { T } A h \cdot e _ { j } ^ { T } ( A y ) < 0 \implies | e _ { j } ^ { T } A h | \leq | e _ { j } ^ { T } ( A y ) | .
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
Since $y$ is fixed, assuming that the entries of $A$ are chosen from a continuous distribution such that $e _ { j } ^ { T } A$ is uniformly distributed over the sphere, then $( e _ { j } ^ { T } A h ) ^ { 2 }$ follows a Beta $\textstyle \left( { \frac { 1 } { 2 } } , { \frac { n - 1 } { 2 } } \right)$ when $h$ is drawn uniformly at random from the unit sphere, independent of $A$ . This means that no matter what $y$ is, there exists sufficiently small $h$ such that the left hand side of equation 20 is false with probability one, and in that neighborhood $\mathrm { d i a g } ( \mathfrak { d } ) = \tilde { H }$ . □
|
| 453 |
+
|
| 454 |
+
# B.2 PROOF OF THEOREM 2
|
| 455 |
+
|
| 456 |
+
Theorem 4. Assume that the primal $L P$ has a unique optimal solution, and that the level set $\{ x : A x \leq b , c ^ { T } x \leq \alpha \}$ is bounded for all $\alpha$ (for dual feasibility). Then short step (no line search) Newton’s method converges globally at a linear rate with local quadratic convergence.
|
| 457 |
+
|
| 458 |
+
Proof. First, since the objective function is piecewise quadratic since it is a sum of piecewise quadratic functions. In particular, it is self concordant since its third derivative zero everywhere. Now setting $\rho < \epsilon$ , we see that an approximate solution of the problem with the modified Hessian is also an approximate solution to equation 6. Moreover, since the possible values of $\tilde { H }$ is finite, the local norm (also known as Newton’s decrement) $\nabla g ( y ) ^ { T } \tilde { H } ( y ) ^ { - 1 } \nabla g ( y )$ is finite. Hence, we can choose $\rho > 0$ so that there is a descent direction $d$ , that is, there exist a step size $\lambda > 0$ such that $\lambda \nabla g ( x ) ^ { T } \dot { d } < 0$ Finally, we use Theorem 4.1.12 in Nesterov (2013) to claim the desired result. □
|
| 459 |
+
|
| 460 |
+
The assumptions in Theorem 4 are standard: 1. uniqueness can easily be satisfied by randomly perturbing the cost vector; 2. in most of our formulations, we explicitly have bound constraints on the decision variables, hence level sets are bounded.
|
| 461 |
+
|
| 462 |
+
# B.3 DIFFERENTIATING THE STEP FUNCTION IN REMARK 4
|
| 463 |
+
|
| 464 |
+
We will use a slightly modified “suffix" notation as in Brookes (2005) in our calculations. That is, for a matrix $A$ , $\vec { A }$ is the same as $\mathrm { v e c } ( A )$ , vectorization of $A$ obtained by concatenating all the columns. The following three properties relating the Kronecker product,\~·, and differentials will be used often:
|
| 465 |
+
|
| 466 |
+
1. Fact 1: For two vectors a, b, a ⊗ b = baT .
|
| 467 |
+
2. Fact 2: If $A$ is $p \times q$ matrix, and $B$ is a $m \times n$ matrix, then $\overrightarrow { { \partial B } } = \left( { \partial B } / { \partial A } \right) \overrightarrow { { \partial A } }$ where $\partial B / \partial A$ is the $( m n ) \times ( p q )$ Jacobian matrix of $\vec { B }$ with respect to $\vec { A }$ . If $A$ or $B$ is a column vector or scalar, then\~· has no effect.
|
| 468 |
+
3. Fact 3: ${ \overrightarrow { \partial ( A X B ) } } = \left( B ^ { T } \otimes A \right) { \overrightarrow { \partial X } } .$ .
|
| 469 |
+
|
| 470 |
+
Using the above two facts, we can compute all the gradients needed to backpropagate through the unrolled iterations. We will show the computation for the gradient of $Q ^ { - \bar { 1 } } u$ with respect to $A \in \mathbb { R } ^ { m \times n }$ for a fixed $u \in \mathbb { R } ^ { n }$ . We can apply chain rule to the following composition:
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
\begin{array} { r } { A \xrightarrow { \quad f _ { 1 } \circ f _ { 2 } \quad } \left( A ^ { T } \tilde { H } A + \rho I \right) ^ { - 1 } u } \\ { f _ { 1 } \Bigg \downarrow \xrightarrow [ ] { f _ { 2 } } \quad } \\ { A ^ { T } \tilde { H } A + \rho I } \end{array}
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
to get, $J _ { f _ { 2 } \circ f _ { 1 } } = J _ { f _ { 2 } } \circ J _ { f _ { 1 } }$ . Now using Fact 2 on $\partial \left( X ^ { - 1 } \right) = - X ^ { - 1 } ( \partial X ) X ^ { - 1 }$ and some algebraic manipulation, we obtain,
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
\overrightarrow { J _ { f _ { 2 } \circ f _ { 1 } } } = - \left( u ^ { T } \left( A ^ { T } \tilde { H } A + \rho I \right) ^ { - 1 } \otimes \left( A ^ { T } \tilde { H } A + \rho I \right) \right) \overrightarrow { J _ { f _ { 1 } } } .
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
We will now compute $\overrightarrow { J _ { f _ { 1 } } }$ . Note that $\tilde { H }$ is also a function of $A$ , so using product rule, we can write $\overrightarrow { J _ { f _ { 1 } } }$ as a sum of three derivatives – with respect to each of $A , A ^ { T } , \tilde { H }$ . The derivatives with respect to $A$ and $A ^ { T }$ are fairly straightforward to compute, so will focus on computing the derivative with respect to $\tilde { H }$ . To that end, we will use Fact 3, and show to compute the derivative of the step function by approximating it using the logistic function.
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
\frac { \partial } { \partial A } \mathrm { d i a g } \left( \left( A y - b \right) _ { \ast } \right) \approx \frac { \partial } { \partial A } \mathrm { d i a g } \left( 1 \circledast \left( 1 + \exp \left( \kappa \left( - A y + b \right) \right) \right) \right) , \kappa > 0 .
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
Note that these derivatives are used in computing derivatives of upstream network, so using distributional derivatives, and another application of chain rule to the left hand side of equation 22 results in the dirac delta function which is atomic, that is, has all its mass in a measure zero set. Hence this calculation provides an mathematical justification that the set of nondifferentiable points has measure zero for our training purposes. It is easy to formally verify this argument using differentiable tent functions as approximations to the heaviside step function.
|
md/train/EbIDjBynYJ8/EbIDjBynYJ8.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/EdXhmWvvQV/EdXhmWvvQV.md
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CENTER-WISE LOCAL IMAGE MIXTURE FOR CONTRASTIVE REPRESENTATION LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent advances in unsupervised representation learning have experienced remarkable progress, especially with the achievements of contrastive learning, which regards each image as well its augmentations as a separate class, while does not consider the semantic similarity among images. This paper proposes a new kind of data augmentation, named Center-wise Local Image Mixture, to expand the neighborhood space of an image. CLIM encourages both local similarity and global aggregation while pulling similar images. This is achieved by searching local similar samples of an image, and only selecting images that are closer to the corresponding cluster center, which we denote as center-wise local selection. As a result, similar representations are progressively approaching the clusters, while do not break the local similarity. Furthermore, image mixture is used as a smoothing regularization to avoid overconfidence on the selected samples. Besides, we introduce multi-resolution augmentation, which enables the representation to be scale invariant. Integrating the two augmentations produces better feature representation on several unsupervised benchmarks. Notably, we reach $7 5 . 5 \%$ top-1 accuracy with linear evaluation over ResNet-50, and $5 9 . 3 \%$ top-1 accuracy when fine-tuned with only $1 \%$ labels, as well as consistently outperforming supervised pretraining on several downstream transfer tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Learning general representations that can be transferable to different downstream tasks is a key challenge in computer vision. This is usually achieved by fully supervised learning paradigm, e.g., making use of ImageNet labels for pretraining over the past several years. Recently, self-supervised learning has attracted more attention due to its free of human labels. In self-supervised learning, the network aims at exploring the intrinsic distributions of images via a series of predefined pretext tasks (Doersch et al., 2015; Gidaris et al., 2018; Noroozi & Favaro, 2016; Pathak et al., 2016). Among them, instance discrimination (Wu et al., 2018) based methods have achieved remarkable progress (Chen et al., 2020a; He et al., 2020; Grill et al., 2020; Caron et al., 2020). The core idea of instance discrimination is to push away different images, and encourage the representation of different transformations (augmentations) of the same image to be similar. Following this paradigm, self-supervised models are able to generate features that are comparable or even better than those produced by supervised pretraining when evaluated on some downstream tasks, e.g.,COCO detection and segmentation (Chen et al., 2020c;b).
|
| 12 |
+
|
| 13 |
+
In contrastive learning, the positive pairs are simply constrained within different transformations of the same image, e.g., cropping, color distortion, Gaussian blur, rotation, etc.. Recent advances have demonstrated that better data augmentations (Chen et al., 2020a) really help to improve the representation robustness. However, contrasting two images that are de facto similar in semantic space is not applicable for general representations. It is intuitive to pull semantically similar images for better transferability. DeepCluster (Caron et al., 2018) and Local Aggregation (Zhuang et al., 2019) relax the extreme instance discrimination task via discriminating groups of images instead of an individual image. However, due to the lack of labels, it is inevitable that the positive pairs contain noisy samples, which limits the performance.
|
| 14 |
+
|
| 15 |
+
In this paper, we target at expanding instance discrimination by exploring local similarities among images. Towards this goal, one need to solve two issues: i) how to select similar images as positive pairs of an image, and ii) how to incorporate these positive pairs, which inevitably contain noisy assignments, into contrastive learning. We propose a new kind of data augmentation, named Centerwise Local Image Mixture, to tackle the above two issues in a robust and efficient way. CLIM consists of two core elements, i.e., a center-wise positive sample selection, as well as a data mixing operation. For positive sample selection, the motivation is that a good representation should be endowed with high intra-class similarity, and we find that although MoCo (He et al., 2020) does not explicitly model invariance to similar images, the intra-class similarity becomes higher as the training process goes. Based on this observation, we explicitly enforce semantically similar images towards the center of clusters, and generate representation with higher intra-class similarity, which we find is beneficial for few shot learning. This is achieved by searching nearest neighbors of an image, and only retaining similar samples that are closer to the corresponding cluster center, which we denote as center-wise local sample selection. As a result, an image is pulled towards the center while do not break the local similarity.
|
| 16 |
+
|
| 17 |
+
Once similar samples are selected, a direct way is to treat these similar samples as multiple positives for contrastive learning. However, since feature representation in high dimensional space is complex, the returned positive samples inevitably contain noisy assignments, which should not be overconfident. Instead, we rely on data mixing as augmented samples, which can be treated as a smoothing regularization in unsupervised learning. In particular, we apply Cutmix (Yun et al., 2019), a widely used data augmentation in supervised learning, where patches are cut and pasted among the positive pairs to generate new samples. Benefit from the center-wise sample selection, the Cutmix augmentation is only constrained within the local neighborhood of an image, and can be treated as an expansion of current neighborhood space. In this way, similar samples are pulled together in a smoother and robust way, which we find is beneficial for general representation.
|
| 18 |
+
|
| 19 |
+
Furthermore, we propose multi-resolution augmentation, which aims at contrasting the same image (patch) at different resolutions explicitly, to enable the representation to be scale invariant. We argue that although previous operations such as crop and resize introduce multi-resolution implicitly, they do not compare the same patch at different resolutions directly. As comparisons, multi-resolution incorporates scale invariance into contrastive learning, and significantly boosts the performance even based on a strong baseline. The multi-resolution strategy is simple but effective, and can be combined with current data augmentations for further improving performance.
|
| 20 |
+
|
| 21 |
+
We evaluate the feature representation on several self-supervised learning benchmarks. In particular, on ImageNet linear evaluation protocol, we achieve $7 5 . 5 \%$ top-1 accuracy with a standard ResNet50. In few shot setting, when finetuned with only $1 \%$ labels, we achieve $5 9 . 3 \%$ top-1 accuracy, surpassing previous works by a large margin. We also validate its transferring ability on several downstream tasks, and consistently outperform the fully supervised counterparts.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Unsupervised Representation Learning. Unsupervised learning aims at exploring the intrinsic distribution of data samples via constructing a series of pretext tasks without human labels. These pretext tasks take many forms and vary in utilizing different properties of images. Among them, one family of methods takes advantage of the spatial properties of images, typical pretext tasks include predicting the relative spatial positions of patches (Doersch et al., 2015; Noroozi & Favaro, 2016), or inferring the missing parts of images by inpainting (Pathak et al., 2016), colorization (Zhang et al., 2016), or rotation prediction (Gidaris et al., 2018). Recent progress in self-supervised learning mainly benefits from instance discrimination, which regards each image (and augmentations of itself) as one class for contrastive learning. The motivation behind these works is the InfoMax principle, which aims at maximizing mutual information (Tian et al., 2019; Wu et al., 2018) across different augmentations of the same image (He et al., 2020; Chen et al., 2020a), (Tian et al., 2019).
|
| 26 |
+
|
| 27 |
+
Data Augmentation. Instance discrimination makes use of several data augmentations, e.g., random cropping, color jittering, horizontal flipping, to define a large view set of vicinities for each image. As has been demonstrated (Chen et al., 2020a; Tian et al., 2020), the effectiveness of instance discrimination methods strongly relies on the type of augmentations. Hoping that the network holds invariance in the local vicinities of each sample. However, current data augmentations are mostly constrained within a single image. An exception is (Shen et al., 2020), where image mixture is used for flattened contrastive predictions. However, such mixture strategy is conducted among all images, which destroys the local similarity when contrasting mixed samples that are semantic dissimilar.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: An illustration of the proposed CLIM and multi-resolution data augmentations.
|
| 31 |
+
|
| 32 |
+
Beyond self-supervised learning, mixing samples from different images is widely used to help alleviate overfitting in training deep networks. In particular, Mixup (Zhang et al., 2017) combines two samples linearly on pixel level, where the target of the synthetic image was a linear combination of one-hot labels. Following Mixup, there are a few variants (Verma et al., 2018) as well as a recent effort named Cutmix (Yun et al., 2019), which combined Mixup and Cutout (DeVries & Taylor, 2017) by cutting and pasting patches.
|
| 33 |
+
|
| 34 |
+
# 3 METHOD
|
| 35 |
+
|
| 36 |
+
In this section, we start by reviewing contrastive learning for unsupervised representation learning. Then we elaborate our proposed CLIM data augmentation, which targets at pulling similar samples via center-wise similar sample selection, followed by a cutmix data augmentation. We also present multi-resolution augmentation that we observe further improves the performance, as well as detailed analysis with recent methods that share similar targets with our method.
|
| 37 |
+
|
| 38 |
+
# 3.1 CONTRASTIVE LEARNING
|
| 39 |
+
|
| 40 |
+
Contrastive learning targets at training an encoder to map positive pairs to similar representations while pushing away the negative samples in the embedding space. Given unlabeled training set $X = \{ x _ { 1 } , x _ { 2 } , . . . , x _ { n } \}$ . Instance-wise contrastive learning aims to learn an encoder $f _ { q }$ that maps the samples $\boldsymbol { X }$ to embedding space $V = \{ v _ { 1 } , v _ { 2 } , . . . , v _ { n } \}$ by optimizing a contrastive loss. Take the Noise Contrastive Estimator (NCE) (Oord et al., 2018) as an example, the contrastive loss is defined as:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\mathcal { L } _ { n c e } ( x _ { i } , x _ { i } ^ { \prime } ) = - \log \frac { \exp ( f _ { q } ( x _ { i } ) \cdot f _ { k } ( x _ { i } ^ { \prime } ) / \tau ) } { \exp ( f _ { q } ( x _ { i } ) \cdot f _ { k } ( x _ { i } ^ { \prime } ) / \tau ) + \sum _ { j = 1 } ^ { K } \exp ( f _ { q } ( x _ { i } ) \cdot f _ { k } ( x _ { j } ^ { \prime } ) / \tau ) ) } ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\tau$ is the temperature parameter, and $x _ { i } ^ { \prime }$ and $\boldsymbol { x } _ { j } ^ { \prime }$ denote the positive and negative samples of $x _ { i }$ , respectively. The encoder $f _ { k }$ can be shared (Chen et al., 2020a; Caron et al., 2020) or momentum update of the encoder $f _ { q }$ (He et al., 2020).
|
| 47 |
+
|
| 48 |
+
# 3.2 CLIM: CENTER-WISE LOCAL IMAGE MIXTURE
|
| 49 |
+
|
| 50 |
+
In contrastive learning, each sample as well as its augmentations is treated as a separate class, while all other samples are regarded as negative examples and pushed away. In principle, semantically similar samples should have similar feature representation in the embedding space, while current contrastive strategies do not consider the semantic similarities among different samples, and only choose different views of the same sample as positive pairs. To solve this issue, we propose a new kind of data augmentation, termed as Center-wise Local Image Mixture, which pulls samples that are semantically similar in an efficient and robust way. The proposed CLIM augmentation consists of two elements, i.e., center-wise local similar sample selection, and a cutmix data augmentation, which would be described in details in the following.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Comparison of three positive sample selection strategies, i.e., k-means, knn, and the proposed center-wise local sample selection.
|
| 54 |
+
|
| 55 |
+
# 3.2.1 CENTER-WISE LOCAL POSITIVE SAMPLE SELECTION
|
| 56 |
+
|
| 57 |
+
As noted by (Wang & Isola, 2020), a good representation should satisfy both alignment and uniformity, which encourages similar images to have similar representation in the embedding space, and meanwhile, semantically similar features are well-clustered. Towards this goal, we propose a positive sample selection strategy that considers both local similarity and global aggregation. This is achieved by searching similar samples within a cluster that the anchor sample belongs to, and only retaining samples that are closer to the corresponding cluster center. We denote it as center-wise local selection as these samples are picked out towards the cluster center among the local neighborhood of an image. In this way, similar samples are progressively pulled to the predefined cluster centers, while do not break the local similarity.
|
| 58 |
+
|
| 59 |
+
Specifically, given a set of unlabeled images $X = \{ x _ { 1 } , x _ { 2 } , . . . , x _ { n } \}$ and the corresponding embedding $V = \{ v _ { 1 } , v _ { 2 } , . . . , v _ { n } \}$ with encoder $f _ { \theta }$ , where $v _ { i } = f _ { \theta } ( x _ { i } )$ . We cluster the representations $V$ using a standard $\mathbf { k }$ -means algorithm, and obtain $m$ centers $\mathbf { C } = \{ c _ { 1 } , c _ { 2 } , . . . , c _ { m } \}$ . Given an anchor $x _ { i }$ with its assigned cluster $c ( x _ { i } ) \in C$ , denote the sample set that belongs to $c ( x _ { i } )$ as $\Omega _ { 1 } = \{ x | c ( x ) = c ( x _ { i } ) \}$ . We search the $k$ nearest neighbors of $x _ { i }$ over the entire space with L2 distance, obtaining sample set $\pmb { \Omega } _ { 2 } = \{ x _ { i 1 } , . . . , x _ { i k } \}$ . The positive samples are selected based on the following rule:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\Omega _ { p } = \{ x | d ( f _ { \theta } ( x ) , v _ { c ( x _ { i } ) } ) \leq d ( f _ { \theta } ( x _ { i } ) , v _ { c ( x _ { i } ) } ) , x \in \Omega _ { 1 } \cap \Omega _ { 2 } \} ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $d ( \cdot , \cdot )$ denotes the L2 distance of two samples, and $v _ { c ( x _ { i } ) }$ denotes the feature representation of the corresponding cluster center, respectively. In this way, the samples are aggregated towards the predefined clusters, and meanwhile maintaining the local similarity.
|
| 66 |
+
|
| 67 |
+
Our method combines the advantages of cluster and nearest neighbor methods. An illustration comparing the three methods is shown in Fig. 2. Cluster-based method regards all samples that belong to the same center as positive pairs, which breaks the local similarity among samples especially when the anchor is around the boundary. While nearest neighbor-based method independently pulling samples of an anchor, and does not encourage the well-clustered goal. As a result, the embedding space is not highly concentrated among multiple similar anchors. As comparisons, by center-wise sample selection, similar samples are progressively pulled to the predefined center as well as considering the local similarity. In the experimental section, we would compare the performance of the three methods, and validate the superior performance of our proposed selection strategy.
|
| 68 |
+
|
| 69 |
+
# 3.2.2 CUTMIX DATA AUGMENTATION
|
| 70 |
+
|
| 71 |
+
Once we obtain the positive samples of an anchor, one direct way is to treat these samples similar as the augmented ones for contrastive learning. However, similarity computation in high dimensional space inevitably contains noisy samples, which should not be overconfident for contrasting. To solve this issue, we make use of data mixture strategy, which aims at mixing patches from two different images as augmented samples for contrasting. Data mixing is widely used in supervised learning as label smoothing regularization. The highlight is that without image level labels, we are not able to assign new labels to the augmented samples. Instead, we only mixing samples that are similar in representation, and the mixed samples can be treated as an augmented version of the anchor. In this way, these mixed samples, as well as traditional data augmentations, can be pulled together in contrastive learning. Specifically, given a positive pair $( x _ { i } , \tilde { x } _ { i } )$ , we conduct data mixing as follows:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
x _ { m i x } = \mathbf { M } \odot x _ { i } + ( \mathbf { 1 } - \mathbf { M } ) \odot \tilde { x } _ { i } ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\mathbf { M } \in \{ 0 , 1 \} ^ { W \times H }$ denotes a binary mask indicating the mixed rectangle region of an image, i.e., where to cutout the region in $x _ { i }$ and replaced with a randomly selected patch from ${ \tilde { x } } _ { i }$ , and $W , H$ denotes the wide and height of an image, respectively. 1 is a binary mask filled with ones, and $\odot$ is the element-wise multiplication operation. For mask $\mathbf { M }$ generation, we follow the setting in (Yun et al., 2019). For the mixed sample $x _ { m i x }$ , the positive sample can be either $x _ { i }$ or $\tilde { x } _ { i }$ , and we reformulate the contrastive learning as combing two NCE loss:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
{ \mathcal L } _ { m i x } ( x _ { i } , \tilde { x } _ { i } ) = \lambda \cdot { \mathcal L } _ { n c e } ( x _ { m i x } , x _ { i } ) + ( 1 - \lambda ) \cdot { \mathcal L } _ { n c e } ( x _ { m i x } , \tilde { x } _ { i } ) .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Where the combination ratio $\lambda$ is sampled from beta distribution $\mathtt { B e t a } ( \alpha , \alpha )$ with parameter $\alpha$ . The proposed data mixing augmentation can be seamlessly incorporated into current contrastive learning. The advantages are twofold: first, mixed samples help to expand the neighborhood space of current anchor sample for better representation; second, minimizing the two terms simultaneously can help to maximize the mutual information between $x _ { i }$ and ${ \tilde { x } } _ { i }$ in a soft manner and perform as smoothing regularization on the prediction for selected positive samples.
|
| 84 |
+
|
| 85 |
+
# 3.3 MULTI-RESOLUTION DATA AUGMENTATION
|
| 86 |
+
|
| 87 |
+
Data augmentation plays a key role in current contrastive learning, among them crop augmentation is one of the most effective way (Chen et al., 2020a). In a typical crop augmentation, a sample $x$ with size $H \times W$ is randomly cropped with ratio $\sigma$ , and resized to $K _ { t r a i n } \times K _ { t r a i n }$ as augmented samples, where $K _ { t r a i n } \times K _ { t r a i n }$ denotes the input resolution for model training. Hence the scaling factor w.r.t. sample $x$ can be described as:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
s = \frac { 1 } { \sigma } \cdot \frac { K _ { t r a i n } } { \sqrt { H \times W } } .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
For crop augmentation, the parameter $K _ { t r a i n }$ is fixed, and the crop ratio $\sigma$ is randomly selected among positive pairs. As a result, different crop augmentations usually contain different contents, which can be regarded as modeling occlusion invariance to some extent, where each crop sees one view of an image. In this section, we propose a simple but effective data augmentation strategy, named multi-resolution augmentation, which enables the representation to be scale invariant of an example. The highlight is that it is better for contrasting positive pairs with the same content but different resolutions. Specifically, for each positive we keep the crop ratio $\sigma$ fixed, and adjust $K _ { t r a i n }$ to different resolutions for contrastive loss. An illustration is shown in Fig. 1 .Using multi-resolution, the objective function can be generalized as:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathcal { L } _ { m r } = \sum _ { r , r ^ { \prime } \in \{ r _ { 1 } , \ldots , r _ { n } \} } \mathcal { L } _ { m i x } ( x _ { i } ^ { r } , \tilde { x } _ { i } ^ { r ^ { \prime } } ) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\{ r _ { 1 } , . . . , r _ { n } \}$ indicates the resolution set. In this way, the encoder would be encouraged to discriminate the positive samples with different resolutions from a series of negative keys, which will maximize the mutual information between inputs with different resolutions and discard redundant information brought by resolutions.
|
| 100 |
+
|
| 101 |
+
Relation with Multi-crop Augmentation. There exist recent works that aim at improving crop augmentations, including multi-crop (Caron et al., 2020) and jigsaw-crop (Misra & Maaten, 2020). However, both methods target at reducing crop ratio $\sigma$ in Eq.5 and resolution $K _ { t r a i n }$ simultaneously to bridge different parts of an object, and do not explicitly model scale invariance. As comparisons, our proposed multi-resolution strategy fixes the crop ratio to explicitly model scale invariance. In the experimental section, we would compare these two augmentations to validate the difference.
|
| 102 |
+
|
| 103 |
+
Table 1: Top-1 accuracies under linear evaluation on ImageNet, using ResNet-50 as encoder
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Method Accuracy (%)</td></tr><tr><td>Supervised 76.5</td></tr><tr><td>Colorization (Zhang et al., 2016) 39.6</td></tr><tr><td>Jigsaw (Noroozi & Favaro, 2016) 45.7</td></tr><tr><td>NPID (Wu et al., 2018) 54.0</td></tr><tr><td>LA (Zhuang et al., 2019) 58.8</td></tr><tr><td>MoCo (He et al., 2020) 60.6</td></tr><tr><td>SeLa (YM. et al., 2020) 61.5</td></tr><tr><td>PIRL (Misra & Maaten,2020) 63.6</td></tr><tr><td>CPCv2 (Henaff et al., 2019) 63.8</td></tr><tr><td>PCL (Li et al., 2020) 65.9</td></tr><tr><td>SimCLR (Chen et al., 2020a) 70.0</td></tr><tr><td>MoCo v2 (Chen et al., 2020c) 71.1</td></tr><tr><td>SimCLRv2 (Chen et al., 2020b) 71.7</td></tr><tr><td>InfoMin (Tian et al.,2020) 73.0</td></tr><tr><td>BYOL (Grill et al., 2020) 74.3</td></tr><tr><td>SwAV (Caron et al., 2020) 75.3</td></tr><tr><td>CLIM 75.5</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Table 2: Semi-supervised learning with few shot ImageNet labels, using ResNet50 as encoder (averaged by 5 trials)
|
| 108 |
+
|
| 109 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Top-1/Top-5</td></tr><tr><td>1% labels 10% labels</td><td></td></tr><tr><td>Supervised</td><td>25.4 48.4 56.4 56.4</td></tr><tr><td>PIRL</td><td>30.7 57.2 60.4 83.8</td></tr><tr><td>SimCLR</td><td>48.3 75.5 65.6 87.8</td></tr><tr><td>MoCo v2</td><td>52.4 78.4 65.3 86.6</td></tr><tr><td>BYOL</td><td>53.2 78.4 68.8 89.0</td></tr><tr><td>SwAV</td><td>53.9 78.5 70.2 89.9</td></tr><tr><td>SimCLRv2</td><td>57.9 82.5 68.4 89.2</td></tr><tr><td>CLIM</td><td>59.3 81.6 70.0 89.3</td></tr></table>
|
| 110 |
+
|
| 111 |
+
Table 3: Transfer learning on VOC object detection (averaged by 5 trials).
|
| 112 |
+
|
| 113 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Accuracy (%)</td></tr><tr><td>AP50</td><td>AP75</td></tr><tr><td>Supervised</td><td>81.4</td><td>58.8</td></tr><tr><td>MoCo v2</td><td>82.5</td><td>64.0</td></tr><tr><td>SwAV</td><td>82.6</td><td>:</td></tr><tr><td>CLIM</td><td>82.8</td><td>64.5</td></tr></table>
|
| 114 |
+
|
| 115 |
+
Relation with Fix-Res. The proposed multi-resolution augmentation is reminiscent of recent work FixRes (Touvron et al., 2019), which also explores resolution issue of better representation, but they are different in both motivation and goal. FixRes is based on the observation that data augmentations induce a significant discrepancy between the size of the objects seen by the classifier at train and test time, and employs different train and test resolutions to fix the train-test resolution discrepancy. The goal is to require less scale invariance for the neural net in FixRes. While our multi-resolution augmentation aims to model the scale invariance explicitly, which is not carefully considered in previous self-supervised learning.
|
| 116 |
+
|
| 117 |
+
# 4 EXPERIMENTAL RESULTS
|
| 118 |
+
|
| 119 |
+
In this section, we assess our pretrained feature representation on several unsupervised benchmarks. We evaluate it on ImageNet under linear evaluation and semi-supervised settings. Then we transfer the learned features to different downstream tasks. We also analyze the performance of our representation with detailed ablation studies. For brief expression, except for the ablation study, we denote our method as CLIM, which includes two kinds of data augmentations.
|
| 120 |
+
|
| 121 |
+
# 4.1 LINEAR EVALUATION ON IMAGENET
|
| 122 |
+
|
| 123 |
+
The feature representation is trained based on ImageNet 2012 (Russakovsky et al., 2015), using a standard ResNet-50 structure as backbone. We follow the setting in MoCo v2 (Chen et al., 2020c), and the training details are listed in Appendix A. We first evaluate our features by training a linear classifier on top of the frozen representation, following a common protocol in (He et al., 2020; Tian et al., 2019). For linear classifier, the learning rate is initialized as 30 and decayed by 0.1 after 60, 80 epochs, respectively. Table 1 shows the top-1 accuracies with center crop evaluation. Our method achieves an accuracy of $7 5 . 5 \%$ , surpassing MoCo v2 baseline $( 7 1 . 1 \% )$ by $4 . 4 \%$ , and nearly approaching the supervised learning baseline $( 7 6 . 5 \% )$ .
|
| 124 |
+
|
| 125 |
+
Table 4: Transfer learning on COCO detection and instance segmentation (averaged by 5 trials)
|
| 126 |
+
|
| 127 |
+
<table><tr><td rowspan=3 colspan=1>Method</td><td rowspan=1 colspan=2>Mask R-CNN,R50-FPN,Det</td><td rowspan=1 colspan=2>Mask R-CNN,R50-FPN,InsSeg</td></tr><tr><td rowspan=1 colspan=1>1× schedule</td><td rowspan=1 colspan=1>2× schedule</td><td rowspan=1 colspan=1>1× schedule</td><td rowspan=1 colspan=1>2× schedule</td></tr><tr><td rowspan=1 colspan=1>AP66AP0AP</td><td rowspan=1 colspan=1>AP66AP0AP</td><td rowspan=1 colspan=1>APmkAPAP7</td><td rowspan=1 colspan=1>APmkAPAP7</td></tr><tr><td rowspan=1 colspan=1>Supervised</td><td rowspan=1 colspan=1>38.959.642.0</td><td rowspan=1 colspan=1>40.661.344.4</td><td rowspan=1 colspan=1>35.4 56.5 38.1</td><td rowspan=1 colspan=1>36.8 58.1 39.5</td></tr><tr><td rowspan=1 colspan=1>MoCo v2</td><td rowspan=1 colspan=1>39.259.942.7</td><td rowspan=1 colspan=1>41.562.245.3</td><td rowspan=1 colspan=1>35.7 56.8 38.1</td><td rowspan=1 colspan=1>37.5 59.1 40.1</td></tr><tr><td rowspan=1 colspan=1>CLIM</td><td rowspan=1 colspan=1>39.560.043.3</td><td rowspan=1 colspan=1>41.862.345.7</td><td rowspan=1 colspan=1>35.8 57.0 38.6</td><td rowspan=1 colspan=1>37.7 59.4 40.5</td></tr></table>
|
| 128 |
+
|
| 129 |
+
# 4.2 SEMI-SUPERVISED TRAINING ON IMAGENET
|
| 130 |
+
|
| 131 |
+
We also evaluate our method by fine-tuning the pretrained model with a small subset of labels, following the semi-supervised settings in (Grill et al., 2020; Kornblith et al., 2019; Chen et al., 2020a; Caron et al., 2020). For fair comparisons, we use the same fixed $1 \%$ and $1 0 \%$ splits of training data as in (Chen et al., 2020a), and fine-tune all layers using SGD optimizer with momentum of 0.9, and learning rate of 0.0001 for backbone, 10 for the newly initialized fc layer. The fine-tune epochs is set as 60, and the learning rate is decayed by 0.1 after every 20 epochs. During training, only random cropping and flipping data augmentations are used for fair comparison. The results are reported in Table 2. CLIM achieves $5 9 . 3 \%$ top-1 accuracy with only $1 \%$ labels, and $7 0 . 0 \%$ with $1 0 \%$ labels. The performance gains are larger with $1 \%$ labels, e.g., $6 . 1 \%$ higher than BYOL, and $5 . 4 \%$ better than SwAV, which demonstrates that the proposed feature representation is mainly suitable for extremely few shot learning. Note that SimCLR v2 makes use of other tricks like more MLP layers for better performance, while our method simply adds one fc layer, and still achieves better performance under both settings.
|
| 132 |
+
|
| 133 |
+
# 4.3 DOWNSTREAM TASKS
|
| 134 |
+
|
| 135 |
+
We also evaluate our feature representation on several downstream tasks, including object detection and instance segmentation, to evaluate the transferability of the learned features. For fair comparison, all experiments follow MoCo settings.
|
| 136 |
+
|
| 137 |
+
PASCAL VOC Object Detection. Following the evaluation protocol in (He et al., 2020), we use Faster R-CNN (Ren et al., 2015) with R50-C4 as backbone. We fine-tune all layers on the trainval set of $\mathrm { \ V O C { 0 7 + 1 2 } }$ for $2 \times$ schedule and evaluate on the test set of VOC2007. We report the performances under the metric of AP50 and AP75. As shown in Table 3, on PASCAL VOC, CLIM achieves $8 2 . 8 \%$ and $6 4 . 5 \%$ mAP under AP50 and AP75 metric, which is 1.4 points and 5.7 points higher than the fully supervised counterparts, and is slightly better than the results of MoCo v2.
|
| 138 |
+
|
| 139 |
+
COCO Object Detection and Instance Segmentation. We also evaluate the representation learned on a large scale COCO dataset. Following (He et al., 2020), we choose Mask R-CNN with FPN as backbone, and fine-tune all the layers on the train set and evaluate on the val set of COCO2017. In Table 4, we report results under both $1 \times$ and $2 \times$ schedules. We show that CLIM consistently outperforms the supervised pretrained model and MoCo v2. Under 2X schedule, we achieve $4 1 . 8 \%$ and $3 7 . 7 \%$ detection and segmentation accuracies, respectively, which is 1.2 points and 1.1 points better than the supervised couterparts, and also slightly better than the highly optimized MoCo v2.
|
| 140 |
+
|
| 141 |
+
LVIS Long Tailed Instance Segmentation. Different from VOC and COCO where the number of training samples is comparable, LVIS is a long-tailed dataset, which contains more than 1200 categories, among them some categories only have less than ten instances. The main challenge is to learn accurate few shot models for classes among the tail of the class distribution, for which little data is available. We evaluate our features on this long-tailed dataset to validate how the unsupervised representation boosts the performance. Similarly, we fine-tune the model (Mask R-CNN, R50-FPN) on the train set and evaluate on the val set of Lvis v0.5. Table 5 shows the result under $2 \times$ schedule. CLIM outperforms the supervised pretrained model by a large margin and is slightly better than MoCo v2. We claim that it is mainly to the proposed data mixing data augmentation, which is able to learn generalized representations even with extremely few labeled data.
|
| 142 |
+
|
| 143 |
+
Table 5: Transfer learning on LVIS long-tailed instance segmentation (averaged by 5 trials)
|
| 144 |
+
|
| 145 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Object Det</td><td colspan="3">Instance Seg</td></tr><tr><td>AP66</td><td>AP</td><td>AP</td><td>AP66</td><td>AP</td><td>APm</td></tr><tr><td>Supervised</td><td>24.1</td><td>39.4</td><td>25.0</td><td>24.2</td><td>37.8</td><td>25.1</td></tr><tr><td>MoCo v2</td><td>25.1</td><td>40.4</td><td>26.1</td><td>25.3</td><td>38.4</td><td>27.0</td></tr><tr><td>CLIM</td><td>25.5</td><td>41.2</td><td>26.7</td><td>25.6</td><td>39.5</td><td>27.5</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 6: Impact of different sample selection
|
| 148 |
+
|
| 149 |
+
<table><tr><td rowspan="2">Strategy</td><td colspan="2">Accuracy (%)</td></tr><tr><td>no mixing</td><td>+cutmix</td></tr><tr><td>MoCo v2</td><td>67.5</td><td>-</td></tr><tr><td>Random</td><td>62.3</td><td>67.1</td></tr><tr><td>KNN</td><td>68.3</td><td>69.5</td></tr><tr><td>K-means</td><td>68.0</td><td>69.2</td></tr><tr><td>KNN ∩ K-means</td><td>68.5</td><td>69.6</td></tr><tr><td>Center-wise</td><td>69.3</td><td>70.1</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 7: Impact of different multiple resolutions
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Method</td><td>Resolution</td><td>Accuracy (%)</td></tr><tr><td>Multi-Crop</td><td>2×224 + 2×96</td><td>69.7</td></tr><tr><td rowspan="4">Multi-Reso</td><td>r,r'∈ {224,96}</td><td>70.4</td></tr><tr><td>r,r' ∈ {224,128}</td><td>71.7</td></tr><tr><td>r,r' ∈ {224,160}</td><td>72.3</td></tr><tr><td>r,r'∈ {224,224}</td><td>71.4</td></tr></table>
|
| 154 |
+
|
| 155 |
+
# 4.4 ABLATION STUDY
|
| 156 |
+
|
| 157 |
+
In this section, we present ablation studies to better understand how each component affects the performance. Detailed comparisons include 1) positive sample selection, 2) cutmix data augmentation, and 3) multi-resolution augmentation. Unless specified, we train the model for 200 epochs over the ImageNet-1000 and report the top-1 classification accuracy under linear evaluation protocol.
|
| 158 |
+
|
| 159 |
+
Positive Sample Selection. We first analyze the advantages of our proposed center-wise local sample selection strategy. The compared sample selection alternatives include:
|
| 160 |
+
|
| 161 |
+
• Random selection: Randomly select a sample from all unlabeled data.
|
| 162 |
+
• KNN selection: Use $\mathbf { k }$ -nearest neighbors to build the correlation map among samples, and randomly select a sample from the Top- $k$ $k = 1 0$ ) nearest neighbors as positive samples.
|
| 163 |
+
• K-means selection: Use $\mathbf { k }$ -means clustering algorithm to obtain $k$ cluster centers, and randomly select a sample from the corresponding cluster as positive samples.
|
| 164 |
+
|
| 165 |
+
• KNN ∩ K-means selection: Use K-means clustering algorithm to obtain $k$ cluster centers, and randomly select nearest neighbor within the cluster as positive samples.
|
| 166 |
+
|
| 167 |
+
The results are shown in the second column of Table 6. In order the inspect the influence of sample selection, we do not conduct cutmix augmentation, and these positive samples are simply pulled via a standard contrastive loss. It can be shown that comparing with the MoCo baseline, both KNN and cluster-based sample selection boost the performance, and notably, simply selecting the union of knn and k-means achieves $\cdot$ accuracy, which is comparable with result that directly using knn. Since for samples not lie around the boundary, it equals to knn, and does not encourage intra-class compactness. As comparison, our proposed center-wise selection strategy outperforms all the above selection methods.
|
| 168 |
+
|
| 169 |
+
Cutmix Data Augmentation. Data mixing helps to expand the neighborhood space of the target sample, and acts as smoothing regularization for the prediction. As shown in the third column of Table 6, cutmix augmentation consistently improve the performance, comparing with directly pulling similar samples in contrastive loss, and achieve $7 0 . 1 \%$ accuracy with only 200 training epochs. Notably, with randomly selected positive samples, cutmix operation even obtains $6 7 . 1 \%$ accuracy, slightly lower than the MoCo baseline, while significantly better than no mixing with only $6 2 . 3 \%$ accuracy. This can be attributed to the smoothing regularization of cutmix, which is able to alleviate the effect of noisy samples and update model in a more robust way.
|
| 170 |
+
|
| 171 |
+
Multiple Resolution. Based on CLIM, we further add multi-resolution data augmentation to validate its effectiveness. The results of introducing different resolutions are shown in Table 7. Using multiple resolutions setting with $r , r ^ { \prime } \in \{ 2 2 4 , 1 \bar { 6 } 0 \}$ , our method achieves an accuracy of $7 2 . 3 \%$ with only 200 epochs, which surpasses the baseline of MoCo by $4 . 8 \%$ , and even much better than the results of MoCo with 800 epochs $( 7 1 . 1 \% )$ ).
|
| 172 |
+
|
| 173 |
+
We also compare our multi-resolution augmentation with multi-crop augmentation proposed in (Caron et al., 2020). $2 \times 2 2 4 + 2 \times 9 6$ denotes using two $2 2 4 \times 2 2 4$ crops with crop-scale $\sigma \sim U ( 0 . 2 , 1 . 0 )$ and two $9 6 \times 9 6$ crops with $\sigma \sim U ( 0 . 0 \bar { 5 } , 0 . 1 4 )$ , referring to (Caron et al., 2020). The main difference is that, the multi-crop strategy targets at capturing relationship between local and global information, while our proposed multiple resolution target at enabling the encoder with scale invariance. We find that multi-crop slightly deteriorates the performance of CLIM $( 7 0 . 1 \%$ versus $6 9 . 7 \%$ ), partially because data mixing behaves like image cropping augmentation, and shares similarity with multi-crop strategy.
|
| 174 |
+
|
| 175 |
+
# 5 CONCLUSION
|
| 176 |
+
|
| 177 |
+
In this work, we proposed CLIM data augmentation, to efficiently pull semantically similar samples for better representation in contrastive learning. The main contributions of CLIM consist of two elements, center-wise positive sample selection, which considers both local similarity and global aggregation property. In such way, similar samples are progressively aggregated to a series of predefined clusters, while not breaking the local similarity; and data mixing augmentation, which expands the neighborhood space of an example by mixing two images, and acts as a smoothing regularization for contrastive loss. Furthermore, we present a simple but effective multi-resolution augmentation, which explicitly model scale invariance to further improve the representation. Experiments evaluated on several unsupervised benchmarks demonstrate the effectiveness of our method.
|
| 178 |
+
|
| 179 |
+
# REFERENCES
|
| 180 |
+
|
| 181 |
+
Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 132–149, 2018.
|
| 182 |
+
Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882, 2020.
|
| 183 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020a.
|
| 184 |
+
Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big selfsupervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020b.
|
| 185 |
+
Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020c.
|
| 186 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 187 |
+
Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE international conference on computer vision, pp. 1422–1430, 2015.
|
| 188 |
+
Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018.
|
| 189 |
+
Jean-Bastien Grill, Florian Strub, Florent Altche, Corentin Tallec, Pierre H Richemond, Elena ´ Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020.
|
| 190 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9729–9738, 2020.
|
| 191 |
+
|
| 192 |
+
Olivier J Henaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, SM Eslami, and ´ Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019.
|
| 193 |
+
|
| 194 |
+
Jeff Johnson, Matthijs Douze, and Herve J ´ egou. Billion-scale similarity search with gpus. ´ IEEE Transactions on Big Data, 2019.
|
| 195 |
+
|
| 196 |
+
Simon Kornblith, Jonathon Shlens, and Quoc V Le. Do better imagenet models transfer better? In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2661–2671, 2019.
|
| 197 |
+
|
| 198 |
+
Junnan Li, Pan Zhou, Caiming Xiong, Richard Socher, and Steven CH Hoi. Prototypical contrastive learning of unsupervised representations. arXiv preprint arXiv:2005.04966, 2020.
|
| 199 |
+
|
| 200 |
+
Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6707–6717, 2020.
|
| 201 |
+
|
| 202 |
+
Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pp. 69–84. Springer, 2016.
|
| 203 |
+
|
| 204 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 205 |
+
|
| 206 |
+
Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2536–2544, 2016.
|
| 207 |
+
|
| 208 |
+
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, pp. 91–99, 2015.
|
| 209 |
+
|
| 210 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 211 |
+
|
| 212 |
+
Zhiqiang Shen, Zechun Liu, Zhuang Liu, Marios Savvides, and Trevor Darrell. Rethinking image mixture for unsupervised visual representation learning. arXiv preprint arXiv:2003.05438, 2020.
|
| 213 |
+
|
| 214 |
+
Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019.
|
| 215 |
+
|
| 216 |
+
Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. arXiv preprint arXiv:2005.10243, 2020.
|
| 217 |
+
|
| 218 |
+
Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Herve J ´ egou. Fixing the train-test resolution ´ discrepancy. In Advances in Neural Information Processing Systems, pp. 8252–8262, 2019.
|
| 219 |
+
|
| 220 |
+
Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, Aaron Courville, David Lopez-Paz, and Yoshua Bengio. Manifold mixup: Better representations by interpolating hidden states. arXiv preprint arXiv:1806.05236, 2018.
|
| 221 |
+
|
| 222 |
+
Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. arXiv preprint arXiv:2005.10242, 2020.
|
| 223 |
+
|
| 224 |
+
Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3733–3742, 2018.
|
| 225 |
+
|
| 226 |
+
Asano YM., Rupprecht C., and Vedaldi A. Self-labelling via simultaneous clustering and representation learning. In International Conference on Learning Representations (ICLR), 2020.
|
| 227 |
+
|
| 228 |
+
Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE International Conference on Computer Vision, pp. 6023–6032, 2019.
|
| 229 |
+
|
| 230 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 231 |
+
|
| 232 |
+
Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European conference on computer vision, pp. 649–666. Springer, 2016.
|
| 233 |
+
|
| 234 |
+
Chengxu Zhuang, Alex Lin Zhai, and Daniel Yamins. Local aggregation for unsupervised learning of visual embeddings. In Proceedings of the IEEE International Conference on Computer Vision, pp. 6002–6012, 2019.
|
| 235 |
+
|
| 236 |
+
A IMPLEMENTATION DETAILS
|
| 237 |
+
|
| 238 |
+
# A.1 IMPLEMENTATION DETAILS FOR CONTRASTIVE PRETRAINING
|
| 239 |
+
|
| 240 |
+
Architecture and Optimization. We follow the setting in MoCo v2 (Chen et al., 2020c), which relies on two encoders, one for training and the other one for momentum update $m = 0 . 9 9 9$ ) to store negative keys. Following SimCLR (Chen et al., 2020a), we replace the fc head with a 2-layer MLP to project the output of the final pooling layer to 128-d. We use SGD as optimizer, with weight decay setting as 0.0001 and the momentum as 0.9. We use a mini-batch size of 512 on 16 V100 GPUs with a cosine learning rate schedule decayed from 0.06. We train the model for 1200 epochs, as we introducing data mixing augmentation, and usually requires more epochs for better performance as in supervised learning (Yun et al., 2019). 1
|
| 241 |
+
|
| 242 |
+
Image Augmentations. We combine the proposed augmentations with previous widely used basic augmentation strategies, following the settings in (Chen et al., 2020a; He et al., 2020). The basic augmentations are listed below, as well as the corresponding parameters.
|
| 243 |
+
|
| 244 |
+
• RandomResizedCrop: A crop of random size (from 0.2 to 1.0) of the original size and a random aspect ratio (from $3 / 4$ to 4/3) of the original aspect ratio is made. • RandomFlip: Randomly horizontally flip the image with a probability of 0.5. • ColorJitter: Randomly change the brightness, contrast and saturation of an image. • RandomGrayscale: Randomly convert RGB image to grayscale with a probability of 0.2. • RandomGaussianBlur: Randomly blur the image with a probability of 0.5. The radius is randomly sampled from 0.1 to 2.0.
|
| 245 |
+
|
| 246 |
+
# A.2 DETAILS OF POSITIVE SAMPLE SELECTION
|
| 247 |
+
|
| 248 |
+
We implement k-means and knn by faiss (Johnson et al., 2019). For efficiency, we perform clustering and knn computation every 5 epochs, since each iteration can be finished within minutes, the extra computation cost is marginal comparing with the budget for model training. The number of clusters is set as $1 0 K$ , and we select the top 40 nearest neighbors in knn. In order to balance the contribution of each image, we randomly select 10 positive samples for the following cutmix augmentations. For situations where there remained no more than 10 examples (e.g., the anchor is already around the cluster center), we simply select the most nearest samples among the remained top- $4 0 \mathrm { k n n }$ samples.
|
| 249 |
+
|
| 250 |
+
# B MORE ABLATION STUDIES
|
| 251 |
+
|
| 252 |
+
This section gives more detailed analysis w.r.t. some hyperparameters. Unless specified, we train the model for 200 epochs over the ImageNet-1000 and report the top-1 classification accuracy under linear evaluation protocol.
|
| 253 |
+
|
| 254 |
+
Table 8: Impact of the number of clusters $m$ and $k$ of knn
|
| 255 |
+
|
| 256 |
+
<table><tr><td>Number of Clusters (m)</td><td colspan="3">5000</td><td colspan="3">10000</td><td colspan="3">20000</td></tr><tr><td>knn (k)</td><td>20</td><td>40</td><td>60</td><td>20</td><td>40</td><td>60</td><td>20</td><td>40</td><td>60</td></tr><tr><td> Accuracy (%)</td><td>69.1</td><td>69.5</td><td>69.4</td><td>70.0</td><td>70.1</td><td>69.7</td><td>69.6</td><td>69.9</td><td>69.5</td></tr></table>
|
| 257 |
+
|
| 258 |
+
The number of Clusters $m$ and the $k$ in Knn. Here we inspect the impact of the number of clusters $m$ in $\mathbf { k }$ -means and the $k$ in knn to analyze their effect on the performance. In order to ensure local similarity, we restrict the nearest neighbors within a range from 20 to 60. The results for different clusters and top- $\mathbf { \nabla } \cdot \mathbf { k }$ neighbors are shown in Table 8. We observe that CLIM consistently improves
|
| 259 |
+
|
| 260 |
+
the performance comparing the baseline Moco $6 7 . 5 \%$ , and is relatively robust to different $m$ and $k$ .
|
| 261 |
+
Notably, the best performance is achieved when $m = 1 0 0 0 0$ , $k = 4 0$ .
|
| 262 |
+
|
| 263 |
+
Hyperparameters $\alpha$ in Cutmix. The combination $\lambda$ in cutmix is sampled from the beta distribution $\mathtt { B e t a } ( \alpha , \alpha )$ , where $\alpha$ plays an important role in data mixing augmentation, which controls the strength of interpolation between the anchor and its positive pair. Here we inspect how different $\alpha \in \{ 1 , 1 . 5 , 2 , 2 . 5 \}$ affect the representation. As shown in Table 9. We find that the performance is relatively robust to different $\alpha$ , and the best performance is achieved when $\alpha$ is set as 2.
|
| 264 |
+
|
| 265 |
+
Table 9: Impact of $\alpha$ in cutmix
|
| 266 |
+
|
| 267 |
+
<table><tr><td>a</td><td>1.0</td><td>1.5</td><td>2.0</td><td>2.5</td></tr><tr><td>Accuracy (%)</td><td>69.7</td><td>69.9</td><td>70.1</td><td>69.8</td></tr></table>
|
| 268 |
+
|
| 269 |
+
Ablation study on mixing strategies. Our method targets at generating new samples that expanding the neighborhood of an anchor. Here we compare performance of using mixup data augmentation, a widely used method in supervised settings. We try different choices of beta distribution for Mixup (Zhang et al., 2017) and choose the best one $\alpha = 0 . 2$ ) for comparison. Table 10 shows that Cutmix performs better than Mixup, partially because mixup destroys the real pixel distribution (destroys the naturality of pixels).
|
| 270 |
+
|
| 271 |
+
Table 10: Ablation study on the mixing methods
|
| 272 |
+
|
| 273 |
+
<table><tr><td>Method</td><td>Accuracy (%)</td></tr><tr><td>Mixup</td><td>69.5</td></tr><tr><td>Cutmix</td><td>70.1</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Extra ablation experiments for longer training schedule. We compare the improvements brought by different components of our proposed method for longer training schedule (800 epochs). Table 11 shows the top-1 accuracies under linear evaluation protocol. Our method consistently outperforms the MoCo v2 baseline, which demonstrates the effectiveness of our proposed method.
|
| 276 |
+
|
| 277 |
+
Table 11: Ablation study on the longer training schedule
|
| 278 |
+
|
| 279 |
+
<table><tr><td>Method</td><td>Accuracy (%)</td></tr><tr><td>MoCo v2</td><td>71.1</td></tr><tr><td>Center-wise+ cutmix</td><td>73.7</td></tr><tr><td>Center-wise+ cutmix+Multi-reso</td><td>75.2</td></tr></table>
|
| 280 |
+
|
| 281 |
+
# C MORE EXPERIMENTAL RESULTS
|
| 282 |
+
|
| 283 |
+
Visualization of Feature Representation. We visualize the feature space to better understand how CLIM augmentation pulls similar samples. Specifically, we randomly choose 10 classes from the validation set and provide the $t$ -sne visualization of feature representation generated by CLIM, supervised training and MoCo v2. As shown in Fig. 3, the same color denotes features with the same label. It can be shown that CLIM takes on higher aggregation property comparing with MoCo, and the fully supervised learned representation reveals the highest aggregation due to it makes use of image labels. Furthermore, we compute the intra-class similarity as the average cosine distance among all intra-class pairwise samples, and report the average similarity across 1000 classes, as shown in Table 12, CLIM achieves an intra-class similarity of 0.65, which is much higher than that in MoCo v2 with similarity of only 0.58. As comparison, we also list the result of supervised learning, with a similarity metric of 0.75.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 3: t-sne visualization of representation learned by MoCo, CLIM and supervised learning.
|
| 287 |
+
|
| 288 |
+
Table 12: Intra-class similarity for different models
|
| 289 |
+
|
| 290 |
+
<table><tr><td>Method</td><td>Intra-class Similarity</td></tr><tr><td>Supervised</td><td>0.75</td></tr><tr><td>MoCo v2</td><td>0.58</td></tr><tr><td>CLIM</td><td>0.65</td></tr></table>
|
| 291 |
+
|
| 292 |
+
Table 13: Results of different training epochs
|
| 293 |
+
|
| 294 |
+
<table><tr><td>Epochs</td><td>Accuracy (%)</td></tr><tr><td>200</td><td>72.3</td></tr><tr><td>800</td><td>75.2</td></tr><tr><td>1200</td><td>75.5</td></tr></table>
|
| 295 |
+
|
| 296 |
+
Results of Different Training Epochs. In Table 13, we compare CLIM trained with different epochs. Our method achieves an accuracy of $7 2 . 3 \%$ with only 200 epochs, $7 5 . 2 \%$ with 800 epochs, and can be further improved to $7 5 . 5 \%$ when training with 1200 epochs.
|
md/train/FMPuzXV1fR/FMPuzXV1fR.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Breaking the centralized barrier for cross-device federated learning∗
|
| 2 |
+
|
| 3 |
+
Sai Praneeth Karimireddy EPFL sai.karimireddy@epfl.ch
|
| 4 |
+
|
| 5 |
+
Martin Jaggi EPFL martin.jaggi@epfl.ch
|
| 6 |
+
|
| 7 |
+
Satyen Kale Google Research satyenkale@google.com
|
| 8 |
+
|
| 9 |
+
Mehryar Mohri Google Research mohri@google.com
|
| 10 |
+
|
| 11 |
+
Sashank J. Reddi Google Research sashank@google.com
|
| 12 |
+
|
| 13 |
+
Sebastian U. Stich EPFL sebastian.stich@epfl.ch
|
| 14 |
+
|
| 15 |
+
Ananda Theertha Suresh Google Research theertha@google.com
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Federated learning (FL) is a challenging setting for optimization due to the heterogeneity of the data across different clients which can cause a client drift phenomenon. In fact, designing an algorithm for FL that is uniformly better than simple centralized training has been a major open problem thus far. In this work, we propose a general algorithmic framework, MIME, which i) mitigates client drift and ii) adapts an arbitrary centralized optimization algorithm such as momentum and Adam to the cross-device federated learning setting. MIME uses a combination of control-variates and server-level optimizer state (e.g. momentum) at every client-update step to ensure that each local update mimics that of the centralized method run on i.i.d. data. We prove a reduction result showing that MIME can translate the convergence of a generic algorithm in the centralized setting into convergence in the federated setting. Moreover, we show that, when combined with momentum-based variance reduction, MIME is provably faster than any centralized method–the first such result. We also perform a thorough experimental exploration of MIME’s performance on real world datasets (implemented here).
|
| 20 |
+
|
| 21 |
+
# 1 Introduction
|
| 22 |
+
|
| 23 |
+
Federated learning (FL) is an increasingly important large-scale learning framework where the training data remains distributed over a large number of clients, which may be mobile phones or network sensors [38, 37, 43, 44, 28]. A server then orchestrates the clients to train a single model, here referred to as a server model, without ever transmitting client data over the network, thereby providing some basic levels of data privacy and security.
|
| 24 |
+
|
| 25 |
+
Two important settings are distinguished in FL [28, Table 1]: the cross-device and the cross-silo settings. The cross-silo setting corresponds to a relatively small number of reliable clients, typically organizations, such as medical or financial institutions. In contrast, in the cross-device federated learning setting, the number of clients may be extremely large and include, for example, all 3.5 billion active android phones [25]. Thus, in that setting, we may never make even a single pass over the entire clients’ data during training. The cross-device setting is further characterized by resourcepoor clients communicating over a highly unreliable network. Together, the essential features of this setting give rise to unique challenges not present in the cross-silo setting. In this work, we are interested in the more challenging cross-device setting, for which we will formalize and study stochastic optimization algorithms. Importantly, recent advances in FL optimization, such as SCAFFOLD [32] or FedDyn [1], are not anymore applicable since they are designed for the cross-silo setting.
|
| 26 |
+
|
| 27 |
+
The problem. The de facto standard algorithm for the cross-device setting is FEDAVG [43], which performs multiple SGD updates on the available clients before communicating to the server. While this approach can reduce the frequency of communication required, performing multiple steps on the same client can lead to ‘over-fitting’ to its atypical local data, a phenomenon known as client drift [32]. This in turn leads to slower convergence and can, somewhat counter-intuitively, require larger total communication [69]. Despite significant attention received from the optimization community, the communication complexity of heterogeneous cross-device has not improved upon that of simple centralized methods, which take no local steps (aka SERVER-ONLY methods). Furthermore, algorithmic innovations such as momentum [59, 14], adaptivity [35, 75, 77], and clipping [71, 72, 76] are critical to the success of deep learning applications. The lack of a theoretical understanding of the impact of multiple client steps has also hindered adapting these techniques in a principled manner into the client updates, in order to replace the vanilla SGD update of FEDAVG.
|
| 28 |
+
|
| 29 |
+
To overcome such deficiencies, we propose a new framework, MIME, that mitigates client drift and can adapt an arbitrary centralized optimization algorithm, e.g. SGD with momentum or Adam, to the federated setting. In each local client update, MIME uses global optimizer state, e.g. momentum or adaptive learning rates, and an SVRG-style correction to mimic the updates of the centralized algorithm run on i.i.d. data. This optimizer state is computed only at the server level and kept fixed throughout the local steps, thereby avoiding overfitting to the atypical local data of any single client.
|
| 30 |
+
|
| 31 |
+
Contributions. We summarize our main results below.
|
| 32 |
+
|
| 33 |
+
• MIME framework. We formalize the cross-device federated learning problem, and propose a new framework MIME that can adapt arbitrary centralized algorithms to this setting. • Convergence result. We prove a result showing that MIME successfully reduces client drift. We also prove that the convergence of any generic algorithm in the centralized setting translates convergence of its MIME version in the federated setting. • Speed-up over centralized methods. By carefully tracking the bias introduced due to multiple local steps, we prove that MIME with momentum-based variance reduction (MVR) can beat a lower bound for centralized methods, thus breaking a fundamental barrier. This is the first such result in FL, and also the first general result showing asymptotic speed-up due to local steps. • Empirical validation. We propose a simpler variant, MIMELITE, with an empirical performance similar to MIME. We report the results of thorough experimental analysis demonstrating that both MIME and MIMELITE indeed converge faster than FEDAVG.
|
| 34 |
+
|
| 35 |
+
Related work. Analysis of FEDAVG: Much of the recent work in federated learning has focused on analyzing FEDAVG. For identical clients, FEDAVG coincides with parallel SGD, for which [78] derived an analysis with asymptotic convergence. Sharper and more refined analyses of the same method, sometimes called local SGD, were provided by [56], and more recently by [57], [47], [34], and [70], for identical functions. Their analysis was extended to heterogeneous clients in [68, 74, 32, 34, 36]. [11] derived a tight characterization of FedAvg with quadratic functions and demonstrated the sensitivity of the algorithm to both client and server step sizes. Matching upper and lower bounds were recently given by [32] and [69] for general functions, proving that FEDAVG can be slower than even SGD for heterogeneous data, due to the client-drift.
|
| 36 |
+
|
| 37 |
+
Comparison to SCAFFOLD: For the cross-silo setting where the number of clients is relatively low, [32] proposed the SCAFFOLD algorithm, which uses control-variates (similar to SVRG) to correct for client drift. However, their algorithm crucially relies on stateful clients which repeatedly participate in the training process. FedDyn [1] reduces the communication requirements, but also requires persistent stateful clients. In contrast, we focus on the cross-device setting where clients may be visited only once during training and where they are stateless (and thus SCAFFOLD and FedDyn are inapplicable). This is akin to the difference between the finite-sum (corresponding to cross-silo) and stochastic (cross-device) settings in traditional centralized optimization [39].
|
| 38 |
+
|
| 39 |
+
Comparison to FedAvg and variants: [26] and [67] observed that using server momentum significantly improves over vanilla FEDAVG. This idea was generalized by [49], who replaced the server update with an arbitrary optimizer, e.g. Adam. However, these methods only modify the server update while using SGD for the client updates. We henceforth refer to this meta algorithm as FedAvg. FedAvgSGD, FedAvgMom, FedAvgAdam denote specific instantiations of the server optimizer in FedAvg with SGD, Momentum or Adam. MIME, on the other hand, ensures that every local client update resembles the optimizer e.g. MIME would apply momentum in every client update and not just at the server level. Beyond this, [40] proposed to add a regularizer to ensure client updates remain close. However, this may slow down convergence (cf. Fig. 5 and [32, 66]). Other orthogonal directions which can be combined with MIME include tackling computation heterogeneity, where some clients perform many more updates than others [66], improving fairness by modifying the objective [44, 41], incorporating differential privacy [20, 2, 61], Byzantine adversaries [48, 65, 30], secure aggregation [8, 24], etc. We defer additional discussion to the extensive survey by [28].
|
| 40 |
+
|
| 41 |
+
Momentum based variance reduction. Initial optimal methods for stochastic non-convex optimization like SPIDER [17] and SARAH [46] required intermittently computing very large batch gradients. Subsequently, it was shown that momentum based variance reduction (MVR) methods obtained a similar optimal rate without needing such large batch gradient computations [62, 14]. Momentum is an exponential moving average of many stochastic gradients and so it has much smaller variance than the stochastic gradients themselves. However, because these gradients are computed at different parameters it also has a bias. MVR adds a small additional correction term which significantly reduces this bias and provides improved rates.
|
| 42 |
+
|
| 43 |
+
# 2 Problem setup
|
| 44 |
+
|
| 45 |
+
This section formalizes the problem of cross-device federated learning [28]. Cross-device FL is characterized by a large number of client devices like mobile phones which may potentially connect to the server at most once. Due to their transient nature, it is not possible to store any state on the clients, precluding an algorithm like SCAFFOLD. Furthermore, each client has only a few samples, and there is wide heterogeneity in the samples across clients. Finally, communication is a major bottleneck and a key metric for optimization in this setting is the number of communication rounds.
|
| 46 |
+
|
| 47 |
+
Thus, our objective will be to minimize the following quantity within the fewest number of clientserver communication rounds:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
f ( \pmb { x } ) = \mathbb { E } _ { i \sim \mathcal { C } } \Big [ f _ { i } ( \pmb { x } ) : = \frac { 1 } { n _ { i } } \sum _ { \nu = 1 } ^ { n _ { i } } f _ { i } ( \pmb { x } ; \zeta _ { i , \nu } ) \Big ] .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Here, $f _ { i }$ denotes the loss function of client $i$ and $\{ \zeta _ { i , 1 } , \ldots , \zeta _ { i , n _ { i } } \}$ its local data. Since the number of clients is extremely large, while the size of each local data is rather modest, we represent the former as an expectation and the latter as a finite sum. In each round, the algorithm samples a subset of clients (of size $S$ ) and performs some updates to the server model. Due to the transient and heterogeneous nature of the clients, it is easy to see that the problem becomes intractable with arbitrarily dissimilar clients. Thus, it is necessary to assume bounded dissimilarity across clients.
|
| 54 |
+
|
| 55 |
+
(A1) $G ^ { 2 }$ -BGV or bounded inter-client gradient variance: there exists $G \geq 0$ such that
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\begin{array} { r } { \mathbb { E } _ { i \sim \mathcal { C } } [ \| \nabla f _ { i } ( \pmb { x } ) - \nabla f ( \pmb { x } ) \| ^ { 2 } ] \le G ^ { 2 } , \forall \pmb { x } . } \end{array}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Next, we also characterize the variance in the Hessians.
|
| 62 |
+
|
| 63 |
+
(A2) $\delta$ -BHV or bounded Hessian variance: Almost surely, the loss function of any client $i$ satisfies
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \| \nabla ^ { 2 } f _ { i } ( { \pmb x } ; \zeta ) - \nabla ^ { 2 } f ( { \pmb x } ) \| \leq \delta , \forall { \pmb x } . } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
This is in contrast to the usual smoothness assumption that can be stated as:
|
| 70 |
+
|
| 71 |
+
$( \mathbf { A } 2 ^ { * } )$ ) $L$ -smooth: $\| \nabla ^ { 2 } f _ { i } ( \pmb { x } ; \zeta ) \| \le L$ , $\forall x$ , a.s. for any $i$ .
|
| 72 |
+
|
| 73 |
+
Note that if $f _ { i } ( x ; \zeta )$ is $L$ -smooth then (A2) is satisfied with $\delta \leq 2 L$ , and hence (A2) is weaker than $( \mathsf { A } 2 ^ { \ast } )$ . In realistic examples we expect the clients to be similar and hence that $\delta \ll L$ . In addition, we assume that $f ( { \pmb x } )$ is bounded from below by $f ^ { \star }$ and is $L$ -smooth, as is standard.
|
| 74 |
+
|
| 75 |
+
# 3 Mime framework
|
| 76 |
+
|
| 77 |
+
In this section we describe how to adapt an arbitrary centralized optimizer (referred to as the “base” optimizer) which may have internal state (e.g. momentum) to the federated learning problem (1) while ensuring there is no client-drift. Algorithm 4 describes our framework. We develop two variants, MIME and MIMELITE, which consist of three components i) a base optimizer we are seeking to mimic, ii) the global (server) optimizer state computation, and iii) the local client updates.
|
| 78 |
+
|
| 79 |
+
# Algorithm 1 Mime and MimeLite
|
| 80 |
+
|
| 81 |
+
<table><tr><td>input: initial x and s,learning rate η and base optimize B= (U,V) for each round t = 1,..,T do sample subset S of clients</td></tr><tr><td>communicate (x, s) to all clients i ∈ S communicate c ← ∑j∈s Vf(x) (only Mime)</td></tr><tr><td>on client i ∈ S in parallel do initialize local model yi ←x for k=1,.,K do</td></tr><tr><td>sample mini-batch ‘ from local data gi ← Vfi(yi;S)-Vfi(x;S)+c (Mime)</td></tr><tr><td>gi ←Vfi(yi; S) (MimeLite)</td></tr><tr><td>update yi ← yi - nu(gi,s) end for</td></tr><tr><td>compute full local-batch gradient Vfi(x) communicate (yi, Vf (x))</td></tr><tr><td>end on client</td></tr><tr><td>8 ← V(ΣiesVfi(x),s) (update optimize state)</td></tr><tr><td>x ← ∑i∈s yi (update server parameters) end for</td></tr></table>
|
| 82 |
+
|
| 83 |
+
Base optimizer. We assume the centralized base optimizer we are imitating can be decomposed into two steps: an update step $\mathcal { U }$ which updates the parameters $_ { \textbf { \em x } }$ , and a optimizer state update step $\mathcal { V } ( \cdot )$ which keeps track of global optimizer state $\pmb { s }$ . Each step of the base optimizer $\boldsymbol { B } = ( \boldsymbol { \mathcal { U } } , \boldsymbol { \mathcal { V } } )$ uses a gradient $\textbf { { g } }$ to update the parameter $_ { \textbf { \em x } }$ and the optimizer state $\pmb { s }$ as follows:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { l } { { { \pmb x } { \pmb x } - \eta \mathcal { U } ( { \pmb g } , { \pmb s } ) , } } \\ { { { \pmb s } \mathcal { V } ( { \pmb g } , { \pmb s } ) . } } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
As an example, consider SGD with momentum. The state here is the momentum ${ \mathbf { } } m _ { t }$ and uses the following update steps:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\begin{array} { r l } & { \pmb { x } _ { t } = \pmb { x } _ { t - 1 } - \eta \left( ( 1 - \beta ) \nabla f _ { i } ( \pmb { x } _ { t - 1 } ) \right. } \\ & { \qquad \quad + \left. \beta \pmb { m } _ { t - 1 } \right) , } \\ & { \pmb { m } _ { t } = ( 1 - \beta ) \nabla f _ { i } ( \pmb { x } _ { t - 1 } ) + \beta \pmb { m } _ { t - 1 } . } \end{array}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
Thus, SGD with momentum can be represented in the above generic form with $\mathcal { U } ( { \pmb g } , { \pmb s } ) = ( 1 - \beta ) { \overset { } { \pmb g } } + \beta { \pmb s }$ and $\mathcal { V } ( { \pmb g } , \pmb s ) = ( 1 - \beta ) \pmb { g } + \beta \pmb { s }$ . Table 5 in Appendix shows how other algo
|
| 96 |
+
|
| 97 |
+
rithms like Adam, Adagrad, etc. can be represented in this manner. We keep the update $\mathcal { U }$ to be linear in the gradient $\textbf { { g } }$ , whereas $\nu$ can be more complicated. This implies that while the parameter update step $\mathcal { U }$ is relatively resilient to receiving a biased gradient $\textbf { { g } }$ while $\nu$ can be much more sensitive.
|
| 98 |
+
|
| 99 |
+
Compute optimizer state globally, apply locally. When updating the optimizer state of the base algorithm, we use only the gradient computed at the server parameters. Further, they remain fixed throughout the local updates of the clients. This ensures that these optimizer state remain unbiased and representative of the global function $f ( \cdot )$ . At the end of the round, the server performs
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r l } & { \boldsymbol { s } \gets \mathcal { V } \Big ( \frac { 1 } { | \mathcal { S } | } \sum _ { i \in \mathcal { S } } \nabla f _ { i } ( \boldsymbol { x } ) , \boldsymbol { s } \Big ) , } \\ & { \nabla f _ { i } ( \boldsymbol { x } ) = \frac { 1 } { n _ { i } } \sum _ { \nu = 1 } ^ { n _ { i } } \nabla f _ { i } ( \boldsymbol { x } ; \zeta _ { i , \nu } ) . } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Note that we use full-batch gradients computed at the server parameters $_ { \textbf { \em x } }$ , not client parameters $\mathbf { \nabla } _ { \mathbf { \psi } _ { 3 } } \psi _ { i }$
|
| 106 |
+
|
| 107 |
+
Local client updates. Each client $i \in S$ performs $K$ updates using $\mathcal { U }$ of the base algorithm and a minibatch gradient. There are two variants possible corresponding to $\mathbf { M M E }$ and MIMELITE differentiated using colored boxes. Starting from ${ \pmb y } _ { i } { \pmb x }$ , repeat the following $K$ times
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
{ \pmb y } _ { i } \gets { \pmb y } _ { i } - \eta \mathcal { U } ( { \pmb g } _ { i } , { \pmb s } )
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\pmb { g } _ { i } \gets \nabla f _ { i } ( \pmb { y } _ { i } ; \zeta )$ for MIMELITE, and $\begin{array} { r } { \pmb { g } _ { i } \nabla f _ { i } ( \pmb { y } _ { i } ; \zeta ) - \nabla f _ { i } ( \pmb { x } ; \zeta ) + \frac { 1 } { | \mathcal { S } | } \sum _ { j \in \mathcal { S } } \nabla f _ { j } ( \pmb { x } ) } \end{array}$ for MIME. MIMELITE simply uses the local minibatch gradient whereas MIME uses an SVRG
|
| 114 |
+
|
| 115 |
+
style correction [27]. This is done to reduce the noise from sampling a local mini-batch. While this correction yields faster rates in theory (and in practice for convex problems), in deep learning applications we found that MIMELITE closely matches the performance of MIME.
|
| 116 |
+
|
| 117 |
+
Finally, there are two modifications made in practical FL: we weight all averages across the clients by the number of datapoints $n _ { i }$ [43], and we perform $K$ epochs instead of $K$ steps [66].
|
| 118 |
+
|
| 119 |
+
# 4 Theoretical analysis of Mime
|
| 120 |
+
|
| 121 |
+
Table 1 summarizes the rates of MIME (highlighted in blue) and MIMELITE (highlighted in green) and compares them to SERVER-ONLY methods when using SGD, Adam and momentum methods as the base algorithms. We will first examine the convergence of MIME and MIMELITE with a generic base optimizer and show that its properties are preserved in the federated setting. We then examine a specific momentum based base optimizer, and prove that Mime and MimeLite can be asymptotically faster than the best server-only method. This is the first result to prove the usefulness of local steps and demonstrate asymptotic speed-ups.
|
| 122 |
+
|
| 123 |
+
# 4.1 Convergence with a generic base optimizer
|
| 124 |
+
|
| 125 |
+
We will prove a generic reduction result demonstrating that if the underlying base algorithm converges, and is robust to slight perturbations, then MIME and MIMELITE also preserve the convergence of the algorithm when applied to the federated setting with additinoal local steps.
|
| 126 |
+
|
| 127 |
+
Theorem I. Suppose that we have $G ^ { 2 }$ inter-client gradient variance (A1), $L$ -smooth $\left\{ f _ { i } \right\} \left( \mathbf { A } 2 ^ { * } \right)$ , and $\sigma ^ { 2 }$ intra-client gradient variance (A3). Further, suppose that the updater $\mathcal { U }$ of our baseoptimizer $\boldsymbol { B } = ( \boldsymbol { \mathcal { U } } , \boldsymbol { \mathcal { V } } )$ satisfies i) linearity for a fixed state s: $\mathcal { U } ( \pmb { g } _ { 1 } + \pmb { g } _ { 2 } ; \pmb { s } ) = \mathcal { U } ( \pmb { g } _ { 1 } ; \pmb { s } ) + \mathcal { U } ( \pmb { g } _ { 2 } ; \pmb { s } )$ , and ii) Lipschitzness: $\| \mathcal { U } ( \pmb { g } ; \pmb { s } ) \| \leq B \| \pmb { g } \|$ for some $B \geq 0$ . Then, running MIME $o r$ MIMELITE with $K$ local updates and step-size $\eta$ is equivalent to running a centralized algorithm with step-size $\begin{array} { r } { \tilde { \eta } : = K \eta \le \frac { \hat { 1 } } { 2 L B } } \end{array}$ , and updates
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\pmb { x } _ { t } \pmb { x } _ { t - 1 } - \tilde { \eta } \mathcal { U } ( \pmb { g } _ { t } + \pmb { e } _ { t } , \pmb { s } _ { t - 1 } ) , a n
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
an unbiased gradient $\mathbb { E } _ { t } [ { \pmb { g } } _ { t } ] = \nabla f ( { \pmb { x } } _ { t - 1 } )$ , with variance bounded as
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\begin{array} { r } { \mathbb { E } _ { t } \Vert { \pmb { g } } _ { t } - \nabla f ( { \pmb x } _ { t - 1 } ) \Vert ^ { 2 } \leq \left\{ \begin{array} { l l } { \frac { G ^ { 2 } } { S } } & { \mathrm { ~ M I M E ~ } , } \\ { \frac { G ^ { 2 } } { S } + \frac { \sigma ^ { 2 } } { K S } } & { \mathrm { ~ M I M E L I T E ~ } . } \end{array} \right. } \end{array}
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
and finally a small error bounded as
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r } { \frac { 1 } { B ^ { 2 } L ^ { 2 } \tilde { \eta } ^ { 2 } } \mathbb { E } _ { t } \Vert e _ { t } \Vert ^ { 2 } \leq \left\{ \begin{array} { l l } { \mathbb { E } _ { t } \Vert g _ { t } \Vert ^ { 2 } } & { \mathrm { ~ M I M E ~ , } } \\ { \mathbb { E } _ { t } \Vert g _ { t } \Vert ^ { 2 } + G ^ { 2 } + \frac { \sigma ^ { 2 } } { K } } & { \mathrm { ~ M I M E L I T E ~ . } } \end{array} \right. } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Here, we have proven that MIME and MIMELITE truly mimic the centralized base algorithm with very small perturbations—the magnitude of $e _ { t }$ is $\mathcal { O } ( \bar { \eta } ^ { 2 } )$ . The key to the result is the linearity of the parameter update step $\mathcal { U } ( \cdot ; s )$ . By separating the base optimizer into a very simple parameter step $\mathcal { U }$ and a more complicated optimizer state update step $\nu$ , we can ensure that commonly used algorithms such as momentum, Adam, Adagrad, and others all satisfy this property. Armed with this general reduction, we can easily obtain specific convergence results.
|
| 146 |
+
|
| 147 |
+
Corollary $\mathbf { I I }$ ((Mime/MimeLite) with SGD). Given that the conditions in Theorem $I$ are satisfied, let us run $T$ rounds with $K$ local steps using SGD as the base optimizer and output ${ \pmb x } ^ { o u t }$ . This output satisfies $\mathbb { E } \| \nabla f ( \pmb { x } ^ { o u t } ) \| ^ { 2 } \leq \epsilon$ for $F : = f ( \pmb { x } _ { 0 } ) - f ^ { \star }$ , $\tilde { G } ^ { 2 } : = G ^ { 2 } \stackrel { \sim } { + } \sigma ^ { 2 } / K$ and
|
| 148 |
+
|
| 149 |
+
• $\mu$ -PL inequality: $\begin{array} { r } { \eta = \tilde { \mathcal { O } } \big ( \frac { 1 } { \mu K T } \big ) } \end{array}$ , and
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\begin{array} { r l } & { T = \left\{ \begin{array} { l l } { \tilde { \mathcal { O } } \left( \frac { L G ^ { 2 } } { \mu S \epsilon } + \frac { L F } { \mu } \log \left( \frac { 1 } { \epsilon } \right) \right) } & { \mathrm { ~ M I M E ~ } , } \\ { \tilde { \mathcal { O } } \left( \frac { L G ^ { 2 } } { \mu S \epsilon } + \frac { L \tilde { \mathcal { G } } } { \mu \sqrt { \epsilon } } + \frac { L F } { \mu } \log \left( \frac { 1 } { \epsilon } \right) \right) } & { \mathrm { ~ M I M E L I T E ~ } . } \end{array} \right. } \\ & { = \mathcal { O } \big ( \sqrt { \frac { F S } { L G ^ { 2 } T K ^ { 2 } } } \big ) , a n d } \\ & { T = \left\{ \begin{array} { l l } { \mathcal { O } \Big ( \frac { L G ^ { 2 } F } { S \epsilon ^ { 2 } } + \frac { L F } { \epsilon } \Big ) } & { \mathrm { ~ M I M E ~ } , } \\ { \mathcal { O } \Big ( \frac { L G ^ { 2 } F } { S \epsilon ^ { 2 } } + \frac { L ^ { 2 } G F } { \epsilon ^ { 3 / 2 } } + \frac { L F } { \epsilon } \Big ) } & { \mathrm { ~ M I M E L I T E ~ } . } \end{array} \right. } \end{array}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
Table 1: Number of communication rounds required to reach $\| \nabla f ( \pmb { x } ) \| ^ { 2 } \leq \epsilon$ (log factors are ignored) with $S$ clients sampled each round. All analyses except SCAFFOLD assume $G ^ { 2 }$ bounded gradient dissimilarity (A1). All analyses assume $L$ -smooth losses, except MimeLiteMVR and MimeMVR, which only assume $\delta$ bounded Hessian dissimilarity (A2). Convergence of SCAFFOLD depends on the total number of clients $N$ which is potentially infinite. FEDAVG and MIMELITE are slightly slower than the server-only methods due to additional drift terms in most cases. MIME is the fastest and either matches or improves upon the optimal statistical rates (first term in the rates). In fact, MimeMVR and MimeLiteMVR beat lower bounds for any server-only method when $\delta \ll L$ .
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Algorithm</td><td colspan="5">Non-convex</td><td colspan="4"> μ-PL inequality</td></tr><tr><td colspan="2">SCAFFOLDa [32]</td><td colspan="4">2 () L E</td><td>+</td><td colspan="3"></td></tr><tr><td colspan="2">SGD SERVER-ONLY [21]</td><td colspan="4">LG² +</td><td>G²</td><td>+</td><td></td><td></td></tr><tr><td>MimeLiteSGD=</td><td>FedAvgSGD C</td><td colspan="2">S E LG² L²G</td><td>+</td><td></td><td>uSe G²</td><td>+</td><td>μ LG</td><td>+/</td></tr><tr><td>MimeSGD</td><td></td><td>S+ LG² +</td><td>3/2 L</td><td></td><td>μSE G²</td><td></td><td>L</td><td>HVE</td><td>μ</td></tr><tr><td>ADAM</td><td></td><td>Se² L</td><td>E</td><td></td><td></td><td>μSE</td><td>+ μ</td><td></td><td></td></tr><tr><td></td><td>SERVER-ONLY [75]b</td><td colspan="4">-G2/s</td><td></td><td></td><td></td><td></td></tr><tr><td>MimeAdamb</td><td>MimeLiteAdambc</td><td colspan="4">LVS E-G2/S</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td colspan="4">L e-G²/S</td><td></td><td></td><td></td><td></td></tr><tr><td>SERVER-ONLY [14]</td><td>Momentum Variance Reduction (MVR)</td><td colspan="4">LG G + S3/2</td><td></td><td></td><td></td><td></td></tr><tr><td>MimeLiteMVRd</td><td></td><td colspan="4">Se E δ(G+σ) G²+² 8</td><td></td><td></td><td></td><td></td></tr><tr><td>MimeMVRd</td><td></td><td colspan="4">3/2 E E 8G G²</td><td></td><td></td><td></td><td></td></tr><tr><td colspan="2">SERVER-ONLY lower bound [5]</td><td>VSe3/2 2(</td><td>十 SE LG G²</td><td>E +)</td><td>2()</td><td></td><td></td><td></td><td></td></tr></table>
|
| 158 |
+
|
| 159 |
+
a Num. clients $. N )$ can be same order as num. total rounds or even $\infty$ , making the bounds vacuous. b Adam requires large batch-size $S \ge G ^ { 2 } / \epsilon$ to converge [50, 75]. Convergence of FedAdam with client sampling is unknown ([49] only analyze with full client participation). c Requires $K \stackrel { \smile } { \geq } \sigma ^ { 2 } / G ^ { 2 }$ number of local updates. Typically, intra-client variance is small $( \sigma ^ { 2 } \lesssim G ^ { 2 } )$ . d Requires $K \ge L / \delta$ number of local updates. Faster than the lower bound (and hence any SERVERONLY algorithm) when $\delta \ll L$ i.e. our methods can take advantage of Hessian similarity, whereas SERVER-ONLY methods cannot. In worst case, $\delta \approx L$ and all methods are comparable.
|
| 160 |
+
|
| 161 |
+
If we take a sufficient number of local steps $K \ge G ^ { 2 } / \sigma ^ { 2 }$ , then we have ${ \tilde { G } } = { \mathcal { O } } ( G )$ in the above rates. On comparing with the rates in Table 1 for SERVER-ONLY SGD, we see that MIME exactly matches its rates. MIMELITE matches the asymptotic term but has a few higher order terms. Note that when using SGD as the base optimizer, MIMELITE becomes exactly the same as FEDAVG and hence has the same rate of convergence.
|
| 162 |
+
|
| 163 |
+
Corollary III ((Mime/MimeLite) with Adam). Suppose that the conditions in Theorem $I$ are satisfied, and further $| \nabla _ { j } f _ { i } ( { \pmb x } ) | \le H$ for any coordinate $j \in [ d ]$ . Then let us run $T$ rounds using Adam as the base optimizer with $K$ local steps, $\beta _ { 1 } = 0$ , $\varepsilon _ { 0 } > 0$ , $\eta \leq \varepsilon _ { 0 } ^ { 2 } / K L ( H + \varepsilon _ { 0 } )$ , and any $\beta _ { 2 } \in [ 0 , 1 )$ . Output ${ \pmb x } ^ { o u t }$ chosen randomly from $\{ \pmb { x } _ { 1 } , \hdots \pmb { x } _ { T } \}$ satisfies $\mathbb { E } \| \nabla f ( \pmb { x } ^ { o u t } ) \| ^ { 2 } \leq \epsilon _ { \mathcal { I } }$ for
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\begin{array} { r l } & { T = \left\{ \begin{array} { l l } { \mathcal { O } \Big ( \frac { L F ( H + \varepsilon _ { 0 } ) ^ { 2 } } { \varepsilon _ { 0 } ^ { 2 } ( \epsilon - \tilde { G } ^ { 2 } / S ) } \Big ) } & { \quad \mathrm { M I M E ~ A d a m ~ } , } \\ { \mathcal { O } \Big ( \frac { L F ( H + \varepsilon _ { 0 } ) ^ { 2 } \sqrt { S } } { \varepsilon _ { 0 } ^ { 2 } ( \epsilon - \tilde { G } ^ { 2 } / S ) } \Big ) } & { \quad \mathrm { M I M E L I T E ~ A d a m ~ } . } \end{array} \right. } \\ & { \bar { \tau } , \tilde { G } ^ { 2 } : = G ^ { 2 } + \sigma ^ { 2 } / K . } \end{array}
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
where ${ \cal F } : = f ( x _ { 0 } ) - f ^ { \star } , \tilde { G } ^ { 2 } : \stackrel { \bullet } { = } G ^ { \dot { 2 } } + \stackrel { \bullet } { \sigma } ^ { 2 } / K .$
|
| 170 |
+
|
| 171 |
+
Note that here $\varepsilon _ { \mathrm { 0 } }$ represents a small positive parameter used in Adam for regularization, and is different from the error $\epsilon$ . Similar to the SERVER-ONLY analysis of Adam [75], we assume $\beta _ { 1 } = 0$
|
| 172 |
+
|
| 173 |
+
and that batch size is large enough such that $S \ge G ^ { 2 } / \epsilon$ . A similar analysis can also be carried out for AdaGrad, and other novel variants of Adam [42].
|
| 174 |
+
|
| 175 |
+
# 4.2 Circumventing server-only lower bounds
|
| 176 |
+
|
| 177 |
+
The rates obtained above, while providing a safety-check, do not beat those of the SERVER-ONLY approach. The previous best rates for cross-device FL correspond to MimeLiteSGD which is $\begin{array} { r } { \ O ( \frac { L G ^ { 2 } } { S \epsilon ^ { 2 } } + \frac { L ^ { 2 } G } { \epsilon ^ { 3 / 2 } } ) } \end{array}$ [34, 36, 69]. While, using a separate server-learning rate can remove the effect of the second term [33], this at best matches the rate of SERVER-ONLY SGD $\mathcal { O } \big ( \textstyle \frac { L G ^ { 2 } } { S \epsilon ^ { 2 } } \big )$ . This is significantly slower than simply using momentum based variance reduction (MVR) as in in the FL setting (SERVER-ONLY MVR) which has a communication complexity of ( √LGS3/2 ) [14]. Thus, even though the main reason for studying local-step methods was to improve the communication complexity, none thus far show such improvement. The above difficulty of beating SERVER-ONLY may not be surprising given the two sets of strong lower bounds known.
|
| 178 |
+
|
| 179 |
+
Necessity of local steps. Firstly, [5] show a gradient oracle lower bound of $\Omega \big ( \frac { L G } { \sqrt { S } \epsilon ^ { 3 / 2 } } \big )$ This matches the complexity of MVR, and hence at first glance it seems that SERVER-ONLY MVR is optimal. However, the lower bound is really only on the number of gradients computed and not on the number of clients sampled (sample complexity) [18], or number of rounds of communication required. In particular, multiple local updates increases number of gradients computed without needing additional communication offers us a potential way to side-step such lower bounds. A careful analysis of the bias introduced as a result of such local steps is a key part of our analysis.
|
| 180 |
+
|
| 181 |
+
Necessity of $\delta$ -BHD. A second set of lower bounds directly study the number of communication rounds required in heterogeneous optimization [6, 69]. These results prove that there exist settings where local steps provide no advantage and SERVER-ONLY methods are optimal. This however contradicts real world experimental evidence [43]. As before, the disparity arises due to the contrived settings considered by the lower bounds. For distributed optimization (with full client participation) and convex quadratic objectives, $\delta$ -BHD (A2) was shown to be a sufficient [54, 51] and necessary [6] condition to circumvent these lower bounds and yield highly performant methods. We similarly leverage $\delta$ -BHD (A2) to design novel methods which significantly extend prior results to i) all smooth non-convex functions (not just quadratics), and ii) cross-device FL with client sampling.
|
| 182 |
+
|
| 183 |
+
We now state our convergence results with momentum based variance reduction (MVR) as the basealgorithm since it is known to be optimal in the SERVER-ONLY setting.
|
| 184 |
+
|
| 185 |
+
Theorem IV. For $L$ -smooth $f$ with $G ^ { 2 }$ gradient dissimilarity (A1), $\delta$ Hessian dissimilarity (A2) and $F : = ( f ( \pmb { x } ^ { 0 } ) - f ^ { \star } )$ , let us run MVR as the base algorithm for $T$ rounds with $K \ge L / \delta$ local steps and generate an output ${ \pmb x } ^ { o u t }$ . This output satisfies $\bar { \mathbb { E } } \| \nabla f ( \pmb { x } ^ { o u t } ) \| ^ { 2 } \leq \epsilon$ for
|
| 186 |
+
|
| 187 |
+
• $M i m e M V R$ : $\begin{array} { r } { \eta = \mathcal { O } \Big ( \operatorname* { m i n } \big ( \frac { 1 } { \delta K } , \big ( \frac { S F } { G ^ { 2 } T K ^ { 3 } } \big ) ^ { 1 / 3 } \Big ) \Big ) } \end{array}$ , momentum $\begin{array} { r } { \beta = 1 - \mathcal { O } \big ( \frac { \delta ^ { 2 } S ^ { 2 / 3 } } { ( T G ^ { 2 } ) ^ { 2 / 3 } } \big ) } \end{array}$ ( δ2S2/3(T G2)2/3 ), and
|
| 188 |
+
|
| 189 |
+
MimeLiteMVR : $\begin{array} { r } { \eta = \mathcal { O } \Big ( \operatorname* { m i n } \big ( \frac { 1 } { \delta K } , \big ( \frac { \mathbf { v } } { \hat { G } ^ { 2 } T K ^ { 3 } } \big ) ^ { 1 / 3 } \Big ) \Big ) } \end{array}$ , momentum $\begin{array} { r } { \beta = 1 - \mathcal { O } ( \frac { \delta ^ { 2 } } { ( T \hat { G } ^ { 2 } ) ^ { 2 / 3 } } ) } \end{array}$
|
| 190 |
+
|
| 191 |
+
Here, we define ${ \hat { G } } ^ { 2 } : = G ^ { 2 } + \sigma ^ { 2 }$ and the expectation in $\mathbb { E } \| \nabla ^ { \in } f ( \pmb { x } ^ { \mathrm { o u t } } ) \| ^ { 2 } \le \epsilon$ is taken both over the sampling of the clients during the running of the algorithm, the sampling of the mini-batches in local updates, and the choice of $\pmb { x } ^ { \mathrm { o u t } }$ (which is chosen randomly from the client iterates $\mathbf { \nabla } _ { \mathbf { \psi } _ { 3 } } \mathbf { \psi } _ { 2 } \qquad \mathbf { \psi } _ { 3 } \mathbf { \psi } _ { 4 } \qquad \mathbf { \psi } _ { 3 } \mathbf { \psi } _ { 4 } \qquad \mathbf { \psi } _ { 3 } \mathbf { \psi } _ { 4 } \mathbf { \psi } _ { 3 } \qquad \mathbf { \psi } _ { 4 } \mathbf { \psi } _ { 4 } \mathbf { \psi } _ { 3 } \mathbf { \psi } _ { 4 } \mathbf { \psi } _ { 4 } \mathbf { \psi } _ { 3 } \qquad \mathbf { \psi } _ { 3 } \mathbf { \psi } _ { 4 } \mathbf { \psi } _ { 4 } \mathbf { \psi } _ { 3 } \mathbf { \psi } _ { 4 } \mathbf { \psi } _ { 4 }$ ).
|
| 192 |
+
|
| 193 |
+
Remarkably, the rates of our methods are independent of $L$ and only depend on $\delta$ . Thus, when $\delta \leq L$ and $\bar { \delta } \leq L / _ { S }$ for MimeMVR and MimeLiteMVR, the rates beat the server only lower bound of $\Omega \big ( \frac { L G } { \sqrt { S } \epsilon ^ { 3 / 2 } } \big )$ . In fact, if the Hessian variance is small and $\delta \approx 0$ , our methods only need $\mathcal { O } ( 1 / \epsilon )$ rounds to communicate. Intuitively, our results show that local steps are very useful when heterogeneity (represented by $\delta$ ) is smaller than optimization difficulty (captured by smoothness constant $L$ ).
|
| 194 |
+
|
| 195 |
+
MimeMVR uses a momentum parameter $\beta$ of the order of $( 1 - \mathcal { O } ( T G ^ { 2 } ) ^ { - 2 / 3 } )$ i.e. as $T$ increases, $\beta$ asymptotically approaches 1. In contrast, previous analyses of distributed momentum (e.g. [73]) prove rates of the form $\frac { G ^ { 2 } } { S ( 1 - \beta ) \epsilon ^ { 2 } }$ , which are worse than that of standard SGD by a factor of $\frac { 1 } { 1 - \beta }$ .
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 1: Mime, MimeLite, FedAvg, Scaffold, FedProx, and Loc-Mime with $\mathrm { S G D + }$ momentum using 10 local epochs, run on EMNIST62 and a 2 hidden layer (300u-100) MLP. (Left) Mime and MimeLite are nearly identical and outperform the rest $7 \times$ faster). (Center) Mime makes better use of momentum than FedAvg, with a large increase in performance. (Right) Locally adapting momentum slows down convergence and makes it more unstable.
|
| 199 |
+
|
| 200 |
+
Thus, ours is also the first result which theoretically showcases the usefulness of using large momentum in distributed and federated learning. While we only prove the utility of local steps for MimeMVR, we believe our theory can be extended to other local update methods as well.
|
| 201 |
+
|
| 202 |
+
Our analysis is highly non-trivial and involves two crucial ingredients: i) computing the momentum at the server level to ensure that it remains unbiased and then applying it locally during every client update to reduce variance, and ii) carefully keeping track of the bias introduced via additional local steps. Our experiments (Sec. 5) verify our theoretical insights are indeed applicable in deep learning settings as well. See App. B for a proof sketch and App. G–H detailed proofs.
|
| 203 |
+
|
| 204 |
+
# 5 Experimental analysis on real world datasets
|
| 205 |
+
|
| 206 |
+
We run experiments on natively federated datasets to confirm our theory and accurately measure real world performance. Our main findings are i) MIME and MIMELITE consistently outperform FEDAVG, and ii) momentum and adaptivity significantly improves performance.
|
| 207 |
+
|
| 208 |
+
# 5.1 Setup
|
| 209 |
+
|
| 210 |
+
Algorithms. We consider three (meta) algorithms: FEDAVG, MIME, and MIMELITE. Each of these adapt four base optimizers: SGD, momentum, Adam, and Adagrad.
|
| 211 |
+
|
| 212 |
+
FEDAVG follows [49] who run multiple epochs of SGD on each client sampled, and then aggregate the net client updates. This aggregated update is used as a pseudo-gradient in the base optimizer (called server optimizer). The learning rate for the server optimizer is fixed to 1 as in [67]. This is done to ensure all algorithms have the same number of hyper-parameters.
|
| 213 |
+
|
| 214 |
+
MIME and MIMELITE follow Algorithm 4 and also run a fixed number of epochs on the client. However, note that this requires communicating both the full local-batch gradient as well as the parameter updates doubling the communication required to be sent by the client. For a fairer comparison, we split the sampled clients in MIME and MIMELITE into two groups–the first communicates only full local-batch gradient and the latter communicates only parameter updates. Thus, all methods have equal client communication to the server. This variant retains the convergence guarantees up to constants (details in the Appendix). We also run Loc-MIME where instead of keeping the global optimizer state fixed, we update it locally within the client. The optimizer state is reset after the round finishes. In all methods, aggregation is weighted by the number of samples on the clients.
|
| 215 |
+
|
| 216 |
+
Datasets and models. We run five simulations on three real-world federated datasets: EMNIST62 with i) a linear classifier, ii) an MLP, and iii) a CNN, iv) a charRNN on Shakespeare, and v) an LSTM for next word prediction on StackOverflow, all accessed through Tensorflow Federated [60]. The learning rates were individually tuned and other optimizer hyper-parameters such as $\beta$ for momentum, $\beta _ { 1 }$ , $\beta _ { 2 }$ , $\varepsilon _ { \mathrm { 0 } }$ for Adam and AdaGrad were left to their default values, unless explicitly stated otherwise. We refer to Appendix C for additional setup details and discussion.
|
| 217 |
+
|
| 218 |
+
# 5.2 Ablation and comparative study
|
| 219 |
+
|
| 220 |
+
In order to study the different algorithms, we train a 2 hidden layer ( $3 0 0 \mu$ -100) MLP on EMNIST62 with 10 local epochs for 1k rounds and use SGD $^ +$ momentum (with tuned $\beta$ ) as the base optimizer.
|
| 221 |
+
|
| 222 |
+
Mime $\approx$ MimeLite $>$ FedAvg $>$ SCAFFOLD $>$ FedProx. Fig. 1 (left) shows MIME and MIMELITE have nearly identical performance, and are about $7 \times$ faster than FedAvg. This implies our strategy of applying momentum to client updates is faster than simply using server momentum. FedProx [40] uses an additional regularizer $\mu$ tuned over [0.1, 0.5, 1] $\mu = 0$ is the same as FedAvg). Regularization does not seem to reduce client drift but still slows down convergence [66]. SCAFFOLD [32] is also slower than Mime and FedAvg in this setup. This is because in cross-device setting with a large number of clients $N = 3 . 4 k )$ ) means that each client is visited less than 6 times during the entire training (20 clients per round for 1k rounds). This means that the correction term utilized by SCAFFOLD uses control-variates which are quite stale (computed about 200 rounds ago) which slows down the convergence. In contrast, the SVRG correction term in Mime is computed using clients sampled in the current or previous rounds, and so is much more accurate.
|
| 223 |
+
|
| 224 |
+
Table 2: Validation $\%$ accuracies after training for 1000 rounds. Best results for each dataset is underlined and the best within each base optimizer is bolded. The number of clients sampled per round has been reduced for MIME and MIMELITE to ensure all methods have equal client and server communication. Final accuracies obtained by MIME and MIMELITE are competitive with FEDAVG, especially with adaptive base optimizers. FEDAVG seems unstable with Adam.
|
| 225 |
+
|
| 226 |
+
<table><tr><td rowspan="3">SGD</td><td colspan="2">EMNIST logistic StackOverflow</td><td colspan="2">EMNIST CNN Shakespeare</td></tr><tr><td>FedAvgSGD</td><td>66.8</td><td>85.8 56.7</td><td>23.8</td></tr><tr><td>MimeLiteSGD</td><td>66.8</td><td>85.8 56.7</td><td>23.8</td></tr><tr><td rowspan="3">MimeSGD MOMENTUM</td><td>67.4</td><td>85.3</td><td>56.1</td><td>12.5</td></tr><tr><td>FedAvgMom</td><td>67.4</td><td>85.7 55.4</td><td>22.2</td></tr><tr><td>MimeLiteMom</td><td>67.4 86.0</td><td>49.8</td><td>19.9</td></tr><tr><td rowspan="3">ADAM</td><td>MimeMom</td><td>67.5</td><td>85.9</td><td>53.6</td><td>19.3</td></tr><tr><td>FedAvgAdam</td><td>67.3</td><td>85.9</td><td>18.5</td><td>3.2</td></tr><tr><td>MimeLiteAdam</td><td>68.0</td><td>86.4</td><td>54.0</td><td>21.5</td></tr><tr><td rowspan="3">ADAGRAD</td><td>MimeAdam</td><td>68.0</td><td>86.6</td><td>54.1</td><td>22.8</td></tr><tr><td>FedAvgAdagrad</td><td>67.6</td><td>86.3</td><td>55.5</td><td>24.2</td></tr><tr><td>MimeLiteAdagrad</td><td>66.6</td><td>85.5</td><td>56.8</td><td>23.8</td></tr><tr><td></td><td>MimeAdagrad</td><td>67.4</td><td>86.3</td><td>57.1</td><td>14.7</td></tr></table>
|
| 227 |
+
|
| 228 |
+
With momentum $>$ without momentum. Fig. 1 (center) examines the impact of momentum on FedAvg and Mime. Momentum slightly improves the performance of FedAvg, whereas it has a significant impact on the performance of Mime. This is also in line with our theory and confirms that Mime’s strategy of applying it locally at every client update makes better use of momentum.
|
| 229 |
+
|
| 230 |
+
Fixed $>$ locally updated optimizer state. Finally, we check how the performance of Mime changes if instead of keeping the momentum fixed throughout a round, we let it change. The latter is a way to combine global and local momentum. The momentum is reset at the end of the round ignoring the changes the clients make to it. Fig. 1 (right) shows that this worsens the performance, confirming that it is better to keep the global optimizer state fixed as predicted by our theory.
|
| 231 |
+
|
| 232 |
+
Together, the above observations validate all aspects of Mime (and MimeLite) design: compute statistics at the server level, and apply them unchanged at every client update.
|
| 233 |
+
|
| 234 |
+
# 5.3 Large scale comparison with equal server and client communication
|
| 235 |
+
|
| 236 |
+
We perform a larger scale study closely matching the setup of [49]. For both MIME and MIMELITE, only half the clients compute and transmit the updated parameters, and other half transmit the full local-batch gradients. Hence, client to server communication cost is the same for all methods for all clients. However, MIME and MIMELITE require sending additional optimization state to the clients. Hence, we also reduce the number of clients sampled in each round to ensure sum total of communication at each round is $4 0 \times$ model size for EMNIST and Shakespeare experiments, and $1 0 0 \times$ model size for the StackOverflow next word prediction experiment.
|
| 237 |
+
|
| 238 |
+
Since we only perform 1 local epoch, the hyper-parameters (e.g. epsilon for adaptive methods) are more carefully chosen following [49], and MIME and MIMELITE use significantly fewer clients per round, the difference between FEDAVG and MIME is smaller here. Table 2 summarizes the results.
|
| 239 |
+
|
| 240 |
+
For the image classification tasks of EMNIST62 logistic and EMNIST62 CNN, Mime and MimeLite with Adam achieve the best performance. Using momentum (both with SGD and in Adam) significantly improves their performance. In contrast, FedAvgAdam is more unstable with worse performance. This is because FedAvg is excessively sensitive to hyperparameters (cf. App. E).
|
| 241 |
+
|
| 242 |
+
We next consider the character prediction task on Shakespeare dataset, and next word prediction on StackOverflow. Here, the momentum based methods (SGD $^ +$ momentum and Adam) are slower than their non-momentum counterparts (vanilla SGD and AdaGrad). This is because the mini-batch gradients in these tasks are sparse, with the gradients corresponding to tokens not in the mini-batch being zero. This sparsity structure is however destroyed when using momentum or Adam. For the same reason, Mime which uses an SVRG correction also significantly increases the gradient density.
|
| 243 |
+
|
| 244 |
+
Discussion. For traditional tasks such as image classification, we observe that Mime (especially with Adam) usually outperforms MimeLite which in turn outperforms FedAvg. These methods are able to successfully leverage momentum and adaptivity to improve performance. For tasks where the client gradients are sparse, the SVRG correction used by Mime hinders performance. Adapting our techniques to work with sparse gradients (a la Yogi [ \` 75]) could lead to further improvements. Also, note that we reduce communication by na¨ıvely reducing the number of participating clients per round. More sophisticated approaches to save on client communication including quantization or sparsification [58, 3], or even novel algorithmic innovations [1] could be explored. Further, server communication could be reduced using memory efficient optimizers e.g. AdaFactor [55] or SM3 [4].
|
| 245 |
+
|
| 246 |
+
# 6 Conclusion
|
| 247 |
+
|
| 248 |
+
Our work initiated a formal study of the cross-device federated learning problem and provided theoretically justified algorithms. We introduced a new framework MIME which overcomes the natural client-heterogeneity in such a setting, and can adapt arbitrary centralized algorithms such as Adam without additional hyper-parameters. We demonstrated the superiority of MIME via strong convergence guarantees and empirical evaluations. Further, we proved that a particular instance of our method, MimeMVR, beat centralized lower-bounds, demonstrating that additional local steps can yield asymptotic improvements for the first time. We believe our analysis will be of independent interest beyond the federated setting for understanding the sample complexity of non-convex optimization, and for yielding improved analysis of decentralized optimization algorithms.
|
| 249 |
+
|
| 250 |
+
# References
|
| 251 |
+
|
| 252 |
+
[1] Durmus Alp Emre Acar, Yue Zhao, Ramon Matas Navarro, Matthew Mattina, Paul N Whatmough, and Venkatesh Saligrama. Federated learning based on dynamic regularization. In International Conference on Learning Representations, 2021.
|
| 253 |
+
[2] Naman Agarwal, Ananda Theertha Suresh, Felix X. Yu, Sanjiv Kumar, and Brendan McMahan. cpSGD: Communication-efficient and differentially-private distributed SGD. In Proceedings of NeurIPS, pages 7575–7586, 2018.
|
| 254 |
+
[3] Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. Qsgd: Communication-efficient sgd via gradient quantization and encoding. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 255 |
+
[4] Rohan Anil, Vineet Gupta, Tomer Koren, and Yoram Singer. Memory-efficient adaptive optimization. arXiv preprint arXiv:1901.11150, 2019.
|
| 256 |
+
[5] Yossi Arjevani, Yair Carmon, John C Duchi, Dylan J Foster, Nathan Srebro, and Blake Woodworth. Lower bounds for non-convex stochastic optimization. arXiv preprint arXiv:1912.02365, 2019.
|
| 257 |
+
[6] Yossi Arjevani and Ohad Shamir. Communication complexity of distributed convex learning and optimization. In Advances in neural information processing systems, pages 1756–1764, 2015.
|
| 258 |
+
[7] Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloe Kiddon, Jakub Konecnˇ y, Stefano Mazzocchi, H Brendan McMahan, \` et al. Towards federated learning at scale: System design. arXiv preprint arXiv:1902.01046, 2019.
|
| 259 |
+
[8] Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H. Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for privacy-preserving machine learning. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pages 1175–1191. ACM, 2017.
|
| 260 |
+
[9] Sebastian Caldas, Jakub Konecny, H Brendan McMahan, and Ameet Talwalkar. Expand- ˇ ing the reach of federated learning by reducing client resource requirements. arXiv preprint arXiv:1812.07210, 2018.
|
| 261 |
+
[10] Sebastian Caldas, Peter Wu, Tian Li, Jakub Konecnˇ y, H Brendan McMahan, Virginia \` Smith, and Ameet Talwalkar. Leaf: A benchmark for federated settings. arXiv preprint arXiv:1812.01097, 2018.
|
| 262 |
+
[11] Zachary Charles and Jakub Konecnˇ y. On the outsized importance of learning rates in local \` update methods. arXiv preprint arXiv:2007.00878, 2020.
|
| 263 |
+
[12] Gregory Cohen, Saeed Afshar, Jonathan Tapson, and Andre Van Schaik. Emnist: Extending mnist to handwritten letters. In 2017 International Joint Conference on Neural Networks (IJCNN), pages 2921–2926. IEEE, 2017.
|
| 264 |
+
[13] Ashok Cutkosky and Harsh Mehta. Momentum improves normalized SGD. arXiv preprint arXiv:2002.03305, 2020.
|
| 265 |
+
[14] Ashok Cutkosky and Francesco Orabona. Momentum-based variance reduction in non-convex SGD. In Advances in Neural Information Processing Systems, pages 15210–15219, 2019.
|
| 266 |
+
[15] Aaron Defazio and Leon Bottou. On the ineffectiveness of variance reduced optimization ´ for deep learning. In Advances in Neural Information Processing Systems, pages 1753–1763, 2019.
|
| 267 |
+
[16] Stack Exchange. Stack exchange data dump. https: // archive. org/ details/ stackexchange , 2021.
|
| 268 |
+
[17] Cong Fang, Chris Junchi Li, Zhouchen Lin, and Tong Zhang. SPIDER: Near-optimal nonconvex optimization via stochastic path-integrated differential estimator. In Advances in Neural Information Processing Systems, pages 689–699, 2018.
|
| 269 |
+
[18] Dylan J Foster, Ayush Sekhari, Ohad Shamir, Nathan Srebro, Karthik Sridharan, and Blake Woodworth. The complexity of making the gradient small in stochastic convex optimization. In Conference on Learning Theory, pages 1319–1345. PMLR, 2019.
|
| 270 |
+
[19] Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. International Conference on Learning Representations (ICLR), 2019.
|
| 271 |
+
[20] Robin C Geyer, Tassilo Klein, and Moin Nabi. Differentially private federated learning: A client level perspective. arXiv preprint arXiv:1712.07557, 2017.
|
| 272 |
+
[21] Saeed Ghadimi and Guanghui Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013.
|
| 273 |
+
[22] Jenny Hamer, Mehryar Mohri, and Ananda Theertha Suresh. FedBoost: Communicationefficient algorithms for federated learning. In 37th International Conference on Machine Learning (ICML), 2020.
|
| 274 |
+
[23] Andrew Hard, Kurt Partridge, Cameron Nguyen, Niranjan Subrahmanya, Aishanee Shah, Pai Zhu, Ignacio Lopez Moreno, and Rajiv Mathews. Training keyword spotting models on non-iid data with federated learning. arXiv preprint arXiv:2005.10406, 2020.
|
| 275 |
+
[24] Lie He, Sai Praneeth Karimireddy, and Martin Jaggi. Secure byzantine-robust machine learning. arXiv preprint arXiv:2006.04747, 2020.
|
| 276 |
+
[25] Arne Holst. Smartphone users worldwide 2016-2021. Statista https: // web. archive. org/ web/ 20210608080335/ https: // www. statista. com/ statistics/ 330695/ number-of-smartphone-users-worldwide/ , 2019.
|
| 277 |
+
[26] Tzu-Ming Harry Hsu, Hang Qi, and Matthew Brown. Measuring the effects of non-identical data distribution for federated visual classification. arXiv preprint arXiv:1909.06335, 2019.
|
| 278 |
+
[27] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in neural information processing systems, pages 315–323, 2013.
|
| 279 |
+
[28] Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurelien Bellet, Mehdi Bennis, Ar- ´ jun Nitin Bhagoji, Keith Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019.
|
| 280 |
+
[29] Hamed Karimi, Julie Nutini, and Mark Schmidt. Linear convergence of gradient and proximalgradient methods under the polyak-łojasiewicz condition. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 795–811. Springer, 2016.
|
| 281 |
+
[30] Sai Praneeth Karimireddy, Lie He, and Martin Jaggi. Learning from history for byzantine robust optimization. In 38th International Conference on Machine Learning (ICML), 2021.
|
| 282 |
+
[31] Sai Praneeth Karimireddy, Martin Jaggi, Satyen Kale, Mehryar Mohri, Sashank J Reddi, Sebastian U Stich, and Ananda Theertha Suresh. Mime: Mimicking centralized stochastic algorithms in federated learning. arXiv preprint arXiv:2008.03606, 2020.
|
| 283 |
+
[32] Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank J Reddi, Sebastian U Stich, and Ananda Theertha Suresh. SCAFFOLD: Stochastic controlled averaging for on-device federated learning. In 37th International Conference on Machine Learning (ICML), 2020.
|
| 284 |
+
[33] Sai Praneeth Karimireddy, Quentin Rebjock, Sebastian U. Stich, and Martin Jaggi. Error feedback fixes SignSGD and other gradient compression schemes. In 36th International Conference on Machine Learning (ICML), 2019.
|
| 285 |
+
[34] Ahmed Khaled, Konstantin Mishchenko, and Peter Richtarik. Tighter theory for local SGD on ´ indentical and heterogeneous data. In Proceedings of AISTATS, 2020.
|
| 286 |
+
[35] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 287 |
+
[36] Anastasia Koloskova, Nicolas Loizou, Sadra Boreiri, Martin Jaggi, and Sebastian U Stich. A unified theory of decentralized SGD with changing topology and local updates. In $3 7 t h$ International Conference on Machine Learning (ICML), 2020.
|
| 288 |
+
[37] Jakub Konecnˇ y, H. Brendan McMahan, Daniel Ramage, and Peter Richt \` arik. Feder- ´ ated optimization: Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527, 2016.
|
| 289 |
+
[38] Jakub Konecnˇ y, H. Brendan McMahan, Felix X. Yu, Peter Richt \` arik, Ananda Theertha Suresh, ´ and Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016.
|
| 290 |
+
[39] Lihua Lei and Michael Jordan. Less than a single pass: Stochastically controlled stochastic gradient. In AISTATS, pages 148–156, 2017.
|
| 291 |
+
[40] Tian Li, Anit Kumar Sahu, Maziar Sanjabi, Manzil Zaheer, Ameet Talwalkar, and Virginia Smith. On the convergence of federated optimization in heterogeneous networks. arXiv preprint arXiv:1812.06127, 2018.
|
| 292 |
+
[41] Tian Li, Maziar Sanjabi, and Virginia Smith. Fair resource allocation in federated learning. arXiv preprint arXiv:1905.10497, 2019.
|
| 293 |
+
[42] Liyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Jiawei Han. On the variance of the adaptive learning rate and beyond. arXiv preprint arXiv:1908.03265, 2019.
|
| 294 |
+
[43] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. ¨ Communication-efficient learning of deep networks from decentralized data. In Proceedings of AISTATS, pages 1273–1282, 2017.
|
| 295 |
+
[44] Mehryar Mohri, Gary Sivek, and Ananda Theertha Suresh. Agnostic federated learning. arXiv preprint arXiv:1902.00146, 2019.
|
| 296 |
+
[45] Yurii Nesterov. Lectures on convex optimization, volume 137. Springer, 2018.
|
| 297 |
+
[46] Lam M. Nguyen, Jie Liu, Katya Scheinberg, and Martin Taka´c. Stochastic recursive gradient ˇ algorithm for nonconvex optimization. arXiv preprint arXiv:1705.07261, 2017.
|
| 298 |
+
[47] Kumar Kshitij Patel and Aymeric Dieuleveut. Communication trade-offs for synchronized distributed SGD with large step size. In 33rd Conference on Neural Information Processing Systems (NeurIPS), 2019.
|
| 299 |
+
[48] Krishna Pillutla, Sham M Kakade, and Zaid Harchaoui. Robust aggregation for federated learning. arXiv preprint arXiv:1912.13445, 2019.
|
| 300 |
+
[49] Sashank Reddi, Zachary Charles, Manzil Zaheer, Zachary Garrett, Keith Rush, Jakub Konecnˇ y,\` Sanjiv Kumar, and H Brendan McMahan. Adaptive federated optimization. arXiv preprint arXiv:2003.00295, 2020.
|
| 301 |
+
[50] Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. International Conference on Learning Representations (ICLR), 2018.
|
| 302 |
+
[51] Sashank J. Reddi, Jakub Konecnˇ y, Peter Richt \` arik, Barnab ´ as P ´ ocz ´ os, and Alex Smola. Aide: ´ Fast and communication efficient distributed optimization. arXiv preprint arXiv:1608.06879, 2016.
|
| 303 |
+
[52] Jae Hun Ro, Ananda Theertha Suresh, and Ke Wu. FedJAX: Federated learning simulation with JAX, 2020.
|
| 304 |
+
[53] Jae Hun Ro, Ananda Theertha Suresh, and Ke Wu. Fedjax: Federated learning simulation with jax. arXiv preprint arXiv:2108.02117, 2021.
|
| 305 |
+
[54] Ohad Shamir, Nati Srebro, and Tong Zhang. Communication-efficient distributed optimization using an approximate newton-type method. In International conference on machine learning, pages 1000–1008, 2014.
|
| 306 |
+
[55] Noam Shazeer and Mitchell Stern. Adafactor: Adaptive learning rates with sublinear memory cost. In International Conference on Machine Learning, pages 4596–4604. PMLR, 2018.
|
| 307 |
+
[56] Sebastian U. Stich. Local SGD converges fast and communicates little. International Conference on Learning Representations (ICLR), 2019.
|
| 308 |
+
[57] Sebastian U. Stich and Sai Praneeth Karimireddy. The error-feedback framework: Better rates for SGD with delayed gradients and compressed communication. arXiv preprint arXiv:1909.05350, 2019.
|
| 309 |
+
[58] Ananda Theertha Suresh, Felix X. Yu, Sanjiv Kumar, and H. Brendan McMahan. Distributed mean estimation with limited communication. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 3329–3337. JMLR. org, 2017.
|
| 310 |
+
[59] Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pages 1139–1147, 2013.
|
| 311 |
+
[60] TFF. Tensorflow federated datasets. https: // www. tensorflow. org/ federated/ api_ docs/ python/ tff/ simulation/ datasets , 2020.
|
| 312 |
+
[61] Om Thakkar, Swaroop Ramaswamy, Rajiv Mathews, and Franc¸oise Beaufays. Understanding unintended memorization in federated learning. arXiv preprint arXiv:2006.07490, 2020.
|
| 313 |
+
[62] Quoc Tran-Dinh, Nhan H. Pham, Dzung T. Phan, and Lam M. Nguyen. Hybrid stochastic gradient descent algorithms for stochastic nonconvex optimization. arXiv preprint arXiv:1905.05920, 2019.
|
| 314 |
+
[63] Sharan Vaswani, Francis Bach, and Mark Schmidt. Fast and faster convergence of SGD for over-parameterized models and an accelerated perceptron. arXiv preprint arXiv:1810.07288, 2018.
|
| 315 |
+
[64] Thijs Vogels, Sai Praneeth Karimireddy, and Martin Jaggi. Powersgd: Practical low-rank gradient compression for distributed optimization. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 316 |
+
[65] Hongyi Wang, Kartik Sreenivasan, Shashank Rajput, Harit Vishwakarma, Saurabh Agarwal, Jy-yong Sohn, Kangwook Lee, and Dimitris Papailiopoulos. Attack of the tails: Yes, you really can backdoor federated learning. arXiv preprint arXiv:2007.05084, 2020.
|
| 317 |
+
[66] Jianyu Wang, Qinghua Liu, Hao Liang, Gauri Joshi, and H Vincent Poor. Tackling the objective inconsistency problem in heterogeneous federated optimization. arXiv preprint arXiv:2007.07481, 2020.
|
| 318 |
+
[67] Jianyu Wang, Vinayak Tantia, Nicolas Ballas, and Michael Rabbat. SlowMo: Improving communication-efficient distributed sgd with slow momentum. International Conference on Learning Representations (ICLR), 2020.
|
| 319 |
+
[68] Shiqiang Wang, Tiffany Tuor, Theodoros Salonidis, Kin K. Leung, Christian Makaya, Ting He, and Kevin Chan. Adaptive federated learning in resource constrained edge computing systems. IEEE Journal on Selected Areas in Communications, 37(6):1205–1221, 2019.
|
| 320 |
+
[69] Blake Woodworth, Kumar Kshitij Patel, and Nathan Srebro. Minibatch vs local SGD for heterogeneous distributed learning. arXiv preprint arXiv:2006.04735, 2020.
|
| 321 |
+
[70] Blake Woodworth, Kumar Kshitij Patel, Sebastian U Stich, Zhen Dai, Brian Bullins, H Brendan McMahan, Ohad Shamir, and Nathan Srebro. Is local SGD better than minibatch SGD? In 37th International Conference on Machine Learning (ICML), 2020.
|
| 322 |
+
[71] Yang You, Igor Gitman, and Boris Ginsburg. Large batch training of convolutional networks. arXiv preprint arXiv:1708.03888, 2017.
|
| 323 |
+
[72] Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. Large batch optimization for deep learning: Training bert in 76 minutes. In International Conference on Learning Representations, 2019.
|
| 324 |
+
[73] Hao Yu, Rong Jin, and Sen Yang. On the linear speedup analysis of communication efficient momentum sgd for distributed non-convex optimization. arXiv preprint arXiv:1905.03817, 2019.
|
| 325 |
+
[74] Hao Yu, Sen Yang, and Shenghuo Zhu. Parallel restarted SGD with faster convergence and less communication: Demystifying why model averaging works for deep learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 5693–5700, 2019.
|
| 326 |
+
[75] Manzil Zaheer, Sashank Reddi, Devendra Sachan, Satyen Kale, and Sanjiv Kumar. Adaptive methods for nonconvex optimization. In Advances in neural information processing systems, pages 9793–9803, 2018.
|
| 327 |
+
[76] Jingzhao Zhang, Tianxing He, Suvrit Sra, and Ali Jadbabaie. Why gradient clipping accelerates training: A theoretical justification for adaptivity. In International Conference on Learning Representations, 2020.
|
| 328 |
+
[77] Jingzhao Zhang, Sai Praneeth Karimireddy, Andreas Veit, Seungyeon Kim, Sashank J Reddi, Sanjiv Kumar, and Suvrit Sra. Why ADAM beats SGD for attention models. arXiv preprint arXiv:1912.03194, 2019.
|
| 329 |
+
[78] Martin Zinkevich, Markus Weimer, Lihong Li, and Alex J Smola. Parallelized stochastic gradient descent. In Advances in neural information processing systems, pages 2595–2603, 2010.
|