Chelsea707 commited on
Commit
106e077
·
verified ·
1 Parent(s): a113ae4

Add Batch 8ed7da13-ab3b-4544-ac21-96d10f0a42db data

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +48 -0
  2. 2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/ed6283a9-c47a-45be-a3e5-a228ad5db48e_content_list.json +2126 -0
  3. 2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/ed6283a9-c47a-45be-a3e5-a228ad5db48e_model.json +0 -0
  4. 2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/ed6283a9-c47a-45be-a3e5-a228ad5db48e_origin.pdf +3 -0
  5. 2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/full.md +388 -0
  6. 2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/images.zip +3 -0
  7. 2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/layout.json +0 -0
  8. 2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/3de52cb5-1c81-4fb7-8fab-f06b43c089a4_content_list.json +1650 -0
  9. 2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/3de52cb5-1c81-4fb7-8fab-f06b43c089a4_model.json +0 -0
  10. 2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/3de52cb5-1c81-4fb7-8fab-f06b43c089a4_origin.pdf +3 -0
  11. 2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/full.md +286 -0
  12. 2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/images.zip +3 -0
  13. 2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/layout.json +0 -0
  14. 2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/472ef1b2-669d-4b07-ae82-dafb730e88d4_content_list.json +1219 -0
  15. 2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/472ef1b2-669d-4b07-ae82-dafb730e88d4_model.json +1518 -0
  16. 2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/472ef1b2-669d-4b07-ae82-dafb730e88d4_origin.pdf +3 -0
  17. 2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/full.md +203 -0
  18. 2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/images.zip +3 -0
  19. 2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/layout.json +0 -0
  20. 2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/21af0af7-6fd8-4600-8ad6-54b767b85a85_content_list.json +1527 -0
  21. 2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/21af0af7-6fd8-4600-8ad6-54b767b85a85_model.json +1828 -0
  22. 2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/21af0af7-6fd8-4600-8ad6-54b767b85a85_origin.pdf +3 -0
  23. 2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/full.md +268 -0
  24. 2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/images.zip +3 -0
  25. 2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/layout.json +0 -0
  26. 2023/A Boundary Offset Prediction Network for Named Entity Recognition/5304d5a7-baa1-46a8-bf30-4a5c29036879_content_list.json +1827 -0
  27. 2023/A Boundary Offset Prediction Network for Named Entity Recognition/5304d5a7-baa1-46a8-bf30-4a5c29036879_model.json +0 -0
  28. 2023/A Boundary Offset Prediction Network for Named Entity Recognition/5304d5a7-baa1-46a8-bf30-4a5c29036879_origin.pdf +3 -0
  29. 2023/A Boundary Offset Prediction Network for Named Entity Recognition/full.md +356 -0
  30. 2023/A Boundary Offset Prediction Network for Named Entity Recognition/images.zip +3 -0
  31. 2023/A Boundary Offset Prediction Network for Named Entity Recognition/layout.json +0 -0
  32. 2023/A Causal View of Entity Bias in (Large) Language Models/729caa97-c496-4007-b8f4-5ff70bb6b7ae_content_list.json +1906 -0
  33. 2023/A Causal View of Entity Bias in (Large) Language Models/729caa97-c496-4007-b8f4-5ff70bb6b7ae_model.json +0 -0
  34. 2023/A Causal View of Entity Bias in (Large) Language Models/729caa97-c496-4007-b8f4-5ff70bb6b7ae_origin.pdf +3 -0
  35. 2023/A Causal View of Entity Bias in (Large) Language Models/full.md +336 -0
  36. 2023/A Causal View of Entity Bias in (Large) Language Models/images.zip +3 -0
  37. 2023/A Causal View of Entity Bias in (Large) Language Models/layout.json +0 -0
  38. 2023/A Closer Look into Using Large Language Models for Automatic Evaluation/dbe97091-acd7-407e-a8d4-8552f4605855_content_list.json +0 -0
  39. 2023/A Closer Look into Using Large Language Models for Automatic Evaluation/dbe97091-acd7-407e-a8d4-8552f4605855_model.json +0 -0
  40. 2023/A Closer Look into Using Large Language Models for Automatic Evaluation/dbe97091-acd7-407e-a8d4-8552f4605855_origin.pdf +3 -0
  41. 2023/A Closer Look into Using Large Language Models for Automatic Evaluation/full.md +564 -0
  42. 2023/A Closer Look into Using Large Language Models for Automatic Evaluation/images.zip +3 -0
  43. 2023/A Closer Look into Using Large Language Models for Automatic Evaluation/layout.json +0 -0
  44. 2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/03295168-adb4-4f17-ac96-deb081e11468_content_list.json +1929 -0
  45. 2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/03295168-adb4-4f17-ac96-deb081e11468_model.json +2424 -0
  46. 2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/03295168-adb4-4f17-ac96-deb081e11468_origin.pdf +3 -0
  47. 2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/full.md +325 -0
  48. 2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/images.zip +3 -0
  49. 2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/layout.json +0 -0
  50. 2023/A Comprehensive Evaluation of Tool-Assisted Generation Strategies/6b3b9095-80bb-4832-9b1c-9b30dcb51c14_content_list.json +0 -0
.gitattributes CHANGED
@@ -5545,3 +5545,51 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
5545
  2024/“You[[:space:]]Gotta[[:space:]]be[[:space:]]a[[:space:]]Doctor,[[:space:]]Lin”[[:space:]]_[[:space:]]An[[:space:]]Investigation[[:space:]]of[[:space:]]Name-Based[[:space:]]Bias[[:space:]]of[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]in[[:space:]]Employment[[:space:]]Recommendations/d7845467-94ef-458f-9d7d-f43f9afdcb6b_origin.pdf filter=lfs diff=lfs merge=lfs -text
5546
  2024/Fast[[:space:]]Forwarding[[:space:]]Low-Rank[[:space:]]Training/9609da61-f7eb-4e43-a005-289ec2b63ea6_origin.pdf filter=lfs diff=lfs merge=lfs -text
5547
  2024/Fewer[[:space:]]is[[:space:]]More_[[:space:]]Boosting[[:space:]]Math[[:space:]]Reasoning[[:space:]]with[[:space:]]Reinforced[[:space:]]Context[[:space:]]Pruning/aaf75814-e779-4ac6-b074-387d29a3853b_origin.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5545
  2024/“You[[:space:]]Gotta[[:space:]]be[[:space:]]a[[:space:]]Doctor,[[:space:]]Lin”[[:space:]]_[[:space:]]An[[:space:]]Investigation[[:space:]]of[[:space:]]Name-Based[[:space:]]Bias[[:space:]]of[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]in[[:space:]]Employment[[:space:]]Recommendations/d7845467-94ef-458f-9d7d-f43f9afdcb6b_origin.pdf filter=lfs diff=lfs merge=lfs -text
5546
  2024/Fast[[:space:]]Forwarding[[:space:]]Low-Rank[[:space:]]Training/9609da61-f7eb-4e43-a005-289ec2b63ea6_origin.pdf filter=lfs diff=lfs merge=lfs -text
5547
  2024/Fewer[[:space:]]is[[:space:]]More_[[:space:]]Boosting[[:space:]]Math[[:space:]]Reasoning[[:space:]]with[[:space:]]Reinforced[[:space:]]Context[[:space:]]Pruning/aaf75814-e779-4ac6-b074-387d29a3853b_origin.pdf filter=lfs diff=lfs merge=lfs -text
5548
+ 2023/1-PAGER_[[:space:]]One[[:space:]]Pass[[:space:]]Answer[[:space:]]Generation[[:space:]]and[[:space:]]Evidence[[:space:]]Retrieval/ed6283a9-c47a-45be-a3e5-a228ad5db48e_origin.pdf filter=lfs diff=lfs merge=lfs -text
5549
+ 2023/2INER_[[:space:]]Instructive[[:space:]]and[[:space:]]In-Context[[:space:]]Learning[[:space:]]on[[:space:]]Few-Shot[[:space:]]Named[[:space:]]Entity[[:space:]]Recognition/3de52cb5-1c81-4fb7-8fab-f06b43c089a4_origin.pdf filter=lfs diff=lfs merge=lfs -text
5550
+ 2023/A[[:space:]]Benchmark[[:space:]]for[[:space:]]Semi-Inductive[[:space:]]Link[[:space:]]Prediction[[:space:]]in[[:space:]]Knowledge[[:space:]]Graphs/472ef1b2-669d-4b07-ae82-dafb730e88d4_origin.pdf filter=lfs diff=lfs merge=lfs -text
5551
+ 2023/A[[:space:]]Black-Box[[:space:]]Attack[[:space:]]on[[:space:]]Code[[:space:]]Models[[:space:]]via[[:space:]]Representation[[:space:]]Nearest[[:space:]]Neighbor[[:space:]]Search/21af0af7-6fd8-4600-8ad6-54b767b85a85_origin.pdf filter=lfs diff=lfs merge=lfs -text
5552
+ 2023/A[[:space:]]Boundary[[:space:]]Offset[[:space:]]Prediction[[:space:]]Network[[:space:]]for[[:space:]]Named[[:space:]]Entity[[:space:]]Recognition/5304d5a7-baa1-46a8-bf30-4a5c29036879_origin.pdf filter=lfs diff=lfs merge=lfs -text
5553
+ 2023/A[[:space:]]Causal[[:space:]]View[[:space:]]of[[:space:]]Entity[[:space:]]Bias[[:space:]]in[[:space:]](Large)[[:space:]]Language[[:space:]]Models/729caa97-c496-4007-b8f4-5ff70bb6b7ae_origin.pdf filter=lfs diff=lfs merge=lfs -text
5554
+ 2023/A[[:space:]]Closer[[:space:]]Look[[:space:]]into[[:space:]]Using[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]for[[:space:]]Automatic[[:space:]]Evaluation/dbe97091-acd7-407e-a8d4-8552f4605855_origin.pdf filter=lfs diff=lfs merge=lfs -text
5555
+ 2023/A[[:space:]]Comprehensive[[:space:]]Evaluation[[:space:]]of[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]on[[:space:]]Legal[[:space:]]Judgment[[:space:]]Prediction/03295168-adb4-4f17-ac96-deb081e11468_origin.pdf filter=lfs diff=lfs merge=lfs -text
5556
+ 2023/A[[:space:]]Comprehensive[[:space:]]Evaluation[[:space:]]of[[:space:]]Tool-Assisted[[:space:]]Generation[[:space:]]Strategies/6b3b9095-80bb-4832-9b1c-9b30dcb51c14_origin.pdf filter=lfs diff=lfs merge=lfs -text
5557
+ 2023/A[[:space:]]Computational[[:space:]]Interface[[:space:]]to[[:space:]]Translate[[:space:]]Strategic[[:space:]]Intent[[:space:]]from[[:space:]]Unstructured[[:space:]]Language[[:space:]]in[[:space:]]a[[:space:]]Low-Data[[:space:]]Setting/0ecff77c-66e5-47c5-93be-49d90731c30d_origin.pdf filter=lfs diff=lfs merge=lfs -text
5558
+ 2023/A[[:space:]]Confederacy[[:space:]]of[[:space:]]Models_[[:space:]]a[[:space:]]Comprehensive[[:space:]]Evaluation[[:space:]]of[[:space:]]LLMs[[:space:]]on[[:space:]]Creative[[:space:]]Writing/ddc1ecbc-a8cc-40b2-84dd-398deba4a5c3_origin.pdf filter=lfs diff=lfs merge=lfs -text
5559
+ 2023/A[[:space:]]Critical[[:space:]]Analysis[[:space:]]of[[:space:]]Document[[:space:]]Out-of-Distribution[[:space:]]Detection/dc0b7121-5749-4d5e-b65f-34d4dd4df565_origin.pdf filter=lfs diff=lfs merge=lfs -text
5560
+ 2023/A[[:space:]]Dataset[[:space:]]for[[:space:]]Investigating[[:space:]]the[[:space:]]Impact[[:space:]]of[[:space:]]Context[[:space:]]for[[:space:]]Offensive[[:space:]]Language[[:space:]]Detection[[:space:]]in[[:space:]]Tweets/1ce470ab-e396-4125-bc86-502c385ac36b_origin.pdf filter=lfs diff=lfs merge=lfs -text
5561
+ 2023/A[[:space:]]Framework[[:space:]]for[[:space:]]Bidirectional[[:space:]]Decoding_[[:space:]]Case[[:space:]]Study[[:space:]]in[[:space:]]Morphological[[:space:]]Inflection/911ebe92-f987-4f30-ba8a-6ececcac30ec_origin.pdf filter=lfs diff=lfs merge=lfs -text
5562
+ 2023/A[[:space:]]Framework[[:space:]]for[[:space:]]Exploring[[:space:]]Player[[:space:]]Perceptions[[:space:]]of[[:space:]]LLM-Generated[[:space:]]Dialogue[[:space:]]in[[:space:]]Commercial[[:space:]]Video[[:space:]]Games/d5ddb1fa-ae0e-4f20-bc10-0953a4168524_origin.pdf filter=lfs diff=lfs merge=lfs -text
5563
+ 2023/A[[:space:]]Frustratingly[[:space:]]Easy[[:space:]]Plug-and-Play[[:space:]]Detection-and-Reasoning[[:space:]]Module[[:space:]]for[[:space:]]Chinese[[:space:]]Spelling[[:space:]]Check/79cd98e0-e8e2-4f21-9a02-28f4c98a27c1_origin.pdf filter=lfs diff=lfs merge=lfs -text
5564
+ 2023/A[[:space:]]Hierarchical[[:space:]]Encoding-Decoding[[:space:]]Scheme[[:space:]]for[[:space:]]Abstractive[[:space:]]Multi-document[[:space:]]Summarization/c4cdb542-18c4-4689-81ae-62f4201e9b72_origin.pdf filter=lfs diff=lfs merge=lfs -text
5565
+ 2023/A[[:space:]]Joint[[:space:]]Matrix[[:space:]]Factorization[[:space:]]Analysis[[:space:]]of[[:space:]]Multilingual[[:space:]]Representations/7f6fc390-7960-4621-b5b9-b109c8392c16_origin.pdf filter=lfs diff=lfs merge=lfs -text
5566
+ 2023/A[[:space:]]Language[[:space:]]Model[[:space:]]with[[:space:]]Limited[[:space:]]Memory[[:space:]]Capacity[[:space:]]Captures[[:space:]]Interference[[:space:]]in[[:space:]]Human[[:space:]]Sentence[[:space:]]Processing/92d813cc-3614-40df-b622-17b80c3b6926_origin.pdf filter=lfs diff=lfs merge=lfs -text
5567
+ 2023/A[[:space:]]Lightweight[[:space:]]Method[[:space:]]to[[:space:]]Generate[[:space:]]Unanswerable[[:space:]]Questions[[:space:]]in[[:space:]]English/a4ca28aa-7501-4c72-aa7e-6dcc59b17cd9_origin.pdf filter=lfs diff=lfs merge=lfs -text
5568
+ 2023/A[[:space:]]Multi-Modal[[:space:]]Multilingual[[:space:]]Benchmark[[:space:]]for[[:space:]]Document[[:space:]]Image[[:space:]]Classification/99651770-2f3f-4559-bee6-0108e0d63ab8_origin.pdf filter=lfs diff=lfs merge=lfs -text
5569
+ 2023/A[[:space:]]New[[:space:]]Benchmark[[:space:]]and[[:space:]]Reverse[[:space:]]Validation[[:space:]]Method[[:space:]]for[[:space:]]Passage-level[[:space:]]Hallucination[[:space:]]Detection/7f0f41c2-eeab-448d-b1cb-149a639ca0c9_origin.pdf filter=lfs diff=lfs merge=lfs -text
5570
+ 2023/A[[:space:]]Novel[[:space:]]Contrastive[[:space:]]Learning[[:space:]]Method[[:space:]]for[[:space:]]Clickbait[[:space:]]Detection[[:space:]]on[[:space:]]RoCliCo_[[:space:]]A[[:space:]]Romanian[[:space:]]Clickbait[[:space:]]Corpus[[:space:]]of[[:space:]]News[[:space:]]Articles/335fe8e5-0d90-4371-8a9c-3d49533b1a2a_origin.pdf filter=lfs diff=lfs merge=lfs -text
5571
+ 2023/A[[:space:]]Parallel[[:space:]]Corpus[[:space:]]for[[:space:]]Vietnamese[[:space:]]Central-Northern[[:space:]]Dialect[[:space:]]Text[[:space:]]Transfer/2837564c-4387-482a-9089-34aa15fd7e0e_origin.pdf filter=lfs diff=lfs merge=lfs -text
5572
+ 2023/A[[:space:]]Query-Parallel[[:space:]]Machine[[:space:]]Reading[[:space:]]Comprehension[[:space:]]Framework[[:space:]]for[[:space:]]Low-resource[[:space:]]NER/74fbd22a-dac6-4ba8-8eab-10941bff64c1_origin.pdf filter=lfs diff=lfs merge=lfs -text
5573
+ 2023/A[[:space:]]Read-and-Select[[:space:]]Framework[[:space:]]for[[:space:]]Zero-shot[[:space:]]Entity[[:space:]]Linking/030b6fb6-a8fa-4919-bdfc-db2b37ea1051_origin.pdf filter=lfs diff=lfs merge=lfs -text
5574
+ 2023/A[[:space:]]Reference-free[[:space:]]Segmentation[[:space:]]Quality[[:space:]]Index[[:space:]](SegReFree)/ba88a6ce-2298-483f-951e-99f75155a986_origin.pdf filter=lfs diff=lfs merge=lfs -text
5575
+ 2023/A[[:space:]]Rewriting[[:space:]]Approach[[:space:]]for[[:space:]]Gender[[:space:]]Inclusivity[[:space:]]in[[:space:]]Portuguese/df7e43be-a55c-4f96-b469-7bbe13e64823_origin.pdf filter=lfs diff=lfs merge=lfs -text
5576
+ 2023/A[[:space:]]Sequence-to-Structure[[:space:]]Approach[[:space:]]to[[:space:]]Document-level[[:space:]]Targeted[[:space:]]Sentiment[[:space:]]Analysis/76c3d563-4f8f-4984-b3fb-b69d157d8234_origin.pdf filter=lfs diff=lfs merge=lfs -text
5577
+ 2023/A[[:space:]]Spectral[[:space:]]Viewpoint[[:space:]]on[[:space:]]Continual[[:space:]]Relation[[:space:]]Extraction/4b8581b0-8a1e-48ad-ae8d-aedefab1e935_origin.pdf filter=lfs diff=lfs merge=lfs -text
5578
+ 2023/A[[:space:]]Structure-Aware[[:space:]]Generative[[:space:]]Adversarial[[:space:]]Network[[:space:]]for[[:space:]]Bilingual[[:space:]]Lexicon[[:space:]]Induction/96069ab8-fad1-4366-a1c1-d7fc4e850f49_origin.pdf filter=lfs diff=lfs merge=lfs -text
5579
+ 2023/A[[:space:]]Table-to-Text[[:space:]]Framework[[:space:]]with[[:space:]]Heterogeneous[[:space:]]Multidominance[[:space:]]Attention[[:space:]]and[[:space:]]Self-Evaluated[[:space:]]Multi-Pass[[:space:]]Deliberation/a47fb9bb-8f0e-45f7-8219-a8faab1cf449_origin.pdf filter=lfs diff=lfs merge=lfs -text
5580
+ 2023/A[[:space:]]Thorough[[:space:]]Examination[[:space:]]on[[:space:]]Zero-shot[[:space:]]Dense[[:space:]]Retrieval/183885c0-48c6-4842-97b7-5dfbcdd03624_origin.pdf filter=lfs diff=lfs merge=lfs -text
5581
+ 2023/A[[:space:]]Unified[[:space:]]Framework[[:space:]]for[[:space:]]Synaesthesia[[:space:]]Analysis/dcba89c9-0794-4ccb-b6ef-0aea93f140db_origin.pdf filter=lfs diff=lfs merge=lfs -text
5582
+ 2023/A[[:space:]]Zero-Shot[[:space:]]Language[[:space:]]Agent[[:space:]]for[[:space:]]Computer[[:space:]]Control[[:space:]]with[[:space:]]Structured[[:space:]]Reflection/a0a6e275-4726-404f-a447-0adafd25c638_origin.pdf filter=lfs diff=lfs merge=lfs -text
5583
+ 2023/ACT-SQL_[[:space:]]In-Context[[:space:]]Learning[[:space:]]for[[:space:]]Text-to-SQL[[:space:]]with[[:space:]]Automatically-Generated[[:space:]]Chain-of-Thought/e5a64e92-4796-4a1a-8132-76dddf1f0f67_origin.pdf filter=lfs diff=lfs merge=lfs -text
5584
+ 2023/APP_[[:space:]]Adaptive[[:space:]]Prototypical[[:space:]]Pseudo-Labeling[[:space:]]for[[:space:]]Few-shot[[:space:]]OOD[[:space:]]Detection/3af0b555-df5b-4b18-a998-77ba61a4930c_origin.pdf filter=lfs diff=lfs merge=lfs -text
5585
+ 2023/ARKitSceneRefer_[[:space:]]Text-based[[:space:]]Localization[[:space:]]of[[:space:]]Small[[:space:]]Objects[[:space:]]in[[:space:]]Diverse[[:space:]]Real-World[[:space:]]3D[[:space:]]Indoor[[:space:]]Scenes/9d2d43eb-57ab-4c45-85e3-3b1baced78e6_origin.pdf filter=lfs diff=lfs merge=lfs -text
5586
+ 2023/ASPIRO_[[:space:]]Any-shot[[:space:]]Structured[[:space:]]Parsing-error-Induced[[:space:]]ReprOmpting[[:space:]]for[[:space:]]Consistent[[:space:]]Data-to-Text[[:space:]]Generation/e52a8117-87c0-4cd3-84ab-fcf1cc33cdf9_origin.pdf filter=lfs diff=lfs merge=lfs -text
5587
+ 2023/ASSERT_[[:space:]]Automated[[:space:]]Safety[[:space:]]Scenario[[:space:]]Red[[:space:]]Teaming[[:space:]]for[[:space:]]Evaluating[[:space:]]the[[:space:]]Robustness[[:space:]]of[[:space:]]Large[[:space:]]Language[[:space:]]Models/8fe0a4b0-6ae1-4e8a-a11f-345dc122b949_origin.pdf filter=lfs diff=lfs merge=lfs -text
5588
+ 2023/Accelerating[[:space:]]Multiple[[:space:]]Intent[[:space:]]Detection[[:space:]]and[[:space:]]Slot[[:space:]]Filling[[:space:]]via[[:space:]]Targeted[[:space:]]Knowledge[[:space:]]Distillation/f16b73f7-5f29-464a-8a54-5c1e1dad9dad_origin.pdf filter=lfs diff=lfs merge=lfs -text
5589
+ 2023/Accuracy[[:space:]]is[[:space:]]not[[:space:]]enough_[[:space:]]Evaluating[[:space:]]Personalization[[:space:]]in[[:space:]]Summarizers/b5c480b9-c0cf-42cb-8d63-001436d251fb_origin.pdf filter=lfs diff=lfs merge=lfs -text
5590
+ 2023/Active[[:space:]]Learning[[:space:]]Principles[[:space:]]for[[:space:]]In-Context[[:space:]]Learning[[:space:]]with[[:space:]]Large[[:space:]]Language[[:space:]]Models/c9f86532-1018-45a4-a80e-747592411e6d_origin.pdf filter=lfs diff=lfs merge=lfs -text
5591
+ 2023/AdaTranS_[[:space:]]Adapting[[:space:]]with[[:space:]]Boundary-based[[:space:]]Shrinking[[:space:]]for[[:space:]]End-to-End[[:space:]]Speech[[:space:]]Translation/2910c3af-b7a9-4cab-b640-ffd3aa82e0c6_origin.pdf filter=lfs diff=lfs merge=lfs -text
5592
+ 2023/Adaptation[[:space:]]with[[:space:]]Self-Evaluation[[:space:]]to[[:space:]]Improve[[:space:]]Selective[[:space:]]Prediction[[:space:]]in[[:space:]]LLMs/f7d2433b-15b6-4b85-939e-afd16b6d78ec_origin.pdf filter=lfs diff=lfs merge=lfs -text
5593
+ 2023/Adapter[[:space:]]Pruning[[:space:]]using[[:space:]]Tropical[[:space:]]Characterization/42a77f92-f51b-4a4c-822f-e51497eb78bc_origin.pdf filter=lfs diff=lfs merge=lfs -text
5594
+ 2023/Adapter-TST_[[:space:]]A[[:space:]]Parameter[[:space:]]Efficient[[:space:]]Method[[:space:]]for[[:space:]]Multiple-Attribute[[:space:]]Text[[:space:]]Style[[:space:]]Transfer/4a33baff-242c-4747-a6f9-e0cf8517f0aa_origin.pdf filter=lfs diff=lfs merge=lfs -text
5595
+ 2023/Adapting[[:space:]]Pretrained[[:space:]]Text-to-Text[[:space:]]Models[[:space:]]for[[:space:]]Long[[:space:]]Text[[:space:]]Sequences/1b1c2a00-dc3f-4735-b793-a47c561f3d44_origin.pdf filter=lfs diff=lfs merge=lfs -text
2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/ed6283a9-c47a-45be-a3e5-a228ad5db48e_content_list.json ADDED
@@ -0,0 +1,2126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "1-PAGER: One Pass Answer Generation and Evidence Retrieval",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 164,
8
+ 90,
9
+ 831,
10
+ 109
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Palak Jain<sup>1</sup> Livio Baldini Soares<sup>2</sup> Tom Kwiatkowski<sup>2</sup>",
17
+ "bbox": [
18
+ 228,
19
+ 140,
20
+ 771,
21
+ 156
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "$^{1}$ Google Research $^{2}$ Google Deepmind",
28
+ "bbox": [
29
+ 319,
30
+ 158,
31
+ 680,
32
+ 175
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "{palakj, liviobs, tomkwiat}@google.com",
39
+ "bbox": [
40
+ 319,
41
+ 175,
42
+ 685,
43
+ 192
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Abstract",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 260,
53
+ 252,
54
+ 339,
55
+ 267
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "We present 1-PAGER the first system that answers a question and retrieves evidence using a single Transformer-based model and decoding process. 1-PAGER incrementally partitions the retrieval corpus using constrained decoding to select a document and answer string, and we show that this is competitive with comparable retrieve-and-read alternatives according to both retrieval and answer accuracy metrics. 1-PAGER also outperforms the equivalent 'closed-book' question answering model, by grounding predictions in an evidence corpus. While 1-PAGER is not yet on-par with more expensive systems that read many more documents before generating an answer, we argue that it provides an important step toward attributed generation by folding retrieval into the sequence-to-sequence paradigm that is currently dominant in NLP. We also show that the search paths used to partition the corpus are easy to read and understand, paving a way forward for interpretable neural retrieval.",
62
+ "bbox": [
63
+ 141,
64
+ 279,
65
+ 460,
66
+ 592
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "1 Introduction",
73
+ "text_level": 1,
74
+ "bbox": [
75
+ 114,
76
+ 604,
77
+ 260,
78
+ 619
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "In recent times, there has been a push to reformulate a wide variety of tasks from NLP and other domains into the sequence-to-sequence paradigm, to make use of large pre-trained Transformer networks (Vaswani et al., 2017). However, despite evidence that large language models can often answer questions (Roberts et al., 2020), predict identifiers of documents that support those answers (Tay et al., 2022), or generate text that contains and explains an answer (Yu et al., 2022) the dominant paradigm in question answering is still the retrieve-and-read approach that pipelines separate retrieval and answer generation modules. This approach has the benefit that it can provide direct and targeted paragraph-level attribution for the generated answers (Bohnet et al., 2022). However, it also relies on a heterogenous mix of models that are hard to train in concert (Metzler et al., 2021).",
85
+ "bbox": [
86
+ 112,
87
+ 629,
88
+ 489,
89
+ 917
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "image",
95
+ "img_path": "images/64c5c707b66c4d979c376511847a2f6ef5534751d30fb0db42801b4d3d7ac625.jpg",
96
+ "image_caption": [
97
+ "Figure 1: Example 1P output that iteratively partitions the corpus into sub-sets containing the generated n-grams. The last n-gram is taken as the answer."
98
+ ],
99
+ "image_footnote": [],
100
+ "bbox": [
101
+ 515,
102
+ 255,
103
+ 884,
104
+ 437
105
+ ],
106
+ "page_idx": 0
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "Motivated by the observation that language model decoders already perform search over possible sequences (Graves, 2012), and that evidence documents themselves are simply sequences of tokens, we present an alternative approach that relies on a single Transformer model. In this approach, which we name 1-PAGER (One Pass Answer Generation and Evidence Retrieval) or simply 1P, the decoder iteratively partitions a corpus of evidence documents by generating a search path consisting of a set of keywords that identify relevant documents and an answer string that is contained in at least one of these documents. With 1P, we aim to explore the spectrum between CBQA, where the answer is generated without reference to an evidence corpus, and pipelined approaches that feed retrieved documents into the transformer.",
111
+ "bbox": [
112
+ 507,
113
+ 516,
114
+ 884,
115
+ 788
116
+ ],
117
+ "page_idx": 0
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "Figure 1 illustrates an example in which the corpus is iteratively partitioned into documents that contain the string 'Economy of India', then those that also contain the string 'Agriculture', and finally those that also contain the answer string '23%'.",
122
+ "bbox": [
123
+ 507,
124
+ 790,
125
+ 884,
126
+ 869
127
+ ],
128
+ "page_idx": 0
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "1P output sequences are guaranteed to match at least one document in the evidence corpus. This is enforced via a constrained decoder that has ac",
133
+ "bbox": [
134
+ 507,
135
+ 871,
136
+ 884,
137
+ 917
138
+ ],
139
+ "page_idx": 0
140
+ },
141
+ {
142
+ "type": "page_number",
143
+ "text": "14529",
144
+ "bbox": [
145
+ 475,
146
+ 927,
147
+ 524,
148
+ 940
149
+ ],
150
+ "page_idx": 0
151
+ },
152
+ {
153
+ "type": "footer",
154
+ "text": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 14529-14543",
155
+ "bbox": [
156
+ 208,
157
+ 945,
158
+ 786,
159
+ 958
160
+ ],
161
+ "page_idx": 0
162
+ },
163
+ {
164
+ "type": "footer",
165
+ "text": "December 6-10, 2023 ©2023 Association for Computational Linguistics",
166
+ "bbox": [
167
+ 277,
168
+ 958,
169
+ 719,
170
+ 972
171
+ ],
172
+ "page_idx": 0
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "cess to an FM-index representation of the evidence corpus contents (Ferragina and Manzini, 2000) and we evaluate 1P's ability to correctly answer open-domain questions while also retrieving passages that provide support for those answers (Bohnet et al., 2022). Since 1P is the first model that can do both of these tasks, we compare to pipelined systems that first retrieve a single passage and then generate an answer based on this evidence passage. 1P is competitive as a passage retriever, performing similarly to a widely used dense retriever (Karpukhin et al., 2020) and outperforming the SEAL system which independently generates keywords rather than a search path (Bevilacqua et al., 2022). 1P also outperforms an equivalent closed-book question answering (CBQA) model (Roberts et al., 2020) according to answer accuracy. Part of this improvement comes from the prediction of search paths themselves, reminiscent of chain-of-thought reasoning (Wei et al., 2022), and part is from 1P's constrained decoder, which forces the model to generate answers from passages that contain the keywords.",
177
+ "bbox": [
178
+ 115,
179
+ 85,
180
+ 490,
181
+ 453
182
+ ],
183
+ "page_idx": 1
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "While 1P does not yet perform as well as the very best retrieval or open-domain question answering systems in terms of accuracy, the fact that it is competitive with pipelined systems that are trained with the same data and which use similar amounts of inference-time compute suggests a promising path ahead. Unlike those systems, 1P can be trained end-to-end along with any other task that fits into the sequence-to-sequence paradigm. Additionally, 1P search paths are inherently interpretable, unlike embeddings used in dense retrieval.",
188
+ "bbox": [
189
+ 115,
190
+ 456,
191
+ 489,
192
+ 632
193
+ ],
194
+ "page_idx": 1
195
+ },
196
+ {
197
+ "type": "text",
198
+ "text": "2 Related Work",
199
+ "text_level": 1,
200
+ "bbox": [
201
+ 115,
202
+ 649,
203
+ 267,
204
+ 664
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "\"Retrieve-and-read\" Question Answering Question answering approaches in NLP are dominated by the \"retrieve-and-read\" paradigm where a retriever first fetches hundreds of relevant documents from a corpus, followed by a language model that reranks and extracts the answer (Harabagiu et al., 2003; Chen et al., 2017; Zhu et al., 2021). Sparse retrievers such as BM25 (Robertson et al., 2009) build a high-dimensional lexical index over text corpus. Dense retrievers (Karpukhin et al., 2020) use a dual encoder architecture to embed the query and document and perform an approximate nearest neighbor search. Various modifications to dense retrieval have been proposed over the years includ",
211
+ "bbox": [
212
+ 115,
213
+ 677,
214
+ 485,
215
+ 917
216
+ ],
217
+ "page_idx": 1
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "ing hard negative training (Xiong et al., 2020), late interaction (Khattab and Zaharia, 2020; Santhanam et al., 2022), few-shot learning (Izacard et al., 2022), joint retriever and reader training (Jiang et al., 2022).",
222
+ "bbox": [
223
+ 512,
224
+ 84,
225
+ 880,
226
+ 162
227
+ ],
228
+ "page_idx": 1
229
+ },
230
+ {
231
+ "type": "text",
232
+ "text": "A particular variant of interest is the Iterative Retrieval process where the query is reformulated incrementally (Das et al., 2019; Lee et al., 2022) leading to an interactive search process (Jiang et al., 2023; Adolphs et al., 2021). This query augmentation scheme has similarities with our use of search paths. However, we use the paths to iteratively partition the corpus while prior works have used it for refining the query.",
233
+ "bbox": [
234
+ 512,
235
+ 166,
236
+ 880,
237
+ 310
238
+ ],
239
+ "page_idx": 1
240
+ },
241
+ {
242
+ "type": "text",
243
+ "text": "To perform well, retrieve-and-read systems will typically retrieve 10s to 100s of passages that must be processed by a language model. In constraint, 1P retrieves and extracts an answer in a single pass of language model generation.",
244
+ "bbox": [
245
+ 512,
246
+ 313,
247
+ 880,
248
+ 391
249
+ ],
250
+ "page_idx": 1
251
+ },
252
+ {
253
+ "type": "text",
254
+ "text": "Closed Book Question Answering With data and parameter scale, LLMs in a closed-book setting (CBQA) have shown competitive performance (OpenAI, 2023; Anil et al., 2023; Yu et al., 2023) to retrieve pipelines (ODQA), however without producing any attributed passages (Rashkin et al., 2021; Bohnet et al., 2022). An extension of CBQA is post-hoc retrieval where a large language model LLM) is first used to generate an answer and then evidence for the question-answer pair is fetched by a retriever (Gao et al., 2023a; Bohnet et al., 2022). While post-hoc retrieval serves the same goal as 1P, it still uses a pipeline of LLM and retriever to do so.",
255
+ "bbox": [
256
+ 512,
257
+ 407,
258
+ 880,
259
+ 629
260
+ ],
261
+ "page_idx": 1
262
+ },
263
+ {
264
+ "type": "text",
265
+ "text": "Generative Retrieval Recently, generative retrieval has emerged as an alternative to the conventional \"retrieve-and-read\" pipeline (Metzler et al., 2021). Genre (De Cao et al., 2021) performed generative entity linking by constraining model's decoding to a set of entities. DSI (Tay et al., 2022) showed one of the first proof of LLM's ability to memorize docids in the corpus. However, atomic ids or hierarchical clusters, as used in DSI, are opaque identifiers and capture limited information. Works such as SEAL (Bevilacqua et al., 2022) and Ultron (Zhou et al., 2022) use a semantically richer representation: keywords in the document. In particular, SEAL constrains the generation to only keywords in the corpus using the FM-index (Ferragina and Manzini, 2000), a key data structure we borrow in this work.",
266
+ "bbox": [
267
+ 512,
268
+ 646,
269
+ 880,
270
+ 916
271
+ ],
272
+ "page_idx": 1
273
+ },
274
+ {
275
+ "type": "page_number",
276
+ "text": "14530",
277
+ "bbox": [
278
+ 478,
279
+ 928,
280
+ 524,
281
+ 940
282
+ ],
283
+ "page_idx": 1
284
+ },
285
+ {
286
+ "type": "image",
287
+ "img_path": "images/8dcfa0acd2a903129c9e6dbe6563a933e6f4602c2c9e926949dec9381190afc9.jpg",
288
+ "image_caption": [
289
+ "Figure 2: System illustration of different QA systems. From left to right: CBQA, 1-PAGER, SEAL, Retrieve-and-Read system. $C$ denotes the retrieval corpus, $P$ a retrieved passage, $Q$ the input question and $A$ , the generated answer. 1P is closest to CBQA (only single model used) but it also outputs a passage retrieved from $C$ ."
290
+ ],
291
+ "image_footnote": [],
292
+ "bbox": [
293
+ 122,
294
+ 80,
295
+ 877,
296
+ 171
297
+ ],
298
+ "page_idx": 2
299
+ },
300
+ {
301
+ "type": "text",
302
+ "text": "1P represents docids as keyword paths, which are arguably more interpretable, and learns a soft partition over the corpus instead of the hard partition imposed by DSI's clustering.",
303
+ "bbox": [
304
+ 112,
305
+ 249,
306
+ 487,
307
+ 313
308
+ ],
309
+ "page_idx": 2
310
+ },
311
+ {
312
+ "type": "text",
313
+ "text": "Another crucial distinction is 1P's ability to both retrieve and generate an answer while prior works rely on a external re-ranker/reader for the same. A high-level view of various question-answering systems is presented in Figure 2.",
314
+ "bbox": [
315
+ 112,
316
+ 313,
317
+ 487,
318
+ 394
319
+ ],
320
+ "page_idx": 2
321
+ },
322
+ {
323
+ "type": "text",
324
+ "text": "Attributed Question Answering Standard metrics for open-domain question answering, such as exact match or token-based F1, have received criticism for being imprecise and/or insufficient. Several efforts have proposed augmenting answers with textual evidence, via retrieval or citations (Bohnet et al., 2022; Menick et al., 2022; Gao et al., 2023b). While this work does not directly evaluate the quality of retrieved answer evidence, our proposed model inherently produces a passage to support the final answer, along with a search path of keywords, which could be used to provide users with answer evidence.",
325
+ "bbox": [
326
+ 112,
327
+ 403,
328
+ 489,
329
+ 612
330
+ ],
331
+ "page_idx": 2
332
+ },
333
+ {
334
+ "type": "text",
335
+ "text": "3 Iterative Corpus Partitioning and Answer Prediction",
336
+ "text_level": 1,
337
+ "bbox": [
338
+ 112,
339
+ 625,
340
+ 436,
341
+ 657
342
+ ],
343
+ "page_idx": 2
344
+ },
345
+ {
346
+ "type": "text",
347
+ "text": "We focus on the problem of learning a mapping $f(q, D) \\to (a, d_a)$ from a question $q$ and corpus of documents $D$ to an answer and supporting document $(a, d_a)$ . The predicted document $d_a$ is retrieved from $D$ and the answer $a$ is a sub-string of $d_a$ . The document $d_a$ should be relevant to the question and provide evidence for answer.",
348
+ "bbox": [
349
+ 112,
350
+ 668,
351
+ 487,
352
+ 778
353
+ ],
354
+ "page_idx": 2
355
+ },
356
+ {
357
+ "type": "text",
358
+ "text": "The goal of this paper is to model the function $f$ using a single sequence-to-sequence model, rather than a pipeline which first retrieves $d_{a}$ and then feeds it into an answer generation module. To achieve our goal, we recast retrieval as an iterative corpus partitioning process illustrated in Figure 3.",
359
+ "bbox": [
360
+ 112,
361
+ 781,
362
+ 487,
363
+ 878
364
+ ],
365
+ "page_idx": 2
366
+ },
367
+ {
368
+ "type": "text",
369
+ "text": "Iterative corpus partitioning adopts the LM decoder's autoregressive search process to partition",
370
+ "bbox": [
371
+ 112,
372
+ 887,
373
+ 489,
374
+ 919
375
+ ],
376
+ "page_idx": 2
377
+ },
378
+ {
379
+ "type": "text",
380
+ "text": "$D$ by predicting n-gram keywords.",
381
+ "bbox": [
382
+ 509,
383
+ 249,
384
+ 766,
385
+ 265
386
+ ],
387
+ "page_idx": 2
388
+ },
389
+ {
390
+ "type": "text",
391
+ "text": "An n-gram of tokens $k$ is said to be contained in a document $d$ , denoted by $k \\prec d$ , when $k$ is a sub-sequence of $d$ . We define a keyword corpus partitioning function",
392
+ "bbox": [
393
+ 507,
394
+ 265,
395
+ 882,
396
+ 329
397
+ ],
398
+ "page_idx": 2
399
+ },
400
+ {
401
+ "type": "equation",
402
+ "text": "\n$$\n\\mathcal {F} (D, k) = \\{d | k \\prec d; d \\in D \\}\n$$\n",
403
+ "text_format": "latex",
404
+ "bbox": [
405
+ 581,
406
+ 338,
407
+ 808,
408
+ 357
409
+ ],
410
+ "page_idx": 2
411
+ },
412
+ {
413
+ "type": "text",
414
+ "text": "that selects only those documents that contain $k$ . 1-PAGER iteratively partitions the corpus $D$ by generating a sequence of n-grams that we refer to as a Search Path $p_t = [k_1, k_2, \\dots, k_t]$ . Each prefix of this search path defines a subset of $D$ via the search path corpus partitioning function",
415
+ "bbox": [
416
+ 507,
417
+ 366,
418
+ 882,
419
+ 463
420
+ ],
421
+ "page_idx": 2
422
+ },
423
+ {
424
+ "type": "equation",
425
+ "text": "\n$$\n\\mathcal {P} (D, p _ {t}) = D _ {p _ {t}} = \\{\\cap_ {i \\in [ 1, t ]} \\mathcal {F} (D, k _ {i}) \\}\n$$\n",
426
+ "text_format": "latex",
427
+ "bbox": [
428
+ 549,
429
+ 472,
430
+ 838,
431
+ 492
432
+ ],
433
+ "page_idx": 2
434
+ },
435
+ {
436
+ "type": "text",
437
+ "text": "and each subsequent keyword $k_{t+1}$ narrows down $D_{p_t}$ into further sub-spaces such that $D_{p_{t+1}} \\subseteq D_{p_t}$ .",
438
+ "bbox": [
439
+ 507,
440
+ 500,
441
+ 882,
442
+ 533
443
+ ],
444
+ "page_idx": 2
445
+ },
446
+ {
447
+ "type": "text",
448
+ "text": "Answer prediction is treated in exactly the same way as keyword selection and in 1P the last keyword from $p$ is taken as the answer.",
449
+ "bbox": [
450
+ 507,
451
+ 539,
452
+ 882,
453
+ 588
454
+ ],
455
+ "page_idx": 2
456
+ },
457
+ {
458
+ "type": "text",
459
+ "text": "4 Constrained Decoding and FM-Index",
460
+ "text_level": 1,
461
+ "bbox": [
462
+ 507,
463
+ 599,
464
+ 867,
465
+ 615
466
+ ],
467
+ "page_idx": 2
468
+ },
469
+ {
470
+ "type": "text",
471
+ "text": "To avoid generating empty partitions, we constrain 1-PAGER to only decode search paths that match at least one document. We modify the decoder's beam-search strategy to only allow keyword continuations that are contained in the current partition.",
472
+ "bbox": [
473
+ 507,
474
+ 625,
475
+ 882,
476
+ 703
477
+ ],
478
+ "page_idx": 2
479
+ },
480
+ {
481
+ "type": "text",
482
+ "text": "Given a document subset $D_{p_i}$ , which could be the full corpus $D$ at the start of decoding $(i = 0)$ and a keyword prefix $k$ , which could be empty, the set of all valid continuation tokens is defined as,",
483
+ "bbox": [
484
+ 507,
485
+ 705,
486
+ 882,
487
+ 768
488
+ ],
489
+ "page_idx": 2
490
+ },
491
+ {
492
+ "type": "equation",
493
+ "text": "\n$$\n\\mathcal {C} (k, D _ {p _ {i}}) = \\{x | k \\| x \\prec d, d \\in D _ {p _ {i}} \\}\n$$\n",
494
+ "text_format": "latex",
495
+ "bbox": [
496
+ 554,
497
+ 778,
498
+ 835,
499
+ 797
500
+ ],
501
+ "page_idx": 2
502
+ },
503
+ {
504
+ "type": "text",
505
+ "text": "where $x$ is any vocabulary token and $\\| \\cdot \\|$ indicates concatenation of two token sequences. As a special case, when $k = \\phi$ and $i = 0$ , all tokens in $D$ are valid continuations. 1P separates keywords in $p_T$ with a special separator token $\\rightarrow$ and marks the end of the sequence with an EOS token. These two tokens are always valid continuations.",
506
+ "bbox": [
507
+ 507,
508
+ 806,
509
+ 882,
510
+ 917
511
+ ],
512
+ "page_idx": 2
513
+ },
514
+ {
515
+ "type": "page_number",
516
+ "text": "14531",
517
+ "bbox": [
518
+ 477,
519
+ 927,
520
+ 522,
521
+ 940
522
+ ],
523
+ "page_idx": 2
524
+ },
525
+ {
526
+ "type": "image",
527
+ "img_path": "images/ee9b1d9383128dc9e50e582c09f5501209e0eb4fb1f761fd7f474a4bf66331d8.jpg",
528
+ "image_caption": [
529
+ "Figure 3: Illustration of the 1P decoding process. A keyword can only be generated from the documents matching previously generated keywords. Right panel shows a magnified view of applying constraints to a decoding step. Any keyword not present in the documents is masked out."
530
+ ],
531
+ "image_footnote": [],
532
+ "bbox": [
533
+ 126,
534
+ 84,
535
+ 877,
536
+ 336
537
+ ],
538
+ "page_idx": 3
539
+ },
540
+ {
541
+ "type": "text",
542
+ "text": "Consider Figure 3. The three keywords correspond to the decoded token sequence [Ten, Commandments, $\\rightarrow$ , twice, in, the, Hebrew, Bible, $\\rightarrow$ , books, of, Exodus, EOS]. At the start of decoding, any token in $D$ is allowed. After decoding Ten, only those tokens that follow Ten as an n-gram in $D$ are allowed, along with the default separators. After decoding [Ten, Commandments, $\\rightarrow$ ] we are ready to start a new keyword, but only tokens from documents that contain the keyword Ten Commandments are allowed. Decoding continues in this manner until EOS is generated.",
543
+ "bbox": [
544
+ 112,
545
+ 418,
546
+ 489,
547
+ 611
548
+ ],
549
+ "page_idx": 3
550
+ },
551
+ {
552
+ "type": "text",
553
+ "text": "To efficiently implement these constraints, we need a data-structure that can quickly determine both $\\mathcal{C}(k,D_p)$ , the continuation tokens given a document set and $\\mathcal{P}(D_p,k)$ , the subset of documents that contain a given path.",
554
+ "bbox": [
555
+ 112,
556
+ 613,
557
+ 489,
558
+ 692
559
+ ],
560
+ "page_idx": 3
561
+ },
562
+ {
563
+ "type": "text",
564
+ "text": "For this, we extend the usage of an FM-index (Ferragina and Manzini, 2000) as described in (Bevilacqua et al., 2022). The FM-index is a compressed token-based index over a corpus $D_0$ with a few important properties for our usage: (1) it can efficiently list possible token continuations for a sequence prefix that occur in $D_0$ i.e., $\\mathcal{C}(k,D_0)$ , (2) it can list the set of documents in the corpus that match an n-gram i.e., $\\mathcal{F}(D_0,k)$ , and (3) it supports search over arbitrary n-grams that occur within documents. Note that the FM-index operations are optimized for $D_0$ , the original corpus it is built over. We extend these to an arbitrary $D_p \\subset D_0$ at additional cost described in Appendix A.1.",
565
+ "bbox": [
566
+ 112,
567
+ 694,
568
+ 489,
569
+ 919
570
+ ],
571
+ "page_idx": 3
572
+ },
573
+ {
574
+ "type": "text",
575
+ "text": "5 Training data generation",
576
+ "text_level": 1,
577
+ "bbox": [
578
+ 509,
579
+ 418,
580
+ 759,
581
+ 434
582
+ ],
583
+ "page_idx": 3
584
+ },
585
+ {
586
+ "type": "text",
587
+ "text": "For training 1P, we produce a dataset with examples of queries and search paths as described above. At a high-level, we generate search paths by iteratively selecting n-grams from an answer passage, and simulating, using the FM-Index of the retrieval corpus, the partitioning of the corpus after selecting each keyword, until only a few documents remain. Finally, the answer span $a$ is appended to the search path. Each example produced can be serialized as sequence-to-sequence pair of inputs and targets as:",
588
+ "bbox": [
589
+ 507,
590
+ 444,
591
+ 884,
592
+ 605
593
+ ],
594
+ "page_idx": 3
595
+ },
596
+ {
597
+ "type": "text",
598
+ "text": "inputs: Generate keywords for: $<q>$ ?",
599
+ "bbox": [
600
+ 509,
601
+ 612,
602
+ 836,
603
+ 627
604
+ ],
605
+ "page_idx": 3
606
+ },
607
+ {
608
+ "type": "text",
609
+ "text": "targets: K_SEP $k_{0}$ K_SEP $k_{1}$ ... K_SEP A_SEP a EOS",
610
+ "bbox": [
611
+ 509,
612
+ 630,
613
+ 880,
614
+ 643
615
+ ],
616
+ "page_idx": 3
617
+ },
618
+ {
619
+ "type": "text",
620
+ "text": "5.1 Keyword Selection",
621
+ "text_level": 1,
622
+ "bbox": [
623
+ 507,
624
+ 656,
625
+ 702,
626
+ 671
627
+ ],
628
+ "page_idx": 3
629
+ },
630
+ {
631
+ "type": "text",
632
+ "text": "A good keyword should have a) high relevance to the query and b) effectively narrow down the search space. To identify relevant keywords, we restrict to only the gold document $g$ . All ngrams in $g$ of length up to five are extracted. Irrelevant keywords are filtered out such as those starting or ending with stop words. Similarly, keywords that are too rare in the corpus, e.g., \"Philippines at Luzon\" or too frequent, e.g., \"part\" are excluded based on a threshold on their count in corpus. The remaining keywords are scored with a combinations of heuristics, mainly Rouge-1 similarity with the query (Lin, 2004) along with minor award for keywords containing entities and penalty for keywords highly frequent in the corpus.",
633
+ "bbox": [
634
+ 507,
635
+ 677,
636
+ 884,
637
+ 919
638
+ ],
639
+ "page_idx": 3
640
+ },
641
+ {
642
+ "type": "page_number",
643
+ "text": "14532",
644
+ "bbox": [
645
+ 477,
646
+ 927,
647
+ 524,
648
+ 940
649
+ ],
650
+ "page_idx": 3
651
+ },
652
+ {
653
+ "type": "text",
654
+ "text": "This scoring mechanism often misses out on keywords that are semantically relevant, but do not lexically overlap with the query. To boost the relevance of our keyword set, we re-score the top hundred keywords using a language model. A T5-XXL model is finetuned with the input as the query $q$ and target as either the title or a heuristically sampled keyword in a similar fashion to Bevilacqua et al. (2022). The heuristically sampled keywords are re-scored using this model to obtain a refined LM-scored set. Two other special types of keywords are awarded high scores: Title of the gold passage and the keyword containing the answer string $a$ .",
655
+ "bbox": [
656
+ 112,
657
+ 84,
658
+ 492,
659
+ 294
660
+ ],
661
+ "page_idx": 4
662
+ },
663
+ {
664
+ "type": "text",
665
+ "text": "5.2 Search Paths",
666
+ "text_level": 1,
667
+ "bbox": [
668
+ 112,
669
+ 307,
670
+ 265,
671
+ 322
672
+ ],
673
+ "page_idx": 4
674
+ },
675
+ {
676
+ "type": "text",
677
+ "text": "The first keyword in a search path needs to effectively partition the corpus. We experiment with either the title or the highest scored keyword from the gold passage as the first keyword in the path. The next keywords are sampled based on their score, given they do not overlap with any of the existing keywords in the path. We continue augmenting a path $p$ with keywords until at most ten passages in the corpus match i.e., $|D_p| < 10$ . The answer keyword is then appended to the path. Our train paths (including the answer) contain a median of three keywords and one matching document.",
678
+ "bbox": [
679
+ 112,
680
+ 331,
681
+ 489,
682
+ 524
683
+ ],
684
+ "page_idx": 4
685
+ },
686
+ {
687
+ "type": "text",
688
+ "text": "6 Experimental Setup",
689
+ "text_level": 1,
690
+ "bbox": [
691
+ 112,
692
+ 539,
693
+ 321,
694
+ 557
695
+ ],
696
+ "page_idx": 4
697
+ },
698
+ {
699
+ "type": "text",
700
+ "text": "6.1 Datasets",
701
+ "text_level": 1,
702
+ "bbox": [
703
+ 112,
704
+ 568,
705
+ 228,
706
+ 583
707
+ ],
708
+ "page_idx": 4
709
+ },
710
+ {
711
+ "type": "text",
712
+ "text": "We use Open-NQ (Kwiatkowski et al., 2019; Lee et al., 2019) as the question-answering dataset for training. For evaluation, besides Open-NQ, WebQuestions (Berant et al., 2013) and CuratedTREC (Baudiš and Šedivý, 2015) are used to measure out-of-domain performance. The FM-Index corpus for constrained decoding is built over DPR Wikipedia corpus with 100-word splits (Karpukhin et al., 2020). The positive gold passages from DPR are used for sampling training paths. This setup is chosen to mirror SEAL and also permits fair comparison against DPR.",
713
+ "bbox": [
714
+ 112,
715
+ 590,
716
+ 489,
717
+ 785
718
+ ],
719
+ "page_idx": 4
720
+ },
721
+ {
722
+ "type": "text",
723
+ "text": "6.2 Training",
724
+ "text_level": 1,
725
+ "bbox": [
726
+ 112,
727
+ 800,
728
+ 230,
729
+ 815
730
+ ],
731
+ "page_idx": 4
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "1P's training dataset contains 310k paths corresponding to 55k queries from Open-NQ. Majority of the training paths begin with the title, with a small fraction starting with other keywords (12%). All keywords, except the title, are scored using the LM-scoring technique described above.",
736
+ "bbox": [
737
+ 112,
738
+ 822,
739
+ 489,
740
+ 917
741
+ ],
742
+ "page_idx": 4
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "For our experiments, we use the T5X (Roberts et al., 2022) framework. A T5-XXL $1.1^{1}$ (Raffel et al., 2020) model is finetuned with a batch size of 256 and dropout of 0.1. No additional hyperparameter tuning is performed. We format search paths using the reserved tokens $\\mathsf{K\\_SEP} = \"$ <extra_id_0>\" and $\\mathsf{A\\_SEP} = \"$ <extra_id_1>\".",
747
+ "bbox": [
748
+ 507,
749
+ 84,
750
+ 884,
751
+ 197
752
+ ],
753
+ "page_idx": 4
754
+ },
755
+ {
756
+ "type": "text",
757
+ "text": "6.3 Inference",
758
+ "text_level": 1,
759
+ "bbox": [
760
+ 507,
761
+ 209,
762
+ 631,
763
+ 223
764
+ ],
765
+ "page_idx": 4
766
+ },
767
+ {
768
+ "type": "text",
769
+ "text": "Our best model employs beam decoding with a beam of 5. Even when the beam is greater than one, only the top-beam result is used for retrieval. We discuss the effect of beam size in depth in Section 7. Given the top generated path $p$ , $D_{p}$ corresponds to the retrieved documents. In case $|D_{p}| > 1$ , a document is sampled arbitrarily for evaluation.",
770
+ "bbox": [
771
+ 507,
772
+ 230,
773
+ 884,
774
+ 342
775
+ ],
776
+ "page_idx": 4
777
+ },
778
+ {
779
+ "type": "text",
780
+ "text": "6.4Baselines",
781
+ "text_level": 1,
782
+ "bbox": [
783
+ 507,
784
+ 354,
785
+ 628,
786
+ 368
787
+ ],
788
+ "page_idx": 4
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "We compare to a closed-book question answering (CBQA) system that generates answers, but does not ground these in an evidence corpus, as well as retrieve-and-read systems that combine a variety of retrievers with a Transformer-based answerer module. Both the CBQA baseline and the answerer module are derived from the same T5-XXL 1.1 pretrained model as 1P.",
793
+ "bbox": [
794
+ 507,
795
+ 375,
796
+ 882,
797
+ 502
798
+ ],
799
+ "page_idx": 4
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "6.4.1 T5-CBQA",
804
+ "text_level": 1,
805
+ "bbox": [
806
+ 507,
807
+ 514,
808
+ 650,
809
+ 529
810
+ ],
811
+ "page_idx": 4
812
+ },
813
+ {
814
+ "type": "text",
815
+ "text": "A T5-XXL 1.1 model is fine-tuned to predict answers from the DPR training set for 10,000 steps with a batch size of 128. Note that it is possible to achieve a higher closed-book performance on NQ using the full Open-NQ training split instead of the subset included in the DPR training set (Roberts et al., 2020). However, to enable meaningful comparison we restrict the CBQA baseline to the same training examples used to train 1P.",
816
+ "bbox": [
817
+ 507,
818
+ 533,
819
+ 882,
820
+ 678
821
+ ],
822
+ "page_idx": 4
823
+ },
824
+ {
825
+ "type": "text",
826
+ "text": "6.4.2 Retrieve-and-Read",
827
+ "text_level": 1,
828
+ "bbox": [
829
+ 507,
830
+ 688,
831
+ 717,
832
+ 702
833
+ ],
834
+ "page_idx": 4
835
+ },
836
+ {
837
+ "type": "text",
838
+ "text": "The retrieve-and-read baselines first retrieve a single passage from the evidence corpus, and then feed this passage and the question into the answer generation module<sup>2</sup>. We report retrieval accuracy for the retrieved passage and answer accuracy for the generated answer.",
839
+ "bbox": [
840
+ 507,
841
+ 708,
842
+ 884,
843
+ 804
844
+ ],
845
+ "page_idx": 4
846
+ },
847
+ {
848
+ "type": "text",
849
+ "text": "T5-Reader We tune a T5-XXL 1.1 model to generate answers from (question, evidence passage)",
850
+ "bbox": [
851
+ 507,
852
+ 814,
853
+ 882,
854
+ 847
855
+ ],
856
+ "page_idx": 4
857
+ },
858
+ {
859
+ "type": "page_footnote",
860
+ "text": "1https://goo.gl/t5-checkpoints",
861
+ "bbox": [
862
+ 529,
863
+ 854,
864
+ 769,
865
+ 869
866
+ ],
867
+ "page_idx": 4
868
+ },
869
+ {
870
+ "type": "page_footnote",
871
+ "text": "2This differs from ODQA evaluations that do not include evidence retrieval as a first-class task, where many retrieved passages are fed into a reader that generates an answer without attribution to any single piece of text.",
872
+ "bbox": [
873
+ 507,
874
+ 869,
875
+ 880,
876
+ 917
877
+ ],
878
+ "page_idx": 4
879
+ },
880
+ {
881
+ "type": "page_number",
882
+ "text": "14533",
883
+ "bbox": [
884
+ 477,
885
+ 927,
886
+ 524,
887
+ 940
888
+ ],
889
+ "page_idx": 4
890
+ },
891
+ {
892
+ "type": "text",
893
+ "text": "pairs. This is the same base model used by 1P and we train on the (question, passage, answer) triples in the DPR training split to ensure fair comparison.",
894
+ "bbox": [
895
+ 112,
896
+ 84,
897
+ 489,
898
+ 134
899
+ ],
900
+ "page_idx": 5
901
+ },
902
+ {
903
+ "type": "text",
904
+ "text": "DPR-Retriever We compare against vanilla DPR finetuned on NQ without hard negatives (Karpukhin et al., 2020) using the pre-computed index available on DPR's repository<sup>3</sup>. We note that our ODQA setup differs from the one used by Karpukhin et al. in that we choose the highest scoring retrieval as evidence for answer generation, instead of generating from the top-100 passages without attribution.",
905
+ "bbox": [
906
+ 112,
907
+ 143,
908
+ 487,
909
+ 288
910
+ ],
911
+ "page_idx": 5
912
+ },
913
+ {
914
+ "type": "text",
915
+ "text": "BM25-Retriever We use Pyserini toolkit (Lin et al., 2021) with default configurations, retrieving the top-1 passage.",
916
+ "bbox": [
917
+ 112,
918
+ 300,
919
+ 489,
920
+ 350
921
+ ],
922
+ "page_idx": 5
923
+ },
924
+ {
925
+ "type": "text",
926
+ "text": "SEAL-Retriever SEAL (Bevilacqua et al., 2022) is a generative retrieval system that generates a set of keywords constrained on the corpus. In terms of technique, 1P borrows inspiration from SEAL's use of the FM-Index as well as keywords-as-identifiers. However, the two setups have substantial differences that we highlight in Section 8. We run SEAL with its default configuration and a beam of 5 using the publicly released checkpoint based on Bart-large (Lewis et al., 2020). All outputs from the beam are used for retrieval.",
927
+ "bbox": [
928
+ 112,
929
+ 359,
930
+ 489,
931
+ 537
932
+ ],
933
+ "page_idx": 5
934
+ },
935
+ {
936
+ "type": "text",
937
+ "text": "6.5 Evaluation",
938
+ "text_level": 1,
939
+ "bbox": [
940
+ 112,
941
+ 550,
942
+ 247,
943
+ 564
944
+ ],
945
+ "page_idx": 5
946
+ },
947
+ {
948
+ "type": "text",
949
+ "text": "We evaluate in-domain performance on the OpenNQ test split and out-of-domain performance on WebQuestions (WQ) and CuratedTREC (TREC) following the setup from Karpukhin et al. (2020). Passage retrieval performance is measured with Hits@1 using Pyserini evaluation scripts<sup>4</sup>.",
950
+ "bbox": [
951
+ 112,
952
+ 571,
953
+ 489,
954
+ 670
955
+ ],
956
+ "page_idx": 5
957
+ },
958
+ {
959
+ "type": "text",
960
+ "text": "6.6 1P configurations",
961
+ "text_level": 1,
962
+ "bbox": [
963
+ 112,
964
+ 682,
965
+ 302,
966
+ 697
967
+ ],
968
+ "page_idx": 5
969
+ },
970
+ {
971
+ "type": "text",
972
+ "text": "We experiment with three configurations: a) 1P: Our primary setup that uses both training and constrained decoding procedures described above, producing a retrieved passage as well as an answer. b) 1P-Unconstrained: Only the training technique described in Section 5 is adopted, with standard unconstrained decoding. Since generation is unconstrained, it is possible that no passage gets retrieved for a given path. c) $1\\mathrm{P} +$ Reader: Here, we take the top retrieved passage from 1P and input it to the Reader model (Section 6.4) to extract the answer.",
973
+ "bbox": [
974
+ 112,
975
+ 703,
976
+ 489,
977
+ 881
978
+ ],
979
+ "page_idx": 5
980
+ },
981
+ {
982
+ "type": "text",
983
+ "text": "7 Results",
984
+ "text_level": 1,
985
+ "bbox": [
986
+ 509,
987
+ 83,
988
+ 608,
989
+ 99
990
+ ],
991
+ "page_idx": 5
992
+ },
993
+ {
994
+ "type": "table",
995
+ "img_path": "images/373d92d883e2c3fe39aedc352fd6ec69e48eaa5838f6d02af015818d49684aef.jpg",
996
+ "table_caption": [],
997
+ "table_footnote": [],
998
+ "table_body": "<table><tr><td rowspan=\"2\">Retriever</td><td rowspan=\"2\">Answerer</td><td rowspan=\"2\">Retrieval Hits @ 1</td><td colspan=\"2\">Answer</td></tr><tr><td>EM</td><td>F1</td></tr><tr><td>-</td><td>T5 - CBQA</td><td>-</td><td>26.8</td><td>34.0</td></tr><tr><td>BM25</td><td>T5 - Reader</td><td>23.6</td><td>17.9</td><td>24.0</td></tr><tr><td>SEAL</td><td>T5 - Reader</td><td>37.9</td><td>29.4</td><td>35.8</td></tr><tr><td>DPR</td><td>T5 - Reader</td><td>46.5</td><td>35.6</td><td>42.4</td></tr><tr><td>1P</td><td>T5 - Reader</td><td>46.3</td><td>34.2</td><td>41.4</td></tr><tr><td colspan=\"2\">1P - Unconstrained</td><td>29.3</td><td>29.3</td><td>36.1</td></tr><tr><td colspan=\"2\">1P</td><td>46.3</td><td>31.7</td><td>38.0</td></tr></table>",
999
+ "bbox": [
1000
+ 510,
1001
+ 118,
1002
+ 885,
1003
+ 288
1004
+ ],
1005
+ "page_idx": 5
1006
+ },
1007
+ {
1008
+ "type": "table",
1009
+ "img_path": "images/1bfeba8d3638f54c80776ec86b6211ca901b7b47015f1c3e6b40c0416d68f5a7.jpg",
1010
+ "table_caption": [
1011
+ "Table 1: Comparison of different Retriever and Answerer combinations on the NQ-Open test set. In retrieve-and-read setups, answers are generated from the top-1 retrieved passage. 1P combines passage retrieval and answer generation in a single prediction."
1012
+ ],
1013
+ "table_footnote": [],
1014
+ "table_body": "<table><tr><td rowspan=\"2\">System</td><td colspan=\"2\">WebQuestions</td><td colspan=\"2\">TREC</td></tr><tr><td>Hits @1</td><td>EM</td><td>Hits @1</td><td>EM</td></tr><tr><td>BM25 + Rdr</td><td>19.7</td><td>14.2</td><td>35.2</td><td>29.1</td></tr><tr><td>DPR + Rdr</td><td>32.0</td><td>17.3</td><td>51.6</td><td>35.0</td></tr><tr><td>1P + Rdr</td><td>38.0</td><td>20.4</td><td>63.8</td><td>38.5</td></tr><tr><td>1P</td><td>38.0</td><td>20.5</td><td>63.8</td><td>36.4</td></tr></table>",
1015
+ "bbox": [
1016
+ 510,
1017
+ 403,
1018
+ 895,
1019
+ 524
1020
+ ],
1021
+ "page_idx": 5
1022
+ },
1023
+ {
1024
+ "type": "text",
1025
+ "text": "Table 2: Comparison of different Retriever and Answerer combinations on Out-of-domain datasets. Both the Retriever and Answerer (Rdr) are trained on only Open-NQ. In retrieve-and-read setups, answers are generated from the top-1 retrieved passage.",
1026
+ "bbox": [
1027
+ 507,
1028
+ 533,
1029
+ 885,
1030
+ 606
1031
+ ],
1032
+ "page_idx": 5
1033
+ },
1034
+ {
1035
+ "type": "text",
1036
+ "text": "We compare to the baselines described in Section 6.4 on Open-NQ using both retrieval and answer accuracy metrics in Table 1. Answers are generated based on the top retrieved document in systems that separate retrieval from answer generation, to provide a clean comparison between systems that return (answer, evidence passage) pairs. Table 2 reports the out-of-domain performance of various systems on WQ and TREC.",
1037
+ "bbox": [
1038
+ 505,
1039
+ 629,
1040
+ 884,
1041
+ 772
1042
+ ],
1043
+ "page_idx": 5
1044
+ },
1045
+ {
1046
+ "type": "text",
1047
+ "text": "1P outperforms CBQA in question answering and beats the retrieve-and-read systems, BM25 and SEAL. On the passage retrieval task, it significantly improves over BM25 and SEAL. For indomain setting, 1P is competitive with DPR on retrieval task, but lags behind the QA pipeline that uses DPR. However, this appears to be more due to the reader rather than the retriever as discussed in Section 8. It is worth noting that 1P general",
1048
+ "bbox": [
1049
+ 505,
1050
+ 774,
1051
+ 885,
1052
+ 919
1053
+ ],
1054
+ "page_idx": 5
1055
+ },
1056
+ {
1057
+ "type": "page_footnote",
1058
+ "text": "<sup>3</sup>https://github.com/facebookresearch/DPR",
1059
+ "bbox": [
1060
+ 134,
1061
+ 890,
1062
+ 440,
1063
+ 904
1064
+ ],
1065
+ "page_idx": 5
1066
+ },
1067
+ {
1068
+ "type": "page_footnote",
1069
+ "text": "4https://github.com/castorini/pyserini",
1070
+ "bbox": [
1071
+ 134,
1072
+ 904,
1073
+ 423,
1074
+ 917
1075
+ ],
1076
+ "page_idx": 5
1077
+ },
1078
+ {
1079
+ "type": "page_number",
1080
+ "text": "14534",
1081
+ "bbox": [
1082
+ 477,
1083
+ 927,
1084
+ 524,
1085
+ 940
1086
+ ],
1087
+ "page_idx": 5
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "text": "izes significantly better out-of-domain compared to other systems.",
1092
+ "bbox": [
1093
+ 112,
1094
+ 84,
1095
+ 487,
1096
+ 116
1097
+ ],
1098
+ "page_idx": 6
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "Utility of Search Paths 1P-Unconstrained can be viewed as an extended version of CBQA that generates a search path before predicting the answer. Thus, improvement of 1P-Unconstrained over CBQA can be attributed to this path-conditioned answer generation process, analogous to chain-of-thought reasoning (Wei et al., 2022; Lampinen et al., 2022).",
1103
+ "bbox": [
1104
+ 112,
1105
+ 126,
1106
+ 489,
1107
+ 255
1108
+ ],
1109
+ "page_idx": 6
1110
+ },
1111
+ {
1112
+ "type": "table",
1113
+ "img_path": "images/fb7a9f435f7af5f644d5e644283f75948883f6355bcb0aee300fc20d6edc77a6.jpg",
1114
+ "table_caption": [],
1115
+ "table_footnote": [],
1116
+ "table_body": "<table><tr><td rowspan=\"2\">System</td><td rowspan=\"2\">Constrained Decoding</td><td colspan=\"2\">Beam</td></tr><tr><td>1</td><td>5</td></tr><tr><td>CBQA</td><td>No</td><td>26.7</td><td>26.8</td></tr><tr><td>1P Unconst.</td><td>No</td><td>29.0</td><td>29.3</td></tr><tr><td>SEAL + Reader</td><td>Yes</td><td>28.5</td><td>29.4</td></tr><tr><td>1P</td><td>Yes</td><td>28.7</td><td>31.7</td></tr></table>",
1117
+ "bbox": [
1118
+ 122,
1119
+ 277,
1120
+ 480,
1121
+ 397
1122
+ ],
1123
+ "page_idx": 6
1124
+ },
1125
+ {
1126
+ "type": "text",
1127
+ "text": "Effect of Constrained Decoding The purpose of constrained decoding is to ground the answer in an evidence retrieved from the corpus. As expected, the constrained setup enables 1P to achieve a higher Hits@1 than 1P-unconstrained. Surprisingly, when decoding with a beam of one, we observe a small drop in answer accuracy for 1P compared to 1P-Unconstrained (Table 3). Inspecting the losses, two dominant reasons surface. Firstly, As DPR passages are chunked into 100-words (Karpukhin et al., 2020), some queries may become unanswerable given a single passage due to missing context. This is disadvantageous when the model has memorized the answer but there is no single passage to attribute it to.",
1128
+ "bbox": [
1129
+ 112,
1130
+ 516,
1131
+ 489,
1132
+ 757
1133
+ ],
1134
+ "page_idx": 6
1135
+ },
1136
+ {
1137
+ "type": "text",
1138
+ "text": "Secondly, during constrained decoding, after generating the initial keywords, the search space may soon become sparse with no good candidates to pick from. Could a larger room for planning its actions help the model here? Indeed, increasing the beam size to 5 improves performance by $3\\%$ (Table 3), even when only the top-beam is used for retrieval. We refer to this as Planning, since the larger beam only enables the model to plan better and the remaining beam outputs are otherwise dis",
1139
+ "bbox": [
1140
+ 112,
1141
+ 758,
1142
+ 489,
1143
+ 919
1144
+ ],
1145
+ "page_idx": 6
1146
+ },
1147
+ {
1148
+ "type": "text",
1149
+ "text": "carded. Note that unconstrained decoding does not gain from planning. In the final setup in Table 1, we use a beam of 5 for both 1P and SEAL. Unlike 1P, SEAL uses all the outputs from the larger beam for retrieval.",
1150
+ "bbox": [
1151
+ 507,
1152
+ 84,
1153
+ 884,
1154
+ 164
1155
+ ],
1156
+ "page_idx": 6
1157
+ },
1158
+ {
1159
+ "type": "text",
1160
+ "text": "8 Discussion and Ablations",
1161
+ "text_level": 1,
1162
+ "bbox": [
1163
+ 507,
1164
+ 178,
1165
+ 761,
1166
+ 193
1167
+ ],
1168
+ "page_idx": 6
1169
+ },
1170
+ {
1171
+ "type": "text",
1172
+ "text": "Generating Answers While 1P is capable of generating answers, Table 1 highlights that it falls behind the 1P+Reader. The reason seems to be clear: the Reader has visibility into the full passage context while 1P is limited to the decoded search path and the constrained index which only ensures that generations are grounded in the corpus. Since 1P does retrieve passages, it would be possible to pull in the corresponding text as input for answer generation. We leave this as future work.",
1173
+ "bbox": [
1174
+ 507,
1175
+ 204,
1176
+ 884,
1177
+ 365
1178
+ ],
1179
+ "page_idx": 6
1180
+ },
1181
+ {
1182
+ "type": "text",
1183
+ "text": "Comparison to SEAL While 1P takes inspiration from SEAL, in practice, there are a few key differences between the two systems aside from 1P's answer generation.",
1184
+ "bbox": [
1185
+ 507,
1186
+ 376,
1187
+ 882,
1188
+ 439
1189
+ ],
1190
+ "page_idx": 6
1191
+ },
1192
+ {
1193
+ "type": "text",
1194
+ "text": "SEAL generates a large set of keywords (Table 4) using many separate decodes and heuristic guidance (Appendix A.3). In contrast, 1P decodes a single sequence of about three keywords.",
1195
+ "bbox": [
1196
+ 507,
1197
+ 441,
1198
+ 882,
1199
+ 505
1200
+ ],
1201
+ "page_idx": 6
1202
+ },
1203
+ {
1204
+ "type": "table",
1205
+ "img_path": "images/bd58d3bc2f48fa3e4ce0e928bbafbdfc664beeb698e29c15813aa140e2b04146.jpg",
1206
+ "table_caption": [
1207
+ "Table 3: EM for various decoding setups with different beam sizes on Open-NQ. Only top-beam result is used for evaluation, except in SEAL which uses all beam outputs. 1P constrained decoding benefits the most from a large beam whereas Unconstrained setups have only a slight effect."
1208
+ ],
1209
+ "table_footnote": [],
1210
+ "table_body": "<table><tr><td></td><td>SEAL</td><td>1P</td></tr><tr><td>Median keywords</td><td>32</td><td>3</td></tr><tr><td>Median docs retrieved</td><td>500</td><td>1</td></tr><tr><td>Generates answer</td><td>×</td><td>✓</td></tr></table>",
1211
+ "bbox": [
1212
+ 547,
1213
+ 517,
1214
+ 847,
1215
+ 599
1216
+ ],
1217
+ "page_idx": 6
1218
+ },
1219
+ {
1220
+ "type": "text",
1221
+ "text": "Table 4: Key differences between SEAL and 1P measured over Open-NQ test split with a beam of 1.",
1222
+ "bbox": [
1223
+ 507,
1224
+ 609,
1225
+ 882,
1226
+ 638
1227
+ ],
1228
+ "page_idx": 6
1229
+ },
1230
+ {
1231
+ "type": "text",
1232
+ "text": "The SEAL keywords are a set, decoded independently of each other and re-scored using sophisticated techniques to retrieve a large number of documents. For instance, the default configuration in SEAL retrieves up to 500 documents. This makes SEAL suitable to be employed in conjunction with a re-ranker. In contrast, 1P search path's map directly to a single (or few) relevant documents (Appendix A.6).",
1233
+ "bbox": [
1234
+ 507,
1235
+ 661,
1236
+ 884,
1237
+ 804
1238
+ ],
1239
+ "page_idx": 6
1240
+ },
1241
+ {
1242
+ "type": "text",
1243
+ "text": "We acknowledge the model-size variation between SEAL and 1P in the reported experiments, however we preferred using the publicly available SEAL checkpoint. Given the discrepancies with larger beam-size, multiple decodes and use of Reader model, it is difficult to have an apples to apples comparison between the two systems.",
1244
+ "bbox": [
1245
+ 507,
1246
+ 806,
1247
+ 882,
1248
+ 919
1249
+ ],
1250
+ "page_idx": 6
1251
+ },
1252
+ {
1253
+ "type": "page_number",
1254
+ "text": "14535",
1255
+ "bbox": [
1256
+ 477,
1257
+ 927,
1258
+ 524,
1259
+ 940
1260
+ ],
1261
+ "page_idx": 6
1262
+ },
1263
+ {
1264
+ "type": "text",
1265
+ "text": "Path vs Keyword set We qualitatively observe that keywords in a 1P path, owing to sequential generation, are distinct and add new information as compared to the SEAL output set where overlapping keywords are common (Appendix A.3). Thus, paths are advantageous for precisely narrowing down to a single relevant document while keyword sets are effective for retrieving a large number of documents that can later be reranked. This is corroborated by the fact that 1P is better at Hits@1 while SEAL is better at Hits@5 (Appendix A.4).",
1266
+ "bbox": [
1267
+ 112,
1268
+ 84,
1269
+ 489,
1270
+ 261
1271
+ ],
1272
+ "page_idx": 7
1273
+ },
1274
+ {
1275
+ "type": "text",
1276
+ "text": "Qualitative Analysis Table 5 illustrates patterns of Search Paths generated by 1P. We note some of the common path patterns here:",
1277
+ "bbox": [
1278
+ 112,
1279
+ 271,
1280
+ 487,
1281
+ 318
1282
+ ],
1283
+ "page_idx": 7
1284
+ },
1285
+ {
1286
+ "type": "list",
1287
+ "sub_type": "text",
1288
+ "list_items": [
1289
+ "1) First keywords are entities in the query, followed by query predicates that iteratively narrow down towards an answer. This is the most common type of path observed and can be attributed to the dominant presence of title in the training data.",
1290
+ "2) Rewrites of the original query or related predicates such as \"seasons consists of\", \"appeared on ...\". Such paths are more prevalent where there is no canonical entity in the query or no entity can be determined with high confidence.",
1291
+ "3) Answer is directly generated followed by supporting keywords that guide towards an attributed passage. This happens in a small fraction of cases, likely where the pretrained model has memorized an answer with high confidence."
1292
+ ],
1293
+ "bbox": [
1294
+ 112,
1295
+ 319,
1296
+ 487,
1297
+ 560
1298
+ ],
1299
+ "page_idx": 7
1300
+ },
1301
+ {
1302
+ "type": "text",
1303
+ "text": "Overall, we find the generated search paths to be fairly meaningful and interpretable.",
1304
+ "bbox": [
1305
+ 112,
1306
+ 562,
1307
+ 487,
1308
+ 594
1309
+ ],
1310
+ "page_idx": 7
1311
+ },
1312
+ {
1313
+ "type": "text",
1314
+ "text": "Sampling Search Paths for Training Table 6 highlights that high quality keywords are crucial to performance. The LM re-scored set of keywords result in significant accuracy gain over heuristically sampled keywords. Paths with first keyword as Title boost performance further. Mixing in a small fraction of paths starting with non-title keywords encourages the model to generate predicates where no entity can be determined, giving us the best results.",
1315
+ "bbox": [
1316
+ 112,
1317
+ 604,
1318
+ 489,
1319
+ 763
1320
+ ],
1321
+ "page_idx": 7
1322
+ },
1323
+ {
1324
+ "type": "text",
1325
+ "text": "Sensitivity to tokenization We find that constrained decoding is highly sensitive to rare tokenization or punctuation formatting in the corpus. Consider the query \"who sang i ran all the way home\" with the gold document title \"Sorry (I Ran All the Way Home)\". In the unconstrained setup, the model's top prediction starts with \"I Ran All the Way Home\". However, \"(I\" is tokenized differently from \"I\" and searching over the FM-Index",
1326
+ "bbox": [
1327
+ 112,
1328
+ 774,
1329
+ 489,
1330
+ 917
1331
+ ],
1332
+ "page_idx": 7
1333
+ },
1334
+ {
1335
+ "type": "text",
1336
+ "text": "returns no match. As a result, constrained decoding drops the predicted keyword altogether, resorting to lower ranked keywords in the beam. We partially fix the issue by modifying the answer in a fraction of the training data to include surrounding punctuation tokens based on how they appear in the FM-index. For instance, the keyword \"I Ran ...\" would update to \"(I Ran ...)\". This simple change leads to a jump in answer accuracy from $26.4\\%$ to $28.7\\%$ . However, much more work is needed to make 1P robust to variations in tokenization.",
1337
+ "bbox": [
1338
+ 507,
1339
+ 84,
1340
+ 884,
1341
+ 260
1342
+ ],
1343
+ "page_idx": 7
1344
+ },
1345
+ {
1346
+ "type": "text",
1347
+ "text": "See Appendix A.2 for analysis of training data size and Appendix A.5 for masking logits vs log-probs.",
1348
+ "bbox": [
1349
+ 507,
1350
+ 262,
1351
+ 884,
1352
+ 309
1353
+ ],
1354
+ "page_idx": 7
1355
+ },
1356
+ {
1357
+ "type": "text",
1358
+ "text": "Conclusion",
1359
+ "text_level": 1,
1360
+ "bbox": [
1361
+ 509,
1362
+ 323,
1363
+ 611,
1364
+ 338
1365
+ ],
1366
+ "page_idx": 7
1367
+ },
1368
+ {
1369
+ "type": "text",
1370
+ "text": "We introduce 1-PAGER, the first system to perform question answering and passage retrieval in one pass with a single language model, using a constrained decoder to iteratively partition the retrieval corpus and then generate an answer. We show competitive or improved performance over a variety of comparable baselines and carefully analyze the results, ablating both training strategies and decoding style. We also provide a qualitative analysis of predictions to illustrate the system's capabilities. Challenges with constrained decoding are surfaced including poor search spaces and sensitivity to tokenization and mitigation strategies are presented.",
1371
+ "bbox": [
1372
+ 507,
1373
+ 349,
1374
+ 884,
1375
+ 557
1376
+ ],
1377
+ "page_idx": 7
1378
+ },
1379
+ {
1380
+ "type": "text",
1381
+ "text": "We hope that 1P adds value in demonstrating how a single transformer model can be harnessed to do both retrieval and answering and pave the path for further progress in the generative retrieval domain.",
1382
+ "bbox": [
1383
+ 507,
1384
+ 558,
1385
+ 882,
1386
+ 637
1387
+ ],
1388
+ "page_idx": 7
1389
+ },
1390
+ {
1391
+ "type": "text",
1392
+ "text": "Limitations",
1393
+ "text_level": 1,
1394
+ "bbox": [
1395
+ 509,
1396
+ 651,
1397
+ 615,
1398
+ 665
1399
+ ],
1400
+ "page_idx": 7
1401
+ },
1402
+ {
1403
+ "type": "text",
1404
+ "text": "1P is geared towards identifying a concise, small set of documents and generating answer in a single go. While this makes the architecture simpler, it also adds certain weaknesses. 1P is not effective for retrieving a large number of documents and falls behind pipelined systems that combine retrieval with re-ranking. Even for a single passage, it lags behind state-of-the-art dense-retrieval techniques. 1P's method of answer generation is also not competitive with the use of a reader, due to lack of passage context.",
1405
+ "bbox": [
1406
+ 507,
1407
+ 677,
1408
+ 884,
1409
+ 853
1410
+ ],
1411
+ "page_idx": 7
1412
+ },
1413
+ {
1414
+ "type": "text",
1415
+ "text": "Our training strategy relies heavily on titles or entities and it's generalization on corpora without rich structure or on queries without central entities, remains to be studied.",
1416
+ "bbox": [
1417
+ 507,
1418
+ 854,
1419
+ 882,
1420
+ 917
1421
+ ],
1422
+ "page_idx": 7
1423
+ },
1424
+ {
1425
+ "type": "page_number",
1426
+ "text": "14536",
1427
+ "bbox": [
1428
+ 477,
1429
+ 928,
1430
+ 524,
1431
+ 941
1432
+ ],
1433
+ "page_idx": 7
1434
+ },
1435
+ {
1436
+ "type": "table",
1437
+ "img_path": "images/6615d0859b5cffb3239259a2a7b25b02962c66e39f3ea5a0456551d6295b932b.jpg",
1438
+ "table_caption": [],
1439
+ "table_footnote": [],
1440
+ "table_body": "<table><tr><td colspan=\"2\">Query (Q) and Generated Search Path (SP)</td><td>Comment</td></tr><tr><td colspan=\"3\">Correctly attributed passages and answers</td></tr><tr><td colspan=\"2\">Q: how many episodes of greys anatomy season 14\nSP: Grey&#x27;s Anatomy (season 14) » season consists of 24 episodes » 24</td><td>Query entity resolved first, followed by query predicates</td></tr><tr><td colspan=\"2\">Q: when did they start adding zinc to pennies\nSP: Penny (United States coin) » zinc » Lincoln cent » 1943</td><td>Query entity resolved iteratively</td></tr><tr><td colspan=\"2\">Q: who was executed for being an american spy during the revolutionary war\nSP: Nathan Hale » Army during the American Revolutionary » Nathan Hale</td><td>Answer generated first</td></tr><tr><td colspan=\"2\">Q: who was the grandfather on the Cosby show\nSP: appeared on &quot;The Cosby » Earle Hyman</td><td>Query rewrites</td></tr><tr><td colspan=\"3\">Incorrect Passage or Answer</td></tr><tr><td>Q: who decides the number of judges in the high court\nSP: judge is appointed » High Court » Chief Justice of India</td><td>A: President of India</td><td>Path correctly resolved,\nFailed on answer</td></tr><tr><td>Q: when did the isle of wight become an island\nIsle of Wight » 1890 » 1890</td><td>A: During the last Ice Age</td><td>Query entity resolved,\nFailed on supporting keywords</td></tr><tr><td>Q: love yourself by justin bieber is about who\nSP: Love Yourself: Her » music video » Her</td><td>A: Rihana</td><td>Failed to resolve\nquery entity</td></tr></table>",
1441
+ "bbox": [
1442
+ 115,
1443
+ 80,
1444
+ 884,
1445
+ 361
1446
+ ],
1447
+ "page_idx": 8
1448
+ },
1449
+ {
1450
+ "type": "table",
1451
+ "img_path": "images/760f38de5fe54c729d356498f7cec5a4a204ee9a0a6106e83a20b90ae1fec2f1.jpg",
1452
+ "table_caption": [
1453
+ "Table 5: Example 1P Search Paths (SP) on Open-NQ test set. The last keyword in SP is the predicted answer. Gold answers are indicated by A."
1454
+ ],
1455
+ "table_footnote": [],
1456
+ "table_body": "<table><tr><td>Search Path</td><td>Hits@1</td><td>EM</td></tr><tr><td>Heuristic</td><td>34.5</td><td>22.6</td></tr><tr><td>LM-scored</td><td>40.0</td><td>27.2</td></tr><tr><td>Title » LM-scored</td><td>41.9</td><td>28.0</td></tr><tr><td>Title » LM-scored + LM-scored (7+1)</td><td>42.9</td><td>28.7</td></tr></table>",
1457
+ "bbox": [
1458
+ 154,
1459
+ 428,
1460
+ 450,
1461
+ 542
1462
+ ],
1463
+ "page_idx": 8
1464
+ },
1465
+ {
1466
+ "type": "text",
1467
+ "text": "Table 6: Comparison of Training Search Paths on OpenNQ. Here LM-scored denotes re-scoring by LM on a heuristic set. All results are with a beam of one. \"»\" indicates keyword separator and \"+\" mixture of path types in the give ratio.",
1468
+ "bbox": [
1469
+ 112,
1470
+ 551,
1471
+ 489,
1472
+ 625
1473
+ ],
1474
+ "page_idx": 8
1475
+ },
1476
+ {
1477
+ "type": "text",
1478
+ "text": "Constrained decoding also comes with its own challenges. Constrained beam outputs often lack diversity, so that even with a larger beam one may still end up in poor search spaces. Computing document-level constraints across the corpus is expensive as it may require scanning a large number of rows in the index. Further, communication between FM-Index and Transformer model slows down inference.",
1479
+ "bbox": [
1480
+ 112,
1481
+ 659,
1482
+ 489,
1483
+ 803
1484
+ ],
1485
+ "page_idx": 8
1486
+ },
1487
+ {
1488
+ "type": "text",
1489
+ "text": "Acknowledgement",
1490
+ "text_level": 1,
1491
+ "bbox": [
1492
+ 114,
1493
+ 824,
1494
+ 278,
1495
+ 840
1496
+ ],
1497
+ "page_idx": 8
1498
+ },
1499
+ {
1500
+ "type": "text",
1501
+ "text": "We thank Don Metzler, Nicholas FitzGerald, Partha Talukdar, Srini Narayanan, as well as our anonymous reviewers, for their thoughtful comments and valuable feedback",
1502
+ "bbox": [
1503
+ 112,
1504
+ 854,
1505
+ 489,
1506
+ 917
1507
+ ],
1508
+ "page_idx": 8
1509
+ },
1510
+ {
1511
+ "type": "text",
1512
+ "text": "Ethical Considerations",
1513
+ "text_level": 1,
1514
+ "bbox": [
1515
+ 509,
1516
+ 430,
1517
+ 712,
1518
+ 445
1519
+ ],
1520
+ "page_idx": 8
1521
+ },
1522
+ {
1523
+ "type": "text",
1524
+ "text": "While Large Language Models can solve a wide range of tasks effectively, they also suffer from biases across axis such as gender, race, region (Chan, 2023). LLMs are also prone to generating toxic content, especially when probed about it. Although, our task grounds the model's generations on a corpus, some of the biases in pre-trained LLMs, may seep in 1-PAGER.",
1525
+ "bbox": [
1526
+ 507,
1527
+ 457,
1528
+ 884,
1529
+ 585
1530
+ ],
1531
+ "page_idx": 8
1532
+ },
1533
+ {
1534
+ "type": "text",
1535
+ "text": "Building the FM-index and constrained decoding is a compute-intensive affair. We have experimented over a single dataset, Natural Questions, involving only knowledge-seeking queries, and single model family, T5. It is possible that some of our findings may not hold over other datasets or model families. Finally, our experiments are limited to English corpus and queries. The proposed approaches are resource-intensive and may not be accessible or valid for several low-resourced languages.",
1536
+ "bbox": [
1537
+ 507,
1538
+ 587,
1539
+ 884,
1540
+ 747
1541
+ ],
1542
+ "page_idx": 8
1543
+ },
1544
+ {
1545
+ "type": "text",
1546
+ "text": "References",
1547
+ "text_level": 1,
1548
+ "bbox": [
1549
+ 510,
1550
+ 776,
1551
+ 608,
1552
+ 791
1553
+ ],
1554
+ "page_idx": 8
1555
+ },
1556
+ {
1557
+ "type": "text",
1558
+ "text": "Leonard Adolphs, Benjamin Boerschinger, Christian Buck, Michelle Chen Huebscher, Massimiliano Ciaramita, Lasse Espeholt, Thomas Hofmann, Yannic Kilcher, Sascha Rothe, Pier Giuseppe Sessa, et al. 2021. Boosting search engines with interactive agents. arXiv preprint arXiv:2109.00527.",
1559
+ "bbox": [
1560
+ 509,
1561
+ 800,
1562
+ 884,
1563
+ 879
1564
+ ],
1565
+ "page_idx": 8
1566
+ },
1567
+ {
1568
+ "type": "text",
1569
+ "text": "Rohan Anil, Andrew M Dai, Orhan Firat, Melvin Johnson, Dmitry Lepikhin, Alexandre Passos, Siamak",
1570
+ "bbox": [
1571
+ 509,
1572
+ 891,
1573
+ 882,
1574
+ 917
1575
+ ],
1576
+ "page_idx": 8
1577
+ },
1578
+ {
1579
+ "type": "page_number",
1580
+ "text": "14537",
1581
+ "bbox": [
1582
+ 477,
1583
+ 927,
1584
+ 524,
1585
+ 940
1586
+ ],
1587
+ "page_idx": 8
1588
+ },
1589
+ {
1590
+ "type": "list",
1591
+ "sub_type": "ref_text",
1592
+ "list_items": [
1593
+ "Shakeri, Emanuel Taropa, Paige Bailey, Zhifeng Chen, et al. 2023. Palm 2 technical report. arXiv preprint arXiv:2305.10403.",
1594
+ "Petr Baudis and Jan Šedivý. 2015. Modeling of the question answering task in the yodaqa system. In Experimental IR Meets Multilinguality, Multimodality, and Interaction: 6th International Conference of the CLEF Association, CLEF'15, Toulouse, France, September 8-11, 2015, Proceedings 6, pages 222-228. Springer.",
1595
+ "Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on freebase from question-answer pairs. In Proceedings of the 2013 conference on empirical methods in natural language processing, pages 1533-1544.",
1596
+ "Michele Bevilacqua, Giuseppe Ottaviano, Patrick Lewis, Wen tau Yih, Sebastian Riedel, and Fabio Petroni. 2022. Autoregressive search engines: Generating substrings as document identifiers. In arXiv pre-print 2204.10628.",
1597
+ "Bernd Bohnet, Vinh Q Tran, Pat Verga, Roee Aharoni, Daniel Andor, Livio Baldini Soares, Jacob Eisenstein, Kuzman Ganchev, Jonathan Herzig, Kai Hui, et al. 2022. Attributed question answering: Evaluation and modeling for attributed large language models. arXiv preprint arXiv:2212.08037.",
1598
+ "Anastasia Chan. 2023. Gpt-3 and instructgpt: technological dystopianism, utopianism, and \"contextual\" perspectives in ai ethics and industry. AI and Ethics, 3(1):53-64.",
1599
+ "Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. 2017. Reading wikipedia to answer open-domain questions. arXiv preprint arXiv:1704.00051.",
1600
+ "Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, and Andrew McCallum. 2019. Multi-step retriever-reader interaction for scalable open-domain question answering. In International Conference on Learning Representations.",
1601
+ "Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. 2021. Autoregressive entity retrieval. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net.",
1602
+ "P. Ferragina and G. Manzini. 2000. Opportunistic data structures with applications. In Proceedings 41st Annual Symposium on Foundations of Computer Science, pages 390-398.",
1603
+ "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. 2023a. Rarr: Researching and revising what language models say, using language models."
1604
+ ],
1605
+ "bbox": [
1606
+ 115,
1607
+ 85,
1608
+ 487,
1609
+ 917
1610
+ ],
1611
+ "page_idx": 9
1612
+ },
1613
+ {
1614
+ "type": "list",
1615
+ "sub_type": "ref_text",
1616
+ "list_items": [
1617
+ "Tianyu Gao, Howard Yen, Jiatong Yu, and Danqi Chen. 2023b. Enabling large language models to generate text with citations.",
1618
+ "Alex Graves. 2012. Sequence transduction with recurrent neural networks.",
1619
+ "Sanda M Harabagiu, Steven J Maiorano, and Marius A Pasca. 2003. Open-domain textual question answering techniques. Natural Language Engineering, 9(3):231-267.",
1620
+ "Gautier Izacard, Patrick Lewis, Maria Lomeli, Lucas Hosseini, Fabio Petroni, Timo Schick, Jane Dwivedi-Yu, Armand Joulin, Sebastian Riedel, and Edouard Grave. 2022. Few-shot Learning with Retrieval Augmented Language Models.",
1621
+ "Zhengbao Jiang, Luyu Gao, Jun Araki, Haibo Ding, Zhiruo Wang, Jamie Callan, and Graham Neubig. 2022. Retrieval as attention: End-to-end learning of retrieval and reading within a single transformer. arXiv preprint arXiv:2212.02027.",
1622
+ "Zhengbao Jiang, Frank F Xu, Luyu Gao, Zhiqing Sun, Qian Liu, Jane Dwivedi-Yu, Yiming Yang, Jamie Callan, and Graham Neubig. 2023. Active retrieval augmented generation. arXiv preprint arXiv:2305.06983.",
1623
+ "Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6769-6781, Online. Association for Computational Linguistics.",
1624
+ "Omar Khattab and Matei Zaharia. 2020. Colbert: Efficient and effective passage search via contextualized late interaction over bert. In Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval, pages 39-48.",
1625
+ "Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Matthew Kelcey, Jacob Devlin, Kenton Lee, Kristina N. Toutanova, Llion Jones, Ming-Wei Chang, Andrew Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: a benchmark for question answering research. Transactions of the Association of Computational Linguistics.",
1626
+ "Andrew K Lampinen, Ishita Dasgupta, Stephanie CY Chan, Kory Matthewson, Michael Henry Tessler, Antonia Creswell, James L McClelland, Jane X Wang, and Felix Hill. 2022. Can language models learn from explanations in context? arXiv preprint arXiv:2204.02329."
1627
+ ],
1628
+ "bbox": [
1629
+ 510,
1630
+ 85,
1631
+ 880,
1632
+ 917
1633
+ ],
1634
+ "page_idx": 9
1635
+ },
1636
+ {
1637
+ "type": "page_number",
1638
+ "text": "14538",
1639
+ "bbox": [
1640
+ 477,
1641
+ 928,
1642
+ 524,
1643
+ 940
1644
+ ],
1645
+ "page_idx": 9
1646
+ },
1647
+ {
1648
+ "type": "list",
1649
+ "sub_type": "ref_text",
1650
+ "list_items": [
1651
+ "Hyunjii Lee, Sohee Yang, Hanseok Oh, and Minjoon Seo. 2022. Generative multi-hop retrieval. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 1417-1436.",
1652
+ "Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6086–6096, Florence, Italy. Association for Computational Linguistics.",
1653
+ "Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871-7880, Online. Association for Computational Linguistics.",
1654
+ "Patrick Lewis, Yuxiang Wu, Linqing Liu, Pasquale Minervini, Heinrich Kuttler, Aleksandra Piktus, Pontus Stenetorp, and Sebastian Riedel. 2021. Paq: 65 million probably-asked questions and what you can do with them.",
1655
+ "Chin-Yew Lin. 2004. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pages 74-81.",
1656
+ "Jimmy Lin, Xueguang Ma, Sheng-Chieh Lin, Jheng-Hong Yang, Ronak Pradeep, and Rodrigo Nogueira. 2021. Pyserini: An easy-to-use python toolkit to support replicable in research with sparse and dense representations. arXiv preprint arXiv:2102.10073.",
1657
+ "Jacob Menick, Maja Trebacz, Vladimir Mikulik, John Aslanides, Francis Song, Martin Chadwick, Mia Glaese, Susannah Young, Lucy Campbell-Gillingham, Geoffrey Irving, and Nat McAleese. 2022. Teaching language models to support answers with verified quotes.",
1658
+ "Donald Metzler, Yi Tay, Dara Bahri, and Marc Najork. 2021. Rethinking search: making domain experts out of dilettantes. ACM SIGIR Forum, 55(1):1-27.",
1659
+ "OpenAI. 2023. Gpt-4 technical report.",
1660
+ "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67.",
1661
+ "Hannah Rashkin, Vitaly Nikolaev, Matthew Lamm, Lora Aroyo, Michael Collins, Dipanjan Das, Slav Petrov, Gaurav Singh Tomar, Iulia Turc, and David Reitter. 2021. Measuring attribution in natural language generation models. arXiv preprint arXiv:2112.12870."
1662
+ ],
1663
+ "bbox": [
1664
+ 115,
1665
+ 85,
1666
+ 489,
1667
+ 917
1668
+ ],
1669
+ "page_idx": 10
1670
+ },
1671
+ {
1672
+ "type": "list",
1673
+ "sub_type": "ref_text",
1674
+ "list_items": [
1675
+ "Adam Roberts, Hyung Won Chung, Anselm Levskaya, Gaurav Mishra, James Bradbury, Daniel Andor, Sharan Narang, Brian Lester, Colin Gaffney, Afroz Mohiuddin, Curtis Hawthorne, Aitor Lewkowycz, Alex Salcianu, Marc van Zee, Jacob Austin, Sebastian Goodman, Livio Baldini Soares, Haitang Hu, Sasha Tsvyashchenko, Aankanksha Chowdhery, Jasmijn Bastings, Jannis Bulian, Xavier Garcia, Jianmo Ni, Andrew Chen, Kathleen Kenealy, Jonathan H. Clark, Stephan Lee, Dan Garrette, James Lee-Thorp, Colin Raffel, Noam Shazeer, Marvin Ritter, Maarten Bosma, Alexandre Passos, Jeremy Maitin-Shepard, Noah Fiedel, Mark Omernick, Brennan Saeta, Ryan Sepassi, Alexander Spiridonov, Joshua Newlan, and Andrea Gesmundo. 2022. Scaling up models and data with t5x and seqio.",
1676
+ "Adam Roberts, Colin Raffel, and Noam Shazeer. 2020. How much knowledge can you pack into the parameters of a language model? arXiv preprint arXiv:2002.08910.",
1677
+ "Stephen Robertson, Hugo Zaragoza, et al. 2009. The probabilistic relevance framework: Bm25 and beyond. Foundations and Trends® in Information Retrieval, 3(4):333-389.",
1678
+ "Keshav Santhanam, Omar Khattab, Jon Saad-Falcon, Christopher Potts, and Matei Zaharia. 2022. Colbertv2: Effective and efficient retrieval via lightweight late interaction.",
1679
+ "Yi Tay, Vinh Tran, Mostafa Dehghani, Jianmo Ni, Dara Bahri, Harsh Mehta, Zhen Qin, Kai Hui, Zhe Zhao, Jai Gupta, et al. 2022. Transformer memory as a differentiable search index. Advances in Neural Information Processing Systems, 35:21831-21843.",
1680
+ "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30.",
1681
+ "Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. 2022. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903.",
1682
+ "Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul Bennett, Junaid Ahmed, and Arnold Overwijk. 2020. Approximate nearest neighbor negative contrastive learning for dense text retrieval. arXiv preprint arXiv:2007.00808.",
1683
+ "Wenhao Yu, Dan Iter, Shuohang Wang, Yichong Xu, Mingxuan Ju, Soumya Sanyal, Chenguang Zhu, Michael Zeng, and Meng Jiang. 2022. Generate rather than retrieve: Large language models are strong context generators. arXiv preprint arXiv:2209.10063.",
1684
+ "Wenhao Yu, Dan Iter, Shuohang Wang, Yichong Xu, Mingxuan Ju, Soumya Sanyal, Chenguang Zhu, Michael Zeng, and Meng Jiang. 2023. Generate"
1685
+ ],
1686
+ "bbox": [
1687
+ 510,
1688
+ 85,
1689
+ 882,
1690
+ 917
1691
+ ],
1692
+ "page_idx": 10
1693
+ },
1694
+ {
1695
+ "type": "page_number",
1696
+ "text": "14539",
1697
+ "bbox": [
1698
+ 477,
1699
+ 928,
1700
+ 524,
1701
+ 940
1702
+ ],
1703
+ "page_idx": 10
1704
+ },
1705
+ {
1706
+ "type": "list",
1707
+ "sub_type": "ref_text",
1708
+ "list_items": [
1709
+ "rather than retrieve: Large language models are strong context generators. In The Eleventh International Conference on Learning Representations.",
1710
+ "Yujia Zhou, Jing Yao, Zhicheng Dou, Ledell Wu, Peitan Zhang, and Ji-Rong Wen. 2022. Ultron: An ultimate retriever on corpus with a model-based indexer. arXiv preprint arXiv:2208.09257.",
1711
+ "Fengbin Zhu, Wenqiang Lei, Chao Wang, Jianming Zheng, Soujanya Poria, and Tat-Seng Chua. 2021. Retrieving and reading: A comprehensive survey on open-domain question answering."
1712
+ ],
1713
+ "bbox": [
1714
+ 115,
1715
+ 85,
1716
+ 489,
1717
+ 252
1718
+ ],
1719
+ "page_idx": 11
1720
+ },
1721
+ {
1722
+ "type": "page_number",
1723
+ "text": "14540",
1724
+ "bbox": [
1725
+ 477,
1726
+ 928,
1727
+ 526,
1728
+ 940
1729
+ ],
1730
+ "page_idx": 11
1731
+ },
1732
+ {
1733
+ "type": "text",
1734
+ "text": "A Appendix",
1735
+ "text_level": 1,
1736
+ "bbox": [
1737
+ 114,
1738
+ 84,
1739
+ 238,
1740
+ 99
1741
+ ],
1742
+ "page_idx": 12
1743
+ },
1744
+ {
1745
+ "type": "text",
1746
+ "text": "A.1 Constrain Computation",
1747
+ "text_level": 1,
1748
+ "bbox": [
1749
+ 114,
1750
+ 109,
1751
+ 352,
1752
+ 124
1753
+ ],
1754
+ "page_idx": 12
1755
+ },
1756
+ {
1757
+ "type": "text",
1758
+ "text": "1P relies on two key operations for constrain computation:",
1759
+ "bbox": [
1760
+ 112,
1761
+ 130,
1762
+ 489,
1763
+ 162
1764
+ ],
1765
+ "page_idx": 12
1766
+ },
1767
+ {
1768
+ "type": "list",
1769
+ "sub_type": "text",
1770
+ "list_items": [
1771
+ "a) $\\mathcal{F}(D,k)$ : Documents that contain keyword $k$",
1772
+ "b) $\\mathcal{C}(k,D)$ : Next tokens for keyword $k$ in arbitrary document set $D$"
1773
+ ],
1774
+ "bbox": [
1775
+ 126,
1776
+ 172,
1777
+ 487,
1778
+ 230
1779
+ ],
1780
+ "page_idx": 12
1781
+ },
1782
+ {
1783
+ "type": "text",
1784
+ "text": "$\\mathcal{F}(D,k)$ is preprocessed and cached to allow for quick computation. $\\mathcal{C}(k,D)$ is trickier to compute. When $D$ represents the full corpus, FM-index can fetch the next tokens in $O(|V| \\log(|V|))$ , where $V$ is the token vocabulary and independent of $|D|$ . However, arbitrary $D$ requires a traversal over all documents and can be very expensive. In practise, the LLM training guides it to generate effective keywords such that $|D|$ is small.",
1785
+ "bbox": [
1786
+ 112,
1787
+ 241,
1788
+ 487,
1789
+ 385
1790
+ ],
1791
+ "page_idx": 12
1792
+ },
1793
+ {
1794
+ "type": "text",
1795
+ "text": "We also apply certain other optimizations to reduce the compute cost:",
1796
+ "bbox": [
1797
+ 112,
1798
+ 387,
1799
+ 489,
1800
+ 419
1801
+ ],
1802
+ "page_idx": 12
1803
+ },
1804
+ {
1805
+ "type": "list",
1806
+ "sub_type": "text",
1807
+ "list_items": [
1808
+ "- Constrains are computed lazily over a decoding pass.",
1809
+ "- Several computations are cached, eg: keyword to document id mapping",
1810
+ "- To cap the cost of constraints at each decoding step, we allow for unconstrained generation in rare scenarios, when the estimated cost is too high. If the generated path is absent in the corpus ( $< 1\\%$ examples), these can be filtered out later."
1811
+ ],
1812
+ "bbox": [
1813
+ 136,
1814
+ 429,
1815
+ 485,
1816
+ 609
1817
+ ],
1818
+ "page_idx": 12
1819
+ },
1820
+ {
1821
+ "type": "text",
1822
+ "text": "Despite these optimizations, inference continues to be expensive and we perhaps need a special data structure for next token look-up.",
1823
+ "bbox": [
1824
+ 112,
1825
+ 621,
1826
+ 487,
1827
+ 671
1828
+ ],
1829
+ "page_idx": 12
1830
+ },
1831
+ {
1832
+ "type": "text",
1833
+ "text": "A.2 Training data size",
1834
+ "text_level": 1,
1835
+ "bbox": [
1836
+ 114,
1837
+ 680,
1838
+ 305,
1839
+ 696
1840
+ ],
1841
+ "page_idx": 12
1842
+ },
1843
+ {
1844
+ "type": "table",
1845
+ "img_path": "images/71439e0cbf64e4a85772a56a9624e0e9ba13d010d9008d119d31af6dbf235983.jpg",
1846
+ "table_caption": [],
1847
+ "table_footnote": [],
1848
+ "table_body": "<table><tr><td>Dataset</td><td>Queries</td><td>Paths</td><td>Hits@1</td><td>EM</td></tr><tr><td>Open-NQ</td><td>55k</td><td>55k</td><td>41.9</td><td>28.1</td></tr><tr><td>Open-NQ</td><td>55k</td><td>310k</td><td>42.9</td><td>28.7</td></tr><tr><td rowspan=\"2\">Open-NQ + PAQ</td><td>55k</td><td>310k</td><td rowspan=\"2\">43.6</td><td rowspan=\"2\">29.5</td></tr><tr><td>+ 9M</td><td>+ 9M</td></tr></table>",
1849
+ "bbox": [
1850
+ 119,
1851
+ 712,
1852
+ 482,
1853
+ 810
1854
+ ],
1855
+ "page_idx": 12
1856
+ },
1857
+ {
1858
+ "type": "text",
1859
+ "text": "Table 7: Comparison of different dataset sizes for queries and paths",
1860
+ "bbox": [
1861
+ 112,
1862
+ 819,
1863
+ 487,
1864
+ 850
1865
+ ],
1866
+ "page_idx": 12
1867
+ },
1868
+ {
1869
+ "type": "text",
1870
+ "text": "In Table 7, we observe the effect of dataset size on performance. Increasing the numbers of paths sampled per query improves performance, perhaps",
1871
+ "bbox": [
1872
+ 112,
1873
+ 871,
1874
+ 487,
1875
+ 919
1876
+ ],
1877
+ "page_idx": 12
1878
+ },
1879
+ {
1880
+ "type": "text",
1881
+ "text": "due to higher diversity in training. However, this method of dataset expansion is limited by the number of relevant paths we could extract for a query.",
1882
+ "bbox": [
1883
+ 507,
1884
+ 84,
1885
+ 882,
1886
+ 131
1887
+ ],
1888
+ "page_idx": 12
1889
+ },
1890
+ {
1891
+ "type": "text",
1892
+ "text": "We also experiment with increasing the query set manifold by mixing in unsupervised datasets. A total of 9M QA pairs are sampled from PAQ (Lewis et al., 2021), a synthetic QA dataset, and search paths extracted with heuristic scoring described in Section 5. The original 1P training dataset is mixed in 1:1 ratio. This further boosts performance, but not proportionally to the amount of data added, indicating diminishing returns from silver datasets.",
1893
+ "bbox": [
1894
+ 507,
1895
+ 133,
1896
+ 882,
1897
+ 277
1898
+ ],
1899
+ "page_idx": 12
1900
+ },
1901
+ {
1902
+ "type": "text",
1903
+ "text": "A.3 SEAL keywords",
1904
+ "text_level": 1,
1905
+ "bbox": [
1906
+ 507,
1907
+ 288,
1908
+ 687,
1909
+ 304
1910
+ ],
1911
+ "page_idx": 12
1912
+ },
1913
+ {
1914
+ "type": "text",
1915
+ "text": "SEAL generates a set of document substrings constrained on the corpus, that are combined to form document identifiers. Besides using a LM to generate keywords, SEAL utilizes several other mechanisms for extracting keywords. This includes partial beam sequences, heuristically adding query n-grams, sampling the top-k tokens from the logprobs of the first decoding step, force decoding title etc. The keywords are re-scored using the LM as well as FM-index count and all keyword combinations are retrieved. Table 8 illustrates keywords generated by both the systems. Note that SEAL keywords can be repetitive and therefore require a large number of keywords to narrow down to meaningful documents. This also makes SEAL suitable for retrieving a much larger set of documents that can be re-ranked later. The maximum number of retrieved documents for SEAL are capped by a hyperparameter with default value of 500. In contrast, 1P is geared towards retrieving only the top-document.",
1916
+ "bbox": [
1917
+ 507,
1918
+ 309,
1919
+ 882,
1920
+ 630
1921
+ ],
1922
+ "page_idx": 12
1923
+ },
1924
+ {
1925
+ "type": "text",
1926
+ "text": "A.4 Hits@5",
1927
+ "text_level": 1,
1928
+ "bbox": [
1929
+ 509,
1930
+ 640,
1931
+ 618,
1932
+ 655
1933
+ ],
1934
+ "page_idx": 12
1935
+ },
1936
+ {
1937
+ "type": "text",
1938
+ "text": "SEAL does significantly better than 1P for Hits@5 (Table 9). We attribute this to the large set of keywords generated by SEAL as explained in the Appendix A.3.",
1939
+ "bbox": [
1940
+ 507,
1941
+ 662,
1942
+ 882,
1943
+ 726
1944
+ ],
1945
+ "page_idx": 12
1946
+ },
1947
+ {
1948
+ "type": "text",
1949
+ "text": "A.5 Normalizing sequence likelihood over constrained space",
1950
+ "text_level": 1,
1951
+ "bbox": [
1952
+ 507,
1953
+ 737,
1954
+ 853,
1955
+ 769
1956
+ ],
1957
+ "page_idx": 12
1958
+ },
1959
+ {
1960
+ "type": "text",
1961
+ "text": "During constrained decoding a sequence $X$ , we need to choose the next token from $\\mathcal{C}(X, D)$ and not the entire vocabulary space $V$ . Should the sequence likelihood be re-normalized over this constrained space? We find that re-normalizing the probabilities results in inflated likelihoods, making it hard for the model to back-track.",
1962
+ "bbox": [
1963
+ 507,
1964
+ 774,
1965
+ 882,
1966
+ 885
1967
+ ],
1968
+ "page_idx": 12
1969
+ },
1970
+ {
1971
+ "type": "text",
1972
+ "text": "Consider the query, \"where did the butchers in the slaughterhouse cases live\" to which our model",
1973
+ "bbox": [
1974
+ 507,
1975
+ 887,
1976
+ 880,
1977
+ 917
1978
+ ],
1979
+ "page_idx": 12
1980
+ },
1981
+ {
1982
+ "type": "page_number",
1983
+ "text": "14541",
1984
+ "bbox": [
1985
+ 477,
1986
+ 927,
1987
+ 522,
1988
+ 940
1989
+ ],
1990
+ "page_idx": 12
1991
+ },
1992
+ {
1993
+ "type": "table",
1994
+ "img_path": "images/8734388e27db242bfa05e7766526c2e6c225c95060ead1e3a67a54fb141fe56e.jpg",
1995
+ "table_caption": [],
1996
+ "table_footnote": [],
1997
+ "table_body": "<table><tr><td>System</td><td>Question or Search Path</td><td>Answer</td></tr><tr><td rowspan=\"2\">1P SEAL</td><td>who has the most catches in nfl history2,000-yard club » Barry Sanders</td><td rowspan=\"2\">Jerry RiceBarry SandersT.J. Houshmandzadeh</td></tr><tr><td>&lt;/s&gt; Michael Irvin @ @, yards per catch, caught his, touchdown, record</td></tr><tr><td rowspan=\"2\">1P SEAL</td><td>when was harry potter and the philosophers stone publishedHarry Potter and the Philosopher&#x27;s Stone » first published in the United » 1997</td><td>19971997</td></tr><tr><td>&lt;/s&gt; Harry Potter and the Philosopher&#x27;s Stone @ @, &quot;Harry Potter, Potter and thePhilosopher&#x27;s Stone is, Potter and the Philosopher&#x27;s Stone Harry, novel</td><td>1999</td></tr><tr><td rowspan=\"2\">1P SEAL</td><td>what is the meaning of the harp in irelandHarp » national symbol of Ireland » national symbol of Ireland</td><td>the arms of Irelandnational symbol of Ireland</td></tr><tr><td>&lt;/s&gt; Harp @ @, Irish harp., harp is, harp was, harp</td><td>aristocracy</td></tr><tr><td rowspan=\"2\">1P SEAL</td><td>who was the president of pakistan during 1971 warIndo-Pakistani War of 1971 » Prime Minister of Pakistan » Zulfikar Ali Bhutto</td><td>Yahya KhanZulfikar Ali Bhutto</td></tr><tr><td>&lt;/s&gt; Indo-Pakistani War of 1971 @ @, East Pakistan, Pakistani, Pakistan Army,Pakistan&#x27;s</td><td>Muhammad Yaqub Khan</td></tr><tr><td rowspan=\"2\">1P SEAL</td><td>when do you declare honors in contract bridgeContract bridge » declaring » end of the hand</td><td>any time after the auctionend of the hand</td></tr><tr><td>&lt;/s&gt; Contract bridge @ @, declarer, bidding, honors, hands</td><td>bidding</td></tr></table>",
1998
+ "bbox": [
1999
+ 119,
2000
+ 95,
2001
+ 878,
2002
+ 390
2003
+ ],
2004
+ "page_idx": 13
2005
+ },
2006
+ {
2007
+ "type": "table",
2008
+ "img_path": "images/58293c4b5818600e487ba00304d9f3dedfe3d565b91feed1a7d030d82bf1e5b2.jpg",
2009
+ "table_caption": [
2010
+ "Table 8: Comparison of keywords generated by SEAL and 1P for randomly sampled examples from Open-NQ test set. For 1P, we show the full search path separated by \"»\" with the last keyword as the answer. For SEAL, we illustrate the top-5 keywords along with the answer from Reader model. \"</s>\" and \"@@\" are special tokens used by SEAL for identifying start of passage and title marker respectively. The Answer next to the question is the gold answer while others are predictions from corresponding systems."
2011
+ ],
2012
+ "table_footnote": [],
2013
+ "table_body": "<table><tr><td>System</td><td>Beam</td><td>Hits@5</td></tr><tr><td>SEAL</td><td>1</td><td>59.7</td></tr><tr><td>SEAL</td><td>5</td><td>62.8</td></tr><tr><td>1P</td><td>1</td><td>46.5</td></tr><tr><td>1P</td><td>5</td><td>50.8</td></tr></table>",
2014
+ "bbox": [
2015
+ 191,
2016
+ 499,
2017
+ 410,
2018
+ 596
2019
+ ],
2020
+ "page_idx": 13
2021
+ },
2022
+ {
2023
+ "type": "text",
2024
+ "text": "Table 9: Hits@5 on Open-NQ test. SEAL achieves a much higher score than 1P owning to the larger number of documents matched and re-scored. Note that only top-beam result is used for 1P while SEAL uses all beam outputs.",
2025
+ "bbox": [
2026
+ 112,
2027
+ 606,
2028
+ 487,
2029
+ 678
2030
+ ],
2031
+ "page_idx": 13
2032
+ },
2033
+ {
2034
+ "type": "text",
2035
+ "text": "predicts an irrelevant search path [Slaughterhouse Five, but, EoS]. What's going on under the hood? The first keyword is incorrect lending the model into a poor search space. With the second keyword, the model is possibly looking to generate \"butcher\" but there's no such keyword in the constrained set. Ideally, the model should backtrack at this point to other candidates in the beam. However, since the set of continuations is small, renormalizing inflates the probabilities of all tokens in $\\mathcal{C}$ including $EoS$ , even though the true likelihood of such a sequence is very low. Indeed, using the language model's scores directly without any re",
2036
+ "bbox": [
2037
+ 112,
2038
+ 709,
2039
+ 489,
2040
+ 919
2041
+ ],
2042
+ "page_idx": 13
2043
+ },
2044
+ {
2045
+ "type": "image",
2046
+ "img_path": "images/654724f0998c6062f18ca04f65c75b48e7ea83283c2b0243c15547b26b82e17d.jpg",
2047
+ "image_caption": [
2048
+ "Figure 4: Number of matching documents in the corpus for 1P generated path in the test set. About half the examples match only a single path."
2049
+ ],
2050
+ "image_footnote": [],
2051
+ "bbox": [
2052
+ 515,
2053
+ 502,
2054
+ 878,
2055
+ 671
2056
+ ],
2057
+ "page_idx": 13
2058
+ },
2059
+ {
2060
+ "type": "text",
2061
+ "text": "normalization cures this issue yielding [Slaughterhouse cases, Butcher, EoS]. and this is the strategy we opt for in all our experiments.",
2062
+ "bbox": [
2063
+ 507,
2064
+ 753,
2065
+ 882,
2066
+ 802
2067
+ ],
2068
+ "page_idx": 13
2069
+ },
2070
+ {
2071
+ "type": "text",
2072
+ "text": "A.6 Number of matching documents",
2073
+ "text_level": 1,
2074
+ "bbox": [
2075
+ 507,
2076
+ 816,
2077
+ 811,
2078
+ 832
2079
+ ],
2080
+ "page_idx": 13
2081
+ },
2082
+ {
2083
+ "type": "text",
2084
+ "text": "1P generated paths effectively narrow down the corpus, generally matching only a few documents in the corpus as illustrated in Figure 4. Note that a small fraction of paths match 0 documents due to pruning optimizations applied during inference",
2085
+ "bbox": [
2086
+ 507,
2087
+ 838,
2088
+ 880,
2089
+ 919
2090
+ ],
2091
+ "page_idx": 13
2092
+ },
2093
+ {
2094
+ "type": "page_number",
2095
+ "text": "14542",
2096
+ "bbox": [
2097
+ 477,
2098
+ 927,
2099
+ 524,
2100
+ 940
2101
+ ],
2102
+ "page_idx": 13
2103
+ },
2104
+ {
2105
+ "type": "text",
2106
+ "text": "time detailed in Appendix A.1.",
2107
+ "bbox": [
2108
+ 114,
2109
+ 85,
2110
+ 346,
2111
+ 99
2112
+ ],
2113
+ "page_idx": 14
2114
+ },
2115
+ {
2116
+ "type": "page_number",
2117
+ "text": "14543",
2118
+ "bbox": [
2119
+ 477,
2120
+ 928,
2121
+ 524,
2122
+ 940
2123
+ ],
2124
+ "page_idx": 14
2125
+ }
2126
+ ]
2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/ed6283a9-c47a-45be-a3e5-a228ad5db48e_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/ed6283a9-c47a-45be-a3e5-a228ad5db48e_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d3bbda581e133bce3116c1a53df4fc4a4a19cddab81e602bf459518802b97de
3
+ size 611969
2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/full.md ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1-PAGER: One Pass Answer Generation and Evidence Retrieval
2
+
3
+ Palak Jain<sup>1</sup> Livio Baldini Soares<sup>2</sup> Tom Kwiatkowski<sup>2</sup>
4
+
5
+ $^{1}$ Google Research $^{2}$ Google Deepmind
6
+
7
+ {palakj, liviobs, tomkwiat}@google.com
8
+
9
+ # Abstract
10
+
11
+ We present 1-PAGER the first system that answers a question and retrieves evidence using a single Transformer-based model and decoding process. 1-PAGER incrementally partitions the retrieval corpus using constrained decoding to select a document and answer string, and we show that this is competitive with comparable retrieve-and-read alternatives according to both retrieval and answer accuracy metrics. 1-PAGER also outperforms the equivalent 'closed-book' question answering model, by grounding predictions in an evidence corpus. While 1-PAGER is not yet on-par with more expensive systems that read many more documents before generating an answer, we argue that it provides an important step toward attributed generation by folding retrieval into the sequence-to-sequence paradigm that is currently dominant in NLP. We also show that the search paths used to partition the corpus are easy to read and understand, paving a way forward for interpretable neural retrieval.
12
+
13
+ # 1 Introduction
14
+
15
+ In recent times, there has been a push to reformulate a wide variety of tasks from NLP and other domains into the sequence-to-sequence paradigm, to make use of large pre-trained Transformer networks (Vaswani et al., 2017). However, despite evidence that large language models can often answer questions (Roberts et al., 2020), predict identifiers of documents that support those answers (Tay et al., 2022), or generate text that contains and explains an answer (Yu et al., 2022) the dominant paradigm in question answering is still the retrieve-and-read approach that pipelines separate retrieval and answer generation modules. This approach has the benefit that it can provide direct and targeted paragraph-level attribution for the generated answers (Bohnet et al., 2022). However, it also relies on a heterogenous mix of models that are hard to train in concert (Metzler et al., 2021).
16
+
17
+ ![](images/64c5c707b66c4d979c376511847a2f6ef5534751d30fb0db42801b4d3d7ac625.jpg)
18
+ Figure 1: Example 1P output that iteratively partitions the corpus into sub-sets containing the generated n-grams. The last n-gram is taken as the answer.
19
+
20
+ Motivated by the observation that language model decoders already perform search over possible sequences (Graves, 2012), and that evidence documents themselves are simply sequences of tokens, we present an alternative approach that relies on a single Transformer model. In this approach, which we name 1-PAGER (One Pass Answer Generation and Evidence Retrieval) or simply 1P, the decoder iteratively partitions a corpus of evidence documents by generating a search path consisting of a set of keywords that identify relevant documents and an answer string that is contained in at least one of these documents. With 1P, we aim to explore the spectrum between CBQA, where the answer is generated without reference to an evidence corpus, and pipelined approaches that feed retrieved documents into the transformer.
21
+
22
+ Figure 1 illustrates an example in which the corpus is iteratively partitioned into documents that contain the string 'Economy of India', then those that also contain the string 'Agriculture', and finally those that also contain the answer string '23%'.
23
+
24
+ 1P output sequences are guaranteed to match at least one document in the evidence corpus. This is enforced via a constrained decoder that has ac
25
+
26
+ cess to an FM-index representation of the evidence corpus contents (Ferragina and Manzini, 2000) and we evaluate 1P's ability to correctly answer open-domain questions while also retrieving passages that provide support for those answers (Bohnet et al., 2022). Since 1P is the first model that can do both of these tasks, we compare to pipelined systems that first retrieve a single passage and then generate an answer based on this evidence passage. 1P is competitive as a passage retriever, performing similarly to a widely used dense retriever (Karpukhin et al., 2020) and outperforming the SEAL system which independently generates keywords rather than a search path (Bevilacqua et al., 2022). 1P also outperforms an equivalent closed-book question answering (CBQA) model (Roberts et al., 2020) according to answer accuracy. Part of this improvement comes from the prediction of search paths themselves, reminiscent of chain-of-thought reasoning (Wei et al., 2022), and part is from 1P's constrained decoder, which forces the model to generate answers from passages that contain the keywords.
27
+
28
+ While 1P does not yet perform as well as the very best retrieval or open-domain question answering systems in terms of accuracy, the fact that it is competitive with pipelined systems that are trained with the same data and which use similar amounts of inference-time compute suggests a promising path ahead. Unlike those systems, 1P can be trained end-to-end along with any other task that fits into the sequence-to-sequence paradigm. Additionally, 1P search paths are inherently interpretable, unlike embeddings used in dense retrieval.
29
+
30
+ # 2 Related Work
31
+
32
+ "Retrieve-and-read" Question Answering Question answering approaches in NLP are dominated by the "retrieve-and-read" paradigm where a retriever first fetches hundreds of relevant documents from a corpus, followed by a language model that reranks and extracts the answer (Harabagiu et al., 2003; Chen et al., 2017; Zhu et al., 2021). Sparse retrievers such as BM25 (Robertson et al., 2009) build a high-dimensional lexical index over text corpus. Dense retrievers (Karpukhin et al., 2020) use a dual encoder architecture to embed the query and document and perform an approximate nearest neighbor search. Various modifications to dense retrieval have been proposed over the years includ
33
+
34
+ ing hard negative training (Xiong et al., 2020), late interaction (Khattab and Zaharia, 2020; Santhanam et al., 2022), few-shot learning (Izacard et al., 2022), joint retriever and reader training (Jiang et al., 2022).
35
+
36
+ A particular variant of interest is the Iterative Retrieval process where the query is reformulated incrementally (Das et al., 2019; Lee et al., 2022) leading to an interactive search process (Jiang et al., 2023; Adolphs et al., 2021). This query augmentation scheme has similarities with our use of search paths. However, we use the paths to iteratively partition the corpus while prior works have used it for refining the query.
37
+
38
+ To perform well, retrieve-and-read systems will typically retrieve 10s to 100s of passages that must be processed by a language model. In constraint, 1P retrieves and extracts an answer in a single pass of language model generation.
39
+
40
+ Closed Book Question Answering With data and parameter scale, LLMs in a closed-book setting (CBQA) have shown competitive performance (OpenAI, 2023; Anil et al., 2023; Yu et al., 2023) to retrieve pipelines (ODQA), however without producing any attributed passages (Rashkin et al., 2021; Bohnet et al., 2022). An extension of CBQA is post-hoc retrieval where a large language model LLM) is first used to generate an answer and then evidence for the question-answer pair is fetched by a retriever (Gao et al., 2023a; Bohnet et al., 2022). While post-hoc retrieval serves the same goal as 1P, it still uses a pipeline of LLM and retriever to do so.
41
+
42
+ Generative Retrieval Recently, generative retrieval has emerged as an alternative to the conventional "retrieve-and-read" pipeline (Metzler et al., 2021). Genre (De Cao et al., 2021) performed generative entity linking by constraining model's decoding to a set of entities. DSI (Tay et al., 2022) showed one of the first proof of LLM's ability to memorize docids in the corpus. However, atomic ids or hierarchical clusters, as used in DSI, are opaque identifiers and capture limited information. Works such as SEAL (Bevilacqua et al., 2022) and Ultron (Zhou et al., 2022) use a semantically richer representation: keywords in the document. In particular, SEAL constrains the generation to only keywords in the corpus using the FM-index (Ferragina and Manzini, 2000), a key data structure we borrow in this work.
43
+
44
+ ![](images/8dcfa0acd2a903129c9e6dbe6563a933e6f4602c2c9e926949dec9381190afc9.jpg)
45
+ Figure 2: System illustration of different QA systems. From left to right: CBQA, 1-PAGER, SEAL, Retrieve-and-Read system. $C$ denotes the retrieval corpus, $P$ a retrieved passage, $Q$ the input question and $A$ , the generated answer. 1P is closest to CBQA (only single model used) but it also outputs a passage retrieved from $C$ .
46
+
47
+ 1P represents docids as keyword paths, which are arguably more interpretable, and learns a soft partition over the corpus instead of the hard partition imposed by DSI's clustering.
48
+
49
+ Another crucial distinction is 1P's ability to both retrieve and generate an answer while prior works rely on a external re-ranker/reader for the same. A high-level view of various question-answering systems is presented in Figure 2.
50
+
51
+ Attributed Question Answering Standard metrics for open-domain question answering, such as exact match or token-based F1, have received criticism for being imprecise and/or insufficient. Several efforts have proposed augmenting answers with textual evidence, via retrieval or citations (Bohnet et al., 2022; Menick et al., 2022; Gao et al., 2023b). While this work does not directly evaluate the quality of retrieved answer evidence, our proposed model inherently produces a passage to support the final answer, along with a search path of keywords, which could be used to provide users with answer evidence.
52
+
53
+ # 3 Iterative Corpus Partitioning and Answer Prediction
54
+
55
+ We focus on the problem of learning a mapping $f(q, D) \to (a, d_a)$ from a question $q$ and corpus of documents $D$ to an answer and supporting document $(a, d_a)$ . The predicted document $d_a$ is retrieved from $D$ and the answer $a$ is a sub-string of $d_a$ . The document $d_a$ should be relevant to the question and provide evidence for answer.
56
+
57
+ The goal of this paper is to model the function $f$ using a single sequence-to-sequence model, rather than a pipeline which first retrieves $d_{a}$ and then feeds it into an answer generation module. To achieve our goal, we recast retrieval as an iterative corpus partitioning process illustrated in Figure 3.
58
+
59
+ Iterative corpus partitioning adopts the LM decoder's autoregressive search process to partition
60
+
61
+ $D$ by predicting n-gram keywords.
62
+
63
+ An n-gram of tokens $k$ is said to be contained in a document $d$ , denoted by $k \prec d$ , when $k$ is a sub-sequence of $d$ . We define a keyword corpus partitioning function
64
+
65
+ $$
66
+ \mathcal {F} (D, k) = \{d | k \prec d; d \in D \}
67
+ $$
68
+
69
+ that selects only those documents that contain $k$ . 1-PAGER iteratively partitions the corpus $D$ by generating a sequence of n-grams that we refer to as a Search Path $p_t = [k_1, k_2, \dots, k_t]$ . Each prefix of this search path defines a subset of $D$ via the search path corpus partitioning function
70
+
71
+ $$
72
+ \mathcal {P} (D, p _ {t}) = D _ {p _ {t}} = \{\cap_ {i \in [ 1, t ]} \mathcal {F} (D, k _ {i}) \}
73
+ $$
74
+
75
+ and each subsequent keyword $k_{t+1}$ narrows down $D_{p_t}$ into further sub-spaces such that $D_{p_{t+1}} \subseteq D_{p_t}$ .
76
+
77
+ Answer prediction is treated in exactly the same way as keyword selection and in 1P the last keyword from $p$ is taken as the answer.
78
+
79
+ # 4 Constrained Decoding and FM-Index
80
+
81
+ To avoid generating empty partitions, we constrain 1-PAGER to only decode search paths that match at least one document. We modify the decoder's beam-search strategy to only allow keyword continuations that are contained in the current partition.
82
+
83
+ Given a document subset $D_{p_i}$ , which could be the full corpus $D$ at the start of decoding $(i = 0)$ and a keyword prefix $k$ , which could be empty, the set of all valid continuation tokens is defined as,
84
+
85
+ $$
86
+ \mathcal {C} (k, D _ {p _ {i}}) = \{x | k \| x \prec d, d \in D _ {p _ {i}} \}
87
+ $$
88
+
89
+ where $x$ is any vocabulary token and $\| \cdot \|$ indicates concatenation of two token sequences. As a special case, when $k = \phi$ and $i = 0$ , all tokens in $D$ are valid continuations. 1P separates keywords in $p_T$ with a special separator token $\rightarrow$ and marks the end of the sequence with an EOS token. These two tokens are always valid continuations.
90
+
91
+ ![](images/ee9b1d9383128dc9e50e582c09f5501209e0eb4fb1f761fd7f474a4bf66331d8.jpg)
92
+ Figure 3: Illustration of the 1P decoding process. A keyword can only be generated from the documents matching previously generated keywords. Right panel shows a magnified view of applying constraints to a decoding step. Any keyword not present in the documents is masked out.
93
+
94
+ Consider Figure 3. The three keywords correspond to the decoded token sequence [Ten, Commandments, $\rightarrow$ , twice, in, the, Hebrew, Bible, $\rightarrow$ , books, of, Exodus, EOS]. At the start of decoding, any token in $D$ is allowed. After decoding Ten, only those tokens that follow Ten as an n-gram in $D$ are allowed, along with the default separators. After decoding [Ten, Commandments, $\rightarrow$ ] we are ready to start a new keyword, but only tokens from documents that contain the keyword Ten Commandments are allowed. Decoding continues in this manner until EOS is generated.
95
+
96
+ To efficiently implement these constraints, we need a data-structure that can quickly determine both $\mathcal{C}(k,D_p)$ , the continuation tokens given a document set and $\mathcal{P}(D_p,k)$ , the subset of documents that contain a given path.
97
+
98
+ For this, we extend the usage of an FM-index (Ferragina and Manzini, 2000) as described in (Bevilacqua et al., 2022). The FM-index is a compressed token-based index over a corpus $D_0$ with a few important properties for our usage: (1) it can efficiently list possible token continuations for a sequence prefix that occur in $D_0$ i.e., $\mathcal{C}(k,D_0)$ , (2) it can list the set of documents in the corpus that match an n-gram i.e., $\mathcal{F}(D_0,k)$ , and (3) it supports search over arbitrary n-grams that occur within documents. Note that the FM-index operations are optimized for $D_0$ , the original corpus it is built over. We extend these to an arbitrary $D_p \subset D_0$ at additional cost described in Appendix A.1.
99
+
100
+ # 5 Training data generation
101
+
102
+ For training 1P, we produce a dataset with examples of queries and search paths as described above. At a high-level, we generate search paths by iteratively selecting n-grams from an answer passage, and simulating, using the FM-Index of the retrieval corpus, the partitioning of the corpus after selecting each keyword, until only a few documents remain. Finally, the answer span $a$ is appended to the search path. Each example produced can be serialized as sequence-to-sequence pair of inputs and targets as:
103
+
104
+ inputs: Generate keywords for: $<q>$ ?
105
+
106
+ targets: K_SEP $k_{0}$ K_SEP $k_{1}$ ... K_SEP A_SEP a EOS
107
+
108
+ # 5.1 Keyword Selection
109
+
110
+ A good keyword should have a) high relevance to the query and b) effectively narrow down the search space. To identify relevant keywords, we restrict to only the gold document $g$ . All ngrams in $g$ of length up to five are extracted. Irrelevant keywords are filtered out such as those starting or ending with stop words. Similarly, keywords that are too rare in the corpus, e.g., "Philippines at Luzon" or too frequent, e.g., "part" are excluded based on a threshold on their count in corpus. The remaining keywords are scored with a combinations of heuristics, mainly Rouge-1 similarity with the query (Lin, 2004) along with minor award for keywords containing entities and penalty for keywords highly frequent in the corpus.
111
+
112
+ This scoring mechanism often misses out on keywords that are semantically relevant, but do not lexically overlap with the query. To boost the relevance of our keyword set, we re-score the top hundred keywords using a language model. A T5-XXL model is finetuned with the input as the query $q$ and target as either the title or a heuristically sampled keyword in a similar fashion to Bevilacqua et al. (2022). The heuristically sampled keywords are re-scored using this model to obtain a refined LM-scored set. Two other special types of keywords are awarded high scores: Title of the gold passage and the keyword containing the answer string $a$ .
113
+
114
+ # 5.2 Search Paths
115
+
116
+ The first keyword in a search path needs to effectively partition the corpus. We experiment with either the title or the highest scored keyword from the gold passage as the first keyword in the path. The next keywords are sampled based on their score, given they do not overlap with any of the existing keywords in the path. We continue augmenting a path $p$ with keywords until at most ten passages in the corpus match i.e., $|D_p| < 10$ . The answer keyword is then appended to the path. Our train paths (including the answer) contain a median of three keywords and one matching document.
117
+
118
+ # 6 Experimental Setup
119
+
120
+ # 6.1 Datasets
121
+
122
+ We use Open-NQ (Kwiatkowski et al., 2019; Lee et al., 2019) as the question-answering dataset for training. For evaluation, besides Open-NQ, WebQuestions (Berant et al., 2013) and CuratedTREC (Baudiš and Šedivý, 2015) are used to measure out-of-domain performance. The FM-Index corpus for constrained decoding is built over DPR Wikipedia corpus with 100-word splits (Karpukhin et al., 2020). The positive gold passages from DPR are used for sampling training paths. This setup is chosen to mirror SEAL and also permits fair comparison against DPR.
123
+
124
+ # 6.2 Training
125
+
126
+ 1P's training dataset contains 310k paths corresponding to 55k queries from Open-NQ. Majority of the training paths begin with the title, with a small fraction starting with other keywords (12%). All keywords, except the title, are scored using the LM-scoring technique described above.
127
+
128
+ For our experiments, we use the T5X (Roberts et al., 2022) framework. A T5-XXL $1.1^{1}$ (Raffel et al., 2020) model is finetuned with a batch size of 256 and dropout of 0.1. No additional hyperparameter tuning is performed. We format search paths using the reserved tokens $\mathsf{K\_SEP} = "$ <extra_id_0>" and $\mathsf{A\_SEP} = "$ <extra_id_1>".
129
+
130
+ # 6.3 Inference
131
+
132
+ Our best model employs beam decoding with a beam of 5. Even when the beam is greater than one, only the top-beam result is used for retrieval. We discuss the effect of beam size in depth in Section 7. Given the top generated path $p$ , $D_{p}$ corresponds to the retrieved documents. In case $|D_{p}| > 1$ , a document is sampled arbitrarily for evaluation.
133
+
134
+ # 6.4Baselines
135
+
136
+ We compare to a closed-book question answering (CBQA) system that generates answers, but does not ground these in an evidence corpus, as well as retrieve-and-read systems that combine a variety of retrievers with a Transformer-based answerer module. Both the CBQA baseline and the answerer module are derived from the same T5-XXL 1.1 pretrained model as 1P.
137
+
138
+ # 6.4.1 T5-CBQA
139
+
140
+ A T5-XXL 1.1 model is fine-tuned to predict answers from the DPR training set for 10,000 steps with a batch size of 128. Note that it is possible to achieve a higher closed-book performance on NQ using the full Open-NQ training split instead of the subset included in the DPR training set (Roberts et al., 2020). However, to enable meaningful comparison we restrict the CBQA baseline to the same training examples used to train 1P.
141
+
142
+ # 6.4.2 Retrieve-and-Read
143
+
144
+ The retrieve-and-read baselines first retrieve a single passage from the evidence corpus, and then feed this passage and the question into the answer generation module<sup>2</sup>. We report retrieval accuracy for the retrieved passage and answer accuracy for the generated answer.
145
+
146
+ T5-Reader We tune a T5-XXL 1.1 model to generate answers from (question, evidence passage)
147
+
148
+ pairs. This is the same base model used by 1P and we train on the (question, passage, answer) triples in the DPR training split to ensure fair comparison.
149
+
150
+ DPR-Retriever We compare against vanilla DPR finetuned on NQ without hard negatives (Karpukhin et al., 2020) using the pre-computed index available on DPR's repository<sup>3</sup>. We note that our ODQA setup differs from the one used by Karpukhin et al. in that we choose the highest scoring retrieval as evidence for answer generation, instead of generating from the top-100 passages without attribution.
151
+
152
+ BM25-Retriever We use Pyserini toolkit (Lin et al., 2021) with default configurations, retrieving the top-1 passage.
153
+
154
+ SEAL-Retriever SEAL (Bevilacqua et al., 2022) is a generative retrieval system that generates a set of keywords constrained on the corpus. In terms of technique, 1P borrows inspiration from SEAL's use of the FM-Index as well as keywords-as-identifiers. However, the two setups have substantial differences that we highlight in Section 8. We run SEAL with its default configuration and a beam of 5 using the publicly released checkpoint based on Bart-large (Lewis et al., 2020). All outputs from the beam are used for retrieval.
155
+
156
+ # 6.5 Evaluation
157
+
158
+ We evaluate in-domain performance on the OpenNQ test split and out-of-domain performance on WebQuestions (WQ) and CuratedTREC (TREC) following the setup from Karpukhin et al. (2020). Passage retrieval performance is measured with Hits@1 using Pyserini evaluation scripts<sup>4</sup>.
159
+
160
+ # 6.6 1P configurations
161
+
162
+ We experiment with three configurations: a) 1P: Our primary setup that uses both training and constrained decoding procedures described above, producing a retrieved passage as well as an answer. b) 1P-Unconstrained: Only the training technique described in Section 5 is adopted, with standard unconstrained decoding. Since generation is unconstrained, it is possible that no passage gets retrieved for a given path. c) $1\mathrm{P} +$ Reader: Here, we take the top retrieved passage from 1P and input it to the Reader model (Section 6.4) to extract the answer.
163
+
164
+ # 7 Results
165
+
166
+ <table><tr><td rowspan="2">Retriever</td><td rowspan="2">Answerer</td><td rowspan="2">Retrieval Hits @ 1</td><td colspan="2">Answer</td></tr><tr><td>EM</td><td>F1</td></tr><tr><td>-</td><td>T5 - CBQA</td><td>-</td><td>26.8</td><td>34.0</td></tr><tr><td>BM25</td><td>T5 - Reader</td><td>23.6</td><td>17.9</td><td>24.0</td></tr><tr><td>SEAL</td><td>T5 - Reader</td><td>37.9</td><td>29.4</td><td>35.8</td></tr><tr><td>DPR</td><td>T5 - Reader</td><td>46.5</td><td>35.6</td><td>42.4</td></tr><tr><td>1P</td><td>T5 - Reader</td><td>46.3</td><td>34.2</td><td>41.4</td></tr><tr><td colspan="2">1P - Unconstrained</td><td>29.3</td><td>29.3</td><td>36.1</td></tr><tr><td colspan="2">1P</td><td>46.3</td><td>31.7</td><td>38.0</td></tr></table>
167
+
168
+ Table 1: Comparison of different Retriever and Answerer combinations on the NQ-Open test set. In retrieve-and-read setups, answers are generated from the top-1 retrieved passage. 1P combines passage retrieval and answer generation in a single prediction.
169
+
170
+ <table><tr><td rowspan="2">System</td><td colspan="2">WebQuestions</td><td colspan="2">TREC</td></tr><tr><td>Hits @1</td><td>EM</td><td>Hits @1</td><td>EM</td></tr><tr><td>BM25 + Rdr</td><td>19.7</td><td>14.2</td><td>35.2</td><td>29.1</td></tr><tr><td>DPR + Rdr</td><td>32.0</td><td>17.3</td><td>51.6</td><td>35.0</td></tr><tr><td>1P + Rdr</td><td>38.0</td><td>20.4</td><td>63.8</td><td>38.5</td></tr><tr><td>1P</td><td>38.0</td><td>20.5</td><td>63.8</td><td>36.4</td></tr></table>
171
+
172
+ Table 2: Comparison of different Retriever and Answerer combinations on Out-of-domain datasets. Both the Retriever and Answerer (Rdr) are trained on only Open-NQ. In retrieve-and-read setups, answers are generated from the top-1 retrieved passage.
173
+
174
+ We compare to the baselines described in Section 6.4 on Open-NQ using both retrieval and answer accuracy metrics in Table 1. Answers are generated based on the top retrieved document in systems that separate retrieval from answer generation, to provide a clean comparison between systems that return (answer, evidence passage) pairs. Table 2 reports the out-of-domain performance of various systems on WQ and TREC.
175
+
176
+ 1P outperforms CBQA in question answering and beats the retrieve-and-read systems, BM25 and SEAL. On the passage retrieval task, it significantly improves over BM25 and SEAL. For indomain setting, 1P is competitive with DPR on retrieval task, but lags behind the QA pipeline that uses DPR. However, this appears to be more due to the reader rather than the retriever as discussed in Section 8. It is worth noting that 1P general
177
+
178
+ izes significantly better out-of-domain compared to other systems.
179
+
180
+ Utility of Search Paths 1P-Unconstrained can be viewed as an extended version of CBQA that generates a search path before predicting the answer. Thus, improvement of 1P-Unconstrained over CBQA can be attributed to this path-conditioned answer generation process, analogous to chain-of-thought reasoning (Wei et al., 2022; Lampinen et al., 2022).
181
+
182
+ <table><tr><td rowspan="2">System</td><td rowspan="2">Constrained Decoding</td><td colspan="2">Beam</td></tr><tr><td>1</td><td>5</td></tr><tr><td>CBQA</td><td>No</td><td>26.7</td><td>26.8</td></tr><tr><td>1P Unconst.</td><td>No</td><td>29.0</td><td>29.3</td></tr><tr><td>SEAL + Reader</td><td>Yes</td><td>28.5</td><td>29.4</td></tr><tr><td>1P</td><td>Yes</td><td>28.7</td><td>31.7</td></tr></table>
183
+
184
+ Effect of Constrained Decoding The purpose of constrained decoding is to ground the answer in an evidence retrieved from the corpus. As expected, the constrained setup enables 1P to achieve a higher Hits@1 than 1P-unconstrained. Surprisingly, when decoding with a beam of one, we observe a small drop in answer accuracy for 1P compared to 1P-Unconstrained (Table 3). Inspecting the losses, two dominant reasons surface. Firstly, As DPR passages are chunked into 100-words (Karpukhin et al., 2020), some queries may become unanswerable given a single passage due to missing context. This is disadvantageous when the model has memorized the answer but there is no single passage to attribute it to.
185
+
186
+ Secondly, during constrained decoding, after generating the initial keywords, the search space may soon become sparse with no good candidates to pick from. Could a larger room for planning its actions help the model here? Indeed, increasing the beam size to 5 improves performance by $3\%$ (Table 3), even when only the top-beam is used for retrieval. We refer to this as Planning, since the larger beam only enables the model to plan better and the remaining beam outputs are otherwise dis
187
+
188
+ carded. Note that unconstrained decoding does not gain from planning. In the final setup in Table 1, we use a beam of 5 for both 1P and SEAL. Unlike 1P, SEAL uses all the outputs from the larger beam for retrieval.
189
+
190
+ # 8 Discussion and Ablations
191
+
192
+ Generating Answers While 1P is capable of generating answers, Table 1 highlights that it falls behind the 1P+Reader. The reason seems to be clear: the Reader has visibility into the full passage context while 1P is limited to the decoded search path and the constrained index which only ensures that generations are grounded in the corpus. Since 1P does retrieve passages, it would be possible to pull in the corresponding text as input for answer generation. We leave this as future work.
193
+
194
+ Comparison to SEAL While 1P takes inspiration from SEAL, in practice, there are a few key differences between the two systems aside from 1P's answer generation.
195
+
196
+ SEAL generates a large set of keywords (Table 4) using many separate decodes and heuristic guidance (Appendix A.3). In contrast, 1P decodes a single sequence of about three keywords.
197
+
198
+ Table 3: EM for various decoding setups with different beam sizes on Open-NQ. Only top-beam result is used for evaluation, except in SEAL which uses all beam outputs. 1P constrained decoding benefits the most from a large beam whereas Unconstrained setups have only a slight effect.
199
+
200
+ <table><tr><td></td><td>SEAL</td><td>1P</td></tr><tr><td>Median keywords</td><td>32</td><td>3</td></tr><tr><td>Median docs retrieved</td><td>500</td><td>1</td></tr><tr><td>Generates answer</td><td>×</td><td>✓</td></tr></table>
201
+
202
+ Table 4: Key differences between SEAL and 1P measured over Open-NQ test split with a beam of 1.
203
+
204
+ The SEAL keywords are a set, decoded independently of each other and re-scored using sophisticated techniques to retrieve a large number of documents. For instance, the default configuration in SEAL retrieves up to 500 documents. This makes SEAL suitable to be employed in conjunction with a re-ranker. In contrast, 1P search path's map directly to a single (or few) relevant documents (Appendix A.6).
205
+
206
+ We acknowledge the model-size variation between SEAL and 1P in the reported experiments, however we preferred using the publicly available SEAL checkpoint. Given the discrepancies with larger beam-size, multiple decodes and use of Reader model, it is difficult to have an apples to apples comparison between the two systems.
207
+
208
+ Path vs Keyword set We qualitatively observe that keywords in a 1P path, owing to sequential generation, are distinct and add new information as compared to the SEAL output set where overlapping keywords are common (Appendix A.3). Thus, paths are advantageous for precisely narrowing down to a single relevant document while keyword sets are effective for retrieving a large number of documents that can later be reranked. This is corroborated by the fact that 1P is better at Hits@1 while SEAL is better at Hits@5 (Appendix A.4).
209
+
210
+ Qualitative Analysis Table 5 illustrates patterns of Search Paths generated by 1P. We note some of the common path patterns here:
211
+
212
+ 1) First keywords are entities in the query, followed by query predicates that iteratively narrow down towards an answer. This is the most common type of path observed and can be attributed to the dominant presence of title in the training data.
213
+ 2) Rewrites of the original query or related predicates such as "seasons consists of", "appeared on ...". Such paths are more prevalent where there is no canonical entity in the query or no entity can be determined with high confidence.
214
+ 3) Answer is directly generated followed by supporting keywords that guide towards an attributed passage. This happens in a small fraction of cases, likely where the pretrained model has memorized an answer with high confidence.
215
+
216
+ Overall, we find the generated search paths to be fairly meaningful and interpretable.
217
+
218
+ Sampling Search Paths for Training Table 6 highlights that high quality keywords are crucial to performance. The LM re-scored set of keywords result in significant accuracy gain over heuristically sampled keywords. Paths with first keyword as Title boost performance further. Mixing in a small fraction of paths starting with non-title keywords encourages the model to generate predicates where no entity can be determined, giving us the best results.
219
+
220
+ Sensitivity to tokenization We find that constrained decoding is highly sensitive to rare tokenization or punctuation formatting in the corpus. Consider the query "who sang i ran all the way home" with the gold document title "Sorry (I Ran All the Way Home)". In the unconstrained setup, the model's top prediction starts with "I Ran All the Way Home". However, "(I" is tokenized differently from "I" and searching over the FM-Index
221
+
222
+ returns no match. As a result, constrained decoding drops the predicted keyword altogether, resorting to lower ranked keywords in the beam. We partially fix the issue by modifying the answer in a fraction of the training data to include surrounding punctuation tokens based on how they appear in the FM-index. For instance, the keyword "I Ran ..." would update to "(I Ran ...)". This simple change leads to a jump in answer accuracy from $26.4\%$ to $28.7\%$ . However, much more work is needed to make 1P robust to variations in tokenization.
223
+
224
+ See Appendix A.2 for analysis of training data size and Appendix A.5 for masking logits vs log-probs.
225
+
226
+ # Conclusion
227
+
228
+ We introduce 1-PAGER, the first system to perform question answering and passage retrieval in one pass with a single language model, using a constrained decoder to iteratively partition the retrieval corpus and then generate an answer. We show competitive or improved performance over a variety of comparable baselines and carefully analyze the results, ablating both training strategies and decoding style. We also provide a qualitative analysis of predictions to illustrate the system's capabilities. Challenges with constrained decoding are surfaced including poor search spaces and sensitivity to tokenization and mitigation strategies are presented.
229
+
230
+ We hope that 1P adds value in demonstrating how a single transformer model can be harnessed to do both retrieval and answering and pave the path for further progress in the generative retrieval domain.
231
+
232
+ # Limitations
233
+
234
+ 1P is geared towards identifying a concise, small set of documents and generating answer in a single go. While this makes the architecture simpler, it also adds certain weaknesses. 1P is not effective for retrieving a large number of documents and falls behind pipelined systems that combine retrieval with re-ranking. Even for a single passage, it lags behind state-of-the-art dense-retrieval techniques. 1P's method of answer generation is also not competitive with the use of a reader, due to lack of passage context.
235
+
236
+ Our training strategy relies heavily on titles or entities and it's generalization on corpora without rich structure or on queries without central entities, remains to be studied.
237
+
238
+ <table><tr><td colspan="2">Query (Q) and Generated Search Path (SP)</td><td>Comment</td></tr><tr><td colspan="3">Correctly attributed passages and answers</td></tr><tr><td colspan="2">Q: how many episodes of greys anatomy season 14
239
+ SP: Grey&#x27;s Anatomy (season 14) » season consists of 24 episodes » 24</td><td>Query entity resolved first, followed by query predicates</td></tr><tr><td colspan="2">Q: when did they start adding zinc to pennies
240
+ SP: Penny (United States coin) » zinc » Lincoln cent » 1943</td><td>Query entity resolved iteratively</td></tr><tr><td colspan="2">Q: who was executed for being an american spy during the revolutionary war
241
+ SP: Nathan Hale » Army during the American Revolutionary » Nathan Hale</td><td>Answer generated first</td></tr><tr><td colspan="2">Q: who was the grandfather on the Cosby show
242
+ SP: appeared on &quot;The Cosby » Earle Hyman</td><td>Query rewrites</td></tr><tr><td colspan="3">Incorrect Passage or Answer</td></tr><tr><td>Q: who decides the number of judges in the high court
243
+ SP: judge is appointed » High Court » Chief Justice of India</td><td>A: President of India</td><td>Path correctly resolved,
244
+ Failed on answer</td></tr><tr><td>Q: when did the isle of wight become an island
245
+ Isle of Wight » 1890 » 1890</td><td>A: During the last Ice Age</td><td>Query entity resolved,
246
+ Failed on supporting keywords</td></tr><tr><td>Q: love yourself by justin bieber is about who
247
+ SP: Love Yourself: Her » music video » Her</td><td>A: Rihana</td><td>Failed to resolve
248
+ query entity</td></tr></table>
249
+
250
+ Table 5: Example 1P Search Paths (SP) on Open-NQ test set. The last keyword in SP is the predicted answer. Gold answers are indicated by A.
251
+
252
+ <table><tr><td>Search Path</td><td>Hits@1</td><td>EM</td></tr><tr><td>Heuristic</td><td>34.5</td><td>22.6</td></tr><tr><td>LM-scored</td><td>40.0</td><td>27.2</td></tr><tr><td>Title » LM-scored</td><td>41.9</td><td>28.0</td></tr><tr><td>Title » LM-scored + LM-scored (7+1)</td><td>42.9</td><td>28.7</td></tr></table>
253
+
254
+ Table 6: Comparison of Training Search Paths on OpenNQ. Here LM-scored denotes re-scoring by LM on a heuristic set. All results are with a beam of one. "»" indicates keyword separator and "+" mixture of path types in the give ratio.
255
+
256
+ Constrained decoding also comes with its own challenges. Constrained beam outputs often lack diversity, so that even with a larger beam one may still end up in poor search spaces. Computing document-level constraints across the corpus is expensive as it may require scanning a large number of rows in the index. Further, communication between FM-Index and Transformer model slows down inference.
257
+
258
+ # Acknowledgement
259
+
260
+ We thank Don Metzler, Nicholas FitzGerald, Partha Talukdar, Srini Narayanan, as well as our anonymous reviewers, for their thoughtful comments and valuable feedback
261
+
262
+ # Ethical Considerations
263
+
264
+ While Large Language Models can solve a wide range of tasks effectively, they also suffer from biases across axis such as gender, race, region (Chan, 2023). LLMs are also prone to generating toxic content, especially when probed about it. Although, our task grounds the model's generations on a corpus, some of the biases in pre-trained LLMs, may seep in 1-PAGER.
265
+
266
+ Building the FM-index and constrained decoding is a compute-intensive affair. We have experimented over a single dataset, Natural Questions, involving only knowledge-seeking queries, and single model family, T5. It is possible that some of our findings may not hold over other datasets or model families. Finally, our experiments are limited to English corpus and queries. The proposed approaches are resource-intensive and may not be accessible or valid for several low-resourced languages.
267
+
268
+ # References
269
+
270
+ Leonard Adolphs, Benjamin Boerschinger, Christian Buck, Michelle Chen Huebscher, Massimiliano Ciaramita, Lasse Espeholt, Thomas Hofmann, Yannic Kilcher, Sascha Rothe, Pier Giuseppe Sessa, et al. 2021. Boosting search engines with interactive agents. arXiv preprint arXiv:2109.00527.
271
+
272
+ Rohan Anil, Andrew M Dai, Orhan Firat, Melvin Johnson, Dmitry Lepikhin, Alexandre Passos, Siamak
273
+
274
+ Shakeri, Emanuel Taropa, Paige Bailey, Zhifeng Chen, et al. 2023. Palm 2 technical report. arXiv preprint arXiv:2305.10403.
275
+ Petr Baudis and Jan Šedivý. 2015. Modeling of the question answering task in the yodaqa system. In Experimental IR Meets Multilinguality, Multimodality, and Interaction: 6th International Conference of the CLEF Association, CLEF'15, Toulouse, France, September 8-11, 2015, Proceedings 6, pages 222-228. Springer.
276
+ Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on freebase from question-answer pairs. In Proceedings of the 2013 conference on empirical methods in natural language processing, pages 1533-1544.
277
+ Michele Bevilacqua, Giuseppe Ottaviano, Patrick Lewis, Wen tau Yih, Sebastian Riedel, and Fabio Petroni. 2022. Autoregressive search engines: Generating substrings as document identifiers. In arXiv pre-print 2204.10628.
278
+ Bernd Bohnet, Vinh Q Tran, Pat Verga, Roee Aharoni, Daniel Andor, Livio Baldini Soares, Jacob Eisenstein, Kuzman Ganchev, Jonathan Herzig, Kai Hui, et al. 2022. Attributed question answering: Evaluation and modeling for attributed large language models. arXiv preprint arXiv:2212.08037.
279
+ Anastasia Chan. 2023. Gpt-3 and instructgpt: technological dystopianism, utopianism, and "contextual" perspectives in ai ethics and industry. AI and Ethics, 3(1):53-64.
280
+ Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. 2017. Reading wikipedia to answer open-domain questions. arXiv preprint arXiv:1704.00051.
281
+ Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, and Andrew McCallum. 2019. Multi-step retriever-reader interaction for scalable open-domain question answering. In International Conference on Learning Representations.
282
+ Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. 2021. Autoregressive entity retrieval. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net.
283
+ P. Ferragina and G. Manzini. 2000. Opportunistic data structures with applications. In Proceedings 41st Annual Symposium on Foundations of Computer Science, pages 390-398.
284
+ 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. 2023a. Rarr: Researching and revising what language models say, using language models.
285
+
286
+ Tianyu Gao, Howard Yen, Jiatong Yu, and Danqi Chen. 2023b. Enabling large language models to generate text with citations.
287
+ Alex Graves. 2012. Sequence transduction with recurrent neural networks.
288
+ Sanda M Harabagiu, Steven J Maiorano, and Marius A Pasca. 2003. Open-domain textual question answering techniques. Natural Language Engineering, 9(3):231-267.
289
+ Gautier Izacard, Patrick Lewis, Maria Lomeli, Lucas Hosseini, Fabio Petroni, Timo Schick, Jane Dwivedi-Yu, Armand Joulin, Sebastian Riedel, and Edouard Grave. 2022. Few-shot Learning with Retrieval Augmented Language Models.
290
+ Zhengbao Jiang, Luyu Gao, Jun Araki, Haibo Ding, Zhiruo Wang, Jamie Callan, and Graham Neubig. 2022. Retrieval as attention: End-to-end learning of retrieval and reading within a single transformer. arXiv preprint arXiv:2212.02027.
291
+ Zhengbao Jiang, Frank F Xu, Luyu Gao, Zhiqing Sun, Qian Liu, Jane Dwivedi-Yu, Yiming Yang, Jamie Callan, and Graham Neubig. 2023. Active retrieval augmented generation. arXiv preprint arXiv:2305.06983.
292
+ Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6769-6781, Online. Association for Computational Linguistics.
293
+ Omar Khattab and Matei Zaharia. 2020. Colbert: Efficient and effective passage search via contextualized late interaction over bert. In Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval, pages 39-48.
294
+ Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Matthew Kelcey, Jacob Devlin, Kenton Lee, Kristina N. Toutanova, Llion Jones, Ming-Wei Chang, Andrew Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: a benchmark for question answering research. Transactions of the Association of Computational Linguistics.
295
+ Andrew K Lampinen, Ishita Dasgupta, Stephanie CY Chan, Kory Matthewson, Michael Henry Tessler, Antonia Creswell, James L McClelland, Jane X Wang, and Felix Hill. 2022. Can language models learn from explanations in context? arXiv preprint arXiv:2204.02329.
296
+
297
+ Hyunjii Lee, Sohee Yang, Hanseok Oh, and Minjoon Seo. 2022. Generative multi-hop retrieval. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 1417-1436.
298
+ Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6086–6096, Florence, Italy. Association for Computational Linguistics.
299
+ Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871-7880, Online. Association for Computational Linguistics.
300
+ Patrick Lewis, Yuxiang Wu, Linqing Liu, Pasquale Minervini, Heinrich Kuttler, Aleksandra Piktus, Pontus Stenetorp, and Sebastian Riedel. 2021. Paq: 65 million probably-asked questions and what you can do with them.
301
+ Chin-Yew Lin. 2004. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pages 74-81.
302
+ Jimmy Lin, Xueguang Ma, Sheng-Chieh Lin, Jheng-Hong Yang, Ronak Pradeep, and Rodrigo Nogueira. 2021. Pyserini: An easy-to-use python toolkit to support replicable in research with sparse and dense representations. arXiv preprint arXiv:2102.10073.
303
+ Jacob Menick, Maja Trebacz, Vladimir Mikulik, John Aslanides, Francis Song, Martin Chadwick, Mia Glaese, Susannah Young, Lucy Campbell-Gillingham, Geoffrey Irving, and Nat McAleese. 2022. Teaching language models to support answers with verified quotes.
304
+ Donald Metzler, Yi Tay, Dara Bahri, and Marc Najork. 2021. Rethinking search: making domain experts out of dilettantes. ACM SIGIR Forum, 55(1):1-27.
305
+ OpenAI. 2023. Gpt-4 technical report.
306
+ Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1-67.
307
+ Hannah Rashkin, Vitaly Nikolaev, Matthew Lamm, Lora Aroyo, Michael Collins, Dipanjan Das, Slav Petrov, Gaurav Singh Tomar, Iulia Turc, and David Reitter. 2021. Measuring attribution in natural language generation models. arXiv preprint arXiv:2112.12870.
308
+
309
+ Adam Roberts, Hyung Won Chung, Anselm Levskaya, Gaurav Mishra, James Bradbury, Daniel Andor, Sharan Narang, Brian Lester, Colin Gaffney, Afroz Mohiuddin, Curtis Hawthorne, Aitor Lewkowycz, Alex Salcianu, Marc van Zee, Jacob Austin, Sebastian Goodman, Livio Baldini Soares, Haitang Hu, Sasha Tsvyashchenko, Aankanksha Chowdhery, Jasmijn Bastings, Jannis Bulian, Xavier Garcia, Jianmo Ni, Andrew Chen, Kathleen Kenealy, Jonathan H. Clark, Stephan Lee, Dan Garrette, James Lee-Thorp, Colin Raffel, Noam Shazeer, Marvin Ritter, Maarten Bosma, Alexandre Passos, Jeremy Maitin-Shepard, Noah Fiedel, Mark Omernick, Brennan Saeta, Ryan Sepassi, Alexander Spiridonov, Joshua Newlan, and Andrea Gesmundo. 2022. Scaling up models and data with t5x and seqio.
310
+ Adam Roberts, Colin Raffel, and Noam Shazeer. 2020. How much knowledge can you pack into the parameters of a language model? arXiv preprint arXiv:2002.08910.
311
+ Stephen Robertson, Hugo Zaragoza, et al. 2009. The probabilistic relevance framework: Bm25 and beyond. Foundations and Trends® in Information Retrieval, 3(4):333-389.
312
+ Keshav Santhanam, Omar Khattab, Jon Saad-Falcon, Christopher Potts, and Matei Zaharia. 2022. Colbertv2: Effective and efficient retrieval via lightweight late interaction.
313
+ Yi Tay, Vinh Tran, Mostafa Dehghani, Jianmo Ni, Dara Bahri, Harsh Mehta, Zhen Qin, Kai Hui, Zhe Zhao, Jai Gupta, et al. 2022. Transformer memory as a differentiable search index. Advances in Neural Information Processing Systems, 35:21831-21843.
314
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30.
315
+ Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. 2022. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903.
316
+ Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul Bennett, Junaid Ahmed, and Arnold Overwijk. 2020. Approximate nearest neighbor negative contrastive learning for dense text retrieval. arXiv preprint arXiv:2007.00808.
317
+ Wenhao Yu, Dan Iter, Shuohang Wang, Yichong Xu, Mingxuan Ju, Soumya Sanyal, Chenguang Zhu, Michael Zeng, and Meng Jiang. 2022. Generate rather than retrieve: Large language models are strong context generators. arXiv preprint arXiv:2209.10063.
318
+ Wenhao Yu, Dan Iter, Shuohang Wang, Yichong Xu, Mingxuan Ju, Soumya Sanyal, Chenguang Zhu, Michael Zeng, and Meng Jiang. 2023. Generate
319
+
320
+ rather than retrieve: Large language models are strong context generators. In The Eleventh International Conference on Learning Representations.
321
+ Yujia Zhou, Jing Yao, Zhicheng Dou, Ledell Wu, Peitan Zhang, and Ji-Rong Wen. 2022. Ultron: An ultimate retriever on corpus with a model-based indexer. arXiv preprint arXiv:2208.09257.
322
+ Fengbin Zhu, Wenqiang Lei, Chao Wang, Jianming Zheng, Soujanya Poria, and Tat-Seng Chua. 2021. Retrieving and reading: A comprehensive survey on open-domain question answering.
323
+
324
+ # A Appendix
325
+
326
+ # A.1 Constrain Computation
327
+
328
+ 1P relies on two key operations for constrain computation:
329
+
330
+ a) $\mathcal{F}(D,k)$ : Documents that contain keyword $k$
331
+ b) $\mathcal{C}(k,D)$ : Next tokens for keyword $k$ in arbitrary document set $D$
332
+
333
+ $\mathcal{F}(D,k)$ is preprocessed and cached to allow for quick computation. $\mathcal{C}(k,D)$ is trickier to compute. When $D$ represents the full corpus, FM-index can fetch the next tokens in $O(|V| \log(|V|))$ , where $V$ is the token vocabulary and independent of $|D|$ . However, arbitrary $D$ requires a traversal over all documents and can be very expensive. In practise, the LLM training guides it to generate effective keywords such that $|D|$ is small.
334
+
335
+ We also apply certain other optimizations to reduce the compute cost:
336
+
337
+ - Constrains are computed lazily over a decoding pass.
338
+ - Several computations are cached, eg: keyword to document id mapping
339
+ - To cap the cost of constraints at each decoding step, we allow for unconstrained generation in rare scenarios, when the estimated cost is too high. If the generated path is absent in the corpus ( $< 1\%$ examples), these can be filtered out later.
340
+
341
+ Despite these optimizations, inference continues to be expensive and we perhaps need a special data structure for next token look-up.
342
+
343
+ # A.2 Training data size
344
+
345
+ <table><tr><td>Dataset</td><td>Queries</td><td>Paths</td><td>Hits@1</td><td>EM</td></tr><tr><td>Open-NQ</td><td>55k</td><td>55k</td><td>41.9</td><td>28.1</td></tr><tr><td>Open-NQ</td><td>55k</td><td>310k</td><td>42.9</td><td>28.7</td></tr><tr><td rowspan="2">Open-NQ + PAQ</td><td>55k</td><td>310k</td><td rowspan="2">43.6</td><td rowspan="2">29.5</td></tr><tr><td>+ 9M</td><td>+ 9M</td></tr></table>
346
+
347
+ Table 7: Comparison of different dataset sizes for queries and paths
348
+
349
+ In Table 7, we observe the effect of dataset size on performance. Increasing the numbers of paths sampled per query improves performance, perhaps
350
+
351
+ due to higher diversity in training. However, this method of dataset expansion is limited by the number of relevant paths we could extract for a query.
352
+
353
+ We also experiment with increasing the query set manifold by mixing in unsupervised datasets. A total of 9M QA pairs are sampled from PAQ (Lewis et al., 2021), a synthetic QA dataset, and search paths extracted with heuristic scoring described in Section 5. The original 1P training dataset is mixed in 1:1 ratio. This further boosts performance, but not proportionally to the amount of data added, indicating diminishing returns from silver datasets.
354
+
355
+ # A.3 SEAL keywords
356
+
357
+ SEAL generates a set of document substrings constrained on the corpus, that are combined to form document identifiers. Besides using a LM to generate keywords, SEAL utilizes several other mechanisms for extracting keywords. This includes partial beam sequences, heuristically adding query n-grams, sampling the top-k tokens from the logprobs of the first decoding step, force decoding title etc. The keywords are re-scored using the LM as well as FM-index count and all keyword combinations are retrieved. Table 8 illustrates keywords generated by both the systems. Note that SEAL keywords can be repetitive and therefore require a large number of keywords to narrow down to meaningful documents. This also makes SEAL suitable for retrieving a much larger set of documents that can be re-ranked later. The maximum number of retrieved documents for SEAL are capped by a hyperparameter with default value of 500. In contrast, 1P is geared towards retrieving only the top-document.
358
+
359
+ # A.4 Hits@5
360
+
361
+ SEAL does significantly better than 1P for Hits@5 (Table 9). We attribute this to the large set of keywords generated by SEAL as explained in the Appendix A.3.
362
+
363
+ # A.5 Normalizing sequence likelihood over constrained space
364
+
365
+ During constrained decoding a sequence $X$ , we need to choose the next token from $\mathcal{C}(X, D)$ and not the entire vocabulary space $V$ . Should the sequence likelihood be re-normalized over this constrained space? We find that re-normalizing the probabilities results in inflated likelihoods, making it hard for the model to back-track.
366
+
367
+ Consider the query, "where did the butchers in the slaughterhouse cases live" to which our model
368
+
369
+ <table><tr><td>System</td><td>Question or Search Path</td><td>Answer</td></tr><tr><td rowspan="2">1P SEAL</td><td>who has the most catches in nfl history2,000-yard club » Barry Sanders</td><td rowspan="2">Jerry RiceBarry SandersT.J. Houshmandzadeh</td></tr><tr><td>&lt;/s&gt; Michael Irvin @ @, yards per catch, caught his, touchdown, record</td></tr><tr><td rowspan="2">1P SEAL</td><td>when was harry potter and the philosophers stone publishedHarry Potter and the Philosopher&#x27;s Stone » first published in the United » 1997</td><td>19971997</td></tr><tr><td>&lt;/s&gt; Harry Potter and the Philosopher&#x27;s Stone @ @, &quot;Harry Potter, Potter and thePhilosopher&#x27;s Stone is, Potter and the Philosopher&#x27;s Stone Harry, novel</td><td>1999</td></tr><tr><td rowspan="2">1P SEAL</td><td>what is the meaning of the harp in irelandHarp » national symbol of Ireland » national symbol of Ireland</td><td>the arms of Irelandnational symbol of Ireland</td></tr><tr><td>&lt;/s&gt; Harp @ @, Irish harp., harp is, harp was, harp</td><td>aristocracy</td></tr><tr><td rowspan="2">1P SEAL</td><td>who was the president of pakistan during 1971 warIndo-Pakistani War of 1971 » Prime Minister of Pakistan » Zulfikar Ali Bhutto</td><td>Yahya KhanZulfikar Ali Bhutto</td></tr><tr><td>&lt;/s&gt; Indo-Pakistani War of 1971 @ @, East Pakistan, Pakistani, Pakistan Army,Pakistan&#x27;s</td><td>Muhammad Yaqub Khan</td></tr><tr><td rowspan="2">1P SEAL</td><td>when do you declare honors in contract bridgeContract bridge » declaring » end of the hand</td><td>any time after the auctionend of the hand</td></tr><tr><td>&lt;/s&gt; Contract bridge @ @, declarer, bidding, honors, hands</td><td>bidding</td></tr></table>
370
+
371
+ Table 8: Comparison of keywords generated by SEAL and 1P for randomly sampled examples from Open-NQ test set. For 1P, we show the full search path separated by "»" with the last keyword as the answer. For SEAL, we illustrate the top-5 keywords along with the answer from Reader model. "</s>" and "@@" are special tokens used by SEAL for identifying start of passage and title marker respectively. The Answer next to the question is the gold answer while others are predictions from corresponding systems.
372
+
373
+ <table><tr><td>System</td><td>Beam</td><td>Hits@5</td></tr><tr><td>SEAL</td><td>1</td><td>59.7</td></tr><tr><td>SEAL</td><td>5</td><td>62.8</td></tr><tr><td>1P</td><td>1</td><td>46.5</td></tr><tr><td>1P</td><td>5</td><td>50.8</td></tr></table>
374
+
375
+ Table 9: Hits@5 on Open-NQ test. SEAL achieves a much higher score than 1P owning to the larger number of documents matched and re-scored. Note that only top-beam result is used for 1P while SEAL uses all beam outputs.
376
+
377
+ predicts an irrelevant search path [Slaughterhouse Five, but, EoS]. What's going on under the hood? The first keyword is incorrect lending the model into a poor search space. With the second keyword, the model is possibly looking to generate "butcher" but there's no such keyword in the constrained set. Ideally, the model should backtrack at this point to other candidates in the beam. However, since the set of continuations is small, renormalizing inflates the probabilities of all tokens in $\mathcal{C}$ including $EoS$ , even though the true likelihood of such a sequence is very low. Indeed, using the language model's scores directly without any re
378
+
379
+ ![](images/654724f0998c6062f18ca04f65c75b48e7ea83283c2b0243c15547b26b82e17d.jpg)
380
+ Figure 4: Number of matching documents in the corpus for 1P generated path in the test set. About half the examples match only a single path.
381
+
382
+ normalization cures this issue yielding [Slaughterhouse cases, Butcher, EoS]. and this is the strategy we opt for in all our experiments.
383
+
384
+ # A.6 Number of matching documents
385
+
386
+ 1P generated paths effectively narrow down the corpus, generally matching only a few documents in the corpus as illustrated in Figure 4. Note that a small fraction of paths match 0 documents due to pruning optimizations applied during inference
387
+
388
+ time detailed in Appendix A.1.
2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1603eaa6b2434c8f0a9c35dd810355d630df7196bb6504aa1401ba17082d3d06
3
+ size 575982
2023/1-PAGER_ One Pass Answer Generation and Evidence Retrieval/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/3de52cb5-1c81-4fb7-8fab-f06b43c089a4_content_list.json ADDED
@@ -0,0 +1,1650 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "2INER: Instructive and In-Context Learning on Few-Shot Named Entity Recognition",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 124,
8
+ 80,
9
+ 875,
10
+ 122
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Jiasheng Zhang $^{1}$ Xikai Liu $^{2}$ Xinyi Lai $^{3}$ Yan Gao $^{2}$",
17
+ "bbox": [
18
+ 258,
19
+ 129,
20
+ 742,
21
+ 147
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Shusen Wang² Yao Hu² Yiqing LIN",
28
+ "bbox": [
29
+ 322,
30
+ 148,
31
+ 677,
32
+ 164
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "$^{1}$ Shanghai Jiaotong University $^{2}$ Xiaohongshu Inc. $^{3}$ Chongqing University",
39
+ "bbox": [
40
+ 184,
41
+ 164,
42
+ 818,
43
+ 181
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "{js.zhang,yiqing.lin}@sjtu.edu.cn",
50
+ "bbox": [
51
+ 332,
52
+ 181,
53
+ 668,
54
+ 198
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "{xikai,yadun,haxian,xiahou}@xiaohongshu.com",
61
+ "bbox": [
62
+ 284,
63
+ 198,
64
+ 719,
65
+ 214
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "laixinyi@cqu.edu.cn",
72
+ "bbox": [
73
+ 403,
74
+ 215,
75
+ 596,
76
+ 230
77
+ ],
78
+ "page_idx": 0
79
+ },
80
+ {
81
+ "type": "text",
82
+ "text": "Abstract",
83
+ "text_level": 1,
84
+ "bbox": [
85
+ 260,
86
+ 252,
87
+ 339,
88
+ 267
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "Prompt-based learning has emerged as a powerful technique in natural language processing (NLP) due to its ability to leverage pre-training knowledge for downstream few-shot tasks. In this paper, we propose 2INER, a novel text-to-text framework for Few-Shot Named Entity Recognition (NER) tasks. Our approach employs instruction finetuning based on InstructionNER (Wang et al., 2022) to enable the model to effectively comprehend and process task-specific instructions, including both main and auxiliary tasks. We also introduce a new auxiliary task, called Type Extraction, to enhance the model's understanding of entity types in the overall semantic context of a sentence. To facilitate in-context learning, we concatenate examples to the input, enabling the model to learn from additional contextual information. Experimental results on four datasets demonstrate that our approach outperforms existing Few-Shot NER methods and remains competitive with state-of-the-art standard NER algorithms.",
95
+ "bbox": [
96
+ 141,
97
+ 279,
98
+ 460,
99
+ 605
100
+ ],
101
+ "page_idx": 0
102
+ },
103
+ {
104
+ "type": "text",
105
+ "text": "1 Introduction",
106
+ "text_level": 1,
107
+ "bbox": [
108
+ 114,
109
+ 619,
110
+ 260,
111
+ 634
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Named Entity Recognition (NER) has been a fundamental task of Natural Language Processing (NLP) and there are three types of sub-tasks in NER: flat NER (Tjong Kim Sang and De Meulder, 2003), nested NER (Kim et al., 2003) and discontinuous NER (Karimi et al., 2015). All three sub-tasks aim to locate named entities, extract the entity spans, and classify each span into pre-defined label categories. In terms of the flat NER which is the main focus of this paper, it can be formulated as a sequence labeling paradigm by assigning labels to each token in the sentence through token-classification models. The dominant methods include combining Pre-trained Language Models(PLMs) (Devlin et al., 2019) with label-specific classifier (LC) (Strubell et al., 2017; Cui and Zhang, 2019). However, the fixed shape of the output LC",
118
+ "bbox": [
119
+ 112,
120
+ 645,
121
+ 489,
122
+ 917
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "layer necessitates a consistent label set for both the training and testing data, which poses a challenge for knowledge transfer. Therefore, these models need to be trained from scratch to adapt to a new domain with a different label set, highlighting the requirement for a large amount of data for these methods.",
129
+ "bbox": [
130
+ 507,
131
+ 253,
132
+ 884,
133
+ 363
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "Due to the high cost of sequence labeling annotation in real-world scenarios, labeled data for NER is often limited. As a result, few-shot NER has gained significant attention due to its practical applications. Meanwhile, applying prompt-base learning (Han et al., 2021) on PLMs is an effective way to solve few-shot problems (Brown et al., 2020). PLMs can learn a lot of knowledge regarding human languages by training on a large amount of self-supervised corpus. In order to explore the potential of PLMs, prompt-based learning reformulate the downstream tasks to text-to-text framework with additional prompt indicating task descriptions (e.g. instruction fine-tuning (Wei et al., 2021; Chung et al., 2022; Sanh et al., 2021)). Through this approach, the model can effectively leverage the knowledge present in PLMs to enhance downstream skills without the need for additional large amounts of downstream data. This enables the model to achieve remarkable performance in few-shot settings.",
140
+ "bbox": [
141
+ 507,
142
+ 368,
143
+ 884,
144
+ 705
145
+ ],
146
+ "page_idx": 0
147
+ },
148
+ {
149
+ "type": "text",
150
+ "text": "Recently, many prompt-based NER methods have emerged to address the limitations of traditional few-shot NER approaches. TemplateNER (Cui et al., 2021) treats original sentence and predicted template filled by entity spans as source and target sequence, respectively, but all candidate spans must be enumerated during inference, leading to a high computational cost. CARTNER (Yan et al., 2021) proposed a pointer mechanism to unified all NER sub-tasks into one sequence-to-sequence (seq2seq) framework. CARTNER utilizes the raw sentence as input and outputs pointer index and tag index which represent the location",
151
+ "bbox": [
152
+ 507,
153
+ 709,
154
+ 885,
155
+ 917
156
+ ],
157
+ "page_idx": 0
158
+ },
159
+ {
160
+ "type": "page_number",
161
+ "text": "3940",
162
+ "bbox": [
163
+ 480,
164
+ 927,
165
+ 521,
166
+ 940
167
+ ],
168
+ "page_idx": 0
169
+ },
170
+ {
171
+ "type": "footer",
172
+ "text": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 3940-3951",
173
+ "bbox": [
174
+ 216,
175
+ 945,
176
+ 778,
177
+ 958
178
+ ],
179
+ "page_idx": 0
180
+ },
181
+ {
182
+ "type": "footer",
183
+ "text": "December 6-10, 2023 ©2023 Association for Computational Linguistics",
184
+ "bbox": [
185
+ 277,
186
+ 958,
187
+ 719,
188
+ 972
189
+ ],
190
+ "page_idx": 0
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "of the span and the corresponding label index in the category, respectively. To further adapt BARTNER for few-shot settings, LightNER (Chen et al., 2022b) proposed a lightweight tuning approach for low-resource settings by adding a unified learnable verbalizer and incorporating learnable parameters into the self-attention layers. Nonetheless, due to the fact that pointer mechanism only outputs the indexes of entities and labels, the model encounters challenges in effectively leveraging the capabilities of PLMs to directly comprehend the semantic meaning between entities and labels. Thus instead of using a pointer mechanism, InstructionNER (Wang et al., 2022) directly generates entity spans and types in the target sequence and applies instruction fine-tuning with two auxiliary tasks to further mining the capabilities of PLMs, which leads to significant few-shot improvements.",
195
+ "bbox": [
196
+ 112,
197
+ 84,
198
+ 492,
199
+ 375
200
+ ],
201
+ "page_idx": 1
202
+ },
203
+ {
204
+ "type": "text",
205
+ "text": "In terms of the auxiliary tasks in InstructionNER, they propose two auxiliary tasks from two perspectives: span recognition (Entity Extraction) and entity labeling (Entity Typing). However, we argue that NER can be further divided into three parts: 1) understand the relationship between the label and semantic meaning of the sentence. 2) extract the spans. 3) annotate the given spans. We believe that both span recognition and entity labeling can be benefit from having a deeper understanding of the label semantics. Therefore, we proposed a new auxiliary task, called Type Extraction, to help the model to acquire this ability.",
206
+ "bbox": [
207
+ 112,
208
+ 378,
209
+ 489,
210
+ 589
211
+ ],
212
+ "page_idx": 1
213
+ },
214
+ {
215
+ "type": "text",
216
+ "text": "Meanwhile, none of the above methods take the additional external knowledge into account. Current literature related to utilize external knowledge in NER involve (Chen et al., 2022a) and (Lee et al., 2022a). SDNet (Chen et al., 2022a) proposes a self-describing mechanism to leverage external resources by self-describing both entity types and mentions, while (Lee et al., 2022a) uses a demonstration-based method by incorporating examples to the input but without a text-to-text framework. Therefore, to the best of our knowledge, there is currently no existing literature that combines in-context external knowledge with instruction fine-tuning for few-shot NER.",
217
+ "bbox": [
218
+ 112,
219
+ 593,
220
+ 489,
221
+ 818
222
+ ],
223
+ "page_idx": 1
224
+ },
225
+ {
226
+ "type": "text",
227
+ "text": "In this paper, we propose 2INER(Instructive and In-Context Learning on Few-Shot NER). We build upon the work of InstructionNER by incorporating in-context examples and a novel auxiliary task. Specifically, we first reformulate the NER tasks into a text-to-text framework and then employ T5",
228
+ "bbox": [
229
+ 112,
230
+ 822,
231
+ 489,
232
+ 920
233
+ ],
234
+ "page_idx": 1
235
+ },
236
+ {
237
+ "type": "text",
238
+ "text": "(Raffel et al., 2020) for natural language generation. In terms of the source sentence, we use instructions to distinguish between tasks by giving a comprehensive task description and include an alternative field to identify the entity type that requires detection. Moreover, we suggest incorporating in-context demonstration examples into the source sentence to enable the model to learn from external knowledge. For the target sentence, we use natural language to represent entity spans and types instead of pointer mechanism. In addition to the two auxiliary tasks used in InstructionNER, we propose a new task called type extraction to further explore the potential of PLMs to understand label semantics. Type Extraction task requires the model to identify all the entity types presented in the original sentence and learn to understand the meaning of entity types at the overall semantic level of the sentence. Our contributions can be summarized as follows:",
239
+ "bbox": [
240
+ 505,
241
+ 84,
242
+ 884,
243
+ 404
244
+ ],
245
+ "page_idx": 1
246
+ },
247
+ {
248
+ "type": "list",
249
+ "sub_type": "text",
250
+ "list_items": [
251
+ "- To utilize external knowledge, we apply demonstration-based in-context learning examples to the instruction template. The in-context examples enable the model to directly learn which spans correspond to which types from these additional information, leading to better few-shot abilities.",
252
+ "- We expand the NER capabilities by dividing them into three components instead of two. And we propose a novel auxiliary task for instructions fine-tuning, called type extraction, to address the existing gap. It can enable the model to understand the meaning of the entity types through the overall semantic level of the sentence, which will improve span recognition and entity labeling abilities.",
253
+ "- We conduct extensive experiments on four datasets, demonstrating that 2NER outperforms existing few-shot NER methods and remains competitive with SOTA standard NER algorithms."
254
+ ],
255
+ "bbox": [
256
+ 507,
257
+ 407,
258
+ 885,
259
+ 697
260
+ ],
261
+ "page_idx": 1
262
+ },
263
+ {
264
+ "type": "text",
265
+ "text": "2 Related Work",
266
+ "text_level": 1,
267
+ "bbox": [
268
+ 507,
269
+ 709,
270
+ 665,
271
+ 725
272
+ ],
273
+ "page_idx": 1
274
+ },
275
+ {
276
+ "type": "text",
277
+ "text": "2.1 Named Entity Recognition",
278
+ "text_level": 1,
279
+ "bbox": [
280
+ 507,
281
+ 737,
282
+ 764,
283
+ 752
284
+ ],
285
+ "page_idx": 1
286
+ },
287
+ {
288
+ "type": "text",
289
+ "text": "Currently, NER tasks can be divided into flat NER (Tjong Kim Sang and De Meulder, 2003), nested NER (Kim et al., 2003) and discontinuous NER (Karimi et al., 2015), while in this paper, we mainly focus on the flat NER task. The current dominant method to solve flat NER is using token-level classification by turning it into a sequence labeling problem (Chiu and Nichols, 2016; Liu et al., 2019; Zhang et al., 2020; Liu et al., 2021), which apply a text encoder and CRF (Ma and Hovy, 2016) in",
290
+ "bbox": [
291
+ 505,
292
+ 757,
293
+ 884,
294
+ 919
295
+ ],
296
+ "page_idx": 1
297
+ },
298
+ {
299
+ "type": "page_number",
300
+ "text": "3941",
301
+ "bbox": [
302
+ 480,
303
+ 928,
304
+ 519,
305
+ 940
306
+ ],
307
+ "page_idx": 1
308
+ },
309
+ {
310
+ "type": "text",
311
+ "text": "sequence. Recently, CARTNER (Yan et al., 2021) formulate all three NER tasks into a text-to-text framework to solve them concurrently. CARTNER generate entity span sequences by a pointer-based model based on BART (Lewis et al., 2020) so that special design of tagging schema or spans post-processing are no longer needed.",
312
+ "bbox": [
313
+ 112,
314
+ 84,
315
+ 489,
316
+ 197
317
+ ],
318
+ "page_idx": 2
319
+ },
320
+ {
321
+ "type": "text",
322
+ "text": "2.2 Prompt-based Learning",
323
+ "text_level": 1,
324
+ "bbox": [
325
+ 112,
326
+ 209,
327
+ 349,
328
+ 225
329
+ ],
330
+ "page_idx": 2
331
+ },
332
+ {
333
+ "type": "text",
334
+ "text": "With the emergence of GPT-3 (Brown et al., 2020), prompt-based learning has gained increasing attention. It can better stimulate the knowledge model learned in pre-training stages and integrate different tasks together compared to the paradigm of fine-tuning separate model for each task, especially in few-shot settings (Han et al., 2021). To push prompt-based learning further, instruction-based learning (Wei et al., 2021) is proposed to fine-tune the PLMs on a collection of task descriptions which enables the model to better follow human instructions and generalize to unseen tasks with better zero-shot and few-shot abilities (Chung et al., 2022; Sanh et al., 2021).",
335
+ "bbox": [
336
+ 112,
337
+ 230,
338
+ 489,
339
+ 455
340
+ ],
341
+ "page_idx": 2
342
+ },
343
+ {
344
+ "type": "text",
345
+ "text": "2.3 Few-Shot NER Methods",
346
+ "text_level": 1,
347
+ "bbox": [
348
+ 112,
349
+ 467,
350
+ 352,
351
+ 482
352
+ ],
353
+ "page_idx": 2
354
+ },
355
+ {
356
+ "type": "text",
357
+ "text": "One line of work in few-shot NER is to apply contrastive learning to assign the labels by searching for the closest token (Das et al., 2022; Chen et al., 2022c), prototype (Snell et al., 2017; Fritzler et al., 2019; Ma et al., 2022b) or label semantic (Ma et al., 2022a; Huang et al., 2022) in the support set. Another line of researches is prompt-based learning using a unified text-to-text framework to make full use of the PLMs abilities. (Cui et al., 2021) applies span classification using BART and (Chen et al., 2022b; Yan et al., 2021) use a pointer mechanism to generate indexes of spans and types. (Wang et al., 2022) utilizes instruction fine-tuning and two auxiliary tasks to train T5. Meanwhile, to apply external knowledge to the model, (Chen et al., 2022a) introduces a self-describing mechanism and (Lee et al., 2022a) uses a demonstration-based method. Therefore, our methods introduce in-context learning via instruction fine-tuning together to achieve better few-shot NER abilities, which haven't been fully discussed yet in seq2seq NER settings.",
358
+ "bbox": [
359
+ 112,
360
+ 488,
361
+ 489,
362
+ 828
363
+ ],
364
+ "page_idx": 2
365
+ },
366
+ {
367
+ "type": "text",
368
+ "text": "3 Methodology",
369
+ "text_level": 1,
370
+ "bbox": [
371
+ 112,
372
+ 839,
373
+ 263,
374
+ 854
375
+ ],
376
+ "page_idx": 2
377
+ },
378
+ {
379
+ "type": "text",
380
+ "text": "3.1 NER Definition",
381
+ "text_level": 1,
382
+ "bbox": [
383
+ 112,
384
+ 865,
385
+ 282,
386
+ 879
387
+ ],
388
+ "page_idx": 2
389
+ },
390
+ {
391
+ "type": "text",
392
+ "text": "NER aims to predict all spans in the input sentence as well as the entity types associated with the spans.",
393
+ "bbox": [
394
+ 112,
395
+ 887,
396
+ 489,
397
+ 919
398
+ ],
399
+ "page_idx": 2
400
+ },
401
+ {
402
+ "type": "text",
403
+ "text": "The standard flatten-NER can be formulated as follows, given the input sentence containing $n$ tokens $X = [x_{1}, x_{2}, \\ldots, x_{n}]$ , the model has to predict the target sentence $Y = [l_{1}, l_{2}, \\ldots, l_{n}]$ . We use $V_{BIO}$ to denote the BIO label set, so $\\forall l_{i}, l_{i} \\in V_{BIO}$ . While in the sequence-to-sequence modeling scenario, the input sentence is still $X$ but instead of predicting $Y$ , the model predicts each entity $y_{i} = (e_{i}, s_{i})$ directly, where $s_{i}$ represents the entity span in $X$ . And $e_{i} \\in V$ represents the entity type of $s_{i}$ , where $V$ is the set of entity types.",
404
+ "bbox": [
405
+ 507,
406
+ 84,
407
+ 884,
408
+ 261
409
+ ],
410
+ "page_idx": 2
411
+ },
412
+ {
413
+ "type": "text",
414
+ "text": "More specifically, we use $l$ and $r$ to indicate the left and right boundary of an entity span in $X$ , so $s_i$ can be simplified as $s_i = x_{l:r}$ , where $x_{l:r} = [x_l, x_{l+1}, \\dots, x_r]$ . Therefore, the NER model has to predict each $y_i$ in $X$ , indicating that the span $s_i$ belongs to the $e_i$ entity type.",
415
+ "bbox": [
416
+ 507,
417
+ 261,
418
+ 884,
419
+ 357
420
+ ],
421
+ "page_idx": 2
422
+ },
423
+ {
424
+ "type": "text",
425
+ "text": "3.2 Convert NER to Text-to-text Task",
426
+ "text_level": 1,
427
+ "bbox": [
428
+ 507,
429
+ 368,
430
+ 821,
431
+ 382
432
+ ],
433
+ "page_idx": 2
434
+ },
435
+ {
436
+ "type": "text",
437
+ "text": "Using language models like T5 (Raffel et al., 2020) to solve most NLP tasks in a unified text-to-text framework can not only fully utilize the knowledge model learned in the pre-training stage but also simplify the training by using same data format, same loss and same model architecture. Moreover, Compared to using simple prompts, using instruction finetuning can further explore the capabilities of the model (Chung et al., 2022; Sanh et al., 2021). Besides, utilizing in-context learning can further enhance the model's few-shot capabilities in general (Brown et al., 2020) and specifically NER abilities (Lee et al., 2022b). Therefore, we transform the NER task into a text-to-text format and employ instruction finetuning and in-context learning to unleash the model's few-shot capabilities, as shown in Figure 1. The backbone we used is T5.",
438
+ "bbox": [
439
+ 507,
440
+ 388,
441
+ 884,
442
+ 661
443
+ ],
444
+ "page_idx": 2
445
+ },
446
+ {
447
+ "type": "text",
448
+ "text": "The basic text-to-text format of the main NER tasks consists of the following three parts, which is inspired by InstructionNER (Wang et al., 2022) $^{1}$ :",
449
+ "bbox": [
450
+ 507,
451
+ 662,
452
+ 882,
453
+ 709
454
+ ],
455
+ "page_idx": 2
456
+ },
457
+ {
458
+ "type": "text",
459
+ "text": "Instruction The instruction is a prompt that informs the model about the current task it needs to perform. The model is expected to follow the instructions provided within the prompt and complete the task accordingly. The instruction for the main NER task is: Please extract entities and their types from the Sentence, choose entity types from Alternatives.",
460
+ "bbox": [
461
+ 507,
462
+ 719,
463
+ 884,
464
+ 846
465
+ ],
466
+ "page_idx": 2
467
+ },
468
+ {
469
+ "type": "text",
470
+ "text": "Sentence The sentence is the input $X$ from which entities need to be extracted.",
471
+ "bbox": [
472
+ 507,
473
+ 856,
474
+ 882,
475
+ 887
476
+ ],
477
+ "page_idx": 2
478
+ },
479
+ {
480
+ "type": "text",
481
+ "text": "<sup>1</sup>The templates of auxiliary tasks and in-context Example will be discussed in 3.4 and 3.3 respectively.",
482
+ "bbox": [
483
+ 507,
484
+ 892,
485
+ 882,
486
+ 917
487
+ ],
488
+ "page_idx": 2
489
+ },
490
+ {
491
+ "type": "page_number",
492
+ "text": "3942",
493
+ "bbox": [
494
+ 480,
495
+ 927,
496
+ 521,
497
+ 940
498
+ ],
499
+ "page_idx": 2
500
+ },
501
+ {
502
+ "type": "image",
503
+ "img_path": "images/373832b663573beaab873631fd7634757242b782f75d1348c308506edd49c34b.jpg",
504
+ "image_caption": [
505
+ "Figure 1: The model architecture of our proposed 2INER. The left and right sides are the source and target sentence of the model, respectively."
506
+ ],
507
+ "image_footnote": [],
508
+ "bbox": [
509
+ 139,
510
+ 91,
511
+ 880,
512
+ 272
513
+ ],
514
+ "page_idx": 3
515
+ },
516
+ {
517
+ "type": "text",
518
+ "text": "Alternatives Alternatives is a list of entity types $(V)$ split by comma, from which the model needs to select the corresponding type to annotate the corresponding span. Alternatives serves as a constraint and a guiding factor, informing the model that it can only select entity types from within this list.",
519
+ "bbox": [
520
+ 110,
521
+ 344,
522
+ 485,
523
+ 455
524
+ ],
525
+ "page_idx": 3
526
+ },
527
+ {
528
+ "type": "text",
529
+ "text": "In order to formulate the NER output to natural language, for each NER output $y_{i} = (e_{i}, s_{i})$ , we use the following template to convert it to text: $s_{i}$ is $a / an$ $e_{i}$ , and we use dot to concatenate all detected entity occurrences $y_{i}$ to form the output text. In terms of the entity types $e_{i}$ , we use natural language to represent the entity instead of adding special tokens to the model<sup>2</sup>.",
530
+ "bbox": [
531
+ 112,
532
+ 473,
533
+ 487,
534
+ 602
535
+ ],
536
+ "page_idx": 3
537
+ },
538
+ {
539
+ "type": "text",
540
+ "text": "3.3 Auxiliary Tasks",
541
+ "text_level": 1,
542
+ "bbox": [
543
+ 112,
544
+ 612,
545
+ 284,
546
+ 627
547
+ ],
548
+ "page_idx": 3
549
+ },
550
+ {
551
+ "type": "text",
552
+ "text": "To enhance the NER performance, in addition to the main task, we need to introduce several auxiliary tasks. In InstructionNER (Wang et al., 2022), they employed two auxiliary tasks: entity extraction and entity typing. Moreover, in this paper, a new auxiliary task called type extraction will be introduced. During training, the auxiliary task will also be in the form of text-to-text data, trained alongside the main task data.",
553
+ "bbox": [
554
+ 110,
555
+ 632,
556
+ 487,
557
+ 775
558
+ ],
559
+ "page_idx": 3
560
+ },
561
+ {
562
+ "type": "text",
563
+ "text": "The auxiliary task primarily aims to improve NER capabilities from three perspectives: understand label semantic, span recognition and entity labeling, since NER can be decomposed into three steps: understand the relationship between the label and semantic meaning of the sentence, then extract",
564
+ "bbox": [
565
+ 112,
566
+ 777,
567
+ 487,
568
+ 873
569
+ ],
570
+ "page_idx": 3
571
+ },
572
+ {
573
+ "type": "text",
574
+ "text": "the spans and finally annotate the given spans. We will discuss the configuration of the auxiliary task in detail from these three perspectives.",
575
+ "bbox": [
576
+ 507,
577
+ 344,
578
+ 882,
579
+ 392
580
+ ],
581
+ "page_idx": 3
582
+ },
583
+ {
584
+ "type": "text",
585
+ "text": "3.3.1 Understand label semantic",
586
+ "text_level": 1,
587
+ "bbox": [
588
+ 507,
589
+ 403,
590
+ 779,
591
+ 417
592
+ ],
593
+ "page_idx": 3
594
+ },
595
+ {
596
+ "type": "text",
597
+ "text": "Type Extraction The goal of the Type Extraction task is to identify all the entity types present in the original sentence. The Instruction is changed to: Please extract all entity types appeared in the Sentence. We will remove the Alternatives in this case, which means that there will be no constraints or hints regarding entity types in the input text, aiming to increase the difficulty of the task. And the output template is: $e_i$ type exists in the sentence. The Type Extraction task involves detecting whether a specific entity type appears in the sentence, without focusing on specific spans or associating spans with entity types. This task will assist the model in understanding the meaning of entity types at the overall semantic level of the sentence. We believe that once the model gains a deeper understanding of entity types, it will be able to comprehend the relationship between spans and types more accurately. As a result, it will enhance both span recognition and entity labeling capabilities simultaneously.",
598
+ "bbox": [
599
+ 505,
600
+ 422,
601
+ 882,
602
+ 744
603
+ ],
604
+ "page_idx": 3
605
+ },
606
+ {
607
+ "type": "text",
608
+ "text": "3.3.2 Span recognition",
609
+ "text_level": 1,
610
+ "bbox": [
611
+ 507,
612
+ 755,
613
+ 702,
614
+ 770
615
+ ],
616
+ "page_idx": 3
617
+ },
618
+ {
619
+ "type": "text",
620
+ "text": "Entity Extraction The goal of the entity extraction task is to extract useful entity spans from the original sentence without the need for annotating the extracted spans. The instruction has been modified to: Please extract entities from the Sentence. Because the model doesn't need to type spans, the Alternatives field is deleted. And the output template has been changed to: $s_i$ is an entity word, since $e_i$ is no longer needed. Because the entity ex",
621
+ "bbox": [
622
+ 505,
623
+ 774,
624
+ 884,
625
+ 917
626
+ ],
627
+ "page_idx": 3
628
+ },
629
+ {
630
+ "type": "page_footnote",
631
+ "text": "2.e.g. \"Character_Name\" will be represented as \"Character Name\" instead of adding a special token named \"Character_Name\"",
632
+ "bbox": [
633
+ 112,
634
+ 879,
635
+ 487,
636
+ 917
637
+ ],
638
+ "page_idx": 3
639
+ },
640
+ {
641
+ "type": "page_number",
642
+ "text": "3943",
643
+ "bbox": [
644
+ 480,
645
+ 927,
646
+ 519,
647
+ 940
648
+ ],
649
+ "page_idx": 3
650
+ },
651
+ {
652
+ "type": "text",
653
+ "text": "traction task only require the model to predict useful spans regardless of the associated entity types, this task will guide the model to extract correct spans, enhancing the span-F1 accuracy, moreover, overall main task F1 as well (Wang et al., 2022).",
654
+ "bbox": [
655
+ 112,
656
+ 84,
657
+ 487,
658
+ 164
659
+ ],
660
+ "page_idx": 4
661
+ },
662
+ {
663
+ "type": "text",
664
+ "text": "The original InstructionNER (Wang et al., 2022) paper only employed span concatenation as the output(e.g. $s_1, s_2, s_3$ ). However, we believe that since the output of the main task consists of complete sentences with subject-verb-object structures, it would be more cohesive to follow the same pattern for the auxiliary tasks. And more structured output can fully utilize the PLMs's understanding of the task as well.",
665
+ "bbox": [
666
+ 112,
667
+ 165,
668
+ 487,
669
+ 307
670
+ ],
671
+ "page_idx": 4
672
+ },
673
+ {
674
+ "type": "text",
675
+ "text": "3.3.3 Entity Labeling",
676
+ "text_level": 1,
677
+ "bbox": [
678
+ 112,
679
+ 319,
680
+ 297,
681
+ 335
682
+ ],
683
+ "page_idx": 4
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "Entity Typing The entity typing task aims to type the given span with the correct label. The instruction has been modified to: Please type these entities according to the Sentence: <the given spans>. The Alternatives prompt and output template is the same as those in main task. During training, the given spans in the Instruction is the exact entity spans that have labels on. In entity typing task, since the spans are given, the model doesn't need to worry about the correctness of the span extracted, so the model can focus more on learning how to label the entity accurately, enhancing the main task NER ability.",
688
+ "bbox": [
689
+ 112,
690
+ 338,
691
+ 489,
692
+ 548
693
+ ],
694
+ "page_idx": 4
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "3.4 In-Context Learning",
699
+ "text_level": 1,
700
+ "bbox": [
701
+ 112,
702
+ 560,
703
+ 324,
704
+ 575
705
+ ],
706
+ "page_idx": 4
707
+ },
708
+ {
709
+ "type": "text",
710
+ "text": "In-context learning will be applied to further enhance few-shot NER capabilities. The main approach of in-context learning is to append Examples at the end of the input sentence, hoping that the model can directly learn which spans correspond to which types from these Examples, without the need for additional gradient updates. Besides, the in-context examples are also presented in natural language format, which closely resembles the output text format, serving as a reminder for the model about the desired format it should generate and making it easier for PLMs to understand. This similarity helps bridge the gap and facilitates the model's comprehension.",
711
+ "bbox": [
712
+ 112,
713
+ 581,
714
+ 489,
715
+ 804
716
+ ],
717
+ "page_idx": 4
718
+ },
719
+ {
720
+ "type": "text",
721
+ "text": "The in-context example format in NER is inspired by (Lee et al., 2022b). All examples in this context follow the template: span is a/an entity-type. And we will concatenate an additional prompt (based on the knowledge in Examples) after the Instruction to hint the model to learn from the Examples. During training stage, in-context Examples",
722
+ "bbox": [
723
+ 112,
724
+ 806,
725
+ 489,
726
+ 919
727
+ ],
728
+ "page_idx": 4
729
+ },
730
+ {
731
+ "type": "text",
732
+ "text": "will only be added to the main NER tasks and there will be no Examples added in auxiliary tasks, which will be discussed in detail in Analysis 5.2.",
733
+ "bbox": [
734
+ 507,
735
+ 84,
736
+ 880,
737
+ 131
738
+ ],
739
+ "page_idx": 4
740
+ },
741
+ {
742
+ "type": "text",
743
+ "text": "In terms of the choices of the samples in Examples, we randomly choose some spans appeared in the train set as well as their corresponding entity types to create Examples. Since we are uncertain about the entity types present in the sentence, we will provide at least one example for each entity type in the Alternatives list within the Examples. The number of samples of each entity types in Examples will also be the same $^3$ (e.g. in terms of MIT Movie dataset, there are 12 entity types. If we set the number of examples to 5, there will be 5 examples for each entity types, resulting in a total of $5^{*}12$ examples in the field).",
744
+ "bbox": [
745
+ 507,
746
+ 133,
747
+ 884,
748
+ 341
749
+ ],
750
+ "page_idx": 4
751
+ },
752
+ {
753
+ "type": "text",
754
+ "text": "3.5 Inference",
755
+ "text_level": 1,
756
+ "bbox": [
757
+ 507,
758
+ 354,
759
+ 630,
760
+ 368
761
+ ],
762
+ "page_idx": 4
763
+ },
764
+ {
765
+ "type": "text",
766
+ "text": "During inference time, we first use the template of the main NER task to wrap the input sentence $X$ , and then feed the sentence to 2INER to get the predicted output text. In terms of the Example field, the example spans are sampled from the training support set, so the model won't see the groundtruth in the Examples during evaluation, avoiding information leakage. After the output text is generated, a decoding strategy will be applied to get the predicted entity $(e_i, s_i)$ : (1) We use dot to split the whole output text to obtain individual sub-texts. (2) We use \"is a\" or \"is an\" to split each sub-text if they can be found. (3) The span is the part before \"is a/an\" and the entity type is the part after it. Once we get the $(e_i, s_i)$ , we will check whether $s_i$ is in the input sentence $X$ and $e_i$ is in the set of entity types $V$ . If it doesn't pass the check, then it isn't a valid entity and will be deleted. And if any of the three steps result in a match failure, then the sub-text will be skipped.",
767
+ "bbox": [
768
+ 507,
769
+ 376,
770
+ 882,
771
+ 697
772
+ ],
773
+ "page_idx": 4
774
+ },
775
+ {
776
+ "type": "text",
777
+ "text": "4 Experiment",
778
+ "text_level": 1,
779
+ "bbox": [
780
+ 507,
781
+ 709,
782
+ 648,
783
+ 726
784
+ ],
785
+ "page_idx": 4
786
+ },
787
+ {
788
+ "type": "text",
789
+ "text": "4.1 Dataset",
790
+ "text_level": 1,
791
+ "bbox": [
792
+ 507,
793
+ 737,
794
+ 616,
795
+ 751
796
+ ],
797
+ "page_idx": 4
798
+ },
799
+ {
800
+ "type": "text",
801
+ "text": "We conduct NER experiments in standard and low-resources settings. For the rich-resources domain, we use CoNLL-2003 (Tjong Kim Sang and De Meulder, 2003) and for the low-resource domain, we use three datasets: MIT Movie Review, MIT Restaurant Review (Liu et al., 2013) and Airline Travel Information Systems (ATIS) (Hakkani",
802
+ "bbox": [
803
+ 507,
804
+ 758,
805
+ 884,
806
+ 871
807
+ ],
808
+ "page_idx": 4
809
+ },
810
+ {
811
+ "type": "page_footnote",
812
+ "text": "3We refer to \"the number of samples per entity types\" as \"the number of examples\" in the rest of the paper for convenience.",
813
+ "bbox": [
814
+ 507,
815
+ 879,
816
+ 885,
817
+ 917
818
+ ],
819
+ "page_idx": 4
820
+ },
821
+ {
822
+ "type": "page_number",
823
+ "text": "3944",
824
+ "bbox": [
825
+ 480,
826
+ 927,
827
+ 519,
828
+ 940
829
+ ],
830
+ "page_idx": 4
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "Tür et al., 2016), following (Wang et al., 2022; Chen et al., 2022b; Cui et al., 2021; Yan et al., 2021).",
835
+ "bbox": [
836
+ 112,
837
+ 84,
838
+ 489,
839
+ 131
840
+ ],
841
+ "page_idx": 5
842
+ },
843
+ {
844
+ "type": "text",
845
+ "text": "4.2 Implementation settings",
846
+ "text_level": 1,
847
+ "bbox": [
848
+ 112,
849
+ 146,
850
+ 349,
851
+ 161
852
+ ],
853
+ "page_idx": 5
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "In Few-Shot NER scenario, in order to guarantee that each entity type has equal number of instances in the training set, we can't sample $k$ sentences for each entity type directly because a single sentence may contain multiple entities, so the actual shot will exceed $k$ . Following (Wang et al., 2022), we will apply a greedy sampling strategy (Yang and Katiyar, 2020) instead, to sample the few-shot training set for each setting and due to the randomness of the sampling, we will repeat 3 times for each experiment. We use T5-large as the backbone model for fair comparison with (Wang et al., 2022). In terms of the number of examples in in-context Example field, we set the number to 5 for MIT Movie and MIT Restaurant dataset, and 1 for ATIS dataset as default. We only add in-context Example field on main-task, and don't include them in auxiliary tasks. The ratio of auxiliary tasks is set to $1.0$ . We set the batch size to $2/4/8$ , learning-rate to $2\\mathrm{e}-5/5\\mathrm{e}-5$ for $10/20/50$ Shot settings respectively, and set batch size to 32, learning-rate to $1\\mathrm{e}-4$ for the abundant data setting. The optimizer is Adam and beam search is set to 2. For evaluation, we use F1 score as the metric for NER.",
858
+ "bbox": [
859
+ 115,
860
+ 168,
861
+ 489,
862
+ 552
863
+ ],
864
+ "page_idx": 5
865
+ },
866
+ {
867
+ "type": "text",
868
+ "text": "The names InstructionNER in the tables mean training with main-task data only, indicating the base model, and the subscript words in the tables indicate addition to the base model: +ET, +EE, +TE, +EX means adding Entity Typing, Entity Extraction, Type Extraction, in-context examples, respectively. And we named InstructionNER+ET,EE,TE,EX as 2INER, which is our final model.",
869
+ "bbox": [
870
+ 110,
871
+ 555,
872
+ 487,
873
+ 700
874
+ ],
875
+ "page_idx": 5
876
+ },
877
+ {
878
+ "type": "text",
879
+ "text": "4.3 Standard NER Setting",
880
+ "text_level": 1,
881
+ "bbox": [
882
+ 112,
883
+ 713,
884
+ 337,
885
+ 728
886
+ ],
887
+ "page_idx": 5
888
+ },
889
+ {
890
+ "type": "text",
891
+ "text": "We use CoNLL-2003 dataset to conduct standard NER experiment. We combine the train and validation set as described in (Yan et al., 2021) to train the model. The result is in Table 1, which shows that even though our method mainly focuses on few-shot NER settings, it remains competitive with",
892
+ "bbox": [
893
+ 112,
894
+ 734,
895
+ 487,
896
+ 832
897
+ ],
898
+ "page_idx": 5
899
+ },
900
+ {
901
+ "type": "table",
902
+ "img_path": "images/40d453eddc62f1ffaa3e37262e4d8b138dda7d3e43144b071e0a0090ab6cdbc6.jpg",
903
+ "table_caption": [],
904
+ "table_footnote": [],
905
+ "table_body": "<table><tr><td>Model</td><td>F1</td><td>Span-F1</td></tr><tr><td>(Yang et al., 2018)</td><td>90.77</td><td>-</td></tr><tr><td>(Ma and Hovy, 2016)</td><td>91.21</td><td>-</td></tr><tr><td>(Gui et al., 2020)</td><td>92.02</td><td>-</td></tr><tr><td>(Yamada et al., 2020)*</td><td>94.30</td><td>92.40</td></tr><tr><td>(Li et al., 2020a)†</td><td>-</td><td>92.87</td></tr><tr><td>(Yu et al., 2020a)‡</td><td>-</td><td>92.50</td></tr><tr><td>LC-BERT</td><td>91.73</td><td>-</td></tr><tr><td>LC-BART</td><td>90.60</td><td>-</td></tr><tr><td>TemplateNER</td><td>91.90</td><td>-</td></tr><tr><td>BARTNER</td><td>-</td><td>93.24</td></tr><tr><td>LightNER</td><td>92.93</td><td>-</td></tr><tr><td>2INER (InstructionNER+ET,EE,TE,EX)</td><td>90.71</td><td>93.93</td></tr></table>",
906
+ "bbox": [
907
+ 510,
908
+ 80,
909
+ 885,
910
+ 244
911
+ ],
912
+ "page_idx": 5
913
+ },
914
+ {
915
+ "type": "text",
916
+ "text": "Table 1: F1 and Span-F1 (%) on CoNLL-2003 Standard NER setting. Our method is competitive with SOTA algorithm and even outperform BARTNER (Yan et al., 2021) in span-F1. \" * \" indicates training on external data. \"†\" indicates the reproduction by (Yan et al., 2021). \"‡\" indicates the reproduction with only the sentence-level context by (Yan et al., 2021).",
917
+ "bbox": [
918
+ 507,
919
+ 253,
920
+ 884,
921
+ 354
922
+ ],
923
+ "page_idx": 5
924
+ },
925
+ {
926
+ "type": "text",
927
+ "text": "SOTA algorithm under standard NER setting and even outperform BARTNER (Yan et al., 2021) in span-F1, which is designed for rich-resource NER settings. The performances of 2INER in data abundant nested and discontinuous NER settings are in Appendix A.",
928
+ "bbox": [
929
+ 507,
930
+ 381,
931
+ 882,
932
+ 478
933
+ ],
934
+ "page_idx": 5
935
+ },
936
+ {
937
+ "type": "text",
938
+ "text": "4.4 Few-Shot NER Setting",
939
+ "text_level": 1,
940
+ "bbox": [
941
+ 507,
942
+ 493,
943
+ 732,
944
+ 508
945
+ ],
946
+ "page_idx": 5
947
+ },
948
+ {
949
+ "type": "text",
950
+ "text": "Under Few-Shot NER setting, we only use K-Shot training samples to finetune our model and the results are in Table 2. According to the table, we can find that: (1) Our models consistently outperform InstructionNER as well as other baselines on all three datasets under 10/20/50 Shot settings (except 50Shot in ATIS, which is slightly lower than BARTNER). Especially in MIT Movie dataset, our models have $7.33\\%$ , $6.76\\%$ , $5.39\\%$ improvements compared to InstructionNER under 10/20/50 settings. (2) Our 10Shot model even outperforms TempleNER's 50Shot model by $20.73\\%$ and $7.06\\%$ in MIT Movie and MIT Restaurant respectively, which highlights the superiority and capability of our model. (3) We have the same finding as InstructionNER (Wang et al., 2022) that F1 improvements are much more significant on MIT Movie than on MIT Restaurant ( $7.33\\% / 6.76\\% / 5.39\\%$ v.s. $6.86\\% / 3.24\\% / 3.3\\%$ under 10/20/50 Shot settings), which indicates that although MIT Movie has more entity types, text-to-text framework and instruction-tuning can better utilize pre-training knowledge, and through in-context learning, the model can learn more about the relationships between entities. (4) In ATIS dataset, the improve",
951
+ "bbox": [
952
+ 505,
953
+ 517,
954
+ 885,
955
+ 919
956
+ ],
957
+ "page_idx": 5
958
+ },
959
+ {
960
+ "type": "page_footnote",
961
+ "text": "4https://huggingface.co/t5-large",
962
+ "bbox": [
963
+ 134,
964
+ 843,
965
+ 381,
966
+ 857
967
+ ],
968
+ "page_idx": 5
969
+ },
970
+ {
971
+ "type": "page_footnote",
972
+ "text": "ATIS has 79 entity types so we set the number to 1 to avoid excessively long token lengths.",
973
+ "bbox": [
974
+ 115,
975
+ 856,
976
+ 485,
977
+ 881
978
+ ],
979
+ "page_idx": 5
980
+ },
981
+ {
982
+ "type": "page_footnote",
983
+ "text": "The data size ratio between main task and each auxiliary tasks. 1.0 means that each sample will be extended into 4 samples: one for main task, one for EE, ET, TE, respectively.",
984
+ "bbox": [
985
+ 115,
986
+ 881,
987
+ 485,
988
+ 917
989
+ ],
990
+ "page_idx": 5
991
+ },
992
+ {
993
+ "type": "page_number",
994
+ "text": "3945",
995
+ "bbox": [
996
+ 480,
997
+ 928,
998
+ 519,
999
+ 940
1000
+ ],
1001
+ "page_idx": 5
1002
+ },
1003
+ {
1004
+ "type": "table",
1005
+ "img_path": "images/28f1fbe800713b94355e78ec56f8f504b6928eb426379cc9871af2b667ed6bb4.jpg",
1006
+ "table_caption": [],
1007
+ "table_footnote": [],
1008
+ "table_body": "<table><tr><td rowspan=\"2\">Models</td><td colspan=\"3\">MIT Movie</td><td colspan=\"3\">MIT Restaurant</td><td colspan=\"3\">ATIS</td></tr><tr><td>10</td><td>20</td><td>50</td><td>10</td><td>20</td><td>50</td><td>10</td><td>20</td><td>50</td></tr><tr><td>LC-BERT</td><td>25.2</td><td>42.2</td><td>49.6</td><td>21.8</td><td>39.4</td><td>52.7</td><td>44.1</td><td>76.7</td><td>90.7</td></tr><tr><td>LC-BART</td><td>10.2</td><td>27.5</td><td>44.2</td><td>6.3</td><td>8.5</td><td>51.3</td><td>42.0</td><td>72.7</td><td>87.5</td></tr><tr><td>TemplateNER</td><td>37.3</td><td>48.5</td><td>52.2</td><td>46.0</td><td>57.1</td><td>58.7</td><td>71.7</td><td>79.4</td><td>92.6</td></tr><tr><td>BARTNER*</td><td>41.1</td><td>54.0</td><td>67.7</td><td>44.0</td><td>56.0</td><td>64.0</td><td>77.7</td><td>86.1</td><td>93.4</td></tr><tr><td>LightNER</td><td>41.7</td><td>57.8</td><td>73.1</td><td>48.5</td><td>58.0</td><td>62.0</td><td>76.3</td><td>85.3</td><td>92.8</td></tr><tr><td>InstructionNER</td><td>64.4 (±2.1)</td><td>70.0 (±0.3)</td><td>74.1 (±1.2)</td><td>58.7 (±1.2)</td><td>65.5 (±1.4)</td><td>71.2 (±1.1)</td><td>90.14 (±0.12)†</td><td>91.22 (±0.19)†</td><td>92.53 (±0.14)†</td></tr><tr><td>InstructionNER+ET,EE</td><td>65.6 (±3.0)</td><td>70.1 (±1.9)</td><td>74.7 (±0.3)</td><td>58.9 (±0.8)</td><td>66.1 (±0.9)</td><td>71.1 (±0.9)</td><td>90.04 (±0.02)†</td><td>91.46 (±0.23)†</td><td>92.62 (±0.04)†</td></tr><tr><td>InstructionNER+EX</td><td>72.56 (±1.01)</td><td>74.99 (±0.27)</td><td>78.61 (±0.37)</td><td>64.07 (±1.25)</td><td>68.2 (±0.11)</td><td>74.38 (±0.19)</td><td>89.17 (±0.2)</td><td>91.33 (±0.05)</td><td>92.65 (±0.18)</td></tr><tr><td>InstructionNER+TE</td><td>72.0 (±0.25)</td><td>76.55 (±0.2)</td><td>80.02 (±0.26)</td><td>65.52 (±1.35)</td><td>68.67 (±0.95)</td><td>73.98 (±0.27)</td><td>90.77 (±0.6)</td><td>91.85 (±0.05)</td><td>92.69 (±0.1)</td></tr><tr><td>InstructionNER+ET,EE,TE,EX</td><td>72.93 (±0.91)</td><td>76.86 (±0.53)</td><td>80.09 (±0.22)</td><td>65.76 (±0.47)</td><td>69.34 (±0.81)</td><td>74.4 (±0.4)</td><td>90.47 (±0.26)</td><td>92.11 (±0.09)</td><td>92.83 (±0.15)</td></tr></table>",
1009
+ "bbox": [
1010
+ 115,
1011
+ 80,
1012
+ 897,
1013
+ 218
1014
+ ],
1015
+ "page_idx": 6
1016
+ },
1017
+ {
1018
+ "type": "text",
1019
+ "text": "Table 2: The F1(\\%) on three dataset under 10/20/50 Shot settings. The bold number means the best F1 across all models and the numbers in brackets means the standard deviation. The underline numbers mean the best results in our experiments. The \"+\" numbers mean the results of our reproduction. \"* means the reproduction by InstructionNER (Wang et al., 2022).",
1020
+ "bbox": [
1021
+ 112,
1022
+ 227,
1023
+ 884,
1024
+ 285
1025
+ ],
1026
+ "page_idx": 6
1027
+ },
1028
+ {
1029
+ "type": "text",
1030
+ "text": "ment of our model is less significant compared to other two datasets. We argue that this is because ATIS contains 79 entity types and even if we only provide one sample span for each entity types in in-context Example field, the average token length is 1099 compared to 368 with or without examples, where the token length of the Alternative filed is 327. So the actual input Sentence $X$ only accounts for $3.7\\%$ of the total token length, which increases the difficulty for the model to extract key information from lengthy sentences. So too many entity types may potentially reduce model improvements.",
1031
+ "bbox": [
1032
+ 112,
1033
+ 310,
1034
+ 489,
1035
+ 502
1036
+ ],
1037
+ "page_idx": 6
1038
+ },
1039
+ {
1040
+ "type": "text",
1041
+ "text": "4.5 Ablation Study",
1042
+ "text_level": 1,
1043
+ "bbox": [
1044
+ 112,
1045
+ 514,
1046
+ 280,
1047
+ 529
1048
+ ],
1049
+ "page_idx": 6
1050
+ },
1051
+ {
1052
+ "type": "text",
1053
+ "text": "In order to find out the influence of our proposed type extraction task and in-context examples on model's few-shot abilities, we conduct ablation studies in Figure 2. The results indicate that adding type extraction task and in-context examples can further enhance the model's few-shot NER abilities. We set InstructionNER as the baseline here which only trains on main-task data without any auxiliary tasks. Then we add type extraction task (InstructionNER+TE) or in-context examples (InstructionNER+EX) respectively on the baseline model to explore their influences. The results from Figure 2 shows that in terms of 10/20/50 Shot settings in few-shot NER, type extraction task achieves an average improvements of $7.21\\%$ , $4.86\\%$ , $4.35\\%$ F1 and in-context example achieves an average improvements of $6.76\\%$ , $3.84\\%$ , $3.84\\%$ F1 in MIT Movie and MIT Restaurant dataset.",
1054
+ "bbox": [
1055
+ 112,
1056
+ 533,
1057
+ 487,
1058
+ 822
1059
+ ],
1060
+ "page_idx": 6
1061
+ },
1062
+ {
1063
+ "type": "text",
1064
+ "text": "Moreover, adding type extraction task can greatly increase the Span-F1 as well. Because Span-F1 indicates the model's ability to locate",
1065
+ "bbox": [
1066
+ 112,
1067
+ 824,
1068
+ 487,
1069
+ 873
1070
+ ],
1071
+ "page_idx": 6
1072
+ },
1073
+ {
1074
+ "type": "image",
1075
+ "img_path": "images/ccbd7a22ac82ef0bf7eff5a54809f4a260d406dd5983e0a34343f0d4560b51d5.jpg",
1076
+ "image_caption": [
1077
+ "Figure 2: F1 and Span-F1 $(\\%)$ on MIT Movie and MIT Restaurant through 10/20/50 Shot settings with different task combinations. The deep and light color indicate F1 and Span-F1 respectively."
1078
+ ],
1079
+ "image_footnote": [],
1080
+ "bbox": [
1081
+ 515,
1082
+ 310,
1083
+ 875,
1084
+ 470
1085
+ ],
1086
+ "page_idx": 6
1087
+ },
1088
+ {
1089
+ "type": "text",
1090
+ "text": "spans, the results reveal that through training on type extraction task, span recognition can be benefit from having a deeper understanding of the labels from the overall semantic level of sentence. Therefore, it proves the effectiveness of three steps of NER abilities we proposed in 3.3, and shows that type extraction task can simultaneously improve span recognition and entity labeling abilities through understanding label semantic.",
1091
+ "bbox": [
1092
+ 507,
1093
+ 565,
1094
+ 885,
1095
+ 709
1096
+ ],
1097
+ "page_idx": 6
1098
+ },
1099
+ {
1100
+ "type": "text",
1101
+ "text": "5 Analysis",
1102
+ "text_level": 1,
1103
+ "bbox": [
1104
+ 507,
1105
+ 724,
1106
+ 618,
1107
+ 740
1108
+ ],
1109
+ "page_idx": 6
1110
+ },
1111
+ {
1112
+ "type": "text",
1113
+ "text": "5.1 Increase Example Number",
1114
+ "text_level": 1,
1115
+ "bbox": [
1116
+ 507,
1117
+ 751,
1118
+ 766,
1119
+ 768
1120
+ ],
1121
+ "page_idx": 6
1122
+ },
1123
+ {
1124
+ "type": "text",
1125
+ "text": "In this section, we will focus on how the number of examples in in-context Example field influence the model performance. We will sequentially change the number of examples to 1, 3, 5, 10, and 15, and train corresponding models to observe the change of F1 on MIT Restaurant dataset. We train our model with main-task and in-context example without any auxiliary tasks (InstructionNER+EX) in this section. The results are in Table 3.",
1126
+ "bbox": [
1127
+ 507,
1128
+ 774,
1129
+ 884,
1130
+ 917
1131
+ ],
1132
+ "page_idx": 6
1133
+ },
1134
+ {
1135
+ "type": "page_footnote",
1136
+ "text": "<sup>7</sup>We try to use special-tokens to represent the entity types, but the F1 is slightly lower than without using special-tokens and the proportion of $X$ to the total number of tokens is $4.5\\%$ .",
1137
+ "bbox": [
1138
+ 112,
1139
+ 879,
1140
+ 487,
1141
+ 917
1142
+ ],
1143
+ "page_idx": 6
1144
+ },
1145
+ {
1146
+ "type": "page_number",
1147
+ "text": "3946",
1148
+ "bbox": [
1149
+ 480,
1150
+ 928,
1151
+ 521,
1152
+ 940
1153
+ ],
1154
+ "page_idx": 6
1155
+ },
1156
+ {
1157
+ "type": "table",
1158
+ "img_path": "images/efc06f9375437155a196c6ed767da44b29109efda6cf4cb5025ddf0b9e98f199.jpg",
1159
+ "table_caption": [],
1160
+ "table_footnote": [],
1161
+ "table_body": "<table><tr><td rowspan=\"2\">InstructionNER+EX Examples</td><td colspan=\"2\">MIT Restaurant</td></tr><tr><td>20 Shot</td><td>50 Shot</td></tr><tr><td>0</td><td>65.5 (±1.4)</td><td>71.2 (±1.1)</td></tr><tr><td>1</td><td>67.74 (±0.22)</td><td>73.89 (±0.15)</td></tr><tr><td>3</td><td>67.89 (±0.3)</td><td>74.15 (±0.39)</td></tr><tr><td>5</td><td>68.2 (±0.11)</td><td>74.38 (±0.19)</td></tr><tr><td>10</td><td>69.47 (±0.35)</td><td>74.41 (±0.18)</td></tr><tr><td>15</td><td>69.52 (±0.16)</td><td>74.64 (±0.49)</td></tr></table>",
1162
+ "bbox": [
1163
+ 137,
1164
+ 80,
1165
+ 463,
1166
+ 195
1167
+ ],
1168
+ "page_idx": 7
1169
+ },
1170
+ {
1171
+ "type": "text",
1172
+ "text": "As the number of examples increases, F1 score continues to increase and the largest improvement in F1 score occurs when going from zero examples to one example. As the number of examples increases further, the F1 will continue to increase but the rate of improvement gradually slows down. This suggests that when only one in-context example is provided, the model can quickly learn the specific meanings of each entity type from the example. While more examples may lead to repetitive cues to the model so a balance should be made between model performance and computational cost.",
1173
+ "bbox": [
1174
+ 112,
1175
+ 302,
1176
+ 489,
1177
+ 495
1178
+ ],
1179
+ "page_idx": 7
1180
+ },
1181
+ {
1182
+ "type": "text",
1183
+ "text": "5.2 Effect of In-Context Example on Auxiliary task",
1184
+ "text_level": 1,
1185
+ "bbox": [
1186
+ 112,
1187
+ 508,
1188
+ 485,
1189
+ 539
1190
+ ],
1191
+ "page_idx": 7
1192
+ },
1193
+ {
1194
+ "type": "text",
1195
+ "text": "In this section, we will discuss whether to add in-context examples on auxiliary task. The model is 2INER (InstructionNER+ET,EE,TE,EX) and we will compare two settings: add examples only on main-task, add examples on main-task as well as three auxiliary tasks. The results in Table 4 indicate that adding examples on auxiliary task will slightly decrease the F1 performance. Because adding examples to auxiliary tasks may potentially reduce their difficulty and make it too easy for the model, thereby reducing the auxiliary tasks' effectiveness in aiding the main task. So adding examples only to the main task is a better approach.",
1196
+ "bbox": [
1197
+ 112,
1198
+ 546,
1199
+ 489,
1200
+ 755
1201
+ ],
1202
+ "page_idx": 7
1203
+ },
1204
+ {
1205
+ "type": "text",
1206
+ "text": "5.3 Increase Shot",
1207
+ "text_level": 1,
1208
+ "bbox": [
1209
+ 112,
1210
+ 768,
1211
+ 267,
1212
+ 782
1213
+ ],
1214
+ "page_idx": 7
1215
+ },
1216
+ {
1217
+ "type": "text",
1218
+ "text": "In this section, we will discuss the model performance under relatively abundant settings. We increase the shots to 100, 200 and 500 in MIT Movie and MIT Restaurant datasets using 2INER (InstructionNER+ET,EE,TE,EX). As shown in Table 5, compared to InstructionNER, 2INER achieves $5.43\\%$ , $3.98\\%$ , $3.19\\%$ improvements in F1 under 100/200/500 shots settings respectively.",
1219
+ "bbox": [
1220
+ 112,
1221
+ 790,
1222
+ 489,
1223
+ 919
1224
+ ],
1225
+ "page_idx": 7
1226
+ },
1227
+ {
1228
+ "type": "table",
1229
+ "img_path": "images/4be07f0e7b5395e6ccb2a20ce1f412ef23ef29dee2051b238deb08b31040cb4c.jpg",
1230
+ "table_caption": [
1231
+ "Table 3: F1 scores(%) on MIT Restaurant dataset while changing number of examples using InstructionNER+EX. Bold numbers indicate the best F1 and the numbers in brackets means the standard deviation."
1232
+ ],
1233
+ "table_footnote": [],
1234
+ "table_body": "<table><tr><td></td><td colspan=\"3\">MIT Restaurant</td></tr><tr><td></td><td>10 Shot</td><td>20 Shot</td><td>50 Shot</td></tr><tr><td>2INER</td><td>65.26</td><td>69.27</td><td>74.2</td></tr><tr><td>Examples on all tasks</td><td>(±0.49)</td><td>(±0.89)</td><td>(±0.45)</td></tr><tr><td>2INER</td><td>65.76</td><td>69.34</td><td>74.4</td></tr><tr><td>Examples only on Main-Task</td><td>(±0.47)</td><td>(±0.81)</td><td>(±0.4)</td></tr></table>",
1235
+ "bbox": [
1236
+ 527,
1237
+ 80,
1238
+ 863,
1239
+ 168
1240
+ ],
1241
+ "page_idx": 7
1242
+ },
1243
+ {
1244
+ "type": "table",
1245
+ "img_path": "images/87d6cd817fcf3ed5d42bad417f5dfbf3862d451896fdc56b3645e3ef318ad6db.jpg",
1246
+ "table_caption": [
1247
+ "Table 4: The comparison between adding in-context examples only on main-task and on all tasks including auxiliary tasks. Bold numbers indicate the best F1 and the numbers in brackets means the standard deviation."
1248
+ ],
1249
+ "table_footnote": [],
1250
+ "table_body": "<table><tr><td rowspan=\"2\">Models</td><td colspan=\"3\">MIT Movie</td><td colspan=\"3\">MIT Restaurant</td></tr><tr><td>100</td><td>200</td><td>500</td><td>100</td><td>200</td><td>500</td></tr><tr><td>LC-BERT</td><td>50.7</td><td>59.3</td><td>74.4</td><td>53.5</td><td>57.4</td><td>61.3</td></tr><tr><td>LC-BART</td><td>47.5</td><td>54.2</td><td>64.1</td><td>52.2</td><td>56.3</td><td>60.2</td></tr><tr><td>TemplateNER</td><td>56.3</td><td>62.0</td><td>74.9</td><td>60.1</td><td>62.8</td><td>65.0</td></tr><tr><td>BARTNER*</td><td>70.1</td><td>74.6</td><td>82.6</td><td>65.3</td><td>74.4</td><td>75.7</td></tr><tr><td>LightNER</td><td>78.0</td><td>80.6</td><td>84.8</td><td>70.8</td><td>75.5</td><td>80.2</td></tr><tr><td>InstructionNER+ETEE</td><td>74.3</td><td>78.4</td><td>82.3</td><td>72.7</td><td>75.5</td><td>76.6</td></tr><tr><td>2INER</td><td>81.3</td><td>83.54</td><td>86.16</td><td>76.57</td><td>78.31</td><td>79.11</td></tr></table>",
1251
+ "bbox": [
1252
+ 510,
1253
+ 249,
1254
+ 885,
1255
+ 376
1256
+ ],
1257
+ "page_idx": 7
1258
+ },
1259
+ {
1260
+ "type": "text",
1261
+ "text": "Table 5: The F1 (\\%) under relatively abundant settings. \" * \" indicates the reproduction results by (Wang et al., 2022). Bold numbers indicate the best F1.",
1262
+ "bbox": [
1263
+ 507,
1264
+ 386,
1265
+ 882,
1266
+ 429
1267
+ ],
1268
+ "page_idx": 7
1269
+ },
1270
+ {
1271
+ "type": "text",
1272
+ "text": "And 2INER outperforms LightNER in all settings except 500-shots in MIT Restaurant, which shows that 2INER has great NER abilities under data abundant scenario as well. We argue that the in-context Example field may help the model to learn from more diverse samples from the abundant training set and turn the general knowledge into specialized capabilities, leading to the improvement in F1.",
1273
+ "bbox": [
1274
+ 507,
1275
+ 457,
1276
+ 882,
1277
+ 586
1278
+ ],
1279
+ "page_idx": 7
1280
+ },
1281
+ {
1282
+ "type": "text",
1283
+ "text": "6 Conclusion",
1284
+ "text_level": 1,
1285
+ "bbox": [
1286
+ 507,
1287
+ 601,
1288
+ 640,
1289
+ 615
1290
+ ],
1291
+ "page_idx": 7
1292
+ },
1293
+ {
1294
+ "type": "text",
1295
+ "text": "In this paper, we propose 2INER for few-shot NER using both instruction finetuning and in-context learning by converting NER into a text-to-text framework. Based on InstructionNER, we create a template to concatenate task-specific instructions, input sentence and entity alternatives to make full use of the pre-training knowledge. Besides, we decompose NER into three steps and introduce another auxiliary tasks, called type extraction, to help the model better understand the general semantic meaning of the entity types, which can improve both span recognition and entity labeling abilities. Moreover, we apply the in-context examples to enable the model to learn from additional contextual information, enhancing few-shot abilities. Multiple experiments on four NER datasets prove 2INER's effectiveness in few-shot NER scenario by consistently outperforming other baselines.",
1296
+ "bbox": [
1297
+ 505,
1298
+ 629,
1299
+ 884,
1300
+ 917
1301
+ ],
1302
+ "page_idx": 7
1303
+ },
1304
+ {
1305
+ "type": "page_number",
1306
+ "text": "3947",
1307
+ "bbox": [
1308
+ 480,
1309
+ 927,
1310
+ 519,
1311
+ 940
1312
+ ],
1313
+ "page_idx": 7
1314
+ },
1315
+ {
1316
+ "type": "text",
1317
+ "text": "Limitations",
1318
+ "text_level": 1,
1319
+ "bbox": [
1320
+ 114,
1321
+ 84,
1322
+ 220,
1323
+ 99
1324
+ ],
1325
+ "page_idx": 8
1326
+ },
1327
+ {
1328
+ "type": "text",
1329
+ "text": "One limitation of our work is the extensive length of the Example and Alternative field when there are too many existed entity types. While incorporating in-context examples in the input sentence can improve few-shot NER performance, it poses a challenge when the Example field becomes too long because we add at least one examples for each potential entity type, especially when the Alternative list contains numerous entity types. This can result in less improvement gains and more computational costs. To address this issue, we assume that larger PLMs such as the recently proposed LLaMA (Touvron et al., 2023) could potentially be explored in future research as a means of resolution.",
1330
+ "bbox": [
1331
+ 112,
1332
+ 112,
1333
+ 492,
1334
+ 336
1335
+ ],
1336
+ "page_idx": 8
1337
+ },
1338
+ {
1339
+ "type": "text",
1340
+ "text": "Ethics Statement",
1341
+ "text_level": 1,
1342
+ "bbox": [
1343
+ 114,
1344
+ 351,
1345
+ 265,
1346
+ 366
1347
+ ],
1348
+ "page_idx": 8
1349
+ },
1350
+ {
1351
+ "type": "text",
1352
+ "text": "In consideration of ethical concerns, we would make the following descriptions: (1) All of our experiments are conducted using existing datasets sourced from publicly available scientific papers. (2) Our few-shot methods don't require a lot of computational resources. (3) Our text generation models will generate texts based on existing templates, so it won't generate harmful sentences.",
1353
+ "bbox": [
1354
+ 112,
1355
+ 379,
1356
+ 489,
1357
+ 507
1358
+ ],
1359
+ "page_idx": 8
1360
+ },
1361
+ {
1362
+ "type": "text",
1363
+ "text": "References",
1364
+ "text_level": 1,
1365
+ "bbox": [
1366
+ 114,
1367
+ 537,
1368
+ 213,
1369
+ 551
1370
+ ],
1371
+ "page_idx": 8
1372
+ },
1373
+ {
1374
+ "type": "list",
1375
+ "sub_type": "ref_text",
1376
+ "list_items": [
1377
+ "Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901.",
1378
+ "Jiawei Chen, Qing Liu, Hongyu Lin, Xianpei Han, and Le Sun. 2022a. Few-shot named entity recognition with self-describing networks. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5711-5722, Dublin, Ireland. Association for Computational Linguistics.",
1379
+ "Xiang Chen, Lei Li, Shumin Deng, Chuanqi Tan, Changliang Xu, Fei Huang, Luo Si, Huajun Chen, and Ningyu Zhang. 2022b. LightNER: A lightweight tuning paradigm for low-resource NER via pluggable prompting. In Proceedings of the 29th International Conference on Computational Linguistics, pages 2374-2387, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.",
1380
+ "Yanru Chen, Yanan Zheng, and Zhilin Yang. 2022c. Prompt-based metric learning for few-shot ner. arXiv preprint arXiv:2211.04337."
1381
+ ],
1382
+ "bbox": [
1383
+ 115,
1384
+ 561,
1385
+ 489,
1386
+ 917
1387
+ ],
1388
+ "page_idx": 8
1389
+ },
1390
+ {
1391
+ "type": "list",
1392
+ "sub_type": "ref_text",
1393
+ "list_items": [
1394
+ "Jason P.C. Chiu and Eric Nichols. 2016. Named entity recognition with bidirectional LSTM-CNNs. Transactions of the Association for Computational Linguistics, 4:357-370.",
1395
+ "Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. 2022. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416.",
1396
+ "Leyang Cui, Yu Wu, Jian Liu, Sen Yang, and Yue Zhang. 2021. Template-based named entity recognition using BART. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 1835–1845, Online. Association for Computational Linguistics.",
1397
+ "Leyang Cui and Yue Zhang. 2019. Hierarchically-refined label attention network for sequence labeling. 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), pages 4115-4128, Hong Kong, China. Association for Computational Linguistics.",
1398
+ "Xiang Dai, Sarvnaz Karimi, Ben Hachey, and Cecile Paris. 2020. An effective transition-based model for discontinuous NER. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5860-5870, Online. Association for Computational Linguistics.",
1399
+ "Sarkar Snigdha Sarathi Das, Arzoo Katiyar, Rebecca Passonneau, and Rui Zhang. 2022. CONTaiNER: Few-shot named entity recognition via contrastive learning. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6338-6353, Dublin, Ireland. Association for Computational Linguistics.",
1400
+ "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics.",
1401
+ "Alexander Fritzler, Varvara Logacheva, and Maksim Kretov. 2019. Few-shot classification in named entity recognition task. In Proceedings of the 34th ACM/SIGAPP Symposium on Applied Computing, pages 993-1000.",
1402
+ "Tao Gui, Jiacheng Ye, Qi Zhang, Zhengyan Li, Zichu Fei, Yeyun Gong, and Xuanjing Huang. 2020. Uncertainty-aware label refinement for sequence labeling. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2316-2326, Online. Association for Computational Linguistics."
1403
+ ],
1404
+ "bbox": [
1405
+ 510,
1406
+ 85,
1407
+ 884,
1408
+ 917
1409
+ ],
1410
+ "page_idx": 8
1411
+ },
1412
+ {
1413
+ "type": "page_number",
1414
+ "text": "3948",
1415
+ "bbox": [
1416
+ 480,
1417
+ 928,
1418
+ 519,
1419
+ 940
1420
+ ],
1421
+ "page_idx": 8
1422
+ },
1423
+ {
1424
+ "type": "list",
1425
+ "sub_type": "ref_text",
1426
+ "list_items": [
1427
+ "Dilek Hakkani-Tur, Gokhan Tur, Asli Celikyilmaz, YunNung Chen, Jianfeng Gao, Li Deng, and Ye-Yi Wang. 2016. Multi-domain joint semantic frame parsing using bi-directional rnn-lstm. In Interspeech, pages 715-719.",
1428
+ "Xu Han, Zhengyan Zhang, Ning Ding, Yuxian Gu, Xiao Liu, Yuqi Huo, Jiezhong Qiu, Yuan Yao, Ao Zhang, Liang Zhang, et al. 2021. Pre-trained models: Past, present and future. AI Open, 2:225-250.",
1429
+ "Yucheng Huang, Kai He, Yige Wang, Xianli Zhang, Tieliang Gong, Rui Mao, and Chen Li. 2022. COPNER: Contrastive learning with prompt guiding for few-shot named entity recognition. In Proceedings of the 29th International Conference on Computational Linguistics, pages 2515-2527, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.",
1430
+ "Sarvnaz Karimi, Alejandro Metke-Jimenez, Madonna Kemp, and Chen Wang. 2015. Cadec: A corpus of adverse drug event annotations. Journal of biomedical informatics, 55:73-81.",
1431
+ "J-D Kim, Tomoko Ohta, Yuka Tateisi, and Jun'ichi Tsujii. 2003. Genia corpus—a semantically annotated corpus for bio-textmining. Bioinformatics, 19(suppl_1):i180-i182.",
1432
+ "Dong-Ho Lee, Akshen Kadakia, Kangmin Tan, Mahak Agarwal, Xinyu Feng, Takashi Shibuya, Ryosuke Mitani, Toshiyuki Sekiya, Jay Pujara, and Xiang Ren. 2022a. Good examples make a faster learner: Simple demonstration-based learning for low-resource NER. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2687-2700, Dublin, Ireland. Association for Computational Linguistics.",
1433
+ "Dong-Ho Lee, Akshen Kadakia, Kangmin Tan, Mahak Agarwal, Xinyu Feng, Takashi Shibuya, Ryosuke Mitani, Toshiyuki Sekiya, Jay Pujara, and Xiang Ren. 2022b. Good examples make a faster learner: Simple demonstration-based learning for low-resource NER. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2687-2700, Dublin, Ireland. Association for Computational Linguistics.",
1434
+ "Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. 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, pages 7871-7880, Online. Association for Computational Linguistics.",
1435
+ "Xiaoya Li, Jingrong Feng, Yuxian Meng, Qinghong Han, Fei Wu, and Jiwei Li. 2020a. A unified MRC framework for named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5849-5859, Online. Association for Computational Linguistics."
1436
+ ],
1437
+ "bbox": [
1438
+ 115,
1439
+ 85,
1440
+ 485,
1441
+ 917
1442
+ ],
1443
+ "page_idx": 9
1444
+ },
1445
+ {
1446
+ "type": "list",
1447
+ "sub_type": "ref_text",
1448
+ "list_items": [
1449
+ "Xiaoya Li, Jingrong Feng, Yuxian Meng, Qinghong Han, Fei Wu, and Jiwei Li. 2020b. A unified MRC framework for named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5849-5859, Online. Association for Computational Linguistics.",
1450
+ "Jingjing Liu, Panupong Pasupat, Scott Cyphers, and Jim Glass. 2013. Asgard: A portable architecture for multilingual dialogue systems. In 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, pages 8386-8390. IEEE.",
1451
+ "Kun Liu, Yao Fu, Chuanqi Tan, Mosha Chen, Ningyu Zhang, Songfang Huang, and Sheng Gao. 2021. Noisy-labeled NER with confidence estimation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3437-3445, Online. Association for Computational Linguistics.",
1452
+ "Yijin Liu, Fandong Meng, Jinchao Zhang, Jinan Xu, Yufeng Chen, and Jie Zhou. 2019. GCDT: A global context enhanced deep transition architecture for sequence labeling. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2431-2441, Florence, Italy. Association for Computational Linguistics.",
1453
+ "Jie Ma, Miguel Ballesteros, Srikanth Doss, Rishita Anubhai, Sunil Mallya, Yaser Al-Onaizan, and Dan Roth. 2022a. Label semantics for few shot named entity recognition. In Findings of the Association for Computational Linguistics: ACL 2022, pages 1956-1971, Dublin, Ireland. Association for Computational Linguistics.",
1454
+ "Tingting Ma, Huiqiang Jiang, Qianhui Wu, Tiejun Zhao, and Chin-Yew Lin. 2022b. Decomposed meta-learning for few-shot named entity recognition. In Findings of the Association for Computational Linguistics: ACL 2022, pages 1584-1596, Dublin, Ireland. Association for Computational Linguistics.",
1455
+ "Xuezhe Ma and Eduard Hovy. 2016. End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1064-1074, Berlin, Germany. Association for Computational Linguistics.",
1456
+ "Alejandro Metke-Jimenez and Sarvnaz Karimi. 2016. Concept identification and normalisation for adverse drug event discovery in medical forums. In BMDID@ ISWC.",
1457
+ "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485-5551."
1458
+ ],
1459
+ "bbox": [
1460
+ 510,
1461
+ 85,
1462
+ 880,
1463
+ 917
1464
+ ],
1465
+ "page_idx": 9
1466
+ },
1467
+ {
1468
+ "type": "page_number",
1469
+ "text": "3949",
1470
+ "bbox": [
1471
+ 480,
1472
+ 928,
1473
+ 519,
1474
+ 940
1475
+ ],
1476
+ "page_idx": 9
1477
+ },
1478
+ {
1479
+ "type": "list",
1480
+ "sub_type": "ref_text",
1481
+ "list_items": [
1482
+ "Victor Sanh, Albert Webson, Colin Raffel, Stephen H Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, et al. 2021. Multitask prompted training enables zero-shot task generalization. arXiv preprint arXiv:2110.08207.",
1483
+ "Jake Snell, Kevin Swersky, and Richard Zemel. 2017. Prototypical networks for few-shot learning. Advances in neural information processing systems, 30.",
1484
+ "Emma Strubell, Patrick Verga, David Belanger, and Andrew McCallum. 2017. Fast and accurate entity recognition with iterated dilated convolutions. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2670-2680, Copenhagen, Denmark. Association for Computational Linguistics.",
1485
+ "Buzhou Tang, Jianglu Hu, Xiaolong Wang, and Qingcai Chen. 2018. Recognizing continuous and discontinuous adverse drug reaction mentions from social media using lstm-crf. Wireless Communications & Mobile Computing (Online), 2018.",
1486
+ "Erik F. Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the CoNLL-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pages 142-147.",
1487
+ "Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.",
1488
+ "Jue Wang, Lidan Shou, Ke Chen, and Gang Chen. 2020. Pyramid: A layered model for nested named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5918-5928, Online. Association for Computational Linguistics.",
1489
+ "Liwen Wang, Rumei Li, Yang Yan, Yuanmeng Yan, Sirui Wang, Wei Wu, and Weiran Xu. 2022. Instructionner: A multi-task instruction-based generative framework for few-shot ner. arXiv preprint arXiv:2203.03903.",
1490
+ "Jason Wei, Maarten Bosma, Vincent Y Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. 2021. Finetuned language models are zero-shot learners. arXiv preprint arXiv:2109.01652.",
1491
+ "Ikuya Yamada, Akari Asai, Hiroyuki Shindo, Hideaki Takeda, and Yuji Matsumoto. 2020. LUKE: Deep contextualized entity representations with entity-aware self-attention. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6442-6454, Online. Association for Computational Linguistics."
1492
+ ],
1493
+ "bbox": [
1494
+ 115,
1495
+ 85,
1496
+ 489,
1497
+ 917
1498
+ ],
1499
+ "page_idx": 10
1500
+ },
1501
+ {
1502
+ "type": "list",
1503
+ "sub_type": "ref_text",
1504
+ "list_items": [
1505
+ "Hang Yan, Tao Gui, Junqi Dai, Qipeng Guo, Zheng Zhang, and Xipeng Qiu. 2021. A unified generative framework for various NER subtasks. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 5808-5822, Online. Association for Computational Linguistics.",
1506
+ "Jie Yang, Shuailong Liang, and Yue Zhang. 2018. Design challenges and misconceptions in neural sequence labeling. In Proceedings of the 27th International Conference on Computational Linguistics, pages 3879-3889, Santa Fe, New Mexico, USA. Association for Computational Linguistics.",
1507
+ "Yi Yang and Arzoo Katiyar. 2020. Simple and effective few-shot named entity recognition with structured nearest neighbor learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6365-6375, Online. Association for Computational Linguistics.",
1508
+ "Juntao Yu, Bernd Bohnet, and Massimo Poesio. 2020a. Named entity recognition as dependency parsing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6470-6476, Online. Association for Computational Linguistics.",
1509
+ "Juntao Yu, Bernd Bohnet, and Massimo Poesio. 2020b. Named entity recognition as dependency parsing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6470-6476, Online. Association for Computational Linguistics.",
1510
+ "Ningyu Zhang, Shumin Deng, Zhen Bi, Haiyang Yu, Jiacheng Yang, Mosha Chen, Fei Huang, Wei Zhang, and Huajun Chen. 2020. OpenUE: An open toolkit of universal extraction from text. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 1-8, Online. Association for Computational Linguistics."
1511
+ ],
1512
+ "bbox": [
1513
+ 510,
1514
+ 85,
1515
+ 884,
1516
+ 657
1517
+ ],
1518
+ "page_idx": 10
1519
+ },
1520
+ {
1521
+ "type": "text",
1522
+ "text": "A Appendix",
1523
+ "text_level": 1,
1524
+ "bbox": [
1525
+ 510,
1526
+ 669,
1527
+ 633,
1528
+ 686
1529
+ ],
1530
+ "page_idx": 10
1531
+ },
1532
+ {
1533
+ "type": "text",
1534
+ "text": "In this section, we will discuss the remaining two NER settings: nested NER and discontinuous NER. Because the text-to-text structure of our proposed method can be easily adapted to all three NER settings, which will result in a unified structure for solving NER problems. Here, we mainly discuss standard NER scenarios with abundant data.",
1535
+ "bbox": [
1536
+ 510,
1537
+ 694,
1538
+ 884,
1539
+ 804
1540
+ ],
1541
+ "page_idx": 10
1542
+ },
1543
+ {
1544
+ "type": "text",
1545
+ "text": "For data abundant nested NER, We conduct experiments on Genia (Kim et al., 2003). We follow BARTNER (Yan et al., 2021) to use five entities types and split the train, dev, test as 8.1:0.9:1.0. The results are in Table 6.",
1546
+ "bbox": [
1547
+ 510,
1548
+ 806,
1549
+ 884,
1550
+ 885
1551
+ ],
1552
+ "page_idx": 10
1553
+ },
1554
+ {
1555
+ "type": "text",
1556
+ "text": "For data abundant discontinuous NER, we conduct experiments on CADEC (Karimi et al., 2015).",
1557
+ "bbox": [
1558
+ 510,
1559
+ 887,
1560
+ 884,
1561
+ 917
1562
+ ],
1563
+ "page_idx": 10
1564
+ },
1565
+ {
1566
+ "type": "page_number",
1567
+ "text": "3950",
1568
+ "bbox": [
1569
+ 480,
1570
+ 928,
1571
+ 521,
1572
+ 940
1573
+ ],
1574
+ "page_idx": 10
1575
+ },
1576
+ {
1577
+ "type": "table",
1578
+ "img_path": "images/aa1ce3f42503e4314d4568f3745c8ccb113375eb4bdf63eb875421d10a6ab47a.jpg",
1579
+ "table_caption": [],
1580
+ "table_footnote": [],
1581
+ "table_body": "<table><tr><td>Genia: Model</td><td>P</td><td>R</td><td>F</td></tr><tr><td>(Li et al., 2020b)[BERT-Large]†</td><td>81.25</td><td>76.36</td><td>78.72</td></tr><tr><td>(Yu et al., 2020b)[BERT-Large]†</td><td>79.43</td><td>78.32</td><td>78.87</td></tr><tr><td>(Wang et al., 2020)[BERT-Large]</td><td>79.45</td><td>78.94</td><td>79.19</td></tr><tr><td>BARTNER (Yan et al., 2021)</td><td>78.87</td><td>79.6</td><td>79.23</td></tr><tr><td>2INER</td><td>82.9</td><td>80.74</td><td>81.81</td></tr></table>",
1582
+ "bbox": [
1583
+ 115,
1584
+ 80,
1585
+ 502,
1586
+ 165
1587
+ ],
1588
+ "page_idx": 11
1589
+ },
1590
+ {
1591
+ "type": "table",
1592
+ "img_path": "images/d493dd0845cbc10bf9c8e07a0261bca83ad302c5b4731f8980439a864f39fefe.jpg",
1593
+ "table_caption": [
1594
+ "Table 6: Span-F1 (%) on Genia Nested data abundant NER setting. The \"†\" mean the reproduction by (Yan et al., 2021)."
1595
+ ],
1596
+ "table_footnote": [],
1597
+ "table_body": "<table><tr><td>CADEC: Model</td><td>P</td><td>R</td><td>F</td></tr><tr><td>(Metke-Jimenez and Karimi, 2016)</td><td>64.4</td><td>56.5</td><td>60.2</td></tr><tr><td>(Tang et al., 2018)</td><td>67.8</td><td>64.9</td><td>66.3</td></tr><tr><td>(Dai et al., 2020)[ELMo]</td><td>68.9</td><td>69.0</td><td>69.0</td></tr><tr><td>BARTNER (Yan et al., 2021)</td><td>70.08</td><td>71.21</td><td>70.64</td></tr><tr><td>2INER</td><td>71.18</td><td>75.26</td><td>73.16</td></tr></table>",
1598
+ "bbox": [
1599
+ 115,
1600
+ 230,
1601
+ 515,
1602
+ 313
1603
+ ],
1604
+ "page_idx": 11
1605
+ },
1606
+ {
1607
+ "type": "text",
1608
+ "text": "Table 7: Span-F1 (%) on CADEC discontinuous data abundant NER setting.",
1609
+ "bbox": [
1610
+ 112,
1611
+ 323,
1612
+ 485,
1613
+ 351
1614
+ ],
1615
+ "page_idx": 11
1616
+ },
1617
+ {
1618
+ "type": "text",
1619
+ "text": "Following BARTNER (Yan et al., 2021), since only the Adverse Drug Events (ADEs) entities include discontinuous data, only these entities were considered. The results are in Table 7.",
1620
+ "bbox": [
1621
+ 112,
1622
+ 376,
1623
+ 487,
1624
+ 441
1625
+ ],
1626
+ "page_idx": 11
1627
+ },
1628
+ {
1629
+ "type": "text",
1630
+ "text": "The experiment settings are the same as flat NER. We use T5-large as the backbone model and report span-level F1. The results show that in data abundant nested and discontinuous NER setting, our proposed method greatly outperforms BARTNER (Yan et al., 2021) and other SOTA methods, which demonstrates that our methods do have a potential to handle different NER settings in a unified framework.",
1631
+ "bbox": [
1632
+ 112,
1633
+ 442,
1634
+ 489,
1635
+ 586
1636
+ ],
1637
+ "page_idx": 11
1638
+ },
1639
+ {
1640
+ "type": "page_number",
1641
+ "text": "3951",
1642
+ "bbox": [
1643
+ 480,
1644
+ 928,
1645
+ 517,
1646
+ 940
1647
+ ],
1648
+ "page_idx": 11
1649
+ }
1650
+ ]
2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/3de52cb5-1c81-4fb7-8fab-f06b43c089a4_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/3de52cb5-1c81-4fb7-8fab-f06b43c089a4_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0dd589f8ba7f9c07fc0cc5914770641cf5b04e10abda592b40c8f21b2740e3c3
3
+ size 588891
2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/full.md ADDED
@@ -0,0 +1,286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 2INER: Instructive and In-Context Learning on Few-Shot Named Entity Recognition
2
+
3
+ Jiasheng Zhang $^{1}$ Xikai Liu $^{2}$ Xinyi Lai $^{3}$ Yan Gao $^{2}$
4
+
5
+ Shusen Wang² Yao Hu² Yiqing LIN
6
+
7
+ $^{1}$ Shanghai Jiaotong University $^{2}$ Xiaohongshu Inc. $^{3}$ Chongqing University
8
+
9
+ {js.zhang,yiqing.lin}@sjtu.edu.cn
10
+
11
+ {xikai,yadun,haxian,xiahou}@xiaohongshu.com
12
+
13
+ laixinyi@cqu.edu.cn
14
+
15
+ # Abstract
16
+
17
+ Prompt-based learning has emerged as a powerful technique in natural language processing (NLP) due to its ability to leverage pre-training knowledge for downstream few-shot tasks. In this paper, we propose 2INER, a novel text-to-text framework for Few-Shot Named Entity Recognition (NER) tasks. Our approach employs instruction finetuning based on InstructionNER (Wang et al., 2022) to enable the model to effectively comprehend and process task-specific instructions, including both main and auxiliary tasks. We also introduce a new auxiliary task, called Type Extraction, to enhance the model's understanding of entity types in the overall semantic context of a sentence. To facilitate in-context learning, we concatenate examples to the input, enabling the model to learn from additional contextual information. Experimental results on four datasets demonstrate that our approach outperforms existing Few-Shot NER methods and remains competitive with state-of-the-art standard NER algorithms.
18
+
19
+ # 1 Introduction
20
+
21
+ Named Entity Recognition (NER) has been a fundamental task of Natural Language Processing (NLP) and there are three types of sub-tasks in NER: flat NER (Tjong Kim Sang and De Meulder, 2003), nested NER (Kim et al., 2003) and discontinuous NER (Karimi et al., 2015). All three sub-tasks aim to locate named entities, extract the entity spans, and classify each span into pre-defined label categories. In terms of the flat NER which is the main focus of this paper, it can be formulated as a sequence labeling paradigm by assigning labels to each token in the sentence through token-classification models. The dominant methods include combining Pre-trained Language Models(PLMs) (Devlin et al., 2019) with label-specific classifier (LC) (Strubell et al., 2017; Cui and Zhang, 2019). However, the fixed shape of the output LC
22
+
23
+ layer necessitates a consistent label set for both the training and testing data, which poses a challenge for knowledge transfer. Therefore, these models need to be trained from scratch to adapt to a new domain with a different label set, highlighting the requirement for a large amount of data for these methods.
24
+
25
+ Due to the high cost of sequence labeling annotation in real-world scenarios, labeled data for NER is often limited. As a result, few-shot NER has gained significant attention due to its practical applications. Meanwhile, applying prompt-base learning (Han et al., 2021) on PLMs is an effective way to solve few-shot problems (Brown et al., 2020). PLMs can learn a lot of knowledge regarding human languages by training on a large amount of self-supervised corpus. In order to explore the potential of PLMs, prompt-based learning reformulate the downstream tasks to text-to-text framework with additional prompt indicating task descriptions (e.g. instruction fine-tuning (Wei et al., 2021; Chung et al., 2022; Sanh et al., 2021)). Through this approach, the model can effectively leverage the knowledge present in PLMs to enhance downstream skills without the need for additional large amounts of downstream data. This enables the model to achieve remarkable performance in few-shot settings.
26
+
27
+ Recently, many prompt-based NER methods have emerged to address the limitations of traditional few-shot NER approaches. TemplateNER (Cui et al., 2021) treats original sentence and predicted template filled by entity spans as source and target sequence, respectively, but all candidate spans must be enumerated during inference, leading to a high computational cost. CARTNER (Yan et al., 2021) proposed a pointer mechanism to unified all NER sub-tasks into one sequence-to-sequence (seq2seq) framework. CARTNER utilizes the raw sentence as input and outputs pointer index and tag index which represent the location
28
+
29
+ of the span and the corresponding label index in the category, respectively. To further adapt BARTNER for few-shot settings, LightNER (Chen et al., 2022b) proposed a lightweight tuning approach for low-resource settings by adding a unified learnable verbalizer and incorporating learnable parameters into the self-attention layers. Nonetheless, due to the fact that pointer mechanism only outputs the indexes of entities and labels, the model encounters challenges in effectively leveraging the capabilities of PLMs to directly comprehend the semantic meaning between entities and labels. Thus instead of using a pointer mechanism, InstructionNER (Wang et al., 2022) directly generates entity spans and types in the target sequence and applies instruction fine-tuning with two auxiliary tasks to further mining the capabilities of PLMs, which leads to significant few-shot improvements.
30
+
31
+ In terms of the auxiliary tasks in InstructionNER, they propose two auxiliary tasks from two perspectives: span recognition (Entity Extraction) and entity labeling (Entity Typing). However, we argue that NER can be further divided into three parts: 1) understand the relationship between the label and semantic meaning of the sentence. 2) extract the spans. 3) annotate the given spans. We believe that both span recognition and entity labeling can be benefit from having a deeper understanding of the label semantics. Therefore, we proposed a new auxiliary task, called Type Extraction, to help the model to acquire this ability.
32
+
33
+ Meanwhile, none of the above methods take the additional external knowledge into account. Current literature related to utilize external knowledge in NER involve (Chen et al., 2022a) and (Lee et al., 2022a). SDNet (Chen et al., 2022a) proposes a self-describing mechanism to leverage external resources by self-describing both entity types and mentions, while (Lee et al., 2022a) uses a demonstration-based method by incorporating examples to the input but without a text-to-text framework. Therefore, to the best of our knowledge, there is currently no existing literature that combines in-context external knowledge with instruction fine-tuning for few-shot NER.
34
+
35
+ In this paper, we propose 2INER(Instructive and In-Context Learning on Few-Shot NER). We build upon the work of InstructionNER by incorporating in-context examples and a novel auxiliary task. Specifically, we first reformulate the NER tasks into a text-to-text framework and then employ T5
36
+
37
+ (Raffel et al., 2020) for natural language generation. In terms of the source sentence, we use instructions to distinguish between tasks by giving a comprehensive task description and include an alternative field to identify the entity type that requires detection. Moreover, we suggest incorporating in-context demonstration examples into the source sentence to enable the model to learn from external knowledge. For the target sentence, we use natural language to represent entity spans and types instead of pointer mechanism. In addition to the two auxiliary tasks used in InstructionNER, we propose a new task called type extraction to further explore the potential of PLMs to understand label semantics. Type Extraction task requires the model to identify all the entity types presented in the original sentence and learn to understand the meaning of entity types at the overall semantic level of the sentence. Our contributions can be summarized as follows:
38
+
39
+ - To utilize external knowledge, we apply demonstration-based in-context learning examples to the instruction template. The in-context examples enable the model to directly learn which spans correspond to which types from these additional information, leading to better few-shot abilities.
40
+ - We expand the NER capabilities by dividing them into three components instead of two. And we propose a novel auxiliary task for instructions fine-tuning, called type extraction, to address the existing gap. It can enable the model to understand the meaning of the entity types through the overall semantic level of the sentence, which will improve span recognition and entity labeling abilities.
41
+ - We conduct extensive experiments on four datasets, demonstrating that 2NER outperforms existing few-shot NER methods and remains competitive with SOTA standard NER algorithms.
42
+
43
+ # 2 Related Work
44
+
45
+ # 2.1 Named Entity Recognition
46
+
47
+ Currently, NER tasks can be divided into flat NER (Tjong Kim Sang and De Meulder, 2003), nested NER (Kim et al., 2003) and discontinuous NER (Karimi et al., 2015), while in this paper, we mainly focus on the flat NER task. The current dominant method to solve flat NER is using token-level classification by turning it into a sequence labeling problem (Chiu and Nichols, 2016; Liu et al., 2019; Zhang et al., 2020; Liu et al., 2021), which apply a text encoder and CRF (Ma and Hovy, 2016) in
48
+
49
+ sequence. Recently, CARTNER (Yan et al., 2021) formulate all three NER tasks into a text-to-text framework to solve them concurrently. CARTNER generate entity span sequences by a pointer-based model based on BART (Lewis et al., 2020) so that special design of tagging schema or spans post-processing are no longer needed.
50
+
51
+ # 2.2 Prompt-based Learning
52
+
53
+ With the emergence of GPT-3 (Brown et al., 2020), prompt-based learning has gained increasing attention. It can better stimulate the knowledge model learned in pre-training stages and integrate different tasks together compared to the paradigm of fine-tuning separate model for each task, especially in few-shot settings (Han et al., 2021). To push prompt-based learning further, instruction-based learning (Wei et al., 2021) is proposed to fine-tune the PLMs on a collection of task descriptions which enables the model to better follow human instructions and generalize to unseen tasks with better zero-shot and few-shot abilities (Chung et al., 2022; Sanh et al., 2021).
54
+
55
+ # 2.3 Few-Shot NER Methods
56
+
57
+ One line of work in few-shot NER is to apply contrastive learning to assign the labels by searching for the closest token (Das et al., 2022; Chen et al., 2022c), prototype (Snell et al., 2017; Fritzler et al., 2019; Ma et al., 2022b) or label semantic (Ma et al., 2022a; Huang et al., 2022) in the support set. Another line of researches is prompt-based learning using a unified text-to-text framework to make full use of the PLMs abilities. (Cui et al., 2021) applies span classification using BART and (Chen et al., 2022b; Yan et al., 2021) use a pointer mechanism to generate indexes of spans and types. (Wang et al., 2022) utilizes instruction fine-tuning and two auxiliary tasks to train T5. Meanwhile, to apply external knowledge to the model, (Chen et al., 2022a) introduces a self-describing mechanism and (Lee et al., 2022a) uses a demonstration-based method. Therefore, our methods introduce in-context learning via instruction fine-tuning together to achieve better few-shot NER abilities, which haven't been fully discussed yet in seq2seq NER settings.
58
+
59
+ # 3 Methodology
60
+
61
+ # 3.1 NER Definition
62
+
63
+ NER aims to predict all spans in the input sentence as well as the entity types associated with the spans.
64
+
65
+ The standard flatten-NER can be formulated as follows, given the input sentence containing $n$ tokens $X = [x_{1}, x_{2}, \ldots, x_{n}]$ , the model has to predict the target sentence $Y = [l_{1}, l_{2}, \ldots, l_{n}]$ . We use $V_{BIO}$ to denote the BIO label set, so $\forall l_{i}, l_{i} \in V_{BIO}$ . While in the sequence-to-sequence modeling scenario, the input sentence is still $X$ but instead of predicting $Y$ , the model predicts each entity $y_{i} = (e_{i}, s_{i})$ directly, where $s_{i}$ represents the entity span in $X$ . And $e_{i} \in V$ represents the entity type of $s_{i}$ , where $V$ is the set of entity types.
66
+
67
+ More specifically, we use $l$ and $r$ to indicate the left and right boundary of an entity span in $X$ , so $s_i$ can be simplified as $s_i = x_{l:r}$ , where $x_{l:r} = [x_l, x_{l+1}, \dots, x_r]$ . Therefore, the NER model has to predict each $y_i$ in $X$ , indicating that the span $s_i$ belongs to the $e_i$ entity type.
68
+
69
+ # 3.2 Convert NER to Text-to-text Task
70
+
71
+ Using language models like T5 (Raffel et al., 2020) to solve most NLP tasks in a unified text-to-text framework can not only fully utilize the knowledge model learned in the pre-training stage but also simplify the training by using same data format, same loss and same model architecture. Moreover, Compared to using simple prompts, using instruction finetuning can further explore the capabilities of the model (Chung et al., 2022; Sanh et al., 2021). Besides, utilizing in-context learning can further enhance the model's few-shot capabilities in general (Brown et al., 2020) and specifically NER abilities (Lee et al., 2022b). Therefore, we transform the NER task into a text-to-text format and employ instruction finetuning and in-context learning to unleash the model's few-shot capabilities, as shown in Figure 1. The backbone we used is T5.
72
+
73
+ The basic text-to-text format of the main NER tasks consists of the following three parts, which is inspired by InstructionNER (Wang et al., 2022) $^{1}$ :
74
+
75
+ Instruction The instruction is a prompt that informs the model about the current task it needs to perform. The model is expected to follow the instructions provided within the prompt and complete the task accordingly. The instruction for the main NER task is: Please extract entities and their types from the Sentence, choose entity types from Alternatives.
76
+
77
+ Sentence The sentence is the input $X$ from which entities need to be extracted.
78
+
79
+ <sup>1</sup>The templates of auxiliary tasks and in-context Example will be discussed in 3.4 and 3.3 respectively.
80
+
81
+ ![](images/373832b663573beaab873631fd7634757242b782f75d1348c308506edd49c34b.jpg)
82
+ Figure 1: The model architecture of our proposed 2INER. The left and right sides are the source and target sentence of the model, respectively.
83
+
84
+ Alternatives Alternatives is a list of entity types $(V)$ split by comma, from which the model needs to select the corresponding type to annotate the corresponding span. Alternatives serves as a constraint and a guiding factor, informing the model that it can only select entity types from within this list.
85
+
86
+ In order to formulate the NER output to natural language, for each NER output $y_{i} = (e_{i}, s_{i})$ , we use the following template to convert it to text: $s_{i}$ is $a / an$ $e_{i}$ , and we use dot to concatenate all detected entity occurrences $y_{i}$ to form the output text. In terms of the entity types $e_{i}$ , we use natural language to represent the entity instead of adding special tokens to the model<sup>2</sup>.
87
+
88
+ # 3.3 Auxiliary Tasks
89
+
90
+ To enhance the NER performance, in addition to the main task, we need to introduce several auxiliary tasks. In InstructionNER (Wang et al., 2022), they employed two auxiliary tasks: entity extraction and entity typing. Moreover, in this paper, a new auxiliary task called type extraction will be introduced. During training, the auxiliary task will also be in the form of text-to-text data, trained alongside the main task data.
91
+
92
+ The auxiliary task primarily aims to improve NER capabilities from three perspectives: understand label semantic, span recognition and entity labeling, since NER can be decomposed into three steps: understand the relationship between the label and semantic meaning of the sentence, then extract
93
+
94
+ the spans and finally annotate the given spans. We will discuss the configuration of the auxiliary task in detail from these three perspectives.
95
+
96
+ # 3.3.1 Understand label semantic
97
+
98
+ Type Extraction The goal of the Type Extraction task is to identify all the entity types present in the original sentence. The Instruction is changed to: Please extract all entity types appeared in the Sentence. We will remove the Alternatives in this case, which means that there will be no constraints or hints regarding entity types in the input text, aiming to increase the difficulty of the task. And the output template is: $e_i$ type exists in the sentence. The Type Extraction task involves detecting whether a specific entity type appears in the sentence, without focusing on specific spans or associating spans with entity types. This task will assist the model in understanding the meaning of entity types at the overall semantic level of the sentence. We believe that once the model gains a deeper understanding of entity types, it will be able to comprehend the relationship between spans and types more accurately. As a result, it will enhance both span recognition and entity labeling capabilities simultaneously.
99
+
100
+ # 3.3.2 Span recognition
101
+
102
+ Entity Extraction The goal of the entity extraction task is to extract useful entity spans from the original sentence without the need for annotating the extracted spans. The instruction has been modified to: Please extract entities from the Sentence. Because the model doesn't need to type spans, the Alternatives field is deleted. And the output template has been changed to: $s_i$ is an entity word, since $e_i$ is no longer needed. Because the entity ex
103
+
104
+ traction task only require the model to predict useful spans regardless of the associated entity types, this task will guide the model to extract correct spans, enhancing the span-F1 accuracy, moreover, overall main task F1 as well (Wang et al., 2022).
105
+
106
+ The original InstructionNER (Wang et al., 2022) paper only employed span concatenation as the output(e.g. $s_1, s_2, s_3$ ). However, we believe that since the output of the main task consists of complete sentences with subject-verb-object structures, it would be more cohesive to follow the same pattern for the auxiliary tasks. And more structured output can fully utilize the PLMs's understanding of the task as well.
107
+
108
+ # 3.3.3 Entity Labeling
109
+
110
+ Entity Typing The entity typing task aims to type the given span with the correct label. The instruction has been modified to: Please type these entities according to the Sentence: <the given spans>. The Alternatives prompt and output template is the same as those in main task. During training, the given spans in the Instruction is the exact entity spans that have labels on. In entity typing task, since the spans are given, the model doesn't need to worry about the correctness of the span extracted, so the model can focus more on learning how to label the entity accurately, enhancing the main task NER ability.
111
+
112
+ # 3.4 In-Context Learning
113
+
114
+ In-context learning will be applied to further enhance few-shot NER capabilities. The main approach of in-context learning is to append Examples at the end of the input sentence, hoping that the model can directly learn which spans correspond to which types from these Examples, without the need for additional gradient updates. Besides, the in-context examples are also presented in natural language format, which closely resembles the output text format, serving as a reminder for the model about the desired format it should generate and making it easier for PLMs to understand. This similarity helps bridge the gap and facilitates the model's comprehension.
115
+
116
+ The in-context example format in NER is inspired by (Lee et al., 2022b). All examples in this context follow the template: span is a/an entity-type. And we will concatenate an additional prompt (based on the knowledge in Examples) after the Instruction to hint the model to learn from the Examples. During training stage, in-context Examples
117
+
118
+ will only be added to the main NER tasks and there will be no Examples added in auxiliary tasks, which will be discussed in detail in Analysis 5.2.
119
+
120
+ In terms of the choices of the samples in Examples, we randomly choose some spans appeared in the train set as well as their corresponding entity types to create Examples. Since we are uncertain about the entity types present in the sentence, we will provide at least one example for each entity type in the Alternatives list within the Examples. The number of samples of each entity types in Examples will also be the same $^3$ (e.g. in terms of MIT Movie dataset, there are 12 entity types. If we set the number of examples to 5, there will be 5 examples for each entity types, resulting in a total of $5^{*}12$ examples in the field).
121
+
122
+ # 3.5 Inference
123
+
124
+ During inference time, we first use the template of the main NER task to wrap the input sentence $X$ , and then feed the sentence to 2INER to get the predicted output text. In terms of the Example field, the example spans are sampled from the training support set, so the model won't see the groundtruth in the Examples during evaluation, avoiding information leakage. After the output text is generated, a decoding strategy will be applied to get the predicted entity $(e_i, s_i)$ : (1) We use dot to split the whole output text to obtain individual sub-texts. (2) We use "is a" or "is an" to split each sub-text if they can be found. (3) The span is the part before "is a/an" and the entity type is the part after it. Once we get the $(e_i, s_i)$ , we will check whether $s_i$ is in the input sentence $X$ and $e_i$ is in the set of entity types $V$ . If it doesn't pass the check, then it isn't a valid entity and will be deleted. And if any of the three steps result in a match failure, then the sub-text will be skipped.
125
+
126
+ # 4 Experiment
127
+
128
+ # 4.1 Dataset
129
+
130
+ We conduct NER experiments in standard and low-resources settings. For the rich-resources domain, we use CoNLL-2003 (Tjong Kim Sang and De Meulder, 2003) and for the low-resource domain, we use three datasets: MIT Movie Review, MIT Restaurant Review (Liu et al., 2013) and Airline Travel Information Systems (ATIS) (Hakkani
131
+
132
+ Tür et al., 2016), following (Wang et al., 2022; Chen et al., 2022b; Cui et al., 2021; Yan et al., 2021).
133
+
134
+ # 4.2 Implementation settings
135
+
136
+ In Few-Shot NER scenario, in order to guarantee that each entity type has equal number of instances in the training set, we can't sample $k$ sentences for each entity type directly because a single sentence may contain multiple entities, so the actual shot will exceed $k$ . Following (Wang et al., 2022), we will apply a greedy sampling strategy (Yang and Katiyar, 2020) instead, to sample the few-shot training set for each setting and due to the randomness of the sampling, we will repeat 3 times for each experiment. We use T5-large as the backbone model for fair comparison with (Wang et al., 2022). In terms of the number of examples in in-context Example field, we set the number to 5 for MIT Movie and MIT Restaurant dataset, and 1 for ATIS dataset as default. We only add in-context Example field on main-task, and don't include them in auxiliary tasks. The ratio of auxiliary tasks is set to $1.0$ . We set the batch size to $2/4/8$ , learning-rate to $2\mathrm{e}-5/5\mathrm{e}-5$ for $10/20/50$ Shot settings respectively, and set batch size to 32, learning-rate to $1\mathrm{e}-4$ for the abundant data setting. The optimizer is Adam and beam search is set to 2. For evaluation, we use F1 score as the metric for NER.
137
+
138
+ The names InstructionNER in the tables mean training with main-task data only, indicating the base model, and the subscript words in the tables indicate addition to the base model: +ET, +EE, +TE, +EX means adding Entity Typing, Entity Extraction, Type Extraction, in-context examples, respectively. And we named InstructionNER+ET,EE,TE,EX as 2INER, which is our final model.
139
+
140
+ # 4.3 Standard NER Setting
141
+
142
+ We use CoNLL-2003 dataset to conduct standard NER experiment. We combine the train and validation set as described in (Yan et al., 2021) to train the model. The result is in Table 1, which shows that even though our method mainly focuses on few-shot NER settings, it remains competitive with
143
+
144
+ <table><tr><td>Model</td><td>F1</td><td>Span-F1</td></tr><tr><td>(Yang et al., 2018)</td><td>90.77</td><td>-</td></tr><tr><td>(Ma and Hovy, 2016)</td><td>91.21</td><td>-</td></tr><tr><td>(Gui et al., 2020)</td><td>92.02</td><td>-</td></tr><tr><td>(Yamada et al., 2020)*</td><td>94.30</td><td>92.40</td></tr><tr><td>(Li et al., 2020a)†</td><td>-</td><td>92.87</td></tr><tr><td>(Yu et al., 2020a)‡</td><td>-</td><td>92.50</td></tr><tr><td>LC-BERT</td><td>91.73</td><td>-</td></tr><tr><td>LC-BART</td><td>90.60</td><td>-</td></tr><tr><td>TemplateNER</td><td>91.90</td><td>-</td></tr><tr><td>BARTNER</td><td>-</td><td>93.24</td></tr><tr><td>LightNER</td><td>92.93</td><td>-</td></tr><tr><td>2INER (InstructionNER+ET,EE,TE,EX)</td><td>90.71</td><td>93.93</td></tr></table>
145
+
146
+ Table 1: F1 and Span-F1 (%) on CoNLL-2003 Standard NER setting. Our method is competitive with SOTA algorithm and even outperform BARTNER (Yan et al., 2021) in span-F1. " * " indicates training on external data. "†" indicates the reproduction by (Yan et al., 2021). "‡" indicates the reproduction with only the sentence-level context by (Yan et al., 2021).
147
+
148
+ SOTA algorithm under standard NER setting and even outperform BARTNER (Yan et al., 2021) in span-F1, which is designed for rich-resource NER settings. The performances of 2INER in data abundant nested and discontinuous NER settings are in Appendix A.
149
+
150
+ # 4.4 Few-Shot NER Setting
151
+
152
+ Under Few-Shot NER setting, we only use K-Shot training samples to finetune our model and the results are in Table 2. According to the table, we can find that: (1) Our models consistently outperform InstructionNER as well as other baselines on all three datasets under 10/20/50 Shot settings (except 50Shot in ATIS, which is slightly lower than BARTNER). Especially in MIT Movie dataset, our models have $7.33\%$ , $6.76\%$ , $5.39\%$ improvements compared to InstructionNER under 10/20/50 settings. (2) Our 10Shot model even outperforms TempleNER's 50Shot model by $20.73\%$ and $7.06\%$ in MIT Movie and MIT Restaurant respectively, which highlights the superiority and capability of our model. (3) We have the same finding as InstructionNER (Wang et al., 2022) that F1 improvements are much more significant on MIT Movie than on MIT Restaurant ( $7.33\% / 6.76\% / 5.39\%$ v.s. $6.86\% / 3.24\% / 3.3\%$ under 10/20/50 Shot settings), which indicates that although MIT Movie has more entity types, text-to-text framework and instruction-tuning can better utilize pre-training knowledge, and through in-context learning, the model can learn more about the relationships between entities. (4) In ATIS dataset, the improve
153
+
154
+ <table><tr><td rowspan="2">Models</td><td colspan="3">MIT Movie</td><td colspan="3">MIT Restaurant</td><td colspan="3">ATIS</td></tr><tr><td>10</td><td>20</td><td>50</td><td>10</td><td>20</td><td>50</td><td>10</td><td>20</td><td>50</td></tr><tr><td>LC-BERT</td><td>25.2</td><td>42.2</td><td>49.6</td><td>21.8</td><td>39.4</td><td>52.7</td><td>44.1</td><td>76.7</td><td>90.7</td></tr><tr><td>LC-BART</td><td>10.2</td><td>27.5</td><td>44.2</td><td>6.3</td><td>8.5</td><td>51.3</td><td>42.0</td><td>72.7</td><td>87.5</td></tr><tr><td>TemplateNER</td><td>37.3</td><td>48.5</td><td>52.2</td><td>46.0</td><td>57.1</td><td>58.7</td><td>71.7</td><td>79.4</td><td>92.6</td></tr><tr><td>BARTNER*</td><td>41.1</td><td>54.0</td><td>67.7</td><td>44.0</td><td>56.0</td><td>64.0</td><td>77.7</td><td>86.1</td><td>93.4</td></tr><tr><td>LightNER</td><td>41.7</td><td>57.8</td><td>73.1</td><td>48.5</td><td>58.0</td><td>62.0</td><td>76.3</td><td>85.3</td><td>92.8</td></tr><tr><td>InstructionNER</td><td>64.4 (±2.1)</td><td>70.0 (±0.3)</td><td>74.1 (±1.2)</td><td>58.7 (±1.2)</td><td>65.5 (±1.4)</td><td>71.2 (±1.1)</td><td>90.14 (±0.12)†</td><td>91.22 (±0.19)†</td><td>92.53 (±0.14)†</td></tr><tr><td>InstructionNER+ET,EE</td><td>65.6 (±3.0)</td><td>70.1 (±1.9)</td><td>74.7 (±0.3)</td><td>58.9 (±0.8)</td><td>66.1 (±0.9)</td><td>71.1 (±0.9)</td><td>90.04 (±0.02)†</td><td>91.46 (±0.23)†</td><td>92.62 (±0.04)†</td></tr><tr><td>InstructionNER+EX</td><td>72.56 (±1.01)</td><td>74.99 (±0.27)</td><td>78.61 (±0.37)</td><td>64.07 (±1.25)</td><td>68.2 (±0.11)</td><td>74.38 (±0.19)</td><td>89.17 (±0.2)</td><td>91.33 (±0.05)</td><td>92.65 (±0.18)</td></tr><tr><td>InstructionNER+TE</td><td>72.0 (±0.25)</td><td>76.55 (±0.2)</td><td>80.02 (±0.26)</td><td>65.52 (±1.35)</td><td>68.67 (±0.95)</td><td>73.98 (±0.27)</td><td>90.77 (±0.6)</td><td>91.85 (±0.05)</td><td>92.69 (±0.1)</td></tr><tr><td>InstructionNER+ET,EE,TE,EX</td><td>72.93 (±0.91)</td><td>76.86 (±0.53)</td><td>80.09 (±0.22)</td><td>65.76 (±0.47)</td><td>69.34 (±0.81)</td><td>74.4 (±0.4)</td><td>90.47 (±0.26)</td><td>92.11 (±0.09)</td><td>92.83 (±0.15)</td></tr></table>
155
+
156
+ Table 2: The F1(\%) on three dataset under 10/20/50 Shot settings. The bold number means the best F1 across all models and the numbers in brackets means the standard deviation. The underline numbers mean the best results in our experiments. The "+" numbers mean the results of our reproduction. "* means the reproduction by InstructionNER (Wang et al., 2022).
157
+
158
+ ment of our model is less significant compared to other two datasets. We argue that this is because ATIS contains 79 entity types and even if we only provide one sample span for each entity types in in-context Example field, the average token length is 1099 compared to 368 with or without examples, where the token length of the Alternative filed is 327. So the actual input Sentence $X$ only accounts for $3.7\%$ of the total token length, which increases the difficulty for the model to extract key information from lengthy sentences. So too many entity types may potentially reduce model improvements.
159
+
160
+ # 4.5 Ablation Study
161
+
162
+ In order to find out the influence of our proposed type extraction task and in-context examples on model's few-shot abilities, we conduct ablation studies in Figure 2. The results indicate that adding type extraction task and in-context examples can further enhance the model's few-shot NER abilities. We set InstructionNER as the baseline here which only trains on main-task data without any auxiliary tasks. Then we add type extraction task (InstructionNER+TE) or in-context examples (InstructionNER+EX) respectively on the baseline model to explore their influences. The results from Figure 2 shows that in terms of 10/20/50 Shot settings in few-shot NER, type extraction task achieves an average improvements of $7.21\%$ , $4.86\%$ , $4.35\%$ F1 and in-context example achieves an average improvements of $6.76\%$ , $3.84\%$ , $3.84\%$ F1 in MIT Movie and MIT Restaurant dataset.
163
+
164
+ Moreover, adding type extraction task can greatly increase the Span-F1 as well. Because Span-F1 indicates the model's ability to locate
165
+
166
+ ![](images/ccbd7a22ac82ef0bf7eff5a54809f4a260d406dd5983e0a34343f0d4560b51d5.jpg)
167
+ Figure 2: F1 and Span-F1 $(\%)$ on MIT Movie and MIT Restaurant through 10/20/50 Shot settings with different task combinations. The deep and light color indicate F1 and Span-F1 respectively.
168
+
169
+ spans, the results reveal that through training on type extraction task, span recognition can be benefit from having a deeper understanding of the labels from the overall semantic level of sentence. Therefore, it proves the effectiveness of three steps of NER abilities we proposed in 3.3, and shows that type extraction task can simultaneously improve span recognition and entity labeling abilities through understanding label semantic.
170
+
171
+ # 5 Analysis
172
+
173
+ # 5.1 Increase Example Number
174
+
175
+ In this section, we will focus on how the number of examples in in-context Example field influence the model performance. We will sequentially change the number of examples to 1, 3, 5, 10, and 15, and train corresponding models to observe the change of F1 on MIT Restaurant dataset. We train our model with main-task and in-context example without any auxiliary tasks (InstructionNER+EX) in this section. The results are in Table 3.
176
+
177
+ <table><tr><td rowspan="2">InstructionNER+EX Examples</td><td colspan="2">MIT Restaurant</td></tr><tr><td>20 Shot</td><td>50 Shot</td></tr><tr><td>0</td><td>65.5 (±1.4)</td><td>71.2 (±1.1)</td></tr><tr><td>1</td><td>67.74 (±0.22)</td><td>73.89 (±0.15)</td></tr><tr><td>3</td><td>67.89 (±0.3)</td><td>74.15 (±0.39)</td></tr><tr><td>5</td><td>68.2 (±0.11)</td><td>74.38 (±0.19)</td></tr><tr><td>10</td><td>69.47 (±0.35)</td><td>74.41 (±0.18)</td></tr><tr><td>15</td><td>69.52 (±0.16)</td><td>74.64 (±0.49)</td></tr></table>
178
+
179
+ As the number of examples increases, F1 score continues to increase and the largest improvement in F1 score occurs when going from zero examples to one example. As the number of examples increases further, the F1 will continue to increase but the rate of improvement gradually slows down. This suggests that when only one in-context example is provided, the model can quickly learn the specific meanings of each entity type from the example. While more examples may lead to repetitive cues to the model so a balance should be made between model performance and computational cost.
180
+
181
+ # 5.2 Effect of In-Context Example on Auxiliary task
182
+
183
+ In this section, we will discuss whether to add in-context examples on auxiliary task. The model is 2INER (InstructionNER+ET,EE,TE,EX) and we will compare two settings: add examples only on main-task, add examples on main-task as well as three auxiliary tasks. The results in Table 4 indicate that adding examples on auxiliary task will slightly decrease the F1 performance. Because adding examples to auxiliary tasks may potentially reduce their difficulty and make it too easy for the model, thereby reducing the auxiliary tasks' effectiveness in aiding the main task. So adding examples only to the main task is a better approach.
184
+
185
+ # 5.3 Increase Shot
186
+
187
+ In this section, we will discuss the model performance under relatively abundant settings. We increase the shots to 100, 200 and 500 in MIT Movie and MIT Restaurant datasets using 2INER (InstructionNER+ET,EE,TE,EX). As shown in Table 5, compared to InstructionNER, 2INER achieves $5.43\%$ , $3.98\%$ , $3.19\%$ improvements in F1 under 100/200/500 shots settings respectively.
188
+
189
+ Table 3: F1 scores(%) on MIT Restaurant dataset while changing number of examples using InstructionNER+EX. Bold numbers indicate the best F1 and the numbers in brackets means the standard deviation.
190
+
191
+ <table><tr><td></td><td colspan="3">MIT Restaurant</td></tr><tr><td></td><td>10 Shot</td><td>20 Shot</td><td>50 Shot</td></tr><tr><td>2INER</td><td>65.26</td><td>69.27</td><td>74.2</td></tr><tr><td>Examples on all tasks</td><td>(±0.49)</td><td>(±0.89)</td><td>(±0.45)</td></tr><tr><td>2INER</td><td>65.76</td><td>69.34</td><td>74.4</td></tr><tr><td>Examples only on Main-Task</td><td>(±0.47)</td><td>(±0.81)</td><td>(±0.4)</td></tr></table>
192
+
193
+ Table 4: The comparison between adding in-context examples only on main-task and on all tasks including auxiliary tasks. Bold numbers indicate the best F1 and the numbers in brackets means the standard deviation.
194
+
195
+ <table><tr><td rowspan="2">Models</td><td colspan="3">MIT Movie</td><td colspan="3">MIT Restaurant</td></tr><tr><td>100</td><td>200</td><td>500</td><td>100</td><td>200</td><td>500</td></tr><tr><td>LC-BERT</td><td>50.7</td><td>59.3</td><td>74.4</td><td>53.5</td><td>57.4</td><td>61.3</td></tr><tr><td>LC-BART</td><td>47.5</td><td>54.2</td><td>64.1</td><td>52.2</td><td>56.3</td><td>60.2</td></tr><tr><td>TemplateNER</td><td>56.3</td><td>62.0</td><td>74.9</td><td>60.1</td><td>62.8</td><td>65.0</td></tr><tr><td>BARTNER*</td><td>70.1</td><td>74.6</td><td>82.6</td><td>65.3</td><td>74.4</td><td>75.7</td></tr><tr><td>LightNER</td><td>78.0</td><td>80.6</td><td>84.8</td><td>70.8</td><td>75.5</td><td>80.2</td></tr><tr><td>InstructionNER+ETEE</td><td>74.3</td><td>78.4</td><td>82.3</td><td>72.7</td><td>75.5</td><td>76.6</td></tr><tr><td>2INER</td><td>81.3</td><td>83.54</td><td>86.16</td><td>76.57</td><td>78.31</td><td>79.11</td></tr></table>
196
+
197
+ Table 5: The F1 (\%) under relatively abundant settings. " * " indicates the reproduction results by (Wang et al., 2022). Bold numbers indicate the best F1.
198
+
199
+ And 2INER outperforms LightNER in all settings except 500-shots in MIT Restaurant, which shows that 2INER has great NER abilities under data abundant scenario as well. We argue that the in-context Example field may help the model to learn from more diverse samples from the abundant training set and turn the general knowledge into specialized capabilities, leading to the improvement in F1.
200
+
201
+ # 6 Conclusion
202
+
203
+ In this paper, we propose 2INER for few-shot NER using both instruction finetuning and in-context learning by converting NER into a text-to-text framework. Based on InstructionNER, we create a template to concatenate task-specific instructions, input sentence and entity alternatives to make full use of the pre-training knowledge. Besides, we decompose NER into three steps and introduce another auxiliary tasks, called type extraction, to help the model better understand the general semantic meaning of the entity types, which can improve both span recognition and entity labeling abilities. Moreover, we apply the in-context examples to enable the model to learn from additional contextual information, enhancing few-shot abilities. Multiple experiments on four NER datasets prove 2INER's effectiveness in few-shot NER scenario by consistently outperforming other baselines.
204
+
205
+ # Limitations
206
+
207
+ One limitation of our work is the extensive length of the Example and Alternative field when there are too many existed entity types. While incorporating in-context examples in the input sentence can improve few-shot NER performance, it poses a challenge when the Example field becomes too long because we add at least one examples for each potential entity type, especially when the Alternative list contains numerous entity types. This can result in less improvement gains and more computational costs. To address this issue, we assume that larger PLMs such as the recently proposed LLaMA (Touvron et al., 2023) could potentially be explored in future research as a means of resolution.
208
+
209
+ # Ethics Statement
210
+
211
+ In consideration of ethical concerns, we would make the following descriptions: (1) All of our experiments are conducted using existing datasets sourced from publicly available scientific papers. (2) Our few-shot methods don't require a lot of computational resources. (3) Our text generation models will generate texts based on existing templates, so it won't generate harmful sentences.
212
+
213
+ # References
214
+
215
+ Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901.
216
+ Jiawei Chen, Qing Liu, Hongyu Lin, Xianpei Han, and Le Sun. 2022a. Few-shot named entity recognition with self-describing networks. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5711-5722, Dublin, Ireland. Association for Computational Linguistics.
217
+ Xiang Chen, Lei Li, Shumin Deng, Chuanqi Tan, Changliang Xu, Fei Huang, Luo Si, Huajun Chen, and Ningyu Zhang. 2022b. LightNER: A lightweight tuning paradigm for low-resource NER via pluggable prompting. In Proceedings of the 29th International Conference on Computational Linguistics, pages 2374-2387, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.
218
+ Yanru Chen, Yanan Zheng, and Zhilin Yang. 2022c. Prompt-based metric learning for few-shot ner. arXiv preprint arXiv:2211.04337.
219
+
220
+ Jason P.C. Chiu and Eric Nichols. 2016. Named entity recognition with bidirectional LSTM-CNNs. Transactions of the Association for Computational Linguistics, 4:357-370.
221
+ Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. 2022. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416.
222
+ Leyang Cui, Yu Wu, Jian Liu, Sen Yang, and Yue Zhang. 2021. Template-based named entity recognition using BART. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 1835–1845, Online. Association for Computational Linguistics.
223
+ Leyang Cui and Yue Zhang. 2019. Hierarchically-refined label attention network for sequence labeling. 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), pages 4115-4128, Hong Kong, China. Association for Computational Linguistics.
224
+ Xiang Dai, Sarvnaz Karimi, Ben Hachey, and Cecile Paris. 2020. An effective transition-based model for discontinuous NER. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5860-5870, Online. Association for Computational Linguistics.
225
+ Sarkar Snigdha Sarathi Das, Arzoo Katiyar, Rebecca Passonneau, and Rui Zhang. 2022. CONTaiNER: Few-shot named entity recognition via contrastive learning. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6338-6353, Dublin, Ireland. Association for Computational Linguistics.
226
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics.
227
+ Alexander Fritzler, Varvara Logacheva, and Maksim Kretov. 2019. Few-shot classification in named entity recognition task. In Proceedings of the 34th ACM/SIGAPP Symposium on Applied Computing, pages 993-1000.
228
+ Tao Gui, Jiacheng Ye, Qi Zhang, Zhengyan Li, Zichu Fei, Yeyun Gong, and Xuanjing Huang. 2020. Uncertainty-aware label refinement for sequence labeling. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2316-2326, Online. Association for Computational Linguistics.
229
+
230
+ Dilek Hakkani-Tur, Gokhan Tur, Asli Celikyilmaz, YunNung Chen, Jianfeng Gao, Li Deng, and Ye-Yi Wang. 2016. Multi-domain joint semantic frame parsing using bi-directional rnn-lstm. In Interspeech, pages 715-719.
231
+ Xu Han, Zhengyan Zhang, Ning Ding, Yuxian Gu, Xiao Liu, Yuqi Huo, Jiezhong Qiu, Yuan Yao, Ao Zhang, Liang Zhang, et al. 2021. Pre-trained models: Past, present and future. AI Open, 2:225-250.
232
+ Yucheng Huang, Kai He, Yige Wang, Xianli Zhang, Tieliang Gong, Rui Mao, and Chen Li. 2022. COPNER: Contrastive learning with prompt guiding for few-shot named entity recognition. In Proceedings of the 29th International Conference on Computational Linguistics, pages 2515-2527, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.
233
+ Sarvnaz Karimi, Alejandro Metke-Jimenez, Madonna Kemp, and Chen Wang. 2015. Cadec: A corpus of adverse drug event annotations. Journal of biomedical informatics, 55:73-81.
234
+ J-D Kim, Tomoko Ohta, Yuka Tateisi, and Jun'ichi Tsujii. 2003. Genia corpus—a semantically annotated corpus for bio-textmining. Bioinformatics, 19(suppl_1):i180-i182.
235
+ Dong-Ho Lee, Akshen Kadakia, Kangmin Tan, Mahak Agarwal, Xinyu Feng, Takashi Shibuya, Ryosuke Mitani, Toshiyuki Sekiya, Jay Pujara, and Xiang Ren. 2022a. Good examples make a faster learner: Simple demonstration-based learning for low-resource NER. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2687-2700, Dublin, Ireland. Association for Computational Linguistics.
236
+ Dong-Ho Lee, Akshen Kadakia, Kangmin Tan, Mahak Agarwal, Xinyu Feng, Takashi Shibuya, Ryosuke Mitani, Toshiyuki Sekiya, Jay Pujara, and Xiang Ren. 2022b. Good examples make a faster learner: Simple demonstration-based learning for low-resource NER. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2687-2700, Dublin, Ireland. Association for Computational Linguistics.
237
+ Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. 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, pages 7871-7880, Online. Association for Computational Linguistics.
238
+ Xiaoya Li, Jingrong Feng, Yuxian Meng, Qinghong Han, Fei Wu, and Jiwei Li. 2020a. A unified MRC framework for named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5849-5859, Online. Association for Computational Linguistics.
239
+
240
+ Xiaoya Li, Jingrong Feng, Yuxian Meng, Qinghong Han, Fei Wu, and Jiwei Li. 2020b. A unified MRC framework for named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5849-5859, Online. Association for Computational Linguistics.
241
+ Jingjing Liu, Panupong Pasupat, Scott Cyphers, and Jim Glass. 2013. Asgard: A portable architecture for multilingual dialogue systems. In 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, pages 8386-8390. IEEE.
242
+ Kun Liu, Yao Fu, Chuanqi Tan, Mosha Chen, Ningyu Zhang, Songfang Huang, and Sheng Gao. 2021. Noisy-labeled NER with confidence estimation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3437-3445, Online. Association for Computational Linguistics.
243
+ Yijin Liu, Fandong Meng, Jinchao Zhang, Jinan Xu, Yufeng Chen, and Jie Zhou. 2019. GCDT: A global context enhanced deep transition architecture for sequence labeling. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2431-2441, Florence, Italy. Association for Computational Linguistics.
244
+ Jie Ma, Miguel Ballesteros, Srikanth Doss, Rishita Anubhai, Sunil Mallya, Yaser Al-Onaizan, and Dan Roth. 2022a. Label semantics for few shot named entity recognition. In Findings of the Association for Computational Linguistics: ACL 2022, pages 1956-1971, Dublin, Ireland. Association for Computational Linguistics.
245
+ Tingting Ma, Huiqiang Jiang, Qianhui Wu, Tiejun Zhao, and Chin-Yew Lin. 2022b. Decomposed meta-learning for few-shot named entity recognition. In Findings of the Association for Computational Linguistics: ACL 2022, pages 1584-1596, Dublin, Ireland. Association for Computational Linguistics.
246
+ Xuezhe Ma and Eduard Hovy. 2016. End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1064-1074, Berlin, Germany. Association for Computational Linguistics.
247
+ Alejandro Metke-Jimenez and Sarvnaz Karimi. 2016. Concept identification and normalisation for adverse drug event discovery in medical forums. In BMDID@ ISWC.
248
+ Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485-5551.
249
+
250
+ Victor Sanh, Albert Webson, Colin Raffel, Stephen H Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, et al. 2021. Multitask prompted training enables zero-shot task generalization. arXiv preprint arXiv:2110.08207.
251
+ Jake Snell, Kevin Swersky, and Richard Zemel. 2017. Prototypical networks for few-shot learning. Advances in neural information processing systems, 30.
252
+ Emma Strubell, Patrick Verga, David Belanger, and Andrew McCallum. 2017. Fast and accurate entity recognition with iterated dilated convolutions. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2670-2680, Copenhagen, Denmark. Association for Computational Linguistics.
253
+ Buzhou Tang, Jianglu Hu, Xiaolong Wang, and Qingcai Chen. 2018. Recognizing continuous and discontinuous adverse drug reaction mentions from social media using lstm-crf. Wireless Communications & Mobile Computing (Online), 2018.
254
+ Erik F. Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the CoNLL-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pages 142-147.
255
+ Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
256
+ Jue Wang, Lidan Shou, Ke Chen, and Gang Chen. 2020. Pyramid: A layered model for nested named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5918-5928, Online. Association for Computational Linguistics.
257
+ Liwen Wang, Rumei Li, Yang Yan, Yuanmeng Yan, Sirui Wang, Wei Wu, and Weiran Xu. 2022. Instructionner: A multi-task instruction-based generative framework for few-shot ner. arXiv preprint arXiv:2203.03903.
258
+ Jason Wei, Maarten Bosma, Vincent Y Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. 2021. Finetuned language models are zero-shot learners. arXiv preprint arXiv:2109.01652.
259
+ Ikuya Yamada, Akari Asai, Hiroyuki Shindo, Hideaki Takeda, and Yuji Matsumoto. 2020. LUKE: Deep contextualized entity representations with entity-aware self-attention. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6442-6454, Online. Association for Computational Linguistics.
260
+
261
+ Hang Yan, Tao Gui, Junqi Dai, Qipeng Guo, Zheng Zhang, and Xipeng Qiu. 2021. A unified generative framework for various NER subtasks. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 5808-5822, Online. Association for Computational Linguistics.
262
+ Jie Yang, Shuailong Liang, and Yue Zhang. 2018. Design challenges and misconceptions in neural sequence labeling. In Proceedings of the 27th International Conference on Computational Linguistics, pages 3879-3889, Santa Fe, New Mexico, USA. Association for Computational Linguistics.
263
+ Yi Yang and Arzoo Katiyar. 2020. Simple and effective few-shot named entity recognition with structured nearest neighbor learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6365-6375, Online. Association for Computational Linguistics.
264
+ Juntao Yu, Bernd Bohnet, and Massimo Poesio. 2020a. Named entity recognition as dependency parsing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6470-6476, Online. Association for Computational Linguistics.
265
+ Juntao Yu, Bernd Bohnet, and Massimo Poesio. 2020b. Named entity recognition as dependency parsing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6470-6476, Online. Association for Computational Linguistics.
266
+ Ningyu Zhang, Shumin Deng, Zhen Bi, Haiyang Yu, Jiacheng Yang, Mosha Chen, Fei Huang, Wei Zhang, and Huajun Chen. 2020. OpenUE: An open toolkit of universal extraction from text. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 1-8, Online. Association for Computational Linguistics.
267
+
268
+ # A Appendix
269
+
270
+ In this section, we will discuss the remaining two NER settings: nested NER and discontinuous NER. Because the text-to-text structure of our proposed method can be easily adapted to all three NER settings, which will result in a unified structure for solving NER problems. Here, we mainly discuss standard NER scenarios with abundant data.
271
+
272
+ For data abundant nested NER, We conduct experiments on Genia (Kim et al., 2003). We follow BARTNER (Yan et al., 2021) to use five entities types and split the train, dev, test as 8.1:0.9:1.0. The results are in Table 6.
273
+
274
+ For data abundant discontinuous NER, we conduct experiments on CADEC (Karimi et al., 2015).
275
+
276
+ <table><tr><td>Genia: Model</td><td>P</td><td>R</td><td>F</td></tr><tr><td>(Li et al., 2020b)[BERT-Large]†</td><td>81.25</td><td>76.36</td><td>78.72</td></tr><tr><td>(Yu et al., 2020b)[BERT-Large]†</td><td>79.43</td><td>78.32</td><td>78.87</td></tr><tr><td>(Wang et al., 2020)[BERT-Large]</td><td>79.45</td><td>78.94</td><td>79.19</td></tr><tr><td>BARTNER (Yan et al., 2021)</td><td>78.87</td><td>79.6</td><td>79.23</td></tr><tr><td>2INER</td><td>82.9</td><td>80.74</td><td>81.81</td></tr></table>
277
+
278
+ Table 6: Span-F1 (%) on Genia Nested data abundant NER setting. The "†" mean the reproduction by (Yan et al., 2021).
279
+
280
+ <table><tr><td>CADEC: Model</td><td>P</td><td>R</td><td>F</td></tr><tr><td>(Metke-Jimenez and Karimi, 2016)</td><td>64.4</td><td>56.5</td><td>60.2</td></tr><tr><td>(Tang et al., 2018)</td><td>67.8</td><td>64.9</td><td>66.3</td></tr><tr><td>(Dai et al., 2020)[ELMo]</td><td>68.9</td><td>69.0</td><td>69.0</td></tr><tr><td>BARTNER (Yan et al., 2021)</td><td>70.08</td><td>71.21</td><td>70.64</td></tr><tr><td>2INER</td><td>71.18</td><td>75.26</td><td>73.16</td></tr></table>
281
+
282
+ Table 7: Span-F1 (%) on CADEC discontinuous data abundant NER setting.
283
+
284
+ Following BARTNER (Yan et al., 2021), since only the Adverse Drug Events (ADEs) entities include discontinuous data, only these entities were considered. The results are in Table 7.
285
+
286
+ The experiment settings are the same as flat NER. We use T5-large as the backbone model and report span-level F1. The results show that in data abundant nested and discontinuous NER setting, our proposed method greatly outperforms BARTNER (Yan et al., 2021) and other SOTA methods, which demonstrates that our methods do have a potential to handle different NER settings in a unified framework.
2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72329fbca927d0b1c91a87f8ff7fc29fdbb67d3f8cb397d2c420db0cf9108635
3
+ size 330837
2023/2INER_ Instructive and In-Context Learning on Few-Shot Named Entity Recognition/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/472ef1b2-669d-4b07-ae82-dafb730e88d4_content_list.json ADDED
@@ -0,0 +1,1219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 124,
8
+ 89,
9
+ 872,
10
+ 111
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Adrian Kochsiek",
17
+ "bbox": [
18
+ 258,
19
+ 137,
20
+ 410,
21
+ 152
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "University of Mannheim",
28
+ "bbox": [
29
+ 233,
30
+ 154,
31
+ 433,
32
+ 170
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Germany",
39
+ "bbox": [
40
+ 295,
41
+ 171,
42
+ 371,
43
+ 187
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "akochsiek@uni-mannheim.de",
50
+ "bbox": [
51
+ 206,
52
+ 187,
53
+ 460,
54
+ 202
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Rainer Gemulla",
61
+ "bbox": [
62
+ 594,
63
+ 137,
64
+ 737,
65
+ 152
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "University of Mannheim",
72
+ "bbox": [
73
+ 566,
74
+ 154,
75
+ 766,
76
+ 168
77
+ ],
78
+ "page_idx": 0
79
+ },
80
+ {
81
+ "type": "text",
82
+ "text": "Germany",
83
+ "bbox": [
84
+ 626,
85
+ 171,
86
+ 705,
87
+ 187
88
+ ],
89
+ "page_idx": 0
90
+ },
91
+ {
92
+ "type": "text",
93
+ "text": "rgemulla@uni-mannheim.de",
94
+ "bbox": [
95
+ 544,
96
+ 187,
97
+ 786,
98
+ 203
99
+ ],
100
+ "page_idx": 0
101
+ },
102
+ {
103
+ "type": "text",
104
+ "text": "Abstract",
105
+ "text_level": 1,
106
+ "bbox": [
107
+ 260,
108
+ 252,
109
+ 339,
110
+ 268
111
+ ],
112
+ "page_idx": 0
113
+ },
114
+ {
115
+ "type": "text",
116
+ "text": "Semi-inductive link prediction (LP) in knowledge graphs (KG) is the task of predicting facts for new, previously unseen entities based on context information. Although new entities can be integrated by retraining the model from scratch in principle, such an approach is infeasible for large-scale KGs, where retraining is expensive and new entities may arise frequently. In this paper, we propose and describe a large-scale benchmark to evaluate semi-inductive LP models. The benchmark is based on and extends Wikidata5M: It provides transductive, k-shot, and 0-shot LP tasks, each varying the available information from (i) only KG structure, to (ii) including textual mentions, and (iii) detailed descriptions of the entities. We report on a small study of recent approaches and found that semi-inductive LP performance is far from transductive performance on long-tail entities throughout all experiments. The benchmark provides a test bed for further research into integrating context and textual information in semi-inductive LP models.",
117
+ "bbox": [
118
+ 144,
119
+ 281,
120
+ 458,
121
+ 620
122
+ ],
123
+ "page_idx": 0
124
+ },
125
+ {
126
+ "type": "text",
127
+ "text": "1 Introduction",
128
+ "text_level": 1,
129
+ "bbox": [
130
+ 114,
131
+ 634,
132
+ 258,
133
+ 650
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "A knowledge graph (KG) is a collection of facts describing relations between real-world entities. Facts are represented in the form of subject-relation-object triples such as (Dave Grohl, memberOf, Foo Fighters). In this paper, we consider link prediction (LP) tasks, i.e., the problem of inferring missing facts in the KG. LP can be transductive (TD; all entities known a priori), semi-inductive (SI; some entities known a priori), and inductive (no entities known a priori). We concentrate on semi-inductive and transductive LP.",
140
+ "bbox": [
141
+ 112,
142
+ 661,
143
+ 489,
144
+ 835
145
+ ],
146
+ "page_idx": 0
147
+ },
148
+ {
149
+ "type": "text",
150
+ "text": "SI-LP focuses on modeling entities that are unknown or unseen during LP, such as out-of-KG entities (not part or not yet part of the KG) or newly created entities, e.g., a new user, product, or event. Such previously unknown entities can be",
151
+ "bbox": [
152
+ 112,
153
+ 838,
154
+ 489,
155
+ 917
156
+ ],
157
+ "page_idx": 0
158
+ },
159
+ {
160
+ "type": "text",
161
+ "text": "handled by retraining in principle. For large-scale KGs, however, retraining is inherently expensive and new entities may arise frequently. Therefore, the goal of SI-LP is to avoid retraining and perform LP directly, i.e., to generalize beyond the entities seen during training.",
162
+ "bbox": [
163
+ 507,
164
+ 252,
165
+ 884,
166
+ 348
167
+ ],
168
+ "page_idx": 0
169
+ },
170
+ {
171
+ "type": "text",
172
+ "text": "To perform LP for unseen entities, context information about these entities is needed. The amount and form of context information varies widely and may take the form of facts and/or textual information, such as an entity mention and/or its description. For example, a new user in a social network may provide a name, basic facts such as gender or country of origin, and perhaps a textual self-description.",
173
+ "bbox": [
174
+ 507,
175
+ 349,
176
+ 885,
177
+ 493
178
+ ],
179
+ "page_idx": 0
180
+ },
181
+ {
182
+ "type": "text",
183
+ "text": "In this paper, we introduce the Wikidata5M-SI benchmark for SI-LP. Our benchmark is based on the popular Wikidata5M (Wang et al., 2021) benchmark and has four major design goals: (G1) It ensures that unseen entities are long tail entities since popular entities (such as, say, Foo Fighters) and/or types and taxons (such as human and organization) are unlikely to be unseen. (G2) It allows to evaluate each model with varying amounts of contextual facts (0-shot, few-shot, transductive), i.e., to explore individual models across a range of tasks. (G3) It provides a controlled amount of textual information (none, mention, full description), where each setting demands different modeling capabilities. Finally, (G4) the benchmark is large-scale so that retraining is not a suitable approach. All prior SI-LP benchmarks violate at least one of these criteria.",
184
+ "bbox": [
185
+ 507,
186
+ 494,
187
+ 885,
188
+ 781
189
+ ],
190
+ "page_idx": 0
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "We report on a small experimental study with recent LP approaches. In general, we found that",
195
+ "bbox": [
196
+ 507,
197
+ 784,
198
+ 882,
199
+ 816
200
+ ],
201
+ "page_idx": 0
202
+ },
203
+ {
204
+ "type": "list",
205
+ "sub_type": "text",
206
+ "list_items": [
207
+ "1. SI performance was far behind TD performance in all experiments for long-tail entities,",
208
+ "2. there was generally a trade-off between TD and SI performance,",
209
+ "3. textual information was highly valuable,"
210
+ ],
211
+ "bbox": [
212
+ 522,
213
+ 827,
214
+ 882,
215
+ 917
216
+ ],
217
+ "page_idx": 0
218
+ },
219
+ {
220
+ "type": "page_number",
221
+ "text": "10634",
222
+ "bbox": [
223
+ 475,
224
+ 927,
225
+ 524,
226
+ 940
227
+ ],
228
+ "page_idx": 0
229
+ },
230
+ {
231
+ "type": "footer",
232
+ "text": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 10634-10643",
233
+ "bbox": [
234
+ 210,
235
+ 945,
236
+ 786,
237
+ 958
238
+ ],
239
+ "page_idx": 0
240
+ },
241
+ {
242
+ "type": "footer",
243
+ "text": "December 6-10, 2023 ©2023 Association for Computational Linguistics",
244
+ "bbox": [
245
+ 277,
246
+ 958,
247
+ 719,
248
+ 971
249
+ ],
250
+ "page_idx": 0
251
+ },
252
+ {
253
+ "type": "list",
254
+ "sub_type": "text",
255
+ "list_items": [
256
+ "4. proper integration of context and textual information needs further exploration, and",
257
+ "5. facts involving less common relations provided more useful context."
258
+ ],
259
+ "bbox": [
260
+ 127,
261
+ 84,
262
+ 487,
263
+ 154
264
+ ],
265
+ "page_idx": 1
266
+ },
267
+ {
268
+ "type": "text",
269
+ "text": "Our benchmark provides directions and a test bed for further research into SI-LP.",
270
+ "bbox": [
271
+ 112,
272
+ 171,
273
+ 485,
274
+ 200
275
+ ],
276
+ "page_idx": 1
277
+ },
278
+ {
279
+ "type": "text",
280
+ "text": "2 Related Work",
281
+ "text_level": 1,
282
+ "bbox": [
283
+ 112,
284
+ 218,
285
+ 267,
286
+ 233
287
+ ],
288
+ "page_idx": 1
289
+ },
290
+ {
291
+ "type": "text",
292
+ "text": "Multiple SI-LP datasets have been proposed in the literature. The benchmarks of Daza et al. (2021), Albooyeh et al. (2020), and Galkin et al. (2021) are obtained by first merging the splits of smaller transductive LP datasets and subsequently sampling unseen entities uniformly to construct validation and test splits. These benchmarks do not satisfy goals G1-G4. Shi and Weninger (2018) follow a similar approach but focus on only 0-shot evaluation based on textual features. Xie et al. (2016) and Shah et al. (2019) select entities from Freebase with connection to entities in FB15k (Bordes et al., 2013), also focussing on 0-shot evaluation using rich textual descriptions. These approaches do not satisfy G2 and G3. Finally, Wang et al. (2019) and Hamaguchi et al. (2017) uniformly sample test triples and mark occurring entities as unseen. These approaches do not focus on long-tail entities (and, in fact, the accumulated context of unseen entities may be larger than the training graph itself) and they do not satisfy G1-G3.",
293
+ "bbox": [
294
+ 112,
295
+ 246,
296
+ 487,
297
+ 583
298
+ ],
299
+ "page_idx": 1
300
+ },
301
+ {
302
+ "type": "text",
303
+ "text": "There are also several of fully-inductive LP benchmarks (Teru et al., 2020; Wang et al., 2021) involving KGs. While SI-LP aims to connect unseen entities to an existing KG, fully-inductive LP reasons about a new KG with completely separate entities (but shared relations). We do not consider this task in this work.",
304
+ "bbox": [
305
+ 112,
306
+ 586,
307
+ 487,
308
+ 697
309
+ ],
310
+ "page_idx": 1
311
+ },
312
+ {
313
+ "type": "text",
314
+ "text": "3 The Wikidata5M-SI Benchmark",
315
+ "text_level": 1,
316
+ "bbox": [
317
+ 112,
318
+ 713,
319
+ 421,
320
+ 728
321
+ ],
322
+ "page_idx": 1
323
+ },
324
+ {
325
+ "type": "text",
326
+ "text": "Wikidata5M-SI is based on the popular Wikidata5M (Wang et al., 2021) benchmark, which is induced by the 5M most common entities of Wikidata. Our benchmark contains transductive and semi-inductive valid/test splits; see Tab. 1 for an overview. Generally, we aimed to keep Wikidata5M-SI as close as possible to Wikidata5M. We did need to modify the original transductive valid and test splits, however, because they unintentionally contained both seen and unseen entities (i.e., these splits were not fully transductive). We",
327
+ "bbox": [
328
+ 112,
329
+ 741,
330
+ 487,
331
+ 917
332
+ ],
333
+ "page_idx": 1
334
+ },
335
+ {
336
+ "type": "table",
337
+ "img_path": "images/6df893522092a3826a3019d3e2f226989b49c48bb05359ce9afd18aaf33ac573.jpg",
338
+ "table_caption": [],
339
+ "table_footnote": [],
340
+ "table_body": "<table><tr><td rowspan=\"2\"></td><td rowspan=\"2\">Train</td><td colspan=\"2\">Transductive</td><td colspan=\"2\">Semi-inductive</td></tr><tr><td>Valid</td><td>Test</td><td>Valid</td><td>Test</td></tr><tr><td>Triples</td><td>20,600,187</td><td>4,983</td><td>4,977</td><td>5,500</td><td>5,500</td></tr><tr><td>Entities</td><td>4,593,103</td><td>7,768</td><td>7,760</td><td>3,722</td><td>3,793</td></tr><tr><td>Entities unseen</td><td>-</td><td>0</td><td>0</td><td>500</td><td>500</td></tr><tr><td>Relations</td><td>822</td><td>217</td><td>211</td><td>126</td><td>115</td></tr></table>",
341
+ "bbox": [
342
+ 510,
343
+ 80,
344
+ 878,
345
+ 171
346
+ ],
347
+ "page_idx": 1
348
+ },
349
+ {
350
+ "type": "text",
351
+ "text": "Table 1: Statistics of the Wikidata5M-SI splits.",
352
+ "bbox": [
353
+ 534,
354
+ 180,
355
+ 853,
356
+ 195
357
+ ],
358
+ "page_idx": 1
359
+ },
360
+ {
361
+ "type": "text",
362
+ "text": "did that by simply removing all triples involving unseen entities.",
363
+ "bbox": [
364
+ 507,
365
+ 223,
366
+ 880,
367
+ 253
368
+ ],
369
+ "page_idx": 1
370
+ },
371
+ {
372
+ "type": "text",
373
+ "text": "Unseen entities. To ensure that unseen entities in the semi-inductive splits are from the long tail (G1), we only considered entities of degree 20 or less. To be able to provide sufficient context for few-shot tasks (G2), we further did not consider entities of degree 10 or less. In more detail, we sampled 500 entities of degrees 11-20 (stratified sampling grouped by degree) for each semi-inductive split. All sampled entities, along with their facts, were removed from the train split. Note that these entities (naturally) have a different class distribution than all entities; see Sec. A.1 for details.",
374
+ "bbox": [
375
+ 507,
376
+ 256,
377
+ 882,
378
+ 448
379
+ ],
380
+ "page_idx": 1
381
+ },
382
+ {
383
+ "type": "text",
384
+ "text": "Tasks and metrics. For TD tasks, we follow the standard protocol of Wikidata5M. To construct SI tasks, we include 11 of the original facts of each unseen entity into its SI split; each split thus contains 5,500 triples. This enables up to 10-shot SI tasks (1 fact to test, up to 10 facts for context). For entities of degree larger than 11, we select the 11 facts with the most frequent relations; see Tab. 2 for an example. The rationale is that more common relations (such as instanceof or country) may be considered more likely to be provided for unseen entities than rare ones (such as militaryBranch or publisher). We then construct a single $k$ -shot task for each triple $(s,p,o)$ in the SI split as follows. When, say, $s$ is the unseen entity, we consider the LP task $(s,p,?)$ and provide $k$ additional facts of form $(s,p',o')$ as context. Context facts are selected by frequency as above, but we also explored random and infrequent-relation context in our study. Models are asked to provide a ranking of predicted answers, and we determine the filtered mean reciprocal rank (MRR) and Hits@K of the correct answer $(o)$ .",
385
+ "bbox": [
386
+ 507,
387
+ 451,
388
+ 882,
389
+ 819
390
+ ],
391
+ "page_idx": 1
392
+ },
393
+ {
394
+ "type": "text",
395
+ "text": "Textual information. For each entity, we provide its principal mention and a detailed description (both directly from Wikidata5M); see Tab. 2. This allows to differentiate model evaluation with varying amounts of textual information per entity (G3): (A) atomic, i.e., no textual information, (M) men",
396
+ "bbox": [
397
+ 507,
398
+ 822,
399
+ 882,
400
+ 917
401
+ ],
402
+ "page_idx": 1
403
+ },
404
+ {
405
+ "type": "page_number",
406
+ "text": "10635",
407
+ "bbox": [
408
+ 477,
409
+ 927,
410
+ 524,
411
+ 940
412
+ ],
413
+ "page_idx": 1
414
+ },
415
+ {
416
+ "type": "table",
417
+ "img_path": "images/cb2ab194c68802dab69337dd9266e6bedca5457458a49eb9115a16cea174c1bf.jpg",
418
+ "table_caption": [],
419
+ "table_footnote": [],
420
+ "table_body": "<table><tr><td>ID</td><td>Q18918</td><td></td></tr><tr><td>Mention</td><td>Sam Witwer</td><td></td></tr><tr><td>Description</td><td colspan=\"2\">Samuel Stewart Witwer (born October 20, 1977) is an American actor and mu-sician. He is known for portraying Crashdown in Battlestar Galactica, Davis Bloome in Smallville, Aidan Waite in Being Human, and Ben Lockwood in Supergirl. He voiced the protagonist Galen Marek / Starkiller in Star Wars: The Force Unleashed, the Son in Star Wars: The Clone Wars and Emperor Palpatine in Star Wars Rebels, both of which he has also voiced Darth Maul.</td></tr><tr><td rowspan=\"11\">Context triples</td><td>instance of | human</td><td>M: ○ D: ○</td></tr><tr><td>country of citizenship | United States of America</td><td>M: × D: ○</td></tr><tr><td>occupation | musician</td><td>M: × D: ✓</td></tr><tr><td>occupation | actor</td><td>M: × D: ✓</td></tr><tr><td>place of birth | Glenview</td><td>M: × D: ×</td></tr><tr><td>given name | Samuel</td><td>M: ○ D: ✓</td></tr><tr><td>given name | Sam</td><td>M: ✓ D: ○</td></tr><tr><td>cast member | Battlestar Galactica</td><td>M: × D: ✓</td></tr><tr><td>cast member | Being Human - supernatural drama television series</td><td>M: × D: ✓</td></tr><tr><td>cast member | Star Wars: The Force Unleashed II</td><td>M: × D: ○</td></tr><tr><td>cast member | The Mist</td><td>M: × D: ×</td></tr></table>",
421
+ "bbox": [
422
+ 126,
423
+ 80,
424
+ 870,
425
+ 418
426
+ ],
427
+ "page_idx": 2
428
+ },
429
+ {
430
+ "type": "text",
431
+ "text": "Table 2: Example of an entity from the semi-inductive validation set of Wikidata5M-SI. For each triple, we annotated whether the answer is contained in (✓), deducible from (○), or not contained in (×) mention (M) or description (D).",
432
+ "bbox": [
433
+ 112,
434
+ 428,
435
+ 882,
436
+ 470
437
+ ],
438
+ "page_idx": 2
439
+ },
440
+ {
441
+ "type": "text",
442
+ "text": "tions only, and (D) detailed textual descriptions as in (Kochsiek et al., 2023). This differentiation is especially important in the SI setting, as detailed text descriptions might not be provided for unseen entities and each setting demands different modeling capabilities. In fact, (A) performs reasoning only using graph structure, whereas (D) also benefits from information extraction to some extent. We discuss this further in Sec. 5.",
443
+ "bbox": [
444
+ 112,
445
+ 495,
446
+ 487,
447
+ 640
448
+ ],
449
+ "page_idx": 2
450
+ },
451
+ {
452
+ "type": "text",
453
+ "text": "4 Semi-Inductive Link Prediction Models",
454
+ "text_level": 1,
455
+ "bbox": [
456
+ 112,
457
+ 652,
458
+ 420,
459
+ 683
460
+ ],
461
+ "page_idx": 2
462
+ },
463
+ {
464
+ "type": "text",
465
+ "text": "We briefly summarize recent models for SI-LP; we considered these models in our experimental study.",
466
+ "bbox": [
467
+ 112,
468
+ 694,
469
+ 487,
470
+ 725
471
+ ],
472
+ "page_idx": 2
473
+ },
474
+ {
475
+ "type": "text",
476
+ "text": "Graph-only models. ComplEx (Trouillon et al., 2016) is the best-performing transductive KGE model on Wikidata5M (Kochsiek et al., 2022). To use ComplEx for SI-LP, we follow an approach explored by Jambor et al. (2021). In particular, we represent each entity as the sum of a local embedding (one per entity) and a global bias embedding. For 0-shot, we solely use the global bias for the unseen entity. For k-shot, we obtain the local embedding for the unseen entity by performing a single training step on the context triples (keeping all other embeddings fixed). An alternative",
477
+ "bbox": [
478
+ 112,
479
+ 726,
480
+ 489,
481
+ 917
482
+ ],
483
+ "page_idx": 2
484
+ },
485
+ {
486
+ "type": "text",
487
+ "text": "approach is taken by oDistMult-ERAvg (Albooyeh et al., 2020), which represents unseen entities by aggregating the embeddings of the relations and entities in the context. A more direct approach is taken by HittER (Chen et al., 2021), which contextualizes the query entity with its neighborhood for TD-LP. The approach can be used for SI-LP directly by using a masking token (akin to the global bias above) for an unseen entity. We originally planned to consider NodePiece (Galkin et al., 2021) (entity represented by a combination of anchor embeddings) and NBFNet (Zhu et al., 2021) (a GNN-based LP model); both support SI-LP directly. However, the available implementations did not scale to Wikidata5M-SI (out of memory).",
488
+ "bbox": [
489
+ 507,
490
+ 495,
491
+ 884,
492
+ 737
493
+ ],
494
+ "page_idx": 2
495
+ },
496
+ {
497
+ "type": "text",
498
+ "text": "Text-based models. As a baseline approach to integrate textual information directly into KGE models, we consider the approach explored in the",
499
+ "bbox": [
500
+ 507,
501
+ 740,
502
+ 882,
503
+ 789
504
+ ],
505
+ "page_idx": 2
506
+ },
507
+ {
508
+ "type": "page_footnote",
509
+ "text": "To address the high memory footprint (Galkin et al., 2021) of oDistMult-ERAvg, we extend it with neighborhood sampling.",
510
+ "bbox": [
511
+ 507,
512
+ 808,
513
+ 882,
514
+ 845
515
+ ],
516
+ "page_idx": 2
517
+ },
518
+ {
519
+ "type": "page_footnote",
520
+ "text": "For NBFNet (Zhu et al., 2021), the large memory footprint is inherent to the model; it is a full-graph GNN and hard to scale. For NodePiece (Galkin et al., 2021), however, the problem mainly lies in the expensive evaluation. All intermediate representations are precomputed, leading to a large memory overhead.",
521
+ "bbox": [
522
+ 507,
523
+ 846,
524
+ 882,
525
+ 917
526
+ ],
527
+ "page_idx": 2
528
+ },
529
+ {
530
+ "type": "page_number",
531
+ "text": "10636",
532
+ "bbox": [
533
+ 477,
534
+ 927,
535
+ 524,
536
+ 940
537
+ ],
538
+ "page_idx": 2
539
+ },
540
+ {
541
+ "type": "text",
542
+ "text": "WikiKG90M benchmark (Hu et al., 2021); see Sec. A.2 for details. The remaining approaches are purely textual. SimKGC (Wang et al., 2022) utilizes two pretrained BERT Transformers: one to embed query entities (and relations) based on their mention or description, and one for tail entities. Using a contrastive learning approach, it measures cosine similarity between both representations for ranking. KGT5 (Saxena et al., 2022) is a sequence-to-sequence link prediction approach, which is trained to generate the mention of the answer entity using the mention or description of the query entity and relation as input. Both approaches support 0-shot SI-LP when textual information is provided for the query entity. They do not utilize additional context, however, i.e., do not support k-shot SI-LP. KGT5-context (Kochsiek et al., 2023) is an extension of KGT5, which extends the input of KGT5 by the one-hop neighborhood of the query entity and consequently supports k-shot LP directly.",
543
+ "bbox": [
544
+ 115,
545
+ 82,
546
+ 490,
547
+ 420
548
+ ],
549
+ "page_idx": 3
550
+ },
551
+ {
552
+ "type": "text",
553
+ "text": "5 Experimental Study",
554
+ "text_level": 1,
555
+ "bbox": [
556
+ 112,
557
+ 435,
558
+ 321,
559
+ 451
560
+ ],
561
+ "page_idx": 3
562
+ },
563
+ {
564
+ "type": "text",
565
+ "text": "We evaluated all presented baseline models in the TD and SI setting on the atomic, mentions, and descriptions dataset. Further, we evaluated in detail which context was most useful and what information was conveyed by textual mentions and descriptions.",
566
+ "bbox": [
567
+ 112,
568
+ 462,
569
+ 487,
570
+ 557
571
+ ],
572
+ "page_idx": 3
573
+ },
574
+ {
575
+ "type": "text",
576
+ "text": "Setup. Source code, configuration, and the benchmark itself are available at https://github. com/uma-pi1.wikidata5m-si. For further details on hyperparameter tuning and training see Sec. A.3.",
577
+ "bbox": [
578
+ 112,
579
+ 560,
580
+ 489,
581
+ 638
582
+ ],
583
+ "page_idx": 3
584
+ },
585
+ {
586
+ "type": "text",
587
+ "text": "Main results. Transductive and SI performance in terms of MRR of all models is presented in Tab. 3; Hits@K in Tab. 7-9 (Sec. A). Note that overall transductive performance was oftentimes below best reported SI performance. This is due to varying degrees of query entities between both settings. Typically, models perform better predicting new relations for an entity (e.g., the birthplace) than predicting additional objects for a known relation (e.g., additional awards won by a person) (Saxena et al., 2022; Kochsiek et al., 2023). For a direct comparison between both settings, we additionally report TD performance on long tail query entities. $^{3}$",
588
+ "bbox": [
589
+ 112,
590
+ 640,
591
+ 487,
592
+ 848
593
+ ],
594
+ "page_idx": 3
595
+ },
596
+ {
597
+ "type": "text",
598
+ "text": "Atomic. TD performance on the long tail was considerably higher than SI performance. As no in",
599
+ "bbox": [
600
+ 112,
601
+ 850,
602
+ 489,
603
+ 881
604
+ ],
605
+ "page_idx": 3
606
+ },
607
+ {
608
+ "type": "text",
609
+ "text": "formation was provided for unseen entities, 0-shot was not reasonably possible. Without text-based information, context was a necessity. A simple neighborhood aggregation—entity-relation average (ERAvg)—offered the best integration of context.",
610
+ "bbox": [
611
+ 507,
612
+ 84,
613
+ 882,
614
+ 164
615
+ ],
616
+ "page_idx": 3
617
+ },
618
+ {
619
+ "type": "text",
620
+ "text": "Mentions. Integrating mentions did not improve performance on its own, as provided text information was still limited. However, additionally providing context information during inference (KGT5-context) simplified the learning problem and improved TD performance significantly. But for 0-shot, the limited text information provided with mentions allowed for reasonable performance. To analyze what information is conveyed for 0-shot, we annotated 100 valid triples; see Tab. 4. In $10\\%$ of cases, the answer was already contained in the mention, and it was deducible in at least $7\\%$ . This enabled basic reasoning without any further information. In contrast to the TD setting, KGT5 outperformed its context extension. KGT5-context was reliant on context which was lacking especially during 0-shot. This showed a trade-off between best performance in the SI and TD setting. This trade-off could be mitigated by applying (full and partial) context hiding. With such adapted training, KGT5-context reached a middle ground with a transductive MRR of 0.366 and 0-shot MRR of 0.283.4 However, even with full context (10-shot), performance was still only on par with KGT5. Therefore, context information did not bring any further benefits when text was provided.",
621
+ "bbox": [
622
+ 507,
623
+ 167,
624
+ 884,
625
+ 585
626
+ ],
627
+ "page_idx": 3
628
+ },
629
+ {
630
+ "type": "text",
631
+ "text": "Descriptions. Further, integrating descriptions improved performance for both settings, TD and SI, considerably; see Tab. 3. Similar to the mentions-only setting, KGT5-context performed best in TD and KGT5 in the SI setting. Applying the same trade-off with context-hiding reached a middle ground with 0.418 TD-MRR and 0.449 SI-MRR.",
632
+ "bbox": [
633
+ 507,
634
+ 588,
635
+ 882,
636
+ 700
637
+ ],
638
+ "page_idx": 3
639
+ },
640
+ {
641
+ "type": "text",
642
+ "text": "Descriptions were very detailed and partially contained the correct answer as well as the same information as contained in context triples; see Tab. 4. Therefore, performance did not further improve with context size. In such cases, models mainly benefit from information extraction capabilities. To judge how much information extraction helps, we grouped performance of KGT5+description in the 0-shot setting on validation data into the groups contained, deducible and not contained in descrip",
643
+ "bbox": [
644
+ 507,
645
+ 703,
646
+ 882,
647
+ 863
648
+ ],
649
+ "page_idx": 3
650
+ },
651
+ {
652
+ "type": "page_footnote",
653
+ "text": "4In $25\\% / 25\\% / 50\\%$ of cases, we hid the full context/sampled between 1-10 neighbors/used the full context, respectively.",
654
+ "bbox": [
655
+ 507,
656
+ 879,
657
+ 882,
658
+ 917
659
+ ],
660
+ "page_idx": 3
661
+ },
662
+ {
663
+ "type": "page_footnote",
664
+ "text": "3We define long tail query entities as entities with degree $\\leq 10$ as in the SI setting.",
665
+ "bbox": [
666
+ 112,
667
+ 891,
668
+ 487,
669
+ 917
670
+ ],
671
+ "page_idx": 3
672
+ },
673
+ {
674
+ "type": "page_number",
675
+ "text": "10637",
676
+ "bbox": [
677
+ 477,
678
+ 927,
679
+ 524,
680
+ 940
681
+ ],
682
+ "page_idx": 3
683
+ },
684
+ {
685
+ "type": "table",
686
+ "img_path": "images/4c597d069cebe5c1fb4baede01313e4f125e346507e24f70ac1253c37b7d6a27.jpg",
687
+ "table_caption": [],
688
+ "table_footnote": [],
689
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">Transductive</td><td colspan=\"5\">Semi-inductive (num. shots)</td><td rowspan=\"2\">Pre-trained</td></tr><tr><td>All</td><td>Long tail</td><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.308</td><td>0.523</td><td>0.124</td><td>0.151</td><td>0.176</td><td>0.190</td><td>0.206</td><td>no</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.294</td><td>0.512</td><td>-</td><td>0.171</td><td>0.246</td><td>0.295</td><td>0.333</td><td>no</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.284</td><td>0.512</td><td>0.019</td><td>0.105</td><td>0.153</td><td>0.179</td><td>0.221</td><td>no</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.299</td><td>0.535</td><td>-</td><td>0.187</td><td>0.235</td><td>0.258</td><td>0.280</td><td>yes</td></tr><tr><td>SimKGC (mentions only)</td><td>0.212</td><td>0.361</td><td>0.220</td><td>-</td><td>-</td><td>-</td><td>-</td><td>yes</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.281</td><td>0.542</td><td>0.310</td><td>-</td><td>-</td><td>-</td><td>-</td><td>no</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.374</td><td>0.678</td><td>0.220</td><td>0.217</td><td>0.236</td><td>0.259</td><td>0.311</td><td>no</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.313</td><td>0.585</td><td>-</td><td>0.278</td><td>0.281</td><td>0.285</td><td>0.292</td><td>yes</td></tr><tr><td>SimKGC + Descriptions (Wang et al., 2022)</td><td>0.353</td><td>0.663</td><td>0.403</td><td>-</td><td>-</td><td>-</td><td>-</td><td>yes</td></tr><tr><td>KGT5 + Descriptions (Kochsiek et al., 2023)</td><td>0.364</td><td>0.728</td><td>0.470</td><td>-</td><td>-</td><td>-</td><td>-</td><td>no</td></tr><tr><td>KGT5-context + Descriptions (Kochsiek et al., 2023)</td><td>0.420</td><td>0.777</td><td>0.417</td><td>0.420</td><td>0.416</td><td>0.420</td><td>0.437</td><td>no</td></tr></table>",
690
+ "bbox": [
691
+ 112,
692
+ 80,
693
+ 880,
694
+ 282
695
+ ],
696
+ "page_idx": 4
697
+ },
698
+ {
699
+ "type": "table",
700
+ "img_path": "images/31d45159c5ece98c1e1cd7e33d1abfd26cc42b9c75893ec7721d32e30d4244fe.jpg",
701
+ "table_caption": [
702
+ "Table 3: Transductive and semi-inductive link prediction results in terms of MRR on the dataset Wikidata5M-SI. The first group presets results on the atomic, the second on the mentions and the third on the descriptions dataset. Best per TD/SI in bold. Best per group underlined."
703
+ ],
704
+ "table_footnote": [],
705
+ "table_body": "<table><tr><td></td><td>Mention</td><td>Description</td></tr><tr><td>Contained</td><td>10%</td><td>44%</td></tr><tr><td>Deductible</td><td>7%</td><td>10%</td></tr><tr><td>Not contained</td><td>83%</td><td>46%</td></tr></table>",
706
+ "bbox": [
707
+ 139,
708
+ 359,
709
+ 463,
710
+ 434
711
+ ],
712
+ "page_idx": 4
713
+ },
714
+ {
715
+ "type": "table",
716
+ "img_path": "images/43bba62dbfaca9436f58a64500a6c77ee103085817d0c9ccbe840ad1fecebc7f.jpg",
717
+ "table_caption": [
718
+ "Table 4: Information about a query answer contained in mentions and descriptions. Annotated for 100 sampled triples from 0-shot valid. For an example, see Tab. 2."
719
+ ],
720
+ "table_footnote": [],
721
+ "table_body": "<table><tr><td>Context selection</td><td>1</td><td>3</td><td>5</td></tr><tr><td>Most common</td><td>0.217</td><td>0.236</td><td>0.259</td></tr><tr><td>Least common</td><td>0.253</td><td>0.273</td><td>0.290</td></tr><tr><td>Random</td><td>0.237</td><td>0.260</td><td>0.281</td></tr></table>",
722
+ "bbox": [
723
+ 137,
724
+ 504,
725
+ 463,
726
+ 575
727
+ ],
728
+ "page_idx": 4
729
+ },
730
+ {
731
+ "type": "text",
732
+ "text": "Table 5: Influence of context selection. Semi-inductive test MRR of KGT5-context.",
733
+ "bbox": [
734
+ 112,
735
+ 583,
736
+ 485,
737
+ 612
738
+ ],
739
+ "page_idx": 4
740
+ },
741
+ {
742
+ "type": "text",
743
+ "text": "tion; see Fig. 1 in Sec. A. When contained, the correct answer was extracted in $\\approx 70\\%$ of cases.",
744
+ "bbox": [
745
+ 112,
746
+ 643,
747
+ 485,
748
+ 674
749
+ ],
750
+ "page_idx": 4
751
+ },
752
+ {
753
+ "type": "text",
754
+ "text": "Context selection. We selected the most common relations as context triples so far, as this may be a more realistic setting. To investigate the effect of this selection approach, we compared the default selection of choosing most common relations to least common and random. Results for KGT5-context are shown in Tab. 5; for all other models in Tab. 10 in Sec. A. We found that the less common the relations of the provided context, the better the SI performance. More common context relations often described high-level concepts, while less common provided further detail; see the example in Tab. 2. While more common context may be more readily available, less common context was more helpful to describe a new entity.",
755
+ "bbox": [
756
+ 112,
757
+ 678,
758
+ 487,
759
+ 917
760
+ ],
761
+ "page_idx": 4
762
+ },
763
+ {
764
+ "type": "text",
765
+ "text": "6 Conclusion",
766
+ "text_level": 1,
767
+ "bbox": [
768
+ 507,
769
+ 362,
770
+ 640,
771
+ 376
772
+ ],
773
+ "page_idx": 4
774
+ },
775
+ {
776
+ "type": "text",
777
+ "text": "We proposed the new WikiData5M-SI large-scale benchmark for semi-supervised link prediction. The benchmark focuses on unseen entities from the long tail and allows to evaluate models with varying and controlled amounts of factual and textual context information. In our experimental evaluation, we found that semi-inductive LP performance fell behind transductive performance for long-tail entities in general, and that detailed textual information was often more valuable than factual context information. Moreover, current models did not integrate these two types of information adequately, suggesting a direction for future research.",
778
+ "bbox": [
779
+ 507,
780
+ 388,
781
+ 882,
782
+ 596
783
+ ],
784
+ "page_idx": 4
785
+ },
786
+ {
787
+ "type": "text",
788
+ "text": "Limitations",
789
+ "text_level": 1,
790
+ "bbox": [
791
+ 509,
792
+ 611,
793
+ 613,
794
+ 626
795
+ ],
796
+ "page_idx": 4
797
+ },
798
+ {
799
+ "type": "text",
800
+ "text": "This study was performed on Wikidata5M-SI, i.e., a subset of a single knowledge graph. Model performance and insights may vary if graph structure and/or availability and usefulness of mentions and description is different. In particular, the entity descriptions provided with Wikidata5M-SI partly contained information relevant for link prediction so that models benefited from information extraction capabilities.",
801
+ "bbox": [
802
+ 507,
803
+ 637,
804
+ 882,
805
+ 782
806
+ ],
807
+ "page_idx": 4
808
+ },
809
+ {
810
+ "type": "text",
811
+ "text": "Ethics Statement",
812
+ "text_level": 1,
813
+ "bbox": [
814
+ 509,
815
+ 796,
816
+ 660,
817
+ 810
818
+ ],
819
+ "page_idx": 4
820
+ },
821
+ {
822
+ "type": "text",
823
+ "text": "This research adapts publicly available data, benchmarks, and codebases for evaluation. We believe that this research was conducted in an ethical manner in compliance with all relevant laws and regulations.",
824
+ "bbox": [
825
+ 507,
826
+ 822,
827
+ 882,
828
+ 902
829
+ ],
830
+ "page_idx": 4
831
+ },
832
+ {
833
+ "type": "page_number",
834
+ "text": "10638",
835
+ "bbox": [
836
+ 477,
837
+ 927,
838
+ 524,
839
+ 940
840
+ ],
841
+ "page_idx": 4
842
+ },
843
+ {
844
+ "type": "text",
845
+ "text": "References",
846
+ "text_level": 1,
847
+ "bbox": [
848
+ 115,
849
+ 84,
850
+ 213,
851
+ 98
852
+ ],
853
+ "page_idx": 5
854
+ },
855
+ {
856
+ "type": "list",
857
+ "sub_type": "ref_text",
858
+ "list_items": [
859
+ "Marjan Albooyeh, Rishab Goel, and Seyed Mehran Kazemi. 2020. Out-of-sample representation learning for knowledge graphs. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 2657-2666.",
860
+ "Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. 2013. Translating embeddings for modeling multi-relational data. In Neural Information Processing Systems (NIPS), pages 1-9.",
861
+ "Samuel Broscheit, Daniel Ruffinelli, Adrian Kochsiek, Patrick Betz, and Rainer Gemulla. 2020. LibKGE - A knowledge graph embedding library for reproducible research. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 165-174.",
862
+ "Sanxing Chen, Xiaodong Liu, Jianfeng Gao, Jian Jiao, Ruofei Zhang, and Yangfeng Ji. 2021. Hitter: Hierarchical transformers for knowledge graph embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10395-10407.",
863
+ "Daniel Daza, Michael Cochez, and Paul Groth. 2021. Inductive entity representations from text via link prediction. In Proceedings of the Web Conference 2021, pages 798-808.",
864
+ "Mikhail Galkin, Etienne Denis, Jiapeng Wu, and William L Hamilton. 2021. Nodepiece: Compositional and parameter-efficient representations of large knowledge graphs. In International Conference on Learning Representations.",
865
+ "Takuo Hamaguchi, Hidekazu Oiwa, Masashi Shimbo, and Yuji Matsumoto. 2017. Knowledge transfer for out-of-knowledge-base entities: a graph neural network approach. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pages 1802-1808.",
866
+ "Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. 2021. Ogb-lsc: A large-scale challenge for machine learning on graphs. Advances in Neural Information Processing Systems, 35.",
867
+ "Dora Jambor, Komal Teru, Joelle Pineau, and William L Hamilton. 2021. Exploring the limits of few-shot link prediction in knowledge graphs. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2816-2822.",
868
+ "Adrian Kochsiek, Fritz Niesel, and Rainer Gemulla. 2022. Start small, think big: On hyperparameter optimization for large-scale knowledge graph embeddings. In Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2022, Grenoble, France, September"
869
+ ],
870
+ "bbox": [
871
+ 115,
872
+ 105,
873
+ 489,
874
+ 917
875
+ ],
876
+ "page_idx": 5
877
+ },
878
+ {
879
+ "type": "list",
880
+ "sub_type": "ref_text",
881
+ "list_items": [
882
+ "19-23, 2022, Proceedings, Part II, pages 138-154. Springer.",
883
+ "Adrian Kochsiek, Apoorv Saxena, Inderjeet Nair, and Rainer Gemulla. 2023. Friendly neighbors: Contextualized sequence-to-sequence link prediction. In Proceedings of the 8th Workshop on Representation Learning for NLP.",
884
+ "Apoory Saxena, Adrian Kochsiek, and Rainer Gemulla. 2022. Sequence-to-sequence knowledge graph completion and question answering. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2814-2828.",
885
+ "Haseeb Shah, Johannes Villmow, Adrian Ulges, Ulrich Schwanecke, and Faisal Shafait. 2019. An open-world extension to knowledge graph completion models. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 3044-3051.",
886
+ "Baoxu Shi and Tim Weninger. 2018. Open-world knowledge graph completion. In Proceedings of the AAAI conference on artificial intelligence, volume 32.",
887
+ "Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and TieYan Liu. 2020. Mpnet: Masked and permuted pretraining for language understanding. Advances in Neural Information Processing Systems, 33:16857-16867.",
888
+ "Komal Teru, Etienne Denis, and Will Hamilton. 2020. Inductive relation prediction by subgraph reasoning. In International Conference on Machine Learning, pages 9448-9457.",
889
+ "Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. 2016. Complex embeddings for simple link prediction. In International conference on machine learning, pages 2071-2080.",
890
+ "Liang Wang, Wei Zhao, Zhuoyu Wei, and Jingming Liu. 2022. Simkgc: Simple contrastive knowledge graph completion with pre-trained language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4281-4294.",
891
+ "Peifeng Wang, Jialong Han, Chenliang Li, and Rong Pan. 2019. Logic attention based neighborhood aggregation for inductive knowledge graph embedding. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7152-7159.",
892
+ "Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhengyan Zhang, Zhiyuan Liu, Juanzi Li, and Jian Tang. 2021. Kepler: A unified model for knowledge embedding and pre-trained language representation. Transactions of the Association for Computational Linguistics, 9:176-194."
893
+ ],
894
+ "bbox": [
895
+ 510,
896
+ 85,
897
+ 882,
898
+ 917
899
+ ],
900
+ "page_idx": 5
901
+ },
902
+ {
903
+ "type": "page_number",
904
+ "text": "10639",
905
+ "bbox": [
906
+ 477,
907
+ 928,
908
+ 524,
909
+ 940
910
+ ],
911
+ "page_idx": 5
912
+ },
913
+ {
914
+ "type": "text",
915
+ "text": "Ruobing Xie, Zhiyuan Liu, Jia Jia, Huanbo Luan, and Maosong Sun. 2016. Representation learning of knowledge graphs with entity descriptions. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 30.",
916
+ "bbox": [
917
+ 115,
918
+ 85,
919
+ 487,
920
+ 151
921
+ ],
922
+ "page_idx": 6
923
+ },
924
+ {
925
+ "type": "text",
926
+ "text": "Bishan Yang, Scott Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. 2015. Embedding entities and relations for learning and inference in knowledge bases. In Proceedings of the International Conference on Learning Representations (ICLR) 2015.",
927
+ "bbox": [
928
+ 115,
929
+ 161,
930
+ 487,
931
+ 227
932
+ ],
933
+ "page_idx": 6
934
+ },
935
+ {
936
+ "type": "text",
937
+ "text": "Zhaocheng Zhu, Zuobai Zhang, Louis-Pascal Xhonneux, and Jian Tang. 2021. Neural bellman-ford networks: A general graph neural network framework for link prediction. Advances in Neural Information Processing Systems, 34.",
938
+ "bbox": [
939
+ 114,
940
+ 237,
941
+ 487,
942
+ 302
943
+ ],
944
+ "page_idx": 6
945
+ },
946
+ {
947
+ "type": "text",
948
+ "text": "A Appendix",
949
+ "text_level": 1,
950
+ "bbox": [
951
+ 114,
952
+ 316,
953
+ 236,
954
+ 331
955
+ ],
956
+ "page_idx": 6
957
+ },
958
+ {
959
+ "type": "text",
960
+ "text": "A.1 Distribution of Unseen Entities",
961
+ "text_level": 1,
962
+ "bbox": [
963
+ 114,
964
+ 341,
965
+ 405,
966
+ 355
967
+ ],
968
+ "page_idx": 6
969
+ },
970
+ {
971
+ "type": "text",
972
+ "text": "Long-tail entities have a different distribution than entities from the whole KG; see Tab. 6 for an overview of the distribution shift for the top 10 entity types. This difference is natural. In particular, high-degree entities in a KG such as Wikidata often refer to types/taxons (e.g., human, organization, ...) as well as popular named entities (e.g., Albert Einstein, Germany, ...). These entities are fundamental to the KG and/or of high interest and have many facts associated with them. For this reason, they do not form suitable candidates for benchmarking unseen or new entities. In addition, removing high-degree entities for the purpose of evaluating SI-LP is likely to distort the KG (e.g., consider removing type \"human\" or \"Germany\"). In contrast, Wikidata5M-SI focuses on entities for which knowledge is not yet abundant: long-tail entities are accompanied by no or few facts (at least initially) and our SI-LP benchmark tests reasoning capabilities with this limited information.",
973
+ "bbox": [
974
+ 115,
975
+ 361,
976
+ 487,
977
+ 682
978
+ ],
979
+ "page_idx": 6
980
+ },
981
+ {
982
+ "type": "text",
983
+ "text": "A.2 Integrating Text into KGE Models",
984
+ "text_level": 1,
985
+ "bbox": [
986
+ 509,
987
+ 84,
988
+ 828,
989
+ 99
990
+ ],
991
+ "page_idx": 6
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "To integrate text into traditional KGE models, we follow the baseline models of the WikiKG90M link prediction challenge (Hu et al., 2021). We embed mentions combined with descriptions using MPNet (Song et al., 2020), concatenate the resulting descriptions embedding with the entity embedding, and project it with a linear layer for the final representation of the entity. In combination with oDistMult-ERAvg (Albooyeh et al., 2020), we apply the aggregation of neighboring entities and relations on the entity embedding part only. The resulting aggregation is then concatenated with its description and finally projected.",
996
+ "bbox": [
997
+ 507,
998
+ 105,
999
+ 882,
1000
+ 312
1001
+ ],
1002
+ "page_idx": 6
1003
+ },
1004
+ {
1005
+ "type": "text",
1006
+ "text": "This approach is closely related to BLP (Daza et al., 2021). The main differences to BLP are:",
1007
+ "bbox": [
1008
+ 507,
1009
+ 312,
1010
+ 880,
1011
+ 342
1012
+ ],
1013
+ "page_idx": 6
1014
+ },
1015
+ {
1016
+ "type": "list",
1017
+ "sub_type": "text",
1018
+ "list_items": [
1019
+ "1. Hu et al. (2021) use MPNet, BLP uses BERT.",
1020
+ "2. In combination with DistMult-ERAvg, we concatenate a learnable \"structural embedding\" to the CLS embedding of the language model, whereas BLP does not."
1021
+ ],
1022
+ "bbox": [
1023
+ 522,
1024
+ 348,
1025
+ 882,
1026
+ 439
1027
+ ],
1028
+ "page_idx": 6
1029
+ },
1030
+ {
1031
+ "type": "text",
1032
+ "text": "A.3 Experimental Setup",
1033
+ "text_level": 1,
1034
+ "bbox": [
1035
+ 509,
1036
+ 451,
1037
+ 717,
1038
+ 466
1039
+ ],
1040
+ "page_idx": 6
1041
+ },
1042
+ {
1043
+ "type": "text",
1044
+ "text": "For hyperparameter optimization for ComplEx (Trouillon et al., 2016), DistMult (Yang et al., 2015), and HittER (Chen et al., 2021), we used the multi-fidelity approach GraSH (Kochsiek et al., 2022) implemented in LibKGE (Broscheit et al., 2020) with 64 initial trials and trained for up to 64 epochs. For fold-in, we reused training hyperparameters and trained for a single epoch on the provided context. For text-based approaches, we used the hyperparameters and architectures proposed by the authors for the transductive split of Wikidata5M. We trained on up to 5 A6000-GPUs with 49GB of VRAM.",
1045
+ "bbox": [
1046
+ 507,
1047
+ 470,
1048
+ 882,
1049
+ 678
1050
+ ],
1051
+ "page_idx": 6
1052
+ },
1053
+ {
1054
+ "type": "page_number",
1055
+ "text": "10640",
1056
+ "bbox": [
1057
+ 477,
1058
+ 927,
1059
+ 524,
1060
+ 940
1061
+ ],
1062
+ "page_idx": 6
1063
+ },
1064
+ {
1065
+ "type": "table",
1066
+ "img_path": "images/89e501f861d5ef0214152d97d53cfcea733d7ae14141c864209868ba5ff5a7c3.jpg",
1067
+ "table_caption": [],
1068
+ "table_footnote": [],
1069
+ "table_body": "<table><tr><td>WikidataID</td><td>Mention</td><td>All entities</td><td>Long-tail entities</td></tr><tr><td>Q5</td><td>human</td><td>39%</td><td>61%</td></tr><tr><td>Q11424</td><td>film</td><td>3%</td><td>8%</td></tr><tr><td>Q484170</td><td>commune of France</td><td>1%</td><td>7%</td></tr><tr><td>Q482994</td><td>album</td><td>3%</td><td>1%</td></tr><tr><td>Q16521</td><td>taxon</td><td>9%</td><td>1%</td></tr><tr><td>Q134556</td><td>single</td><td>1%</td><td>1%</td></tr><tr><td>Q747074</td><td>commune of Italy</td><td>0%</td><td>1%</td></tr><tr><td>Q2074737</td><td>municipality of Spain</td><td>0%</td><td>1%</td></tr><tr><td>Q571</td><td>book</td><td>1%</td><td>1%</td></tr><tr><td>Q7889</td><td>video game</td><td>1%</td><td>1%</td></tr></table>",
1070
+ "bbox": [
1071
+ 221,
1072
+ 83,
1073
+ 776,
1074
+ 278
1075
+ ],
1076
+ "page_idx": 7
1077
+ },
1078
+ {
1079
+ "type": "image",
1080
+ "img_path": "images/baae9bbd293af72cab83695b604ca04663ba5fd908d5419b7ced6cda5d4535df.jpg",
1081
+ "image_caption": [
1082
+ "Figure 1: Number of correct (rank=1) and incorrect predictions by KGT5+descriptions on annotated examples per annotation label."
1083
+ ],
1084
+ "image_footnote": [],
1085
+ "bbox": [
1086
+ 262,
1087
+ 335,
1088
+ 736,
1089
+ 583
1090
+ ],
1091
+ "page_idx": 7
1092
+ },
1093
+ {
1094
+ "type": "table",
1095
+ "img_path": "images/6026a441f3b98506f54bfb89cbc3672f5394b099a10392ef3cd43300a9c5328d.jpg",
1096
+ "table_caption": [
1097
+ "Table 6: Distribution of top 10 entity types over long-tail entities with degree between 11 and 20 compared to all entities."
1098
+ ],
1099
+ "table_footnote": [],
1100
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Trans.</td><td colspan=\"5\">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>Complex + Bias + Fold in (Jambor et al., 2021)</td><td>0.260</td><td>0.058</td><td>0.097</td><td>0.118</td><td>0.124</td><td>0.132</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.237</td><td>-</td><td>0.115</td><td>0.151</td><td>0.185</td><td>0.209</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.234</td><td>0.005</td><td>0.076</td><td>0.115</td><td>0.132</td><td>0.153</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.239</td><td>-</td><td>0.106</td><td>0.142</td><td>0.153</td><td>0.167</td></tr><tr><td>SimKGC (mentions only)</td><td>0.182</td><td>0.187</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.249</td><td>0.263</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.347</td><td>0.184</td><td>0.177</td><td>0.195</td><td>0.218</td><td>0.263</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.252</td><td>-</td><td>0.152</td><td>0.153</td><td>0.153</td><td>0.161</td></tr><tr><td>SimKGC + Descriptions (Wang et al., 2022)</td><td>0.311</td><td>0.349</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.332</td><td>0.430</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.400</td><td>0.379</td><td>0.382</td><td>0.373</td><td>0.378</td><td>0.393</td></tr></table>",
1101
+ "bbox": [
1102
+ 122,
1103
+ 640,
1104
+ 873,
1105
+ 890
1106
+ ],
1107
+ "page_idx": 7
1108
+ },
1109
+ {
1110
+ "type": "text",
1111
+ "text": "Table 7: Transductive and semi-inductive link prediction results in terms of H@1 on the dataset Wikidata5M-SI.",
1112
+ "bbox": [
1113
+ 117,
1114
+ 898,
1115
+ 875,
1116
+ 913
1117
+ ],
1118
+ "page_idx": 7
1119
+ },
1120
+ {
1121
+ "type": "page_number",
1122
+ "text": "10641",
1123
+ "bbox": [
1124
+ 477,
1125
+ 927,
1126
+ 522,
1127
+ 940
1128
+ ],
1129
+ "page_idx": 7
1130
+ },
1131
+ {
1132
+ "type": "table",
1133
+ "img_path": "images/0d637e223560b8fe3fe0b4aa3b32b9e0fe281fae22778a0d6f9bdd23d08e37c0.jpg",
1134
+ "table_caption": [],
1135
+ "table_footnote": [],
1136
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Trans.</td><td colspan=\"5\">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.337</td><td>0.165</td><td>0.180</td><td>0.202</td><td>0.219</td><td>0.242</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.328</td><td>-</td><td>0.190</td><td>0.292</td><td>0.352</td><td>0.401</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.309</td><td>0.013</td><td>0.109</td><td>0.158</td><td>0.188</td><td>0.242</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.332</td><td>-</td><td>0.239</td><td>0.289</td><td>0.314</td><td>0.340</td></tr><tr><td>SimKGC (mentions only)</td><td>0.223</td><td>0.227</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.296</td><td>0.332</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.390</td><td>0.236</td><td>0.234</td><td>0.257</td><td>0.278</td><td>0.335</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.344</td><td>-</td><td>0.368</td><td>0.373</td><td>0.378</td><td>0.380</td></tr><tr><td>SimKGC (Wang et al., 2022)</td><td>0.367</td><td>0.421</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.385</td><td>0.490</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.432</td><td>0.441</td><td>0.443</td><td>0.443</td><td>0.447</td><td>0.463</td></tr></table>",
1137
+ "bbox": [
1138
+ 122,
1139
+ 152,
1140
+ 875,
1141
+ 399
1142
+ ],
1143
+ "page_idx": 8
1144
+ },
1145
+ {
1146
+ "type": "table",
1147
+ "img_path": "images/3fd2ce994ab5d7c80f165bf238ab17d6880c5876b2bd282cf885ac708209371a.jpg",
1148
+ "table_caption": [
1149
+ "Table 8: Transductive and semi-inductive link prediction results in terms of H@3 on the dataset Wikidata5M-SI."
1150
+ ],
1151
+ "table_footnote": [],
1152
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Trans.</td><td colspan=\"5\">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.387</td><td>0.231</td><td>0.245</td><td>0.282</td><td>0.309</td><td>0.336</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.389</td><td>-</td><td>0.270</td><td>0.409</td><td>0.493</td><td>0.564</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.376</td><td>0.050</td><td>0.157</td><td>0.226</td><td>0.270</td><td>0.359</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.411</td><td>-</td><td>0.320</td><td>0.392</td><td>0.440</td><td>0.478</td></tr><tr><td>SimKGC (mentions only)</td><td>0.266</td><td>0.283</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.344</td><td>0.398</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.423</td><td>0.293</td><td>0.295</td><td>0.310</td><td>0.336</td><td>0.400</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.425</td><td>-</td><td>0.465</td><td>0.472</td><td>0.484</td><td>0.491</td></tr><tr><td>SimKGC (Wang et al., 2022)</td><td>0.432</td><td>0.504</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.416</td><td>0.544</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.455</td><td>0.484</td><td>0.489</td><td>0.489</td><td>0.495</td><td>0.516</td></tr></table>",
1153
+ "bbox": [
1154
+ 122,
1155
+ 571,
1156
+ 875,
1157
+ 820
1158
+ ],
1159
+ "page_idx": 8
1160
+ },
1161
+ {
1162
+ "type": "text",
1163
+ "text": "Table 9: Transductive and semi-inductive link prediction results in terms of H@10 on the dataset Wikidata5M-SI.",
1164
+ "bbox": [
1165
+ 114,
1166
+ 829,
1167
+ 878,
1168
+ 843
1169
+ ],
1170
+ "page_idx": 8
1171
+ },
1172
+ {
1173
+ "type": "page_number",
1174
+ "text": "10642",
1175
+ "bbox": [
1176
+ 477,
1177
+ 928,
1178
+ 524,
1179
+ 940
1180
+ ],
1181
+ "page_idx": 8
1182
+ },
1183
+ {
1184
+ "type": "table",
1185
+ "img_path": "images/b6a0092f4fc56e10af7c6f2a33953ece3eeddc716ad6b3f162b8fd09290bf1d1.jpg",
1186
+ "table_caption": [],
1187
+ "table_footnote": [],
1188
+ "table_body": "<table><tr><td>Model</td><td>Context selection</td><td>1</td><td>3</td><td>5</td></tr><tr><td rowspan=\"3\">ComplEx + fold-in</td><td>Most common</td><td>0.151</td><td>0.161</td><td>0.168</td></tr><tr><td>Least common</td><td>0.166</td><td>0.185</td><td>0.195</td></tr><tr><td>Random</td><td>0.164</td><td>0.187</td><td>0.196</td></tr><tr><td rowspan=\"3\">DistMult + ERAvg</td><td>Most common</td><td>0.171</td><td>0.246</td><td>0.295</td></tr><tr><td>Least common</td><td>0.217</td><td>0.299</td><td>0.323</td></tr><tr><td>Random</td><td>0.215</td><td>0.303</td><td>0.318</td></tr><tr><td rowspan=\"3\">oDistMult + ERAvg + Mentions</td><td>Most common</td><td>0.187</td><td>0.235</td><td>0.258</td></tr><tr><td>Least common</td><td>0.237</td><td>0.274</td><td>0.279</td></tr><tr><td>Random</td><td>0.232</td><td>0.265</td><td>0.272</td></tr><tr><td rowspan=\"3\">HittER</td><td>Most common</td><td>0.105</td><td>0.153</td><td>0.179</td></tr><tr><td>Least common</td><td>0.151</td><td>0.195</td><td>0.216</td></tr><tr><td>Random</td><td>0.136</td><td>0.190</td><td>0.206</td></tr><tr><td rowspan=\"3\">KGT5-context</td><td>Most common</td><td>0.217</td><td>0.236</td><td>0.259</td></tr><tr><td>Least common</td><td>0.253</td><td>0.273</td><td>0.290</td></tr><tr><td>Random</td><td>0.237</td><td>0.260</td><td>0.281</td></tr><tr><td rowspan=\"3\">KGT5-context + Desc.</td><td>Most common</td><td>0.420</td><td>0.416</td><td>0.420</td></tr><tr><td>Least common</td><td>0.423</td><td>0.424</td><td>0.430</td></tr><tr><td>Random</td><td>0.422</td><td>0.430</td><td>0.430</td></tr></table>",
1189
+ "bbox": [
1190
+ 196,
1191
+ 319,
1192
+ 796,
1193
+ 651
1194
+ ],
1195
+ "page_idx": 9
1196
+ },
1197
+ {
1198
+ "type": "text",
1199
+ "text": "Table 10: Influence of context selection. Semi-inductive test MRR. Best per model in bold.",
1200
+ "bbox": [
1201
+ 191,
1202
+ 659,
1203
+ 803,
1204
+ 675
1205
+ ],
1206
+ "page_idx": 9
1207
+ },
1208
+ {
1209
+ "type": "page_number",
1210
+ "text": "10643",
1211
+ "bbox": [
1212
+ 477,
1213
+ 928,
1214
+ 524,
1215
+ 940
1216
+ ],
1217
+ "page_idx": 9
1218
+ }
1219
+ ]
2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/472ef1b2-669d-4b07-ae82-dafb730e88d4_model.json ADDED
@@ -0,0 +1,1518 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ [
3
+ {
4
+ "type": "title",
5
+ "bbox": [
6
+ 0.126,
7
+ 0.09,
8
+ 0.873,
9
+ 0.112
10
+ ],
11
+ "angle": 0,
12
+ "content": "A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs"
13
+ },
14
+ {
15
+ "type": "text",
16
+ "bbox": [
17
+ 0.26,
18
+ 0.138,
19
+ 0.411,
20
+ 0.153
21
+ ],
22
+ "angle": 0,
23
+ "content": "Adrian Kochsiek"
24
+ },
25
+ {
26
+ "type": "text",
27
+ "bbox": [
28
+ 0.235,
29
+ 0.155,
30
+ 0.435,
31
+ 0.171
32
+ ],
33
+ "angle": 0,
34
+ "content": "University of Mannheim"
35
+ },
36
+ {
37
+ "type": "text",
38
+ "bbox": [
39
+ 0.296,
40
+ 0.172,
41
+ 0.373,
42
+ 0.188
43
+ ],
44
+ "angle": 0,
45
+ "content": "Germany"
46
+ },
47
+ {
48
+ "type": "text",
49
+ "bbox": [
50
+ 0.207,
51
+ 0.189,
52
+ 0.462,
53
+ 0.203
54
+ ],
55
+ "angle": 0,
56
+ "content": "akochsiek@uni-mannheim.de"
57
+ },
58
+ {
59
+ "type": "text",
60
+ "bbox": [
61
+ 0.595,
62
+ 0.138,
63
+ 0.738,
64
+ 0.153
65
+ ],
66
+ "angle": 0,
67
+ "content": "Rainer Gemulla"
68
+ },
69
+ {
70
+ "type": "text",
71
+ "bbox": [
72
+ 0.567,
73
+ 0.155,
74
+ 0.767,
75
+ 0.17
76
+ ],
77
+ "angle": 0,
78
+ "content": "University of Mannheim"
79
+ },
80
+ {
81
+ "type": "text",
82
+ "bbox": [
83
+ 0.628,
84
+ 0.172,
85
+ 0.706,
86
+ 0.188
87
+ ],
88
+ "angle": 0,
89
+ "content": "Germany"
90
+ },
91
+ {
92
+ "type": "text",
93
+ "bbox": [
94
+ 0.545,
95
+ 0.189,
96
+ 0.788,
97
+ 0.204
98
+ ],
99
+ "angle": 0,
100
+ "content": "rgemulla@uni-mannheim.de"
101
+ },
102
+ {
103
+ "type": "title",
104
+ "bbox": [
105
+ 0.261,
106
+ 0.253,
107
+ 0.341,
108
+ 0.269
109
+ ],
110
+ "angle": 0,
111
+ "content": "Abstract"
112
+ },
113
+ {
114
+ "type": "text",
115
+ "bbox": [
116
+ 0.145,
117
+ 0.282,
118
+ 0.46,
119
+ 0.621
120
+ ],
121
+ "angle": 0,
122
+ "content": "Semi-inductive link prediction (LP) in knowledge graphs (KG) is the task of predicting facts for new, previously unseen entities based on context information. Although new entities can be integrated by retraining the model from scratch in principle, such an approach is infeasible for large-scale KGs, where retraining is expensive and new entities may arise frequently. In this paper, we propose and describe a large-scale benchmark to evaluate semi-inductive LP models. The benchmark is based on and extends Wikidata5M: It provides transductive, k-shot, and 0-shot LP tasks, each varying the available information from (i) only KG structure, to (ii) including textual mentions, and (iii) detailed descriptions of the entities. We report on a small study of recent approaches and found that semi-inductive LP performance is far from transductive performance on long-tail entities throughout all experiments. The benchmark provides a test bed for further research into integrating context and textual information in semi-inductive LP models."
123
+ },
124
+ {
125
+ "type": "title",
126
+ "bbox": [
127
+ 0.115,
128
+ 0.636,
129
+ 0.26,
130
+ 0.651
131
+ ],
132
+ "angle": 0,
133
+ "content": "1 Introduction"
134
+ },
135
+ {
136
+ "type": "text",
137
+ "bbox": [
138
+ 0.113,
139
+ 0.662,
140
+ 0.49,
141
+ 0.837
142
+ ],
143
+ "angle": 0,
144
+ "content": "A knowledge graph (KG) is a collection of facts describing relations between real-world entities. Facts are represented in the form of subject-relation-object triples such as (Dave Grohl, memberOf, Foo Fighters). In this paper, we consider link prediction (LP) tasks, i.e., the problem of inferring missing facts in the KG. LP can be transductive (TD; all entities known a priori), semi-inductive (SI; some entities known a priori), and inductive (no entities known a priori). We concentrate on semi-inductive and transductive LP."
145
+ },
146
+ {
147
+ "type": "text",
148
+ "bbox": [
149
+ 0.113,
150
+ 0.839,
151
+ 0.49,
152
+ 0.919
153
+ ],
154
+ "angle": 0,
155
+ "content": "SI-LP focuses on modeling entities that are unknown or unseen during LP, such as out-of-KG entities (not part or not yet part of the KG) or newly created entities, e.g., a new user, product, or event. Such previously unknown entities can be"
156
+ },
157
+ {
158
+ "type": "text",
159
+ "bbox": [
160
+ 0.508,
161
+ 0.253,
162
+ 0.885,
163
+ 0.349
164
+ ],
165
+ "angle": 0,
166
+ "content": "handled by retraining in principle. For large-scale KGs, however, retraining is inherently expensive and new entities may arise frequently. Therefore, the goal of SI-LP is to avoid retraining and perform LP directly, i.e., to generalize beyond the entities seen during training."
167
+ },
168
+ {
169
+ "type": "text",
170
+ "bbox": [
171
+ 0.508,
172
+ 0.35,
173
+ 0.886,
174
+ 0.494
175
+ ],
176
+ "angle": 0,
177
+ "content": "To perform LP for unseen entities, context information about these entities is needed. The amount and form of context information varies widely and may take the form of facts and/or textual information, such as an entity mention and/or its description. For example, a new user in a social network may provide a name, basic facts such as gender or country of origin, and perhaps a textual self-description."
178
+ },
179
+ {
180
+ "type": "text",
181
+ "bbox": [
182
+ 0.508,
183
+ 0.495,
184
+ 0.886,
185
+ 0.782
186
+ ],
187
+ "angle": 0,
188
+ "content": "In this paper, we introduce the Wikidata5M-SI benchmark for SI-LP. Our benchmark is based on the popular Wikidata5M (Wang et al., 2021) benchmark and has four major design goals: (G1) It ensures that unseen entities are long tail entities since popular entities (such as, say, Foo Fighters) and/or types and taxons (such as human and organization) are unlikely to be unseen. (G2) It allows to evaluate each model with varying amounts of contextual facts (0-shot, few-shot, transductive), i.e., to explore individual models across a range of tasks. (G3) It provides a controlled amount of textual information (none, mention, full description), where each setting demands different modeling capabilities. Finally, (G4) the benchmark is large-scale so that retraining is not a suitable approach. All prior SI-LP benchmarks violate at least one of these criteria."
189
+ },
190
+ {
191
+ "type": "text",
192
+ "bbox": [
193
+ 0.508,
194
+ 0.785,
195
+ 0.884,
196
+ 0.817
197
+ ],
198
+ "angle": 0,
199
+ "content": "We report on a small experimental study with recent LP approaches. In general, we found that"
200
+ },
201
+ {
202
+ "type": "text",
203
+ "bbox": [
204
+ 0.525,
205
+ 0.828,
206
+ 0.884,
207
+ 0.86
208
+ ],
209
+ "angle": 0,
210
+ "content": "1. SI performance was far behind TD performance in all experiments for long-tail entities,"
211
+ },
212
+ {
213
+ "type": "text",
214
+ "bbox": [
215
+ 0.524,
216
+ 0.866,
217
+ 0.881,
218
+ 0.898
219
+ ],
220
+ "angle": 0,
221
+ "content": "2. there was generally a trade-off between TD and SI performance,"
222
+ },
223
+ {
224
+ "type": "text",
225
+ "bbox": [
226
+ 0.524,
227
+ 0.903,
228
+ 0.847,
229
+ 0.919
230
+ ],
231
+ "angle": 0,
232
+ "content": "3. textual information was highly valuable,"
233
+ },
234
+ {
235
+ "type": "list",
236
+ "bbox": [
237
+ 0.524,
238
+ 0.828,
239
+ 0.884,
240
+ 0.919
241
+ ],
242
+ "angle": 0,
243
+ "content": null
244
+ },
245
+ {
246
+ "type": "page_number",
247
+ "bbox": [
248
+ 0.477,
249
+ 0.928,
250
+ 0.526,
251
+ 0.941
252
+ ],
253
+ "angle": 0,
254
+ "content": "10634"
255
+ },
256
+ {
257
+ "type": "footer",
258
+ "bbox": [
259
+ 0.211,
260
+ 0.946,
261
+ 0.788,
262
+ 0.959
263
+ ],
264
+ "angle": 0,
265
+ "content": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 10634-10643"
266
+ },
267
+ {
268
+ "type": "footer",
269
+ "bbox": [
270
+ 0.278,
271
+ 0.959,
272
+ 0.72,
273
+ 0.972
274
+ ],
275
+ "angle": 0,
276
+ "content": "December 6-10, 2023 ©2023 Association for Computational Linguistics"
277
+ }
278
+ ],
279
+ [
280
+ {
281
+ "type": "text",
282
+ "bbox": [
283
+ 0.129,
284
+ 0.085,
285
+ 0.488,
286
+ 0.116
287
+ ],
288
+ "angle": 0,
289
+ "content": "4. proper integration of context and textual information needs further exploration, and"
290
+ },
291
+ {
292
+ "type": "text",
293
+ "bbox": [
294
+ 0.129,
295
+ 0.125,
296
+ 0.488,
297
+ 0.155
298
+ ],
299
+ "angle": 0,
300
+ "content": "5. facts involving less common relations provided more useful context."
301
+ },
302
+ {
303
+ "type": "list",
304
+ "bbox": [
305
+ 0.129,
306
+ 0.085,
307
+ 0.488,
308
+ 0.155
309
+ ],
310
+ "angle": 0,
311
+ "content": null
312
+ },
313
+ {
314
+ "type": "text",
315
+ "bbox": [
316
+ 0.114,
317
+ 0.172,
318
+ 0.486,
319
+ 0.202
320
+ ],
321
+ "angle": 0,
322
+ "content": "Our benchmark provides directions and a test bed for further research into SI-LP."
323
+ },
324
+ {
325
+ "type": "title",
326
+ "bbox": [
327
+ 0.114,
328
+ 0.219,
329
+ 0.268,
330
+ 0.234
331
+ ],
332
+ "angle": 0,
333
+ "content": "2 Related Work"
334
+ },
335
+ {
336
+ "type": "text",
337
+ "bbox": [
338
+ 0.113,
339
+ 0.247,
340
+ 0.489,
341
+ 0.584
342
+ ],
343
+ "angle": 0,
344
+ "content": "Multiple SI-LP datasets have been proposed in the literature. The benchmarks of Daza et al. (2021), Albooyeh et al. (2020), and Galkin et al. (2021) are obtained by first merging the splits of smaller transductive LP datasets and subsequently sampling unseen entities uniformly to construct validation and test splits. These benchmarks do not satisfy goals G1-G4. Shi and Weninger (2018) follow a similar approach but focus on only 0-shot evaluation based on textual features. Xie et al. (2016) and Shah et al. (2019) select entities from Freebase with connection to entities in FB15k (Bordes et al., 2013), also focussing on 0-shot evaluation using rich textual descriptions. These approaches do not satisfy G2 and G3. Finally, Wang et al. (2019) and Hamaguchi et al. (2017) uniformly sample test triples and mark occurring entities as unseen. These approaches do not focus on long-tail entities (and, in fact, the accumulated context of unseen entities may be larger than the training graph itself) and they do not satisfy G1-G3."
345
+ },
346
+ {
347
+ "type": "text",
348
+ "bbox": [
349
+ 0.113,
350
+ 0.587,
351
+ 0.489,
352
+ 0.698
353
+ ],
354
+ "angle": 0,
355
+ "content": "There are also several of fully-inductive LP benchmarks (Teru et al., 2020; Wang et al., 2021) involving KGs. While SI-LP aims to connect unseen entities to an existing KG, fully-inductive LP reasons about a new KG with completely separate entities (but shared relations). We do not consider this task in this work."
356
+ },
357
+ {
358
+ "type": "title",
359
+ "bbox": [
360
+ 0.114,
361
+ 0.714,
362
+ 0.422,
363
+ 0.73
364
+ ],
365
+ "angle": 0,
366
+ "content": "3 The Wikidata5M-SI Benchmark"
367
+ },
368
+ {
369
+ "type": "text",
370
+ "bbox": [
371
+ 0.113,
372
+ 0.743,
373
+ 0.489,
374
+ 0.919
375
+ ],
376
+ "angle": 0,
377
+ "content": "Wikidata5M-SI is based on the popular Wikidata5M (Wang et al., 2021) benchmark, which is induced by the 5M most common entities of Wikidata. Our benchmark contains transductive and semi-inductive valid/test splits; see Tab. 1 for an overview. Generally, we aimed to keep Wikidata5M-SI as close as possible to Wikidata5M. We did need to modify the original transductive valid and test splits, however, because they unintentionally contained both seen and unseen entities (i.e., these splits were not fully transductive). We"
378
+ },
379
+ {
380
+ "type": "table",
381
+ "bbox": [
382
+ 0.512,
383
+ 0.082,
384
+ 0.88,
385
+ 0.172
386
+ ],
387
+ "angle": 0,
388
+ "content": "<table><tr><td rowspan=\"2\"></td><td rowspan=\"2\">Train</td><td colspan=\"2\">Transductive</td><td colspan=\"2\">Semi-inductive</td></tr><tr><td>Valid</td><td>Test</td><td>Valid</td><td>Test</td></tr><tr><td>Triples</td><td>20,600,187</td><td>4,983</td><td>4,977</td><td>5,500</td><td>5,500</td></tr><tr><td>Entities</td><td>4,593,103</td><td>7,768</td><td>7,760</td><td>3,722</td><td>3,793</td></tr><tr><td>Entities unseen</td><td>-</td><td>0</td><td>0</td><td>500</td><td>500</td></tr><tr><td>Relations</td><td>822</td><td>217</td><td>211</td><td>126</td><td>115</td></tr></table>"
389
+ },
390
+ {
391
+ "type": "table_caption",
392
+ "bbox": [
393
+ 0.536,
394
+ 0.181,
395
+ 0.855,
396
+ 0.196
397
+ ],
398
+ "angle": 0,
399
+ "content": "Table 1: Statistics of the Wikidata5M-SI splits."
400
+ },
401
+ {
402
+ "type": "text",
403
+ "bbox": [
404
+ 0.508,
405
+ 0.224,
406
+ 0.881,
407
+ 0.254
408
+ ],
409
+ "angle": 0,
410
+ "content": "did that by simply removing all triples involving unseen entities."
411
+ },
412
+ {
413
+ "type": "text",
414
+ "bbox": [
415
+ 0.508,
416
+ 0.258,
417
+ 0.884,
418
+ 0.449
419
+ ],
420
+ "angle": 0,
421
+ "content": "Unseen entities. To ensure that unseen entities in the semi-inductive splits are from the long tail (G1), we only considered entities of degree 20 or less. To be able to provide sufficient context for few-shot tasks (G2), we further did not consider entities of degree 10 or less. In more detail, we sampled 500 entities of degrees 11-20 (stratified sampling grouped by degree) for each semi-inductive split. All sampled entities, along with their facts, were removed from the train split. Note that these entities (naturally) have a different class distribution than all entities; see Sec. A.1 for details."
422
+ },
423
+ {
424
+ "type": "text",
425
+ "bbox": [
426
+ 0.508,
427
+ 0.452,
428
+ 0.884,
429
+ 0.82
430
+ ],
431
+ "angle": 0,
432
+ "content": "Tasks and metrics. For TD tasks, we follow the standard protocol of Wikidata5M. To construct SI tasks, we include 11 of the original facts of each unseen entity into its SI split; each split thus contains 5,500 triples. This enables up to 10-shot SI tasks (1 fact to test, up to 10 facts for context). For entities of degree larger than 11, we select the 11 facts with the most frequent relations; see Tab. 2 for an example. The rationale is that more common relations (such as instanceof or country) may be considered more likely to be provided for unseen entities than rare ones (such as militaryBranch or publisher). We then construct a single \\( k \\)-shot task for each triple \\( (s,p,o) \\) in the SI split as follows. When, say, \\( s \\) is the unseen entity, we consider the LP task \\( (s,p,?) \\) and provide \\( k \\) additional facts of form \\( (s,p',o') \\) as context. Context facts are selected by frequency as above, but we also explored random and infrequent-relation context in our study. Models are asked to provide a ranking of predicted answers, and we determine the filtered mean reciprocal rank (MRR) and Hits@K of the correct answer \\( (o) \\)."
433
+ },
434
+ {
435
+ "type": "text",
436
+ "bbox": [
437
+ 0.508,
438
+ 0.824,
439
+ 0.884,
440
+ 0.919
441
+ ],
442
+ "angle": 0,
443
+ "content": "Textual information. For each entity, we provide its principal mention and a detailed description (both directly from Wikidata5M); see Tab. 2. This allows to differentiate model evaluation with varying amounts of textual information per entity (G3): (A) atomic, i.e., no textual information, (M) men"
444
+ },
445
+ {
446
+ "type": "page_number",
447
+ "bbox": [
448
+ 0.478,
449
+ 0.928,
450
+ 0.525,
451
+ 0.941
452
+ ],
453
+ "angle": 0,
454
+ "content": "10635"
455
+ }
456
+ ],
457
+ [
458
+ {
459
+ "type": "table",
460
+ "bbox": [
461
+ 0.127,
462
+ 0.082,
463
+ 0.871,
464
+ 0.419
465
+ ],
466
+ "angle": 0,
467
+ "content": "<table><tr><td>ID</td><td>Q18918</td><td></td></tr><tr><td>Mention</td><td>Sam Witwer</td><td></td></tr><tr><td>Description</td><td colspan=\"2\">Samuel Stewart Witwer (born October 20, 1977) is an American actor and mu-sician. He is known for portraying Crashdown in Battlestar Galactica, Davis Bloome in Smallville, Aidan Waite in Being Human, and Ben Lockwood in Supergirl. He voiced the protagonist Galen Marek / Starkiller in Star Wars: The Force Unleashed, the Son in Star Wars: The Clone Wars and Emperor Palpatine in Star Wars Rebels, both of which he has also voiced Darth Maul.</td></tr><tr><td rowspan=\"11\">Context triples</td><td>instance of | human</td><td>M: ○ D: ○</td></tr><tr><td>country of citizenship | United States of America</td><td>M: × D: ○</td></tr><tr><td>occupation | musician</td><td>M: × D: ✓</td></tr><tr><td>occupation | actor</td><td>M: × D: ✓</td></tr><tr><td>place of birth | Glenview</td><td>M: × D: ×</td></tr><tr><td>given name | Samuel</td><td>M: ○ D: ✓</td></tr><tr><td>given name | Sam</td><td>M: ✓ D: ○</td></tr><tr><td>cast member | Battlestar Galactica</td><td>M: × D: ✓</td></tr><tr><td>cast member | Being Human - supernatural drama television series</td><td>M: × D: ✓</td></tr><tr><td>cast member | Star Wars: The Force Unleashed II</td><td>M: × D: ○</td></tr><tr><td>cast member | The Mist</td><td>M: × D: ×</td></tr></table>"
468
+ },
469
+ {
470
+ "type": "table_caption",
471
+ "bbox": [
472
+ 0.113,
473
+ 0.429,
474
+ 0.884,
475
+ 0.472
476
+ ],
477
+ "angle": 0,
478
+ "content": "Table 2: Example of an entity from the semi-inductive validation set of Wikidata5M-SI. For each triple, we annotated whether the answer is contained in (✓), deducible from (○), or not contained in (×) mention (M) or description (D)."
479
+ },
480
+ {
481
+ "type": "text",
482
+ "bbox": [
483
+ 0.113,
484
+ 0.497,
485
+ 0.489,
486
+ 0.641
487
+ ],
488
+ "angle": 0,
489
+ "content": "tions only, and (D) detailed textual descriptions as in (Kochsiek et al., 2023). This differentiation is especially important in the SI setting, as detailed text descriptions might not be provided for unseen entities and each setting demands different modeling capabilities. In fact, (A) performs reasoning only using graph structure, whereas (D) also benefits from information extraction to some extent. We discuss this further in Sec. 5."
490
+ },
491
+ {
492
+ "type": "title",
493
+ "bbox": [
494
+ 0.114,
495
+ 0.653,
496
+ 0.421,
497
+ 0.684
498
+ ],
499
+ "angle": 0,
500
+ "content": "4 Semi-Inductive Link Prediction Models"
501
+ },
502
+ {
503
+ "type": "text",
504
+ "bbox": [
505
+ 0.113,
506
+ 0.695,
507
+ 0.489,
508
+ 0.726
509
+ ],
510
+ "angle": 0,
511
+ "content": "We briefly summarize recent models for SI-LP; we considered these models in our experimental study."
512
+ },
513
+ {
514
+ "type": "text",
515
+ "bbox": [
516
+ 0.113,
517
+ 0.727,
518
+ 0.49,
519
+ 0.919
520
+ ],
521
+ "angle": 0,
522
+ "content": "Graph-only models. ComplEx (Trouillon et al., 2016) is the best-performing transductive KGE model on Wikidata5M (Kochsiek et al., 2022). To use ComplEx for SI-LP, we follow an approach explored by Jambor et al. (2021). In particular, we represent each entity as the sum of a local embedding (one per entity) and a global bias embedding. For 0-shot, we solely use the global bias for the unseen entity. For k-shot, we obtain the local embedding for the unseen entity by performing a single training step on the context triples (keeping all other embeddings fixed). An alternative"
523
+ },
524
+ {
525
+ "type": "text",
526
+ "bbox": [
527
+ 0.508,
528
+ 0.497,
529
+ 0.885,
530
+ 0.738
531
+ ],
532
+ "angle": 0,
533
+ "content": "approach is taken by oDistMult-ERAvg (Albooyeh et al., 2020), which represents unseen entities by aggregating the embeddings of the relations and entities in the context. A more direct approach is taken by HittER (Chen et al., 2021), which contextualizes the query entity with its neighborhood for TD-LP. The approach can be used for SI-LP directly by using a masking token (akin to the global bias above) for an unseen entity. We originally planned to consider NodePiece (Galkin et al., 2021) (entity represented by a combination of anchor embeddings) and NBFNet (Zhu et al., 2021) (a GNN-based LP model); both support SI-LP directly. However, the available implementations did not scale to Wikidata5M-SI (out of memory)."
534
+ },
535
+ {
536
+ "type": "text",
537
+ "bbox": [
538
+ 0.508,
539
+ 0.741,
540
+ 0.884,
541
+ 0.79
542
+ ],
543
+ "angle": 0,
544
+ "content": "Text-based models. As a baseline approach to integrate textual information directly into KGE models, we consider the approach explored in the"
545
+ },
546
+ {
547
+ "type": "page_footnote",
548
+ "bbox": [
549
+ 0.508,
550
+ 0.809,
551
+ 0.883,
552
+ 0.846
553
+ ],
554
+ "angle": 0,
555
+ "content": "To address the high memory footprint (Galkin et al., 2021) of oDistMult-ERAvg, we extend it with neighborhood sampling."
556
+ },
557
+ {
558
+ "type": "page_footnote",
559
+ "bbox": [
560
+ 0.508,
561
+ 0.847,
562
+ 0.883,
563
+ 0.919
564
+ ],
565
+ "angle": 0,
566
+ "content": "For NBFNet (Zhu et al., 2021), the large memory footprint is inherent to the model; it is a full-graph GNN and hard to scale. For NodePiece (Galkin et al., 2021), however, the problem mainly lies in the expensive evaluation. All intermediate representations are precomputed, leading to a large memory overhead."
567
+ },
568
+ {
569
+ "type": "list",
570
+ "bbox": [
571
+ 0.508,
572
+ 0.809,
573
+ 0.883,
574
+ 0.919
575
+ ],
576
+ "angle": 0,
577
+ "content": null
578
+ },
579
+ {
580
+ "type": "page_number",
581
+ "bbox": [
582
+ 0.478,
583
+ 0.928,
584
+ 0.526,
585
+ 0.941
586
+ ],
587
+ "angle": 0,
588
+ "content": "10636"
589
+ }
590
+ ],
591
+ [
592
+ {
593
+ "type": "text",
594
+ "bbox": [
595
+ 0.117,
596
+ 0.083,
597
+ 0.492,
598
+ 0.421
599
+ ],
600
+ "angle": 0,
601
+ "content": "WikiKG90M benchmark (Hu et al., 2021); see Sec. A.2 for details. The remaining approaches are purely textual. SimKGC (Wang et al., 2022) utilizes two pretrained BERT Transformers: one to embed query entities (and relations) based on their mention or description, and one for tail entities. Using a contrastive learning approach, it measures cosine similarity between both representations for ranking. KGT5 (Saxena et al., 2022) is a sequence-to-sequence link prediction approach, which is trained to generate the mention of the answer entity using the mention or description of the query entity and relation as input. Both approaches support 0-shot SI-LP when textual information is provided for the query entity. They do not utilize additional context, however, i.e., do not support k-shot SI-LP. KGT5-context (Kochsiek et al., 2023) is an extension of KGT5, which extends the input of KGT5 by the one-hop neighborhood of the query entity and consequently supports k-shot LP directly."
602
+ },
603
+ {
604
+ "type": "title",
605
+ "bbox": [
606
+ 0.114,
607
+ 0.436,
608
+ 0.322,
609
+ 0.453
610
+ ],
611
+ "angle": 0,
612
+ "content": "5 Experimental Study"
613
+ },
614
+ {
615
+ "type": "text",
616
+ "bbox": [
617
+ 0.113,
618
+ 0.463,
619
+ 0.489,
620
+ 0.558
621
+ ],
622
+ "angle": 0,
623
+ "content": "We evaluated all presented baseline models in the TD and SI setting on the atomic, mentions, and descriptions dataset. Further, we evaluated in detail which context was most useful and what information was conveyed by textual mentions and descriptions."
624
+ },
625
+ {
626
+ "type": "text",
627
+ "bbox": [
628
+ 0.113,
629
+ 0.561,
630
+ 0.49,
631
+ 0.639
632
+ ],
633
+ "angle": 0,
634
+ "content": "Setup. Source code, configuration, and the benchmark itself are available at https://github. com/uma-pi1.wikidata5m-si. For further details on hyperparameter tuning and training see Sec. A.3."
635
+ },
636
+ {
637
+ "type": "text",
638
+ "bbox": [
639
+ 0.113,
640
+ 0.641,
641
+ 0.489,
642
+ 0.85
643
+ ],
644
+ "angle": 0,
645
+ "content": "Main results. Transductive and SI performance in terms of MRR of all models is presented in Tab. 3; Hits@K in Tab. 7-9 (Sec. A). Note that overall transductive performance was oftentimes below best reported SI performance. This is due to varying degrees of query entities between both settings. Typically, models perform better predicting new relations for an entity (e.g., the birthplace) than predicting additional objects for a known relation (e.g., additional awards won by a person) (Saxena et al., 2022; Kochsiek et al., 2023). For a direct comparison between both settings, we additionally report TD performance on long tail query entities.\\(^{3}\\)"
646
+ },
647
+ {
648
+ "type": "text",
649
+ "bbox": [
650
+ 0.114,
651
+ 0.851,
652
+ 0.49,
653
+ 0.882
654
+ ],
655
+ "angle": 0,
656
+ "content": "Atomic. TD performance on the long tail was considerably higher than SI performance. As no in"
657
+ },
658
+ {
659
+ "type": "text",
660
+ "bbox": [
661
+ 0.508,
662
+ 0.085,
663
+ 0.883,
664
+ 0.165
665
+ ],
666
+ "angle": 0,
667
+ "content": "formation was provided for unseen entities, 0-shot was not reasonably possible. Without text-based information, context was a necessity. A simple neighborhood aggregation—entity-relation average (ERAvg)—offered the best integration of context."
668
+ },
669
+ {
670
+ "type": "text",
671
+ "bbox": [
672
+ 0.509,
673
+ 0.168,
674
+ 0.885,
675
+ 0.586
676
+ ],
677
+ "angle": 0,
678
+ "content": "Mentions. Integrating mentions did not improve performance on its own, as provided text information was still limited. However, additionally providing context information during inference (KGT5-context) simplified the learning problem and improved TD performance significantly. But for 0-shot, the limited text information provided with mentions allowed for reasonable performance. To analyze what information is conveyed for 0-shot, we annotated 100 valid triples; see Tab. 4. In \\(10\\%\\) of cases, the answer was already contained in the mention, and it was deducible in at least \\(7\\%\\). This enabled basic reasoning without any further information. In contrast to the TD setting, KGT5 outperformed its context extension. KGT5-context was reliant on context which was lacking especially during 0-shot. This showed a trade-off between best performance in the SI and TD setting. This trade-off could be mitigated by applying (full and partial) context hiding. With such adapted training, KGT5-context reached a middle ground with a transductive MRR of 0.366 and 0-shot MRR of 0.283.4 However, even with full context (10-shot), performance was still only on par with KGT5. Therefore, context information did not bring any further benefits when text was provided."
679
+ },
680
+ {
681
+ "type": "text",
682
+ "bbox": [
683
+ 0.508,
684
+ 0.589,
685
+ 0.884,
686
+ 0.701
687
+ ],
688
+ "angle": 0,
689
+ "content": "Descriptions. Further, integrating descriptions improved performance for both settings, TD and SI, considerably; see Tab. 3. Similar to the mentions-only setting, KGT5-context performed best in TD and KGT5 in the SI setting. Applying the same trade-off with context-hiding reached a middle ground with 0.418 TD-MRR and 0.449 SI-MRR."
690
+ },
691
+ {
692
+ "type": "text",
693
+ "bbox": [
694
+ 0.508,
695
+ 0.704,
696
+ 0.884,
697
+ 0.864
698
+ ],
699
+ "angle": 0,
700
+ "content": "Descriptions were very detailed and partially contained the correct answer as well as the same information as contained in context triples; see Tab. 4. Therefore, performance did not further improve with context size. In such cases, models mainly benefit from information extraction capabilities. To judge how much information extraction helps, we grouped performance of KGT5+description in the 0-shot setting on validation data into the groups contained, deducible and not contained in descrip"
701
+ },
702
+ {
703
+ "type": "page_footnote",
704
+ "bbox": [
705
+ 0.508,
706
+ 0.881,
707
+ 0.884,
708
+ 0.919
709
+ ],
710
+ "angle": 0,
711
+ "content": "4In \\(25\\% / 25\\% / 50\\%\\) of cases, we hid the full context/sampled between 1-10 neighbors/used the full context, respectively."
712
+ },
713
+ {
714
+ "type": "page_footnote",
715
+ "bbox": [
716
+ 0.114,
717
+ 0.892,
718
+ 0.488,
719
+ 0.919
720
+ ],
721
+ "angle": 0,
722
+ "content": "3We define long tail query entities as entities with degree \\(\\leq 10\\) as in the SI setting."
723
+ },
724
+ {
725
+ "type": "page_number",
726
+ "bbox": [
727
+ 0.478,
728
+ 0.928,
729
+ 0.526,
730
+ 0.941
731
+ ],
732
+ "angle": 0,
733
+ "content": "10637"
734
+ }
735
+ ],
736
+ [
737
+ {
738
+ "type": "table",
739
+ "bbox": [
740
+ 0.114,
741
+ 0.082,
742
+ 0.881,
743
+ 0.284
744
+ ],
745
+ "angle": 0,
746
+ "content": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">Transductive</td><td colspan=\"5\">Semi-inductive (num. shots)</td><td rowspan=\"2\">Pre-trained</td></tr><tr><td>All</td><td>Long tail</td><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.308</td><td>0.523</td><td>0.124</td><td>0.151</td><td>0.176</td><td>0.190</td><td>0.206</td><td>no</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.294</td><td>0.512</td><td>-</td><td>0.171</td><td>0.246</td><td>0.295</td><td>0.333</td><td>no</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.284</td><td>0.512</td><td>0.019</td><td>0.105</td><td>0.153</td><td>0.179</td><td>0.221</td><td>no</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.299</td><td>0.535</td><td>-</td><td>0.187</td><td>0.235</td><td>0.258</td><td>0.280</td><td>yes</td></tr><tr><td>SimKGC (mentions only)</td><td>0.212</td><td>0.361</td><td>0.220</td><td>-</td><td>-</td><td>-</td><td>-</td><td>yes</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.281</td><td>0.542</td><td>0.310</td><td>-</td><td>-</td><td>-</td><td>-</td><td>no</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.374</td><td>0.678</td><td>0.220</td><td>0.217</td><td>0.236</td><td>0.259</td><td>0.311</td><td>no</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.313</td><td>0.585</td><td>-</td><td>0.278</td><td>0.281</td><td>0.285</td><td>0.292</td><td>yes</td></tr><tr><td>SimKGC + Descriptions (Wang et al., 2022)</td><td>0.353</td><td>0.663</td><td>0.403</td><td>-</td><td>-</td><td>-</td><td>-</td><td>yes</td></tr><tr><td>KGT5 + Descriptions (Kochsiek et al., 2023)</td><td>0.364</td><td>0.728</td><td>0.470</td><td>-</td><td>-</td><td>-</td><td>-</td><td>no</td></tr><tr><td>KGT5-context + Descriptions (Kochsiek et al., 2023)</td><td>0.420</td><td>0.777</td><td>0.417</td><td>0.420</td><td>0.416</td><td>0.420</td><td>0.437</td><td>no</td></tr></table>"
747
+ },
748
+ {
749
+ "type": "table_caption",
750
+ "bbox": [
751
+ 0.113,
752
+ 0.295,
753
+ 0.884,
754
+ 0.339
755
+ ],
756
+ "angle": 0,
757
+ "content": "Table 3: Transductive and semi-inductive link prediction results in terms of MRR on the dataset Wikidata5M-SI. The first group presets results on the atomic, the second on the mentions and the third on the descriptions dataset. Best per TD/SI in bold. Best per group underlined."
758
+ },
759
+ {
760
+ "type": "table",
761
+ "bbox": [
762
+ 0.14,
763
+ 0.36,
764
+ 0.465,
765
+ 0.435
766
+ ],
767
+ "angle": 0,
768
+ "content": "<table><tr><td></td><td>Mention</td><td>Description</td></tr><tr><td>Contained</td><td>10%</td><td>44%</td></tr><tr><td>Deductible</td><td>7%</td><td>10%</td></tr><tr><td>Not contained</td><td>83%</td><td>46%</td></tr></table>"
769
+ },
770
+ {
771
+ "type": "table_caption",
772
+ "bbox": [
773
+ 0.114,
774
+ 0.445,
775
+ 0.487,
776
+ 0.487
777
+ ],
778
+ "angle": 0,
779
+ "content": "Table 4: Information about a query answer contained in mentions and descriptions. Annotated for 100 sampled triples from 0-shot valid. For an example, see Tab. 2."
780
+ },
781
+ {
782
+ "type": "table",
783
+ "bbox": [
784
+ 0.139,
785
+ 0.505,
786
+ 0.465,
787
+ 0.576
788
+ ],
789
+ "angle": 0,
790
+ "content": "<table><tr><td>Context selection</td><td>1</td><td>3</td><td>5</td></tr><tr><td>Most common</td><td>0.217</td><td>0.236</td><td>0.259</td></tr><tr><td>Least common</td><td>0.253</td><td>0.273</td><td>0.290</td></tr><tr><td>Random</td><td>0.237</td><td>0.260</td><td>0.281</td></tr></table>"
791
+ },
792
+ {
793
+ "type": "table_caption",
794
+ "bbox": [
795
+ 0.114,
796
+ 0.585,
797
+ 0.487,
798
+ 0.613
799
+ ],
800
+ "angle": 0,
801
+ "content": "Table 5: Influence of context selection. Semi-inductive test MRR of KGT5-context."
802
+ },
803
+ {
804
+ "type": "text",
805
+ "bbox": [
806
+ 0.113,
807
+ 0.644,
808
+ 0.486,
809
+ 0.675
810
+ ],
811
+ "angle": 0,
812
+ "content": "tion; see Fig. 1 in Sec. A. When contained, the correct answer was extracted in \\(\\approx 70\\%\\) of cases."
813
+ },
814
+ {
815
+ "type": "text",
816
+ "bbox": [
817
+ 0.113,
818
+ 0.679,
819
+ 0.489,
820
+ 0.919
821
+ ],
822
+ "angle": 0,
823
+ "content": "Context selection. We selected the most common relations as context triples so far, as this may be a more realistic setting. To investigate the effect of this selection approach, we compared the default selection of choosing most common relations to least common and random. Results for KGT5-context are shown in Tab. 5; for all other models in Tab. 10 in Sec. A. We found that the less common the relations of the provided context, the better the SI performance. More common context relations often described high-level concepts, while less common provided further detail; see the example in Tab. 2. While more common context may be more readily available, less common context was more helpful to describe a new entity."
824
+ },
825
+ {
826
+ "type": "title",
827
+ "bbox": [
828
+ 0.509,
829
+ 0.363,
830
+ 0.642,
831
+ 0.377
832
+ ],
833
+ "angle": 0,
834
+ "content": "6 Conclusion"
835
+ },
836
+ {
837
+ "type": "text",
838
+ "bbox": [
839
+ 0.508,
840
+ 0.389,
841
+ 0.884,
842
+ 0.598
843
+ ],
844
+ "angle": 0,
845
+ "content": "We proposed the new WikiData5M-SI large-scale benchmark for semi-supervised link prediction. The benchmark focuses on unseen entities from the long tail and allows to evaluate models with varying and controlled amounts of factual and textual context information. In our experimental evaluation, we found that semi-inductive LP performance fell behind transductive performance for long-tail entities in general, and that detailed textual information was often more valuable than factual context information. Moreover, current models did not integrate these two types of information adequately, suggesting a direction for future research."
846
+ },
847
+ {
848
+ "type": "title",
849
+ "bbox": [
850
+ 0.51,
851
+ 0.612,
852
+ 0.615,
853
+ 0.627
854
+ ],
855
+ "angle": 0,
856
+ "content": "Limitations"
857
+ },
858
+ {
859
+ "type": "text",
860
+ "bbox": [
861
+ 0.508,
862
+ 0.638,
863
+ 0.884,
864
+ 0.783
865
+ ],
866
+ "angle": 0,
867
+ "content": "This study was performed on Wikidata5M-SI, i.e., a subset of a single knowledge graph. Model performance and insights may vary if graph structure and/or availability and usefulness of mentions and description is different. In particular, the entity descriptions provided with Wikidata5M-SI partly contained information relevant for link prediction so that models benefited from information extraction capabilities."
868
+ },
869
+ {
870
+ "type": "title",
871
+ "bbox": [
872
+ 0.51,
873
+ 0.797,
874
+ 0.661,
875
+ 0.812
876
+ ],
877
+ "angle": 0,
878
+ "content": "Ethics Statement"
879
+ },
880
+ {
881
+ "type": "text",
882
+ "bbox": [
883
+ 0.508,
884
+ 0.823,
885
+ 0.884,
886
+ 0.903
887
+ ],
888
+ "angle": 0,
889
+ "content": "This research adapts publicly available data, benchmarks, and codebases for evaluation. We believe that this research was conducted in an ethical manner in compliance with all relevant laws and regulations."
890
+ },
891
+ {
892
+ "type": "page_number",
893
+ "bbox": [
894
+ 0.478,
895
+ 0.928,
896
+ 0.526,
897
+ 0.941
898
+ ],
899
+ "angle": 0,
900
+ "content": "10638"
901
+ }
902
+ ],
903
+ [
904
+ {
905
+ "type": "title",
906
+ "bbox": [
907
+ 0.116,
908
+ 0.085,
909
+ 0.214,
910
+ 0.099
911
+ ],
912
+ "angle": 0,
913
+ "content": "References"
914
+ },
915
+ {
916
+ "type": "ref_text",
917
+ "bbox": [
918
+ 0.117,
919
+ 0.107,
920
+ 0.49,
921
+ 0.174
922
+ ],
923
+ "angle": 0,
924
+ "content": "Marjan Albooyeh, Rishab Goel, and Seyed Mehran Kazemi. 2020. Out-of-sample representation learning for knowledge graphs. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 2657-2666."
925
+ },
926
+ {
927
+ "type": "ref_text",
928
+ "bbox": [
929
+ 0.117,
930
+ 0.183,
931
+ 0.49,
932
+ 0.25
933
+ ],
934
+ "angle": 0,
935
+ "content": "Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. 2013. Translating embeddings for modeling multi-relational data. In Neural Information Processing Systems (NIPS), pages 1-9."
936
+ },
937
+ {
938
+ "type": "ref_text",
939
+ "bbox": [
940
+ 0.117,
941
+ 0.258,
942
+ 0.49,
943
+ 0.35
944
+ ],
945
+ "angle": 0,
946
+ "content": "Samuel Broscheit, Daniel Ruffinelli, Adrian Kochsiek, Patrick Betz, and Rainer Gemulla. 2020. LibKGE - A knowledge graph embedding library for reproducible research. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 165-174."
947
+ },
948
+ {
949
+ "type": "ref_text",
950
+ "bbox": [
951
+ 0.117,
952
+ 0.36,
953
+ 0.49,
954
+ 0.44
955
+ ],
956
+ "angle": 0,
957
+ "content": "Sanxing Chen, Xiaodong Liu, Jianfeng Gao, Jian Jiao, Ruofei Zhang, and Yangfeng Ji. 2021. Hitter: Hierarchical transformers for knowledge graph embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10395-10407."
958
+ },
959
+ {
960
+ "type": "ref_text",
961
+ "bbox": [
962
+ 0.117,
963
+ 0.448,
964
+ 0.489,
965
+ 0.502
966
+ ],
967
+ "angle": 0,
968
+ "content": "Daniel Daza, Michael Cochez, and Paul Groth. 2021. Inductive entity representations from text via link prediction. In Proceedings of the Web Conference 2021, pages 798-808."
969
+ },
970
+ {
971
+ "type": "ref_text",
972
+ "bbox": [
973
+ 0.117,
974
+ 0.511,
975
+ 0.49,
976
+ 0.577
977
+ ],
978
+ "angle": 0,
979
+ "content": "Mikhail Galkin, Etienne Denis, Jiapeng Wu, and William L Hamilton. 2021. Nodepiece: Compositional and parameter-efficient representations of large knowledge graphs. In International Conference on Learning Representations."
980
+ },
981
+ {
982
+ "type": "ref_text",
983
+ "bbox": [
984
+ 0.117,
985
+ 0.586,
986
+ 0.49,
987
+ 0.666
988
+ ],
989
+ "angle": 0,
990
+ "content": "Takuo Hamaguchi, Hidekazu Oiwa, Masashi Shimbo, and Yuji Matsumoto. 2017. Knowledge transfer for out-of-knowledge-base entities: a graph neural network approach. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pages 1802-1808."
991
+ },
992
+ {
993
+ "type": "ref_text",
994
+ "bbox": [
995
+ 0.117,
996
+ 0.675,
997
+ 0.49,
998
+ 0.742
999
+ ],
1000
+ "angle": 0,
1001
+ "content": "Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. 2021. Ogb-lsc: A large-scale challenge for machine learning on graphs. Advances in Neural Information Processing Systems, 35."
1002
+ },
1003
+ {
1004
+ "type": "ref_text",
1005
+ "bbox": [
1006
+ 0.117,
1007
+ 0.751,
1008
+ 0.49,
1009
+ 0.83
1010
+ ],
1011
+ "angle": 0,
1012
+ "content": "Dora Jambor, Komal Teru, Joelle Pineau, and William L Hamilton. 2021. Exploring the limits of few-shot link prediction in knowledge graphs. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2816-2822."
1013
+ },
1014
+ {
1015
+ "type": "ref_text",
1016
+ "bbox": [
1017
+ 0.117,
1018
+ 0.84,
1019
+ 0.49,
1020
+ 0.919
1021
+ ],
1022
+ "angle": 0,
1023
+ "content": "Adrian Kochsiek, Fritz Niesel, and Rainer Gemulla. 2022. Start small, think big: On hyperparameter optimization for large-scale knowledge graph embeddings. In Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2022, Grenoble, France, September"
1024
+ },
1025
+ {
1026
+ "type": "list",
1027
+ "bbox": [
1028
+ 0.117,
1029
+ 0.107,
1030
+ 0.49,
1031
+ 0.919
1032
+ ],
1033
+ "angle": 0,
1034
+ "content": null
1035
+ },
1036
+ {
1037
+ "type": "ref_text",
1038
+ "bbox": [
1039
+ 0.53,
1040
+ 0.086,
1041
+ 0.884,
1042
+ 0.114
1043
+ ],
1044
+ "angle": 0,
1045
+ "content": "19-23, 2022, Proceedings, Part II, pages 138-154. Springer."
1046
+ },
1047
+ {
1048
+ "type": "ref_text",
1049
+ "bbox": [
1050
+ 0.512,
1051
+ 0.125,
1052
+ 0.884,
1053
+ 0.191
1054
+ ],
1055
+ "angle": 0,
1056
+ "content": "Adrian Kochsiek, Apoorv Saxena, Inderjeet Nair, and Rainer Gemulla. 2023. Friendly neighbors: Contextualized sequence-to-sequence link prediction. In Proceedings of the 8th Workshop on Representation Learning for NLP."
1057
+ },
1058
+ {
1059
+ "type": "ref_text",
1060
+ "bbox": [
1061
+ 0.512,
1062
+ 0.203,
1063
+ 0.884,
1064
+ 0.282
1065
+ ],
1066
+ "angle": 0,
1067
+ "content": "Apoory Saxena, Adrian Kochsiek, and Rainer Gemulla. 2022. Sequence-to-sequence knowledge graph completion and question answering. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2814-2828."
1068
+ },
1069
+ {
1070
+ "type": "ref_text",
1071
+ "bbox": [
1072
+ 0.512,
1073
+ 0.293,
1074
+ 0.884,
1075
+ 0.372
1076
+ ],
1077
+ "angle": 0,
1078
+ "content": "Haseeb Shah, Johannes Villmow, Adrian Ulges, Ulrich Schwanecke, and Faisal Shafait. 2019. An open-world extension to knowledge graph completion models. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 3044-3051."
1079
+ },
1080
+ {
1081
+ "type": "ref_text",
1082
+ "bbox": [
1083
+ 0.512,
1084
+ 0.384,
1085
+ 0.884,
1086
+ 0.436
1087
+ ],
1088
+ "angle": 0,
1089
+ "content": "Baoxu Shi and Tim Weninger. 2018. Open-world knowledge graph completion. In Proceedings of the AAAI conference on artificial intelligence, volume 32."
1090
+ },
1091
+ {
1092
+ "type": "ref_text",
1093
+ "bbox": [
1094
+ 0.512,
1095
+ 0.449,
1096
+ 0.884,
1097
+ 0.514
1098
+ ],
1099
+ "angle": 0,
1100
+ "content": "Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and TieYan Liu. 2020. Mpnet: Masked and permuted pretraining for language understanding. Advances in Neural Information Processing Systems, 33:16857-16867."
1101
+ },
1102
+ {
1103
+ "type": "ref_text",
1104
+ "bbox": [
1105
+ 0.512,
1106
+ 0.526,
1107
+ 0.884,
1108
+ 0.58
1109
+ ],
1110
+ "angle": 0,
1111
+ "content": "Komal Teru, Etienne Denis, and Will Hamilton. 2020. Inductive relation prediction by subgraph reasoning. In International Conference on Machine Learning, pages 9448-9457."
1112
+ },
1113
+ {
1114
+ "type": "ref_text",
1115
+ "bbox": [
1116
+ 0.512,
1117
+ 0.592,
1118
+ 0.884,
1119
+ 0.658
1120
+ ],
1121
+ "angle": 0,
1122
+ "content": "Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. 2016. Complex embeddings for simple link prediction. In International conference on machine learning, pages 2071-2080."
1123
+ },
1124
+ {
1125
+ "type": "ref_text",
1126
+ "bbox": [
1127
+ 0.512,
1128
+ 0.67,
1129
+ 0.884,
1130
+ 0.751
1131
+ ],
1132
+ "angle": 0,
1133
+ "content": "Liang Wang, Wei Zhao, Zhuoyu Wei, and Jingming Liu. 2022. Simkgc: Simple contrastive knowledge graph completion with pre-trained language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4281-4294."
1134
+ },
1135
+ {
1136
+ "type": "ref_text",
1137
+ "bbox": [
1138
+ 0.512,
1139
+ 0.762,
1140
+ 0.884,
1141
+ 0.828
1142
+ ],
1143
+ "angle": 0,
1144
+ "content": "Peifeng Wang, Jialong Han, Chenliang Li, and Rong Pan. 2019. Logic attention based neighborhood aggregation for inductive knowledge graph embedding. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7152-7159."
1145
+ },
1146
+ {
1147
+ "type": "ref_text",
1148
+ "bbox": [
1149
+ 0.512,
1150
+ 0.84,
1151
+ 0.884,
1152
+ 0.918
1153
+ ],
1154
+ "angle": 0,
1155
+ "content": "Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhengyan Zhang, Zhiyuan Liu, Juanzi Li, and Jian Tang. 2021. Kepler: A unified model for knowledge embedding and pre-trained language representation. Transactions of the Association for Computational Linguistics, 9:176-194."
1156
+ },
1157
+ {
1158
+ "type": "list",
1159
+ "bbox": [
1160
+ 0.512,
1161
+ 0.086,
1162
+ 0.884,
1163
+ 0.918
1164
+ ],
1165
+ "angle": 0,
1166
+ "content": null
1167
+ },
1168
+ {
1169
+ "type": "page_number",
1170
+ "bbox": [
1171
+ 0.478,
1172
+ 0.929,
1173
+ 0.525,
1174
+ 0.941
1175
+ ],
1176
+ "angle": 0,
1177
+ "content": "10639"
1178
+ }
1179
+ ],
1180
+ [
1181
+ {
1182
+ "type": "text",
1183
+ "bbox": [
1184
+ 0.116,
1185
+ 0.086,
1186
+ 0.488,
1187
+ 0.152
1188
+ ],
1189
+ "angle": 0,
1190
+ "content": "Ruobing Xie, Zhiyuan Liu, Jia Jia, Huanbo Luan, and Maosong Sun. 2016. Representation learning of knowledge graphs with entity descriptions. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 30."
1191
+ },
1192
+ {
1193
+ "type": "text",
1194
+ "bbox": [
1195
+ 0.116,
1196
+ 0.162,
1197
+ 0.488,
1198
+ 0.228
1199
+ ],
1200
+ "angle": 0,
1201
+ "content": "Bishan Yang, Scott Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. 2015. Embedding entities and relations for learning and inference in knowledge bases. In Proceedings of the International Conference on Learning Representations (ICLR) 2015."
1202
+ },
1203
+ {
1204
+ "type": "text",
1205
+ "bbox": [
1206
+ 0.115,
1207
+ 0.238,
1208
+ 0.488,
1209
+ 0.303
1210
+ ],
1211
+ "angle": 0,
1212
+ "content": "Zhaocheng Zhu, Zuobai Zhang, Louis-Pascal Xhonneux, and Jian Tang. 2021. Neural bellman-ford networks: A general graph neural network framework for link prediction. Advances in Neural Information Processing Systems, 34."
1213
+ },
1214
+ {
1215
+ "type": "title",
1216
+ "bbox": [
1217
+ 0.115,
1218
+ 0.317,
1219
+ 0.238,
1220
+ 0.332
1221
+ ],
1222
+ "angle": 0,
1223
+ "content": "A Appendix"
1224
+ },
1225
+ {
1226
+ "type": "title",
1227
+ "bbox": [
1228
+ 0.115,
1229
+ 0.342,
1230
+ 0.406,
1231
+ 0.356
1232
+ ],
1233
+ "angle": 0,
1234
+ "content": "A.1 Distribution of Unseen Entities"
1235
+ },
1236
+ {
1237
+ "type": "text",
1238
+ "bbox": [
1239
+ 0.117,
1240
+ 0.362,
1241
+ 0.489,
1242
+ 0.683
1243
+ ],
1244
+ "angle": 0,
1245
+ "content": "Long-tail entities have a different distribution than entities from the whole KG; see Tab. 6 for an overview of the distribution shift for the top 10 entity types. This difference is natural. In particular, high-degree entities in a KG such as Wikidata often refer to types/taxons (e.g., human, organization, ...) as well as popular named entities (e.g., Albert Einstein, Germany, ...). These entities are fundamental to the KG and/or of high interest and have many facts associated with them. For this reason, they do not form suitable candidates for benchmarking unseen or new entities. In addition, removing high-degree entities for the purpose of evaluating SI-LP is likely to distort the KG (e.g., consider removing type \"human\" or \"Germany\"). In contrast, Wikidata5M-SI focuses on entities for which knowledge is not yet abundant: long-tail entities are accompanied by no or few facts (at least initially) and our SI-LP benchmark tests reasoning capabilities with this limited information."
1246
+ },
1247
+ {
1248
+ "type": "title",
1249
+ "bbox": [
1250
+ 0.51,
1251
+ 0.085,
1252
+ 0.83,
1253
+ 0.1
1254
+ ],
1255
+ "angle": 0,
1256
+ "content": "A.2 Integrating Text into KGE Models"
1257
+ },
1258
+ {
1259
+ "type": "text",
1260
+ "bbox": [
1261
+ 0.508,
1262
+ 0.106,
1263
+ 0.884,
1264
+ 0.313
1265
+ ],
1266
+ "angle": 0,
1267
+ "content": "To integrate text into traditional KGE models, we follow the baseline models of the WikiKG90M link prediction challenge (Hu et al., 2021). We embed mentions combined with descriptions using MPNet (Song et al., 2020), concatenate the resulting descriptions embedding with the entity embedding, and project it with a linear layer for the final representation of the entity. In combination with oDistMult-ERAvg (Albooyeh et al., 2020), we apply the aggregation of neighboring entities and relations on the entity embedding part only. The resulting aggregation is then concatenated with its description and finally projected."
1268
+ },
1269
+ {
1270
+ "type": "text",
1271
+ "bbox": [
1272
+ 0.509,
1273
+ 0.313,
1274
+ 0.882,
1275
+ 0.343
1276
+ ],
1277
+ "angle": 0,
1278
+ "content": "This approach is closely related to BLP (Daza et al., 2021). The main differences to BLP are:"
1279
+ },
1280
+ {
1281
+ "type": "text",
1282
+ "bbox": [
1283
+ 0.525,
1284
+ 0.349,
1285
+ 0.884,
1286
+ 0.365
1287
+ ],
1288
+ "angle": 0,
1289
+ "content": "1. Hu et al. (2021) use MPNet, BLP uses BERT."
1290
+ },
1291
+ {
1292
+ "type": "text",
1293
+ "bbox": [
1294
+ 0.524,
1295
+ 0.377,
1296
+ 0.882,
1297
+ 0.44
1298
+ ],
1299
+ "angle": 0,
1300
+ "content": "2. In combination with DistMult-ERAvg, we concatenate a learnable \"structural embedding\" to the CLS embedding of the language model, whereas BLP does not."
1301
+ },
1302
+ {
1303
+ "type": "list",
1304
+ "bbox": [
1305
+ 0.524,
1306
+ 0.349,
1307
+ 0.884,
1308
+ 0.44
1309
+ ],
1310
+ "angle": 0,
1311
+ "content": null
1312
+ },
1313
+ {
1314
+ "type": "title",
1315
+ "bbox": [
1316
+ 0.51,
1317
+ 0.452,
1318
+ 0.719,
1319
+ 0.467
1320
+ ],
1321
+ "angle": 0,
1322
+ "content": "A.3 Experimental Setup"
1323
+ },
1324
+ {
1325
+ "type": "text",
1326
+ "bbox": [
1327
+ 0.508,
1328
+ 0.472,
1329
+ 0.884,
1330
+ 0.68
1331
+ ],
1332
+ "angle": 0,
1333
+ "content": "For hyperparameter optimization for ComplEx (Trouillon et al., 2016), DistMult (Yang et al., 2015), and HittER (Chen et al., 2021), we used the multi-fidelity approach GraSH (Kochsiek et al., 2022) implemented in LibKGE (Broscheit et al., 2020) with 64 initial trials and trained for up to 64 epochs. For fold-in, we reused training hyperparameters and trained for a single epoch on the provided context. For text-based approaches, we used the hyperparameters and architectures proposed by the authors for the transductive split of Wikidata5M. We trained on up to 5 A6000-GPUs with 49GB of VRAM."
1334
+ },
1335
+ {
1336
+ "type": "page_number",
1337
+ "bbox": [
1338
+ 0.478,
1339
+ 0.928,
1340
+ 0.526,
1341
+ 0.941
1342
+ ],
1343
+ "angle": 0,
1344
+ "content": "10640"
1345
+ }
1346
+ ],
1347
+ [
1348
+ {
1349
+ "type": "table",
1350
+ "bbox": [
1351
+ 0.223,
1352
+ 0.084,
1353
+ 0.778,
1354
+ 0.279
1355
+ ],
1356
+ "angle": 0,
1357
+ "content": "<table><tr><td>WikidataID</td><td>Mention</td><td>All entities</td><td>Long-tail entities</td></tr><tr><td>Q5</td><td>human</td><td>39%</td><td>61%</td></tr><tr><td>Q11424</td><td>film</td><td>3%</td><td>8%</td></tr><tr><td>Q484170</td><td>commune of France</td><td>1%</td><td>7%</td></tr><tr><td>Q482994</td><td>album</td><td>3%</td><td>1%</td></tr><tr><td>Q16521</td><td>taxon</td><td>9%</td><td>1%</td></tr><tr><td>Q134556</td><td>single</td><td>1%</td><td>1%</td></tr><tr><td>Q747074</td><td>commune of Italy</td><td>0%</td><td>1%</td></tr><tr><td>Q2074737</td><td>municipality of Spain</td><td>0%</td><td>1%</td></tr><tr><td>Q571</td><td>book</td><td>1%</td><td>1%</td></tr><tr><td>Q7889</td><td>video game</td><td>1%</td><td>1%</td></tr></table>"
1358
+ },
1359
+ {
1360
+ "type": "table_caption",
1361
+ "bbox": [
1362
+ 0.113,
1363
+ 0.288,
1364
+ 0.884,
1365
+ 0.318
1366
+ ],
1367
+ "angle": 0,
1368
+ "content": "Table 6: Distribution of top 10 entity types over long-tail entities with degree between 11 and 20 compared to all entities."
1369
+ },
1370
+ {
1371
+ "type": "image",
1372
+ "bbox": [
1373
+ 0.263,
1374
+ 0.336,
1375
+ 0.737,
1376
+ 0.584
1377
+ ],
1378
+ "angle": 0,
1379
+ "content": null
1380
+ },
1381
+ {
1382
+ "type": "image_caption",
1383
+ "bbox": [
1384
+ 0.113,
1385
+ 0.603,
1386
+ 0.884,
1387
+ 0.631
1388
+ ],
1389
+ "angle": 0,
1390
+ "content": "Figure 1: Number of correct (rank=1) and incorrect predictions by KGT5+descriptions on annotated examples per annotation label."
1391
+ },
1392
+ {
1393
+ "type": "table",
1394
+ "bbox": [
1395
+ 0.124,
1396
+ 0.642,
1397
+ 0.875,
1398
+ 0.891
1399
+ ],
1400
+ "angle": 0,
1401
+ "content": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Trans.</td><td colspan=\"5\">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>Complex + Bias + Fold in (Jambor et al., 2021)</td><td>0.260</td><td>0.058</td><td>0.097</td><td>0.118</td><td>0.124</td><td>0.132</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.237</td><td>-</td><td>0.115</td><td>0.151</td><td>0.185</td><td>0.209</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.234</td><td>0.005</td><td>0.076</td><td>0.115</td><td>0.132</td><td>0.153</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.239</td><td>-</td><td>0.106</td><td>0.142</td><td>0.153</td><td>0.167</td></tr><tr><td>SimKGC (mentions only)</td><td>0.182</td><td>0.187</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.249</td><td>0.263</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.347</td><td>0.184</td><td>0.177</td><td>0.195</td><td>0.218</td><td>0.263</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.252</td><td>-</td><td>0.152</td><td>0.153</td><td>0.153</td><td>0.161</td></tr><tr><td>SimKGC + Descriptions (Wang et al., 2022)</td><td>0.311</td><td>0.349</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.332</td><td>0.430</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.400</td><td>0.379</td><td>0.382</td><td>0.373</td><td>0.378</td><td>0.393</td></tr></table>"
1402
+ },
1403
+ {
1404
+ "type": "table_caption",
1405
+ "bbox": [
1406
+ 0.119,
1407
+ 0.899,
1408
+ 0.877,
1409
+ 0.914
1410
+ ],
1411
+ "angle": 0,
1412
+ "content": "Table 7: Transductive and semi-inductive link prediction results in terms of H@1 on the dataset Wikidata5M-SI."
1413
+ },
1414
+ {
1415
+ "type": "page_number",
1416
+ "bbox": [
1417
+ 0.478,
1418
+ 0.928,
1419
+ 0.524,
1420
+ 0.941
1421
+ ],
1422
+ "angle": 0,
1423
+ "content": "10641"
1424
+ }
1425
+ ],
1426
+ [
1427
+ {
1428
+ "type": "table",
1429
+ "bbox": [
1430
+ 0.123,
1431
+ 0.153,
1432
+ 0.877,
1433
+ 0.4
1434
+ ],
1435
+ "angle": 0,
1436
+ "content": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Trans.</td><td colspan=\"5\">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.337</td><td>0.165</td><td>0.180</td><td>0.202</td><td>0.219</td><td>0.242</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.328</td><td>-</td><td>0.190</td><td>0.292</td><td>0.352</td><td>0.401</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.309</td><td>0.013</td><td>0.109</td><td>0.158</td><td>0.188</td><td>0.242</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.332</td><td>-</td><td>0.239</td><td>0.289</td><td>0.314</td><td>0.340</td></tr><tr><td>SimKGC (mentions only)</td><td>0.223</td><td>0.227</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.296</td><td>0.332</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.390</td><td>0.236</td><td>0.234</td><td>0.257</td><td>0.278</td><td>0.335</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.344</td><td>-</td><td>0.368</td><td>0.373</td><td>0.378</td><td>0.380</td></tr><tr><td>SimKGC (Wang et al., 2022)</td><td>0.367</td><td>0.421</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.385</td><td>0.490</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.432</td><td>0.441</td><td>0.443</td><td>0.443</td><td>0.447</td><td>0.463</td></tr></table>"
1437
+ },
1438
+ {
1439
+ "type": "table_caption",
1440
+ "bbox": [
1441
+ 0.12,
1442
+ 0.409,
1443
+ 0.877,
1444
+ 0.424
1445
+ ],
1446
+ "angle": 0,
1447
+ "content": "Table 8: Transductive and semi-inductive link prediction results in terms of H@3 on the dataset Wikidata5M-SI."
1448
+ },
1449
+ {
1450
+ "type": "table",
1451
+ "bbox": [
1452
+ 0.123,
1453
+ 0.573,
1454
+ 0.877,
1455
+ 0.821
1456
+ ],
1457
+ "angle": 0,
1458
+ "content": "<table><tr><td rowspan=\"2\">Model</td><td rowspan=\"2\">Trans.</td><td colspan=\"5\">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.387</td><td>0.231</td><td>0.245</td><td>0.282</td><td>0.309</td><td>0.336</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.389</td><td>-</td><td>0.270</td><td>0.409</td><td>0.493</td><td>0.564</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.376</td><td>0.050</td><td>0.157</td><td>0.226</td><td>0.270</td><td>0.359</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.411</td><td>-</td><td>0.320</td><td>0.392</td><td>0.440</td><td>0.478</td></tr><tr><td>SimKGC (mentions only)</td><td>0.266</td><td>0.283</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.344</td><td>0.398</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.423</td><td>0.293</td><td>0.295</td><td>0.310</td><td>0.336</td><td>0.400</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.425</td><td>-</td><td>0.465</td><td>0.472</td><td>0.484</td><td>0.491</td></tr><tr><td>SimKGC (Wang et al., 2022)</td><td>0.432</td><td>0.504</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.416</td><td>0.544</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.455</td><td>0.484</td><td>0.489</td><td>0.489</td><td>0.495</td><td>0.516</td></tr></table>"
1459
+ },
1460
+ {
1461
+ "type": "table_caption",
1462
+ "bbox": [
1463
+ 0.115,
1464
+ 0.83,
1465
+ 0.88,
1466
+ 0.844
1467
+ ],
1468
+ "angle": 0,
1469
+ "content": "Table 9: Transductive and semi-inductive link prediction results in terms of H@10 on the dataset Wikidata5M-SI."
1470
+ },
1471
+ {
1472
+ "type": "page_number",
1473
+ "bbox": [
1474
+ 0.478,
1475
+ 0.929,
1476
+ 0.526,
1477
+ 0.941
1478
+ ],
1479
+ "angle": 0,
1480
+ "content": "10642"
1481
+ }
1482
+ ],
1483
+ [
1484
+ {
1485
+ "type": "table",
1486
+ "bbox": [
1487
+ 0.197,
1488
+ 0.32,
1489
+ 0.798,
1490
+ 0.652
1491
+ ],
1492
+ "angle": 0,
1493
+ "content": "<table><tr><td>Model</td><td>Context selection</td><td>1</td><td>3</td><td>5</td></tr><tr><td rowspan=\"3\">ComplEx + fold-in</td><td>Most common</td><td>0.151</td><td>0.161</td><td>0.168</td></tr><tr><td>Least common</td><td>0.166</td><td>0.185</td><td>0.195</td></tr><tr><td>Random</td><td>0.164</td><td>0.187</td><td>0.196</td></tr><tr><td rowspan=\"3\">DistMult + ERAvg</td><td>Most common</td><td>0.171</td><td>0.246</td><td>0.295</td></tr><tr><td>Least common</td><td>0.217</td><td>0.299</td><td>0.323</td></tr><tr><td>Random</td><td>0.215</td><td>0.303</td><td>0.318</td></tr><tr><td rowspan=\"3\">oDistMult + ERAvg + Mentions</td><td>Most common</td><td>0.187</td><td>0.235</td><td>0.258</td></tr><tr><td>Least common</td><td>0.237</td><td>0.274</td><td>0.279</td></tr><tr><td>Random</td><td>0.232</td><td>0.265</td><td>0.272</td></tr><tr><td rowspan=\"3\">HittER</td><td>Most common</td><td>0.105</td><td>0.153</td><td>0.179</td></tr><tr><td>Least common</td><td>0.151</td><td>0.195</td><td>0.216</td></tr><tr><td>Random</td><td>0.136</td><td>0.190</td><td>0.206</td></tr><tr><td rowspan=\"3\">KGT5-context</td><td>Most common</td><td>0.217</td><td>0.236</td><td>0.259</td></tr><tr><td>Least common</td><td>0.253</td><td>0.273</td><td>0.290</td></tr><tr><td>Random</td><td>0.237</td><td>0.260</td><td>0.281</td></tr><tr><td rowspan=\"3\">KGT5-context + Desc.</td><td>Most common</td><td>0.420</td><td>0.416</td><td>0.420</td></tr><tr><td>Least common</td><td>0.423</td><td>0.424</td><td>0.430</td></tr><tr><td>Random</td><td>0.422</td><td>0.430</td><td>0.430</td></tr></table>"
1494
+ },
1495
+ {
1496
+ "type": "table_caption",
1497
+ "bbox": [
1498
+ 0.192,
1499
+ 0.661,
1500
+ 0.804,
1501
+ 0.676
1502
+ ],
1503
+ "angle": 0,
1504
+ "content": "Table 10: Influence of context selection. Semi-inductive test MRR. Best per model in bold."
1505
+ },
1506
+ {
1507
+ "type": "page_number",
1508
+ "bbox": [
1509
+ 0.478,
1510
+ 0.929,
1511
+ 0.525,
1512
+ 0.941
1513
+ ],
1514
+ "angle": 0,
1515
+ "content": "10643"
1516
+ }
1517
+ ]
1518
+ ]
2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/472ef1b2-669d-4b07-ae82-dafb730e88d4_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0bcc909175c997fdcf394be70be0f3d49a831844a93b248d07e56456a42ab5e
3
+ size 221562
2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/full.md ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs
2
+
3
+ Adrian Kochsiek
4
+
5
+ University of Mannheim
6
+
7
+ Germany
8
+
9
+ akochsiek@uni-mannheim.de
10
+
11
+ Rainer Gemulla
12
+
13
+ University of Mannheim
14
+
15
+ Germany
16
+
17
+ rgemulla@uni-mannheim.de
18
+
19
+ # Abstract
20
+
21
+ Semi-inductive link prediction (LP) in knowledge graphs (KG) is the task of predicting facts for new, previously unseen entities based on context information. Although new entities can be integrated by retraining the model from scratch in principle, such an approach is infeasible for large-scale KGs, where retraining is expensive and new entities may arise frequently. In this paper, we propose and describe a large-scale benchmark to evaluate semi-inductive LP models. The benchmark is based on and extends Wikidata5M: It provides transductive, k-shot, and 0-shot LP tasks, each varying the available information from (i) only KG structure, to (ii) including textual mentions, and (iii) detailed descriptions of the entities. We report on a small study of recent approaches and found that semi-inductive LP performance is far from transductive performance on long-tail entities throughout all experiments. The benchmark provides a test bed for further research into integrating context and textual information in semi-inductive LP models.
22
+
23
+ # 1 Introduction
24
+
25
+ A knowledge graph (KG) is a collection of facts describing relations between real-world entities. Facts are represented in the form of subject-relation-object triples such as (Dave Grohl, memberOf, Foo Fighters). In this paper, we consider link prediction (LP) tasks, i.e., the problem of inferring missing facts in the KG. LP can be transductive (TD; all entities known a priori), semi-inductive (SI; some entities known a priori), and inductive (no entities known a priori). We concentrate on semi-inductive and transductive LP.
26
+
27
+ SI-LP focuses on modeling entities that are unknown or unseen during LP, such as out-of-KG entities (not part or not yet part of the KG) or newly created entities, e.g., a new user, product, or event. Such previously unknown entities can be
28
+
29
+ handled by retraining in principle. For large-scale KGs, however, retraining is inherently expensive and new entities may arise frequently. Therefore, the goal of SI-LP is to avoid retraining and perform LP directly, i.e., to generalize beyond the entities seen during training.
30
+
31
+ To perform LP for unseen entities, context information about these entities is needed. The amount and form of context information varies widely and may take the form of facts and/or textual information, such as an entity mention and/or its description. For example, a new user in a social network may provide a name, basic facts such as gender or country of origin, and perhaps a textual self-description.
32
+
33
+ In this paper, we introduce the Wikidata5M-SI benchmark for SI-LP. Our benchmark is based on the popular Wikidata5M (Wang et al., 2021) benchmark and has four major design goals: (G1) It ensures that unseen entities are long tail entities since popular entities (such as, say, Foo Fighters) and/or types and taxons (such as human and organization) are unlikely to be unseen. (G2) It allows to evaluate each model with varying amounts of contextual facts (0-shot, few-shot, transductive), i.e., to explore individual models across a range of tasks. (G3) It provides a controlled amount of textual information (none, mention, full description), where each setting demands different modeling capabilities. Finally, (G4) the benchmark is large-scale so that retraining is not a suitable approach. All prior SI-LP benchmarks violate at least one of these criteria.
34
+
35
+ We report on a small experimental study with recent LP approaches. In general, we found that
36
+
37
+ 1. SI performance was far behind TD performance in all experiments for long-tail entities,
38
+ 2. there was generally a trade-off between TD and SI performance,
39
+ 3. textual information was highly valuable,
40
+
41
+ 4. proper integration of context and textual information needs further exploration, and
42
+ 5. facts involving less common relations provided more useful context.
43
+
44
+ Our benchmark provides directions and a test bed for further research into SI-LP.
45
+
46
+ # 2 Related Work
47
+
48
+ Multiple SI-LP datasets have been proposed in the literature. The benchmarks of Daza et al. (2021), Albooyeh et al. (2020), and Galkin et al. (2021) are obtained by first merging the splits of smaller transductive LP datasets and subsequently sampling unseen entities uniformly to construct validation and test splits. These benchmarks do not satisfy goals G1-G4. Shi and Weninger (2018) follow a similar approach but focus on only 0-shot evaluation based on textual features. Xie et al. (2016) and Shah et al. (2019) select entities from Freebase with connection to entities in FB15k (Bordes et al., 2013), also focussing on 0-shot evaluation using rich textual descriptions. These approaches do not satisfy G2 and G3. Finally, Wang et al. (2019) and Hamaguchi et al. (2017) uniformly sample test triples and mark occurring entities as unseen. These approaches do not focus on long-tail entities (and, in fact, the accumulated context of unseen entities may be larger than the training graph itself) and they do not satisfy G1-G3.
49
+
50
+ There are also several of fully-inductive LP benchmarks (Teru et al., 2020; Wang et al., 2021) involving KGs. While SI-LP aims to connect unseen entities to an existing KG, fully-inductive LP reasons about a new KG with completely separate entities (but shared relations). We do not consider this task in this work.
51
+
52
+ # 3 The Wikidata5M-SI Benchmark
53
+
54
+ Wikidata5M-SI is based on the popular Wikidata5M (Wang et al., 2021) benchmark, which is induced by the 5M most common entities of Wikidata. Our benchmark contains transductive and semi-inductive valid/test splits; see Tab. 1 for an overview. Generally, we aimed to keep Wikidata5M-SI as close as possible to Wikidata5M. We did need to modify the original transductive valid and test splits, however, because they unintentionally contained both seen and unseen entities (i.e., these splits were not fully transductive). We
55
+
56
+ <table><tr><td rowspan="2"></td><td rowspan="2">Train</td><td colspan="2">Transductive</td><td colspan="2">Semi-inductive</td></tr><tr><td>Valid</td><td>Test</td><td>Valid</td><td>Test</td></tr><tr><td>Triples</td><td>20,600,187</td><td>4,983</td><td>4,977</td><td>5,500</td><td>5,500</td></tr><tr><td>Entities</td><td>4,593,103</td><td>7,768</td><td>7,760</td><td>3,722</td><td>3,793</td></tr><tr><td>Entities unseen</td><td>-</td><td>0</td><td>0</td><td>500</td><td>500</td></tr><tr><td>Relations</td><td>822</td><td>217</td><td>211</td><td>126</td><td>115</td></tr></table>
57
+
58
+ Table 1: Statistics of the Wikidata5M-SI splits.
59
+
60
+ did that by simply removing all triples involving unseen entities.
61
+
62
+ Unseen entities. To ensure that unseen entities in the semi-inductive splits are from the long tail (G1), we only considered entities of degree 20 or less. To be able to provide sufficient context for few-shot tasks (G2), we further did not consider entities of degree 10 or less. In more detail, we sampled 500 entities of degrees 11-20 (stratified sampling grouped by degree) for each semi-inductive split. All sampled entities, along with their facts, were removed from the train split. Note that these entities (naturally) have a different class distribution than all entities; see Sec. A.1 for details.
63
+
64
+ Tasks and metrics. For TD tasks, we follow the standard protocol of Wikidata5M. To construct SI tasks, we include 11 of the original facts of each unseen entity into its SI split; each split thus contains 5,500 triples. This enables up to 10-shot SI tasks (1 fact to test, up to 10 facts for context). For entities of degree larger than 11, we select the 11 facts with the most frequent relations; see Tab. 2 for an example. The rationale is that more common relations (such as instanceof or country) may be considered more likely to be provided for unseen entities than rare ones (such as militaryBranch or publisher). We then construct a single $k$ -shot task for each triple $(s,p,o)$ in the SI split as follows. When, say, $s$ is the unseen entity, we consider the LP task $(s,p,?)$ and provide $k$ additional facts of form $(s,p',o')$ as context. Context facts are selected by frequency as above, but we also explored random and infrequent-relation context in our study. Models are asked to provide a ranking of predicted answers, and we determine the filtered mean reciprocal rank (MRR) and Hits@K of the correct answer $(o)$ .
65
+
66
+ Textual information. For each entity, we provide its principal mention and a detailed description (both directly from Wikidata5M); see Tab. 2. This allows to differentiate model evaluation with varying amounts of textual information per entity (G3): (A) atomic, i.e., no textual information, (M) men
67
+
68
+ <table><tr><td>ID</td><td>Q18918</td><td></td></tr><tr><td>Mention</td><td>Sam Witwer</td><td></td></tr><tr><td>Description</td><td colspan="2">Samuel Stewart Witwer (born October 20, 1977) is an American actor and mu-sician. He is known for portraying Crashdown in Battlestar Galactica, Davis Bloome in Smallville, Aidan Waite in Being Human, and Ben Lockwood in Supergirl. He voiced the protagonist Galen Marek / Starkiller in Star Wars: The Force Unleashed, the Son in Star Wars: The Clone Wars and Emperor Palpatine in Star Wars Rebels, both of which he has also voiced Darth Maul.</td></tr><tr><td rowspan="11">Context triples</td><td>instance of | human</td><td>M: ○ D: ○</td></tr><tr><td>country of citizenship | United States of America</td><td>M: × D: ○</td></tr><tr><td>occupation | musician</td><td>M: × D: ✓</td></tr><tr><td>occupation | actor</td><td>M: × D: ✓</td></tr><tr><td>place of birth | Glenview</td><td>M: × D: ×</td></tr><tr><td>given name | Samuel</td><td>M: ○ D: ✓</td></tr><tr><td>given name | Sam</td><td>M: ✓ D: ○</td></tr><tr><td>cast member | Battlestar Galactica</td><td>M: × D: ✓</td></tr><tr><td>cast member | Being Human - supernatural drama television series</td><td>M: × D: ✓</td></tr><tr><td>cast member | Star Wars: The Force Unleashed II</td><td>M: × D: ○</td></tr><tr><td>cast member | The Mist</td><td>M: × D: ×</td></tr></table>
69
+
70
+ Table 2: Example of an entity from the semi-inductive validation set of Wikidata5M-SI. For each triple, we annotated whether the answer is contained in (✓), deducible from (○), or not contained in (×) mention (M) or description (D).
71
+
72
+ tions only, and (D) detailed textual descriptions as in (Kochsiek et al., 2023). This differentiation is especially important in the SI setting, as detailed text descriptions might not be provided for unseen entities and each setting demands different modeling capabilities. In fact, (A) performs reasoning only using graph structure, whereas (D) also benefits from information extraction to some extent. We discuss this further in Sec. 5.
73
+
74
+ # 4 Semi-Inductive Link Prediction Models
75
+
76
+ We briefly summarize recent models for SI-LP; we considered these models in our experimental study.
77
+
78
+ Graph-only models. ComplEx (Trouillon et al., 2016) is the best-performing transductive KGE model on Wikidata5M (Kochsiek et al., 2022). To use ComplEx for SI-LP, we follow an approach explored by Jambor et al. (2021). In particular, we represent each entity as the sum of a local embedding (one per entity) and a global bias embedding. For 0-shot, we solely use the global bias for the unseen entity. For k-shot, we obtain the local embedding for the unseen entity by performing a single training step on the context triples (keeping all other embeddings fixed). An alternative
79
+
80
+ approach is taken by oDistMult-ERAvg (Albooyeh et al., 2020), which represents unseen entities by aggregating the embeddings of the relations and entities in the context. A more direct approach is taken by HittER (Chen et al., 2021), which contextualizes the query entity with its neighborhood for TD-LP. The approach can be used for SI-LP directly by using a masking token (akin to the global bias above) for an unseen entity. We originally planned to consider NodePiece (Galkin et al., 2021) (entity represented by a combination of anchor embeddings) and NBFNet (Zhu et al., 2021) (a GNN-based LP model); both support SI-LP directly. However, the available implementations did not scale to Wikidata5M-SI (out of memory).
81
+
82
+ Text-based models. As a baseline approach to integrate textual information directly into KGE models, we consider the approach explored in the
83
+
84
+ WikiKG90M benchmark (Hu et al., 2021); see Sec. A.2 for details. The remaining approaches are purely textual. SimKGC (Wang et al., 2022) utilizes two pretrained BERT Transformers: one to embed query entities (and relations) based on their mention or description, and one for tail entities. Using a contrastive learning approach, it measures cosine similarity between both representations for ranking. KGT5 (Saxena et al., 2022) is a sequence-to-sequence link prediction approach, which is trained to generate the mention of the answer entity using the mention or description of the query entity and relation as input. Both approaches support 0-shot SI-LP when textual information is provided for the query entity. They do not utilize additional context, however, i.e., do not support k-shot SI-LP. KGT5-context (Kochsiek et al., 2023) is an extension of KGT5, which extends the input of KGT5 by the one-hop neighborhood of the query entity and consequently supports k-shot LP directly.
85
+
86
+ # 5 Experimental Study
87
+
88
+ We evaluated all presented baseline models in the TD and SI setting on the atomic, mentions, and descriptions dataset. Further, we evaluated in detail which context was most useful and what information was conveyed by textual mentions and descriptions.
89
+
90
+ Setup. Source code, configuration, and the benchmark itself are available at https://github. com/uma-pi1.wikidata5m-si. For further details on hyperparameter tuning and training see Sec. A.3.
91
+
92
+ Main results. Transductive and SI performance in terms of MRR of all models is presented in Tab. 3; Hits@K in Tab. 7-9 (Sec. A). Note that overall transductive performance was oftentimes below best reported SI performance. This is due to varying degrees of query entities between both settings. Typically, models perform better predicting new relations for an entity (e.g., the birthplace) than predicting additional objects for a known relation (e.g., additional awards won by a person) (Saxena et al., 2022; Kochsiek et al., 2023). For a direct comparison between both settings, we additionally report TD performance on long tail query entities. $^{3}$
93
+
94
+ Atomic. TD performance on the long tail was considerably higher than SI performance. As no in
95
+
96
+ formation was provided for unseen entities, 0-shot was not reasonably possible. Without text-based information, context was a necessity. A simple neighborhood aggregation—entity-relation average (ERAvg)—offered the best integration of context.
97
+
98
+ Mentions. Integrating mentions did not improve performance on its own, as provided text information was still limited. However, additionally providing context information during inference (KGT5-context) simplified the learning problem and improved TD performance significantly. But for 0-shot, the limited text information provided with mentions allowed for reasonable performance. To analyze what information is conveyed for 0-shot, we annotated 100 valid triples; see Tab. 4. In $10\%$ of cases, the answer was already contained in the mention, and it was deducible in at least $7\%$ . This enabled basic reasoning without any further information. In contrast to the TD setting, KGT5 outperformed its context extension. KGT5-context was reliant on context which was lacking especially during 0-shot. This showed a trade-off between best performance in the SI and TD setting. This trade-off could be mitigated by applying (full and partial) context hiding. With such adapted training, KGT5-context reached a middle ground with a transductive MRR of 0.366 and 0-shot MRR of 0.283.4 However, even with full context (10-shot), performance was still only on par with KGT5. Therefore, context information did not bring any further benefits when text was provided.
99
+
100
+ Descriptions. Further, integrating descriptions improved performance for both settings, TD and SI, considerably; see Tab. 3. Similar to the mentions-only setting, KGT5-context performed best in TD and KGT5 in the SI setting. Applying the same trade-off with context-hiding reached a middle ground with 0.418 TD-MRR and 0.449 SI-MRR.
101
+
102
+ Descriptions were very detailed and partially contained the correct answer as well as the same information as contained in context triples; see Tab. 4. Therefore, performance did not further improve with context size. In such cases, models mainly benefit from information extraction capabilities. To judge how much information extraction helps, we grouped performance of KGT5+description in the 0-shot setting on validation data into the groups contained, deducible and not contained in descrip
103
+
104
+ <table><tr><td rowspan="2">Model</td><td colspan="2">Transductive</td><td colspan="5">Semi-inductive (num. shots)</td><td rowspan="2">Pre-trained</td></tr><tr><td>All</td><td>Long tail</td><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.308</td><td>0.523</td><td>0.124</td><td>0.151</td><td>0.176</td><td>0.190</td><td>0.206</td><td>no</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.294</td><td>0.512</td><td>-</td><td>0.171</td><td>0.246</td><td>0.295</td><td>0.333</td><td>no</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.284</td><td>0.512</td><td>0.019</td><td>0.105</td><td>0.153</td><td>0.179</td><td>0.221</td><td>no</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.299</td><td>0.535</td><td>-</td><td>0.187</td><td>0.235</td><td>0.258</td><td>0.280</td><td>yes</td></tr><tr><td>SimKGC (mentions only)</td><td>0.212</td><td>0.361</td><td>0.220</td><td>-</td><td>-</td><td>-</td><td>-</td><td>yes</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.281</td><td>0.542</td><td>0.310</td><td>-</td><td>-</td><td>-</td><td>-</td><td>no</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.374</td><td>0.678</td><td>0.220</td><td>0.217</td><td>0.236</td><td>0.259</td><td>0.311</td><td>no</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.313</td><td>0.585</td><td>-</td><td>0.278</td><td>0.281</td><td>0.285</td><td>0.292</td><td>yes</td></tr><tr><td>SimKGC + Descriptions (Wang et al., 2022)</td><td>0.353</td><td>0.663</td><td>0.403</td><td>-</td><td>-</td><td>-</td><td>-</td><td>yes</td></tr><tr><td>KGT5 + Descriptions (Kochsiek et al., 2023)</td><td>0.364</td><td>0.728</td><td>0.470</td><td>-</td><td>-</td><td>-</td><td>-</td><td>no</td></tr><tr><td>KGT5-context + Descriptions (Kochsiek et al., 2023)</td><td>0.420</td><td>0.777</td><td>0.417</td><td>0.420</td><td>0.416</td><td>0.420</td><td>0.437</td><td>no</td></tr></table>
105
+
106
+ Table 3: Transductive and semi-inductive link prediction results in terms of MRR on the dataset Wikidata5M-SI. The first group presets results on the atomic, the second on the mentions and the third on the descriptions dataset. Best per TD/SI in bold. Best per group underlined.
107
+
108
+ <table><tr><td></td><td>Mention</td><td>Description</td></tr><tr><td>Contained</td><td>10%</td><td>44%</td></tr><tr><td>Deductible</td><td>7%</td><td>10%</td></tr><tr><td>Not contained</td><td>83%</td><td>46%</td></tr></table>
109
+
110
+ Table 4: Information about a query answer contained in mentions and descriptions. Annotated for 100 sampled triples from 0-shot valid. For an example, see Tab. 2.
111
+
112
+ <table><tr><td>Context selection</td><td>1</td><td>3</td><td>5</td></tr><tr><td>Most common</td><td>0.217</td><td>0.236</td><td>0.259</td></tr><tr><td>Least common</td><td>0.253</td><td>0.273</td><td>0.290</td></tr><tr><td>Random</td><td>0.237</td><td>0.260</td><td>0.281</td></tr></table>
113
+
114
+ Table 5: Influence of context selection. Semi-inductive test MRR of KGT5-context.
115
+
116
+ tion; see Fig. 1 in Sec. A. When contained, the correct answer was extracted in $\approx 70\%$ of cases.
117
+
118
+ Context selection. We selected the most common relations as context triples so far, as this may be a more realistic setting. To investigate the effect of this selection approach, we compared the default selection of choosing most common relations to least common and random. Results for KGT5-context are shown in Tab. 5; for all other models in Tab. 10 in Sec. A. We found that the less common the relations of the provided context, the better the SI performance. More common context relations often described high-level concepts, while less common provided further detail; see the example in Tab. 2. While more common context may be more readily available, less common context was more helpful to describe a new entity.
119
+
120
+ # 6 Conclusion
121
+
122
+ We proposed the new WikiData5M-SI large-scale benchmark for semi-supervised link prediction. The benchmark focuses on unseen entities from the long tail and allows to evaluate models with varying and controlled amounts of factual and textual context information. In our experimental evaluation, we found that semi-inductive LP performance fell behind transductive performance for long-tail entities in general, and that detailed textual information was often more valuable than factual context information. Moreover, current models did not integrate these two types of information adequately, suggesting a direction for future research.
123
+
124
+ # Limitations
125
+
126
+ This study was performed on Wikidata5M-SI, i.e., a subset of a single knowledge graph. Model performance and insights may vary if graph structure and/or availability and usefulness of mentions and description is different. In particular, the entity descriptions provided with Wikidata5M-SI partly contained information relevant for link prediction so that models benefited from information extraction capabilities.
127
+
128
+ # Ethics Statement
129
+
130
+ This research adapts publicly available data, benchmarks, and codebases for evaluation. We believe that this research was conducted in an ethical manner in compliance with all relevant laws and regulations.
131
+
132
+ # References
133
+
134
+ Marjan Albooyeh, Rishab Goel, and Seyed Mehran Kazemi. 2020. Out-of-sample representation learning for knowledge graphs. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 2657-2666.
135
+ Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. 2013. Translating embeddings for modeling multi-relational data. In Neural Information Processing Systems (NIPS), pages 1-9.
136
+ Samuel Broscheit, Daniel Ruffinelli, Adrian Kochsiek, Patrick Betz, and Rainer Gemulla. 2020. LibKGE - A knowledge graph embedding library for reproducible research. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 165-174.
137
+ Sanxing Chen, Xiaodong Liu, Jianfeng Gao, Jian Jiao, Ruofei Zhang, and Yangfeng Ji. 2021. Hitter: Hierarchical transformers for knowledge graph embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10395-10407.
138
+ Daniel Daza, Michael Cochez, and Paul Groth. 2021. Inductive entity representations from text via link prediction. In Proceedings of the Web Conference 2021, pages 798-808.
139
+ Mikhail Galkin, Etienne Denis, Jiapeng Wu, and William L Hamilton. 2021. Nodepiece: Compositional and parameter-efficient representations of large knowledge graphs. In International Conference on Learning Representations.
140
+ Takuo Hamaguchi, Hidekazu Oiwa, Masashi Shimbo, and Yuji Matsumoto. 2017. Knowledge transfer for out-of-knowledge-base entities: a graph neural network approach. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pages 1802-1808.
141
+ Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. 2021. Ogb-lsc: A large-scale challenge for machine learning on graphs. Advances in Neural Information Processing Systems, 35.
142
+ Dora Jambor, Komal Teru, Joelle Pineau, and William L Hamilton. 2021. Exploring the limits of few-shot link prediction in knowledge graphs. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2816-2822.
143
+ Adrian Kochsiek, Fritz Niesel, and Rainer Gemulla. 2022. Start small, think big: On hyperparameter optimization for large-scale knowledge graph embeddings. In Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2022, Grenoble, France, September
144
+
145
+ 19-23, 2022, Proceedings, Part II, pages 138-154. Springer.
146
+ Adrian Kochsiek, Apoorv Saxena, Inderjeet Nair, and Rainer Gemulla. 2023. Friendly neighbors: Contextualized sequence-to-sequence link prediction. In Proceedings of the 8th Workshop on Representation Learning for NLP.
147
+ Apoory Saxena, Adrian Kochsiek, and Rainer Gemulla. 2022. Sequence-to-sequence knowledge graph completion and question answering. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2814-2828.
148
+ Haseeb Shah, Johannes Villmow, Adrian Ulges, Ulrich Schwanecke, and Faisal Shafait. 2019. An open-world extension to knowledge graph completion models. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 3044-3051.
149
+ Baoxu Shi and Tim Weninger. 2018. Open-world knowledge graph completion. In Proceedings of the AAAI conference on artificial intelligence, volume 32.
150
+ Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and TieYan Liu. 2020. Mpnet: Masked and permuted pretraining for language understanding. Advances in Neural Information Processing Systems, 33:16857-16867.
151
+ Komal Teru, Etienne Denis, and Will Hamilton. 2020. Inductive relation prediction by subgraph reasoning. In International Conference on Machine Learning, pages 9448-9457.
152
+ Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. 2016. Complex embeddings for simple link prediction. In International conference on machine learning, pages 2071-2080.
153
+ Liang Wang, Wei Zhao, Zhuoyu Wei, and Jingming Liu. 2022. Simkgc: Simple contrastive knowledge graph completion with pre-trained language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4281-4294.
154
+ Peifeng Wang, Jialong Han, Chenliang Li, and Rong Pan. 2019. Logic attention based neighborhood aggregation for inductive knowledge graph embedding. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7152-7159.
155
+ Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhengyan Zhang, Zhiyuan Liu, Juanzi Li, and Jian Tang. 2021. Kepler: A unified model for knowledge embedding and pre-trained language representation. Transactions of the Association for Computational Linguistics, 9:176-194.
156
+
157
+ Ruobing Xie, Zhiyuan Liu, Jia Jia, Huanbo Luan, and Maosong Sun. 2016. Representation learning of knowledge graphs with entity descriptions. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 30.
158
+
159
+ Bishan Yang, Scott Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. 2015. Embedding entities and relations for learning and inference in knowledge bases. In Proceedings of the International Conference on Learning Representations (ICLR) 2015.
160
+
161
+ Zhaocheng Zhu, Zuobai Zhang, Louis-Pascal Xhonneux, and Jian Tang. 2021. Neural bellman-ford networks: A general graph neural network framework for link prediction. Advances in Neural Information Processing Systems, 34.
162
+
163
+ # A Appendix
164
+
165
+ # A.1 Distribution of Unseen Entities
166
+
167
+ Long-tail entities have a different distribution than entities from the whole KG; see Tab. 6 for an overview of the distribution shift for the top 10 entity types. This difference is natural. In particular, high-degree entities in a KG such as Wikidata often refer to types/taxons (e.g., human, organization, ...) as well as popular named entities (e.g., Albert Einstein, Germany, ...). These entities are fundamental to the KG and/or of high interest and have many facts associated with them. For this reason, they do not form suitable candidates for benchmarking unseen or new entities. In addition, removing high-degree entities for the purpose of evaluating SI-LP is likely to distort the KG (e.g., consider removing type "human" or "Germany"). In contrast, Wikidata5M-SI focuses on entities for which knowledge is not yet abundant: long-tail entities are accompanied by no or few facts (at least initially) and our SI-LP benchmark tests reasoning capabilities with this limited information.
168
+
169
+ # A.2 Integrating Text into KGE Models
170
+
171
+ To integrate text into traditional KGE models, we follow the baseline models of the WikiKG90M link prediction challenge (Hu et al., 2021). We embed mentions combined with descriptions using MPNet (Song et al., 2020), concatenate the resulting descriptions embedding with the entity embedding, and project it with a linear layer for the final representation of the entity. In combination with oDistMult-ERAvg (Albooyeh et al., 2020), we apply the aggregation of neighboring entities and relations on the entity embedding part only. The resulting aggregation is then concatenated with its description and finally projected.
172
+
173
+ This approach is closely related to BLP (Daza et al., 2021). The main differences to BLP are:
174
+
175
+ 1. Hu et al. (2021) use MPNet, BLP uses BERT.
176
+ 2. In combination with DistMult-ERAvg, we concatenate a learnable "structural embedding" to the CLS embedding of the language model, whereas BLP does not.
177
+
178
+ # A.3 Experimental Setup
179
+
180
+ For hyperparameter optimization for ComplEx (Trouillon et al., 2016), DistMult (Yang et al., 2015), and HittER (Chen et al., 2021), we used the multi-fidelity approach GraSH (Kochsiek et al., 2022) implemented in LibKGE (Broscheit et al., 2020) with 64 initial trials and trained for up to 64 epochs. For fold-in, we reused training hyperparameters and trained for a single epoch on the provided context. For text-based approaches, we used the hyperparameters and architectures proposed by the authors for the transductive split of Wikidata5M. We trained on up to 5 A6000-GPUs with 49GB of VRAM.
181
+
182
+ <table><tr><td>WikidataID</td><td>Mention</td><td>All entities</td><td>Long-tail entities</td></tr><tr><td>Q5</td><td>human</td><td>39%</td><td>61%</td></tr><tr><td>Q11424</td><td>film</td><td>3%</td><td>8%</td></tr><tr><td>Q484170</td><td>commune of France</td><td>1%</td><td>7%</td></tr><tr><td>Q482994</td><td>album</td><td>3%</td><td>1%</td></tr><tr><td>Q16521</td><td>taxon</td><td>9%</td><td>1%</td></tr><tr><td>Q134556</td><td>single</td><td>1%</td><td>1%</td></tr><tr><td>Q747074</td><td>commune of Italy</td><td>0%</td><td>1%</td></tr><tr><td>Q2074737</td><td>municipality of Spain</td><td>0%</td><td>1%</td></tr><tr><td>Q571</td><td>book</td><td>1%</td><td>1%</td></tr><tr><td>Q7889</td><td>video game</td><td>1%</td><td>1%</td></tr></table>
183
+
184
+ ![](images/baae9bbd293af72cab83695b604ca04663ba5fd908d5419b7ced6cda5d4535df.jpg)
185
+ Figure 1: Number of correct (rank=1) and incorrect predictions by KGT5+descriptions on annotated examples per annotation label.
186
+
187
+ Table 6: Distribution of top 10 entity types over long-tail entities with degree between 11 and 20 compared to all entities.
188
+
189
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Trans.</td><td colspan="5">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>Complex + Bias + Fold in (Jambor et al., 2021)</td><td>0.260</td><td>0.058</td><td>0.097</td><td>0.118</td><td>0.124</td><td>0.132</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.237</td><td>-</td><td>0.115</td><td>0.151</td><td>0.185</td><td>0.209</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.234</td><td>0.005</td><td>0.076</td><td>0.115</td><td>0.132</td><td>0.153</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.239</td><td>-</td><td>0.106</td><td>0.142</td><td>0.153</td><td>0.167</td></tr><tr><td>SimKGC (mentions only)</td><td>0.182</td><td>0.187</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.249</td><td>0.263</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.347</td><td>0.184</td><td>0.177</td><td>0.195</td><td>0.218</td><td>0.263</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.252</td><td>-</td><td>0.152</td><td>0.153</td><td>0.153</td><td>0.161</td></tr><tr><td>SimKGC + Descriptions (Wang et al., 2022)</td><td>0.311</td><td>0.349</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.332</td><td>0.430</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.400</td><td>0.379</td><td>0.382</td><td>0.373</td><td>0.378</td><td>0.393</td></tr></table>
190
+
191
+ Table 7: Transductive and semi-inductive link prediction results in terms of H@1 on the dataset Wikidata5M-SI.
192
+
193
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Trans.</td><td colspan="5">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.337</td><td>0.165</td><td>0.180</td><td>0.202</td><td>0.219</td><td>0.242</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.328</td><td>-</td><td>0.190</td><td>0.292</td><td>0.352</td><td>0.401</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.309</td><td>0.013</td><td>0.109</td><td>0.158</td><td>0.188</td><td>0.242</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.332</td><td>-</td><td>0.239</td><td>0.289</td><td>0.314</td><td>0.340</td></tr><tr><td>SimKGC (mentions only)</td><td>0.223</td><td>0.227</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.296</td><td>0.332</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.390</td><td>0.236</td><td>0.234</td><td>0.257</td><td>0.278</td><td>0.335</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.344</td><td>-</td><td>0.368</td><td>0.373</td><td>0.378</td><td>0.380</td></tr><tr><td>SimKGC (Wang et al., 2022)</td><td>0.367</td><td>0.421</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.385</td><td>0.490</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.432</td><td>0.441</td><td>0.443</td><td>0.443</td><td>0.447</td><td>0.463</td></tr></table>
194
+
195
+ Table 8: Transductive and semi-inductive link prediction results in terms of H@3 on the dataset Wikidata5M-SI.
196
+
197
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Trans.</td><td colspan="5">Semi-inductive (num. shots)</td></tr><tr><td>0</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>ComplEx + Bias + Fold in (Jambor et al., 2021)</td><td>0.387</td><td>0.231</td><td>0.245</td><td>0.282</td><td>0.309</td><td>0.336</td></tr><tr><td>DistMult + ERAvg (Albooyeh et al., 2020)</td><td>0.389</td><td>-</td><td>0.270</td><td>0.409</td><td>0.493</td><td>0.564</td></tr><tr><td>HittER (Chen et al., 2021)</td><td>0.376</td><td>0.050</td><td>0.157</td><td>0.226</td><td>0.270</td><td>0.359</td></tr><tr><td>DistMult + ERAvg + Mentions</td><td>0.411</td><td>-</td><td>0.320</td><td>0.392</td><td>0.440</td><td>0.478</td></tr><tr><td>SimKGC (mentions only)</td><td>0.266</td><td>0.283</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 (Saxena et al., 2022)</td><td>0.344</td><td>0.398</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context (Kochsiek et al., 2023)</td><td>0.423</td><td>0.293</td><td>0.295</td><td>0.310</td><td>0.336</td><td>0.400</td></tr><tr><td>DistMult + ERAvg + Descriptions</td><td>0.425</td><td>-</td><td>0.465</td><td>0.472</td><td>0.484</td><td>0.491</td></tr><tr><td>SimKGC (Wang et al., 2022)</td><td>0.432</td><td>0.504</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5 + Descriptions</td><td>0.416</td><td>0.544</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>KGT5-context + Descriptions</td><td>0.455</td><td>0.484</td><td>0.489</td><td>0.489</td><td>0.495</td><td>0.516</td></tr></table>
198
+
199
+ Table 9: Transductive and semi-inductive link prediction results in terms of H@10 on the dataset Wikidata5M-SI.
200
+
201
+ <table><tr><td>Model</td><td>Context selection</td><td>1</td><td>3</td><td>5</td></tr><tr><td rowspan="3">ComplEx + fold-in</td><td>Most common</td><td>0.151</td><td>0.161</td><td>0.168</td></tr><tr><td>Least common</td><td>0.166</td><td>0.185</td><td>0.195</td></tr><tr><td>Random</td><td>0.164</td><td>0.187</td><td>0.196</td></tr><tr><td rowspan="3">DistMult + ERAvg</td><td>Most common</td><td>0.171</td><td>0.246</td><td>0.295</td></tr><tr><td>Least common</td><td>0.217</td><td>0.299</td><td>0.323</td></tr><tr><td>Random</td><td>0.215</td><td>0.303</td><td>0.318</td></tr><tr><td rowspan="3">oDistMult + ERAvg + Mentions</td><td>Most common</td><td>0.187</td><td>0.235</td><td>0.258</td></tr><tr><td>Least common</td><td>0.237</td><td>0.274</td><td>0.279</td></tr><tr><td>Random</td><td>0.232</td><td>0.265</td><td>0.272</td></tr><tr><td rowspan="3">HittER</td><td>Most common</td><td>0.105</td><td>0.153</td><td>0.179</td></tr><tr><td>Least common</td><td>0.151</td><td>0.195</td><td>0.216</td></tr><tr><td>Random</td><td>0.136</td><td>0.190</td><td>0.206</td></tr><tr><td rowspan="3">KGT5-context</td><td>Most common</td><td>0.217</td><td>0.236</td><td>0.259</td></tr><tr><td>Least common</td><td>0.253</td><td>0.273</td><td>0.290</td></tr><tr><td>Random</td><td>0.237</td><td>0.260</td><td>0.281</td></tr><tr><td rowspan="3">KGT5-context + Desc.</td><td>Most common</td><td>0.420</td><td>0.416</td><td>0.420</td></tr><tr><td>Least common</td><td>0.423</td><td>0.424</td><td>0.430</td></tr><tr><td>Random</td><td>0.422</td><td>0.430</td><td>0.430</td></tr></table>
202
+
203
+ Table 10: Influence of context selection. Semi-inductive test MRR. Best per model in bold.
2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0e05a8644c0e03d830ae07a4cbb0b21e9777720a30ee2964c58cde9310fbe98
3
+ size 716640
2023/A Benchmark for Semi-Inductive Link Prediction in Knowledge Graphs/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/21af0af7-6fd8-4600-8ad6-54b767b85a85_content_list.json ADDED
@@ -0,0 +1,1527 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "A Black-Box Attack on Code Models via Representation Nearest Neighbor Search",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 114,
8
+ 83,
9
+ 884,
10
+ 122
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Jie Zhang $^{1*}$ , Wei Ma $^{2\\dagger}$ , Qiang Hu $^{3}$ , Shangqing Liu $^{2}$ , Xiaofei Xie $^{4}$ , Yves Le Traon $^{3}$ , and Yang Liu $^{2}$",
17
+ "bbox": [
18
+ 109,
19
+ 131,
20
+ 892,
21
+ 151
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "<sup>1</sup>Noah's Ark Lab, Huawei",
28
+ "bbox": [
29
+ 393,
30
+ 162,
31
+ 608,
32
+ 178
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "$^{2}$ School of Computer Science and Engineering, Nanyang Technological University",
39
+ "bbox": [
40
+ 161,
41
+ 179,
42
+ 836,
43
+ 196
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "<sup>3</sup>The Interdisciplinary Centre for Security, Reliability and Trust, University of Luxembourg",
50
+ "bbox": [
51
+ 131,
52
+ 196,
53
+ 870,
54
+ 212
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "$^{4}$ School of Computing and Information Systems, Singapore Management University",
61
+ "bbox": [
62
+ 157,
63
+ 212,
64
+ 842,
65
+ 230
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "Abstract",
72
+ "text_level": 1,
73
+ "bbox": [
74
+ 260,
75
+ 252,
76
+ 342,
77
+ 268
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "Existing methods for generating adversarial code examples face several challenges: limited availability of substitute variables, high verification costs for these substitutes, and the creation of adversarial samples with noticeable perturbations. To address these concerns, our proposed approach, RNNS, uses a search seed based on historical attacks to find potential adversarial substitutes. Rather than directly using the discrete substitutes, they are mapped to a continuous vector space using a pre-trained variable name encoder. Based on the vector representation, RNNS predicts and selects better substitutes for attacks. We evaluated the performance of RNNS across six coding tasks encompassing three programming languages: Java, Python, and C. We employed three pre-trained code models (CodeBERT, GraphCodeBERT, and CodeT5) that resulted in a cumulative of 18 victim models. The results demonstrate that RNNS outperforms baselines in terms of ASR and QT. Furthermore, the perturbation of adversarial examples introduced by RNNS is smaller compared to the baselines in terms of the number of replaced variables and the change in variable length. Lastly, our experiments indicate that RNNS is efficient in attacking defended models and can be employed for adversarial training.",
84
+ "bbox": [
85
+ 142,
86
+ 278,
87
+ 460,
88
+ 690
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "1 Introduction",
95
+ "text_level": 1,
96
+ "bbox": [
97
+ 114,
98
+ 700,
99
+ 260,
100
+ 715
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Recently, since programming language can be seen as one kind of textual data and also inspired by the success of deep learning for text processing and understanding, researchers have tried to pretrain code models such as CodeBERT (Feng et al., 2020), GraphCodeBERT (Guo et al., 2020), ContrabERT (Liu et al., 2023a) to help developers to solve multiple programming tasks, e.g., code search (Gu et al., 2018; Liu et al., 2023b), code clone detection (White et al., 2016; Li et al., 2017), code sum",
107
+ "bbox": [
108
+ 112,
109
+ 725,
110
+ 490,
111
+ 885
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "marization (Ahmad et al., 2020; Liu et al., 2020), and vulnerability detection (Zhou et al., 2019). Although these code models have achieved good performance on many code tasks, they are still suffering from robustness issues. A few adversarial attack methods have emerged to evaluate and improve the robustness of code models.",
118
+ "bbox": [
119
+ 507,
120
+ 253,
121
+ 885,
122
+ 363
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "There are certain considerations to be made. Firstly, code pre-training models are frequently deployed remotely, which limits access to the model parameters and renders white-box attacks infeasible. Secondly, among the numerous code-equivalent transformation methods, variable substitution exerts the most significant influence on the resilience of large code models while being the least detectable transformation (Li et al., 2022). As a result, black-box attack techniques based on variable substitution have emerged as a valuable avenue for research and multiple works have been proposed such as ALERT (Yang et al., 2022) and MHM (Zhang et al., 2020).",
129
+ "bbox": [
130
+ 507,
131
+ 368,
132
+ 885,
133
+ 594
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "However, these works have three limitations: 1) The number of substitute variables is limited and lacks diversity, which lowers the upper bound of the attack success rate. For example, ALERT employs 60 substitute variables for each variable, which are generated by a pre-trained model, and the substitute variables lack diversity. MHM also randomly selects 1500 words from a fixed dictionary as substitute variables. 2) The verification cost of substitute variables is high. To verify the attack effect of each substitute, it is necessary to replace the source variable with an adversarial sample and perform an actual attack on the victim model. ALERT uses a traversal method to select substitute variables, and in order to reduce the number of attacks, it limits the number of substitute variables; MHM uses a random sampling method to select substitute variables in order to reduce the number of attacks. Neither method is conducive to cost-effective attacks. 3) The generated adversarial samples have",
140
+ "bbox": [
141
+ 507,
142
+ 596,
143
+ 885,
144
+ 920
145
+ ],
146
+ "page_idx": 0
147
+ },
148
+ {
149
+ "type": "page_footnote",
150
+ "text": "* clark.zhang@huawei.com",
151
+ "bbox": [
152
+ 139,
153
+ 891,
154
+ 310,
155
+ 904
156
+ ],
157
+ "page_idx": 0
158
+ },
159
+ {
160
+ "type": "page_footnote",
161
+ "text": "† corresponding author: ma_wei@ntu.edu.sg",
162
+ "bbox": [
163
+ 139,
164
+ 904,
165
+ 416,
166
+ 917
167
+ ],
168
+ "page_idx": 0
169
+ },
170
+ {
171
+ "type": "page_number",
172
+ "text": "9706",
173
+ "bbox": [
174
+ 478,
175
+ 927,
176
+ 521,
177
+ 940
178
+ ],
179
+ "page_idx": 0
180
+ },
181
+ {
182
+ "type": "footer",
183
+ "text": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 9706-9716 December 6-10, 2023 ©2023 Association for Computational Linguistics",
184
+ "bbox": [
185
+ 216,
186
+ 945,
187
+ 779,
188
+ 972
189
+ ],
190
+ "page_idx": 0
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "large perturbations. Each adversarial sample usually needs to replace multiple original variables to succeed in attacking, and MHM easily generates semantically incoherent and excessively long variable names.",
195
+ "bbox": [
196
+ 112,
197
+ 84,
198
+ 487,
199
+ 162
200
+ ],
201
+ "page_idx": 1
202
+ },
203
+ {
204
+ "type": "text",
205
+ "text": "To address the aforementioned challenges, in this paper, we propose a search-based black-box adversarial attack method to create challenging adversarial samples based on the search seed vector in the variable representation space, namely Representation Nearest Neighbor Search (RNNS). Specifically, RNNS, first utilizes publicly available real code datasets to construct a large original substitute set, denoted as $subs_{original}$ . Then, based on the previous attack results, RNNS predicts the search seed vector required for the next round of attacks and efficiently searches for the $k$ nearest substitutes to the seed vector from the large-scale original substitute set to form the $subs_{topk}$ , where $k$ is much smaller than the size of the original substitute set. The generation process of the $subs_{topk}$ does not involve attacking the victim model even once. Furthermore, the length and similarity of the substitute must adhere to specific perturbation constraints to prevent excessive deviations from $var$ .",
206
+ "bbox": [
207
+ 115,
208
+ 165,
209
+ 489,
210
+ 501
211
+ ],
212
+ "page_idx": 1
213
+ },
214
+ {
215
+ "type": "text",
216
+ "text": "To evaluate the effectiveness of RNNS, we investigate three pre-trained code models, CodeBERT (Feng et al., 2020), GraphCodeBERT (Guo et al., 2020) and CodeT5 (Wang et al., 2021), and perform the attack on six code tasks in three programming languages, i.e., Java, Python, and C. The results on 18 victim models demonstrate that compared to the approaches MHM and ALERT, RNNS achieves a higher attack success rate (ASR) with a maximum of about $100\\%$ improvement and 18/18 times as the winner. Meanwhile, RNNS needs fewer query times (QT) with 8/18 times as the winners. Furthermore, we analyze the quality of adversarial examples statistically and find that RNNS introduces minor perturbations. In the end, we apply RNNS to attack three defended models and find that our approach outperforms the baselines by up to $32.07\\%$ ASR. We also use adversarial examples to improve the model's robustness through contrastive adversarial training.",
217
+ "bbox": [
218
+ 115,
219
+ 504,
220
+ 489,
221
+ 825
222
+ ],
223
+ "page_idx": 1
224
+ },
225
+ {
226
+ "type": "text",
227
+ "text": "2 Preliminaries",
228
+ "text_level": 1,
229
+ "bbox": [
230
+ 112,
231
+ 838,
232
+ 265,
233
+ 853
234
+ ],
235
+ "page_idx": 1
236
+ },
237
+ {
238
+ "type": "text",
239
+ "text": "2.1 Textual Code Processing",
240
+ "text_level": 1,
241
+ "bbox": [
242
+ 112,
243
+ 865,
244
+ 352,
245
+ 881
246
+ ],
247
+ "page_idx": 1
248
+ },
249
+ {
250
+ "type": "text",
251
+ "text": "The nature of code data (in text format with discrete input space) makes it impossible to feed one",
252
+ "bbox": [
253
+ 112,
254
+ 887,
255
+ 489,
256
+ 917
257
+ ],
258
+ "page_idx": 1
259
+ },
260
+ {
261
+ "type": "equation",
262
+ "text": "\n$$\n\\begin{array}{c c} x = \\left( \\begin{array}{c} S _ {0} \\\\ ... \\\\ S _ {i} \\\\ ... \\\\ S _ {j} \\\\ ... \\\\ S _ {l} \\end{array} \\right) \\longrightarrow R ^ {l \\times d} = \\left( \\begin{array}{c} \\boldsymbol {v} _ {0} \\\\ ... \\\\ \\boldsymbol {v} _ {i} \\\\ ... \\\\ \\boldsymbol {v} _ {j} \\\\ ... \\\\ \\boldsymbol {v} _ {l} \\end{array} \\right) \\longrightarrow \\boxed {f (\\theta)} \\\\ \\text {M o d e l} & \\longrightarrow \\left( \\begin{array}{c} p _ {0} \\\\ ... \\\\ p _ {g} \\\\ ... \\\\ p _ {k} \\end{array} \\right) \\\\ \\text {D o m a i n P r o b a b i l i t y} \\\\ \\text {S p a c e} & \\text {S p a c e} \\end{array}\n$$\n",
263
+ "text_format": "latex",
264
+ "bbox": [
265
+ 512,
266
+ 87,
267
+ 887,
268
+ 186
269
+ ],
270
+ "page_idx": 1
271
+ },
272
+ {
273
+ "type": "text",
274
+ "text": "Figure 1: One code model demo on the downstream task.",
275
+ "bbox": [
276
+ 507,
277
+ 204,
278
+ 882,
279
+ 231
280
+ ],
281
+ "page_idx": 1
282
+ },
283
+ {
284
+ "type": "text",
285
+ "text": "code input $x$ directly into deep learning models. Thus, transferring code data to learnable continuous vectors is the first step in source code learning. Dense encoding (Zhelezniak et al., 2020) is one common method used to vectorize textual code data. To do so, first, we need to learn a tokenizer that splits the code text into a token sequence which is called Tokenization. After tokenization, code $x$ is represented by a sequence of tokens, namely, $x = (s_0, \\dots, s_j, \\dots, s_l)$ where $s_i$ is one token. Then, the code vocabulary dictionary is built by using all the appeared tokens $s_i$ , denoted $\\mathbb{V}$ . After that, every word (token) in $\\mathbb{V}$ is embedded by learned vectors $\\boldsymbol{v}_i$ with dimension $d$ . Here, we use $E^{|\\mathbb{V}| \\times d}$ to represent the embedding matrix for $\\mathbb{V}$ . Finally, $x$ can be converted into a embedding matrix $R^{l \\times d} = (v_0, \\dots, v_j, \\dots, v_l)$ . After this code encoding, pre-trained code models based on the transformer take the matrix $R^{l \\times d}$ as inputs and learn the contextual representation of $x$ for downstream tasks via pre-training such as Masked Language Modeling (MLM) and Causal Language Modeling (CLM).",
286
+ "bbox": [
287
+ 507,
288
+ 239,
289
+ 884,
290
+ 608
291
+ ],
292
+ "page_idx": 1
293
+ },
294
+ {
295
+ "type": "text",
296
+ "text": "Figure 1 illustrates the main steps of the code processing models for the downstream classification tasks. First, we tokenize the textual code $x$ into a token sequence that is represented in a discrete integer space. Then, we map the discrete sequence ids into the token vector space $R^{l \\times d}$ . Next, we feed the token vectors into the task model $f(\\theta)$ . $f(\\theta)$ is built on top of pre-trained models. Finally, we can predict the domain probabilities after fine-tuning.",
297
+ "bbox": [
298
+ 507,
299
+ 609,
300
+ 882,
301
+ 755
302
+ ],
303
+ "page_idx": 1
304
+ },
305
+ {
306
+ "type": "text",
307
+ "text": "2.2 Problem Statement",
308
+ "text_level": 1,
309
+ "bbox": [
310
+ 507,
311
+ 768,
312
+ 707,
313
+ 782
314
+ ],
315
+ "page_idx": 1
316
+ },
317
+ {
318
+ "type": "text",
319
+ "text": "Since many critical code tasks are classification problems, e.g., defect prediction and code clone detection. In this paper, we focus on the adversarial attack for code classification tasks. Considering a code classification task, we use $f(x; \\theta) \\to y: R^{l \\times d} \\to \\mathbb{C} = \\{i | 0 \\leq i \\leq n\\}$ to denote the victim model that maps a code token sequence $x$ to a label $y$ from a label set $\\mathbb{C}$ with size $n$ , where",
320
+ "bbox": [
321
+ 507,
322
+ 790,
323
+ 882,
324
+ 917
325
+ ],
326
+ "page_idx": 1
327
+ },
328
+ {
329
+ "type": "page_number",
330
+ "text": "9707",
331
+ "bbox": [
332
+ 480,
333
+ 927,
334
+ 519,
335
+ 940
336
+ ],
337
+ "page_idx": 1
338
+ },
339
+ {
340
+ "type": "text",
341
+ "text": "$l$ is the sequence length and $d$ is the token vector dimension, and $i$ is one integer. By querying dictionary dense embedding $\\pmb{E}^{|\\mathbb{V}\\times d|}$ , a code token sequence $x = (s_0,\\dots,s_j,\\dots,s_l)$ , is vectorized into $\\pmb{R}^{l\\times d}$ . Adversarial attacks for code models create an adversarial example $x^{\\prime}$ by modifying some vulnerable tokens of $x$ with a limited maximum perturbation $\\epsilon$ to change the correct label $y$ to a wrong label $y^\\prime$ . Simply, we get a perturbed $x^{\\prime}$ by modifying some tokens in $(s_0,\\dots,s_j,\\dots,s_l)$ such that $f(x^{\\prime};\\theta)\\neq f(x;\\theta)$ where $x^{\\prime} = x + \\sigma$ and $x^{\\prime}$ has to have the same behavior with $x$ , + represent perturbation execution, $\\sigma$ is the perturbation code transformation for $(s_0,\\dots,s_j,\\dots,s_l)$ , and $\\sigma \\leq \\epsilon$ . We target the more practical attacking scenario - black-box attack that requires less information. We assume we cannot access the model parameters and can only utilize the final output of model $f(x;\\theta)$ to conduct the attack.",
342
+ "bbox": [
343
+ 112,
344
+ 84,
345
+ 492,
346
+ 390
347
+ ],
348
+ "page_idx": 2
349
+ },
350
+ {
351
+ "type": "text",
352
+ "text": "3 Methodology",
353
+ "text_level": 1,
354
+ "bbox": [
355
+ 112,
356
+ 403,
357
+ 263,
358
+ 420
359
+ ],
360
+ "page_idx": 2
361
+ },
362
+ {
363
+ "type": "text",
364
+ "text": "3.1 Motivation",
365
+ "text_level": 1,
366
+ "bbox": [
367
+ 112,
368
+ 430,
369
+ 247,
370
+ 444
371
+ ],
372
+ "page_idx": 2
373
+ },
374
+ {
375
+ "type": "text",
376
+ "text": "As mentioned in the introduction, the current methods face three limitations: 1) there is a limited number of substitute variables; 2) there is a high verification cost associated with substitute variables; and 3) the generated adversarial samples often exhibit large perturbations. Among these limitations, the second one holds the utmost significance as it significantly impacts both the first and third limitations. Due to the high cost involved, it becomes challenging to generate diverse adversarial examples within a reasonable budget. Additionally, attackers tend to introduce large perturbations without employing any perturbation constraints in order to maximize their attacks.",
377
+ "bbox": [
378
+ 112,
379
+ 451,
380
+ 489,
381
+ 675
382
+ ],
383
+ "page_idx": 2
384
+ },
385
+ {
386
+ "type": "text",
387
+ "text": "To address these limitations, the first question arises: \"Could we substantially reduce the verification cost while allowing for unrestricted diversity of substitute variables and minimizing perturbations?\" To delve into the reasons behind the second limitation, we need to analyze its underlying factors. The low verification efficiency of the substitute set stems from the fact that each substitute can only be verified by constructing an adversarial sample to replace the original variable and then launching an actual attack on the victim model. This realization leads to the second question: \"Is it feasible to predict the attack effect of a substitute instead of constructing an adversarial sample to attack the victim model?\"",
388
+ "bbox": [
389
+ 112,
390
+ 677,
391
+ 489,
392
+ 917
393
+ ],
394
+ "page_idx": 2
395
+ },
396
+ {
397
+ "type": "image",
398
+ "img_path": "images/30b4588241ab9a49cce19898cce8d7c4104bc2ea7b84b8d6c8b49fd8dc7c39bc.jpg",
399
+ "image_caption": [],
400
+ "image_footnote": [],
401
+ "bbox": [
402
+ 522,
403
+ 85,
404
+ 890,
405
+ 370
406
+ ],
407
+ "page_idx": 2
408
+ },
409
+ {
410
+ "type": "text",
411
+ "text": "Given input code $x$ and one of its variables $var$ , different substitutes can be used to replace it to obtain different adversarial samples. After attacking the victim model, the probability of the label will also change. Conversely, if we want to reduce the probability of this label, the third question is following, \"how to choose relatively better substitutes that can reduce the model confidence from a large-scale original substitute set?\" It is possible to select good substitutes without actual attack if we can forecast, which is implemented by RNNS.",
412
+ "bbox": [
413
+ 507,
414
+ 400,
415
+ 884,
416
+ 576
417
+ ],
418
+ "page_idx": 2
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "The core idea of RNNS is maintaining a search seed updated based on the historical attack. The search seed is employed to search next adversarial substitutes that are possible to attack successfully. Since substitutes are discrete and cannot be directly involved in calculations, we first use a variable name pre-trained encoder denoted as $E$ to map substitutes to a unified continuous representation vector space. Then, based on the representation vectors of substitutes that have participated in the attack, we predict the search seed vector $e_{seed}$ for the next round of the substitute selection. Finally, we calculate the similarity between $e_{seed}$ and the representation vector of substitutes and then select relatively better substitutes. For specific details, please refer to Section 3.2.3.",
423
+ "bbox": [
424
+ 507,
425
+ 577,
426
+ 884,
427
+ 835
428
+ ],
429
+ "page_idx": 2
430
+ },
431
+ {
432
+ "type": "text",
433
+ "text": "3.2 Representation Nearest Neighbor Search",
434
+ "text_level": 1,
435
+ "bbox": [
436
+ 507,
437
+ 848,
438
+ 877,
439
+ 865
440
+ ],
441
+ "page_idx": 2
442
+ },
443
+ {
444
+ "type": "text",
445
+ "text": "Algorithm 1 shows the workflow of our approach, First, we collect the original substitute set from public real code, following the process described",
446
+ "bbox": [
447
+ 507,
448
+ 871,
449
+ 884,
450
+ 919
451
+ ],
452
+ "page_idx": 2
453
+ },
454
+ {
455
+ "type": "page_number",
456
+ "text": "9708",
457
+ "bbox": [
458
+ 480,
459
+ 927,
460
+ 519,
461
+ 940
462
+ ],
463
+ "page_idx": 2
464
+ },
465
+ {
466
+ "type": "text",
467
+ "text": "in Section 3.2.1. We extract variables from the input code and sort them according to their uncertainty, referring to Section 3.2.2 (Line 3-4). We replace variables in sequence to form attack samples (Line 5). For a given $var$ , we first initialize the optimal substitute for this current iteration $sub_{cur}$ and the optimal substitute for the previous iteration $sub_{pre}$ to the $var$ . Then, we initialize the accumulated smooth increment of the representation vector $\\Delta e_{smo}$ to a zero vector. $\\Delta e_{smo}$ is used to record the historical representation change of the search seed $e_{seed}$ . We now commence the iterative attack process, as delineated in Line 11. We predict the search seed vector $e_{seed}$ with the process described in Section 3.2.3 (Line 12), and then extract topk substitutes based on $e_{seed}$ to form the candidate substitutes $subs_{topk}$ with the process described in Section 3.2.4 (Line 13). Subsequently, we replace $sub_{cur}$ in $x'$ with each substitute in $subs_{topk}$ to obtain the corresponding temporary adversarial sample $x'_tmp$ (Line 14-15). $x'$ is the current code that we are trying to attack and it is initialized with the original code $x$ . We use $x'_tmp$ to attack the victim model and obtain the probability $prob_y$ of the ground-truth label $y$ and predicted label $y'$ (Line 16). If the probability of the ground-truth label $y$ hits a new low ( $< prob_{min}$ ), we update $x'$ , $sub_{pre}$ , $sub_{cur}$ and $prob_{min}$ (Line 17-22). $prob_{min}$ records the minimum probability of label $y$ during the attack process. If $x'_tmp$ causes the victim model to predict an incorrect label, this attack is successful and returns the successful adversarial sample (Line 23-26); otherwise, proceed to the next iteration until all variables have completed iteration and return the final adversarial sample and attack result (Line 30).",
468
+ "bbox": [
469
+ 112,
470
+ 84,
471
+ 490,
472
+ 664
473
+ ],
474
+ "page_idx": 3
475
+ },
476
+ {
477
+ "type": "text",
478
+ "text": "3.2.1 Collecting Large Original Substitute Set",
479
+ "text_level": 1,
480
+ "bbox": [
481
+ 112,
482
+ 671,
483
+ 487,
484
+ 687
485
+ ],
486
+ "page_idx": 3
487
+ },
488
+ {
489
+ "type": "text",
490
+ "text": "We have developed a tool for variable extraction that leverages the tree-sitter framework<sup>1</sup>. This tool, henceforth denoted as ExtractVar (see Line 3), operates in three distinct steps. In the first step, we extract all variables from the current dataset and then filter out duplicates. During the second step, each valid variable is tokenized, and we compute the embedding for each token using the variable-name encoder $E$ that is pre-trained on CodeSearchNet<sup>2</sup>. We then apply a mean pooling operation on these tokens to determine the variable's embedding. In the third step, we retain all the chosen variables",
491
+ "bbox": [
492
+ 112,
493
+ 690,
494
+ 490,
495
+ 883
496
+ ],
497
+ "page_idx": 3
498
+ },
499
+ {
500
+ "type": "text",
501
+ "text": "along with their associated embeddings as the initial substitute set, represented as $subs_{original}$ .",
502
+ "bbox": [
503
+ 507,
504
+ 84,
505
+ 885,
506
+ 118
507
+ ],
508
+ "page_idx": 3
509
+ },
510
+ {
511
+ "type": "text",
512
+ "text": "3.2.2 Computing Uncertainty",
513
+ "text_level": 1,
514
+ "bbox": [
515
+ 507,
516
+ 124,
517
+ 757,
518
+ 140
519
+ ],
520
+ "page_idx": 3
521
+ },
522
+ {
523
+ "type": "text",
524
+ "text": "Given a specific code $x$ , we replace each instance of $var \\in x$ with a set of predefined fixed variables $VarArray$ , resulting in a set of mutated codes denoted as $X_{var}^{mutated}$ . These mutated codes are subsequently utilized to query the victim model, allowing us to obtain the probability distribution for each class. A greater variance in the distribution signifies increased uncertainty for $var$ , suggesting that $var$ should be prioritized for replacement. The uncertainty associated with $var$ is defined as follows:",
525
+ "bbox": [
526
+ 507,
527
+ 143,
528
+ 885,
529
+ 319
530
+ ],
531
+ "page_idx": 3
532
+ },
533
+ {
534
+ "type": "equation",
535
+ "text": "\n$$\nu n c e r t a i n t y _ {v a r} = \\frac {1}{C} \\sum_ {i = 1} ^ {C} v a r i a n c e (P _ {v a r} ^ {i})\n$$\n",
536
+ "text_format": "latex",
537
+ "bbox": [
538
+ 534,
539
+ 326,
540
+ 857,
541
+ 370
542
+ ],
543
+ "page_idx": 3
544
+ },
545
+ {
546
+ "type": "text",
547
+ "text": "where $P_{var}^{i} = \\{p_{var}^{i}(x) | \\forall x \\in X_{var}^{mutated}\\}$ , $C$ is the number of labels, $p_{var}^{i}(x)$ is the model probability for label $i$ given the mutated code $x$ , and variance denotes the standard variance function. A larger and more diverse $X_{var}^{mutated}$ ensures a closer approximation of uncertainty to the true value. It is important to note, however, that the magnitude of the change length must not be excessively large, as this would result in all probability changes converging to a single point. This is because samples subjected to large changes deviate significantly from the original, leading to a substantial decrease in the model confidence levels. Subsequently, we arrange the variables in descending order based on their uncertainties. The greater the uncertainty of a variable, the more valuable it is for attack. This process is denoted as RankVarsWithUncertainty at line 4. In our implementation, the size of this variable array VarArray is 16, and the variable length ranges from 1 to 5.",
548
+ "bbox": [
549
+ 507,
550
+ 380,
551
+ 885,
552
+ 703
553
+ ],
554
+ "page_idx": 3
555
+ },
556
+ {
557
+ "type": "text",
558
+ "text": "3.2.3 Predicting Search Seed",
559
+ "text_level": 1,
560
+ "bbox": [
561
+ 507,
562
+ 712,
563
+ 752,
564
+ 727
565
+ ],
566
+ "page_idx": 3
567
+ },
568
+ {
569
+ "type": "text",
570
+ "text": "To filter out superior substitutes from the substantial $subs_{original}$ , it becomes necessary to predict the search seed within the substitute representation vector space. Given the optimal substitute $sub_{cur}$ of the current round, the optimal substitute $sub_{pre}$ from the previous round, and the accumulated smooth increment of the representation vector, denoted as $\\Delta e_{smo}$ , from all preceding rounds of iteration, we initially compute the increment of the representation vector in the current round, $\\Delta e$ :",
571
+ "bbox": [
572
+ 507,
573
+ 731,
574
+ 885,
575
+ 891
576
+ ],
577
+ "page_idx": 3
578
+ },
579
+ {
580
+ "type": "equation",
581
+ "text": "\n$$\n\\Delta \\boldsymbol {e} = E (s u b _ {c u r}) - E (s u b _ {p r e})\n$$\n",
582
+ "text_format": "latex",
583
+ "bbox": [
584
+ 579,
585
+ 902,
586
+ 811,
587
+ 920
588
+ ],
589
+ "page_idx": 3
590
+ },
591
+ {
592
+ "type": "page_footnote",
593
+ "text": "1https://tree-sitter.github.io/tree-sitter",
594
+ "bbox": [
595
+ 134,
596
+ 890,
597
+ 389,
598
+ 904
599
+ ],
600
+ "page_idx": 3
601
+ },
602
+ {
603
+ "type": "page_footnote",
604
+ "text": "2https://huggingface.co/datasets/code_search_net",
605
+ "bbox": [
606
+ 136,
607
+ 904,
608
+ 421,
609
+ 917
610
+ ],
611
+ "page_idx": 3
612
+ },
613
+ {
614
+ "type": "page_number",
615
+ "text": "9709",
616
+ "bbox": [
617
+ 480,
618
+ 927,
619
+ 519,
620
+ 940
621
+ ],
622
+ "page_idx": 3
623
+ },
624
+ {
625
+ "type": "table",
626
+ "img_path": "images/17b33fb314e463991cd8f0c9d307ef116209e0b26bc4871ae46163d3010a654f.jpg",
627
+ "table_caption": [],
628
+ "table_footnote": [],
629
+ "table_body": "<table><tr><td>Task</td><td>Train / Val / Test</td><td>CodeBERT</td><td>GraphCodeBERT</td><td>CodeT5</td></tr><tr><td>Defect</td><td>21,854 / 2,732 / 2,732</td><td>63.76</td><td>63.65</td><td>67.02</td></tr><tr><td>Clone</td><td>90,102 / 4,000 / 4,000</td><td>96.97</td><td>97.36</td><td>97.84</td></tr><tr><td>Authorship</td><td>528 / - / 132</td><td>82.57</td><td>77.27</td><td>88.63</td></tr><tr><td>C1000</td><td>320,000 / 80,000 / 100,000</td><td>82.53</td><td>83.79</td><td>84.46</td></tr><tr><td>Python800</td><td>153,600 / 38,400 / 48,000</td><td>96.39</td><td>96.29</td><td>96.79</td></tr><tr><td>Java250</td><td>48,000 / 11,909 / 15,000</td><td>96.91</td><td>97.27</td><td>97.72</td></tr></table>",
630
+ "bbox": [
631
+ 117,
632
+ 82,
633
+ 489,
634
+ 143
635
+ ],
636
+ "page_idx": 4
637
+ },
638
+ {
639
+ "type": "text",
640
+ "text": "Table 1: Datasets and Victim Model Performance (Accuracy, %).",
641
+ "bbox": [
642
+ 112,
643
+ 159,
644
+ 487,
645
+ 187
646
+ ],
647
+ "page_idx": 4
648
+ },
649
+ {
650
+ "type": "text",
651
+ "text": ", where $E$ is variable name encoder, trained on CodeSearchNet by masked language modelling independently so that RNNS is independent of victim downstream-task models. Then we update the $\\Delta e_{smo}$",
652
+ "bbox": [
653
+ 112,
654
+ 214,
655
+ 487,
656
+ 294
657
+ ],
658
+ "page_idx": 4
659
+ },
660
+ {
661
+ "type": "equation",
662
+ "text": "\n$$\n\\Delta \\mathbf {e} _ {s m o} = (1 - \\alpha) \\Delta \\mathbf {e} _ {s m o} + \\alpha \\Delta \\mathbf {e}\n$$\n",
663
+ "text_format": "latex",
664
+ "bbox": [
665
+ 174,
666
+ 309,
667
+ 426,
668
+ 325
669
+ ],
670
+ "page_idx": 4
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": ", where $\\alpha$ is a smooth rate limited 0 to 1, Finally, we predict the search seed $e_{\\text{seed}}$ :",
675
+ "bbox": [
676
+ 112,
677
+ 338,
678
+ 487,
679
+ 370
680
+ ],
681
+ "page_idx": 4
682
+ },
683
+ {
684
+ "type": "equation",
685
+ "text": "\n$$\n\\boldsymbol {e} _ {\\text {s e e d}} = E \\left(\\operatorname {s u b} _ {\\text {c u r}}\\right) + \\Delta \\boldsymbol {e} _ {\\text {s m o}}\n$$\n",
686
+ "text_format": "latex",
687
+ "bbox": [
688
+ 189,
689
+ 385,
690
+ 411,
691
+ 401
692
+ ],
693
+ "page_idx": 4
694
+ },
695
+ {
696
+ "type": "text",
697
+ "text": "This process is denoted as PredictSeed at line 12.",
698
+ "bbox": [
699
+ 112,
700
+ 416,
701
+ 487,
702
+ 431
703
+ ],
704
+ "page_idx": 4
705
+ },
706
+ {
707
+ "type": "text",
708
+ "text": "3.2.4 Searching Top-K Substitutes",
709
+ "text_level": 1,
710
+ "bbox": [
711
+ 112,
712
+ 442,
713
+ 400,
714
+ 457
715
+ ],
716
+ "page_idx": 4
717
+ },
718
+ {
719
+ "type": "text",
720
+ "text": "Initially, we filter out substitutes from $subs_{original}$ that comply with two constraints: 1) $1 - sim(E(sub), E(var)) < \\epsilon$ and 2) $|len(sub) - len(var)| < \\delta$ , where $var$ refers to the original variable in the input code that is to be replaced, $sim(.)$ is the similarity calculation function. $E(.)$ is the variable name encoder, and $len(.)$ is used to calculate the length of the variable name. Then, we calculate the similarity between the search seed $e_{seed}$ and the substitutes that are filtered by the two constraints and select the $k$ most similar substitutes to form $subs_{topk}$ . This process is denoted as SearchTopkSub at line 13. In our experiment, $\\epsilon = 0.15$ , $\\delta = 4$ , $k = 60$ , $sim(.)$ is cosine similarity.",
721
+ "bbox": [
722
+ 112,
723
+ 462,
724
+ 489,
725
+ 703
726
+ ],
727
+ "page_idx": 4
728
+ },
729
+ {
730
+ "type": "text",
731
+ "text": "4 Experimental Setup",
732
+ "text_level": 1,
733
+ "bbox": [
734
+ 112,
735
+ 715,
736
+ 321,
737
+ 733
738
+ ],
739
+ "page_idx": 4
740
+ },
741
+ {
742
+ "type": "text",
743
+ "text": "Dataset and Model. To study the effectiveness and efficiency of RNNS, we conduct experiments on three popular programming languages (C, Python, and Java). For the datasets, we employed six widely studied open-source datasets that cover four important code tasks. Specifically, BigCloneBench (Wang et al., 2020) is one code clone detection dataset named Clone. Devign (Zhou et al., 2019) is a dataset used for vulnerability detection, named Defect. For authorship prediction, we use the dataset provided by (Alsulami et al., 2017).",
744
+ "bbox": [
745
+ 112,
746
+ 741,
747
+ 489,
748
+ 917
749
+ ],
750
+ "page_idx": 4
751
+ },
752
+ {
753
+ "type": "text",
754
+ "text": "Besides, we utilize three problem-solving classification tasks, Java250, Python800, and C1000, provided by ProjectCodeNet (Puri et al., 2021). For all the datasets (except for authorship prediction which does not have enough data samples), we follow the original papers to split the data into the training set, validation set, and test set. Authorship prediction only has two split parts, training data and test data.",
755
+ "bbox": [
756
+ 507,
757
+ 84,
758
+ 882,
759
+ 227
760
+ ],
761
+ "page_idx": 4
762
+ },
763
+ {
764
+ "type": "text",
765
+ "text": "For the code models, we follow the previous work (Yang et al., 2022) and investigate two pretrained models CodeBERT (Feng et al., 2020), and GraphCodeBERT (Guo et al., 2020). Besides, we add one more powerful model CodeT5 (Wang et al., 2021) in our study. Table 1 summarizes the details of our employed datasets and fine-tuned models.",
766
+ "bbox": [
767
+ 507,
768
+ 252,
769
+ 882,
770
+ 365
771
+ ],
772
+ "page_idx": 4
773
+ },
774
+ {
775
+ "type": "text",
776
+ "text": "Evaluation Metric. To evaluate the effectiveness of adversarial attack methods, we employ the commonly used attack success rate (ASR) (Yang et al., 2022) as the measurement. To evaluate the efficiency of the attack methods, we use query times (QT) to check the average number of querying the victim model for one input code. Finally, we use the change of replaced-variable length and the number of replaced variables to study the quality/perturbation of adversarial examples. A smaller score means the attack method can generate adversarial examples with less perturbation injection.",
777
+ "bbox": [
778
+ 507,
779
+ 388,
780
+ 882,
781
+ 581
782
+ ],
783
+ "page_idx": 4
784
+ },
785
+ {
786
+ "type": "text",
787
+ "text": "Baseline. We compare RNNS with two black-box attack baselines, MHM (Zhang et al., 2020) and NaturalAttack (ALERT) (Yang et al., 2022). MHM is a sampling search-based black-box attack that generates the substitutes from the vocabulary based on lexical rules for identifiers. MHM employs synthesized tokens as the candidates of substitutes, which could introduce meaningless variable names. ALERT is a recently proposed attack method that combines greedy attack and genetic algorithm to find the substitutes. We also use two textual attack algorithms PSO (Zang et al., 2020) and LSH (Maheshwary et al., 2021) as minor baselines, since they are not designed for code models.",
788
+ "bbox": [
789
+ 507,
790
+ 605,
791
+ 882,
792
+ 829
793
+ ],
794
+ "page_idx": 4
795
+ },
796
+ {
797
+ "type": "text",
798
+ "text": "Implementation. We implement our approach in PyTorch and run all experiments on 32G-v100 GPUs. We reuse the source code from the baselines. We make our implementation publicly available.",
799
+ "bbox": [
800
+ 507,
801
+ 854,
802
+ 882,
803
+ 917
804
+ ],
805
+ "page_idx": 4
806
+ },
807
+ {
808
+ "type": "page_number",
809
+ "text": "9710",
810
+ "bbox": [
811
+ 480,
812
+ 927,
813
+ 519,
814
+ 940
815
+ ],
816
+ "page_idx": 4
817
+ },
818
+ {
819
+ "type": "table",
820
+ "img_path": "images/0e919ba263daf8956316645eed9a72f94dc933a90beb1976bd24e049559a6608.jpg",
821
+ "table_caption": [],
822
+ "table_footnote": [],
823
+ "table_body": "<table><tr><td rowspan=\"2\">Task+Model</td><td colspan=\"2\">ALERT</td><td colspan=\"2\">MHM</td><td colspan=\"2\">RNNS</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Clone+CodeBert</td><td>28.67</td><td>2155.39</td><td>39.66</td><td>972.15</td><td>46.50</td><td>666.48</td></tr><tr><td>Clone+GraphCodeBert</td><td>10.40</td><td>1466.68</td><td>9.58</td><td>490.99</td><td>41.28</td><td>1122.01</td></tr><tr><td>Clone+CodeT5</td><td>29.20</td><td>2359.70</td><td>38.79</td><td>1069.06</td><td>39.61</td><td>895.79</td></tr><tr><td>Defect+CodeBert</td><td>52.29</td><td>1079.68</td><td>50.51</td><td>862.18</td><td>69.18</td><td>588.35</td></tr><tr><td>Defect+GraphCodeBert</td><td>74.29</td><td>621.77</td><td>75.19</td><td>539.93</td><td>81.63</td><td>404.73</td></tr><tr><td>Defect+CodeT5</td><td>76.66</td><td>721.02</td><td>86.51</td><td>344.08</td><td>89.45</td><td>344.29</td></tr><tr><td>Authorship+CodeBert</td><td>34.98</td><td>682.57</td><td>64.70</td><td>775.11</td><td>73.39</td><td>1029.59</td></tr><tr><td>Authorship+GraphCodeBert</td><td>58.82</td><td>1227.36</td><td>75.49</td><td>632.10</td><td>80.39</td><td>696.64</td></tr><tr><td>Authorship+CodeT5</td><td>64.95</td><td>1078.40</td><td>66.97</td><td>715.89</td><td>71.79</td><td>970.44</td></tr><tr><td>Java250+CodeBert</td><td>50.50</td><td>958.96</td><td>74.03</td><td>961.60</td><td>75.12</td><td>815.91</td></tr><tr><td>Java250+GraphCodeBert</td><td>46.74</td><td>1026.15</td><td>46.05</td><td>946.52</td><td>72.30</td><td>853.74</td></tr><tr><td>Java250+CodeT5</td><td>52.04</td><td>1189.42</td><td>30.59</td><td>1107.95</td><td>63.80</td><td>1049.46</td></tr><tr><td>Python800+CodeBert</td><td>58.30</td><td>513.63</td><td>56.67</td><td>919.37</td><td>77.88</td><td>514.19</td></tr><tr><td>Python800+GraphCodeBert</td><td>51.87</td><td>577.70</td><td>54.15</td><td>917.92</td><td>71.42</td><td>730.14</td></tr><tr><td>Python800+CodeT5</td><td>52.84</td><td>777.20</td><td>36.95</td><td>1127.44</td><td>69.07</td><td>662.28</td></tr><tr><td>C1000+CodeBert</td><td>53.50</td><td>525.43</td><td>59.75</td><td>340.88</td><td>72.96</td><td>537.76</td></tr><tr><td>C1000+GraphCodeBert</td><td>52.68</td><td>566.18</td><td>45.93</td><td>837.09</td><td>72.23</td><td>634.27</td></tr><tr><td>C1000+CodeT5</td><td>47.86</td><td>843.33</td><td>36.45</td><td>668.15</td><td>59.00</td><td>697.06</td></tr><tr><td>Count</td><td>0/18</td><td>4/18</td><td>0/18</td><td>6/18</td><td>18/18</td><td>8/18</td></tr></table>",
824
+ "bbox": [
825
+ 268,
826
+ 80,
827
+ 731,
828
+ 322
829
+ ],
830
+ "page_idx": 5
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "Table 2: Comparison results with MHM, and ALERT, ASR %. Count: the number of best results achieved.",
835
+ "bbox": [
836
+ 136,
837
+ 331,
838
+ 858,
839
+ 346
840
+ ],
841
+ "page_idx": 5
842
+ },
843
+ {
844
+ "type": "text",
845
+ "text": "5 Results Analysis",
846
+ "text_level": 1,
847
+ "bbox": [
848
+ 112,
849
+ 357,
850
+ 290,
851
+ 373
852
+ ],
853
+ "page_idx": 5
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "5.1 Attack Effectiveness and Efficiency",
858
+ "text_level": 1,
859
+ "bbox": [
860
+ 112,
861
+ 385,
862
+ 435,
863
+ 401
864
+ ],
865
+ "page_idx": 5
866
+ },
867
+ {
868
+ "type": "text",
869
+ "text": "We compare RNNS with two methods MHM (Zhang et al., 2020) and NaturalAttack (ALERT) (Yang et al., 2022) on six datasets and 18 victim models that have been fine-tuned for the downstream tasks. Table 2 shows the comparison results where the last row Count indicates how many times this method achieves the best results. We can see that RNNS achieves the best performance for 18/18 times in terms of ASR, and the lowest cost for 8/18 times in terms of QT in Table 2. Both of the indicators are better than the baselines. The two baselines have zero best ASR for all victim models and all datasets. The lowest QTs achieved by ALERT and MHM are 4 and 6, respectively. We conclude that for effectiveness and efficiency, RNNS outperforms ALERT and MHM in all cases. Especially, MHM and ALERT fail to attack GraphCodeBERT on BigClone dataset, and only have $9.58\\%$ and $10.4\\%$ ASR respectively, while RNNS has more than $40\\%$ ASR. RNNS has almost two times larger ASR than MHM on Java250+CodeT5 and Python800+CodeT5.",
870
+ "bbox": [
871
+ 112,
872
+ 409,
873
+ 487,
874
+ 778
875
+ ],
876
+ "page_idx": 5
877
+ },
878
+ {
879
+ "type": "text",
880
+ "text": "It should be noted that high ASR is not due to large QT. As shown in Table 2, the three groups of experiments with the most QTs are Clone+GraphCodeBert, Java250+CodeT5, and Authorship+CodeBert, with ASRs of $41.28\\%$ , $63.80\\%$ , and $73.39\\%$ , respectively, which are not the highest. On the contrary, Defect+CodeT5 has the highest",
881
+ "bbox": [
882
+ 112,
883
+ 780,
884
+ 489,
885
+ 892
886
+ ],
887
+ "page_idx": 5
888
+ },
889
+ {
890
+ "type": "text",
891
+ "text": "ASR of $89.45\\%$ , but QT is the smallest. Therefore, there is no absolute causal relationship between QT and ASR.",
892
+ "bbox": [
893
+ 507,
894
+ 357,
895
+ 882,
896
+ 405
897
+ ],
898
+ "page_idx": 5
899
+ },
900
+ {
901
+ "type": "text",
902
+ "text": "5.2 Perturbation of Adversarial Example",
903
+ "text_level": 1,
904
+ "bbox": [
905
+ 507,
906
+ 425,
907
+ 848,
908
+ 441
909
+ ],
910
+ "page_idx": 5
911
+ },
912
+ {
913
+ "type": "text",
914
+ "text": "We conduct a study about the quality of the adversarial examples to check if RNNS can generate looking-normal code, e.g., avoiding naively increasing the variable name length. To do so, firstly, we count the average length of the original variable and adversarial variables as demonstrated by Table 3. We also compute the mean and variances of their difference. Besides, we compute the average number of the replaced variables for the successful attack as shown in Table 4. Low values mean the inputs are modified less, and high qualities.",
915
+ "bbox": [
916
+ 505,
917
+ 450,
918
+ 882,
919
+ 626
920
+ ],
921
+ "page_idx": 5
922
+ },
923
+ {
924
+ "type": "text",
925
+ "text": "In Table 3, the 2nd, 5th, and 8th columns are the average length for original variables (named Var Len) that are replaced. The 3rd, 6th, and 9th columns are the average lengths for adversarial variables (named Adv Var Len). The 4th, 7th, and 10th columns are the average and variance (mean $\\pm$ variance) of the absolute length difference between original variables and adversarial variables (named Difference). We observe that MHM prefers to replace the long-length variables while RNNS likes replacing short-length variables if we compare the 2nd and 5th columns. Meanwhile, the change of variable length from RNNS is less than MHM. MHM introduces the average length difference of 3.39-6.82 while RNNS only has 2.02-2.54. MHM has much higher variances than RNNS in the length change. ALERT uses shorter adversarial variable names than RNNS",
926
+ "bbox": [
927
+ 507,
928
+ 629,
929
+ 882,
930
+ 917
931
+ ],
932
+ "page_idx": 5
933
+ },
934
+ {
935
+ "type": "page_footnote",
936
+ "text": "<sup>3</sup>https://github.com/18682922316/RNNS-for-code-attack",
937
+ "bbox": [
938
+ 134,
939
+ 903,
940
+ 447,
941
+ 917
942
+ ],
943
+ "page_idx": 5
944
+ },
945
+ {
946
+ "type": "page_number",
947
+ "text": "9711",
948
+ "bbox": [
949
+ 480,
950
+ 927,
951
+ 517,
952
+ 940
953
+ ],
954
+ "page_idx": 5
955
+ },
956
+ {
957
+ "type": "table",
958
+ "img_path": "images/972dbb7978d3bef7c97b734d46e3c3771bbc4db71d27ef228eb675815d0a1b11.jpg",
959
+ "table_caption": [],
960
+ "table_footnote": [],
961
+ "table_body": "<table><tr><td rowspan=\"2\">Task+Model</td><td colspan=\"3\">RNNS</td><td colspan=\"3\">MHM</td><td colspan=\"3\">ALERT</td></tr><tr><td>Var Len</td><td>Adv Var Len</td><td>Difference</td><td>Var Len</td><td>Adv Var Len</td><td>Difference</td><td>Var Len</td><td>Adv Var Len</td><td>Difference</td></tr><tr><td>Clone+CodeBert</td><td>6.12</td><td>6.79</td><td>2.35 ± 4.50</td><td>6.47</td><td>10.6</td><td>6.34 ± 10.98</td><td>5.91</td><td>6.21</td><td>1.32 ± 2.02</td></tr><tr><td>Clone+GraphCodeBert</td><td>6.32</td><td>6.97</td><td>2.54 ± 6.43</td><td>6.58</td><td>10.41</td><td>6.82 ± 21.67</td><td>5.50</td><td>5.93</td><td>1.45 ± 2.49</td></tr><tr><td>Clone+CodeT5</td><td>6.45</td><td>6.69</td><td>2.51 ± 8.30</td><td>6.46</td><td>10.46</td><td>6.17 ± 25.78</td><td>6.25</td><td>6.61</td><td>1.32 ± 2.72</td></tr><tr><td>Defect+CodeBert</td><td>4.64</td><td>5.44</td><td>2.08 ± 2.49</td><td>4.44</td><td>9.59</td><td>6.57 ± 28.78</td><td>4.85</td><td>5.06</td><td>1.36 ± 1.93</td></tr><tr><td>Defect+GraphCodeBert</td><td>4.08</td><td>5.34</td><td>2.13 ± 1.83</td><td>4.37</td><td>9.73</td><td>6.48 ± 26.51</td><td>4.47</td><td>5.22</td><td>1.33 ± 1.83</td></tr><tr><td>Defect+CodeT5</td><td>3.95</td><td>5.17</td><td>2.03 ± 1.93</td><td>4.33</td><td>9.81</td><td>6.59 ± 29.98</td><td>4.36</td><td>5.01</td><td>1.27 ± 1.57</td></tr><tr><td>Authorship+CodeBert</td><td>3.81</td><td>5.18</td><td>2.28 ± 1.56</td><td>3.97</td><td>7.94</td><td>5.45 ± 16.72</td><td>4.42</td><td>5.35</td><td>1.40 ± 2.25</td></tr><tr><td>Authorship+GraphCodeBert</td><td>3.69</td><td>5.23</td><td>2.36 ± 1.71</td><td>4.39</td><td>7.64</td><td>5.24 ± 15.38</td><td>3.74</td><td>4.46</td><td>1.22 ± 1.82</td></tr><tr><td>Authorship+CodeT5</td><td>3.95</td><td>5.18</td><td>2.03 ± 2.66</td><td>3.95</td><td>7.98</td><td>5.59 ± 20.94</td><td>3.81</td><td>4.50</td><td>1.22 ± 1.62</td></tr><tr><td>Java250+CodeBert</td><td>2.35</td><td>4.22</td><td>2.11 ± 1.02</td><td>3.21</td><td>6.50</td><td>4.34 ± 15.20</td><td>3.22</td><td>3.65</td><td>0.94 ± 1.63</td></tr><tr><td>Java250+GraphCodeBert</td><td>2.48</td><td>4.31</td><td>2.13 ± 1.07</td><td>3.13</td><td>6.59</td><td>4.42 ± 14.84</td><td>3.05</td><td>3.50</td><td>0.98 ± 1.54</td></tr><tr><td>Java250+CodeT5</td><td>2.76</td><td>4.47</td><td>2.10 ± 1.17</td><td>3.20</td><td>6.54</td><td>4.33 ± 14.60</td><td>3.16</td><td>7.31</td><td>4.41 ± 18.73</td></tr><tr><td>Python800+CodeBert</td><td>1.50</td><td>3.54</td><td>2.21 ± 1.02</td><td>1.97</td><td>5.11</td><td>3.64 ± 9.06</td><td>1.78</td><td>2.27</td><td>0.64 ± 1.34</td></tr><tr><td>Python800+GraphCodeBert</td><td>1.88</td><td>3.90</td><td>2.18 ± 0.78</td><td>1.99</td><td>6.01</td><td>4.46 ± 16.52</td><td>1.80</td><td>2.33</td><td>0.76 ± 1.30</td></tr><tr><td>Python800+CodeT5</td><td>1.65</td><td>3.59</td><td>2.13 ± 0.95</td><td>1.97</td><td>4.95</td><td>3.49 ± 8.18</td><td>1.88</td><td>5.84</td><td>4.10 ± 12.64</td></tr><tr><td>C1000+CodeBert</td><td>1.58</td><td>3.44</td><td>2.08 ± 0.88</td><td>2.41</td><td>5.05</td><td>3.65 ± 12.02</td><td>2.13</td><td>2.52</td><td>0.67 ± 1.17</td></tr><tr><td>C1000+GraphCodeBert</td><td>1.60</td><td>3.59</td><td>2.10 ±0.85</td><td>2.39</td><td>5.35</td><td>3.90 ± 12.98</td><td>2.18</td><td>2.67</td><td>0.66 ± 1.23</td></tr><tr><td>C1000+CodeBert</td><td>1.38</td><td>3.33</td><td>2.02 ± 0.85</td><td>2.36</td><td>4.82</td><td>3.39 ± 10.98</td><td>2.10</td><td>6.56</td><td>4.74 ± 13.24</td></tr></table>",
962
+ "bbox": [
963
+ 147,
964
+ 80,
965
+ 848,
966
+ 294
967
+ ],
968
+ "page_idx": 6
969
+ },
970
+ {
971
+ "type": "text",
972
+ "text": "Table 3: Replaced-variable length comparison, mean $\\pm$ variance.",
973
+ "bbox": [
974
+ 270,
975
+ 304,
976
+ 724,
977
+ 318
978
+ ],
979
+ "page_idx": 6
980
+ },
981
+ {
982
+ "type": "text",
983
+ "text": "with less change because it uses the pre-trained model to generate the replacements that are close to the replaced variables.",
984
+ "bbox": [
985
+ 112,
986
+ 331,
987
+ 487,
988
+ 378
989
+ ],
990
+ "page_idx": 6
991
+ },
992
+ {
993
+ "type": "text",
994
+ "text": "Table 4 statistically shows the number of replaced variables. It can be seen that RNNS replaces around an average of 3.6 variables with a smaller variance of around (3.4-4.6) while MHM needs to modify about an average of 5.4 variables with a larger variance $(\\geq 11.14)$ . ALERT also replaces more variables to attack models than RNNS and MHM. RNNS introduces less or equal perturbation than the baselines in terms of length change and change number.",
995
+ "bbox": [
996
+ 112,
997
+ 380,
998
+ 489,
999
+ 539
1000
+ ],
1001
+ "page_idx": 6
1002
+ },
1003
+ {
1004
+ "type": "text",
1005
+ "text": "Figure 2 shows one example of RNNS, MHM, and ALERT attack successfully from the Java250 dataset. The changes are highlighted by shadow markers. RNNS only renames one variable $\\mathbf{b}$ to $\\mathbf{h}$ , ALERT renames two variables, while MHM almost renames all variables and also prefers longer names.",
1006
+ "bbox": [
1007
+ 112,
1008
+ 542,
1009
+ 489,
1010
+ 653
1011
+ ],
1012
+ "page_idx": 6
1013
+ },
1014
+ {
1015
+ "type": "text",
1016
+ "text": "5.3 Ablation Study",
1017
+ "text_level": 1,
1018
+ "bbox": [
1019
+ 112,
1020
+ 670,
1021
+ 280,
1022
+ 686
1023
+ ],
1024
+ "page_idx": 6
1025
+ },
1026
+ {
1027
+ "type": "text",
1028
+ "text": "We remove the two search constraints in Section 3.2.4, denoted this variant of RNNS as RNNS-Unlimited. Table 5 shows the comparing results between RNNS-Unlimited and RNNS. RNNS-Unlimited gets the first place for all the tasks in terms of ASR. ASR can be improved by a maximum of $8.35\\%$ and a minimum of about $2\\%$ after removing limitations. For QT, RNNS-Unlimited only loses 3 times among 18 evaluations. The improvement of RNNS-Unlimited is not surprising with respect to ASR and QT. Because RNNS-Unlimited can search the adversarial examples in the non-similar real names and use very long variable names.",
1029
+ "bbox": [
1030
+ 112,
1031
+ 694,
1032
+ 490,
1033
+ 917
1034
+ ],
1035
+ "page_idx": 6
1036
+ },
1037
+ {
1038
+ "type": "text",
1039
+ "text": "5.4 Attack Defended Model and Retraining",
1040
+ "text_level": 1,
1041
+ "bbox": [
1042
+ 507,
1043
+ 331,
1044
+ 867,
1045
+ 347
1046
+ ],
1047
+ "page_idx": 6
1048
+ },
1049
+ {
1050
+ "type": "text",
1051
+ "text": "Attack Defended Model. We employ RNNS and MHM to attack the three defended models provided by ALERT (Yang et al., 2022). These models are prepared by adversarial fine-tuning. Table 6 presents the results. We can see that RNNS outperforms MHM in two tasks, and MHM is better in one task. This experiment setting actually is not friendly for RNNS because ALERT (Yang et al., 2022) uses the replacements from pre-trained models which implicitly have the semantic constraint.",
1052
+ "bbox": [
1053
+ 505,
1054
+ 351,
1055
+ 885,
1056
+ 513
1057
+ ],
1058
+ "page_idx": 6
1059
+ },
1060
+ {
1061
+ "type": "text",
1062
+ "text": "Retraining. We use the adversarial examples from RNNS to retrain the victim models of CodeBERT by contrastive adversarial learning. We use three 3 datasets, Defect, Authorship, and Java250. We generate the adversarial examples on the whole training dataset for them. Table 7 presents the results, all approaches achieve much lower ASR compared with the previous. RNNS adversarial examples can improve the mode robustness through contrastive adversarial retraining. If we compare Defect/Authorship+CodeBERT in Table 7 and Table 6, we can find that both retrained models via RNNS are more robust than the models from ALERT since they have much lower ASRs.",
1063
+ "bbox": [
1064
+ 507,
1065
+ 514,
1066
+ 885,
1067
+ 739
1068
+ ],
1069
+ "page_idx": 6
1070
+ },
1071
+ {
1072
+ "type": "text",
1073
+ "text": "5.5 RNNS vs Textual Attack Methods",
1074
+ "text_level": 1,
1075
+ "bbox": [
1076
+ 507,
1077
+ 752,
1078
+ 821,
1079
+ 766
1080
+ ],
1081
+ "page_idx": 6
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "To compare the effects of RNNS and textual attack methods, We conducted attack experiments on three datasets using the PSO (Zang et al., 2020) and LSH (Maheshwary et al., 2021). The three datasets Defect, Authorship, and Java250, represent three languages respectively, C, Python, and Java. To be fair, the search space of the PSO and LSH is the same as that of RNNS.",
1086
+ "bbox": [
1087
+ 507,
1088
+ 774,
1089
+ 884,
1090
+ 901
1091
+ ],
1092
+ "page_idx": 6
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "As shown in Table 8, the QT of PSO algorithm",
1097
+ "bbox": [
1098
+ 527,
1099
+ 903,
1100
+ 880,
1101
+ 917
1102
+ ],
1103
+ "page_idx": 6
1104
+ },
1105
+ {
1106
+ "type": "page_number",
1107
+ "text": "9712",
1108
+ "bbox": [
1109
+ 480,
1110
+ 927,
1111
+ 519,
1112
+ 940
1113
+ ],
1114
+ "page_idx": 6
1115
+ },
1116
+ {
1117
+ "type": "table",
1118
+ "img_path": "images/cbe72181236b7b03ac2707b60e04bdf414d0b44d39c985b525b4408dbd2f25d7.jpg",
1119
+ "table_caption": [],
1120
+ "table_footnote": [],
1121
+ "table_body": "<table><tr><td rowspan=\"2\">Task</td><td colspan=\"3\">CodeBERT</td><td colspan=\"3\">GraphCodeBERT</td><td colspan=\"3\">CodeT5</td></tr><tr><td>RNNS</td><td>MHM</td><td>ALERT</td><td>RNNS</td><td>MHM</td><td>ALERT</td><td>RNNS</td><td>MHM</td><td>ALERT</td></tr><tr><td>Clone</td><td>3.55 ± 4.60</td><td>6.72 ± 16.57</td><td>6.86 ± 18.85</td><td>4.12 ± 4.94</td><td>6.21 ± 15.13</td><td>6.95 ± 18.99</td><td>3.43 ± 5.00</td><td>5.68 ± 14.01</td><td>7.65 ± 25.57</td></tr><tr><td>Defect</td><td>3.39 ± 4.96</td><td>2.78 ± 7.89</td><td>3.49 ± 3.99</td><td>2.67 ± 1.75</td><td>2.84 ± 9.50</td><td>4.10 ± 11.05</td><td>2.51 ± 1.45</td><td>2.16 ± 3.58</td><td>3.49 ± 3.99</td></tr><tr><td>Authorship</td><td>4.24 ± 7.47</td><td>7.52 ± 25.82</td><td>6.60 ± 22.96</td><td>3.65 ± 3.32</td><td>6.67 ± 22.29</td><td>7.75 ± 33.12</td><td>4.39 ± 9.00</td><td>5.72 ± 13.02</td><td>6.06 ± 18.74</td></tr><tr><td>Java250</td><td>3.87 ± 4.70</td><td>7.11 ± 21.18</td><td>7.82 ± 28.96</td><td>3.87 ± 4.25</td><td>6.41 ± 16.24</td><td>7.83 ± 25.06</td><td>4.71 ± 6.87</td><td>7.04 ± 15.29</td><td>8.92 ± 25.97</td></tr><tr><td>Python800</td><td>3.06 ± 1.87</td><td>5.21 ± 12.28</td><td>4.96 ± 8.47</td><td>4.12 ± 3.68</td><td>5.00 ± 10.83</td><td>4.63 ± 6.76</td><td>3.57 ± 3.04</td><td>5.29 ± 13.51</td><td>6.18 ± 11.45</td></tr><tr><td>C1000</td><td>3.00 ± 1.86</td><td>4.42 ± 7.49</td><td>4.13 ± 5.59</td><td>3.37 ± 2.38</td><td>5.14 ± 7.30</td><td>4.88 ± 6.24</td><td>3.39 ± 2.48</td><td>5.20 ± 7.43</td><td>5.43 ± 6.99</td></tr><tr><td>mean</td><td>3.52 ± 4.24</td><td>5.63 ± 15.21</td><td>5.65 ± 14.80</td><td>3.63 ± 3.39</td><td>5.38 ± 13.55</td><td>6.02 ± 16.87</td><td>3.67 ± 4.64</td><td>5.18 ± 11.14</td><td>6.29 ± 15.45</td></tr></table>",
1122
+ "bbox": [
1123
+ 129,
1124
+ 80,
1125
+ 867,
1126
+ 180
1127
+ ],
1128
+ "page_idx": 7
1129
+ },
1130
+ {
1131
+ "type": "table",
1132
+ "img_path": "images/4e8ab953e457c12148e74c5d4481000d71071bf77ba1781d8277c663e7ff9cea.jpg",
1133
+ "table_caption": [
1134
+ "Table 4: Replaced-variable number comparison, mean $\\pm$ variance"
1135
+ ],
1136
+ "table_footnote": [],
1137
+ "table_body": "<table><tr><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args)</td><td></td><td></td></tr><tr><td>Scanner obj = new Scanner(System.in);</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><tr><td>int a = obj.nextInt();</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><tr><td>int b = obj.nextInt();</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><tr><td>int out = 1;</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><tr><td>int ans = 0;</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><tr><td>while (out &lt; b) {</td><td>}</td><td>while (out &lt; h) {</td><td>}</td><td>}</td><td>while (tempOp &lt; colArr) {</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td></tr><tr><td>out--;</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><tr><td>out = out + a;</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><tr><td>ans++;</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><tr><td>}</td><td>}</td><td>System.out.println(ans);</td><td>}</td><td>}</td><td>System.out.println(number_array);</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td></tr><tr><td>Original Code</td><td>Adversarial Code from RNNS</td><td>Adversarial Code from MHM</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td></tr></table>",
1138
+ "bbox": [
1139
+ 129,
1140
+ 217,
1141
+ 860,
1142
+ 332
1143
+ ],
1144
+ "page_idx": 7
1145
+ },
1146
+ {
1147
+ "type": "table",
1148
+ "img_path": "images/771539b6beaf6d7585994be7cb1aeb67e9d57accf249b095eeaef2a5a545fe47.jpg",
1149
+ "table_caption": [
1150
+ "Figure 2: Case study. Original vs. RNNS vs. MHM vs. ALERT"
1151
+ ],
1152
+ "table_footnote": [],
1153
+ "table_body": "<table><tr><td rowspan=\"3\">Task</td><td colspan=\"4\">CodeBERT</td><td colspan=\"4\">GraphCodeBERT</td><td colspan=\"4\">CodeT5</td></tr><tr><td colspan=\"2\">RNNS-Unlimited</td><td colspan=\"2\">RNNS</td><td colspan=\"2\">RNNS-Unlimited</td><td colspan=\"2\">RNNS</td><td colspan=\"2\">RNNS-Unlimited</td><td colspan=\"2\">RNNS</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Defect</td><td>72.29</td><td>590.98</td><td>69.18</td><td>588.35</td><td>87.77</td><td>381.82</td><td>81.63</td><td>404.73</td><td>91.64</td><td>338.41</td><td>89.45</td><td>344.29</td></tr><tr><td>Clone</td><td>50.66</td><td>955.97</td><td>46.50</td><td>666.48</td><td>48.16</td><td>1105.11</td><td>41.28</td><td>1122.01</td><td>41.38</td><td>920.65</td><td>39.61</td><td>895.79</td></tr><tr><td>Authorship</td><td>91.74</td><td>447.68</td><td>73.39</td><td>1029.59</td><td>91.17</td><td>438.69</td><td>80.39</td><td>696.64</td><td>88.88</td><td>620.56</td><td>71.79</td><td>970.44</td></tr><tr><td>C1000</td><td>74.70</td><td>502.02</td><td>72.96</td><td>537.76</td><td>76.82</td><td>498.64</td><td>72.23</td><td>634.27</td><td>61.96</td><td>704.95</td><td>59.00</td><td>697.06</td></tr><tr><td>Python800</td><td>83.90</td><td>460.92</td><td>77.88</td><td>514.19</td><td>79.00</td><td>496.30</td><td>71.42</td><td>730.14</td><td>72.69</td><td>646.59</td><td>69.07</td><td>662.28</td></tr><tr><td>Java250</td><td>79.70</td><td>760.97</td><td>75.12</td><td>815.91</td><td>81.94</td><td>744.57</td><td>72.30</td><td>853.74</td><td>75.52</td><td>910.97</td><td>63.80</td><td>1049.46</td></tr><tr><td>Count</td><td>6/6</td><td>4/6</td><td>0/6</td><td>2/6</td><td>6/6</td><td>6/6</td><td>0/6</td><td>0/6</td><td>6/6</td><td>5/6</td><td>0/6</td><td>1/6</td></tr></table>",
1154
+ "bbox": [
1155
+ 154,
1156
+ 376,
1157
+ 842,
1158
+ 495
1159
+ ],
1160
+ "page_idx": 7
1161
+ },
1162
+ {
1163
+ "type": "table",
1164
+ "img_path": "images/7860bc92b68fbb77ab00f2beece6397a0ec64ac8885eb875e9adf450ed8b2bc2.jpg",
1165
+ "table_caption": [
1166
+ "Table 5: Results of ablation study, before and after removing constraints, ASR %."
1167
+ ],
1168
+ "table_footnote": [],
1169
+ "table_body": "<table><tr><td rowspan=\"2\">Defended Model</td><td colspan=\"2\">RNNS</td><td colspan=\"2\">MHM</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Clone+CodeBert</td><td>12.90</td><td>958.35</td><td>28.17</td><td>1245.75</td></tr><tr><td>Defect+CodeBert</td><td>95.37</td><td>282.20</td><td>92.23</td><td>283.66</td></tr><tr><td>Authorship+CodeBert</td><td>51.88</td><td>1524.40</td><td>43.26</td><td>1026.08</td></tr></table>",
1170
+ "bbox": [
1171
+ 137,
1172
+ 533,
1173
+ 467,
1174
+ 594
1175
+ ],
1176
+ "page_idx": 7
1177
+ },
1178
+ {
1179
+ "type": "table",
1180
+ "img_path": "images/206b7875bdf32f367983f1f679ef90c30f57bb0719d1fb24d992aca8532fb2eb.jpg",
1181
+ "table_caption": [
1182
+ "Table 6: Attack defended models, ASR %."
1183
+ ],
1184
+ "table_footnote": [],
1185
+ "table_body": "<table><tr><td></td><td>ACC</td><td>ASR(RNNS)</td><td>ASR(MHM)</td><td>ASR(ALERT)</td></tr><tr><td>Authorship</td><td>90.62</td><td>19.81</td><td>23.58</td><td>14.28</td></tr><tr><td>Defect</td><td>65.14</td><td>40.46</td><td>23.69</td><td>24.53</td></tr><tr><td>Java250</td><td>97.63</td><td>19.67</td><td>6.65</td><td>42.91</td></tr></table>",
1186
+ "bbox": [
1187
+ 117,
1188
+ 630,
1189
+ 489,
1190
+ 678
1191
+ ],
1192
+ "page_idx": 7
1193
+ },
1194
+ {
1195
+ "type": "text",
1196
+ "text": "is 4.22-6.7 times that of RNNS, and the ASR of PSQ algorithm is $5.55\\% - 27.82\\%$ lower than that of RNNS algorithm. It can be inferred that for code variable attacks, combinatorial optimization is inefficient when the substitute set of variables is relatively large. The main reasons are the following two points. Firstly, code segments are generally longer, and the substitute set of code variables is much larger than the synonym set of natural language words. Secondly, the impact of variable replacement on code semantics is smaller than that",
1197
+ "bbox": [
1198
+ 112,
1199
+ 741,
1200
+ 487,
1201
+ 917
1202
+ ],
1203
+ "page_idx": 7
1204
+ },
1205
+ {
1206
+ "type": "table",
1207
+ "img_path": "images/1bc38d7614c0281243716bf757f4a186790439153b00aace795c5a254f5daba8.jpg",
1208
+ "table_caption": [
1209
+ "Table 7: Results of contrastive adversarial retraining, model: CodeBERT."
1210
+ ],
1211
+ "table_footnote": [],
1212
+ "table_body": "<table><tr><td rowspan=\"2\">Task+Model</td><td colspan=\"2\">RNNS</td><td colspan=\"2\">PSO</td><td colspan=\"2\">LSH</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Defect+CodeBert</td><td>69.18</td><td>588.35</td><td>63.63</td><td>3945.04</td><td>26.62</td><td>321.78</td></tr><tr><td>Authorship+CodeBert</td><td>73.39</td><td>1029.59</td><td>52.29</td><td>4350.00</td><td>19.26</td><td>458.55</td></tr><tr><td>Java250+CodeBert</td><td>75.12</td><td>815.91</td><td>47.3</td><td>5076.02</td><td>31.58</td><td>397.05</td></tr></table>",
1213
+ "bbox": [
1214
+ 515,
1215
+ 533,
1216
+ 878,
1217
+ 586
1218
+ ],
1219
+ "page_idx": 7
1220
+ },
1221
+ {
1222
+ "type": "text",
1223
+ "text": "Table 8: RNNS vs PSO and LSH, ASR %.",
1224
+ "bbox": [
1225
+ 549,
1226
+ 596,
1227
+ 838,
1228
+ 609
1229
+ ],
1230
+ "page_idx": 7
1231
+ },
1232
+ {
1233
+ "type": "text",
1234
+ "text": "of word replacement on natural language semantics.",
1235
+ "bbox": [
1236
+ 507,
1237
+ 623,
1238
+ 882,
1239
+ 639
1240
+ ],
1241
+ "page_idx": 7
1242
+ },
1243
+ {
1244
+ "type": "text",
1245
+ "text": "RNNS's QT is 1.8-2.2 times that of LSH, and the QT has dropped significantly. However, LSH's ASR is inferior to RNNS by $42.56\\% - 54.13\\%$ . For code variable attacks, LSH has high efficiency, but its effectiveness is relatively low. One possible reason for LSH causing low ASR is the distribution of adversarial samples in each bucket is uneven.",
1246
+ "bbox": [
1247
+ 507,
1248
+ 655,
1249
+ 882,
1250
+ 766
1251
+ ],
1252
+ "page_idx": 7
1253
+ },
1254
+ {
1255
+ "type": "text",
1256
+ "text": "6 Related Work",
1257
+ "text_level": 1,
1258
+ "bbox": [
1259
+ 507,
1260
+ 780,
1261
+ 665,
1262
+ 795
1263
+ ],
1264
+ "page_idx": 7
1265
+ },
1266
+ {
1267
+ "type": "text",
1268
+ "text": "Adversarial attacks for code models have been widely studied (Yang et al., 2022; Liu et al., 2023a; Li et al., 2023; Jha and Reddy, 2023). These works can be generally categorized into black-box attacks and white-box attacks. A black-box attack for code models queries the model outputs and selects the substitutes using a score function. For example,",
1269
+ "bbox": [
1270
+ 505,
1271
+ 806,
1272
+ 882,
1273
+ 917
1274
+ ],
1275
+ "page_idx": 7
1276
+ },
1277
+ {
1278
+ "type": "page_number",
1279
+ "text": "9713",
1280
+ "bbox": [
1281
+ 480,
1282
+ 927,
1283
+ 519,
1284
+ 940
1285
+ ],
1286
+ "page_idx": 7
1287
+ },
1288
+ {
1289
+ "type": "table",
1290
+ "img_path": "images/771b4e0040f235590205eb87e09d7749767d61c59325e1d876bb32b805c7b3f4.jpg",
1291
+ "table_caption": [],
1292
+ "table_footnote": [],
1293
+ "table_body": "<table><tr><td>Algorithm</td><td>Substitutes Size</td><td>Substitutes Source</td><td>Replacement Position</td><td>Substitutes Selection</td></tr><tr><td>MHM</td><td>medium</td><td>vocabulary</td><td>random</td><td>random sample</td></tr><tr><td>ALERT</td><td>small</td><td>model generation</td><td>importance score</td><td>traverse</td></tr><tr><td>RNNS</td><td>large</td><td>real public variables</td><td>uncertainty score</td><td>efficient constrained search</td></tr></table>",
1294
+ "bbox": [
1295
+ 144,
1296
+ 80,
1297
+ 458,
1298
+ 171
1299
+ ],
1300
+ "page_idx": 8
1301
+ },
1302
+ {
1303
+ "type": "text",
1304
+ "text": "Table 9: Difference between RNNS to the others.",
1305
+ "bbox": [
1306
+ 129,
1307
+ 181,
1308
+ 467,
1309
+ 193
1310
+ ],
1311
+ "page_idx": 8
1312
+ },
1313
+ {
1314
+ "type": "text",
1315
+ "text": "ALERT (Yang et al., 2022) finds the adversarial examples using variable-name substitutes generated by pre-trained masked models. MHM (Zhang et al., 2020) uses Metropolis-Hastings to sample the replacement of code identifiers. STRATA (Springer et al., 2020) generates adversarial examples by replacing the code tokens based on the token distribution. Chen et al. (2022) apply pre-defined semantics-preserving code transformations to attack code models. CodeAttack (Jha and Reddy, 2023) uses code structure to generate adversarial data. White-box attacks require the code model gradient to modify inputs for adversarial example generation. CARROT (Zhang et al., 2022) selects code mutated variants based on the model gradient. Henkel et al. (2022) attack code models by gradient-based optimization of the abstract syntax tree transformation. Srikant et al. (2021) uses optimized program obfuscations to modify the code. DAMP (Yefet et al., 2020) derives the desired wrong prediction by changing inputs guided by the model gradient.",
1316
+ "bbox": [
1317
+ 115,
1318
+ 206,
1319
+ 489,
1320
+ 558
1321
+ ],
1322
+ "page_idx": 8
1323
+ },
1324
+ {
1325
+ "type": "text",
1326
+ "text": "Table 9 demonstrates the differences among RNNS, MHM (Zhang et al., 2020) and ALERT (Yang et al., 2022). MHM and ALERT represent the two methodologies most closely aligned with our research. Our approach considers identifier replacements like MHM and ALERT, ensuring that the adversarial example keeps the same semantics as the original one. Our substitute size is scalable and can be substantial, and RNNS searches the possible next adversarial example in the substitute space. In our approach, we locate vulnerable variables based on the uncertainty and search $\\text{sub}_{\\text{topk}}$ without building adversarial samples and actual attacks. Our goal is to obtain high ASRs by searching real variable names. MHM has the same goal as ours but synthesizes variable names. ALERT sacrifices ASR to make the variable name readable.",
1327
+ "bbox": [
1328
+ 115,
1329
+ 561,
1330
+ 485,
1331
+ 848
1332
+ ],
1333
+ "page_idx": 8
1334
+ },
1335
+ {
1336
+ "type": "text",
1337
+ "text": "7 Conclusion",
1338
+ "text_level": 1,
1339
+ "bbox": [
1340
+ 112,
1341
+ 862,
1342
+ 243,
1343
+ 876
1344
+ ],
1345
+ "page_idx": 8
1346
+ },
1347
+ {
1348
+ "type": "text",
1349
+ "text": "We propose a novel black-box adversarial search-based attack for variable replacement. RNNS has",
1350
+ "bbox": [
1351
+ 112,
1352
+ 887,
1353
+ 487,
1354
+ 917
1355
+ ],
1356
+ "page_idx": 8
1357
+ },
1358
+ {
1359
+ "type": "text",
1360
+ "text": "three main contributions: 1) This work proposes a non-generation search-based black-box attacking method via predicting the attack effect of a substitute. This method can greatly reduce the verification cost of the substitute, remove the restrictions on the size and diversity of the substitute set, and achieve a significant improvement in terms of ASR without increasing QT. 2) This work proposes a simple and efficient method for constructing a substitute set. This method can construct a large-scale, diverse, and real substitute set at low cost. 3) The adversarial examples from RNNS can be used to improve the model robustness.",
1361
+ "bbox": [
1362
+ 507,
1363
+ 84,
1364
+ 882,
1365
+ 292
1366
+ ],
1367
+ "page_idx": 8
1368
+ },
1369
+ {
1370
+ "type": "text",
1371
+ "text": "8 Limitations",
1372
+ "text_level": 1,
1373
+ "bbox": [
1374
+ 507,
1375
+ 307,
1376
+ 643,
1377
+ 321
1378
+ ],
1379
+ "page_idx": 8
1380
+ },
1381
+ {
1382
+ "type": "text",
1383
+ "text": "There are some limitations of RNNS. Firstly, RNNS does not revert to the preceding step to persist with the search upon an increase in the model probability of the ground truth label. While the incorporation of this step may bolster the Attack Success Rate (ASR), it could potentially compromise the Query Time (QT). Secondly, the size and diversity of the substitute set significantly influence RNNS; a minimal and homogeneous set can precipitate a diminished attack success rate. Thirdly, RNNS involves multiple hyperparameters whose values need to be manually set. One of the most important parameters is the moving parameter $\\alpha$ . The number of attacking iterations max itr is also significant. We set $\\alpha$ to 0.2 and max itr to 6 with some small experimental trials. Fourthly, RNNS currently only targets untargeted attack scenarios, for targeted attacks, ASR will be very low when there are many category labels. For example, when performing targeted attacks on Authorship+Codebert with 66 labels, the ASR can only reach $6.4\\%$ . How to migrate to targeted attacks is a direction we need to study in the future.",
1384
+ "bbox": [
1385
+ 507,
1386
+ 332,
1387
+ 882,
1388
+ 702
1389
+ ],
1390
+ "page_idx": 8
1391
+ },
1392
+ {
1393
+ "type": "text",
1394
+ "text": "Acknowledgment",
1395
+ "text_level": 1,
1396
+ "bbox": [
1397
+ 509,
1398
+ 715,
1399
+ 663,
1400
+ 732
1401
+ ],
1402
+ "page_idx": 8
1403
+ },
1404
+ {
1405
+ "type": "text",
1406
+ "text": "This work is supported by NRF and the CSA under its National Cybersecurity R&D Programme (NCRP25-P04-TAICeN), NRF and DSO National Laboratories under the AI Singapore Programme (AISG Award No: AISG2-RP-2020-019), and NRF Investigatorship NRF-NRFI06-2020-0001. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of NRF and CSA Singapore.",
1407
+ "bbox": [
1408
+ 507,
1409
+ 741,
1410
+ 882,
1411
+ 903
1412
+ ],
1413
+ "page_idx": 8
1414
+ },
1415
+ {
1416
+ "type": "page_number",
1417
+ "text": "9714",
1418
+ "bbox": [
1419
+ 480,
1420
+ 928,
1421
+ 519,
1422
+ 940
1423
+ ],
1424
+ "page_idx": 8
1425
+ },
1426
+ {
1427
+ "type": "text",
1428
+ "text": "References",
1429
+ "text_level": 1,
1430
+ "bbox": [
1431
+ 115,
1432
+ 84,
1433
+ 213,
1434
+ 98
1435
+ ],
1436
+ "page_idx": 9
1437
+ },
1438
+ {
1439
+ "type": "list",
1440
+ "sub_type": "ref_text",
1441
+ "list_items": [
1442
+ "Wasi Ahmad, Saikat Chakraborty, Baishakhi Ray, and Kai-Wei Chang. 2020. A transformer-based approach for source code summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4998-5007.",
1443
+ "Bander Alsulami, Edwin Dauber, Richard Harang, Spiros Mancoridis, and Rachel Greenstadt. 2017. Source code authorship attribution using long short-term memory based networks. In Computer Security - ESORICS 2017, pages 65-82, Cham. Springer International Publishing.",
1444
+ "Penglong Chen, Zhen Li, Yu Wen, and Lili Liu. 2022. Generating adversarial source programs using important tokens-based structural transformations. In 2022 26th International Conference on Engineering of Complex Computer Systems (ICECCS), pages 173-182.",
1445
+ "Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. 2020. Codebert: A pre-trained model for programming and natural languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1536-1547.",
1446
+ "Xiaodong Gu, Hongyu Zhang, and Sunghun Kim. 2018. Deep code search. In 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE), pages 933-944. IEEE.",
1447
+ "Daya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng, Duyu Tang, LIU Shujie, Long Zhou, Nan Duan, Alexey Svyatkovskiy, Shengyu Fu, et al. 2020. Graphcodebert: Pre-training code representations with data flow. In International Conference on Learning Representations.",
1448
+ "Jordan Henkel, Goutham Ramakrishnan, Zi Wang, Aws Albarghouthi, Somesh Jha, and Thomas Reps. 2022. Semantic robustness of models of source code. In 2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER), pages 526-537.",
1449
+ "Akshita Jha and Chandan K Reddy. 2023. Codeattack: Code-based adversarial attacks for pre-trained programming language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 14892-14900.",
1450
+ "Liuqing Li, He Feng, Wenjie Zhuang, Na Meng, and Barbara Ryder. 2017. Cclearner: A deep learning-based clone detection approach. In 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME), pages 249-260. IEEE.",
1451
+ "Yanzhou Li, Shangqing Liu, Kangjie Chen, Xiaofei Xie, Tianwei Zhang, and Yang Liu. 2023. Multi-target backdoor attacks for code pre-trained models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7236-7254, Toronto, Canada. Association for Computational Linguistics."
1452
+ ],
1453
+ "bbox": [
1454
+ 115,
1455
+ 105,
1456
+ 487,
1457
+ 917
1458
+ ],
1459
+ "page_idx": 9
1460
+ },
1461
+ {
1462
+ "type": "list",
1463
+ "sub_type": "ref_text",
1464
+ "list_items": [
1465
+ "Yaoxian Li, Shiyi Qi, Cuiyun Gao, Yun Peng, David Lo, Zenglin Xu, and Michael R Lyu. 2022. A closer look into transformer-based code intelligence through code transformation: Challenges and opportunities. arXiv preprint arXiv:2207.04285.",
1466
+ "Shangqing Liu, Yu Chen, Xiaofei Xie, Jing Kai Siow, and Yang Liu. 2020. Retrieval-augmented generation for code summarization via hybrid gnn. In International Conference on Learning Representations.",
1467
+ "Shangqing Liu, Bozhi Wu, Xiaofei Xie, Guozhu Meng, and Yang Liu. 2023a. Contrabert: Enhancing code pre-trained models via contrastive learning. In 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE), pages 2476-2487.",
1468
+ "Shangqing Liu, Xiaofei Xie, Jingkai Siow, Lei Ma, Guozhu Meng, and Yang Liu. 2023b. Graphsearch-net: Enhancing gnns via capturing global dependencies for semantic code search. IEEE Transactions on Software Engineering.",
1469
+ "Rishabh Maheshwary, Saket Maheshwary, and Vikram Pudi. 2021. A strong baseline for query efficient attacks in a black box setting. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8396-8409.",
1470
+ "Ruchir Puri, David Kung, Geert Janssen, Wei Zhang, Giacomo Domeniconi, Vladimir Zolotov, Julian Dolby, Jie Chen, Mihir Choudhury, Lindsey Decker, Veronika Thost, Luca Buratti, Saurabh Pajar, Shyam Ramji, Ulrich Finkler, Susan Malaika, and Frederick Reiss. 2021. Codenet: A large-scale ai for code dataset for learning a diversity of coding tasks.",
1471
+ "Jacob M Springer, Bryn Marie Reinstadler, and Una-May O'Reilly. 2020. Strata: Simple, gradient-free attacks for models of code. arXiv preprint arXiv:2009.13562.",
1472
+ "Shashank Srikant, Sijia Liu, Tamara Mitrovska, Shiyu Chang, Quanfu Fan, Gaoyuan Zhang, and Una-May O'Reilly. 2021. Generating adversarial computer programs using optimized obfuscations. In International Conference on Learning Representations.",
1473
+ "Wenhan Wang, Ge Li, Bo Ma, Xin Xia, and Zhi Jin. 2020. Detecting code clones with graph neural network and flow-augmented abstract syntax tree. In 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER), pages 261-271. IEEE.",
1474
+ "Yue Wang, Weishi Wang, Shafiq Joty, and Steven C.H. Hoi. 2021. CodeT5: Identifier-aware unified pretrained encoder-decoder models for code understanding and generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8696-8708, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics."
1475
+ ],
1476
+ "bbox": [
1477
+ 510,
1478
+ 85,
1479
+ 880,
1480
+ 917
1481
+ ],
1482
+ "page_idx": 9
1483
+ },
1484
+ {
1485
+ "type": "page_number",
1486
+ "text": "9715",
1487
+ "bbox": [
1488
+ 480,
1489
+ 928,
1490
+ 519,
1491
+ 940
1492
+ ],
1493
+ "page_idx": 9
1494
+ },
1495
+ {
1496
+ "type": "list",
1497
+ "sub_type": "ref_text",
1498
+ "list_items": [
1499
+ "Martin White, Michele Tufano, Christopher Vendome, and Denys Poshyvanyk. 2016. Deep learning code fragments for code clone detection. In 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 87-98. IEEE.",
1500
+ "Zhou Yang, Jieke Shi, Junda He, and David Lo. 2022. Natural attack for pre-trained models of code. In Proceedings of the 44th International Conference on Software Engineering, ICSE '22, page 1482-1493, New York, NY, USA. Association for Computing Machinery.",
1501
+ "Noam Yefet, Uri Alon, and Eran Yahav. 2020. Adversarial examples for models of code. Proceedings of the ACM on Programming Languages, 4(OOPSLA):1-30.",
1502
+ "Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020. Word-level textual adversarial attacking as combinatorial optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6066-6080.",
1503
+ "Huangzhao Zhang, Zhiyi Fu, Ge Li, Lei Ma, Zhehao Zhao, Hua'an Yang, Yizhe Sun, Yang Liu, and Zhi Jin. 2022. Towards robustness of deep program processing models—detection, estimation, and enhancement. ACM Trans. Softw. Eng. Methodol., 31(3).",
1504
+ "Huangzhao Zhang, Zhuo Li, Ge Li, Lei Ma, Yang Liu, and Zhi Jin. 2020. Generating adversarial examples for holding robustness of source code processing models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1169-1176.",
1505
+ "Vitalii Zhelezniak, Aleksandar Savkov, and Nils Hammerla. 2020. Estimating mutual information between dense word embeddings. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8361-8371, Online. Association for Computational Linguistics.",
1506
+ "Yaqin Zhou, Shangqing Liu, Jingkai Siow, Xiaoning Du, and Yang Liu. 2019. Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks. Advances in neural information processing systems, 32."
1507
+ ],
1508
+ "bbox": [
1509
+ 115,
1510
+ 85,
1511
+ 485,
1512
+ 707
1513
+ ],
1514
+ "page_idx": 10
1515
+ },
1516
+ {
1517
+ "type": "page_number",
1518
+ "text": "9716",
1519
+ "bbox": [
1520
+ 480,
1521
+ 928,
1522
+ 519,
1523
+ 940
1524
+ ],
1525
+ "page_idx": 10
1526
+ }
1527
+ ]
2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/21af0af7-6fd8-4600-8ad6-54b767b85a85_model.json ADDED
@@ -0,0 +1,1828 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ [
3
+ {
4
+ "type": "title",
5
+ "bbox": [
6
+ 0.115,
7
+ 0.084,
8
+ 0.885,
9
+ 0.123
10
+ ],
11
+ "angle": 0,
12
+ "content": "A Black-Box Attack on Code Models via Representation Nearest Neighbor Search"
13
+ },
14
+ {
15
+ "type": "text",
16
+ "bbox": [
17
+ 0.11,
18
+ 0.133,
19
+ 0.893,
20
+ 0.152
21
+ ],
22
+ "angle": 0,
23
+ "content": "Jie Zhang\\(^{1*}\\), Wei Ma\\(^{2\\dagger}\\), Qiang Hu\\(^{3}\\), Shangqing Liu\\(^{2}\\), Xiaofei Xie\\(^{4}\\), Yves Le Traon\\(^{3}\\), and Yang Liu\\(^{2}\\)"
24
+ },
25
+ {
26
+ "type": "text",
27
+ "bbox": [
28
+ 0.394,
29
+ 0.163,
30
+ 0.61,
31
+ 0.179
32
+ ],
33
+ "angle": 0,
34
+ "content": "<sup>1</sup>Noah's Ark Lab, Huawei"
35
+ },
36
+ {
37
+ "type": "text",
38
+ "bbox": [
39
+ 0.162,
40
+ 0.18,
41
+ 0.837,
42
+ 0.197
43
+ ],
44
+ "angle": 0,
45
+ "content": "\\(^{2}\\)School of Computer Science and Engineering, Nanyang Technological University"
46
+ },
47
+ {
48
+ "type": "text",
49
+ "bbox": [
50
+ 0.132,
51
+ 0.197,
52
+ 0.871,
53
+ 0.214
54
+ ],
55
+ "angle": 0,
56
+ "content": "<sup>3</sup>The Interdisciplinary Centre for Security, Reliability and Trust, University of Luxembourg"
57
+ },
58
+ {
59
+ "type": "text",
60
+ "bbox": [
61
+ 0.158,
62
+ 0.214,
63
+ 0.843,
64
+ 0.231
65
+ ],
66
+ "angle": 0,
67
+ "content": "\\(^{4}\\)School of Computing and Information Systems, Singapore Management University"
68
+ },
69
+ {
70
+ "type": "title",
71
+ "bbox": [
72
+ 0.261,
73
+ 0.253,
74
+ 0.343,
75
+ 0.269
76
+ ],
77
+ "angle": 0,
78
+ "content": "Abstract"
79
+ },
80
+ {
81
+ "type": "text",
82
+ "bbox": [
83
+ 0.144,
84
+ 0.279,
85
+ 0.461,
86
+ 0.691
87
+ ],
88
+ "angle": 0,
89
+ "content": "Existing methods for generating adversarial code examples face several challenges: limited availability of substitute variables, high verification costs for these substitutes, and the creation of adversarial samples with noticeable perturbations. To address these concerns, our proposed approach, RNNS, uses a search seed based on historical attacks to find potential adversarial substitutes. Rather than directly using the discrete substitutes, they are mapped to a continuous vector space using a pre-trained variable name encoder. Based on the vector representation, RNNS predicts and selects better substitutes for attacks. We evaluated the performance of RNNS across six coding tasks encompassing three programming languages: Java, Python, and C. We employed three pre-trained code models (CodeBERT, GraphCodeBERT, and CodeT5) that resulted in a cumulative of 18 victim models. The results demonstrate that RNNS outperforms baselines in terms of ASR and QT. Furthermore, the perturbation of adversarial examples introduced by RNNS is smaller compared to the baselines in terms of the number of replaced variables and the change in variable length. Lastly, our experiments indicate that RNNS is efficient in attacking defended models and can be employed for adversarial training."
90
+ },
91
+ {
92
+ "type": "title",
93
+ "bbox": [
94
+ 0.115,
95
+ 0.701,
96
+ 0.262,
97
+ 0.716
98
+ ],
99
+ "angle": 0,
100
+ "content": "1 Introduction"
101
+ },
102
+ {
103
+ "type": "text",
104
+ "bbox": [
105
+ 0.113,
106
+ 0.726,
107
+ 0.491,
108
+ 0.887
109
+ ],
110
+ "angle": 0,
111
+ "content": "Recently, since programming language can be seen as one kind of textual data and also inspired by the success of deep learning for text processing and understanding, researchers have tried to pretrain code models such as CodeBERT (Feng et al., 2020), GraphCodeBERT (Guo et al., 2020), ContrabERT (Liu et al., 2023a) to help developers to solve multiple programming tasks, e.g., code search (Gu et al., 2018; Liu et al., 2023b), code clone detection (White et al., 2016; Li et al., 2017), code sum"
112
+ },
113
+ {
114
+ "type": "text",
115
+ "bbox": [
116
+ 0.508,
117
+ 0.254,
118
+ 0.886,
119
+ 0.365
120
+ ],
121
+ "angle": 0,
122
+ "content": "marization (Ahmad et al., 2020; Liu et al., 2020), and vulnerability detection (Zhou et al., 2019). Although these code models have achieved good performance on many code tasks, they are still suffering from robustness issues. A few adversarial attack methods have emerged to evaluate and improve the robustness of code models."
123
+ },
124
+ {
125
+ "type": "text",
126
+ "bbox": [
127
+ 0.508,
128
+ 0.369,
129
+ 0.886,
130
+ 0.595
131
+ ],
132
+ "angle": 0,
133
+ "content": "There are certain considerations to be made. Firstly, code pre-training models are frequently deployed remotely, which limits access to the model parameters and renders white-box attacks infeasible. Secondly, among the numerous code-equivalent transformation methods, variable substitution exerts the most significant influence on the resilience of large code models while being the least detectable transformation (Li et al., 2022). As a result, black-box attack techniques based on variable substitution have emerged as a valuable avenue for research and multiple works have been proposed such as ALERT (Yang et al., 2022) and MHM (Zhang et al., 2020)."
134
+ },
135
+ {
136
+ "type": "text",
137
+ "bbox": [
138
+ 0.508,
139
+ 0.598,
140
+ 0.886,
141
+ 0.921
142
+ ],
143
+ "angle": 0,
144
+ "content": "However, these works have three limitations: 1) The number of substitute variables is limited and lacks diversity, which lowers the upper bound of the attack success rate. For example, ALERT employs 60 substitute variables for each variable, which are generated by a pre-trained model, and the substitute variables lack diversity. MHM also randomly selects 1500 words from a fixed dictionary as substitute variables. 2) The verification cost of substitute variables is high. To verify the attack effect of each substitute, it is necessary to replace the source variable with an adversarial sample and perform an actual attack on the victim model. ALERT uses a traversal method to select substitute variables, and in order to reduce the number of attacks, it limits the number of substitute variables; MHM uses a random sampling method to select substitute variables in order to reduce the number of attacks. Neither method is conducive to cost-effective attacks. 3) The generated adversarial samples have"
145
+ },
146
+ {
147
+ "type": "page_footnote",
148
+ "bbox": [
149
+ 0.141,
150
+ 0.892,
151
+ 0.312,
152
+ 0.905
153
+ ],
154
+ "angle": 0,
155
+ "content": "* clark.zhang@huawei.com"
156
+ },
157
+ {
158
+ "type": "page_footnote",
159
+ "bbox": [
160
+ 0.141,
161
+ 0.905,
162
+ 0.417,
163
+ 0.919
164
+ ],
165
+ "angle": 0,
166
+ "content": "† corresponding author: ma_wei@ntu.edu.sg"
167
+ },
168
+ {
169
+ "type": "list",
170
+ "bbox": [
171
+ 0.141,
172
+ 0.892,
173
+ 0.417,
174
+ 0.919
175
+ ],
176
+ "angle": 0,
177
+ "content": null
178
+ },
179
+ {
180
+ "type": "page_number",
181
+ "bbox": [
182
+ 0.48,
183
+ 0.928,
184
+ 0.522,
185
+ 0.941
186
+ ],
187
+ "angle": 0,
188
+ "content": "9706"
189
+ },
190
+ {
191
+ "type": "footer",
192
+ "bbox": [
193
+ 0.218,
194
+ 0.946,
195
+ 0.781,
196
+ 0.973
197
+ ],
198
+ "angle": 0,
199
+ "content": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 9706-9716 December 6-10, 2023 ©2023 Association for Computational Linguistics"
200
+ }
201
+ ],
202
+ [
203
+ {
204
+ "type": "text",
205
+ "bbox": [
206
+ 0.113,
207
+ 0.085,
208
+ 0.489,
209
+ 0.163
210
+ ],
211
+ "angle": 0,
212
+ "content": "large perturbations. Each adversarial sample usually needs to replace multiple original variables to succeed in attacking, and MHM easily generates semantically incoherent and excessively long variable names."
213
+ },
214
+ {
215
+ "type": "text",
216
+ "bbox": [
217
+ 0.117,
218
+ 0.166,
219
+ 0.49,
220
+ 0.502
221
+ ],
222
+ "angle": 0,
223
+ "content": "To address the aforementioned challenges, in this paper, we propose a search-based black-box adversarial attack method to create challenging adversarial samples based on the search seed vector in the variable representation space, namely Representation Nearest Neighbor Search (RNNS). Specifically, RNNS, first utilizes publicly available real code datasets to construct a large original substitute set, denoted as \\( subs_{original} \\). Then, based on the previous attack results, RNNS predicts the search seed vector required for the next round of attacks and efficiently searches for the \\( k \\) nearest substitutes to the seed vector from the large-scale original substitute set to form the \\( subs_{topk} \\), where \\( k \\) is much smaller than the size of the original substitute set. The generation process of the \\( subs_{topk} \\) does not involve attacking the victim model even once. Furthermore, the length and similarity of the substitute must adhere to specific perturbation constraints to prevent excessive deviations from \\( var \\)."
224
+ },
225
+ {
226
+ "type": "text",
227
+ "bbox": [
228
+ 0.117,
229
+ 0.505,
230
+ 0.49,
231
+ 0.826
232
+ ],
233
+ "angle": 0,
234
+ "content": "To evaluate the effectiveness of RNNS, we investigate three pre-trained code models, CodeBERT (Feng et al., 2020), GraphCodeBERT (Guo et al., 2020) and CodeT5 (Wang et al., 2021), and perform the attack on six code tasks in three programming languages, i.e., Java, Python, and C. The results on 18 victim models demonstrate that compared to the approaches MHM and ALERT, RNNS achieves a higher attack success rate (ASR) with a maximum of about \\(100\\%\\) improvement and 18/18 times as the winner. Meanwhile, RNNS needs fewer query times (QT) with 8/18 times as the winners. Furthermore, we analyze the quality of adversarial examples statistically and find that RNNS introduces minor perturbations. In the end, we apply RNNS to attack three defended models and find that our approach outperforms the baselines by up to \\(32.07\\%\\) ASR. We also use adversarial examples to improve the model's robustness through contrastive adversarial training."
235
+ },
236
+ {
237
+ "type": "title",
238
+ "bbox": [
239
+ 0.114,
240
+ 0.839,
241
+ 0.267,
242
+ 0.854
243
+ ],
244
+ "angle": 0,
245
+ "content": "2 Preliminaries"
246
+ },
247
+ {
248
+ "type": "title",
249
+ "bbox": [
250
+ 0.114,
251
+ 0.866,
252
+ 0.353,
253
+ 0.882
254
+ ],
255
+ "angle": 0,
256
+ "content": "2.1 Textual Code Processing"
257
+ },
258
+ {
259
+ "type": "text",
260
+ "bbox": [
261
+ 0.113,
262
+ 0.888,
263
+ 0.49,
264
+ 0.919
265
+ ],
266
+ "angle": 0,
267
+ "content": "The nature of code data (in text format with discrete input space) makes it impossible to feed one"
268
+ },
269
+ {
270
+ "type": "equation",
271
+ "bbox": [
272
+ 0.514,
273
+ 0.089,
274
+ 0.888,
275
+ 0.187
276
+ ],
277
+ "angle": 0,
278
+ "content": "\\[\n\\begin{array}{c c} x = \\left( \\begin{array}{c} S _ {0} \\\\ ... \\\\ S _ {i} \\\\ ... \\\\ S _ {j} \\\\ ... \\\\ S _ {l} \\end{array} \\right) \\longrightarrow R ^ {l \\times d} = \\left( \\begin{array}{c} \\boldsymbol {v} _ {0} \\\\ ... \\\\ \\boldsymbol {v} _ {i} \\\\ ... \\\\ \\boldsymbol {v} _ {j} \\\\ ... \\\\ \\boldsymbol {v} _ {l} \\end{array} \\right) \\longrightarrow \\boxed {f (\\theta)} \\\\ \\text {M o d e l} & \\longrightarrow \\left( \\begin{array}{c} p _ {0} \\\\ ... \\\\ p _ {g} \\\\ ... \\\\ p _ {k} \\end{array} \\right) \\\\ \\text {D o m a i n P r o b a b i l i t y} \\\\ \\text {S p a c e} & \\text {S p a c e} \\end{array}\n\\]"
279
+ },
280
+ {
281
+ "type": "image_caption",
282
+ "bbox": [
283
+ 0.508,
284
+ 0.205,
285
+ 0.883,
286
+ 0.232
287
+ ],
288
+ "angle": 0,
289
+ "content": "Figure 1: One code model demo on the downstream task."
290
+ },
291
+ {
292
+ "type": "text",
293
+ "bbox": [
294
+ 0.508,
295
+ 0.24,
296
+ 0.885,
297
+ 0.609
298
+ ],
299
+ "angle": 0,
300
+ "content": "code input \\( x \\) directly into deep learning models. Thus, transferring code data to learnable continuous vectors is the first step in source code learning. Dense encoding (Zhelezniak et al., 2020) is one common method used to vectorize textual code data. To do so, first, we need to learn a tokenizer that splits the code text into a token sequence which is called Tokenization. After tokenization, code \\( x \\) is represented by a sequence of tokens, namely, \\( x = (s_0, \\dots, s_j, \\dots, s_l) \\) where \\( s_i \\) is one token. Then, the code vocabulary dictionary is built by using all the appeared tokens \\( s_i \\), denoted \\( \\mathbb{V} \\). After that, every word (token) in \\( \\mathbb{V} \\) is embedded by learned vectors \\( \\boldsymbol{v}_i \\) with dimension \\( d \\). Here, we use \\( E^{|\\mathbb{V}| \\times d} \\) to represent the embedding matrix for \\( \\mathbb{V} \\). Finally, \\( x \\) can be converted into a embedding matrix \\( R^{l \\times d} = (v_0, \\dots, v_j, \\dots, v_l) \\). After this code encoding, pre-trained code models based on the transformer take the matrix \\( R^{l \\times d} \\) as inputs and learn the contextual representation of \\( x \\) for downstream tasks via pre-training such as Masked Language Modeling (MLM) and Causal Language Modeling (CLM)."
301
+ },
302
+ {
303
+ "type": "text",
304
+ "bbox": [
305
+ 0.508,
306
+ 0.611,
307
+ 0.884,
308
+ 0.756
309
+ ],
310
+ "angle": 0,
311
+ "content": "Figure 1 illustrates the main steps of the code processing models for the downstream classification tasks. First, we tokenize the textual code \\( x \\) into a token sequence that is represented in a discrete integer space. Then, we map the discrete sequence ids into the token vector space \\( R^{l \\times d} \\). Next, we feed the token vectors into the task model \\( f(\\theta) \\). \\( f(\\theta) \\) is built on top of pre-trained models. Finally, we can predict the domain probabilities after fine-tuning."
312
+ },
313
+ {
314
+ "type": "title",
315
+ "bbox": [
316
+ 0.509,
317
+ 0.769,
318
+ 0.708,
319
+ 0.783
320
+ ],
321
+ "angle": 0,
322
+ "content": "2.2 Problem Statement"
323
+ },
324
+ {
325
+ "type": "text",
326
+ "bbox": [
327
+ 0.508,
328
+ 0.791,
329
+ 0.884,
330
+ 0.919
331
+ ],
332
+ "angle": 0,
333
+ "content": "Since many critical code tasks are classification problems, e.g., defect prediction and code clone detection. In this paper, we focus on the adversarial attack for code classification tasks. Considering a code classification task, we use \\( f(x; \\theta) \\to y: R^{l \\times d} \\to \\mathbb{C} = \\{i | 0 \\leq i \\leq n\\} \\) to denote the victim model that maps a code token sequence \\( x \\) to a label \\( y \\) from a label set \\( \\mathbb{C} \\) with size \\( n \\), where"
334
+ },
335
+ {
336
+ "type": "page_number",
337
+ "bbox": [
338
+ 0.481,
339
+ 0.928,
340
+ 0.521,
341
+ 0.941
342
+ ],
343
+ "angle": 0,
344
+ "content": "9707"
345
+ }
346
+ ],
347
+ [
348
+ {
349
+ "type": "text",
350
+ "bbox": [
351
+ 0.113,
352
+ 0.085,
353
+ 0.493,
354
+ 0.391
355
+ ],
356
+ "angle": 0,
357
+ "content": "\\(l\\) is the sequence length and \\(d\\) is the token vector dimension, and \\(i\\) is one integer. By querying dictionary dense embedding \\(\\pmb{E}^{|\\mathbb{V}\\times d|}\\), a code token sequence \\(x = (s_0,\\dots,s_j,\\dots,s_l)\\), is vectorized into \\(\\pmb{R}^{l\\times d}\\). Adversarial attacks for code models create an adversarial example \\(x^{\\prime}\\) by modifying some vulnerable tokens of \\(x\\) with a limited maximum perturbation \\(\\epsilon\\) to change the correct label \\(y\\) to a wrong label \\(y^\\prime\\). Simply, we get a perturbed \\(x^{\\prime}\\) by modifying some tokens in \\((s_0,\\dots,s_j,\\dots,s_l)\\) such that \\(f(x^{\\prime};\\theta)\\neq f(x;\\theta)\\) where \\(x^{\\prime} = x + \\sigma\\) and \\(x^{\\prime}\\) has to have the same behavior with \\(x\\), + represent perturbation execution, \\(\\sigma\\) is the perturbation code transformation for \\((s_0,\\dots,s_j,\\dots,s_l)\\), and \\(\\sigma \\leq \\epsilon\\). We target the more practical attacking scenario - black-box attack that requires less information. We assume we cannot access the model parameters and can only utilize the final output of model \\(f(x;\\theta)\\) to conduct the attack."
358
+ },
359
+ {
360
+ "type": "title",
361
+ "bbox": [
362
+ 0.114,
363
+ 0.404,
364
+ 0.265,
365
+ 0.421
366
+ ],
367
+ "angle": 0,
368
+ "content": "3 Methodology"
369
+ },
370
+ {
371
+ "type": "title",
372
+ "bbox": [
373
+ 0.114,
374
+ 0.431,
375
+ 0.248,
376
+ 0.445
377
+ ],
378
+ "angle": 0,
379
+ "content": "3.1 Motivation"
380
+ },
381
+ {
382
+ "type": "text",
383
+ "bbox": [
384
+ 0.113,
385
+ 0.453,
386
+ 0.49,
387
+ 0.676
388
+ ],
389
+ "angle": 0,
390
+ "content": "As mentioned in the introduction, the current methods face three limitations: 1) there is a limited number of substitute variables; 2) there is a high verification cost associated with substitute variables; and 3) the generated adversarial samples often exhibit large perturbations. Among these limitations, the second one holds the utmost significance as it significantly impacts both the first and third limitations. Due to the high cost involved, it becomes challenging to generate diverse adversarial examples within a reasonable budget. Additionally, attackers tend to introduce large perturbations without employing any perturbation constraints in order to maximize their attacks."
391
+ },
392
+ {
393
+ "type": "text",
394
+ "bbox": [
395
+ 0.113,
396
+ 0.678,
397
+ 0.49,
398
+ 0.919
399
+ ],
400
+ "angle": 0,
401
+ "content": "To address these limitations, the first question arises: \"Could we substantially reduce the verification cost while allowing for unrestricted diversity of substitute variables and minimizing perturbations?\" To delve into the reasons behind the second limitation, we need to analyze its underlying factors. The low verification efficiency of the substitute set stems from the fact that each substitute can only be verified by constructing an adversarial sample to replace the original variable and then launching an actual attack on the victim model. This realization leads to the second question: \"Is it feasible to predict the attack effect of a substitute instead of constructing an adversarial sample to attack the victim model?\""
402
+ },
403
+ {
404
+ "type": "image",
405
+ "bbox": [
406
+ 0.523,
407
+ 0.086,
408
+ 0.891,
409
+ 0.372
410
+ ],
411
+ "angle": 0,
412
+ "content": null
413
+ },
414
+ {
415
+ "type": "text",
416
+ "bbox": [
417
+ 0.508,
418
+ 0.401,
419
+ 0.885,
420
+ 0.577
421
+ ],
422
+ "angle": 0,
423
+ "content": "Given input code \\( x \\) and one of its variables \\( var \\), different substitutes can be used to replace it to obtain different adversarial samples. After attacking the victim model, the probability of the label will also change. Conversely, if we want to reduce the probability of this label, the third question is following, \"how to choose relatively better substitutes that can reduce the model confidence from a large-scale original substitute set?\" It is possible to select good substitutes without actual attack if we can forecast, which is implemented by RNNS."
424
+ },
425
+ {
426
+ "type": "text",
427
+ "bbox": [
428
+ 0.508,
429
+ 0.579,
430
+ 0.885,
431
+ 0.837
432
+ ],
433
+ "angle": 0,
434
+ "content": "The core idea of RNNS is maintaining a search seed updated based on the historical attack. The search seed is employed to search next adversarial substitutes that are possible to attack successfully. Since substitutes are discrete and cannot be directly involved in calculations, we first use a variable name pre-trained encoder denoted as \\( E \\) to map substitutes to a unified continuous representation vector space. Then, based on the representation vectors of substitutes that have participated in the attack, we predict the search seed vector \\( e_{seed} \\) for the next round of the substitute selection. Finally, we calculate the similarity between \\( e_{seed} \\) and the representation vector of substitutes and then select relatively better substitutes. For specific details, please refer to Section 3.2.3."
435
+ },
436
+ {
437
+ "type": "title",
438
+ "bbox": [
439
+ 0.509,
440
+ 0.849,
441
+ 0.878,
442
+ 0.866
443
+ ],
444
+ "angle": 0,
445
+ "content": "3.2 Representation Nearest Neighbor Search"
446
+ },
447
+ {
448
+ "type": "text",
449
+ "bbox": [
450
+ 0.508,
451
+ 0.872,
452
+ 0.885,
453
+ 0.92
454
+ ],
455
+ "angle": 0,
456
+ "content": "Algorithm 1 shows the workflow of our approach, First, we collect the original substitute set from public real code, following the process described"
457
+ },
458
+ {
459
+ "type": "page_number",
460
+ "bbox": [
461
+ 0.481,
462
+ 0.928,
463
+ 0.521,
464
+ 0.941
465
+ ],
466
+ "angle": 0,
467
+ "content": "9708"
468
+ }
469
+ ],
470
+ [
471
+ {
472
+ "type": "text",
473
+ "bbox": [
474
+ 0.113,
475
+ 0.085,
476
+ 0.492,
477
+ 0.665
478
+ ],
479
+ "angle": 0,
480
+ "content": "in Section 3.2.1. We extract variables from the input code and sort them according to their uncertainty, referring to Section 3.2.2 (Line 3-4). We replace variables in sequence to form attack samples (Line 5). For a given \\( var \\), we first initialize the optimal substitute for this current iteration \\( sub_{cur} \\) and the optimal substitute for the previous iteration \\( sub_{pre} \\) to the \\( var \\). Then, we initialize the accumulated smooth increment of the representation vector \\( \\Delta e_{smo} \\) to a zero vector. \\( \\Delta e_{smo} \\) is used to record the historical representation change of the search seed \\( e_{seed} \\). We now commence the iterative attack process, as delineated in Line 11. We predict the search seed vector \\( e_{seed} \\) with the process described in Section 3.2.3 (Line 12), and then extract topk substitutes based on \\( e_{seed} \\) to form the candidate substitutes \\( subs_{topk} \\) with the process described in Section 3.2.4 (Line 13). Subsequently, we replace \\( sub_{cur} \\) in \\( x' \\) with each substitute in \\( subs_{topk} \\) to obtain the corresponding temporary adversarial sample \\( x'_tmp \\) (Line 14-15). \\( x' \\) is the current code that we are trying to attack and it is initialized with the original code \\( x \\). We use \\( x'_tmp \\) to attack the victim model and obtain the probability \\( prob_y \\) of the ground-truth label \\( y \\) and predicted label \\( y' \\) (Line 16). If the probability of the ground-truth label \\( y \\) hits a new low (\\(< prob_{min}\\)), we update \\( x' \\), \\( sub_{pre} \\), \\( sub_{cur} \\) and \\( prob_{min} \\) (Line 17-22). \\( prob_{min} \\) records the minimum probability of label \\( y \\) during the attack process. If \\( x'_tmp \\) causes the victim model to predict an incorrect label, this attack is successful and returns the successful adversarial sample (Line 23-26); otherwise, proceed to the next iteration until all variables have completed iteration and return the final adversarial sample and attack result (Line 30)."
481
+ },
482
+ {
483
+ "type": "title",
484
+ "bbox": [
485
+ 0.114,
486
+ 0.673,
487
+ 0.489,
488
+ 0.688
489
+ ],
490
+ "angle": 0,
491
+ "content": "3.2.1 Collecting Large Original Substitute Set"
492
+ },
493
+ {
494
+ "type": "text",
495
+ "bbox": [
496
+ 0.113,
497
+ 0.692,
498
+ 0.491,
499
+ 0.884
500
+ ],
501
+ "angle": 0,
502
+ "content": "We have developed a tool for variable extraction that leverages the tree-sitter framework<sup>1</sup>. This tool, henceforth denoted as ExtractVar (see Line 3), operates in three distinct steps. In the first step, we extract all variables from the current dataset and then filter out duplicates. During the second step, each valid variable is tokenized, and we compute the embedding for each token using the variable-name encoder \\( E \\) that is pre-trained on CodeSearchNet<sup>2</sup>. We then apply a mean pooling operation on these tokens to determine the variable's embedding. In the third step, we retain all the chosen variables"
503
+ },
504
+ {
505
+ "type": "text",
506
+ "bbox": [
507
+ 0.509,
508
+ 0.085,
509
+ 0.886,
510
+ 0.119
511
+ ],
512
+ "angle": 0,
513
+ "content": "along with their associated embeddings as the initial substitute set, represented as \\( subs_{original} \\)."
514
+ },
515
+ {
516
+ "type": "title",
517
+ "bbox": [
518
+ 0.509,
519
+ 0.126,
520
+ 0.759,
521
+ 0.141
522
+ ],
523
+ "angle": 0,
524
+ "content": "3.2.2 Computing Uncertainty"
525
+ },
526
+ {
527
+ "type": "text",
528
+ "bbox": [
529
+ 0.508,
530
+ 0.145,
531
+ 0.886,
532
+ 0.32
533
+ ],
534
+ "angle": 0,
535
+ "content": "Given a specific code \\( x \\), we replace each instance of \\( var \\in x \\) with a set of predefined fixed variables \\( VarArray \\), resulting in a set of mutated codes denoted as \\( X_{var}^{mutated} \\). These mutated codes are subsequently utilized to query the victim model, allowing us to obtain the probability distribution for each class. A greater variance in the distribution signifies increased uncertainty for \\( var \\), suggesting that \\( var \\) should be prioritized for replacement. The uncertainty associated with \\( var \\) is defined as follows:"
536
+ },
537
+ {
538
+ "type": "equation",
539
+ "bbox": [
540
+ 0.536,
541
+ 0.328,
542
+ 0.858,
543
+ 0.372
544
+ ],
545
+ "angle": 0,
546
+ "content": "\\[\nu n c e r t a i n t y _ {v a r} = \\frac {1}{C} \\sum_ {i = 1} ^ {C} v a r i a n c e (P _ {v a r} ^ {i})\n\\]"
547
+ },
548
+ {
549
+ "type": "text",
550
+ "bbox": [
551
+ 0.508,
552
+ 0.381,
553
+ 0.886,
554
+ 0.705
555
+ ],
556
+ "angle": 0,
557
+ "content": "where \\( P_{var}^{i} = \\{p_{var}^{i}(x) | \\forall x \\in X_{var}^{mutated}\\} \\), \\( C \\) is the number of labels, \\( p_{var}^{i}(x) \\) is the model probability for label \\( i \\) given the mutated code \\( x \\), and variance denotes the standard variance function. A larger and more diverse \\( X_{var}^{mutated} \\) ensures a closer approximation of uncertainty to the true value. It is important to note, however, that the magnitude of the change length must not be excessively large, as this would result in all probability changes converging to a single point. This is because samples subjected to large changes deviate significantly from the original, leading to a substantial decrease in the model confidence levels. Subsequently, we arrange the variables in descending order based on their uncertainties. The greater the uncertainty of a variable, the more valuable it is for attack. This process is denoted as RankVarsWithUncertainty at line 4. In our implementation, the size of this variable array VarArray is 16, and the variable length ranges from 1 to 5."
558
+ },
559
+ {
560
+ "type": "title",
561
+ "bbox": [
562
+ 0.509,
563
+ 0.713,
564
+ 0.753,
565
+ 0.728
566
+ ],
567
+ "angle": 0,
568
+ "content": "3.2.3 Predicting Search Seed"
569
+ },
570
+ {
571
+ "type": "text",
572
+ "bbox": [
573
+ 0.508,
574
+ 0.732,
575
+ 0.886,
576
+ 0.892
577
+ ],
578
+ "angle": 0,
579
+ "content": "To filter out superior substitutes from the substantial \\( subs_{original} \\), it becomes necessary to predict the search seed within the substitute representation vector space. Given the optimal substitute \\( sub_{cur} \\) of the current round, the optimal substitute \\( sub_{pre} \\) from the previous round, and the accumulated smooth increment of the representation vector, denoted as \\( \\Delta e_{smo} \\), from all preceding rounds of iteration, we initially compute the increment of the representation vector in the current round, \\( \\Delta e \\):"
580
+ },
581
+ {
582
+ "type": "page_footnote",
583
+ "bbox": [
584
+ 0.136,
585
+ 0.891,
586
+ 0.391,
587
+ 0.905
588
+ ],
589
+ "angle": 0,
590
+ "content": "1https://tree-sitter.github.io/tree-sitter"
591
+ },
592
+ {
593
+ "type": "page_footnote",
594
+ "bbox": [
595
+ 0.137,
596
+ 0.905,
597
+ 0.422,
598
+ 0.918
599
+ ],
600
+ "angle": 0,
601
+ "content": "2https://huggingface.co/datasets/code_search_net"
602
+ },
603
+ {
604
+ "type": "list",
605
+ "bbox": [
606
+ 0.136,
607
+ 0.891,
608
+ 0.422,
609
+ 0.918
610
+ ],
611
+ "angle": 0,
612
+ "content": null
613
+ },
614
+ {
615
+ "type": "equation",
616
+ "bbox": [
617
+ 0.58,
618
+ 0.903,
619
+ 0.813,
620
+ 0.921
621
+ ],
622
+ "angle": 0,
623
+ "content": "\\[\n\\Delta \\boldsymbol {e} = E (s u b _ {c u r}) - E (s u b _ {p r e})\n\\]"
624
+ },
625
+ {
626
+ "type": "page_number",
627
+ "bbox": [
628
+ 0.481,
629
+ 0.928,
630
+ 0.521,
631
+ 0.941
632
+ ],
633
+ "angle": 0,
634
+ "content": "9709"
635
+ }
636
+ ],
637
+ [
638
+ {
639
+ "type": "table",
640
+ "bbox": [
641
+ 0.119,
642
+ 0.083,
643
+ 0.49,
644
+ 0.145
645
+ ],
646
+ "angle": 0,
647
+ "content": "<table><tr><td>Task</td><td>Train / Val / Test</td><td>CodeBERT</td><td>GraphCodeBERT</td><td>CodeT5</td></tr><tr><td>Defect</td><td>21,854 / 2,732 / 2,732</td><td>63.76</td><td>63.65</td><td>67.02</td></tr><tr><td>Clone</td><td>90,102 / 4,000 / 4,000</td><td>96.97</td><td>97.36</td><td>97.84</td></tr><tr><td>Authorship</td><td>528 / - / 132</td><td>82.57</td><td>77.27</td><td>88.63</td></tr><tr><td>C1000</td><td>320,000 / 80,000 / 100,000</td><td>82.53</td><td>83.79</td><td>84.46</td></tr><tr><td>Python800</td><td>153,600 / 38,400 / 48,000</td><td>96.39</td><td>96.29</td><td>96.79</td></tr><tr><td>Java250</td><td>48,000 / 11,909 / 15,000</td><td>96.91</td><td>97.27</td><td>97.72</td></tr></table>"
648
+ },
649
+ {
650
+ "type": "table_caption",
651
+ "bbox": [
652
+ 0.114,
653
+ 0.16,
654
+ 0.489,
655
+ 0.189
656
+ ],
657
+ "angle": 0,
658
+ "content": "Table 1: Datasets and Victim Model Performance (Accuracy, %)."
659
+ },
660
+ {
661
+ "type": "text",
662
+ "bbox": [
663
+ 0.113,
664
+ 0.215,
665
+ 0.489,
666
+ 0.295
667
+ ],
668
+ "angle": 0,
669
+ "content": ", where \\(E\\) is variable name encoder, trained on CodeSearchNet by masked language modelling independently so that RNNS is independent of victim downstream-task models. Then we update the \\(\\Delta e_{smo}\\)"
670
+ },
671
+ {
672
+ "type": "equation",
673
+ "bbox": [
674
+ 0.175,
675
+ 0.31,
676
+ 0.427,
677
+ 0.326
678
+ ],
679
+ "angle": 0,
680
+ "content": "\\[\n\\Delta \\mathbf {e} _ {s m o} = (1 - \\alpha) \\Delta \\mathbf {e} _ {s m o} + \\alpha \\Delta \\mathbf {e}\n\\]"
681
+ },
682
+ {
683
+ "type": "text",
684
+ "bbox": [
685
+ 0.114,
686
+ 0.34,
687
+ 0.489,
688
+ 0.372
689
+ ],
690
+ "angle": 0,
691
+ "content": ", where \\(\\alpha\\) is a smooth rate limited 0 to 1, Finally, we predict the search seed \\(e_{\\text{seed}}\\):"
692
+ },
693
+ {
694
+ "type": "equation",
695
+ "bbox": [
696
+ 0.19,
697
+ 0.386,
698
+ 0.412,
699
+ 0.403
700
+ ],
701
+ "angle": 0,
702
+ "content": "\\[\n\\boldsymbol {e} _ {\\text {s e e d}} = E \\left(\\operatorname {s u b} _ {\\text {c u r}}\\right) + \\Delta \\boldsymbol {e} _ {\\text {s m o}}\n\\]"
703
+ },
704
+ {
705
+ "type": "text",
706
+ "bbox": [
707
+ 0.114,
708
+ 0.417,
709
+ 0.489,
710
+ 0.432
711
+ ],
712
+ "angle": 0,
713
+ "content": "This process is denoted as PredictSeed at line 12."
714
+ },
715
+ {
716
+ "type": "title",
717
+ "bbox": [
718
+ 0.114,
719
+ 0.443,
720
+ 0.4,
721
+ 0.458
722
+ ],
723
+ "angle": 0,
724
+ "content": "3.2.4 Searching Top-K Substitutes"
725
+ },
726
+ {
727
+ "type": "text",
728
+ "bbox": [
729
+ 0.113,
730
+ 0.463,
731
+ 0.49,
732
+ 0.704
733
+ ],
734
+ "angle": 0,
735
+ "content": "Initially, we filter out substitutes from \\( subs_{original} \\) that comply with two constraints: 1) \\( 1 - sim(E(sub), E(var)) < \\epsilon \\) and 2) \\( |len(sub) - len(var)| < \\delta \\), where \\( var \\) refers to the original variable in the input code that is to be replaced, \\( sim(.) \\) is the similarity calculation function. \\( E(.) \\) is the variable name encoder, and \\( len(.) \\) is used to calculate the length of the variable name. Then, we calculate the similarity between the search seed \\( e_{seed} \\) and the substitutes that are filtered by the two constraints and select the \\( k \\) most similar substitutes to form \\( subs_{topk} \\). This process is denoted as SearchTopkSub at line 13. In our experiment, \\( \\epsilon = 0.15 \\), \\( \\delta = 4 \\), \\( k = 60 \\), \\( sim(.) \\) is cosine similarity."
736
+ },
737
+ {
738
+ "type": "title",
739
+ "bbox": [
740
+ 0.114,
741
+ 0.717,
742
+ 0.322,
743
+ 0.734
744
+ ],
745
+ "angle": 0,
746
+ "content": "4 Experimental Setup"
747
+ },
748
+ {
749
+ "type": "text",
750
+ "bbox": [
751
+ 0.113,
752
+ 0.743,
753
+ 0.49,
754
+ 0.919
755
+ ],
756
+ "angle": 0,
757
+ "content": "Dataset and Model. To study the effectiveness and efficiency of RNNS, we conduct experiments on three popular programming languages (C, Python, and Java). For the datasets, we employed six widely studied open-source datasets that cover four important code tasks. Specifically, BigCloneBench (Wang et al., 2020) is one code clone detection dataset named Clone. Devign (Zhou et al., 2019) is a dataset used for vulnerability detection, named Defect. For authorship prediction, we use the dataset provided by (Alsulami et al., 2017)."
758
+ },
759
+ {
760
+ "type": "text",
761
+ "bbox": [
762
+ 0.508,
763
+ 0.085,
764
+ 0.883,
765
+ 0.228
766
+ ],
767
+ "angle": 0,
768
+ "content": "Besides, we utilize three problem-solving classification tasks, Java250, Python800, and C1000, provided by ProjectCodeNet (Puri et al., 2021). For all the datasets (except for authorship prediction which does not have enough data samples), we follow the original papers to split the data into the training set, validation set, and test set. Authorship prediction only has two split parts, training data and test data."
769
+ },
770
+ {
771
+ "type": "text",
772
+ "bbox": [
773
+ 0.508,
774
+ 0.253,
775
+ 0.884,
776
+ 0.366
777
+ ],
778
+ "angle": 0,
779
+ "content": "For the code models, we follow the previous work (Yang et al., 2022) and investigate two pretrained models CodeBERT (Feng et al., 2020), and GraphCodeBERT (Guo et al., 2020). Besides, we add one more powerful model CodeT5 (Wang et al., 2021) in our study. Table 1 summarizes the details of our employed datasets and fine-tuned models."
780
+ },
781
+ {
782
+ "type": "text",
783
+ "bbox": [
784
+ 0.508,
785
+ 0.39,
786
+ 0.884,
787
+ 0.582
788
+ ],
789
+ "angle": 0,
790
+ "content": "Evaluation Metric. To evaluate the effectiveness of adversarial attack methods, we employ the commonly used attack success rate (ASR) (Yang et al., 2022) as the measurement. To evaluate the efficiency of the attack methods, we use query times (QT) to check the average number of querying the victim model for one input code. Finally, we use the change of replaced-variable length and the number of replaced variables to study the quality/perturbation of adversarial examples. A smaller score means the attack method can generate adversarial examples with less perturbation injection."
791
+ },
792
+ {
793
+ "type": "text",
794
+ "bbox": [
795
+ 0.508,
796
+ 0.606,
797
+ 0.884,
798
+ 0.831
799
+ ],
800
+ "angle": 0,
801
+ "content": "Baseline. We compare RNNS with two black-box attack baselines, MHM (Zhang et al., 2020) and NaturalAttack (ALERT) (Yang et al., 2022). MHM is a sampling search-based black-box attack that generates the substitutes from the vocabulary based on lexical rules for identifiers. MHM employs synthesized tokens as the candidates of substitutes, which could introduce meaningless variable names. ALERT is a recently proposed attack method that combines greedy attack and genetic algorithm to find the substitutes. We also use two textual attack algorithms PSO (Zang et al., 2020) and LSH (Maheshwary et al., 2021) as minor baselines, since they are not designed for code models."
802
+ },
803
+ {
804
+ "type": "text",
805
+ "bbox": [
806
+ 0.508,
807
+ 0.855,
808
+ 0.884,
809
+ 0.919
810
+ ],
811
+ "angle": 0,
812
+ "content": "Implementation. We implement our approach in PyTorch and run all experiments on 32G-v100 GPUs. We reuse the source code from the baselines. We make our implementation publicly available."
813
+ },
814
+ {
815
+ "type": "page_number",
816
+ "bbox": [
817
+ 0.481,
818
+ 0.928,
819
+ 0.521,
820
+ 0.941
821
+ ],
822
+ "angle": 0,
823
+ "content": "9710"
824
+ }
825
+ ],
826
+ [
827
+ {
828
+ "type": "table",
829
+ "bbox": [
830
+ 0.27,
831
+ 0.082,
832
+ 0.732,
833
+ 0.323
834
+ ],
835
+ "angle": 0,
836
+ "content": "<table><tr><td rowspan=\"2\">Task+Model</td><td colspan=\"2\">ALERT</td><td colspan=\"2\">MHM</td><td colspan=\"2\">RNNS</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Clone+CodeBert</td><td>28.67</td><td>2155.39</td><td>39.66</td><td>972.15</td><td>46.50</td><td>666.48</td></tr><tr><td>Clone+GraphCodeBert</td><td>10.40</td><td>1466.68</td><td>9.58</td><td>490.99</td><td>41.28</td><td>1122.01</td></tr><tr><td>Clone+CodeT5</td><td>29.20</td><td>2359.70</td><td>38.79</td><td>1069.06</td><td>39.61</td><td>895.79</td></tr><tr><td>Defect+CodeBert</td><td>52.29</td><td>1079.68</td><td>50.51</td><td>862.18</td><td>69.18</td><td>588.35</td></tr><tr><td>Defect+GraphCodeBert</td><td>74.29</td><td>621.77</td><td>75.19</td><td>539.93</td><td>81.63</td><td>404.73</td></tr><tr><td>Defect+CodeT5</td><td>76.66</td><td>721.02</td><td>86.51</td><td>344.08</td><td>89.45</td><td>344.29</td></tr><tr><td>Authorship+CodeBert</td><td>34.98</td><td>682.57</td><td>64.70</td><td>775.11</td><td>73.39</td><td>1029.59</td></tr><tr><td>Authorship+GraphCodeBert</td><td>58.82</td><td>1227.36</td><td>75.49</td><td>632.10</td><td>80.39</td><td>696.64</td></tr><tr><td>Authorship+CodeT5</td><td>64.95</td><td>1078.40</td><td>66.97</td><td>715.89</td><td>71.79</td><td>970.44</td></tr><tr><td>Java250+CodeBert</td><td>50.50</td><td>958.96</td><td>74.03</td><td>961.60</td><td>75.12</td><td>815.91</td></tr><tr><td>Java250+GraphCodeBert</td><td>46.74</td><td>1026.15</td><td>46.05</td><td>946.52</td><td>72.30</td><td>853.74</td></tr><tr><td>Java250+CodeT5</td><td>52.04</td><td>1189.42</td><td>30.59</td><td>1107.95</td><td>63.80</td><td>1049.46</td></tr><tr><td>Python800+CodeBert</td><td>58.30</td><td>513.63</td><td>56.67</td><td>919.37</td><td>77.88</td><td>514.19</td></tr><tr><td>Python800+GraphCodeBert</td><td>51.87</td><td>577.70</td><td>54.15</td><td>917.92</td><td>71.42</td><td>730.14</td></tr><tr><td>Python800+CodeT5</td><td>52.84</td><td>777.20</td><td>36.95</td><td>1127.44</td><td>69.07</td><td>662.28</td></tr><tr><td>C1000+CodeBert</td><td>53.50</td><td>525.43</td><td>59.75</td><td>340.88</td><td>72.96</td><td>537.76</td></tr><tr><td>C1000+GraphCodeBert</td><td>52.68</td><td>566.18</td><td>45.93</td><td>837.09</td><td>72.23</td><td>634.27</td></tr><tr><td>C1000+CodeT5</td><td>47.86</td><td>843.33</td><td>36.45</td><td>668.15</td><td>59.00</td><td>697.06</td></tr><tr><td>Count</td><td>0/18</td><td>4/18</td><td>0/18</td><td>6/18</td><td>18/18</td><td>8/18</td></tr></table>"
837
+ },
838
+ {
839
+ "type": "table_caption",
840
+ "bbox": [
841
+ 0.137,
842
+ 0.332,
843
+ 0.859,
844
+ 0.347
845
+ ],
846
+ "angle": 0,
847
+ "content": "Table 2: Comparison results with MHM, and ALERT, ASR %. Count: the number of best results achieved."
848
+ },
849
+ {
850
+ "type": "title",
851
+ "bbox": [
852
+ 0.114,
853
+ 0.359,
854
+ 0.291,
855
+ 0.374
856
+ ],
857
+ "angle": 0,
858
+ "content": "5 Results Analysis"
859
+ },
860
+ {
861
+ "type": "title",
862
+ "bbox": [
863
+ 0.114,
864
+ 0.386,
865
+ 0.436,
866
+ 0.402
867
+ ],
868
+ "angle": 0,
869
+ "content": "5.1 Attack Effectiveness and Efficiency"
870
+ },
871
+ {
872
+ "type": "text",
873
+ "bbox": [
874
+ 0.113,
875
+ 0.41,
876
+ 0.489,
877
+ 0.779
878
+ ],
879
+ "angle": 0,
880
+ "content": "We compare RNNS with two methods MHM (Zhang et al., 2020) and NaturalAttack (ALERT) (Yang et al., 2022) on six datasets and 18 victim models that have been fine-tuned for the downstream tasks. Table 2 shows the comparison results where the last row Count indicates how many times this method achieves the best results. We can see that RNNS achieves the best performance for 18/18 times in terms of ASR, and the lowest cost for 8/18 times in terms of QT in Table 2. Both of the indicators are better than the baselines. The two baselines have zero best ASR for all victim models and all datasets. The lowest QTs achieved by ALERT and MHM are 4 and 6, respectively. We conclude that for effectiveness and efficiency, RNNS outperforms ALERT and MHM in all cases. Especially, MHM and ALERT fail to attack GraphCodeBERT on BigClone dataset, and only have \\(9.58\\%\\) and \\(10.4\\%\\) ASR respectively, while RNNS has more than \\(40\\%\\) ASR. RNNS has almost two times larger ASR than MHM on Java250+CodeT5 and Python800+CodeT5."
881
+ },
882
+ {
883
+ "type": "text",
884
+ "bbox": [
885
+ 0.113,
886
+ 0.781,
887
+ 0.49,
888
+ 0.893
889
+ ],
890
+ "angle": 0,
891
+ "content": "It should be noted that high ASR is not due to large QT. As shown in Table 2, the three groups of experiments with the most QTs are Clone+GraphCodeBert, Java250+CodeT5, and Authorship+CodeBert, with ASRs of \\(41.28\\%\\), \\(63.80\\%\\), and \\(73.39\\%\\), respectively, which are not the highest. On the contrary, Defect+CodeT5 has the highest"
892
+ },
893
+ {
894
+ "type": "text",
895
+ "bbox": [
896
+ 0.509,
897
+ 0.359,
898
+ 0.883,
899
+ 0.406
900
+ ],
901
+ "angle": 0,
902
+ "content": "ASR of \\(89.45\\%\\), but QT is the smallest. Therefore, there is no absolute causal relationship between QT and ASR."
903
+ },
904
+ {
905
+ "type": "title",
906
+ "bbox": [
907
+ 0.509,
908
+ 0.426,
909
+ 0.85,
910
+ 0.442
911
+ ],
912
+ "angle": 0,
913
+ "content": "5.2 Perturbation of Adversarial Example"
914
+ },
915
+ {
916
+ "type": "text",
917
+ "bbox": [
918
+ 0.507,
919
+ 0.451,
920
+ 0.884,
921
+ 0.627
922
+ ],
923
+ "angle": 0,
924
+ "content": "We conduct a study about the quality of the adversarial examples to check if RNNS can generate looking-normal code, e.g., avoiding naively increasing the variable name length. To do so, firstly, we count the average length of the original variable and adversarial variables as demonstrated by Table 3. We also compute the mean and variances of their difference. Besides, we compute the average number of the replaced variables for the successful attack as shown in Table 4. Low values mean the inputs are modified less, and high qualities."
925
+ },
926
+ {
927
+ "type": "text",
928
+ "bbox": [
929
+ 0.508,
930
+ 0.63,
931
+ 0.884,
932
+ 0.919
933
+ ],
934
+ "angle": 0,
935
+ "content": "In Table 3, the 2nd, 5th, and 8th columns are the average length for original variables (named Var Len) that are replaced. The 3rd, 6th, and 9th columns are the average lengths for adversarial variables (named Adv Var Len). The 4th, 7th, and 10th columns are the average and variance (mean \\(\\pm\\) variance) of the absolute length difference between original variables and adversarial variables (named Difference). We observe that MHM prefers to replace the long-length variables while RNNS likes replacing short-length variables if we compare the 2nd and 5th columns. Meanwhile, the change of variable length from RNNS is less than MHM. MHM introduces the average length difference of 3.39-6.82 while RNNS only has 2.02-2.54. MHM has much higher variances than RNNS in the length change. ALERT uses shorter adversarial variable names than RNNS"
936
+ },
937
+ {
938
+ "type": "page_footnote",
939
+ "bbox": [
940
+ 0.136,
941
+ 0.904,
942
+ 0.448,
943
+ 0.918
944
+ ],
945
+ "angle": 0,
946
+ "content": "<sup>3</sup>https://github.com/18682922316/RNNS-for-code-attack"
947
+ },
948
+ {
949
+ "type": "page_number",
950
+ "bbox": [
951
+ 0.481,
952
+ 0.928,
953
+ 0.519,
954
+ 0.941
955
+ ],
956
+ "angle": 0,
957
+ "content": "9711"
958
+ }
959
+ ],
960
+ [
961
+ {
962
+ "type": "table",
963
+ "bbox": [
964
+ 0.149,
965
+ 0.082,
966
+ 0.849,
967
+ 0.296
968
+ ],
969
+ "angle": 0,
970
+ "content": "<table><tr><td rowspan=\"2\">Task+Model</td><td colspan=\"3\">RNNS</td><td colspan=\"3\">MHM</td><td colspan=\"3\">ALERT</td></tr><tr><td>Var Len</td><td>Adv Var Len</td><td>Difference</td><td>Var Len</td><td>Adv Var Len</td><td>Difference</td><td>Var Len</td><td>Adv Var Len</td><td>Difference</td></tr><tr><td>Clone+CodeBert</td><td>6.12</td><td>6.79</td><td>2.35 ± 4.50</td><td>6.47</td><td>10.6</td><td>6.34 ± 10.98</td><td>5.91</td><td>6.21</td><td>1.32 ± 2.02</td></tr><tr><td>Clone+GraphCodeBert</td><td>6.32</td><td>6.97</td><td>2.54 ± 6.43</td><td>6.58</td><td>10.41</td><td>6.82 ± 21.67</td><td>5.50</td><td>5.93</td><td>1.45 ± 2.49</td></tr><tr><td>Clone+CodeT5</td><td>6.45</td><td>6.69</td><td>2.51 ± 8.30</td><td>6.46</td><td>10.46</td><td>6.17 ± 25.78</td><td>6.25</td><td>6.61</td><td>1.32 ± 2.72</td></tr><tr><td>Defect+CodeBert</td><td>4.64</td><td>5.44</td><td>2.08 ± 2.49</td><td>4.44</td><td>9.59</td><td>6.57 ± 28.78</td><td>4.85</td><td>5.06</td><td>1.36 ± 1.93</td></tr><tr><td>Defect+GraphCodeBert</td><td>4.08</td><td>5.34</td><td>2.13 ± 1.83</td><td>4.37</td><td>9.73</td><td>6.48 ± 26.51</td><td>4.47</td><td>5.22</td><td>1.33 ± 1.83</td></tr><tr><td>Defect+CodeT5</td><td>3.95</td><td>5.17</td><td>2.03 ± 1.93</td><td>4.33</td><td>9.81</td><td>6.59 ± 29.98</td><td>4.36</td><td>5.01</td><td>1.27 ± 1.57</td></tr><tr><td>Authorship+CodeBert</td><td>3.81</td><td>5.18</td><td>2.28 ± 1.56</td><td>3.97</td><td>7.94</td><td>5.45 ± 16.72</td><td>4.42</td><td>5.35</td><td>1.40 ± 2.25</td></tr><tr><td>Authorship+GraphCodeBert</td><td>3.69</td><td>5.23</td><td>2.36 ± 1.71</td><td>4.39</td><td>7.64</td><td>5.24 ± 15.38</td><td>3.74</td><td>4.46</td><td>1.22 ± 1.82</td></tr><tr><td>Authorship+CodeT5</td><td>3.95</td><td>5.18</td><td>2.03 ± 2.66</td><td>3.95</td><td>7.98</td><td>5.59 ± 20.94</td><td>3.81</td><td>4.50</td><td>1.22 ± 1.62</td></tr><tr><td>Java250+CodeBert</td><td>2.35</td><td>4.22</td><td>2.11 ± 1.02</td><td>3.21</td><td>6.50</td><td>4.34 ± 15.20</td><td>3.22</td><td>3.65</td><td>0.94 ± 1.63</td></tr><tr><td>Java250+GraphCodeBert</td><td>2.48</td><td>4.31</td><td>2.13 ± 1.07</td><td>3.13</td><td>6.59</td><td>4.42 ± 14.84</td><td>3.05</td><td>3.50</td><td>0.98 ± 1.54</td></tr><tr><td>Java250+CodeT5</td><td>2.76</td><td>4.47</td><td>2.10 ± 1.17</td><td>3.20</td><td>6.54</td><td>4.33 ± 14.60</td><td>3.16</td><td>7.31</td><td>4.41 ± 18.73</td></tr><tr><td>Python800+CodeBert</td><td>1.50</td><td>3.54</td><td>2.21 ± 1.02</td><td>1.97</td><td>5.11</td><td>3.64 ± 9.06</td><td>1.78</td><td>2.27</td><td>0.64 ± 1.34</td></tr><tr><td>Python800+GraphCodeBert</td><td>1.88</td><td>3.90</td><td>2.18 ± 0.78</td><td>1.99</td><td>6.01</td><td>4.46 ± 16.52</td><td>1.80</td><td>2.33</td><td>0.76 ± 1.30</td></tr><tr><td>Python800+CodeT5</td><td>1.65</td><td>3.59</td><td>2.13 ± 0.95</td><td>1.97</td><td>4.95</td><td>3.49 ± 8.18</td><td>1.88</td><td>5.84</td><td>4.10 ± 12.64</td></tr><tr><td>C1000+CodeBert</td><td>1.58</td><td>3.44</td><td>2.08 ± 0.88</td><td>2.41</td><td>5.05</td><td>3.65 ± 12.02</td><td>2.13</td><td>2.52</td><td>0.67 ± 1.17</td></tr><tr><td>C1000+GraphCodeBert</td><td>1.60</td><td>3.59</td><td>2.10 ±0.85</td><td>2.39</td><td>5.35</td><td>3.90 ± 12.98</td><td>2.18</td><td>2.67</td><td>0.66 ± 1.23</td></tr><tr><td>C1000+CodeBert</td><td>1.38</td><td>3.33</td><td>2.02 ± 0.85</td><td>2.36</td><td>4.82</td><td>3.39 ± 10.98</td><td>2.10</td><td>6.56</td><td>4.74 ± 13.24</td></tr></table>"
971
+ },
972
+ {
973
+ "type": "table_caption",
974
+ "bbox": [
975
+ 0.271,
976
+ 0.305,
977
+ 0.725,
978
+ 0.319
979
+ ],
980
+ "angle": 0,
981
+ "content": "Table 3: Replaced-variable length comparison, mean \\( \\pm \\) variance."
982
+ },
983
+ {
984
+ "type": "text",
985
+ "bbox": [
986
+ 0.113,
987
+ 0.332,
988
+ 0.489,
989
+ 0.379
990
+ ],
991
+ "angle": 0,
992
+ "content": "with less change because it uses the pre-trained model to generate the replacements that are close to the replaced variables."
993
+ },
994
+ {
995
+ "type": "text",
996
+ "bbox": [
997
+ 0.113,
998
+ 0.381,
999
+ 0.49,
1000
+ 0.541
1001
+ ],
1002
+ "angle": 0,
1003
+ "content": "Table 4 statistically shows the number of replaced variables. It can be seen that RNNS replaces around an average of 3.6 variables with a smaller variance of around (3.4-4.6) while MHM needs to modify about an average of 5.4 variables with a larger variance \\((\\geq 11.14)\\). ALERT also replaces more variables to attack models than RNNS and MHM. RNNS introduces less or equal perturbation than the baselines in terms of length change and change number."
1004
+ },
1005
+ {
1006
+ "type": "text",
1007
+ "bbox": [
1008
+ 0.113,
1009
+ 0.543,
1010
+ 0.49,
1011
+ 0.655
1012
+ ],
1013
+ "angle": 0,
1014
+ "content": "Figure 2 shows one example of RNNS, MHM, and ALERT attack successfully from the Java250 dataset. The changes are highlighted by shadow markers. RNNS only renames one variable \\(\\mathbf{b}\\) to \\(\\mathbf{h}\\), ALERT renames two variables, while MHM almost renames all variables and also prefers longer names."
1015
+ },
1016
+ {
1017
+ "type": "title",
1018
+ "bbox": [
1019
+ 0.114,
1020
+ 0.671,
1021
+ 0.281,
1022
+ 0.687
1023
+ ],
1024
+ "angle": 0,
1025
+ "content": "5.3 Ablation Study"
1026
+ },
1027
+ {
1028
+ "type": "text",
1029
+ "bbox": [
1030
+ 0.113,
1031
+ 0.695,
1032
+ 0.491,
1033
+ 0.919
1034
+ ],
1035
+ "angle": 0,
1036
+ "content": "We remove the two search constraints in Section 3.2.4, denoted this variant of RNNS as RNNS-Unlimited. Table 5 shows the comparing results between RNNS-Unlimited and RNNS. RNNS-Unlimited gets the first place for all the tasks in terms of ASR. ASR can be improved by a maximum of \\(8.35\\%\\) and a minimum of about \\(2\\%\\) after removing limitations. For QT, RNNS-Unlimited only loses 3 times among 18 evaluations. The improvement of RNNS-Unlimited is not surprising with respect to ASR and QT. Because RNNS-Unlimited can search the adversarial examples in the non-similar real names and use very long variable names."
1037
+ },
1038
+ {
1039
+ "type": "title",
1040
+ "bbox": [
1041
+ 0.509,
1042
+ 0.332,
1043
+ 0.868,
1044
+ 0.348
1045
+ ],
1046
+ "angle": 0,
1047
+ "content": "5.4 Attack Defended Model and Retraining"
1048
+ },
1049
+ {
1050
+ "type": "text",
1051
+ "bbox": [
1052
+ 0.507,
1053
+ 0.353,
1054
+ 0.886,
1055
+ 0.514
1056
+ ],
1057
+ "angle": 0,
1058
+ "content": "Attack Defended Model. We employ RNNS and MHM to attack the three defended models provided by ALERT (Yang et al., 2022). These models are prepared by adversarial fine-tuning. Table 6 presents the results. We can see that RNNS outperforms MHM in two tasks, and MHM is better in one task. This experiment setting actually is not friendly for RNNS because ALERT (Yang et al., 2022) uses the replacements from pre-trained models which implicitly have the semantic constraint."
1059
+ },
1060
+ {
1061
+ "type": "text",
1062
+ "bbox": [
1063
+ 0.508,
1064
+ 0.515,
1065
+ 0.886,
1066
+ 0.74
1067
+ ],
1068
+ "angle": 0,
1069
+ "content": "Retraining. We use the adversarial examples from RNNS to retrain the victim models of CodeBERT by contrastive adversarial learning. We use three 3 datasets, Defect, Authorship, and Java250. We generate the adversarial examples on the whole training dataset for them. Table 7 presents the results, all approaches achieve much lower ASR compared with the previous. RNNS adversarial examples can improve the mode robustness through contrastive adversarial retraining. If we compare Defect/Authorship+CodeBERT in Table 7 and Table 6, we can find that both retrained models via RNNS are more robust than the models from ALERT since they have much lower ASRs."
1070
+ },
1071
+ {
1072
+ "type": "title",
1073
+ "bbox": [
1074
+ 0.509,
1075
+ 0.753,
1076
+ 0.822,
1077
+ 0.767
1078
+ ],
1079
+ "angle": 0,
1080
+ "content": "5.5 RNNS vs Textual Attack Methods"
1081
+ },
1082
+ {
1083
+ "type": "text",
1084
+ "bbox": [
1085
+ 0.508,
1086
+ 0.775,
1087
+ 0.885,
1088
+ 0.902
1089
+ ],
1090
+ "angle": 0,
1091
+ "content": "To compare the effects of RNNS and textual attack methods, We conducted attack experiments on three datasets using the PSO (Zang et al., 2020) and LSH (Maheshwary et al., 2021). The three datasets Defect, Authorship, and Java250, represent three languages respectively, C, Python, and Java. To be fair, the search space of the PSO and LSH is the same as that of RNNS."
1092
+ },
1093
+ {
1094
+ "type": "text",
1095
+ "bbox": [
1096
+ 0.528,
1097
+ 0.904,
1098
+ 0.882,
1099
+ 0.919
1100
+ ],
1101
+ "angle": 0,
1102
+ "content": "As shown in Table 8, the QT of PSO algorithm"
1103
+ },
1104
+ {
1105
+ "type": "page_number",
1106
+ "bbox": [
1107
+ 0.481,
1108
+ 0.928,
1109
+ 0.521,
1110
+ 0.941
1111
+ ],
1112
+ "angle": 0,
1113
+ "content": "9712"
1114
+ }
1115
+ ],
1116
+ [
1117
+ {
1118
+ "type": "table",
1119
+ "bbox": [
1120
+ 0.131,
1121
+ 0.082,
1122
+ 0.868,
1123
+ 0.181
1124
+ ],
1125
+ "angle": 0,
1126
+ "content": "<table><tr><td rowspan=\"2\">Task</td><td colspan=\"3\">CodeBERT</td><td colspan=\"3\">GraphCodeBERT</td><td colspan=\"3\">CodeT5</td></tr><tr><td>RNNS</td><td>MHM</td><td>ALERT</td><td>RNNS</td><td>MHM</td><td>ALERT</td><td>RNNS</td><td>MHM</td><td>ALERT</td></tr><tr><td>Clone</td><td>3.55 ± 4.60</td><td>6.72 ± 16.57</td><td>6.86 ± 18.85</td><td>4.12 ± 4.94</td><td>6.21 ± 15.13</td><td>6.95 ± 18.99</td><td>3.43 ± 5.00</td><td>5.68 ± 14.01</td><td>7.65 ± 25.57</td></tr><tr><td>Defect</td><td>3.39 ± 4.96</td><td>2.78 ± 7.89</td><td>3.49 ± 3.99</td><td>2.67 ± 1.75</td><td>2.84 ± 9.50</td><td>4.10 ± 11.05</td><td>2.51 ± 1.45</td><td>2.16 ± 3.58</td><td>3.49 ± 3.99</td></tr><tr><td>Authorship</td><td>4.24 ± 7.47</td><td>7.52 ± 25.82</td><td>6.60 ± 22.96</td><td>3.65 ± 3.32</td><td>6.67 ± 22.29</td><td>7.75 ± 33.12</td><td>4.39 ± 9.00</td><td>5.72 ± 13.02</td><td>6.06 ± 18.74</td></tr><tr><td>Java250</td><td>3.87 ± 4.70</td><td>7.11 ± 21.18</td><td>7.82 ± 28.96</td><td>3.87 ± 4.25</td><td>6.41 ± 16.24</td><td>7.83 ± 25.06</td><td>4.71 ± 6.87</td><td>7.04 ± 15.29</td><td>8.92 ± 25.97</td></tr><tr><td>Python800</td><td>3.06 ± 1.87</td><td>5.21 ± 12.28</td><td>4.96 ± 8.47</td><td>4.12 ± 3.68</td><td>5.00 ± 10.83</td><td>4.63 ± 6.76</td><td>3.57 ± 3.04</td><td>5.29 ± 13.51</td><td>6.18 ± 11.45</td></tr><tr><td>C1000</td><td>3.00 ± 1.86</td><td>4.42 ± 7.49</td><td>4.13 ± 5.59</td><td>3.37 ± 2.38</td><td>5.14 ± 7.30</td><td>4.88 ± 6.24</td><td>3.39 ± 2.48</td><td>5.20 ± 7.43</td><td>5.43 ± 6.99</td></tr><tr><td>mean</td><td>3.52 ± 4.24</td><td>5.63 ± 15.21</td><td>5.65 ± 14.80</td><td>3.63 ± 3.39</td><td>5.38 ± 13.55</td><td>6.02 ± 16.87</td><td>3.67 ± 4.64</td><td>5.18 ± 11.14</td><td>6.29 ± 15.45</td></tr></table>"
1127
+ },
1128
+ {
1129
+ "type": "table_caption",
1130
+ "bbox": [
1131
+ 0.268,
1132
+ 0.191,
1133
+ 0.726,
1134
+ 0.204
1135
+ ],
1136
+ "angle": 0,
1137
+ "content": "Table 4: Replaced-variable number comparison, mean \\( \\pm \\) variance"
1138
+ },
1139
+ {
1140
+ "type": "table",
1141
+ "bbox": [
1142
+ 0.131,
1143
+ 0.218,
1144
+ 0.861,
1145
+ 0.334
1146
+ ],
1147
+ "angle": 0,
1148
+ "content": "<table><tr><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args)</td><td></td><td></td></tr><tr><td>Scanner obj = new Scanner(System.in);</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><tr><td>int a = obj.nextInt();</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><tr><td>int b = obj.nextInt();</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><tr><td>int out = 1;</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><tr><td>int ans = 0;</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><tr><td>while (out &lt; b) {</td><td>}</td><td>while (out &lt; h) {</td><td>}</td><td>}</td><td>while (tempOp &lt; colArr) {</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td></tr><tr><td>out--;</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><tr><td>out = out + a;</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><tr><td>ans++;</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><tr><td>}</td><td>}</td><td>System.out.println(ans);</td><td>}</td><td>}</td><td>System.out.println(number_array);</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td></tr><tr><td>Original Code</td><td>Adversarial Code from RNNS</td><td>Adversarial Code from MHM</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td></tr></table>"
1149
+ },
1150
+ {
1151
+ "type": "table_caption",
1152
+ "bbox": [
1153
+ 0.281,
1154
+ 0.345,
1155
+ 0.715,
1156
+ 0.358
1157
+ ],
1158
+ "angle": 0,
1159
+ "content": "Figure 2: Case study. Original vs. RNNS vs. MHM vs. ALERT"
1160
+ },
1161
+ {
1162
+ "type": "table",
1163
+ "bbox": [
1164
+ 0.156,
1165
+ 0.378,
1166
+ 0.843,
1167
+ 0.496
1168
+ ],
1169
+ "angle": 0,
1170
+ "content": "<table><tr><td rowspan=\"3\">Task</td><td colspan=\"4\">CodeBERT</td><td colspan=\"4\">GraphCodeBERT</td><td colspan=\"4\">CodeT5</td></tr><tr><td colspan=\"2\">RNNS-Unlimited</td><td colspan=\"2\">RNNS</td><td colspan=\"2\">RNNS-Unlimited</td><td colspan=\"2\">RNNS</td><td colspan=\"2\">RNNS-Unlimited</td><td colspan=\"2\">RNNS</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Defect</td><td>72.29</td><td>590.98</td><td>69.18</td><td>588.35</td><td>87.77</td><td>381.82</td><td>81.63</td><td>404.73</td><td>91.64</td><td>338.41</td><td>89.45</td><td>344.29</td></tr><tr><td>Clone</td><td>50.66</td><td>955.97</td><td>46.50</td><td>666.48</td><td>48.16</td><td>1105.11</td><td>41.28</td><td>1122.01</td><td>41.38</td><td>920.65</td><td>39.61</td><td>895.79</td></tr><tr><td>Authorship</td><td>91.74</td><td>447.68</td><td>73.39</td><td>1029.59</td><td>91.17</td><td>438.69</td><td>80.39</td><td>696.64</td><td>88.88</td><td>620.56</td><td>71.79</td><td>970.44</td></tr><tr><td>C1000</td><td>74.70</td><td>502.02</td><td>72.96</td><td>537.76</td><td>76.82</td><td>498.64</td><td>72.23</td><td>634.27</td><td>61.96</td><td>704.95</td><td>59.00</td><td>697.06</td></tr><tr><td>Python800</td><td>83.90</td><td>460.92</td><td>77.88</td><td>514.19</td><td>79.00</td><td>496.30</td><td>71.42</td><td>730.14</td><td>72.69</td><td>646.59</td><td>69.07</td><td>662.28</td></tr><tr><td>Java250</td><td>79.70</td><td>760.97</td><td>75.12</td><td>815.91</td><td>81.94</td><td>744.57</td><td>72.30</td><td>853.74</td><td>75.52</td><td>910.97</td><td>63.80</td><td>1049.46</td></tr><tr><td>Count</td><td>6/6</td><td>4/6</td><td>0/6</td><td>2/6</td><td>6/6</td><td>6/6</td><td>0/6</td><td>0/6</td><td>6/6</td><td>5/6</td><td>0/6</td><td>1/6</td></tr></table>"
1171
+ },
1172
+ {
1173
+ "type": "table_caption",
1174
+ "bbox": [
1175
+ 0.221,
1176
+ 0.505,
1177
+ 0.772,
1178
+ 0.519
1179
+ ],
1180
+ "angle": 0,
1181
+ "content": "Table 5: Results of ablation study, before and after removing constraints, ASR %."
1182
+ },
1183
+ {
1184
+ "type": "table",
1185
+ "bbox": [
1186
+ 0.139,
1187
+ 0.535,
1188
+ 0.468,
1189
+ 0.595
1190
+ ],
1191
+ "angle": 0,
1192
+ "content": "<table><tr><td rowspan=\"2\">Defended Model</td><td colspan=\"2\">RNNS</td><td colspan=\"2\">MHM</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Clone+CodeBert</td><td>12.90</td><td>958.35</td><td>28.17</td><td>1245.75</td></tr><tr><td>Defect+CodeBert</td><td>95.37</td><td>282.20</td><td>92.23</td><td>283.66</td></tr><tr><td>Authorship+CodeBert</td><td>51.88</td><td>1524.40</td><td>43.26</td><td>1026.08</td></tr></table>"
1193
+ },
1194
+ {
1195
+ "type": "table_caption",
1196
+ "bbox": [
1197
+ 0.155,
1198
+ 0.605,
1199
+ 0.444,
1200
+ 0.618
1201
+ ],
1202
+ "angle": 0,
1203
+ "content": "Table 6: Attack defended models, ASR %."
1204
+ },
1205
+ {
1206
+ "type": "table",
1207
+ "bbox": [
1208
+ 0.119,
1209
+ 0.631,
1210
+ 0.49,
1211
+ 0.68
1212
+ ],
1213
+ "angle": 0,
1214
+ "content": "<table><tr><td></td><td>ACC</td><td>ASR(RNNS)</td><td>ASR(MHM)</td><td>ASR(ALERT)</td></tr><tr><td>Authorship</td><td>90.62</td><td>19.81</td><td>23.58</td><td>14.28</td></tr><tr><td>Defect</td><td>65.14</td><td>40.46</td><td>23.69</td><td>24.53</td></tr><tr><td>Java250</td><td>97.63</td><td>19.67</td><td>6.65</td><td>42.91</td></tr></table>"
1215
+ },
1216
+ {
1217
+ "type": "table_caption",
1218
+ "bbox": [
1219
+ 0.114,
1220
+ 0.69,
1221
+ 0.489,
1222
+ 0.717
1223
+ ],
1224
+ "angle": 0,
1225
+ "content": "Table 7: Results of contrastive adversarial retraining, model: CodeBERT."
1226
+ },
1227
+ {
1228
+ "type": "text",
1229
+ "bbox": [
1230
+ 0.113,
1231
+ 0.743,
1232
+ 0.489,
1233
+ 0.919
1234
+ ],
1235
+ "angle": 0,
1236
+ "content": "is 4.22-6.7 times that of RNNS, and the ASR of PSQ algorithm is \\(5.55\\% - 27.82\\%\\) lower than that of RNNS algorithm. It can be inferred that for code variable attacks, combinatorial optimization is inefficient when the substitute set of variables is relatively large. The main reasons are the following two points. Firstly, code segments are generally longer, and the substitute set of code variables is much larger than the synonym set of natural language words. Secondly, the impact of variable replacement on code semantics is smaller than that"
1237
+ },
1238
+ {
1239
+ "type": "table",
1240
+ "bbox": [
1241
+ 0.517,
1242
+ 0.535,
1243
+ 0.879,
1244
+ 0.587
1245
+ ],
1246
+ "angle": 0,
1247
+ "content": "<table><tr><td rowspan=\"2\">Task+Model</td><td colspan=\"2\">RNNS</td><td colspan=\"2\">PSO</td><td colspan=\"2\">LSH</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Defect+CodeBert</td><td>69.18</td><td>588.35</td><td>63.63</td><td>3945.04</td><td>26.62</td><td>321.78</td></tr><tr><td>Authorship+CodeBert</td><td>73.39</td><td>1029.59</td><td>52.29</td><td>4350.00</td><td>19.26</td><td>458.55</td></tr><tr><td>Java250+CodeBert</td><td>75.12</td><td>815.91</td><td>47.3</td><td>5076.02</td><td>31.58</td><td>397.05</td></tr></table>"
1248
+ },
1249
+ {
1250
+ "type": "table_caption",
1251
+ "bbox": [
1252
+ 0.55,
1253
+ 0.597,
1254
+ 0.84,
1255
+ 0.61
1256
+ ],
1257
+ "angle": 0,
1258
+ "content": "Table 8: RNNS vs PSO and LSH, ASR %."
1259
+ },
1260
+ {
1261
+ "type": "text",
1262
+ "bbox": [
1263
+ 0.509,
1264
+ 0.624,
1265
+ 0.884,
1266
+ 0.64
1267
+ ],
1268
+ "angle": 0,
1269
+ "content": "of word replacement on natural language semantics."
1270
+ },
1271
+ {
1272
+ "type": "text",
1273
+ "bbox": [
1274
+ 0.508,
1275
+ 0.656,
1276
+ 0.883,
1277
+ 0.768
1278
+ ],
1279
+ "angle": 0,
1280
+ "content": "RNNS's QT is 1.8-2.2 times that of LSH, and the QT has dropped significantly. However, LSH's ASR is inferior to RNNS by \\(42.56\\% - 54.13\\%\\). For code variable attacks, LSH has high efficiency, but its effectiveness is relatively low. One possible reason for LSH causing low ASR is the distribution of adversarial samples in each bucket is uneven."
1281
+ },
1282
+ {
1283
+ "type": "title",
1284
+ "bbox": [
1285
+ 0.509,
1286
+ 0.781,
1287
+ 0.666,
1288
+ 0.796
1289
+ ],
1290
+ "angle": 0,
1291
+ "content": "6 Related Work"
1292
+ },
1293
+ {
1294
+ "type": "text",
1295
+ "bbox": [
1296
+ 0.507,
1297
+ 0.807,
1298
+ 0.884,
1299
+ 0.919
1300
+ ],
1301
+ "angle": 0,
1302
+ "content": "Adversarial attacks for code models have been widely studied (Yang et al., 2022; Liu et al., 2023a; Li et al., 2023; Jha and Reddy, 2023). These works can be generally categorized into black-box attacks and white-box attacks. A black-box attack for code models queries the model outputs and selects the substitutes using a score function. For example,"
1303
+ },
1304
+ {
1305
+ "type": "page_number",
1306
+ "bbox": [
1307
+ 0.481,
1308
+ 0.928,
1309
+ 0.52,
1310
+ 0.941
1311
+ ],
1312
+ "angle": 0,
1313
+ "content": "9713"
1314
+ }
1315
+ ],
1316
+ [
1317
+ {
1318
+ "type": "table",
1319
+ "bbox": [
1320
+ 0.145,
1321
+ 0.082,
1322
+ 0.46,
1323
+ 0.172
1324
+ ],
1325
+ "angle": 0,
1326
+ "content": "<table><tr><td>Algorithm</td><td>Substitutes Size</td><td>Substitutes Source</td><td>Replacement Position</td><td>Substitutes Selection</td></tr><tr><td>MHM</td><td>medium</td><td>vocabulary</td><td>random</td><td>random sample</td></tr><tr><td>ALERT</td><td>small</td><td>model generation</td><td>importance score</td><td>traverse</td></tr><tr><td>RNNS</td><td>large</td><td>real public variables</td><td>uncertainty score</td><td>efficient constrained search</td></tr></table>"
1327
+ },
1328
+ {
1329
+ "type": "table_caption",
1330
+ "bbox": [
1331
+ 0.131,
1332
+ 0.183,
1333
+ 0.468,
1334
+ 0.195
1335
+ ],
1336
+ "angle": 0,
1337
+ "content": "Table 9: Difference between RNNS to the others."
1338
+ },
1339
+ {
1340
+ "type": "text",
1341
+ "bbox": [
1342
+ 0.117,
1343
+ 0.208,
1344
+ 0.49,
1345
+ 0.56
1346
+ ],
1347
+ "angle": 0,
1348
+ "content": "ALERT (Yang et al., 2022) finds the adversarial examples using variable-name substitutes generated by pre-trained masked models. MHM (Zhang et al., 2020) uses Metropolis-Hastings to sample the replacement of code identifiers. STRATA (Springer et al., 2020) generates adversarial examples by replacing the code tokens based on the token distribution. Chen et al. (2022) apply pre-defined semantics-preserving code transformations to attack code models. CodeAttack (Jha and Reddy, 2023) uses code structure to generate adversarial data. White-box attacks require the code model gradient to modify inputs for adversarial example generation. CARROT (Zhang et al., 2022) selects code mutated variants based on the model gradient. Henkel et al. (2022) attack code models by gradient-based optimization of the abstract syntax tree transformation. Srikant et al. (2021) uses optimized program obfuscations to modify the code. DAMP (Yefet et al., 2020) derives the desired wrong prediction by changing inputs guided by the model gradient."
1349
+ },
1350
+ {
1351
+ "type": "text",
1352
+ "bbox": [
1353
+ 0.117,
1354
+ 0.562,
1355
+ 0.486,
1356
+ 0.849
1357
+ ],
1358
+ "angle": 0,
1359
+ "content": "Table 9 demonstrates the differences among RNNS, MHM (Zhang et al., 2020) and ALERT (Yang et al., 2022). MHM and ALERT represent the two methodologies most closely aligned with our research. Our approach considers identifier replacements like MHM and ALERT, ensuring that the adversarial example keeps the same semantics as the original one. Our substitute size is scalable and can be substantial, and RNNS searches the possible next adversarial example in the substitute space. In our approach, we locate vulnerable variables based on the uncertainty and search \\( \\text{sub}_{\\text{topk}} \\) without building adversarial samples and actual attacks. Our goal is to obtain high ASRs by searching real variable names. MHM has the same goal as ours but synthesizes variable names. ALERT sacrifices ASR to make the variable name readable."
1360
+ },
1361
+ {
1362
+ "type": "title",
1363
+ "bbox": [
1364
+ 0.114,
1365
+ 0.863,
1366
+ 0.245,
1367
+ 0.877
1368
+ ],
1369
+ "angle": 0,
1370
+ "content": "7 Conclusion"
1371
+ },
1372
+ {
1373
+ "type": "text",
1374
+ "bbox": [
1375
+ 0.113,
1376
+ 0.888,
1377
+ 0.489,
1378
+ 0.918
1379
+ ],
1380
+ "angle": 0,
1381
+ "content": "We propose a novel black-box adversarial search-based attack for variable replacement. RNNS has"
1382
+ },
1383
+ {
1384
+ "type": "text",
1385
+ "bbox": [
1386
+ 0.508,
1387
+ 0.085,
1388
+ 0.884,
1389
+ 0.293
1390
+ ],
1391
+ "angle": 0,
1392
+ "content": "three main contributions: 1) This work proposes a non-generation search-based black-box attacking method via predicting the attack effect of a substitute. This method can greatly reduce the verification cost of the substitute, remove the restrictions on the size and diversity of the substitute set, and achieve a significant improvement in terms of ASR without increasing QT. 2) This work proposes a simple and efficient method for constructing a substitute set. This method can construct a large-scale, diverse, and real substitute set at low cost. 3) The adversarial examples from RNNS can be used to improve the model robustness."
1393
+ },
1394
+ {
1395
+ "type": "title",
1396
+ "bbox": [
1397
+ 0.509,
1398
+ 0.308,
1399
+ 0.644,
1400
+ 0.322
1401
+ ],
1402
+ "angle": 0,
1403
+ "content": "8 Limitations"
1404
+ },
1405
+ {
1406
+ "type": "text",
1407
+ "bbox": [
1408
+ 0.508,
1409
+ 0.334,
1410
+ 0.884,
1411
+ 0.703
1412
+ ],
1413
+ "angle": 0,
1414
+ "content": "There are some limitations of RNNS. Firstly, RNNS does not revert to the preceding step to persist with the search upon an increase in the model probability of the ground truth label. While the incorporation of this step may bolster the Attack Success Rate (ASR), it could potentially compromise the Query Time (QT). Secondly, the size and diversity of the substitute set significantly influence RNNS; a minimal and homogeneous set can precipitate a diminished attack success rate. Thirdly, RNNS involves multiple hyperparameters whose values need to be manually set. One of the most important parameters is the moving parameter \\(\\alpha\\). The number of attacking iterations max itr is also significant. We set \\(\\alpha\\) to 0.2 and max itr to 6 with some small experimental trials. Fourthly, RNNS currently only targets untargeted attack scenarios, for targeted attacks, ASR will be very low when there are many category labels. For example, when performing targeted attacks on Authorship+Codebert with 66 labels, the ASR can only reach \\(6.4\\%\\). How to migrate to targeted attacks is a direction we need to study in the future."
1415
+ },
1416
+ {
1417
+ "type": "title",
1418
+ "bbox": [
1419
+ 0.51,
1420
+ 0.717,
1421
+ 0.665,
1422
+ 0.733
1423
+ ],
1424
+ "angle": 0,
1425
+ "content": "Acknowledgment"
1426
+ },
1427
+ {
1428
+ "type": "text",
1429
+ "bbox": [
1430
+ 0.508,
1431
+ 0.743,
1432
+ 0.883,
1433
+ 0.904
1434
+ ],
1435
+ "angle": 0,
1436
+ "content": "This work is supported by NRF and the CSA under its National Cybersecurity R&D Programme (NCRP25-P04-TAICeN), NRF and DSO National Laboratories under the AI Singapore Programme (AISG Award No: AISG2-RP-2020-019), and NRF Investigatorship NRF-NRFI06-2020-0001. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of NRF and CSA Singapore."
1437
+ },
1438
+ {
1439
+ "type": "page_number",
1440
+ "bbox": [
1441
+ 0.481,
1442
+ 0.929,
1443
+ 0.521,
1444
+ 0.941
1445
+ ],
1446
+ "angle": 0,
1447
+ "content": "9714"
1448
+ }
1449
+ ],
1450
+ [
1451
+ {
1452
+ "type": "title",
1453
+ "bbox": [
1454
+ 0.116,
1455
+ 0.085,
1456
+ 0.214,
1457
+ 0.099
1458
+ ],
1459
+ "angle": 0,
1460
+ "content": "References"
1461
+ },
1462
+ {
1463
+ "type": "ref_text",
1464
+ "bbox": [
1465
+ 0.117,
1466
+ 0.107,
1467
+ 0.487,
1468
+ 0.173
1469
+ ],
1470
+ "angle": 0,
1471
+ "content": "Wasi Ahmad, Saikat Chakraborty, Baishakhi Ray, and Kai-Wei Chang. 2020. A transformer-based approach for source code summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4998-5007."
1472
+ },
1473
+ {
1474
+ "type": "ref_text",
1475
+ "bbox": [
1476
+ 0.117,
1477
+ 0.181,
1478
+ 0.488,
1479
+ 0.26
1480
+ ],
1481
+ "angle": 0,
1482
+ "content": "Bander Alsulami, Edwin Dauber, Richard Harang, Spiros Mancoridis, and Rachel Greenstadt. 2017. Source code authorship attribution using long short-term memory based networks. In Computer Security - ESORICS 2017, pages 65-82, Cham. Springer International Publishing."
1483
+ },
1484
+ {
1485
+ "type": "ref_text",
1486
+ "bbox": [
1487
+ 0.117,
1488
+ 0.268,
1489
+ 0.488,
1490
+ 0.346
1491
+ ],
1492
+ "angle": 0,
1493
+ "content": "Penglong Chen, Zhen Li, Yu Wen, and Lili Liu. 2022. Generating adversarial source programs using important tokens-based structural transformations. In 2022 26th International Conference on Engineering of Complex Computer Systems (ICECCS), pages 173-182."
1494
+ },
1495
+ {
1496
+ "type": "ref_text",
1497
+ "bbox": [
1498
+ 0.117,
1499
+ 0.355,
1500
+ 0.488,
1501
+ 0.434
1502
+ ],
1503
+ "angle": 0,
1504
+ "content": "Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. 2020. Codebert: A pre-trained model for programming and natural languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1536-1547."
1505
+ },
1506
+ {
1507
+ "type": "ref_text",
1508
+ "bbox": [
1509
+ 0.117,
1510
+ 0.443,
1511
+ 0.488,
1512
+ 0.495
1513
+ ],
1514
+ "angle": 0,
1515
+ "content": "Xiaodong Gu, Hongyu Zhang, and Sunghun Kim. 2018. Deep code search. In 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE), pages 933-944. IEEE."
1516
+ },
1517
+ {
1518
+ "type": "ref_text",
1519
+ "bbox": [
1520
+ 0.117,
1521
+ 0.504,
1522
+ 0.488,
1523
+ 0.581
1524
+ ],
1525
+ "angle": 0,
1526
+ "content": "Daya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng, Duyu Tang, LIU Shujie, Long Zhou, Nan Duan, Alexey Svyatkovskiy, Shengyu Fu, et al. 2020. Graphcodebert: Pre-training code representations with data flow. In International Conference on Learning Representations."
1527
+ },
1528
+ {
1529
+ "type": "ref_text",
1530
+ "bbox": [
1531
+ 0.117,
1532
+ 0.591,
1533
+ 0.488,
1534
+ 0.669
1535
+ ],
1536
+ "angle": 0,
1537
+ "content": "Jordan Henkel, Goutham Ramakrishnan, Zi Wang, Aws Albarghouthi, Somesh Jha, and Thomas Reps. 2022. Semantic robustness of models of source code. In 2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER), pages 526-537."
1538
+ },
1539
+ {
1540
+ "type": "ref_text",
1541
+ "bbox": [
1542
+ 0.117,
1543
+ 0.678,
1544
+ 0.488,
1545
+ 0.744
1546
+ ],
1547
+ "angle": 0,
1548
+ "content": "Akshita Jha and Chandan K Reddy. 2023. Codeattack: Code-based adversarial attacks for pre-trained programming language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 14892-14900."
1549
+ },
1550
+ {
1551
+ "type": "ref_text",
1552
+ "bbox": [
1553
+ 0.117,
1554
+ 0.753,
1555
+ 0.488,
1556
+ 0.819
1557
+ ],
1558
+ "angle": 0,
1559
+ "content": "Liuqing Li, He Feng, Wenjie Zhuang, Na Meng, and Barbara Ryder. 2017. Cclearner: A deep learning-based clone detection approach. In 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME), pages 249-260. IEEE."
1560
+ },
1561
+ {
1562
+ "type": "ref_text",
1563
+ "bbox": [
1564
+ 0.117,
1565
+ 0.826,
1566
+ 0.488,
1567
+ 0.919
1568
+ ],
1569
+ "angle": 0,
1570
+ "content": "Yanzhou Li, Shangqing Liu, Kangjie Chen, Xiaofei Xie, Tianwei Zhang, and Yang Liu. 2023. Multi-target backdoor attacks for code pre-trained models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7236-7254, Toronto, Canada. Association for Computational Linguistics."
1571
+ },
1572
+ {
1573
+ "type": "list",
1574
+ "bbox": [
1575
+ 0.117,
1576
+ 0.107,
1577
+ 0.488,
1578
+ 0.919
1579
+ ],
1580
+ "angle": 0,
1581
+ "content": null
1582
+ },
1583
+ {
1584
+ "type": "ref_text",
1585
+ "bbox": [
1586
+ 0.513,
1587
+ 0.086,
1588
+ 0.882,
1589
+ 0.152
1590
+ ],
1591
+ "angle": 0,
1592
+ "content": "Yaoxian Li, Shiyi Qi, Cuiyun Gao, Yun Peng, David Lo, Zenglin Xu, and Michael R Lyu. 2022. A closer look into transformer-based code intelligence through code transformation: Challenges and opportunities. arXiv preprint arXiv:2207.04285."
1593
+ },
1594
+ {
1595
+ "type": "ref_text",
1596
+ "bbox": [
1597
+ 0.512,
1598
+ 0.166,
1599
+ 0.882,
1600
+ 0.219
1601
+ ],
1602
+ "angle": 0,
1603
+ "content": "Shangqing Liu, Yu Chen, Xiaofei Xie, Jing Kai Siow, and Yang Liu. 2020. Retrieval-augmented generation for code summarization via hybrid gnn. In International Conference on Learning Representations."
1604
+ },
1605
+ {
1606
+ "type": "ref_text",
1607
+ "bbox": [
1608
+ 0.512,
1609
+ 0.232,
1610
+ 0.882,
1611
+ 0.298
1612
+ ],
1613
+ "angle": 0,
1614
+ "content": "Shangqing Liu, Bozhi Wu, Xiaofei Xie, Guozhu Meng, and Yang Liu. 2023a. Contrabert: Enhancing code pre-trained models via contrastive learning. In 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE), pages 2476-2487."
1615
+ },
1616
+ {
1617
+ "type": "ref_text",
1618
+ "bbox": [
1619
+ 0.512,
1620
+ 0.311,
1621
+ 0.882,
1622
+ 0.377
1623
+ ],
1624
+ "angle": 0,
1625
+ "content": "Shangqing Liu, Xiaofei Xie, Jingkai Siow, Lei Ma, Guozhu Meng, and Yang Liu. 2023b. Graphsearch-net: Enhancing gnns via capturing global dependencies for semantic code search. IEEE Transactions on Software Engineering."
1626
+ },
1627
+ {
1628
+ "type": "ref_text",
1629
+ "bbox": [
1630
+ 0.512,
1631
+ 0.391,
1632
+ 0.882,
1633
+ 0.457
1634
+ ],
1635
+ "angle": 0,
1636
+ "content": "Rishabh Maheshwary, Saket Maheshwary, and Vikram Pudi. 2021. A strong baseline for query efficient attacks in a black box setting. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8396-8409."
1637
+ },
1638
+ {
1639
+ "type": "ref_text",
1640
+ "bbox": [
1641
+ 0.512,
1642
+ 0.47,
1643
+ 0.882,
1644
+ 0.562
1645
+ ],
1646
+ "angle": 0,
1647
+ "content": "Ruchir Puri, David Kung, Geert Janssen, Wei Zhang, Giacomo Domeniconi, Vladimir Zolotov, Julian Dolby, Jie Chen, Mihir Choudhury, Lindsey Decker, Veronika Thost, Luca Buratti, Saurabh Pajar, Shyam Ramji, Ulrich Finkler, Susan Malaika, and Frederick Reiss. 2021. Codenet: A large-scale ai for code dataset for learning a diversity of coding tasks."
1648
+ },
1649
+ {
1650
+ "type": "ref_text",
1651
+ "bbox": [
1652
+ 0.512,
1653
+ 0.576,
1654
+ 0.882,
1655
+ 0.627
1656
+ ],
1657
+ "angle": 0,
1658
+ "content": "Jacob M Springer, Bryn Marie Reinstadler, and Una-May O'Reilly. 2020. Strata: Simple, gradient-free attacks for models of code. arXiv preprint arXiv:2009.13562."
1659
+ },
1660
+ {
1661
+ "type": "ref_text",
1662
+ "bbox": [
1663
+ 0.512,
1664
+ 0.642,
1665
+ 0.882,
1666
+ 0.708
1667
+ ],
1668
+ "angle": 0,
1669
+ "content": "Shashank Srikant, Sijia Liu, Tamara Mitrovska, Shiyu Chang, Quanfu Fan, Gaoyuan Zhang, and Una-May O'Reilly. 2021. Generating adversarial computer programs using optimized obfuscations. In International Conference on Learning Representations."
1670
+ },
1671
+ {
1672
+ "type": "ref_text",
1673
+ "bbox": [
1674
+ 0.512,
1675
+ 0.721,
1676
+ 0.882,
1677
+ 0.8
1678
+ ],
1679
+ "angle": 0,
1680
+ "content": "Wenhan Wang, Ge Li, Bo Ma, Xin Xia, and Zhi Jin. 2020. Detecting code clones with graph neural network and flow-augmented abstract syntax tree. In 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER), pages 261-271. IEEE."
1681
+ },
1682
+ {
1683
+ "type": "ref_text",
1684
+ "bbox": [
1685
+ 0.512,
1686
+ 0.814,
1687
+ 0.882,
1688
+ 0.919
1689
+ ],
1690
+ "angle": 0,
1691
+ "content": "Yue Wang, Weishi Wang, Shafiq Joty, and Steven C.H. Hoi. 2021. CodeT5: Identifier-aware unified pretrained encoder-decoder models for code understanding and generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8696-8708, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics."
1692
+ },
1693
+ {
1694
+ "type": "list",
1695
+ "bbox": [
1696
+ 0.512,
1697
+ 0.086,
1698
+ 0.882,
1699
+ 0.919
1700
+ ],
1701
+ "angle": 0,
1702
+ "content": null
1703
+ },
1704
+ {
1705
+ "type": "page_number",
1706
+ "bbox": [
1707
+ 0.481,
1708
+ 0.929,
1709
+ 0.521,
1710
+ 0.941
1711
+ ],
1712
+ "angle": 0,
1713
+ "content": "9715"
1714
+ }
1715
+ ],
1716
+ [
1717
+ {
1718
+ "type": "ref_text",
1719
+ "bbox": [
1720
+ 0.117,
1721
+ 0.086,
1722
+ 0.487,
1723
+ 0.152
1724
+ ],
1725
+ "angle": 0,
1726
+ "content": "Martin White, Michele Tufano, Christopher Vendome, and Denys Poshyvanyk. 2016. Deep learning code fragments for code clone detection. In 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 87-98. IEEE."
1727
+ },
1728
+ {
1729
+ "type": "ref_text",
1730
+ "bbox": [
1731
+ 0.117,
1732
+ 0.162,
1733
+ 0.487,
1734
+ 0.241
1735
+ ],
1736
+ "angle": 0,
1737
+ "content": "Zhou Yang, Jieke Shi, Junda He, and David Lo. 2022. Natural attack for pre-trained models of code. In Proceedings of the 44th International Conference on Software Engineering, ICSE '22, page 1482-1493, New York, NY, USA. Association for Computing Machinery."
1738
+ },
1739
+ {
1740
+ "type": "ref_text",
1741
+ "bbox": [
1742
+ 0.117,
1743
+ 0.251,
1744
+ 0.487,
1745
+ 0.302
1746
+ ],
1747
+ "angle": 0,
1748
+ "content": "Noam Yefet, Uri Alon, and Eran Yahav. 2020. Adversarial examples for models of code. Proceedings of the ACM on Programming Languages, 4(OOPSLA):1-30."
1749
+ },
1750
+ {
1751
+ "type": "ref_text",
1752
+ "bbox": [
1753
+ 0.117,
1754
+ 0.313,
1755
+ 0.487,
1756
+ 0.392
1757
+ ],
1758
+ "angle": 0,
1759
+ "content": "Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020. Word-level textual adversarial attacking as combinatorial optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6066-6080."
1760
+ },
1761
+ {
1762
+ "type": "ref_text",
1763
+ "bbox": [
1764
+ 0.117,
1765
+ 0.402,
1766
+ 0.487,
1767
+ 0.468
1768
+ ],
1769
+ "angle": 0,
1770
+ "content": "Huangzhao Zhang, Zhiyi Fu, Ge Li, Lei Ma, Zhehao Zhao, Hua'an Yang, Yizhe Sun, Yang Liu, and Zhi Jin. 2022. Towards robustness of deep program processing models—detection, estimation, and enhancement. ACM Trans. Softw. Eng. Methodol., 31(3)."
1771
+ },
1772
+ {
1773
+ "type": "ref_text",
1774
+ "bbox": [
1775
+ 0.117,
1776
+ 0.478,
1777
+ 0.487,
1778
+ 0.544
1779
+ ],
1780
+ "angle": 0,
1781
+ "content": "Huangzhao Zhang, Zhuo Li, Ge Li, Lei Ma, Yang Liu, and Zhi Jin. 2020. Generating adversarial examples for holding robustness of source code processing models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1169-1176."
1782
+ },
1783
+ {
1784
+ "type": "ref_text",
1785
+ "bbox": [
1786
+ 0.117,
1787
+ 0.554,
1788
+ 0.487,
1789
+ 0.633
1790
+ ],
1791
+ "angle": 0,
1792
+ "content": "Vitalii Zhelezniak, Aleksandar Savkov, and Nils Hammerla. 2020. Estimating mutual information between dense word embeddings. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8361-8371, Online. Association for Computational Linguistics."
1793
+ },
1794
+ {
1795
+ "type": "ref_text",
1796
+ "bbox": [
1797
+ 0.117,
1798
+ 0.642,
1799
+ 0.487,
1800
+ 0.708
1801
+ ],
1802
+ "angle": 0,
1803
+ "content": "Yaqin Zhou, Shangqing Liu, Jingkai Siow, Xiaoning Du, and Yang Liu. 2019. Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks. Advances in neural information processing systems, 32."
1804
+ },
1805
+ {
1806
+ "type": "list",
1807
+ "bbox": [
1808
+ 0.117,
1809
+ 0.086,
1810
+ 0.487,
1811
+ 0.708
1812
+ ],
1813
+ "angle": 0,
1814
+ "content": null
1815
+ },
1816
+ {
1817
+ "type": "page_number",
1818
+ "bbox": [
1819
+ 0.481,
1820
+ 0.929,
1821
+ 0.521,
1822
+ 0.941
1823
+ ],
1824
+ "angle": 0,
1825
+ "content": "9716"
1826
+ }
1827
+ ]
1828
+ ]
2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/21af0af7-6fd8-4600-8ad6-54b767b85a85_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5fefb94e85c1f0fdd8d963b9a4726be3c2c7b8b0329323569f5bab42311e69a
3
+ size 404359
2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/full.md ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Black-Box Attack on Code Models via Representation Nearest Neighbor Search
2
+
3
+ Jie Zhang $^{1*}$ , Wei Ma $^{2\dagger}$ , Qiang Hu $^{3}$ , Shangqing Liu $^{2}$ , Xiaofei Xie $^{4}$ , Yves Le Traon $^{3}$ , and Yang Liu $^{2}$
4
+
5
+ <sup>1</sup>Noah's Ark Lab, Huawei
6
+
7
+ $^{2}$ School of Computer Science and Engineering, Nanyang Technological University
8
+
9
+ <sup>3</sup>The Interdisciplinary Centre for Security, Reliability and Trust, University of Luxembourg
10
+
11
+ $^{4}$ School of Computing and Information Systems, Singapore Management University
12
+
13
+ # Abstract
14
+
15
+ Existing methods for generating adversarial code examples face several challenges: limited availability of substitute variables, high verification costs for these substitutes, and the creation of adversarial samples with noticeable perturbations. To address these concerns, our proposed approach, RNNS, uses a search seed based on historical attacks to find potential adversarial substitutes. Rather than directly using the discrete substitutes, they are mapped to a continuous vector space using a pre-trained variable name encoder. Based on the vector representation, RNNS predicts and selects better substitutes for attacks. We evaluated the performance of RNNS across six coding tasks encompassing three programming languages: Java, Python, and C. We employed three pre-trained code models (CodeBERT, GraphCodeBERT, and CodeT5) that resulted in a cumulative of 18 victim models. The results demonstrate that RNNS outperforms baselines in terms of ASR and QT. Furthermore, the perturbation of adversarial examples introduced by RNNS is smaller compared to the baselines in terms of the number of replaced variables and the change in variable length. Lastly, our experiments indicate that RNNS is efficient in attacking defended models and can be employed for adversarial training.
16
+
17
+ # 1 Introduction
18
+
19
+ Recently, since programming language can be seen as one kind of textual data and also inspired by the success of deep learning for text processing and understanding, researchers have tried to pretrain code models such as CodeBERT (Feng et al., 2020), GraphCodeBERT (Guo et al., 2020), ContrabERT (Liu et al., 2023a) to help developers to solve multiple programming tasks, e.g., code search (Gu et al., 2018; Liu et al., 2023b), code clone detection (White et al., 2016; Li et al., 2017), code sum
20
+
21
+ marization (Ahmad et al., 2020; Liu et al., 2020), and vulnerability detection (Zhou et al., 2019). Although these code models have achieved good performance on many code tasks, they are still suffering from robustness issues. A few adversarial attack methods have emerged to evaluate and improve the robustness of code models.
22
+
23
+ There are certain considerations to be made. Firstly, code pre-training models are frequently deployed remotely, which limits access to the model parameters and renders white-box attacks infeasible. Secondly, among the numerous code-equivalent transformation methods, variable substitution exerts the most significant influence on the resilience of large code models while being the least detectable transformation (Li et al., 2022). As a result, black-box attack techniques based on variable substitution have emerged as a valuable avenue for research and multiple works have been proposed such as ALERT (Yang et al., 2022) and MHM (Zhang et al., 2020).
24
+
25
+ However, these works have three limitations: 1) The number of substitute variables is limited and lacks diversity, which lowers the upper bound of the attack success rate. For example, ALERT employs 60 substitute variables for each variable, which are generated by a pre-trained model, and the substitute variables lack diversity. MHM also randomly selects 1500 words from a fixed dictionary as substitute variables. 2) The verification cost of substitute variables is high. To verify the attack effect of each substitute, it is necessary to replace the source variable with an adversarial sample and perform an actual attack on the victim model. ALERT uses a traversal method to select substitute variables, and in order to reduce the number of attacks, it limits the number of substitute variables; MHM uses a random sampling method to select substitute variables in order to reduce the number of attacks. Neither method is conducive to cost-effective attacks. 3) The generated adversarial samples have
26
+
27
+ large perturbations. Each adversarial sample usually needs to replace multiple original variables to succeed in attacking, and MHM easily generates semantically incoherent and excessively long variable names.
28
+
29
+ To address the aforementioned challenges, in this paper, we propose a search-based black-box adversarial attack method to create challenging adversarial samples based on the search seed vector in the variable representation space, namely Representation Nearest Neighbor Search (RNNS). Specifically, RNNS, first utilizes publicly available real code datasets to construct a large original substitute set, denoted as $subs_{original}$ . Then, based on the previous attack results, RNNS predicts the search seed vector required for the next round of attacks and efficiently searches for the $k$ nearest substitutes to the seed vector from the large-scale original substitute set to form the $subs_{topk}$ , where $k$ is much smaller than the size of the original substitute set. The generation process of the $subs_{topk}$ does not involve attacking the victim model even once. Furthermore, the length and similarity of the substitute must adhere to specific perturbation constraints to prevent excessive deviations from $var$ .
30
+
31
+ To evaluate the effectiveness of RNNS, we investigate three pre-trained code models, CodeBERT (Feng et al., 2020), GraphCodeBERT (Guo et al., 2020) and CodeT5 (Wang et al., 2021), and perform the attack on six code tasks in three programming languages, i.e., Java, Python, and C. The results on 18 victim models demonstrate that compared to the approaches MHM and ALERT, RNNS achieves a higher attack success rate (ASR) with a maximum of about $100\%$ improvement and 18/18 times as the winner. Meanwhile, RNNS needs fewer query times (QT) with 8/18 times as the winners. Furthermore, we analyze the quality of adversarial examples statistically and find that RNNS introduces minor perturbations. In the end, we apply RNNS to attack three defended models and find that our approach outperforms the baselines by up to $32.07\%$ ASR. We also use adversarial examples to improve the model's robustness through contrastive adversarial training.
32
+
33
+ # 2 Preliminaries
34
+
35
+ # 2.1 Textual Code Processing
36
+
37
+ The nature of code data (in text format with discrete input space) makes it impossible to feed one
38
+
39
+ $$
40
+ \begin{array}{c c} x = \left( \begin{array}{c} S _ {0} \\ ... \\ S _ {i} \\ ... \\ S _ {j} \\ ... \\ S _ {l} \end{array} \right) \longrightarrow R ^ {l \times d} = \left( \begin{array}{c} \boldsymbol {v} _ {0} \\ ... \\ \boldsymbol {v} _ {i} \\ ... \\ \boldsymbol {v} _ {j} \\ ... \\ \boldsymbol {v} _ {l} \end{array} \right) \longrightarrow \boxed {f (\theta)} \\ \text {M o d e l} & \longrightarrow \left( \begin{array}{c} p _ {0} \\ ... \\ p _ {g} \\ ... \\ p _ {k} \end{array} \right) \\ \text {D o m a i n P r o b a b i l i t y} \\ \text {S p a c e} & \text {S p a c e} \end{array}
41
+ $$
42
+
43
+ Figure 1: One code model demo on the downstream task.
44
+
45
+ code input $x$ directly into deep learning models. Thus, transferring code data to learnable continuous vectors is the first step in source code learning. Dense encoding (Zhelezniak et al., 2020) is one common method used to vectorize textual code data. To do so, first, we need to learn a tokenizer that splits the code text into a token sequence which is called Tokenization. After tokenization, code $x$ is represented by a sequence of tokens, namely, $x = (s_0, \dots, s_j, \dots, s_l)$ where $s_i$ is one token. Then, the code vocabulary dictionary is built by using all the appeared tokens $s_i$ , denoted $\mathbb{V}$ . After that, every word (token) in $\mathbb{V}$ is embedded by learned vectors $\boldsymbol{v}_i$ with dimension $d$ . Here, we use $E^{|\mathbb{V}| \times d}$ to represent the embedding matrix for $\mathbb{V}$ . Finally, $x$ can be converted into a embedding matrix $R^{l \times d} = (v_0, \dots, v_j, \dots, v_l)$ . After this code encoding, pre-trained code models based on the transformer take the matrix $R^{l \times d}$ as inputs and learn the contextual representation of $x$ for downstream tasks via pre-training such as Masked Language Modeling (MLM) and Causal Language Modeling (CLM).
46
+
47
+ Figure 1 illustrates the main steps of the code processing models for the downstream classification tasks. First, we tokenize the textual code $x$ into a token sequence that is represented in a discrete integer space. Then, we map the discrete sequence ids into the token vector space $R^{l \times d}$ . Next, we feed the token vectors into the task model $f(\theta)$ . $f(\theta)$ is built on top of pre-trained models. Finally, we can predict the domain probabilities after fine-tuning.
48
+
49
+ # 2.2 Problem Statement
50
+
51
+ Since many critical code tasks are classification problems, e.g., defect prediction and code clone detection. In this paper, we focus on the adversarial attack for code classification tasks. Considering a code classification task, we use $f(x; \theta) \to y: R^{l \times d} \to \mathbb{C} = \{i | 0 \leq i \leq n\}$ to denote the victim model that maps a code token sequence $x$ to a label $y$ from a label set $\mathbb{C}$ with size $n$ , where
52
+
53
+ $l$ is the sequence length and $d$ is the token vector dimension, and $i$ is one integer. By querying dictionary dense embedding $\pmb{E}^{|\mathbb{V}\times d|}$ , a code token sequence $x = (s_0,\dots,s_j,\dots,s_l)$ , is vectorized into $\pmb{R}^{l\times d}$ . Adversarial attacks for code models create an adversarial example $x^{\prime}$ by modifying some vulnerable tokens of $x$ with a limited maximum perturbation $\epsilon$ to change the correct label $y$ to a wrong label $y^\prime$ . Simply, we get a perturbed $x^{\prime}$ by modifying some tokens in $(s_0,\dots,s_j,\dots,s_l)$ such that $f(x^{\prime};\theta)\neq f(x;\theta)$ where $x^{\prime} = x + \sigma$ and $x^{\prime}$ has to have the same behavior with $x$ , + represent perturbation execution, $\sigma$ is the perturbation code transformation for $(s_0,\dots,s_j,\dots,s_l)$ , and $\sigma \leq \epsilon$ . We target the more practical attacking scenario - black-box attack that requires less information. We assume we cannot access the model parameters and can only utilize the final output of model $f(x;\theta)$ to conduct the attack.
54
+
55
+ # 3 Methodology
56
+
57
+ # 3.1 Motivation
58
+
59
+ As mentioned in the introduction, the current methods face three limitations: 1) there is a limited number of substitute variables; 2) there is a high verification cost associated with substitute variables; and 3) the generated adversarial samples often exhibit large perturbations. Among these limitations, the second one holds the utmost significance as it significantly impacts both the first and third limitations. Due to the high cost involved, it becomes challenging to generate diverse adversarial examples within a reasonable budget. Additionally, attackers tend to introduce large perturbations without employing any perturbation constraints in order to maximize their attacks.
60
+
61
+ To address these limitations, the first question arises: "Could we substantially reduce the verification cost while allowing for unrestricted diversity of substitute variables and minimizing perturbations?" To delve into the reasons behind the second limitation, we need to analyze its underlying factors. The low verification efficiency of the substitute set stems from the fact that each substitute can only be verified by constructing an adversarial sample to replace the original variable and then launching an actual attack on the victim model. This realization leads to the second question: "Is it feasible to predict the attack effect of a substitute instead of constructing an adversarial sample to attack the victim model?"
62
+
63
+ ![](images/30b4588241ab9a49cce19898cce8d7c4104bc2ea7b84b8d6c8b49fd8dc7c39bc.jpg)
64
+
65
+ Given input code $x$ and one of its variables $var$ , different substitutes can be used to replace it to obtain different adversarial samples. After attacking the victim model, the probability of the label will also change. Conversely, if we want to reduce the probability of this label, the third question is following, "how to choose relatively better substitutes that can reduce the model confidence from a large-scale original substitute set?" It is possible to select good substitutes without actual attack if we can forecast, which is implemented by RNNS.
66
+
67
+ The core idea of RNNS is maintaining a search seed updated based on the historical attack. The search seed is employed to search next adversarial substitutes that are possible to attack successfully. Since substitutes are discrete and cannot be directly involved in calculations, we first use a variable name pre-trained encoder denoted as $E$ to map substitutes to a unified continuous representation vector space. Then, based on the representation vectors of substitutes that have participated in the attack, we predict the search seed vector $e_{seed}$ for the next round of the substitute selection. Finally, we calculate the similarity between $e_{seed}$ and the representation vector of substitutes and then select relatively better substitutes. For specific details, please refer to Section 3.2.3.
68
+
69
+ # 3.2 Representation Nearest Neighbor Search
70
+
71
+ Algorithm 1 shows the workflow of our approach, First, we collect the original substitute set from public real code, following the process described
72
+
73
+ in Section 3.2.1. We extract variables from the input code and sort them according to their uncertainty, referring to Section 3.2.2 (Line 3-4). We replace variables in sequence to form attack samples (Line 5). For a given $var$ , we first initialize the optimal substitute for this current iteration $sub_{cur}$ and the optimal substitute for the previous iteration $sub_{pre}$ to the $var$ . Then, we initialize the accumulated smooth increment of the representation vector $\Delta e_{smo}$ to a zero vector. $\Delta e_{smo}$ is used to record the historical representation change of the search seed $e_{seed}$ . We now commence the iterative attack process, as delineated in Line 11. We predict the search seed vector $e_{seed}$ with the process described in Section 3.2.3 (Line 12), and then extract topk substitutes based on $e_{seed}$ to form the candidate substitutes $subs_{topk}$ with the process described in Section 3.2.4 (Line 13). Subsequently, we replace $sub_{cur}$ in $x'$ with each substitute in $subs_{topk}$ to obtain the corresponding temporary adversarial sample $x'_tmp$ (Line 14-15). $x'$ is the current code that we are trying to attack and it is initialized with the original code $x$ . We use $x'_tmp$ to attack the victim model and obtain the probability $prob_y$ of the ground-truth label $y$ and predicted label $y'$ (Line 16). If the probability of the ground-truth label $y$ hits a new low ( $< prob_{min}$ ), we update $x'$ , $sub_{pre}$ , $sub_{cur}$ and $prob_{min}$ (Line 17-22). $prob_{min}$ records the minimum probability of label $y$ during the attack process. If $x'_tmp$ causes the victim model to predict an incorrect label, this attack is successful and returns the successful adversarial sample (Line 23-26); otherwise, proceed to the next iteration until all variables have completed iteration and return the final adversarial sample and attack result (Line 30).
74
+
75
+ # 3.2.1 Collecting Large Original Substitute Set
76
+
77
+ We have developed a tool for variable extraction that leverages the tree-sitter framework<sup>1</sup>. This tool, henceforth denoted as ExtractVar (see Line 3), operates in three distinct steps. In the first step, we extract all variables from the current dataset and then filter out duplicates. During the second step, each valid variable is tokenized, and we compute the embedding for each token using the variable-name encoder $E$ that is pre-trained on CodeSearchNet<sup>2</sup>. We then apply a mean pooling operation on these tokens to determine the variable's embedding. In the third step, we retain all the chosen variables
78
+
79
+ along with their associated embeddings as the initial substitute set, represented as $subs_{original}$ .
80
+
81
+ # 3.2.2 Computing Uncertainty
82
+
83
+ Given a specific code $x$ , we replace each instance of $var \in x$ with a set of predefined fixed variables $VarArray$ , resulting in a set of mutated codes denoted as $X_{var}^{mutated}$ . These mutated codes are subsequently utilized to query the victim model, allowing us to obtain the probability distribution for each class. A greater variance in the distribution signifies increased uncertainty for $var$ , suggesting that $var$ should be prioritized for replacement. The uncertainty associated with $var$ is defined as follows:
84
+
85
+ $$
86
+ u n c e r t a i n t y _ {v a r} = \frac {1}{C} \sum_ {i = 1} ^ {C} v a r i a n c e (P _ {v a r} ^ {i})
87
+ $$
88
+
89
+ where $P_{var}^{i} = \{p_{var}^{i}(x) | \forall x \in X_{var}^{mutated}\}$ , $C$ is the number of labels, $p_{var}^{i}(x)$ is the model probability for label $i$ given the mutated code $x$ , and variance denotes the standard variance function. A larger and more diverse $X_{var}^{mutated}$ ensures a closer approximation of uncertainty to the true value. It is important to note, however, that the magnitude of the change length must not be excessively large, as this would result in all probability changes converging to a single point. This is because samples subjected to large changes deviate significantly from the original, leading to a substantial decrease in the model confidence levels. Subsequently, we arrange the variables in descending order based on their uncertainties. The greater the uncertainty of a variable, the more valuable it is for attack. This process is denoted as RankVarsWithUncertainty at line 4. In our implementation, the size of this variable array VarArray is 16, and the variable length ranges from 1 to 5.
90
+
91
+ # 3.2.3 Predicting Search Seed
92
+
93
+ To filter out superior substitutes from the substantial $subs_{original}$ , it becomes necessary to predict the search seed within the substitute representation vector space. Given the optimal substitute $sub_{cur}$ of the current round, the optimal substitute $sub_{pre}$ from the previous round, and the accumulated smooth increment of the representation vector, denoted as $\Delta e_{smo}$ , from all preceding rounds of iteration, we initially compute the increment of the representation vector in the current round, $\Delta e$ :
94
+
95
+ $$
96
+ \Delta \boldsymbol {e} = E (s u b _ {c u r}) - E (s u b _ {p r e})
97
+ $$
98
+
99
+ <table><tr><td>Task</td><td>Train / Val / Test</td><td>CodeBERT</td><td>GraphCodeBERT</td><td>CodeT5</td></tr><tr><td>Defect</td><td>21,854 / 2,732 / 2,732</td><td>63.76</td><td>63.65</td><td>67.02</td></tr><tr><td>Clone</td><td>90,102 / 4,000 / 4,000</td><td>96.97</td><td>97.36</td><td>97.84</td></tr><tr><td>Authorship</td><td>528 / - / 132</td><td>82.57</td><td>77.27</td><td>88.63</td></tr><tr><td>C1000</td><td>320,000 / 80,000 / 100,000</td><td>82.53</td><td>83.79</td><td>84.46</td></tr><tr><td>Python800</td><td>153,600 / 38,400 / 48,000</td><td>96.39</td><td>96.29</td><td>96.79</td></tr><tr><td>Java250</td><td>48,000 / 11,909 / 15,000</td><td>96.91</td><td>97.27</td><td>97.72</td></tr></table>
100
+
101
+ Table 1: Datasets and Victim Model Performance (Accuracy, %).
102
+
103
+ , where $E$ is variable name encoder, trained on CodeSearchNet by masked language modelling independently so that RNNS is independent of victim downstream-task models. Then we update the $\Delta e_{smo}$
104
+
105
+ $$
106
+ \Delta \mathbf {e} _ {s m o} = (1 - \alpha) \Delta \mathbf {e} _ {s m o} + \alpha \Delta \mathbf {e}
107
+ $$
108
+
109
+ , where $\alpha$ is a smooth rate limited 0 to 1, Finally, we predict the search seed $e_{\text{seed}}$ :
110
+
111
+ $$
112
+ \boldsymbol {e} _ {\text {s e e d}} = E \left(\operatorname {s u b} _ {\text {c u r}}\right) + \Delta \boldsymbol {e} _ {\text {s m o}}
113
+ $$
114
+
115
+ This process is denoted as PredictSeed at line 12.
116
+
117
+ # 3.2.4 Searching Top-K Substitutes
118
+
119
+ Initially, we filter out substitutes from $subs_{original}$ that comply with two constraints: 1) $1 - sim(E(sub), E(var)) < \epsilon$ and 2) $|len(sub) - len(var)| < \delta$ , where $var$ refers to the original variable in the input code that is to be replaced, $sim(.)$ is the similarity calculation function. $E(.)$ is the variable name encoder, and $len(.)$ is used to calculate the length of the variable name. Then, we calculate the similarity between the search seed $e_{seed}$ and the substitutes that are filtered by the two constraints and select the $k$ most similar substitutes to form $subs_{topk}$ . This process is denoted as SearchTopkSub at line 13. In our experiment, $\epsilon = 0.15$ , $\delta = 4$ , $k = 60$ , $sim(.)$ is cosine similarity.
120
+
121
+ # 4 Experimental Setup
122
+
123
+ Dataset and Model. To study the effectiveness and efficiency of RNNS, we conduct experiments on three popular programming languages (C, Python, and Java). For the datasets, we employed six widely studied open-source datasets that cover four important code tasks. Specifically, BigCloneBench (Wang et al., 2020) is one code clone detection dataset named Clone. Devign (Zhou et al., 2019) is a dataset used for vulnerability detection, named Defect. For authorship prediction, we use the dataset provided by (Alsulami et al., 2017).
124
+
125
+ Besides, we utilize three problem-solving classification tasks, Java250, Python800, and C1000, provided by ProjectCodeNet (Puri et al., 2021). For all the datasets (except for authorship prediction which does not have enough data samples), we follow the original papers to split the data into the training set, validation set, and test set. Authorship prediction only has two split parts, training data and test data.
126
+
127
+ For the code models, we follow the previous work (Yang et al., 2022) and investigate two pretrained models CodeBERT (Feng et al., 2020), and GraphCodeBERT (Guo et al., 2020). Besides, we add one more powerful model CodeT5 (Wang et al., 2021) in our study. Table 1 summarizes the details of our employed datasets and fine-tuned models.
128
+
129
+ Evaluation Metric. To evaluate the effectiveness of adversarial attack methods, we employ the commonly used attack success rate (ASR) (Yang et al., 2022) as the measurement. To evaluate the efficiency of the attack methods, we use query times (QT) to check the average number of querying the victim model for one input code. Finally, we use the change of replaced-variable length and the number of replaced variables to study the quality/perturbation of adversarial examples. A smaller score means the attack method can generate adversarial examples with less perturbation injection.
130
+
131
+ Baseline. We compare RNNS with two black-box attack baselines, MHM (Zhang et al., 2020) and NaturalAttack (ALERT) (Yang et al., 2022). MHM is a sampling search-based black-box attack that generates the substitutes from the vocabulary based on lexical rules for identifiers. MHM employs synthesized tokens as the candidates of substitutes, which could introduce meaningless variable names. ALERT is a recently proposed attack method that combines greedy attack and genetic algorithm to find the substitutes. We also use two textual attack algorithms PSO (Zang et al., 2020) and LSH (Maheshwary et al., 2021) as minor baselines, since they are not designed for code models.
132
+
133
+ Implementation. We implement our approach in PyTorch and run all experiments on 32G-v100 GPUs. We reuse the source code from the baselines. We make our implementation publicly available.
134
+
135
+ <table><tr><td rowspan="2">Task+Model</td><td colspan="2">ALERT</td><td colspan="2">MHM</td><td colspan="2">RNNS</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Clone+CodeBert</td><td>28.67</td><td>2155.39</td><td>39.66</td><td>972.15</td><td>46.50</td><td>666.48</td></tr><tr><td>Clone+GraphCodeBert</td><td>10.40</td><td>1466.68</td><td>9.58</td><td>490.99</td><td>41.28</td><td>1122.01</td></tr><tr><td>Clone+CodeT5</td><td>29.20</td><td>2359.70</td><td>38.79</td><td>1069.06</td><td>39.61</td><td>895.79</td></tr><tr><td>Defect+CodeBert</td><td>52.29</td><td>1079.68</td><td>50.51</td><td>862.18</td><td>69.18</td><td>588.35</td></tr><tr><td>Defect+GraphCodeBert</td><td>74.29</td><td>621.77</td><td>75.19</td><td>539.93</td><td>81.63</td><td>404.73</td></tr><tr><td>Defect+CodeT5</td><td>76.66</td><td>721.02</td><td>86.51</td><td>344.08</td><td>89.45</td><td>344.29</td></tr><tr><td>Authorship+CodeBert</td><td>34.98</td><td>682.57</td><td>64.70</td><td>775.11</td><td>73.39</td><td>1029.59</td></tr><tr><td>Authorship+GraphCodeBert</td><td>58.82</td><td>1227.36</td><td>75.49</td><td>632.10</td><td>80.39</td><td>696.64</td></tr><tr><td>Authorship+CodeT5</td><td>64.95</td><td>1078.40</td><td>66.97</td><td>715.89</td><td>71.79</td><td>970.44</td></tr><tr><td>Java250+CodeBert</td><td>50.50</td><td>958.96</td><td>74.03</td><td>961.60</td><td>75.12</td><td>815.91</td></tr><tr><td>Java250+GraphCodeBert</td><td>46.74</td><td>1026.15</td><td>46.05</td><td>946.52</td><td>72.30</td><td>853.74</td></tr><tr><td>Java250+CodeT5</td><td>52.04</td><td>1189.42</td><td>30.59</td><td>1107.95</td><td>63.80</td><td>1049.46</td></tr><tr><td>Python800+CodeBert</td><td>58.30</td><td>513.63</td><td>56.67</td><td>919.37</td><td>77.88</td><td>514.19</td></tr><tr><td>Python800+GraphCodeBert</td><td>51.87</td><td>577.70</td><td>54.15</td><td>917.92</td><td>71.42</td><td>730.14</td></tr><tr><td>Python800+CodeT5</td><td>52.84</td><td>777.20</td><td>36.95</td><td>1127.44</td><td>69.07</td><td>662.28</td></tr><tr><td>C1000+CodeBert</td><td>53.50</td><td>525.43</td><td>59.75</td><td>340.88</td><td>72.96</td><td>537.76</td></tr><tr><td>C1000+GraphCodeBert</td><td>52.68</td><td>566.18</td><td>45.93</td><td>837.09</td><td>72.23</td><td>634.27</td></tr><tr><td>C1000+CodeT5</td><td>47.86</td><td>843.33</td><td>36.45</td><td>668.15</td><td>59.00</td><td>697.06</td></tr><tr><td>Count</td><td>0/18</td><td>4/18</td><td>0/18</td><td>6/18</td><td>18/18</td><td>8/18</td></tr></table>
136
+
137
+ Table 2: Comparison results with MHM, and ALERT, ASR %. Count: the number of best results achieved.
138
+
139
+ # 5 Results Analysis
140
+
141
+ # 5.1 Attack Effectiveness and Efficiency
142
+
143
+ We compare RNNS with two methods MHM (Zhang et al., 2020) and NaturalAttack (ALERT) (Yang et al., 2022) on six datasets and 18 victim models that have been fine-tuned for the downstream tasks. Table 2 shows the comparison results where the last row Count indicates how many times this method achieves the best results. We can see that RNNS achieves the best performance for 18/18 times in terms of ASR, and the lowest cost for 8/18 times in terms of QT in Table 2. Both of the indicators are better than the baselines. The two baselines have zero best ASR for all victim models and all datasets. The lowest QTs achieved by ALERT and MHM are 4 and 6, respectively. We conclude that for effectiveness and efficiency, RNNS outperforms ALERT and MHM in all cases. Especially, MHM and ALERT fail to attack GraphCodeBERT on BigClone dataset, and only have $9.58\%$ and $10.4\%$ ASR respectively, while RNNS has more than $40\%$ ASR. RNNS has almost two times larger ASR than MHM on Java250+CodeT5 and Python800+CodeT5.
144
+
145
+ It should be noted that high ASR is not due to large QT. As shown in Table 2, the three groups of experiments with the most QTs are Clone+GraphCodeBert, Java250+CodeT5, and Authorship+CodeBert, with ASRs of $41.28\%$ , $63.80\%$ , and $73.39\%$ , respectively, which are not the highest. On the contrary, Defect+CodeT5 has the highest
146
+
147
+ ASR of $89.45\%$ , but QT is the smallest. Therefore, there is no absolute causal relationship between QT and ASR.
148
+
149
+ # 5.2 Perturbation of Adversarial Example
150
+
151
+ We conduct a study about the quality of the adversarial examples to check if RNNS can generate looking-normal code, e.g., avoiding naively increasing the variable name length. To do so, firstly, we count the average length of the original variable and adversarial variables as demonstrated by Table 3. We also compute the mean and variances of their difference. Besides, we compute the average number of the replaced variables for the successful attack as shown in Table 4. Low values mean the inputs are modified less, and high qualities.
152
+
153
+ In Table 3, the 2nd, 5th, and 8th columns are the average length for original variables (named Var Len) that are replaced. The 3rd, 6th, and 9th columns are the average lengths for adversarial variables (named Adv Var Len). The 4th, 7th, and 10th columns are the average and variance (mean $\pm$ variance) of the absolute length difference between original variables and adversarial variables (named Difference). We observe that MHM prefers to replace the long-length variables while RNNS likes replacing short-length variables if we compare the 2nd and 5th columns. Meanwhile, the change of variable length from RNNS is less than MHM. MHM introduces the average length difference of 3.39-6.82 while RNNS only has 2.02-2.54. MHM has much higher variances than RNNS in the length change. ALERT uses shorter adversarial variable names than RNNS
154
+
155
+ <table><tr><td rowspan="2">Task+Model</td><td colspan="3">RNNS</td><td colspan="3">MHM</td><td colspan="3">ALERT</td></tr><tr><td>Var Len</td><td>Adv Var Len</td><td>Difference</td><td>Var Len</td><td>Adv Var Len</td><td>Difference</td><td>Var Len</td><td>Adv Var Len</td><td>Difference</td></tr><tr><td>Clone+CodeBert</td><td>6.12</td><td>6.79</td><td>2.35 ± 4.50</td><td>6.47</td><td>10.6</td><td>6.34 ± 10.98</td><td>5.91</td><td>6.21</td><td>1.32 ± 2.02</td></tr><tr><td>Clone+GraphCodeBert</td><td>6.32</td><td>6.97</td><td>2.54 ± 6.43</td><td>6.58</td><td>10.41</td><td>6.82 ± 21.67</td><td>5.50</td><td>5.93</td><td>1.45 ± 2.49</td></tr><tr><td>Clone+CodeT5</td><td>6.45</td><td>6.69</td><td>2.51 ± 8.30</td><td>6.46</td><td>10.46</td><td>6.17 ± 25.78</td><td>6.25</td><td>6.61</td><td>1.32 ± 2.72</td></tr><tr><td>Defect+CodeBert</td><td>4.64</td><td>5.44</td><td>2.08 ± 2.49</td><td>4.44</td><td>9.59</td><td>6.57 ± 28.78</td><td>4.85</td><td>5.06</td><td>1.36 ± 1.93</td></tr><tr><td>Defect+GraphCodeBert</td><td>4.08</td><td>5.34</td><td>2.13 ± 1.83</td><td>4.37</td><td>9.73</td><td>6.48 ± 26.51</td><td>4.47</td><td>5.22</td><td>1.33 ± 1.83</td></tr><tr><td>Defect+CodeT5</td><td>3.95</td><td>5.17</td><td>2.03 ± 1.93</td><td>4.33</td><td>9.81</td><td>6.59 ± 29.98</td><td>4.36</td><td>5.01</td><td>1.27 ± 1.57</td></tr><tr><td>Authorship+CodeBert</td><td>3.81</td><td>5.18</td><td>2.28 ± 1.56</td><td>3.97</td><td>7.94</td><td>5.45 ± 16.72</td><td>4.42</td><td>5.35</td><td>1.40 ± 2.25</td></tr><tr><td>Authorship+GraphCodeBert</td><td>3.69</td><td>5.23</td><td>2.36 ± 1.71</td><td>4.39</td><td>7.64</td><td>5.24 ± 15.38</td><td>3.74</td><td>4.46</td><td>1.22 ± 1.82</td></tr><tr><td>Authorship+CodeT5</td><td>3.95</td><td>5.18</td><td>2.03 ± 2.66</td><td>3.95</td><td>7.98</td><td>5.59 ± 20.94</td><td>3.81</td><td>4.50</td><td>1.22 ± 1.62</td></tr><tr><td>Java250+CodeBert</td><td>2.35</td><td>4.22</td><td>2.11 ± 1.02</td><td>3.21</td><td>6.50</td><td>4.34 ± 15.20</td><td>3.22</td><td>3.65</td><td>0.94 ± 1.63</td></tr><tr><td>Java250+GraphCodeBert</td><td>2.48</td><td>4.31</td><td>2.13 ± 1.07</td><td>3.13</td><td>6.59</td><td>4.42 ± 14.84</td><td>3.05</td><td>3.50</td><td>0.98 ± 1.54</td></tr><tr><td>Java250+CodeT5</td><td>2.76</td><td>4.47</td><td>2.10 ± 1.17</td><td>3.20</td><td>6.54</td><td>4.33 ± 14.60</td><td>3.16</td><td>7.31</td><td>4.41 ± 18.73</td></tr><tr><td>Python800+CodeBert</td><td>1.50</td><td>3.54</td><td>2.21 ± 1.02</td><td>1.97</td><td>5.11</td><td>3.64 ± 9.06</td><td>1.78</td><td>2.27</td><td>0.64 ± 1.34</td></tr><tr><td>Python800+GraphCodeBert</td><td>1.88</td><td>3.90</td><td>2.18 ± 0.78</td><td>1.99</td><td>6.01</td><td>4.46 ± 16.52</td><td>1.80</td><td>2.33</td><td>0.76 ± 1.30</td></tr><tr><td>Python800+CodeT5</td><td>1.65</td><td>3.59</td><td>2.13 ± 0.95</td><td>1.97</td><td>4.95</td><td>3.49 ± 8.18</td><td>1.88</td><td>5.84</td><td>4.10 ± 12.64</td></tr><tr><td>C1000+CodeBert</td><td>1.58</td><td>3.44</td><td>2.08 ± 0.88</td><td>2.41</td><td>5.05</td><td>3.65 ± 12.02</td><td>2.13</td><td>2.52</td><td>0.67 ± 1.17</td></tr><tr><td>C1000+GraphCodeBert</td><td>1.60</td><td>3.59</td><td>2.10 ±0.85</td><td>2.39</td><td>5.35</td><td>3.90 ± 12.98</td><td>2.18</td><td>2.67</td><td>0.66 ± 1.23</td></tr><tr><td>C1000+CodeBert</td><td>1.38</td><td>3.33</td><td>2.02 ± 0.85</td><td>2.36</td><td>4.82</td><td>3.39 ± 10.98</td><td>2.10</td><td>6.56</td><td>4.74 ± 13.24</td></tr></table>
156
+
157
+ Table 3: Replaced-variable length comparison, mean $\pm$ variance.
158
+
159
+ with less change because it uses the pre-trained model to generate the replacements that are close to the replaced variables.
160
+
161
+ Table 4 statistically shows the number of replaced variables. It can be seen that RNNS replaces around an average of 3.6 variables with a smaller variance of around (3.4-4.6) while MHM needs to modify about an average of 5.4 variables with a larger variance $(\geq 11.14)$ . ALERT also replaces more variables to attack models than RNNS and MHM. RNNS introduces less or equal perturbation than the baselines in terms of length change and change number.
162
+
163
+ Figure 2 shows one example of RNNS, MHM, and ALERT attack successfully from the Java250 dataset. The changes are highlighted by shadow markers. RNNS only renames one variable $\mathbf{b}$ to $\mathbf{h}$ , ALERT renames two variables, while MHM almost renames all variables and also prefers longer names.
164
+
165
+ # 5.3 Ablation Study
166
+
167
+ We remove the two search constraints in Section 3.2.4, denoted this variant of RNNS as RNNS-Unlimited. Table 5 shows the comparing results between RNNS-Unlimited and RNNS. RNNS-Unlimited gets the first place for all the tasks in terms of ASR. ASR can be improved by a maximum of $8.35\%$ and a minimum of about $2\%$ after removing limitations. For QT, RNNS-Unlimited only loses 3 times among 18 evaluations. The improvement of RNNS-Unlimited is not surprising with respect to ASR and QT. Because RNNS-Unlimited can search the adversarial examples in the non-similar real names and use very long variable names.
168
+
169
+ # 5.4 Attack Defended Model and Retraining
170
+
171
+ Attack Defended Model. We employ RNNS and MHM to attack the three defended models provided by ALERT (Yang et al., 2022). These models are prepared by adversarial fine-tuning. Table 6 presents the results. We can see that RNNS outperforms MHM in two tasks, and MHM is better in one task. This experiment setting actually is not friendly for RNNS because ALERT (Yang et al., 2022) uses the replacements from pre-trained models which implicitly have the semantic constraint.
172
+
173
+ Retraining. We use the adversarial examples from RNNS to retrain the victim models of CodeBERT by contrastive adversarial learning. We use three 3 datasets, Defect, Authorship, and Java250. We generate the adversarial examples on the whole training dataset for them. Table 7 presents the results, all approaches achieve much lower ASR compared with the previous. RNNS adversarial examples can improve the mode robustness through contrastive adversarial retraining. If we compare Defect/Authorship+CodeBERT in Table 7 and Table 6, we can find that both retrained models via RNNS are more robust than the models from ALERT since they have much lower ASRs.
174
+
175
+ # 5.5 RNNS vs Textual Attack Methods
176
+
177
+ To compare the effects of RNNS and textual attack methods, We conducted attack experiments on three datasets using the PSO (Zang et al., 2020) and LSH (Maheshwary et al., 2021). The three datasets Defect, Authorship, and Java250, represent three languages respectively, C, Python, and Java. To be fair, the search space of the PSO and LSH is the same as that of RNNS.
178
+
179
+ As shown in Table 8, the QT of PSO algorithm
180
+
181
+ <table><tr><td rowspan="2">Task</td><td colspan="3">CodeBERT</td><td colspan="3">GraphCodeBERT</td><td colspan="3">CodeT5</td></tr><tr><td>RNNS</td><td>MHM</td><td>ALERT</td><td>RNNS</td><td>MHM</td><td>ALERT</td><td>RNNS</td><td>MHM</td><td>ALERT</td></tr><tr><td>Clone</td><td>3.55 ± 4.60</td><td>6.72 ± 16.57</td><td>6.86 ± 18.85</td><td>4.12 ± 4.94</td><td>6.21 ± 15.13</td><td>6.95 ± 18.99</td><td>3.43 ± 5.00</td><td>5.68 ± 14.01</td><td>7.65 ± 25.57</td></tr><tr><td>Defect</td><td>3.39 ± 4.96</td><td>2.78 ± 7.89</td><td>3.49 ± 3.99</td><td>2.67 ± 1.75</td><td>2.84 ± 9.50</td><td>4.10 ± 11.05</td><td>2.51 ± 1.45</td><td>2.16 ± 3.58</td><td>3.49 ± 3.99</td></tr><tr><td>Authorship</td><td>4.24 ± 7.47</td><td>7.52 ± 25.82</td><td>6.60 ± 22.96</td><td>3.65 ± 3.32</td><td>6.67 ± 22.29</td><td>7.75 ± 33.12</td><td>4.39 ± 9.00</td><td>5.72 ± 13.02</td><td>6.06 ± 18.74</td></tr><tr><td>Java250</td><td>3.87 ± 4.70</td><td>7.11 ± 21.18</td><td>7.82 ± 28.96</td><td>3.87 ± 4.25</td><td>6.41 ± 16.24</td><td>7.83 ± 25.06</td><td>4.71 ± 6.87</td><td>7.04 ± 15.29</td><td>8.92 ± 25.97</td></tr><tr><td>Python800</td><td>3.06 ± 1.87</td><td>5.21 ± 12.28</td><td>4.96 ± 8.47</td><td>4.12 ± 3.68</td><td>5.00 ± 10.83</td><td>4.63 ± 6.76</td><td>3.57 ± 3.04</td><td>5.29 ± 13.51</td><td>6.18 ± 11.45</td></tr><tr><td>C1000</td><td>3.00 ± 1.86</td><td>4.42 ± 7.49</td><td>4.13 ± 5.59</td><td>3.37 ± 2.38</td><td>5.14 ± 7.30</td><td>4.88 ± 6.24</td><td>3.39 ± 2.48</td><td>5.20 ± 7.43</td><td>5.43 ± 6.99</td></tr><tr><td>mean</td><td>3.52 ± 4.24</td><td>5.63 ± 15.21</td><td>5.65 ± 14.80</td><td>3.63 ± 3.39</td><td>5.38 ± 13.55</td><td>6.02 ± 16.87</td><td>3.67 ± 4.64</td><td>5.18 ± 11.14</td><td>6.29 ± 15.45</td></tr></table>
182
+
183
+ Table 4: Replaced-variable number comparison, mean $\pm$ variance
184
+
185
+ <table><tr><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args) {</td><td>public static void main(String[] args)</td><td></td><td></td></tr><tr><td>Scanner obj = new Scanner(System.in);</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><tr><td>int a = obj.nextInt();</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><tr><td>int b = obj.nextInt();</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><tr><td>int out = 1;</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><tr><td>int ans = 0;</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><tr><td>while (out &lt; b) {</td><td>}</td><td>while (out &lt; h) {</td><td>}</td><td>}</td><td>while (tempOp &lt; colArr) {</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td></tr><tr><td>out--;</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><tr><td>out = out + a;</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><tr><td>ans++;</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><tr><td>}</td><td>}</td><td>System.out.println(ans);</td><td>}</td><td>}</td><td>System.out.println(number_array);</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td><td>}</td></tr><tr><td>Original Code</td><td>Adversarial Code from RNNS</td><td>Adversarial Code from MHM</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td><td>Adversarial Code from ALERT</td></tr></table>
186
+
187
+ Figure 2: Case study. Original vs. RNNS vs. MHM vs. ALERT
188
+
189
+ <table><tr><td rowspan="3">Task</td><td colspan="4">CodeBERT</td><td colspan="4">GraphCodeBERT</td><td colspan="4">CodeT5</td></tr><tr><td colspan="2">RNNS-Unlimited</td><td colspan="2">RNNS</td><td colspan="2">RNNS-Unlimited</td><td colspan="2">RNNS</td><td colspan="2">RNNS-Unlimited</td><td colspan="2">RNNS</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Defect</td><td>72.29</td><td>590.98</td><td>69.18</td><td>588.35</td><td>87.77</td><td>381.82</td><td>81.63</td><td>404.73</td><td>91.64</td><td>338.41</td><td>89.45</td><td>344.29</td></tr><tr><td>Clone</td><td>50.66</td><td>955.97</td><td>46.50</td><td>666.48</td><td>48.16</td><td>1105.11</td><td>41.28</td><td>1122.01</td><td>41.38</td><td>920.65</td><td>39.61</td><td>895.79</td></tr><tr><td>Authorship</td><td>91.74</td><td>447.68</td><td>73.39</td><td>1029.59</td><td>91.17</td><td>438.69</td><td>80.39</td><td>696.64</td><td>88.88</td><td>620.56</td><td>71.79</td><td>970.44</td></tr><tr><td>C1000</td><td>74.70</td><td>502.02</td><td>72.96</td><td>537.76</td><td>76.82</td><td>498.64</td><td>72.23</td><td>634.27</td><td>61.96</td><td>704.95</td><td>59.00</td><td>697.06</td></tr><tr><td>Python800</td><td>83.90</td><td>460.92</td><td>77.88</td><td>514.19</td><td>79.00</td><td>496.30</td><td>71.42</td><td>730.14</td><td>72.69</td><td>646.59</td><td>69.07</td><td>662.28</td></tr><tr><td>Java250</td><td>79.70</td><td>760.97</td><td>75.12</td><td>815.91</td><td>81.94</td><td>744.57</td><td>72.30</td><td>853.74</td><td>75.52</td><td>910.97</td><td>63.80</td><td>1049.46</td></tr><tr><td>Count</td><td>6/6</td><td>4/6</td><td>0/6</td><td>2/6</td><td>6/6</td><td>6/6</td><td>0/6</td><td>0/6</td><td>6/6</td><td>5/6</td><td>0/6</td><td>1/6</td></tr></table>
190
+
191
+ Table 5: Results of ablation study, before and after removing constraints, ASR %.
192
+
193
+ <table><tr><td rowspan="2">Defended Model</td><td colspan="2">RNNS</td><td colspan="2">MHM</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Clone+CodeBert</td><td>12.90</td><td>958.35</td><td>28.17</td><td>1245.75</td></tr><tr><td>Defect+CodeBert</td><td>95.37</td><td>282.20</td><td>92.23</td><td>283.66</td></tr><tr><td>Authorship+CodeBert</td><td>51.88</td><td>1524.40</td><td>43.26</td><td>1026.08</td></tr></table>
194
+
195
+ Table 6: Attack defended models, ASR %.
196
+
197
+ <table><tr><td></td><td>ACC</td><td>ASR(RNNS)</td><td>ASR(MHM)</td><td>ASR(ALERT)</td></tr><tr><td>Authorship</td><td>90.62</td><td>19.81</td><td>23.58</td><td>14.28</td></tr><tr><td>Defect</td><td>65.14</td><td>40.46</td><td>23.69</td><td>24.53</td></tr><tr><td>Java250</td><td>97.63</td><td>19.67</td><td>6.65</td><td>42.91</td></tr></table>
198
+
199
+ is 4.22-6.7 times that of RNNS, and the ASR of PSQ algorithm is $5.55\% - 27.82\%$ lower than that of RNNS algorithm. It can be inferred that for code variable attacks, combinatorial optimization is inefficient when the substitute set of variables is relatively large. The main reasons are the following two points. Firstly, code segments are generally longer, and the substitute set of code variables is much larger than the synonym set of natural language words. Secondly, the impact of variable replacement on code semantics is smaller than that
200
+
201
+ Table 7: Results of contrastive adversarial retraining, model: CodeBERT.
202
+
203
+ <table><tr><td rowspan="2">Task+Model</td><td colspan="2">RNNS</td><td colspan="2">PSO</td><td colspan="2">LSH</td></tr><tr><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td><td>ASR</td><td>QT</td></tr><tr><td>Defect+CodeBert</td><td>69.18</td><td>588.35</td><td>63.63</td><td>3945.04</td><td>26.62</td><td>321.78</td></tr><tr><td>Authorship+CodeBert</td><td>73.39</td><td>1029.59</td><td>52.29</td><td>4350.00</td><td>19.26</td><td>458.55</td></tr><tr><td>Java250+CodeBert</td><td>75.12</td><td>815.91</td><td>47.3</td><td>5076.02</td><td>31.58</td><td>397.05</td></tr></table>
204
+
205
+ Table 8: RNNS vs PSO and LSH, ASR %.
206
+
207
+ of word replacement on natural language semantics.
208
+
209
+ RNNS's QT is 1.8-2.2 times that of LSH, and the QT has dropped significantly. However, LSH's ASR is inferior to RNNS by $42.56\% - 54.13\%$ . For code variable attacks, LSH has high efficiency, but its effectiveness is relatively low. One possible reason for LSH causing low ASR is the distribution of adversarial samples in each bucket is uneven.
210
+
211
+ # 6 Related Work
212
+
213
+ Adversarial attacks for code models have been widely studied (Yang et al., 2022; Liu et al., 2023a; Li et al., 2023; Jha and Reddy, 2023). These works can be generally categorized into black-box attacks and white-box attacks. A black-box attack for code models queries the model outputs and selects the substitutes using a score function. For example,
214
+
215
+ <table><tr><td>Algorithm</td><td>Substitutes Size</td><td>Substitutes Source</td><td>Replacement Position</td><td>Substitutes Selection</td></tr><tr><td>MHM</td><td>medium</td><td>vocabulary</td><td>random</td><td>random sample</td></tr><tr><td>ALERT</td><td>small</td><td>model generation</td><td>importance score</td><td>traverse</td></tr><tr><td>RNNS</td><td>large</td><td>real public variables</td><td>uncertainty score</td><td>efficient constrained search</td></tr></table>
216
+
217
+ Table 9: Difference between RNNS to the others.
218
+
219
+ ALERT (Yang et al., 2022) finds the adversarial examples using variable-name substitutes generated by pre-trained masked models. MHM (Zhang et al., 2020) uses Metropolis-Hastings to sample the replacement of code identifiers. STRATA (Springer et al., 2020) generates adversarial examples by replacing the code tokens based on the token distribution. Chen et al. (2022) apply pre-defined semantics-preserving code transformations to attack code models. CodeAttack (Jha and Reddy, 2023) uses code structure to generate adversarial data. White-box attacks require the code model gradient to modify inputs for adversarial example generation. CARROT (Zhang et al., 2022) selects code mutated variants based on the model gradient. Henkel et al. (2022) attack code models by gradient-based optimization of the abstract syntax tree transformation. Srikant et al. (2021) uses optimized program obfuscations to modify the code. DAMP (Yefet et al., 2020) derives the desired wrong prediction by changing inputs guided by the model gradient.
220
+
221
+ Table 9 demonstrates the differences among RNNS, MHM (Zhang et al., 2020) and ALERT (Yang et al., 2022). MHM and ALERT represent the two methodologies most closely aligned with our research. Our approach considers identifier replacements like MHM and ALERT, ensuring that the adversarial example keeps the same semantics as the original one. Our substitute size is scalable and can be substantial, and RNNS searches the possible next adversarial example in the substitute space. In our approach, we locate vulnerable variables based on the uncertainty and search $\text{sub}_{\text{topk}}$ without building adversarial samples and actual attacks. Our goal is to obtain high ASRs by searching real variable names. MHM has the same goal as ours but synthesizes variable names. ALERT sacrifices ASR to make the variable name readable.
222
+
223
+ # 7 Conclusion
224
+
225
+ We propose a novel black-box adversarial search-based attack for variable replacement. RNNS has
226
+
227
+ three main contributions: 1) This work proposes a non-generation search-based black-box attacking method via predicting the attack effect of a substitute. This method can greatly reduce the verification cost of the substitute, remove the restrictions on the size and diversity of the substitute set, and achieve a significant improvement in terms of ASR without increasing QT. 2) This work proposes a simple and efficient method for constructing a substitute set. This method can construct a large-scale, diverse, and real substitute set at low cost. 3) The adversarial examples from RNNS can be used to improve the model robustness.
228
+
229
+ # 8 Limitations
230
+
231
+ There are some limitations of RNNS. Firstly, RNNS does not revert to the preceding step to persist with the search upon an increase in the model probability of the ground truth label. While the incorporation of this step may bolster the Attack Success Rate (ASR), it could potentially compromise the Query Time (QT). Secondly, the size and diversity of the substitute set significantly influence RNNS; a minimal and homogeneous set can precipitate a diminished attack success rate. Thirdly, RNNS involves multiple hyperparameters whose values need to be manually set. One of the most important parameters is the moving parameter $\alpha$ . The number of attacking iterations max itr is also significant. We set $\alpha$ to 0.2 and max itr to 6 with some small experimental trials. Fourthly, RNNS currently only targets untargeted attack scenarios, for targeted attacks, ASR will be very low when there are many category labels. For example, when performing targeted attacks on Authorship+Codebert with 66 labels, the ASR can only reach $6.4\%$ . How to migrate to targeted attacks is a direction we need to study in the future.
232
+
233
+ # Acknowledgment
234
+
235
+ This work is supported by NRF and the CSA under its National Cybersecurity R&D Programme (NCRP25-P04-TAICeN), NRF and DSO National Laboratories under the AI Singapore Programme (AISG Award No: AISG2-RP-2020-019), and NRF Investigatorship NRF-NRFI06-2020-0001. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of NRF and CSA Singapore.
236
+
237
+ # References
238
+
239
+ Wasi Ahmad, Saikat Chakraborty, Baishakhi Ray, and Kai-Wei Chang. 2020. A transformer-based approach for source code summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4998-5007.
240
+ Bander Alsulami, Edwin Dauber, Richard Harang, Spiros Mancoridis, and Rachel Greenstadt. 2017. Source code authorship attribution using long short-term memory based networks. In Computer Security - ESORICS 2017, pages 65-82, Cham. Springer International Publishing.
241
+ Penglong Chen, Zhen Li, Yu Wen, and Lili Liu. 2022. Generating adversarial source programs using important tokens-based structural transformations. In 2022 26th International Conference on Engineering of Complex Computer Systems (ICECCS), pages 173-182.
242
+ Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. 2020. Codebert: A pre-trained model for programming and natural languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1536-1547.
243
+ Xiaodong Gu, Hongyu Zhang, and Sunghun Kim. 2018. Deep code search. In 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE), pages 933-944. IEEE.
244
+ Daya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng, Duyu Tang, LIU Shujie, Long Zhou, Nan Duan, Alexey Svyatkovskiy, Shengyu Fu, et al. 2020. Graphcodebert: Pre-training code representations with data flow. In International Conference on Learning Representations.
245
+ Jordan Henkel, Goutham Ramakrishnan, Zi Wang, Aws Albarghouthi, Somesh Jha, and Thomas Reps. 2022. Semantic robustness of models of source code. In 2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER), pages 526-537.
246
+ Akshita Jha and Chandan K Reddy. 2023. Codeattack: Code-based adversarial attacks for pre-trained programming language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 14892-14900.
247
+ Liuqing Li, He Feng, Wenjie Zhuang, Na Meng, and Barbara Ryder. 2017. Cclearner: A deep learning-based clone detection approach. In 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME), pages 249-260. IEEE.
248
+ Yanzhou Li, Shangqing Liu, Kangjie Chen, Xiaofei Xie, Tianwei Zhang, and Yang Liu. 2023. Multi-target backdoor attacks for code pre-trained models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7236-7254, Toronto, Canada. Association for Computational Linguistics.
249
+
250
+ Yaoxian Li, Shiyi Qi, Cuiyun Gao, Yun Peng, David Lo, Zenglin Xu, and Michael R Lyu. 2022. A closer look into transformer-based code intelligence through code transformation: Challenges and opportunities. arXiv preprint arXiv:2207.04285.
251
+ Shangqing Liu, Yu Chen, Xiaofei Xie, Jing Kai Siow, and Yang Liu. 2020. Retrieval-augmented generation for code summarization via hybrid gnn. In International Conference on Learning Representations.
252
+ Shangqing Liu, Bozhi Wu, Xiaofei Xie, Guozhu Meng, and Yang Liu. 2023a. Contrabert: Enhancing code pre-trained models via contrastive learning. In 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE), pages 2476-2487.
253
+ Shangqing Liu, Xiaofei Xie, Jingkai Siow, Lei Ma, Guozhu Meng, and Yang Liu. 2023b. Graphsearch-net: Enhancing gnns via capturing global dependencies for semantic code search. IEEE Transactions on Software Engineering.
254
+ Rishabh Maheshwary, Saket Maheshwary, and Vikram Pudi. 2021. A strong baseline for query efficient attacks in a black box setting. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8396-8409.
255
+ Ruchir Puri, David Kung, Geert Janssen, Wei Zhang, Giacomo Domeniconi, Vladimir Zolotov, Julian Dolby, Jie Chen, Mihir Choudhury, Lindsey Decker, Veronika Thost, Luca Buratti, Saurabh Pajar, Shyam Ramji, Ulrich Finkler, Susan Malaika, and Frederick Reiss. 2021. Codenet: A large-scale ai for code dataset for learning a diversity of coding tasks.
256
+ Jacob M Springer, Bryn Marie Reinstadler, and Una-May O'Reilly. 2020. Strata: Simple, gradient-free attacks for models of code. arXiv preprint arXiv:2009.13562.
257
+ Shashank Srikant, Sijia Liu, Tamara Mitrovska, Shiyu Chang, Quanfu Fan, Gaoyuan Zhang, and Una-May O'Reilly. 2021. Generating adversarial computer programs using optimized obfuscations. In International Conference on Learning Representations.
258
+ Wenhan Wang, Ge Li, Bo Ma, Xin Xia, and Zhi Jin. 2020. Detecting code clones with graph neural network and flow-augmented abstract syntax tree. In 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER), pages 261-271. IEEE.
259
+ Yue Wang, Weishi Wang, Shafiq Joty, and Steven C.H. Hoi. 2021. CodeT5: Identifier-aware unified pretrained encoder-decoder models for code understanding and generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8696-8708, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
260
+
261
+ Martin White, Michele Tufano, Christopher Vendome, and Denys Poshyvanyk. 2016. Deep learning code fragments for code clone detection. In 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 87-98. IEEE.
262
+ Zhou Yang, Jieke Shi, Junda He, and David Lo. 2022. Natural attack for pre-trained models of code. In Proceedings of the 44th International Conference on Software Engineering, ICSE '22, page 1482-1493, New York, NY, USA. Association for Computing Machinery.
263
+ Noam Yefet, Uri Alon, and Eran Yahav. 2020. Adversarial examples for models of code. Proceedings of the ACM on Programming Languages, 4(OOPSLA):1-30.
264
+ Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020. Word-level textual adversarial attacking as combinatorial optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6066-6080.
265
+ Huangzhao Zhang, Zhiyi Fu, Ge Li, Lei Ma, Zhehao Zhao, Hua'an Yang, Yizhe Sun, Yang Liu, and Zhi Jin. 2022. Towards robustness of deep program processing models—detection, estimation, and enhancement. ACM Trans. Softw. Eng. Methodol., 31(3).
266
+ Huangzhao Zhang, Zhuo Li, Ge Li, Lei Ma, Yang Liu, and Zhi Jin. 2020. Generating adversarial examples for holding robustness of source code processing models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1169-1176.
267
+ Vitalii Zhelezniak, Aleksandar Savkov, and Nils Hammerla. 2020. Estimating mutual information between dense word embeddings. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8361-8371, Online. Association for Computational Linguistics.
268
+ Yaqin Zhou, Shangqing Liu, Jingkai Siow, Xiaoning Du, and Yang Liu. 2019. Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks. Advances in neural information processing systems, 32.
2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6f7d9523eca19051d9a35331ea333b8a2b289b87e3c37a88d24bbdbb6f25030
3
+ size 605697
2023/A Black-Box Attack on Code Models via Representation Nearest Neighbor Search/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Boundary Offset Prediction Network for Named Entity Recognition/5304d5a7-baa1-46a8-bf30-4a5c29036879_content_list.json ADDED
@@ -0,0 +1,1827 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "A Boundary Offset Prediction Network for Named Entity Recognition",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 136,
8
+ 89,
9
+ 860,
10
+ 111
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Minghao Tang $^{1,2}$ , Yongquan He $^{3}$ , Yongxiu Xu $^{1,2*}$ , Hongbo Xu $^{1}$ , Wenyuan Zhang $^{1,2}$ and Yang Lin $^{3}$",
17
+ "bbox": [
18
+ 152,
19
+ 123,
20
+ 855,
21
+ 158
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "$^{1}$ Institute of Information Engineering, CAS, China",
28
+ "bbox": [
29
+ 295,
30
+ 159,
31
+ 705,
32
+ 174
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "$^{2}$ School of Cyber Security, UCAS, China",
39
+ "bbox": [
40
+ 332,
41
+ 175,
42
+ 668,
43
+ 191
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "<sup>3</sup>Meituan, China",
50
+ "bbox": [
51
+ 433,
52
+ 192,
53
+ 569,
54
+ 206
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "{tangminghao,xuyongxiu,hbxu}@ie.ac.cn, heyongquan@meituan.com",
61
+ "bbox": [
62
+ 186,
63
+ 209,
64
+ 815,
65
+ 225
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "Abstract",
72
+ "text_level": 1,
73
+ "bbox": [
74
+ 260,
75
+ 252,
76
+ 339,
77
+ 266
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "Named entity recognition (NER) is a fundamental task in natural language processing that aims to identify and classify named entities in text. However, span-based methods for NER typically assign entity types to text spans, resulting in an imbalanced sample space and neglecting the connections between non-entity and entity spans. To address these issues, we propose a novel approach for NER, named the Boundary Offset Prediction Network (BOPN), which predicts the boundary offsets between candidate spans and their nearest entity spans. By leveraging the guiding semantics of boundary offsets, BOPN establishes connections between non-entity and entity spans, enabling non-entity spans to function as additional positive samples for entity detection. Furthermore, our method integrates entity type and span representations to generate type-aware boundary offsets instead of using entity types as detection targets. We conduct experiments on eight widely-used NER datasets, and the results demonstrate that our proposed BOPN outperforms previous state-of-the-art methods.",
84
+ "bbox": [
85
+ 141,
86
+ 278,
87
+ 460,
88
+ 619
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "1 Introduction",
95
+ "text_level": 1,
96
+ "bbox": [
97
+ 114,
98
+ 631,
99
+ 258,
100
+ 645
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Named entity recognition (NER) is a fundamental task in natural language processing (NLP) that involves identifying and categorizing named entities in text, such as people, locations and organizations. It has drawn much attention from the community due to its relevance in various NLP applications, such as entity linking (Le and Titov, 2018; Hou et al., 2020) and relation extraction (Miwa and Bansal, 2016; Li et al., 2021b).",
107
+ "bbox": [
108
+ 112,
109
+ 656,
110
+ 487,
111
+ 800
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Various paradigms have been proposed for NER, including the sequence labeling (Huang et al., 2015; Ju et al., 2018), hypergraph-based (Lu and Roth, 2015; Katiyar and Cardie, 2018; Wang and Lu, 2018), sequence-to-sequence (Gillick et al., 2016; Yan et al., 2021) and span-based methods (Sohrab",
118
+ "bbox": [
119
+ 112,
120
+ 801,
121
+ 489,
122
+ 898
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "image",
128
+ "img_path": "images/afdc6e2991a1a66df20f5b60549e17670764767519c981aef32ce0850c1a9658.jpg",
129
+ "image_caption": [
130
+ "protein protein cell_type HMG box containing transcription factors in lymphocyte differentiation",
131
+ "Figure 1: A sentence from GENIA dataset (Ohta et al., 2002), containing 8 words and 3 entities. The candidate spans covers the upper triangular region with a total of 36 samples of each matrix. There are 2 and 1 positive samples for \"protein\" and \"cell type\" entity types, respectively."
132
+ ],
133
+ "image_footnote": [],
134
+ "bbox": [
135
+ 515,
136
+ 288,
137
+ 877,
138
+ 413
139
+ ],
140
+ "page_idx": 0
141
+ },
142
+ {
143
+ "type": "text",
144
+ "text": "and Miwa, 2018; Shen et al., 2021; Chen et al., 2021). Among these approaches, the span-based method has become the most popular due to its simplicity and effectiveness. It is straightforward that typically embeds all possible text spans and predicts their entity types, making it suitable for various NER subtasks (Li et al., 2021a, 2022).",
145
+ "bbox": [
146
+ 507,
147
+ 544,
148
+ 882,
149
+ 656
150
+ ],
151
+ "page_idx": 0
152
+ },
153
+ {
154
+ "type": "text",
155
+ "text": "Despite significant progress made by span-based methods in NER, there remain two critical issues that require attention. Firstly, these methods often suffer from highly imbalanced sample spaces, as exemplified in Figure 1. Such imbalance can negatively impact the trainability and performance of deep neural networks (Johnson and Khoshgoftaar, 2019). Although some methods (Shen et al., 2021; Wan et al., 2022) mitigate this issue by restricting the maximum span length, such an approach can also constrain the model's predictive power. Secondly, current span-based methods primarily focus on learning the distinction between non-entities and entities, disregarding their relationships. While a model can identify whether \"HMG box\" is an entity, it may fail to recognize the connection be",
156
+ "bbox": [
157
+ 507,
158
+ 662,
159
+ 884,
160
+ 917
161
+ ],
162
+ "page_idx": 0
163
+ },
164
+ {
165
+ "type": "page_footnote",
166
+ "text": "* Yongxiu Xu is the corresponding author",
167
+ "bbox": [
168
+ 141,
169
+ 904,
170
+ 396,
171
+ 917
172
+ ],
173
+ "page_idx": 0
174
+ },
175
+ {
176
+ "type": "page_number",
177
+ "text": "14834",
178
+ "bbox": [
179
+ 475,
180
+ 927,
181
+ 524,
182
+ 940
183
+ ],
184
+ "page_idx": 0
185
+ },
186
+ {
187
+ "type": "footer",
188
+ "text": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 14834-14846 December 6-10, 2023 ©2023 Association for Computational Linguistics",
189
+ "bbox": [
190
+ 208,
191
+ 945,
192
+ 786,
193
+ 972
194
+ ],
195
+ "page_idx": 0
196
+ },
197
+ {
198
+ "type": "image",
199
+ "img_path": "images/e231c942f392d6606bda85462443b42c741df015dc8fca7920e84c9d9c0c8541.jpg",
200
+ "image_caption": [
201
+ "Figure 2: Text spans annotated with boundary offset. \"1S\" or \"1E\" represents a span has 1 offset from its nearest entity at the start or end boundary, and so on."
202
+ ],
203
+ "image_footnote": [],
204
+ "bbox": [
205
+ 122,
206
+ 80,
207
+ 482,
208
+ 190
209
+ ],
210
+ "page_idx": 1
211
+ },
212
+ {
213
+ "type": "text",
214
+ "text": "tween \"HMG\" and \"HMG box.\" To enhance the model's ability to recognize entities, it is crucial to explicitly capture both boundary differences and connections between non-entities and entities.",
215
+ "bbox": [
216
+ 112,
217
+ 271,
218
+ 487,
219
+ 335
220
+ ],
221
+ "page_idx": 1
222
+ },
223
+ {
224
+ "type": "text",
225
+ "text": "In this paper, we intend to model text spans by utilizing boundary offset information as supervision, rather than predict their probability of belonging to entities. As shown in Figure 2, there could be two advantages for deep models when boundary offsets are learnable: i) The natural quantitative relationships between offset values enable the model to capture boundary differences and connections simultaneously. ii) Non-entity spans can have specific semantics that guide the positioning of entity spans, leading to an improved sample space with fewer negative samples.",
226
+ "bbox": [
227
+ 112,
228
+ 337,
229
+ 489,
230
+ 529
231
+ ],
232
+ "page_idx": 1
233
+ },
234
+ {
235
+ "type": "text",
236
+ "text": "Based on this observation, we propose the Boundary Offset Prediction Network (BOPN) for NER. BOPN focuses on predicting boundary offsets between candidate spans and their nearest entities, providing a new perspective on modeling text spans. Specifically, our method follows the pipeline of first learning span representations and then classifying them for offset prediction. BERT (Devlin et al., 2019) and BiLSTM (Lample et al., 2016) are used to embed texts, followed by a Conditional Layer (Liu et al., 2021) for building span representations. Meanwhile, we also treat entity types as inputs rather than classification targets, which are fused with span representations to generate type-aware boundary offsets in parallel. Finally, we incorporate multiple 3D convolution layers to capture the natural quantitative relationships between the offset values.",
237
+ "bbox": [
238
+ 112,
239
+ 532,
240
+ 489,
241
+ 819
242
+ ],
243
+ "page_idx": 1
244
+ },
245
+ {
246
+ "type": "text",
247
+ "text": "We evaluate our method on eight widely-used NER datasets, including five English NER datasets and three Chinese NER datasets. The experimental results demonstrate that our approach outperforms the existing state-of-the-art methods. Furthermore, a detailed examination reveals a significant im",
248
+ "bbox": [
249
+ 112,
250
+ 822,
251
+ 489,
252
+ 917
253
+ ],
254
+ "page_idx": 1
255
+ },
256
+ {
257
+ "type": "text",
258
+ "text": "provement in recall scores when aggregating results across offset labels, which is particularly beneficial for recall-sensitive applications.",
259
+ "bbox": [
260
+ 507,
261
+ 84,
262
+ 882,
263
+ 131
264
+ ],
265
+ "page_idx": 1
266
+ },
267
+ {
268
+ "type": "text",
269
+ "text": "2 Problem Definition",
270
+ "text_level": 1,
271
+ "bbox": [
272
+ 507,
273
+ 143,
274
+ 709,
275
+ 159
276
+ ],
277
+ "page_idx": 1
278
+ },
279
+ {
280
+ "type": "text",
281
+ "text": "Named Entity Recognition (NER) aims to identify of all entities within an input sentence $\\mathrm{X} = \\{x_{n}\\}_{n = 1}^{N}$ , based on a pre-defined set of entity types $\\mathrm{Y} = \\{y_{m}\\}_{m = 1}^{M}$ . Typically, an entity is specified by token boundaries and a entity types.",
282
+ "bbox": [
283
+ 507,
284
+ 170,
285
+ 884,
286
+ 250
287
+ ],
288
+ "page_idx": 1
289
+ },
290
+ {
291
+ "type": "text",
292
+ "text": "Our proposed method focuses on predicting the boundary offset between each candidate text span and its nearest entity. Hence, we formulate each text span as a quadruple: $\\{x_{i}, x_{j}, f_{s}, y_{m}\\}$ , where $i$ and $j$ denote the start and end boundary indices of the span, $f_{s}$ represents the start or end boundary offset from its nearest entity of type $y_{m}$ . Note that an entity span is a special case with $f_{s} = 0$ .",
293
+ "bbox": [
294
+ 507,
295
+ 250,
296
+ 882,
297
+ 380
298
+ ],
299
+ "page_idx": 1
300
+ },
301
+ {
302
+ "type": "text",
303
+ "text": "Annotation Guidelines To facilitate understanding, we present the essential boundary offset labels as follow:",
304
+ "bbox": [
305
+ 507,
306
+ 388,
307
+ 882,
308
+ 435
309
+ ],
310
+ "page_idx": 1
311
+ },
312
+ {
313
+ "type": "list",
314
+ "sub_type": "text",
315
+ "list_items": [
316
+ "- Center Span: refers to an entity span with an offset label of \"0\".",
317
+ "- $\\mathbf{\\nabla}^{*}\\mathbf{S}$ or $\\mathbf{\\nabla}^{*}\\mathbf{E}$ : denotes the annotation of the start or end boundary offsets for non-entity spans. \" $\\ast$ \" represents an offset value in the range of $[-S, \\dots, -1, 1, \\dots, S]$ , where $S$ denotes the maximum offset value.",
318
+ "- Out-of-Range: refers to the annotation of a non-entity span with an absolute boundary offset value from its nearest entity exceeding the maximum offset value $S$ ."
319
+ ],
320
+ "bbox": [
321
+ 531,
322
+ 450,
323
+ 880,
324
+ 646
325
+ ],
326
+ "page_idx": 1
327
+ },
328
+ {
329
+ "type": "text",
330
+ "text": "The annotation procedure for boundary offsets involves three steps. Initially, a 3-dimensional matrix $\\mathcal{O} \\in \\mathbb{R}^{M \\times N \\times N}$ is constructed according to the input sentence $X$ , where $M$ denotes the number of entity types and $N$ represents the length of the sentence. Next, we annotate the center spans with the offset label \"0\" based on the golden entities present in $X$ . Entities of different types are assigned to their respective sub-matrices. Finally, for non-entity spans, we compute the start and end boundary offset values with respect to all center spans. Their annotation is determined by the absolute minimum offset value. If the absolute minimum offset value is less than $S$ , we annotate the corresponding *S or *E; otherwise, we label the span as \"Out-of-Range\".",
331
+ "bbox": [
332
+ 507,
333
+ 661,
334
+ 884,
335
+ 917
336
+ ],
337
+ "page_idx": 1
338
+ },
339
+ {
340
+ "type": "page_number",
341
+ "text": "14835",
342
+ "bbox": [
343
+ 477,
344
+ 927,
345
+ 524,
346
+ 940
347
+ ],
348
+ "page_idx": 1
349
+ },
350
+ {
351
+ "type": "image",
352
+ "img_path": "images/c3d5830016737eb1c91b120afd7c7b2898f072f40fbc8081c3a749cb57e2a4a5.jpg",
353
+ "image_caption": [
354
+ "(a) Span Encoder",
355
+ "Figure 3: An overview architecture of our method, which mainly consists of two components: a Span Encoder and a Boundary Offset Predictor."
356
+ ],
357
+ "image_footnote": [],
358
+ "bbox": [
359
+ 115,
360
+ 96,
361
+ 880,
362
+ 324
363
+ ],
364
+ "page_idx": 2
365
+ },
366
+ {
367
+ "type": "text",
368
+ "text": "3 Methods",
369
+ "text_level": 1,
370
+ "bbox": [
371
+ 114,
372
+ 387,
373
+ 223,
374
+ 401
375
+ ],
376
+ "page_idx": 2
377
+ },
378
+ {
379
+ "type": "text",
380
+ "text": "Figure 3 provides an overview of our method, which encompasses two primary components: a Span Encoder (Section 3.1) and a Boundary Offset Predictor (Section 3.2). The Span Encoder is responsible for encoding entity types and sentences, utilizing word representations to construct span representations. Subsequently, the entity type and span representations are inputted into the boundary offset predictor, facilitating type-aware offset classification.",
381
+ "bbox": [
382
+ 112,
383
+ 419,
384
+ 489,
385
+ 580
386
+ ],
387
+ "page_idx": 2
388
+ },
389
+ {
390
+ "type": "text",
391
+ "text": "3.1 Span Encoder",
392
+ "text_level": 1,
393
+ "bbox": [
394
+ 112,
395
+ 600,
396
+ 272,
397
+ 615
398
+ ],
399
+ "page_idx": 2
400
+ },
401
+ {
402
+ "type": "text",
403
+ "text": "Drawing inspiration from the prompt-based methods (Qin and Eisner, 2021; Han et al., 2022), we consider entity types as task-oriented inputs, indicating the specific types of entities that the model needs to predict within a given sentence.",
404
+ "bbox": [
405
+ 112,
406
+ 626,
407
+ 487,
408
+ 706
409
+ ],
410
+ "page_idx": 2
411
+ },
412
+ {
413
+ "type": "text",
414
+ "text": "To achieve this, we create a set of additional type tokens, denoted as $\\mathrm{P} = \\{p_m\\}_{m=1}^M$ , where $p_m$ represents a learnable special token corresponding to entity type $y_m$ . Next, we concatenate the soft tokens $\\mathrm{P}$ with the sentence $\\mathrm{X}$ to form a single sequence, and employ BERT (Devlin et al., 2019) to encode them simultaneously. The output of BERT is then passed through a BiLSTM (Lample et al., 2016) to generate final embedding features $\\mathrm{H} = \\{h_1, h_2, \\dots, h_{M+N}\\} \\in \\mathbb{R}^{(M+N) \\times d}$ , where $d$ is the hidden size. Finally, we split $\\mathrm{H}$ to obtain entity type representations $\\mathrm{H}^Y \\in \\mathbb{R}^{M \\times d}$ and token representations $\\mathrm{H}^X \\in \\mathbb{R}^{N \\times d}$ , respectively.",
415
+ "bbox": [
416
+ 112,
417
+ 709,
418
+ 489,
419
+ 919
420
+ ],
421
+ "page_idx": 2
422
+ },
423
+ {
424
+ "type": "text",
425
+ "text": "Span Representation Given the token representations $\\mathrm{H}^X = \\{h_1, h_2, \\dots, h_N\\}$ , the span representation $v_{ij}$ can be considered as a fusion of the boundary representations $(h_i, h_j)$ . Following Li et al. (2022), we adopt the Conditional Layer Normalization (CLN) (Liu et al., 2021) mechanism to build a high-quality span representation:",
426
+ "bbox": [
427
+ 507,
428
+ 387,
429
+ 884,
430
+ 501
431
+ ],
432
+ "page_idx": 2
433
+ },
434
+ {
435
+ "type": "equation",
436
+ "text": "\n$$\n\\begin{array}{l} v _ {i j} = \\operatorname {C L N} \\left(h _ {i}, h _ {j}\\right) \\tag {1} \\\\ = \\gamma_ {j} \\otimes \\operatorname {N o r m} \\left(h _ {i}\\right) + \\lambda_ {j}, \\\\ \\end{array}\n$$\n",
437
+ "text_format": "latex",
438
+ "bbox": [
439
+ 589,
440
+ 513,
441
+ 882,
442
+ 550
443
+ ],
444
+ "page_idx": 2
445
+ },
446
+ {
447
+ "type": "text",
448
+ "text": "where $\\mathrm{Norm}(\\cdot)$ is the instance normalization function (Ulyanov et al., 2016), $\\gamma_{j}$ and $\\lambda_{j}$ are the condition parameters that are obtained by two different feedforward networks: $\\gamma_{j} = \\mathrm{FFN}(h_{j})$ and $\\lambda_{j} = \\mathrm{FFN}(h_{j})$ .",
449
+ "bbox": [
450
+ 507,
451
+ 562,
452
+ 884,
453
+ 644
454
+ ],
455
+ "page_idx": 2
456
+ },
457
+ {
458
+ "type": "text",
459
+ "text": "While valid candidate spans are restricted to the upper triangular region of the adjacent text span matrix, a region embedding $\\mathrm{E} = [e_{up}, e_{low}] \\in \\mathbb{R}^{2 \\times d_e}$ are adapted to distinguish the positions of text spans. The final representation of each span is obtained as: $\\hat{v}_{ij} = [v_{ij}, e_{up}]$ if $i \\leq j$ ; $\\hat{v}_{ij} = [v_{ij}, e_{low}]$ if $i > j$ .",
460
+ "bbox": [
461
+ 507,
462
+ 644,
463
+ 882,
464
+ 756
465
+ ],
466
+ "page_idx": 2
467
+ },
468
+ {
469
+ "type": "text",
470
+ "text": "3.2 Boundary Offset Predictor",
471
+ "text_level": 1,
472
+ "bbox": [
473
+ 507,
474
+ 768,
475
+ 766,
476
+ 784
477
+ ],
478
+ "page_idx": 2
479
+ },
480
+ {
481
+ "type": "text",
482
+ "text": "As previously mentioned, we utilize the entity types as inputs to guide the model in generating type-aware boundary offsets, rather than categorizing each text span into a particular entity type.",
483
+ "bbox": [
484
+ 507,
485
+ 790,
486
+ 884,
487
+ 854
488
+ ],
489
+ "page_idx": 2
490
+ },
491
+ {
492
+ "type": "text",
493
+ "text": "The biaffine classifier (Yu et al., 2020) is employed to fuse entity type representations and span representations. Specifically, given an entity type representation $h_m \\in \\mathbf{H}^Y$ and span representation",
494
+ "bbox": [
495
+ 507,
496
+ 854,
497
+ 882,
498
+ 919
499
+ ],
500
+ "page_idx": 2
501
+ },
502
+ {
503
+ "type": "page_number",
504
+ "text": "14836",
505
+ "bbox": [
506
+ 477,
507
+ 927,
508
+ 524,
509
+ 940
510
+ ],
511
+ "page_idx": 2
512
+ },
513
+ {
514
+ "type": "text",
515
+ "text": "$\\hat{v}_{ij}\\in \\widehat{\\mathbf{V}}$ , a scoring vector $c_{mij}\\in \\mathbb{R}^L$ can be computed as:",
516
+ "bbox": [
517
+ 112,
518
+ 83,
519
+ 489,
520
+ 116
521
+ ],
522
+ "page_idx": 3
523
+ },
524
+ {
525
+ "type": "equation",
526
+ "text": "\n$$\nh _ {y} ^ {\\prime} = \\operatorname {F F N} \\left(h _ {y}\\right), \\quad \\hat {v} _ {i j} ^ {\\prime} = \\operatorname {F F N} \\left(\\hat {v} _ {i j}\\right), \\tag {2}\n$$\n",
527
+ "text_format": "latex",
528
+ "bbox": [
529
+ 169,
530
+ 126,
531
+ 487,
532
+ 147
533
+ ],
534
+ "page_idx": 3
535
+ },
536
+ {
537
+ "type": "equation",
538
+ "text": "\n$$\nc _ {m i j} = \\left(h _ {m} ^ {\\prime}\\right) ^ {T} U \\hat {v} _ {i j} ^ {\\prime} + W \\left(h _ {m} ^ {\\prime} \\oplus v _ {i j} ^ {\\prime}\\right) + b, \\tag {3}\n$$\n",
539
+ "text_format": "latex",
540
+ "bbox": [
541
+ 137,
542
+ 156,
543
+ 487,
544
+ 179
545
+ ],
546
+ "page_idx": 3
547
+ },
548
+ {
549
+ "type": "text",
550
+ "text": "where $L$ is the number of offset labels $^1$ ; $U \\in \\mathbb{R}^{L \\times d_b \\times d_b}$ , $W \\in \\mathbb{R}^{L \\times 2d_b}$ and $b \\in \\mathbb{R}^L$ are learnable parameters, $d_b$ is the biaffine hidden size.",
551
+ "bbox": [
552
+ 112,
553
+ 184,
554
+ 489,
555
+ 233
556
+ ],
557
+ "page_idx": 3
558
+ },
559
+ {
560
+ "type": "text",
561
+ "text": "3D Convolution Layer Furthermore, we utilize multiple 3-dimensional convolution (3DConv) layers to capture the inherent quantitative relationships between the boundary offsets of adjacent text spans. As depicted in Figure 3(b), the 3D convolution kernels traverse the complete score matrix $C$ in three directions, thereby aggregating offset predictions for adjacent text spans across all entity types. The computation in a single convolution layer can be expressed as:",
562
+ "bbox": [
563
+ 112,
564
+ 241,
565
+ 489,
566
+ 401
567
+ ],
568
+ "page_idx": 3
569
+ },
570
+ {
571
+ "type": "equation",
572
+ "text": "\n$$\n\\mathrm {Q} = \\sigma (\\mathrm {3 D C o n v} (\\mathrm {C})), \\tag {4}\n$$\n",
573
+ "text_format": "latex",
574
+ "bbox": [
575
+ 218,
576
+ 414,
577
+ 487,
578
+ 432
579
+ ],
580
+ "page_idx": 3
581
+ },
582
+ {
583
+ "type": "text",
584
+ "text": "where $\\mathbf{Q} \\in \\mathbb{R}^{M \\times N \\times N \\times L}$ , $\\sigma$ is the GELU activation function (Hendrycks and Gimpel, 2016). We assign different dilation rates to each convolution layer, and then concatenate their outputs followed by a linear to calculate final prediction scores:",
585
+ "bbox": [
586
+ 112,
587
+ 442,
588
+ 487,
589
+ 525
590
+ ],
591
+ "page_idx": 3
592
+ },
593
+ {
594
+ "type": "equation",
595
+ "text": "\n$$\n\\hat {\\mathrm {Q}} = \\operatorname {L i n e a r} \\left(\\mathrm {Q} _ {1} \\oplus \\mathrm {Q} _ {2} \\oplus \\mathrm {Q} _ {3}\\right), \\tag {5}\n$$\n",
596
+ "text_format": "latex",
597
+ "bbox": [
598
+ 189,
599
+ 535,
600
+ 487,
601
+ 555
602
+ ],
603
+ "page_idx": 3
604
+ },
605
+ {
606
+ "type": "text",
607
+ "text": "To obtain the probability distribution of span $(i,j)$ over the offset labels, $\\hat{q}_{mij} \\in \\hat{\\mathbf{Q}}$ is fed into a softmax layer:",
608
+ "bbox": [
609
+ 112,
610
+ 565,
611
+ 487,
612
+ 613
613
+ ],
614
+ "page_idx": 3
615
+ },
616
+ {
617
+ "type": "equation",
618
+ "text": "\n$$\n\\hat {o} _ {m i j} = \\operatorname {s o f t m a x} \\left(\\hat {q} _ {m i j}\\right), \\tag {6}\n$$\n",
619
+ "text_format": "latex",
620
+ "bbox": [
621
+ 211,
622
+ 627,
623
+ 487,
624
+ 644
625
+ ],
626
+ "page_idx": 3
627
+ },
628
+ {
629
+ "type": "text",
630
+ "text": "3.3 Training and Inference",
631
+ "text_level": 1,
632
+ "bbox": [
633
+ 112,
634
+ 655,
635
+ 341,
636
+ 671
637
+ ],
638
+ "page_idx": 3
639
+ },
640
+ {
641
+ "type": "text",
642
+ "text": "Learning Objective In our method, the learning objective is to accurately assign a boundary offset to each text span, which can be treated as a multiclass classification problem and optimized using cross-entropy loss:",
643
+ "bbox": [
644
+ 112,
645
+ 676,
646
+ 487,
647
+ 756
648
+ ],
649
+ "page_idx": 3
650
+ },
651
+ {
652
+ "type": "equation",
653
+ "text": "\n$$\n\\mathcal {L} = - \\frac {1}{M N ^ {2}} \\sum_ {m} ^ {M} \\sum_ {i} ^ {N} \\sum_ {j} ^ {N} o _ {m i j} ^ {T} \\log \\left(\\hat {o} _ {m i j}\\right) \\tag {7}\n$$\n",
654
+ "text_format": "latex",
655
+ "bbox": [
656
+ 139,
657
+ 766,
658
+ 487,
659
+ 812
660
+ ],
661
+ "page_idx": 3
662
+ },
663
+ {
664
+ "type": "text",
665
+ "text": "where $o_{mij} \\in \\mathbb{R}^D$ represents the ground-truth, which is an one-hot vector encoded from the annotated adjacent text span matrix $\\mathcal{O}$ .",
666
+ "bbox": [
667
+ 112,
668
+ 824,
669
+ 489,
670
+ 872
671
+ ],
672
+ "page_idx": 3
673
+ },
674
+ {
675
+ "type": "text",
676
+ "text": "Inference with Boundary offsets During the inference process, decoding entities based on predicted boundary offsets is a straightforward procedure. The output of our method is a matrix of size $M \\times N \\times N$ , where each cell represents a potential entity and contains information about its boundaries and type. For example, a cell with coordinates $(m, i, j)$ and the prediction \"-1E\" indicates an entity of type $y_{m}$ with a start boundary at $x_{i}$ and an end boundary at $x_{j+1}$ . Conversely, if the predicted value is \"out-of-range,\" it implies that the cell does not correspond to any entity.",
677
+ "bbox": [
678
+ 507,
679
+ 84,
680
+ 884,
681
+ 277
682
+ ],
683
+ "page_idx": 3
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "However, blindly accepting all predicted boundary offsets may result in sub-optimal outcomes as it disregards the quantitative relationship between boundary offsets. Therefore, we introduce two heuristic rules to identify unreasonable predictions: i) Predicted boundary offsets that do not align with their nearest center span. ii) Predicted boundary offsets that do not adhere to a sequential order with neighboring spans.",
688
+ "bbox": [
689
+ 507,
690
+ 279,
691
+ 884,
692
+ 423
693
+ ],
694
+ "page_idx": 3
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "4 Experimental Settings",
699
+ "text_level": 1,
700
+ "bbox": [
701
+ 507,
702
+ 439,
703
+ 734,
704
+ 456
705
+ ],
706
+ "page_idx": 3
707
+ },
708
+ {
709
+ "type": "text",
710
+ "text": "4.1 Datasets",
711
+ "text_level": 1,
712
+ "bbox": [
713
+ 507,
714
+ 467,
715
+ 623,
716
+ 481
717
+ ],
718
+ "page_idx": 3
719
+ },
720
+ {
721
+ "type": "text",
722
+ "text": "To evaluate our method, we conducted experiments on five English NER datasets, including CoNLL 2003 (Sang and De Meulder, 2003), OntoNotes $5^{2}$ , ACE $2004^{3}$ , ACE $2005^{4}$ and GENIA (Ohta et al., 2002); and three Chinese NER datasets, including MSRA (Levow, 2006), Resume NER (Zhang and Yang, 2018) and Weibo NER (Peng and Dredze, 2015). Note that ACE 2004, ACE 2005 and GENIA are nested NER datasets, others are flat datasets.",
723
+ "bbox": [
724
+ 507,
725
+ 489,
726
+ 882,
727
+ 633
728
+ ],
729
+ "page_idx": 3
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "For OntoNotes 5, we take the same train/dev/test as used in CoNLL 2012 shared task (Pradhan et al., 2012). For ACE 2004 and ACE 2005, we use the same data split as Lu and Roth (2015). For GENIA, we follow Katiyar and Cardie (2018) to split train/test as 9:1. For other datasets, we employ the same settings in previous works (Ma et al., 2020; Yan et al., 2021; Zhu and Li, 2022).",
734
+ "bbox": [
735
+ 507,
736
+ 636,
737
+ 882,
738
+ 764
739
+ ],
740
+ "page_idx": 3
741
+ },
742
+ {
743
+ "type": "text",
744
+ "text": "4.2 Implementation Details",
745
+ "text_level": 1,
746
+ "bbox": [
747
+ 507,
748
+ 778,
749
+ 741,
750
+ 794
751
+ ],
752
+ "page_idx": 3
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "We use BioBERT-v1.1 (Lee et al., 2020) as the contextual embedding in GENIA. For other English corpora, we BERT-large-cased (Devlin et al., 2019) as the contextual embedding. For Chinese",
757
+ "bbox": [
758
+ 507,
759
+ 801,
760
+ 882,
761
+ 866
762
+ ],
763
+ "page_idx": 3
764
+ },
765
+ {
766
+ "type": "page_footnote",
767
+ "text": "Given a maximum offset $S$ , $L = 4S + 2$ when considering both start and end boundary offset; $L = 2S + 2$ when only considering start or end boundary offset.",
768
+ "bbox": [
769
+ 112,
770
+ 879,
771
+ 487,
772
+ 917
773
+ ],
774
+ "page_idx": 3
775
+ },
776
+ {
777
+ "type": "page_footnote",
778
+ "text": "$^{2}$ https://catalog.ldc.upenn.edu/LDC2005T09 \n $^{3}$ https://catalog.ldc.upenn.edu/LDC2005T09",
779
+ "bbox": [
780
+ 529,
781
+ 878,
782
+ 805,
783
+ 904
784
+ ],
785
+ "page_idx": 3
786
+ },
787
+ {
788
+ "type": "page_footnote",
789
+ "text": "4https://catalog.ldc.upenn.edu/LDC2006T06",
790
+ "bbox": [
791
+ 529,
792
+ 904,
793
+ 803,
794
+ 917
795
+ ],
796
+ "page_idx": 3
797
+ },
798
+ {
799
+ "type": "page_number",
800
+ "text": "14837",
801
+ "bbox": [
802
+ 477,
803
+ 927,
804
+ 524,
805
+ 940
806
+ ],
807
+ "page_idx": 3
808
+ },
809
+ {
810
+ "type": "table",
811
+ "img_path": "images/51a8df1d54a01656e26c278e13c8423906cc8511a43b3e4105312ce1cebe8872.jpg",
812
+ "table_caption": [],
813
+ "table_footnote": [],
814
+ "table_body": "<table><tr><td rowspan=\"2\">Models</td><td colspan=\"3\">CoNLL 2003</td><td colspan=\"3\">OntoNotes 5</td></tr><tr><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td></tr><tr><td colspan=\"7\">Sequence Labeling Methods</td></tr><tr><td>BiLSTM-CRF (Miwa and Bansal, 2016)</td><td>-</td><td>-</td><td>91.03</td><td>86.04</td><td>86.53</td><td>86.28</td></tr><tr><td>BERT-Tagger (Devlin et al., 2019)</td><td>-</td><td>-</td><td>92.80</td><td>90.01</td><td>88.35</td><td>89.16</td></tr><tr><td colspan=\"7\">Span-based Methods</td></tr><tr><td>Biaffine (Yu et al., 2020)*†</td><td>92.46</td><td>92.67</td><td>92.55</td><td>89.94</td><td>89.81</td><td>89.88</td></tr><tr><td>W2NER (Li et al., 2022)</td><td>92.71</td><td>93.44</td><td>93.07</td><td>90.03</td><td>90.97</td><td>90.50</td></tr><tr><td>Boundary Smooth (Zhu and Li, 2022)*†</td><td>92.89</td><td>93.20</td><td>93.04</td><td>90.42</td><td>90.81</td><td>90.61</td></tr><tr><td>DiffusionNER (Shen et al., 2023a)</td><td>92.99</td><td>92.56</td><td>92.78</td><td>90.31</td><td>91.02</td><td>90.66</td></tr><tr><td colspan=\"7\">Others</td></tr><tr><td>Seq2Seq (Straková et al., 2019)</td><td>-</td><td>-</td><td>92.98</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BartNER (Yan et al., 2021)†</td><td>92.57</td><td>93.53</td><td>93.05</td><td>89.65</td><td>90.87</td><td>90.26</td></tr><tr><td>PIQN (Shen et al., 2022)</td><td>93.29</td><td>92.46</td><td>92.87</td><td>91.43</td><td>90.73</td><td>90.96</td></tr><tr><td>PromptNER (Shen et al., 2023b)</td><td>92.48</td><td>92.33</td><td>92.41</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BOPN (Ours)</td><td>93.22</td><td>93.15</td><td>93.19</td><td>90.93</td><td>91.40</td><td>91.16</td></tr></table>",
815
+ "bbox": [
816
+ 201,
817
+ 80,
818
+ 796,
819
+ 318
820
+ ],
821
+ "page_idx": 4
822
+ },
823
+ {
824
+ "type": "table",
825
+ "img_path": "images/95bc12ee2f9aafbfc8ab866b4cf6f2aface10670f739ee9baa72c4e8aa505dc2.jpg",
826
+ "table_caption": [
827
+ "Table 1: Results on English flat NER datasets CoNLL 2003 and OntoNotes 5. † means our re-implementation via their code. * denotes a fair comparison that their BERT encoder is consistent with our model."
828
+ ],
829
+ "table_footnote": [],
830
+ "table_body": "<table><tr><td rowspan=\"2\">Models</td><td colspan=\"3\">MSRA</td><td colspan=\"3\">Resume NER</td><td colspan=\"3\">Weibo NER</td></tr><tr><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td></tr><tr><td colspan=\"10\">Sequence Labeling Methods</td></tr><tr><td>Lattice (Zhang and Yang, 2018)</td><td>93.57</td><td>92.79</td><td>93.18</td><td>94.81</td><td>94.11</td><td>94.46</td><td>53.04</td><td>62.25</td><td>58.79</td></tr><tr><td>Flat (Li et al., 2020)</td><td>-</td><td>-</td><td>96.09</td><td>-</td><td>-</td><td>95.86</td><td>-</td><td>-</td><td>68.55</td></tr><tr><td>SoftLexicon (Ma et al., 2020)</td><td>95.75</td><td>95.10</td><td>95.42</td><td>96.08</td><td>96.13</td><td>96.11</td><td>70.94</td><td>67.02</td><td>70.50</td></tr><tr><td>MECT (Wu et al., 2021)</td><td>-</td><td>-</td><td>96.24</td><td>-</td><td>-</td><td>95.98</td><td>-</td><td>-</td><td>70.43</td></tr><tr><td colspan=\"10\">Span-based Methods</td></tr><tr><td>W2NER (Li et al., 2022)</td><td>96.12</td><td>96.08</td><td>96.10</td><td>96.96</td><td>96.35</td><td>96.65</td><td>70.84</td><td>73.87</td><td>72.32</td></tr><tr><td>Boundary Smooth (Zhu and Li, 2022)</td><td>96.37</td><td>96.15</td><td>96.26</td><td>96.63</td><td>96.69</td><td>96.66</td><td>70.16</td><td>75.36</td><td>72.66</td></tr><tr><td>DiffusionNER (Shen et al., 2023a)</td><td>95.71</td><td>94.11</td><td>94.91</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BOPN (Ours)</td><td>96.44</td><td>96.34</td><td>96.39</td><td>96.73</td><td>96.83</td><td>96.78</td><td>71.79</td><td>73.90</td><td>72.92</td></tr></table>",
831
+ "bbox": [
832
+ 119,
833
+ 369,
834
+ 882,
835
+ 554
836
+ ],
837
+ "page_idx": 4
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "Table 2: Results on Chinese flat NER datasets MSRA, Resume and Weibo.",
842
+ "bbox": [
843
+ 243,
844
+ 564,
845
+ 751,
846
+ 579
847
+ ],
848
+ "page_idx": 4
849
+ },
850
+ {
851
+ "type": "text",
852
+ "text": "corpora, we use the BERT pre-trained with whole word masking (Cui et al., 2021).",
853
+ "bbox": [
854
+ 112,
855
+ 605,
856
+ 485,
857
+ 636
858
+ ],
859
+ "page_idx": 4
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "The BiLSTM has one layer and 256 hidden size with dropout rate of 0.5. The size of region embedding $d_{e}$ is 20. The maximum offset value $S$ is selected in $\\{1,2,3\\}$ . For all datasets, we train our models by using AdamW Optimizer (Loshchilov and Hutter, 2017) with a linear warmup-decay learning rate schedule. See Appendix A for more details. Our source code can be obtained from https://github.com/mhtang1995/BOPN.",
864
+ "bbox": [
865
+ 112,
866
+ 638,
867
+ 485,
868
+ 783
869
+ ],
870
+ "page_idx": 4
871
+ },
872
+ {
873
+ "type": "text",
874
+ "text": "4.3 Evaluation",
875
+ "text_level": 1,
876
+ "bbox": [
877
+ 112,
878
+ 799,
879
+ 247,
880
+ 813
881
+ ],
882
+ "page_idx": 4
883
+ },
884
+ {
885
+ "type": "text",
886
+ "text": "We use strict evaluation metrics where a predicted entity is considered correct only when both the boundaries (after adding boundary offset) and type are accurately matched. The precision, recall and $F_{1}$ scores are employed. We run our model for five times and report averaged values.",
887
+ "bbox": [
888
+ 112,
889
+ 822,
890
+ 485,
891
+ 917
892
+ ],
893
+ "page_idx": 4
894
+ },
895
+ {
896
+ "type": "text",
897
+ "text": "5 Results and Analysis",
898
+ "text_level": 1,
899
+ "bbox": [
900
+ 507,
901
+ 604,
902
+ 722,
903
+ 620
904
+ ],
905
+ "page_idx": 4
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "5.1 Main Results",
910
+ "text_level": 1,
911
+ "bbox": [
912
+ 507,
913
+ 634,
914
+ 660,
915
+ 649
916
+ ],
917
+ "page_idx": 4
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "The performance of our proposed method and the baselines on English flat NER datasets is presented in Table 1. The experimental results demonstrate that our approach surpasses the previous state-of-the-art (SOTA) methods by $+0.12\\%$ on the CoNLL 2003 dataset and $+0.20\\%$ on the OntoNotes 5 dataset, achieving superior performance with $F_{1}$ scores of $93.19\\%$ and $91.16\\%$ , respectively. For Chinese flat NER datasets, we provide the results in Table 2. Similarly, our proposed method achieves SOTA performance in terms of $F_{1}$ scores, surpassing the previous best method by $+0.13\\%$ , $+0.12\\%$ , and $+0.26\\%$ in $F_{1}$ scores on the MSRA, Resume NER, and Weibo NER datasets, respectively.",
922
+ "bbox": [
923
+ 505,
924
+ 659,
925
+ 882,
926
+ 884
927
+ ],
928
+ "page_idx": 4
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "The performance results on English nested NER datasets are presented in Table 3. Remarkably,",
933
+ "bbox": [
934
+ 507,
935
+ 887,
936
+ 882,
937
+ 919
938
+ ],
939
+ "page_idx": 4
940
+ },
941
+ {
942
+ "type": "page_number",
943
+ "text": "14838",
944
+ "bbox": [
945
+ 477,
946
+ 927,
947
+ 524,
948
+ 940
949
+ ],
950
+ "page_idx": 4
951
+ },
952
+ {
953
+ "type": "table",
954
+ "img_path": "images/fa2bba559ca22fd4759b58d7f6b9102e9206b9c08053052018dc26058c40e7ae.jpg",
955
+ "table_caption": [],
956
+ "table_footnote": [],
957
+ "table_body": "<table><tr><td rowspan=\"2\">Models</td><td colspan=\"3\">ACE 2004</td><td colspan=\"3\">ACE 2005</td><td colspan=\"3\">GENIA</td></tr><tr><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td></tr><tr><td colspan=\"10\">Sequence Labeling Methods</td></tr><tr><td>Layered (Ju et al., 2018)</td><td>-</td><td>-</td><td>-</td><td>74.2</td><td>70.3</td><td>72.2</td><td>78.5</td><td>71.3</td><td>74.7</td></tr><tr><td>Pyramid (Wang et al., 2020)</td><td>86.08</td><td>86.48</td><td>86.28</td><td>83.95</td><td>85.39</td><td>84.66</td><td>79.45</td><td>78.94</td><td>79.19</td></tr><tr><td colspan=\"10\">Span-based Methods</td></tr><tr><td>Biaffine (Yu et al., 2020)</td><td>87.3</td><td>86.0</td><td>86.7</td><td>85.2</td><td>85.6</td><td>85.4</td><td>78.2</td><td>78.2</td><td>78.2</td></tr><tr><td>Locate and Label (Shen et al., 2021)</td><td>87.44</td><td>87.38</td><td>87.41</td><td>86.09</td><td>87.27</td><td>86.67</td><td>80.19</td><td>80.89</td><td>80.54</td></tr><tr><td>W2NER (Li et al., 2022)</td><td>87.33</td><td>87.71</td><td>87.52</td><td>85.03</td><td>88.62</td><td>86.79</td><td>83.10</td><td>79.76</td><td>81.39</td></tr><tr><td>Triaffine (Yuan et al., 2022)</td><td>87.13</td><td>87.68</td><td>87.60</td><td>86.70</td><td>86.94</td><td>86.82</td><td>80.42</td><td>82.06</td><td>81.23</td></tr><tr><td>Boundary Smooth (Zhu and Li, 2022)</td><td>88.43</td><td>87.53</td><td>87.98</td><td>86.25</td><td>88.07</td><td>87.15</td><td>-</td><td>-</td><td>-</td></tr><tr><td>DiffusionNER (Shen et al., 2023a)</td><td>88.11</td><td>88.66</td><td>88.39</td><td>86.15</td><td>87.72</td><td>86.93</td><td>82.10</td><td>80.97</td><td>81.53</td></tr><tr><td colspan=\"10\">Others</td></tr><tr><td>Seq2Seq (Straková et al., 2019)</td><td>-</td><td>-</td><td>84.33</td><td>-</td><td>-</td><td>83.42</td><td>-</td><td>-</td><td>78.20</td></tr><tr><td>BartNER (Yan et al., 2021)</td><td>87.27</td><td>86.41</td><td>86.84</td><td>83.16</td><td>86.38</td><td>84.74</td><td>78.57</td><td>79.30</td><td>78.93</td></tr><tr><td>PIQN (Shen et al., 2022)</td><td>88.48</td><td>87.81</td><td>88.14</td><td>86.27</td><td>88.60</td><td>87.42</td><td>83.24</td><td>80.35</td><td>81.77</td></tr><tr><td>PromptNER (Shen et al., 2023b)</td><td>87.58</td><td>88.76</td><td>88.16</td><td>86.07</td><td>88.38</td><td>87.21</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BOPN (Ours)</td><td>89.13</td><td>89.40</td><td>89.26</td><td>89.56</td><td>91.23</td><td>90.39</td><td>82.14</td><td>82.16</td><td>82.14</td></tr></table>",
958
+ "bbox": [
959
+ 119,
960
+ 80,
961
+ 884,
962
+ 355
963
+ ],
964
+ "page_idx": 5
965
+ },
966
+ {
967
+ "type": "table",
968
+ "img_path": "images/2f8978854f1e34a1d256ff1d158bd7686e6740c1f55e0a214c8ffcb8517f8bc4.jpg",
969
+ "table_caption": [
970
+ "Table 3: Results on English nested NER datasets ACE 2004, ACE 2004 and GENIA."
971
+ ],
972
+ "table_footnote": [],
973
+ "table_body": "<table><tr><td></td><td>CoNLL 2003</td><td>Resume NER</td><td>ACE 2004</td></tr><tr><td>BOPN (Ours)</td><td>93.19</td><td>96.78</td><td>89.26</td></tr><tr><td>- w/o Type Inp.</td><td>92.87</td><td>96.41</td><td>88.83</td></tr><tr><td>- w/o Region Emb.</td><td>92.71</td><td>96.22</td><td>88.71</td></tr><tr><td>- w/o BO</td><td>92.74</td><td>96.26</td><td>88.62</td></tr><tr><td>- w/o 3DConv</td><td>92.87</td><td>96.40</td><td>89.11</td></tr><tr><td>- MBO (S=1)</td><td>93.11</td><td>96.75</td><td>89.14</td></tr><tr><td>- MBO (S=2)</td><td>93.15</td><td>96.78</td><td>89.26</td></tr><tr><td>- MBO (S=3)</td><td>93.19</td><td>96.71</td><td>89.22</td></tr><tr><td>- 3DConv (l=1)</td><td>93.08</td><td>96.69</td><td>89.18</td></tr><tr><td>- 3DConv (l=2)</td><td>93.19</td><td>96.75</td><td>89.26</td></tr><tr><td>- 3DConv (l=3)</td><td>93.05</td><td>96.78</td><td>89.25</td></tr></table>",
974
+ "bbox": [
975
+ 119,
976
+ 401,
977
+ 485,
978
+ 606
979
+ ],
980
+ "page_idx": 5
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "Table 4: Ablation Studies. MBO means the maximum boundary offset value.",
985
+ "bbox": [
986
+ 112,
987
+ 615,
988
+ 485,
989
+ 645
990
+ ],
991
+ "page_idx": 5
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "our proposed BOPN achieves substantial improvements in performance on these datasets, with $F_{1}$ scores increasing by $+0.87\\%$ , $+2.97\\%$ , and $+0.37\\%$ on ACE 2004, ACE 2005, and GENIA, respectively. These results align with our expectations, as the boundary features of nested entities are more intricate compared to flat entities. We attribute this improvement to two key factors: 1) Our method predicts the boundary information of various entity types in parallel, effectively avoiding nested boundary conflicts between different types of entities. 2) By predicting boundary offsets, our method expands the predictive range for each text span, allowing for more granular and precise identification of entity boundaries.",
996
+ "bbox": [
997
+ 112,
998
+ 677,
999
+ 490,
1000
+ 917
1001
+ ],
1002
+ "page_idx": 5
1003
+ },
1004
+ {
1005
+ "type": "text",
1006
+ "text": "5.2 Ablation Studies",
1007
+ "text_level": 1,
1008
+ "bbox": [
1009
+ 507,
1010
+ 404,
1011
+ 685,
1012
+ 418
1013
+ ],
1014
+ "page_idx": 5
1015
+ },
1016
+ {
1017
+ "type": "text",
1018
+ "text": "In order to assess the impact of each component in our method, we conduct ablation studies on the CoNLL 2003, ACE 2005, and Resume NER datasets. The results of these studies are presented in Table 4.",
1019
+ "bbox": [
1020
+ 507,
1021
+ 426,
1022
+ 882,
1023
+ 505
1024
+ ],
1025
+ "page_idx": 5
1026
+ },
1027
+ {
1028
+ "type": "text",
1029
+ "text": "Maximum Boundary Offset We investigate the impact of training the model with different maximum offset values $S$ through our ablation studies. The hyperparameter $S$ determines the annotation scope of non-entity spans with boundary offset. Specifically, the extreme scenario of setting $S$ to 0 corresponds to a condition \"w/o BO\" (without Boundary Offset). The results indicate a significant decline in performance when employing \"w/o BO,\" confirming the usefulness of utilizing boundary offsets as supervision. However, we also observe that the optimal $S$ value varies across different datasets. This could be attributed to the fact that a larger $S$ value provides more boundary knowledge but also increases the label search space. Consequently, hyperparameter tuning for $S$ becomes necessary to achieve the best performance in practice.",
1030
+ "bbox": [
1031
+ 507,
1032
+ 516,
1033
+ 884,
1034
+ 789
1035
+ ],
1036
+ "page_idx": 5
1037
+ },
1038
+ {
1039
+ "type": "text",
1040
+ "text": "In addition, we analyze the learning curves of our model with different maximum offset values. Figure 4 demonstrates that a larger $S$ can accelerate the training process of the model. We think the reason may be that a larger $S$ not only leads to an increase of positive samples but also results in a decrease of negative samples, thereby ultimately enhancing the trainability of the model.",
1041
+ "bbox": [
1042
+ 507,
1043
+ 790,
1044
+ 882,
1045
+ 917
1046
+ ],
1047
+ "page_idx": 5
1048
+ },
1049
+ {
1050
+ "type": "page_number",
1051
+ "text": "14839",
1052
+ "bbox": [
1053
+ 477,
1054
+ 927,
1055
+ 524,
1056
+ 940
1057
+ ],
1058
+ "page_idx": 5
1059
+ },
1060
+ {
1061
+ "type": "image",
1062
+ "img_path": "images/80743a7388518887de4cddd798286acf3542bc8074bcaf3df54dbf23b325835e.jpg",
1063
+ "image_caption": [
1064
+ "Figure 4: The learning curves on ACE 2004 dataset."
1065
+ ],
1066
+ "image_footnote": [],
1067
+ "bbox": [
1068
+ 134,
1069
+ 82,
1070
+ 463,
1071
+ 259
1072
+ ],
1073
+ "page_idx": 6
1074
+ },
1075
+ {
1076
+ "type": "table",
1077
+ "img_path": "images/9525a18639f669a1f475103602f75af1476495c53c686972228cffcd243de4c9.jpg",
1078
+ "table_caption": [],
1079
+ "table_footnote": [],
1080
+ "table_body": "<table><tr><td>Label</td><td>P</td><td>R</td><td>F1</td><td>Support</td></tr><tr><td>-2S</td><td>81.51</td><td>82.02</td><td>81.76</td><td>5029</td></tr><tr><td>-1S</td><td>81.62</td><td>82.97</td><td>82.29</td><td>5292</td></tr><tr><td>1S</td><td>79.55</td><td>81.47</td><td>80.50</td><td>3281</td></tr><tr><td>2S</td><td>76.27</td><td>79.55</td><td>77.88</td><td>1438</td></tr><tr><td>-2E</td><td>78.64</td><td>77.19</td><td>77.90</td><td>1464</td></tr><tr><td>-1E</td><td>79.79</td><td>80.58</td><td>80.18</td><td>3254</td></tr><tr><td>1E</td><td>82.26</td><td>82.20</td><td>82.23</td><td>5393</td></tr><tr><td>2E</td><td>82.37</td><td>80.75</td><td>81.57</td><td>5113</td></tr><tr><td>0</td><td>81.92</td><td>81.95</td><td>81.93</td><td>5495</td></tr><tr><td>ALL</td><td>79.21</td><td>84.22</td><td>81.64</td><td>5495</td></tr><tr><td>- w/ rules</td><td>81.85</td><td>82.56</td><td>82.20</td><td>5495</td></tr></table>",
1081
+ "bbox": [
1082
+ 119,
1083
+ 299,
1084
+ 485,
1085
+ 511
1086
+ ],
1087
+ "page_idx": 6
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "text": "Table 5: Performance of each boundary offset label on GENIA, where the maximum offset value is 2. The reported results is one out of five experiments.",
1092
+ "bbox": [
1093
+ 112,
1094
+ 521,
1095
+ 485,
1096
+ 565
1097
+ ],
1098
+ "page_idx": 6
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "3D Convolution Layer \"w/o 3DConv\" indicates the 3D convolution layers are removed. As seen, the results show a decline in performance across all datasets, indicating the importance of 3D convolution layers in capturing the interactions between boundary offsets of adjacent text spans.",
1103
+ "bbox": [
1104
+ 112,
1105
+ 590,
1106
+ 487,
1107
+ 687
1108
+ ],
1109
+ "page_idx": 6
1110
+ },
1111
+ {
1112
+ "type": "text",
1113
+ "text": "Type Inputs \"w/o Type Inputs\" refers to a setting where the entity types encoded with the sentence are replaced, in which the randomly initialized entity type embeddings are fed into the biaffine classifier. The results obtained in this setting show a slight decline in performance.",
1114
+ "bbox": [
1115
+ 112,
1116
+ 699,
1117
+ 487,
1118
+ 794
1119
+ ],
1120
+ "page_idx": 6
1121
+ },
1122
+ {
1123
+ "type": "text",
1124
+ "text": "Region Embedding The results demonstrate a slight drop in performance across all datasets without region embeddings. This suggests that integrating sample distribution features can be a reasonable approach for enhancing text span representations.",
1125
+ "bbox": [
1126
+ 112,
1127
+ 806,
1128
+ 487,
1129
+ 885
1130
+ ],
1131
+ "page_idx": 6
1132
+ },
1133
+ {
1134
+ "type": "text",
1135
+ "text": "As the CLN layer and biaffine classifier serve as fundamental components in our approach for span",
1136
+ "bbox": [
1137
+ 112,
1138
+ 887,
1139
+ 487,
1140
+ 919
1141
+ ],
1142
+ "page_idx": 6
1143
+ },
1144
+ {
1145
+ "type": "image",
1146
+ "img_path": "images/8053ec891e88602ef839556b5f26ee561c5811df50fa4443201d11aa38f9185d.jpg",
1147
+ "image_caption": [
1148
+ "Figure 5: A comparison of F1-scores on entities of different lengths in GENIA dataset. Entity supports are in the parentheses."
1149
+ ],
1150
+ "image_footnote": [],
1151
+ "bbox": [
1152
+ 529,
1153
+ 82,
1154
+ 863,
1155
+ 236
1156
+ ],
1157
+ "page_idx": 6
1158
+ },
1159
+ {
1160
+ "type": "text",
1161
+ "text": "representation and classification, they cannot be evaluated independently. Nonetheless, our ablation studies demonstrate the effectiveness of learning boundary offset information and the usefulness of each composition in our model.",
1162
+ "bbox": [
1163
+ 507,
1164
+ 319,
1165
+ 882,
1166
+ 400
1167
+ ],
1168
+ "page_idx": 6
1169
+ },
1170
+ {
1171
+ "type": "text",
1172
+ "text": "5.3 Detailed Analysis",
1173
+ "text_level": 1,
1174
+ "bbox": [
1175
+ 507,
1176
+ 420,
1177
+ 692,
1178
+ 435
1179
+ ],
1180
+ "page_idx": 6
1181
+ },
1182
+ {
1183
+ "type": "text",
1184
+ "text": "Performance on Different Offset Labels We investigate the performance of each boundary offset label, and the results are presented in Table 5. Notably, the offset label \"0\" has complete entity support and achieves an $F_{1}$ score of $82.04\\%$ . Furthermore, we observed a positive correlation between the quantity of entity support and the performance of boundary offset labels.",
1185
+ "bbox": [
1186
+ 507,
1187
+ 447,
1188
+ 882,
1189
+ 575
1190
+ ],
1191
+ "page_idx": 6
1192
+ },
1193
+ {
1194
+ "type": "text",
1195
+ "text": "When a text span is not predicted as \"out-of-range\", its assigned label can be utilized to determine the position of its nearest entity. By aggregating all predictions of offset labels, we observe a sharp decrease in precision score, along with a significant increase in recall score, when compared to only considering the center span (with an offset label of \"0\"). This finding suggests that different offset labels provide distinct information that assists the model in recognizing additional entities. Nevertheless, this approach can introduce noisy predictions due to the model's inadequate performance on certain labels. Despite this limitation, it may have practical applicability in recall-sensitive applications.",
1196
+ "bbox": [
1197
+ 507,
1198
+ 577,
1199
+ 882,
1200
+ 819
1201
+ ],
1202
+ "page_idx": 6
1203
+ },
1204
+ {
1205
+ "type": "text",
1206
+ "text": "As discussed in Section 3.3, we devise two heuristic rules to remove improbable predictions. Our findings reveal that this approach enhances the precision score, with only a minor reduction in the recall score, leading to an overall improvement in the $F_{1}$ score.",
1207
+ "bbox": [
1208
+ 507,
1209
+ 822,
1210
+ 882,
1211
+ 917
1212
+ ],
1213
+ "page_idx": 6
1214
+ },
1215
+ {
1216
+ "type": "page_number",
1217
+ "text": "14840",
1218
+ "bbox": [
1219
+ 477,
1220
+ 927,
1221
+ 524,
1222
+ 940
1223
+ ],
1224
+ "page_idx": 6
1225
+ },
1226
+ {
1227
+ "type": "image",
1228
+ "img_path": "images/7ecb4838dceef94fe33a44e5fd507039fdc00eaa747ec70b3febb19d1bbb31c2.jpg",
1229
+ "image_caption": [
1230
+ "Figure 6: Effect of varying percentage of training samples on GENIA. We train all models for 50 epochs and report their best performance."
1231
+ ],
1232
+ "image_footnote": [],
1233
+ "bbox": [
1234
+ 132,
1235
+ 82,
1236
+ 463,
1237
+ 262
1238
+ ],
1239
+ "page_idx": 7
1240
+ },
1241
+ {
1242
+ "type": "text",
1243
+ "text": "Performance on Entities with Varying Lengths We explore the model performance on entities of different lengths in GENIA. As shown in Figure 5, we compare the $F_{1}$ scores of models which are training with different $S$ . The model achieves higher $F_{1}$ scores across all columns when $S = 2$ , with a more pronounced performance improvement for longer entities. The results highlight the usefulness of learning boundary offsets between nonentity and entity spans, which helps the model learn boundary features more effectively.",
1244
+ "bbox": [
1245
+ 112,
1246
+ 342,
1247
+ 487,
1248
+ 519
1249
+ ],
1250
+ "page_idx": 7
1251
+ },
1252
+ {
1253
+ "type": "text",
1254
+ "text": "Size of Training Data As the boundary offset labels contain more informative knowledge, we hypothesize that our proposed BOPN would perform better with limited training data. As shown in Figure 6, our model achieves impressive results, exhibiting only a $5.46\\%$ decrease in performance when trained with a mere $12.5\\%$ of the available training data. In contrast, when boundary information is not utilized during training, the model's performance declines rapidly as the amount of training data decreases, thus creating significant obstacles to effective training.",
1255
+ "bbox": [
1256
+ 112,
1257
+ 527,
1258
+ 489,
1259
+ 721
1260
+ ],
1261
+ "page_idx": 7
1262
+ },
1263
+ {
1264
+ "type": "text",
1265
+ "text": "6 Related Work",
1266
+ "text_level": 1,
1267
+ "bbox": [
1268
+ 112,
1269
+ 732,
1270
+ 268,
1271
+ 747
1272
+ ],
1273
+ "page_idx": 7
1274
+ },
1275
+ {
1276
+ "type": "text",
1277
+ "text": "In recent years, various paradigms for named entity recognition (NER) have been proposed, among which span-based methods have become one of the most mainstream approaches, treating NER as a text span classification problem. With the development of pre-trained language models, some works (Sohrab and Miwa, 2018; Luan et al., 2019; Wadden et al., 2019) obtain span representations by connecting boundary representations or aggregating token representations and feeding them into",
1278
+ "bbox": [
1279
+ 112,
1280
+ 758,
1281
+ 489,
1282
+ 917
1283
+ ],
1284
+ "page_idx": 7
1285
+ },
1286
+ {
1287
+ "type": "text",
1288
+ "text": "a linear classifier for type prediction. Alternatively, Yu et al. (2020) utilizes a biaffine classifier to fuse start and end boundary representations directly for span classification. To further enhance span representation, several other methods (Wan et al., 2022; Yuan et al., 2022) propose fusing representations of token, boundary, and related entity spans.",
1289
+ "bbox": [
1290
+ 507,
1291
+ 84,
1292
+ 884,
1293
+ 197
1294
+ ],
1295
+ "page_idx": 7
1296
+ },
1297
+ {
1298
+ "type": "text",
1299
+ "text": "Meanwhile, some methods try to improve span-based methods by adding boundary supervision. Specifically, Zheng et al. (2019) and Tan et al. (2020) additionally detect entity boundaries with multi-task learning, while Shen et al. (2021) perform boundary regression after span prediction. Li et al. (2022) design two word-word relations for span classification. Compared with previous methods, our proposed method utilizes continuous boundary offset values to model text spans, which can capture both the boundary differences and connections between non-entity and entity spans.",
1300
+ "bbox": [
1301
+ 507,
1302
+ 198,
1303
+ 884,
1304
+ 391
1305
+ ],
1306
+ "page_idx": 7
1307
+ },
1308
+ {
1309
+ "type": "text",
1310
+ "text": "In addition to span-based methods, there are three widely-used NER methods. The traditional sequence labeling methods (Huang et al., 2015; Lample et al., 2016) assign each token a tag with a pre-designed tagging scheme (e.g., $BIO$ ). To address nested entities, some works (Ju et al., 2018; Wang et al., 2020; Rojas et al., 2022) add struggles or design special tagging schemes. Hypergraph-based methods (Lu and Roth, 2015; Katiyar and Cardie, 2018; Wang and Lu, 2018) represent the input sentence as a hypergraph for detecting nested entities, which must be carefully designed to avoid spurious structures. Sequence-to-sequence methods reformulate NER as a sequence generation problem. For example, Gillick et al. (2016) first apply the Seq2Seq model for NER, inputting the sentence and outputting start positions, entity lengths, and types. Straková et al. (2019) use the Seq2Seq model and enhanced BILOU scheme to address nested NER. Yan et al. (2021) treats NER as an entity span sequence generation problem with pointer network based on BART (Lewis et al., 2019).",
1311
+ "bbox": [
1312
+ 507,
1313
+ 393,
1314
+ 884,
1315
+ 745
1316
+ ],
1317
+ "page_idx": 7
1318
+ },
1319
+ {
1320
+ "type": "text",
1321
+ "text": "7 Conclusion",
1322
+ "text_level": 1,
1323
+ "bbox": [
1324
+ 509,
1325
+ 762,
1326
+ 640,
1327
+ 778
1328
+ ],
1329
+ "page_idx": 7
1330
+ },
1331
+ {
1332
+ "type": "text",
1333
+ "text": "In this paper, we introduce a novel approach for named entity recognition (NER) called the Boundary Offset Prediction Network (BOPN). BOPN predicts the boundary offsets between candidate spans and their nearest entities, leveraging entity types as inputs. By incorporating entity types, BOPN enables parallel prediction of type-aware boundary offsets, enhancing the model's ability to capture",
1334
+ "bbox": [
1335
+ 507,
1336
+ 790,
1337
+ 882,
1338
+ 917
1339
+ ],
1340
+ "page_idx": 7
1341
+ },
1342
+ {
1343
+ "type": "page_number",
1344
+ "text": "14841",
1345
+ "bbox": [
1346
+ 477,
1347
+ 928,
1348
+ 522,
1349
+ 940
1350
+ ],
1351
+ "page_idx": 7
1352
+ },
1353
+ {
1354
+ "type": "text",
1355
+ "text": "fine-grained entity boundaries. To capture the interactions between boundary offsets, we employ multiple 3D convolution layers, which refine the offset predictions and capture the inherent quantitative relationships between adjacent text spans.",
1356
+ "bbox": [
1357
+ 112,
1358
+ 84,
1359
+ 487,
1360
+ 164
1361
+ ],
1362
+ "page_idx": 8
1363
+ },
1364
+ {
1365
+ "type": "text",
1366
+ "text": "The experimental results demonstrate that our proposed method achieves state-of-the-art performance on eight widely-used datasets, including five English NER datasets and three Chinese NER datasets. Moreover, further analysis reveals a significant improvement in recall scores by utilizing boundary offset as supervision, showcasing the utility of our approach for recall-sensitive applications in NER.",
1367
+ "bbox": [
1368
+ 115,
1369
+ 166,
1370
+ 489,
1371
+ 307
1372
+ ],
1373
+ "page_idx": 8
1374
+ },
1375
+ {
1376
+ "type": "text",
1377
+ "text": "Limitations",
1378
+ "text_level": 1,
1379
+ "bbox": [
1380
+ 112,
1381
+ 321,
1382
+ 218,
1383
+ 336
1384
+ ],
1385
+ "page_idx": 8
1386
+ },
1387
+ {
1388
+ "type": "text",
1389
+ "text": "The proposed BOPN approach has certain limitations that should be acknowledged. Firstly, while BOPN treats boundary offsets as classification targets, it does not explicitly model the order relationship between offset values. Although the 3D convolution layers are employed to implicitly capture interactions between boundary offsets, they do not provide a strong constraint on the ordering of offset labels.",
1390
+ "bbox": [
1391
+ 112,
1392
+ 346,
1393
+ 487,
1394
+ 489
1395
+ ],
1396
+ "page_idx": 8
1397
+ },
1398
+ {
1399
+ "type": "text",
1400
+ "text": "Additionally, the method uses boundary offsets to convert some non-entity spans into positive samples, which leads to higher recall scores but potentially lower precision scores. To optimize prediction results, heuristic rules are applied to filter out unreasonable samples. However, these rules are based on observations and may not be comprehensive enough to handle all cases effectively.",
1401
+ "bbox": [
1402
+ 112,
1403
+ 491,
1404
+ 487,
1405
+ 619
1406
+ ],
1407
+ "page_idx": 8
1408
+ },
1409
+ {
1410
+ "type": "text",
1411
+ "text": "Therefore, there is still a need to explore more effective ways to integrate and optimize the offset predictions in order to address these limitations and enhance the overall performance of the BOPN approach.",
1412
+ "bbox": [
1413
+ 112,
1414
+ 620,
1415
+ 487,
1416
+ 700
1417
+ ],
1418
+ "page_idx": 8
1419
+ },
1420
+ {
1421
+ "type": "text",
1422
+ "text": "Ethics Statement",
1423
+ "text_level": 1,
1424
+ "bbox": [
1425
+ 112,
1426
+ 712,
1427
+ 265,
1428
+ 726
1429
+ ],
1430
+ "page_idx": 8
1431
+ },
1432
+ {
1433
+ "type": "text",
1434
+ "text": "To address ethical concerns, we provide the two detailed description: 1) All experiments were conducted on existing datasets derived from public scientific papers. 2) Our work does not contain any personally identifiable information and does not harm anyone.",
1435
+ "bbox": [
1436
+ 112,
1437
+ 737,
1438
+ 487,
1439
+ 833
1440
+ ],
1441
+ "page_idx": 8
1442
+ },
1443
+ {
1444
+ "type": "text",
1445
+ "text": "Acknowledgements",
1446
+ "text_level": 1,
1447
+ "bbox": [
1448
+ 112,
1449
+ 846,
1450
+ 285,
1451
+ 860
1452
+ ],
1453
+ "page_idx": 8
1454
+ },
1455
+ {
1456
+ "type": "text",
1457
+ "text": "This work was supported by Strategic Priority Research Program of Chinese Academy of Sciences (N0. XDC02040400).",
1458
+ "bbox": [
1459
+ 112,
1460
+ 870,
1461
+ 487,
1462
+ 917
1463
+ ],
1464
+ "page_idx": 8
1465
+ },
1466
+ {
1467
+ "type": "text",
1468
+ "text": "References",
1469
+ "text_level": 1,
1470
+ "bbox": [
1471
+ 510,
1472
+ 83,
1473
+ 608,
1474
+ 98
1475
+ ],
1476
+ "page_idx": 8
1477
+ },
1478
+ {
1479
+ "type": "list",
1480
+ "sub_type": "ref_text",
1481
+ "list_items": [
1482
+ "Pei Chen, Haibo Ding, Jun Araki, and Ruihong Huang. 2021. Explicitly capturing relations between entity mentions via graph neural networks for domain-specific named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 735-742.",
1483
+ "Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, and Ziqing Yang. 2021. Pre-training with whole word masking for chinese bert. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 29:3504-3514.",
1484
+ "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186.",
1485
+ "Dan Gillick, Cliff Brunk, Oriol Vinyals, and Amarnag Subramanya. 2016. Multilingual language processing from bytes. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1296-1306.",
1486
+ "Xu Han, Weilin Zhao, Ning Ding, Zhiyuan Liu, and Maosong Sun. 2022.Ptr: Prompt tuning with rules for text classification. AI Open, 3:182-192.",
1487
+ "Dan Hendrycks and Kevin Gimpel. 2016. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415.",
1488
+ "Feng Hou, Ruili Wang, Jun He, and Yi Zhou. 2020. Improving entity linking through semantic reinforced entity embeddings. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6843-6848.",
1489
+ "Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991.",
1490
+ "Justin M Johnson and Taghi M Khoshgoftaar. 2019. Survey on deep learning with class imbalance. Journal of Big Data, 6(1):1-54.",
1491
+ "Meizhi Ju, Makoto Miwa, and Sophia Ananiadou. 2018. A neural layered model for nested named entity recognition. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1446-1459.",
1492
+ "Arzoo Katiyar and Claire Cardie. 2018. Nested named entity recognition revisited. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, volume 1."
1493
+ ],
1494
+ "bbox": [
1495
+ 510,
1496
+ 105,
1497
+ 884,
1498
+ 917
1499
+ ],
1500
+ "page_idx": 8
1501
+ },
1502
+ {
1503
+ "type": "page_number",
1504
+ "text": "14842",
1505
+ "bbox": [
1506
+ 477,
1507
+ 928,
1508
+ 524,
1509
+ 940
1510
+ ],
1511
+ "page_idx": 8
1512
+ },
1513
+ {
1514
+ "type": "list",
1515
+ "sub_type": "ref_text",
1516
+ "list_items": [
1517
+ "Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 260-270.",
1518
+ "Phong Le and Ivan Titov. 2018. Improving entity linking by modeling latent relations between mentions. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1595-1604.",
1519
+ "Jinhyuk Lee, Wonjin Yoon, Sungdong Kim, Donghyeon Kim, Sunkyu Kim, Chan Ho So, and Jaewoo Kang. 2020. Biobert: a pre-trained biomedical language representation model for biomedical text mining. Bioinformatics, 36(4):1234-1240.",
1520
+ "Gina-Anne Levow. 2006. The third international Chinese language processing bakeoff: Word segmentation and named entity recognition. In Proceedings of the Fifth SIGHAN workshop on Chinese language processing, pages 108-117.",
1521
+ "Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. 2019. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461.",
1522
+ "Fei Li, ZhiChao Lin, Meishan Zhang, and Donghong Ji. 2021a. A span-based model for joint overlapped and discontinuous named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 4814-4828, Online. Association for Computational Linguistics.",
1523
+ "Jingye Li, Hao Fei, Jiang Liu, Shengqiong Wu, Meishan Zhang, Chong Teng, Donghong Ji, and Fei Li. 2022. Unified named entity recognition as word-word relation classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 10965-10973.",
1524
+ "Jingye Li, Kang Xu, Fei Li, Hao Fei, Yafeng Ren, and Donghong Ji. 2021b. Mrn: A locally and globally mention-based reasoning network for document-level relation extraction. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 1359-1370.",
1525
+ "Xiaonan Li, Hang Yan, Xipeng Qiu, and Xuan-Jing Huang. 2020. Flat: Chinese ner using flat-lattice transformer. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6836-6842.",
1526
+ "Ruibo Liu, Jason Wei, Chenyan Jia, and Soroush Vosoughi. 2021. Modulating language models with"
1527
+ ],
1528
+ "bbox": [
1529
+ 115,
1530
+ 85,
1531
+ 489,
1532
+ 917
1533
+ ],
1534
+ "page_idx": 9
1535
+ },
1536
+ {
1537
+ "type": "list",
1538
+ "sub_type": "ref_text",
1539
+ "list_items": [
1540
+ "emotions. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 4332-4339.",
1541
+ "Ilya Loshchilov and Frank Hutter. 2017. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101.",
1542
+ "Wei Lu and Dan Roth. 2015. Joint mention extraction and classification with mention hypergraphs. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 857-867.",
1543
+ "Yi Luan, Dave Wadden, Luheng He, Amy Shah, Mari Ostendorf, and Hannaneh Hajishirzi. 2019. A general framework for information extraction using dynamic span graphs. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 3036-3046, Minneapolis, Minnesota. Association for Computational Linguistics.",
1544
+ "Ruotian Ma, Minlong Peng, Qi Zhang, Zhongyu Wei, and Xuan-Jing Huang. 2020. Simplify the usage of lexicon in chinese ner. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5951-5960.",
1545
+ "Makoto Miwa and Mohit Bansal. 2016. End-to-end relation extraction using lstms on sequences and tree structures. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1105-1116.",
1546
+ "Tomoko Ohta, Yuka Tateisi, Jin-Dong Kim, Hideki Mima, and Junichi Tsujii. 2002. The genia corpus: An annotated research abstract corpus in molecular biology domain. In Proceedings of the human language technology conference, pages 73-77. CiteSeer.",
1547
+ "Nanyun Peng and Mark Dredze. 2015. Named entity recognition for chinese social media with jointly trained embeddings. In Proceedings of the 2015 conference on empirical methods in natural language processing, pages 548-554.",
1548
+ "Sameer Pradhan, Alessandro Moschitti, Nianwen Xue, Olga Uryupina, and Yuchen Zhang. 2012. Conll-2012 shared task: Modeling multilingual unrestricted coreference in onthonotes. In Joint conference on EMNLP and CoNLL-shared task, pages 1-40.",
1549
+ "Guanghui Qin and Jason Eisner. 2021. Learning how to ask: Querying lms with mixtures of soft prompts. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5203-5212.",
1550
+ "Matías Rojas, Felipe Bravo-Marquez, and Jocelyn Dunstan. 2022. Simple yet powerful: An overlooked architecture for nested named entity recognition. In Proceedings of the 29th International Conference on Computational Linguistics, pages 2108-2117."
1551
+ ],
1552
+ "bbox": [
1553
+ 510,
1554
+ 85,
1555
+ 880,
1556
+ 917
1557
+ ],
1558
+ "page_idx": 9
1559
+ },
1560
+ {
1561
+ "type": "page_number",
1562
+ "text": "14843",
1563
+ "bbox": [
1564
+ 477,
1565
+ 928,
1566
+ 524,
1567
+ 940
1568
+ ],
1569
+ "page_idx": 9
1570
+ },
1571
+ {
1572
+ "type": "list",
1573
+ "sub_type": "ref_text",
1574
+ "list_items": [
1575
+ "Erik Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the conll-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pages 142-147.",
1576
+ "Yongliang Shen, Xinyin Ma, Zeqi Tan, Shuai Zhang, Wen Wang, and Weiming Lu. 2021. Locate and label: A two-stage identifier for nested named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 2782-2794.",
1577
+ "Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. 2023a. Diffusion: Boundary diffusion for named entity recognition. arXiv preprint arXiv:2305.13298.",
1578
+ "Yongliang Shen, Zeqi Tan, Shuhui Wu, Wenqi Zhang, Rongsheng Zhang, Yadong Xi, Weiming Lu, and Yueting Zhuang. 2023b. Prompter: Prompt locating and typing for named entity recognition. arXiv preprint arXiv:2305.17104.",
1579
+ "Yongliang Shen, Xiaobin Wang, Zeqi Tan, Guangwei Xu, Pengjun Xie, Fei Huang, Weiming Lu, and Yueting Zhuang. 2022. Parallel instance query network for named entity recognition. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 947-961.",
1580
+ "Mohammad Golam Sohrab and Makoto Miwa. 2018. Deep exhaustive model for nested named entity recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2843-2849.",
1581
+ "Jana Straková, Milan Straka, and Jan Hajic. 2019. Neural architectures for nested ner through linearization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5326-5331.",
1582
+ "Chuanqi Tan, Wei Qiu, Mosha Chen, Rui Wang, and Fei Huang. 2020. Boundary enhanced neural span classification for nested named entity recognition. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pages 9016-9023.",
1583
+ "Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. 2016. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022.",
1584
+ "David Wadden, Ulme Wennberg, Yi Luan, and Hannaneh Hajishirzi. 2019. Entity, relation, and event extraction with contextualized span representations. 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), pages 5784-5789, Hong Kong, China. Association for Computational Linguistics."
1585
+ ],
1586
+ "bbox": [
1587
+ 115,
1588
+ 85,
1589
+ 489,
1590
+ 917
1591
+ ],
1592
+ "page_idx": 10
1593
+ },
1594
+ {
1595
+ "type": "list",
1596
+ "sub_type": "ref_text",
1597
+ "list_items": [
1598
+ "Juncheng Wan, Dongyu Ru, Weinan Zhang, and Yong Yu. 2022. Nested named entity recognition with span-level graphs. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 892-903, Dublin, Ireland. Association for Computational Linguistics.",
1599
+ "Bailin Wang and Wei Lu. 2018. Neural segmental hypergraphs for overlapping mention recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 204-214.",
1600
+ "Jue Wang, Lidan Shou, Ke Chen, and Gang Chen. 2020. Pyramid: A layered model for nested named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5918-5928.",
1601
+ "Shuang Wu, Xiaoning Song, and Zhenhua Feng. 2021. Mect: Multi-metadata embedding based cross-transformer for chinese named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 1529-1539.",
1602
+ "Hang Yan, Tao Gui, Junqi Dai, Qipeng Guo, Zheng Zhang, and Xipeng Qiu. 2021. A unified generative framework for various ner subtasks. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 5808-5822.",
1603
+ "Juntao Yu, Bernd Bohnet, and Massimo Poesio. 2020. Named entity recognition as dependency parsing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6470-6476.",
1604
+ "Zheng Yuan, Chuanqi Tan, Songfang Huang, and Fei Huang. 2022. Fusing heterogeneous factors with triaffine mechanism for nested named entity recognition. In *Findings of the Association for Computational Linguistics: ACL* 2022, pages 3174-3186.",
1605
+ "Yue Zhang and Jie Yang. 2018. Chinese ner using lattice LSTM. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1554-1564.",
1606
+ "Changmeng Zheng, Yi Cai, Jingyun Xu, Ho-fung Leung, and Guandong Xu. 2019. A boundary-aware neural model for nested named entity recognition. 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), pages 357-366, Hong Kong, China. Association for Computational Linguistics.",
1607
+ "Enwei Zhu and Jinpeng Li. 2022. Boundary smoothing for named entity recognition. In Proceedings of the"
1608
+ ],
1609
+ "bbox": [
1610
+ 510,
1611
+ 85,
1612
+ 884,
1613
+ 917
1614
+ ],
1615
+ "page_idx": 10
1616
+ },
1617
+ {
1618
+ "type": "page_number",
1619
+ "text": "14844",
1620
+ "bbox": [
1621
+ 477,
1622
+ 928,
1623
+ 524,
1624
+ 940
1625
+ ],
1626
+ "page_idx": 10
1627
+ },
1628
+ {
1629
+ "type": "text",
1630
+ "text": "60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7096-7108.",
1631
+ "bbox": [
1632
+ 131,
1633
+ 85,
1634
+ 489,
1635
+ 124
1636
+ ],
1637
+ "page_idx": 11
1638
+ },
1639
+ {
1640
+ "type": "text",
1641
+ "text": "A Appendix",
1642
+ "text_level": 1,
1643
+ "bbox": [
1644
+ 114,
1645
+ 149,
1646
+ 236,
1647
+ 166
1648
+ ],
1649
+ "page_idx": 11
1650
+ },
1651
+ {
1652
+ "type": "text",
1653
+ "text": "A.1 Datasets",
1654
+ "text_level": 1,
1655
+ "bbox": [
1656
+ 114,
1657
+ 175,
1658
+ 231,
1659
+ 190
1660
+ ],
1661
+ "page_idx": 11
1662
+ },
1663
+ {
1664
+ "type": "text",
1665
+ "text": "We evaluate our method on eight datasets, including CoNLL 2003, OntoNotes 5, ACE 2004, ACE 2005, and GENIA for English NER datasets; MSRA, Resume NER and Weibo NER for Chinese NER datasets. Table 6 presents the detailed statistics of datasets.",
1666
+ "bbox": [
1667
+ 112,
1668
+ 196,
1669
+ 489,
1670
+ 292
1671
+ ],
1672
+ "page_idx": 11
1673
+ },
1674
+ {
1675
+ "type": "text",
1676
+ "text": "A.2 Implementation Details",
1677
+ "text_level": 1,
1678
+ "bbox": [
1679
+ 114,
1680
+ 304,
1681
+ 349,
1682
+ 319
1683
+ ],
1684
+ "page_idx": 11
1685
+ },
1686
+ {
1687
+ "type": "text",
1688
+ "text": "We use BioBERT-v1.1 (Lee et al., 2020) as the contextual embedding in GENIA. For other English corpora, we BERT-large-cased (Devlin et al., 2019) as the contextual embedding. For Chinese corpora, we use the BERT pre-trained with whole word masking (Cui et al., 2021). Our model is implemented with PyTorch and trained with a NVIDIA RTX3090 GPU. We use a grid search to find the best hyperparameters which are tuned on the development set. The range of hyperparameters we used for eight datasets are listed in Table 7.",
1689
+ "bbox": [
1690
+ 112,
1691
+ 324,
1692
+ 489,
1693
+ 500
1694
+ ],
1695
+ "page_idx": 11
1696
+ },
1697
+ {
1698
+ "type": "text",
1699
+ "text": "A.3Baselines",
1700
+ "text_level": 1,
1701
+ "bbox": [
1702
+ 114,
1703
+ 512,
1704
+ 236,
1705
+ 526
1706
+ ],
1707
+ "page_idx": 11
1708
+ },
1709
+ {
1710
+ "type": "text",
1711
+ "text": "We compare BOPN with the following baselines:",
1712
+ "bbox": [
1713
+ 112,
1714
+ 533,
1715
+ 480,
1716
+ 548
1717
+ ],
1718
+ "page_idx": 11
1719
+ },
1720
+ {
1721
+ "type": "list",
1722
+ "sub_type": "text",
1723
+ "list_items": [
1724
+ "- BiLSTM-CRF (Miwa and Bansal, 2016) is a model for sequence labeling tasks that combines BiLSTM with CRF layers.",
1725
+ "- BERT-Tagger (Devlin et al., 2019) that utilizes the pre-trained language model BERT as a feature extractor and incorporates a tag classifier for fine-tuning.",
1726
+ "- Lattice (Zhang and Yang, 2018) proposed a lattice-structured LSTM model for Chinese NER.",
1727
+ "- Layered (Ju et al., 2018) dynamically stacks flat NER layers to solve nested NER task.",
1728
+ "- Flat (Li et al., 2020) proposes a flat-lattice transformer for Chinese NER, which converts the lattice structure into a flat structure consisting of spans.",
1729
+ "- Pyramid (Wang et al., 2020) designs pyramid layer and inverse pyramid layer to decode nested entities."
1730
+ ],
1731
+ "bbox": [
1732
+ 136,
1733
+ 558,
1734
+ 489,
1735
+ 917
1736
+ ],
1737
+ "page_idx": 11
1738
+ },
1739
+ {
1740
+ "type": "list",
1741
+ "sub_type": "text",
1742
+ "list_items": [
1743
+ "- SoftLexicon (Ma et al., 2020) proposes a Chinese NER method in which lexicon information is introduced by simply adjusting the character representation layer.",
1744
+ "- MECT (Wu et al., 2021) uses multi-metadata embedding in a two-stream transformer to integrate Chinese character features with the radical-level embedding.",
1745
+ "- Biaffine (Yu et al., 2020) classifies text spans by a biaffine classifier between boundary representations.",
1746
+ "- Locate and Label (Shen et al., 2021) proposed a two-stage identifier of locating entities with boundary regression first and classifying them later.",
1747
+ "- W2NER (Li et al., 2022) models NER as word-word relation classification, including the next-neighboring-word and the tail-head-word relations.",
1748
+ "- Triaffine (Yuan et al., 2022) proposed a tri-affine mechanism to fuse information of inside tokens, boundaries, labels for NER.",
1749
+ "- Boundary Smooth (Zhu and Li, 2022) proposed boundary smoothing as a regularization technique for span-based neural NER models.",
1750
+ "- DiffusionNER (Shen et al., 2023a) formulates NER as a boundary-denoising diffusion process, which samples noisy spans from a Gaussian distribution.",
1751
+ "- Seq2Seq (Straková et al., 2019) converts the labels of nested entities into a sequence and then uses a seq2seq model to decode entities.",
1752
+ "- BartNER (Yan et al., 2021) formulates NER as an entity span sequence generation problem based on the pre-training Seq2Seq model BART (Lewis et al., 2019).",
1753
+ "PIQN (Shen et al., 2022) sets up global and learnable instance queries to extract entities from a sentence in a parallel manner.",
1754
+ "- PromptNER (Shen et al., 2023b) unifies entity locating and entity typing in prompt learning for NER, which predicts all entities by filling position slots and type slots."
1755
+ ],
1756
+ "bbox": [
1757
+ 531,
1758
+ 84,
1759
+ 884,
1760
+ 892
1761
+ ],
1762
+ "page_idx": 11
1763
+ },
1764
+ {
1765
+ "type": "page_number",
1766
+ "text": "14845",
1767
+ "bbox": [
1768
+ 477,
1769
+ 928,
1770
+ 524,
1771
+ 940
1772
+ ],
1773
+ "page_idx": 11
1774
+ },
1775
+ {
1776
+ "type": "table",
1777
+ "img_path": "images/5dffea8ce0cd1df58b1b2e1979097de0347a1fe50c0ec75bfd57ecae3a4bd1a4.jpg",
1778
+ "table_caption": [],
1779
+ "table_footnote": [],
1780
+ "table_body": "<table><tr><td></td><td>CoNLL 2003</td><td>OntoNotes 5</td><td>ACE 2004</td><td>ACE 2005</td><td>GENIA</td><td>MSRA</td><td>Resume</td><td>Weibo</td></tr><tr><td>Types</td><td>4</td><td>18</td><td>7</td><td>7</td><td>5</td><td>3</td><td>8</td><td>4</td></tr><tr><td>#Train.S</td><td>17291</td><td>59924</td><td>6200</td><td>7194</td><td>16692</td><td>46471</td><td>3819</td><td>1350</td></tr><tr><td>#Dev.S</td><td>-</td><td>8528</td><td>745</td><td>969</td><td>-</td><td>-</td><td>463</td><td>270</td></tr><tr><td>#Test.S</td><td>3453</td><td>8262</td><td>812</td><td>1047</td><td>1854</td><td>4376</td><td>477</td><td>270</td></tr><tr><td>Avg.Len.S</td><td>14.38</td><td>18.11</td><td>22.61</td><td>18.97</td><td>25.41</td><td>45.54</td><td>31.17</td><td>54.57</td></tr><tr><td>#Train.E</td><td>29441</td><td>128738</td><td>22204</td><td>9389</td><td>50509</td><td>74703</td><td>13438</td><td>1855</td></tr><tr><td>#Dev.E</td><td>-</td><td>20354</td><td>2514</td><td>1112</td><td>-</td><td>-</td><td>1497</td><td>379</td></tr><tr><td>#Test.E</td><td>5648</td><td>12586</td><td>3035</td><td>1118</td><td>5506</td><td>6181</td><td>1630</td><td>409</td></tr><tr><td>Avg.Len.E</td><td>1.45</td><td>1.83</td><td>2.50</td><td>2.28</td><td>1.97</td><td>3.24</td><td>5.88</td><td>2.60</td></tr></table>",
1781
+ "bbox": [
1782
+ 119,
1783
+ 80,
1784
+ 884,
1785
+ 247
1786
+ ],
1787
+ "page_idx": 12
1788
+ },
1789
+ {
1790
+ "type": "table",
1791
+ "img_path": "images/a371baf555b1f0288923db625c9c7bd334695def450301addcfc8eab21880179.jpg",
1792
+ "table_caption": [
1793
+ "Table 6: Dataset Statistics. \"#\" denotes the amount. \"S.\" and \"E.\" denote sentence and entity mentions, respectively."
1794
+ ],
1795
+ "table_footnote": [],
1796
+ "table_body": "<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Epoch</td><td>[50, 80]</td></tr><tr><td>Batch size</td><td>[8, 16]</td></tr><tr><td>Learning rate (BERT)</td><td>[5e-6, 3e-5]</td></tr><tr><td>Learning rate (Other)</td><td>1e-3</td></tr><tr><td>LSTM hidden size d</td><td>256</td></tr><tr><td>LSTM dropout</td><td>0.5</td></tr><tr><td>Region embedding size de</td><td>20</td></tr><tr><td>Biaffine hidden size db</td><td>150</td></tr><tr><td>Biaffine dropout</td><td>0.2</td></tr><tr><td>Maximum offset value S</td><td>[1, 3]</td></tr><tr><td>Adam epsilon</td><td>1e-8</td></tr><tr><td>Warm factor</td><td>0.1</td></tr></table>",
1797
+ "bbox": [
1798
+ 139,
1799
+ 478,
1800
+ 460,
1801
+ 705
1802
+ ],
1803
+ "page_idx": 12
1804
+ },
1805
+ {
1806
+ "type": "text",
1807
+ "text": "Table 7: Hyper-parameter settings.",
1808
+ "bbox": [
1809
+ 181,
1810
+ 714,
1811
+ 418,
1812
+ 730
1813
+ ],
1814
+ "page_idx": 12
1815
+ },
1816
+ {
1817
+ "type": "page_number",
1818
+ "text": "14846",
1819
+ "bbox": [
1820
+ 477,
1821
+ 928,
1822
+ 524,
1823
+ 940
1824
+ ],
1825
+ "page_idx": 12
1826
+ }
1827
+ ]
2023/A Boundary Offset Prediction Network for Named Entity Recognition/5304d5a7-baa1-46a8-bf30-4a5c29036879_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Boundary Offset Prediction Network for Named Entity Recognition/5304d5a7-baa1-46a8-bf30-4a5c29036879_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a53d15a37dc056ff66a5ecd0c9f6c1f9663644d405039bca4d579907f8772ac5
3
+ size 811013
2023/A Boundary Offset Prediction Network for Named Entity Recognition/full.md ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Boundary Offset Prediction Network for Named Entity Recognition
2
+
3
+ Minghao Tang $^{1,2}$ , Yongquan He $^{3}$ , Yongxiu Xu $^{1,2*}$ , Hongbo Xu $^{1}$ , Wenyuan Zhang $^{1,2}$ and Yang Lin $^{3}$
4
+
5
+ $^{1}$ Institute of Information Engineering, CAS, China
6
+
7
+ $^{2}$ School of Cyber Security, UCAS, China
8
+
9
+ <sup>3</sup>Meituan, China
10
+
11
+ {tangminghao,xuyongxiu,hbxu}@ie.ac.cn, heyongquan@meituan.com
12
+
13
+ # Abstract
14
+
15
+ Named entity recognition (NER) is a fundamental task in natural language processing that aims to identify and classify named entities in text. However, span-based methods for NER typically assign entity types to text spans, resulting in an imbalanced sample space and neglecting the connections between non-entity and entity spans. To address these issues, we propose a novel approach for NER, named the Boundary Offset Prediction Network (BOPN), which predicts the boundary offsets between candidate spans and their nearest entity spans. By leveraging the guiding semantics of boundary offsets, BOPN establishes connections between non-entity and entity spans, enabling non-entity spans to function as additional positive samples for entity detection. Furthermore, our method integrates entity type and span representations to generate type-aware boundary offsets instead of using entity types as detection targets. We conduct experiments on eight widely-used NER datasets, and the results demonstrate that our proposed BOPN outperforms previous state-of-the-art methods.
16
+
17
+ # 1 Introduction
18
+
19
+ Named entity recognition (NER) is a fundamental task in natural language processing (NLP) that involves identifying and categorizing named entities in text, such as people, locations and organizations. It has drawn much attention from the community due to its relevance in various NLP applications, such as entity linking (Le and Titov, 2018; Hou et al., 2020) and relation extraction (Miwa and Bansal, 2016; Li et al., 2021b).
20
+
21
+ Various paradigms have been proposed for NER, including the sequence labeling (Huang et al., 2015; Ju et al., 2018), hypergraph-based (Lu and Roth, 2015; Katiyar and Cardie, 2018; Wang and Lu, 2018), sequence-to-sequence (Gillick et al., 2016; Yan et al., 2021) and span-based methods (Sohrab
22
+
23
+ ![](images/afdc6e2991a1a66df20f5b60549e17670764767519c981aef32ce0850c1a9658.jpg)
24
+ protein protein cell_type HMG box containing transcription factors in lymphocyte differentiation
25
+ Figure 1: A sentence from GENIA dataset (Ohta et al., 2002), containing 8 words and 3 entities. The candidate spans covers the upper triangular region with a total of 36 samples of each matrix. There are 2 and 1 positive samples for "protein" and "cell type" entity types, respectively.
26
+
27
+ and Miwa, 2018; Shen et al., 2021; Chen et al., 2021). Among these approaches, the span-based method has become the most popular due to its simplicity and effectiveness. It is straightforward that typically embeds all possible text spans and predicts their entity types, making it suitable for various NER subtasks (Li et al., 2021a, 2022).
28
+
29
+ Despite significant progress made by span-based methods in NER, there remain two critical issues that require attention. Firstly, these methods often suffer from highly imbalanced sample spaces, as exemplified in Figure 1. Such imbalance can negatively impact the trainability and performance of deep neural networks (Johnson and Khoshgoftaar, 2019). Although some methods (Shen et al., 2021; Wan et al., 2022) mitigate this issue by restricting the maximum span length, such an approach can also constrain the model's predictive power. Secondly, current span-based methods primarily focus on learning the distinction between non-entities and entities, disregarding their relationships. While a model can identify whether "HMG box" is an entity, it may fail to recognize the connection be
30
+
31
+ ![](images/e231c942f392d6606bda85462443b42c741df015dc8fca7920e84c9d9c0c8541.jpg)
32
+ Figure 2: Text spans annotated with boundary offset. "1S" or "1E" represents a span has 1 offset from its nearest entity at the start or end boundary, and so on.
33
+
34
+ tween "HMG" and "HMG box." To enhance the model's ability to recognize entities, it is crucial to explicitly capture both boundary differences and connections between non-entities and entities.
35
+
36
+ In this paper, we intend to model text spans by utilizing boundary offset information as supervision, rather than predict their probability of belonging to entities. As shown in Figure 2, there could be two advantages for deep models when boundary offsets are learnable: i) The natural quantitative relationships between offset values enable the model to capture boundary differences and connections simultaneously. ii) Non-entity spans can have specific semantics that guide the positioning of entity spans, leading to an improved sample space with fewer negative samples.
37
+
38
+ Based on this observation, we propose the Boundary Offset Prediction Network (BOPN) for NER. BOPN focuses on predicting boundary offsets between candidate spans and their nearest entities, providing a new perspective on modeling text spans. Specifically, our method follows the pipeline of first learning span representations and then classifying them for offset prediction. BERT (Devlin et al., 2019) and BiLSTM (Lample et al., 2016) are used to embed texts, followed by a Conditional Layer (Liu et al., 2021) for building span representations. Meanwhile, we also treat entity types as inputs rather than classification targets, which are fused with span representations to generate type-aware boundary offsets in parallel. Finally, we incorporate multiple 3D convolution layers to capture the natural quantitative relationships between the offset values.
39
+
40
+ We evaluate our method on eight widely-used NER datasets, including five English NER datasets and three Chinese NER datasets. The experimental results demonstrate that our approach outperforms the existing state-of-the-art methods. Furthermore, a detailed examination reveals a significant im
41
+
42
+ provement in recall scores when aggregating results across offset labels, which is particularly beneficial for recall-sensitive applications.
43
+
44
+ # 2 Problem Definition
45
+
46
+ Named Entity Recognition (NER) aims to identify of all entities within an input sentence $\mathrm{X} = \{x_{n}\}_{n = 1}^{N}$ , based on a pre-defined set of entity types $\mathrm{Y} = \{y_{m}\}_{m = 1}^{M}$ . Typically, an entity is specified by token boundaries and a entity types.
47
+
48
+ Our proposed method focuses on predicting the boundary offset between each candidate text span and its nearest entity. Hence, we formulate each text span as a quadruple: $\{x_{i}, x_{j}, f_{s}, y_{m}\}$ , where $i$ and $j$ denote the start and end boundary indices of the span, $f_{s}$ represents the start or end boundary offset from its nearest entity of type $y_{m}$ . Note that an entity span is a special case with $f_{s} = 0$ .
49
+
50
+ Annotation Guidelines To facilitate understanding, we present the essential boundary offset labels as follow:
51
+
52
+ - Center Span: refers to an entity span with an offset label of "0".
53
+ - $\mathbf{\nabla}^{*}\mathbf{S}$ or $\mathbf{\nabla}^{*}\mathbf{E}$ : denotes the annotation of the start or end boundary offsets for non-entity spans. " $\ast$ " represents an offset value in the range of $[-S, \dots, -1, 1, \dots, S]$ , where $S$ denotes the maximum offset value.
54
+ - Out-of-Range: refers to the annotation of a non-entity span with an absolute boundary offset value from its nearest entity exceeding the maximum offset value $S$ .
55
+
56
+ The annotation procedure for boundary offsets involves three steps. Initially, a 3-dimensional matrix $\mathcal{O} \in \mathbb{R}^{M \times N \times N}$ is constructed according to the input sentence $X$ , where $M$ denotes the number of entity types and $N$ represents the length of the sentence. Next, we annotate the center spans with the offset label "0" based on the golden entities present in $X$ . Entities of different types are assigned to their respective sub-matrices. Finally, for non-entity spans, we compute the start and end boundary offset values with respect to all center spans. Their annotation is determined by the absolute minimum offset value. If the absolute minimum offset value is less than $S$ , we annotate the corresponding *S or *E; otherwise, we label the span as "Out-of-Range".
57
+
58
+ ![](images/c3d5830016737eb1c91b120afd7c7b2898f072f40fbc8081c3a749cb57e2a4a5.jpg)
59
+ (a) Span Encoder
60
+ Figure 3: An overview architecture of our method, which mainly consists of two components: a Span Encoder and a Boundary Offset Predictor.
61
+
62
+ # 3 Methods
63
+
64
+ Figure 3 provides an overview of our method, which encompasses two primary components: a Span Encoder (Section 3.1) and a Boundary Offset Predictor (Section 3.2). The Span Encoder is responsible for encoding entity types and sentences, utilizing word representations to construct span representations. Subsequently, the entity type and span representations are inputted into the boundary offset predictor, facilitating type-aware offset classification.
65
+
66
+ # 3.1 Span Encoder
67
+
68
+ Drawing inspiration from the prompt-based methods (Qin and Eisner, 2021; Han et al., 2022), we consider entity types as task-oriented inputs, indicating the specific types of entities that the model needs to predict within a given sentence.
69
+
70
+ To achieve this, we create a set of additional type tokens, denoted as $\mathrm{P} = \{p_m\}_{m=1}^M$ , where $p_m$ represents a learnable special token corresponding to entity type $y_m$ . Next, we concatenate the soft tokens $\mathrm{P}$ with the sentence $\mathrm{X}$ to form a single sequence, and employ BERT (Devlin et al., 2019) to encode them simultaneously. The output of BERT is then passed through a BiLSTM (Lample et al., 2016) to generate final embedding features $\mathrm{H} = \{h_1, h_2, \dots, h_{M+N}\} \in \mathbb{R}^{(M+N) \times d}$ , where $d$ is the hidden size. Finally, we split $\mathrm{H}$ to obtain entity type representations $\mathrm{H}^Y \in \mathbb{R}^{M \times d}$ and token representations $\mathrm{H}^X \in \mathbb{R}^{N \times d}$ , respectively.
71
+
72
+ Span Representation Given the token representations $\mathrm{H}^X = \{h_1, h_2, \dots, h_N\}$ , the span representation $v_{ij}$ can be considered as a fusion of the boundary representations $(h_i, h_j)$ . Following Li et al. (2022), we adopt the Conditional Layer Normalization (CLN) (Liu et al., 2021) mechanism to build a high-quality span representation:
73
+
74
+ $$
75
+ \begin{array}{l} v _ {i j} = \operatorname {C L N} \left(h _ {i}, h _ {j}\right) \tag {1} \\ = \gamma_ {j} \otimes \operatorname {N o r m} \left(h _ {i}\right) + \lambda_ {j}, \\ \end{array}
76
+ $$
77
+
78
+ where $\mathrm{Norm}(\cdot)$ is the instance normalization function (Ulyanov et al., 2016), $\gamma_{j}$ and $\lambda_{j}$ are the condition parameters that are obtained by two different feedforward networks: $\gamma_{j} = \mathrm{FFN}(h_{j})$ and $\lambda_{j} = \mathrm{FFN}(h_{j})$ .
79
+
80
+ While valid candidate spans are restricted to the upper triangular region of the adjacent text span matrix, a region embedding $\mathrm{E} = [e_{up}, e_{low}] \in \mathbb{R}^{2 \times d_e}$ are adapted to distinguish the positions of text spans. The final representation of each span is obtained as: $\hat{v}_{ij} = [v_{ij}, e_{up}]$ if $i \leq j$ ; $\hat{v}_{ij} = [v_{ij}, e_{low}]$ if $i > j$ .
81
+
82
+ # 3.2 Boundary Offset Predictor
83
+
84
+ As previously mentioned, we utilize the entity types as inputs to guide the model in generating type-aware boundary offsets, rather than categorizing each text span into a particular entity type.
85
+
86
+ The biaffine classifier (Yu et al., 2020) is employed to fuse entity type representations and span representations. Specifically, given an entity type representation $h_m \in \mathbf{H}^Y$ and span representation
87
+
88
+ $\hat{v}_{ij}\in \widehat{\mathbf{V}}$ , a scoring vector $c_{mij}\in \mathbb{R}^L$ can be computed as:
89
+
90
+ $$
91
+ h _ {y} ^ {\prime} = \operatorname {F F N} \left(h _ {y}\right), \quad \hat {v} _ {i j} ^ {\prime} = \operatorname {F F N} \left(\hat {v} _ {i j}\right), \tag {2}
92
+ $$
93
+
94
+ $$
95
+ c _ {m i j} = \left(h _ {m} ^ {\prime}\right) ^ {T} U \hat {v} _ {i j} ^ {\prime} + W \left(h _ {m} ^ {\prime} \oplus v _ {i j} ^ {\prime}\right) + b, \tag {3}
96
+ $$
97
+
98
+ where $L$ is the number of offset labels $^1$ ; $U \in \mathbb{R}^{L \times d_b \times d_b}$ , $W \in \mathbb{R}^{L \times 2d_b}$ and $b \in \mathbb{R}^L$ are learnable parameters, $d_b$ is the biaffine hidden size.
99
+
100
+ 3D Convolution Layer Furthermore, we utilize multiple 3-dimensional convolution (3DConv) layers to capture the inherent quantitative relationships between the boundary offsets of adjacent text spans. As depicted in Figure 3(b), the 3D convolution kernels traverse the complete score matrix $C$ in three directions, thereby aggregating offset predictions for adjacent text spans across all entity types. The computation in a single convolution layer can be expressed as:
101
+
102
+ $$
103
+ \mathrm {Q} = \sigma (\mathrm {3 D C o n v} (\mathrm {C})), \tag {4}
104
+ $$
105
+
106
+ where $\mathbf{Q} \in \mathbb{R}^{M \times N \times N \times L}$ , $\sigma$ is the GELU activation function (Hendrycks and Gimpel, 2016). We assign different dilation rates to each convolution layer, and then concatenate their outputs followed by a linear to calculate final prediction scores:
107
+
108
+ $$
109
+ \hat {\mathrm {Q}} = \operatorname {L i n e a r} \left(\mathrm {Q} _ {1} \oplus \mathrm {Q} _ {2} \oplus \mathrm {Q} _ {3}\right), \tag {5}
110
+ $$
111
+
112
+ To obtain the probability distribution of span $(i,j)$ over the offset labels, $\hat{q}_{mij} \in \hat{\mathbf{Q}}$ is fed into a softmax layer:
113
+
114
+ $$
115
+ \hat {o} _ {m i j} = \operatorname {s o f t m a x} \left(\hat {q} _ {m i j}\right), \tag {6}
116
+ $$
117
+
118
+ # 3.3 Training and Inference
119
+
120
+ Learning Objective In our method, the learning objective is to accurately assign a boundary offset to each text span, which can be treated as a multiclass classification problem and optimized using cross-entropy loss:
121
+
122
+ $$
123
+ \mathcal {L} = - \frac {1}{M N ^ {2}} \sum_ {m} ^ {M} \sum_ {i} ^ {N} \sum_ {j} ^ {N} o _ {m i j} ^ {T} \log \left(\hat {o} _ {m i j}\right) \tag {7}
124
+ $$
125
+
126
+ where $o_{mij} \in \mathbb{R}^D$ represents the ground-truth, which is an one-hot vector encoded from the annotated adjacent text span matrix $\mathcal{O}$ .
127
+
128
+ Inference with Boundary offsets During the inference process, decoding entities based on predicted boundary offsets is a straightforward procedure. The output of our method is a matrix of size $M \times N \times N$ , where each cell represents a potential entity and contains information about its boundaries and type. For example, a cell with coordinates $(m, i, j)$ and the prediction "-1E" indicates an entity of type $y_{m}$ with a start boundary at $x_{i}$ and an end boundary at $x_{j+1}$ . Conversely, if the predicted value is "out-of-range," it implies that the cell does not correspond to any entity.
129
+
130
+ However, blindly accepting all predicted boundary offsets may result in sub-optimal outcomes as it disregards the quantitative relationship between boundary offsets. Therefore, we introduce two heuristic rules to identify unreasonable predictions: i) Predicted boundary offsets that do not align with their nearest center span. ii) Predicted boundary offsets that do not adhere to a sequential order with neighboring spans.
131
+
132
+ # 4 Experimental Settings
133
+
134
+ # 4.1 Datasets
135
+
136
+ To evaluate our method, we conducted experiments on five English NER datasets, including CoNLL 2003 (Sang and De Meulder, 2003), OntoNotes $5^{2}$ , ACE $2004^{3}$ , ACE $2005^{4}$ and GENIA (Ohta et al., 2002); and three Chinese NER datasets, including MSRA (Levow, 2006), Resume NER (Zhang and Yang, 2018) and Weibo NER (Peng and Dredze, 2015). Note that ACE 2004, ACE 2005 and GENIA are nested NER datasets, others are flat datasets.
137
+
138
+ For OntoNotes 5, we take the same train/dev/test as used in CoNLL 2012 shared task (Pradhan et al., 2012). For ACE 2004 and ACE 2005, we use the same data split as Lu and Roth (2015). For GENIA, we follow Katiyar and Cardie (2018) to split train/test as 9:1. For other datasets, we employ the same settings in previous works (Ma et al., 2020; Yan et al., 2021; Zhu and Li, 2022).
139
+
140
+ # 4.2 Implementation Details
141
+
142
+ We use BioBERT-v1.1 (Lee et al., 2020) as the contextual embedding in GENIA. For other English corpora, we BERT-large-cased (Devlin et al., 2019) as the contextual embedding. For Chinese
143
+
144
+ <table><tr><td rowspan="2">Models</td><td colspan="3">CoNLL 2003</td><td colspan="3">OntoNotes 5</td></tr><tr><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td></tr><tr><td colspan="7">Sequence Labeling Methods</td></tr><tr><td>BiLSTM-CRF (Miwa and Bansal, 2016)</td><td>-</td><td>-</td><td>91.03</td><td>86.04</td><td>86.53</td><td>86.28</td></tr><tr><td>BERT-Tagger (Devlin et al., 2019)</td><td>-</td><td>-</td><td>92.80</td><td>90.01</td><td>88.35</td><td>89.16</td></tr><tr><td colspan="7">Span-based Methods</td></tr><tr><td>Biaffine (Yu et al., 2020)*†</td><td>92.46</td><td>92.67</td><td>92.55</td><td>89.94</td><td>89.81</td><td>89.88</td></tr><tr><td>W2NER (Li et al., 2022)</td><td>92.71</td><td>93.44</td><td>93.07</td><td>90.03</td><td>90.97</td><td>90.50</td></tr><tr><td>Boundary Smooth (Zhu and Li, 2022)*†</td><td>92.89</td><td>93.20</td><td>93.04</td><td>90.42</td><td>90.81</td><td>90.61</td></tr><tr><td>DiffusionNER (Shen et al., 2023a)</td><td>92.99</td><td>92.56</td><td>92.78</td><td>90.31</td><td>91.02</td><td>90.66</td></tr><tr><td colspan="7">Others</td></tr><tr><td>Seq2Seq (Straková et al., 2019)</td><td>-</td><td>-</td><td>92.98</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BartNER (Yan et al., 2021)†</td><td>92.57</td><td>93.53</td><td>93.05</td><td>89.65</td><td>90.87</td><td>90.26</td></tr><tr><td>PIQN (Shen et al., 2022)</td><td>93.29</td><td>92.46</td><td>92.87</td><td>91.43</td><td>90.73</td><td>90.96</td></tr><tr><td>PromptNER (Shen et al., 2023b)</td><td>92.48</td><td>92.33</td><td>92.41</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BOPN (Ours)</td><td>93.22</td><td>93.15</td><td>93.19</td><td>90.93</td><td>91.40</td><td>91.16</td></tr></table>
145
+
146
+ Table 1: Results on English flat NER datasets CoNLL 2003 and OntoNotes 5. † means our re-implementation via their code. * denotes a fair comparison that their BERT encoder is consistent with our model.
147
+
148
+ <table><tr><td rowspan="2">Models</td><td colspan="3">MSRA</td><td colspan="3">Resume NER</td><td colspan="3">Weibo NER</td></tr><tr><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td></tr><tr><td colspan="10">Sequence Labeling Methods</td></tr><tr><td>Lattice (Zhang and Yang, 2018)</td><td>93.57</td><td>92.79</td><td>93.18</td><td>94.81</td><td>94.11</td><td>94.46</td><td>53.04</td><td>62.25</td><td>58.79</td></tr><tr><td>Flat (Li et al., 2020)</td><td>-</td><td>-</td><td>96.09</td><td>-</td><td>-</td><td>95.86</td><td>-</td><td>-</td><td>68.55</td></tr><tr><td>SoftLexicon (Ma et al., 2020)</td><td>95.75</td><td>95.10</td><td>95.42</td><td>96.08</td><td>96.13</td><td>96.11</td><td>70.94</td><td>67.02</td><td>70.50</td></tr><tr><td>MECT (Wu et al., 2021)</td><td>-</td><td>-</td><td>96.24</td><td>-</td><td>-</td><td>95.98</td><td>-</td><td>-</td><td>70.43</td></tr><tr><td colspan="10">Span-based Methods</td></tr><tr><td>W2NER (Li et al., 2022)</td><td>96.12</td><td>96.08</td><td>96.10</td><td>96.96</td><td>96.35</td><td>96.65</td><td>70.84</td><td>73.87</td><td>72.32</td></tr><tr><td>Boundary Smooth (Zhu and Li, 2022)</td><td>96.37</td><td>96.15</td><td>96.26</td><td>96.63</td><td>96.69</td><td>96.66</td><td>70.16</td><td>75.36</td><td>72.66</td></tr><tr><td>DiffusionNER (Shen et al., 2023a)</td><td>95.71</td><td>94.11</td><td>94.91</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BOPN (Ours)</td><td>96.44</td><td>96.34</td><td>96.39</td><td>96.73</td><td>96.83</td><td>96.78</td><td>71.79</td><td>73.90</td><td>72.92</td></tr></table>
149
+
150
+ Table 2: Results on Chinese flat NER datasets MSRA, Resume and Weibo.
151
+
152
+ corpora, we use the BERT pre-trained with whole word masking (Cui et al., 2021).
153
+
154
+ The BiLSTM has one layer and 256 hidden size with dropout rate of 0.5. The size of region embedding $d_{e}$ is 20. The maximum offset value $S$ is selected in $\{1,2,3\}$ . For all datasets, we train our models by using AdamW Optimizer (Loshchilov and Hutter, 2017) with a linear warmup-decay learning rate schedule. See Appendix A for more details. Our source code can be obtained from https://github.com/mhtang1995/BOPN.
155
+
156
+ # 4.3 Evaluation
157
+
158
+ We use strict evaluation metrics where a predicted entity is considered correct only when both the boundaries (after adding boundary offset) and type are accurately matched. The precision, recall and $F_{1}$ scores are employed. We run our model for five times and report averaged values.
159
+
160
+ # 5 Results and Analysis
161
+
162
+ # 5.1 Main Results
163
+
164
+ The performance of our proposed method and the baselines on English flat NER datasets is presented in Table 1. The experimental results demonstrate that our approach surpasses the previous state-of-the-art (SOTA) methods by $+0.12\%$ on the CoNLL 2003 dataset and $+0.20\%$ on the OntoNotes 5 dataset, achieving superior performance with $F_{1}$ scores of $93.19\%$ and $91.16\%$ , respectively. For Chinese flat NER datasets, we provide the results in Table 2. Similarly, our proposed method achieves SOTA performance in terms of $F_{1}$ scores, surpassing the previous best method by $+0.13\%$ , $+0.12\%$ , and $+0.26\%$ in $F_{1}$ scores on the MSRA, Resume NER, and Weibo NER datasets, respectively.
165
+
166
+ The performance results on English nested NER datasets are presented in Table 3. Remarkably,
167
+
168
+ <table><tr><td rowspan="2">Models</td><td colspan="3">ACE 2004</td><td colspan="3">ACE 2005</td><td colspan="3">GENIA</td></tr><tr><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td><td>P</td><td>R</td><td>F1</td></tr><tr><td colspan="10">Sequence Labeling Methods</td></tr><tr><td>Layered (Ju et al., 2018)</td><td>-</td><td>-</td><td>-</td><td>74.2</td><td>70.3</td><td>72.2</td><td>78.5</td><td>71.3</td><td>74.7</td></tr><tr><td>Pyramid (Wang et al., 2020)</td><td>86.08</td><td>86.48</td><td>86.28</td><td>83.95</td><td>85.39</td><td>84.66</td><td>79.45</td><td>78.94</td><td>79.19</td></tr><tr><td colspan="10">Span-based Methods</td></tr><tr><td>Biaffine (Yu et al., 2020)</td><td>87.3</td><td>86.0</td><td>86.7</td><td>85.2</td><td>85.6</td><td>85.4</td><td>78.2</td><td>78.2</td><td>78.2</td></tr><tr><td>Locate and Label (Shen et al., 2021)</td><td>87.44</td><td>87.38</td><td>87.41</td><td>86.09</td><td>87.27</td><td>86.67</td><td>80.19</td><td>80.89</td><td>80.54</td></tr><tr><td>W2NER (Li et al., 2022)</td><td>87.33</td><td>87.71</td><td>87.52</td><td>85.03</td><td>88.62</td><td>86.79</td><td>83.10</td><td>79.76</td><td>81.39</td></tr><tr><td>Triaffine (Yuan et al., 2022)</td><td>87.13</td><td>87.68</td><td>87.60</td><td>86.70</td><td>86.94</td><td>86.82</td><td>80.42</td><td>82.06</td><td>81.23</td></tr><tr><td>Boundary Smooth (Zhu and Li, 2022)</td><td>88.43</td><td>87.53</td><td>87.98</td><td>86.25</td><td>88.07</td><td>87.15</td><td>-</td><td>-</td><td>-</td></tr><tr><td>DiffusionNER (Shen et al., 2023a)</td><td>88.11</td><td>88.66</td><td>88.39</td><td>86.15</td><td>87.72</td><td>86.93</td><td>82.10</td><td>80.97</td><td>81.53</td></tr><tr><td colspan="10">Others</td></tr><tr><td>Seq2Seq (Straková et al., 2019)</td><td>-</td><td>-</td><td>84.33</td><td>-</td><td>-</td><td>83.42</td><td>-</td><td>-</td><td>78.20</td></tr><tr><td>BartNER (Yan et al., 2021)</td><td>87.27</td><td>86.41</td><td>86.84</td><td>83.16</td><td>86.38</td><td>84.74</td><td>78.57</td><td>79.30</td><td>78.93</td></tr><tr><td>PIQN (Shen et al., 2022)</td><td>88.48</td><td>87.81</td><td>88.14</td><td>86.27</td><td>88.60</td><td>87.42</td><td>83.24</td><td>80.35</td><td>81.77</td></tr><tr><td>PromptNER (Shen et al., 2023b)</td><td>87.58</td><td>88.76</td><td>88.16</td><td>86.07</td><td>88.38</td><td>87.21</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BOPN (Ours)</td><td>89.13</td><td>89.40</td><td>89.26</td><td>89.56</td><td>91.23</td><td>90.39</td><td>82.14</td><td>82.16</td><td>82.14</td></tr></table>
169
+
170
+ Table 3: Results on English nested NER datasets ACE 2004, ACE 2004 and GENIA.
171
+
172
+ <table><tr><td></td><td>CoNLL 2003</td><td>Resume NER</td><td>ACE 2004</td></tr><tr><td>BOPN (Ours)</td><td>93.19</td><td>96.78</td><td>89.26</td></tr><tr><td>- w/o Type Inp.</td><td>92.87</td><td>96.41</td><td>88.83</td></tr><tr><td>- w/o Region Emb.</td><td>92.71</td><td>96.22</td><td>88.71</td></tr><tr><td>- w/o BO</td><td>92.74</td><td>96.26</td><td>88.62</td></tr><tr><td>- w/o 3DConv</td><td>92.87</td><td>96.40</td><td>89.11</td></tr><tr><td>- MBO (S=1)</td><td>93.11</td><td>96.75</td><td>89.14</td></tr><tr><td>- MBO (S=2)</td><td>93.15</td><td>96.78</td><td>89.26</td></tr><tr><td>- MBO (S=3)</td><td>93.19</td><td>96.71</td><td>89.22</td></tr><tr><td>- 3DConv (l=1)</td><td>93.08</td><td>96.69</td><td>89.18</td></tr><tr><td>- 3DConv (l=2)</td><td>93.19</td><td>96.75</td><td>89.26</td></tr><tr><td>- 3DConv (l=3)</td><td>93.05</td><td>96.78</td><td>89.25</td></tr></table>
173
+
174
+ Table 4: Ablation Studies. MBO means the maximum boundary offset value.
175
+
176
+ our proposed BOPN achieves substantial improvements in performance on these datasets, with $F_{1}$ scores increasing by $+0.87\%$ , $+2.97\%$ , and $+0.37\%$ on ACE 2004, ACE 2005, and GENIA, respectively. These results align with our expectations, as the boundary features of nested entities are more intricate compared to flat entities. We attribute this improvement to two key factors: 1) Our method predicts the boundary information of various entity types in parallel, effectively avoiding nested boundary conflicts between different types of entities. 2) By predicting boundary offsets, our method expands the predictive range for each text span, allowing for more granular and precise identification of entity boundaries.
177
+
178
+ # 5.2 Ablation Studies
179
+
180
+ In order to assess the impact of each component in our method, we conduct ablation studies on the CoNLL 2003, ACE 2005, and Resume NER datasets. The results of these studies are presented in Table 4.
181
+
182
+ Maximum Boundary Offset We investigate the impact of training the model with different maximum offset values $S$ through our ablation studies. The hyperparameter $S$ determines the annotation scope of non-entity spans with boundary offset. Specifically, the extreme scenario of setting $S$ to 0 corresponds to a condition "w/o BO" (without Boundary Offset). The results indicate a significant decline in performance when employing "w/o BO," confirming the usefulness of utilizing boundary offsets as supervision. However, we also observe that the optimal $S$ value varies across different datasets. This could be attributed to the fact that a larger $S$ value provides more boundary knowledge but also increases the label search space. Consequently, hyperparameter tuning for $S$ becomes necessary to achieve the best performance in practice.
183
+
184
+ In addition, we analyze the learning curves of our model with different maximum offset values. Figure 4 demonstrates that a larger $S$ can accelerate the training process of the model. We think the reason may be that a larger $S$ not only leads to an increase of positive samples but also results in a decrease of negative samples, thereby ultimately enhancing the trainability of the model.
185
+
186
+ ![](images/80743a7388518887de4cddd798286acf3542bc8074bcaf3df54dbf23b325835e.jpg)
187
+ Figure 4: The learning curves on ACE 2004 dataset.
188
+
189
+ <table><tr><td>Label</td><td>P</td><td>R</td><td>F1</td><td>Support</td></tr><tr><td>-2S</td><td>81.51</td><td>82.02</td><td>81.76</td><td>5029</td></tr><tr><td>-1S</td><td>81.62</td><td>82.97</td><td>82.29</td><td>5292</td></tr><tr><td>1S</td><td>79.55</td><td>81.47</td><td>80.50</td><td>3281</td></tr><tr><td>2S</td><td>76.27</td><td>79.55</td><td>77.88</td><td>1438</td></tr><tr><td>-2E</td><td>78.64</td><td>77.19</td><td>77.90</td><td>1464</td></tr><tr><td>-1E</td><td>79.79</td><td>80.58</td><td>80.18</td><td>3254</td></tr><tr><td>1E</td><td>82.26</td><td>82.20</td><td>82.23</td><td>5393</td></tr><tr><td>2E</td><td>82.37</td><td>80.75</td><td>81.57</td><td>5113</td></tr><tr><td>0</td><td>81.92</td><td>81.95</td><td>81.93</td><td>5495</td></tr><tr><td>ALL</td><td>79.21</td><td>84.22</td><td>81.64</td><td>5495</td></tr><tr><td>- w/ rules</td><td>81.85</td><td>82.56</td><td>82.20</td><td>5495</td></tr></table>
190
+
191
+ Table 5: Performance of each boundary offset label on GENIA, where the maximum offset value is 2. The reported results is one out of five experiments.
192
+
193
+ 3D Convolution Layer "w/o 3DConv" indicates the 3D convolution layers are removed. As seen, the results show a decline in performance across all datasets, indicating the importance of 3D convolution layers in capturing the interactions between boundary offsets of adjacent text spans.
194
+
195
+ Type Inputs "w/o Type Inputs" refers to a setting where the entity types encoded with the sentence are replaced, in which the randomly initialized entity type embeddings are fed into the biaffine classifier. The results obtained in this setting show a slight decline in performance.
196
+
197
+ Region Embedding The results demonstrate a slight drop in performance across all datasets without region embeddings. This suggests that integrating sample distribution features can be a reasonable approach for enhancing text span representations.
198
+
199
+ As the CLN layer and biaffine classifier serve as fundamental components in our approach for span
200
+
201
+ ![](images/8053ec891e88602ef839556b5f26ee561c5811df50fa4443201d11aa38f9185d.jpg)
202
+ Figure 5: A comparison of F1-scores on entities of different lengths in GENIA dataset. Entity supports are in the parentheses.
203
+
204
+ representation and classification, they cannot be evaluated independently. Nonetheless, our ablation studies demonstrate the effectiveness of learning boundary offset information and the usefulness of each composition in our model.
205
+
206
+ # 5.3 Detailed Analysis
207
+
208
+ Performance on Different Offset Labels We investigate the performance of each boundary offset label, and the results are presented in Table 5. Notably, the offset label "0" has complete entity support and achieves an $F_{1}$ score of $82.04\%$ . Furthermore, we observed a positive correlation between the quantity of entity support and the performance of boundary offset labels.
209
+
210
+ When a text span is not predicted as "out-of-range", its assigned label can be utilized to determine the position of its nearest entity. By aggregating all predictions of offset labels, we observe a sharp decrease in precision score, along with a significant increase in recall score, when compared to only considering the center span (with an offset label of "0"). This finding suggests that different offset labels provide distinct information that assists the model in recognizing additional entities. Nevertheless, this approach can introduce noisy predictions due to the model's inadequate performance on certain labels. Despite this limitation, it may have practical applicability in recall-sensitive applications.
211
+
212
+ As discussed in Section 3.3, we devise two heuristic rules to remove improbable predictions. Our findings reveal that this approach enhances the precision score, with only a minor reduction in the recall score, leading to an overall improvement in the $F_{1}$ score.
213
+
214
+ ![](images/7ecb4838dceef94fe33a44e5fd507039fdc00eaa747ec70b3febb19d1bbb31c2.jpg)
215
+ Figure 6: Effect of varying percentage of training samples on GENIA. We train all models for 50 epochs and report their best performance.
216
+
217
+ Performance on Entities with Varying Lengths We explore the model performance on entities of different lengths in GENIA. As shown in Figure 5, we compare the $F_{1}$ scores of models which are training with different $S$ . The model achieves higher $F_{1}$ scores across all columns when $S = 2$ , with a more pronounced performance improvement for longer entities. The results highlight the usefulness of learning boundary offsets between nonentity and entity spans, which helps the model learn boundary features more effectively.
218
+
219
+ Size of Training Data As the boundary offset labels contain more informative knowledge, we hypothesize that our proposed BOPN would perform better with limited training data. As shown in Figure 6, our model achieves impressive results, exhibiting only a $5.46\%$ decrease in performance when trained with a mere $12.5\%$ of the available training data. In contrast, when boundary information is not utilized during training, the model's performance declines rapidly as the amount of training data decreases, thus creating significant obstacles to effective training.
220
+
221
+ # 6 Related Work
222
+
223
+ In recent years, various paradigms for named entity recognition (NER) have been proposed, among which span-based methods have become one of the most mainstream approaches, treating NER as a text span classification problem. With the development of pre-trained language models, some works (Sohrab and Miwa, 2018; Luan et al., 2019; Wadden et al., 2019) obtain span representations by connecting boundary representations or aggregating token representations and feeding them into
224
+
225
+ a linear classifier for type prediction. Alternatively, Yu et al. (2020) utilizes a biaffine classifier to fuse start and end boundary representations directly for span classification. To further enhance span representation, several other methods (Wan et al., 2022; Yuan et al., 2022) propose fusing representations of token, boundary, and related entity spans.
226
+
227
+ Meanwhile, some methods try to improve span-based methods by adding boundary supervision. Specifically, Zheng et al. (2019) and Tan et al. (2020) additionally detect entity boundaries with multi-task learning, while Shen et al. (2021) perform boundary regression after span prediction. Li et al. (2022) design two word-word relations for span classification. Compared with previous methods, our proposed method utilizes continuous boundary offset values to model text spans, which can capture both the boundary differences and connections between non-entity and entity spans.
228
+
229
+ In addition to span-based methods, there are three widely-used NER methods. The traditional sequence labeling methods (Huang et al., 2015; Lample et al., 2016) assign each token a tag with a pre-designed tagging scheme (e.g., $BIO$ ). To address nested entities, some works (Ju et al., 2018; Wang et al., 2020; Rojas et al., 2022) add struggles or design special tagging schemes. Hypergraph-based methods (Lu and Roth, 2015; Katiyar and Cardie, 2018; Wang and Lu, 2018) represent the input sentence as a hypergraph for detecting nested entities, which must be carefully designed to avoid spurious structures. Sequence-to-sequence methods reformulate NER as a sequence generation problem. For example, Gillick et al. (2016) first apply the Seq2Seq model for NER, inputting the sentence and outputting start positions, entity lengths, and types. Straková et al. (2019) use the Seq2Seq model and enhanced BILOU scheme to address nested NER. Yan et al. (2021) treats NER as an entity span sequence generation problem with pointer network based on BART (Lewis et al., 2019).
230
+
231
+ # 7 Conclusion
232
+
233
+ In this paper, we introduce a novel approach for named entity recognition (NER) called the Boundary Offset Prediction Network (BOPN). BOPN predicts the boundary offsets between candidate spans and their nearest entities, leveraging entity types as inputs. By incorporating entity types, BOPN enables parallel prediction of type-aware boundary offsets, enhancing the model's ability to capture
234
+
235
+ fine-grained entity boundaries. To capture the interactions between boundary offsets, we employ multiple 3D convolution layers, which refine the offset predictions and capture the inherent quantitative relationships between adjacent text spans.
236
+
237
+ The experimental results demonstrate that our proposed method achieves state-of-the-art performance on eight widely-used datasets, including five English NER datasets and three Chinese NER datasets. Moreover, further analysis reveals a significant improvement in recall scores by utilizing boundary offset as supervision, showcasing the utility of our approach for recall-sensitive applications in NER.
238
+
239
+ # Limitations
240
+
241
+ The proposed BOPN approach has certain limitations that should be acknowledged. Firstly, while BOPN treats boundary offsets as classification targets, it does not explicitly model the order relationship between offset values. Although the 3D convolution layers are employed to implicitly capture interactions between boundary offsets, they do not provide a strong constraint on the ordering of offset labels.
242
+
243
+ Additionally, the method uses boundary offsets to convert some non-entity spans into positive samples, which leads to higher recall scores but potentially lower precision scores. To optimize prediction results, heuristic rules are applied to filter out unreasonable samples. However, these rules are based on observations and may not be comprehensive enough to handle all cases effectively.
244
+
245
+ Therefore, there is still a need to explore more effective ways to integrate and optimize the offset predictions in order to address these limitations and enhance the overall performance of the BOPN approach.
246
+
247
+ # Ethics Statement
248
+
249
+ To address ethical concerns, we provide the two detailed description: 1) All experiments were conducted on existing datasets derived from public scientific papers. 2) Our work does not contain any personally identifiable information and does not harm anyone.
250
+
251
+ # Acknowledgements
252
+
253
+ This work was supported by Strategic Priority Research Program of Chinese Academy of Sciences (N0. XDC02040400).
254
+
255
+ # References
256
+
257
+ Pei Chen, Haibo Ding, Jun Araki, and Ruihong Huang. 2021. Explicitly capturing relations between entity mentions via graph neural networks for domain-specific named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 735-742.
258
+ Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, and Ziqing Yang. 2021. Pre-training with whole word masking for chinese bert. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 29:3504-3514.
259
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186.
260
+ Dan Gillick, Cliff Brunk, Oriol Vinyals, and Amarnag Subramanya. 2016. Multilingual language processing from bytes. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1296-1306.
261
+ Xu Han, Weilin Zhao, Ning Ding, Zhiyuan Liu, and Maosong Sun. 2022.Ptr: Prompt tuning with rules for text classification. AI Open, 3:182-192.
262
+ Dan Hendrycks and Kevin Gimpel. 2016. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415.
263
+ Feng Hou, Ruili Wang, Jun He, and Yi Zhou. 2020. Improving entity linking through semantic reinforced entity embeddings. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6843-6848.
264
+ Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991.
265
+ Justin M Johnson and Taghi M Khoshgoftaar. 2019. Survey on deep learning with class imbalance. Journal of Big Data, 6(1):1-54.
266
+ Meizhi Ju, Makoto Miwa, and Sophia Ananiadou. 2018. A neural layered model for nested named entity recognition. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1446-1459.
267
+ Arzoo Katiyar and Claire Cardie. 2018. Nested named entity recognition revisited. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, volume 1.
268
+
269
+ Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 260-270.
270
+ Phong Le and Ivan Titov. 2018. Improving entity linking by modeling latent relations between mentions. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1595-1604.
271
+ Jinhyuk Lee, Wonjin Yoon, Sungdong Kim, Donghyeon Kim, Sunkyu Kim, Chan Ho So, and Jaewoo Kang. 2020. Biobert: a pre-trained biomedical language representation model for biomedical text mining. Bioinformatics, 36(4):1234-1240.
272
+ Gina-Anne Levow. 2006. The third international Chinese language processing bakeoff: Word segmentation and named entity recognition. In Proceedings of the Fifth SIGHAN workshop on Chinese language processing, pages 108-117.
273
+ Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. 2019. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461.
274
+ Fei Li, ZhiChao Lin, Meishan Zhang, and Donghong Ji. 2021a. A span-based model for joint overlapped and discontinuous named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 4814-4828, Online. Association for Computational Linguistics.
275
+ Jingye Li, Hao Fei, Jiang Liu, Shengqiong Wu, Meishan Zhang, Chong Teng, Donghong Ji, and Fei Li. 2022. Unified named entity recognition as word-word relation classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 10965-10973.
276
+ Jingye Li, Kang Xu, Fei Li, Hao Fei, Yafeng Ren, and Donghong Ji. 2021b. Mrn: A locally and globally mention-based reasoning network for document-level relation extraction. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 1359-1370.
277
+ Xiaonan Li, Hang Yan, Xipeng Qiu, and Xuan-Jing Huang. 2020. Flat: Chinese ner using flat-lattice transformer. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6836-6842.
278
+ Ruibo Liu, Jason Wei, Chenyan Jia, and Soroush Vosoughi. 2021. Modulating language models with
279
+
280
+ emotions. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 4332-4339.
281
+ Ilya Loshchilov and Frank Hutter. 2017. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101.
282
+ Wei Lu and Dan Roth. 2015. Joint mention extraction and classification with mention hypergraphs. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 857-867.
283
+ Yi Luan, Dave Wadden, Luheng He, Amy Shah, Mari Ostendorf, and Hannaneh Hajishirzi. 2019. A general framework for information extraction using dynamic span graphs. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 3036-3046, Minneapolis, Minnesota. Association for Computational Linguistics.
284
+ Ruotian Ma, Minlong Peng, Qi Zhang, Zhongyu Wei, and Xuan-Jing Huang. 2020. Simplify the usage of lexicon in chinese ner. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5951-5960.
285
+ Makoto Miwa and Mohit Bansal. 2016. End-to-end relation extraction using lstms on sequences and tree structures. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1105-1116.
286
+ Tomoko Ohta, Yuka Tateisi, Jin-Dong Kim, Hideki Mima, and Junichi Tsujii. 2002. The genia corpus: An annotated research abstract corpus in molecular biology domain. In Proceedings of the human language technology conference, pages 73-77. CiteSeer.
287
+ Nanyun Peng and Mark Dredze. 2015. Named entity recognition for chinese social media with jointly trained embeddings. In Proceedings of the 2015 conference on empirical methods in natural language processing, pages 548-554.
288
+ Sameer Pradhan, Alessandro Moschitti, Nianwen Xue, Olga Uryupina, and Yuchen Zhang. 2012. Conll-2012 shared task: Modeling multilingual unrestricted coreference in onthonotes. In Joint conference on EMNLP and CoNLL-shared task, pages 1-40.
289
+ Guanghui Qin and Jason Eisner. 2021. Learning how to ask: Querying lms with mixtures of soft prompts. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5203-5212.
290
+ Matías Rojas, Felipe Bravo-Marquez, and Jocelyn Dunstan. 2022. Simple yet powerful: An overlooked architecture for nested named entity recognition. In Proceedings of the 29th International Conference on Computational Linguistics, pages 2108-2117.
291
+
292
+ Erik Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the conll-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pages 142-147.
293
+ Yongliang Shen, Xinyin Ma, Zeqi Tan, Shuai Zhang, Wen Wang, and Weiming Lu. 2021. Locate and label: A two-stage identifier for nested named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 2782-2794.
294
+ Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. 2023a. Diffusion: Boundary diffusion for named entity recognition. arXiv preprint arXiv:2305.13298.
295
+ Yongliang Shen, Zeqi Tan, Shuhui Wu, Wenqi Zhang, Rongsheng Zhang, Yadong Xi, Weiming Lu, and Yueting Zhuang. 2023b. Prompter: Prompt locating and typing for named entity recognition. arXiv preprint arXiv:2305.17104.
296
+ Yongliang Shen, Xiaobin Wang, Zeqi Tan, Guangwei Xu, Pengjun Xie, Fei Huang, Weiming Lu, and Yueting Zhuang. 2022. Parallel instance query network for named entity recognition. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 947-961.
297
+ Mohammad Golam Sohrab and Makoto Miwa. 2018. Deep exhaustive model for nested named entity recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2843-2849.
298
+ Jana Straková, Milan Straka, and Jan Hajic. 2019. Neural architectures for nested ner through linearization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5326-5331.
299
+ Chuanqi Tan, Wei Qiu, Mosha Chen, Rui Wang, and Fei Huang. 2020. Boundary enhanced neural span classification for nested named entity recognition. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pages 9016-9023.
300
+ Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. 2016. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022.
301
+ David Wadden, Ulme Wennberg, Yi Luan, and Hannaneh Hajishirzi. 2019. Entity, relation, and event extraction with contextualized span representations. 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), pages 5784-5789, Hong Kong, China. Association for Computational Linguistics.
302
+
303
+ Juncheng Wan, Dongyu Ru, Weinan Zhang, and Yong Yu. 2022. Nested named entity recognition with span-level graphs. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 892-903, Dublin, Ireland. Association for Computational Linguistics.
304
+ Bailin Wang and Wei Lu. 2018. Neural segmental hypergraphs for overlapping mention recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 204-214.
305
+ Jue Wang, Lidan Shou, Ke Chen, and Gang Chen. 2020. Pyramid: A layered model for nested named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5918-5928.
306
+ Shuang Wu, Xiaoning Song, and Zhenhua Feng. 2021. Mect: Multi-metadata embedding based cross-transformer for chinese named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 1529-1539.
307
+ Hang Yan, Tao Gui, Junqi Dai, Qipeng Guo, Zheng Zhang, and Xipeng Qiu. 2021. A unified generative framework for various ner subtasks. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 5808-5822.
308
+ Juntao Yu, Bernd Bohnet, and Massimo Poesio. 2020. Named entity recognition as dependency parsing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6470-6476.
309
+ Zheng Yuan, Chuanqi Tan, Songfang Huang, and Fei Huang. 2022. Fusing heterogeneous factors with triaffine mechanism for nested named entity recognition. In *Findings of the Association for Computational Linguistics: ACL* 2022, pages 3174-3186.
310
+ Yue Zhang and Jie Yang. 2018. Chinese ner using lattice LSTM. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1554-1564.
311
+ Changmeng Zheng, Yi Cai, Jingyun Xu, Ho-fung Leung, and Guandong Xu. 2019. A boundary-aware neural model for nested named entity recognition. 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), pages 357-366, Hong Kong, China. Association for Computational Linguistics.
312
+ Enwei Zhu and Jinpeng Li. 2022. Boundary smoothing for named entity recognition. In Proceedings of the
313
+
314
+ 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7096-7108.
315
+
316
+ # A Appendix
317
+
318
+ # A.1 Datasets
319
+
320
+ We evaluate our method on eight datasets, including CoNLL 2003, OntoNotes 5, ACE 2004, ACE 2005, and GENIA for English NER datasets; MSRA, Resume NER and Weibo NER for Chinese NER datasets. Table 6 presents the detailed statistics of datasets.
321
+
322
+ # A.2 Implementation Details
323
+
324
+ We use BioBERT-v1.1 (Lee et al., 2020) as the contextual embedding in GENIA. For other English corpora, we BERT-large-cased (Devlin et al., 2019) as the contextual embedding. For Chinese corpora, we use the BERT pre-trained with whole word masking (Cui et al., 2021). Our model is implemented with PyTorch and trained with a NVIDIA RTX3090 GPU. We use a grid search to find the best hyperparameters which are tuned on the development set. The range of hyperparameters we used for eight datasets are listed in Table 7.
325
+
326
+ # A.3Baselines
327
+
328
+ We compare BOPN with the following baselines:
329
+
330
+ - BiLSTM-CRF (Miwa and Bansal, 2016) is a model for sequence labeling tasks that combines BiLSTM with CRF layers.
331
+ - BERT-Tagger (Devlin et al., 2019) that utilizes the pre-trained language model BERT as a feature extractor and incorporates a tag classifier for fine-tuning.
332
+ - Lattice (Zhang and Yang, 2018) proposed a lattice-structured LSTM model for Chinese NER.
333
+ - Layered (Ju et al., 2018) dynamically stacks flat NER layers to solve nested NER task.
334
+ - Flat (Li et al., 2020) proposes a flat-lattice transformer for Chinese NER, which converts the lattice structure into a flat structure consisting of spans.
335
+ - Pyramid (Wang et al., 2020) designs pyramid layer and inverse pyramid layer to decode nested entities.
336
+
337
+ - SoftLexicon (Ma et al., 2020) proposes a Chinese NER method in which lexicon information is introduced by simply adjusting the character representation layer.
338
+ - MECT (Wu et al., 2021) uses multi-metadata embedding in a two-stream transformer to integrate Chinese character features with the radical-level embedding.
339
+ - Biaffine (Yu et al., 2020) classifies text spans by a biaffine classifier between boundary representations.
340
+ - Locate and Label (Shen et al., 2021) proposed a two-stage identifier of locating entities with boundary regression first and classifying them later.
341
+ - W2NER (Li et al., 2022) models NER as word-word relation classification, including the next-neighboring-word and the tail-head-word relations.
342
+ - Triaffine (Yuan et al., 2022) proposed a tri-affine mechanism to fuse information of inside tokens, boundaries, labels for NER.
343
+ - Boundary Smooth (Zhu and Li, 2022) proposed boundary smoothing as a regularization technique for span-based neural NER models.
344
+ - DiffusionNER (Shen et al., 2023a) formulates NER as a boundary-denoising diffusion process, which samples noisy spans from a Gaussian distribution.
345
+ - Seq2Seq (Straková et al., 2019) converts the labels of nested entities into a sequence and then uses a seq2seq model to decode entities.
346
+ - BartNER (Yan et al., 2021) formulates NER as an entity span sequence generation problem based on the pre-training Seq2Seq model BART (Lewis et al., 2019).
347
+ PIQN (Shen et al., 2022) sets up global and learnable instance queries to extract entities from a sentence in a parallel manner.
348
+ - PromptNER (Shen et al., 2023b) unifies entity locating and entity typing in prompt learning for NER, which predicts all entities by filling position slots and type slots.
349
+
350
+ <table><tr><td></td><td>CoNLL 2003</td><td>OntoNotes 5</td><td>ACE 2004</td><td>ACE 2005</td><td>GENIA</td><td>MSRA</td><td>Resume</td><td>Weibo</td></tr><tr><td>Types</td><td>4</td><td>18</td><td>7</td><td>7</td><td>5</td><td>3</td><td>8</td><td>4</td></tr><tr><td>#Train.S</td><td>17291</td><td>59924</td><td>6200</td><td>7194</td><td>16692</td><td>46471</td><td>3819</td><td>1350</td></tr><tr><td>#Dev.S</td><td>-</td><td>8528</td><td>745</td><td>969</td><td>-</td><td>-</td><td>463</td><td>270</td></tr><tr><td>#Test.S</td><td>3453</td><td>8262</td><td>812</td><td>1047</td><td>1854</td><td>4376</td><td>477</td><td>270</td></tr><tr><td>Avg.Len.S</td><td>14.38</td><td>18.11</td><td>22.61</td><td>18.97</td><td>25.41</td><td>45.54</td><td>31.17</td><td>54.57</td></tr><tr><td>#Train.E</td><td>29441</td><td>128738</td><td>22204</td><td>9389</td><td>50509</td><td>74703</td><td>13438</td><td>1855</td></tr><tr><td>#Dev.E</td><td>-</td><td>20354</td><td>2514</td><td>1112</td><td>-</td><td>-</td><td>1497</td><td>379</td></tr><tr><td>#Test.E</td><td>5648</td><td>12586</td><td>3035</td><td>1118</td><td>5506</td><td>6181</td><td>1630</td><td>409</td></tr><tr><td>Avg.Len.E</td><td>1.45</td><td>1.83</td><td>2.50</td><td>2.28</td><td>1.97</td><td>3.24</td><td>5.88</td><td>2.60</td></tr></table>
351
+
352
+ Table 6: Dataset Statistics. "#" denotes the amount. "S." and "E." denote sentence and entity mentions, respectively.
353
+
354
+ <table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Epoch</td><td>[50, 80]</td></tr><tr><td>Batch size</td><td>[8, 16]</td></tr><tr><td>Learning rate (BERT)</td><td>[5e-6, 3e-5]</td></tr><tr><td>Learning rate (Other)</td><td>1e-3</td></tr><tr><td>LSTM hidden size d</td><td>256</td></tr><tr><td>LSTM dropout</td><td>0.5</td></tr><tr><td>Region embedding size de</td><td>20</td></tr><tr><td>Biaffine hidden size db</td><td>150</td></tr><tr><td>Biaffine dropout</td><td>0.2</td></tr><tr><td>Maximum offset value S</td><td>[1, 3]</td></tr><tr><td>Adam epsilon</td><td>1e-8</td></tr><tr><td>Warm factor</td><td>0.1</td></tr></table>
355
+
356
+ Table 7: Hyper-parameter settings.
2023/A Boundary Offset Prediction Network for Named Entity Recognition/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f88265836a3cad064790b75cd75c5b24415ec1dd2a86f8f3b4c25058afd6aec0
3
+ size 740495
2023/A Boundary Offset Prediction Network for Named Entity Recognition/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Causal View of Entity Bias in (Large) Language Models/729caa97-c496-4007-b8f4-5ff70bb6b7ae_content_list.json ADDED
@@ -0,0 +1,1906 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "A Causal View of Entity Bias in (Large) Language Models",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 196,
8
+ 90,
9
+ 800,
10
+ 111
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Fei Wang† Wenjie Mo† Yiwei Wang‡ Wenxuan Zhou† Muhao Chen†#",
17
+ "bbox": [
18
+ 186,
19
+ 129,
20
+ 818,
21
+ 147
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "†University of Southern California; ‡University of California, Los Angeles;",
28
+ "bbox": [
29
+ 198,
30
+ 148,
31
+ 803,
32
+ 164
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "$^{\\#}$ University of California, Davis",
39
+ "bbox": [
40
+ 371,
41
+ 165,
42
+ 630,
43
+ 180
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "{fwang598, jackymo, zhouwenx}@usc.edu; wangyw.evan@gmail.com;",
50
+ "bbox": [
51
+ 203,
52
+ 181,
53
+ 796,
54
+ 198
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "muhchen@ucdavis.edu",
61
+ "bbox": [
62
+ 403,
63
+ 199,
64
+ 598,
65
+ 212
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "Abstract",
72
+ "text_level": 1,
73
+ "bbox": [
74
+ 260,
75
+ 252,
76
+ 339,
77
+ 266
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "Entity bias widely affects pretrained (large) language models, causing them to rely on (biased) parametric knowledge to make unfaithful predictions. Although causality-inspired methods have shown great potential to mitigate entity bias, it is hard to precisely estimate the parameters of underlying causal models in practice. The rise of black-box LLMs also makes the situation even worse, because of their inaccessible parameters and uncalibrated logits. To address these problems, we propose a specific structured causal model (SCM) whose parameters are comparatively easier to estimate. Building upon this SCM, we propose causal intervention techniques to mitigate entity bias for both white-box and black-box settings. The proposed causal intervention perturbs the original entity with neighboring entities. This intervention reduces specific biasing information pertaining to the original entity while still preserving sufficient semantic information from similar entities. Under the white-box setting, our training-time intervention improves OOD performance of PLMs on relation extraction (RE) and machine reading comprehension (MRC) by 5.7 points and by 9.1 points, respectively. Under the black-box setting, our in-context intervention effectively reduces the entity-based knowledge conflicts of GPT-3.5, achieving up to 20.5 points of improvement of exact match accuracy on MRC and up to 17.6 points of reduction in memorization ratio on RE.<sup>1</sup>",
84
+ "bbox": [
85
+ 141,
86
+ 279,
87
+ 460,
88
+ 734
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "1 Introduction",
95
+ "text_level": 1,
96
+ "bbox": [
97
+ 114,
98
+ 746,
99
+ 258,
100
+ 762
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Entity bias (Longpre et al., 2021; Wang et al., 2022; Xu et al., 2022; Peng et al., 2020; Qian et al., 2021b; Hermann et al., 2015) refers to an undesirable phenomenon where models overly rely on prediction shortcuts triggered by specific entities to make spurious predictions. For example, given the sentence \"Bill Gates went to Microsoft Building 99,\" models",
107
+ "bbox": [
108
+ 110,
109
+ 771,
110
+ 487,
111
+ 883
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Context: Bill Gates went to Microsoft Building 99.",
118
+ "bbox": [
119
+ 522,
120
+ 263,
121
+ 806,
122
+ 275
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "Question: What's the relation between Bill Gates and",
129
+ "bbox": [
130
+ 524,
131
+ 277,
132
+ 823,
133
+ 287
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "Microsoft in the given context?",
140
+ "bbox": [
141
+ 526,
142
+ 288,
143
+ 702,
144
+ 300
145
+ ],
146
+ "page_idx": 0
147
+ },
148
+ {
149
+ "type": "text",
150
+ "text": "Option: founder, visitor.",
151
+ "bbox": [
152
+ 526,
153
+ 300,
154
+ 658,
155
+ 312
156
+ ],
157
+ "page_idx": 0
158
+ },
159
+ {
160
+ "type": "text",
161
+ "text": "Answer with one word: founder (GPT-3.5) X",
162
+ "bbox": [
163
+ 526,
164
+ 313,
165
+ 781,
166
+ 326
167
+ ],
168
+ "page_idx": 0
169
+ },
170
+ {
171
+ "type": "text",
172
+ "text": "Assume subject_entity can be any of Bill Gates, Jeff Bezos, and Steve Jobs, while object-entity can be any of Google, Microsoft, and Meta.",
173
+ "bbox": [
174
+ 524,
175
+ 348,
176
+ 857,
177
+ 385
178
+ ],
179
+ "page_idx": 0
180
+ },
181
+ {
182
+ "type": "text",
183
+ "text": "Context: subject entity went to object entity Building 99.",
184
+ "bbox": [
185
+ 527,
186
+ 387,
187
+ 850,
188
+ 398
189
+ ],
190
+ "page_idx": 0
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "Question: What's the relation between subject_entity and object-entity in the given context?",
195
+ "bbox": [
196
+ 527,
197
+ 399,
198
+ 853,
199
+ 423
200
+ ],
201
+ "page_idx": 0
202
+ },
203
+ {
204
+ "type": "text",
205
+ "text": "Option: founder, visitor.",
206
+ "bbox": [
207
+ 527,
208
+ 424,
209
+ 660,
210
+ 435
211
+ ],
212
+ "page_idx": 0
213
+ },
214
+ {
215
+ "type": "text",
216
+ "text": "Answer with one word: visitor (GPT-3.5)",
217
+ "bbox": [
218
+ 527,
219
+ 437,
220
+ 774,
221
+ 449
222
+ ],
223
+ "page_idx": 0
224
+ },
225
+ {
226
+ "type": "text",
227
+ "text": "Figure 1: An example of entity bias in GPT-3.5. Our in-context intervention mitigates the conflicts between parametric knowledge and contextual knowledge.",
228
+ "bbox": [
229
+ 507,
230
+ 468,
231
+ 882,
232
+ 512
233
+ ],
234
+ "page_idx": 0
235
+ },
236
+ {
237
+ "type": "text",
238
+ "text": "may be misled by their memory of the entities Bill Gates and Microsoft, saying the relation between them in this context is founder rather than visitor, as shown in Fig. 1. Recent studies show that entity bias widely affects pretrained (large) language models (LLMs; Longpre et al. 2021; Yan et al. 2022; Zhou et al. 2023). These models have a tendency to disregard contextual information that contradicts or is infrequently reported in the pretrained corpus, while excessively relying on (biased) parametric knowledge (Longpre et al., 2021) to make unfaithful predictions and perpetuate bias.",
239
+ "bbox": [
240
+ 507,
241
+ 541,
242
+ 884,
243
+ 734
244
+ ],
245
+ "page_idx": 0
246
+ },
247
+ {
248
+ "type": "text",
249
+ "text": "Prior studies have proposed multiple causality-inspired methods to mitigate entity bias (Zhang et al., 2017; Nan et al., 2021; Wang et al., 2022; Zhu et al., 2022). Despite their potential, the causal models underlying these methods are flawed in practice, primarily because of imprecise parameter estimation. For example, some causal models necessitate estimating the probability distribution",
250
+ "bbox": [
251
+ 507,
252
+ 736,
253
+ 882,
254
+ 865
255
+ ],
256
+ "page_idx": 0
257
+ },
258
+ {
259
+ "type": "page_footnote",
260
+ "text": "1Our code is available at https://github.com/ luka-group/Causal-View-of-Entity-Bias",
261
+ "bbox": [
262
+ 112,
263
+ 891,
264
+ 487,
265
+ 917
266
+ ],
267
+ "page_idx": 0
268
+ },
269
+ {
270
+ "type": "page_footnote",
271
+ "text": "2Although Zhang et al. (2017) do not mention causal theory, the proposed entity masking does follow a relevant principle to cut off causal links between specific entities and labels.",
272
+ "bbox": [
273
+ 507,
274
+ 879,
275
+ 882,
276
+ 917
277
+ ],
278
+ "page_idx": 0
279
+ },
280
+ {
281
+ "type": "page_number",
282
+ "text": "15173",
283
+ "bbox": [
284
+ 475,
285
+ 927,
286
+ 524,
287
+ 940
288
+ ],
289
+ "page_idx": 0
290
+ },
291
+ {
292
+ "type": "footer",
293
+ "text": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 15173-15184",
294
+ "bbox": [
295
+ 208,
296
+ 945,
297
+ 786,
298
+ 958
299
+ ],
300
+ "page_idx": 0
301
+ },
302
+ {
303
+ "type": "footer",
304
+ "text": "December 6-10, 2023 ©2023 Association for Computational Linguistics",
305
+ "bbox": [
306
+ 277,
307
+ 959,
308
+ 719,
309
+ 971
310
+ ],
311
+ "page_idx": 0
312
+ },
313
+ {
314
+ "type": "text",
315
+ "text": "over labels when given a sentence that is devoid of entities or contextual information (Zhang et al., 2017; Wang et al., 2022). These methods either lose predictive information about entities, or are prone to erroneous representation without contextualization. The other critical problem is the difficulty of applying these methods to black-box LLMs, of which parameters are inaccessible and logits are uncalibrated.",
316
+ "bbox": [
317
+ 110,
318
+ 84,
319
+ 487,
320
+ 227
321
+ ],
322
+ "page_idx": 1
323
+ },
324
+ {
325
+ "type": "text",
326
+ "text": "To address the aforementioned problems, the first contribution of this paper is a causal analysis of entity bias mitigation methods (§3.1). We examine and compare the structured causal models (SCMs) behind existing methods. We find that, among the theoretically equivalent causal models (Verma and Pearl, 1990), there exists a specific SCM whose parameters are comparatively easier to estimate. As shown in Fig. 2, the proposed SCM only requires to intervene input entities to mitigate the presence of spurious features before passing them to the subsequent neural layers. Moreover, it retains the entity type information<sup>3</sup> at an appropriate level of granularity without requiring explicit entity typing.",
327
+ "bbox": [
328
+ 114,
329
+ 230,
330
+ 489,
331
+ 470
332
+ ],
333
+ "page_idx": 1
334
+ },
335
+ {
336
+ "type": "text",
337
+ "text": "The second contribution of this paper is a training-time causal intervention technique for mitigating entity bias based on the proposed SCM (§3.2). Specifically, we identify entities that are likely to share similar predictive information with the given entity. During training, we perturb embedding of the given entity within a convex hull constructed by embeddings of similar entities. During inference, we represent the entity with the center of the convex hull. Taking advantage of the continuous nature of the embedding space, this intervention does not rely on models specifically trained on natural language to estimate the label distribution of unnatural text, nor does it sacrifice predictive entity or contextual information.",
338
+ "bbox": [
339
+ 110,
340
+ 472,
341
+ 489,
342
+ 712
343
+ ],
344
+ "page_idx": 1
345
+ },
346
+ {
347
+ "type": "text",
348
+ "text": "The third contribution of this paper is to transform the training-time intervention into in-context intervention for black-box LLMs whose parameters are inaccessible, and logits are uncalibrated (§3.3). A significant advantage of the proposed SCM is that the causal intervention is carried out at the input layer, enabling its implementation within an in-context setting. Specifically, we replace entities with placeholders and define each placeholder",
349
+ "bbox": [
350
+ 112,
351
+ 713,
352
+ 489,
353
+ 859
354
+ ],
355
+ "page_idx": 1
356
+ },
357
+ {
358
+ "type": "image",
359
+ "img_path": "images/bf9d06eb92efa725a6034a50a4f065110b9aba5f3115575234f82e257a19ac56.jpg",
360
+ "image_caption": [],
361
+ "image_footnote": [],
362
+ "bbox": [
363
+ 514,
364
+ 82,
365
+ 678,
366
+ 173
367
+ ],
368
+ "page_idx": 1
369
+ },
370
+ {
371
+ "type": "image",
372
+ "img_path": "images/822404bcab44be672f773ca48fbde5c0e883b30f7145a30b4351ca44fa7346de.jpg",
373
+ "image_caption": [],
374
+ "image_footnote": [],
375
+ "bbox": [
376
+ 695,
377
+ 80,
378
+ 863,
379
+ 173
380
+ ],
381
+ "page_idx": 1
382
+ },
383
+ {
384
+ "type": "image",
385
+ "img_path": "images/fa721ff35c2731ef19e22b55cd75093b559fef91bc441146d20f4632827f9845.jpg",
386
+ "image_caption": [
387
+ "Figure 2: Structured causal models revealing entity bias."
388
+ ],
389
+ "image_footnote": [],
390
+ "bbox": [
391
+ 512,
392
+ 174,
393
+ 884,
394
+ 252
395
+ ],
396
+ "page_idx": 1
397
+ },
398
+ {
399
+ "type": "text",
400
+ "text": "by examples - a set of similar entities. For example, we can replace Bill Gates in Fig. 1 with subject_entity and presuppend the prompt, \"Assume that subject-entity can be any of Steve Jobs, Bill Gates, and Jeff Bezos\", to the input. This in-context intervention can be applied to any black-box LLM without additional cost.",
401
+ "bbox": [
402
+ 507,
403
+ 303,
404
+ 884,
405
+ 413
406
+ ],
407
+ "page_idx": 1
408
+ },
409
+ {
410
+ "type": "text",
411
+ "text": "Experiments on relation extraction (RE) and machine reading comprehension (MRC) show that the proposed causal intervention techniques are effective for both white-box and black-box LLMs. Under the white-box setting ( $\\S 4$ ), our training-time intervention significantly improves out-of-distribution performance of RoBERTa (Liu et al., 2019) on RE by 5.7 points and SpanBERT (Joshi et al., 2020) on MRC by 9.1 points, comparing with the vanilla version. Under the black-box setting ( $\\S 5$ ), our in-context intervention effectively reduces the entity-based knowledge conflicts (Long-pre et al., 2021) and improves the task performance of GPT-3.5. Specifically, our method outperforms the best baseline by up to 20.5 points of exact match accuracy on MRC and reduces the memorization ratio by up to 17.6 points on RE. Further analyses reveal the crucial role of the number of neighboring entities $k$ in balancing the predictive information and biasing information from entities, and the necessity of entity placeholder definition for in-context intervention.",
412
+ "bbox": [
413
+ 507,
414
+ 414,
415
+ 884,
416
+ 769
417
+ ],
418
+ "page_idx": 1
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "2 Related Work",
423
+ "text_level": 1,
424
+ "bbox": [
425
+ 509,
426
+ 782,
427
+ 665,
428
+ 797
429
+ ],
430
+ "page_idx": 1
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "Entity Bias in LLMs. LLMs memorize factual knowledge in their parameters during pretraining (Roberts et al., 2020; Jiang et al., 2020) and show promising results in answering factual questions (Petroni et al., 2019; Brown et al., 2020; Wei",
435
+ "bbox": [
436
+ 507,
437
+ 814,
438
+ 884,
439
+ 894
440
+ ],
441
+ "page_idx": 1
442
+ },
443
+ {
444
+ "type": "page_footnote",
445
+ "text": "<sup>3</sup>Entity type information plays a crucial role in entity-driven tasks. For example, without knowing a more specific location type, it is impossible to differentiate between relations born_in_city and born_in_country.",
446
+ "bbox": [
447
+ 112,
448
+ 868,
449
+ 487,
450
+ 917
451
+ ],
452
+ "page_idx": 1
453
+ },
454
+ {
455
+ "type": "page_footnote",
456
+ "text": "4https://platform.openai.com/docs/models/gpt-3-5",
457
+ "bbox": [
458
+ 529,
459
+ 903,
460
+ 836,
461
+ 917
462
+ ],
463
+ "page_idx": 1
464
+ },
465
+ {
466
+ "type": "page_number",
467
+ "text": "15174",
468
+ "bbox": [
469
+ 477,
470
+ 927,
471
+ 524,
472
+ 940
473
+ ],
474
+ "page_idx": 1
475
+ },
476
+ {
477
+ "type": "text",
478
+ "text": "et al., 2022). However, the parametric knowledge may be inaccurate due to the misinformation in the training corpus (Lin et al., 2022) or outdated as the world evolves (Liska et al., 2022; Kasai et al., 2022). In such scenarios, it is critical for LLMs to update their predictions when provided with contextual evidence. However, previous studies (Longpre et al., 2021; Qian et al., 2021b; Yan et al., 2022) observe that language models may take entities as shortcuts, leading to spurious predictions based solely on parametric knowledge. This bias becomes more prominent when the evidence contains infrequent or conflicting knowledge compared to the training corpus.",
479
+ "bbox": [
480
+ 110,
481
+ 84,
482
+ 492,
483
+ 311
484
+ ],
485
+ "page_idx": 2
486
+ },
487
+ {
488
+ "type": "text",
489
+ "text": "To mitigate this bias, previous work (Longpre et al., 2021; Chen et al., 2022; Li et al., 2022; Zhou et al., 2023) introduces the entity substitution technique, which involves constructing counterfactual data by randomly replacing the entities, and updating the language models either by finetuning or in-context learning. Although showing improved results, these techniques are empirical and lack theoretical backgrounds. In this paper, we theoretically analyze the entity bias problem from a causal view. Furthermore, we propose a causal intervention method that surpasses the performance of entity substitution.",
490
+ "bbox": [
491
+ 110,
492
+ 312,
493
+ 490,
494
+ 521
495
+ ],
496
+ "page_idx": 2
497
+ },
498
+ {
499
+ "type": "text",
500
+ "text": "Debiasing with Causal Intervention. LLMs have been revealed with bias problems, for which literature has paid much attention in order to mitigate their adverse effects (Sweeney and Najafian, 2019; Zhang et al., 2020b; Venkit and Wilson, 2021; Lalor et al., 2022). Recent debiasing techniques incorporate the concept of counterfactual inference, and have been applied in various tasks for bias mitigation (Niu and Zhang, 2021; Qian et al., 2021a; Wang et al., 2022). One dominant technique is based on causal mediation analysis (Udomcharoenchaikit et al., 2022), which involves decomposing the total effect into pure direct effect and total indirect effect. In this context, Wang et al. (2022) utilize total direct effect and total effect to debias the relation extraction. Apart from debiasing, causal mediation analysis can be used to analyze biases in LLMs (Vig et al., 2020; Finlayson et al., 2021).",
501
+ "bbox": [
502
+ 110,
503
+ 530,
504
+ 490,
505
+ 819
506
+ ],
507
+ "page_idx": 2
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "In addition to intervening causal mediator, previous studies have also explored confounder analysis (Keith et al., 2020; Qian et al., 2021a; Feder et al., 2022; Weld et al., 2022). A confounder is a variable that influences both the input and the output, causing a spurious correlation between them.",
512
+ "bbox": [
513
+ 110,
514
+ 822,
515
+ 490,
516
+ 920
517
+ ],
518
+ "page_idx": 2
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "Typically, the de-confounder process applies the do-calculus (Pearl, 2012) to compute the prediction assuming that the value of the confounder variable is not the observed one but follows its natural distribution (Zhang et al., 2020a; Tian et al., 2022). Our approach is also based on confounder analysis. While nearly all the aforementioned approaches request a white-box accessibility of the model with at least logits of predictions, this work represents a pilot study of deconfounder method that applies to purely black-box LLMs.",
523
+ "bbox": [
524
+ 507,
525
+ 84,
526
+ 885,
527
+ 262
528
+ ],
529
+ "page_idx": 2
530
+ },
531
+ {
532
+ "type": "text",
533
+ "text": "3 Method",
534
+ "text_level": 1,
535
+ "bbox": [
536
+ 507,
537
+ 275,
538
+ 611,
539
+ 290
540
+ ],
541
+ "page_idx": 2
542
+ },
543
+ {
544
+ "type": "text",
545
+ "text": "In this section, we first analyze methods for mitigating entity bias in a causal view and propose an easy-to-estimate SCM as a theoretical basis (§3.1). Based on the proposed SCM, we design a training-time intervention technique for white-box LLMs (§3.2) and an in-context intervention technique for black-box LLMs (§3.3).",
546
+ "bbox": [
547
+ 507,
548
+ 302,
549
+ 885,
550
+ 414
551
+ ],
552
+ "page_idx": 2
553
+ },
554
+ {
555
+ "type": "text",
556
+ "text": "3.1 Causal Analysis of Entity Bias",
557
+ "text_level": 1,
558
+ "bbox": [
559
+ 507,
560
+ 429,
561
+ 794,
562
+ 444
563
+ ],
564
+ "page_idx": 2
565
+ },
566
+ {
567
+ "type": "text",
568
+ "text": "To compare existing methods in the same context, we analyze the structured causal models (SCMs) behind them. Fig. 2 shows two typical SCMs for entity bias mitigation methods, where $X$ refers to the raw input, $E$ refers to entities, and $Y$ refers to the label. The links $X \\rightarrow Y \\leftarrow E$ show that LLMs rely on both predictive information from the whole input and the biasing information from specific entities to make the prediction. The links $E \\rightarrow X$ and $X \\rightarrow E$ assume that the context is written down with the entity in mind or vice versa. As discussed by Verma and Pearl (1990), we cannot differentiate between these two directions merely based on statistical observations. Indeed, the two SCMs with opposite links between $X$ and $E$ are equivalent according to the Bayes' theorem:",
569
+ "bbox": [
570
+ 507,
571
+ 451,
572
+ 885,
573
+ 708
574
+ ],
575
+ "page_idx": 2
576
+ },
577
+ {
578
+ "type": "equation",
579
+ "text": "\n$$\n\\begin{array}{l} P (X) P (E | X) P (Y | X, E) \\\\ = P (Y, X, E) \\\\ = P (E) P (X \\mid E) P (Y \\mid X, E) \\\\ \\end{array}\n$$\n",
580
+ "text_format": "latex",
581
+ "bbox": [
582
+ 589,
583
+ 724,
584
+ 801,
585
+ 778
586
+ ],
587
+ "page_idx": 2
588
+ },
589
+ {
590
+ "type": "text",
591
+ "text": "As revealed by these SCMs, entity bias exists in LLMs because entities serve as either confounders or mediators. Thus, the bias can be mitigated through causal intervention, such as backdoor adjustment",
592
+ "bbox": [
593
+ 507,
594
+ 795,
595
+ 885,
596
+ 875
597
+ ],
598
+ "page_idx": 2
599
+ },
600
+ {
601
+ "type": "equation",
602
+ "text": "\n$$\nP (Y | d o (X)) = \\sum_ {E} P (Y | X, E) P (E),\n$$\n",
603
+ "text_format": "latex",
604
+ "bbox": [
605
+ 549,
606
+ 889,
607
+ 842,
608
+ 921
609
+ ],
610
+ "page_idx": 2
611
+ },
612
+ {
613
+ "type": "page_number",
614
+ "text": "15175",
615
+ "bbox": [
616
+ 477,
617
+ 927,
618
+ 524,
619
+ 940
620
+ ],
621
+ "page_idx": 2
622
+ },
623
+ {
624
+ "type": "image",
625
+ "img_path": "images/8e8cd6f645fb1ebe10dd5f451789ba5103994691b8b9e54976f1e508ad3d7713.jpg",
626
+ "image_caption": [
627
+ "Figure 3: Left: Training-time intervention with $k = 4$ . Right: Example of predictive and biasing information."
628
+ ],
629
+ "image_footnote": [],
630
+ "bbox": [
631
+ 117,
632
+ 80,
633
+ 527,
634
+ 244
635
+ ],
636
+ "page_idx": 3
637
+ },
638
+ {
639
+ "type": "image",
640
+ "img_path": "images/5559d0c93cb9298a3db4eb6479d03fe4fabaa1a8fd6a0b0f1c71dd44810e15ea.jpg",
641
+ "image_caption": [],
642
+ "image_footnote": [],
643
+ "bbox": [
644
+ 559,
645
+ 80,
646
+ 885,
647
+ 244
648
+ ],
649
+ "page_idx": 3
650
+ },
651
+ {
652
+ "type": "text",
653
+ "text": "which eliminates the influence of a specific variable (in this context, $E$ ) by assigning values to this variable. However, previous SCM-based debiasing methods exhibit divergent performances, since they estimate different (conditional) probabilities using different surrogates when performing the causal intervention. For example, counterfactual analysis by Wang et al. (2022) estimates and deducts the biasing effect of entities on labels by masking the context, while Zhang et al. (2017) and Longpre et al. (2021) directly remove the effect of entities by entity masking or substitution. None of them estimates the causal effects of entity names precisely, due to the highly complex architectures of LLMs, which account for their unsatisfactory performance on mitigating entity bias.",
654
+ "bbox": [
655
+ 112,
656
+ 293,
657
+ 489,
658
+ 551
659
+ ],
660
+ "page_idx": 3
661
+ },
662
+ {
663
+ "type": "text",
664
+ "text": "In this work, we consider the SCM in Fig. 2, whose parameters are much easier to estimate in practice. Since most LLMs follow a sequential structure by stacking neural layers, mitigating the entity bias in one layer will also mitigate the entity bias in subsequent layers. The underlying logic is simple - if we block the spurious features in the input, there will be no spurious correlations to capture. Therefore, we propose to mitigate the entity bias in the input layer $M$ , which could be an embedding layer or a prompt layer. Obviously, $P(M|X,E)$ can be estimated more accurately and efficiently than $P(Y|X,E)$ , because there is no need to run the whole model, ensuring less error propagation and computational cost. To further improve the estimation by retaining as much predictive information as possible, we propose to estimate $P(M|do(X))$ by perturbing the entity with similar entities rather than masking it. In the following sections, we will show how to realize the proposed causal intervention on both white-box and black-box LLMs.",
665
+ "bbox": [
666
+ 112,
667
+ 565,
668
+ 489,
669
+ 917
670
+ ],
671
+ "page_idx": 3
672
+ },
673
+ {
674
+ "type": "text",
675
+ "text": "3.2 Training-time Intervention",
676
+ "text_level": 1,
677
+ "bbox": [
678
+ 507,
679
+ 293,
680
+ 766,
681
+ 307
682
+ ],
683
+ "page_idx": 3
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "For white-box models of which the parameters are accessible, we can effectively address their internal bias through training-time intervention. In the case of entity bias identified by the proposed SCM, we realize the causal intervention by perturbing the input entities or entity tokens using their neighboring counterparts in the embedding space, as shown in Fig. 3 (Left). For each entity presented in the input text, we first find its top $k$ nearest neighbors according to embedding distance. Then we construct the smallest convex hull<sup>5</sup> to cover the original entity and neighboring entities. Due to the continuous nature of the embedding space, the embeddings within the convex hull approximately represent the same predictive information as a whole. The entity-specific biasing information, which has the potential to trigger spurious shortcuts, gradually diminishes from the original entity towards the border of the convex hull.",
688
+ "bbox": [
689
+ 505,
690
+ 313,
691
+ 884,
692
+ 618
693
+ ],
694
+ "page_idx": 3
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "During training, we introduce perturbations to the entity embedding by replacing it with a random embedding selected from within the convex hull. In this way, the convex hull bounded the predictive information, while random sampling further introduces noises and increases the diversity of data for robust training. During inference, we replace the original entity embedding with the center of the convex hull, in order to balance the trade-off between predictive and biasing information. Fig. 3 (Right) provides an example of the information preserved through such intervention. By replacing the entity Bill Gates with the center of the convex hull, encompassed by its neighboring entities, such as Steve Jobs and Jeff Bezos, we effectively retain the",
699
+ "bbox": [
700
+ 507,
701
+ 620,
702
+ 884,
703
+ 860
704
+ ],
705
+ "page_idx": 3
706
+ },
707
+ {
708
+ "type": "page_footnote",
709
+ "text": "5This convex hull-bounded perturbation is inspired by Dong et al. (2021), where perturbation within a convex hull formed by synonyms is used to improve model robustness against word substitutions.",
710
+ "bbox": [
711
+ 507,
712
+ 869,
713
+ 882,
714
+ 917
715
+ ],
716
+ "page_idx": 3
717
+ },
718
+ {
719
+ "type": "page_number",
720
+ "text": "15176",
721
+ "bbox": [
722
+ 477,
723
+ 927,
724
+ 524,
725
+ 940
726
+ ],
727
+ "page_idx": 3
728
+ },
729
+ {
730
+ "type": "image",
731
+ "img_path": "images/7c8d3d8e5550de1e1a4c33f69110be8de990706e2138b587b755297749d3f07d.jpg",
732
+ "image_caption": [
733
+ "1. Replace entities with placeholders"
734
+ ],
735
+ "image_footnote": [],
736
+ "bbox": [
737
+ 124,
738
+ 99,
739
+ 547,
740
+ 280
741
+ ],
742
+ "page_idx": 4
743
+ },
744
+ {
745
+ "type": "image",
746
+ "img_path": "images/403da6bc914c98f8dd45d3130dbb3a8385c8be8e9d55c263417ed0fedccb6b0f.jpg",
747
+ "image_caption": [
748
+ "3. Define placeholders with examples",
749
+ "Figure 4: In-context intervention for black-box LLMs. We take relation extraction as an example."
750
+ ],
751
+ "image_footnote": [],
752
+ "bbox": [
753
+ 571,
754
+ 99,
755
+ 880,
756
+ 280
757
+ ],
758
+ "page_idx": 4
759
+ },
760
+ {
761
+ "type": "text",
762
+ "text": "shared predictive information (e.g., person), while mitigating the biasing information (e.g., founder of Microsoft). That is to say, the convex hull-bounded perturbation serves as an effective estimation of $P(M|do(X))$ .",
763
+ "bbox": [
764
+ 112,
765
+ 331,
766
+ 487,
767
+ 412
768
+ ],
769
+ "page_idx": 4
770
+ },
771
+ {
772
+ "type": "text",
773
+ "text": "3.3 In-context Intervention",
774
+ "text_level": 1,
775
+ "bbox": [
776
+ 114,
777
+ 453,
778
+ 342,
779
+ 467
780
+ ],
781
+ "page_idx": 4
782
+ },
783
+ {
784
+ "type": "text",
785
+ "text": "The rise of Web services powered by black-box LLMs, such as GPT-3.5, introduces new challenges for mitigating entity bias, demanding debiasing methods that do not require accessible model weights and prediction logits. As discussed in §3.1, a key advantage of our SCM is that the deconfounder operation is merely on the input layer. In the context of black-box LLMs, the input is the user-provided prompt. Thus, we perform the causal intervention solely through modifying prompts to resolve entity bias. We propose a four-step (test-time) in-context intervention technique for black-box LLMs. Fig. 4 shows the whole process.",
786
+ "bbox": [
787
+ 112,
788
+ 491,
789
+ 489,
790
+ 701
791
+ ],
792
+ "page_idx": 4
793
+ },
794
+ {
795
+ "type": "text",
796
+ "text": "First, we replace the original entity mention in the input with abstract placeholders (e.g., [ENTITY]). This step effectively mitigates any biasing information from the original entity names, because the placeholders are semantic-neutral. However, this step also eliminates predictive information from entities. We show in §5.3 that, without proper definition for the placeholder, models can easily fail to answer questions. In the next two steps, we construct definitions to provide predictive information for each placeholder while introducing minimal additional biasing information. Second, we query the LLM to name $k$ entities similar to the",
797
+ "bbox": [
798
+ 112,
799
+ 709,
800
+ 489,
801
+ 917
802
+ ],
803
+ "page_idx": 4
804
+ },
805
+ {
806
+ "type": "text",
807
+ "text": "original one (e.g., $E_{o}$ ). These generated entities (e.g., $E_{a}$ and $E_{b}$ ) present similar predictive information as the original entity, and are able to fulfill the same function as neighboring entities in §3.2. Third, we define the placeholder with the original entity and generated entities. For example, we can verbalize the definition as \"Assume [ENTITY] can be any of $E_{o}$ , $E_{a}$ and $E_{b}$ \". This definition encourages the LLM to find common properties of given entities rather than relying on biasing information of one specific entity. The resulting placeholder along with its definition serves as an effective estimation of $P(M|do(X))$ . Finally, we presuppose the placeholder definition to be modified context and question, and query the LLM with the new prompt. This four-step adjustment ensures that the resulting prompt is free of specific biasing information pertaining to the original entity while still preserving sufficient predictive information by considering given entity examples as a whole.",
808
+ "bbox": [
809
+ 507,
810
+ 330,
811
+ 884,
812
+ 653
813
+ ],
814
+ "page_idx": 4
815
+ },
816
+ {
817
+ "type": "text",
818
+ "text": "4 White-Box Experiments",
819
+ "text_level": 1,
820
+ "bbox": [
821
+ 507,
822
+ 664,
823
+ 752,
824
+ 682
825
+ ],
826
+ "page_idx": 4
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "In this section, we evaluate our training-time intervention under the white-box setting.",
831
+ "bbox": [
832
+ 507,
833
+ 690,
834
+ 882,
835
+ 722
836
+ ],
837
+ "page_idx": 4
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "4.1 Experimental Setup",
842
+ "text_level": 1,
843
+ "bbox": [
844
+ 507,
845
+ 733,
846
+ 714,
847
+ 749
848
+ ],
849
+ "page_idx": 4
850
+ },
851
+ {
852
+ "type": "text",
853
+ "text": "Datasets and Metrics. We evaluate our methods on relation extraction (RE) and machine reading comprehension (MRC). For both tasks, we fine-tune models on an in-distribution (ID) training set and evaluate models on both ID and out-of-distribution (OOD) test sets. For RE, we adopt TACRED (Zhang et al., 2017) as the ID dataset and",
854
+ "bbox": [
855
+ 507,
856
+ 759,
857
+ 882,
858
+ 872
859
+ ],
860
+ "page_idx": 4
861
+ },
862
+ {
863
+ "type": "page_footnote",
864
+ "text": "Here, we rely on the entity knowledge possessed by LLMs. However, it is possible to replace the LLM with external databases or tools in this step.",
865
+ "bbox": [
866
+ 507,
867
+ 879,
868
+ 882,
869
+ 917
870
+ ],
871
+ "page_idx": 4
872
+ },
873
+ {
874
+ "type": "page_number",
875
+ "text": "15177",
876
+ "bbox": [
877
+ 477,
878
+ 927,
879
+ 524,
880
+ 940
881
+ ],
882
+ "page_idx": 4
883
+ },
884
+ {
885
+ "type": "table",
886
+ "img_path": "images/bfed6b16267ab5669a18bb0a93289a68731bd6628eaeb168d33cc6461d8768dd.jpg",
887
+ "table_caption": [],
888
+ "table_footnote": [],
889
+ "table_body": "<table><tr><td rowspan=\"2\"></td><td colspan=\"3\">RE (F1)</td><td colspan=\"3\">MRC (EM)</td></tr><tr><td>ID</td><td>OOD</td><td>Δ</td><td>ID</td><td>OOD</td><td>Δ</td></tr><tr><td>Vanilla Model</td><td>71.1±0.9</td><td>62.3±0.6</td><td>-12.4%</td><td>79.1†±0.1</td><td>63.1†±0.8</td><td>-20.2%</td></tr><tr><td>+ Continual Pretraining (Yan et al., 2022)*</td><td>-</td><td>-</td><td>-</td><td>79.6†±0.6</td><td>65.9†±1.1</td><td>-17.2%</td></tr><tr><td>+ CoRE (Wang et al., 2022)</td><td>71.3±0.3</td><td>61.2±0.6</td><td>-14.2%</td><td>-</td><td>-</td><td>-</td></tr><tr><td>+ Entity Mask (Zhang et al., 2017)</td><td>61.4±0.5</td><td>61.9±0.5</td><td>+0.9%</td><td>75.7±0.6</td><td>62.9±0.4</td><td>-16.9%</td></tr><tr><td>+ Entity Substitution (Longpre et al., 2021)</td><td>66.6±0.6</td><td>65.8±0.3</td><td>-1.2%</td><td>76.4±0.8</td><td>70.8±1.5</td><td>-7.3%</td></tr><tr><td>+ Ours</td><td>70.8±0.3</td><td>68.0±0.3</td><td>-3.9%</td><td>77.0±0.7</td><td>72.2±0.5</td><td>-6.2%</td></tr></table>",
890
+ "bbox": [
891
+ 134,
892
+ 80,
893
+ 860,
894
+ 225
895
+ ],
896
+ "page_idx": 5
897
+ },
898
+ {
899
+ "type": "text",
900
+ "text": "Table 1: Results under white-box setting. We report the average F1/EM score and standard deviation of three runs. $\\Delta$ shows the relative performance change between ID and OOD. The best number of each column is in bold. * Continual pretraining is not directly comparable to finetuning methods. † Numbers copied from Yan et al. (2022).",
901
+ "bbox": [
902
+ 112,
903
+ 228,
904
+ 882,
905
+ 272
906
+ ],
907
+ "page_idx": 5
908
+ },
909
+ {
910
+ "type": "text",
911
+ "text": "EntRED (Wang et al., 2023) as the OOD dataset, and report micro-F1 score. In both datasets, entities in each sentence are given. For MRC, we adopt TriviaQA (Joshi et al., 2017) as the ID dataset and its answer-substituted version (Yan et al., 2022) as the OOD dataset, and report exact match (EM) score. Following Yan et al. (2022), we hold out $10\\%$ of the training data for development and evaluate models on the original development set. We use the DBName version of their OOD dataset. For all metrics, we report the average score with standard deviation of three runs.",
912
+ "bbox": [
913
+ 112,
914
+ 297,
915
+ 489,
916
+ 491
917
+ ],
918
+ "page_idx": 5
919
+ },
920
+ {
921
+ "type": "text",
922
+ "text": "Baselines. We compare our methods with the following baselines. Entity Mask (Zhang et al., 2017) masks the subject and object entities in the sentence with special tokens. Entity Substitution (Longpre et al., 2021) randomly selects an entity of the same type to substitute the original entity. CoRE (Wang et al., 2022) applies counterfactual inference by computing the difference between the prediction made with the entire sentence and the prediction made with only the entities observed. Continual Pretraining (Yan et al., 2022) introduces an intermediate pretraining stage to the backbone model with the objective of recovering masked entities.",
923
+ "bbox": [
924
+ 112,
925
+ 504,
926
+ 489,
927
+ 713
928
+ ],
929
+ "page_idx": 5
930
+ },
931
+ {
932
+ "type": "text",
933
+ "text": "Implementation Details. For RE, we apply RoBERTa (Liu et al., 2019) as the backbone model following previous works (Zhou and Chen, 2022; Wang et al., 2022). We use the entity Marker_punct input format from Zhou and Chen (2022) in main experiments, in order to mitigate the impact of explicit entity type information on our analysis of entity bias. For MRC, we apply SpanBERT (Joshi et al., 2020) as the backbone model following Yan et al. (2022). Since entities are not given in MRC datasets, we use the same named entity recognition tool used by Yan et al. to",
934
+ "bbox": [
935
+ 112,
936
+ 726,
937
+ 489,
938
+ 917
939
+ ],
940
+ "page_idx": 5
941
+ },
942
+ {
943
+ "type": "text",
944
+ "text": "extract entities. Since the detected entities could be noisy and incomplete, we perform our method upon answer-substituted training set ensuring all answer entities are perturbed as strong as Entity Substitution. Since RoBERTa and SpanBERT lack entity-level embeddings, we apply our causal intervention to each token embedding within the entity mention instead. To construct convex hull, We select neighboring tokens based on their Euclidean distance to the original token in the embedding space. For both tasks, we perform training-time intervention on each entity token with $k = 3$ . While further data augmentation is always possible, for a fair comparison, we finetune all the models with the same amount of data. More implementation details are in Appx. §A.1.",
945
+ "bbox": [
946
+ 507,
947
+ 297,
948
+ 884,
949
+ 554
950
+ ],
951
+ "page_idx": 5
952
+ },
953
+ {
954
+ "type": "text",
955
+ "text": "4.2 Results",
956
+ "text_level": 1,
957
+ "bbox": [
958
+ 507,
959
+ 567,
960
+ 613,
961
+ 581
962
+ ],
963
+ "page_idx": 5
964
+ },
965
+ {
966
+ "type": "text",
967
+ "text": "As shown in Tab. 1, the vanilla RoBERTa and Span-BERT experiences significant declines in performance on RE $(-12.4\\%)$ and MRC $(-20.2\\%)$ when evaluated on OOD test sets. For both tasks, the OOD test set exhibits lower entity bias, achieving better performance on it suggests that the model relies less on entity bias as a predictive factor.",
968
+ "bbox": [
969
+ 507,
970
+ 589,
971
+ 882,
972
+ 700
973
+ ],
974
+ "page_idx": 5
975
+ },
976
+ {
977
+ "type": "text",
978
+ "text": "CoRE and Continual Pretraining are the only baselines that improve the ID performance. CoRE leads to a slight performance decrease on the OOD test set of RE in exchange, while Continual Pretraining further increases the OOD performance on MRC. Entity Mask successfully narrows down or even reverses the relative performance drop under OOD setting on the two tasks. However, its absolute performance decreases significantly due",
979
+ "bbox": [
980
+ 507,
981
+ 702,
982
+ 884,
983
+ 847
984
+ ],
985
+ "page_idx": 5
986
+ },
987
+ {
988
+ "type": "page_footnote",
989
+ "text": "This is because CoRE is designed for a class-balanced setting, but this experiment emphasizes the performance on the raw class distribution. Moreover, we search its bias mitigation weight on the ID development set, which has a notably different entity distribution compared with the OOD test set.",
990
+ "bbox": [
991
+ 507,
992
+ 857,
993
+ 882,
994
+ 917
995
+ ],
996
+ "page_idx": 5
997
+ },
998
+ {
999
+ "type": "page_number",
1000
+ "text": "15178",
1001
+ "bbox": [
1002
+ 477,
1003
+ 927,
1004
+ 524,
1005
+ 940
1006
+ ],
1007
+ "page_idx": 5
1008
+ },
1009
+ {
1010
+ "type": "image",
1011
+ "img_path": "images/1e5e73f04a91dfac533284c7fb68b82174d8773d9d033b143674b9b8251048c4.jpg",
1012
+ "image_caption": [
1013
+ "Figure 5: F1 score of training-time intervention with different $k$ on RE."
1014
+ ],
1015
+ "image_footnote": [],
1016
+ "bbox": [
1017
+ 117,
1018
+ 84,
1019
+ 482,
1020
+ 237
1021
+ ],
1022
+ "page_idx": 6
1023
+ },
1024
+ {
1025
+ "type": "text",
1026
+ "text": "to the loss of predictive information from entities. Moreover, its effectiveness is dependent on the task property. Unlike MRC, entities are given and are not answers in RE, so the gap between ID and OOD performance of Entity Mask are much smaller. Entity Substitution stands out among all the baselines in terms of the OOD performance, with an absolute improvement of 3.5 points on RE and 7.7 points on MRC. However, its ID performance suffers a lot from the distribution shift of entities during training.",
1027
+ "bbox": [
1028
+ 112,
1029
+ 307,
1030
+ 489,
1031
+ 483
1032
+ ],
1033
+ "page_idx": 6
1034
+ },
1035
+ {
1036
+ "type": "text",
1037
+ "text": "Our training-time intervention achieves the best OOD performance, with an absolute improvement of 2.2 points on RE and 1.4 points on MRC compared with Entity Substitution. At the same time, its ID performance is also better. These results show that our method mitigates entity bias more effectively without losing much predictive information. In other words, the proposed method represents a better way to estimate the parameters of the proposed SCM accurately.",
1038
+ "bbox": [
1039
+ 112,
1040
+ 486,
1041
+ 489,
1042
+ 646
1043
+ ],
1044
+ "page_idx": 6
1045
+ },
1046
+ {
1047
+ "type": "text",
1048
+ "text": "4.3 Analysis",
1049
+ "text_level": 1,
1050
+ "bbox": [
1051
+ 112,
1052
+ 663,
1053
+ 228,
1054
+ 678
1055
+ ],
1056
+ "page_idx": 6
1057
+ },
1058
+ {
1059
+ "type": "text",
1060
+ "text": "To provide a comprehensive understanding of our training-time intervention, we further conduct analyses on RE.",
1061
+ "bbox": [
1062
+ 112,
1063
+ 686,
1064
+ 489,
1065
+ 734
1066
+ ],
1067
+ "page_idx": 6
1068
+ },
1069
+ {
1070
+ "type": "text",
1071
+ "text": "Effect of $k$ . The number of neighbors, $k$ , plays a crucial role in balancing the predictive information and biasing information from entities. To find the sweet spot of $k$ , we examine its influence on model performance as shown in Fig. 5. In general, the ID performance decreases when $k$ increases. As the value of $k$ increases, the resulting convex hull becomes larger, causing the center of the hull to move further away from the original entity. Consequently, both the predictive information and biasing information that contribute to ID performance grad",
1072
+ "bbox": [
1073
+ 112,
1074
+ 741,
1075
+ 489,
1076
+ 919
1077
+ ],
1078
+ "page_idx": 6
1079
+ },
1080
+ {
1081
+ "type": "text",
1082
+ "text": "ually diminish. In contrast, the OOD performance is lower when $k$ is too big or too small. When $k$ is too big, the same problem under ID setting also happens to the OOD setting. When $k$ is too small, the biasing information is not effectively mitigated, because the perturbed entity is too close to the original entity.",
1083
+ "bbox": [
1084
+ 507,
1085
+ 84,
1086
+ 884,
1087
+ 197
1088
+ ],
1089
+ "page_idx": 6
1090
+ },
1091
+ {
1092
+ "type": "text",
1093
+ "text": "Entity Type as Input. Previous experiments in this section do not explicitly input entity information as it may disturb the causal analysis. Here, we analyze the effect of entity type information as input. We use the typed-entity Marker_punct input format from Zhou and Chen (2022). The ID and OOD F1 scores of vanilla RoBERTa model are 74.6 and 68.9 points, respectively. Our training-time intervention further improves the ID performance by 0.7 points and the OOD performance by 2.9 points. These results indicate that information from neighboring entities is complementary to coarse-grained entity type information for precise RE.",
1094
+ "bbox": [
1095
+ 507,
1096
+ 203,
1097
+ 885,
1098
+ 413
1099
+ ],
1100
+ "page_idx": 6
1101
+ },
1102
+ {
1103
+ "type": "text",
1104
+ "text": "5 Black-Box Experiments",
1105
+ "text_level": 1,
1106
+ "bbox": [
1107
+ 507,
1108
+ 426,
1109
+ 749,
1110
+ 443
1111
+ ],
1112
+ "page_idx": 6
1113
+ },
1114
+ {
1115
+ "type": "text",
1116
+ "text": "In this section, we evaluate our in-context intervention for mitigating entity bias from LLMs under black-box setting.",
1117
+ "bbox": [
1118
+ 507,
1119
+ 453,
1120
+ 882,
1121
+ 502
1122
+ ],
1123
+ "page_idx": 6
1124
+ },
1125
+ {
1126
+ "type": "text",
1127
+ "text": "5.1 Experimental Setup",
1128
+ "text_level": 1,
1129
+ "bbox": [
1130
+ 507,
1131
+ 514,
1132
+ 714,
1133
+ 531
1134
+ ],
1135
+ "page_idx": 6
1136
+ },
1137
+ {
1138
+ "type": "text",
1139
+ "text": "Datasets. Following Zhou et al. (2023), we adopt GPT-3.5 text-davinci-003 as the backbone LLM and evaluate the model performance under a zero-shot setting. We use the RE and MRC datasets provided by Zhou et al. (2023). The RE dataset is based on Re-TACRED (Stoica et al., 2021). Zhou et al. pair each instance's entities with a randomly sampled context that shares the same entity types but possesses different relations. To mitigate the influence of the label no Relation, which can also serve as a signal of abstention, we further filter out all instances whose original or updated labels are no relation. The MRC dataset is based on Natural Questions (Kwiatkowski et al., 2019). Zhou et al. replace the original answer in each instance with a randomly sampled entity of the same type. They only collect instances where the LLM can give the correct answer based on the raw context. Intuitively, LLMs that faithfully capture contextual information should update their answers based on the new context.",
1140
+ "bbox": [
1141
+ 507,
1142
+ 542,
1143
+ 884,
1144
+ 879
1145
+ ],
1146
+ "page_idx": 6
1147
+ },
1148
+ {
1149
+ "type": "text",
1150
+ "text": "Metrics. We report the F1 score for RE, and EM score for MRC. To align with previous works, we",
1151
+ "bbox": [
1152
+ 507,
1153
+ 887,
1154
+ 882,
1155
+ 917
1156
+ ],
1157
+ "page_idx": 6
1158
+ },
1159
+ {
1160
+ "type": "page_number",
1161
+ "text": "15179",
1162
+ "bbox": [
1163
+ 477,
1164
+ 927,
1165
+ 524,
1166
+ 941
1167
+ ],
1168
+ "page_idx": 6
1169
+ },
1170
+ {
1171
+ "type": "image",
1172
+ "img_path": "images/be6c9003fb40edac702a485a798962fd538118535c39d89b507e4846ed2de6dc.jpg",
1173
+ "image_caption": [
1174
+ "MRC (EM↑)"
1175
+ ],
1176
+ "image_footnote": [],
1177
+ "bbox": [
1178
+ 117,
1179
+ 96,
1180
+ 302,
1181
+ 223
1182
+ ],
1183
+ "page_idx": 7
1184
+ },
1185
+ {
1186
+ "type": "image",
1187
+ "img_path": "images/bc72c29f86b2b87f5661457131bdf034bd1761395f3cb70403b534e8f09f5462.jpg",
1188
+ "image_caption": [
1189
+ "MRC (MR↓)"
1190
+ ],
1191
+ "image_footnote": [],
1192
+ "bbox": [
1193
+ 309,
1194
+ 96,
1195
+ 495,
1196
+ 222
1197
+ ],
1198
+ "page_idx": 7
1199
+ },
1200
+ {
1201
+ "type": "image",
1202
+ "img_path": "images/cd431268605c6800f35fa1004b6cbc4ecbaddfcdcd993a6c0e1d14738e944b64.jpg",
1203
+ "image_caption": [
1204
+ "RE(F1↑)"
1205
+ ],
1206
+ "image_footnote": [],
1207
+ "bbox": [
1208
+ 502,
1209
+ 96,
1210
+ 685,
1211
+ 222
1212
+ ],
1213
+ "page_idx": 7
1214
+ },
1215
+ {
1216
+ "type": "image",
1217
+ "img_path": "images/e81114962483800c37f0c8a36288ff6f38777800b7221cf11cb9b2953493d90d.jpg",
1218
+ "image_caption": [
1219
+ "RE (MR↓)"
1220
+ ],
1221
+ "image_footnote": [],
1222
+ "bbox": [
1223
+ 694,
1224
+ 96,
1225
+ 877,
1226
+ 222
1227
+ ],
1228
+ "page_idx": 7
1229
+ },
1230
+ {
1231
+ "type": "image",
1232
+ "img_path": "images/4d847bd6ecc6921a78d6e8692d8fa0ca19bbd734699d2d8f8b462ba5f6d13c98.jpg",
1233
+ "image_caption": [
1234
+ "Figure 6: GPT-3.5 results on MRC and RE under black-box setting. We report the EM score on MRC and the F1 score on RE, for which higher scores are better. We also report the MR score on both tasks, for which lower scores are better. Our in-context intervention performs consistently better than baselines under all settings.",
1235
+ "Figure 7: Ablation study of in-context intervention for GPT-3.5 on RE."
1236
+ ],
1237
+ "image_footnote": [],
1238
+ "bbox": [
1239
+ 119,
1240
+ 318,
1241
+ 484,
1242
+ 422
1243
+ ],
1244
+ "page_idx": 7
1245
+ },
1246
+ {
1247
+ "type": "text",
1248
+ "text": "also report the memorization ratio (MR; Longpre et al. 2021) to measure the model's ability to update answers based on given contexts. $^{8}$",
1249
+ "bbox": [
1250
+ 112,
1251
+ 488,
1252
+ 485,
1253
+ 538
1254
+ ],
1255
+ "page_idx": 7
1256
+ },
1257
+ {
1258
+ "type": "text",
1259
+ "text": "Baselines. We compare our in-context intervention with the methods introduced by Zhou et al. (2023). Base prompts directly concatenate the context and the question of each instance as the query. Attribute-based prompts append \"in the given context\" to the question. Opinion-based prompts modified the context to a narrator's statement by prepending \"Bob said\" to the context, and then query the LLM about the narrator's opinion by preponding \"What's Bob's opinion on\" to the question. We evaluate all methods with and without specifically designed task instructions following Zhou et al. (2023).",
1260
+ "bbox": [
1261
+ 110,
1262
+ 543,
1263
+ 490,
1264
+ 736
1265
+ ],
1266
+ "page_idx": 7
1267
+ },
1268
+ {
1269
+ "type": "text",
1270
+ "text": "Implementation Details. We apply our in-context intervention to attribute-based prompts. We adopt the backbone LLM to propose two similar entities along with the original entity to define each placeholder. To further eliminate the spurious entity mapping, we shuffle the entities for each placeholder before verbalization. Details of all prompt templates used can be found in Appx. §A.2. Since",
1271
+ "bbox": [
1272
+ 112,
1273
+ 741,
1274
+ 487,
1275
+ 871
1276
+ ],
1277
+ "page_idx": 7
1278
+ },
1279
+ {
1280
+ "type": "text",
1281
+ "text": "entities are not given in MRC, we detect named entities and replace them with placeholders using gpt-3.5-turbo as an external tool. Given the potential abundance of entities in long contexts, we do not replace entities that exclusively appear in the context.",
1282
+ "bbox": [
1283
+ 507,
1284
+ 319,
1285
+ 884,
1286
+ 416
1287
+ ],
1288
+ "page_idx": 7
1289
+ },
1290
+ {
1291
+ "type": "text",
1292
+ "text": "5.2 Results",
1293
+ "text_level": 1,
1294
+ "bbox": [
1295
+ 507,
1296
+ 429,
1297
+ 613,
1298
+ 442
1299
+ ],
1300
+ "page_idx": 7
1301
+ },
1302
+ {
1303
+ "type": "text",
1304
+ "text": "As shown in Fig. 6, all methods benefit from carefully designed task instructions in terms of task performance. The Opinion-based prompt performs the best among all baselines in most cases. Compared with the Base prompt, it significantly improves the EM score by 18.7-21.5 points on MRC and the F1 score by 0.6-4.7 points on RE. Our in-context intervention achieves the highest EM/F1 score and the lowest MR score under all settings. Specifically, without task instruction, our in-context intervention outperforms the best baseline by 20.5 EM points on MRC and reduces the MR score by 17.6 points on RE. These results demonstrate the effectiveness of our causal intervention for addressing entity-based knowledge conflicts in black-box LLMs.",
1305
+ "bbox": [
1306
+ 507,
1307
+ 450,
1308
+ 882,
1309
+ 690
1310
+ ],
1311
+ "page_idx": 7
1312
+ },
1313
+ {
1314
+ "type": "text",
1315
+ "text": "5.3 Ablation Study",
1316
+ "text_level": 1,
1317
+ "bbox": [
1318
+ 507,
1319
+ 703,
1320
+ 673,
1321
+ 719
1322
+ ],
1323
+ "page_idx": 7
1324
+ },
1325
+ {
1326
+ "type": "text",
1327
+ "text": "We in addition conduct an ablation study on RE to provide a comprehensive understanding of our method, as shown in Fig. 7. When the placeholder definition is not provided (i.e., w/o definition), no entity information, including both biasing and predictive information, appears in the input. As a result, it successfully blocks any spurious shortcuts with MR drops to 0. However, the F1 score also drops sharply from 71.8 points to 37.9 points, indicating that some entity information is essential to accurate RE and the LLM cannot understand the placeholders well without their definition.",
1328
+ "bbox": [
1329
+ 507,
1330
+ 726,
1331
+ 882,
1332
+ 917
1333
+ ],
1334
+ "page_idx": 7
1335
+ },
1336
+ {
1337
+ "type": "page_footnote",
1338
+ "text": "${}^{8}MR = \\frac{P_{o}}{P_{o} + P_{s}}$ , where $P_{o}$ is the probability that the model generates the original answer and $P_{s}$ is the probability that the model updates the answer correctly.",
1339
+ "bbox": [
1340
+ 112,
1341
+ 877,
1342
+ 487,
1343
+ 919
1344
+ ],
1345
+ "page_idx": 7
1346
+ },
1347
+ {
1348
+ "type": "page_number",
1349
+ "text": "15180",
1350
+ "bbox": [
1351
+ 477,
1352
+ 927,
1353
+ 524,
1354
+ 940
1355
+ ],
1356
+ "page_idx": 7
1357
+ },
1358
+ {
1359
+ "type": "text",
1360
+ "text": "We further examine the role of original entities in the placeholder definition. On the one hand, we remove the original entities from the definition (i.e., w/o original entity). Results show that our method can still improve F1 while reducing MR. This verifies the effectiveness of using a set of similar entities to represent the predictive information from the original entity. On the other hand, we put the original subject and object entities at the same position (i.e., w/o entity shuffle) in the definition so that the LLM can easily map them. As a result, the MR increases significantly, showing that the LLM can find spurious shortcuts even through mapping the subject entity and the object entity from two entity sets.",
1361
+ "bbox": [
1362
+ 112,
1363
+ 84,
1364
+ 492,
1365
+ 326
1366
+ ],
1367
+ "page_idx": 8
1368
+ },
1369
+ {
1370
+ "type": "text",
1371
+ "text": "6 Conclusion",
1372
+ "text_level": 1,
1373
+ "bbox": [
1374
+ 112,
1375
+ 343,
1376
+ 247,
1377
+ 357
1378
+ ],
1379
+ "page_idx": 8
1380
+ },
1381
+ {
1382
+ "type": "text",
1383
+ "text": "In this paper, we analyze the entity bias in LLMs from a causal view. Building upon an SCM whose parameters are easier to estimate, we propose training-time causal intervention for white-box LLMs and in-context causal intervention for black-box LLMs. Both intervention techniques perturb the original entity with neighboring entities to mitigate spurious correlations between specific entities and predictions. Experiments on relation extraction and machine reading comprehension show that the proposed intervention can effectively reduce the conflicts between parametric knowledge and contextual knowledge and significantly improve the performance of LLMs. Future work can apply our causal intervention to more LLMs and tasks to achieve context-faithful answers.",
1384
+ "bbox": [
1385
+ 112,
1386
+ 372,
1387
+ 489,
1388
+ 630
1389
+ ],
1390
+ "page_idx": 8
1391
+ },
1392
+ {
1393
+ "type": "text",
1394
+ "text": "Acknowledgement",
1395
+ "text_level": 1,
1396
+ "bbox": [
1397
+ 114,
1398
+ 648,
1399
+ 278,
1400
+ 665
1401
+ ],
1402
+ "page_idx": 8
1403
+ },
1404
+ {
1405
+ "type": "text",
1406
+ "text": "We appreciate the reviewers for their insightful comments and suggestions. Fei Wang is supported by the Annenberg Fellowship and the Amazon ML Fellowship. Wenjie Mo is supported by the USC CURVE Fellowship and the Provost's Research Fellowship. Wenxuan Zhou and Muhao Chen are supported by the NSF Grant IIS 2105329, the NSF Grant ITE 2333736, the DARPA MCS program under Contract No. N660011924033 with the United States Office Of Naval Research. This work is also supported in part by a Cisco Research Award, two Amazon Research Awards, and a Keston Research Award. Computing of this work has been partly supported by a subaward of NSF Cloudbank 1925001 through UCSD.",
1407
+ "bbox": [
1408
+ 112,
1409
+ 677,
1410
+ 489,
1411
+ 919
1412
+ ],
1413
+ "page_idx": 8
1414
+ },
1415
+ {
1416
+ "type": "text",
1417
+ "text": "Limitation",
1418
+ "text_level": 1,
1419
+ "bbox": [
1420
+ 509,
1421
+ 83,
1422
+ 606,
1423
+ 98
1424
+ ],
1425
+ "page_idx": 8
1426
+ },
1427
+ {
1428
+ "type": "text",
1429
+ "text": "Although we have tried to verify the effectiveness of our method under diverse settings, including different LLMs, different accessibility of model parameters, and different tasks, there are always more options for further investigation, especially nowadays when more and more LLMs are kept produced. Considering the property of the entity bias issue may vary when it comes to different LLMs and datasets from different domains, future work can build better benchmark for more comprehensive evaluation. In this paper, we only consider zero-shot prompting for black-box LLMs, because this will help us to control variables during causal analysis. However, it is possible to combine the proposed causal intervention with cutting-edge LLM inference methods, such as in-context learning (Brown et al., 2020), although the underlying SCM may become more complex.",
1430
+ "bbox": [
1431
+ 507,
1432
+ 108,
1433
+ 885,
1434
+ 399
1435
+ ],
1436
+ "page_idx": 8
1437
+ },
1438
+ {
1439
+ "type": "text",
1440
+ "text": "References",
1441
+ "text_level": 1,
1442
+ "bbox": [
1443
+ 510,
1444
+ 425,
1445
+ 608,
1446
+ 439
1447
+ ],
1448
+ "page_idx": 8
1449
+ },
1450
+ {
1451
+ "type": "list",
1452
+ "sub_type": "ref_text",
1453
+ "list_items": [
1454
+ "Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901.",
1455
+ "Hung-Ting Chen, Michael Zhang, and Eunsol Choi. 2022. Rich knowledge sources bring complex knowledge conflicts: Recalibrating models to reflect conflicting evidence. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 2292-2307, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.",
1456
+ "Xinshuai Dong, Anh Tuan Luu, Rongrong Ji, and Hong Liu. 2021. Towards robustness against natural language word substitutions. In International Conference on Learning Representations.",
1457
+ "Amir Feder, Katherine A Keith, Emaad Manzoor, Reid Pryzant, Dhanya Sridhar, Zach Wood-Doughty, Jacob Eisenstein, Justin Grimmer, Roi Reichart, Margaret E Roberts, et al. 2022. Causal inference in natural language processing: Estimation, prediction, interpretation and beyond. Transactions of the Association for Computational Linguistics, 10:1138-1158.",
1458
+ "Matthew Finlayson, Aaron Mueller, Sebastian Gehrmann, Stuart Shieber, Tal Linzen, and Yonatan Belinkov. 2021. Causal analysis of syntactic agreement mechanisms in neural language models. arXiv preprint arXiv:2106.06087.",
1459
+ "Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman,"
1460
+ ],
1461
+ "bbox": [
1462
+ 509,
1463
+ 447,
1464
+ 885,
1465
+ 919
1466
+ ],
1467
+ "page_idx": 8
1468
+ },
1469
+ {
1470
+ "type": "page_number",
1471
+ "text": "15181",
1472
+ "bbox": [
1473
+ 477,
1474
+ 927,
1475
+ 524,
1476
+ 940
1477
+ ],
1478
+ "page_idx": 8
1479
+ },
1480
+ {
1481
+ "type": "list",
1482
+ "sub_type": "ref_text",
1483
+ "list_items": [
1484
+ "and Phil Blunsom. 2015. Teaching machines to read and comprehend. Advances in neural information processing systems, 28.",
1485
+ "Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. 2020. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423-438.",
1486
+ "Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. 2020. Spanbert: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64-77.",
1487
+ "Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. 2017. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1601-1611.",
1488
+ "Jungo Kasai, Keisuke Sakaguchi, Yoichi Takahashi, Ronan Le Bras, Akari Asai, Xinyan Yu, Dragomir Radev, Noah A Smith, Yejin Choi, and Kentaro Inui. 2022. Realtime qa: What's the answer right now? arXiv preprint arXiv:2207.13332.",
1489
+ "Katherine Keith, David Jensen, and Brendan O'Connor. 2020. Text and causal inference: A review of using text to remove confounding from causal estimates. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5332-5344.",
1490
+ "Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. 2019. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453-466.",
1491
+ "John P Lalor, Yi Yang, Kendall Smith, Nicole Forsgren, and Ahmed Abbasi. 2022. Benchmarking intersectional biases in nlp. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3598-3609.",
1492
+ "Daliang Li, Ankit Singh Rawat, Manzil Zaheer, Xin Wang, Michal Lukasik, Andreas Veit, Felix Yu, and Sanjiv Kumar. 2022. Large language models with controllable working memory. arXiv preprint arXiv:2211.05110.",
1493
+ "Stephanie Lin, Jacob Hilton, and Owain Evans. 2022. TruthfulQA: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3214-3252, Dublin, Ireland. Association for Computational Linguistics.",
1494
+ "Adam Liska, Tomas Kocisky, Elena Gribovskaya, Tayfun Terzi, Eren Sezener, Devang Agrawal, D'Autume Cyprien De Masson, Tim Scholtes, Manzil Zaheer,"
1495
+ ],
1496
+ "bbox": [
1497
+ 115,
1498
+ 85,
1499
+ 487,
1500
+ 917
1501
+ ],
1502
+ "page_idx": 9
1503
+ },
1504
+ {
1505
+ "type": "list",
1506
+ "sub_type": "ref_text",
1507
+ "list_items": [
1508
+ "Susannah Young, et al. 2022. Streamingqa: A benchmark for adaptation to new knowledge over time in question answering models. In International Conference on Machine Learning, pages 13604-13622. PMLR.",
1509
+ "Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692.",
1510
+ "Shayne Longpre, Kartik Perisetla, Anthony Chen, Nikhil Ramesh, Chris DuBois, and Sameer Singh. 2021. Entity-based knowledge conflicts in question answering. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7052-7063.",
1511
+ "Guoshun Nan, Jiaqi Zeng, Rui Qiao, Zhijiang Guo, and Wei Lu. 2021. Uncovering main causalities for long-tailed information extraction. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9683-9695.",
1512
+ "Yulei Niu and Hanwang Zhang. 2021. Introspective distillation for robust question answering. Advances in Neural Information Processing Systems, 34:16292-16304.",
1513
+ "Judea Pearl. 2012. The do-calculus revisited. In Proceedings of the Twenty-Eighth Conference on Uncertainty in Artificial Intelligence, pages 3-11.",
1514
+ "Hao Peng, Tianyu Gao, Xu Han, Yankai Lin, Peng Li, Zhiyuan Liu, Maosong Sun, and Jie Zhou. 2020. Learning from context or names? an empirical study on neural relation extraction. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3661-3672.",
1515
+ "Fabio Petroni, Tim Rocttäschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander Miller. 2019. Language models as knowledge bases? 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), pages 2463-2473, Hong Kong, China. Association for Computational Linguistics.",
1516
+ "Chen Qian, Fuli Feng, Lijie Wen, Chunping Ma, and Pengjun Xie. 2021a. Counterfactual inference for text classification debiasing. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 5434-5445.",
1517
+ "Kun Qian, Ahmad Beirami, Zhouhan Lin, Ankita De, Alborz Geramifard, Zhou Yu, and Chinnadhurai Sankar. 2021b. Annotation inconsistency and entity bias in MultiWOZ. In Proceedings of the 22nd Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 326-337, Singapore and Online. Association for Computational Linguistics."
1518
+ ],
1519
+ "bbox": [
1520
+ 510,
1521
+ 85,
1522
+ 882,
1523
+ 917
1524
+ ],
1525
+ "page_idx": 9
1526
+ },
1527
+ {
1528
+ "type": "page_number",
1529
+ "text": "15182",
1530
+ "bbox": [
1531
+ 477,
1532
+ 928,
1533
+ 524,
1534
+ 940
1535
+ ],
1536
+ "page_idx": 9
1537
+ },
1538
+ {
1539
+ "type": "list",
1540
+ "sub_type": "ref_text",
1541
+ "list_items": [
1542
+ "Adam Roberts, Colin Raffel, and Noam Shazeer. 2020. How much knowledge can you pack into the parameters of a language model? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5418-5426, Online. Association for Computational Linguistics.",
1543
+ "George Stoica, Emmanouil Antonios Platanios, and Barnabás Póczos. 2021. Re-tacred: Addressing shortcomings of the tacred dataset. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 13843-13850.",
1544
+ "Chris Sweeney and Maryam Najafian. 2019. A transparent framework for evaluating unintended demographic bias in word embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1662-1667.",
1545
+ "Bing Tian, Yixin Cao, Yong Zhang, and Chunxiao Xing. 2022. Debiasing nlu models via causal intervention and counterfactual reasoning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 11376-11384.",
1546
+ "Can Udomcharoenchaikit, Wuttikorn Ponwitayarat, Patomporn Payoungkhamdee, Kanruethai Masuk, Weerayut Buaphet, Ekapol Chuangsuwanich, and Sarana Nutanong. 2022. Mitigating spurious correlation in natural language understanding with counterfactual inference. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 11308-11321.",
1547
+ "Pranav Narayanan Venkit and Shomir Wilson. 2021. Identification of bias against people with disabilities in sentiment analysis and toxicity detection models. arXiv preprint arXiv:2111.13259.",
1548
+ "Thomas Verma and Judea Pearl. 1990. Equivalence and synthesis of causal models. In Proceedings of the Sixth Annual Conference on Uncertainty in Artificial Intelligence, pages 255-270.",
1549
+ "Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Simas Sakenis, Jason Huang, Yaron Singer, and Stuart Shieber. 2020. Causal mediation analysis for interpreting neural nlp: The case of gender bias. arXiv preprint arXiv:2004.12265.",
1550
+ "Yiwei Wang, Muhao Chen, Wenxuan Zhou, Yujun Cai, Yuxuan Liang, Dayiheng Liu, Baosong Yang, Juncheng Liu, and Bryan Hooi. 2022. Should we rely on entity mentions for relation extraction? debi- aising relation extraction with counterfactual analysis. arXiv preprint arXiv:2205.03784.",
1551
+ "Yiwei Wang, Bryan Hooi, Fei Wang, Yujun Cai, Yuxuan Liang, Wenxuan Zhou, Jing Tang, Manjuan Duan, and Muhao Chen. 2023. How fragile is relation extraction under entity replacements? In Proceedings of the 27th SIGNLL Conference on Computational Natural Language Learning (CoNLL)."
1552
+ ],
1553
+ "bbox": [
1554
+ 115,
1555
+ 85,
1556
+ 489,
1557
+ 917
1558
+ ],
1559
+ "page_idx": 10
1560
+ },
1561
+ {
1562
+ "type": "list",
1563
+ "sub_type": "ref_text",
1564
+ "list_items": [
1565
+ "Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. 2022. Finetuned language models are zero-shot learners. In International Conference on Learning Representations.",
1566
+ "Galen Weld, Peter West, Maria Glenski, David Arbour, Ryan A Rossi, and Tim Althoff. 2022. Adjusting for confounders with text: Challenges and an empirical evaluation framework for causal inference. In Proceedings of the International AAAI Conference on Web and Social Media, volume 16, pages 1109-1120.",
1567
+ "Nan Xu, Fei Wang, Bangzheng Li, Mingtao Dong, and Muhao Chen. 2022. Does your model classify entities reasonably? diagnosing and mitigating spurious correlations in entity typing. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing.",
1568
+ "Jun Yan, Yang Xiao, Sagnik Mukherjee, Bill Yuchen Lin, Robin Jia, and Xiang Ren. 2022. On the robustness of reading comprehension models to entity renaming. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 508-520.",
1569
+ "Dong Zhang, Hanwang Zhang, Jinhui Tang, Xian-Sheng Hua, and Qianru Sun. 2020a. Causal intervention for weakly-supervised semantic segmentation. Advances in Neural Information Processing Systems, 33:655-666.",
1570
+ "Guanhua Zhang, Bing Bai, Junqi Zhang, Kun Bai, Conghui Zhu, and Tiejun Zhao. 2020b. Demographics should not be the reason of toxicity: Mitigating discrimination in text classifications with instance weighting. arXiv preprint arXiv:2004.14088.",
1571
+ "Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D Manning. 2017. Position-aware attention and supervised data improve slot filling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 35-45.",
1572
+ "Wenxuan Zhou and Muhao Chen. 2022. An improved baseline for sentence-level relation extraction. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing, pages 161-168.",
1573
+ "Wenxuan Zhou, Sheng Zhang, Hoifung Poon, and Muhao Chen. 2023. Context-faithful prompting for large language models. In *Findings of the 2023 Conference on Empirical Methods in Natural Language Processing*.",
1574
+ "Yongchun Zhu, Qiang Sheng, Juan Cao, Shuokai Li, Danding Wang, and Fuzhen Zhuang. 2022. Generalizing to the future: Mitigating entity bias in fake news detection. In Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2120-2125."
1575
+ ],
1576
+ "bbox": [
1577
+ 510,
1578
+ 85,
1579
+ 882,
1580
+ 910
1581
+ ],
1582
+ "page_idx": 10
1583
+ },
1584
+ {
1585
+ "type": "page_number",
1586
+ "text": "15183",
1587
+ "bbox": [
1588
+ 477,
1589
+ 927,
1590
+ 524,
1591
+ 940
1592
+ ],
1593
+ "page_idx": 10
1594
+ },
1595
+ {
1596
+ "type": "text",
1597
+ "text": "A Implementation Details",
1598
+ "text_level": 1,
1599
+ "bbox": [
1600
+ 114,
1601
+ 83,
1602
+ 356,
1603
+ 99
1604
+ ],
1605
+ "page_idx": 11
1606
+ },
1607
+ {
1608
+ "type": "text",
1609
+ "text": "A.1 White-Box Experiments",
1610
+ "text_level": 1,
1611
+ "bbox": [
1612
+ 114,
1613
+ 112,
1614
+ 354,
1615
+ 129
1616
+ ],
1617
+ "page_idx": 11
1618
+ },
1619
+ {
1620
+ "type": "text",
1621
+ "text": "For RE, we use RoBERTa-Large as our backbone model, which has 354 million parameters. Our implementation is based on the codebase by Zhou and Chen (2022) with their default hyper-parameters. More specifically, we employ a learning rate of 3e-5, a batch size of 32, and conduct training for a total of 5 epochs. Other method-specific hyperparameters are selected on the development set of TACRED. Finetuning typically takes 1.5 hours on an NVIDIA RTX A5000 GPU.",
1622
+ "bbox": [
1623
+ 112,
1624
+ 137,
1625
+ 487,
1626
+ 296
1627
+ ],
1628
+ "page_idx": 11
1629
+ },
1630
+ {
1631
+ "type": "text",
1632
+ "text": "For MRC, we use SpanBERT-base-cased as our backbone model, which has 110 million parameters. Our implementation is based on the codebase by Yan et al. (2022) with their default hyperparameters. More specifically, we employ a learning rate of 2e-5, a batch size of 16, and conduct training for a total of 4 epochs. Other method-specific hyper-parameters are selected on the hold-out development set of TriviaQA. Finetuning typically takes 3 hours on an NVIDIA RTX A5000 GPU.",
1633
+ "bbox": [
1634
+ 112,
1635
+ 300,
1636
+ 489,
1637
+ 475
1638
+ ],
1639
+ "page_idx": 11
1640
+ },
1641
+ {
1642
+ "type": "text",
1643
+ "text": "A.2 Black-Box Experiments",
1644
+ "text_level": 1,
1645
+ "bbox": [
1646
+ 114,
1647
+ 494,
1648
+ 351,
1649
+ 508
1650
+ ],
1651
+ "page_idx": 11
1652
+ },
1653
+ {
1654
+ "type": "text",
1655
+ "text": "Our implementation is based on the codebase by Zhou et al. (2023).",
1656
+ "bbox": [
1657
+ 112,
1658
+ 518,
1659
+ 485,
1660
+ 549
1661
+ ],
1662
+ "page_idx": 11
1663
+ },
1664
+ {
1665
+ "type": "text",
1666
+ "text": "The instruction for MRC is",
1667
+ "bbox": [
1668
+ 132,
1669
+ 552,
1670
+ 337,
1671
+ 565
1672
+ ],
1673
+ "page_idx": 11
1674
+ },
1675
+ {
1676
+ "type": "text",
1677
+ "text": "Instruction: read the given information and answer the corresponding question.",
1678
+ "bbox": [
1679
+ 131,
1680
+ 586,
1681
+ 468,
1682
+ 619
1683
+ ],
1684
+ "page_idx": 11
1685
+ },
1686
+ {
1687
+ "type": "text",
1688
+ "text": "The prompt without instruction for MRC is",
1689
+ "bbox": [
1690
+ 132,
1691
+ 638,
1692
+ 455,
1693
+ 653
1694
+ ],
1695
+ "page_idx": 11
1696
+ },
1697
+ {
1698
+ "type": "text",
1699
+ "text": "Assume that {ENTITY0} can be any of {entity0Candidates}. [Assume that {ENTITY1} can be any of {entity1Candidates} ...] {context}",
1700
+ "bbox": [
1701
+ 132,
1702
+ 671,
1703
+ 470,
1704
+ 734
1705
+ ],
1706
+ "page_idx": 11
1707
+ },
1708
+ {
1709
+ "type": "text",
1710
+ "text": "Q:{question} based on the given text? Extract the answer from the given text. Do not add other words.",
1711
+ "bbox": [
1712
+ 132,
1713
+ 737,
1714
+ 468,
1715
+ 782
1716
+ ],
1717
+ "page_idx": 11
1718
+ },
1719
+ {
1720
+ "type": "text",
1721
+ "text": "A:",
1722
+ "bbox": [
1723
+ 132,
1724
+ 785,
1725
+ 154,
1726
+ 799
1727
+ ],
1728
+ "page_idx": 11
1729
+ },
1730
+ {
1731
+ "type": "text",
1732
+ "text": "The instruction for RE is",
1733
+ "bbox": [
1734
+ 132,
1735
+ 816,
1736
+ 319,
1737
+ 831
1738
+ ],
1739
+ "page_idx": 11
1740
+ },
1741
+ {
1742
+ "type": "text",
1743
+ "text": "Identify the relationship between two entities from a list of options.",
1744
+ "bbox": [
1745
+ 132,
1746
+ 852,
1747
+ 467,
1748
+ 883
1749
+ ],
1750
+ "page_idx": 11
1751
+ },
1752
+ {
1753
+ "type": "text",
1754
+ "text": "The prompt without instruction for RE is",
1755
+ "bbox": [
1756
+ 132,
1757
+ 903,
1758
+ 438,
1759
+ 917
1760
+ ],
1761
+ "page_idx": 11
1762
+ },
1763
+ {
1764
+ "type": "text",
1765
+ "text": "Assume that subject_entity is one of {subjCandidates}, while object-entity is one of {objCandidates} in the following text. {context}",
1766
+ "bbox": [
1767
+ 526,
1768
+ 89,
1769
+ 863,
1770
+ 153
1771
+ ],
1772
+ "page_idx": 11
1773
+ },
1774
+ {
1775
+ "type": "text",
1776
+ "text": "Q: Which option indicates the relationship between subject_entity and object-entity in the given text?",
1777
+ "bbox": [
1778
+ 527,
1779
+ 154,
1780
+ 863,
1781
+ 200
1782
+ ],
1783
+ "page_idx": 11
1784
+ },
1785
+ {
1786
+ "type": "text",
1787
+ "text": "Options:{options}",
1788
+ "bbox": [
1789
+ 529,
1790
+ 202,
1791
+ 665,
1792
+ 218
1793
+ ],
1794
+ "page_idx": 11
1795
+ },
1796
+ {
1797
+ "type": "text",
1798
+ "text": "A:",
1799
+ "bbox": [
1800
+ 529,
1801
+ 219,
1802
+ 549,
1803
+ 231
1804
+ ],
1805
+ "page_idx": 11
1806
+ },
1807
+ {
1808
+ "type": "text",
1809
+ "text": "The prompt template for detecting entities in MRC is",
1810
+ "bbox": [
1811
+ 509,
1812
+ 247,
1813
+ 880,
1814
+ 277
1815
+ ],
1816
+ "page_idx": 11
1817
+ },
1818
+ {
1819
+ "type": "text",
1820
+ "text": "List named entities in the following sentence. Separate the entities with $\\# \\# \\# \\#$ , if you find multiple entities. Do not add additional words before or after your answers..",
1821
+ "bbox": [
1822
+ 526,
1823
+ 294,
1824
+ 865,
1825
+ 357
1826
+ ],
1827
+ "page_idx": 11
1828
+ },
1829
+ {
1830
+ "type": "text",
1831
+ "text": "{sentence}",
1832
+ "bbox": [
1833
+ 527,
1834
+ 360,
1835
+ 608,
1836
+ 374
1837
+ ],
1838
+ "page_idx": 11
1839
+ },
1840
+ {
1841
+ "type": "text",
1842
+ "text": "The prompt template for replacing entities with placeholders in MRC is",
1843
+ "bbox": [
1844
+ 507,
1845
+ 390,
1846
+ 880,
1847
+ 420
1848
+ ],
1849
+ "page_idx": 11
1850
+ },
1851
+ {
1852
+ "type": "text",
1853
+ "text": "Replace the entity {entity_list} in the following paragraph. \n{paragraph}",
1854
+ "bbox": [
1855
+ 526,
1856
+ 437,
1857
+ 865,
1858
+ 485
1859
+ ],
1860
+ "page_idx": 11
1861
+ },
1862
+ {
1863
+ "type": "text",
1864
+ "text": "The prompt template for finding similar entities is",
1865
+ "bbox": [
1866
+ 509,
1867
+ 501,
1868
+ 880,
1869
+ 531
1870
+ ],
1871
+ "page_idx": 11
1872
+ },
1873
+ {
1874
+ "type": "text",
1875
+ "text": "Name two [{\\entity_type}] entities similar to {\" $\\{entity\\}''$ . Separate the entities with \\#\\#\\#, and do not add additional words before or after your answers. Provide random answers if you are not sure.",
1876
+ "bbox": [
1877
+ 526,
1878
+ 546,
1879
+ 863,
1880
+ 627
1881
+ ],
1882
+ "page_idx": 11
1883
+ },
1884
+ {
1885
+ "type": "text",
1886
+ "text": "In all the above prompts, variables are surrounded with curly brackets and optional variables are surrounded with square brackets.",
1887
+ "bbox": [
1888
+ 507,
1889
+ 640,
1890
+ 882,
1891
+ 689
1892
+ ],
1893
+ "page_idx": 11
1894
+ },
1895
+ {
1896
+ "type": "page_number",
1897
+ "text": "15184",
1898
+ "bbox": [
1899
+ 477,
1900
+ 927,
1901
+ 524,
1902
+ 940
1903
+ ],
1904
+ "page_idx": 11
1905
+ }
1906
+ ]
2023/A Causal View of Entity Bias in (Large) Language Models/729caa97-c496-4007-b8f4-5ff70bb6b7ae_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Causal View of Entity Bias in (Large) Language Models/729caa97-c496-4007-b8f4-5ff70bb6b7ae_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:90964d0f41dcecb380f0e13b6cd6e51f46125dbe8ce9f3b5f9d81b32bc449be8
3
+ size 1174471
2023/A Causal View of Entity Bias in (Large) Language Models/full.md ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Causal View of Entity Bias in (Large) Language Models
2
+
3
+ Fei Wang† Wenjie Mo† Yiwei Wang‡ Wenxuan Zhou† Muhao Chen†#
4
+
5
+ †University of Southern California; ‡University of California, Los Angeles;
6
+
7
+ $^{\#}$ University of California, Davis
8
+
9
+ {fwang598, jackymo, zhouwenx}@usc.edu; wangyw.evan@gmail.com;
10
+
11
+ muhchen@ucdavis.edu
12
+
13
+ # Abstract
14
+
15
+ Entity bias widely affects pretrained (large) language models, causing them to rely on (biased) parametric knowledge to make unfaithful predictions. Although causality-inspired methods have shown great potential to mitigate entity bias, it is hard to precisely estimate the parameters of underlying causal models in practice. The rise of black-box LLMs also makes the situation even worse, because of their inaccessible parameters and uncalibrated logits. To address these problems, we propose a specific structured causal model (SCM) whose parameters are comparatively easier to estimate. Building upon this SCM, we propose causal intervention techniques to mitigate entity bias for both white-box and black-box settings. The proposed causal intervention perturbs the original entity with neighboring entities. This intervention reduces specific biasing information pertaining to the original entity while still preserving sufficient semantic information from similar entities. Under the white-box setting, our training-time intervention improves OOD performance of PLMs on relation extraction (RE) and machine reading comprehension (MRC) by 5.7 points and by 9.1 points, respectively. Under the black-box setting, our in-context intervention effectively reduces the entity-based knowledge conflicts of GPT-3.5, achieving up to 20.5 points of improvement of exact match accuracy on MRC and up to 17.6 points of reduction in memorization ratio on RE.<sup>1</sup>
16
+
17
+ # 1 Introduction
18
+
19
+ Entity bias (Longpre et al., 2021; Wang et al., 2022; Xu et al., 2022; Peng et al., 2020; Qian et al., 2021b; Hermann et al., 2015) refers to an undesirable phenomenon where models overly rely on prediction shortcuts triggered by specific entities to make spurious predictions. For example, given the sentence "Bill Gates went to Microsoft Building 99," models
20
+
21
+ Context: Bill Gates went to Microsoft Building 99.
22
+
23
+ Question: What's the relation between Bill Gates and
24
+
25
+ Microsoft in the given context?
26
+
27
+ Option: founder, visitor.
28
+
29
+ Answer with one word: founder (GPT-3.5) X
30
+
31
+ Assume subject_entity can be any of Bill Gates, Jeff Bezos, and Steve Jobs, while object-entity can be any of Google, Microsoft, and Meta.
32
+
33
+ Context: subject entity went to object entity Building 99.
34
+
35
+ Question: What's the relation between subject_entity and object-entity in the given context?
36
+
37
+ Option: founder, visitor.
38
+
39
+ Answer with one word: visitor (GPT-3.5)
40
+
41
+ Figure 1: An example of entity bias in GPT-3.5. Our in-context intervention mitigates the conflicts between parametric knowledge and contextual knowledge.
42
+
43
+ may be misled by their memory of the entities Bill Gates and Microsoft, saying the relation between them in this context is founder rather than visitor, as shown in Fig. 1. Recent studies show that entity bias widely affects pretrained (large) language models (LLMs; Longpre et al. 2021; Yan et al. 2022; Zhou et al. 2023). These models have a tendency to disregard contextual information that contradicts or is infrequently reported in the pretrained corpus, while excessively relying on (biased) parametric knowledge (Longpre et al., 2021) to make unfaithful predictions and perpetuate bias.
44
+
45
+ Prior studies have proposed multiple causality-inspired methods to mitigate entity bias (Zhang et al., 2017; Nan et al., 2021; Wang et al., 2022; Zhu et al., 2022). Despite their potential, the causal models underlying these methods are flawed in practice, primarily because of imprecise parameter estimation. For example, some causal models necessitate estimating the probability distribution
46
+
47
+ over labels when given a sentence that is devoid of entities or contextual information (Zhang et al., 2017; Wang et al., 2022). These methods either lose predictive information about entities, or are prone to erroneous representation without contextualization. The other critical problem is the difficulty of applying these methods to black-box LLMs, of which parameters are inaccessible and logits are uncalibrated.
48
+
49
+ To address the aforementioned problems, the first contribution of this paper is a causal analysis of entity bias mitigation methods (§3.1). We examine and compare the structured causal models (SCMs) behind existing methods. We find that, among the theoretically equivalent causal models (Verma and Pearl, 1990), there exists a specific SCM whose parameters are comparatively easier to estimate. As shown in Fig. 2, the proposed SCM only requires to intervene input entities to mitigate the presence of spurious features before passing them to the subsequent neural layers. Moreover, it retains the entity type information<sup>3</sup> at an appropriate level of granularity without requiring explicit entity typing.
50
+
51
+ The second contribution of this paper is a training-time causal intervention technique for mitigating entity bias based on the proposed SCM (§3.2). Specifically, we identify entities that are likely to share similar predictive information with the given entity. During training, we perturb embedding of the given entity within a convex hull constructed by embeddings of similar entities. During inference, we represent the entity with the center of the convex hull. Taking advantage of the continuous nature of the embedding space, this intervention does not rely on models specifically trained on natural language to estimate the label distribution of unnatural text, nor does it sacrifice predictive entity or contextual information.
52
+
53
+ The third contribution of this paper is to transform the training-time intervention into in-context intervention for black-box LLMs whose parameters are inaccessible, and logits are uncalibrated (§3.3). A significant advantage of the proposed SCM is that the causal intervention is carried out at the input layer, enabling its implementation within an in-context setting. Specifically, we replace entities with placeholders and define each placeholder
54
+
55
+ ![](images/bf9d06eb92efa725a6034a50a4f065110b9aba5f3115575234f82e257a19ac56.jpg)
56
+
57
+ ![](images/822404bcab44be672f773ca48fbde5c0e883b30f7145a30b4351ca44fa7346de.jpg)
58
+
59
+ ![](images/fa721ff35c2731ef19e22b55cd75093b559fef91bc441146d20f4632827f9845.jpg)
60
+ Figure 2: Structured causal models revealing entity bias.
61
+
62
+ by examples - a set of similar entities. For example, we can replace Bill Gates in Fig. 1 with subject_entity and presuppend the prompt, "Assume that subject-entity can be any of Steve Jobs, Bill Gates, and Jeff Bezos", to the input. This in-context intervention can be applied to any black-box LLM without additional cost.
63
+
64
+ Experiments on relation extraction (RE) and machine reading comprehension (MRC) show that the proposed causal intervention techniques are effective for both white-box and black-box LLMs. Under the white-box setting ( $\S 4$ ), our training-time intervention significantly improves out-of-distribution performance of RoBERTa (Liu et al., 2019) on RE by 5.7 points and SpanBERT (Joshi et al., 2020) on MRC by 9.1 points, comparing with the vanilla version. Under the black-box setting ( $\S 5$ ), our in-context intervention effectively reduces the entity-based knowledge conflicts (Long-pre et al., 2021) and improves the task performance of GPT-3.5. Specifically, our method outperforms the best baseline by up to 20.5 points of exact match accuracy on MRC and reduces the memorization ratio by up to 17.6 points on RE. Further analyses reveal the crucial role of the number of neighboring entities $k$ in balancing the predictive information and biasing information from entities, and the necessity of entity placeholder definition for in-context intervention.
65
+
66
+ # 2 Related Work
67
+
68
+ Entity Bias in LLMs. LLMs memorize factual knowledge in their parameters during pretraining (Roberts et al., 2020; Jiang et al., 2020) and show promising results in answering factual questions (Petroni et al., 2019; Brown et al., 2020; Wei
69
+
70
+ et al., 2022). However, the parametric knowledge may be inaccurate due to the misinformation in the training corpus (Lin et al., 2022) or outdated as the world evolves (Liska et al., 2022; Kasai et al., 2022). In such scenarios, it is critical for LLMs to update their predictions when provided with contextual evidence. However, previous studies (Longpre et al., 2021; Qian et al., 2021b; Yan et al., 2022) observe that language models may take entities as shortcuts, leading to spurious predictions based solely on parametric knowledge. This bias becomes more prominent when the evidence contains infrequent or conflicting knowledge compared to the training corpus.
71
+
72
+ To mitigate this bias, previous work (Longpre et al., 2021; Chen et al., 2022; Li et al., 2022; Zhou et al., 2023) introduces the entity substitution technique, which involves constructing counterfactual data by randomly replacing the entities, and updating the language models either by finetuning or in-context learning. Although showing improved results, these techniques are empirical and lack theoretical backgrounds. In this paper, we theoretically analyze the entity bias problem from a causal view. Furthermore, we propose a causal intervention method that surpasses the performance of entity substitution.
73
+
74
+ Debiasing with Causal Intervention. LLMs have been revealed with bias problems, for which literature has paid much attention in order to mitigate their adverse effects (Sweeney and Najafian, 2019; Zhang et al., 2020b; Venkit and Wilson, 2021; Lalor et al., 2022). Recent debiasing techniques incorporate the concept of counterfactual inference, and have been applied in various tasks for bias mitigation (Niu and Zhang, 2021; Qian et al., 2021a; Wang et al., 2022). One dominant technique is based on causal mediation analysis (Udomcharoenchaikit et al., 2022), which involves decomposing the total effect into pure direct effect and total indirect effect. In this context, Wang et al. (2022) utilize total direct effect and total effect to debias the relation extraction. Apart from debiasing, causal mediation analysis can be used to analyze biases in LLMs (Vig et al., 2020; Finlayson et al., 2021).
75
+
76
+ In addition to intervening causal mediator, previous studies have also explored confounder analysis (Keith et al., 2020; Qian et al., 2021a; Feder et al., 2022; Weld et al., 2022). A confounder is a variable that influences both the input and the output, causing a spurious correlation between them.
77
+
78
+ Typically, the de-confounder process applies the do-calculus (Pearl, 2012) to compute the prediction assuming that the value of the confounder variable is not the observed one but follows its natural distribution (Zhang et al., 2020a; Tian et al., 2022). Our approach is also based on confounder analysis. While nearly all the aforementioned approaches request a white-box accessibility of the model with at least logits of predictions, this work represents a pilot study of deconfounder method that applies to purely black-box LLMs.
79
+
80
+ # 3 Method
81
+
82
+ In this section, we first analyze methods for mitigating entity bias in a causal view and propose an easy-to-estimate SCM as a theoretical basis (§3.1). Based on the proposed SCM, we design a training-time intervention technique for white-box LLMs (§3.2) and an in-context intervention technique for black-box LLMs (§3.3).
83
+
84
+ # 3.1 Causal Analysis of Entity Bias
85
+
86
+ To compare existing methods in the same context, we analyze the structured causal models (SCMs) behind them. Fig. 2 shows two typical SCMs for entity bias mitigation methods, where $X$ refers to the raw input, $E$ refers to entities, and $Y$ refers to the label. The links $X \rightarrow Y \leftarrow E$ show that LLMs rely on both predictive information from the whole input and the biasing information from specific entities to make the prediction. The links $E \rightarrow X$ and $X \rightarrow E$ assume that the context is written down with the entity in mind or vice versa. As discussed by Verma and Pearl (1990), we cannot differentiate between these two directions merely based on statistical observations. Indeed, the two SCMs with opposite links between $X$ and $E$ are equivalent according to the Bayes' theorem:
87
+
88
+ $$
89
+ \begin{array}{l} P (X) P (E | X) P (Y | X, E) \\ = P (Y, X, E) \\ = P (E) P (X \mid E) P (Y \mid X, E) \\ \end{array}
90
+ $$
91
+
92
+ As revealed by these SCMs, entity bias exists in LLMs because entities serve as either confounders or mediators. Thus, the bias can be mitigated through causal intervention, such as backdoor adjustment
93
+
94
+ $$
95
+ P (Y | d o (X)) = \sum_ {E} P (Y | X, E) P (E),
96
+ $$
97
+
98
+ ![](images/8e8cd6f645fb1ebe10dd5f451789ba5103994691b8b9e54976f1e508ad3d7713.jpg)
99
+ Figure 3: Left: Training-time intervention with $k = 4$ . Right: Example of predictive and biasing information.
100
+
101
+ ![](images/5559d0c93cb9298a3db4eb6479d03fe4fabaa1a8fd6a0b0f1c71dd44810e15ea.jpg)
102
+
103
+ which eliminates the influence of a specific variable (in this context, $E$ ) by assigning values to this variable. However, previous SCM-based debiasing methods exhibit divergent performances, since they estimate different (conditional) probabilities using different surrogates when performing the causal intervention. For example, counterfactual analysis by Wang et al. (2022) estimates and deducts the biasing effect of entities on labels by masking the context, while Zhang et al. (2017) and Longpre et al. (2021) directly remove the effect of entities by entity masking or substitution. None of them estimates the causal effects of entity names precisely, due to the highly complex architectures of LLMs, which account for their unsatisfactory performance on mitigating entity bias.
104
+
105
+ In this work, we consider the SCM in Fig. 2, whose parameters are much easier to estimate in practice. Since most LLMs follow a sequential structure by stacking neural layers, mitigating the entity bias in one layer will also mitigate the entity bias in subsequent layers. The underlying logic is simple - if we block the spurious features in the input, there will be no spurious correlations to capture. Therefore, we propose to mitigate the entity bias in the input layer $M$ , which could be an embedding layer or a prompt layer. Obviously, $P(M|X,E)$ can be estimated more accurately and efficiently than $P(Y|X,E)$ , because there is no need to run the whole model, ensuring less error propagation and computational cost. To further improve the estimation by retaining as much predictive information as possible, we propose to estimate $P(M|do(X))$ by perturbing the entity with similar entities rather than masking it. In the following sections, we will show how to realize the proposed causal intervention on both white-box and black-box LLMs.
106
+
107
+ # 3.2 Training-time Intervention
108
+
109
+ For white-box models of which the parameters are accessible, we can effectively address their internal bias through training-time intervention. In the case of entity bias identified by the proposed SCM, we realize the causal intervention by perturbing the input entities or entity tokens using their neighboring counterparts in the embedding space, as shown in Fig. 3 (Left). For each entity presented in the input text, we first find its top $k$ nearest neighbors according to embedding distance. Then we construct the smallest convex hull<sup>5</sup> to cover the original entity and neighboring entities. Due to the continuous nature of the embedding space, the embeddings within the convex hull approximately represent the same predictive information as a whole. The entity-specific biasing information, which has the potential to trigger spurious shortcuts, gradually diminishes from the original entity towards the border of the convex hull.
110
+
111
+ During training, we introduce perturbations to the entity embedding by replacing it with a random embedding selected from within the convex hull. In this way, the convex hull bounded the predictive information, while random sampling further introduces noises and increases the diversity of data for robust training. During inference, we replace the original entity embedding with the center of the convex hull, in order to balance the trade-off between predictive and biasing information. Fig. 3 (Right) provides an example of the information preserved through such intervention. By replacing the entity Bill Gates with the center of the convex hull, encompassed by its neighboring entities, such as Steve Jobs and Jeff Bezos, we effectively retain the
112
+
113
+ ![](images/7c8d3d8e5550de1e1a4c33f69110be8de990706e2138b587b755297749d3f07d.jpg)
114
+ 1. Replace entities with placeholders
115
+
116
+ ![](images/403da6bc914c98f8dd45d3130dbb3a8385c8be8e9d55c263417ed0fedccb6b0f.jpg)
117
+ 3. Define placeholders with examples
118
+ Figure 4: In-context intervention for black-box LLMs. We take relation extraction as an example.
119
+
120
+ shared predictive information (e.g., person), while mitigating the biasing information (e.g., founder of Microsoft). That is to say, the convex hull-bounded perturbation serves as an effective estimation of $P(M|do(X))$ .
121
+
122
+ # 3.3 In-context Intervention
123
+
124
+ The rise of Web services powered by black-box LLMs, such as GPT-3.5, introduces new challenges for mitigating entity bias, demanding debiasing methods that do not require accessible model weights and prediction logits. As discussed in §3.1, a key advantage of our SCM is that the deconfounder operation is merely on the input layer. In the context of black-box LLMs, the input is the user-provided prompt. Thus, we perform the causal intervention solely through modifying prompts to resolve entity bias. We propose a four-step (test-time) in-context intervention technique for black-box LLMs. Fig. 4 shows the whole process.
125
+
126
+ First, we replace the original entity mention in the input with abstract placeholders (e.g., [ENTITY]). This step effectively mitigates any biasing information from the original entity names, because the placeholders are semantic-neutral. However, this step also eliminates predictive information from entities. We show in §5.3 that, without proper definition for the placeholder, models can easily fail to answer questions. In the next two steps, we construct definitions to provide predictive information for each placeholder while introducing minimal additional biasing information. Second, we query the LLM to name $k$ entities similar to the
127
+
128
+ original one (e.g., $E_{o}$ ). These generated entities (e.g., $E_{a}$ and $E_{b}$ ) present similar predictive information as the original entity, and are able to fulfill the same function as neighboring entities in §3.2. Third, we define the placeholder with the original entity and generated entities. For example, we can verbalize the definition as "Assume [ENTITY] can be any of $E_{o}$ , $E_{a}$ and $E_{b}$ ". This definition encourages the LLM to find common properties of given entities rather than relying on biasing information of one specific entity. The resulting placeholder along with its definition serves as an effective estimation of $P(M|do(X))$ . Finally, we presuppose the placeholder definition to be modified context and question, and query the LLM with the new prompt. This four-step adjustment ensures that the resulting prompt is free of specific biasing information pertaining to the original entity while still preserving sufficient predictive information by considering given entity examples as a whole.
129
+
130
+ # 4 White-Box Experiments
131
+
132
+ In this section, we evaluate our training-time intervention under the white-box setting.
133
+
134
+ # 4.1 Experimental Setup
135
+
136
+ Datasets and Metrics. We evaluate our methods on relation extraction (RE) and machine reading comprehension (MRC). For both tasks, we fine-tune models on an in-distribution (ID) training set and evaluate models on both ID and out-of-distribution (OOD) test sets. For RE, we adopt TACRED (Zhang et al., 2017) as the ID dataset and
137
+
138
+ <table><tr><td rowspan="2"></td><td colspan="3">RE (F1)</td><td colspan="3">MRC (EM)</td></tr><tr><td>ID</td><td>OOD</td><td>Δ</td><td>ID</td><td>OOD</td><td>Δ</td></tr><tr><td>Vanilla Model</td><td>71.1±0.9</td><td>62.3±0.6</td><td>-12.4%</td><td>79.1†±0.1</td><td>63.1†±0.8</td><td>-20.2%</td></tr><tr><td>+ Continual Pretraining (Yan et al., 2022)*</td><td>-</td><td>-</td><td>-</td><td>79.6†±0.6</td><td>65.9†±1.1</td><td>-17.2%</td></tr><tr><td>+ CoRE (Wang et al., 2022)</td><td>71.3±0.3</td><td>61.2±0.6</td><td>-14.2%</td><td>-</td><td>-</td><td>-</td></tr><tr><td>+ Entity Mask (Zhang et al., 2017)</td><td>61.4±0.5</td><td>61.9±0.5</td><td>+0.9%</td><td>75.7±0.6</td><td>62.9±0.4</td><td>-16.9%</td></tr><tr><td>+ Entity Substitution (Longpre et al., 2021)</td><td>66.6±0.6</td><td>65.8±0.3</td><td>-1.2%</td><td>76.4±0.8</td><td>70.8±1.5</td><td>-7.3%</td></tr><tr><td>+ Ours</td><td>70.8±0.3</td><td>68.0±0.3</td><td>-3.9%</td><td>77.0±0.7</td><td>72.2±0.5</td><td>-6.2%</td></tr></table>
139
+
140
+ Table 1: Results under white-box setting. We report the average F1/EM score and standard deviation of three runs. $\Delta$ shows the relative performance change between ID and OOD. The best number of each column is in bold. * Continual pretraining is not directly comparable to finetuning methods. † Numbers copied from Yan et al. (2022).
141
+
142
+ EntRED (Wang et al., 2023) as the OOD dataset, and report micro-F1 score. In both datasets, entities in each sentence are given. For MRC, we adopt TriviaQA (Joshi et al., 2017) as the ID dataset and its answer-substituted version (Yan et al., 2022) as the OOD dataset, and report exact match (EM) score. Following Yan et al. (2022), we hold out $10\%$ of the training data for development and evaluate models on the original development set. We use the DBName version of their OOD dataset. For all metrics, we report the average score with standard deviation of three runs.
143
+
144
+ Baselines. We compare our methods with the following baselines. Entity Mask (Zhang et al., 2017) masks the subject and object entities in the sentence with special tokens. Entity Substitution (Longpre et al., 2021) randomly selects an entity of the same type to substitute the original entity. CoRE (Wang et al., 2022) applies counterfactual inference by computing the difference between the prediction made with the entire sentence and the prediction made with only the entities observed. Continual Pretraining (Yan et al., 2022) introduces an intermediate pretraining stage to the backbone model with the objective of recovering masked entities.
145
+
146
+ Implementation Details. For RE, we apply RoBERTa (Liu et al., 2019) as the backbone model following previous works (Zhou and Chen, 2022; Wang et al., 2022). We use the entity Marker_punct input format from Zhou and Chen (2022) in main experiments, in order to mitigate the impact of explicit entity type information on our analysis of entity bias. For MRC, we apply SpanBERT (Joshi et al., 2020) as the backbone model following Yan et al. (2022). Since entities are not given in MRC datasets, we use the same named entity recognition tool used by Yan et al. to
147
+
148
+ extract entities. Since the detected entities could be noisy and incomplete, we perform our method upon answer-substituted training set ensuring all answer entities are perturbed as strong as Entity Substitution. Since RoBERTa and SpanBERT lack entity-level embeddings, we apply our causal intervention to each token embedding within the entity mention instead. To construct convex hull, We select neighboring tokens based on their Euclidean distance to the original token in the embedding space. For both tasks, we perform training-time intervention on each entity token with $k = 3$ . While further data augmentation is always possible, for a fair comparison, we finetune all the models with the same amount of data. More implementation details are in Appx. §A.1.
149
+
150
+ # 4.2 Results
151
+
152
+ As shown in Tab. 1, the vanilla RoBERTa and Span-BERT experiences significant declines in performance on RE $(-12.4\%)$ and MRC $(-20.2\%)$ when evaluated on OOD test sets. For both tasks, the OOD test set exhibits lower entity bias, achieving better performance on it suggests that the model relies less on entity bias as a predictive factor.
153
+
154
+ CoRE and Continual Pretraining are the only baselines that improve the ID performance. CoRE leads to a slight performance decrease on the OOD test set of RE in exchange, while Continual Pretraining further increases the OOD performance on MRC. Entity Mask successfully narrows down or even reverses the relative performance drop under OOD setting on the two tasks. However, its absolute performance decreases significantly due
155
+
156
+ ![](images/1e5e73f04a91dfac533284c7fb68b82174d8773d9d033b143674b9b8251048c4.jpg)
157
+ Figure 5: F1 score of training-time intervention with different $k$ on RE.
158
+
159
+ to the loss of predictive information from entities. Moreover, its effectiveness is dependent on the task property. Unlike MRC, entities are given and are not answers in RE, so the gap between ID and OOD performance of Entity Mask are much smaller. Entity Substitution stands out among all the baselines in terms of the OOD performance, with an absolute improvement of 3.5 points on RE and 7.7 points on MRC. However, its ID performance suffers a lot from the distribution shift of entities during training.
160
+
161
+ Our training-time intervention achieves the best OOD performance, with an absolute improvement of 2.2 points on RE and 1.4 points on MRC compared with Entity Substitution. At the same time, its ID performance is also better. These results show that our method mitigates entity bias more effectively without losing much predictive information. In other words, the proposed method represents a better way to estimate the parameters of the proposed SCM accurately.
162
+
163
+ # 4.3 Analysis
164
+
165
+ To provide a comprehensive understanding of our training-time intervention, we further conduct analyses on RE.
166
+
167
+ Effect of $k$ . The number of neighbors, $k$ , plays a crucial role in balancing the predictive information and biasing information from entities. To find the sweet spot of $k$ , we examine its influence on model performance as shown in Fig. 5. In general, the ID performance decreases when $k$ increases. As the value of $k$ increases, the resulting convex hull becomes larger, causing the center of the hull to move further away from the original entity. Consequently, both the predictive information and biasing information that contribute to ID performance grad
168
+
169
+ ually diminish. In contrast, the OOD performance is lower when $k$ is too big or too small. When $k$ is too big, the same problem under ID setting also happens to the OOD setting. When $k$ is too small, the biasing information is not effectively mitigated, because the perturbed entity is too close to the original entity.
170
+
171
+ Entity Type as Input. Previous experiments in this section do not explicitly input entity information as it may disturb the causal analysis. Here, we analyze the effect of entity type information as input. We use the typed-entity Marker_punct input format from Zhou and Chen (2022). The ID and OOD F1 scores of vanilla RoBERTa model are 74.6 and 68.9 points, respectively. Our training-time intervention further improves the ID performance by 0.7 points and the OOD performance by 2.9 points. These results indicate that information from neighboring entities is complementary to coarse-grained entity type information for precise RE.
172
+
173
+ # 5 Black-Box Experiments
174
+
175
+ In this section, we evaluate our in-context intervention for mitigating entity bias from LLMs under black-box setting.
176
+
177
+ # 5.1 Experimental Setup
178
+
179
+ Datasets. Following Zhou et al. (2023), we adopt GPT-3.5 text-davinci-003 as the backbone LLM and evaluate the model performance under a zero-shot setting. We use the RE and MRC datasets provided by Zhou et al. (2023). The RE dataset is based on Re-TACRED (Stoica et al., 2021). Zhou et al. pair each instance's entities with a randomly sampled context that shares the same entity types but possesses different relations. To mitigate the influence of the label no Relation, which can also serve as a signal of abstention, we further filter out all instances whose original or updated labels are no relation. The MRC dataset is based on Natural Questions (Kwiatkowski et al., 2019). Zhou et al. replace the original answer in each instance with a randomly sampled entity of the same type. They only collect instances where the LLM can give the correct answer based on the raw context. Intuitively, LLMs that faithfully capture contextual information should update their answers based on the new context.
180
+
181
+ Metrics. We report the F1 score for RE, and EM score for MRC. To align with previous works, we
182
+
183
+ ![](images/be6c9003fb40edac702a485a798962fd538118535c39d89b507e4846ed2de6dc.jpg)
184
+ MRC (EM↑)
185
+
186
+ ![](images/bc72c29f86b2b87f5661457131bdf034bd1761395f3cb70403b534e8f09f5462.jpg)
187
+ MRC (MR↓)
188
+
189
+ ![](images/cd431268605c6800f35fa1004b6cbc4ecbaddfcdcd993a6c0e1d14738e944b64.jpg)
190
+ RE(F1↑)
191
+
192
+ ![](images/e81114962483800c37f0c8a36288ff6f38777800b7221cf11cb9b2953493d90d.jpg)
193
+ RE (MR↓)
194
+
195
+ ![](images/4d847bd6ecc6921a78d6e8692d8fa0ca19bbd734699d2d8f8b462ba5f6d13c98.jpg)
196
+ Figure 6: GPT-3.5 results on MRC and RE under black-box setting. We report the EM score on MRC and the F1 score on RE, for which higher scores are better. We also report the MR score on both tasks, for which lower scores are better. Our in-context intervention performs consistently better than baselines under all settings.
197
+ Figure 7: Ablation study of in-context intervention for GPT-3.5 on RE.
198
+
199
+ also report the memorization ratio (MR; Longpre et al. 2021) to measure the model's ability to update answers based on given contexts. $^{8}$
200
+
201
+ Baselines. We compare our in-context intervention with the methods introduced by Zhou et al. (2023). Base prompts directly concatenate the context and the question of each instance as the query. Attribute-based prompts append "in the given context" to the question. Opinion-based prompts modified the context to a narrator's statement by prepending "Bob said" to the context, and then query the LLM about the narrator's opinion by preponding "What's Bob's opinion on" to the question. We evaluate all methods with and without specifically designed task instructions following Zhou et al. (2023).
202
+
203
+ Implementation Details. We apply our in-context intervention to attribute-based prompts. We adopt the backbone LLM to propose two similar entities along with the original entity to define each placeholder. To further eliminate the spurious entity mapping, we shuffle the entities for each placeholder before verbalization. Details of all prompt templates used can be found in Appx. §A.2. Since
204
+
205
+ entities are not given in MRC, we detect named entities and replace them with placeholders using gpt-3.5-turbo as an external tool. Given the potential abundance of entities in long contexts, we do not replace entities that exclusively appear in the context.
206
+
207
+ # 5.2 Results
208
+
209
+ As shown in Fig. 6, all methods benefit from carefully designed task instructions in terms of task performance. The Opinion-based prompt performs the best among all baselines in most cases. Compared with the Base prompt, it significantly improves the EM score by 18.7-21.5 points on MRC and the F1 score by 0.6-4.7 points on RE. Our in-context intervention achieves the highest EM/F1 score and the lowest MR score under all settings. Specifically, without task instruction, our in-context intervention outperforms the best baseline by 20.5 EM points on MRC and reduces the MR score by 17.6 points on RE. These results demonstrate the effectiveness of our causal intervention for addressing entity-based knowledge conflicts in black-box LLMs.
210
+
211
+ # 5.3 Ablation Study
212
+
213
+ We in addition conduct an ablation study on RE to provide a comprehensive understanding of our method, as shown in Fig. 7. When the placeholder definition is not provided (i.e., w/o definition), no entity information, including both biasing and predictive information, appears in the input. As a result, it successfully blocks any spurious shortcuts with MR drops to 0. However, the F1 score also drops sharply from 71.8 points to 37.9 points, indicating that some entity information is essential to accurate RE and the LLM cannot understand the placeholders well without their definition.
214
+
215
+ We further examine the role of original entities in the placeholder definition. On the one hand, we remove the original entities from the definition (i.e., w/o original entity). Results show that our method can still improve F1 while reducing MR. This verifies the effectiveness of using a set of similar entities to represent the predictive information from the original entity. On the other hand, we put the original subject and object entities at the same position (i.e., w/o entity shuffle) in the definition so that the LLM can easily map them. As a result, the MR increases significantly, showing that the LLM can find spurious shortcuts even through mapping the subject entity and the object entity from two entity sets.
216
+
217
+ # 6 Conclusion
218
+
219
+ In this paper, we analyze the entity bias in LLMs from a causal view. Building upon an SCM whose parameters are easier to estimate, we propose training-time causal intervention for white-box LLMs and in-context causal intervention for black-box LLMs. Both intervention techniques perturb the original entity with neighboring entities to mitigate spurious correlations between specific entities and predictions. Experiments on relation extraction and machine reading comprehension show that the proposed intervention can effectively reduce the conflicts between parametric knowledge and contextual knowledge and significantly improve the performance of LLMs. Future work can apply our causal intervention to more LLMs and tasks to achieve context-faithful answers.
220
+
221
+ # Acknowledgement
222
+
223
+ We appreciate the reviewers for their insightful comments and suggestions. Fei Wang is supported by the Annenberg Fellowship and the Amazon ML Fellowship. Wenjie Mo is supported by the USC CURVE Fellowship and the Provost's Research Fellowship. Wenxuan Zhou and Muhao Chen are supported by the NSF Grant IIS 2105329, the NSF Grant ITE 2333736, the DARPA MCS program under Contract No. N660011924033 with the United States Office Of Naval Research. This work is also supported in part by a Cisco Research Award, two Amazon Research Awards, and a Keston Research Award. Computing of this work has been partly supported by a subaward of NSF Cloudbank 1925001 through UCSD.
224
+
225
+ # Limitation
226
+
227
+ Although we have tried to verify the effectiveness of our method under diverse settings, including different LLMs, different accessibility of model parameters, and different tasks, there are always more options for further investigation, especially nowadays when more and more LLMs are kept produced. Considering the property of the entity bias issue may vary when it comes to different LLMs and datasets from different domains, future work can build better benchmark for more comprehensive evaluation. In this paper, we only consider zero-shot prompting for black-box LLMs, because this will help us to control variables during causal analysis. However, it is possible to combine the proposed causal intervention with cutting-edge LLM inference methods, such as in-context learning (Brown et al., 2020), although the underlying SCM may become more complex.
228
+
229
+ # References
230
+
231
+ Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901.
232
+ Hung-Ting Chen, Michael Zhang, and Eunsol Choi. 2022. Rich knowledge sources bring complex knowledge conflicts: Recalibrating models to reflect conflicting evidence. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 2292-2307, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
233
+ Xinshuai Dong, Anh Tuan Luu, Rongrong Ji, and Hong Liu. 2021. Towards robustness against natural language word substitutions. In International Conference on Learning Representations.
234
+ Amir Feder, Katherine A Keith, Emaad Manzoor, Reid Pryzant, Dhanya Sridhar, Zach Wood-Doughty, Jacob Eisenstein, Justin Grimmer, Roi Reichart, Margaret E Roberts, et al. 2022. Causal inference in natural language processing: Estimation, prediction, interpretation and beyond. Transactions of the Association for Computational Linguistics, 10:1138-1158.
235
+ Matthew Finlayson, Aaron Mueller, Sebastian Gehrmann, Stuart Shieber, Tal Linzen, and Yonatan Belinkov. 2021. Causal analysis of syntactic agreement mechanisms in neural language models. arXiv preprint arXiv:2106.06087.
236
+ Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman,
237
+
238
+ and Phil Blunsom. 2015. Teaching machines to read and comprehend. Advances in neural information processing systems, 28.
239
+ Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. 2020. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423-438.
240
+ Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. 2020. Spanbert: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64-77.
241
+ Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. 2017. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1601-1611.
242
+ Jungo Kasai, Keisuke Sakaguchi, Yoichi Takahashi, Ronan Le Bras, Akari Asai, Xinyan Yu, Dragomir Radev, Noah A Smith, Yejin Choi, and Kentaro Inui. 2022. Realtime qa: What's the answer right now? arXiv preprint arXiv:2207.13332.
243
+ Katherine Keith, David Jensen, and Brendan O'Connor. 2020. Text and causal inference: A review of using text to remove confounding from causal estimates. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5332-5344.
244
+ Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. 2019. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453-466.
245
+ John P Lalor, Yi Yang, Kendall Smith, Nicole Forsgren, and Ahmed Abbasi. 2022. Benchmarking intersectional biases in nlp. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3598-3609.
246
+ Daliang Li, Ankit Singh Rawat, Manzil Zaheer, Xin Wang, Michal Lukasik, Andreas Veit, Felix Yu, and Sanjiv Kumar. 2022. Large language models with controllable working memory. arXiv preprint arXiv:2211.05110.
247
+ Stephanie Lin, Jacob Hilton, and Owain Evans. 2022. TruthfulQA: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3214-3252, Dublin, Ireland. Association for Computational Linguistics.
248
+ Adam Liska, Tomas Kocisky, Elena Gribovskaya, Tayfun Terzi, Eren Sezener, Devang Agrawal, D'Autume Cyprien De Masson, Tim Scholtes, Manzil Zaheer,
249
+
250
+ Susannah Young, et al. 2022. Streamingqa: A benchmark for adaptation to new knowledge over time in question answering models. In International Conference on Machine Learning, pages 13604-13622. PMLR.
251
+ Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692.
252
+ Shayne Longpre, Kartik Perisetla, Anthony Chen, Nikhil Ramesh, Chris DuBois, and Sameer Singh. 2021. Entity-based knowledge conflicts in question answering. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7052-7063.
253
+ Guoshun Nan, Jiaqi Zeng, Rui Qiao, Zhijiang Guo, and Wei Lu. 2021. Uncovering main causalities for long-tailed information extraction. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9683-9695.
254
+ Yulei Niu and Hanwang Zhang. 2021. Introspective distillation for robust question answering. Advances in Neural Information Processing Systems, 34:16292-16304.
255
+ Judea Pearl. 2012. The do-calculus revisited. In Proceedings of the Twenty-Eighth Conference on Uncertainty in Artificial Intelligence, pages 3-11.
256
+ Hao Peng, Tianyu Gao, Xu Han, Yankai Lin, Peng Li, Zhiyuan Liu, Maosong Sun, and Jie Zhou. 2020. Learning from context or names? an empirical study on neural relation extraction. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3661-3672.
257
+ Fabio Petroni, Tim Rocttäschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander Miller. 2019. Language models as knowledge bases? 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), pages 2463-2473, Hong Kong, China. Association for Computational Linguistics.
258
+ Chen Qian, Fuli Feng, Lijie Wen, Chunping Ma, and Pengjun Xie. 2021a. Counterfactual inference for text classification debiasing. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 5434-5445.
259
+ Kun Qian, Ahmad Beirami, Zhouhan Lin, Ankita De, Alborz Geramifard, Zhou Yu, and Chinnadhurai Sankar. 2021b. Annotation inconsistency and entity bias in MultiWOZ. In Proceedings of the 22nd Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 326-337, Singapore and Online. Association for Computational Linguistics.
260
+
261
+ Adam Roberts, Colin Raffel, and Noam Shazeer. 2020. How much knowledge can you pack into the parameters of a language model? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5418-5426, Online. Association for Computational Linguistics.
262
+ George Stoica, Emmanouil Antonios Platanios, and Barnabás Póczos. 2021. Re-tacred: Addressing shortcomings of the tacred dataset. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 13843-13850.
263
+ Chris Sweeney and Maryam Najafian. 2019. A transparent framework for evaluating unintended demographic bias in word embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1662-1667.
264
+ Bing Tian, Yixin Cao, Yong Zhang, and Chunxiao Xing. 2022. Debiasing nlu models via causal intervention and counterfactual reasoning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 11376-11384.
265
+ Can Udomcharoenchaikit, Wuttikorn Ponwitayarat, Patomporn Payoungkhamdee, Kanruethai Masuk, Weerayut Buaphet, Ekapol Chuangsuwanich, and Sarana Nutanong. 2022. Mitigating spurious correlation in natural language understanding with counterfactual inference. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 11308-11321.
266
+ Pranav Narayanan Venkit and Shomir Wilson. 2021. Identification of bias against people with disabilities in sentiment analysis and toxicity detection models. arXiv preprint arXiv:2111.13259.
267
+ Thomas Verma and Judea Pearl. 1990. Equivalence and synthesis of causal models. In Proceedings of the Sixth Annual Conference on Uncertainty in Artificial Intelligence, pages 255-270.
268
+ Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Simas Sakenis, Jason Huang, Yaron Singer, and Stuart Shieber. 2020. Causal mediation analysis for interpreting neural nlp: The case of gender bias. arXiv preprint arXiv:2004.12265.
269
+ Yiwei Wang, Muhao Chen, Wenxuan Zhou, Yujun Cai, Yuxuan Liang, Dayiheng Liu, Baosong Yang, Juncheng Liu, and Bryan Hooi. 2022. Should we rely on entity mentions for relation extraction? debi- aising relation extraction with counterfactual analysis. arXiv preprint arXiv:2205.03784.
270
+ Yiwei Wang, Bryan Hooi, Fei Wang, Yujun Cai, Yuxuan Liang, Wenxuan Zhou, Jing Tang, Manjuan Duan, and Muhao Chen. 2023. How fragile is relation extraction under entity replacements? In Proceedings of the 27th SIGNLL Conference on Computational Natural Language Learning (CoNLL).
271
+
272
+ Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. 2022. Finetuned language models are zero-shot learners. In International Conference on Learning Representations.
273
+ Galen Weld, Peter West, Maria Glenski, David Arbour, Ryan A Rossi, and Tim Althoff. 2022. Adjusting for confounders with text: Challenges and an empirical evaluation framework for causal inference. In Proceedings of the International AAAI Conference on Web and Social Media, volume 16, pages 1109-1120.
274
+ Nan Xu, Fei Wang, Bangzheng Li, Mingtao Dong, and Muhao Chen. 2022. Does your model classify entities reasonably? diagnosing and mitigating spurious correlations in entity typing. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing.
275
+ Jun Yan, Yang Xiao, Sagnik Mukherjee, Bill Yuchen Lin, Robin Jia, and Xiang Ren. 2022. On the robustness of reading comprehension models to entity renaming. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 508-520.
276
+ Dong Zhang, Hanwang Zhang, Jinhui Tang, Xian-Sheng Hua, and Qianru Sun. 2020a. Causal intervention for weakly-supervised semantic segmentation. Advances in Neural Information Processing Systems, 33:655-666.
277
+ Guanhua Zhang, Bing Bai, Junqi Zhang, Kun Bai, Conghui Zhu, and Tiejun Zhao. 2020b. Demographics should not be the reason of toxicity: Mitigating discrimination in text classifications with instance weighting. arXiv preprint arXiv:2004.14088.
278
+ Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D Manning. 2017. Position-aware attention and supervised data improve slot filling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 35-45.
279
+ Wenxuan Zhou and Muhao Chen. 2022. An improved baseline for sentence-level relation extraction. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing, pages 161-168.
280
+ Wenxuan Zhou, Sheng Zhang, Hoifung Poon, and Muhao Chen. 2023. Context-faithful prompting for large language models. In *Findings of the 2023 Conference on Empirical Methods in Natural Language Processing*.
281
+ Yongchun Zhu, Qiang Sheng, Juan Cao, Shuokai Li, Danding Wang, and Fuzhen Zhuang. 2022. Generalizing to the future: Mitigating entity bias in fake news detection. In Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2120-2125.
282
+
283
+ # A Implementation Details
284
+
285
+ # A.1 White-Box Experiments
286
+
287
+ For RE, we use RoBERTa-Large as our backbone model, which has 354 million parameters. Our implementation is based on the codebase by Zhou and Chen (2022) with their default hyper-parameters. More specifically, we employ a learning rate of 3e-5, a batch size of 32, and conduct training for a total of 5 epochs. Other method-specific hyperparameters are selected on the development set of TACRED. Finetuning typically takes 1.5 hours on an NVIDIA RTX A5000 GPU.
288
+
289
+ For MRC, we use SpanBERT-base-cased as our backbone model, which has 110 million parameters. Our implementation is based on the codebase by Yan et al. (2022) with their default hyperparameters. More specifically, we employ a learning rate of 2e-5, a batch size of 16, and conduct training for a total of 4 epochs. Other method-specific hyper-parameters are selected on the hold-out development set of TriviaQA. Finetuning typically takes 3 hours on an NVIDIA RTX A5000 GPU.
290
+
291
+ # A.2 Black-Box Experiments
292
+
293
+ Our implementation is based on the codebase by Zhou et al. (2023).
294
+
295
+ The instruction for MRC is
296
+
297
+ Instruction: read the given information and answer the corresponding question.
298
+
299
+ The prompt without instruction for MRC is
300
+
301
+ Assume that {ENTITY0} can be any of {entity0Candidates}. [Assume that {ENTITY1} can be any of {entity1Candidates} ...] {context}
302
+
303
+ Q:{question} based on the given text? Extract the answer from the given text. Do not add other words.
304
+
305
+ A:
306
+
307
+ The instruction for RE is
308
+
309
+ Identify the relationship between two entities from a list of options.
310
+
311
+ The prompt without instruction for RE is
312
+
313
+ Assume that subject_entity is one of {subjCandidates}, while object-entity is one of {objCandidates} in the following text. {context}
314
+
315
+ Q: Which option indicates the relationship between subject_entity and object-entity in the given text?
316
+
317
+ Options:{options}
318
+
319
+ A:
320
+
321
+ The prompt template for detecting entities in MRC is
322
+
323
+ List named entities in the following sentence. Separate the entities with $\# \# \# \#$ , if you find multiple entities. Do not add additional words before or after your answers..
324
+
325
+ {sentence}
326
+
327
+ The prompt template for replacing entities with placeholders in MRC is
328
+
329
+ Replace the entity {entity_list} in the following paragraph.
330
+ {paragraph}
331
+
332
+ The prompt template for finding similar entities is
333
+
334
+ Name two [{\entity_type}] entities similar to {" $\{entity\}''$ . Separate the entities with \#\#\#, and do not add additional words before or after your answers. Provide random answers if you are not sure.
335
+
336
+ In all the above prompts, variables are surrounded with curly brackets and optional variables are surrounded with square brackets.
2023/A Causal View of Entity Bias in (Large) Language Models/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64ecad02ce6744cebabe842156c4f930b44b585ec8c8d8dfe667f8bcd9559e58
3
+ size 301551
2023/A Causal View of Entity Bias in (Large) Language Models/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Closer Look into Using Large Language Models for Automatic Evaluation/dbe97091-acd7-407e-a8d4-8552f4605855_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Closer Look into Using Large Language Models for Automatic Evaluation/dbe97091-acd7-407e-a8d4-8552f4605855_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Closer Look into Using Large Language Models for Automatic Evaluation/dbe97091-acd7-407e-a8d4-8552f4605855_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bdf2e799ca2e9c75ee6a5260e546f0fd1a9ec7ce73329eda52218c396f55a67a
3
+ size 337128
2023/A Closer Look into Using Large Language Models for Automatic Evaluation/full.md ADDED
@@ -0,0 +1,564 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Closer Look into Automatic Evaluation Using Large Language Models
2
+
3
+ Cheng-Han Chiang
4
+
5
+ National Taiwan University,
6
+
7
+ Taiwan
8
+
9
+ dcml0714@gmail.com
10
+
11
+ Hung-yi Lee
12
+
13
+ National Taiwan University,
14
+
15
+ Taiwan
16
+
17
+ hungyilee@ntu.edu.tw
18
+
19
+ # Abstract
20
+
21
+ Using large language models (LLMs) to evaluate text quality has recently gained popularity. Some prior works explore the idea of using LLMs for evaluation, while they differ in some details of the evaluation process. In this paper, we analyze LLM evaluation (Chiang and Lee, 2023)<sup>1</sup> and G-Eval (Liu et al., 2023), and we discuss how those details in the evaluation process change how well the ratings given by LLMs correlate with human ratings. We find that the auto Chain-of-Thought (CoT) used in G-Eval does not always make G-Eval more aligned with human ratings. We also show that forcing the LLM to output only a numeric rating, as in G-Eval, is suboptimal. Last, we reveal that asking the LLM to explain its own ratings consistently improves the correlation between the ChatGPT and human ratings and pushes state-of-the-art (SoTA) correlations on two meta-evaluation datasets.
22
+
23
+ # 1 Introduction
24
+
25
+ Large language models (LLMs) trained with task instructions and human feedback can follow natural language instructions to complete a task (Askell et al., 2021; Sanh et al., 2022; Wei et al., 2022a; Ouyang et al., 2022). Recently, the instruction-following ability of LLMs makes them promising candidates for automatic evaluation (Chiang and Lee, 2023; Liu et al., 2023; Wang et al., 2023; Huang et al., 2023). By simply instructing the LLMs on how to rate and giving the LLMs the sample to be rated, the LLM can follow the instructions and provide a rating of the sample.
26
+
27
+ Chiang and Lee (2023) propose LLM evaluation and Liu et al. (2023) propose $G$ -Eval; both of which use LLMs to evaluate samples by giving the LLM instructions, and they both show that some LLMs can yield evaluation results that are aligned to the
28
+
29
+ evaluation results of humans. Still, LLM evaluation and G-Eval differ in some specific design choices in the evaluation procedure. Since Chiang and Lee (2023) and Liu et al. (2023) use distinct tasks, it is hard to know how the differences between LLM evaluation and G-Eval affect the evaluation results. This makes practitioners in the future hard to determine how to conduct an automatic evaluation using LLMs.
30
+
31
+ Given that LLM evaluation and G-Eval have already received significant attention shortly after publication, these methods will likely revolutionize the evaluation in NLP. Therefore, conducting a detailed analysis of these approaches is essential and timely. This paper aims to identify the crucial components in LLM evaluation and G-Eval that contribute to stronger correlations with human ratings. Based on our analysis, we provide guidelines on how to use LLMs for automatic evaluations. We have the following findings:
32
+
33
+ - Auto-CoT (proposed by G-Eval) does not always improve the correlation between LLM and human ratings.
34
+ - Making the LLMs output only a single numeric rating is suboptimal.
35
+ - Asking the LLMs to rationalize their own ratings significantly improves the correlation between the LLMs' ratings and human ratings.
36
+ - On two datasets, we improve the best correlation that ChatGPT's rating can achieve, and some correlations even exceed prior SoTA correlations obtained using the ratings of GPT-4 in Liu et al. (2023).
37
+
38
+ # 2 Experiment Setup
39
+
40
+ Our paper studies what components in LLM evaluation and G-Eval make the ratings generated by LLM correlate with human ratings better, and we aim to improve the correlation.
41
+
42
+ # 2.1 LLM as an Automatic Evaluation Metric
43
+
44
+ Both LLM evaluation (Chiang and Lee, 2023) and G-Eval (Liu et al., 2023) propose to ask LLMs to rate a sample regarding some attributes of the sample (e.g., fluency, grammaticality) using a $k$ -point Likert scale. They give the LLMs (1) descriptions of the rating task, (2) the definition and rating criteria of the attribute to be rated, (3) the sample to be rated, and (4) a sentence that prompts the LLM to give the rating<sup>2</sup>. The LLM outputs a sequence containing the rating. Unless specified, we follow prior works to sample $N = 20$ sequences from the LLM and average those ratings as the final rating. While the two methods share the core concept, they differ in two details.
45
+
46
+ Difference 1: Auto Chain-of-Thought The task descriptions and rating criteria in LLM evaluation and G-Eval are all human-written. However, Liu et al. (2023) argue that some evaluated attributes require more than simple definition and evaluation criteria, so they use LLMs to determine the evaluation steps. Specifically, they concatenate the task description, definition, and criteria of the attributes and append a line "Evaluation steps:" to prompt the LLM. The LLM then generates an ordered list containing the step-by-step evaluation steps. They dub this process auto chain-of-thought $(CoT)$ . G-Eval uses human-written task instructions and auto-CoT-generated evaluation steps to prompt the LLM to rate the sample.
47
+
48
+ Difference 2: Prompts for Output At the end of the input to LLMs, G-Eval uses the prompt {"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{ score~only}:" to restrict the LLM to output only the numeric rating; the placeholder will be replaced by the evaluated attributes. In contrast, LLM evaluation uses the following question to ask the LLM to assign the rating: "How {"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{ is the sample? (on a scale of 1-k, with 1 being the lowest)". The LLM's output form is not restricted.
49
+
50
+ # 2.2 Meta-Evaluating an Evaluation Metric
51
+
52
+ Given a sample, an evaluation metric assigns it a rating. To evaluate an evaluation metric, we need a dataset containing human ratings for samples in the dataset. We calculate the correlation coefficient between the ratings obtained by the evaluation metric and the human ratings. A higher correlation
53
+
54
+ indicates the evaluation metric better aligns with human ratings. We adopt Pearson $r$ and Kendall's $\tau$ as they are widely used in meta-evaluations (Graham et al., 2015; Bojar et al., 2017; Zhang* et al., 2020). In our paper, all the correlation refers to the correlation coefficient between the ratings of LLM and human ratings. Details on the calculation of correlation coefficients are in Appendix C.
55
+
56
+ We use SummEval (Fabbri et al., 2021) and Topical-Chat (Gopalakrishnan et al., 2019; Mehri and Eskenazi, 2020) as the meta-evaluation datasets, following Liu et al. (2023). SummEval is a meta-evaluation dataset for summarization derived from the CNN/DailyMail dataset (Hermann et al., 2015). Each summary in SummEval is rated by humans based on the coherence, consistency, fluency of the summary, and relevance between the summary and the source document. Topical-Chat is a dataset that evaluates the quality of a response given the dialogue history and a piece of knowledge relating to the dialogue. We follow Zhong et al. (2022) to evaluate the naturalness, coherence, engagingness, and groundedness (whether the response is grounded on the provided knowledge) of the response. The dataset details are in Appendix E.
57
+
58
+ # 2.3 Large Language Models
59
+
60
+ An LLM used as an evaluation metric should be affordable and accessible to whoever wants to use it. Based on this principle, we use ChatGPT (gpt3.5-turbo-0613) (OpenAI, 2022) for evaluation since it has lower cost and improved performance compared with other GPT-3.5 models. ChatGPT is also used in LLM evaluation and G-Eval. While Liu et al. (2023) further use GPT-4 (OpenAI, 2023) in their experiments, we cannot use GPT-4 in our experiments since most people, including us, have limited or no access to GPT-4, making it utterly unsuitable as an evaluation metric.
61
+
62
+ In our preliminary experiments, we also try to use the best open LLM (at the time of writing this manuscript) on Open LLM leaderboard, the falcon-40b-instruct model (Almazrouei et al., 2023), but we find it cannot follow the instructions and rate the samples very well. Hence, we exclude open LLMs in our paper.
63
+
64
+ # 3 Better Usage of LLM for Evaluation
65
+
66
+ # 3.1 Is Auto CoT Always Useful?
67
+
68
+ Liu et al. (2023) shows that adding the evaluation steps generated by auto CoT improves the correla-
69
+
70
+ <table><tr><td rowspan="2">Sec.</td><td colspan="2">Ablations</td><td colspan="2">Coherence</td><td colspan="2">Consistency</td><td colspan="2">Fluency</td><td colspan="2">Relevance</td></tr><tr><td>CoT</td><td>Output</td><td>r</td><td>τ</td><td>r</td><td>τ</td><td>r</td><td>τ</td><td>r</td><td>τ</td></tr><tr><td>GPT-4†</td><td>?‡</td><td>Score only</td><td>0.581</td><td>0.463</td><td>0.575</td><td>0.419</td><td>0.6</td><td>0.457</td><td>0.599</td><td>0.409</td></tr><tr><td rowspan="2">3.1</td><td>✓</td><td rowspan="2">Score only</td><td>0.45</td><td>0.359</td><td>0.37</td><td>0.286</td><td>0.319</td><td>0.203</td><td>0.403</td><td>0.327</td></tr><tr><td>X</td><td>0.344</td><td>0.248</td><td>0.328</td><td>0.185</td><td>0.361</td><td>0.177</td><td>0.353</td><td>0.248</td></tr><tr><td rowspan="4">3.2</td><td>X</td><td>Score only</td><td>0.344</td><td>0.248</td><td>0.328</td><td>0.185</td><td>0.361</td><td>0.177</td><td>0.353</td><td>0.248</td></tr><tr><td>X</td><td>Free Text</td><td>0.46</td><td>0.342</td><td>0.476</td><td>0.334</td><td>0.477</td><td>0.273</td><td>0.324</td><td>0.228</td></tr><tr><td>X</td><td>Rate-explain</td><td>0.557</td><td>0.44</td><td>0.473</td><td>0.337</td><td>0.451</td><td>0.306</td><td>0.509</td><td>0.348</td></tr><tr><td>X</td><td>Analyze-rate</td><td>0.635</td><td>0.476</td><td>0.537</td><td>0.34</td><td>0.479</td><td>0.302</td><td>0.444</td><td>0.305</td></tr></table>
71
+
72
+ Table 1: The Pearson's $r$ and Kendall's $\tau$ correlation coefficient between LLMs' ratings and human ratings for SummEval. All the results in this table, except the first row, are from ChatGPT. We consider auto CoT + score only using ChatGPT proposed in G-Eval as the baseline of this paper. We boldface the Pearson's $r$ statistically significantly higher than the baseline (except GPT-4). †: results from Liu et al. (2023). Some numbers are different because we re-calculate the correlations based on the GPT-4 responses Liu et al. (2023) released. ‡: The results of GPT-4 cannot serve as a reasonable comparison since we find something odd in the prompts Liu et al. (2023) use, which we elaborate in Appendix A.
73
+
74
+ tion on SummEval when using GPT-4 for evaluation. By scrutinizing their results, we find that the correlations when using auto CoT and not using it often differ by less than 0.02. This raises two questions: (1) Is this difference statistically significant? (2) Does auto CoT yield higher correlations for different LLMs and datasets? To answer these questions, we use ChatGPT to rate the samples in SummEval and Topical-Chat using two sets of prompts, one with the evaluation steps generated using auto CoT and one without those evaluation steps. In this experiment, we follow G-Eval and restrict ChatGPT to output only a numeric score. Following Graham and Baldwin (2014), we use William's test for significance to see if the Pearson's $r$ of using and not using auto CoT is statistically significantly different. We try to follow the prompts used in G-Eval when possible; still, we have to construct some prompts since Liu et al. (2023) only release part of the prompts and some of which are problematic. We list all the prompts and how they are obtained in Appendix F.
75
+
76
+ The experiment results for SummEval are shown in the block in blue in Table 1. We also list the best results of G-Eval using GPT-4 from Liu et al. (2023) in the first row of Table 1 only for reference. Comparing our results with GPT-4 is unfair since we use ChatGPT, which is weaker than GPT-4. A more reasonable baseline for our paper is the "auto CoT + score only" using ChatGPT on the second row, which is the method proposed by G-Eval and shows the highest correlation that ChatGPT can achieve in Liu et al. (2023). The numbers here differ from results in Liu et al. (2023) because
77
+
78
+ we carefully reproduce their results ourselves.
79
+
80
+ Back to Table 1, we can see that auto CoT leads to higher correlations for coherence, consistency, and relevance. By William's test, these higher correlations reach statistical significance with $p$ -values less than 0.05. However, using auto CoT results in a lower Pearson's $r$ for fluency, and this inferiority in Pearson's $r$ is also statistically significant.
81
+
82
+ The results for Topical-Chat are illustrated in Table 2. For Topical-Chat, the Pearson's $r$ of using and not using auto CoT are very close for all four attributes except groundedness, with differences less than 0.025, and these differences are not statistically significant. For groundedness, auto CoT even drastically decreases the correlation. In summary, using auto CoT does not yield consistent and meaningful improvements compared with not using CoT. This should not be surprising since the evaluation steps generated with auto CoT often merely paraphrases the evaluation criterion and instructions given to the LLM.
83
+
84
+ # 3.2 Prompt for Outputs
85
+
86
+ In this section, we explore if the difference in how ChatGPT is prompted to output makes it's ratings better aligned with human ratings. We use two sets of prompts that share the same task descriptions and evaluation criteria but differ in how they prompt the LLM to generate the output. One uses "score only", as in G-Eval. The other replaces the "score only" with "How {{placeholder}}" is the sample? (on a scale of 1-k, with 1 being the lowest), as in LLM evaluation. We call the latter prompts free text since they do not
87
+
88
+ <table><tr><td rowspan="2">Sec.</td><td colspan="2">Ablations</td><td colspan="2">Naturalness</td><td colspan="2">Coherence</td><td colspan="2">Engagingness</td><td colspan="2">Groundedness</td></tr><tr><td>CoT</td><td>Output</td><td>r</td><td>τ</td><td>r</td><td>τ</td><td>r</td><td>τ</td><td>r</td><td>τ</td></tr><tr><td rowspan="2">3.1</td><td>✓</td><td rowspan="2">Score only</td><td>0.393</td><td>0.358</td><td>0.468</td><td>0.391</td><td>0.549</td><td>0.513</td><td>0.311</td><td>0.566</td></tr><tr><td>X</td><td>0.408</td><td>0.331</td><td>0.443</td><td>0.404</td><td>0.557</td><td>0.535</td><td>0.358</td><td>0.582</td></tr><tr><td rowspan="4">3.2</td><td>X</td><td>Score only</td><td>0.408</td><td>0.331</td><td>0.443</td><td>0.404</td><td>0.557</td><td>0.535</td><td>0.358</td><td>0.582</td></tr><tr><td>X</td><td>Free Text</td><td>0.464</td><td>0.476</td><td>0.524</td><td>0.426</td><td>0.611</td><td>0.557</td><td>0.563</td><td>0.666</td></tr><tr><td>X</td><td>Rate-explain</td><td>0.524</td><td>0.47</td><td>0.477</td><td>0.416</td><td>0.567</td><td>0.524</td><td>0.58</td><td>0.693</td></tr><tr><td>X</td><td>Analyze-rate</td><td>0.573</td><td>0.47</td><td>0.486</td><td>0.416</td><td>0.628</td><td>0.524</td><td>0.725</td><td>0.693</td></tr></table>
89
+
90
+ Table 2: The Pearson's $r$ and Kendall's $\tau$ correlation coefficient between LLMs' ratings and human ratings for Topical-Chat. All the results in this table, except the first row, are from ChatGPT. We **boldface** the Pearson's $r$ statistically significantly higher than auto CoT + score only. We **underline** the Pearson's $r$ comparable auto CoT + score only.
91
+
92
+ restrict the output form.
93
+
94
+ The results for SummEval are shown in the yellow blocks in Table 1, and the results for TopicalChat are shown in Table 2. We find that allowing ChatGPT to respond to the question freely yields Pearson's $r$ and Kendall's $\tau$ much higher than restricting the model to output a single numeric score for almost all attributes of both datasets. The higher Pearson's $r$ of free text compared with score only is statistically significant. The only exception is the relevance of SummEval, where free text yields slightly lower correlations.
95
+
96
+ Initially, we thought ChatGPT aligns better with human ratings in free text because it can generate natural language explanations to justify their rating, making the ratings more correlated with human ratings. However, we observe that the responses of ChatGPT when prompted with free text mostly contain a single numeric rating, which is the same behavior when it is instructed by score only. This means that what the model is allowed to generate is more important than what it really generates.
97
+
98
+ The above observations make us curious if the correlations can be higher if ChatGPT is instructed to justify its ratings. Inspired by chain-of-thought in Wei et al. (2022b) and Kojima et al. (2022) (not the auto CoT in G-Eval), we ask ChatGPT to provide their reasoning and rationales on the ratings. Instead of asking ChatGPT to output only a score, we construct two types of prompts that ask ChatGPT to rationalize its decision. The first type of prompt, called analyze-rate, asks ChatGPT to analyze the samples regarding the evaluated criteria first and give the rating. The second type of prompt, called rate-explain, asks ChatGPT to provide the numeric ratings first and explain why it gives such a rating. analyze-rate is more like the zero-shot
99
+
100
+ chain-of-thought (Kojima et al., 2022). Refer to Appendix F.1.1 for the exact prompts we use.
101
+
102
+ The results of asking ChatGPT to explain/analyze how they rate the sample are shown in the last two rows in Table 1 and Appendix Table 2. We find that for all attributes of both datasets, rate-explain and anlyze-rate both lead to correlations stronger than or at least comparable to the correlation of asking ChatGPT to output only a numeric rating (score only). By asking ChatGPT to explain/analyze, we improve the best correlations that can be achieved by ChatGPT in Liu et al. (2023) (the Auto-CoT + score only). Moreover, when asked to explain/analyze when rating, ChatGPT's correlation can be better than or comparable to the state-of-the-art correlation coefficients obtained from GPT-4 in Liu et al. (2023) for coherence of SummEval and three attributes of Topical-Chat. We hypothesize that some attributes (e.g., coherence for SummEval) are harder for ChatGPT to rate, so the correlations for these attributes show a larger improvement when ChatGPT explains how it rates the sample.
103
+
104
+ In rate-explain, the output of ChatGPT contains a numeric rating followed by some explanations. As an auto-regressive language model, ChatGPT cannot depend on the explanation when generating the rating due to causal attention. If we stop the generation after ChatGPT generates the ratings, the output of rate-explain will only contain the ratings, just like the output forms in score only. Although the ratings in rate-explain do not depend on ChatGPT's rationales for the ratings, the ratings still correlate better with human ratings, compared with the ratings in score only. We think this is because when ChatGPT knows it needs to explain the ratings, it tends to generate ratings that are easier for it to explain, and a rating that is more
105
+
106
+ aligned to humans' rating is easier for ChatGPT to explain.
107
+
108
+ # 3.3 Empirical Guidelines
109
+
110
+ Based on the analysis and results in this section, we provide the following guideline: Always ask ChatGPT to explain/analyze when rating. We do not see rate-explain to be significantly better (or worse) than analyze-rate, so it is hard to determine which one to use. A valid method is sampling some ratings using rate-explain and sampling some ratings using analyze-rate and averaging the ratings from the two prompts as the final rating. Using auto CoT is optional since it does not always lead to higher correlations with human ratings. We also find that using auto CoT does not always improve the correlations when ChatGPT is asked to explain; this result is shown in Appendix Table 3.
111
+
112
+ # 3.4 Robustness of the Guidelines
113
+
114
+ LLMs are notorious for their performance fluctuation due to the input prompts, and the sequence generated by LLMs can be different when changing the hyperparameters used in decoding. To verify the validity of our empirical guidelines, we conduct the following two sets of experiments: (1) we vary the temperature used in sampling the output from ChatGPT, and (2) we vary the prompt given to ChatGPT.
115
+
116
+ # 3.4.1 Varying the Temperature
117
+
118
+ We check if our guideline holds if we change the temperature $T$ during generation. We compare Pearson's $r$ when using the method proposed in G-Eval (Auto-CoT + score only) with rate-explain and analyze-rate under different temperatures used when generating the output from ChatGPT. We follow Chiang and Lee (2023) and use two temperatures: 0.7 and 0.3.
119
+
120
+ The results are shown in Appendix Table 5 and summarized as follows: First, when fixing the sampling temperature, we find that rate-explain and analyze-rate always achieve a higher correlation compared with G-Eval. This supports our guideline that "asking the LLM to explain/analyze outperforms the method proposed in G-Eval." Next, we observe that the correlation of G-Eval when $T = 0.3$ is much lower than that of $T = 1.0$ . This shows that G-Eval is not robust to sampling temperature. Contrarily, we find that the correlations obtained by rate-explain and analyze-rate do not significantly change for different sampling
121
+
122
+ temperatures for almost all cases. This shows that rate-explain and analyze-rate are more robust than G-Eval with respect to the sampling temperature.
123
+
124
+ # 3.4.2 Changing the Prompts
125
+
126
+ We check if our guideline holds if we change the prompt given to ChatGPT. In this experiment, we changed the prompts to ChatGPT by appending some instructions before the descriptions of the rating task. We tried with two prompts: (1) the HHH prompts and (2) the human annotator prompts. The HHH prompt is designed by Bai et al. (2022) to align the output of LLMs to be more harmless, honest, and helpful. The human annotator prompt is inspired by Chiang and Lee (2023), who use a similar prompt to make the LLM behave as a human annotator. These two prompts will be inserted before the prompt we originally used in our paper. We use these two prompts to inject persona into the LLM. This is inspired by Zeng et al. (2023), which shows that the output of GPT3 can be different when prompted with a different persona. The prompts are detailed in Appendix F.3.
127
+
128
+ The results are shown in Table 6 and summarized as follows: rate-explain and analyze-rate consistently outperform the G-eval when using the human annotator prompts and the HHH prompts. This indicates that our guidelines are robust toward different prompts. We also find that the correlations of G-Eval significantly drop when adding the human-annotator prompts or HHH prompts. On the other hand, the correlation for rate-explain and analyze-rate do not significantly decrease when adding the human-annotator prompt and the HHH prompt. This shows that asking the LLM to explain is more robust to the variation of the prompts.
129
+
130
+ # 4 Conclusion
131
+
132
+ We study how to better use ChatGPT as an automatic evaluation tool by scrutinizing LLM evaluation and G-Eval. We provide concrete guidelines and show that by using those guidelines, the correlations of several evaluated attributes given by ChatGPT, a publicly usable model, can be higher than or comparable to the ratings given by GPT-4, a highly restricted and pricey model. We also show that the evaluation results based on our guidelines improve the best correlation that ChatGPT's rating can achieve. We believe our results and guidelines help future researchers better use LLMs for evaluation.
133
+
134
+ # Limitations
135
+
136
+ There are three main limitations of this paper.
137
+
138
+ 1. We only use ChatGPT to conduct the experiments in this paper. We explain why we chose ChatGPT in Section 2.3. We believe that using ChatGPT is already enough since we show that the correlations obtained by using ChatGPT are already comparable to or better than the previous SoTA results obtained by GPT-4.
139
+ 2. We only conduct analysis using two tasks, while we know that NLP has more diverse tasks. We do not guarantee that our observations can generalize to all the other datasets. We recommend the users verify the effectiveness of using LLM to evaluate the tasks of interest.
140
+ 3. We cannot fairly compare our results with Liu et al. (2023), the previous SoTA results, due to multiple reasons. We explain those reasons in Appendix A.
141
+
142
+ # Ethics Statement
143
+
144
+ Our paper follows the ACL Code of Ethics. We do not see a particular harmful outcome of our paper. The code and datasets for reproducing our experiments can be found at https://github.com/d223302/A-Closer-Look-To-LLM-Evaluation/.
145
+
146
+ # Acknowledgements
147
+
148
+ We want to thank the reviews for providing detailed feedback and actionable suggestions, which helped us strengthen our paper. We also want to thank the senior committee members for monitoring the reviewing process. Cheng-Han Chiang is supported by a Ph.D. scholarship program by Delta Electronics.
149
+
150
+ # References
151
+
152
+ Ebtesam Almazrouei, Hamza Alobeidli, Abdulaziz Alshamsi, Alessandro Cappelli, Ruxandra Cojocaru, Merouane Debbah, Etienne Goffinet, Daniel Heslow, Julien Launay, Quentin Malartic, Badreddine Noune, Baptiste Pannier, and Guilherme Penedo. 2023. Falcon-40B: an open large language model with state-of-the-art performance.
153
+ Amanda Askell, Yuntao Bai, Anna Chen, Dawn Drain, Deep Ganguli, Tom Henighan, Andy Jones, Nicholas Joseph, Ben Mann, Nova DasSarma, et al. 2021. A
154
+
155
+ general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861.
156
+ 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. 2022. Training a helpful and harmless assistant with reinforcement learning from human feedback.
157
+ Ondrej Bojar, Yvette Graham, and Amir Kamran. 2017. Results of the WMT17 metrics shared task. In Proceedings of the Second Conference on Machine Translation, pages 489-513, Copenhagen, Denmark. Association for Computational Linguistics.
158
+ Cheng-Han Chiang and Hung-yi Lee. 2023. Can large language models be an alternative to human evaluations? In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 15607-15631, Toronto, Canada. Association for Computational Linguistics.
159
+ Alexander R Fabbri, Wojciech Kryscinski, Bryan McCann, Caiming Xiong, Richard Socher, and Dragomir Radev. 2021. Summeval: Re-evaluating summarization evaluation. Transactions of the Association for Computational Linguistics, 9:391-409.
160
+ Karthik Gopalakrishnan, Behnam Hedayatnia, Qinlang Chen, Anna Gottardi, Sanjeev Kwatra, Anushree Venkatesh, Raefer Gabriel, and Dilek Hakkani-Tur. 2019. Topical-chat: Towards knowledge-grounded open-domain conversations.
161
+ Yvette Graham and Timothy Baldwin. 2014. Testing for significance of increased correlation with human judgment. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 172-176, Doha, Qatar. Association for Computational Linguistics.
162
+ Yvette Graham, Timothy Baldwin, and Nitika Mathur. 2015. Accurate evaluation of segment-level machine translation metrics. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1183-1191, Denver, Colorado. Association for Computational Linguistics.
163
+ Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. 2015. Teaching machines to read and comprehend. Advances in neural information processing systems, 28.
164
+ Fan Huang, Haewoon Kwak, and Jisun An. 2023. Is chatgpt better than human annotators? potential and limitations of chatgpt in explaining implicit hate speech. arXiv preprint arXiv:2302.07736.
165
+
166
+ Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. 2022. Large language models are zero-shot reasoners. In Advances in Neural Information Processing Systems.
167
+ Yang Liu, Dan Iter, Yichong Xu, Shuohang Wang, Ruochen Xu, and Chenguang Zhu. 2023. Gpteval: Nlg evaluation using gpt-4 with better human alignment. arXiv preprint arXiv:2303.16634.
168
+ Matouš Macháček and Ondřej Bojar. 2014. Results of the WMT14 metrics shared task. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pages 293-301, Baltimore, Maryland, USA. Association for Computational Linguistics.
169
+ Shikib Mehri and Maxine Eskenazi. 2020. Usr: An unsupervised and reference free evaluation metric for dialog generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 681-707.
170
+ OpenAI. 2022. Chatgpt: Optimizing language models for dialogue. Accessed on January 10, 2023.
171
+ OpenAI. 2023. Gpt-4 technical report.
172
+ Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730-27744.
173
+ Victor Sanh, Albert Webson, Colin Raffel, Stephen Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Arun Raja, Manan Dey, M Saiful Bari, Canwen Xu, Urmish Thakker, Shanya Sharma Sharma, Eliza Szczechla, Taewoon Kim, Gunjan Chhablani, Nihal Nayak, Debajyoti Datta, Jonathan Chang, Mike Tian-Jian Jiang, Han Wang, Matteo Manica, Sheng Shen, Zheng Xin Yong, Harshit Pandey, Rachel Bawden, Thomas Wang, Trishala Neeraj, Jos Rozen, Abheesht Sharma, Andrea Santilli, Thibault Fevry, Jason Alan Fries, Ryan Teehan, Teven Le Scao, Stella Biderman, Leo Gao, Thomas Wolf, and Alexander M Rush. 2022. Multitask prompted training enables zero-shot task generalization. In International Conference on Learning Representations.
174
+ Jiaan Wang, Yunlong Liang, Fandong Meng, Haoxiang Shi, Zhixu Li, Jinan Xu, Jianfeng Qu, and Jie Zhou. 2023. Is chatgpt a good nlg evaluator? a preliminary study. arXiv preprint arXiv:2303.04048.
175
+ Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M. Dai, and Quoc V Le. 2022a. Finetuned language models are zero-shot learners. In International Conference on Learning Representations.
176
+ Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, brian richter, Fei Xia, Ed H. Chi, Quoc V Le, and Denny Zhou. 2022b. Chain of thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems.
177
+
178
+ Andy Zeng, Maria Attarian, brian richter, Krzysztof Marcin Choromanski, Adrian Wong, Stefan Welker, Federico Tombari, Aveek Purohit, Michael S Ryoo, Vikas Sindhwani, Johnny Lee, Vincent Vanhoucke, and Pete Florence. 2023. Socratic models: Composing zero-shot multimodal reasoning with language. In The Eleventh International Conference on Learning Representations.
179
+ Tianyi Zhang*, Varsha Kishore*, Felix Wu*, Kilian Q. Weinberger, and Yoav Artzi. 2020. *Bertscore: Evaluating text generation with bert*. In International Conference on Learning Representations.
180
+ Ming Zhong, Yang Liu, Da Yin, Yuning Mao, Yizhu Jiao, Pengfei Liu, Chenguang Zhu, Heng Ji, and Jiawei Han. 2022. Towards a unified multidimensional evaluator for text generation. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 2023-2038, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
181
+
182
+ # A Why We Cannot Fairly Compare with the Results in Liu et al. (2023)
183
+
184
+ As a work highly related to G-Eval, we would really like to compare our results with G-Eval. However, we encounter difficulties when comparing our results with those in Liu et al. (2023) for the following reasons.
185
+
186
+ - G-Eval proposes to use GPT-4 as the evaluation tool, while it is currently a highly restricted model, and we only have limited access to it.
187
+ - G-Eval only releases the prompts for SummEval. We need to construct the prompts for Topical-Chat based on the human evaluation instructions released by Mehri and Eskenazi (2020). It is possible that the prompts we use for Topical-Chat are different from the prompts used in Liu et al. (2023), making their results incomparable to ours.
188
+ - The prompts of fluency in SummEval released by Liu et al. (2023) in here is problematic so we need to construct new prompts for fluency. Refer to Appendix F.1 for detailed explanations. This makes us unable to directly compare our results with the results in Liu et al. (2023).
189
+ - We cannot reproduce the numbers on the paper of G-Eval even when using their official implementation and the GPT-4 responses they release. This means that the only thing we
190
+
191
+ do is calculate the correlation coefficient using the data and code released on the official GitHub of G-Eval, but the numbers are quite different from the results in G-Eval's paper. Moreover, the results of fluency they provide is the result not using auto CoT, but the results of the other three attributes for SummEval use auto CoT. That is why we use a question mark for the auto CoT field in Table 1.
192
+
193
+ - The Table 2 in Liu et al. (2023) seems to be wrong. The caption (Spearman's $\rho$ and Kendall's $\tau$ ) does not match the headers ( $r$ and $\rho$ ). This makes us hard to compare their results with ours reliably.
194
+
195
+ # B Supplementary Results for Topical-Chat
196
+
197
+ Table 2 is the supplementary results for Topical-Chat that we referred to in the main content. We plan to move Table 2 to the main content using the additional one page in the camera-ready version if the paper is accepted. See how Pearson's $r$ and Kendall's $\tau$ are calculated in Appendix C.
198
+
199
+ # B.1 Is Auto CoT Useful When ChatGPT Is Asked to Explain?
200
+
201
+ In Table 3, we show the results when we add the evaluation steps generated by auto CoT when we ask ChatGPT when prompting with (rate-explain). We find that on groundedness, using auto CoT is worse. However, for the other three attributes, using auto CoT is better. This again shows that auto CoT is not particularly useful.
202
+
203
+ # C Calculation of Correlation Coefficient
204
+
205
+ In this paper, we calculate Pearson's $r$ and Kendall's $\tau$ between human ratings and ChatGPT's ratings. Whether to use Spearman's rank correlation or Pearson's (linear) correlation to evaluate the alignment between human ratings and an automatic evaluation metric is long-standing, but there has been an increasing trend towards Pearson's correlation since 2014 (Macháček and Bojar, 2014; Graham and Baldwin, 2014; Zhang* et al., 2020). We use the pearsonr and Kendall tau in scipy.stats for calculating the correlation coefficients. For each attribute of each sample, the rating of ChatGPT is obtained by 20 samples; we set the decoding temperature to 1 and the top- $p$ in nucleus sampling to 1, following G-Eval (Liu et al., 2023).
206
+
207
+ Consider a dataset with $N$ source documents, and each source document has $M$ corresponding target documents. We also have the human ratings for $N \cdot M$ target documents on a specific attribute. While each attribute of each target document is rated by more than one human rater, we average those ratings when calculating the correlation coefficient. So the $N \cdot M$ ratings are the average ratings from different raters. In the case of SummEval, we have $N = 100$ source documents and $M = 16$ summaries generated by 16 summarization models. There are two different methods for calculating correlation coefficients.
208
+
209
+ # C.0.1 Method 1: Dataset-Level Correlation Coefficient
210
+
211
+ In this method, we first obtain the ratings on $N \cdot M$ target documents from ChatGPT. We then calculate the correlation coefficient between the $N \cdot M$ ChatGPT's ratings and the $N \cdot M$ average human ratings. In this case, the correlation coefficient is calculated among two $N \cdot M$ vectors, meaning that the correlation coefficient is calculated across the entire dataset.
212
+
213
+ # C.0.2 Method 2: Document-Level Correlation Coefficient
214
+
215
+ In this method, for each source document, we obtain the ratings of its $M$ target documents using ChatGPT. Next, we calculate the correlation coefficient between these $M$ ChatGPT ratings and the corresponding $M$ human ratings. After iterating the above process over all the $N$ source documents, we obtain the $N$ correlation coefficients. We average the $N$ correlation coefficients as the final correlation coefficient. In this case, the correlation coefficient is calculated at the document-level and averaged over the whole dataset.
216
+
217
+ # C.1 How We Calculate the Correlation Coefficient
218
+
219
+ In Table 1 and 2 in this paper, we use Method 1 (Subsection C.0.1) to calculate Pearson's correlation, following the recommendation in Graham et al. (2015). Calculating the correlation coefficient on the dataset level is also used in LLM evaluation (Chiang and Lee, 2023). Calculating a single correlation coefficient on the dataset level allows us to use William's test to test whether two Pearson's $r$ are significantly different.
220
+
221
+ For Kendall's $\tau$ in Table 1 and 2, we follow most prior works (Zhong et al., 2022; Liu et al., 2023) to
222
+
223
+ <table><tr><td rowspan="2">Sec.</td><td colspan="2">Ablations</td><td colspan="2">Naturalness</td><td colspan="2">Coherence</td><td colspan="2">Engagingness</td><td colspan="2">Groundedness</td></tr><tr><td>CoT</td><td>Output</td><td>r</td><td>τ</td><td>r</td><td>τ</td><td>r</td><td>τ</td><td>r</td><td>τ</td></tr><tr><td rowspan="3">3.2</td><td>X</td><td>Score only</td><td>0.393</td><td>0.358</td><td>0.468</td><td>0.391</td><td>0.549</td><td>0.513</td><td>0.311</td><td>0.566</td></tr><tr><td>✓</td><td>rate-explain</td><td>0.554</td><td>0.478</td><td>0.512</td><td>0.429</td><td>0.613</td><td>0.566</td><td>0.555</td><td>0.664</td></tr><tr><td>X</td><td>rate-explain</td><td>0.524</td><td>0.47</td><td>0.477</td><td>0.416</td><td>0.567</td><td>0.524</td><td>0.58</td><td>0.693</td></tr></table>
224
+
225
+ Table 3: The Pearson's $r$ and Kendall's $\tau$ correlation coefficient between LLMs' ratings and human ratings for Topical-Chat. All the results in this table, except the first row, are from ChatGPT. We **boldface** the Pearson's $r$ statistically significantly higher than auto CoT + score only. We **underline** the Pearson's $r$ comparable auto CoT + score only.
226
+
227
+ calculate Kendall's $\tau$ using Method 2 (document-level, Section C.0.2) to understand if ChatGPT can differentiate the quality difference between different system outputs for the same source document.
228
+
229
+ In fact, we find that Pearson's $r$ calculated by Method 1 and Method 2 are highly correlated. In Table 4, we show the result of Topical-Chat while we use Method 2 to calculate Pearson's $r$ ; Kendall's $\tau$ is still calculated by Method 2. Comparing the results of Pearson's $r$ in Table 2 and Table 4, one can easily see that when a method have significantly higher Pearson's $r$ in Table 2, it will also have significantly higher Pearson's $r$ . We present the $r$ calculated by Method 1 because it makes more sense when calculating statistical significance when the correlation coefficient is calculated at the dataset-level (Graham et al., 2015).
230
+
231
+ # D Results of Changing the Temperature and Prompts
232
+
233
+ We show the results of varying the temperature used to sample the ChatGPT output in Table 5. In the experiments in this section, we only sample $N = 5$ samples from the ChatGPT since we find that G-eval and our proposed guidelines are quite robust to the number of samples when $N \geq 5$ .
234
+
235
+ # E Datasets
236
+
237
+ # E.1 SummEval
238
+
239
+ SummEval (Fabbri et al., 2021) is a dataset for the meta-evaluation of summarization. It contains 100 source documents, each with 16 summaries obtained from different summarization models. Each of the 1600 summaries is rated by three workers recruited on Amazon Mturk and two experts in summarization. Each summary in SummEval is rated by humans based on the coherence, consistency, fluency of the summary, and relevance between the summary and the source document. Each attribute is rated based on a 5-point Likert scale.
240
+
241
+ We download the source documents, summaries, and human ratings from the GitHub repository of G-Eval (https://github.com/nlpyang/geval/tree/8f54105/data). SummEval was released under MIT License, and our usage for research does not violate the dataset's initial intention.
242
+
243
+ # E.2 Topical-Chat
244
+
245
+ Topical-Chat (Gopalakrishnan et al., 2019) is a knowledge-grounded open-domain dialogue dataset. The dataset consists of a dialogue context (history), an interesting fact related to the topic of the conversation, and a response. Mehri and Eskenazi (2020) releases high-quality human annotations on the quality of responses. They construct the dataset as follows: they first sample 60 dialogues context from Topical-Chat, and for each dialogue context and corresponding fun fact, they use a transformer model to generate four responses using four decoding methods. Each dialogue content has two additional responses: the human response and the ground truth response. Thus, there are a total of 360 dialogue-response pairs. Those pairs are evaluated based on six attributes, and we follow Zhong et al. (2022) and Liu et al. (2023) to only use four attributes: naturalness, coherence, engagingness, and groundedness (whether the response is grounded on the provided knowledge). We obtain the human ratings of Topical-Chat from the Github repository of UniEval (Zhong et al., 2022): https://github.com/maszhongming/UniEval/blob/main/reproduce/data/dialogue/topical chatting.json.
246
+
247
+ # F Prompts
248
+
249
+ We list the prompts we use in this section. In the main content of the paper and in the following parts, we use different highlight colors to represent different parts of the prompt. A prompt is composed
250
+
251
+ <table><tr><td rowspan="2">Sec.</td><td colspan="2">Ablations</td><td colspan="2">Naturalness</td><td colspan="2">Coherence</td><td colspan="2">Engagingness</td><td colspan="2">Groundedness</td></tr><tr><td>CoT</td><td>Output</td><td>r</td><td>τ</td><td>r</td><td>τ</td><td>r</td><td>τ</td><td>r</td><td>τ</td></tr><tr><td>GPT-4†</td><td>✓</td><td>Score only</td><td>0.549</td><td>-</td><td>0.594</td><td>-</td><td>0.627</td><td>-</td><td>0.531</td><td>-</td></tr><tr><td rowspan="2">3.1</td><td>✓</td><td rowspan="2">Score only</td><td>0.445</td><td>0.358</td><td>0.498</td><td>0.391</td><td>0.579</td><td>0.513</td><td>0.685</td><td>0.566</td></tr><tr><td>X</td><td>0.431</td><td>0.331</td><td>0.507</td><td>0.404</td><td>0.631</td><td>0.535</td><td>0.666</td><td>0.582</td></tr><tr><td rowspan="4">3.2</td><td>X</td><td>Score only</td><td>0.431</td><td>0.331</td><td>0.507</td><td>0.404</td><td>0.631</td><td>0.535</td><td>0.666</td><td>0.582</td></tr><tr><td>X</td><td>Free Text</td><td>0.572</td><td>0.476</td><td>0.523</td><td>0.426</td><td>0.676</td><td>0.557</td><td>0.747</td><td>0.666</td></tr><tr><td>X</td><td>Rate-explain</td><td>0.621</td><td>0.512</td><td>0.472</td><td>0.425</td><td>0.61</td><td>0.509</td><td>0.771</td><td>0.663</td></tr><tr><td>X</td><td>Analyze-rate</td><td>0.573</td><td>0.47</td><td>0.486</td><td>0.416</td><td>0.628</td><td>0.524</td><td>0.725</td><td>0.693</td></tr></table>
252
+
253
+ Table 4: The Pearson's $r$ and Kendall's $\tau$ correlation coefficient between LLMs' ratings and human ratings for Topical-Chat. Note that in this table, both Pearson's $r$ and Kendall's $\tau$ are calculated by Method 2 in Appendix C.0.2. All the results in this table, except the first row, are from ChatGPT. The results of GPT-4 are from Liu et al. (2023) but should not be compared with our results since the prompts they use may be different from the prompt we use. Still, we can see that for naturalness, engagingness, and groundedness, the results of rate-explain and analyze-rate is better or comparable to GPT-4.
254
+
255
+ of four parts: (1) the descriptions of the rating task, (2) the definition and rating criteria of the attribute to be rated, (3) the sample to be rated, and (4) a sentence used to prompt the LLM to give the rating.
256
+
257
+ The prompts for different attributes of the same dataset share the same descriptions of the rating task. Different attributes use different definition and rating criteria. In G-Eval, the prompts also compose of the evaluation steps generated by auto CoT.
258
+
259
+ # F.1 Prompts for SummEval
260
+
261
+ The descriptions of the rating task, the definition and rating criteria, the evalua-
262
+
263
+ tion steps for coherence, consistency, and relevance in SummEval is from the prompts released by G-Eval in their GitHub repository (https://github.com/nlpyang/geval/tree/8f54105/prompts/summeval). While G-Eval also releases the prompt they use for fluency, we find something highly problematic in the prompt they use. The prompt for fluency asks the LLM to rate fluency on a scale of 1 to 3 (https://github.com/nlpyang/geval/blob/
264
+
265
+ 8f54105061e00377fbbb909153892d5bfb5b3623a/prompts/summeval/fluDetailed.txt), while the original rating scale in SummEval is 1 to 5. We also find that the original rating criteria used in G-Eval for fluency differ largely from the rating criteria of fluency used for human evaluation in SummEval. Through our experiment, we find that the misalignment of evaluation criteria and evaluation scale significantly decreases Pearson's $r$ with human ratings when using analyze-rate to
266
+
267
+ prompt ChatGPT to output. This is likely because ChatGPT tends to stick to the rating criteria when prompted with analyze-rate, and when using the rating criteria different from the criteria that are used to instruct the human raters, the scores generated by ChatGPT deviates more from the human ratings. This highlights the importance of using the same instructions to the LLM as those instructions used in the human evaluation, as emphasized in Chiang and Lee (2023).
268
+
269
+ First, we show an example prompt for coherence. This prompt corresponds to the score only + auto CoT in Table 1.
270
+
271
+ # Coherence
272
+
273
+ You will be given one summary written for a news article.
274
+
275
+ Your task is to rate the summary on one metric.
276
+
277
+ Please make sure you read and understand these instructions carefully. Please keep this document open while reviewing, and refer to it as needed.
278
+
279
+ Evaluation Criteria:
280
+
281
+ Coherence (1- 5) - the collective quality of all sentences. We align this dimension with the DUC quality question of structure and coherence whereby "the summary should be well- structured and well- organized. The summary should not just be a heap of related information, but should build from sentence to a coherent body of information about a topic."
282
+
283
+ Evaluation Steps:
284
+
285
+ 1. Read the news article carefully and
286
+
287
+ <table><tr><td>Auto-CoT</td><td>Output</td><td>Coherence</td><td>Consistency</td><td>Fluency</td><td>Relevance</td></tr><tr><td>✓</td><td>Score only</td><td>0.356</td><td>0.290</td><td>0.261</td><td>0.263</td></tr><tr><td>X</td><td>Rate-explain</td><td>0.548</td><td>0.482</td><td>0.423</td><td>0.487</td></tr><tr><td>X</td><td>Analyze-rate</td><td>0.589</td><td>0.439</td><td>0.438</td><td>0.319</td></tr></table>
288
+
289
+ (a) Temperature $T = 0.3$
290
+
291
+ <table><tr><td>Auto-CoT</td><td>Output</td><td>Coherence</td><td>Consistency</td><td>Fluency</td><td>Relevance</td></tr><tr><td>✓</td><td>Score only</td><td>0.394</td><td>0.256</td><td>0.288</td><td>0.334</td></tr><tr><td>X</td><td>Rate-explain</td><td>0.526</td><td>0.468</td><td>0.414</td><td>0.485</td></tr><tr><td>X</td><td>Analyze-rate</td><td>0.605</td><td>0.448</td><td>0.441</td><td>0.392</td></tr></table>
292
+
293
+ (b) Temperature $T = 0.7$
294
+
295
+ <table><tr><td>Auto-CoT</td><td>Output</td><td>Coherence</td><td>Consistency</td><td>Fluency</td><td>Relevance</td></tr><tr><td>✓</td><td>Score only</td><td>0.450</td><td>0.370</td><td>0.319</td><td>0.403</td></tr><tr><td>X</td><td>Rate-explain</td><td>0.557</td><td>0.473</td><td>0.452</td><td>0.509</td></tr><tr><td>X</td><td>Analyze-rate</td><td>0.635</td><td>0.534</td><td>0.479</td><td>0.444</td></tr></table>
296
+
297
+ (c) Temperature $T = 1.0$ (The result in Table 1)
298
+ Table 5: Comparing G-Eval (Auto-CoT + score only) with rate-explain and analyze-rate at different temperatures. We boldface Pearson's r statistically significantly higher than the baseline (the first row in each subtable).
299
+
300
+ <table><tr><td>Auto-CoT</td><td>Output</td><td>Coherence</td><td>Consistency</td><td>Fluency</td><td>Relevance</td></tr><tr><td>✓</td><td>Score only</td><td>0.308</td><td>0.248</td><td>0.265</td><td>0.345</td></tr><tr><td>X</td><td>Rate-explain</td><td>textbf0.526</td><td>0.468</td><td>0.414</td><td>0.485</td></tr><tr><td>X</td><td>Analyze-rate</td><td>0.589</td><td>0.524</td><td>0.459</td><td>0.416</td></tr></table>
301
+
302
+ (a) Results when prompted with the human evaluator prompts.
303
+
304
+ <table><tr><td>Auto-CoT</td><td>Output</td><td>Coherence</td><td>Consistency</td><td>Fluency</td><td>Relevance</td></tr><tr><td>✓</td><td>Score only</td><td>0.325</td><td>0.206</td><td>0.281</td><td>0.301</td></tr><tr><td>X</td><td>Rate-explain</td><td>0.596</td><td>0.465</td><td>0.403</td><td>0.478</td></tr><tr><td>X</td><td>Analyze-rate</td><td>0.596</td><td>0.493</td><td>0.475</td><td>0.406</td></tr></table>
305
+
306
+ (b) Results when prompted with the HHH prompts.
307
+
308
+ Table 6: Comparing G-Eval (Auto-CoT + score only) with rate-explain and analyze-rate when using different prompts. We boldface Pearson's r statistically significantly higher than the baseline (the first row in each subtable).
309
+
310
+ identify the main topic and key points. 2. Read the summary and compare it to the news article. Check if the summary covers the main topic and key points of the news article, and if it presents them in a clear and logical order.
311
+ 3. Assign a score for coherence on a scale of 1 to 5, where 1 is the lowest and 5 is the highest based on the Evaluation Criteria.
312
+
313
+ ```yaml
314
+ Example:
315
+ Source Text: {{Document}}
316
+ Summary: {{Summary}}
317
+ Evaluation Form (scores ONLY): - Coherence:
318
+ ```
319
+
320
+ # F.1.1 Different Output Prompts
321
+
322
+ For different output prompts, which is the ablation in Section 3.2 and the last block in Table 1 and 2, we only change the yellow parts (the last part) in the example prompt above. There are four output prompts used in Section 3.2: score only, free text, rate-explain, and analyze-rate. The prompts for free text is attribute-dependent, and we list them in the Their corresponding output prompts are listed as follows:
323
+
324
+ # Score only
325
+
326
+ ```txt
327
+ Evaluation Form (scores ONLY): - {Attribute}:
328
+ ```
329
+
330
+ # Rate-explain
331
+
332
+ Evaluation Form (Answer by starting with "Rating:" and then give the explanation of the rating on the next line by "Rationale:"):
333
+
334
+ ```txt
335
+ - {Attribute}:
336
+ ```
337
+
338
+ # Analyze-rate
339
+
340
+ Evaluation Form (Answer by starting with "Analysis:" to analyze the given example regarding the evaluation criteria as concise as possible, and then give the numeric rating on the next line by "Rating:):
341
+
342
+ ```txt
343
+ - {Attribute}:
344
+ ```
345
+
346
+ # F.1.2 Attribute-Dependent Prompts
347
+
348
+ The definition and rating criteria of the attribute to be rated, the evaluation steps generated by auto CoT, and output prompt for text-free are attributedependent, and we list them as follows. We use different colors to denote different parts in the prompt.
349
+
350
+ Note that the following prompts are not the complete prompts used as the model input; they need to be used with the descriptions of the rating task and the sample to be rated.
351
+
352
+ # Coherence
353
+
354
+ Evaluation Criteria:
355
+
356
+ Coherence (1-5) - the collective quality of all sentences. We align this dimension with the DUC quality question of structure and coherence whereby "the summary should be well-structured and well-organized. The summary should not just be a heap of related information, but should build from sentence to a coherent body of information about a topic."
357
+
358
+ # Evaluation Steps:
359
+
360
+ 1. Read the news article carefully and identify the main topic and key points.
361
+ 2. Read the summary and compare it to the news article. Check if the summary covers the main topic and key points of the news article, and if it presents them in a clear and logical order.
362
+ 3. Assign a score for coherence on a scale of 1 to 5, where 1 is the lowest and 5 is the highest based on the Evaluation Criteria.
363
+
364
+ # Question:
365
+
366
+ How coherent is the summary? That is, how well do the sentences in the summary fit together? (On a scale of 1-5, with 1 being the lowest)
367
+
368
+ # Consistency
369
+
370
+ Evaluation Criteria:
371
+
372
+ Consistency (1-5) - the factual alignment between the summary and the summarized source. A factually consistent summary contains only statements that are entailed by the source document. Annotators were also asked to penalize summaries that contained hallucinated facts.
373
+
374
+ # Evaluation Steps:
375
+
376
+ 1. Read the news article carefully and identify the main facts and details it presents.
377
+ 2. Read the summary and compare it to the
378
+
379
+ article. Check if the summary contains any factual errors that are not supported by the article.
380
+
381
+ 3. Assign a score for consistency based on the Evaluation Criteria.
382
+
383
+ # Question:
384
+
385
+ How consistent is the summary with the source document in terms of the factual alignment? (On a scale of 1-5, with 1 being the lowest)
386
+
387
+ # Fluency
388
+
389
+ Evaluation Criteria:
390
+
391
+ Fluency (1-5): This rating measures the quality of individual sentences, are they well-written and grammatically correct. Consider the quality of individual sentences.
392
+
393
+ Evaluation steps:
394
+
395
+ 1. Read the given summary.
396
+ 2. Evaluate the fluency of the summary on a scale of 1-5 based on the criteria provided.
397
+ 3. Provide the rating.
398
+
399
+ # Question:
400
+
401
+ Based on the evaluation criteria, how fluent is the summary? (On a scale of 1-5, with 1 being the lowest)
402
+
403
+ # Relevance
404
+
405
+ Evaluation Criteria:
406
+
407
+ Relevance (1-5) - selection of important content from the source. The summary should include only important information from the source document. Annotators were instructed to penalize summaries which contained redundancies and excess information.
408
+
409
+ # Evaluation Steps:
410
+
411
+ 1. Read the summary and the source document carefully.
412
+ 2. Compare the summary to the source document and identify the main points of the article.
413
+ 3. Assess how well the summary covers the main points of the article, and how much irrelevant or redundant information it contains.
414
+
415
+ 4. Assign a relevance score from 1 to 5.
416
+
417
+ # Question:
418
+
419
+ On a scale of 1-5, with 1 being the lowest, is the summary relevant to the source document and does the summary only contain the important information of the source document?
420
+
421
+ # F.2 Prompts for Topical-Chat
422
+
423
+ First, we show an example prompt for naturalness. This prompt corresponds to the score only + auto CoT in Table 2.
424
+
425
+ # Naturalness
426
+
427
+ You will be given a conversation between two individuals. You will then be given one potential response for the next turn in the conversation. The response concerns an interesting fact, which will be provided as well.
428
+
429
+ Your task is to rate the responses on one metric.
430
+
431
+ Please make sure you read and understand these instructions carefully. Please keep this document open while reviewing, and refer to it as needed.
432
+
433
+ # Evaluation Crieteria:
434
+
435
+ Naturalness (1-3) Is the response naturally written??
436
+
437
+ - A score of 1 (bad) means that the response is unnatural.
438
+ - A score of 2 (ok) means the response is strange, but not entirely unnatural.
439
+ - A score of 3 (good) means that the response is natural.
440
+
441
+ # Evaluation Steps:
442
+
443
+ 1. Read the conversation between the two individuals.
444
+ 2. Read the potential response for the next turn in the conversation.
445
+ 3. Evaluate the response based on its naturalness, using the provided criteria.
446
+ 4. Assign a rating score of 1, 2, or 3 based on the evaluation.
447
+
448
+ # Example:
449
+
450
+ Conversation History:
451
+
452
+ {{Document}}
453
+
454
+ Corresponding Fact:
455
+
456
+ {{Fact}}
457
+
458
+ Response:
459
+
460
+ {{Response}}
461
+
462
+ Evaluation Form (scores ONLY):
463
+
464
+ - Naturalness:
465
+
466
+ # F.2.1 Different Output Prompts
467
+
468
+ For Topical-Chat, we also conduct ablations on different output prompts. Those different output prompts for score only, rate-explain, analyze-rate are the same as those listed in Section F.1.1. We do not list them here to save some space. The exact prompts we use can be found in the supplementary data of this paper.
469
+
470
+ # F.2.2 Attribute-Dependent Prompts
471
+
472
+ The definition and rating criteria of the attribute to be rated, the evaluation steps generated by auto CoT, and output prompt for text-free are attributedependent, and we list them as follows. Again, the following prompts are not the complete prompts used as the model input; they need to be used with the descriptions of the rating task and the sample to be rated.
473
+
474
+ # Naturalness
475
+
476
+ Evaluation Crieteria:
477
+
478
+ Naturalness (1-3) Is the response naturally written??
479
+
480
+ - A score of 1 (bad) means that the response is unnatural.
481
+
482
+ - A score of 2 (ok) means the response is strange, but not entirely unnatural.
483
+
484
+ - A score of 3 (good) means that the response is natural.
485
+
486
+ # Evaluation Steps:
487
+
488
+ 1. Read the conversation between the two individuals.
489
+ 2. Read the potential response for the next turn in the conversation.
490
+ 3. Evaluate the response based on its naturalness, using the provided criteria.
491
+ 4. Assign a rating score of 1, 2, or 3 based on the evaluation.
492
+
493
+ # Question:
494
+
495
+ How natural is the reponse? (On a scale of 1-3, with 1 being the lowest)
496
+
497
+ # Coherence
498
+
499
+ Evaluation Crieteria:
500
+
501
+ Coherence (1-3) Does the response serve as a valid continuation of the conversation history?
502
+
503
+ - A score of 1 (no) means that the response drastically changes topic or ignores the conversation history.
504
+ - A score of 2 (somewhat) means the response refers to the conversation history in a limited capacity (e.g., in a generic way) and shifts the conversation topic.
505
+ - A score of 3 (yes) means the response is on topic and strongly acknowledges the conversation history.
506
+
507
+ # Evaluation Steps:
508
+
509
+ 1. Read the conversation history.
510
+ 2. Read the potential response.
511
+ 3. Evaluate the coherence of the response based on the conversation history.
512
+ 4. Assign a score of 1, 2, or 3 for coherence.
513
+
514
+ # Question:
515
+
516
+ Does the response serve as a valid continuation of the conversation history? (On a scale of 1-3, with 1 meaning the response is invalid and 3 meaning the response is coherent)
517
+
518
+ # Engagingness
519
+
520
+ Evaluation Crieteria:
521
+
522
+ Engagingness (1-3) Is the response dull/interesting?
523
+
524
+ - A score of 1 (dull) means that the response is generic and dull.
525
+ - A score of 2 (somewhat interesting)
526
+ means the response is somewhat interesting and could engage you in the conversation (e.g., an opinion, thought)
527
+ - A score of 3 (interesting) means the response is very interesting or presents an interesting fact
528
+
529
+ # Evaluation Steps:
530
+
531
+ 1. Read the conversation, the corresponding fact and the response carefully.
532
+ 2. Rate the response on a scale of 1-3 for engagingness, according to the criteria above.
533
+
534
+ Question:
535
+
536
+ Is the response interesting and engaging? (On a scale of 1-3, with 1 meaning dull and 3 meaning interesting)
537
+
538
+ # Groundedness
539
+
540
+ Evaluation Crieteria:
541
+
542
+ Groundedness (0- 1) given the fact that this response is conditioned on, determine whether this response uses that fact.
543
+
544
+ - A score of 0 (no) means the response does not mention or refer to the fact at all
545
+
546
+ - A score of 1 (yes) means the response uses the fact well
547
+
548
+ Evaluation Steps:
549
+
550
+ 1. Read the conversation between the two individuals.
551
+ 2. Identify the fact that is provided for the potential response.
552
+ 3. Read the potential response.
553
+ 4. Determine if the potential response uses or mentions the fact.
554
+ 5. Assign a score of 0 or 1 for groundedness based on whether the response uses the fact.
555
+
556
+ Question:
557
+
558
+ Given the fact that this response is conditioned on, does the response use the fact? (On a scale of 0-1, with 0 meaning no and 1 meaning yes)
559
+
560
+ # F.3 Prompts for Section 3.4.2
561
+
562
+ HHH prompts You are an AI assistant. The AI tries to be helpful, polite, honest, sophisticated, emotionally aware, and humble-but-knowledgeable. The assistant is happy to help with almost anything, and will do its best to understand exactly what is needed.
563
+
564
+ Human annotator prompts Assume that you are a professional and careful human evaluator. You are recruited and paid to conduct the following task. You need to strictly follow the task instruction and ensure that you are doing the job with high-quality.
2023/A Closer Look into Using Large Language Models for Automatic Evaluation/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:484320df7f6aa802a9a8039b1f26fb43ff98e3fe269f6442274d8941a0305f52
3
+ size 399386
2023/A Closer Look into Using Large Language Models for Automatic Evaluation/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/03295168-adb4-4f17-ac96-deb081e11468_content_list.json ADDED
@@ -0,0 +1,1929 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 188,
8
+ 79,
9
+ 811,
10
+ 118
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Ruihao Shui",
17
+ "bbox": [
18
+ 277,
19
+ 126,
20
+ 389,
21
+ 140
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "National University of Singapore ruihaoshui@u.nus.edu",
28
+ "bbox": [
29
+ 198,
30
+ 143,
31
+ 468,
32
+ 174
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Yixin Cao",
39
+ "bbox": [
40
+ 620,
41
+ 126,
42
+ 710,
43
+ 140
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Singapore Management University yxcao@smu.edu.sg",
50
+ "bbox": [
51
+ 522,
52
+ 142,
53
+ 806,
54
+ 175
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Wang Xiang*",
61
+ "bbox": [
62
+ 275,
63
+ 187,
64
+ 393,
65
+ 204
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "University of Science and Technology of China xiangwang1223@gmail.com",
72
+ "bbox": [
73
+ 137,
74
+ 204,
75
+ 524,
76
+ 237
77
+ ],
78
+ "page_idx": 0
79
+ },
80
+ {
81
+ "type": "text",
82
+ "text": "Tat-Seng Chua",
83
+ "bbox": [
84
+ 600,
85
+ 187,
86
+ 732,
87
+ 204
88
+ ],
89
+ "page_idx": 0
90
+ },
91
+ {
92
+ "type": "text",
93
+ "text": "National University of Singapore dcscts@nus.edu.sg",
94
+ "bbox": [
95
+ 529,
96
+ 205,
97
+ 801,
98
+ 237
99
+ ],
100
+ "page_idx": 0
101
+ },
102
+ {
103
+ "type": "text",
104
+ "text": "Abstract",
105
+ "text_level": 1,
106
+ "bbox": [
107
+ 260,
108
+ 252,
109
+ 341,
110
+ 267
111
+ ],
112
+ "page_idx": 0
113
+ },
114
+ {
115
+ "type": "text",
116
+ "text": "Large language models (LLMs) have demonstrated great potential for domain-specific applications, such as the law domain. However, recent disputes over GPT-4's law evaluation raise questions concerning their performance in real-world legal tasks. To systematically investigate their competency in the law, we design practical baseline solutions based on LLMs and test on the task of legal judgment prediction. In our solutions, LLMs can work alone to answer open questions or coordinate with an information retrieval (IR) system to learn from similar cases or solve simplified multi-choice questions. We show that similar cases and multi-choice options, namely label candidates, included in prompts can help LLMs recall domain knowledge that is critical for expertise legal reasoning. We additionally present an intriguing paradox wherein an IR system surpasses the performance of LLM+IR due to limited gains acquired by weaker LLMs from powerful IR systems. In such cases, the role of LLMs becomes redundant. Our evaluation pipeline can be easily extended into other tasks to facilitate evaluations in other domains. Code is available at https://github.com/srhthu/LM-CompEval-Legal",
117
+ "bbox": [
118
+ 141,
119
+ 282,
120
+ 460,
121
+ 667
122
+ ],
123
+ "page_idx": 0
124
+ },
125
+ {
126
+ "type": "text",
127
+ "text": "1 Introduction",
128
+ "text_level": 1,
129
+ "bbox": [
130
+ 114,
131
+ 682,
132
+ 258,
133
+ 697
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "Large language models have achieved great success in various Natural Language Processing (NLP) tasks (Brown et al., 2020; Touvron et al., 2023), while there are still some disputes over the potential for domain-specific applications (Martínez, 2023). Focusing on the law domain, the leading LLM, GPT-4 (OpenAI, 2023), was claimed to pass the Uniform Bar Exam (UBE) with a 90th percentile score. Although inspiring, however, this result was pointed out to be overestimated (Martínez, 2023).",
140
+ "bbox": [
141
+ 112,
142
+ 709,
143
+ 490,
144
+ 872
145
+ ],
146
+ "page_idx": 0
147
+ },
148
+ {
149
+ "type": "image",
150
+ "img_path": "images/99ef283638db9ae2fce19004b145e404d3b53a5a36b8bac09db03b2bc2773c2c.jpg",
151
+ "image_caption": [
152
+ "Figure 1: The task of Legal Judgment Prediction and the evaluation settings. Different colors refer to different charges. For similar cases, \"T\" refers to true similar cases with the same charges as the query cases, while \"F\" refers to false similar cases. For task settings, \"ZS\" is the abbreviation for zero-shot and \"FS\" for few-shot."
153
+ ],
154
+ "image_footnote": [],
155
+ "bbox": [
156
+ 512,
157
+ 250,
158
+ 884,
159
+ 448
160
+ ],
161
+ "page_idx": 0
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "This raises an interesting question: How exactly LLMs perform in various real-world legal tasks?",
166
+ "bbox": [
167
+ 507,
168
+ 577,
169
+ 882,
170
+ 609
171
+ ],
172
+ "page_idx": 0
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "In this paper, we design practical baseline solutions based on LLMs and systematically investigate their competency in the law, to shed light on other domains as well. We attribute the main issues of the previous benchmark as follows. First, UBE is too general and not subject to any legal jurisdiction (Martínez, 2023). Second, UBE contains multi-choice questions and open-ended questions that require human experts to evaluate. To avoid human evaluation, some datasets (Hendrycks et al., 2020) replace open-ended questions with multi-choice questions. However, in real-world applications, there are not only multi-choice but also open questions. Using multi-choice questions only may not be comprehensive enough. Third, specifically in but not limited to common law (Shulayeva et al., 2017; Xiao et al., 2019), similar cases are always introduced as evidence to support expertise legal reasoning (Zhong et al., 2020b), which are not fully",
177
+ "bbox": [
178
+ 505,
179
+ 613,
180
+ 884,
181
+ 919
182
+ ],
183
+ "page_idx": 0
184
+ },
185
+ {
186
+ "type": "page_footnote",
187
+ "text": "*Xiang Wang is also affiliated with Institute of Artificial Intelligence, Institute of Dataspace, Hefei Comprehensive National Science Center.",
188
+ "bbox": [
189
+ 112,
190
+ 879,
191
+ 487,
192
+ 917
193
+ ],
194
+ "page_idx": 0
195
+ },
196
+ {
197
+ "type": "page_number",
198
+ "text": "7337",
199
+ "bbox": [
200
+ 480,
201
+ 927,
202
+ 519,
203
+ 940
204
+ ],
205
+ "page_idx": 0
206
+ },
207
+ {
208
+ "type": "footer",
209
+ "text": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 7337-7348 December 6-10, 2023 ©2023 Association for Computational Linguistics",
210
+ "bbox": [
211
+ 216,
212
+ 945,
213
+ 779,
214
+ 973
215
+ ],
216
+ "page_idx": 0
217
+ },
218
+ {
219
+ "type": "text",
220
+ "text": "studied in previous benchmark (Hendrycks et al., 2020).",
221
+ "bbox": [
222
+ 112,
223
+ 84,
224
+ 489,
225
+ 115
226
+ ],
227
+ "page_idx": 1
228
+ },
229
+ {
230
+ "type": "text",
231
+ "text": "For the first issue, we choose legal judgment prediction (LJP) (Xiao et al., 2018; Chalkidis et al., 2019; Zhong et al., 2020a) as the example task for investigation. It is a real-world problem to determine the charges committed by the defendants under a juridical system, as shown in Figure 1. LJP is typically formulated as a classification task to predict the most possible one from a list of predefined charges. Then, for the second and third issues, we design four settings derived from two work scenarios of LLMs to cover open and multichoice questions and the usage of similar cases. In the first scenario, LLMs work alone without explicit knowledge in prompts, assuming all domain knowledge is implicitly stored in parameters. In the second scenario, LLMs coordinate with an information retrieval (IR) system that enriches prompts with similar demonstrations and label candidates to benefit expertise reasoning. Specifically, demonstrations consist of pairs of similar cases and their charges, which are retrieved by the IR system based on similarity of case facts. Labels of the retrieved cases can form label candidates, shown as circles of different colors in Figure 1, to hint LLM with label information and narrow down label space (Ma et al., 2023).",
232
+ "bbox": [
233
+ 112,
234
+ 117,
235
+ 489,
236
+ 533
237
+ ],
238
+ "page_idx": 1
239
+ },
240
+ {
241
+ "type": "text",
242
+ "text": "The four evaluation settings in Figure 1 can be categorized based on the presence of two elements in prompts: demonstrations (similar cases) and label candidates. Demonstrations convert the setting from zero-shot to few-shot prompting, while label candidates simplify the task from open questions to multi-choice questions<sup>1</sup>. The first scenario corresponds to the first setting, where neither element is present, while the second scenario encompasses the remaining three settings. We evaluate five up-to-date LLMs of the close-source GPT-3 (Brown et al., 2020) family, ChatGPT and GPT-4 (OpenAI, 2023), and open-source LLMs including Vicuna (Chiang et al., 2023), ChatGLM (Du et al., 2022) and BLOOMZ (Muennighoff et al., 2022). The evaluation is conducted on a Chinese LJP dataset, namely CAIL (Xiao et al., 2018), which contains cases of 112 criminal law charges<sup>2</sup>.",
243
+ "bbox": [
244
+ 112,
245
+ 536,
246
+ 489,
247
+ 824
248
+ ],
249
+ "page_idx": 1
250
+ },
251
+ {
252
+ "type": "text",
253
+ "text": "We highlight our key findings as follows:",
254
+ "bbox": [
255
+ 131,
256
+ 826,
257
+ 438,
258
+ 841
259
+ ],
260
+ "page_idx": 1
261
+ },
262
+ {
263
+ "type": "text",
264
+ "text": "1. Similar cases and label candidates can help",
265
+ "bbox": [
266
+ 131,
267
+ 841,
268
+ 485,
269
+ 858
270
+ ],
271
+ "page_idx": 1
272
+ },
273
+ {
274
+ "type": "text",
275
+ "text": "LLMs recall domain knowledge that is critical for expertise legal reasoning.",
276
+ "bbox": [
277
+ 544,
278
+ 84,
279
+ 880,
280
+ 116
281
+ ],
282
+ "page_idx": 1
283
+ },
284
+ {
285
+ "type": "list",
286
+ "sub_type": "text",
287
+ "list_items": [
288
+ "2. Label candidates result in more consistent outputs, indicating LLMs gain greater confidence in their domain knowledge (Jiang et al., 2021).",
289
+ "3. Irrelevant demonstrations formed by fixed cases hardly improve performance. This excludes their effect on task illustration.",
290
+ "4. Paradox: An IR system can outperform LLM+IR since weaker LLMs acquire limited gains from informative documents retrieved by a powerful IR system. Thus, it is critical to adapte LLMs to generate with retrieved documents.",
291
+ "5. More similar cases introduce more knowledge and noise simultaneously, whose final outcome depends on LLMs."
292
+ ],
293
+ "bbox": [
294
+ 522,
295
+ 117,
296
+ 884,
297
+ 357
298
+ ],
299
+ "page_idx": 1
300
+ },
301
+ {
302
+ "type": "text",
303
+ "text": "The main contributions are summarized in three aspects:",
304
+ "bbox": [
305
+ 509,
306
+ 357,
307
+ 880,
308
+ 390
309
+ ],
310
+ "page_idx": 1
311
+ },
312
+ {
313
+ "type": "list",
314
+ "sub_type": "text",
315
+ "list_items": [
316
+ "- We investigate the law competency of LLMs on the task of legal judgment prediction.",
317
+ "- We propose practical baseline solutions for LLMs that tackle two scenarios: working alone or in coordination with an IR system.",
318
+ "- We evaluate five LLMs and conduct comprehensive analysis to demystify their characteristics of expertise reasoning."
319
+ ],
320
+ "bbox": [
321
+ 531,
322
+ 398,
323
+ 882,
324
+ 546
325
+ ],
326
+ "page_idx": 1
327
+ },
328
+ {
329
+ "type": "text",
330
+ "text": "2 Baseline Method",
331
+ "text_level": 1,
332
+ "bbox": [
333
+ 507,
334
+ 558,
335
+ 690,
336
+ 571
337
+ ],
338
+ "page_idx": 1
339
+ },
340
+ {
341
+ "type": "text",
342
+ "text": "The goal of legal judgment prediction is to determine the committed charges given case facts. To harness LLMs for LJP, we adopt in-context learning (Brown et al., 2020) and use LLMs to generate the charges conditioned on prompts (Section 2.1). To enhance LLMs, we incorporate label candidates and demonstrations consisting of similar cases into prompts, which are acquired by an IR system (Section 2.2). This derives four settings of baseline solutions, namely zero-shot open questions, few-shot open questions, zero-shot multi-choice questions, and few-shot multi-choice questions. The multi-choice settings employ label candidates while few-shot settings include demonstrations, as shown in Figure 1. Finally, we introduce how to simulate IR systems with different capabilities to understand their effects (Section 2.3).",
343
+ "bbox": [
344
+ 507,
345
+ 582,
346
+ 884,
347
+ 854
348
+ ],
349
+ "page_idx": 1
350
+ },
351
+ {
352
+ "type": "text",
353
+ "text": "2.1 LLM Prompting",
354
+ "text_level": 1,
355
+ "bbox": [
356
+ 507,
357
+ 866,
358
+ 687,
359
+ 881
360
+ ],
361
+ "page_idx": 1
362
+ },
363
+ {
364
+ "type": "text",
365
+ "text": "Prompt Design. A prompt begins with an instruction to illustrate the task followed by label",
366
+ "bbox": [
367
+ 507,
368
+ 887,
369
+ 882,
370
+ 917
371
+ ],
372
+ "page_idx": 1
373
+ },
374
+ {
375
+ "type": "page_footnote",
376
+ "text": "<sup>1</sup>It is not strict multi-choice questions. LLMs can generate correct answers even though ground-truth labels are absent in candidates.",
377
+ "bbox": [
378
+ 112,
379
+ 866,
380
+ 487,
381
+ 903
382
+ ],
383
+ "page_idx": 1
384
+ },
385
+ {
386
+ "type": "page_footnote",
387
+ "text": "After filtering less frequent (article, charge) pairs",
388
+ "bbox": [
389
+ 134,
390
+ 904,
391
+ 440,
392
+ 917
393
+ ],
394
+ "page_idx": 1
395
+ },
396
+ {
397
+ "type": "page_number",
398
+ "text": "7338",
399
+ "bbox": [
400
+ 480,
401
+ 928,
402
+ 519,
403
+ 940
404
+ ],
405
+ "page_idx": 1
406
+ },
407
+ {
408
+ "type": "text",
409
+ "text": "candidates and task demonstrations in the form of input-output pairs. The templates of prompts are displayed in Appendix A.1.",
410
+ "bbox": [
411
+ 112,
412
+ 84,
413
+ 487,
414
+ 131
415
+ ],
416
+ "page_idx": 2
417
+ },
418
+ {
419
+ "type": "text",
420
+ "text": "Parsing. We adopt one automatic parsing function for all LLMs to map LLM outputs to predefined charge labels. No ad hoc heuristics are employed for a fair comparison. Specifically, we use the BM25 algorithm<sup>3</sup> to measure text similarity between outputs and pre-defined charges and predict the most similar charges. BM25 is robust and yields comparable performances to neural similarity methods like text2vec<sup>4</sup> in our pilot experiments.",
421
+ "bbox": [
422
+ 112,
423
+ 133,
424
+ 487,
425
+ 292
426
+ ],
427
+ "page_idx": 2
428
+ },
429
+ {
430
+ "type": "text",
431
+ "text": "Inference. Sampling is enabled during generation for consistent results, as inspired by Wang et al. (2022). Five outputs are sampled for each prompt with the temperature of 0.8. Their similarity scores of pre-defined labels are averaged.",
432
+ "bbox": [
433
+ 112,
434
+ 294,
435
+ 487,
436
+ 375
437
+ ],
438
+ "page_idx": 2
439
+ },
440
+ {
441
+ "type": "text",
442
+ "text": "2.2 IR System for Knowledge Incorporation",
443
+ "text_level": 1,
444
+ "bbox": [
445
+ 112,
446
+ 387,
447
+ 475,
448
+ 401
449
+ ],
450
+ "page_idx": 2
451
+ },
452
+ {
453
+ "type": "text",
454
+ "text": "IR systems are utilized to retrieve similar cases, commonly referenced by lawyers and judges, to inform their judgments. In addition to providing demonstrations, these similar cases can also aid in generating potential labels by incorporating the labels from the top similar cases. By employing these smaller sets of predefined charges, namely label candidates, complex open questions can be simplified into multiple-choice questions. This approach is effective in enhancing LM prompting (Ma et al., 2023), as including hundreds of charges directly in prompts is impractical.",
455
+ "bbox": [
456
+ 112,
457
+ 409,
458
+ 487,
459
+ 601
460
+ ],
461
+ "page_idx": 2
462
+ },
463
+ {
464
+ "type": "text",
465
+ "text": "Implementation of IR System. We use the BM25 algorithm to measure the semantic similarity between cases. Similar cases are retrieved from the training dataset. To guarantee that the demonstrations exemplify one of the multi-choice options, we exclude demonstrations with labels that are not among the candidate options<sup>5</sup>.",
466
+ "bbox": [
467
+ 112,
468
+ 602,
469
+ 487,
470
+ 715
471
+ ],
472
+ "page_idx": 2
473
+ },
474
+ {
475
+ "type": "text",
476
+ "text": "2.3 Simulation of IR Systems",
477
+ "text_level": 1,
478
+ "bbox": [
479
+ 112,
480
+ 728,
481
+ 359,
482
+ 743
483
+ ],
484
+ "page_idx": 2
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "To investigate the effects of IR capabilities, we simulate a series of IR systems of different capabilities as measured by Precision@1 $^{6}$ . Then the top retrieved cases are used as demonstrations. We consider cases with identical charges to the query cases as true similar cases and vice versa.",
489
+ "bbox": [
490
+ 112,
491
+ 750,
492
+ 487,
493
+ 845
494
+ ],
495
+ "page_idx": 2
496
+ },
497
+ {
498
+ "type": "list",
499
+ "sub_type": "text",
500
+ "list_items": [
501
+ "3https://pypi.org/project/rank-bm25/",
502
+ "<sup>4</sup>https://github.com/crownpku/text2vec",
503
+ "5This condition is not violated for the top four similar cases without filtering.",
504
+ "The accuracy of the top one retrieved case."
505
+ ],
506
+ "bbox": [
507
+ 115,
508
+ 853,
509
+ 485,
510
+ 917
511
+ ],
512
+ "page_idx": 2
513
+ },
514
+ {
515
+ "type": "text",
516
+ "text": "Realistic Simulation. We prioritize the returning of true similar cases for easy query cases, rather than the returning in a random manner. The query difficulty is measured by the Precision@10 of the BM25 retriever described in Section 2.2. The motivation is that queries with shadow linguistic features are more possible to get relevant retrieval results than complex or obscure queries. For a specific value (e.g., a%) of Precision@1 to be simulated, the top a% of easy test cases are assured to have a true similar case, while the rest are assigned false similar cases.",
517
+ "bbox": [
518
+ 505,
519
+ 84,
520
+ 884,
521
+ 275
522
+ ],
523
+ "page_idx": 2
524
+ },
525
+ {
526
+ "type": "text",
527
+ "text": "3 Experimental Setup",
528
+ "text_level": 1,
529
+ "bbox": [
530
+ 507,
531
+ 291,
532
+ 715,
533
+ 307
534
+ ],
535
+ "page_idx": 2
536
+ },
537
+ {
538
+ "type": "text",
539
+ "text": "3.1 Models",
540
+ "text_level": 1,
541
+ "bbox": [
542
+ 507,
543
+ 319,
544
+ 613,
545
+ 332
546
+ ],
547
+ "page_idx": 2
548
+ },
549
+ {
550
+ "type": "text",
551
+ "text": "Below is a concise introduction to the five LLMs to be evaluated.",
552
+ "bbox": [
553
+ 507,
554
+ 340,
555
+ 880,
556
+ 370
557
+ ],
558
+ "page_idx": 2
559
+ },
560
+ {
561
+ "type": "text",
562
+ "text": "GPT-4 (OpenAI, 2023) and ChatGPT are available from OpenAI API and the versions of gpt-4-0314 and gpt-3.5-turbo-0301 are used. For technological details, ChatGPT is claimed to be a sibling model to InstructGPT (Ouyang et al., 2022) that is trained to follow instructions and align to human preferences with the RLHF algorithm (Christiano et al., 2017).",
563
+ "bbox": [
564
+ 507,
565
+ 373,
566
+ 882,
567
+ 501
568
+ ],
569
+ "page_idx": 2
570
+ },
571
+ {
572
+ "type": "text",
573
+ "text": "Vicuna-13B (Chiang et al., 2023) is a LLaMA model (Touvron et al., 2023) fine-tuned on 70K public user-shared conversations with ChatGPT. It can be viewed to learn distilled knowledge (Hinton et al., 2015) of ChatGPT.",
574
+ "bbox": [
575
+ 507,
576
+ 502,
577
+ 880,
578
+ 582
579
+ ],
580
+ "page_idx": 2
581
+ },
582
+ {
583
+ "type": "text",
584
+ "text": "ChatGLM-6B<sup>7</sup> is a dialog language model based on the GLM (Du et al., 2022) architecture and supports English and Chinese.",
585
+ "bbox": [
586
+ 507,
587
+ 583,
588
+ 880,
589
+ 631
590
+ ],
591
+ "page_idx": 2
592
+ },
593
+ {
594
+ "type": "text",
595
+ "text": "BLOOMZ (Muennighoff et al., 2022) is an instruction fine-tuned BLOOM (Scao et al., 2022), a multilingual language model. We use the bloomz-7b1-mt version that is tuned for multilingual prompts. Except for BLOOMZ, Vicuna and ChatGLM are mainly fine-tuned on conversational data.",
596
+ "bbox": [
597
+ 507,
598
+ 633,
599
+ 882,
600
+ 744
601
+ ],
602
+ "page_idx": 2
603
+ },
604
+ {
605
+ "type": "text",
606
+ "text": "3.2 Dataset and Pre-processing",
607
+ "text_level": 1,
608
+ "bbox": [
609
+ 507,
610
+ 759,
611
+ 769,
612
+ 774
613
+ ],
614
+ "page_idx": 2
615
+ },
616
+ {
617
+ "type": "text",
618
+ "text": "The Chinese LJP dataset, CAIL (Xiao et al., 2018), is used in our experiments. Each sample consists of the case facts and the committed charge as the label. As the original dataset is very large (~100K for training and ~20K for test), we randomly sample a balanced small test set from the original test set. Five cases are sampled for each charge, accounting",
619
+ "bbox": [
620
+ 507,
621
+ 781,
622
+ 884,
623
+ 894
624
+ ],
625
+ "page_idx": 2
626
+ },
627
+ {
628
+ "type": "page_footnote",
629
+ "text": "<sup>7</sup>https://github.com/THUDM/ChatGLM-6B",
630
+ "bbox": [
631
+ 529,
632
+ 904,
633
+ 800,
634
+ 917
635
+ ],
636
+ "page_idx": 2
637
+ },
638
+ {
639
+ "type": "page_number",
640
+ "text": "7339",
641
+ "bbox": [
642
+ 480,
643
+ 927,
644
+ 519,
645
+ 940
646
+ ],
647
+ "page_idx": 2
648
+ },
649
+ {
650
+ "type": "table",
651
+ "img_path": "images/534e04af4b4c52ed8454eb1cad6294e2caec99b499fba08b07118ed2be61461d.jpg",
652
+ "table_caption": [],
653
+ "table_footnote": [],
654
+ "table_body": "<table><tr><td>Tokenizer</td><td>Median</td><td>&lt;=500</td><td>&lt;=1000</td></tr><tr><td>ChatGPT</td><td>396.5</td><td>68.75</td><td>92.32</td></tr><tr><td>Vicuna</td><td>496.0</td><td>50.89</td><td>86.96</td></tr><tr><td>ChatGLM</td><td>206.5</td><td>91.07</td><td>98.57</td></tr><tr><td>BLOOMZ</td><td>210.5</td><td>90.54</td><td>98.93</td></tr></table>",
655
+ "bbox": [
656
+ 139,
657
+ 80,
658
+ 463,
659
+ 166
660
+ ],
661
+ "page_idx": 3
662
+ },
663
+ {
664
+ "type": "text",
665
+ "text": "Table 1: Statistics of the number of tokens across tokenizers. The last two columns present the ratios of test samples with token counts below the specified values.",
666
+ "bbox": [
667
+ 112,
668
+ 175,
669
+ 489,
670
+ 219
671
+ ],
672
+ "page_idx": 3
673
+ },
674
+ {
675
+ "type": "text",
676
+ "text": "for 560 test cases in total for 112 charges. Similarly, we also sample the training and validation sets with 10 cases per charge. The training set is used to retrieve similar cases (Section 2.3), while the validation set is used to determine the optimal $k$ of the kNN algorithm.",
677
+ "bbox": [
678
+ 112,
679
+ 248,
680
+ 487,
681
+ 344
682
+ ],
683
+ "page_idx": 3
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "Truncation. Since some cases have very long descriptions, we truncate the case facts of demonstrations to 500 tokens and those of test samples to 1000 tokens. It is worth noting that the text is tokenized by the tokenizer of each model before truncation for a fair comparison. Recently, Petrov et al. (2023) address the issue that a tokenizer can lead to different performances of different languages. This suggests that the performance on a particular language can also be influenced by tokenizers from various models with varying language encoding efficiency.",
688
+ "bbox": [
689
+ 115,
690
+ 347,
691
+ 489,
692
+ 539
693
+ ],
694
+ "page_idx": 3
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "Table 1 shows the statistics of the number of tokens processed by different tokenizers<sup>8</sup>. The most efficient tokenizers for Chinese are those of ChatGLM and BLOOMZ, indicated by the medians of token numbers. In contrast, the tokenizer of ChatGPT produces $2 \\times$ tokens and that of Vicuna produces $2.5 \\times$ tokens. The truncation length is proper to accommodate most samples.",
699
+ "bbox": [
700
+ 112,
701
+ 542,
702
+ 489,
703
+ 671
704
+ ],
705
+ "page_idx": 3
706
+ },
707
+ {
708
+ "type": "text",
709
+ "text": "4 LLM vs. LLM with IR System",
710
+ "text_level": 1,
711
+ "bbox": [
712
+ 112,
713
+ 689,
714
+ 413,
715
+ 707
716
+ ],
717
+ "page_idx": 3
718
+ },
719
+ {
720
+ "type": "text",
721
+ "text": "We initially present the overall results, highlighting the importance of label candidates and similar cases, and conduct a comparative analysis of the models. Subsequently, we investigate the relationship between label candidates and self-consistency to unveil their actual effects on expertise reasoning. Additionally, we perform an ablation study by replacing similar cases with fixed cases as demonstrations to further understand their impact.",
722
+ "bbox": [
723
+ 112,
724
+ 719,
725
+ 489,
726
+ 865
727
+ ],
728
+ "page_idx": 3
729
+ },
730
+ {
731
+ "type": "image",
732
+ "img_path": "images/620fe7dc4baab808679f7c64609c21920fadcfb6307c9e362caf890ff9646183.jpg",
733
+ "image_caption": [
734
+ "Figure 2: The macro comparison between the four settings. “+Label” refers to zero-shot multi-choice questions; “+Sim Case” refers to few-shot open questions and “+Label +Sim Case” refers to few-shot multi-choice questions. More than one points of a model in the last two settings refer to runs with different number of demonstrations."
735
+ ],
736
+ "image_footnote": [],
737
+ "bbox": [
738
+ 521,
739
+ 87,
740
+ 870,
741
+ 265
742
+ ],
743
+ "page_idx": 3
744
+ },
745
+ {
746
+ "type": "image",
747
+ "img_path": "images/058621cf7b920696a5ded18ebf7ce22d573e13f2fbf3fb20ad1dab34e7e7a260.jpg",
748
+ "image_caption": [
749
+ "Figure 3: Compare the models under each setting. Few-shot performances are averaged among 1-shot to 4-shot."
750
+ ],
751
+ "image_footnote": [],
752
+ "bbox": [
753
+ 519,
754
+ 400,
755
+ 705,
756
+ 564
757
+ ],
758
+ "page_idx": 3
759
+ },
760
+ {
761
+ "type": "image",
762
+ "img_path": "images/927a75a027158091b5c7362bb8583d03d067384c89367a300592ad4e44d85ee6.jpg",
763
+ "image_caption": [],
764
+ "image_footnote": [],
765
+ "bbox": [
766
+ 709,
767
+ 399,
768
+ 870,
769
+ 564
770
+ ],
771
+ "page_idx": 3
772
+ },
773
+ {
774
+ "type": "text",
775
+ "text": "4.1 Overall Results",
776
+ "text_level": 1,
777
+ "bbox": [
778
+ 507,
779
+ 637,
780
+ 678,
781
+ 651
782
+ ],
783
+ "page_idx": 3
784
+ },
785
+ {
786
+ "type": "text",
787
+ "text": "The macro comparison between the four settings is shown in Figure 2, where each point represents the performance of one specific run of one model.",
788
+ "bbox": [
789
+ 507,
790
+ 659,
791
+ 882,
792
+ 707
793
+ ],
794
+ "page_idx": 3
795
+ },
796
+ {
797
+ "type": "text",
798
+ "text": "Significance of label candidates and similar cases. In comparison to the zero-shot open question setting where LLMs work alone, the inclusion of label candidates, similar cases, or both demonstrates noteworthy enhancements. This highlights the effectiveness of our baseline solutions that leverage IR systems to expand the capabilities of LLMs in legal domains. These findings align with previous research that has also recognized the significance of the two components (Ma et al., 2023; Liu et al., 2021).",
799
+ "bbox": [
800
+ 505,
801
+ 709,
802
+ 884,
803
+ 884
804
+ ],
805
+ "page_idx": 3
806
+ },
807
+ {
808
+ "type": "text",
809
+ "text": "The effects of label candidates and similar cases differ slightly in terms of performance mean and",
810
+ "bbox": [
811
+ 507,
812
+ 887,
813
+ 882,
814
+ 917
815
+ ],
816
+ "page_idx": 3
817
+ },
818
+ {
819
+ "type": "page_footnote",
820
+ "text": "GPT-4 and ChatGPT have the same results. Following OpenAI's guidance, we use the python package tiktoken for tokenization",
821
+ "bbox": [
822
+ 112,
823
+ 879,
824
+ 487,
825
+ 917
826
+ ],
827
+ "page_idx": 3
828
+ },
829
+ {
830
+ "type": "page_number",
831
+ "text": "7340",
832
+ "bbox": [
833
+ 480,
834
+ 927,
835
+ 521,
836
+ 940
837
+ ],
838
+ "page_idx": 3
839
+ },
840
+ {
841
+ "type": "text",
842
+ "text": "variance. Label candidates contribute to a higher mean performance, while similar cases introduce greater variance. Examining the model performances in the third setting (+Sim Case) displayed in Figure 2, GPT-4 and ChatGPT exhibit more significant improvements from similar cases compared to their smaller counterparts. They also gain more benefit from similar cases than from label candidates. This observation can be attributed to the varying difficulty levels of knowledge utilization. While the knowledge within label candidates is readily accessible and straightforward, leveraging similar cases requires stronger language understanding and few-shot learning abilities.",
843
+ "bbox": [
844
+ 112,
845
+ 84,
846
+ 492,
847
+ 311
848
+ ],
849
+ "page_idx": 4
850
+ },
851
+ {
852
+ "type": "text",
853
+ "text": "Furthermore, the coexistence of label candidates and similar cases further enhances the performance of GPT-4 and ChatGPT, but it diminishes the performance of Vicuna, ChatGLM, and BLOOMZ. This suggests that smaller LLMs may encounter challenges in effectively managing knowledge in multiple forms simultaneously, leading to confusion.",
854
+ "bbox": [
855
+ 112,
856
+ 317,
857
+ 489,
858
+ 447
859
+ ],
860
+ "page_idx": 4
861
+ },
862
+ {
863
+ "type": "text",
864
+ "text": "Model comparison. The performances of the models under zero-shot and few-shot prompting is shown in Figure 3, where few-shot performances are averaged among 1-shot to 4-shot.",
865
+ "bbox": [
866
+ 112,
867
+ 453,
868
+ 489,
869
+ 519
870
+ ],
871
+ "page_idx": 4
872
+ },
873
+ {
874
+ "type": "text",
875
+ "text": "The zero-shot setting emphasizes the ability to understand instructions. When only instructions are available, BLOOMZ performs better than ChatGPT, indicating a superior multilingual instruction following ability. This result is reasonable as BLOOMZ is the only smaller LLM that is fine-tuned on multilingual instructions. Once provided with explicit domain knowledge, ChatGPT outperforms all smaller LLMs. The case is the same for BLOOMZ and ChatGLM, where ChatGLM overtakes BLOOMZ with knowledge of label candidates. BLOOMZ performs worst when prompted with two forms of knowledge, indicating that BLOOMZ is not very robust to prompts. Among the three smaller LLMs, ChatGLM is the most robust to various forms of knowledge.",
876
+ "bbox": [
877
+ 112,
878
+ 525,
879
+ 489,
880
+ 783
881
+ ],
882
+ "page_idx": 4
883
+ },
884
+ {
885
+ "type": "text",
886
+ "text": "The significant effects of label candidates and similar cases can be explained as they activate LLM's memory of relevant domain knowledge. This view can be supported by two pieces of evidence about the relationship between label candidates and self-consistency (Section 4.2) and the negligible effect of irrelevant cases as fixed demonstrations (Section 4.3).",
887
+ "bbox": [
888
+ 112,
889
+ 790,
890
+ 489,
891
+ 919
892
+ ],
893
+ "page_idx": 4
894
+ },
895
+ {
896
+ "type": "image",
897
+ "img_path": "images/797c37324a6cae109c7d203b9697dd318c533ebb16e08e086e16c03012b985f5.jpg",
898
+ "image_caption": [
899
+ "Figure 4: Changes of performance and self-consistency after adding label candidates. The change of each model is illustrated by an arrow pointing from the open question setting to the multi-choice setting."
900
+ ],
901
+ "image_footnote": [],
902
+ "bbox": [
903
+ 526,
904
+ 87,
905
+ 848,
906
+ 236
907
+ ],
908
+ "page_idx": 4
909
+ },
910
+ {
911
+ "type": "text",
912
+ "text": "4.2 Label Candidates Enhance Self-consistency and Confidence",
913
+ "text_level": 1,
914
+ "bbox": [
915
+ 507,
916
+ 326,
917
+ 806,
918
+ 359
919
+ ],
920
+ "page_idx": 4
921
+ },
922
+ {
923
+ "type": "text",
924
+ "text": "To further understand the effect of label candidates, we propose a metric to measure the self-consistency of LLMs that is calculated as the number of the majority prediction. Consistent outputs indicate a high level of confidence in LLMs, which is often associated with a better grasp of knowledge (Jiang et al., 2021, 2023).",
925
+ "bbox": [
926
+ 505,
927
+ 363,
928
+ 884,
929
+ 475
930
+ ],
931
+ "page_idx": 4
932
+ },
933
+ {
934
+ "type": "text",
935
+ "text": "The changes in performance and self-consistency after introducing label candidates are shown in Figure 4 as the arrows. We observe that the incorporation of label candidates leads to more consistent outputs (8 of 10 cases) and higher confidence in LLMs except zero-shot GPT-4 with a slight decrease and few-shot BLOOMZ. In the zero-shot setting, label candidates significantly boost LLM performances. We postulate that label candidates help by eliciting pre-stored domain knowledge with concise charge names. Besides, the self-consistency also correlates with model performances (7 of 10 cases). Such correlation is also observed in other tasks like question answering (Jiang et al., 2021). It is worth noting that label candidates decrease both self-consistency and performance of few-shot prompted BLOOMZ, which also aligns with the correlation.",
936
+ "bbox": [
937
+ 507,
938
+ 478,
939
+ 884,
940
+ 766
941
+ ],
942
+ "page_idx": 4
943
+ },
944
+ {
945
+ "type": "text",
946
+ "text": "4.3 Domain Knowledge Is More Critical Than Task Illustration",
947
+ "text_level": 1,
948
+ "bbox": [
949
+ 507,
950
+ 780,
951
+ 880,
952
+ 810
953
+ ],
954
+ "page_idx": 4
955
+ },
956
+ {
957
+ "type": "text",
958
+ "text": "There is a possible argument that similar demonstrations can help LLMs understand instructions and tasks. To disentangle their effects on task illustration and provision of domain knowledge, we",
959
+ "bbox": [
960
+ 507,
961
+ 818,
962
+ 884,
963
+ 883
964
+ ],
965
+ "page_idx": 4
966
+ },
967
+ {
968
+ "type": "page_footnote",
969
+ "text": "For example, if the five sampled outputs are mapped to labels of (a,a,a,b,c), the consistency score is 3.",
970
+ "bbox": [
971
+ 507,
972
+ 892,
973
+ 882,
974
+ 917
975
+ ],
976
+ "page_idx": 4
977
+ },
978
+ {
979
+ "type": "page_number",
980
+ "text": "7341",
981
+ "bbox": [
982
+ 480,
983
+ 927,
984
+ 517,
985
+ 940
986
+ ],
987
+ "page_idx": 4
988
+ },
989
+ {
990
+ "type": "image",
991
+ "img_path": "images/eea72bf54c5ffa53aceb9880908d9a5af00872456134b4818d6da649d2fe31a9.jpg",
992
+ "image_caption": [
993
+ "Figure 5: The effects of fixed (irrelevant) and similar cases as demonstrations. Divided by the baseline setting of zero-shot open questions, the left part refers to fixed demonstrations with increasing numbers of demonstrations, while the right part refers to similar demonstrations. The shadow area represents the range of standard deviation."
994
+ ],
995
+ "image_footnote": [],
996
+ "bbox": [
997
+ 122,
998
+ 86,
999
+ 475,
1000
+ 227
1001
+ ],
1002
+ "page_idx": 5
1003
+ },
1004
+ {
1005
+ "type": "text",
1006
+ "text": "experiment with irrelevant demonstrations fixed for all test samples. We manually select two common cases with frequent charges in the original dataset as the fixed demonstrations. The 1-shot performance was averaged on the two demonstrations.",
1007
+ "bbox": [
1008
+ 112,
1009
+ 372,
1010
+ 487,
1011
+ 451
1012
+ ],
1013
+ "page_idx": 5
1014
+ },
1015
+ {
1016
+ "type": "text",
1017
+ "text": "We compare the effects of fixed and similar demonstrations with the baseline setting of zero-shot open questions in Figure 5. The change of performance from center to left demonstrates that fixed demonstrations hardly benefit LLMs and sometimes harm the performance (e.g., ChatGLM). This indicates that LLMs can basically understand instructions and do not need general demonstrations for task clarification, implying that the main challenge of expertise reasoning is to recall domain knowledge instead of understanding a specific task.",
1018
+ "bbox": [
1019
+ 112,
1020
+ 455,
1021
+ 489,
1022
+ 631
1023
+ ],
1024
+ "page_idx": 5
1025
+ },
1026
+ {
1027
+ "type": "text",
1028
+ "text": "We inspect the notable performance drop of ChatGLM resulting from fixed demonstrations. We find that ChatGLM tends to analyze the cases of both demonstrations and test samples and then answer with both of their charges. Its wordy style seems to result from the fine-tuning dialog corpus where an assistant LLM is supposed to provide rich information. In contrast, similar cases seem to encourage more concise outputs following the format of demonstrations.",
1029
+ "bbox": [
1030
+ 112,
1031
+ 633,
1032
+ 489,
1033
+ 791
1034
+ ],
1035
+ "page_idx": 5
1036
+ },
1037
+ {
1038
+ "type": "text",
1039
+ "text": "5 Paradox of Information Retrieval System",
1040
+ "text_level": 1,
1041
+ "bbox": [
1042
+ 112,
1043
+ 809,
1044
+ 436,
1045
+ 841
1046
+ ],
1047
+ "page_idx": 5
1048
+ },
1049
+ {
1050
+ "type": "text",
1051
+ "text": "The significance of similar demonstrations illustrated in Section 4.3 has motivated research focusing on prompting-oriented IR systems (Rubin et al., 2021; Sun et al., 2023) to retrieve high qual",
1052
+ "bbox": [
1053
+ 112,
1054
+ 854,
1055
+ 489,
1056
+ 917
1057
+ ],
1058
+ "page_idx": 5
1059
+ },
1060
+ {
1061
+ "type": "image",
1062
+ "img_path": "images/0474ae253fa7623cb6310b53e5d59e27aaf151b2cd9ad07d38f2f015a7f64a32.jpg",
1063
+ "image_caption": [
1064
+ "Figure 6: The performance of ChatGPT coordinated with a series of simulated IR systems with varying capabilities as measured by Precision@1. The vertical blue line represents the threshold of IR capability at which IR systems overtake ChatGPT. The performance of ChatGPT in the real setting (1-shot open questions) is indicated by the red plus sign."
1065
+ ],
1066
+ "image_footnote": [],
1067
+ "bbox": [
1068
+ 521,
1069
+ 87,
1070
+ 870,
1071
+ 206
1072
+ ],
1073
+ "page_idx": 5
1074
+ },
1075
+ {
1076
+ "type": "text",
1077
+ "text": "ity demonstrations. However, we raise an intuitive question: Do LLMs gain substantial improvement from IR systems compared to the kNN baseline that harnesses IR systems for classification tasks? The question is inspired by our observation that the BM25 retriever achieves $48.03\\%$ of Precision@1 and $57.68\\%$ prediction accuracy by majority vote of top $k = 17$ retrieved similar cases.",
1078
+ "bbox": [
1079
+ 505,
1080
+ 349,
1081
+ 882,
1082
+ 476
1083
+ ],
1084
+ "page_idx": 5
1085
+ },
1086
+ {
1087
+ "type": "text",
1088
+ "text": "This observation suggests a paradoxical scenario wherein an IR system outperforms the combination of LLM and IR, with the LLM taking on the leading role and the IR serving as a supporting role. In such a scenario, the LLM becomes redundant due to its failure to fully utilize the informative retrieved documents.",
1089
+ "bbox": [
1090
+ 505,
1091
+ 478,
1092
+ 882,
1093
+ 588
1094
+ ],
1095
+ "page_idx": 5
1096
+ },
1097
+ {
1098
+ "type": "text",
1099
+ "text": "To investigate the paradox, instead of experimenting with different IR systems, we manipulate the BM25 retriever to simulate a series of IR systems with different capabilities measured by Precision@1 as described by Section 2.3. We take a case study of ChatGPT, whose 1-shot performance under different IR systems (denoted as Precision@1) is shown in Figure 6.",
1100
+ "bbox": [
1101
+ 505,
1102
+ 590,
1103
+ 882,
1104
+ 717
1105
+ ],
1106
+ "page_idx": 5
1107
+ },
1108
+ {
1109
+ "type": "text",
1110
+ "text": "Results Although the performance of ChatGPT enhanced by IR systems improves with IR capability, it will eventually underperform the IR system once the IR capability surpasses a certain threshold. In the ideal situation where true similar cases are always retrieved, ChatGPT is unable to attain $100\\%$ accuracy and lags significantly behind the optimal IR system. According to Appendix A.4, all smaller LLMs are not comparable to the BM25 retriever.",
1111
+ "bbox": [
1112
+ 507,
1113
+ 719,
1114
+ 884,
1115
+ 862
1116
+ ],
1117
+ "page_idx": 5
1118
+ },
1119
+ {
1120
+ "type": "text",
1121
+ "text": "Discussion The findings demonstrate that LLMs face challenges in effectively leveraging informa",
1122
+ "bbox": [
1123
+ 507,
1124
+ 864,
1125
+ 882,
1126
+ 896
1127
+ ],
1128
+ "page_idx": 5
1129
+ },
1130
+ {
1131
+ "type": "page_footnote",
1132
+ "text": "It is identical to the precision of $k\\mathrm{NN}$ with $k = 1$",
1133
+ "bbox": [
1134
+ 526,
1135
+ 903,
1136
+ 836,
1137
+ 917
1138
+ ],
1139
+ "page_idx": 5
1140
+ },
1141
+ {
1142
+ "type": "page_number",
1143
+ "text": "7342",
1144
+ "bbox": [
1145
+ 480,
1146
+ 927,
1147
+ 519,
1148
+ 940
1149
+ ],
1150
+ "page_idx": 5
1151
+ },
1152
+ {
1153
+ "type": "image",
1154
+ "img_path": "images/172f2228b736de67a5247c124932299a26a9018979977cbb67db93e147fb597c.jpg",
1155
+ "image_caption": [
1156
+ "Figure 7: Performance vs. the number of similar demonstrations of the five LLMs."
1157
+ ],
1158
+ "image_footnote": [],
1159
+ "bbox": [
1160
+ 122,
1161
+ 86,
1162
+ 480,
1163
+ 227
1164
+ ],
1165
+ "page_idx": 6
1166
+ },
1167
+ {
1168
+ "type": "text",
1169
+ "text": "tive retrieved documents. This underscores the need for significant research efforts to enhance the synergy between auto-regressive language models and retrieval by conditioning model outputs more on retrieved documents. Previous work has explored the augmentation of LLMs with retrieval at both the pre-training and fine-tuning stages (Borgeaud et al., 2022; Wang et al., 2023). Moreover, the marginal and inadequate improvement with retrieval indicates the limited legal reasoning ability of existing general LLMs. There is a need for future efforts to enhance domain-specific reasoning abilities of pre-trained foundation models.",
1170
+ "bbox": [
1171
+ 112,
1172
+ 297,
1173
+ 489,
1174
+ 505
1175
+ ],
1176
+ "page_idx": 6
1177
+ },
1178
+ {
1179
+ "type": "text",
1180
+ "text": "6 Ablation Study",
1181
+ "text_level": 1,
1182
+ "bbox": [
1183
+ 112,
1184
+ 518,
1185
+ 280,
1186
+ 533
1187
+ ],
1188
+ "page_idx": 6
1189
+ },
1190
+ {
1191
+ "type": "text",
1192
+ "text": "6.1 More Demonstrations Are Not Always Better",
1193
+ "text_level": 1,
1194
+ "bbox": [
1195
+ 112,
1196
+ 544,
1197
+ 460,
1198
+ 575
1199
+ ],
1200
+ "page_idx": 6
1201
+ },
1202
+ {
1203
+ "type": "text",
1204
+ "text": "The impact of the number of similar demonstrations $(n)$ is depicted in Figure 7. It is evident that GPT-4 and ChatGPT demonstrate proficiency in handling larger numbers of demonstrations, leading to enhanced performance, whereas Vicuna, ChatGLM and BLOOZ experience varying degrees of performance degradation with increasing numbers. Notably, ChatGLM displays the least sensitivity to $n$ . Furthermore, even ChatGPT's performance declines when $n$ is increased from three to four. The performance improvement resulting from larger values of $n$ can be attributed to the increased recall of true similar cases. Conversely, the decline in performance can be attributed to the noise introduced by more false similar cases.",
1205
+ "bbox": [
1206
+ 112,
1207
+ 581,
1208
+ 489,
1209
+ 820
1210
+ ],
1211
+ "page_idx": 6
1212
+ },
1213
+ {
1214
+ "type": "text",
1215
+ "text": "Performance variations. The change of performance after including an additional demonstration are visualized using heat maps in Figure 8. For each model, the three heat maps stand for the variations from k-shot to $(\\mathrm{k} + 1)$ -shot, which are denoted below. For each heat map, the two rows indicate",
1216
+ "bbox": [
1217
+ 112,
1218
+ 822,
1219
+ 489,
1220
+ 917
1221
+ ],
1222
+ "page_idx": 6
1223
+ },
1224
+ {
1225
+ "type": "text",
1226
+ "text": "the inclusion of a new demonstration with true (T) or false (F) similar cases, while the columns indicate the combinations of existing demonstrations. Take the second heat map as an example. The cell in the column of (F, T) and the row of (T) displays the performance variation between 2-shot of (F, T) demonstrations and 3-shot of (F, T, T) demonstrations. Purple represents performance improvement, while green represents performance decline.",
1227
+ "bbox": [
1228
+ 507,
1229
+ 84,
1230
+ 884,
1231
+ 228
1232
+ ],
1233
+ "page_idx": 6
1234
+ },
1235
+ {
1236
+ "type": "text",
1237
+ "text": "For ChatGPT and BLOOMZ, the second rows of their three heat maps are mainly in purple, indicating significant enhancements resulting from the inclusion of true similar cases. However, the first lines of BLOOMZ display a deeper green color than those of ChatGPT, suggesting that BLOOMZ experiences greater degree of performance declines caused by the inclusion of false similar cases. These findings indicate different sensitivity to false similar demonstrations. Powerful language models like GPT-4 and ChatGPT exhibit robustness to noise in false similar cases, allowing them to remain focused on relevant information in true similar cases. In contrast, weaker LLMs are susceptible to the influence of such noise. Overall, ChatGPT performs better when provided with more similar demonstrations, whereas BLOOMZ demonstrates the opposite, as shown in Figure 7.",
1238
+ "bbox": [
1239
+ 507,
1240
+ 230,
1241
+ 884,
1242
+ 520
1243
+ ],
1244
+ "page_idx": 6
1245
+ },
1246
+ {
1247
+ "type": "text",
1248
+ "text": "The conclusion is that increased numbers of demonstrations have both positive and negative implications for expertise reasoning. However, LLMs could potentially gain from additional demonstrations in tasks that requires clear task illustration.",
1249
+ "bbox": [
1250
+ 507,
1251
+ 521,
1252
+ 882,
1253
+ 602
1254
+ ],
1255
+ "page_idx": 6
1256
+ },
1257
+ {
1258
+ "type": "text",
1259
+ "text": "6.2 The Impact of Absent Ground Truth Labels",
1260
+ "text_level": 1,
1261
+ "bbox": [
1262
+ 507,
1263
+ 619,
1264
+ 843,
1265
+ 650
1266
+ ],
1267
+ "page_idx": 6
1268
+ },
1269
+ {
1270
+ "type": "text",
1271
+ "text": "We manually incorporate ground-truth labels into label candidates in cases where they are absent, which may occur due to the limited recall capability of the IR system described in Section 2.2. The test samples are categorized into two groups, namely \"Easy\" and \"Hard\", based on the retrieval of their ground truth labels by the IR system. The original performance of the two groups and the performance of the \"Hard\" group with modified prompts to include ground truth labels, namely \"Hard+GT\", are displayed in Figure 9.",
1272
+ "bbox": [
1273
+ 505,
1274
+ 659,
1275
+ 882,
1276
+ 835
1277
+ ],
1278
+ "page_idx": 6
1279
+ },
1280
+ {
1281
+ "type": "text",
1282
+ "text": "The performance gaps between the \"Easy\" and \"Hard+GT\" groups suggest that challenging samples for IR systems are also difficult for LLMs. However, this gap is insignificant for the powerful GPT-4 who perceives them as equal challeng",
1283
+ "bbox": [
1284
+ 507,
1285
+ 839,
1286
+ 884,
1287
+ 917
1288
+ ],
1289
+ "page_idx": 6
1290
+ },
1291
+ {
1292
+ "type": "page_number",
1293
+ "text": "7343",
1294
+ "bbox": [
1295
+ 480,
1296
+ 927,
1297
+ 519,
1298
+ 940
1299
+ ],
1300
+ "page_idx": 6
1301
+ },
1302
+ {
1303
+ "type": "image",
1304
+ "img_path": "images/fceac87db227ad2a57df6f7e774a27f1bdaa0fa61b7ab09823a4b90fdef37bc8.jpg",
1305
+ "image_caption": [
1306
+ "Figure 8: Heat maps of performance variations resulting from the inclusion of an addition demonstration. \"T\" corresponds to demonstrations with true similar cases, while \"F\" represents those with false similar cases. Each row represents the included new demonstration, while each column indicates the status of existing demonstrations."
1307
+ ],
1308
+ "image_footnote": [],
1309
+ "bbox": [
1310
+ 179,
1311
+ 84,
1312
+ 833,
1313
+ 227
1314
+ ],
1315
+ "page_idx": 7
1316
+ },
1317
+ {
1318
+ "type": "image",
1319
+ "img_path": "images/37506c50c53710f25935e164f14860b2a53239585ed1d5a3b8f8ac353fd38898.jpg",
1320
+ "image_caption": [
1321
+ "Figure 9: The performance of \"Easy\" and \"Hard\" samples under the setting of zero-shot multi-choice questions. \"Hard+GT\" refers to improvement of including the absent ground truth labels in label candidates."
1322
+ ],
1323
+ "image_footnote": [],
1324
+ "bbox": [
1325
+ 122,
1326
+ 311,
1327
+ 478,
1328
+ 432
1329
+ ],
1330
+ "page_idx": 7
1331
+ },
1332
+ {
1333
+ "type": "text",
1334
+ "text": "ing. The improvement of \"Hard+GT\" compared to \"Hard\" is notable in GPT-4, ChatGPT and ChatGLM but inconspicuous in Vicuna with inferior competency in the law. Considering the relatively small size of the \"Hard\" group (79/560), the absence of ground truth labels does not have a significant impact, especially for weaker LLMs.",
1335
+ "bbox": [
1336
+ 112,
1337
+ 536,
1338
+ 489,
1339
+ 650
1340
+ ],
1341
+ "page_idx": 7
1342
+ },
1343
+ {
1344
+ "type": "text",
1345
+ "text": "6.3 Incorporation of Law Articles",
1346
+ "text_level": 1,
1347
+ "bbox": [
1348
+ 112,
1349
+ 668,
1350
+ 394,
1351
+ 683
1352
+ ],
1353
+ "page_idx": 7
1354
+ },
1355
+ {
1356
+ "type": "text",
1357
+ "text": "We examine the effect of incorporating legal articles that explicitly define the charges into prompts. For each charge retrieved by the IR system<sup>11</sup>, ChatGPT is required to determine whether the defendant is guilty for the particular charge by answering with a yes or no. We find that $94.46\\%$ of the ground truth charges are accurately detected, while only $27.31\\%$ of the detected charges are correct. The high recall and low precision indicate a substantial difference between ChatGPT and legal experts in the ability to distinguish charges and make precise judgments.",
1358
+ "bbox": [
1359
+ 112,
1360
+ 693,
1361
+ 489,
1362
+ 885
1363
+ ],
1364
+ "page_idx": 7
1365
+ },
1366
+ {
1367
+ "type": "text",
1368
+ "text": "7 Discussion",
1369
+ "text_level": 1,
1370
+ "bbox": [
1371
+ 509,
1372
+ 309,
1373
+ 636,
1374
+ 323
1375
+ ],
1376
+ "page_idx": 7
1377
+ },
1378
+ {
1379
+ "type": "text",
1380
+ "text": "We compare the LLMs with supervised baselines. We fine-tune BERT (Devlin et al., 2018) on the same training set and achieve a comparable accuracy of $68\\%$ to ChatGPT but lower than GPT-4. Since LLMs are not fine-tuned on the specific LJP task, this result highlights the remarkable superiority of LLMs in acquiring significant knowledge and leveraging transfer learning Raffel et al. (2020).",
1381
+ "bbox": [
1382
+ 507,
1383
+ 334,
1384
+ 884,
1385
+ 462
1386
+ ],
1387
+ "page_idx": 7
1388
+ },
1389
+ {
1390
+ "type": "text",
1391
+ "text": "However, we observe that BERT's performance improves to $89\\%$ when trained with the original training set ( $\\sim 10\\mathrm{K}$ ). We find that certain knowledge is present in shadow features, which can be easily learned with supervision. These superficial features can result in biased supervised models. Fortunately, unsupervised pre-training objectives, make LLMs more robust and less vulnerable to this issue. This depicts a promising future for NLP applications in various domains.",
1392
+ "bbox": [
1393
+ 507,
1394
+ 463,
1395
+ 882,
1396
+ 621
1397
+ ],
1398
+ "page_idx": 7
1399
+ },
1400
+ {
1401
+ "type": "text",
1402
+ "text": "8 Conclusion",
1403
+ "text_level": 1,
1404
+ "bbox": [
1405
+ 507,
1406
+ 636,
1407
+ 640,
1408
+ 651
1409
+ ],
1410
+ "page_idx": 7
1411
+ },
1412
+ {
1413
+ "type": "text",
1414
+ "text": "To address the deficiency in evaluating the competency of LLMs in the field of law, we focused on the task of legal judgment prediction and devised four settings to facilitate a thorough evaluation that encompassed both open and multiple-choice questions and incorporated similar cases to aid in the decision-making process.",
1415
+ "bbox": [
1416
+ 507,
1417
+ 661,
1418
+ 884,
1419
+ 772
1420
+ ],
1421
+ "page_idx": 7
1422
+ },
1423
+ {
1424
+ "type": "text",
1425
+ "text": "The evaluation results revealed different behaviors among the prominent LLMs, namely GPT-4 and ChatGPT, compared to their smaller counterparts. Both GPT-4 and ChatGPT exhibited remarkable proficiency in effectively leveraging domain knowledge in various formats. Among the smaller LLMs, ChatGLM displayed greater robustness, while BLOOMZ showcased superior zero-shot ability.",
1426
+ "bbox": [
1427
+ 507,
1428
+ 774,
1429
+ 885,
1430
+ 917
1431
+ ],
1432
+ "page_idx": 7
1433
+ },
1434
+ {
1435
+ "type": "page_footnote",
1436
+ "text": "we also include the ground truth charge",
1437
+ "bbox": [
1438
+ 131,
1439
+ 903,
1440
+ 384,
1441
+ 917
1442
+ ],
1443
+ "page_idx": 7
1444
+ },
1445
+ {
1446
+ "type": "page_number",
1447
+ "text": "7344",
1448
+ "bbox": [
1449
+ 480,
1450
+ 927,
1451
+ 519,
1452
+ 940
1453
+ ],
1454
+ "page_idx": 7
1455
+ },
1456
+ {
1457
+ "type": "text",
1458
+ "text": "We presented an intriguing paradox wherein LLMs could become abundant in the presence of a powerful IR system. When improving IR systems to benefit LLMs, it is crucial for researchers to acknowledge this paradoxical scenario and prevent great disparity between LLMs and IR systems.",
1459
+ "bbox": [
1460
+ 112,
1461
+ 84,
1462
+ 489,
1463
+ 181
1464
+ ],
1465
+ "page_idx": 8
1466
+ },
1467
+ {
1468
+ "type": "text",
1469
+ "text": "Limitations",
1470
+ "text_level": 1,
1471
+ "bbox": [
1472
+ 112,
1473
+ 198,
1474
+ 220,
1475
+ 212
1476
+ ],
1477
+ "page_idx": 8
1478
+ },
1479
+ {
1480
+ "type": "text",
1481
+ "text": "One limitation of this paper is the use of the close-source GPT-4 and ChatGPT whose availability depends on the commercial company OpenAI. According to OpenAI, the ChatGPT and GPT-4 versions used in this paper, namely gpt-3.5-turbo-0301 and gpt-4-0314, will be deprecated and not available after September 13th, 2023.",
1482
+ "bbox": [
1483
+ 112,
1484
+ 228,
1485
+ 489,
1486
+ 355
1487
+ ],
1488
+ "page_idx": 8
1489
+ },
1490
+ {
1491
+ "type": "text",
1492
+ "text": "Another limitation pertains to the selection of LLMs. Due to the rapid emergence of new LLMs, we are not able to include all of them with the constraint of limited time. Instead of more models, we focus more on designing comprehensive evaluation settings and conducting insightful analyses to shed light on other domains.",
1493
+ "bbox": [
1494
+ 112,
1495
+ 357,
1496
+ 489,
1497
+ 470
1498
+ ],
1499
+ "page_idx": 8
1500
+ },
1501
+ {
1502
+ "type": "text",
1503
+ "text": "Ethics Statement",
1504
+ "text_level": 1,
1505
+ "bbox": [
1506
+ 114,
1507
+ 488,
1508
+ 265,
1509
+ 504
1510
+ ],
1511
+ "page_idx": 8
1512
+ },
1513
+ {
1514
+ "type": "text",
1515
+ "text": "The task of legal judgment prediction is used to evaluate LLM's competency in the law. The primary objective of this task is to assist judges and lawyers in comprehending lengthy legal documents by offering them a supplementary tool. It is important to note that this task does not seek to replace the roles of judges and lawyers, nor does it aim to determine the guilt or charges of defendants through machine learning algorithms. Additionally, there is research focused on interpreting LJP models, aiming to enhance the transparency of black-box models for improved utilization by legal practitioners. The paper utilizes a public and anonymized dataset to exclude the potential issue of personal information leakage.",
1516
+ "bbox": [
1517
+ 112,
1518
+ 518,
1519
+ 489,
1520
+ 760
1521
+ ],
1522
+ "page_idx": 8
1523
+ },
1524
+ {
1525
+ "type": "text",
1526
+ "text": "Acknowledgements",
1527
+ "text_level": 1,
1528
+ "bbox": [
1529
+ 114,
1530
+ 777,
1531
+ 285,
1532
+ 793
1533
+ ],
1534
+ "page_idx": 8
1535
+ },
1536
+ {
1537
+ "type": "text",
1538
+ "text": "We thank all reviewers for their constructive comments. This research is supported by NExT Research Center, the National Natural Science Foundation of China (9227010114) and the University Synergy Innovation Program of Anhui Province (GXXT-2022-040).",
1539
+ "bbox": [
1540
+ 112,
1541
+ 806,
1542
+ 489,
1543
+ 903
1544
+ ],
1545
+ "page_idx": 8
1546
+ },
1547
+ {
1548
+ "type": "text",
1549
+ "text": "References",
1550
+ "text_level": 1,
1551
+ "bbox": [
1552
+ 510,
1553
+ 83,
1554
+ 608,
1555
+ 98
1556
+ ],
1557
+ "page_idx": 8
1558
+ },
1559
+ {
1560
+ "type": "list",
1561
+ "sub_type": "ref_text",
1562
+ "list_items": [
1563
+ "Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George Bm Van Den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. 2022. Improving language models by retrieving from trillions of tokens. In International conference on machine learning, pages 2206-2240. PMLR.",
1564
+ "Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901.",
1565
+ "Ilias Chalkidis, Ion Androutsopoulos, and Nikolaos Aletras. 2019. Neural legal judgment prediction in english. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4317-4323.",
1566
+ "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. 2023. Vicuna: An opensource chatbot impressing gpt-4 with $90\\%$ * chatgpt quality.",
1567
+ "Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. 2017. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30.",
1568
+ "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.",
1569
+ "Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, and Jie Tang. 2022. Glm: General language model pretraining with autoregressive blank infilling. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 320-335.",
1570
+ "Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2020. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300.",
1571
+ "Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531.",
1572
+ "Zhengbao Jiang, Jun Araki, Haibo Ding, and Graham Neubig. 2021. How can we know when language models know? on the calibration of language models for question answering. Transactions of the Association for Computational Linguistics, 9:962-977.",
1573
+ "Zhengbao Jiang, Frank F Xu, Luyu Gao, Zhiqing Sun, Qian Liu, Jane Dwivedi-Yu, Yiming Yang, Jamie Callan, and Graham Neubig. 2023. Active retrieval augmented generation. arXiv preprint arXiv:2305.06983."
1574
+ ],
1575
+ "bbox": [
1576
+ 510,
1577
+ 105,
1578
+ 885,
1579
+ 917
1580
+ ],
1581
+ "page_idx": 8
1582
+ },
1583
+ {
1584
+ "type": "page_number",
1585
+ "text": "7345",
1586
+ "bbox": [
1587
+ 480,
1588
+ 928,
1589
+ 519,
1590
+ 941
1591
+ ],
1592
+ "page_idx": 8
1593
+ },
1594
+ {
1595
+ "type": "list",
1596
+ "sub_type": "ref_text",
1597
+ "list_items": [
1598
+ "Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2021. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804.",
1599
+ "Yubo Ma, Yixin Cao, YongChing Hong, and Aixin Sun. 2023. Large language model is not a good few-shot information extractor, but a good reranker for hard samples! arXiv preprint arXiv:2303.08559.",
1600
+ "Eric Martínez. 2023. Re-evaluating gpt-4's bar exam performance. Available at SSRN 4441311.",
1601
+ "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. 2022. Crosslingual generalization through multitask finetuning. arXiv preprint arXiv:2211.01786.",
1602
+ "OpenAI. 2023. Gpt-4 technical report. arXiv preprint arXiv:2303.08774.",
1603
+ "Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730-27744.",
1604
+ "Aleksandar Petrov, Emanuele La Malfa, Philip HS Torr, and Adel Bibi. 2023. Language model tokenizers introduce unfairness between languages. arXiv preprint arXiv:2305.15425.",
1605
+ "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485-5551.",
1606
+ "Ohad Rubin, Jonathan Herzig, and Jonathan Berant. 2021. Learning to retrieve prompts for in-context learning. arXiv preprint arXiv:2112.08633.",
1607
+ "Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. 2022. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100.",
1608
+ "Olga Shulayeva, Advaith Siddharthan, and Adam Wyner. 2017. Recognizing cited facts and principles in legal judgements. Artificial Intelligence and Law, 25(1):107-126.",
1609
+ "Xiaofei Sun, Linfeng Dong, Xiaoya Li, Zhen Wan, Shuhe Wang, Tianwei Zhang, Jiwei Li, Fei Cheng, Lingjuan Lyu, Fei Wu, and Guoyin Wang. 2023. Pushing the limits of chatgpt on nlp tasks.",
1610
+ "Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro,"
1611
+ ],
1612
+ "bbox": [
1613
+ 115,
1614
+ 85,
1615
+ 485,
1616
+ 917
1617
+ ],
1618
+ "page_idx": 9
1619
+ },
1620
+ {
1621
+ "type": "list",
1622
+ "sub_type": "ref_text",
1623
+ "list_items": [
1624
+ "Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.",
1625
+ "Boxin Wang, Wei Ping, Peng Xu, Lawrence McAfee, Zihan Liu, Mohammad Shoeybi, Yi Dong, Oleksii Kuchaiev, Bo Li, Chaowei Xiao, et al. 2023. Shall we pretrain autoregressive language models with retrieval? a comprehensive study. arXiv preprint arXiv:2304.06762.",
1626
+ "Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2022. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171.",
1627
+ "Chaojun Xiao, Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Zhiyuan Liu, Maosong Sun, Yansong Feng, Xianpei Han, Zhen Hu, Heng Wang, et al. 2018. Cail2018: A large-scale legal dataset for judgment prediction. arXiv preprint arXiv:1807.02478.",
1628
+ "Chaojun Xiao, Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Zhiyuan Liu, Maosong Sun, Tianyang Zhang, Xianpei Han, Zhen Hu, Heng Wang, et al. 2019. Cail2019-scm: A dataset of similar case matching in legal domain. arXiv preprint arXiv:1911.08962.",
1629
+ "Haoxi Zhong, Yuzhong Wang, Cunchao Tu, Tianyang Zhang, Zhiyuan Liu, and Maosong Sun. 2020a. Iteratively questioning and answering for interpretable legal judgment prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1250-1257.",
1630
+ "Haoxi Zhong, Chaojun Xiao, Cunchao Tu, Tianyang Zhang, Zhiyuan Liu, and Maosong Sun. 2020b. How does nlp benefit legal system: A summary of legal artificial intelligence. arXiv preprint arXiv:2004.12158."
1631
+ ],
1632
+ "bbox": [
1633
+ 510,
1634
+ 85,
1635
+ 880,
1636
+ 605
1637
+ ],
1638
+ "page_idx": 9
1639
+ },
1640
+ {
1641
+ "type": "page_number",
1642
+ "text": "7346",
1643
+ "bbox": [
1644
+ 480,
1645
+ 928,
1646
+ 519,
1647
+ 940
1648
+ ],
1649
+ "page_idx": 9
1650
+ },
1651
+ {
1652
+ "type": "text",
1653
+ "text": "A Appendix",
1654
+ "text_level": 1,
1655
+ "bbox": [
1656
+ 114,
1657
+ 84,
1658
+ 236,
1659
+ 99
1660
+ ],
1661
+ "page_idx": 10
1662
+ },
1663
+ {
1664
+ "type": "text",
1665
+ "text": "A.1 Prompt Templates",
1666
+ "text_level": 1,
1667
+ "bbox": [
1668
+ 114,
1669
+ 110,
1670
+ 307,
1671
+ 124
1672
+ ],
1673
+ "page_idx": 10
1674
+ },
1675
+ {
1676
+ "type": "text",
1677
+ "text": "The prompt template is shown in Figure 10. The translation of the original Chinese prompt is displayed using orange text. The setting of zero-shot open questions use a longer instruction that appends \"Output the charge name directly\" to the instruction in Figure A.1.",
1678
+ "bbox": [
1679
+ 112,
1680
+ 131,
1681
+ 487,
1682
+ 227
1683
+ ],
1684
+ "page_idx": 10
1685
+ },
1686
+ {
1687
+ "type": "image",
1688
+ "img_path": "images/2f571fc406aeb44a37b39fa8436dcaf4cb565f2f8dbdaee851cee92ed3b8a327.jpg",
1689
+ "image_caption": [
1690
+ "Figure 10: The prompt template in Chinese and English."
1691
+ ],
1692
+ "image_footnote": [],
1693
+ "bbox": [
1694
+ 119,
1695
+ 243,
1696
+ 468,
1697
+ 382
1698
+ ],
1699
+ "page_idx": 10
1700
+ },
1701
+ {
1702
+ "type": "text",
1703
+ "text": "A.2 Robust to Fixed Demonstrations",
1704
+ "text_level": 1,
1705
+ "bbox": [
1706
+ 114,
1707
+ 439,
1708
+ 418,
1709
+ 454
1710
+ ],
1711
+ "page_idx": 10
1712
+ },
1713
+ {
1714
+ "type": "table",
1715
+ "img_path": "images/ac846278a1128c582af753f3fa49f81f2815f8dfaa13c2157b3810c6f4b2d04b.jpg",
1716
+ "table_caption": [],
1717
+ "table_footnote": [],
1718
+ "table_body": "<table><tr><td>Model</td><td>1shot</td><td>2shot</td></tr><tr><td>GPT-4</td><td>49.59 / 48.84</td><td>50.69</td></tr><tr><td>ChatGPT</td><td>47.01 / 46.57</td><td>47.55</td></tr><tr><td>Vicuna-13B</td><td>22.74 / 29.38</td><td>28.37</td></tr><tr><td>ChatGLM-6B</td><td>22.39 / 25.14</td><td>21.36</td></tr><tr><td>BLOOMZ-7B</td><td>36.65 / 43.94</td><td>42.24</td></tr></table>",
1719
+ "bbox": [
1720
+ 147,
1721
+ 468,
1722
+ 453,
1723
+ 569
1724
+ ],
1725
+ "page_idx": 10
1726
+ },
1727
+ {
1728
+ "type": "text",
1729
+ "text": "We examine the effects of the two fixed cases mentioned in Section 4.3 in Table 2. We find that GPT-4 and ChatGPT are robust to the selection of the fixed demonstration in 1-shot setting, while Vicuna, ChatGLM and BLOOMZ are less robust.",
1730
+ "bbox": [
1731
+ 112,
1732
+ 627,
1733
+ 485,
1734
+ 708
1735
+ ],
1736
+ "page_idx": 10
1737
+ },
1738
+ {
1739
+ "type": "text",
1740
+ "text": "A.3 Comparison with Supervised Baselines",
1741
+ "text_level": 1,
1742
+ "bbox": [
1743
+ 114,
1744
+ 720,
1745
+ 468,
1746
+ 736
1747
+ ],
1748
+ "page_idx": 10
1749
+ },
1750
+ {
1751
+ "type": "text",
1752
+ "text": "To understand the performance of supervised finetuning (SFT) baselines on LJP, we experiment on three models: BERT $^{12}$ , XLM-RoBERTa $^{13}$ and DeBERTa $^{14}$ . These models are fine-tuned on two datasets of different sizes: the original CAIL dataset (~100k samples) and the sampled training set (1120 samples) that is used as retrieval corpus described in Section 3.2, denoted as CAIL_few.",
1753
+ "bbox": [
1754
+ 112,
1755
+ 741,
1756
+ 487,
1757
+ 869
1758
+ ],
1759
+ "page_idx": 10
1760
+ },
1761
+ {
1762
+ "type": "text",
1763
+ "text": "The SFT models are evaluated on the same evaluation dataset described in Section 3.2. The smaller training set aims to compare the few-shot performance of SFT baselines and LLMs in low data scenario.",
1764
+ "bbox": [
1765
+ 507,
1766
+ 84,
1767
+ 882,
1768
+ 162
1769
+ ],
1770
+ "page_idx": 10
1771
+ },
1772
+ {
1773
+ "type": "text",
1774
+ "text": "The results of SFT models are shown in Figure 3. Considering the highest accuracy of GPT-4 being $74.46\\%$ (multi-choice, 4shot), GPT-4 can outperform supervised baselines in low data scenario. If there is abundant training data, supervised baselines are still better than GPT-4 by $15\\%$ .",
1775
+ "bbox": [
1776
+ 507,
1777
+ 165,
1778
+ 882,
1779
+ 261
1780
+ ],
1781
+ "page_idx": 10
1782
+ },
1783
+ {
1784
+ "type": "table",
1785
+ "img_path": "images/9ff0ebb167c5e4bf5cbfeac94073da6a547845d2e4d07cd2fc8c9b9ce5e51518.jpg",
1786
+ "table_caption": [
1787
+ "Table 2: The classification accuracy scores with prompts consisting of fixed cases."
1788
+ ],
1789
+ "table_footnote": [],
1790
+ "table_body": "<table><tr><td>Model</td><td>CAIL</td><td>CAIL_few</td></tr><tr><td>BERT</td><td>89.64</td><td>68.04</td></tr><tr><td>XLM-RoBERTa</td><td>88.75</td><td>66.43</td></tr><tr><td>DeBERTa</td><td>88.57</td><td>30.89</td></tr></table>",
1791
+ "bbox": [
1792
+ 542,
1793
+ 271,
1794
+ 848,
1795
+ 340
1796
+ ],
1797
+ "page_idx": 10
1798
+ },
1799
+ {
1800
+ "type": "text",
1801
+ "text": "Table 3: Prediction accuracy of SFT models fine-tuned on two training datasets of different sizes.",
1802
+ "bbox": [
1803
+ 507,
1804
+ 350,
1805
+ 880,
1806
+ 379
1807
+ ],
1808
+ "page_idx": 10
1809
+ },
1810
+ {
1811
+ "type": "text",
1812
+ "text": "A.4 Detailed Results",
1813
+ "text_level": 1,
1814
+ "bbox": [
1815
+ 507,
1816
+ 406,
1817
+ 687,
1818
+ 420
1819
+ ],
1820
+ "page_idx": 10
1821
+ },
1822
+ {
1823
+ "type": "text",
1824
+ "text": "The specific values of performances displayed in Figure 2 are presented in Table 4. Besides, we also provide the performance of the F1 score in Table 5.",
1825
+ "bbox": [
1826
+ 507,
1827
+ 426,
1828
+ 882,
1829
+ 474
1830
+ ],
1831
+ "page_idx": 10
1832
+ },
1833
+ {
1834
+ "type": "page_footnote",
1835
+ "text": "12bert-base-chinese",
1836
+ "bbox": [
1837
+ 132,
1838
+ 877,
1839
+ 273,
1840
+ 890
1841
+ ],
1842
+ "page_idx": 10
1843
+ },
1844
+ {
1845
+ "type": "page_footnote",
1846
+ "text": "13xIm-roberta-base",
1847
+ "bbox": [
1848
+ 132,
1849
+ 891,
1850
+ 265,
1851
+ 903
1852
+ ],
1853
+ "page_idx": 10
1854
+ },
1855
+ {
1856
+ "type": "page_footnote",
1857
+ "text": "$^{14}$ microsoft/mdeberta-v3-base",
1858
+ "bbox": [
1859
+ 132,
1860
+ 904,
1861
+ 341,
1862
+ 917
1863
+ ],
1864
+ "page_idx": 10
1865
+ },
1866
+ {
1867
+ "type": "page_number",
1868
+ "text": "7347",
1869
+ "bbox": [
1870
+ 480,
1871
+ 927,
1872
+ 519,
1873
+ 940
1874
+ ],
1875
+ "page_idx": 10
1876
+ },
1877
+ {
1878
+ "type": "table",
1879
+ "img_path": "images/f4de87165a1fedaa2c922df6fe9b182d5d6f862f35ff28c6fa9598eaeea95886.jpg",
1880
+ "table_caption": [],
1881
+ "table_footnote": [],
1882
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"5\">Open Questions</td><td colspan=\"5\">Multiple-choice Questions</td></tr><tr><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td></tr><tr><td>GPT-4</td><td>55.18</td><td>64.82</td><td>69.11</td><td>69.82</td><td>71.96</td><td>63.93</td><td>71.25</td><td>72.50</td><td>73.75</td><td>74.46</td></tr><tr><td>ChatGPT</td><td>46.61</td><td>60.00</td><td>62.86</td><td>64.82</td><td>66.96</td><td>61.61</td><td>64.46</td><td>66.96</td><td>70.36</td><td>67.14</td></tr><tr><td>Vicuna-13B</td><td>28.21</td><td>50.36</td><td>49.64</td><td>51.79</td><td>35.89</td><td>47.86</td><td>44.82</td><td>43.39</td><td>35.71</td><td>19.46</td></tr><tr><td>ChatGLM-6B</td><td>41.43</td><td>51.79</td><td>50.00</td><td>50.36</td><td>50.54</td><td>55.71</td><td>50.54</td><td>49.64</td><td>49.46</td><td>47.32</td></tr><tr><td>BLOOMZ-7B</td><td>49.82</td><td>54.82</td><td>52.68</td><td>52.50</td><td>51.25</td><td>53.39</td><td>31.96</td><td>31.07</td><td>27.32</td><td>26.61</td></tr></table>",
1883
+ "bbox": [
1884
+ 127,
1885
+ 216,
1886
+ 868,
1887
+ 334
1888
+ ],
1889
+ "page_idx": 11
1890
+ },
1891
+ {
1892
+ "type": "table",
1893
+ "img_path": "images/7dc56daa2ba608a95e02a93d3ad5bc4b3b63d157d6d482ad9dbe66ee92f49115.jpg",
1894
+ "table_caption": [
1895
+ "Table 4: The classification accuracy scores of all models under the four settings."
1896
+ ],
1897
+ "table_footnote": [],
1898
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"5\">Open Questions</td><td colspan=\"5\">Multiple-choice Questions</td></tr><tr><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td></tr><tr><td>GPT-4</td><td>50.52</td><td>62.72</td><td>67.54</td><td>68.61</td><td>71.02</td><td>62.31</td><td>70.42</td><td>71.81</td><td>73.24</td><td>74.00</td></tr><tr><td>ChatGPT</td><td>43.14</td><td>58.42</td><td>61.86</td><td>64.40</td><td>66.16</td><td>60.67</td><td>63.51</td><td>66.85</td><td>69.59</td><td>66.62</td></tr><tr><td>Vicuna-13B</td><td>25.50</td><td>48.85</td><td>47.64</td><td>49.49</td><td>39.82</td><td>44.70</td><td>41.73</td><td>41.48</td><td>35.03</td><td>21.61</td></tr><tr><td>ChatGLM-6B</td><td>41.89</td><td>50.30</td><td>47.76</td><td>48.59</td><td>48.67</td><td>53.74</td><td>49.26</td><td>47.56</td><td>47.61</td><td>45.32</td></tr><tr><td>BLOOMZ-7B</td><td>46.90</td><td>53.28</td><td>51.06</td><td>50.90</td><td>49.26</td><td>50.68</td><td>29.25</td><td>27.92</td><td>25.27</td><td>23.37</td></tr></table>",
1899
+ "bbox": [
1900
+ 127,
1901
+ 637,
1902
+ 868,
1903
+ 753
1904
+ ],
1905
+ "page_idx": 11
1906
+ },
1907
+ {
1908
+ "type": "text",
1909
+ "text": "Table 5: The classification F1 scores of all models under the four settings.",
1910
+ "bbox": [
1911
+ 247,
1912
+ 764,
1913
+ 746,
1914
+ 778
1915
+ ],
1916
+ "page_idx": 11
1917
+ },
1918
+ {
1919
+ "type": "page_number",
1920
+ "text": "7348",
1921
+ "bbox": [
1922
+ 480,
1923
+ 928,
1924
+ 519,
1925
+ 940
1926
+ ],
1927
+ "page_idx": 11
1928
+ }
1929
+ ]
2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/03295168-adb4-4f17-ac96-deb081e11468_model.json ADDED
@@ -0,0 +1,2424 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ [
3
+ {
4
+ "type": "title",
5
+ "bbox": [
6
+ 0.189,
7
+ 0.08,
8
+ 0.812,
9
+ 0.12
10
+ ],
11
+ "angle": 0,
12
+ "content": "A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction"
13
+ },
14
+ {
15
+ "type": "text",
16
+ "bbox": [
17
+ 0.278,
18
+ 0.127,
19
+ 0.391,
20
+ 0.141
21
+ ],
22
+ "angle": 0,
23
+ "content": "Ruihao Shui"
24
+ },
25
+ {
26
+ "type": "text",
27
+ "bbox": [
28
+ 0.199,
29
+ 0.144,
30
+ 0.47,
31
+ 0.175
32
+ ],
33
+ "angle": 0,
34
+ "content": "National University of Singapore ruihaoshui@u.nus.edu"
35
+ },
36
+ {
37
+ "type": "text",
38
+ "bbox": [
39
+ 0.621,
40
+ 0.127,
41
+ 0.712,
42
+ 0.141
43
+ ],
44
+ "angle": 0,
45
+ "content": "Yixin Cao"
46
+ },
47
+ {
48
+ "type": "text",
49
+ "bbox": [
50
+ 0.524,
51
+ 0.143,
52
+ 0.808,
53
+ 0.177
54
+ ],
55
+ "angle": 0,
56
+ "content": "Singapore Management University yxcao@smu.edu.sg"
57
+ },
58
+ {
59
+ "type": "text",
60
+ "bbox": [
61
+ 0.276,
62
+ 0.188,
63
+ 0.394,
64
+ 0.205
65
+ ],
66
+ "angle": 0,
67
+ "content": "Wang Xiang*"
68
+ },
69
+ {
70
+ "type": "text",
71
+ "bbox": [
72
+ 0.139,
73
+ 0.205,
74
+ 0.525,
75
+ 0.238
76
+ ],
77
+ "angle": 0,
78
+ "content": "University of Science and Technology of China xiangwang1223@gmail.com"
79
+ },
80
+ {
81
+ "type": "text",
82
+ "bbox": [
83
+ 0.601,
84
+ 0.188,
85
+ 0.734,
86
+ 0.205
87
+ ],
88
+ "angle": 0,
89
+ "content": "Tat-Seng Chua"
90
+ },
91
+ {
92
+ "type": "text",
93
+ "bbox": [
94
+ 0.53,
95
+ 0.206,
96
+ 0.802,
97
+ 0.238
98
+ ],
99
+ "angle": 0,
100
+ "content": "National University of Singapore dcscts@nus.edu.sg"
101
+ },
102
+ {
103
+ "type": "title",
104
+ "bbox": [
105
+ 0.261,
106
+ 0.253,
107
+ 0.342,
108
+ 0.268
109
+ ],
110
+ "angle": 0,
111
+ "content": "Abstract"
112
+ },
113
+ {
114
+ "type": "text",
115
+ "bbox": [
116
+ 0.142,
117
+ 0.284,
118
+ 0.461,
119
+ 0.668
120
+ ],
121
+ "angle": 0,
122
+ "content": "Large language models (LLMs) have demonstrated great potential for domain-specific applications, such as the law domain. However, recent disputes over GPT-4's law evaluation raise questions concerning their performance in real-world legal tasks. To systematically investigate their competency in the law, we design practical baseline solutions based on LLMs and test on the task of legal judgment prediction. In our solutions, LLMs can work alone to answer open questions or coordinate with an information retrieval (IR) system to learn from similar cases or solve simplified multi-choice questions. We show that similar cases and multi-choice options, namely label candidates, included in prompts can help LLMs recall domain knowledge that is critical for expertise legal reasoning. We additionally present an intriguing paradox wherein an IR system surpasses the performance of LLM+IR due to limited gains acquired by weaker LLMs from powerful IR systems. In such cases, the role of LLMs becomes redundant. Our evaluation pipeline can be easily extended into other tasks to facilitate evaluations in other domains. Code is available at https://github.com/srhthu/LM-CompEval-Legal"
123
+ },
124
+ {
125
+ "type": "title",
126
+ "bbox": [
127
+ 0.115,
128
+ 0.683,
129
+ 0.26,
130
+ 0.699
131
+ ],
132
+ "angle": 0,
133
+ "content": "1 Introduction"
134
+ },
135
+ {
136
+ "type": "text",
137
+ "bbox": [
138
+ 0.113,
139
+ 0.711,
140
+ 0.491,
141
+ 0.873
142
+ ],
143
+ "angle": 0,
144
+ "content": "Large language models have achieved great success in various Natural Language Processing (NLP) tasks (Brown et al., 2020; Touvron et al., 2023), while there are still some disputes over the potential for domain-specific applications (Martínez, 2023). Focusing on the law domain, the leading LLM, GPT-4 (OpenAI, 2023), was claimed to pass the Uniform Bar Exam (UBE) with a 90th percentile score. Although inspiring, however, this result was pointed out to be overestimated (Martínez, 2023)."
145
+ },
146
+ {
147
+ "type": "image",
148
+ "bbox": [
149
+ 0.513,
150
+ 0.251,
151
+ 0.885,
152
+ 0.449
153
+ ],
154
+ "angle": 0,
155
+ "content": null
156
+ },
157
+ {
158
+ "type": "image_caption",
159
+ "bbox": [
160
+ 0.508,
161
+ 0.457,
162
+ 0.886,
163
+ 0.543
164
+ ],
165
+ "angle": 0,
166
+ "content": "Figure 1: The task of Legal Judgment Prediction and the evaluation settings. Different colors refer to different charges. For similar cases, \"T\" refers to true similar cases with the same charges as the query cases, while \"F\" refers to false similar cases. For task settings, \"ZS\" is the abbreviation for zero-shot and \"FS\" for few-shot."
167
+ },
168
+ {
169
+ "type": "text",
170
+ "bbox": [
171
+ 0.508,
172
+ 0.578,
173
+ 0.883,
174
+ 0.61
175
+ ],
176
+ "angle": 0,
177
+ "content": "This raises an interesting question: How exactly LLMs perform in various real-world legal tasks?"
178
+ },
179
+ {
180
+ "type": "text",
181
+ "bbox": [
182
+ 0.507,
183
+ 0.614,
184
+ 0.885,
185
+ 0.92
186
+ ],
187
+ "angle": 0,
188
+ "content": "In this paper, we design practical baseline solutions based on LLMs and systematically investigate their competency in the law, to shed light on other domains as well. We attribute the main issues of the previous benchmark as follows. First, UBE is too general and not subject to any legal jurisdiction (Martínez, 2023). Second, UBE contains multi-choice questions and open-ended questions that require human experts to evaluate. To avoid human evaluation, some datasets (Hendrycks et al., 2020) replace open-ended questions with multi-choice questions. However, in real-world applications, there are not only multi-choice but also open questions. Using multi-choice questions only may not be comprehensive enough. Third, specifically in but not limited to common law (Shulayeva et al., 2017; Xiao et al., 2019), similar cases are always introduced as evidence to support expertise legal reasoning (Zhong et al., 2020b), which are not fully"
189
+ },
190
+ {
191
+ "type": "page_footnote",
192
+ "bbox": [
193
+ 0.114,
194
+ 0.881,
195
+ 0.488,
196
+ 0.918
197
+ ],
198
+ "angle": 0,
199
+ "content": "*Xiang Wang is also affiliated with Institute of Artificial Intelligence, Institute of Dataspace, Hefei Comprehensive National Science Center."
200
+ },
201
+ {
202
+ "type": "page_number",
203
+ "bbox": [
204
+ 0.481,
205
+ 0.928,
206
+ 0.521,
207
+ 0.941
208
+ ],
209
+ "angle": 0,
210
+ "content": "7337"
211
+ },
212
+ {
213
+ "type": "footer",
214
+ "bbox": [
215
+ 0.218,
216
+ 0.946,
217
+ 0.781,
218
+ 0.974
219
+ ],
220
+ "angle": 0,
221
+ "content": "Findings of the Association for Computational Linguistics: EMNLP 2023, pages 7337-7348 December 6-10, 2023 ©2023 Association for Computational Linguistics"
222
+ }
223
+ ],
224
+ [
225
+ {
226
+ "type": "text",
227
+ "bbox": [
228
+ 0.114,
229
+ 0.085,
230
+ 0.49,
231
+ 0.116
232
+ ],
233
+ "angle": 0,
234
+ "content": "studied in previous benchmark (Hendrycks et al., 2020)."
235
+ },
236
+ {
237
+ "type": "text",
238
+ "bbox": [
239
+ 0.114,
240
+ 0.118,
241
+ 0.49,
242
+ 0.535
243
+ ],
244
+ "angle": 0,
245
+ "content": "For the first issue, we choose legal judgment prediction (LJP) (Xiao et al., 2018; Chalkidis et al., 2019; Zhong et al., 2020a) as the example task for investigation. It is a real-world problem to determine the charges committed by the defendants under a juridical system, as shown in Figure 1. LJP is typically formulated as a classification task to predict the most possible one from a list of predefined charges. Then, for the second and third issues, we design four settings derived from two work scenarios of LLMs to cover open and multichoice questions and the usage of similar cases. In the first scenario, LLMs work alone without explicit knowledge in prompts, assuming all domain knowledge is implicitly stored in parameters. In the second scenario, LLMs coordinate with an information retrieval (IR) system that enriches prompts with similar demonstrations and label candidates to benefit expertise reasoning. Specifically, demonstrations consist of pairs of similar cases and their charges, which are retrieved by the IR system based on similarity of case facts. Labels of the retrieved cases can form label candidates, shown as circles of different colors in Figure 1, to hint LLM with label information and narrow down label space (Ma et al., 2023)."
246
+ },
247
+ {
248
+ "type": "text",
249
+ "bbox": [
250
+ 0.114,
251
+ 0.537,
252
+ 0.49,
253
+ 0.825
254
+ ],
255
+ "angle": 0,
256
+ "content": "The four evaluation settings in Figure 1 can be categorized based on the presence of two elements in prompts: demonstrations (similar cases) and label candidates. Demonstrations convert the setting from zero-shot to few-shot prompting, while label candidates simplify the task from open questions to multi-choice questions<sup>1</sup>. The first scenario corresponds to the first setting, where neither element is present, while the second scenario encompasses the remaining three settings. We evaluate five up-to-date LLMs of the close-source GPT-3 (Brown et al., 2020) family, ChatGPT and GPT-4 (OpenAI, 2023), and open-source LLMs including Vicuna (Chiang et al., 2023), ChatGLM (Du et al., 2022) and BLOOMZ (Muennighoff et al., 2022). The evaluation is conducted on a Chinese LJP dataset, namely CAIL (Xiao et al., 2018), which contains cases of 112 criminal law charges<sup>2</sup>."
257
+ },
258
+ {
259
+ "type": "text",
260
+ "bbox": [
261
+ 0.132,
262
+ 0.827,
263
+ 0.44,
264
+ 0.842
265
+ ],
266
+ "angle": 0,
267
+ "content": "We highlight our key findings as follows:"
268
+ },
269
+ {
270
+ "type": "text",
271
+ "bbox": [
272
+ 0.132,
273
+ 0.843,
274
+ 0.486,
275
+ 0.859
276
+ ],
277
+ "angle": 0,
278
+ "content": "1. Similar cases and label candidates can help"
279
+ },
280
+ {
281
+ "type": "text",
282
+ "bbox": [
283
+ 0.545,
284
+ 0.085,
285
+ 0.882,
286
+ 0.117
287
+ ],
288
+ "angle": 0,
289
+ "content": "LLMs recall domain knowledge that is critical for expertise legal reasoning."
290
+ },
291
+ {
292
+ "type": "text",
293
+ "bbox": [
294
+ 0.525,
295
+ 0.118,
296
+ 0.884,
297
+ 0.165
298
+ ],
299
+ "angle": 0,
300
+ "content": "2. Label candidates result in more consistent outputs, indicating LLMs gain greater confidence in their domain knowledge (Jiang et al., 2021)."
301
+ },
302
+ {
303
+ "type": "text",
304
+ "bbox": [
305
+ 0.525,
306
+ 0.166,
307
+ 0.885,
308
+ 0.212
309
+ ],
310
+ "angle": 0,
311
+ "content": "3. Irrelevant demonstrations formed by fixed cases hardly improve performance. This excludes their effect on task illustration."
312
+ },
313
+ {
314
+ "type": "text",
315
+ "bbox": [
316
+ 0.524,
317
+ 0.214,
318
+ 0.884,
319
+ 0.308
320
+ ],
321
+ "angle": 0,
322
+ "content": "4. Paradox: An IR system can outperform LLM+IR since weaker LLMs acquire limited gains from informative documents retrieved by a powerful IR system. Thus, it is critical to adapte LLMs to generate with retrieved documents."
323
+ },
324
+ {
325
+ "type": "text",
326
+ "bbox": [
327
+ 0.524,
328
+ 0.31,
329
+ 0.884,
330
+ 0.358
331
+ ],
332
+ "angle": 0,
333
+ "content": "5. More similar cases introduce more knowledge and noise simultaneously, whose final outcome depends on LLMs."
334
+ },
335
+ {
336
+ "type": "list",
337
+ "bbox": [
338
+ 0.524,
339
+ 0.118,
340
+ 0.885,
341
+ 0.358
342
+ ],
343
+ "angle": 0,
344
+ "content": null
345
+ },
346
+ {
347
+ "type": "text",
348
+ "bbox": [
349
+ 0.51,
350
+ 0.359,
351
+ 0.882,
352
+ 0.391
353
+ ],
354
+ "angle": 0,
355
+ "content": "The main contributions are summarized in three aspects:"
356
+ },
357
+ {
358
+ "type": "text",
359
+ "bbox": [
360
+ 0.532,
361
+ 0.399,
362
+ 0.882,
363
+ 0.43
364
+ ],
365
+ "angle": 0,
366
+ "content": "- We investigate the law competency of LLMs on the task of legal judgment prediction."
367
+ },
368
+ {
369
+ "type": "text",
370
+ "bbox": [
371
+ 0.532,
372
+ 0.441,
373
+ 0.882,
374
+ 0.489
375
+ ],
376
+ "angle": 0,
377
+ "content": "- We propose practical baseline solutions for LLMs that tackle two scenarios: working alone or in coordination with an IR system."
378
+ },
379
+ {
380
+ "type": "text",
381
+ "bbox": [
382
+ 0.532,
383
+ 0.499,
384
+ 0.884,
385
+ 0.547
386
+ ],
387
+ "angle": 0,
388
+ "content": "- We evaluate five LLMs and conduct comprehensive analysis to demystify their characteristics of expertise reasoning."
389
+ },
390
+ {
391
+ "type": "list",
392
+ "bbox": [
393
+ 0.532,
394
+ 0.399,
395
+ 0.884,
396
+ 0.547
397
+ ],
398
+ "angle": 0,
399
+ "content": null
400
+ },
401
+ {
402
+ "type": "title",
403
+ "bbox": [
404
+ 0.509,
405
+ 0.559,
406
+ 0.691,
407
+ 0.573
408
+ ],
409
+ "angle": 0,
410
+ "content": "2 Baseline Method"
411
+ },
412
+ {
413
+ "type": "text",
414
+ "bbox": [
415
+ 0.508,
416
+ 0.583,
417
+ 0.885,
418
+ 0.856
419
+ ],
420
+ "angle": 0,
421
+ "content": "The goal of legal judgment prediction is to determine the committed charges given case facts. To harness LLMs for LJP, we adopt in-context learning (Brown et al., 2020) and use LLMs to generate the charges conditioned on prompts (Section 2.1). To enhance LLMs, we incorporate label candidates and demonstrations consisting of similar cases into prompts, which are acquired by an IR system (Section 2.2). This derives four settings of baseline solutions, namely zero-shot open questions, few-shot open questions, zero-shot multi-choice questions, and few-shot multi-choice questions. The multi-choice settings employ label candidates while few-shot settings include demonstrations, as shown in Figure 1. Finally, we introduce how to simulate IR systems with different capabilities to understand their effects (Section 2.3)."
422
+ },
423
+ {
424
+ "type": "title",
425
+ "bbox": [
426
+ 0.509,
427
+ 0.867,
428
+ 0.688,
429
+ 0.882
430
+ ],
431
+ "angle": 0,
432
+ "content": "2.1 LLM Prompting"
433
+ },
434
+ {
435
+ "type": "text",
436
+ "bbox": [
437
+ 0.508,
438
+ 0.888,
439
+ 0.884,
440
+ 0.919
441
+ ],
442
+ "angle": 0,
443
+ "content": "Prompt Design. A prompt begins with an instruction to illustrate the task followed by label"
444
+ },
445
+ {
446
+ "type": "page_footnote",
447
+ "bbox": [
448
+ 0.114,
449
+ 0.868,
450
+ 0.488,
451
+ 0.904
452
+ ],
453
+ "angle": 0,
454
+ "content": "<sup>1</sup>It is not strict multi-choice questions. LLMs can generate correct answers even though ground-truth labels are absent in candidates."
455
+ },
456
+ {
457
+ "type": "page_footnote",
458
+ "bbox": [
459
+ 0.136,
460
+ 0.905,
461
+ 0.442,
462
+ 0.919
463
+ ],
464
+ "angle": 0,
465
+ "content": "After filtering less frequent (article, charge) pairs"
466
+ },
467
+ {
468
+ "type": "list",
469
+ "bbox": [
470
+ 0.114,
471
+ 0.868,
472
+ 0.488,
473
+ 0.919
474
+ ],
475
+ "angle": 0,
476
+ "content": null
477
+ },
478
+ {
479
+ "type": "page_number",
480
+ "bbox": [
481
+ 0.481,
482
+ 0.929,
483
+ 0.521,
484
+ 0.941
485
+ ],
486
+ "angle": 0,
487
+ "content": "7338"
488
+ }
489
+ ],
490
+ [
491
+ {
492
+ "type": "text",
493
+ "bbox": [
494
+ 0.113,
495
+ 0.085,
496
+ 0.489,
497
+ 0.132
498
+ ],
499
+ "angle": 0,
500
+ "content": "candidates and task demonstrations in the form of input-output pairs. The templates of prompts are displayed in Appendix A.1."
501
+ },
502
+ {
503
+ "type": "text",
504
+ "bbox": [
505
+ 0.113,
506
+ 0.134,
507
+ 0.489,
508
+ 0.293
509
+ ],
510
+ "angle": 0,
511
+ "content": "Parsing. We adopt one automatic parsing function for all LLMs to map LLM outputs to predefined charge labels. No ad hoc heuristics are employed for a fair comparison. Specifically, we use the BM25 algorithm<sup>3</sup> to measure text similarity between outputs and pre-defined charges and predict the most similar charges. BM25 is robust and yields comparable performances to neural similarity methods like text2vec<sup>4</sup> in our pilot experiments."
512
+ },
513
+ {
514
+ "type": "text",
515
+ "bbox": [
516
+ 0.113,
517
+ 0.295,
518
+ 0.489,
519
+ 0.376
520
+ ],
521
+ "angle": 0,
522
+ "content": "Inference. Sampling is enabled during generation for consistent results, as inspired by Wang et al. (2022). Five outputs are sampled for each prompt with the temperature of 0.8. Their similarity scores of pre-defined labels are averaged."
523
+ },
524
+ {
525
+ "type": "title",
526
+ "bbox": [
527
+ 0.114,
528
+ 0.388,
529
+ 0.476,
530
+ 0.403
531
+ ],
532
+ "angle": 0,
533
+ "content": "2.2 IR System for Knowledge Incorporation"
534
+ },
535
+ {
536
+ "type": "text",
537
+ "bbox": [
538
+ 0.113,
539
+ 0.41,
540
+ 0.489,
541
+ 0.602
542
+ ],
543
+ "angle": 0,
544
+ "content": "IR systems are utilized to retrieve similar cases, commonly referenced by lawyers and judges, to inform their judgments. In addition to providing demonstrations, these similar cases can also aid in generating potential labels by incorporating the labels from the top similar cases. By employing these smaller sets of predefined charges, namely label candidates, complex open questions can be simplified into multiple-choice questions. This approach is effective in enhancing LM prompting (Ma et al., 2023), as including hundreds of charges directly in prompts is impractical."
545
+ },
546
+ {
547
+ "type": "text",
548
+ "bbox": [
549
+ 0.113,
550
+ 0.604,
551
+ 0.489,
552
+ 0.716
553
+ ],
554
+ "angle": 0,
555
+ "content": "Implementation of IR System. We use the BM25 algorithm to measure the semantic similarity between cases. Similar cases are retrieved from the training dataset. To guarantee that the demonstrations exemplify one of the multi-choice options, we exclude demonstrations with labels that are not among the candidate options<sup>5</sup>."
556
+ },
557
+ {
558
+ "type": "title",
559
+ "bbox": [
560
+ 0.114,
561
+ 0.729,
562
+ 0.36,
563
+ 0.744
564
+ ],
565
+ "angle": 0,
566
+ "content": "2.3 Simulation of IR Systems"
567
+ },
568
+ {
569
+ "type": "text",
570
+ "bbox": [
571
+ 0.113,
572
+ 0.751,
573
+ 0.489,
574
+ 0.846
575
+ ],
576
+ "angle": 0,
577
+ "content": "To investigate the effects of IR capabilities, we simulate a series of IR systems of different capabilities as measured by Precision@1\\(^{6}\\). Then the top retrieved cases are used as demonstrations. We consider cases with identical charges to the query cases as true similar cases and vice versa."
578
+ },
579
+ {
580
+ "type": "text",
581
+ "bbox": [
582
+ 0.137,
583
+ 0.854,
584
+ 0.36,
585
+ 0.868
586
+ ],
587
+ "angle": 0,
588
+ "content": "3https://pypi.org/project/rank-bm25/"
589
+ },
590
+ {
591
+ "type": "text",
592
+ "bbox": [
593
+ 0.137,
594
+ 0.868,
595
+ 0.375,
596
+ 0.881
597
+ ],
598
+ "angle": 0,
599
+ "content": "<sup>4</sup>https://github.com/crownpku/text2vec"
600
+ },
601
+ {
602
+ "type": "text",
603
+ "bbox": [
604
+ 0.116,
605
+ 0.881,
606
+ 0.486,
607
+ 0.905
608
+ ],
609
+ "angle": 0,
610
+ "content": "5This condition is not violated for the top four similar cases without filtering."
611
+ },
612
+ {
613
+ "type": "text",
614
+ "bbox": [
615
+ 0.136,
616
+ 0.906,
617
+ 0.403,
618
+ 0.918
619
+ ],
620
+ "angle": 0,
621
+ "content": "The accuracy of the top one retrieved case."
622
+ },
623
+ {
624
+ "type": "list",
625
+ "bbox": [
626
+ 0.116,
627
+ 0.854,
628
+ 0.486,
629
+ 0.918
630
+ ],
631
+ "angle": 0,
632
+ "content": null
633
+ },
634
+ {
635
+ "type": "text",
636
+ "bbox": [
637
+ 0.507,
638
+ 0.085,
639
+ 0.885,
640
+ 0.277
641
+ ],
642
+ "angle": 0,
643
+ "content": "Realistic Simulation. We prioritize the returning of true similar cases for easy query cases, rather than the returning in a random manner. The query difficulty is measured by the Precision@10 of the BM25 retriever described in Section 2.2. The motivation is that queries with shadow linguistic features are more possible to get relevant retrieval results than complex or obscure queries. For a specific value (e.g., a%) of Precision@1 to be simulated, the top a% of easy test cases are assured to have a true similar case, while the rest are assigned false similar cases."
644
+ },
645
+ {
646
+ "type": "title",
647
+ "bbox": [
648
+ 0.509,
649
+ 0.292,
650
+ 0.716,
651
+ 0.309
652
+ ],
653
+ "angle": 0,
654
+ "content": "3 Experimental Setup"
655
+ },
656
+ {
657
+ "type": "title",
658
+ "bbox": [
659
+ 0.509,
660
+ 0.32,
661
+ 0.614,
662
+ 0.333
663
+ ],
664
+ "angle": 0,
665
+ "content": "3.1 Models"
666
+ },
667
+ {
668
+ "type": "text",
669
+ "bbox": [
670
+ 0.508,
671
+ 0.341,
672
+ 0.881,
673
+ 0.372
674
+ ],
675
+ "angle": 0,
676
+ "content": "Below is a concise introduction to the five LLMs to be evaluated."
677
+ },
678
+ {
679
+ "type": "text",
680
+ "bbox": [
681
+ 0.508,
682
+ 0.374,
683
+ 0.884,
684
+ 0.502
685
+ ],
686
+ "angle": 0,
687
+ "content": "GPT-4 (OpenAI, 2023) and ChatGPT are available from OpenAI API and the versions of gpt-4-0314 and gpt-3.5-turbo-0301 are used. For technological details, ChatGPT is claimed to be a sibling model to InstructGPT (Ouyang et al., 2022) that is trained to follow instructions and align to human preferences with the RLHF algorithm (Christiano et al., 2017)."
688
+ },
689
+ {
690
+ "type": "text",
691
+ "bbox": [
692
+ 0.508,
693
+ 0.504,
694
+ 0.882,
695
+ 0.583
696
+ ],
697
+ "angle": 0,
698
+ "content": "Vicuna-13B (Chiang et al., 2023) is a LLaMA model (Touvron et al., 2023) fine-tuned on 70K public user-shared conversations with ChatGPT. It can be viewed to learn distilled knowledge (Hinton et al., 2015) of ChatGPT."
699
+ },
700
+ {
701
+ "type": "text",
702
+ "bbox": [
703
+ 0.508,
704
+ 0.585,
705
+ 0.882,
706
+ 0.632
707
+ ],
708
+ "angle": 0,
709
+ "content": "ChatGLM-6B<sup>7</sup> is a dialog language model based on the GLM (Du et al., 2022) architecture and supports English and Chinese."
710
+ },
711
+ {
712
+ "type": "text",
713
+ "bbox": [
714
+ 0.508,
715
+ 0.634,
716
+ 0.884,
717
+ 0.745
718
+ ],
719
+ "angle": 0,
720
+ "content": "BLOOMZ (Muennighoff et al., 2022) is an instruction fine-tuned BLOOM (Scao et al., 2022), a multilingual language model. We use the bloomz-7b1-mt version that is tuned for multilingual prompts. Except for BLOOMZ, Vicuna and ChatGLM are mainly fine-tuned on conversational data."
721
+ },
722
+ {
723
+ "type": "title",
724
+ "bbox": [
725
+ 0.509,
726
+ 0.76,
727
+ 0.771,
728
+ 0.775
729
+ ],
730
+ "angle": 0,
731
+ "content": "3.2 Dataset and Pre-processing"
732
+ },
733
+ {
734
+ "type": "text",
735
+ "bbox": [
736
+ 0.508,
737
+ 0.782,
738
+ 0.885,
739
+ 0.895
740
+ ],
741
+ "angle": 0,
742
+ "content": "The Chinese LJP dataset, CAIL (Xiao et al., 2018), is used in our experiments. Each sample consists of the case facts and the committed charge as the label. As the original dataset is very large (~100K for training and ~20K for test), we randomly sample a balanced small test set from the original test set. Five cases are sampled for each charge, accounting"
743
+ },
744
+ {
745
+ "type": "page_footnote",
746
+ "bbox": [
747
+ 0.531,
748
+ 0.905,
749
+ 0.8,
750
+ 0.918
751
+ ],
752
+ "angle": 0,
753
+ "content": "<sup>7</sup>https://github.com/THUDM/ChatGLM-6B"
754
+ },
755
+ {
756
+ "type": "page_number",
757
+ "bbox": [
758
+ 0.481,
759
+ 0.928,
760
+ 0.521,
761
+ 0.941
762
+ ],
763
+ "angle": 0,
764
+ "content": "7339"
765
+ }
766
+ ],
767
+ [
768
+ {
769
+ "type": "table",
770
+ "bbox": [
771
+ 0.14,
772
+ 0.082,
773
+ 0.465,
774
+ 0.167
775
+ ],
776
+ "angle": 0,
777
+ "content": "<table><tr><td>Tokenizer</td><td>Median</td><td>&lt;=500</td><td>&lt;=1000</td></tr><tr><td>ChatGPT</td><td>396.5</td><td>68.75</td><td>92.32</td></tr><tr><td>Vicuna</td><td>496.0</td><td>50.89</td><td>86.96</td></tr><tr><td>ChatGLM</td><td>206.5</td><td>91.07</td><td>98.57</td></tr><tr><td>BLOOMZ</td><td>210.5</td><td>90.54</td><td>98.93</td></tr></table>"
778
+ },
779
+ {
780
+ "type": "table_caption",
781
+ "bbox": [
782
+ 0.114,
783
+ 0.176,
784
+ 0.49,
785
+ 0.22
786
+ ],
787
+ "angle": 0,
788
+ "content": "Table 1: Statistics of the number of tokens across tokenizers. The last two columns present the ratios of test samples with token counts below the specified values."
789
+ },
790
+ {
791
+ "type": "text",
792
+ "bbox": [
793
+ 0.113,
794
+ 0.249,
795
+ 0.489,
796
+ 0.345
797
+ ],
798
+ "angle": 0,
799
+ "content": "for 560 test cases in total for 112 charges. Similarly, we also sample the training and validation sets with 10 cases per charge. The training set is used to retrieve similar cases (Section 2.3), while the validation set is used to determine the optimal \\( k \\) of the kNN algorithm."
800
+ },
801
+ {
802
+ "type": "text",
803
+ "bbox": [
804
+ 0.117,
805
+ 0.348,
806
+ 0.49,
807
+ 0.541
808
+ ],
809
+ "angle": 0,
810
+ "content": "Truncation. Since some cases have very long descriptions, we truncate the case facts of demonstrations to 500 tokens and those of test samples to 1000 tokens. It is worth noting that the text is tokenized by the tokenizer of each model before truncation for a fair comparison. Recently, Petrov et al. (2023) address the issue that a tokenizer can lead to different performances of different languages. This suggests that the performance on a particular language can also be influenced by tokenizers from various models with varying language encoding efficiency."
811
+ },
812
+ {
813
+ "type": "text",
814
+ "bbox": [
815
+ 0.113,
816
+ 0.543,
817
+ 0.49,
818
+ 0.673
819
+ ],
820
+ "angle": 0,
821
+ "content": "Table 1 shows the statistics of the number of tokens processed by different tokenizers<sup>8</sup>. The most efficient tokenizers for Chinese are those of ChatGLM and BLOOMZ, indicated by the medians of token numbers. In contrast, the tokenizer of ChatGPT produces \\(2 \\times\\) tokens and that of Vicuna produces \\(2.5 \\times\\) tokens. The truncation length is proper to accommodate most samples."
822
+ },
823
+ {
824
+ "type": "title",
825
+ "bbox": [
826
+ 0.114,
827
+ 0.69,
828
+ 0.414,
829
+ 0.708
830
+ ],
831
+ "angle": 0,
832
+ "content": "4 LLM vs. LLM with IR System"
833
+ },
834
+ {
835
+ "type": "text",
836
+ "bbox": [
837
+ 0.113,
838
+ 0.72,
839
+ 0.49,
840
+ 0.866
841
+ ],
842
+ "angle": 0,
843
+ "content": "We initially present the overall results, highlighting the importance of label candidates and similar cases, and conduct a comparative analysis of the models. Subsequently, we investigate the relationship between label candidates and self-consistency to unveil their actual effects on expertise reasoning. Additionally, we perform an ablation study by replacing similar cases with fixed cases as demonstrations to further understand their impact."
844
+ },
845
+ {
846
+ "type": "image",
847
+ "bbox": [
848
+ 0.522,
849
+ 0.089,
850
+ 0.872,
851
+ 0.266
852
+ ],
853
+ "angle": 0,
854
+ "content": null
855
+ },
856
+ {
857
+ "type": "image_caption",
858
+ "bbox": [
859
+ 0.508,
860
+ 0.281,
861
+ 0.885,
862
+ 0.381
863
+ ],
864
+ "angle": 0,
865
+ "content": "Figure 2: The macro comparison between the four settings. “+Label” refers to zero-shot multi-choice questions; “+Sim Case” refers to few-shot open questions and “+Label +Sim Case” refers to few-shot multi-choice questions. More than one points of a model in the last two settings refer to runs with different number of demonstrations."
866
+ },
867
+ {
868
+ "type": "image",
869
+ "bbox": [
870
+ 0.521,
871
+ 0.401,
872
+ 0.707,
873
+ 0.565
874
+ ],
875
+ "angle": 0,
876
+ "content": null
877
+ },
878
+ {
879
+ "type": "image",
880
+ "bbox": [
881
+ 0.71,
882
+ 0.4,
883
+ 0.872,
884
+ 0.565
885
+ ],
886
+ "angle": 0,
887
+ "content": null
888
+ },
889
+ {
890
+ "type": "image_caption",
891
+ "bbox": [
892
+ 0.509,
893
+ 0.581,
894
+ 0.885,
895
+ 0.611
896
+ ],
897
+ "angle": 0,
898
+ "content": "Figure 3: Compare the models under each setting. Few-shot performances are averaged among 1-shot to 4-shot."
899
+ },
900
+ {
901
+ "type": "title",
902
+ "bbox": [
903
+ 0.509,
904
+ 0.638,
905
+ 0.679,
906
+ 0.652
907
+ ],
908
+ "angle": 0,
909
+ "content": "4.1 Overall Results"
910
+ },
911
+ {
912
+ "type": "text",
913
+ "bbox": [
914
+ 0.508,
915
+ 0.661,
916
+ 0.883,
917
+ 0.708
918
+ ],
919
+ "angle": 0,
920
+ "content": "The macro comparison between the four settings is shown in Figure 2, where each point represents the performance of one specific run of one model."
921
+ },
922
+ {
923
+ "type": "text",
924
+ "bbox": [
925
+ 0.507,
926
+ 0.71,
927
+ 0.885,
928
+ 0.885
929
+ ],
930
+ "angle": 0,
931
+ "content": "Significance of label candidates and similar cases. In comparison to the zero-shot open question setting where LLMs work alone, the inclusion of label candidates, similar cases, or both demonstrates noteworthy enhancements. This highlights the effectiveness of our baseline solutions that leverage IR systems to expand the capabilities of LLMs in legal domains. These findings align with previous research that has also recognized the significance of the two components (Ma et al., 2023; Liu et al., 2021)."
932
+ },
933
+ {
934
+ "type": "text",
935
+ "bbox": [
936
+ 0.509,
937
+ 0.888,
938
+ 0.884,
939
+ 0.919
940
+ ],
941
+ "angle": 0,
942
+ "content": "The effects of label candidates and similar cases differ slightly in terms of performance mean and"
943
+ },
944
+ {
945
+ "type": "page_footnote",
946
+ "bbox": [
947
+ 0.114,
948
+ 0.88,
949
+ 0.488,
950
+ 0.918
951
+ ],
952
+ "angle": 0,
953
+ "content": "GPT-4 and ChatGPT have the same results. Following OpenAI's guidance, we use the python package tiktoken for tokenization"
954
+ },
955
+ {
956
+ "type": "page_number",
957
+ "bbox": [
958
+ 0.481,
959
+ 0.928,
960
+ 0.522,
961
+ 0.941
962
+ ],
963
+ "angle": 0,
964
+ "content": "7340"
965
+ }
966
+ ],
967
+ [
968
+ {
969
+ "type": "text",
970
+ "bbox": [
971
+ 0.113,
972
+ 0.085,
973
+ 0.493,
974
+ 0.312
975
+ ],
976
+ "angle": 0,
977
+ "content": "variance. Label candidates contribute to a higher mean performance, while similar cases introduce greater variance. Examining the model performances in the third setting (+Sim Case) displayed in Figure 2, GPT-4 and ChatGPT exhibit more significant improvements from similar cases compared to their smaller counterparts. They also gain more benefit from similar cases than from label candidates. This observation can be attributed to the varying difficulty levels of knowledge utilization. While the knowledge within label candidates is readily accessible and straightforward, leveraging similar cases requires stronger language understanding and few-shot learning abilities."
978
+ },
979
+ {
980
+ "type": "text",
981
+ "bbox": [
982
+ 0.113,
983
+ 0.318,
984
+ 0.49,
985
+ 0.448
986
+ ],
987
+ "angle": 0,
988
+ "content": "Furthermore, the coexistence of label candidates and similar cases further enhances the performance of GPT-4 and ChatGPT, but it diminishes the performance of Vicuna, ChatGLM, and BLOOMZ. This suggests that smaller LLMs may encounter challenges in effectively managing knowledge in multiple forms simultaneously, leading to confusion."
989
+ },
990
+ {
991
+ "type": "text",
992
+ "bbox": [
993
+ 0.114,
994
+ 0.454,
995
+ 0.49,
996
+ 0.52
997
+ ],
998
+ "angle": 0,
999
+ "content": "Model comparison. The performances of the models under zero-shot and few-shot prompting is shown in Figure 3, where few-shot performances are averaged among 1-shot to 4-shot."
1000
+ },
1001
+ {
1002
+ "type": "text",
1003
+ "bbox": [
1004
+ 0.113,
1005
+ 0.526,
1006
+ 0.49,
1007
+ 0.784
1008
+ ],
1009
+ "angle": 0,
1010
+ "content": "The zero-shot setting emphasizes the ability to understand instructions. When only instructions are available, BLOOMZ performs better than ChatGPT, indicating a superior multilingual instruction following ability. This result is reasonable as BLOOMZ is the only smaller LLM that is fine-tuned on multilingual instructions. Once provided with explicit domain knowledge, ChatGPT outperforms all smaller LLMs. The case is the same for BLOOMZ and ChatGLM, where ChatGLM overtakes BLOOMZ with knowledge of label candidates. BLOOMZ performs worst when prompted with two forms of knowledge, indicating that BLOOMZ is not very robust to prompts. Among the three smaller LLMs, ChatGLM is the most robust to various forms of knowledge."
1011
+ },
1012
+ {
1013
+ "type": "text",
1014
+ "bbox": [
1015
+ 0.113,
1016
+ 0.791,
1017
+ 0.49,
1018
+ 0.92
1019
+ ],
1020
+ "angle": 0,
1021
+ "content": "The significant effects of label candidates and similar cases can be explained as they activate LLM's memory of relevant domain knowledge. This view can be supported by two pieces of evidence about the relationship between label candidates and self-consistency (Section 4.2) and the negligible effect of irrelevant cases as fixed demonstrations (Section 4.3)."
1022
+ },
1023
+ {
1024
+ "type": "image",
1025
+ "bbox": [
1026
+ 0.527,
1027
+ 0.089,
1028
+ 0.85,
1029
+ 0.237
1030
+ ],
1031
+ "angle": 0,
1032
+ "content": null
1033
+ },
1034
+ {
1035
+ "type": "image_caption",
1036
+ "bbox": [
1037
+ 0.508,
1038
+ 0.243,
1039
+ 0.885,
1040
+ 0.302
1041
+ ],
1042
+ "angle": 0,
1043
+ "content": "Figure 4: Changes of performance and self-consistency after adding label candidates. The change of each model is illustrated by an arrow pointing from the open question setting to the multi-choice setting."
1044
+ },
1045
+ {
1046
+ "type": "title",
1047
+ "bbox": [
1048
+ 0.509,
1049
+ 0.327,
1050
+ 0.808,
1051
+ 0.36
1052
+ ],
1053
+ "angle": 0,
1054
+ "content": "4.2 Label Candidates Enhance Self-consistency and Confidence"
1055
+ },
1056
+ {
1057
+ "type": "text",
1058
+ "bbox": [
1059
+ 0.507,
1060
+ 0.365,
1061
+ 0.885,
1062
+ 0.476
1063
+ ],
1064
+ "angle": 0,
1065
+ "content": "To further understand the effect of label candidates, we propose a metric to measure the self-consistency of LLMs that is calculated as the number of the majority prediction. Consistent outputs indicate a high level of confidence in LLMs, which is often associated with a better grasp of knowledge (Jiang et al., 2021, 2023)."
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "bbox": [
1070
+ 0.508,
1071
+ 0.479,
1072
+ 0.885,
1073
+ 0.768
1074
+ ],
1075
+ "angle": 0,
1076
+ "content": "The changes in performance and self-consistency after introducing label candidates are shown in Figure 4 as the arrows. We observe that the incorporation of label candidates leads to more consistent outputs (8 of 10 cases) and higher confidence in LLMs except zero-shot GPT-4 with a slight decrease and few-shot BLOOMZ. In the zero-shot setting, label candidates significantly boost LLM performances. We postulate that label candidates help by eliciting pre-stored domain knowledge with concise charge names. Besides, the self-consistency also correlates with model performances (7 of 10 cases). Such correlation is also observed in other tasks like question answering (Jiang et al., 2021). It is worth noting that label candidates decrease both self-consistency and performance of few-shot prompted BLOOMZ, which also aligns with the correlation."
1077
+ },
1078
+ {
1079
+ "type": "title",
1080
+ "bbox": [
1081
+ 0.509,
1082
+ 0.781,
1083
+ 0.882,
1084
+ 0.811
1085
+ ],
1086
+ "angle": 0,
1087
+ "content": "4.3 Domain Knowledge Is More Critical Than Task Illustration"
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "bbox": [
1092
+ 0.508,
1093
+ 0.819,
1094
+ 0.885,
1095
+ 0.884
1096
+ ],
1097
+ "angle": 0,
1098
+ "content": "There is a possible argument that similar demonstrations can help LLMs understand instructions and tasks. To disentangle their effects on task illustration and provision of domain knowledge, we"
1099
+ },
1100
+ {
1101
+ "type": "page_footnote",
1102
+ "bbox": [
1103
+ 0.509,
1104
+ 0.893,
1105
+ 0.883,
1106
+ 0.919
1107
+ ],
1108
+ "angle": 0,
1109
+ "content": "For example, if the five sampled outputs are mapped to labels of (a,a,a,b,c), the consistency score is 3."
1110
+ },
1111
+ {
1112
+ "type": "page_number",
1113
+ "bbox": [
1114
+ 0.481,
1115
+ 0.928,
1116
+ 0.519,
1117
+ 0.941
1118
+ ],
1119
+ "angle": 0,
1120
+ "content": "7341"
1121
+ }
1122
+ ],
1123
+ [
1124
+ {
1125
+ "type": "image",
1126
+ "bbox": [
1127
+ 0.124,
1128
+ 0.087,
1129
+ 0.476,
1130
+ 0.228
1131
+ ],
1132
+ "angle": 0,
1133
+ "content": null
1134
+ },
1135
+ {
1136
+ "type": "image_caption",
1137
+ "bbox": [
1138
+ 0.113,
1139
+ 0.245,
1140
+ 0.49,
1141
+ 0.344
1142
+ ],
1143
+ "angle": 0,
1144
+ "content": "Figure 5: The effects of fixed (irrelevant) and similar cases as demonstrations. Divided by the baseline setting of zero-shot open questions, the left part refers to fixed demonstrations with increasing numbers of demonstrations, while the right part refers to similar demonstrations. The shadow area represents the range of standard deviation."
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "bbox": [
1149
+ 0.113,
1150
+ 0.373,
1151
+ 0.489,
1152
+ 0.452
1153
+ ],
1154
+ "angle": 0,
1155
+ "content": "experiment with irrelevant demonstrations fixed for all test samples. We manually select two common cases with frequent charges in the original dataset as the fixed demonstrations. The 1-shot performance was averaged on the two demonstrations."
1156
+ },
1157
+ {
1158
+ "type": "text",
1159
+ "bbox": [
1160
+ 0.113,
1161
+ 0.456,
1162
+ 0.49,
1163
+ 0.632
1164
+ ],
1165
+ "angle": 0,
1166
+ "content": "We compare the effects of fixed and similar demonstrations with the baseline setting of zero-shot open questions in Figure 5. The change of performance from center to left demonstrates that fixed demonstrations hardly benefit LLMs and sometimes harm the performance (e.g., ChatGLM). This indicates that LLMs can basically understand instructions and do not need general demonstrations for task clarification, implying that the main challenge of expertise reasoning is to recall domain knowledge instead of understanding a specific task."
1167
+ },
1168
+ {
1169
+ "type": "text",
1170
+ "bbox": [
1171
+ 0.113,
1172
+ 0.634,
1173
+ 0.49,
1174
+ 0.793
1175
+ ],
1176
+ "angle": 0,
1177
+ "content": "We inspect the notable performance drop of ChatGLM resulting from fixed demonstrations. We find that ChatGLM tends to analyze the cases of both demonstrations and test samples and then answer with both of their charges. Its wordy style seems to result from the fine-tuning dialog corpus where an assistant LLM is supposed to provide rich information. In contrast, similar cases seem to encourage more concise outputs following the format of demonstrations."
1178
+ },
1179
+ {
1180
+ "type": "title",
1181
+ "bbox": [
1182
+ 0.114,
1183
+ 0.81,
1184
+ 0.438,
1185
+ 0.843
1186
+ ],
1187
+ "angle": 0,
1188
+ "content": "5 Paradox of Information Retrieval System"
1189
+ },
1190
+ {
1191
+ "type": "text",
1192
+ "bbox": [
1193
+ 0.113,
1194
+ 0.855,
1195
+ 0.49,
1196
+ 0.919
1197
+ ],
1198
+ "angle": 0,
1199
+ "content": "The significance of similar demonstrations illustrated in Section 4.3 has motivated research focusing on prompting-oriented IR systems (Rubin et al., 2021; Sun et al., 2023) to retrieve high qual"
1200
+ },
1201
+ {
1202
+ "type": "image",
1203
+ "bbox": [
1204
+ 0.522,
1205
+ 0.089,
1206
+ 0.872,
1207
+ 0.208
1208
+ ],
1209
+ "angle": 0,
1210
+ "content": null
1211
+ },
1212
+ {
1213
+ "type": "image_caption",
1214
+ "bbox": [
1215
+ 0.508,
1216
+ 0.224,
1217
+ 0.885,
1218
+ 0.325
1219
+ ],
1220
+ "angle": 0,
1221
+ "content": "Figure 6: The performance of ChatGPT coordinated with a series of simulated IR systems with varying capabilities as measured by Precision@1. The vertical blue line represents the threshold of IR capability at which IR systems overtake ChatGPT. The performance of ChatGPT in the real setting (1-shot open questions) is indicated by the red plus sign."
1222
+ },
1223
+ {
1224
+ "type": "text",
1225
+ "bbox": [
1226
+ 0.506,
1227
+ 0.35,
1228
+ 0.883,
1229
+ 0.477
1230
+ ],
1231
+ "angle": 0,
1232
+ "content": "ity demonstrations. However, we raise an intuitive question: Do LLMs gain substantial improvement from IR systems compared to the kNN baseline that harnesses IR systems for classification tasks? The question is inspired by our observation that the BM25 retriever achieves \\(48.03\\%\\) of Precision@1 and \\(57.68\\%\\) prediction accuracy by majority vote of top \\(k = 17\\) retrieved similar cases."
1233
+ },
1234
+ {
1235
+ "type": "text",
1236
+ "bbox": [
1237
+ 0.507,
1238
+ 0.479,
1239
+ 0.884,
1240
+ 0.589
1241
+ ],
1242
+ "angle": 0,
1243
+ "content": "This observation suggests a paradoxical scenario wherein an IR system outperforms the combination of LLM and IR, with the LLM taking on the leading role and the IR serving as a supporting role. In such a scenario, the LLM becomes redundant due to its failure to fully utilize the informative retrieved documents."
1244
+ },
1245
+ {
1246
+ "type": "text",
1247
+ "bbox": [
1248
+ 0.507,
1249
+ 0.591,
1250
+ 0.884,
1251
+ 0.718
1252
+ ],
1253
+ "angle": 0,
1254
+ "content": "To investigate the paradox, instead of experimenting with different IR systems, we manipulate the BM25 retriever to simulate a series of IR systems with different capabilities measured by Precision@1 as described by Section 2.3. We take a case study of ChatGPT, whose 1-shot performance under different IR systems (denoted as Precision@1) is shown in Figure 6."
1255
+ },
1256
+ {
1257
+ "type": "text",
1258
+ "bbox": [
1259
+ 0.508,
1260
+ 0.72,
1261
+ 0.885,
1262
+ 0.863
1263
+ ],
1264
+ "angle": 0,
1265
+ "content": "Results Although the performance of ChatGPT enhanced by IR systems improves with IR capability, it will eventually underperform the IR system once the IR capability surpasses a certain threshold. In the ideal situation where true similar cases are always retrieved, ChatGPT is unable to attain \\(100\\%\\) accuracy and lags significantly behind the optimal IR system. According to Appendix A.4, all smaller LLMs are not comparable to the BM25 retriever."
1266
+ },
1267
+ {
1268
+ "type": "text",
1269
+ "bbox": [
1270
+ 0.508,
1271
+ 0.865,
1272
+ 0.884,
1273
+ 0.897
1274
+ ],
1275
+ "angle": 0,
1276
+ "content": "Discussion The findings demonstrate that LLMs face challenges in effectively leveraging informa"
1277
+ },
1278
+ {
1279
+ "type": "page_footnote",
1280
+ "bbox": [
1281
+ 0.527,
1282
+ 0.904,
1283
+ 0.838,
1284
+ 0.918
1285
+ ],
1286
+ "angle": 0,
1287
+ "content": "It is identical to the precision of \\(k\\mathrm{NN}\\) with \\(k = 1\\)"
1288
+ },
1289
+ {
1290
+ "type": "page_number",
1291
+ "bbox": [
1292
+ 0.481,
1293
+ 0.928,
1294
+ 0.521,
1295
+ 0.941
1296
+ ],
1297
+ "angle": 0,
1298
+ "content": "7342"
1299
+ }
1300
+ ],
1301
+ [
1302
+ {
1303
+ "type": "image",
1304
+ "bbox": [
1305
+ 0.124,
1306
+ 0.087,
1307
+ 0.481,
1308
+ 0.228
1309
+ ],
1310
+ "angle": 0,
1311
+ "content": null
1312
+ },
1313
+ {
1314
+ "type": "image_caption",
1315
+ "bbox": [
1316
+ 0.114,
1317
+ 0.243,
1318
+ 0.49,
1319
+ 0.271
1320
+ ],
1321
+ "angle": 0,
1322
+ "content": "Figure 7: Performance vs. the number of similar demonstrations of the five LLMs."
1323
+ },
1324
+ {
1325
+ "type": "text",
1326
+ "bbox": [
1327
+ 0.113,
1328
+ 0.298,
1329
+ 0.49,
1330
+ 0.506
1331
+ ],
1332
+ "angle": 0,
1333
+ "content": "tive retrieved documents. This underscores the need for significant research efforts to enhance the synergy between auto-regressive language models and retrieval by conditioning model outputs more on retrieved documents. Previous work has explored the augmentation of LLMs with retrieval at both the pre-training and fine-tuning stages (Borgeaud et al., 2022; Wang et al., 2023). Moreover, the marginal and inadequate improvement with retrieval indicates the limited legal reasoning ability of existing general LLMs. There is a need for future efforts to enhance domain-specific reasoning abilities of pre-trained foundation models."
1334
+ },
1335
+ {
1336
+ "type": "title",
1337
+ "bbox": [
1338
+ 0.114,
1339
+ 0.519,
1340
+ 0.281,
1341
+ 0.535
1342
+ ],
1343
+ "angle": 0,
1344
+ "content": "6 Ablation Study"
1345
+ },
1346
+ {
1347
+ "type": "title",
1348
+ "bbox": [
1349
+ 0.114,
1350
+ 0.545,
1351
+ 0.462,
1352
+ 0.576
1353
+ ],
1354
+ "angle": 0,
1355
+ "content": "6.1 More Demonstrations Are Not Always Better"
1356
+ },
1357
+ {
1358
+ "type": "text",
1359
+ "bbox": [
1360
+ 0.113,
1361
+ 0.582,
1362
+ 0.49,
1363
+ 0.821
1364
+ ],
1365
+ "angle": 0,
1366
+ "content": "The impact of the number of similar demonstrations \\((n)\\) is depicted in Figure 7. It is evident that GPT-4 and ChatGPT demonstrate proficiency in handling larger numbers of demonstrations, leading to enhanced performance, whereas Vicuna, ChatGLM and BLOOZ experience varying degrees of performance degradation with increasing numbers. Notably, ChatGLM displays the least sensitivity to \\(n\\). Furthermore, even ChatGPT's performance declines when \\(n\\) is increased from three to four. The performance improvement resulting from larger values of \\(n\\) can be attributed to the increased recall of true similar cases. Conversely, the decline in performance can be attributed to the noise introduced by more false similar cases."
1367
+ },
1368
+ {
1369
+ "type": "text",
1370
+ "bbox": [
1371
+ 0.113,
1372
+ 0.824,
1373
+ 0.49,
1374
+ 0.919
1375
+ ],
1376
+ "angle": 0,
1377
+ "content": "Performance variations. The change of performance after including an additional demonstration are visualized using heat maps in Figure 8. For each model, the three heat maps stand for the variations from k-shot to \\((\\mathrm{k} + 1)\\) -shot, which are denoted below. For each heat map, the two rows indicate"
1378
+ },
1379
+ {
1380
+ "type": "text",
1381
+ "bbox": [
1382
+ 0.508,
1383
+ 0.085,
1384
+ 0.885,
1385
+ 0.229
1386
+ ],
1387
+ "angle": 0,
1388
+ "content": "the inclusion of a new demonstration with true (T) or false (F) similar cases, while the columns indicate the combinations of existing demonstrations. Take the second heat map as an example. The cell in the column of (F, T) and the row of (T) displays the performance variation between 2-shot of (F, T) demonstrations and 3-shot of (F, T, T) demonstrations. Purple represents performance improvement, while green represents performance decline."
1389
+ },
1390
+ {
1391
+ "type": "text",
1392
+ "bbox": [
1393
+ 0.508,
1394
+ 0.231,
1395
+ 0.885,
1396
+ 0.521
1397
+ ],
1398
+ "angle": 0,
1399
+ "content": "For ChatGPT and BLOOMZ, the second rows of their three heat maps are mainly in purple, indicating significant enhancements resulting from the inclusion of true similar cases. However, the first lines of BLOOMZ display a deeper green color than those of ChatGPT, suggesting that BLOOMZ experiences greater degree of performance declines caused by the inclusion of false similar cases. These findings indicate different sensitivity to false similar demonstrations. Powerful language models like GPT-4 and ChatGPT exhibit robustness to noise in false similar cases, allowing them to remain focused on relevant information in true similar cases. In contrast, weaker LLMs are susceptible to the influence of such noise. Overall, ChatGPT performs better when provided with more similar demonstrations, whereas BLOOMZ demonstrates the opposite, as shown in Figure 7."
1400
+ },
1401
+ {
1402
+ "type": "text",
1403
+ "bbox": [
1404
+ 0.508,
1405
+ 0.523,
1406
+ 0.884,
1407
+ 0.604
1408
+ ],
1409
+ "angle": 0,
1410
+ "content": "The conclusion is that increased numbers of demonstrations have both positive and negative implications for expertise reasoning. However, LLMs could potentially gain from additional demonstrations in tasks that requires clear task illustration."
1411
+ },
1412
+ {
1413
+ "type": "title",
1414
+ "bbox": [
1415
+ 0.509,
1416
+ 0.62,
1417
+ 0.844,
1418
+ 0.651
1419
+ ],
1420
+ "angle": 0,
1421
+ "content": "6.2 The Impact of Absent Ground Truth Labels"
1422
+ },
1423
+ {
1424
+ "type": "text",
1425
+ "bbox": [
1426
+ 0.507,
1427
+ 0.66,
1428
+ 0.884,
1429
+ 0.837
1430
+ ],
1431
+ "angle": 0,
1432
+ "content": "We manually incorporate ground-truth labels into label candidates in cases where they are absent, which may occur due to the limited recall capability of the IR system described in Section 2.2. The test samples are categorized into two groups, namely \"Easy\" and \"Hard\", based on the retrieval of their ground truth labels by the IR system. The original performance of the two groups and the performance of the \"Hard\" group with modified prompts to include ground truth labels, namely \"Hard+GT\", are displayed in Figure 9."
1433
+ },
1434
+ {
1435
+ "type": "text",
1436
+ "bbox": [
1437
+ 0.508,
1438
+ 0.84,
1439
+ 0.885,
1440
+ 0.919
1441
+ ],
1442
+ "angle": 0,
1443
+ "content": "The performance gaps between the \"Easy\" and \"Hard+GT\" groups suggest that challenging samples for IR systems are also difficult for LLMs. However, this gap is insignificant for the powerful GPT-4 who perceives them as equal challeng"
1444
+ },
1445
+ {
1446
+ "type": "page_number",
1447
+ "bbox": [
1448
+ 0.481,
1449
+ 0.928,
1450
+ 0.521,
1451
+ 0.941
1452
+ ],
1453
+ "angle": 0,
1454
+ "content": "7343"
1455
+ }
1456
+ ],
1457
+ [
1458
+ {
1459
+ "type": "image",
1460
+ "bbox": [
1461
+ 0.18,
1462
+ 0.085,
1463
+ 0.835,
1464
+ 0.228
1465
+ ],
1466
+ "angle": 0,
1467
+ "content": null
1468
+ },
1469
+ {
1470
+ "type": "image_caption",
1471
+ "bbox": [
1472
+ 0.113,
1473
+ 0.241,
1474
+ 0.885,
1475
+ 0.288
1476
+ ],
1477
+ "angle": 0,
1478
+ "content": "Figure 8: Heat maps of performance variations resulting from the inclusion of an addition demonstration. \"T\" corresponds to demonstrations with true similar cases, while \"F\" represents those with false similar cases. Each row represents the included new demonstration, while each column indicates the status of existing demonstrations."
1479
+ },
1480
+ {
1481
+ "type": "image",
1482
+ "bbox": [
1483
+ 0.124,
1484
+ 0.312,
1485
+ 0.48,
1486
+ 0.434
1487
+ ],
1488
+ "angle": 0,
1489
+ "content": null
1490
+ },
1491
+ {
1492
+ "type": "image_caption",
1493
+ "bbox": [
1494
+ 0.114,
1495
+ 0.449,
1496
+ 0.49,
1497
+ 0.507
1498
+ ],
1499
+ "angle": 0,
1500
+ "content": "Figure 9: The performance of \"Easy\" and \"Hard\" samples under the setting of zero-shot multi-choice questions. \"Hard+GT\" refers to improvement of including the absent ground truth labels in label candidates."
1501
+ },
1502
+ {
1503
+ "type": "text",
1504
+ "bbox": [
1505
+ 0.113,
1506
+ 0.537,
1507
+ 0.49,
1508
+ 0.651
1509
+ ],
1510
+ "angle": 0,
1511
+ "content": "ing. The improvement of \"Hard+GT\" compared to \"Hard\" is notable in GPT-4, ChatGPT and ChatGLM but inconspicuous in Vicuna with inferior competency in the law. Considering the relatively small size of the \"Hard\" group (79/560), the absence of ground truth labels does not have a significant impact, especially for weaker LLMs."
1512
+ },
1513
+ {
1514
+ "type": "title",
1515
+ "bbox": [
1516
+ 0.114,
1517
+ 0.669,
1518
+ 0.396,
1519
+ 0.684
1520
+ ],
1521
+ "angle": 0,
1522
+ "content": "6.3 Incorporation of Law Articles"
1523
+ },
1524
+ {
1525
+ "type": "text",
1526
+ "bbox": [
1527
+ 0.113,
1528
+ 0.694,
1529
+ 0.49,
1530
+ 0.887
1531
+ ],
1532
+ "angle": 0,
1533
+ "content": "We examine the effect of incorporating legal articles that explicitly define the charges into prompts. For each charge retrieved by the IR system<sup>11</sup>, ChatGPT is required to determine whether the defendant is guilty for the particular charge by answering with a yes or no. We find that \\(94.46\\%\\) of the ground truth charges are accurately detected, while only \\(27.31\\%\\) of the detected charges are correct. The high recall and low precision indicate a substantial difference between ChatGPT and legal experts in the ability to distinguish charges and make precise judgments."
1534
+ },
1535
+ {
1536
+ "type": "title",
1537
+ "bbox": [
1538
+ 0.51,
1539
+ 0.31,
1540
+ 0.637,
1541
+ 0.324
1542
+ ],
1543
+ "angle": 0,
1544
+ "content": "7 Discussion"
1545
+ },
1546
+ {
1547
+ "type": "text",
1548
+ "bbox": [
1549
+ 0.508,
1550
+ 0.335,
1551
+ 0.885,
1552
+ 0.463
1553
+ ],
1554
+ "angle": 0,
1555
+ "content": "We compare the LLMs with supervised baselines. We fine-tune BERT (Devlin et al., 2018) on the same training set and achieve a comparable accuracy of \\(68\\%\\) to ChatGPT but lower than GPT-4. Since LLMs are not fine-tuned on the specific LJP task, this result highlights the remarkable superiority of LLMs in acquiring significant knowledge and leveraging transfer learning Raffel et al. (2020)."
1556
+ },
1557
+ {
1558
+ "type": "text",
1559
+ "bbox": [
1560
+ 0.508,
1561
+ 0.464,
1562
+ 0.884,
1563
+ 0.623
1564
+ ],
1565
+ "angle": 0,
1566
+ "content": "However, we observe that BERT's performance improves to \\(89\\%\\) when trained with the original training set (\\(\\sim 10\\mathrm{K}\\)). We find that certain knowledge is present in shadow features, which can be easily learned with supervision. These superficial features can result in biased supervised models. Fortunately, unsupervised pre-training objectives, make LLMs more robust and less vulnerable to this issue. This depicts a promising future for NLP applications in various domains."
1567
+ },
1568
+ {
1569
+ "type": "title",
1570
+ "bbox": [
1571
+ 0.509,
1572
+ 0.637,
1573
+ 0.642,
1574
+ 0.652
1575
+ ],
1576
+ "angle": 0,
1577
+ "content": "8 Conclusion"
1578
+ },
1579
+ {
1580
+ "type": "text",
1581
+ "bbox": [
1582
+ 0.508,
1583
+ 0.662,
1584
+ 0.885,
1585
+ 0.774
1586
+ ],
1587
+ "angle": 0,
1588
+ "content": "To address the deficiency in evaluating the competency of LLMs in the field of law, we focused on the task of legal judgment prediction and devised four settings to facilitate a thorough evaluation that encompassed both open and multiple-choice questions and incorporated similar cases to aid in the decision-making process."
1589
+ },
1590
+ {
1591
+ "type": "text",
1592
+ "bbox": [
1593
+ 0.508,
1594
+ 0.775,
1595
+ 0.886,
1596
+ 0.919
1597
+ ],
1598
+ "angle": 0,
1599
+ "content": "The evaluation results revealed different behaviors among the prominent LLMs, namely GPT-4 and ChatGPT, compared to their smaller counterparts. Both GPT-4 and ChatGPT exhibited remarkable proficiency in effectively leveraging domain knowledge in various formats. Among the smaller LLMs, ChatGLM displayed greater robustness, while BLOOMZ showcased superior zero-shot ability."
1600
+ },
1601
+ {
1602
+ "type": "page_footnote",
1603
+ "bbox": [
1604
+ 0.132,
1605
+ 0.904,
1606
+ 0.385,
1607
+ 0.919
1608
+ ],
1609
+ "angle": 0,
1610
+ "content": "we also include the ground truth charge"
1611
+ },
1612
+ {
1613
+ "type": "page_number",
1614
+ "bbox": [
1615
+ 0.481,
1616
+ 0.928,
1617
+ 0.521,
1618
+ 0.941
1619
+ ],
1620
+ "angle": 0,
1621
+ "content": "7344"
1622
+ }
1623
+ ],
1624
+ [
1625
+ {
1626
+ "type": "text",
1627
+ "bbox": [
1628
+ 0.113,
1629
+ 0.085,
1630
+ 0.49,
1631
+ 0.182
1632
+ ],
1633
+ "angle": 0,
1634
+ "content": "We presented an intriguing paradox wherein LLMs could become abundant in the presence of a powerful IR system. When improving IR systems to benefit LLMs, it is crucial for researchers to acknowledge this paradoxical scenario and prevent great disparity between LLMs and IR systems."
1635
+ },
1636
+ {
1637
+ "type": "title",
1638
+ "bbox": [
1639
+ 0.114,
1640
+ 0.199,
1641
+ 0.221,
1642
+ 0.214
1643
+ ],
1644
+ "angle": 0,
1645
+ "content": "Limitations"
1646
+ },
1647
+ {
1648
+ "type": "text",
1649
+ "bbox": [
1650
+ 0.113,
1651
+ 0.229,
1652
+ 0.49,
1653
+ 0.356
1654
+ ],
1655
+ "angle": 0,
1656
+ "content": "One limitation of this paper is the use of the close-source GPT-4 and ChatGPT whose availability depends on the commercial company OpenAI. According to OpenAI, the ChatGPT and GPT-4 versions used in this paper, namely gpt-3.5-turbo-0301 and gpt-4-0314, will be deprecated and not available after September 13th, 2023."
1657
+ },
1658
+ {
1659
+ "type": "text",
1660
+ "bbox": [
1661
+ 0.113,
1662
+ 0.359,
1663
+ 0.49,
1664
+ 0.472
1665
+ ],
1666
+ "angle": 0,
1667
+ "content": "Another limitation pertains to the selection of LLMs. Due to the rapid emergence of new LLMs, we are not able to include all of them with the constraint of limited time. Instead of more models, we focus more on designing comprehensive evaluation settings and conducting insightful analyses to shed light on other domains."
1668
+ },
1669
+ {
1670
+ "type": "title",
1671
+ "bbox": [
1672
+ 0.115,
1673
+ 0.489,
1674
+ 0.266,
1675
+ 0.505
1676
+ ],
1677
+ "angle": 0,
1678
+ "content": "Ethics Statement"
1679
+ },
1680
+ {
1681
+ "type": "text",
1682
+ "bbox": [
1683
+ 0.113,
1684
+ 0.519,
1685
+ 0.49,
1686
+ 0.761
1687
+ ],
1688
+ "angle": 0,
1689
+ "content": "The task of legal judgment prediction is used to evaluate LLM's competency in the law. The primary objective of this task is to assist judges and lawyers in comprehending lengthy legal documents by offering them a supplementary tool. It is important to note that this task does not seek to replace the roles of judges and lawyers, nor does it aim to determine the guilt or charges of defendants through machine learning algorithms. Additionally, there is research focused on interpreting LJP models, aiming to enhance the transparency of black-box models for improved utilization by legal practitioners. The paper utilizes a public and anonymized dataset to exclude the potential issue of personal information leakage."
1690
+ },
1691
+ {
1692
+ "type": "title",
1693
+ "bbox": [
1694
+ 0.115,
1695
+ 0.778,
1696
+ 0.287,
1697
+ 0.794
1698
+ ],
1699
+ "angle": 0,
1700
+ "content": "Acknowledgements"
1701
+ },
1702
+ {
1703
+ "type": "text",
1704
+ "bbox": [
1705
+ 0.113,
1706
+ 0.807,
1707
+ 0.49,
1708
+ 0.904
1709
+ ],
1710
+ "angle": 0,
1711
+ "content": "We thank all reviewers for their constructive comments. This research is supported by NExT Research Center, the National Natural Science Foundation of China (9227010114) and the University Synergy Innovation Program of Anhui Province (GXXT-2022-040)."
1712
+ },
1713
+ {
1714
+ "type": "title",
1715
+ "bbox": [
1716
+ 0.511,
1717
+ 0.084,
1718
+ 0.61,
1719
+ 0.099
1720
+ ],
1721
+ "angle": 0,
1722
+ "content": "References"
1723
+ },
1724
+ {
1725
+ "type": "ref_text",
1726
+ "bbox": [
1727
+ 0.511,
1728
+ 0.106,
1729
+ 0.886,
1730
+ 0.2
1731
+ ],
1732
+ "angle": 0,
1733
+ "content": "Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George Bm Van Den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. 2022. Improving language models by retrieving from trillions of tokens. In International conference on machine learning, pages 2206-2240. PMLR."
1734
+ },
1735
+ {
1736
+ "type": "ref_text",
1737
+ "bbox": [
1738
+ 0.511,
1739
+ 0.207,
1740
+ 0.885,
1741
+ 0.288
1742
+ ],
1743
+ "angle": 0,
1744
+ "content": "Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901."
1745
+ },
1746
+ {
1747
+ "type": "ref_text",
1748
+ "bbox": [
1749
+ 0.511,
1750
+ 0.295,
1751
+ 0.885,
1752
+ 0.361
1753
+ ],
1754
+ "angle": 0,
1755
+ "content": "Ilias Chalkidis, Ion Androutsopoulos, and Nikolaos Aletras. 2019. Neural legal judgment prediction in english. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4317-4323."
1756
+ },
1757
+ {
1758
+ "type": "ref_text",
1759
+ "bbox": [
1760
+ 0.511,
1761
+ 0.369,
1762
+ 0.885,
1763
+ 0.45
1764
+ ],
1765
+ "angle": 0,
1766
+ "content": "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. 2023. Vicuna: An opensource chatbot impressing gpt-4 with \\(90\\%\\) * chatgpt quality."
1767
+ },
1768
+ {
1769
+ "type": "ref_text",
1770
+ "bbox": [
1771
+ 0.511,
1772
+ 0.457,
1773
+ 0.885,
1774
+ 0.512
1775
+ ],
1776
+ "angle": 0,
1777
+ "content": "Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. 2017. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30."
1778
+ },
1779
+ {
1780
+ "type": "ref_text",
1781
+ "bbox": [
1782
+ 0.511,
1783
+ 0.519,
1784
+ 0.885,
1785
+ 0.572
1786
+ ],
1787
+ "angle": 0,
1788
+ "content": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805."
1789
+ },
1790
+ {
1791
+ "type": "ref_text",
1792
+ "bbox": [
1793
+ 0.511,
1794
+ 0.58,
1795
+ 0.885,
1796
+ 0.661
1797
+ ],
1798
+ "angle": 0,
1799
+ "content": "Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, and Jie Tang. 2022. Glm: General language model pretraining with autoregressive blank infilling. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 320-335."
1800
+ },
1801
+ {
1802
+ "type": "ref_text",
1803
+ "bbox": [
1804
+ 0.511,
1805
+ 0.668,
1806
+ 0.885,
1807
+ 0.722
1808
+ ],
1809
+ "angle": 0,
1810
+ "content": "Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2020. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300."
1811
+ },
1812
+ {
1813
+ "type": "ref_text",
1814
+ "bbox": [
1815
+ 0.511,
1816
+ 0.729,
1817
+ 0.885,
1818
+ 0.771
1819
+ ],
1820
+ "angle": 0,
1821
+ "content": "Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531."
1822
+ },
1823
+ {
1824
+ "type": "ref_text",
1825
+ "bbox": [
1826
+ 0.511,
1827
+ 0.778,
1828
+ 0.885,
1829
+ 0.845
1830
+ ],
1831
+ "angle": 0,
1832
+ "content": "Zhengbao Jiang, Jun Araki, Haibo Ding, and Graham Neubig. 2021. How can we know when language models know? on the calibration of language models for question answering. Transactions of the Association for Computational Linguistics, 9:962-977."
1833
+ },
1834
+ {
1835
+ "type": "ref_text",
1836
+ "bbox": [
1837
+ 0.511,
1838
+ 0.852,
1839
+ 0.885,
1840
+ 0.919
1841
+ ],
1842
+ "angle": 0,
1843
+ "content": "Zhengbao Jiang, Frank F Xu, Luyu Gao, Zhiqing Sun, Qian Liu, Jane Dwivedi-Yu, Yiming Yang, Jamie Callan, and Graham Neubig. 2023. Active retrieval augmented generation. arXiv preprint arXiv:2305.06983."
1844
+ },
1845
+ {
1846
+ "type": "list",
1847
+ "bbox": [
1848
+ 0.511,
1849
+ 0.106,
1850
+ 0.886,
1851
+ 0.919
1852
+ ],
1853
+ "angle": 0,
1854
+ "content": null
1855
+ },
1856
+ {
1857
+ "type": "page_number",
1858
+ "bbox": [
1859
+ 0.481,
1860
+ 0.929,
1861
+ 0.521,
1862
+ 0.942
1863
+ ],
1864
+ "angle": 0,
1865
+ "content": "7345"
1866
+ }
1867
+ ],
1868
+ [
1869
+ {
1870
+ "type": "ref_text",
1871
+ "bbox": [
1872
+ 0.117,
1873
+ 0.086,
1874
+ 0.487,
1875
+ 0.139
1876
+ ],
1877
+ "angle": 0,
1878
+ "content": "Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2021. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804."
1879
+ },
1880
+ {
1881
+ "type": "ref_text",
1882
+ "bbox": [
1883
+ 0.117,
1884
+ 0.149,
1885
+ 0.487,
1886
+ 0.202
1887
+ ],
1888
+ "angle": 0,
1889
+ "content": "Yubo Ma, Yixin Cao, YongChing Hong, and Aixin Sun. 2023. Large language model is not a good few-shot information extractor, but a good reranker for hard samples! arXiv preprint arXiv:2303.08559."
1890
+ },
1891
+ {
1892
+ "type": "ref_text",
1893
+ "bbox": [
1894
+ 0.117,
1895
+ 0.212,
1896
+ 0.486,
1897
+ 0.238
1898
+ ],
1899
+ "angle": 0,
1900
+ "content": "Eric Martínez. 2023. Re-evaluating gpt-4's bar exam performance. Available at SSRN 4441311."
1901
+ },
1902
+ {
1903
+ "type": "ref_text",
1904
+ "bbox": [
1905
+ 0.117,
1906
+ 0.248,
1907
+ 0.487,
1908
+ 0.326
1909
+ ],
1910
+ "angle": 0,
1911
+ "content": "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. 2022. Crosslingual generalization through multitask finetuning. arXiv preprint arXiv:2211.01786."
1912
+ },
1913
+ {
1914
+ "type": "ref_text",
1915
+ "bbox": [
1916
+ 0.117,
1917
+ 0.337,
1918
+ 0.486,
1919
+ 0.363
1920
+ ],
1921
+ "angle": 0,
1922
+ "content": "OpenAI. 2023. Gpt-4 technical report. arXiv preprint arXiv:2303.08774."
1923
+ },
1924
+ {
1925
+ "type": "ref_text",
1926
+ "bbox": [
1927
+ 0.117,
1928
+ 0.374,
1929
+ 0.487,
1930
+ 0.453
1931
+ ],
1932
+ "angle": 0,
1933
+ "content": "Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730-27744."
1934
+ },
1935
+ {
1936
+ "type": "ref_text",
1937
+ "bbox": [
1938
+ 0.117,
1939
+ 0.463,
1940
+ 0.487,
1941
+ 0.515
1942
+ ],
1943
+ "angle": 0,
1944
+ "content": "Aleksandar Petrov, Emanuele La Malfa, Philip HS Torr, and Adel Bibi. 2023. Language model tokenizers introduce unfairness between languages. arXiv preprint arXiv:2305.15425."
1945
+ },
1946
+ {
1947
+ "type": "ref_text",
1948
+ "bbox": [
1949
+ 0.117,
1950
+ 0.525,
1951
+ 0.487,
1952
+ 0.604
1953
+ ],
1954
+ "angle": 0,
1955
+ "content": "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485-5551."
1956
+ },
1957
+ {
1958
+ "type": "ref_text",
1959
+ "bbox": [
1960
+ 0.117,
1961
+ 0.614,
1962
+ 0.487,
1963
+ 0.655
1964
+ ],
1965
+ "angle": 0,
1966
+ "content": "Ohad Rubin, Jonathan Herzig, and Jonathan Berant. 2021. Learning to retrieve prompts for in-context learning. arXiv preprint arXiv:2112.08633."
1967
+ },
1968
+ {
1969
+ "type": "ref_text",
1970
+ "bbox": [
1971
+ 0.117,
1972
+ 0.664,
1973
+ 0.487,
1974
+ 0.743
1975
+ ],
1976
+ "angle": 0,
1977
+ "content": "Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. 2022. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100."
1978
+ },
1979
+ {
1980
+ "type": "ref_text",
1981
+ "bbox": [
1982
+ 0.117,
1983
+ 0.753,
1984
+ 0.487,
1985
+ 0.805
1986
+ ],
1987
+ "angle": 0,
1988
+ "content": "Olga Shulayeva, Advaith Siddharthan, and Adam Wyner. 2017. Recognizing cited facts and principles in legal judgements. Artificial Intelligence and Law, 25(1):107-126."
1989
+ },
1990
+ {
1991
+ "type": "ref_text",
1992
+ "bbox": [
1993
+ 0.117,
1994
+ 0.816,
1995
+ 0.487,
1996
+ 0.87
1997
+ ],
1998
+ "angle": 0,
1999
+ "content": "Xiaofei Sun, Linfeng Dong, Xiaoya Li, Zhen Wan, Shuhe Wang, Tianwei Zhang, Jiwei Li, Fei Cheng, Lingjuan Lyu, Fei Wu, and Guoyin Wang. 2023. Pushing the limits of chatgpt on nlp tasks."
2000
+ },
2001
+ {
2002
+ "type": "ref_text",
2003
+ "bbox": [
2004
+ 0.117,
2005
+ 0.879,
2006
+ 0.487,
2007
+ 0.919
2008
+ ],
2009
+ "angle": 0,
2010
+ "content": "Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro,"
2011
+ },
2012
+ {
2013
+ "type": "list",
2014
+ "bbox": [
2015
+ 0.117,
2016
+ 0.086,
2017
+ 0.487,
2018
+ 0.919
2019
+ ],
2020
+ "angle": 0,
2021
+ "content": null
2022
+ },
2023
+ {
2024
+ "type": "ref_text",
2025
+ "bbox": [
2026
+ 0.529,
2027
+ 0.086,
2028
+ 0.882,
2029
+ 0.125
2030
+ ],
2031
+ "angle": 0,
2032
+ "content": "Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971."
2033
+ },
2034
+ {
2035
+ "type": "ref_text",
2036
+ "bbox": [
2037
+ 0.512,
2038
+ 0.136,
2039
+ 0.882,
2040
+ 0.214
2041
+ ],
2042
+ "angle": 0,
2043
+ "content": "Boxin Wang, Wei Ping, Peng Xu, Lawrence McAfee, Zihan Liu, Mohammad Shoeybi, Yi Dong, Oleksii Kuchaiev, Bo Li, Chaowei Xiao, et al. 2023. Shall we pretrain autoregressive language models with retrieval? a comprehensive study. arXiv preprint arXiv:2304.06762."
2044
+ },
2045
+ {
2046
+ "type": "ref_text",
2047
+ "bbox": [
2048
+ 0.512,
2049
+ 0.224,
2050
+ 0.882,
2051
+ 0.291
2052
+ ],
2053
+ "angle": 0,
2054
+ "content": "Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2022. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171."
2055
+ },
2056
+ {
2057
+ "type": "ref_text",
2058
+ "bbox": [
2059
+ 0.512,
2060
+ 0.3,
2061
+ 0.882,
2062
+ 0.366
2063
+ ],
2064
+ "angle": 0,
2065
+ "content": "Chaojun Xiao, Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Zhiyuan Liu, Maosong Sun, Yansong Feng, Xianpei Han, Zhen Hu, Heng Wang, et al. 2018. Cail2018: A large-scale legal dataset for judgment prediction. arXiv preprint arXiv:1807.02478."
2066
+ },
2067
+ {
2068
+ "type": "ref_text",
2069
+ "bbox": [
2070
+ 0.512,
2071
+ 0.376,
2072
+ 0.882,
2073
+ 0.442
2074
+ ],
2075
+ "angle": 0,
2076
+ "content": "Chaojun Xiao, Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Zhiyuan Liu, Maosong Sun, Tianyang Zhang, Xianpei Han, Zhen Hu, Heng Wang, et al. 2019. Cail2019-scm: A dataset of similar case matching in legal domain. arXiv preprint arXiv:1911.08962."
2077
+ },
2078
+ {
2079
+ "type": "ref_text",
2080
+ "bbox": [
2081
+ 0.512,
2082
+ 0.452,
2083
+ 0.882,
2084
+ 0.531
2085
+ ],
2086
+ "angle": 0,
2087
+ "content": "Haoxi Zhong, Yuzhong Wang, Cunchao Tu, Tianyang Zhang, Zhiyuan Liu, and Maosong Sun. 2020a. Iteratively questioning and answering for interpretable legal judgment prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1250-1257."
2088
+ },
2089
+ {
2090
+ "type": "ref_text",
2091
+ "bbox": [
2092
+ 0.512,
2093
+ 0.54,
2094
+ 0.882,
2095
+ 0.606
2096
+ ],
2097
+ "angle": 0,
2098
+ "content": "Haoxi Zhong, Chaojun Xiao, Cunchao Tu, Tianyang Zhang, Zhiyuan Liu, and Maosong Sun. 2020b. How does nlp benefit legal system: A summary of legal artificial intelligence. arXiv preprint arXiv:2004.12158."
2099
+ },
2100
+ {
2101
+ "type": "list",
2102
+ "bbox": [
2103
+ 0.512,
2104
+ 0.086,
2105
+ 0.882,
2106
+ 0.606
2107
+ ],
2108
+ "angle": 0,
2109
+ "content": null
2110
+ },
2111
+ {
2112
+ "type": "page_number",
2113
+ "bbox": [
2114
+ 0.481,
2115
+ 0.929,
2116
+ 0.521,
2117
+ 0.941
2118
+ ],
2119
+ "angle": 0,
2120
+ "content": "7346"
2121
+ }
2122
+ ],
2123
+ [
2124
+ {
2125
+ "type": "title",
2126
+ "bbox": [
2127
+ 0.115,
2128
+ 0.085,
2129
+ 0.237,
2130
+ 0.1
2131
+ ],
2132
+ "angle": 0,
2133
+ "content": "A Appendix"
2134
+ },
2135
+ {
2136
+ "type": "title",
2137
+ "bbox": [
2138
+ 0.115,
2139
+ 0.111,
2140
+ 0.308,
2141
+ 0.126
2142
+ ],
2143
+ "angle": 0,
2144
+ "content": "A.1 Prompt Templates"
2145
+ },
2146
+ {
2147
+ "type": "text",
2148
+ "bbox": [
2149
+ 0.113,
2150
+ 0.132,
2151
+ 0.489,
2152
+ 0.228
2153
+ ],
2154
+ "angle": 0,
2155
+ "content": "The prompt template is shown in Figure 10. The translation of the original Chinese prompt is displayed using orange text. The setting of zero-shot open questions use a longer instruction that appends \"Output the charge name directly\" to the instruction in Figure A.1."
2156
+ },
2157
+ {
2158
+ "type": "image",
2159
+ "bbox": [
2160
+ 0.12,
2161
+ 0.244,
2162
+ 0.47,
2163
+ 0.384
2164
+ ],
2165
+ "angle": 0,
2166
+ "content": null
2167
+ },
2168
+ {
2169
+ "type": "image_caption",
2170
+ "bbox": [
2171
+ 0.114,
2172
+ 0.397,
2173
+ 0.486,
2174
+ 0.412
2175
+ ],
2176
+ "angle": 0,
2177
+ "content": "Figure 10: The prompt template in Chinese and English."
2178
+ },
2179
+ {
2180
+ "type": "title",
2181
+ "bbox": [
2182
+ 0.115,
2183
+ 0.44,
2184
+ 0.419,
2185
+ 0.455
2186
+ ],
2187
+ "angle": 0,
2188
+ "content": "A.2 Robust to Fixed Demonstrations"
2189
+ },
2190
+ {
2191
+ "type": "table",
2192
+ "bbox": [
2193
+ 0.149,
2194
+ 0.469,
2195
+ 0.454,
2196
+ 0.57
2197
+ ],
2198
+ "angle": 0,
2199
+ "content": "<table><tr><td>Model</td><td>1shot</td><td>2shot</td></tr><tr><td>GPT-4</td><td>49.59 / 48.84</td><td>50.69</td></tr><tr><td>ChatGPT</td><td>47.01 / 46.57</td><td>47.55</td></tr><tr><td>Vicuna-13B</td><td>22.74 / 29.38</td><td>28.37</td></tr><tr><td>ChatGLM-6B</td><td>22.39 / 25.14</td><td>21.36</td></tr><tr><td>BLOOMZ-7B</td><td>36.65 / 43.94</td><td>42.24</td></tr></table>"
2200
+ },
2201
+ {
2202
+ "type": "table_caption",
2203
+ "bbox": [
2204
+ 0.114,
2205
+ 0.581,
2206
+ 0.486,
2207
+ 0.609
2208
+ ],
2209
+ "angle": 0,
2210
+ "content": "Table 2: The classification accuracy scores with prompts consisting of fixed cases."
2211
+ },
2212
+ {
2213
+ "type": "text",
2214
+ "bbox": [
2215
+ 0.114,
2216
+ 0.629,
2217
+ 0.486,
2218
+ 0.709
2219
+ ],
2220
+ "angle": 0,
2221
+ "content": "We examine the effects of the two fixed cases mentioned in Section 4.3 in Table 2. We find that GPT-4 and ChatGPT are robust to the selection of the fixed demonstration in 1-shot setting, while Vicuna, ChatGLM and BLOOMZ are less robust."
2222
+ },
2223
+ {
2224
+ "type": "title",
2225
+ "bbox": [
2226
+ 0.115,
2227
+ 0.721,
2228
+ 0.47,
2229
+ 0.737
2230
+ ],
2231
+ "angle": 0,
2232
+ "content": "A.3 Comparison with Supervised Baselines"
2233
+ },
2234
+ {
2235
+ "type": "text",
2236
+ "bbox": [
2237
+ 0.113,
2238
+ 0.742,
2239
+ 0.489,
2240
+ 0.87
2241
+ ],
2242
+ "angle": 0,
2243
+ "content": "To understand the performance of supervised finetuning (SFT) baselines on LJP, we experiment on three models: BERT\\(^{12}\\), XLM-RoBERTa\\(^{13}\\) and DeBERTa\\(^{14}\\). These models are fine-tuned on two datasets of different sizes: the original CAIL dataset (~100k samples) and the sampled training set (1120 samples) that is used as retrieval corpus described in Section 3.2, denoted as CAIL_few."
2244
+ },
2245
+ {
2246
+ "type": "text",
2247
+ "bbox": [
2248
+ 0.508,
2249
+ 0.085,
2250
+ 0.883,
2251
+ 0.163
2252
+ ],
2253
+ "angle": 0,
2254
+ "content": "The SFT models are evaluated on the same evaluation dataset described in Section 3.2. The smaller training set aims to compare the few-shot performance of SFT baselines and LLMs in low data scenario."
2255
+ },
2256
+ {
2257
+ "type": "text",
2258
+ "bbox": [
2259
+ 0.508,
2260
+ 0.166,
2261
+ 0.884,
2262
+ 0.262
2263
+ ],
2264
+ "angle": 0,
2265
+ "content": "The results of SFT models are shown in Figure 3. Considering the highest accuracy of GPT-4 being \\(74.46\\%\\) (multi-choice, 4shot), GPT-4 can outperform supervised baselines in low data scenario. If there is abundant training data, supervised baselines are still better than GPT-4 by \\(15\\%\\)."
2266
+ },
2267
+ {
2268
+ "type": "table",
2269
+ "bbox": [
2270
+ 0.543,
2271
+ 0.272,
2272
+ 0.85,
2273
+ 0.341
2274
+ ],
2275
+ "angle": 0,
2276
+ "content": "<table><tr><td>Model</td><td>CAIL</td><td>CAIL_few</td></tr><tr><td>BERT</td><td>89.64</td><td>68.04</td></tr><tr><td>XLM-RoBERTa</td><td>88.75</td><td>66.43</td></tr><tr><td>DeBERTa</td><td>88.57</td><td>30.89</td></tr></table>"
2277
+ },
2278
+ {
2279
+ "type": "table_caption",
2280
+ "bbox": [
2281
+ 0.508,
2282
+ 0.351,
2283
+ 0.881,
2284
+ 0.38
2285
+ ],
2286
+ "angle": 0,
2287
+ "content": "Table 3: Prediction accuracy of SFT models fine-tuned on two training datasets of different sizes."
2288
+ },
2289
+ {
2290
+ "type": "title",
2291
+ "bbox": [
2292
+ 0.509,
2293
+ 0.407,
2294
+ 0.688,
2295
+ 0.421
2296
+ ],
2297
+ "angle": 0,
2298
+ "content": "A.4 Detailed Results"
2299
+ },
2300
+ {
2301
+ "type": "text",
2302
+ "bbox": [
2303
+ 0.508,
2304
+ 0.428,
2305
+ 0.884,
2306
+ 0.475
2307
+ ],
2308
+ "angle": 0,
2309
+ "content": "The specific values of performances displayed in Figure 2 are presented in Table 4. Besides, we also provide the performance of the F1 score in Table 5."
2310
+ },
2311
+ {
2312
+ "type": "page_footnote",
2313
+ "bbox": [
2314
+ 0.133,
2315
+ 0.878,
2316
+ 0.275,
2317
+ 0.891
2318
+ ],
2319
+ "angle": 0,
2320
+ "content": "12bert-base-chinese"
2321
+ },
2322
+ {
2323
+ "type": "page_footnote",
2324
+ "bbox": [
2325
+ 0.134,
2326
+ 0.892,
2327
+ 0.266,
2328
+ 0.904
2329
+ ],
2330
+ "angle": 0,
2331
+ "content": "13xIm-roberta-base"
2332
+ },
2333
+ {
2334
+ "type": "page_footnote",
2335
+ "bbox": [
2336
+ 0.134,
2337
+ 0.905,
2338
+ 0.342,
2339
+ 0.918
2340
+ ],
2341
+ "angle": 0,
2342
+ "content": "\\(^{14}\\)microsoft/mdeberta-v3-base"
2343
+ },
2344
+ {
2345
+ "type": "list",
2346
+ "bbox": [
2347
+ 0.133,
2348
+ 0.878,
2349
+ 0.342,
2350
+ 0.918
2351
+ ],
2352
+ "angle": 0,
2353
+ "content": null
2354
+ },
2355
+ {
2356
+ "type": "page_number",
2357
+ "bbox": [
2358
+ 0.481,
2359
+ 0.928,
2360
+ 0.52,
2361
+ 0.941
2362
+ ],
2363
+ "angle": 0,
2364
+ "content": "7347"
2365
+ }
2366
+ ],
2367
+ [
2368
+ {
2369
+ "type": "table",
2370
+ "bbox": [
2371
+ 0.129,
2372
+ 0.217,
2373
+ 0.87,
2374
+ 0.335
2375
+ ],
2376
+ "angle": 0,
2377
+ "content": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"5\">Open Questions</td><td colspan=\"5\">Multiple-choice Questions</td></tr><tr><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td></tr><tr><td>GPT-4</td><td>55.18</td><td>64.82</td><td>69.11</td><td>69.82</td><td>71.96</td><td>63.93</td><td>71.25</td><td>72.50</td><td>73.75</td><td>74.46</td></tr><tr><td>ChatGPT</td><td>46.61</td><td>60.00</td><td>62.86</td><td>64.82</td><td>66.96</td><td>61.61</td><td>64.46</td><td>66.96</td><td>70.36</td><td>67.14</td></tr><tr><td>Vicuna-13B</td><td>28.21</td><td>50.36</td><td>49.64</td><td>51.79</td><td>35.89</td><td>47.86</td><td>44.82</td><td>43.39</td><td>35.71</td><td>19.46</td></tr><tr><td>ChatGLM-6B</td><td>41.43</td><td>51.79</td><td>50.00</td><td>50.36</td><td>50.54</td><td>55.71</td><td>50.54</td><td>49.64</td><td>49.46</td><td>47.32</td></tr><tr><td>BLOOMZ-7B</td><td>49.82</td><td>54.82</td><td>52.68</td><td>52.50</td><td>51.25</td><td>53.39</td><td>31.96</td><td>31.07</td><td>27.32</td><td>26.61</td></tr></table>"
2378
+ },
2379
+ {
2380
+ "type": "table_caption",
2381
+ "bbox": [
2382
+ 0.227,
2383
+ 0.345,
2384
+ 0.768,
2385
+ 0.358
2386
+ ],
2387
+ "angle": 0,
2388
+ "content": "Table 4: The classification accuracy scores of all models under the four settings."
2389
+ },
2390
+ {
2391
+ "type": "table",
2392
+ "bbox": [
2393
+ 0.129,
2394
+ 0.638,
2395
+ 0.87,
2396
+ 0.755
2397
+ ],
2398
+ "angle": 0,
2399
+ "content": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"5\">Open Questions</td><td colspan=\"5\">Multiple-choice Questions</td></tr><tr><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td></tr><tr><td>GPT-4</td><td>50.52</td><td>62.72</td><td>67.54</td><td>68.61</td><td>71.02</td><td>62.31</td><td>70.42</td><td>71.81</td><td>73.24</td><td>74.00</td></tr><tr><td>ChatGPT</td><td>43.14</td><td>58.42</td><td>61.86</td><td>64.40</td><td>66.16</td><td>60.67</td><td>63.51</td><td>66.85</td><td>69.59</td><td>66.62</td></tr><tr><td>Vicuna-13B</td><td>25.50</td><td>48.85</td><td>47.64</td><td>49.49</td><td>39.82</td><td>44.70</td><td>41.73</td><td>41.48</td><td>35.03</td><td>21.61</td></tr><tr><td>ChatGLM-6B</td><td>41.89</td><td>50.30</td><td>47.76</td><td>48.59</td><td>48.67</td><td>53.74</td><td>49.26</td><td>47.56</td><td>47.61</td><td>45.32</td></tr><tr><td>BLOOMZ-7B</td><td>46.90</td><td>53.28</td><td>51.06</td><td>50.90</td><td>49.26</td><td>50.68</td><td>29.25</td><td>27.92</td><td>25.27</td><td>23.37</td></tr></table>"
2400
+ },
2401
+ {
2402
+ "type": "table_caption",
2403
+ "bbox": [
2404
+ 0.248,
2405
+ 0.765,
2406
+ 0.747,
2407
+ 0.779
2408
+ ],
2409
+ "angle": 0,
2410
+ "content": "Table 5: The classification F1 scores of all models under the four settings."
2411
+ },
2412
+ {
2413
+ "type": "page_number",
2414
+ "bbox": [
2415
+ 0.481,
2416
+ 0.929,
2417
+ 0.521,
2418
+ 0.941
2419
+ ],
2420
+ "angle": 0,
2421
+ "content": "7348"
2422
+ }
2423
+ ]
2424
+ ]
2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/03295168-adb4-4f17-ac96-deb081e11468_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:58945123db33158d43b4788d091211618bef9b2089f572e5db62c3558bf83748
3
+ size 508333
2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/full.md ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction
2
+
3
+ Ruihao Shui
4
+
5
+ National University of Singapore ruihaoshui@u.nus.edu
6
+
7
+ Yixin Cao
8
+
9
+ Singapore Management University yxcao@smu.edu.sg
10
+
11
+ Wang Xiang*
12
+
13
+ University of Science and Technology of China xiangwang1223@gmail.com
14
+
15
+ Tat-Seng Chua
16
+
17
+ National University of Singapore dcscts@nus.edu.sg
18
+
19
+ # Abstract
20
+
21
+ Large language models (LLMs) have demonstrated great potential for domain-specific applications, such as the law domain. However, recent disputes over GPT-4's law evaluation raise questions concerning their performance in real-world legal tasks. To systematically investigate their competency in the law, we design practical baseline solutions based on LLMs and test on the task of legal judgment prediction. In our solutions, LLMs can work alone to answer open questions or coordinate with an information retrieval (IR) system to learn from similar cases or solve simplified multi-choice questions. We show that similar cases and multi-choice options, namely label candidates, included in prompts can help LLMs recall domain knowledge that is critical for expertise legal reasoning. We additionally present an intriguing paradox wherein an IR system surpasses the performance of LLM+IR due to limited gains acquired by weaker LLMs from powerful IR systems. In such cases, the role of LLMs becomes redundant. Our evaluation pipeline can be easily extended into other tasks to facilitate evaluations in other domains. Code is available at https://github.com/srhthu/LM-CompEval-Legal
22
+
23
+ # 1 Introduction
24
+
25
+ Large language models have achieved great success in various Natural Language Processing (NLP) tasks (Brown et al., 2020; Touvron et al., 2023), while there are still some disputes over the potential for domain-specific applications (Martínez, 2023). Focusing on the law domain, the leading LLM, GPT-4 (OpenAI, 2023), was claimed to pass the Uniform Bar Exam (UBE) with a 90th percentile score. Although inspiring, however, this result was pointed out to be overestimated (Martínez, 2023).
26
+
27
+ ![](images/99ef283638db9ae2fce19004b145e404d3b53a5a36b8bac09db03b2bc2773c2c.jpg)
28
+ Figure 1: The task of Legal Judgment Prediction and the evaluation settings. Different colors refer to different charges. For similar cases, "T" refers to true similar cases with the same charges as the query cases, while "F" refers to false similar cases. For task settings, "ZS" is the abbreviation for zero-shot and "FS" for few-shot.
29
+
30
+ This raises an interesting question: How exactly LLMs perform in various real-world legal tasks?
31
+
32
+ In this paper, we design practical baseline solutions based on LLMs and systematically investigate their competency in the law, to shed light on other domains as well. We attribute the main issues of the previous benchmark as follows. First, UBE is too general and not subject to any legal jurisdiction (Martínez, 2023). Second, UBE contains multi-choice questions and open-ended questions that require human experts to evaluate. To avoid human evaluation, some datasets (Hendrycks et al., 2020) replace open-ended questions with multi-choice questions. However, in real-world applications, there are not only multi-choice but also open questions. Using multi-choice questions only may not be comprehensive enough. Third, specifically in but not limited to common law (Shulayeva et al., 2017; Xiao et al., 2019), similar cases are always introduced as evidence to support expertise legal reasoning (Zhong et al., 2020b), which are not fully
33
+
34
+ studied in previous benchmark (Hendrycks et al., 2020).
35
+
36
+ For the first issue, we choose legal judgment prediction (LJP) (Xiao et al., 2018; Chalkidis et al., 2019; Zhong et al., 2020a) as the example task for investigation. It is a real-world problem to determine the charges committed by the defendants under a juridical system, as shown in Figure 1. LJP is typically formulated as a classification task to predict the most possible one from a list of predefined charges. Then, for the second and third issues, we design four settings derived from two work scenarios of LLMs to cover open and multichoice questions and the usage of similar cases. In the first scenario, LLMs work alone without explicit knowledge in prompts, assuming all domain knowledge is implicitly stored in parameters. In the second scenario, LLMs coordinate with an information retrieval (IR) system that enriches prompts with similar demonstrations and label candidates to benefit expertise reasoning. Specifically, demonstrations consist of pairs of similar cases and their charges, which are retrieved by the IR system based on similarity of case facts. Labels of the retrieved cases can form label candidates, shown as circles of different colors in Figure 1, to hint LLM with label information and narrow down label space (Ma et al., 2023).
37
+
38
+ The four evaluation settings in Figure 1 can be categorized based on the presence of two elements in prompts: demonstrations (similar cases) and label candidates. Demonstrations convert the setting from zero-shot to few-shot prompting, while label candidates simplify the task from open questions to multi-choice questions<sup>1</sup>. The first scenario corresponds to the first setting, where neither element is present, while the second scenario encompasses the remaining three settings. We evaluate five up-to-date LLMs of the close-source GPT-3 (Brown et al., 2020) family, ChatGPT and GPT-4 (OpenAI, 2023), and open-source LLMs including Vicuna (Chiang et al., 2023), ChatGLM (Du et al., 2022) and BLOOMZ (Muennighoff et al., 2022). The evaluation is conducted on a Chinese LJP dataset, namely CAIL (Xiao et al., 2018), which contains cases of 112 criminal law charges<sup>2</sup>.
39
+
40
+ We highlight our key findings as follows:
41
+
42
+ 1. Similar cases and label candidates can help
43
+
44
+ LLMs recall domain knowledge that is critical for expertise legal reasoning.
45
+
46
+ 2. Label candidates result in more consistent outputs, indicating LLMs gain greater confidence in their domain knowledge (Jiang et al., 2021).
47
+ 3. Irrelevant demonstrations formed by fixed cases hardly improve performance. This excludes their effect on task illustration.
48
+ 4. Paradox: An IR system can outperform LLM+IR since weaker LLMs acquire limited gains from informative documents retrieved by a powerful IR system. Thus, it is critical to adapte LLMs to generate with retrieved documents.
49
+ 5. More similar cases introduce more knowledge and noise simultaneously, whose final outcome depends on LLMs.
50
+
51
+ The main contributions are summarized in three aspects:
52
+
53
+ - We investigate the law competency of LLMs on the task of legal judgment prediction.
54
+ - We propose practical baseline solutions for LLMs that tackle two scenarios: working alone or in coordination with an IR system.
55
+ - We evaluate five LLMs and conduct comprehensive analysis to demystify their characteristics of expertise reasoning.
56
+
57
+ # 2 Baseline Method
58
+
59
+ The goal of legal judgment prediction is to determine the committed charges given case facts. To harness LLMs for LJP, we adopt in-context learning (Brown et al., 2020) and use LLMs to generate the charges conditioned on prompts (Section 2.1). To enhance LLMs, we incorporate label candidates and demonstrations consisting of similar cases into prompts, which are acquired by an IR system (Section 2.2). This derives four settings of baseline solutions, namely zero-shot open questions, few-shot open questions, zero-shot multi-choice questions, and few-shot multi-choice questions. The multi-choice settings employ label candidates while few-shot settings include demonstrations, as shown in Figure 1. Finally, we introduce how to simulate IR systems with different capabilities to understand their effects (Section 2.3).
60
+
61
+ # 2.1 LLM Prompting
62
+
63
+ Prompt Design. A prompt begins with an instruction to illustrate the task followed by label
64
+
65
+ candidates and task demonstrations in the form of input-output pairs. The templates of prompts are displayed in Appendix A.1.
66
+
67
+ Parsing. We adopt one automatic parsing function for all LLMs to map LLM outputs to predefined charge labels. No ad hoc heuristics are employed for a fair comparison. Specifically, we use the BM25 algorithm<sup>3</sup> to measure text similarity between outputs and pre-defined charges and predict the most similar charges. BM25 is robust and yields comparable performances to neural similarity methods like text2vec<sup>4</sup> in our pilot experiments.
68
+
69
+ Inference. Sampling is enabled during generation for consistent results, as inspired by Wang et al. (2022). Five outputs are sampled for each prompt with the temperature of 0.8. Their similarity scores of pre-defined labels are averaged.
70
+
71
+ # 2.2 IR System for Knowledge Incorporation
72
+
73
+ IR systems are utilized to retrieve similar cases, commonly referenced by lawyers and judges, to inform their judgments. In addition to providing demonstrations, these similar cases can also aid in generating potential labels by incorporating the labels from the top similar cases. By employing these smaller sets of predefined charges, namely label candidates, complex open questions can be simplified into multiple-choice questions. This approach is effective in enhancing LM prompting (Ma et al., 2023), as including hundreds of charges directly in prompts is impractical.
74
+
75
+ Implementation of IR System. We use the BM25 algorithm to measure the semantic similarity between cases. Similar cases are retrieved from the training dataset. To guarantee that the demonstrations exemplify one of the multi-choice options, we exclude demonstrations with labels that are not among the candidate options<sup>5</sup>.
76
+
77
+ # 2.3 Simulation of IR Systems
78
+
79
+ To investigate the effects of IR capabilities, we simulate a series of IR systems of different capabilities as measured by Precision@1 $^{6}$ . Then the top retrieved cases are used as demonstrations. We consider cases with identical charges to the query cases as true similar cases and vice versa.
80
+
81
+ 3https://pypi.org/project/rank-bm25/
82
+ <sup>4</sup>https://github.com/crownpku/text2vec
83
+ 5This condition is not violated for the top four similar cases without filtering.
84
+ The accuracy of the top one retrieved case.
85
+
86
+ Realistic Simulation. We prioritize the returning of true similar cases for easy query cases, rather than the returning in a random manner. The query difficulty is measured by the Precision@10 of the BM25 retriever described in Section 2.2. The motivation is that queries with shadow linguistic features are more possible to get relevant retrieval results than complex or obscure queries. For a specific value (e.g., a%) of Precision@1 to be simulated, the top a% of easy test cases are assured to have a true similar case, while the rest are assigned false similar cases.
87
+
88
+ # 3 Experimental Setup
89
+
90
+ # 3.1 Models
91
+
92
+ Below is a concise introduction to the five LLMs to be evaluated.
93
+
94
+ GPT-4 (OpenAI, 2023) and ChatGPT are available from OpenAI API and the versions of gpt-4-0314 and gpt-3.5-turbo-0301 are used. For technological details, ChatGPT is claimed to be a sibling model to InstructGPT (Ouyang et al., 2022) that is trained to follow instructions and align to human preferences with the RLHF algorithm (Christiano et al., 2017).
95
+
96
+ Vicuna-13B (Chiang et al., 2023) is a LLaMA model (Touvron et al., 2023) fine-tuned on 70K public user-shared conversations with ChatGPT. It can be viewed to learn distilled knowledge (Hinton et al., 2015) of ChatGPT.
97
+
98
+ ChatGLM-6B<sup>7</sup> is a dialog language model based on the GLM (Du et al., 2022) architecture and supports English and Chinese.
99
+
100
+ BLOOMZ (Muennighoff et al., 2022) is an instruction fine-tuned BLOOM (Scao et al., 2022), a multilingual language model. We use the bloomz-7b1-mt version that is tuned for multilingual prompts. Except for BLOOMZ, Vicuna and ChatGLM are mainly fine-tuned on conversational data.
101
+
102
+ # 3.2 Dataset and Pre-processing
103
+
104
+ The Chinese LJP dataset, CAIL (Xiao et al., 2018), is used in our experiments. Each sample consists of the case facts and the committed charge as the label. As the original dataset is very large (~100K for training and ~20K for test), we randomly sample a balanced small test set from the original test set. Five cases are sampled for each charge, accounting
105
+
106
+ <table><tr><td>Tokenizer</td><td>Median</td><td>&lt;=500</td><td>&lt;=1000</td></tr><tr><td>ChatGPT</td><td>396.5</td><td>68.75</td><td>92.32</td></tr><tr><td>Vicuna</td><td>496.0</td><td>50.89</td><td>86.96</td></tr><tr><td>ChatGLM</td><td>206.5</td><td>91.07</td><td>98.57</td></tr><tr><td>BLOOMZ</td><td>210.5</td><td>90.54</td><td>98.93</td></tr></table>
107
+
108
+ Table 1: Statistics of the number of tokens across tokenizers. The last two columns present the ratios of test samples with token counts below the specified values.
109
+
110
+ for 560 test cases in total for 112 charges. Similarly, we also sample the training and validation sets with 10 cases per charge. The training set is used to retrieve similar cases (Section 2.3), while the validation set is used to determine the optimal $k$ of the kNN algorithm.
111
+
112
+ Truncation. Since some cases have very long descriptions, we truncate the case facts of demonstrations to 500 tokens and those of test samples to 1000 tokens. It is worth noting that the text is tokenized by the tokenizer of each model before truncation for a fair comparison. Recently, Petrov et al. (2023) address the issue that a tokenizer can lead to different performances of different languages. This suggests that the performance on a particular language can also be influenced by tokenizers from various models with varying language encoding efficiency.
113
+
114
+ Table 1 shows the statistics of the number of tokens processed by different tokenizers<sup>8</sup>. The most efficient tokenizers for Chinese are those of ChatGLM and BLOOMZ, indicated by the medians of token numbers. In contrast, the tokenizer of ChatGPT produces $2 \times$ tokens and that of Vicuna produces $2.5 \times$ tokens. The truncation length is proper to accommodate most samples.
115
+
116
+ # 4 LLM vs. LLM with IR System
117
+
118
+ We initially present the overall results, highlighting the importance of label candidates and similar cases, and conduct a comparative analysis of the models. Subsequently, we investigate the relationship between label candidates and self-consistency to unveil their actual effects on expertise reasoning. Additionally, we perform an ablation study by replacing similar cases with fixed cases as demonstrations to further understand their impact.
119
+
120
+ ![](images/620fe7dc4baab808679f7c64609c21920fadcfb6307c9e362caf890ff9646183.jpg)
121
+ Figure 2: The macro comparison between the four settings. “+Label” refers to zero-shot multi-choice questions; “+Sim Case” refers to few-shot open questions and “+Label +Sim Case” refers to few-shot multi-choice questions. More than one points of a model in the last two settings refer to runs with different number of demonstrations.
122
+
123
+ ![](images/058621cf7b920696a5ded18ebf7ce22d573e13f2fbf3fb20ad1dab34e7e7a260.jpg)
124
+ Figure 3: Compare the models under each setting. Few-shot performances are averaged among 1-shot to 4-shot.
125
+
126
+ ![](images/927a75a027158091b5c7362bb8583d03d067384c89367a300592ad4e44d85ee6.jpg)
127
+
128
+ # 4.1 Overall Results
129
+
130
+ The macro comparison between the four settings is shown in Figure 2, where each point represents the performance of one specific run of one model.
131
+
132
+ Significance of label candidates and similar cases. In comparison to the zero-shot open question setting where LLMs work alone, the inclusion of label candidates, similar cases, or both demonstrates noteworthy enhancements. This highlights the effectiveness of our baseline solutions that leverage IR systems to expand the capabilities of LLMs in legal domains. These findings align with previous research that has also recognized the significance of the two components (Ma et al., 2023; Liu et al., 2021).
133
+
134
+ The effects of label candidates and similar cases differ slightly in terms of performance mean and
135
+
136
+ variance. Label candidates contribute to a higher mean performance, while similar cases introduce greater variance. Examining the model performances in the third setting (+Sim Case) displayed in Figure 2, GPT-4 and ChatGPT exhibit more significant improvements from similar cases compared to their smaller counterparts. They also gain more benefit from similar cases than from label candidates. This observation can be attributed to the varying difficulty levels of knowledge utilization. While the knowledge within label candidates is readily accessible and straightforward, leveraging similar cases requires stronger language understanding and few-shot learning abilities.
137
+
138
+ Furthermore, the coexistence of label candidates and similar cases further enhances the performance of GPT-4 and ChatGPT, but it diminishes the performance of Vicuna, ChatGLM, and BLOOMZ. This suggests that smaller LLMs may encounter challenges in effectively managing knowledge in multiple forms simultaneously, leading to confusion.
139
+
140
+ Model comparison. The performances of the models under zero-shot and few-shot prompting is shown in Figure 3, where few-shot performances are averaged among 1-shot to 4-shot.
141
+
142
+ The zero-shot setting emphasizes the ability to understand instructions. When only instructions are available, BLOOMZ performs better than ChatGPT, indicating a superior multilingual instruction following ability. This result is reasonable as BLOOMZ is the only smaller LLM that is fine-tuned on multilingual instructions. Once provided with explicit domain knowledge, ChatGPT outperforms all smaller LLMs. The case is the same for BLOOMZ and ChatGLM, where ChatGLM overtakes BLOOMZ with knowledge of label candidates. BLOOMZ performs worst when prompted with two forms of knowledge, indicating that BLOOMZ is not very robust to prompts. Among the three smaller LLMs, ChatGLM is the most robust to various forms of knowledge.
143
+
144
+ The significant effects of label candidates and similar cases can be explained as they activate LLM's memory of relevant domain knowledge. This view can be supported by two pieces of evidence about the relationship between label candidates and self-consistency (Section 4.2) and the negligible effect of irrelevant cases as fixed demonstrations (Section 4.3).
145
+
146
+ ![](images/797c37324a6cae109c7d203b9697dd318c533ebb16e08e086e16c03012b985f5.jpg)
147
+ Figure 4: Changes of performance and self-consistency after adding label candidates. The change of each model is illustrated by an arrow pointing from the open question setting to the multi-choice setting.
148
+
149
+ # 4.2 Label Candidates Enhance Self-consistency and Confidence
150
+
151
+ To further understand the effect of label candidates, we propose a metric to measure the self-consistency of LLMs that is calculated as the number of the majority prediction. Consistent outputs indicate a high level of confidence in LLMs, which is often associated with a better grasp of knowledge (Jiang et al., 2021, 2023).
152
+
153
+ The changes in performance and self-consistency after introducing label candidates are shown in Figure 4 as the arrows. We observe that the incorporation of label candidates leads to more consistent outputs (8 of 10 cases) and higher confidence in LLMs except zero-shot GPT-4 with a slight decrease and few-shot BLOOMZ. In the zero-shot setting, label candidates significantly boost LLM performances. We postulate that label candidates help by eliciting pre-stored domain knowledge with concise charge names. Besides, the self-consistency also correlates with model performances (7 of 10 cases). Such correlation is also observed in other tasks like question answering (Jiang et al., 2021). It is worth noting that label candidates decrease both self-consistency and performance of few-shot prompted BLOOMZ, which also aligns with the correlation.
154
+
155
+ # 4.3 Domain Knowledge Is More Critical Than Task Illustration
156
+
157
+ There is a possible argument that similar demonstrations can help LLMs understand instructions and tasks. To disentangle their effects on task illustration and provision of domain knowledge, we
158
+
159
+ ![](images/eea72bf54c5ffa53aceb9880908d9a5af00872456134b4818d6da649d2fe31a9.jpg)
160
+ Figure 5: The effects of fixed (irrelevant) and similar cases as demonstrations. Divided by the baseline setting of zero-shot open questions, the left part refers to fixed demonstrations with increasing numbers of demonstrations, while the right part refers to similar demonstrations. The shadow area represents the range of standard deviation.
161
+
162
+ experiment with irrelevant demonstrations fixed for all test samples. We manually select two common cases with frequent charges in the original dataset as the fixed demonstrations. The 1-shot performance was averaged on the two demonstrations.
163
+
164
+ We compare the effects of fixed and similar demonstrations with the baseline setting of zero-shot open questions in Figure 5. The change of performance from center to left demonstrates that fixed demonstrations hardly benefit LLMs and sometimes harm the performance (e.g., ChatGLM). This indicates that LLMs can basically understand instructions and do not need general demonstrations for task clarification, implying that the main challenge of expertise reasoning is to recall domain knowledge instead of understanding a specific task.
165
+
166
+ We inspect the notable performance drop of ChatGLM resulting from fixed demonstrations. We find that ChatGLM tends to analyze the cases of both demonstrations and test samples and then answer with both of their charges. Its wordy style seems to result from the fine-tuning dialog corpus where an assistant LLM is supposed to provide rich information. In contrast, similar cases seem to encourage more concise outputs following the format of demonstrations.
167
+
168
+ # 5 Paradox of Information Retrieval System
169
+
170
+ The significance of similar demonstrations illustrated in Section 4.3 has motivated research focusing on prompting-oriented IR systems (Rubin et al., 2021; Sun et al., 2023) to retrieve high qual
171
+
172
+ ![](images/0474ae253fa7623cb6310b53e5d59e27aaf151b2cd9ad07d38f2f015a7f64a32.jpg)
173
+ Figure 6: The performance of ChatGPT coordinated with a series of simulated IR systems with varying capabilities as measured by Precision@1. The vertical blue line represents the threshold of IR capability at which IR systems overtake ChatGPT. The performance of ChatGPT in the real setting (1-shot open questions) is indicated by the red plus sign.
174
+
175
+ ity demonstrations. However, we raise an intuitive question: Do LLMs gain substantial improvement from IR systems compared to the kNN baseline that harnesses IR systems for classification tasks? The question is inspired by our observation that the BM25 retriever achieves $48.03\%$ of Precision@1 and $57.68\%$ prediction accuracy by majority vote of top $k = 17$ retrieved similar cases.
176
+
177
+ This observation suggests a paradoxical scenario wherein an IR system outperforms the combination of LLM and IR, with the LLM taking on the leading role and the IR serving as a supporting role. In such a scenario, the LLM becomes redundant due to its failure to fully utilize the informative retrieved documents.
178
+
179
+ To investigate the paradox, instead of experimenting with different IR systems, we manipulate the BM25 retriever to simulate a series of IR systems with different capabilities measured by Precision@1 as described by Section 2.3. We take a case study of ChatGPT, whose 1-shot performance under different IR systems (denoted as Precision@1) is shown in Figure 6.
180
+
181
+ Results Although the performance of ChatGPT enhanced by IR systems improves with IR capability, it will eventually underperform the IR system once the IR capability surpasses a certain threshold. In the ideal situation where true similar cases are always retrieved, ChatGPT is unable to attain $100\%$ accuracy and lags significantly behind the optimal IR system. According to Appendix A.4, all smaller LLMs are not comparable to the BM25 retriever.
182
+
183
+ Discussion The findings demonstrate that LLMs face challenges in effectively leveraging informa
184
+
185
+ ![](images/172f2228b736de67a5247c124932299a26a9018979977cbb67db93e147fb597c.jpg)
186
+ Figure 7: Performance vs. the number of similar demonstrations of the five LLMs.
187
+
188
+ tive retrieved documents. This underscores the need for significant research efforts to enhance the synergy between auto-regressive language models and retrieval by conditioning model outputs more on retrieved documents. Previous work has explored the augmentation of LLMs with retrieval at both the pre-training and fine-tuning stages (Borgeaud et al., 2022; Wang et al., 2023). Moreover, the marginal and inadequate improvement with retrieval indicates the limited legal reasoning ability of existing general LLMs. There is a need for future efforts to enhance domain-specific reasoning abilities of pre-trained foundation models.
189
+
190
+ # 6 Ablation Study
191
+
192
+ # 6.1 More Demonstrations Are Not Always Better
193
+
194
+ The impact of the number of similar demonstrations $(n)$ is depicted in Figure 7. It is evident that GPT-4 and ChatGPT demonstrate proficiency in handling larger numbers of demonstrations, leading to enhanced performance, whereas Vicuna, ChatGLM and BLOOZ experience varying degrees of performance degradation with increasing numbers. Notably, ChatGLM displays the least sensitivity to $n$ . Furthermore, even ChatGPT's performance declines when $n$ is increased from three to four. The performance improvement resulting from larger values of $n$ can be attributed to the increased recall of true similar cases. Conversely, the decline in performance can be attributed to the noise introduced by more false similar cases.
195
+
196
+ Performance variations. The change of performance after including an additional demonstration are visualized using heat maps in Figure 8. For each model, the three heat maps stand for the variations from k-shot to $(\mathrm{k} + 1)$ -shot, which are denoted below. For each heat map, the two rows indicate
197
+
198
+ the inclusion of a new demonstration with true (T) or false (F) similar cases, while the columns indicate the combinations of existing demonstrations. Take the second heat map as an example. The cell in the column of (F, T) and the row of (T) displays the performance variation between 2-shot of (F, T) demonstrations and 3-shot of (F, T, T) demonstrations. Purple represents performance improvement, while green represents performance decline.
199
+
200
+ For ChatGPT and BLOOMZ, the second rows of their three heat maps are mainly in purple, indicating significant enhancements resulting from the inclusion of true similar cases. However, the first lines of BLOOMZ display a deeper green color than those of ChatGPT, suggesting that BLOOMZ experiences greater degree of performance declines caused by the inclusion of false similar cases. These findings indicate different sensitivity to false similar demonstrations. Powerful language models like GPT-4 and ChatGPT exhibit robustness to noise in false similar cases, allowing them to remain focused on relevant information in true similar cases. In contrast, weaker LLMs are susceptible to the influence of such noise. Overall, ChatGPT performs better when provided with more similar demonstrations, whereas BLOOMZ demonstrates the opposite, as shown in Figure 7.
201
+
202
+ The conclusion is that increased numbers of demonstrations have both positive and negative implications for expertise reasoning. However, LLMs could potentially gain from additional demonstrations in tasks that requires clear task illustration.
203
+
204
+ # 6.2 The Impact of Absent Ground Truth Labels
205
+
206
+ We manually incorporate ground-truth labels into label candidates in cases where they are absent, which may occur due to the limited recall capability of the IR system described in Section 2.2. The test samples are categorized into two groups, namely "Easy" and "Hard", based on the retrieval of their ground truth labels by the IR system. The original performance of the two groups and the performance of the "Hard" group with modified prompts to include ground truth labels, namely "Hard+GT", are displayed in Figure 9.
207
+
208
+ The performance gaps between the "Easy" and "Hard+GT" groups suggest that challenging samples for IR systems are also difficult for LLMs. However, this gap is insignificant for the powerful GPT-4 who perceives them as equal challeng
209
+
210
+ ![](images/fceac87db227ad2a57df6f7e774a27f1bdaa0fa61b7ab09823a4b90fdef37bc8.jpg)
211
+ Figure 8: Heat maps of performance variations resulting from the inclusion of an addition demonstration. "T" corresponds to demonstrations with true similar cases, while "F" represents those with false similar cases. Each row represents the included new demonstration, while each column indicates the status of existing demonstrations.
212
+
213
+ ![](images/37506c50c53710f25935e164f14860b2a53239585ed1d5a3b8f8ac353fd38898.jpg)
214
+ Figure 9: The performance of "Easy" and "Hard" samples under the setting of zero-shot multi-choice questions. "Hard+GT" refers to improvement of including the absent ground truth labels in label candidates.
215
+
216
+ ing. The improvement of "Hard+GT" compared to "Hard" is notable in GPT-4, ChatGPT and ChatGLM but inconspicuous in Vicuna with inferior competency in the law. Considering the relatively small size of the "Hard" group (79/560), the absence of ground truth labels does not have a significant impact, especially for weaker LLMs.
217
+
218
+ # 6.3 Incorporation of Law Articles
219
+
220
+ We examine the effect of incorporating legal articles that explicitly define the charges into prompts. For each charge retrieved by the IR system<sup>11</sup>, ChatGPT is required to determine whether the defendant is guilty for the particular charge by answering with a yes or no. We find that $94.46\%$ of the ground truth charges are accurately detected, while only $27.31\%$ of the detected charges are correct. The high recall and low precision indicate a substantial difference between ChatGPT and legal experts in the ability to distinguish charges and make precise judgments.
221
+
222
+ # 7 Discussion
223
+
224
+ We compare the LLMs with supervised baselines. We fine-tune BERT (Devlin et al., 2018) on the same training set and achieve a comparable accuracy of $68\%$ to ChatGPT but lower than GPT-4. Since LLMs are not fine-tuned on the specific LJP task, this result highlights the remarkable superiority of LLMs in acquiring significant knowledge and leveraging transfer learning Raffel et al. (2020).
225
+
226
+ However, we observe that BERT's performance improves to $89\%$ when trained with the original training set ( $\sim 10\mathrm{K}$ ). We find that certain knowledge is present in shadow features, which can be easily learned with supervision. These superficial features can result in biased supervised models. Fortunately, unsupervised pre-training objectives, make LLMs more robust and less vulnerable to this issue. This depicts a promising future for NLP applications in various domains.
227
+
228
+ # 8 Conclusion
229
+
230
+ To address the deficiency in evaluating the competency of LLMs in the field of law, we focused on the task of legal judgment prediction and devised four settings to facilitate a thorough evaluation that encompassed both open and multiple-choice questions and incorporated similar cases to aid in the decision-making process.
231
+
232
+ The evaluation results revealed different behaviors among the prominent LLMs, namely GPT-4 and ChatGPT, compared to their smaller counterparts. Both GPT-4 and ChatGPT exhibited remarkable proficiency in effectively leveraging domain knowledge in various formats. Among the smaller LLMs, ChatGLM displayed greater robustness, while BLOOMZ showcased superior zero-shot ability.
233
+
234
+ We presented an intriguing paradox wherein LLMs could become abundant in the presence of a powerful IR system. When improving IR systems to benefit LLMs, it is crucial for researchers to acknowledge this paradoxical scenario and prevent great disparity between LLMs and IR systems.
235
+
236
+ # Limitations
237
+
238
+ One limitation of this paper is the use of the close-source GPT-4 and ChatGPT whose availability depends on the commercial company OpenAI. According to OpenAI, the ChatGPT and GPT-4 versions used in this paper, namely gpt-3.5-turbo-0301 and gpt-4-0314, will be deprecated and not available after September 13th, 2023.
239
+
240
+ Another limitation pertains to the selection of LLMs. Due to the rapid emergence of new LLMs, we are not able to include all of them with the constraint of limited time. Instead of more models, we focus more on designing comprehensive evaluation settings and conducting insightful analyses to shed light on other domains.
241
+
242
+ # Ethics Statement
243
+
244
+ The task of legal judgment prediction is used to evaluate LLM's competency in the law. The primary objective of this task is to assist judges and lawyers in comprehending lengthy legal documents by offering them a supplementary tool. It is important to note that this task does not seek to replace the roles of judges and lawyers, nor does it aim to determine the guilt or charges of defendants through machine learning algorithms. Additionally, there is research focused on interpreting LJP models, aiming to enhance the transparency of black-box models for improved utilization by legal practitioners. The paper utilizes a public and anonymized dataset to exclude the potential issue of personal information leakage.
245
+
246
+ # Acknowledgements
247
+
248
+ We thank all reviewers for their constructive comments. This research is supported by NExT Research Center, the National Natural Science Foundation of China (9227010114) and the University Synergy Innovation Program of Anhui Province (GXXT-2022-040).
249
+
250
+ # References
251
+
252
+ Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George Bm Van Den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. 2022. Improving language models by retrieving from trillions of tokens. In International conference on machine learning, pages 2206-2240. PMLR.
253
+ Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901.
254
+ Ilias Chalkidis, Ion Androutsopoulos, and Nikolaos Aletras. 2019. Neural legal judgment prediction in english. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4317-4323.
255
+ 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. 2023. Vicuna: An opensource chatbot impressing gpt-4 with $90\%$ * chatgpt quality.
256
+ Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. 2017. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30.
257
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
258
+ Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, and Jie Tang. 2022. Glm: General language model pretraining with autoregressive blank infilling. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 320-335.
259
+ Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2020. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300.
260
+ Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531.
261
+ Zhengbao Jiang, Jun Araki, Haibo Ding, and Graham Neubig. 2021. How can we know when language models know? on the calibration of language models for question answering. Transactions of the Association for Computational Linguistics, 9:962-977.
262
+ Zhengbao Jiang, Frank F Xu, Luyu Gao, Zhiqing Sun, Qian Liu, Jane Dwivedi-Yu, Yiming Yang, Jamie Callan, and Graham Neubig. 2023. Active retrieval augmented generation. arXiv preprint arXiv:2305.06983.
263
+
264
+ Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2021. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804.
265
+ Yubo Ma, Yixin Cao, YongChing Hong, and Aixin Sun. 2023. Large language model is not a good few-shot information extractor, but a good reranker for hard samples! arXiv preprint arXiv:2303.08559.
266
+ Eric Martínez. 2023. Re-evaluating gpt-4's bar exam performance. Available at SSRN 4441311.
267
+ 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. 2022. Crosslingual generalization through multitask finetuning. arXiv preprint arXiv:2211.01786.
268
+ OpenAI. 2023. Gpt-4 technical report. arXiv preprint arXiv:2303.08774.
269
+ Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730-27744.
270
+ Aleksandar Petrov, Emanuele La Malfa, Philip HS Torr, and Adel Bibi. 2023. Language model tokenizers introduce unfairness between languages. arXiv preprint arXiv:2305.15425.
271
+ Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485-5551.
272
+ Ohad Rubin, Jonathan Herzig, and Jonathan Berant. 2021. Learning to retrieve prompts for in-context learning. arXiv preprint arXiv:2112.08633.
273
+ Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilic, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Galle, et al. 2022. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100.
274
+ Olga Shulayeva, Advaith Siddharthan, and Adam Wyner. 2017. Recognizing cited facts and principles in legal judgements. Artificial Intelligence and Law, 25(1):107-126.
275
+ Xiaofei Sun, Linfeng Dong, Xiaoya Li, Zhen Wan, Shuhe Wang, Tianwei Zhang, Jiwei Li, Fei Cheng, Lingjuan Lyu, Fei Wu, and Guoyin Wang. 2023. Pushing the limits of chatgpt on nlp tasks.
276
+ Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro,
277
+
278
+ Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
279
+ Boxin Wang, Wei Ping, Peng Xu, Lawrence McAfee, Zihan Liu, Mohammad Shoeybi, Yi Dong, Oleksii Kuchaiev, Bo Li, Chaowei Xiao, et al. 2023. Shall we pretrain autoregressive language models with retrieval? a comprehensive study. arXiv preprint arXiv:2304.06762.
280
+ Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2022. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171.
281
+ Chaojun Xiao, Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Zhiyuan Liu, Maosong Sun, Yansong Feng, Xianpei Han, Zhen Hu, Heng Wang, et al. 2018. Cail2018: A large-scale legal dataset for judgment prediction. arXiv preprint arXiv:1807.02478.
282
+ Chaojun Xiao, Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Zhiyuan Liu, Maosong Sun, Tianyang Zhang, Xianpei Han, Zhen Hu, Heng Wang, et al. 2019. Cail2019-scm: A dataset of similar case matching in legal domain. arXiv preprint arXiv:1911.08962.
283
+ Haoxi Zhong, Yuzhong Wang, Cunchao Tu, Tianyang Zhang, Zhiyuan Liu, and Maosong Sun. 2020a. Iteratively questioning and answering for interpretable legal judgment prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1250-1257.
284
+ Haoxi Zhong, Chaojun Xiao, Cunchao Tu, Tianyang Zhang, Zhiyuan Liu, and Maosong Sun. 2020b. How does nlp benefit legal system: A summary of legal artificial intelligence. arXiv preprint arXiv:2004.12158.
285
+
286
+ # A Appendix
287
+
288
+ # A.1 Prompt Templates
289
+
290
+ The prompt template is shown in Figure 10. The translation of the original Chinese prompt is displayed using orange text. The setting of zero-shot open questions use a longer instruction that appends "Output the charge name directly" to the instruction in Figure A.1.
291
+
292
+ ![](images/2f571fc406aeb44a37b39fa8436dcaf4cb565f2f8dbdaee851cee92ed3b8a327.jpg)
293
+ Figure 10: The prompt template in Chinese and English.
294
+
295
+ # A.2 Robust to Fixed Demonstrations
296
+
297
+ <table><tr><td>Model</td><td>1shot</td><td>2shot</td></tr><tr><td>GPT-4</td><td>49.59 / 48.84</td><td>50.69</td></tr><tr><td>ChatGPT</td><td>47.01 / 46.57</td><td>47.55</td></tr><tr><td>Vicuna-13B</td><td>22.74 / 29.38</td><td>28.37</td></tr><tr><td>ChatGLM-6B</td><td>22.39 / 25.14</td><td>21.36</td></tr><tr><td>BLOOMZ-7B</td><td>36.65 / 43.94</td><td>42.24</td></tr></table>
298
+
299
+ We examine the effects of the two fixed cases mentioned in Section 4.3 in Table 2. We find that GPT-4 and ChatGPT are robust to the selection of the fixed demonstration in 1-shot setting, while Vicuna, ChatGLM and BLOOMZ are less robust.
300
+
301
+ # A.3 Comparison with Supervised Baselines
302
+
303
+ To understand the performance of supervised finetuning (SFT) baselines on LJP, we experiment on three models: BERT $^{12}$ , XLM-RoBERTa $^{13}$ and DeBERTa $^{14}$ . These models are fine-tuned on two datasets of different sizes: the original CAIL dataset (~100k samples) and the sampled training set (1120 samples) that is used as retrieval corpus described in Section 3.2, denoted as CAIL_few.
304
+
305
+ The SFT models are evaluated on the same evaluation dataset described in Section 3.2. The smaller training set aims to compare the few-shot performance of SFT baselines and LLMs in low data scenario.
306
+
307
+ The results of SFT models are shown in Figure 3. Considering the highest accuracy of GPT-4 being $74.46\%$ (multi-choice, 4shot), GPT-4 can outperform supervised baselines in low data scenario. If there is abundant training data, supervised baselines are still better than GPT-4 by $15\%$ .
308
+
309
+ Table 2: The classification accuracy scores with prompts consisting of fixed cases.
310
+
311
+ <table><tr><td>Model</td><td>CAIL</td><td>CAIL_few</td></tr><tr><td>BERT</td><td>89.64</td><td>68.04</td></tr><tr><td>XLM-RoBERTa</td><td>88.75</td><td>66.43</td></tr><tr><td>DeBERTa</td><td>88.57</td><td>30.89</td></tr></table>
312
+
313
+ Table 3: Prediction accuracy of SFT models fine-tuned on two training datasets of different sizes.
314
+
315
+ # A.4 Detailed Results
316
+
317
+ The specific values of performances displayed in Figure 2 are presented in Table 4. Besides, we also provide the performance of the F1 score in Table 5.
318
+
319
+ <table><tr><td rowspan="2">Model</td><td colspan="5">Open Questions</td><td colspan="5">Multiple-choice Questions</td></tr><tr><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td></tr><tr><td>GPT-4</td><td>55.18</td><td>64.82</td><td>69.11</td><td>69.82</td><td>71.96</td><td>63.93</td><td>71.25</td><td>72.50</td><td>73.75</td><td>74.46</td></tr><tr><td>ChatGPT</td><td>46.61</td><td>60.00</td><td>62.86</td><td>64.82</td><td>66.96</td><td>61.61</td><td>64.46</td><td>66.96</td><td>70.36</td><td>67.14</td></tr><tr><td>Vicuna-13B</td><td>28.21</td><td>50.36</td><td>49.64</td><td>51.79</td><td>35.89</td><td>47.86</td><td>44.82</td><td>43.39</td><td>35.71</td><td>19.46</td></tr><tr><td>ChatGLM-6B</td><td>41.43</td><td>51.79</td><td>50.00</td><td>50.36</td><td>50.54</td><td>55.71</td><td>50.54</td><td>49.64</td><td>49.46</td><td>47.32</td></tr><tr><td>BLOOMZ-7B</td><td>49.82</td><td>54.82</td><td>52.68</td><td>52.50</td><td>51.25</td><td>53.39</td><td>31.96</td><td>31.07</td><td>27.32</td><td>26.61</td></tr></table>
320
+
321
+ Table 4: The classification accuracy scores of all models under the four settings.
322
+
323
+ <table><tr><td rowspan="2">Model</td><td colspan="5">Open Questions</td><td colspan="5">Multiple-choice Questions</td></tr><tr><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td><td>0shot</td><td>1shot</td><td>2shot</td><td>3shot</td><td>4shot</td></tr><tr><td>GPT-4</td><td>50.52</td><td>62.72</td><td>67.54</td><td>68.61</td><td>71.02</td><td>62.31</td><td>70.42</td><td>71.81</td><td>73.24</td><td>74.00</td></tr><tr><td>ChatGPT</td><td>43.14</td><td>58.42</td><td>61.86</td><td>64.40</td><td>66.16</td><td>60.67</td><td>63.51</td><td>66.85</td><td>69.59</td><td>66.62</td></tr><tr><td>Vicuna-13B</td><td>25.50</td><td>48.85</td><td>47.64</td><td>49.49</td><td>39.82</td><td>44.70</td><td>41.73</td><td>41.48</td><td>35.03</td><td>21.61</td></tr><tr><td>ChatGLM-6B</td><td>41.89</td><td>50.30</td><td>47.76</td><td>48.59</td><td>48.67</td><td>53.74</td><td>49.26</td><td>47.56</td><td>47.61</td><td>45.32</td></tr><tr><td>BLOOMZ-7B</td><td>46.90</td><td>53.28</td><td>51.06</td><td>50.90</td><td>49.26</td><td>50.68</td><td>29.25</td><td>27.92</td><td>25.27</td><td>23.37</td></tr></table>
324
+
325
+ Table 5: The classification F1 scores of all models under the four settings.
2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5b02ddce7b7421910eed7373a62beed0e4a1f4b778d01d2aad3a5d91e1f99ba
3
+ size 483834
2023/A Comprehensive Evaluation of Large Language Models on Legal Judgment Prediction/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2023/A Comprehensive Evaluation of Tool-Assisted Generation Strategies/6b3b9095-80bb-4832-9b1c-9b30dcb51c14_content_list.json ADDED
The diff for this file is too large to render. See raw diff