Chelsea707 commited on
Commit
eedce6b
·
verified ·
1 Parent(s): 2457854

Add Batch 7861346e-6808-4be0-9db3-7d4efa710c19 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 +64 -0
  2. 2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/bfb07218-1b5f-4a5f-b87f-4a542319ff95_content_list.json +0 -0
  3. 2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/bfb07218-1b5f-4a5f-b87f-4a542319ff95_model.json +0 -0
  4. 2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/bfb07218-1b5f-4a5f-b87f-4a542319ff95_origin.pdf +3 -0
  5. 2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/full.md +458 -0
  6. 2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/images.zip +3 -0
  7. 2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/layout.json +0 -0
  8. 2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/d966b76a-c5ec-4137-af5f-9b97e38c6c1a_content_list.json +0 -0
  9. 2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/d966b76a-c5ec-4137-af5f-9b97e38c6c1a_model.json +0 -0
  10. 2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/d966b76a-c5ec-4137-af5f-9b97e38c6c1a_origin.pdf +3 -0
  11. 2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/full.md +418 -0
  12. 2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/images.zip +3 -0
  13. 2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/layout.json +0 -0
  14. 2025/Learning to Reason from Feedback at Test-Time/73c5b89a-a858-47ba-a533-28d4db8adb18_content_list.json +2152 -0
  15. 2025/Learning to Reason from Feedback at Test-Time/73c5b89a-a858-47ba-a533-28d4db8adb18_model.json +0 -0
  16. 2025/Learning to Reason from Feedback at Test-Time/73c5b89a-a858-47ba-a533-28d4db8adb18_origin.pdf +3 -0
  17. 2025/Learning to Reason from Feedback at Test-Time/full.md +422 -0
  18. 2025/Learning to Reason from Feedback at Test-Time/images.zip +3 -0
  19. 2025/Learning to Reason from Feedback at Test-Time/layout.json +0 -0
  20. 2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/7e8e6ea3-0b1b-4f33-86f0-4eaba3c14cbc_content_list.json +1822 -0
  21. 2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/7e8e6ea3-0b1b-4f33-86f0-4eaba3c14cbc_model.json +0 -0
  22. 2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/7e8e6ea3-0b1b-4f33-86f0-4eaba3c14cbc_origin.pdf +3 -0
  23. 2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/full.md +368 -0
  24. 2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/images.zip +3 -0
  25. 2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/layout.json +0 -0
  26. 2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/66f11122-2fcc-4faa-9061-ce858a59cc45_content_list.json +0 -0
  27. 2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/66f11122-2fcc-4faa-9061-ce858a59cc45_model.json +0 -0
  28. 2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/66f11122-2fcc-4faa-9061-ce858a59cc45_origin.pdf +3 -0
  29. 2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/full.md +516 -0
  30. 2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/images.zip +3 -0
  31. 2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/layout.json +0 -0
  32. 2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/a6a843c1-4937-4a68-829f-b00fd5a1018d_content_list.json +0 -0
  33. 2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/a6a843c1-4937-4a68-829f-b00fd5a1018d_model.json +0 -0
  34. 2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/a6a843c1-4937-4a68-829f-b00fd5a1018d_origin.pdf +3 -0
  35. 2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/full.md +437 -0
  36. 2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/images.zip +3 -0
  37. 2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/layout.json +0 -0
  38. 2025/Length Controlled Generation for Black-box LLMs/6b4f4832-1066-453d-a13f-fc313f9a0e40_content_list.json +0 -0
  39. 2025/Length Controlled Generation for Black-box LLMs/6b4f4832-1066-453d-a13f-fc313f9a0e40_model.json +0 -0
  40. 2025/Length Controlled Generation for Black-box LLMs/6b4f4832-1066-453d-a13f-fc313f9a0e40_origin.pdf +3 -0
  41. 2025/Length Controlled Generation for Black-box LLMs/full.md +676 -0
  42. 2025/Length Controlled Generation for Black-box LLMs/images.zip +3 -0
  43. 2025/Length Controlled Generation for Black-box LLMs/layout.json +0 -0
  44. 2025/Length-Induced Embedding Collapse in PLM-based Models/4ec798cf-0a35-4837-9dc0-18b1a6b7d80e_content_list.json +0 -0
  45. 2025/Length-Induced Embedding Collapse in PLM-based Models/4ec798cf-0a35-4837-9dc0-18b1a6b7d80e_model.json +0 -0
  46. 2025/Length-Induced Embedding Collapse in PLM-based Models/4ec798cf-0a35-4837-9dc0-18b1a6b7d80e_origin.pdf +3 -0
  47. 2025/Length-Induced Embedding Collapse in PLM-based Models/full.md +0 -0
  48. 2025/Length-Induced Embedding Collapse in PLM-based Models/images.zip +3 -0
  49. 2025/Length-Induced Embedding Collapse in PLM-based Models/layout.json +0 -0
  50. 2025/Less Mature is More Adaptable for Sentence-level Language Modeling/638202b3-d3c6-4703-8b57-405e0e7df341_content_list.json +1976 -0
.gitattributes CHANGED
@@ -2293,3 +2293,67 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
2293
  2025/Learning[[:space:]]First-Order[[:space:]]Logic[[:space:]]Rules[[:space:]]for[[:space:]]Argumentation[[:space:]]Mining/051c4f73-9222-4d30-b581-96039c86e0f5_origin.pdf filter=lfs diff=lfs merge=lfs -text
2294
  2025/Learning[[:space:]]Together[[:space:]]to[[:space:]]Perform[[:space:]]Better_[[:space:]]Teaching[[:space:]]Small-Scale[[:space:]]LLMs[[:space:]]to[[:space:]]Collaborate[[:space:]]via[[:space:]]Preferential[[:space:]]Rationale[[:space:]]Tuning/6952a91d-e34c-42f7-9928-691b1a51646c_origin.pdf filter=lfs diff=lfs merge=lfs -text
2295
  2025/Learning[[:space:]]to[[:space:]]Generate[[:space:]]Structured[[:space:]]Output[[:space:]]with[[:space:]]Schema[[:space:]]Reinforcement[[:space:]]Learning/aac95ee4-c0e9-4dec-b0e3-66d19681dcbe_origin.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2293
  2025/Learning[[:space:]]First-Order[[:space:]]Logic[[:space:]]Rules[[:space:]]for[[:space:]]Argumentation[[:space:]]Mining/051c4f73-9222-4d30-b581-96039c86e0f5_origin.pdf filter=lfs diff=lfs merge=lfs -text
2294
  2025/Learning[[:space:]]Together[[:space:]]to[[:space:]]Perform[[:space:]]Better_[[:space:]]Teaching[[:space:]]Small-Scale[[:space:]]LLMs[[:space:]]to[[:space:]]Collaborate[[:space:]]via[[:space:]]Preferential[[:space:]]Rationale[[:space:]]Tuning/6952a91d-e34c-42f7-9928-691b1a51646c_origin.pdf filter=lfs diff=lfs merge=lfs -text
2295
  2025/Learning[[:space:]]to[[:space:]]Generate[[:space:]]Structured[[:space:]]Output[[:space:]]with[[:space:]]Schema[[:space:]]Reinforcement[[:space:]]Learning/aac95ee4-c0e9-4dec-b0e3-66d19681dcbe_origin.pdf filter=lfs diff=lfs merge=lfs -text
2296
+ 2025/Learning[[:space:]]to[[:space:]]Look[[:space:]]at[[:space:]]the[[:space:]]Other[[:space:]]Side_[[:space:]]A[[:space:]]Semantic[[:space:]]Probing[[:space:]]Study[[:space:]]of[[:space:]]Word[[:space:]]Embeddings[[:space:]]in[[:space:]]LLMs[[:space:]]with[[:space:]]Enabled[[:space:]]Bidirectional[[:space:]]Attention/bfb07218-1b5f-4a5f-b87f-4a542319ff95_origin.pdf filter=lfs diff=lfs merge=lfs -text
2297
+ 2025/Learning[[:space:]]to[[:space:]]Reason[[:space:]]Over[[:space:]]Time_[[:space:]]Timeline[[:space:]]Self-Reflection[[:space:]]for[[:space:]]Improved[[:space:]]Temporal[[:space:]]Reasoning[[:space:]]in[[:space:]]Language[[:space:]]Models/d966b76a-c5ec-4137-af5f-9b97e38c6c1a_origin.pdf filter=lfs diff=lfs merge=lfs -text
2298
+ 2025/Learning[[:space:]]to[[:space:]]Reason[[:space:]]from[[:space:]]Feedback[[:space:]]at[[:space:]]Test-Time/73c5b89a-a858-47ba-a533-28d4db8adb18_origin.pdf filter=lfs diff=lfs merge=lfs -text
2299
+ 2025/Learning[[:space:]]to[[:space:]]Rewrite_[[:space:]]Generalized[[:space:]]LLM-Generated[[:space:]]Text[[:space:]]Detection/7e8e6ea3-0b1b-4f33-86f0-4eaba3c14cbc_origin.pdf filter=lfs diff=lfs merge=lfs -text
2300
+ 2025/LegalAgentBench_[[:space:]]Evaluating[[:space:]]LLM[[:space:]]Agents[[:space:]]in[[:space:]]Legal[[:space:]]Domain/66f11122-2fcc-4faa-9061-ce858a59cc45_origin.pdf filter=lfs diff=lfs merge=lfs -text
2301
+ 2025/LegalReasoner_[[:space:]]Step-wised[[:space:]]Verification-Correction[[:space:]]for[[:space:]]Legal[[:space:]]Judgment[[:space:]]Reasoning/a6a843c1-4937-4a68-829f-b00fd5a1018d_origin.pdf filter=lfs diff=lfs merge=lfs -text
2302
+ 2025/Length[[:space:]]Controlled[[:space:]]Generation[[:space:]]for[[:space:]]Black-box[[:space:]]LLMs/6b4f4832-1066-453d-a13f-fc313f9a0e40_origin.pdf filter=lfs diff=lfs merge=lfs -text
2303
+ 2025/Length-Induced[[:space:]]Embedding[[:space:]]Collapse[[:space:]]in[[:space:]]PLM-based[[:space:]]Models/4ec798cf-0a35-4837-9dc0-18b1a6b7d80e_origin.pdf filter=lfs diff=lfs merge=lfs -text
2304
+ 2025/Less[[:space:]]Mature[[:space:]]is[[:space:]]More[[:space:]]Adaptable[[:space:]]for[[:space:]]Sentence-level[[:space:]]Language[[:space:]]Modeling/638202b3-d3c6-4703-8b57-405e0e7df341_origin.pdf filter=lfs diff=lfs merge=lfs -text
2305
+ 2025/Less[[:space:]]for[[:space:]]More_[[:space:]]Enhanced[[:space:]]Feedback-aligned[[:space:]]Mixed[[:space:]]LLMs[[:space:]]for[[:space:]]Molecule[[:space:]]Caption[[:space:]]Generation[[:space:]]and[[:space:]]Fine-Grained[[:space:]]NLI[[:space:]]Evaluation/41c6e5f1-cf08-476e-90c1-71d4f21a9ccd_origin.pdf filter=lfs diff=lfs merge=lfs -text
2306
+ 2025/Less[[:space:]]is[[:space:]]More_[[:space:]]Explainable[[:space:]]and[[:space:]]Efficient[[:space:]]ICD[[:space:]]Code[[:space:]]Prediction[[:space:]]with[[:space:]]Clinical[[:space:]]Entities/d2a62a3d-183f-435f-8f8d-53446df2da3e_origin.pdf filter=lfs diff=lfs merge=lfs -text
2307
+ 2025/Less,[[:space:]]but[[:space:]]Better_[[:space:]]Efficient[[:space:]]Multilingual[[:space:]]Expansion[[:space:]]for[[:space:]]LLMs[[:space:]]via[[:space:]]Layer-wise[[:space:]]Mixture-of-Experts/f8c812bd-e5dc-41ee-90a9-1c852c2ab57d_origin.pdf filter=lfs diff=lfs merge=lfs -text
2308
+ 2025/Leveraging[[:space:]]Dual[[:space:]]Process[[:space:]]Theory[[:space:]]in[[:space:]]Language[[:space:]]Agent[[:space:]]Framework[[:space:]]for[[:space:]]Real-time[[:space:]]Simultaneous[[:space:]]Human-AI[[:space:]]Collaboration/e70dcb35-8563-4ac0-99f3-5e92697de590_origin.pdf filter=lfs diff=lfs merge=lfs -text
2309
+ 2025/Leveraging[[:space:]]In-Context[[:space:]]Learning[[:space:]]for[[:space:]]Political[[:space:]]Bias[[:space:]]Testing[[:space:]]of[[:space:]]LLMs/176e70a8-ab67-47e5-bf2f-ff2f45b07535_origin.pdf filter=lfs diff=lfs merge=lfs -text
2310
+ 2025/LexCLiPR_[[:space:]]Cross-Lingual[[:space:]]Paragraph[[:space:]]Retrieval[[:space:]]from[[:space:]]Legal[[:space:]]Judgments/fcf5123b-4998-4be0-84bd-b32286590b00_origin.pdf filter=lfs diff=lfs merge=lfs -text
2311
+ 2025/LexGen_[[:space:]]Domain-aware[[:space:]]Multilingual[[:space:]]Lexicon[[:space:]]Generation/a2c940a6-4570-410f-ab78-471f645d0202_origin.pdf filter=lfs diff=lfs merge=lfs -text
2312
+ 2025/LexTempus_[[:space:]]Enhancing[[:space:]]Temporal[[:space:]]Generalizability[[:space:]]of[[:space:]]Legal[[:space:]]Language[[:space:]]Models[[:space:]]Through[[:space:]]Dynamic[[:space:]]Mixture[[:space:]]of[[:space:]]Experts/e2ae0cc0-be05-41be-bbc5-fac0c2d3d53f_origin.pdf filter=lfs diff=lfs merge=lfs -text
2313
+ 2025/Lexical[[:space:]]Diversity-aware[[:space:]]Relevance[[:space:]]Assessment[[:space:]]for[[:space:]]Retrieval-Augmented[[:space:]]Generation/c1d13bf1-bff5-424d-b76d-a0e264c34fcb_origin.pdf filter=lfs diff=lfs merge=lfs -text
2314
+ 2025/Lexical[[:space:]]Recall[[:space:]]or[[:space:]]Logical[[:space:]]Reasoning_[[:space:]]Probing[[:space:]]the[[:space:]]Limits[[:space:]]of[[:space:]]Reasoning[[:space:]]Abilities[[:space:]]in[[:space:]]Large[[:space:]]Language[[:space:]]Models/d89a392d-f3ae-4903-b54c-92d0f4086416_origin.pdf filter=lfs diff=lfs merge=lfs -text
2315
+ 2025/Library-Like[[:space:]]Behavior[[:space:]]In[[:space:]]Language[[:space:]]Models[[:space:]]is[[:space:]]Enhanced[[:space:]]by[[:space:]]Self-Referencing[[:space:]]Causal[[:space:]]Cycles/71633471-88a9-4d86-b5e2-eb8107a61141_origin.pdf filter=lfs diff=lfs merge=lfs -text
2316
+ 2025/Limited[[:space:]]Generalizability[[:space:]]in[[:space:]]Argument[[:space:]]Mining_[[:space:]]State-Of-The-Art[[:space:]]Models[[:space:]]Learn[[:space:]]Datasets,[[:space:]]Not[[:space:]]Arguments/391b569b-e2cd-4abe-8daf-4b519e60399b_origin.pdf filter=lfs diff=lfs merge=lfs -text
2317
+ 2025/Linguistic[[:space:]]Generalizability[[:space:]]of[[:space:]]Test-Time[[:space:]]Scaling[[:space:]]in[[:space:]]Mathematical[[:space:]]Reasoning/f8a24f46-a0bb-4216-b01d-9fbe5cf116e0_origin.pdf filter=lfs diff=lfs merge=lfs -text
2318
+ 2025/Literature[[:space:]]Meets[[:space:]]Data_[[:space:]]A[[:space:]]Synergistic[[:space:]]Approach[[:space:]]to[[:space:]]Hypothesis[[:space:]]Generation/8616a33c-1b42-48f9-a608-2d1fd365f3de_origin.pdf filter=lfs diff=lfs merge=lfs -text
2319
+ 2025/Llama[[:space:]]See,[[:space:]]Llama[[:space:]]Do_[[:space:]]A[[:space:]]Mechanistic[[:space:]]Perspective[[:space:]]on[[:space:]]Contextual[[:space:]]Entrainment[[:space:]]and[[:space:]]Distraction[[:space:]]in[[:space:]]LLMs/331a8304-4f09-4072-b039-3a214753650e_origin.pdf filter=lfs diff=lfs merge=lfs -text
2320
+ 2025/LlamaDuo_[[:space:]]LLMOps[[:space:]]Pipeline[[:space:]]for[[:space:]]Seamless[[:space:]]Migration[[:space:]]from[[:space:]]Service[[:space:]]LLMs[[:space:]]to[[:space:]]Small-Scale[[:space:]]Local[[:space:]]LLMs/ae98f6bb-87b0-4c89-a931-959d1bbd54e7_origin.pdf filter=lfs diff=lfs merge=lfs -text
2321
+ 2025/LoGU_[[:space:]]Long-form[[:space:]]Generation[[:space:]]with[[:space:]]Uncertainty[[:space:]]Expressions/a23e3e0e-d6d9-41e5-a053-0653483f235d_origin.pdf filter=lfs diff=lfs merge=lfs -text
2322
+ 2025/LocAgent_[[:space:]]Graph-Guided[[:space:]]LLM[[:space:]]Agents[[:space:]]for[[:space:]]Code[[:space:]]Localization/4b3e043a-e48e-4152-8a47-9397d1d6adbe_origin.pdf filter=lfs diff=lfs merge=lfs -text
2323
+ 2025/Locate-and-Focus_[[:space:]]Enhancing[[:space:]]Terminology[[:space:]]Translation[[:space:]]in[[:space:]]Speech[[:space:]]Language[[:space:]]Models/cc4d703b-0740-423b-8015-1c066cc6a080_origin.pdf filter=lfs diff=lfs merge=lfs -text
2324
+ 2025/Logic-Regularized[[:space:]]Verifier[[:space:]]Elicits[[:space:]]Reasoning[[:space:]]from[[:space:]]LLMs/20abd37f-ed4b-4282-b02e-b863ae9fb53c_origin.pdf filter=lfs diff=lfs merge=lfs -text
2325
+ 2025/LogicPro_[[:space:]]Improving[[:space:]]Complex[[:space:]]Logical[[:space:]]Reasoning[[:space:]]via[[:space:]]Program-Guided[[:space:]]Learning/26f54764-abcd-412f-8835-667421a85cb4_origin.pdf filter=lfs diff=lfs merge=lfs -text
2326
+ 2025/Logical[[:space:]]forms[[:space:]]complement[[:space:]]probability[[:space:]]in[[:space:]]understanding[[:space:]]language[[:space:]]model[[:space:]](and[[:space:]]human)[[:space:]]performance/89eb8c28-b30a-4464-9afe-73649ff2b2a4_origin.pdf filter=lfs diff=lfs merge=lfs -text
2327
+ 2025/LongBench[[:space:]]v2_[[:space:]]Towards[[:space:]]Deeper[[:space:]]Understanding[[:space:]]and[[:space:]]Reasoning[[:space:]]on[[:space:]]Realistic[[:space:]]Long-context[[:space:]]Multitasks/4f754738-06fc-4493-bb5b-925fe0b31908_origin.pdf filter=lfs diff=lfs merge=lfs -text
2328
+ 2025/LongDocURL_[[:space:]]a[[:space:]]Comprehensive[[:space:]]Multimodal[[:space:]]Long[[:space:]]Document[[:space:]]Benchmark[[:space:]]Integrating[[:space:]]Understanding,[[:space:]]Reasoning,[[:space:]]and[[:space:]]Locating/ae6ba670-ed5f-4602-ba97-f65fa74aa9aa_origin.pdf filter=lfs diff=lfs merge=lfs -text
2329
+ 2025/LongReD_[[:space:]]Mitigating[[:space:]]Short-Text[[:space:]]Degradation[[:space:]]of[[:space:]]Long-Context[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]via[[:space:]]Restoration[[:space:]]Distillation/6f2a37bf-fd40-46ff-8755-874a3f8e7f7f_origin.pdf filter=lfs diff=lfs merge=lfs -text
2330
+ 2025/LongRecipe_[[:space:]]Recipe[[:space:]]for[[:space:]]Efficient[[:space:]]Long[[:space:]]Context[[:space:]]Generalization[[:space:]]in[[:space:]]Large[[:space:]]Language[[:space:]]Models/70d1a1ee-dae2-4381-981d-f4f137ed3766_origin.pdf filter=lfs diff=lfs merge=lfs -text
2331
+ 2025/LongReward_[[:space:]]Improving[[:space:]]Long-context[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]with[[:space:]]AI[[:space:]]Feedback/34d5b4eb-0f7b-40f1-99f6-50ddd6f15b7b_origin.pdf filter=lfs diff=lfs merge=lfs -text
2332
+ 2025/LongSafety_[[:space:]]Evaluating[[:space:]]Long-Context[[:space:]]Safety[[:space:]]of[[:space:]]Large[[:space:]]Language[[:space:]]Models/7a3dc1fd-da5e-490e-af2b-ddd19c5f04cc_origin.pdf filter=lfs diff=lfs merge=lfs -text
2333
+ 2025/Look[[:space:]]Both[[:space:]]Ways[[:space:]]and[[:space:]]No[[:space:]]Sink_[[:space:]]Converting[[:space:]]LLMs[[:space:]]into[[:space:]]Text[[:space:]]Encoders[[:space:]]without[[:space:]]Training/eb0cdc9f-7dc3-4ddf-867d-12bbb9809ab3_origin.pdf filter=lfs diff=lfs merge=lfs -text
2334
+ 2025/Lost[[:space:]]in[[:space:]]Literalism_[[:space:]]How[[:space:]]Supervised[[:space:]]Training[[:space:]]Shapes[[:space:]]Translationese[[:space:]]in[[:space:]]LLMs/fa276b0c-5ed8-4e8b-9d13-a3c26d7765e9_origin.pdf filter=lfs diff=lfs merge=lfs -text
2335
+ 2025/Lost[[:space:]]in[[:space:]]Multilinguality_[[:space:]]Dissecting[[:space:]]Cross-lingual[[:space:]]Factual[[:space:]]Inconsistency[[:space:]]in[[:space:]]Transformer[[:space:]]Language[[:space:]]Models/7be48f31-25cf-4321-b578-2306dd325b7b_origin.pdf filter=lfs diff=lfs merge=lfs -text
2336
+ 2025/Lost[[:space:]]in[[:space:]]the[[:space:]]Context_[[:space:]]Insufficient[[:space:]]and[[:space:]]Distracted[[:space:]]Attention[[:space:]]to[[:space:]]Contexts[[:space:]]in[[:space:]]Preference[[:space:]]Modeling/51daf99c-458a-4866-b318-609368bbaf01_origin.pdf filter=lfs diff=lfs merge=lfs -text
2337
+ 2025/Low-Bit[[:space:]]Quantization[[:space:]]Favors[[:space:]]Undertrained[[:space:]]LLMs/0794dd00-45b5-488f-ad20-e9880ca4c6d2_origin.pdf filter=lfs diff=lfs merge=lfs -text
2338
+ 2025/M-MAD_[[:space:]]Multidimensional[[:space:]]Multi-Agent[[:space:]]Debate[[:space:]]for[[:space:]]Advanced[[:space:]]Machine[[:space:]]Translation[[:space:]]Evaluation/d3f56e83-97a3-4efe-9cb6-3f4cadeac0c7_origin.pdf filter=lfs diff=lfs merge=lfs -text
2339
+ 2025/M-RewardBench_[[:space:]]Evaluating[[:space:]]Reward[[:space:]]Models[[:space:]]in[[:space:]]Multilingual[[:space:]]Settings/7c4ddd96-b657-4cf3-89e4-2342875f231e_origin.pdf filter=lfs diff=lfs merge=lfs -text
2340
+ 2025/M2RC-EVAL_[[:space:]]Massively[[:space:]]Multilingual[[:space:]]Repository-level[[:space:]]Code[[:space:]]Completion[[:space:]]Evaluation/7018a586-9802-45c7-a3b7-02c40cf05cc4_origin.pdf filter=lfs diff=lfs merge=lfs -text
2341
+ 2025/M2S_[[:space:]]Multi-turn[[:space:]]to[[:space:]]Single-turn[[:space:]]jailbreak[[:space:]]in[[:space:]]Red[[:space:]]Teaming[[:space:]]for[[:space:]]LLMs/995233bd-4ce0-44b2-9c9f-78a08acc3644_origin.pdf filter=lfs diff=lfs merge=lfs -text
2342
+ 2025/MAGNET_[[:space:]]Augmenting[[:space:]]Generative[[:space:]]Decoders[[:space:]]with[[:space:]]Representation[[:space:]]Learning[[:space:]]and[[:space:]]Infilling[[:space:]]Capabilities/d1df19ac-635d-46a7-9bee-2ed4ebc15602_origin.pdf filter=lfs diff=lfs merge=lfs -text
2343
+ 2025/MAIN-RAG_[[:space:]]Multi-Agent[[:space:]]Filtering[[:space:]]Retrieval-Augmented[[:space:]]Generation/01fce068-32f9-4647-bf3f-f707dec36682_origin.pdf filter=lfs diff=lfs merge=lfs -text
2344
+ 2025/MAPLE_[[:space:]]Enhancing[[:space:]]Review[[:space:]]Generation[[:space:]]with[[:space:]]Multi-Aspect[[:space:]]Prompt[[:space:]]LEarning[[:space:]]in[[:space:]]Explainable[[:space:]]Recommendation/9f065c65-4738-4b0d-988e-69ca9feb941e_origin.pdf filter=lfs diff=lfs merge=lfs -text
2345
+ 2025/MAPS_[[:space:]]Motivation-Aware[[:space:]]Personalized[[:space:]]Search[[:space:]]via[[:space:]]LLM-Driven[[:space:]]Consultation[[:space:]]Alignment/4a92c1e9-9182-47bc-bf5a-4ea3d353224b_origin.pdf filter=lfs diff=lfs merge=lfs -text
2346
+ 2025/MAPoRL_[[:space:]]Multi-Agent[[:space:]]Post-Co-Training[[:space:]]for[[:space:]]Collaborative[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]with[[:space:]]Reinforcement[[:space:]]Learning/4442ea92-6a52-4e34-9201-f514fa7837d3_origin.pdf filter=lfs diff=lfs merge=lfs -text
2347
+ 2025/MARS_[[:space:]]Benchmarking[[:space:]]the[[:space:]]Metaphysical[[:space:]]Reasoning[[:space:]]Abilities[[:space:]]of[[:space:]]Language[[:space:]]Models[[:space:]]with[[:space:]]a[[:space:]]Multi-task[[:space:]]Evaluation[[:space:]]Dataset/bdc4b79b-fed4-4dff-abcb-990d1d75b4b1_origin.pdf filter=lfs diff=lfs merge=lfs -text
2348
+ 2025/MAmmoTH-VL_[[:space:]]Eliciting[[:space:]]Multimodal[[:space:]]Reasoning[[:space:]]with[[:space:]]Instruction[[:space:]]Tuning[[:space:]]at[[:space:]]Scale/6f723d47-e8f0-4a60-8134-538dda169305_origin.pdf filter=lfs diff=lfs merge=lfs -text
2349
+ 2025/MCS-Bench_[[:space:]]A[[:space:]]Comprehensive[[:space:]]Benchmark[[:space:]]for[[:space:]]Evaluating[[:space:]]Multimodal[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]in[[:space:]]Chinese[[:space:]]Classical[[:space:]]Studies/4a7e2b31-277b-4616-93dc-5c1e83adf627_origin.pdf filter=lfs diff=lfs merge=lfs -text
2350
+ 2025/MDCure_[[:space:]]A[[:space:]]Scalable[[:space:]]Pipeline[[:space:]]for[[:space:]]Multi-Document[[:space:]]Instruction-Following/9e5318e2-43c0-41ae-98c5-b8633cf9fc33_origin.pdf filter=lfs diff=lfs merge=lfs -text
2351
+ 2025/MEDDxAgent_[[:space:]]A[[:space:]]Unified[[:space:]]Modular[[:space:]]Agent[[:space:]]Framework[[:space:]]for[[:space:]]Explainable[[:space:]]Automatic[[:space:]]Differential[[:space:]]Diagnosis/2200caeb-b877-458c-b134-26998d8f7b15_origin.pdf filter=lfs diff=lfs merge=lfs -text
2352
+ 2025/MEMERAG_[[:space:]]A[[:space:]]Multilingual[[:space:]]End-to-End[[:space:]]Meta-Evaluation[[:space:]]Benchmark[[:space:]]for[[:space:]]Retrieval[[:space:]]Augmented[[:space:]]Generation/f681f89b-1b81-4bea-92cd-5fff61b4be29_origin.pdf filter=lfs diff=lfs merge=lfs -text
2353
+ 2025/METAL_[[:space:]]A[[:space:]]Multi-Agent[[:space:]]Framework[[:space:]]for[[:space:]]Chart[[:space:]]Generation[[:space:]]with[[:space:]]Test-Time[[:space:]]Scaling/0e8fb85e-f3e7-4c38-875e-549296d4530b_origin.pdf filter=lfs diff=lfs merge=lfs -text
2354
+ 2025/MEXMA_[[:space:]]Token-level[[:space:]]objectives[[:space:]]improve[[:space:]]sentence[[:space:]]representations/f8287c22-cee9-4116-8fcb-74cbc4c0b950_origin.pdf filter=lfs diff=lfs merge=lfs -text
2355
+ 2025/MEraser_[[:space:]]An[[:space:]]Effective[[:space:]]Fingerprint[[:space:]]Erasure[[:space:]]Approach[[:space:]]for[[:space:]]Large[[:space:]]Language[[:space:]]Models/e3b51320-3fae-453b-8c23-6b70a488911c_origin.pdf filter=lfs diff=lfs merge=lfs -text
2356
+ 2025/MIND_[[:space:]]A[[:space:]]Multi-agent[[:space:]]Framework[[:space:]]for[[:space:]]Zero-shot[[:space:]]Harmful[[:space:]]Meme[[:space:]]Detection/35abf147-4ba9-4ab5-b9f6-51c0b9972073_origin.pdf filter=lfs diff=lfs merge=lfs -text
2357
+ 2025/MIR_[[:space:]]Methodology[[:space:]]Inspiration[[:space:]]Retrieval[[:space:]]for[[:space:]]Scientific[[:space:]]Research[[:space:]]Problems/0c9fcd68-fffb-4a99-b259-a1560d44323c_origin.pdf filter=lfs diff=lfs merge=lfs -text
2358
+ 2025/MISP-Meeting_[[:space:]]A[[:space:]]Real-World[[:space:]]Dataset[[:space:]]with[[:space:]]Multimodal[[:space:]]Cues[[:space:]]for[[:space:]]Long-form[[:space:]]Meeting[[:space:]]Transcription[[:space:]]and[[:space:]]Summarization/e45b8eb8-13bc-4732-8f8e-785cc95f4db5_origin.pdf filter=lfs diff=lfs merge=lfs -text
2359
+ 2025/MLAS-LoRA_[[:space:]]Language-Aware[[:space:]]Parameters[[:space:]]Detection[[:space:]]and[[:space:]]LoRA-Based[[:space:]]Knowledge[[:space:]]Transfer[[:space:]]for[[:space:]]Multilingual[[:space:]]Machine[[:space:]]Translation/ec7f2813-befd-4938-92d1-b2a736d3f3b6_origin.pdf filter=lfs diff=lfs merge=lfs -text
2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/bfb07218-1b5f-4a5f-b87f-4a542319ff95_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/bfb07218-1b5f-4a5f-b87f-4a542319ff95_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/bfb07218-1b5f-4a5f-b87f-4a542319ff95_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52446ef206cd2c28bf9424813b2232c31a414d188cc5a77360f2e1382a457024
3
+ size 960746
2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/full.md ADDED
@@ -0,0 +1,458 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Learning to Look at the Other Side: A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention
2
+
3
+ Zhaoxin Feng and Jianfei Ma and Emmanuele Chersoni and Xiaojing Zhao and Xiaoyi Bao
4
+
5
+ Chinese and Bilingual Studies, The Hong Kong Polytechnic University
6
+
7
+ {zhaoxinbetty.feng, jian-fei.ma, xiaojing.zhao, xiaoyi.bao}@connect.polyu.hk, emmanuele.chersoni@polyu.edu.hk
8
+
9
+ # Abstract
10
+
11
+ Autoregressive Large Language Models (LLMs) demonstrate exceptional performance in language understanding and generation. However, their application in text embedding tasks has been relatively slow, along with the analysis of their semantic representation in probing tasks, due to the constraints of the unidirectional attention mechanism.
12
+
13
+ This paper aims to explore whether such constraints can be overcome by enabling bidirectional attention in LLMs. We tested different variants of the Llama architecture through additional training steps, progressively enabling bidirectional attention and unsupervised/supervised contrastive learning.
14
+
15
+ Our results show that bidirectional attention improves the LLMs' ability to represent subsequent context but weakens their utilization of preceding context, while contrastive learning training can help to maintain both abilities<sup>1</sup>.
16
+
17
+ # 1 Introduction
18
+
19
+ Decoder-only LLMs using autoregressive pretraining have achieved superior performance across language understanding and generation tasks, causing a major shift from the previous pretraining-then-finetuning paradigm dominated by encoder-only models (Naveed et al., 2023). However, the community has been relatively slow in adopting them for word, sentence, and document embedding tasks because of their apparent limitations as text encoders, which have been speculated to be due to the lack of bidirectional attention (Qorib et al., 2024; BehnamGhader et al., 2024; Springer et al., 2025). As illustrated in Figure 1, decoder-only LLMs can only access preceding contextual information during inference, resulting in word representations that encode information from the previous context, instead of the entire input sequence.
20
+
21
+ (a) Unidirectional Attention
22
+
23
+ The
24
+
25
+ bank
26
+
27
+ of the river
28
+
29
+ Next token prediction in Llama
30
+
31
+ The
32
+
33
+ bank
34
+
35
+ of the river
36
+
37
+ Word representation in Llama
38
+
39
+ The
40
+
41
+ [MASK]
42
+
43
+ of the river
44
+
45
+ Masked language modeling in BERT
46
+
47
+ (b) Bidirectional
48
+
49
+ Attention
50
+
51
+ The
52
+
53
+ bank
54
+
55
+ of the river
56
+
57
+ Word representation in BERT
58
+
59
+ Figure 1: Comparison of attention mechanisms in Llama and BERT models. (a) shows Llama's unidirectional attention where prediction (orange arrows) and word representation (blue arrows) can only access one side context; (b) shows BERT's bidirectional attention where masked language modeling allows word representation to access both previous and subsequent context.
60
+
61
+ This architectural constraint is potentially very limiting in tasks requiring fine-grained modulation of word meanings: while contextualized embeddings from encoder-only models marked significant progress compared to previous generation distributional models (Bommasani et al., 2020; Chronis and Erk, 2020), the availability of the right-hand context might be important to capture subtle meaning nuances, and disambiguate the senses of polysemous words (Zhu et al., 2024; Qorib et al., 2024).
62
+
63
+ Can this limitation be addressed? After all, the decoder-only architecture enables more efficient learning from all input tokens during pre-training, significantly improving sample efficiency compared to encoder-only counterparts (Clark et al., 2020), and this would be an important advantage if LLMs representations could be adapted to perform better in embedding tasks.
64
+
65
+ Given the above-mentioned research back
66
+
67
+ ground, we propose the following research question: does bidirectional attention in LLMs enhance the quality of word meaning representations in LLMs? Could they achieve the same quality of embeddings extracted from encoder-only models?
68
+
69
+ In this paper, we propose a probing study of different types of LLMs architectures on a pool of lexical semantic tasks. Drawing inspiration from recent work on enabling bidirectional attention in autoregressive models (BehnamGhader et al., 2024), we compare the performance of Llama embeddings under the following configurations: i) a base Llama architecture, ii) the architecture in i) after an additional training step to enable bidirectional attention; iii) the architecture in ii), after applying unsupervised/supervised contrastive learning.
70
+
71
+ Perhaps surprisingly, we found that bidirectional attention in itself does not improve the performance of Llama embeddings on our tasks: while it improves LLMs' ability to represent the right-hand context of a target word, it also seems to weaken the representation of the left context. Contrastive learning techniques often help the models to maintain both abilities, with Llama architectures getting on par or even outperforming bidirectional, BERT-based baselines on our tasks. Interestingly, we also found that adding bidirectional attention alone exacerbates the anisotropy (Ethayarajh, 2019; Cai et al., 2021; Godey et al., 2024) (a condition in which all vectors occupy just a narrow cone in the vector space) in all layers, resulting on average in higher similarity scores between the vectors of randomly sampled words. These findings reveal the potential of decoder-only LLMs in word embedding tasks, offering insights into enhancing LLMs' representations with bidirectional attention and contrastive learning.
72
+
73
+ # 2 Related Work
74
+
75
+ # 2.1 Representations of Word Semantics
76
+
77
+ The representations of word semantics in NLP have undergone a remarkable development in the last two decades. Early methods like distributional semantic models (DSMs) derive semantic representations from statistical patterns of word co-occurrences in large text corpora, assuming that words with similar contexts have similar meanings (Harris, 1954; Schütze, 1992; Bullinaria and Levy, 2012). Later more efficient methods like Word2Vec and GloVe (Mikolov et al., 2013; Pennington et al., 2014) emerged, using neural net
78
+
79
+ works to train word embedding representations more compactly, without time-consuming high dimensional spare data processing and high perplexity algorithms calculation (Pennington et al., 2014; Mikolov et al., 2013).
80
+
81
+ However, these static vector models struggled with polysemy, as they assigned a single vector to each word regardless of context (Faruqui et al., 2016; Gladkova and Drozd, 2016; Wang et al., 2020b). This limitation was addressed by contextualized embedding models such as ELMo and BERT (Peters et al., 2018; Devlin et al., 2019), in which word vectors are learned as a function of the internal states of the network, such that a word in different sentence contexts determines different activation states and is represented by a distinct vector (Chersoni et al., 2021).
82
+
83
+ Despite the advantages of representing context-specific meanings, contextualized vectors were shown to have a high level of anisotropy, i.e. they occupy just a narrow cone in the vector space, with the consequence that randomly-sampled words might also get high similarity values (Ethayarajh, 2019) and postprocessing techniques need to be applied to adjust the similarity metrics for anisotropy (Timkey and van Schijndel, 2021).
84
+
85
+ # 2.2 Probing Linguistic Features in LLMs
86
+
87
+ Probing-based methods for analyzing linguistic features have become prevalent for understanding the internal linguistic knowledge of language models (Linzen et al., 2016; Hewitt and Liang, 2019; Liu et al., 2019; Wu et al., 2020; Chersoni et al., 2021; Kauf et al., 2023; Matthews et al., 2024; Wang et al., 2024a; Liu et al., 2024). The core idea involves using a simple diagnostic model (the "probe", usually a linear classifier) to predict specific linguistic properties (e.g. animacy) from language model's output representations. If the model succeeds, we can infer that the representations of the language model encode that linguistic knowledge (Chersoni et al., 2021). For instance, Hewitt and Manning (2019) presents a linear classifier to predict a target syntactic structure based on contextualized word representations to measure the syntactic information encoded in language models.
88
+
89
+ For LLMs, the most prevalent method to probe the linguistic knowledge is to use the representation is the hidden state of the last layer (Neelakantan et al., 2022; BehnamGhader et al., 2024; Springer et al., 2025; Lee et al., 2025). We went for the last layer embedding also for an issue of method
90
+
91
+ ological alignment with these approaches. Also, considering that the last hidden layer is processed through all model layers, in theory it contains the richest and most comprehensive context information, and thus our method employs these final layer hidden states to derive contextual representations of target words.
92
+
93
+ # 2.3 Autoregressive LLMs as Text Encoders
94
+
95
+ While ELMo and BERT's bidirectional attention gives them access to both the left and the right context around the target word, autoregressive LLMs like the GPTs (Radford et al., 2019; Brown et al., 2020) only use the context that comes before the target. Therefore, autoregressive LLMs are often considered sub-optimal for text embedding tasks.
96
+
97
+ However, recent studies have shown that even under the constraints of causal masking, LLMs are still capable of capturing certain contextual relationships (Muennighoff, 2022; Wang et al., 2024b; BehnamGhader et al., 2024; Springer et al., 2025). Among these studies, both Springer et al. (2025) and BehnamGhader et al. (2024) specifically hypothesize that the limitation of LLMs lies in unidirectional attention: the former proposed "echo embeddings", a method that feeds a target input sequence twice to a model to allow for the encoding of the context after the target; while the latter proposes an additional training step, called masked next token prediction, to enable bidirectional attention in autoregressive models, and introduces further refinements based on unsupervised and supervised contrastive learning techniques, in order to improve the performance in sentence-level tasks. We ground our work in BehnamGhader et al. (2024)'s LLM2Vec framework, using its publicly available models to observe how different training strategies affect the models' behavior in lexical semantic tasks.
98
+
99
+ # 3 Experimental Setup
100
+
101
+ # 3.1 Model Selection
102
+
103
+ Our experiments focused on Llama architectures (Touvron et al., 2023a), and particularly on Sheared-Llama (Xia et al., 2023) and Llama 2 (Touvron et al., 2023b). The former was chosen because it is a structurally-pruned and space-efficient version of the original model (we used the 1.3B version), and it is the closest in terms of parameter size to the most commonly-used bidirectional models (e.g. BERT and RoBERTa). We selected the 7B
104
+
105
+ version of Llama 2 mainly to check if the trends identified with Sheared-Llama-1.3B were consistently observed in a bigger model.
106
+
107
+ Besides the base models (i.e. Sheared-Llama1.3B and Llama2-7B), for our experiments we tested their variants augmented with the additional training steps of the LLM2Vec framework (BehnamGhader et al., 2024): 1) the Bi+MNTP models underwent an additional training via masked next token prediction, in which part of the input tokens was masked and the model had to reconstruct them on the basis of left and right context. For the prediction of each masked token, only the logits obtained from the previous token positions were used for computing the loss; 2) the architecture in 1), but with the addition of unsupervised (SimCSE) and Supervised contrastive learning (Gao et al., 2021) on top of the bidirectional training. BehnamGhader et al. (2024) added this step claiming that an autoregressive LLM with Bi+MNTP could be adequate for word-level tasks (they indeed obtain improved performance on standard benchmarks for POS Tagging and Named Entity Recognition), but contrastive learning is helpful to make their sequence representations a good fit for sentence-level tasks as well. All the augmented models are based on the same Sheared-Llama and Llama 2 architectures, and this gives us the chance to directly compare the effects of each additional training step.
108
+
109
+ We also used the embeddings from BERT Base and BERT Large (Devlin et al., 2019) as our bidirectional baselines. For more details about our LLMs and the settings of the probe classifiers, the reader can refer to Appendix A.2.
110
+
111
+ # 3.2 Extracting Word Representations
112
+
113
+ We leverage the hidden states from the final layer of LLMs to obtain contextualized representations of the target word for each lexical semantic task. Given a word $w$ within a sequence $c$ , we first extract sequence representations as follows:
114
+
115
+ $$
116
+ \mathbf {H} = \left[ \mathbf {h} _ {1}, \mathbf {h} _ {2}, \dots , \mathbf {h} _ {n} \right] \in \mathbb {R} ^ {n \times d} \tag {1}
117
+ $$
118
+
119
+ where $n$ denotes the sequence length (number of tokens) and $d$ represents the no. of hidden dimensions (e.g., 2048 in Sheared-Llama-1.3B).
120
+
121
+ For a word $w$ tokenized into $k$ subwords $\{t_1, t_2, \dots, t_k\}$ , let $\mathcal{I} = \{i_1, i_2, \dots, i_k\}$ denote their positional indices in $\mathbf{H}$ . The final word representation $\mathbf{v}_w$ is obtained through:
122
+
123
+ ![](images/f53569ae31ca8cec41042c369e8c1066b3e5ed8bb29532a31f2a92c9926df043.jpg)
124
+ Figure 2: Summary of five semantic probing tasks in our study: Tasks 1, 2, and 5 are classification tasks, with 0 and 1 denoting binary labels; Tasks 3 and 4 are regression tasks, where numbers (eg. 5, 7) indicate continuous values for the target variables. The "probed word" (highlighted) refers to the word whose contextualized representation is extracted for the probing task.
125
+
126
+ $$
127
+ \mathbf {v} _ {w} = \frac {1}{| \mathcal {I} |} \sum_ {j \in \mathcal {I}} \mathbf {h} _ {j} \tag {2}
128
+ $$
129
+
130
+ When $|\mathcal{I}| = 1$ (a single-token word), Equation 2 simplifies to $\mathbf{v}_w = \mathbf{h}_i$ . This formulation ensures consistent representation for both single- and multi-token words while preserving contextual information from the final layer.
131
+
132
+ The first four tasks all involve a single target word in a sentence context, so we directly feed the target word's representation to a classifier or regression model for prediction. The exception was the Word-in-Context (see Section 3.3), which required comparing the meaning of a target word in two different sentences. In this task, we test three types of embeddings-derived features as input to a classifier: their cosine similarity, the absolute values of their element-wise difference, and their concatenation.
133
+
134
+ # 3.3 Datasets and Tasks
135
+
136
+ Our study adopts five probing datasets (Figure 2). First, the context-probes dataset by Klafka and Ettinger (2020), which is composed of sets of five-word sentences with a subject-verb-object structure and a binary property annotated for the verb or one of the nouns in the sentence, e.g. animate vs. inanimate for one of the nouns (the subject or the object); dynamic vs. static, and supporting causative-inchoative alternation for verbs. This is an easy task, targeting relatively stable properties of the target words regardless of context, but it can be useful to test the attention patterns of a model: in theory, LLMs with bidirectional attention should be able to solve it regardless of which token embed
137
+
138
+ ding is fed to the classifier (i.e., even if the target word follows the token embedding, a contextualized embedding from a BERT model should still contain information from the right-hand context), while autoregressive LLMs should struggle more when the input embedding is extracted from a token preceding the target.
139
+
140
+ A second task, targeting verbs, is lexical aspect classification (Metheniti et al., 2022). This dataset contains annotations about telicity and duration for verbs in a sentence context: given a verb embedding, a probing model has to determine whether it is telic/atelic or durative/stative.
141
+
142
+ Next, we ran two regression tasks using two datasets targeting the semantics of words in context: CONcreTEXT (Gregori et al., 2020) and contextualized sensorimotor norms (Trott and Bergen, 2022). The former contains annotations about the concreteness of a given word, with mean human ratings on a Likert scale ranging from 1 (totally abstract) to 7 (totally concrete); the latter contains mean human ratings for both verbs and nouns on 11 different sensorimotor domains, such as vision, hearing, etc. For each word, a sensorimotor rating indicates to what extent the corresponding sense is relevant to experiencing the concept referred by the target word in that specific context. In both cases, the goal for a probe model is to predict human ratings using as input the embedding of the target word (Fagarasan et al., 2015; Utsumi, 2018; Thompson and Lupyan, 2018; Li and Summers-Stay, 2019; Chersoni et al., 2020, 2021; Flor, 2024).
143
+
144
+ For the final task, we employ the Word-in-Context (Pilehvar and Camacho-Collados, 2019)
145
+
146
+ ![](images/837454b31502f4a447cc5153bb8c9b4756e6516eeb4b60498646ca8c6a52219a.jpg)
147
+ Figure 3: Results of predicting subject animacy, verb causative/dynamic, and object animacy using each word in a sentence as probed words, scores extracted with Sheared-Llama-1.3B and its variants. The horizontal axis represents word indices in sentences (all with identical five-word syntactic structures).
148
+
149
+ ![](images/d4d91aca771cc1a7f59f73c3682271c7b96a2b401fb37c3f9f05a64d13d3becb.jpg)
150
+
151
+ ![](images/39e027a73423bb82cffbcffbdf98c3e96f399d4616d86407b74c7a6befcaf012.jpg)
152
+
153
+ ![](images/b0bda92d9068fc33dc79312d501c5b5bdbe24e0a73b52aab26faa720b8067a7d.jpg)
154
+
155
+ dataset. In each instance, a target word appears in two different sentences, and the probe model has to determine whether the word is being used in the same sense or not. Dataset details are described in Appendix A.1.
156
+
157
+ We selected the probing tasks to address different types of semantic features for different parts-of-speech (e.g. nouns and verbs), and the tasks demand a different level of contextual sensitivity: while the features of context-probes or verb aspect should be stable for a target word across linguistic contexts, the regression tasks and the Word-in-Context were explicitly designed to require a deeper understanding of contextual meaning.
158
+
159
+ As for the probes, we tested both a linear and a non-linear model on top of the embeddings: the former was logistic regression for classification tasks and linear regression for concreteness and norms predictions; the latter was a multilayer perceptron (see Appendix B). In the main text, we only report the results of the Multilayer Perceptron, which achieved higher scores, while the results for the linear models are in Appendix B.2. All tasks were implemented on a single 40GB NVIDIA A100 GPU.
160
+
161
+ To ensure that our probing methodology actually evaluates the quality of contextual information in embeddings and to assess our selected tasks' sensitivity to context, we conducted two complementary experiments documented in the Appendix 2: 1) control tasks with randomly sampled labels (Appendix C), and 2) out-of-context evaluations where models processed probed words in isolation rather than complete sentences (Appendix D).
162
+
163
+ # 4 Results and Analysis
164
+
165
+ The experimental results yield three main findings derived from Tasks 1 and 2, Tasks 3 and 4, and the final task, respectively.
166
+
167
+ Finding 1: Bidirectional attention improves the LLMs' ability to represent subsequent context, but it weakens the utilization of the previous context. Contrastive learning techniques mitigate this tradeoff by enhancing the model's ability to balance contextual understanding in both directions.
168
+
169
+ ![](images/7c7589342d4acf7973b24a98418d1af8c7f064185e390f9835e5e036bb33e7b7.jpg)
170
+ Figure 4: Results of subject animacy subtask in Task 1 by comparing Sheared-Llama-1.3B to Llama2-7B.
171
+
172
+ Figure 3 shows the results for the context-probes dataset, for the base, unidirectional Llama, when the embedding of the probed word comes before the target word, the model has severe difficulty in correctly predicting the properties of the target word. On the other hand, it can be seen that the
173
+
174
+ performance of the bidirectional baselines is consistently high, regardless of the token embedding. Once bidirectional attention is enabled, however, the score pattern for Llama Bi + MNTP is more aligned with the BERT models.
175
+
176
+ There is, though, an important difference: by comparing Bi + MNTP and unidirectional Llama in Figure 3 a), we can find that the pink line shows relatively stable accuracy in the latter half, while the blue line exhibits a noticeable decline as the distance between target word and token of the input embedding increases. This indicates that enabling bidirectional attention may also weaken Llama's inherent ability to "see" the preceding context.
177
+
178
+ At the same time, if we look at the models enhanced with contrastive learning (purple and green lines), we can notice that the additional training helps Llama to maintain representation quality in all the token positions. The results of the first task thus suggest that the additional training to refine sentence-level representations has positive effects also on the quality of single token embeddings. Figure 4 shows a comparison between Sheared-Llama and Llama 2 in terms of the impact of bidirectional attention, and it can be seen that the larger model is following a similar pattern, although the accuracy scores have a less sharp decrease. Similarly to Sheared-Llama, the application of contrastive learning greatly helps model performance (see Appendix B for more detailed results).
179
+
180
+ In Figure 5 we can see the scores for the lexical aspect classification, where we can observe that, forelicity,the basic versions of Llama are already performing well and on par with the bidirectional baselines, while they fall short of BERT Base in modeling verb duration. As we observed before, bidirectional training alone with Bi $^+$ MNTP actually makes the models less accurate, whereas contrastive learning techniques consistently improve their performance. At a glance, it can be noticed that Llama 2 with either contrastive training type is better than both BERT baselines in both subtasks.
181
+
182
+ Finding 2: Autoregressive models perform similarly to bidirectional ones on regression probing tasks for norms prediction.
183
+
184
+ Moving to the regression tasks, e.g. concreteness prediction on CONcrete and modeling of contextualized sensorimotor norms (Figure 6), we can immediately see that base Llama models already achieve high correlations with human mean ratings, with no significant disadvantage to the bidirectional competitors. This contradicts previous
185
+
186
+ ![](images/fde671ab4ab675d58c6282d291105329a326a0869941e85b7ca5bae335de3b7b.jpg)
187
+
188
+ ![](images/2ef2d74cfaf5f59348f89f96d846ef78c62d33128c617aef87f9cfd17ad2bfed.jpg)
189
+ Figure 5: Results of verb telicity and duration (Task 2).
190
+
191
+ findings claiming that autoregressive LLMs are not optimal when it comes to modeling word semantics (Qorib et al., 2024).
192
+
193
+ It should not be underestimated, however, the specificity of the task at hand: while most probing tasks presented in the literature focus on discrete distinctions (e.g. grammatical vs. ungrammatical, semantically plausible vs. implausible), there is only limited comparative evidence about LLM performance when it comes to modeling fine-grained, continuous judgements of semantic properties. Interestingly, recent studies reported that LLMs are able to faithfully reproduce human ratings of concreteness and sensory norms via prompting GPT-4 (Xu et al., 2023; Martínez et al., 2025), and thus it is possible that such semantic features are robustly encoded also in other autoregressive architectures (e.g. Llama models).
194
+
195
+ Once again, Bi + MNTP alone deteriorates embedding quality, and contrastive learning strategies mitigate its negative effects. However, in the concreteness task this does not lead to any consistent improvement over the base models; in the sensorimotor norms task, better correlations can be observed only for the Llama 2 model, and only with the unsupervised contrastive learning strategy.
196
+
197
+ In addition, it could be noticed about these tasks that in none of the model families size seems to matter too much: Sheared-Llama and BERT Base are often on par or better than the corresponding
198
+
199
+ ![](images/2a75c72aeb581595aa7b34472ca8fc991a03ebb1c29200b921a4b55afabd9953.jpg)
200
+ (a) Concreteness prediction (Spearman)
201
+
202
+ ![](images/483a28b6c8dcc21004f73d919137e5af3bbaf6d0ba44aa3547fb1b74cb68b522.jpg)
203
+ (b) Concreteness prediction (Pearson)
204
+
205
+ (c) Sensorimotor prediction (Spearman)
206
+ ![](images/5759b66ef74227d0299c5d081866aab60c5e2f1c47d30ce40142614dfcd055d4.jpg)
207
+ Unidirectional Llama
208
+
209
+ (d) Sensorimotor predie (Pearson)
210
+ ![](images/0157428a13c41be0f7223401dc7cb552952993c5358b6a8fed4ac9fe5ab27906.jpg)
211
+ Bi+MNTP
212
+ BERT-base
213
+ Bi+MNTP+SimCSE
214
+ Bi + MNTP + Supervised
215
+ BERT-large
216
+
217
+ larger models.
218
+
219
+ ![](images/ab387410dd1198fcc7bb4cc827c45b378d01a77fdbf89ff09c4a347ca4176404.jpg)
220
+ Figure 6: (a)-(b) show results for predicting noun concreteness (Task 3), while (c)-(d) display average results for predicting 11 sensorimotor dimensions of words (Task 4). Metrics include Spearman and Pearson correlation coefficients.
221
+
222
+ ![](images/4d65ec84ede15b535f1d1a5f235feeb5d4599e00bef82d303fbb2d021617758f.jpg)
223
+ Figure 7: Results of word sense disambiguation task (Task 5). This task employs three methods of processing two target words' representation from pair sentences: cosine similarity, absolute difference, and concatenation. The metric is accuracy.
224
+
225
+ Finding 3: In the sense disambiguation task, contrastive learning methods improve the quality of embeddings from autoregressive models irrespec
226
+
227
+ tive of the strategy for extracting probe features.
228
+
229
+ Given that Word-in-Context requires, compared to the other datasets, the combination of two contextualized representations, we tested three different strategies to combine the vectors (Figure 7). No big differences can be seen between those strategies with the base models, and in this case $\mathrm{Bi} + \mathrm{MNTP}$ has a mixed effect, leading to the usual performance deterioration with Sheared-Llama and to better performance with Llama 2. Interestingly, contrastive learning leads again to best scores in the task, and it can be noticed that after its application the cosine similarities strategy becomes the most consistent one (cosine strategy with Sheared-Llama and either one of contrastive training types are the only combinations outperforming both the BERT baselines). As this strategy is simply based on using vector proximity as the only feature for the probe, the result suggests that refining representations for sentence-level tasks with contrastive learning also leads to more meaningful distances between token-level embeddings in the vector space.
230
+
231
+ # 4.1 Anisotropy in the Embedding Space
232
+
233
+ Anisotropy, a known issue in pre-trained language models, has been attributed to the disproportionate influence of rare tokens in the negative direction of
234
+
235
+ ![](images/ea5ded3e43394b39621b4b79219378771269409398ccbe0af1bf61c6110e3b65.jpg)
236
+ Figure 8: (a) represents the experimental results with randomly sampled words to examine the anisotropy; (b) illustrates the variation in anisotropy of words within the same sentence as the layer depth of the LLMs increases.
237
+
238
+ ![](images/77208035193266516a0ac16b8d06c76f2eee09512bac2a19c3e32797a85e1146.jpg)
239
+
240
+ hidden states within likelihood-maximizing models (Wang et al., 2020a; Gao et al., 2019). However, in the literature, bidirectional attention models were shown to exhibit lower anisotropy compared to autoregressive models (Ethayarajh, 2019), possibly due to the impact of the attention mechanisms. Based on this, we speculate that bidirectional attention may alleviate the issue of anisotropy in the embeddings of autoregressive models.
241
+
242
+ Therefore, we extract the embeddings for the target words in the WIC dataset (Pilehvar and Camacho-Collados, 2019), randomly sample the representation of all target words 1000 times, and then calculate the average cosine similarity. The result is presented in Figure 8 a): neither BERT nor Llama produces isotropic word representations. Additionally, all Llama models have a sudden sharp increase in the cosine similarities in the second layer, followed by a decrease.
243
+
244
+ In terms of broad trends from shallow to deep layers, Llama models are relatively stable in the central layers and then the similarities increase again towards the last layers, with the exception for unsupervised contrastive learning Llama. The observed impact of the bidirectional attention mechanism contradicts our hypothesis: Sheared-Llama1.3B with bidirectional attention exhibits higher global similarity across all hidden states compared to its unidirectional counterpart. While the model combining bidirectional attention and supervised contrastive learning is the one with the highest degree of anisotropy, the version with unsupervised contrastive learning is the most successful in reducing average similarities, showing an overall decreasing trend in the later layers. As for BERT, the similarities show a constant upward trend while moving from the earlier to the later layers, which
245
+
246
+ align with the previous analysis, and showing a spike in the degree of anisotropy in the very last ones (Ethayarajh, 2019).
247
+
248
+ On the basis of such findings, we would recommend that for tasks involving an unsupervised evaluation based on vector-space similarity, researchers adopt LLM with bidirectional training and unsupervised contrastive learning, since it seems to be the most robust combination against the anisotropy issue. On the other hand, our results also show that highly anisotropic representations do not necessarily have a negative impact on supervised tasks. In Figure 8 a) it can be clearly seen that, whereas unsupervised contrastive learning reduces anisotropy, supervised contrastive learning increases it. However, our experiments on the probing datasets showed that Llama models trained with supervised contrastive learning generally outperform all the other models.
249
+
250
+ To investigate how word representations within the same sentence evolve from shallow to deep layers of the model, we also extract words from individual sentences and perform layer-wise cosine similarity calculations to quantify intra-sentence anisotropy. Figure 8 b) shows that supervised contrastive learning bidirectional and bidirectional-only Llama models exhibit increasing anisotropy across layers, indicating that, in the deeper layers of the model, words from the same sentence tend to converge towards similar representations. This exhibits a trend of increasing anisotropy analogous to what we observed with randomly selected words. In the case of intra-sentence words, however, unsupervised contrastive learning does not significantly decrease the similarities compared to the base model, and the lowest levels of anisotropy are generally achieved by BERT in the late layers.
251
+
252
+ # 5 Conclusion
253
+
254
+ This work investigates how bidirectional attention contributes to contextual information encoding in word representations. The main contributions are: 1) providing a fine-grained word-based analysis of LLMs with enabled bidirectional attention, 2) unveiling the trade-off brought by bidirectional attention, and 3) contributing valuable insight into the application of LLM2Vec and the ongoing exploration of using LLMs as text encoders.
255
+
256
+ Contrary to our expectations, we found that in semantic probing tasks simply enabling bidirectional attention is not sufficient, as it may decrease the model's capability to represent the previous context. However, we observed that across tasks, with the only exception of regression tasks for norms prediction, adding contrastive learning on top of bidirectional attention tends to improve the representation quality of the embeddings extracted from autoregressive LLMs. The fact that the sense disambiguation task of the Word-in-Context dataset, after contrastive learning, can be better addressed simply by using the cosine between the vectors suggests that this technique might lead to more meaningful distances between token-level vectors.
257
+
258
+ Moreover, we further analyzed the anisotropy of embedding representations across various hidden states. We found that bidirectional attention increases representation isotropy across all Llama layers, showing that this feature is not inherently related to undirectional attention. Among the contrastive learning strategies, the unsupervised one seems to improve the anisotropy issue in the vector space, and thus it would be the recommended choice if the goal was to adapt an autoregressive LLM to unsupervised word embedding tasks that are evaluated via vector similarity.
259
+
260
+ # Limitations
261
+
262
+ This probing study reveals that activating bidirectional attention impacts the semantic encoding of word representations, though the underlying mechanisms remain unclear. Additionally, the correspondence between high-dimensional dense vectors in computational models and semantic information warrants further investigation to bridge interpretability gaps in neural representation studies.
263
+
264
+ Another limitation is that our study is limited to the English language with the Sheared-Llama-1.3B and Llama2-7B models, and bigger models were not tested due to limitation of our computational
265
+
266
+ resources. Different languages and models may yield varying effects on the performance our lexical semantic tasks. We anticipate that future work can expand to diverse languages and models to validate and refine our findings. Likewise, Our approach to extracting contextual word representations, while designed for broad model compatibility, may not be necessarily the optimal one for each model.
267
+
268
+ Lastly, while bidirectional attention mechanisms have been shown to enhance performance in text embedding tasks in LLMs, their inherent capabilities were not thoroughly evaluated in our study. However, since our paper focuses on the problem of adapting autoregressive LLMs to embedding-based tasks, we did not evaluate text generation capabilities. To our knowledge, bidirectional attention and contrastive learning are not commonly adopted for text-generation tasks. A previous study (Khosla et al., 2025) demonstrated that enabling bidirectional attention in LLMs may significantly exacerbate text repetition. This occurs because such mechanisms disrupt the LLM's native autoregressive generation, causing it to resemble BERT-like models, which are known to struggle with coherent text production. Future work may include more in-depth explorations of this problem.
269
+
270
+ # Acknowledgements
271
+
272
+ We sincerely thank BehnamGhader et al. (2024) for their innovative work on LLM2Vec, which provided foundational inspiration for our research. Their open-source contribution of the models on HuggingFace have been invaluable to our work. We also thank anonymous reviewers for their constructive feedback and suggestions, which have significantly helped us to refine this study.
273
+
274
+ # Ethics Statement
275
+
276
+ This study investigates the impact of bidirectional attention mechanisms on semantic feature extraction in LLMs. While the technical contributions aim to advance model interpretability and linguistic capability, we acknowledge broader ethical responsibilities in disseminating and applying these findings. The research is intended to support beneficial applications in natural language understanding, such as improving machine translation and text summarization, where enhanced semantic analysis could yield significant societal value.
277
+
278
+ # References
279
+
280
+ Parishad BehnamGhader, Vaibhav Adlakha, Marius Mosbach, Dzmitry Bahdanau, Nicolas Chapados, and Siva Reddy. 2024. LLM2Vec: Large language models are secretly powerful text encoders. In Proceedings of COLM.
281
+ Rishi Bommasani, Kelly Davis, and Claire Cardie. 2020. Interpreting Pretrained Contextualized Representations via Reductions to Static Embeddings. In Proceedings of ACL, pages 4758-4781, Online. Association for Computational Linguistics.
282
+ 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.
283
+ John A Bullinaria and Joseph P Levy. 2012. Extracting semantic representations from word co-occurrence statistics: stop-lists, stemming, and SVD. Behavior Research Methods, 44:890-907.
284
+ Xingyu Cai, Jiaji Huang, Yuchen Bian, and Kenneth Church. 2021. Isotropy in the contextual embedding space: Clusters and manifolds. In International conference on learning representations.
285
+ Emmanuele Chersoni, Enrico Santus, Chu-Ren Huang, Alessandro Lenci, et al. 2021. Decoding word embeddings with brain-based semantic features. Computational Linguistics, 47(3):663-698.
286
+ Emmanuele Chersoni, Rong Xiang, Qin Lu, and Chu Ren Huang. 2020. Automatic Learning of Modality Exclusivity Norms with Crosslingual Word Embeddings. In Proceedings of *SEM.
287
+ Gabriella Chronis and Katrin Erk. 2020. When is a bishop not like a rook? when it's like a rabbi! multiprototype BERT embeddings for estimating semantic relationships. In Proceedings of CONLL, pages 227-244, Online. Association for Computational Linguistics.
288
+ Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. 2020. ELECTRA: Pretraining text encoders as discriminators rather than generators. In International Conference on Learning Representations.
289
+ 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.
290
+ Kawin Ethayarajh. 2019. How contextual are contextualized word representations? Comparing the geometry of BERT, ELMo, and GPT-2 embeddings. In
291
+
292
+ 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 55-65, Hong Kong, China. Association for Computational Linguistics.
293
+ Luana Fagarasan, Eva Maria Vecchi, and Stephen Clark. 2015. From Distributional Semantics to Feature Norms: Grounding Semantic Models in Human Perceptual Data. In Proceedings of IWCS.
294
+ Manaal Faruqui, Yulia Tsvetkov, Pushpendre Rastogi, and Chris Dyer. 2016. Problems with evaluation of word embeddings using word similarity tasks. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP, pages 30-35, Berlin, Germany. Association for Computational Linguistics.
295
+ Michael M Flor. 2024. Three Studies on Predicting Word Concreteness with Embedding Vectors. In Proceedings of the LREC-COLING Workshop on Cognitive Aspects of the Lexicon.
296
+ Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tieyan Liu. 2019. Representation degeneration problem in training natural language generation models. In International Conference on Learning Representations.
297
+ Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021. SimCSE: Simple contrastive learning of sentence embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6894-6910, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
298
+ Anna Gladkova and Aleksandr Drozd. 2016. Intrinsic evaluations of word embeddings: What can we do better? In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP, pages 36-42, Berlin, Germany. Association for Computational Linguistics.
299
+ Nathan Godey, Éric de la Clergerie, and Benoît Sagot. 2024. Anisotropy is inherent to self-attention in transformers. In Proceedings of EACL.
300
+ Lorenzo Gregori, Maria Montefinese, Daniele P Radicioni, Amelio Ravelli Andrea, Rossella Varvara, et al. 2020. CONCRETEXT@ EVALITA2020: The concreteness in context task. In Ceur Workshop Proceedings, volume 2765, pages 1-8. CEUR.
301
+ Zellig S Harris. 1954. Distributional structure. WORD, 10(2-3):146-162.
302
+ John Hewitt and Percy Liang. 2019. Designing and interpreting probes with control tasks. 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 2733-2743, Hong Kong, China. Association for Computational Linguistics.
303
+
304
+ John Hewitt and Christopher D. Manning. 2019. A structural probe for finding syntax in word representations. 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 4129-4138, Minneapolis, Minnesota. Association for Computational Linguistics.
305
+ Carina Kauf, Anna A Ivanova, Giulia Rambelli, Emmanuele Chersoni, Jingyuan Selena She, Zawad Chowdhury, Evelina Fedorenko, and Alessandro Lenci. 2023. Event Knowledge in Large Language Models: The Gap Between the Impossible and the Unlikely. Cognitive Science, 47(11):e13386.
306
+ Savya Khosla, Aditi Tiwari, Kushal Kafle, Simon Jenni, Handong Zhao, John Collomosse, and Jing Shi. 2025. Magnet: Augmenting generative decoders with representation learning and infilling capabilities. Preprint, arXiv:2501.08648.
307
+ Josef Klafka and Allyson Ettinger. 2020. Spying on your neighbors: Fine-grained probing of contextual embeddings for information about surrounding words. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4801-4811, Online. Association for Computational Linguistics.
308
+ Chankyu Lee, Rajarshi Roy, Mengyao Xu, Jonathan Raiman, Mohammad Shoeybi, Bryan Catanzaro, and Wei Ping. 2025. Nv-embed: Improved techniques for training llms as generalist embedding models. In The Thirteenth International Conference on Learning Representations.
309
+ Dandan Li and Douglas Summers-Stay. 2019. Mapping Distributional Semantics to Property Norms with Deep Neural Networks. *Big Data and Cognitive Computing*, 3(2):30.
310
+ Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. 2016. Assessing the ability of LSTMs to learn syntax-sensitive dependencies. Transactions of the Association for Computational Linguistics, 4:521-535.
311
+ Nelson F. Liu, Matt Gardner, Yonatan Belinkov, Matthew E. Peters, and Noah A. Smith. 2019. Linguistic knowledge and transferability of contextual representations. 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 1073-1094, Minneapolis, Minnesota. Association for Computational Linguistics.
312
+ Zhu Liu, Cunliang Kong, Ying Liu, and Maosong Sun. 2024. Fantastic semantics and where to find them: Investigating which layers of generative LLMs reflect lexical semantics. In *Findings of the Association for Computational Linguistics: ACL* 2024, pages 14551-14558, Bangkok, Thailand. Association for Computational Linguistics.
313
+
314
+ Gonzalo Martínez, Juan Diego Molero, Sandra González, Javier Conde, Marc Brysbaert, and Pedro Reviriego. 2025. Using large language models to estimate features of multi-word expressions: Concreteness, valence, arousal. Behavior Research Methods, 57(1):1-11.
315
+ Jacob Matthews, John Starr, and Marten Schijndel. 2024. Semantics or spelling? probing contextual word embeddings with orthographic noise. In *Findings of the Association for Computational Linguistics: ACL* 2024, pages 4495-4504, Bangkok, Thailand. Association for Computational Linguistics.
316
+ Eleni Metheniti, Tim Van De Cruys, and Nabil Hathout. 2022. About time: Do transformers learn temporal verbal aspect? In Proceedings of the Workshop on Cognitive Modeling and Computational Linguistics, pages 88-101, Dublin, Ireland. Association for Computational Linguistics.
317
+ Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. Preprint, arXiv:1301.3781.
318
+ Niklas Muennighoff. 2022. SGPT: GPT sentence embeddings for semantic search. arXiv preprint arXiv:2202.08904.
319
+ Humza Naveed, Asad Ullah Khan, Shi Qiu, Muhammad Saqib, Saeed Anwar, Muhammad Usman, Naveed Akhtar, Nick Barnes, and Ajmal Mian. 2023. A comprehensive overview of large language models. arXiv preprint arXiv:2307.06435.
320
+ Arvind Neelakantan, Tao Xu, Raul Puri, Alec Radford, Jesse Michael Han, Jerry Tworek, Qiming Yuan, Nikolas Tezak, Jong Wook Kim, Chris Hallacy, et al. 2022. Text and code embeddings by contrastive pretraining. arXiv preprint arXiv:2201.10005.
321
+ Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532-1543, Doha, Qatar. Association for Computational Linguistics.
322
+ Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 2227-2237, New Orleans, Louisiana. Association for Computational Linguistics.
323
+ Mohammad Taher Pilehvar and Jose Camacho-Collados. 2019. WiC: the word-in-context dataset for evaluating context-sensitive meaning representations. 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 1267-1273, Minneapolis, Minnesota. Association for Computational Linguistics.
324
+
325
+ Muhammad Qorib, Geonsik Moon, and Hwee Tou Ng. 2024. Are decoder-only language models better than encoder-only language models in understanding word meaning? In Findings of the Association for Computational Linguistics: ACL 2024, pages 16339-16347, Bangkok, Thailand. Association for Computational Linguistics.
326
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9.
327
+ Hinrich Schütze. 1992. *Dimensions of Meaning*. In *Supercomputing* '92: Proceedings of the 1992 ACM/IEEE Conference on Supercomputing, pages 787-796.
328
+ Jacob Mitchell Springer, Suhas Kotha, Daniel Fried, Graham Neubig, and Aditi Raghunathan. 2025. Repetition improves language model embeddings. In The Thirteenth International Conference on Learning Representations.
329
+ Bill Thompson and Gary Lupyan. 2018. Automatic Estimation of Lexical Concreteness in 77 Languages. In Proceedings of the Annual Meeting of the Cognitive Science Society, volume 40.
330
+ William Timkey and Marten van Schijndel. 2021. All bark and no bite: Rogue dimensions in transformer language models obscure representational quality. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 4527-4546, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
331
+ Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023a. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
332
+ Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. 2023b. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288.
333
+ Sean Trott and Benjamin Bergen. 2022. Contextualized sensorimotor norms: multi-dimensional measures of sensorimotor strength for ambiguous english words, in context. Preprint, arXiv:2203.05648.
334
+ Akira Utsumi. 2018. A Neurobiologically Motivated Analysis of Distributional Semantic Models. In Proceedings of CogSci.
335
+ Elena Voita and Ivan Titov. 2020. Information-theoretic probing with minimum description length. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 183-196, Online. Association for Computational Linguistics.
336
+
337
+ Hetong Wang, Pasquale Minervini, and Edoardo Ponti. 2024a. Probing the emergence of cross-lingual alignment during LLM training. In *Findings of the Association for Computational Linguistics: ACL* 2024, pages 12159–12173, Bangkok, Thailand. Association for Computational Linguistics.
338
+ Liang Wang, Nan Yang, Xiaolong Huang, Linjun Yang, Rangan Majumder, and Furu Wei. 2024b. Improving text embeddings with large language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 11897-11916, Bangkok, Thailand. Association for Computational Linguistics.
339
+ Lingxiao Wang, Jing Huang, Kevin Huang, Ziniu Hu, Guangtao Wang, and Quanquan Gu. 2020a. Improving neural language generation with spectrum control. In International Conference on Learning Representations.
340
+ Yuxuan Wang, Yutai Hou, Wanxiang Che, and Ting Liu. 2020b. From static to dynamic word representations: a survey. International Journal of Machine Learning and Cybernetics, 11:1611-1630.
341
+ Zhiyong Wu, Yun Chen, Ben Kao, and Qun Liu. 2020. Perturbed masking: Parameter-free probing for analyzing and interpreting BERT. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4166-4176, Online. Association for Computational Linguistics.
342
+ Mengzhou Xia, Tianyu Gao, Zhiyuan Zeng, and Danqi Chen. 2023. Sheared Llama: Accelerating language model pre-training via structured pruning. arXiv preprint arXiv:2310.06694.
343
+ Qihui Xu, Yingying Peng, Samuel A Nastase, Martin Chodorow, Minghua Wu, and Ping Li. 2023. Does conceptual representation require embodiment? insights from large language models. arXiv preprint arXiv:2305.19103.
344
+ Yilun Zhu, Joel Ruben Antony Moniz, Shruti Bhargava, Jiarui Lu, Dhivya Piraviperumal, Site Li, Yuan Zhang, Hong Yu, and Bo-Hsiang Tseng. 2024. Can large language models understand context? In *Findings of the Association for Computational Linguistics: EACL* 2024, pages 2004–2018, St. Julian's, Malta. Association for Computational Linguistics.
345
+
346
+ # A Experimental Setup
347
+
348
+ # A.1 Dataset Details
349
+
350
+ Table 1 details datasets used in experiments. The hyperlinks are attached to dataset names, which direct to the download page of each dataset.
351
+
352
+ # A.2 Model Details
353
+
354
+ Table 3 shows used model details in the experiments. Hyperlinks to each model's Hugging Face page are added.
355
+
356
+ # A.3 Other Setup Details
357
+
358
+ The hyperparameters of the Multilayer Perceptron (MLP) classifier used in our experiments are presented in Table 2. All experiments were implemented in Python 3.10 utilizing PyTorch 2.6.0 (CUDA 12.4), Transformers 4.43.1, and PEFT 0.10.0 libraries. To ensure reproducibility across experiments, we set the random seed to a fixed value of 42. To reduce memory usage and computational cost, we employed half-precision (FP16) arithmetic for embedding extraction.
359
+
360
+ # B Experimental Results
361
+
362
+ # B.1 Multilayer Perceptron
363
+
364
+ Tables 4 to 7 shows the experimental results of five tasks using multilayer perceptron as the probe model.
365
+
366
+ # B.2 Logistic Regression/Linear Regression
367
+
368
+ Tables 8 to 11 shows the experimental results of five tasks using logistic regression or linear regression as the probe model.
369
+
370
+ # C Effectiveness of Probing Method
371
+
372
+ As Voita and Titov (2020) pointed out, the probe accuracy can be similar when probing for genuine linguistic labels and probing for random synthetic tasks. To address this concern, we introduced control tasks to evaluate the selectivity of the probes. In control tasks, each label is not genuine but randomly sampled. As Hewitt and Liang (2019) suggested, a good probe should achieve higher accuracy on linguistic tasks and lower accuracy on control tasks. We test BERT-base, Sheared-Llama, and Sheared-Llama $(\mathrm{Bi} + \mathrm{BNTP})$ on control tasks (MLP classifier).
373
+
374
+ Results are shown in Tables 12 to 14: Across all five tasks we examined, the control task consistently showed significantly lower accuracy than the original task, demonstrating that the probes exhibited high selectivity in all five cases.
375
+
376
+ # D Task Sensitivity to Context
377
+
378
+ To assess the importance of the context in the first four tasks (i.e., whether performance benefits from contextual embeddings), we conducted additional experiments using non-contextual inputs (probed words without surrounding context) and MLP classifier. As demonstrated in Tables 15 and 16, the
379
+
380
+ results confirm that all four tasks indeed show improved performance with contextual information.
381
+
382
+ In Task 1 (Table 15): for each experiment, we input only a single word (the probed word) to the model, rather than an entire sentence. As expected, we found that accuracy is high only when probing the target word directly, with the other words yielding random-guess performance. Notice that in Task 1 our focus is not on target word probing accuracy itself, but rather on how much semantic information about the target word is contained in the embeddings of the other words. Therefore, task 1 can be solved only by contextualized embeddings for an input token other than the probed word.
383
+
384
+ As for Task 2, Task 3, and Task 4, we also added no-context results (Table 16). We found that results without context are significantly lower than those with context, indicating that contextual information is crucial for prediction in all three tasks.
385
+
386
+ <table><tr><td>Dataset</td><td>Predictive Method</td><td>Train Data</td><td>Test Data</td></tr><tr><td rowspan="3">Context-probe</td><td rowspan="3">Classification</td><td>Subject:
387
+ 4000 sentences</td><td>Subject:
388
+ 1000 sentences</td></tr><tr><td>Object:
389
+ 4000 sentences</td><td>Object:
390
+ 1000 sentences</td></tr><tr><td>Verb:
391
+ 8000 sentences</td><td>Verb:
392
+ 2000 sentences</td></tr><tr><td rowspan="2">Lexical aspect binary Classification (telicity/duration)</td><td rowspan="2">Classification</td><td>Telicity:
393
+ 3920 sentences</td><td>Telicity:
394
+ 980 sentences</td></tr><tr><td>Duration:
395
+ 2591 sentences</td><td>Duration:
396
+ 648 sentences</td></tr><tr><td>CONcreTEXT</td><td>Regression</td><td>347 sentences</td><td>87 sentences</td></tr><tr><td>Contextualized Sensorimotor Norms</td><td>Regression</td><td>358 sentences</td><td>90 sentences</td></tr><tr><td>WiC Dataset</td><td>Classification</td><td>1120 sentence pairs</td><td>280 sentence pairs</td></tr></table>
397
+
398
+ Table 1: Dataset details and train-test data separation of classifier or regressor training in our experiments. The predictive method applied and data separation between the train and test dataset are demonstrated. Links leading to the webpage of Github or the related recourse are added to the dataset name.
399
+
400
+ <table><tr><td></td><td>T1</td><td>T2-T</td><td>T2-D</td><td>T3</td><td>T4</td><td>T5-A</td><td>T5-S</td><td>T5-C</td></tr><tr><td>Structure</td><td>[20, 10]</td><td>[20, 10]</td><td>[20, 10]</td><td>[40, 20]</td><td>[40, 20]</td><td>[20,10]</td><td>[5,2]</td><td>[20, 10]</td></tr><tr><td>Batch size</td><td>16</td><td>16</td><td>16</td><td>8</td><td>16</td><td>16</td><td>8</td><td>16</td></tr><tr><td>Learning rate</td><td>2e-5</td><td>2e-5</td><td>2e-5</td><td>2e-3</td><td>2e-3</td><td>1e-5</td><td>1e-3</td><td>1.5e-5</td></tr></table>
401
+
402
+ Table 2: Hyperparameters in Multilayer Perceptron classifier in experiments. All language models utilize the same hyperparameters setting in the same task. The first row indicates Task 1, Task 2 telicity, Task 3 duration, Task 3, Task 4, Task 5 (absolute difference), Task 5 (cosine similarity), and Task 5 (concatenation).
403
+
404
+ <table><tr><td>Family</td><td>Model Link</td><td>Parameters</td><td>Attention Mechanism</td></tr><tr><td rowspan="2">BERT</td><td>bert-base-uncased</td><td>109M</td><td rowspan="2">Bidirectional</td></tr><tr><td>bert-large-uncased</td><td>335M</td></tr><tr><td rowspan="4">Llama 1</td><td>Sheared-LLaMA-1.3B</td><td rowspan="4">1.3B</td><td>Unidirectional</td></tr><tr><td>LLM2Vec-Sheared-LLaMA-mntp</td><td rowspan="3">Bidirectional</td></tr><tr><td>LLM2Vec-Sheared-LLaMA-mntp-unsup-simcse</td></tr><tr><td>LLM2Vec-Sheared-LLaMA-mntp-supervised</td></tr><tr><td rowspan="4">Llama 2</td><td>Llama-2-7b-hf</td><td rowspan="4">7B</td><td>Unidirectional</td></tr><tr><td>LLM2Vec-Llama-2-7b-chat-hf-mntp</td><td rowspan="3">Bidirectional</td></tr><tr><td>LLM2Vec-Llama-2-7b-chat-hf-mntp-unsup-simcse</td></tr><tr><td>LLM2Vec-Llama-2-7b-chat-hf-mntp-supervised</td></tr></table>
405
+
406
+ Table 3: Model details of used models, parameters details, and enabled attention mechanism in our experiments. Links leading to the Hugging Face page of each model are added to the hyperlinks.
407
+
408
+ <table><tr><td>Model</td><td>Subtask</td><td>Index 1</td><td>Index 2</td><td>Index 3</td><td>Index 4</td><td>Index 5</td></tr><tr><td rowspan="4">BERT-base</td><td>subject animacy</td><td>0.942</td><td>1.000</td><td>0.966</td><td>0.944</td><td>0.944</td></tr><tr><td>verb causative</td><td>0.989</td><td>0.976</td><td>0.999</td><td>0.990</td><td>0.989</td></tr><tr><td>verb dynamic</td><td>0.998</td><td>0.979</td><td>1.000</td><td>0.999</td><td>0.984</td></tr><tr><td>object animacy</td><td>0.942</td><td>0.870</td><td>0.914</td><td>0.948</td><td>0.982</td></tr><tr><td rowspan="4">BERT-large</td><td>subject animacy</td><td>0.967</td><td>0.998</td><td>0.965</td><td>0.969</td><td>0.939</td></tr><tr><td>verb causative</td><td>0.989</td><td>0.945</td><td>0.998</td><td>0.990</td><td>0.968</td></tr><tr><td>verb dynamic</td><td>0.992</td><td>0.975</td><td>1.000</td><td>0.991</td><td>0.971</td></tr><tr><td>object animacy</td><td>0.932</td><td>0.847</td><td>0.889</td><td>0.940</td><td>0.987</td></tr><tr><td rowspan="4">Sheared-Llama-1.3B</td><td>subject animacy</td><td>0.547†</td><td>1.000</td><td>0.994</td><td>0.996</td><td>0.943</td></tr><tr><td>verb causative</td><td>0.611†</td><td>0.534†</td><td>1.000</td><td>0.995</td><td>0.987</td></tr><tr><td>verb dynamic</td><td>0.515†</td><td>0.494†</td><td>1.000</td><td>0.998</td><td>0.973</td></tr><tr><td>object animacy</td><td>0.539†</td><td>0.501†</td><td>0.508†</td><td>0.507†</td><td>1.000</td></tr><tr><td rowspan="4">Sheared-Llama-1.3B (Bi + MNTP)</td><td>subject animacy</td><td>0.976</td><td>0.976*</td><td>0.916*</td><td>0.826*</td><td>0.766*</td></tr><tr><td>verb causative</td><td>0.958</td><td>0.968</td><td>0.991*</td><td>0.960*</td><td>0.939*</td></tr><tr><td>verb dynamic</td><td>0.972</td><td>0.974</td><td>0.983*</td><td>0.954*</td><td>0.935*</td></tr><tr><td>object animacy</td><td>0.850</td><td>0.877</td><td>0.960</td><td>0.995</td><td>0.999*</td></tr><tr><td rowspan="4">Sheared-Llama-1.3B (Bi + MNTP + SimCSE)</td><td>subject animacy</td><td>0.995</td><td>1.000</td><td>0.949</td><td>0.949</td><td>0.957</td></tr><tr><td>verb causative</td><td>0.993</td><td>0.999</td><td>1.000</td><td>0.995</td><td>0.997</td></tr><tr><td>verb dynamic</td><td>0.999</td><td>1.000</td><td>1.000</td><td>0.997</td><td>0.997</td></tr><tr><td>object animacy</td><td>0.944</td><td>0.956</td><td>0.978</td><td>0.996</td><td>1.000</td></tr><tr><td rowspan="4">Sheared-Llama-1.3B (Bi + MNTP + Supervised)</td><td>subject animacy</td><td>0.988</td><td>1.000</td><td>0.980</td><td>0.983</td><td>0.993</td></tr><tr><td>verb causative</td><td>0.998</td><td>0.995</td><td>1.000</td><td>0.999</td><td>0.999</td></tr><tr><td>verb dynamic</td><td>1.000</td><td>0.999</td><td>1.000</td><td>0.999</td><td>0.997</td></tr><tr><td>object animacy</td><td>0.993</td><td>0.995</td><td>0.989</td><td>0.999</td><td>1.000</td></tr><tr><td rowspan="4">Llama2-7B</td><td>subject animacy</td><td>0.547†</td><td>1.000</td><td>0.995</td><td>0.996</td><td>0.962</td></tr><tr><td>verb causative</td><td>0.611†</td><td>0.526†</td><td>1.000</td><td>1.000</td><td>0.997</td></tr><tr><td>verb dynamic</td><td>0.515†</td><td>0.515†</td><td>1.000</td><td>1.000</td><td>0.997</td></tr><tr><td>object animacy</td><td>0.544†</td><td>0.496†</td><td>0.497†</td><td>0.510†</td><td>1.000</td></tr><tr><td rowspan="4">Llama2-7B (Bi + MNTP)</td><td>subject animacy</td><td>0.999</td><td>0.998*</td><td>0.978*</td><td>0.908*</td><td>0.897*</td></tr><tr><td>verb causative</td><td>0.979</td><td>0.990</td><td>1.000</td><td>0.986*</td><td>0.978*</td></tr><tr><td>verb dynamic</td><td>0.985</td><td>0.990</td><td>0.996*</td><td>0.983*</td><td>0.978*</td></tr><tr><td>object animacy</td><td>0.901</td><td>0.941</td><td>0.994</td><td>0.999</td><td>0.997*</td></tr><tr><td rowspan="4">Llama2-7B (Bi + MNTP + SimCSE)</td><td>subject animacy</td><td>0.993</td><td>1.000</td><td>0.984</td><td>0.982</td><td>0.994</td></tr><tr><td>verb causative</td><td>0.998</td><td>1.000</td><td>1.000</td><td>0.999</td><td>0.999</td></tr><tr><td>verb dynamic</td><td>0.998</td><td>1.000</td><td>1.000</td><td>0.999</td><td>1.000</td></tr><tr><td>object animacy</td><td>0.991</td><td>0.996</td><td>0.988</td><td>0.996</td><td>1.000</td></tr><tr><td rowspan="4">Llama2-7B (Bi + MNTP + Supervised)</td><td>subject animacy</td><td>1.000</td><td>1.000</td><td>0.991</td><td>0.987</td><td>0.999</td></tr><tr><td>verb causative</td><td>1.000</td><td>0.999</td><td>1.000</td><td>0.999</td><td>0.999</td></tr><tr><td>verb dynamic</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>0.997</td></tr><tr><td>object animacy</td><td>0.983</td><td>0.990</td><td>0.986</td><td>0.999</td><td>1.000</td></tr></table>
409
+
410
+ Table 4: Results of Task 1 (context probes, Multilayer Perceptron). Numbers with $\dagger$ give evidence that LLMs can not access the subsequent context, and numbers with $\star$ show that bidirectional attention weakens preceding context utilization.
411
+
412
+ <table><tr><td>Model</td><td>T2-T</td><td>T2-D</td><td>T5-A</td><td>T5-S</td><td>T5-C</td><td>T5-Avg</td></tr><tr><td>BERT-base</td><td>0.8286</td><td>0.9167</td><td>0.6071</td><td>0.6179</td><td>0.5857</td><td>0.6036</td></tr><tr><td>BERT-large</td><td>0.8235</td><td>0.9059</td><td>0.6429</td><td>0.6786</td><td>0.5393</td><td>0.6203</td></tr><tr><td>Sheared-Llama-1.3B</td><td>0.8235</td><td>0.9074</td><td>0.5679</td><td>0.5750</td><td>0.5786</td><td>0.5738</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP</td><td>0.7653</td><td>0.8750</td><td>0.5607</td><td>0.5179</td><td>0.5464</td><td>0.5417</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+SimCSE</td><td>0.8276</td><td>0.9120</td><td>0.6036</td><td>0.6286</td><td>0.5750</td><td>0.6024</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+Supv.</td><td>0.8265</td><td>0.9198</td><td>0.6214</td><td>0.6500</td><td>0.5714</td><td>0.6143</td></tr><tr><td>Llama2-7B</td><td>0.8388</td><td>0.9090</td><td>0.5536</td><td>0.5357</td><td>0.5500</td><td>0.5464</td></tr><tr><td>Llama2-7B-Bi+MNTP</td><td>0.7316</td><td>0.8596</td><td>0.5893</td><td>0.5821</td><td>0.5964</td><td>0.5893</td></tr><tr><td>Llama2-7B-Bi+MNTP+SimCSE</td><td>0.8531</td><td>0.9306</td><td>0.5786</td><td>0.6000</td><td>0.5786</td><td>0.5857</td></tr><tr><td>Llama2-7B-Bi+MNTP+Supv.</td><td>0.8531</td><td>0.9352</td><td>0.5964</td><td>0.6179</td><td>0.6179</td><td>0.6107</td></tr></table>
413
+
414
+ Table 5: Classification accuracy of Task 2 and Task 5 (Multilayer Perceptron): T2-T (Task 2 telicity subtask), T2-D (Task 2 duration subtask), T5-A/S/C (Task 5 with the absolute difference/cosine similarity/concatenation.) "Supv." is the abbreviation of "Supervised". The bolded numbers indicate the highest performances among models in the same column, while numbers with underlines mean the weakest performance.
415
+
416
+ <table><tr><td>Model</td><td>T3-MSE</td><td>T3-R2</td><td>T3-Pearson</td><td>T3-Spearman</td></tr><tr><td>BERT-base</td><td>0.6758</td><td>0.6612</td><td>0.8215</td><td>0.7971</td></tr><tr><td>BERT-large</td><td>0.6639</td><td>0.6671</td><td>0.8219</td><td>0.7946</td></tr><tr><td>Sheared-Llama-1.3B</td><td>0.7336</td><td>0.6322</td><td>0.8219</td><td>0.7946</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP</td><td>0.9808</td><td>0.5082</td><td>0.7157</td><td>0.7079</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+SimCSE</td><td>0.7383</td><td>0.6298</td><td>0.7983</td><td>0.7768</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+Supv.</td><td>0.6926</td><td>0.6527</td><td>0.7958</td><td>0.7795</td></tr><tr><td>Llama2-7B</td><td>0.8213</td><td>0.5882</td><td>0.7751</td><td>0.7635</td></tr><tr><td>Llama2-7B-Bi+MNTP</td><td>1.5857</td><td>0.2049</td><td>0.4616</td><td>0.4503</td></tr><tr><td>Llama2-7B-Bi+MNTP+SimCSE</td><td>0.8872</td><td>0.5552</td><td>0.7477</td><td>0.7628</td></tr><tr><td>Llama2-7B-Bi+MNTP+Supv.</td><td>0.7241</td><td>0.6370</td><td>0.8012</td><td>0.7879</td></tr></table>
417
+
418
+ Table 6: Regression results of Task 3 (concreteness prediction, Multilayer Perceptron). "Supv." is the abbreviation of "Supervised".
419
+
420
+ <table><tr><td>Model</td><td>T4-MSE</td><td>T4-R2</td><td>T4-Pearson</td><td>T4-Spearman</td></tr><tr><td>BERT-base</td><td>0.3738</td><td>0.4065</td><td>0.6706</td><td>0.5916</td></tr><tr><td>BERT-large</td><td>0.3905</td><td>0.3483</td><td>0.6300</td><td>0.5567</td></tr><tr><td>Sheared-Llama-1.3B</td><td>0.3884</td><td>0.3664</td><td>0.6408</td><td>0.5785</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP</td><td>0.4626</td><td>-0.4610</td><td>0.5788</td><td>0.4976</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+SimCSE</td><td>0.3766</td><td>0.4215</td><td>0.6484</td><td>0.5730</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+Supv.</td><td>0.3835</td><td>0.3798</td><td>0.6572</td><td>0.5798</td></tr><tr><td>Llama2-7B</td><td>0.3854</td><td>0.4154</td><td>0.6626</td><td>0.6040</td></tr><tr><td>Llama2-7B-Bi+MNTP</td><td>0.5505</td><td>0.1782</td><td>0.4659</td><td>0.5179</td></tr><tr><td>Llama2-7B-Bi+MNTP+SimCSE</td><td>0.3616</td><td>0.4240</td><td>0.6806</td><td>0.6317</td></tr><tr><td>Llama2-7B-Bi+MNTP+Supv.</td><td>0.3903</td><td>0.3841</td><td>0.6486</td><td>0.5927</td></tr></table>
421
+
422
+ Table 7: Average regression results of Task 4 (sensorimotor prediction, Multilayer Perceptron) "Supv." is the abbreviation of "Supervised".
423
+
424
+ <table><tr><td>Model</td><td>Subtask</td><td>Index 1</td><td>Index 2</td><td>Index 3</td><td>Index 4</td><td>Index 5</td></tr><tr><td rowspan="4">BERT-base</td><td>subject animacy</td><td>0.925</td><td>0.999</td><td>0.958</td><td>0.925</td><td>0.936</td></tr><tr><td>verb causative</td><td>0.975</td><td>0.959</td><td>0.994</td><td>0.975</td><td>0.980</td></tr><tr><td>verb dynamic</td><td>0.989</td><td>0.984</td><td>1.000</td><td>0.989</td><td>0.982</td></tr><tr><td>object animacy</td><td>0.931</td><td>0.835</td><td>0.913</td><td>0.931</td><td>0.984</td></tr><tr><td rowspan="4">BERT-large</td><td>subject animacy</td><td>0.944</td><td>0.997</td><td>0.961</td><td>0.944</td><td>0.929</td></tr><tr><td>verb causative</td><td>0.988</td><td>0.931</td><td>0.998</td><td>0.988</td><td>0.970</td></tr><tr><td>verb dynamic</td><td>0.988</td><td>0.974</td><td>0.998</td><td>0.988</td><td>0.969</td></tr><tr><td>object animacy</td><td>0.925</td><td>0.810</td><td>0.871</td><td>0.925</td><td>0.988</td></tr><tr><td rowspan="4">Sheared-Llama-1.3B</td><td>subject animacy</td><td>0.547†</td><td>1.000</td><td>0.999</td><td>0.998</td><td>0.959</td></tr><tr><td>verb causative</td><td>0.611†</td><td>0.527†</td><td>1.000</td><td>0.997</td><td>0.996</td></tr><tr><td>verb dynamic</td><td>0.515†</td><td>0.500†</td><td>1.000</td><td>1.000</td><td>0.991</td></tr><tr><td>object animacy</td><td>0.539†</td><td>0.492†</td><td>0.534†</td><td>0.479†</td><td>1.000</td></tr><tr><td rowspan="4">Sheared-Llama-1.3B (Bi + MNTP)</td><td>subject animacy</td><td>0.979</td><td>0.983★</td><td>0.912★</td><td>0.823★</td><td>0.765★</td></tr><tr><td>verb causative</td><td>0.962</td><td>0.969</td><td>0.994★</td><td>0.966★</td><td>0.943★</td></tr><tr><td>verb dynamic</td><td>0.971</td><td>0.972</td><td>0.987★</td><td>0.972★</td><td>0.945★</td></tr><tr><td>object animacy</td><td>0.882</td><td>0.887</td><td>0.956</td><td>0.988</td><td>0.995★</td></tr><tr><td rowspan="4">Sheared-Llama-1.3B (Bi + MNTP + SimCSE)</td><td>subject animacy</td><td>0.995</td><td>1.000</td><td>0.961</td><td>0.947</td><td>0.962</td></tr><tr><td>verb causative</td><td>0.996</td><td>0.999</td><td>1.000</td><td>0.999</td><td>0.998</td></tr><tr><td>verb dynamic</td><td>1.000</td><td>1.000</td><td>1.000</td><td>0.998</td><td>0.999</td></tr><tr><td>object animacy</td><td>0.952</td><td>0.970</td><td>0.986</td><td>0.996</td><td>1.000</td></tr><tr><td rowspan="4">Sheared-Llama-1.3B (Bi + MNTP + Supervised)</td><td>subject animacy</td><td>0.970</td><td>1.000</td><td>0.990</td><td>0.991</td><td>0.994</td></tr><tr><td>verb causative</td><td>0.986</td><td>0.998</td><td>1.000</td><td>1.000</td><td>0.998</td></tr><tr><td>verb dynamic</td><td>0.996</td><td>1.000</td><td>1.000</td><td>1.000</td><td>0.999</td></tr><tr><td>object animacy</td><td>0.994</td><td>0.997</td><td>0.992</td><td>0.999</td><td>1.000</td></tr><tr><td rowspan="4">Llama2-7B</td><td>subject animacy</td><td>0.547†</td><td>1.000</td><td>0.998</td><td>0.998</td><td>0.977</td></tr><tr><td>verb causative</td><td>0.611†</td><td>0.528†</td><td>1.000</td><td>1.000</td><td>0.994</td></tr><tr><td>verb dynamic</td><td>0.512†</td><td>0.490†</td><td>1.000</td><td>1.000</td><td>0.996</td></tr><tr><td>object animacy</td><td>0.544†</td><td>0.496†</td><td>0.507†</td><td>0.505†</td><td>0.999</td></tr><tr><td rowspan="4">Llama2-7B (Bi + MNTP)</td><td>subject animacy</td><td>0.997</td><td>0.993★</td><td>0.986★</td><td>0.949★</td><td>0.936★</td></tr><tr><td>verb causative</td><td>0.979</td><td>0.990</td><td>0.997★</td><td>0.994★</td><td>0.983★</td></tr><tr><td>verb dynamic</td><td>0.988</td><td>0.992</td><td>0.997★</td><td>0.990★</td><td>0.985★</td></tr><tr><td>object animacy</td><td>0.932</td><td>0.958</td><td>0.989</td><td>0.993</td><td>0.994★</td></tr><tr><td rowspan="4">Llama2-7B (Bi + MNTP + SimCSE)</td><td>subject animacy</td><td>0.998</td><td>1.000</td><td>0.993</td><td>0.984</td><td>0.993</td></tr><tr><td>verb causative</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td></tr><tr><td>verb dynamic</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td></tr><tr><td>object animacy</td><td>0.989</td><td>0.992</td><td>0.990</td><td>0.997</td><td>1.000</td></tr><tr><td rowspan="4">Llama2-7B (Bi + MNTP + Supervised)</td><td>subject animacy</td><td>1.000</td><td>1.000</td><td>0.993</td><td>0.988</td><td>0.999</td></tr><tr><td>verb causative</td><td>1.000</td><td>0.999</td><td>1.000</td><td>1.000</td><td>0.998</td></tr><tr><td>verb dynamic</td><td>1.000</td><td>1.000</td><td>1.000</td><td>0.999</td><td>0.999</td></tr><tr><td>object animacy</td><td>0.982</td><td>0.991</td><td>0.989</td><td>0.999</td><td>1.000</td></tr></table>
425
+
426
+ Table 8: Results of Task 1 (context probes, Logistic Regression). Numbers with $\dagger$ give evidence that LLMs can not access the subsequent context, and numbers with $\star$ show that bidirectional attention weakens preceding context utilization.
427
+
428
+ <table><tr><td>Model</td><td>T2-T</td><td>T2-D</td><td>T5-A</td><td>T5-S</td><td>T5-C</td><td>T5-Avg</td></tr><tr><td>BERT-base</td><td>0.7765</td><td>0.8904</td><td>0.5929</td><td>0.6179</td><td>0.5607</td><td>0.5905</td></tr><tr><td>BERT-large</td><td>0.7837</td><td>0.8796</td><td>0.5357</td><td>0.6643</td><td>0.5000</td><td>0.5666</td></tr><tr><td>Sheared-Llama-1.3B</td><td>0.7571</td><td>0.9059</td><td>0.4964</td><td>0.5357</td><td>0.5107</td><td>0.5142</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP</td><td>0.7010</td><td>0.8611</td><td>0.5321</td><td>0.5500</td><td>0.5071</td><td>0.5297</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+SimCSE</td><td>0.7745</td><td>0.9090</td><td>0.5500</td><td>0.6321</td><td>0.5357</td><td>0.5726</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+Supv.</td><td>0.7918</td><td>0.9136</td><td>0.5821</td><td>0.6429</td><td>0.5500</td><td>0.5917</td></tr><tr><td>Llama2-7B</td><td>0.8061</td><td>0.9151</td><td>0.4679</td><td>0.5107</td><td>0.5000</td><td>0.4929</td></tr><tr><td>Llama2-7B-Bi+MNTP</td><td>0.6704</td><td>0.8596</td><td>0.5179</td><td>0.5500</td><td>0.5250</td><td>0.5310</td></tr><tr><td>Llama2-7B-Bi+MNTP+SimCSE</td><td>0.8194</td><td>0.9244</td><td>0.5571</td><td>0.6000</td><td>0.5429</td><td>0.5667</td></tr><tr><td>Llama2-7B-Bi+MNTP+Supv.</td><td>0.8357</td><td>0.9198</td><td>0.5500</td><td>0.6393</td><td>0.5321</td><td>0.5738</td></tr></table>
429
+
430
+ Table 9: Classification accuracy of Task 2 and Task 5 (Logistic Regression): T2-T (Task 2 telicity subtask), T2-D (Task 2 duration subtask), T5-A/S/C (Task 5 with the absolute difference/cosine similarity/concatenation.) "Supv." is the abbreviation of "Supervised".
431
+
432
+ <table><tr><td>Model</td><td>T3-MSE</td><td>T3-R2</td><td>T3-Pearson</td><td>T3-Spearman</td></tr><tr><td>BERT-base</td><td>1.2702</td><td>0.3631</td><td>0.6967</td><td>0.6774</td></tr><tr><td>BERT-large</td><td>0.9944</td><td>0.5014</td><td>0.7457</td><td>0.7319</td></tr><tr><td>Sheared-Llama-1.3B</td><td>0.8761</td><td>0.5607</td><td>0.7778</td><td>0.7588</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP</td><td>1.1636</td><td>0.4166</td><td>0.6866</td><td>0.6792</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+SimCSE</td><td>0.7638</td><td>0.6171</td><td>0.7914</td><td>0.7668</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+Supv.</td><td>0.7269</td><td>0.6356</td><td>0.8107</td><td>0.7905</td></tr><tr><td>Llama2-7B</td><td>0.8379</td><td>0.5799</td><td>0.7804</td><td>0.7638</td></tr><tr><td>Llama2-7B-Bi+MNTP</td><td>1.5123</td><td>0.2418</td><td>0.5370</td><td>0.5435</td></tr><tr><td>Llama2-7B-Bi+MNTP+SimCSE</td><td>0.8108</td><td>0.5935</td><td>0.7895</td><td>0.7724</td></tr><tr><td>Llama2-7B-Bi+MNTP+Supv.</td><td>0.6597</td><td>0.6692</td><td>0.8375</td><td>0.8190</td></tr></table>
433
+
434
+ Table 10: Regression results of Task 3 (concreteness prediction, Linear Regression). "Supv." is the abbreviation of "Supervised".
435
+
436
+ <table><tr><td>Model</td><td>T4-MSE</td><td>T4-R2</td><td>T4-Pearson</td><td>T4-Spearman</td></tr><tr><td>BERT-base</td><td>0.6625</td><td>0.0215</td><td>0.5680</td><td>0.4917</td></tr><tr><td>BERT-large</td><td>0.5907</td><td>0.0862</td><td>0.5695</td><td>0.5100</td></tr><tr><td>Sheared-Llama-1.3B</td><td>0.4152</td><td>0.3446</td><td>0.6484</td><td>0.5859</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP</td><td>0.6371</td><td>0.0201</td><td>0.5185</td><td>0.4603</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+SimCSE</td><td>0.4029</td><td>0.3829</td><td>0.6662</td><td>0.6085</td></tr><tr><td>Sheared-Llama-1.3B-Bi+MNTP+Supv.</td><td>0.4554</td><td>0.2950</td><td>0.6304</td><td>0.5622</td></tr><tr><td>Llama2-7B</td><td>0.3827</td><td>0.3994</td><td>0.6636</td><td>0.5944</td></tr><tr><td>Llama2-7B-Bi+MNTP</td><td>0.6598</td><td>0.0121</td><td>0.4925</td><td>0.4301</td></tr><tr><td>Llama2-7B-Bi+MNTP+SimCSE</td><td>0.3560</td><td>0.4508</td><td>0.6952</td><td>0.6327</td></tr><tr><td>Llama2-7B-Bi+MNTP+Supv.</td><td>0.3547</td><td>0.4577</td><td>0.6965</td><td>0.6271</td></tr></table>
437
+
438
+ Table 11: Average regression results of Task 4 (sensorimotor prediction, Linear Regression). "Supv." is the abbreviation of "Supervised".
439
+
440
+ <table><tr><td>Model</td><td>Task</td><td>Index1</td><td>Index2</td><td>Index3</td><td>Index4</td><td>Index5</td></tr><tr><td rowspan="2">BERT-base</td><td>control</td><td>0.518</td><td>0.494</td><td>0.529</td><td>0.519</td><td>0.520</td></tr><tr><td>original</td><td>0.942</td><td>1.000</td><td>0.966</td><td>0.944</td><td>0.944</td></tr><tr><td rowspan="2">Sheared-Llama</td><td>control</td><td>0.497</td><td>0.520</td><td>0.490</td><td>0.530</td><td>0.510</td></tr><tr><td>original</td><td>0.547</td><td>1.000</td><td>0.994</td><td>0.996</td><td>0.943</td></tr><tr><td rowspan="2">Sheared-Llama (Bi+BNTP)</td><td>control</td><td>0.510</td><td>0.527</td><td>0.485</td><td>0.503</td><td>0.493</td></tr><tr><td>original</td><td>0.976</td><td>0.976</td><td>0.916</td><td>0.826</td><td>0.766</td></tr></table>
441
+
442
+ Table 12: This table presents a comparison of accuracy between the control task and the original task in Task 1 (subject animacy).
443
+
444
+ <table><tr><td>Model</td><td>Task</td><td>Task3-P</td><td>Task3-S</td><td>Task4-P</td><td>Task4-S</td></tr><tr><td rowspan="2">BERT-base</td><td>control</td><td>0.0649</td><td>0.0810</td><td>0.0421</td><td>0.0417</td></tr><tr><td>original</td><td>0.8215</td><td>0.7971</td><td>0.6706</td><td>0.5916</td></tr><tr><td rowspan="2">Sheared-Llama</td><td>control</td><td>-0.0798</td><td>-0.0739</td><td>-0.0097</td><td>-0.0091</td></tr><tr><td>original</td><td>0.8219</td><td>0.7946</td><td>0.6408</td><td>0.5785</td></tr><tr><td rowspan="2">Sheared-Llama (Bi + BNTP)</td><td>control</td><td>0.1214</td><td>0.1228</td><td>0.0437</td><td>0.0337</td></tr><tr><td>original</td><td>0.7157</td><td>0.7079</td><td>0.5788</td><td>0.4976</td></tr></table>
445
+
446
+ Table 13: This table presents a comparison of Pearson and Spearman correlation coefficient between the control task and the original task in Task 3 and 4. P and S represent Pearson and Spearman, respectively.
447
+
448
+ <table><tr><td>Model</td><td>Task</td><td>T2-T</td><td>T2-D</td><td>T5-A</td><td>T5-S</td><td>T5-C</td><td>T5-Avg</td></tr><tr><td rowspan="2">BERT-base</td><td>control</td><td>0.5173</td><td>0.5015</td><td>0.5357</td><td>0.5036</td><td>0.5179</td><td>0.5191</td></tr><tr><td>original</td><td>0.8286</td><td>0.9167</td><td>0.6071</td><td>0.6179</td><td>0.5857</td><td>0.6036</td></tr><tr><td rowspan="2">Sheared-llama</td><td>control</td><td>0.5133</td><td>0.5448</td><td>0.5607</td><td>0.4750</td><td>0.5321</td><td>0.5226</td></tr><tr><td>original</td><td>0.8235</td><td>0.9074</td><td>0.5679</td><td>0.5750</td><td>0.5786</td><td>0.5738</td></tr><tr><td rowspan="2">Sheared-llama (Bi + BNTP)</td><td>control</td><td>0.5163</td><td>0.5509</td><td>0.5143</td><td>0.5000</td><td>0.5179</td><td>0.5107</td></tr><tr><td>original</td><td>0.7653</td><td>0.8750</td><td>0.5607</td><td>0.5179</td><td>0.5464</td><td>0.5417</td></tr></table>
449
+
450
+ Table 14: This table presents a comparison of accuracy between the control task and the original task in Task 2 and 5. T2-T (Task 2 telicity subtask), T2-D (Task 2 duration subtask), T5-A/S/C (Task 5 with the absolute difference/cosine similarity/concatenation).
451
+
452
+ <table><tr><td>Model</td><td>Subtask</td><td>Index1</td><td>Index2</td><td>Index3</td><td>Index4</td><td>Index5</td></tr><tr><td rowspan="4">BERT-base</td><td>subject animacy</td><td>0.507</td><td>1.000</td><td>0.519</td><td>0.507</td><td>0.527</td></tr><tr><td>verb causative</td><td>0.511</td><td>0.527</td><td>1.000</td><td>0.508</td><td>0.510</td></tr><tr><td>verb dynamic</td><td>0.516</td><td>0.511</td><td>1.000</td><td>0.516</td><td>0.530</td></tr><tr><td>object animacy</td><td>0.515</td><td>0.533</td><td>0.501</td><td>0.482</td><td>1.000</td></tr><tr><td rowspan="4">Sheared-Llama</td><td>subject animacy</td><td>0.482</td><td>1.000</td><td>0.491</td><td>0.482</td><td>0.499</td></tr><tr><td>verb causative</td><td>0.511</td><td>0.532</td><td>1.000</td><td>0.511</td><td>0.518</td></tr><tr><td>verb dynamic</td><td>0.515</td><td>0.494</td><td>1.000</td><td>0.515</td><td>0.509</td></tr><tr><td>object animacy</td><td>0.507</td><td>0.498</td><td>0.501</td><td>0.507</td><td>1.000</td></tr><tr><td rowspan="4">Sheared-Llama (Bi + MNTP)</td><td>subject animacy</td><td>0.518</td><td>1.000</td><td>0.493</td><td>0.518</td><td>0.494</td></tr><tr><td>verb causative</td><td>0.511</td><td>0.535</td><td>1.000</td><td>0.511</td><td>0.522</td></tr><tr><td>verb dynamic</td><td>0.515</td><td>0.497</td><td>1.000</td><td>0.485</td><td>0.513</td></tr><tr><td>object animacy</td><td>0.507</td><td>0.514</td><td>0.498</td><td>0.507</td><td>1.000</td></tr></table>
453
+
454
+ Table 15: This table presents the accuracy of three semantic features in Task 1 without giving context.
455
+
456
+ <table><tr><td>Model</td><td>Context</td><td>Task2-T</td><td>Task2-D</td><td>Task3-P</td><td>T3-S</td><td>Task4-P</td><td>T4-S</td></tr><tr><td rowspan="2">BERT-base</td><td>with</td><td>0.8286</td><td>0.9167</td><td>0.8215</td><td>0.7971</td><td>0.6706</td><td>0.5916</td></tr><tr><td>without</td><td>0.7480</td><td>0.8302</td><td>0.7105</td><td>0.6874</td><td>0.5405</td><td>0.5015</td></tr><tr><td rowspan="2">Sheared-Llama</td><td>with</td><td>0.8235</td><td>0.9074</td><td>0.8219</td><td>0.7946</td><td>0.6408</td><td>0.5785</td></tr><tr><td>without</td><td>0.7531</td><td>0.8364</td><td>0.7270</td><td>0.7075</td><td>0.5880</td><td>0.5403</td></tr><tr><td rowspan="2">Sheared-Llama (Bi + MNTP)</td><td>with</td><td>0.7653</td><td>0.8750</td><td>0.7157</td><td>0.7079</td><td>0.5788</td><td>0.4976</td></tr><tr><td>without</td><td>0.7367</td><td>0.8318</td><td>0.7034</td><td>0.6830</td><td>0.5714</td><td>0.5278</td></tr></table>
457
+
458
+ Table 16: This table presents a comparison of accuracy in Task 2, 3, 4 and 5 with and without giving context. T and D in Task 2 denote Telicity and Duration, and P and S in Task 3 and 4 represent the Pearson and Spearman.
2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d386144e47f0502fc3d7bdd30e97365a0218de0b40e4da2e60071c2c480322b
3
+ size 1931780
2025/Learning to Look at the Other Side_ A Semantic Probing Study of Word Embeddings in LLMs with Enabled Bidirectional Attention/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/d966b76a-c5ec-4137-af5f-9b97e38c6c1a_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/d966b76a-c5ec-4137-af5f-9b97e38c6c1a_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/d966b76a-c5ec-4137-af5f-9b97e38c6c1a_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44dfd055bc4e35c90487d5d1d78431b272ff21a8fc9bdc7119f4cb8689b3b6c2
3
+ size 518336
2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/full.md ADDED
@@ -0,0 +1,418 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Learning to Reason Over Time: Timeline Self-Reflection for Improved Temporal Reasoning in Language Models
2
+
3
+ Adrián Bazaga*
4
+ University of Cambridge
5
+ ar989@cam.ac.uk
6
+
7
+ Bill Byrne Amazon AGI willbyrn@amazon.com
8
+
9
+ Rexhina Blloshmi Amazon AGI blloshmi@amazon.com
10
+
11
+ Adrià de Gispert
12
+ Amazon AGI
13
+ agispert@amazon.com
14
+
15
+ # Abstract
16
+
17
+ Large Language Models (LLMs) have emerged as powerful tools for generating coherent text, understanding context, and performing reasoning tasks. However, they struggle with temporal reasoning, which requires processing time-related information such as event sequencing, durations, and inter-temporal relationships. These capabilities are critical for applications including question answering, scheduling, and historical analysis. In this paper, we introduce TISER, a novel framework that enhances the temporal reasoning abilities of LLMs through a multi-stage process that combines timeline construction with iterative self-reflection. Our approach leverages test-time scaling to extend the length of reasoning traces, enabling models to capture complex temporal dependencies more effectively. This strategy not only boosts reasoning accuracy but also improves the traceability of the inference process. Experimental results demonstrate state-of-the-art performance across multiple benchmarks, including out-of-distribution test sets, and reveal that TISER enables smaller open-source models to surpass larger closed-weight models on challenging temporal reasoning tasks. $^{1}$
18
+
19
+ # 1 Introduction
20
+
21
+ Temporal reasoning, defined as the ability to interpret and manipulate time-related information, is a fundamental aspect of human cognition that underpins language understanding, planning, forecasting, and the interpretation of sequences, durations, and temporal relationships (Vashishtha et al., 2020; Huang and Chang, 2023; Min et al., 2023). In natural language processing (NLP), effective temporal reasoning is critical for applications such as question answering (QA) (Zhao et al., 2024), event prediction (Dhingra et al., 2021), narrative understanding (Min et al., 2023), and retrieval-augmented
22
+
23
+ *Work done during an internship at Amazon. Now at Microsoft.
24
+ <sup>1</sup>Data available at https://github.com/amazon-science/TISER.
25
+
26
+ generation (RAG) (Lewis et al., 2020). However, despite the remarkable advances of large language models (LLMs) in a wide range of tasks, achieving accurate and robust reasoning over temporal contexts remains a significant challenge (Zhou et al., 2019; Wang and Zhao, 2024; Su et al., 2024; Qiu et al., 2024).
27
+
28
+ Recent benchmarks, such as TRAM (Wang and Zhao, 2024) and TimeBench (Chu et al., 2024), have underscored the difficulties LLMs face in handling complex temporal queries. In many cases, even state-of-the-art models produce inconsistent inferences or fail to accurately track the sequential order of events. Traditional approaches to improving temporal reasoning have relied on prompt engineering (Wei et al., 2023; Zhang et al., 2024a), supervised fine-tuning (Li et al., 2023; Qian et al., 2024), specialized pre-training (Tan et al., 2023), or mathematical reasoning modules (Su et al., 2024).
29
+
30
+ Inspired by recent advancements in test-time scaling of LLMs for reasoning tasks (Muennighoff et al., 2025; DeepSeek-AI, 2025), we propose a novel paradigm for adapting LLMs to temporal reasoning through test-time scaling. Our framework, TISER, incorporates a multi-stage inference pipeline that combines explicit reasoning, timeline construction, and iterative self-reflection. The key idea behind our approach is to empower LLMs to adapt by scaling their internal reasoning process during inference. TISER enables models to systematically organize temporal information, verify their inferences, and refine their outputs. This approach not only enhances temporal reasoning accuracy but also improves traceability by making the intermediate reasoning steps explicit. Our contributions are as follows:
31
+
32
+ - We introduce TISER, a novel framework that adapts LLMs for test-time temporal reasoning via a multi-stage process encompassing reasoning, explicit timeline construction, and
33
+
34
+ self-reflection.
35
+
36
+ - We construct a synthetic dataset that augments existing temporal reasoning benchmarks with detailed intermediate reasoning traces, enabling effective test-time adaptation.
37
+ - We demonstrate that fine-tuning and test-time scaling using TISER achieves state-of-the-art temporal reasoning performance on multiple benchmarks, including TGQA (Xiong et al., 2024), TempReason (Tan et al., 2023), and TimeQA (Chen et al., 2021).
38
+ - We evaluate the fine-tuned LLMs on out-of-distribution benchmarks such as MultiHopRAG (Tang and Yang, 2024) and Test-of-Time (ToT) (Fatemi et al., 2024), demonstrating that our approach preserves performance on standard queries while boosting accuracy on time-based ones.
39
+
40
+ # 2 TISER
41
+
42
+ # 2.1 Temporal Self-Reflective Prompting
43
+
44
+ In order to enhance temporal reasoning in large language models (LLMs), we introduce Temporal Self-Reflective Prompting (TISER). This strategy advances traditional Chain-of-Thought (CoT) prompting by explicitly decomposing the temporal reasoning process into multiple stages, each designed to progressively refine the model's internal representation and final output. The key innovation of TISER lies in its integration of explicit timeline construction and self-reflection for test-time scaling, which collectively mitigate typical errors in temporal inference and improve both the traceability and robustness of the reasoning process.
45
+
46
+ As detailed in Algorithm 1, TISER processes a given question $q$ and its associated temporal context $c$ through four interdependent stages, each building upon the previous one:
47
+
48
+ Stage I (Reasoning): The model initiates the process by generating a preliminary chain-of-thought reasoning trace, denoted as $r$ , based on the question $q$ and the temporal context $c$ . This initial reasoning encapsulates the model's raw inference process and prepares the groundwork for further refinement.
49
+
50
+ Stage II (Timeline Construction): In this stage, the algorithm identifies and extracts salient temporal events from both the reasoning trace $r$ and the context $c$ . These events are then organized into a
51
+
52
+ Algorithm 1 Temporal Self-Reflective Prompting
53
+
54
+ Input: Question $q$ , Temporal context $c$
55
+
56
+ Output: Final answer $a$
57
+
58
+ 1: // Stage I: Reasoning
59
+ 2: Generate an initial reasoning trace $r$ for $q$ based on context $c$ .
60
+ 3:
61
+ 4: repeat
62
+ 5: // Stage II: Timeline Construction
63
+ 6: Extract relevant temporal events from $r$ and $c$ .
64
+ 7: Organize the extracted events into an ordered timeline $t$ .
65
+ 8:
66
+ 9: // Stage III: Reflection
67
+ 10: Analyze $r$ in conjunction with timeline $t$ to detect inconsistencies or errors.
68
+ 11: Revise the reasoning trace to produce an improved version $r'$ .
69
+ 12:
70
+ 13: Set $r \gets r'$
71
+ 14: until the revised reasoning $r'$ and timeline $t$ are consistent and satisfactory
72
+ 15:
73
+ 16: // Stage IV: Answer Generation
74
+ 17: Generate the final answer $a$ using the refined reasoning $r'$ and timeline $t$ .
75
+ 18: return a
76
+
77
+ coherent, ordered timeline $t$ , which serves as an explicit representation of the temporal structure inherent in the problem. By grounding the reasoning in a structured timeline, the model can more clearly delineate the sequence and interdependencies of events.
78
+
79
+ Stage III (Reflection): The model then engages in a self-reflective process, comparing the initial reasoning trace $r$ with the constructed timeline $t$ . This stage is critical for detecting and rectifying inconsistencies, ambiguities, or omissions in the initial reasoning. The reflection yields a refined reasoning trace $r'$ , representing an improved and self-verified version of the original inference.
80
+
81
+ Stage IV (Answer Generation): Finally, leveraging the refined reasoning $r'$ and the explicit timeline $t$ , the model generates the final, concise answer $a$ . This final output is expected to be both accurate and logically coherent, as it has benefited from iterative error correction and temporal grounding.
82
+
83
+ By explicitly segmenting the reasoning process into these four interdependent stages, TISER al
84
+
85
+ ![](images/fd1c06d7d40d71338032b06306e43bb0578164cf6e36f682060cb32ff52b1c4f.jpg)
86
+ Figure 1: High-level overview of TISER (right) compared to other prompting strategies such as standard prompting or CoT without test-time scaling (bottom left) for a given question and temporal context (upper left). In contrast to standard prompting and CoT, our method leverages test-time compute scaling for reasoning, timeline construction, and reflection, leading to more accurate answers. The model used for inference in this example is Qwen2.5-7B.
87
+
88
+ lows for iterative improvement and facilitates a more robust understanding of complex temporal relationships, ultimately leading to more precise and reliable answers. In Figure 1 we illustrate an end-to-end example with TISER reasoning.
89
+
90
+ # 2.2 Dataset Construction
91
+
92
+ To adapt our models for test-time scaling on temporal reasoning tasks, we construct a high-quality dataset that augments existing temporal reasoning datasets with intermediate reasoning traces, which we use for fine-tuning. Each sample in the dataset comprises a question $q$ , its corresponding gold-standard answer $a$ , and a temporal context $c$ . We generate intermediate reasoning steps using any off-the-shelf LLM for synthetic data generation, such as DeepSeek or GPT-4o, guided by the TISER prompt framework to ensure consistent response formatting<sup>2</sup>. In particular, the generated traces include a reasoning sequence $r$ , an ordered timeline of events $t$ , and a reflective verification $f$ . Since each question is paired with a verified gold answer, the generator LLM is encouraged to reason through problems using a temporally consistent process to arrive at the final correct 'gold' answer.
93
+
94
+ To ensure dataset quality, we apply a filtering
95
+
96
+ procedure that retains only those samples for which the final answer $a'$ produced from the intermediate reasoning trace matches the gold answer $a$ . Samples that do not pass this consistency check are discarded. The overall dataset construction process is summarized in Algorithm 2. Detailed quality metrics for the generated dataset are provided in Appendix A.
97
+
98
+ # 2.3 Fine-tuning for Temporal Reasoning
99
+
100
+ We employ a standard supervised fine-tuning (SFT) procedure using Low-Rank Adaptation (LoRA) (Hu et al., 2022) to finetune the base models. We train our models using the dataset constructed according to the TISER framework described in Section 2.2. Specifically, the generated outputs adhere to a defined template: a step-by-step chain-of-thought is enclosed within <reasoning> tags, an ordered summary of relevant temporal events is provided within <timeline> tags, the model's self-reflection and verification are captured within <reflection> tags, and the final concise answer is delimited by <answer> tags. Further details regarding the fine-tuning process are provided in Appendix I.
101
+
102
+ <table><tr><td rowspan="2">Model</td><td rowspan="2">Inference</td><td colspan="2">TGQA</td><td colspan="2">TempReason (L2)</td><td colspan="2">TempReason (L3)</td><td colspan="2">TimeQA (easy)</td><td colspan="2">TimeQA (hard)</td><td colspan="2">Macro Avg.</td></tr><tr><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td></tr><tr><td colspan="14">Closed LLMs</td></tr><tr><td>GPT-4</td><td>Standard</td><td>72.5</td><td>82.5</td><td>78.6</td><td>86.2</td><td>81.9</td><td>88.3</td><td>83.6</td><td>93.7</td><td>76.0</td><td>85.3</td><td>78.5</td><td>87.2</td></tr><tr><td>GPT-4</td><td>TISER</td><td>82.8</td><td>93.4</td><td>79.8</td><td>87.2</td><td>84.7</td><td>91.3</td><td>84.4</td><td>90.5</td><td>77.2</td><td>86.4</td><td>81.8</td><td>89.8</td></tr><tr><td colspan="14">Literature</td></tr><tr><td>T5-large†</td><td>Standard</td><td>54.8</td><td>71.3</td><td>32.7</td><td>50.9</td><td>28.8</td><td>46.8</td><td>63.1</td><td>71.6</td><td>59.5</td><td>68.1</td><td>47.8</td><td>61.7</td></tr><tr><td>Temp-T5†</td><td>Standard</td><td>64.0</td><td>77.8</td><td>31.8</td><td>49.6</td><td>26.1</td><td>43.0</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>REMEMO-large†</td><td>Standard</td><td>46.1</td><td>66.0</td><td>37.4</td><td>54.9</td><td>33.4</td><td>49.3</td><td>63.7</td><td>72.3</td><td>60.5</td><td>69.3</td><td>48.2</td><td>62.4</td></tr><tr><td>TG-LLM†</td><td>CoT</td><td>79.7</td><td>85.0</td><td>42.4</td><td>52.2</td><td>35.6</td><td>46.9</td><td>66.4</td><td>69.1</td><td>63.1</td><td>66.4</td><td>57.4</td><td>63.9</td></tr><tr><td colspan="14">Open LLMs - Off-the-Shelf</td></tr><tr><td>Mistral-7B</td><td>Standard</td><td>15.1</td><td>18.6</td><td>22.0</td><td>24.1</td><td>0.1</td><td>2.3</td><td>51.8</td><td>55.2</td><td>37.0</td><td>39.0</td><td>25.2</td><td>27.8</td></tr><tr><td>Qwen2.5-7B</td><td>Standard</td><td>46.1</td><td>48.9</td><td>51.0</td><td>53.6</td><td>40.1</td><td>42.7</td><td>70.9</td><td>73.5</td><td>53.2</td><td>55.8</td><td>52.3</td><td>55.0</td></tr><tr><td>Mistral-7B</td><td>TISER</td><td>22.4</td><td>24.7</td><td>20.8</td><td>23.6</td><td>36.8</td><td>38.9</td><td>43.3</td><td>46.1</td><td>22.1</td><td>25.3</td><td>29.1</td><td>31.7</td></tr><tr><td>Qwen2.5-7B</td><td>TISER</td><td>48.1</td><td>50.6</td><td>55.2</td><td>58.2</td><td>51.6</td><td>54.2</td><td>66.1</td><td>68.6</td><td>55.2</td><td>57.7</td><td>55.3</td><td>57.9</td></tr><tr><td colspan="14">Open LLMs - Fine-tuned (training data using standard prompting)</td></tr><tr><td>Mistral-7B</td><td>Standard</td><td>18.3</td><td>21.2</td><td>25.4</td><td>27.5</td><td>9.3</td><td>12.8</td><td>55.6</td><td>59.1</td><td>41.2</td><td>44.3</td><td>31.7</td><td>34.5</td></tr><tr><td>Qwen2.5-7B</td><td>Standard</td><td>48.6</td><td>51.7</td><td>54.0</td><td>56.6</td><td>44.2</td><td>46.7</td><td>74.1</td><td>76.9</td><td>56.1</td><td>58.7</td><td>55.4</td><td>57.3</td></tr><tr><td colspan="14">Open LLMs - Fine-tuned (TISER training data generated using DeepSeek V2.5)</td></tr><tr><td>Mistral-7B</td><td>Standard</td><td>48.7</td><td>52.4</td><td>49.3</td><td>51.0</td><td>60.8</td><td>63.2</td><td>61.4</td><td>62.5</td><td>59.2</td><td>60.7</td><td>55.7</td><td>57.9</td></tr><tr><td>Qwen2.5-7B</td><td>Standard</td><td>53.9</td><td>56.6</td><td>49.2</td><td>51.9</td><td>39.6</td><td>41.9</td><td>68.4</td><td>70.7</td><td>51.1</td><td>53.4</td><td>52.4</td><td>54.9</td></tr><tr><td>Mistral-7B</td><td>TISER</td><td>76.3</td><td>84.0</td><td>78.5</td><td>80.1</td><td>83.0</td><td>86.6</td><td>94.2</td><td>95.2</td><td>91.4</td><td>92.5</td><td>85.6</td><td>89.9</td></tr><tr><td>Qwen2.5-7B</td><td>TISER</td><td>79.4</td><td>86.8</td><td>84.7</td><td>86.6</td><td>89.9</td><td>91.7</td><td>87.6</td><td>89.8</td><td>81.2</td><td>89.7</td><td>84.6</td><td>88.9</td></tr><tr><td colspan="14">Open LLMs - Fine-tuned (TISER training data generated using GPT-4)</td></tr><tr><td>Mistral-7B</td><td>Standard</td><td>52.9</td><td>57.0</td><td>55.9</td><td>57.2</td><td>64.3</td><td>66.7</td><td>64.4</td><td>65.5</td><td>62.9</td><td>64.0</td><td>60.1</td><td>62.1</td></tr><tr><td>Qwen2.5-7B</td><td>Standard</td><td>58.5</td><td>60.8</td><td>53.0</td><td>55.6</td><td>43.0</td><td>45.2</td><td>72.6</td><td>74.8</td><td>54.5</td><td>56.8</td><td>54.3</td><td>57.0</td></tr><tr><td>Mistral-7B</td><td>TISER</td><td>80.5</td><td>87.4</td><td>82.5</td><td>84.3</td><td>87.1</td><td>88.5</td><td>97.5</td><td>98.5</td><td>95.9</td><td>96.4</td><td>88.7</td><td>91.0</td></tr><tr><td>Qwen2.5-7B</td><td>TISER</td><td>84.5</td><td>94.2</td><td>85.5</td><td>87.5</td><td>91.5</td><td>94.9</td><td>97.9</td><td>98.3</td><td>96.1</td><td>97.2</td><td>91.1</td><td>94.4</td></tr></table>
103
+
104
+ Table 1: Exact Match (EM) and token-level F1 results on in-domain test sets. Fine-tuned models are trained on the joint training dataset, while evaluation is done on separate test splits. The Inference column gives the prompting strategy used in evaluation. Results with $\dagger$ are reported in the original papers
105
+
106
+ # Algorithm 2 Dataset Construction with Intermediate Reasoning Traces
107
+
108
+ Input: Collection of samples $\mathcal{D}$ containing $(q,a,c)$ from an existing temporal reasoning dataset.
109
+
110
+ Output: Augmented dataset $\mathcal{D}^*$ with intermediate reasoning traces.
111
+
112
+ 1: for each sample $(q, a, c) \in \mathcal{D}$ do
113
+ 2: Generate an intermediate reasoning trace containing: reasoning $r$ , timeline $t$ , and reflection $f$ .
114
+ 3: Given $r, t$ and $f$ , generate an answer $a'$ to the question $q$ with the context $c$ .
115
+ 4: if $a' = a$ then
116
+ 5: Add sample $(q, a, c, r, t, f)$ to $\mathcal{D}^*$ .
117
+ 6: else
118
+ 7: Discard sample.
119
+ 8: end if
120
+ 9: end for
121
+ 10: return $\mathcal{D}^*$
122
+
123
+ # 3 Experiments
124
+
125
+ We evaluate TISER on a range of closed and open LLMs, with and without fine tuning, on multiple temporal reasoning benchmarks along with a more general RAG downstream task.
126
+
127
+ # 3.1 Experimental Setup
128
+
129
+ Datasets. The training dataset is derived from a combination of existing temporal reasoning benchmarks, including TGQA $^3$ (Xiong et al., 2024), TempReason $^4$ (Tan et al., 2023), and TimeQA $^5$ (Chen et al., 2021). We apply our dataset construction method described in Section 2.2 to create the final training examples. Fine-tuning was conducted on the individual datasets, as well as a joint dataset combining all of them. We evaluate on the test splits of TGQA, TempReason and TimeQA,
130
+
131
+ which we refer to as in-domain evaluation. These datasets cover a range of temporal reasoning challenges, such as temporal event ordering and duration calculations. We also evaluate on the ToT benchmark $^{6}$ (Fatemi et al., 2024) and MultiHopRAG $^{7}$ (Tang and Yang, 2024) to assess the benefits of TISER in the out-of-distribution scenario and QA downstream tasks. Details and examples are in Appendix B.
132
+
133
+ Metrics. We evaluate models using Exact Match (EM), which measures the percentage of predictions that exactly match the ground truth, and token-level F1 scores. These metrics are particularly suited for temporal reasoning tasks, where precision is critical for accurate event alignment and inference.
134
+
135
+ Models. Our experiments compare the performance of closed LLMs (e.g., GPT-4o) and open LLMs (e.g., Mistral-7B, Qwen2.5-7B) under different settings: 1) using standard prompts, i.e., baseline performance using the original prompts from each test set, without reasoning (see Appendix D for an example), 2) using TISER prompt, i.e., applying our proposed reasoning, timeline construction and self-reflection strategy during inference only or also fine-tuning. We include both off-the-shelf and fine-tuned configurations of open-source models to assess the relative contributions of TISER during fine-tuning and inference.
136
+
137
+ Implementation details. We use Qwen2.5-7B and Mistral-7B as our main open models, and GPT $40^8$ via API for closed-model evaluations. Open models are fine-tuned via SFT using the Hugging Face Transformers library on 8x NVIDIA A100 GPUs. As discussed in Section 2.2, the TISER dataset can be constructed using any off-the-shelf LLM. For our experiments, we evaluate GPT-40 and DeepSeek V2.5 as generators for the self-reflection examples of temporal reasoning.
138
+
139
+ # 3.2 Main Results
140
+
141
+ Effectiveness of TISER Prompting across models. TISER prompting enables off-the-shelf models to tackle complex temporal reasoning tasks more effectively in many cases, with substantial improvements in several benchmarks. As shown
142
+
143
+ in Table 1, Qwen2.5-7B shows a notable increase in accuracy from $51.0\%$ to $55.2\%$ on TempReason (L2) and from $40.1\%$ to $51.6\%$ on TempReason (L3) when using TISER prompting compared to standard prompting. This improvement highlights the value of TISER prompting in enhancing reasoning and temporal coherence in models that otherwise struggle with these tasks. However, TISER prompting itself does not consistently improve performance in all datasets. For example, Mistral-7B achieves a higher accuracy in TempReason (L2) with standard prompting $(22.0\%)$ compared to TISER prompting $(20.8\%)$ . This discrepancy may be due to the fact that these models are not specifically trained to follow the self-reflection framework proposed in TISER, so they cannot use TISER prompting to improve reasoning and temporal alignment in their responses. These results suggest that even without fine-tuning, TISER prompting can enhance performance in certain contexts. Nevertheless, the benefits of TISER prompting are more consistent and significantly pronounced when models are fine-tuned with the TISER strategy.
144
+
145
+ Performance of Open LLMs: Baselines vs TISER strategy. The open LLMs examined in this study show varied baseline performance but all benefit substantially from the application of TISER prompting, particularly when TISER is used during both training (fine-tuning) and inference. For example, Mistral-7B's TGQA score increases from $15.1\%$ to $80.5\%$ , and its macro average improves from $25.2\%$ to $88.7\%$ , demonstrating how TISER enables smaller models to rival larger ones. Similarly, Qwen2.5-7B achieves a significant increase in accuracy on temporal reasoning-heavy datasets, reaching $85.5\%$ on TempReason (L2) and $91.5\%$ on TempReason (L3), with its macro-average going up from $57.9\%$ to $91.1\%$ , outperforming competitive models across multiple datasets. In addition, the current state-of-the-art, TG-LLM (Xiong et al., 2024), while performing well on datasets such as TGQA $(79.7\%)$ , struggles with other temporal reasoning tasks, with accuracy dropping to $42.4\%$ on TempReason (L2) and $35.6\%$ on TempReason (L3). The macro average of TG-LLM of $57.4\%$ underscores its limitations, especially compared to models that leverage TISER prompting. These findings highlight that the integrated training and inference approach of TISER not only increases performance in temporal and reasoning-intensive tasks but also enables the models to handle a wider range of com
146
+
147
+ <table><tr><td>Training subset</td><td>TGQA</td><td>TempReason (L2)</td><td>TempReason (L3)</td><td>TimeQA (easy)</td><td>TimeQA (hard)</td><td>Macro Avg.</td></tr><tr><td>TGQA</td><td>80.5</td><td>61.5</td><td>77.9</td><td>76.1</td><td>63.5</td><td>72.5</td></tr><tr><td>TempReason (L2)</td><td>55.1</td><td>81.5</td><td>80.5</td><td>82.5</td><td>75.5</td><td>74.6</td></tr><tr><td>TempReason (L3)</td><td>50.1</td><td>81.0</td><td>81.7</td><td>80.1</td><td>70.9</td><td>73.2</td></tr><tr><td>TimeQA (easy)</td><td>46.3</td><td>72.4</td><td>73.4</td><td>92.8</td><td>78.6</td><td>72.5</td></tr><tr><td>TimeQA (hard)</td><td>47.8</td><td>81.3</td><td>75.5</td><td>93.0</td><td>91.1</td><td>77.6</td></tr><tr><td>all (TISER dataset)</td><td>84.5</td><td>85.5</td><td>91.5</td><td>97.9</td><td>96.1</td><td>91.1</td></tr></table>
148
+
149
+ plexities more effectively than current models.
150
+
151
+ Comparison of Closed vs. Open LLMs. In their baseline configurations, closed models like GPT-4o generally outperform open models like Mistral-7B and Qwen2.5-7B, especially when only standard prompting is applied during inference. However, when TISER is used during both training and inference to fine-tune open models, the performance gap narrows significantly. In some cases, such as in TempReason (L3), Qwen2.5-7B surpasses GPT-4o, reaching $91.5\%$ compared to GPT-4o's $84.7\%$ . This demonstrates the potential for open models to outperform closed models when they are fine-tuned with our proposed strategy.
152
+
153
+ Performance Across Training Subsets vs Joint Dataset. Table 2 reports the results after independently fine-tuning the Qwen2.5-7B model on different training subsets and evaluating its performance on multiple test sets. Performance is calculated in terms of EM across all test sets, with the best score for each test set highlighted in bold. The training subsets represent individual or combined datasets used for fine-tuning, while the evaluation spans several reasoning datasets, including TGQA, TempReason (L2 and L3), and TimeQA (easy and hard). The macro average column provides an overall performance summary across all datasets. Fine-tuning the model on the combined dataset that includes all subsets produces the best macro average performance, achieving a score of $91.1\%$ , highlighting the effectiveness of training on a diverse set of reasoning tasks. The joint fine-tuning approach enables the model to achieve best performance for all individual tasks, including $91.5\%$ in TempReason (L3), $97.9\%$ in TimeQA (easy) and $96.1\%$ in TimeQA (hard). These results consistently surpass those achieved through fine-tuning in individual subsets, where performance tended to vary and was often lower across test sets. For example, fine-tuning on individual subsets such as TGQA,
154
+
155
+ Table 2: Exact Match (%) results after fine-tuning Qwen2.5-7B independently on different training subsets (first column) using TISER prompt. Bold text indicates best performance for that particular test set (column).
156
+
157
+ <table><tr><td rowspan="2">Model</td><td colspan="3">Question Type</td></tr><tr><td>Inference</td><td>Comparison</td><td>Temporal</td></tr><tr><td colspan="4">Closed LLMs</td></tr><tr><td>GPT-4</td><td>89.7</td><td>77.5</td><td>61.9</td></tr><tr><td colspan="4">Open LLMs - Off-the-Shelf</td></tr><tr><td>Mistral-7B</td><td>8.7</td><td>15.9</td><td>12.0</td></tr><tr><td>Qwen2.5-7B</td><td>30.5</td><td>25.0</td><td>14.8</td></tr><tr><td colspan="4">Open LLMs - Fine-tuned (TISER data generated using GPT-4)</td></tr><tr><td>Mistral-7B</td><td>29.2</td><td>21.6</td><td>27.3</td></tr><tr><td>Qwen2.5-7B</td><td>31.8</td><td>30.0</td><td>33.5</td></tr></table>
158
+
159
+ Table 3: Exact Match (%) results on a broad-domain RAG task (MultiHopRAG). Performance is reported by question type (inference, comparison, and temporal) using a single standard prompt for all questions vs. a prompt per question type as in MultiHopRAG paper.
160
+
161
+ TempReason (L2), and TempReason (L3) resulted in lower performance on several test sets, particularly in TGQA and TempReason (L2). Although subset-specific fine-tuning can lead to specialization on certain tasks, such as TempReason (L2) scoring $81.5\%$ on TempReason (L2), it struggles to generalize effectively across diverse reasoning datasets. Similarly, the TempReason (L3) subset showed moderate performance but fell short compared to the combined dataset, scoring $81.7\%$ in TempReason (L3) and a macro average of $73.2\%$ .
162
+
163
+ # 3.3 Out-of-Distribution Results
164
+
165
+ Table 3 showcases a detailed analysis of model performance on the MultiHopRAG benchmark with standard prompting ${}^{9}$ ,comparing multiple models across various question types (Inference,Comparison,and Temporal) using Exact Match accuracy as the metric.
166
+
167
+ GPT-4o excels in inference (89.7%), comparison (77.5%) and temporal (61.9%) queries, highlighting its robust comprehension capabilities. Among open-source models, Qwen2.5-7B (TISER) shows
168
+
169
+ <table><tr><td>Setting</td><td>TGQA</td><td>TempReason (L2)</td><td>TempReason (L3)</td><td>TimeQA (easy)</td><td>TimeQA (hard)</td><td>Macro Avg.</td></tr><tr><td>No reasoning</td><td>74.2</td><td>80.8</td><td>84.7</td><td>85.9</td><td>89.8</td><td>73.5</td></tr><tr><td>No timeline construction</td><td>73.5</td><td>80.6</td><td>84.2</td><td>86.5</td><td>86.9</td><td>72.8</td></tr><tr><td>No reflection</td><td>71.8</td><td>79.3</td><td>83.6</td><td>84.2</td><td>81.0</td><td>70.5</td></tr><tr><td>Only reasoning</td><td>62.0</td><td>63.7</td><td>69.1</td><td>77.0</td><td>80.1</td><td>70.0</td></tr><tr><td>Only timeline construction</td><td>59.8</td><td>61.5</td><td>66.1</td><td>75.5</td><td>78.2</td><td>68.0</td></tr><tr><td>Standard prompt</td><td>58.5</td><td>53.0</td><td>43.0</td><td>72.6</td><td>54.5</td><td>54.3</td></tr><tr><td>All stages (TISER prompt)</td><td>84.5</td><td>85.5</td><td>91.5</td><td>97.9</td><td>96.1</td><td>91.1</td></tr></table>
170
+
171
+ Table 4: Impact of removing reasoning, timeline construction, and reflection components on various temporal reasoning benchmarks.
172
+
173
+ <table><tr><td>Model</td><td>Inference Prompt</td><td>Exact Match (%)</td></tr><tr><td colspan="3">Closed LLMs</td></tr><tr><td rowspan="2">GPT-4</td><td>Standard</td><td>63.3</td></tr><tr><td>TISER</td><td>72.2</td></tr><tr><td colspan="3">Open LLMs - Off-the-Shelf</td></tr><tr><td rowspan="2">Mistral-7B</td><td>Standard</td><td>10.1</td></tr><tr><td>TISER</td><td>15.5</td></tr><tr><td rowspan="2">Qwen2.5-7B</td><td>Standard</td><td>18.0</td></tr><tr><td>TISER</td><td>22.5</td></tr><tr><td colspan="3">Open LLMs - Fine-tuned (TISER data generated using GPT-4)</td></tr><tr><td rowspan="2">Mistral-7B</td><td>Standard</td><td>44.4</td></tr><tr><td>TISER</td><td>66.3</td></tr><tr><td rowspan="2">Qwen2.5-7B</td><td>Standard</td><td>45.7</td></tr><tr><td>TISER</td><td>68.5</td></tr></table>
174
+
175
+ Table 5: Performance in Test-of-Time (ToT), an out-of-distribution symbolic temporal reasoning benchmark.
176
+
177
+ the most significant improvements, reaching a performance of $31.8\%$ , $30\%$ and $33.5\%$ on inference, comparison and temporal queries, respectively. The improvements are primarily driven by enhanced performance on temporal queries compared to its baseline counterpart. Therefore, the TISER fine-tuning approach, applied to Mistral-7B and Qwen2.5-7B, contributes notable gains, especially in the temporal category, adopting models for complex reasoning in broad-domain RAG tasks without performance degradation.
178
+
179
+ Table 5 illustrates the effectiveness of various prompting strategies, particularly TISER, on the Test-of-Time (ToT) dataset (Fatemi et al., 2024), an out-of-distribution and symbolic temporal reasoning benchmark. GPT-4o demonstrates strong performance with TISER prompting, reaching an EM score of $72.2\%$ , again underscoring the benefit of using our prompting strategy to handle complex temporal queries. Among open LLMs, Mistral-7B and Qwen2.5-7B models show substantial performance gains when using TISER prompting strategies. In particular, Qwen2.5-7B achieves an EM of
180
+
181
+ $68.5\%$ after TISER fine-tuning, the highest among open models, improving symbolic reasoning abilities over time beyond pure semantic reasoning (Pan et al., 2023).
182
+
183
+ # 3.4 Ablation Study
184
+
185
+ Table 4 summarizes our ablation study, which quantifies the impact of each component in our prompting strategy on temporal reasoning performance. The baseline prompt, i.e., Standard Prompt, which does not perform reasoning, timeline construction, and reflection, produces a low macro average of $54.3\%$ , highlighting limited performance in complex reasoning tasks. Indeed, the lowest score is attained in the TempReason (L3) dataset, which suggests that more sophisticated reasoning is needed to solve this task. Adding components progressively improves performance; i) reasoning alone achieves a macro average of $70.0\%$ and ii) timeline construction alone reaches $68.0\%$ . Removing components progressively, i.e., no reasoning, no timeline construction, or no reflection, shows that reflection is the most important stage among the three. Reflection significantly boosts performance, as the prompt variant with reasoning and timeline construction but without reflection achieves $70.5\%$ . Therefore, the highest macro average of $91.1\%$ is observed with the full prompt that combines all stages including reflection.
186
+
187
+ A key design decision in our framework is the ordering of these components. Rather than deriving a timeline directly from the question, we position timeline construction as the second stage, following an initial reasoning process. The results in Table 4 indicate that generating a preliminary reasoning trace is essential for identifying relevant temporal events and establishing contextual relationships. This, in turn, enables the model to construct a more coherent and accurate timeline in the subsequent stage. Overall, the sequential process of initial reasoning, followed by timeline construction
188
+
189
+ and self-reflection, yields superior performance on temporal inference tasks compared to alternative ordering strategies.
190
+
191
+ # 4 Related Work
192
+
193
+ # 4.1 Temporal Reasoning with LLMs
194
+
195
+ Temporal reasoning in NLP has been a subject of extensive study, with early efforts concentrating on tasks such as temporal expression extraction and temporal relation identification (Verhagen et al., 2007; Kougia et al., 2024). The advent of large language models (LLMs) has shifted the focus toward more complex tasks such as temporal question answering and event forecasting (Dhingra et al., 2021; Qiu et al., 2024). Benchmarks like TempReason (Tan et al., 2023), TRAM (Wang and Zhao, 2024), and TimeBench (Chu et al., 2024) have revealed that LLMs continue to struggle with nuanced temporal understanding, including multistage reasoning, event ordering, and duration calculations. Recent work has demonstrated that test-time scaling, which involves extending the CoT reasoning process during inference, can dramatically improve overall reasoning capabilities (DeepSeek-AI, 2025). However, while these approaches have enhanced general reasoning performance, no prior work has applied test-time scaling specifically to temporal reasoning tasks.
196
+
197
+ # 4.2 Self-Reflection with LLMs
198
+
199
+ Self-reflection is an essential component of human cognition and represents a particular case of CoT reasoning (Wei et al., 2022) that involves reviewing and reassessing intermediate reasoning steps to enhance understanding and correctness (Chen et al., 2024; Wang et al., 2023). Previous research has primarily focused on applying reflective techniques to improve performance on mathematical and logical reasoning tasks. For instance, Zhang et al. (2024b) introduced Reflective Augmentation (RefAug), which appends reflective reasoning to training examples, thereby improving problem-solving capabilities and adaptability to complex scenarios. Other works have demonstrated the benefits of reflective strategies for error correction (Wang et al., 2024), iterative refinement (Jiang et al., 2023; Gero et al., 2023), and increased robustness against inconsistencies (Peng et al., 2023; Huang et al., 2023; Nye et al., 2021). Moreover, methods such as reverse verification (Weng et al., 2023) and selffeedback mechanisms (Madaan et al., 2023) have
200
+
201
+ been proposed to enable LLMs to rectify their responses. Inspired by these approaches, our framework is the first to integrate self-reflection and test-time scaling for temporal reasoning. This combined approach allows to adapt models to systematically organize temporal information, verify its reasoning, and refine its outputs, leading to improved consistency and traceability in complex temporal inference tasks.
202
+
203
+ # 5 Conclusion
204
+
205
+ The results presented in this study underscore the importance of self-reflection prompting and fine-tuning to advance the temporal reasoning capabilities of LLMs. TISER's integration of timeline construction and self-reflection not only enhances the consistency of model reasoning but also boosts performance on a wide array of temporal reasoning benchmarks. Notably, the framework enables smaller open-source models like Mistral-7B and Qwen2.5-7B to achieve performance levels competitive with, and in some cases superior to, larger closed models like GPT-4o. One key insight from our experiments is the role of fine-tuning with high-quality, domain-specific datasets in bridging the gap between open and closed models. The TISER dataset, tailored for temporal reasoning, played a pivotal role in enabling this success. Additionally, our results highlight the robustness of the TISER framework across varying levels of task complexity, from straightforward temporal queries to reasoning tasks involving metadata and multiple documents.
206
+
207
+ We have presented TISER, a prompting strategy and training framework that enhances temporal reasoning in LLMs through test-time scaling and a multi-stage inference process. By incorporating extended chain-of-thought reasoning, including timeline construction and self-reflection, TISER not only improves accuracy but also boosts traceability. Evaluations on benchmarks such as TGQA, TempReason, TimeQA, MultiHopRAG and ToT demonstrate significant performance gains, enabling smaller open-source models to rival or outperform closed-weight models. Notably, our work is the first to apply test-time scaling specifically to temporal reasoning.
208
+
209
+ # Limitations
210
+
211
+ While TISER achieves notable improvements in temporal reasoning, it does introduce some trade-offs. The multi-stage inference pipeline increases
212
+
213
+ the number of tokens generated at test time, leading to additional computational overhead. Moreover, our approach depends on datasets with detailed intermediate reasoning traces, which might not be readily available in every domain. Finally, TISER currently focuses exclusively on text-only temporal reasoning, leaving other forms of abstract or multimodal reasoning for future exploration. These limitations represent opportunities for further refinement.
214
+
215
+ # References
216
+
217
+ Wenhu Chen, Xinyi Wang, and William Yang Wang. 2021. A dataset for answering time-sensitive questions. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2).
218
+ Zhuo Chen, Zhao Zhang, Zixuan Li, Fei Wang, Yutao Zeng, Xiaolong Jin, and Yongjun Xu. 2024. Self-improvement programming for temporal knowledge graph question answering. In Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024), pages 14579-14594, Torino, Italia. ELRA and ICCL.
219
+ Zheng Chu, Jingchang Chen, Qianglong Chen, Weijiang Yu, Haotian Wang, Ming Liu, and Bing Qin. 2024. TimeBench: A comprehensive evaluation of temporal reasoning abilities in large language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1204-1228, Bangkok, Thailand. Association for Computational Linguistics.
220
+ DeepSeek-AI. 2025. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning.
221
+ Bhuwan Dhingra, Jeremy R. Cole, Julian Martin Eisenschlos, Daniel Gillick, Jacob Eisenstein, and William W. Cohen. 2021. Time-aware language models as temporal knowledge bases. Transactions of the Association for Computational Linguistics, 10:257-273.
222
+ Bahare Fatemi, Mehran Kazemi, Anton Tsitsulin, Karishma Malkan, Jinyeong Yim, John Palowitch, Sungyong Seo, Jonathan Halcrow, and Bryan Perozzi. 2024. Test of time: A benchmark for evaluating llms on temporal reasoning.
223
+ Zelalem Gero, Chandan Singh, Hao Cheng, Tristan Naumann, Michel Galley, Jianfeng Gao, and Hoifung Poon. 2023. Self-verification improves few-shot clinical information extraction. In ICML 3rd Workshop on Interpretable Machine Learning in Healthcare (IMLH).
224
+ Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and
225
+
226
+ Weizhu Chen. 2022. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations.
227
+ Jie Huang and Kevin Chen-Chuan Chang. 2023. Towards reasoning in large language models: A survey. In *Findings of the Association for Computational Linguistics: ACL* 2023, pages 1049–1065, Toronto, Canada. Association for Computational Linguistics.
228
+ Wenke Huang, Guancheng Wan, Mang Ye, and Bo Du. 2023. Federated graph semantic and structural learning. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, IJCAI '23.
229
+ Shuyang Jiang, Yuhao Wang, and Yu Wang. 2023. Self-evolve: A code evolution framework via large language models.
230
+ Vasiliki Kougia, Anastasiia Sedova, Andreas Joseph Stephan, Klim Zaporojets, and Benjamin Roth. 2024. Analysing zero-shot temporal relation extraction on clinical notes using temporal consistency. In Proceedings of the 23rd Workshop on Biomedical Natural Language Processing, pages 72-84, Bangkok, Thailand. Association for Computational Linguistics.
231
+ Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Kuttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. 2020. Retrieval-augmented generation for knowledge-intensive nlp tasks. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS '20, Red Hook, NY, USA. Curran Associates Inc.
232
+ Xingxuan Li, Liying Cheng, Qingyu Tan, Hwee Tou Ng, Shafiq Joty, and Lidong Bing. 2023. Unlocking temporal question answering for large language models using code execution. arXiv preprint arXiv:2305.15014.
233
+ Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, Shashank Gupta, Bodhisattwa Prasad Majumder, Katherine Hermann, Sean Welleck, Amir Yazdanbakhsh, and Peter Clark. 2023. Self-refine: Iterative refinement with self-feedback. In Thirty-seventh Conference on Neural Information Processing Systems.
234
+ Bonan Min, Hayley Ross, Elior Sulem, Amir Pouran Ben Veyseh, Thien Huu Nguyen, Oscar Sainz, Eneko Agirre, Ilana Heintz, and Dan Roth. 2023. Recent advances in natural language processing via large pre-trained language models: A survey. ACM Comput. Surv., 56(2).
235
+ Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Li Fei-Fei, Hannaneh Hajishirzi, Luke Zettlemoyer, Percy Liang, Emmanuel Candès, and Tatsunori Hashimoto. 2025. s1: Simple test-time scaling.
236
+
237
+ Maxwell Nye, Anders Johan Andreassen, Guy Gur-Ari, Henryk Michalewski, Jacob Austin, David Bieber, David Dohan, Aitor Lewkowycz, Maarten Bosma, David Luan, et al. 2021. Show your work: Scratchpads for intermediate computation with language models. arXiv preprint arXiv:2112.00114.
238
+ Liangming Pan, Alon Albalak, Xinyi Wang, and William Wang. 2023. Logic-LM: Empowering large language models with symbolic solvers for faithful logical reasoning. In *Findings of the Association for Computational Linguistics: EMNLP* 2023, pages 3806-3824, Singapore. Association for Computational Linguistics.
239
+ Baolin Peng, Michel Galley, Pengcheng He, Hao Cheng, Yujia Xie, Yu Hu, Qiuyuan Huang, Lars Liden, Zhou Yu, Weizhu Chen, and Jianfeng Gao. 2023. Check your facts and try again: Improving large language models with external knowledge and automated feedback.
240
+ Xinying Qian, Ying Zhang, Yu Zhao, Baohang Zhou, Xuhui Sui, Li Zhang, and Kehui Song. 2024. TimeR<sup>4</sup>: Time-aware retrieval-augmented large language models for temporal knowledge graph question answering. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 6942-6952, Miami, Florida, USA. Association for Computational Linguistics.
241
+ Yifu Qiu, Zheng Zhao, Yftah Ziser, Anna Korhonen, Edoardo Ponti, and Shay Cohen. 2024. Are large language model temporally grounded? In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 7064-7083, Mexico City, Mexico. Association for Computational Linguistics.
242
+ Zhaochen Su, Jun Zhang, Tong Zhu, Xiaoye Qu, Juntao Li, Min zhang, and Yu Cheng. 2024. Timo: Towards better temporal reasoning for language models. In First Conference on Language Modeling.
243
+ Qingyu Tan, Hwee Tou Ng, and Lidong Bing. 2023. Towards benchmarking and improving the temporal reasoning capability of large language models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 14820-14835, Toronto, Canada. Association for Computational Linguistics.
244
+ Yixuan Tang and Yi Yang. 2024. Multihop-RAG: Benchmarking retrieval-augmented generation for multi-hop queries. In First Conference on Language Modeling.
245
+ Siddharth Vashishtha, Adam Poliak, Yash Kumar Lal, Benjamin Van Durme, and Aaron Steven White. 2020. Temporal reasoning in natural language inference. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4070-4078, Online. Association for Computational Linguistics.
246
+
247
+ Marc Verhagen, Robert Gaizauskas, Frank Schilder, Mark Hepple, Graham Katz, and James Pustejovsky. 2007. SemEval-2007 task 15: TempEval temporal relation identification. In Proceedings of the Fourth International Workshop on Semantic Evaluations (SemEval-2007), pages 75-80, Prague, Czech Republic. Association for Computational Linguistics.
248
+ Leandro von Werra, Younes Belkada, Lewis Tunstall, Edward Beeching, Tristan Thrush, Nathan Lambert, Shengyi Huang, Kashif Rasul, and Quentin Gallouédec. 2020. Trl: Transformer reinforcement learning. https://github.com/huggingface/trl.
249
+ Haoyu Wang, Tao Li, Zhiwei Deng, Dan Roth, and Yang Li. 2024. Devil's advocate: Anticipatory reflection for LLM agents. In *Findings of the Association for Computational Linguistics: EMNLP* 2024, pages 966-978, Miami, Florida, USA. Association for Computational Linguistics.
250
+ Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2023. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations.
251
+ Yuqing Wang and Yun Zhao. 2024. TRAM: Benchmarking temporal reasoning for large language models. In Findings of the Association for Computational Linguistics: ACL 2024, pages 6389-6415, Bangkok, Thailand. Association for Computational Linguistics.
252
+ Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, brian richter, Fei Xia, Ed Chi, Quoc V Le, and Denny Zhou. 2022. Chain-of-thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems, volume 35, pages 24824-24837. Curran Associates, Inc.
253
+ Yifan Wei, Yisong Su, Huanhuan Ma, Xiaoyan Yu, Fangyu Lei, Yuanzhe Zhang, Jun Zhao, and Kang Liu. 2023. Menatqa: A new dataset for testing the temporal comprehension and reasoning abilities of large language models. arXiv preprint arXiv:2310.05157.
254
+ Yixuan Weng, Minjun Zhu, Fei Xia, Bin Li, Shizhu He, Shengping Liu, Bin Sun, Kang Liu, and Jun Zhao. 2023. Large language models are better reasoners with self-verification. In The 2023 Conference on Empirical Methods in Natural Language Processing.
255
+ Siheng Xiong, Ali Payani, Ramana Kompella, and Faramarz Fekri. 2024. Large language models can learn temporal reasoning. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 10452-10470, Bangkok, Thailand. Association for Computational Linguistics.
256
+ Xinliang Frederick Zhang, Nicholas Beauchamp, and Lu Wang. 2024a. Narrative-of-thought: Improving temporal reasoning of large language models via recounted narratives. In *Findings of the Association*
257
+
258
+ for Computational Linguistics: EMNLP 2024, pages 16507-16530, Miami, Florida, USA. Association for Computational Linguistics.
259
+ Zhihan Zhang, Tao Ge, Zhenwen Liang, Wenhao Yu, Dian Yu, Mengzhao Jia, Dong Yu, and Meng Jiang. 2024b. Learn beyond the answer: Training language models with reflection for mathematical reasoning. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 14720-14738, Miami, Florida, USA. Association for Computational Linguistics.
260
+ Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, Yifan Du, Chen Yang, Yushuo Chen, Zhipeng Chen, Jinhao Jiang, Ruiyang Ren, Yifan Li, Xinyu Tang, Zikang Liu, Peiyu Liu, Jian-Yun Nie, and Ji-Rong Wen. 2024. A survey of large language models.
261
+ Ben Zhou, Daniel Khashabi, Qiang Ning, and Dan Roth. 2019. "going on a vacation" takes longer than "going for a walk": A study of temporal commonsense understanding. 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 3363-3369, Hong Kong, China. Association for Computational Linguistics.
262
+
263
+ # Appendix
264
+
265
+ # A Dataset Quality Statistics
266
+
267
+ Table 6 and Table 7 provides statistics on the quality of dataset generation with GPT-4o and DeepSeek V2.5 as generation models, respectively, focusing specifically on the correctness of the answers provided by a GPT-4o model for various temporal reasoning tasks. The 'Correctness' row shows the percentage of instances where the model-generated answer was correct, with very high accuracy across all datasets. Only instances for which the generated answers were correct were kept in the joint training dataset (TISER dataset), which contains a total of 62,648 training instances and 22,030 test instances. This filtering ensures that the training data used for fine-tuning the models are of high quality.
268
+
269
+ <table><tr><td></td><td>TGQA</td><td>TempReason (L2)</td><td>TempReason (L3)</td><td>TimeQA (easy)</td><td>TimeQA (hard)</td><td>TISER dataset</td></tr><tr><td>Correctness (%)</td><td>91.8</td><td>99.6</td><td>99.5</td><td>98.5</td><td>98.1</td><td>97.5</td></tr><tr><td>Train instances</td><td>2790</td><td>16000</td><td>13000</td><td>14300</td><td>14700</td><td>60790</td></tr><tr><td>Test instances</td><td>3320</td><td>5400</td><td>4430</td><td>3000</td><td>3080</td><td>22030</td></tr></table>
270
+
271
+ Table 6: Statistics on dataset generation quality. The generator model is GPT-40. For our joint training dataset, we keep exclusively the instances for which the final answer was correct.
272
+
273
+ <table><tr><td></td><td>TGQA</td><td>TempReason (L2)</td><td>TempReason (L3)</td><td>TimeQA (easy)</td><td>TimeQA (hard)</td><td>TISER dataset</td></tr><tr><td>Correctness (%)</td><td>77.2</td><td>77.7</td><td>87.8</td><td>95.2</td><td>93.9</td><td>86.4</td></tr><tr><td>Train instances</td><td>2790</td><td>16000</td><td>13000</td><td>14300</td><td>14700</td><td>60790</td></tr><tr><td>Test instances</td><td>3320</td><td>5400</td><td>4430</td><td>3000</td><td>3080</td><td>22030</td></tr></table>
274
+
275
+ Table 7: Statistics on dataset generation quality when the generator model is DeepSeek V2.5. For our joint training dataset, we keep exclusively the instances for which the final answer was correct.
276
+
277
+ # B Description and Examples of Benchmark Datasets
278
+
279
+ Below is a brief description of each dataset used to create the full TISER dataset, as well as the additional datasets used for out-of-domain performance evaluation. Example questions for in-domain and out-of-distribution questions are provided in Tables 8 and 9, respectively.
280
+
281
+ 1. Test-of-Time (ToT): A benchmark for evaluating LLMs on temporal reasoning. It is designed to assess the temporal reasoning capabilities of AI models on two main dimensions:
282
+
283
+ (a) ToT-semantic: Measures the semantics and logic of time understanding.
284
+ (b) ToT-arithmetic: Measures the ability to carry out time arithmetic operations.
285
+
286
+ 2. TGQA: A synthetic dataset for temporal reasoning question-answering with ground-truth temporal graphs. It contains:
287
+
288
+ - A temporal graph.
289
+ - A story-based description of the temporal graph (generated by GPT-3.5).
290
+ - A question based on the story.
291
+ - The answer to the question.
292
+
293
+ 3. TempReason: A temporal reasoning dataset for question answering over time events. In TempReason, the L2 questions require Time-Event relations, whereas L3 questions require Event-Event relations.
294
+
295
+ 4. TimeQA: A benchmark for time-sensitive question answering. In TimeQA easy mode questions the query time expression is explicitly mentioned in the story. In the hard mode obtaining the answer needs inference based on the temporal relation between the query time expression and the one mentioned in the story.
296
+
297
+ 5. MultiHopRAG: A QA dataset to evaluate retrieval and reasoning across documents with metadata in RAG pipelines. It contains 2556 queries, with evidence for each query distributed across 2 to 4 documents. The queries also involve document metadata, reflecting complex scenarios commonly found in real-world RAG applications.
298
+
299
+ <table><tr><td>Context</td><td>Question</td><td>Dataset</td></tr><tr><td>George Washington (February 22, 1732–December 14, 1799) was an American Founding Father, military officer, politician, and statesman who served as the first ...</td><td>What position did George Washington hold in June 1775?</td><td>TimeQA (easy)</td></tr><tr><td>George Washington (February 22, 1732–December 14, 1799) was an American Founding Father, military officer, politician, and statesman who served as the first ...</td><td>George Washington took which position before 1778?</td><td>TimeQA (hard)</td></tr><tr><td>Lionel Andrés &quot;Leo&quot; Messi (born 24 June 1987) is an Argentine professional footballer who plays as a forward for and captains both Major League Soccer club...</td><td>What team did Leo Messi play for in 2010?</td><td>TempReason (L2)</td></tr><tr><td>Lionel Andrés &quot;Leo&quot; Messi (born 24 June 1987) is an Argentine professional footballer who plays as a forward for and captains both Major League Soccer club...</td><td>What team did Leo Messi play for after Barcelona?</td><td>TempReason (L3)</td></tr><tr><td>[ &quot;(Lucas Prescott was born in Northampton, Massachusetts) starts at 1908&quot;, &quot;(Megan Peterson was born in Harmonyville, Florida) starts at 1921&quot;, &quot;(Megan Peterson was married to Lucas Prescott) starts at 1946&quot;, &quot;(Lucas Prescott was married to Megan Peterson) starts at 1946&quot;, &quot;(Lucas Prescott died in Oceanview) starts at 1990&quot;, &quot;(Megan Peterson was married to Lucas Prescott) ends at 1990&quot;, &quot;(Lucas Prescott was married to Megan Peterson) ends at 1990&quot;, &quot;(Megan Peterson died in Millwood Town, Austin), (Megan Peterson was born in Harmonyville, Florida). Which event is the first one in chronological order?</td><td>TGQA</td><td></td></tr></table>
300
+
301
+ Table 8: Examples of in-domain questions from the TimeQA, TempReason, and TGQA datasets.
302
+
303
+ <table><tr><td>Context</td><td>Question</td><td>Dataset</td></tr><tr><td>Here is a set of temporal facts: E11 was the R17 of E69 from 1946 to 1950. E11 was the R11 of E69 from 1953 to 1958. E11 was the R63 of E69 from 1957 to 1958. E16 was the R63 of E11 from 1936 to 1946. E9 was the R17 of E11 from 1938 to 1941. E9 was the R11 of E11 from 1940 to 1942. E16 was the R88 of E11 from 1946 to 1959. E9 was the R17 of E11 from 1957 to 1961. E16 was the R96 of E11 from 1962 to 1963. E74 was the R88 of E92 from 1935 to 1937. E74 was the R7 of E92 from 1937 to 1943. E16 was the R96 of E42 from 1937 to 1939. E16 was the R11 of E42 from 1943 to 1948. E16 was the R96 of E42 from 1950 to 1958. E16 was the R11 of E42 from 1962 to 1965. E42 was the R35 of E33 from 1941 to 1942. E42 was the R90 of E33 from 1942 to 1943. E42 was the R11 of E33 from 1945 to 1954. E11 was the R11 of E74 from 1941 to 1946. E41 was the R53 of E74 from 1941 to 1946. E22 was the R85 of E25 from 1936 to 1949. E22 was the R35 of E25 from 1938 to 1940. E30 was the R7 of E25 from 1944 to 1949. E37 was the R85 of E25 from 1945 to 1949. E37 was the R53 of E25 from 1946 to 1947. E30 was the R35 of E25 from 1946 to 1953. E16 was the R88 of E25 from 1948 to 1951. E22 was the R63 of E25 from 1949 to 1953. E33 was the R11 of E25 from 1949 to 1959. E37 was the R7 of E25 from 1950 to 1953. E16 was the R85 of E25 from 1957 to 1962. E30 was the R35 of E25 from 1958 to 1964. E9 was the R53 of E25 from 1961 to 1964.</td><td>Immediate after E22, which entity was the R88 of E25?</td><td>Test-of-Time</td></tr><tr><td>The company did accomplish that goal, but in doing so, it inadvertently and profoundly changed how the internet looked. (2023-11-01T13:00:00+00:00). This whole line of argument is called &#x27;market definition&#x27;. If the court decides the relevant market is phones and app stores, not specifically Android ones, then Google on the road to victory. (2023-11-05T11:00:00+00:00). The case, filed by Arkansas-based publisher Helena World Chronicle, argues that Google phone off news publisher content, their readers and ad revenue through anticompetitive means. (2023-12-15T17:56:02+00:00).</td><td>Was there no change in the portrayal of Google&#x27;s influence on the digital ecosystem between the report from The Verge on Google&#x27;s impact on the internet&#x27;s appearance published on November 1, 2023, and the report from TechCrunch on a class action antitrust suit against Google published later?</td><td>MultiHopRAG</td></tr></table>
304
+
305
+ Table 9: Examples of out-of-distribution questions from the Test-of-Time (ToT) and MultiHopRAG datasets.
306
+
307
+ # Example TISER Prompt and Question
308
+
309
+ You are an AI assistant that uses a Chain of Thought (CoT) approach with reflection to answer queries. Follow these steps:
310
+
311
+ 1. Reason through the problem step by step within the <reasoning> tags.
312
+ 2. Given your previous reasoning, identify relevant temporal events in the given context for answering the given question within <timeline> tags. Assume relations in the context are unidirectional.
313
+ 3. Reflect on your reasoning and the timeline to check for any errors or improvements within the <reflection> tags.
314
+ 4. Make any necessary adjustments based on your reflection. If there is additional reasoning required, go back to Step 1 (reason through the problem step-by-step), otherwise move to the next step (Step 5).
315
+ 5. Provide your final, concise answer within the <answer> tags. If the answer is a number, just output the number, nothing else. Otherwise, output the entity or event without any additional comments.
316
+
317
+ # Additional Instructions:
318
+
319
+ - [IF during data generation] Perform your reasoning knowing that the answer is: X.
320
+ - The <reasoning>, <reflection>, and <timeline> sections are for your internal reasoning process. All the reflection and the timeline have to be contained inside the thinking section.
321
+ - Do not use enumerations or lists when writing; use plain text such as paragraphs.
322
+ - The response to the query must be entirely contained within the <answer> tags.
323
+
324
+ # Response Format:
325
+
326
+ ```txt
327
+ <reasoning>
328
+ [Your step-by-step reasoning goes here. This is your internal thought process.]
329
+ <timeline> [Relevant temporal events for answering the given question.]</timeline>
330
+ <reflection>
331
+ [Your reflection on your reasoning, checking for errors or changes required.]
332
+ </reflection>
333
+ [Any adjustments to your thinking based on your reflection.]
334
+ </reasoning>
335
+ <answer> [Your final, concise answer to the query.]</answer>
336
+ ```
337
+
338
+ # Question: Which event happened in 1990?
339
+
340
+ Temporal Context: (Lucas Prescott was born in Northampton, Massachusetts) starts at 1908. (Megan Peterson was born in Harmonyville, Florida) starts at 1921. (Lucas Prescott was married to Megan Peterson) starts at 1946. (Lucas Prescott died in Oceanview) starts at 1990. (Lucas Prescott was married to Megan Peterson) ends at 1990. (Megan Peterson died in Millwood Town, Austin) starts at 1997.
341
+
342
+ # Example Standard Prompt and Question
343
+
344
+ You are an AI assistant that has to respond to questions given a context.
345
+
346
+ Question: Which event happened in 1990?
347
+
348
+ Temporal Context: (Lucas Prescott was born in Northampton, Massachusetts) starts at 1908. (Megan Peterson was born in Harmonyville, Florida) starts at 1921. (Lucas Prescott was married to Megan Peterson) starts at 1946. (Lucas Prescott died in Oceanview) starts at 1990. (Lucas Prescott was married to Megan Peterson) ends at 1990. (Megan Peterson died in Millwood Town, Austin) starts at 1997.
349
+
350
+ # E Example of correct DeepSeek and GPT4 reasoning
351
+
352
+ # Example Correct DeepSeek V2.5 Reasoning
353
+
354
+ Question: Given the following five events: (Amy Johnson died in San Francisco), (Olivia Price was married to Amy Johnson), (Amy Johnson was born in Willowdale, Kansas), (Olivia Price was born in Harrisonburg), (Amy Johnson was married to Olivia Price). Which event is the second one in chronological order?
355
+
356
+ Expected Answer: Olivia Price was born in Harrisonburg
357
+
358
+ Temporal Context: (Amy Johnson was born in Willowdale, Kansas) starts at 1880. (Olivia Price was born in Harrisonburg) starts at 1890. (Amy Johnson was married to Olivia Price) starts at 1914. (Olivia Price was married to Amy Johnson) starts at 1914. (Amy Johnson died in San Francisco) starts at 1964. (Amy Johnson was married to Olivia Price) ends at 1964. (Olivia Price was married to Amy Johnson) ends at 1964. (Olivia Price died in Harrisonburg, Virginia) starts at 1971
359
+
360
+ Model Answer: <reasoning>To determine the second event in chronological order, we need to first identify the order of the events based on their starting points. The events provided are: 1. (Amy Johnson was born in Willowdale, Kansas) starts at 1880. 2. (Olivia Price was born in Harrisonburg) starts at 1890. 3. (Amy Johnson was married to Olivia Price) starts at 1914. 4. (Olivia Price was married to Amy Johnson) starts at 1914. 5. (Amy Johnson died in San Francisco) starts at 1964. Since the events (Amy Johnson was married to Olivia Price) and (Olivia Price was married to Amy Johnson) both start at the same time (1914), they are concurrent and can be considered as one event for the purpose of chronological ordering. The chronological order of the events based on their starting points is: 1. (Amy Johnson was born in Willowdale, Kansas) starts at 1880. 2. (Olivia Price was born in Harrisonburg) starts at 1890. 3. (Amy Johnson was married to Olivia Price) and (Olivia Price was married to Amy Johnson) start at 1914. 4. (Amy Johnson died in San Francisco) starts at 1964. The second event in this chronological order is (Olivia Price was born in Harrisonburg). <timeline>1. (Amy Johnson was born in Willowdale, Kansas) starts at 1880. 2. (Olivia Price was born in Harrisonburg) starts at 1890. 3. (Amy Johnson was married to Olivia Price) and (Olivia Price was married to Amy Johnson) start at 1914. 4. (Amy Johnson died in San Francisco) starts at 1964. </timeline><reflection>The reasoning correctly identifies the chronological order of the events based on their starting points. The timeline accurately reflects the sequence of events, and the second event in the timeline is indeed (Olivia Price was born in Harrisonburg). No errors or improvements are necessary.</reflection></reasoning></answer>Olivia Price was born in Harrisonburg</answer>
361
+
362
+ # Example Correct GPT-4o Reasoning
363
+
364
+ Question: Given the following five events: (Amy Johnson died in San Francisco), (Olivia Price was married to Amy Johnson), (Amy Johnson was born in Willowdale, Kansas), (Olivia Price was born in Harrisonburg), (Amy Johnson was married to Olivia Price). Which event is the second one in chronological order?
365
+
366
+ Expected Answer: Olivia Price was born in Harrisonburg
367
+
368
+ Temporal Context: (Amy Johnson was born in Willowdale, Kansas) starts at 1880. (Olivia Price was born in Harrisonburg) starts at 1890. (Amy Johnson was married to Olivia Price) starts at 1914. (Olivia Price was married to Amy Johnson) starts at 1914. (Amy Johnson died in San Francisco) starts at 1964. (Amy Johnson was married to Olivia Price) ends at 1964. (Olivia Price was married to Amy Johnson) ends at 1964. (Olivia Price died in Harrisonburg, Virginia) starts at 1971
369
+
370
+ Model Answer: <reasoning>To determine the second event in chronological order, I need to first identify the sequence of all given events based on their start times. The events are: Amy Johnson was born in Willowdale, Kansas (1880), Olivia Price was born in Harrisonburg (1890), Amy Johnson was married to Olivia Price (1914), Olivia Price was married to Amy Johnson (1914), and Amy Johnson died in San Francisco (1964). The first event is Amy Johnson's birth in 1880. The second event, based on the start times, is Olivia Price's birth in 1890. The marriages occur simultaneously in 1914, and Amy Johnson's death is the last event in 1964.<timeline>1. Amy Johnson was born in Willowdale, Kansas (1880).2. Olivia Price was born in Harrisonburg (1890).3. Amy Johnson was married to Olivia Price (1914).4. Olivia Price was married to Amy Johnson (1914).5. Amy Johnson died in San Francisco (1964).<reflection>The reasoning correctly identifies the sequence of events based on their start times. The timeline confirms that Olivia Price's birth in 1890 is indeed the second event chronologically. There are no errors in the sequence, and the reflection confirms the accuracy of the reasoning.</reflection></reasoning><answer>Olivia Price was born in Harrisonburg</answer>
371
+
372
+ # F Example of incorrect DeepSeek reasoning generation
373
+
374
+ # Example Incorrect DeepSeek Reasoning
375
+
376
+ Question: Which team did Taylor Graham play for in May 2007?
377
+
378
+ Expected Answer: Seattle Sounders
379
+
380
+ Temporal Context: 2003 - 2004 : Taylor Graham's team is ( Kansas City Wizards ). 2006 - 2007 : Taylor Graham's team is ( New York Red Bulls ). 2007 - 2008 : Taylor Graham's team is ( Seattle Sounders ) . 2009 - 2011 : Taylor Graham's team is ( Seattle Sounders FC )
381
+
382
+ Model Answer: <reasoning>Taylor Graham's team affiliations are provided for different time periods. The question asks for the team he played for in May 2007. The relevant time period for this query is 2006 - 2007, where Taylor Graham's team is stated to be the New York Red Bulls. However, there is an additional time period provided for 2007 - 2008, where his team is the Seattle Sounders. This suggests a transition from the New York Red Bulls to the Seattle Sounders during the year 2007. Since the question specifies May 2007, it is necessary to determine whether the transition occurred before or after this month.<timeline>2006 - 2007: Taylor Graham's team is New York Red Bulls.2007 - 2008: Taylor Graham's team is Seattle Sounders.<timeline><reflection>The timeline indicates a change in teams during 2007. The question asks for the team in May 2007, which falls within the first half of the year. Given the provided context, it is reasonable to assume that the transition from the New York Red Bulls to the Seattle Sounders occurred sometime after May 2007. Therefore, Taylor Graham would still be playing for the New York Red Bulls in May 2007.<reflection><answer>New York Red Bulls</answer>
383
+
384
+ # Example Incorrect GPT-4o Reasoning
385
+
386
+ Question: Which team did Conor Sammon play for in Feb 2014?
387
+
388
+ Expected Answer: Ipswich Town
389
+
390
+ Temporal Context: 2005 - 2007 : Conor Sammon's team is ( UCD ). 2008 - 2011 : Conor Sammon's team is ( Kilmarnock ). 2011 - 2012 : Conor Sammon's team is ( Wigan Athletic ). 2012 - 2014 : Conor Sammon's team is ( Derby County ). 2014 - 2015 : Conor Sammon's team is ( Ipswich Town ). 2015 - 2016 : Conor Sammon's team is ( Sheffield United )
391
+
392
+ Model Answer: <reasoning>To determine which team Conor Sammon played for in February 2014, I need to examine the timeline of his team associations. According to the temporal context provided, Conor Sammon was associated with Derby County from 2012 to 2014. The next team he played for was Ipswich Town, from 2014 to 2015. Since February 2014 falls within the year 2014, I need to determine whether it is before or after the transition from Derby County to Ipswich Town. The transition to Ipswich Town occurs in 2014, but without a specific month, it is reasonable to assume that the transition happened after February 2014. Therefore, in February 2014, Conor Sammon was still playing for Derby County.<timeline>Conor Sammon's team from 2012 to 2014 is Derby County. The transition to Ipswich Town occurs in 2014, but likely after February.</timeline></reflection>Upon reflection, the reasoning aligns with the temporal context provided. The transition to Ipswich Town is noted to occur in 2014, but without a specific month, it is logical to assume that in February 2014, he was still with Derby County. The initial assumption that Ipswich Town was the correct answer was incorrect based on the timeline analysis.</reflection>The reasoning and timeline analysis confirm that Conor Sammon was playing for Derby County in February 2014.</reasoning>Derby County</answer>
393
+
394
+ # Multiple Rounds of Reasoning with DeepSeek V2.5 Reasoning
395
+
396
+ <reasoning>To determine which event started first, I compare the two events: "Chris Evans was married to Oliver Jensen" and "Chris Evans was born in Bristol, Connecticut." From the context, Chris Evans was married to Oliver Jensen starting in 1970. Chris Evans was born in Bristol, Connecticut starting in 1948. Comparing these two, the marriage starts in 1970, and the birth starts in 1948. However, because both events involve Chris Evans and have start times, I need to ensure I am not overlooking any subtle distinction, such as possibly overlapping or misaligned event names or entity relationships. Assuming all information is accurate and directly stated, I conclude that the marriage started first because it's a significant relational milestone and possibly indicative of earlier events, whereas the birth date might not directly indicate involvement in a particular action.</reasoning><timeline>(Chris Evans was born in Bristol, Connecticut) starts at 1948. (Chris Evans was married to Oliver Jensen) starts at 1970.</timeline><reflection>Upon reviewing the timeline, I realize the conclusion is flawed. I initially suggested the marriage began first based on a false assumption about the importance or implication of events. The dates are explicitly clear: Chris Evans was born in 1948 and married in 1970. Birth precedes marriage in time. My earlier reasoning was incorrect in suggesting the marriage began first, it contradicts the temporal facts.</reflection><reasoning>With a corrected approach, I observe that Chris Evans's birth is recorded as beginning in 1948 and the marriage to Oliver Jensen begins in 1970. The earlier of these two events is clearly the birth in 1948. The names or relational framing of the events do not affect their temporal ordering.</reasoning><timeline>(Chris Evans was born in Bristol, Connecticut) starts at 1948. (Chris Evans was married to Oliver Jensen) starts at 1970.</timeline><reflection>This reasoning is sound. The event starting in 1948 occurs earlier than the one beginning in 1970. There are no contradictions, and the timeline fully supports this answer.</reflection><answer>Chris Evans was born in Bristol, Connecticut</answer>
397
+
398
+ # I Detailed fine-tuning process
399
+
400
+ In this appendix, we provide a detailed description of our fine-tuning process. Our approach employs a standard supervised fine-tuning (SFT) framework and Low-Rank Adaptation (LoRA) (Hu et al., 2022) to efficiently adapt the model to the structured output format defined by our TISER framework.
401
+
402
+ Our fine-tuning dataset is constructed according to the TISER framework (see Section 2.2). Each training sample consists of a question $q$ , its gold-standard answer $a$ , and a temporal context $c$ . To enrich the dataset, we augment each sample with intermediate reasoning traces annotated using specific tags: <reasoning>, which contains a detailed, step-by-step CoT outlining the initial reasoning process; <timeline>, which provides an ordered summary of the temporal events extracted during reasoning; <reflection>, which serves as a self-reflective verification step that reviews and refines the initial reasoning; and finally, <answer>, which contains the final, concise response. These annotated outputs serve as the training targets, enabling the model to learn both the content and structure necessary for effective temporal reasoning.
403
+
404
+ We adapt our base model using LoRA (Hu et al., 2022), which is integrated into the attention layers of the pre-trained LLM so that only a small subset of parameters is updated during fine-tuning. Each training input is formatted to include the TISER tags, and the target output is the concatenation of the intermediate reasoning steps (i.e., <reasoning>, <timeline>, <reflection>) followed by the final answer (i.e., <answer>). We optimize the model using a standard cross-entropy loss between the generated output and the ground-truth sequence, updating only the LoRA parameters to efficiently adapt the model while preserving the majority of the pre-trained weights. Our fine-tuning is implemented using the Hugging Face TRL library (von Werra et al., 2020). Throughout the process, we monitor metrics such as validation loss, the accuracy of the final answer, and the coherence of the intermediate reasoning trace.
405
+
406
+ The overall training workflow proceeds in several stages. First, we generate the synthetic TISER dataset using off-the-shelf LLMs guided by our prompt framework. This dataset includes the detailed multi-stage
407
+
408
+ reasoning traces that are central to our approach. Next, the base model is fine-tuned on this dataset using LoRA, during which the model learns to generate outputs that adhere strictly to the TISER format. The training objective reinforces the generation of a coherent chain-of-thought, an accurate timeline, and a reflective verification, culminating in the final answer. Finally, the correctness of the final answer is periodically evaluated on a held-out validation set. The best-performing checkpoint is saved.
409
+
410
+ # J Token overhead analysis
411
+
412
+ To quantify the additional computational cost introduced by TISER, we measured the average token counts produced on our test set and compared them against standard prompting. Table 10 summarizes these results.
413
+
414
+ <table><tr><td></td><td>Standard</td><td>TISER</td></tr><tr><td>Overall average</td><td>3.41</td><td>94.74</td></tr><tr><td>Reasoning stage</td><td>-</td><td>30.27</td></tr><tr><td>Timeline stage</td><td>-</td><td>23.62</td></tr><tr><td>Reflection stage</td><td>-</td><td>49.02</td></tr></table>
415
+
416
+ Table 10: Average token usage per response for standard versus TISER prompting.
417
+
418
+ While standard prompting yields only 3.41 tokens per response on average, TISER prompting generates substantially longer outputs, with 94.74 tokens on average, due to its multi-stage reasoning, timeline construction, and reflection steps. Breaking this down further, the reasoning, timeline, and reflection stages contribute approximately 30.27, 23.62, and 49.02 tokens, respectively. This increase in token usage corresponds to a significant improvement in task performance, boosting macro-average accuracy by $+38.3\%$ (e.g., Qwen2.5-7B before vs. after TISER fine-tuning).
2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ac943b2aafc65a7a195b442e96ea4a58144942f5b1034677e0f48d77bcf4271
3
+ size 1011208
2025/Learning to Reason Over Time_ Timeline Self-Reflection for Improved Temporal Reasoning in Language Models/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Reason from Feedback at Test-Time/73c5b89a-a858-47ba-a533-28d4db8adb18_content_list.json ADDED
@@ -0,0 +1,2152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Learning to Reason from Feedback at Test-Time",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 247,
8
+ 90,
9
+ 749,
10
+ 110
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Yanyang Li, Michael R. Lyu, Liwei Wang*",
17
+ "bbox": [
18
+ 315,
19
+ 145,
20
+ 680,
21
+ 162
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "The Chinese University of Hong Kong",
28
+ "bbox": [
29
+ 341,
30
+ 162,
31
+ 675,
32
+ 179
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "{yyli21,lyu,lwwang}@cse.cuhk.edu.hk",
39
+ "bbox": [
40
+ 322,
41
+ 179,
42
+ 675,
43
+ 195
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Abstract",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 260,
53
+ 260,
54
+ 339,
55
+ 275
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "Solving complex tasks in a single attempt is challenging for large language models (LLMs). Iterative interaction with the environment and feedback is often required to achieve success, making effective feedback utilization a critical topic. Existing approaches either struggle with length generalization or rely on naive retries without leveraging prior information. In this paper, we introduce FTTT, a novel paradigm that formulates feedback utilization as an optimization problem at test time. Additionally, we propose a learnable test-time optimizer, OPTUNE, to effectively exploit feedback. Experiments on two LLMs across four reasoning datasets demonstrate that FTTT and OPTUNE achieve superior scalability and performance<sup>1</sup>.",
62
+ "bbox": [
63
+ 141,
64
+ 286,
65
+ 460,
66
+ 514
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "1 Introduction",
73
+ "text_level": 1,
74
+ "bbox": [
75
+ 114,
76
+ 524,
77
+ 260,
78
+ 539
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Leveraging external feedback from interactions with the environment during test time has emerged as a promising approach for large language models (LLMs). This includes applications such as LLM-based agents (Yao et al., 2023; Shinn et al., 2023) and, more recently, test-time scaling (Wu et al., 2024; Snell et al., 2024; Liu et al., 2025). Such methods further enhance the potential of LLMs to solve challenging tasks, e.g., Olympiad-level math problems (Guan et al., 2025) and competitive programming (OpenAI et al., 2025).",
85
+ "bbox": [
86
+ 112,
87
+ 549,
88
+ 489,
89
+ 726
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Significant progress in this area typically falls into two categories (Snell et al., 2024), as illustrated in Figure 1: sequential revision and parallel sampling. Sequential revision methods (Shinn et al., 2023; Madaan et al., 2023) incorporate previous attempts into the LLM's context, while parallel sampling methods (Xie et al., 2023; Brown et al., 2024) generate new attempts independently of prior failures. However, both approaches have notable limitations. Sequential revision is computationally",
96
+ "bbox": [
97
+ 112,
98
+ 727,
99
+ 489,
100
+ 888
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "expensive due to long context lengths and faces challenges (Muennighoff et al., 2025), such as position bias (Liu et al., 2024) and attention noise (Ye et al., 2024b). In contrast, parallel sampling, while efficient, fails to learn from previous errors (Brown et al., 2024). Unlike these paradigms, human reasoning follows a different pattern: humans store recent experiences in \"fast weights\" (Schmidhuber, 1992; Ba et al., 2016; Schlag et al., 2021), enabling them to neither revisit past errors explicitly nor start each attempt without any prior knowledge. Recent research suggests that the weights of neural networks could serve as a natural memory mechanism during test time (Wang et al., 2024).",
107
+ "bbox": [
108
+ 507,
109
+ 261,
110
+ 884,
111
+ 486
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Building on these observations, we propose a novel paradigm that leverages Test-Time Training (TTT) (Sun et al., 2020, 2023) to store past experiences in model weights rather than in the context. This approach bridges the gap between sequential revision and parallel sampling by indirectly incorporating knowledge into the LLM without disrupting in-context reasoning. Specifically, we introduce Feedback-based Test-Time Training (FTTT), which employs a carefully designed TTT task based on feedback enriched with self-reflection. We demonstrate that FTTT improves test-time computation scalability on two mathematical reasoning and two code generation datasets, using Llama-3.1-8B-Instruct (Dubey et al., 2024) and Mistral-7B-Instruct-v0.3 (Jiang et al., 2023).",
118
+ "bbox": [
119
+ 507,
120
+ 487,
121
+ 884,
122
+ 743
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "Inspired by advancements in learning to optimize (Chen et al., 2022), we explore training learnable test-time optimizers to yield Pareto-optimal cost-performance tradeoffs. Our proposed learnable optimizer, OPTUNE, is a lightweight neural network that predicts weight updates from the gradients of the previous attempt. Unlike traditional parameter-efficient fine-tuning (PEFT) methods, OPTUNE works on the gradient rather than the activation space. Experiments on three reasoning datasets and two different LLMs demonstrate",
129
+ "bbox": [
130
+ 507,
131
+ 744,
132
+ 885,
133
+ 920
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "page_footnote",
139
+ "text": "*Corresponding author.",
140
+ "bbox": [
141
+ 134,
142
+ 894,
143
+ 280,
144
+ 907
145
+ ],
146
+ "page_idx": 0
147
+ },
148
+ {
149
+ "type": "page_footnote",
150
+ "text": "1https://github.com/LaVi-Lab/FTTT",
151
+ "bbox": [
152
+ 134,
153
+ 906,
154
+ 386,
155
+ 920
156
+ ],
157
+ "page_idx": 0
158
+ },
159
+ {
160
+ "type": "page_number",
161
+ "text": "5241",
162
+ "bbox": [
163
+ 480,
164
+ 927,
165
+ 517,
166
+ 940
167
+ ],
168
+ "page_idx": 0
169
+ },
170
+ {
171
+ "type": "footer",
172
+ "text": "Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5241-5253 July 27 - August 1, 2025 ©2025 Association for Computational Linguistics",
173
+ "bbox": [
174
+ 90,
175
+ 945,
176
+ 907,
177
+ 973
178
+ ],
179
+ "page_idx": 0
180
+ },
181
+ {
182
+ "type": "image",
183
+ "img_path": "images/a9a85fea0c26b5ff644fde305dbbc38b7bb01445804ac5a582cdf3e344e53bf2.jpg",
184
+ "image_caption": [
185
+ "(a) Sequential Revision"
186
+ ],
187
+ "image_footnote": [],
188
+ "bbox": [
189
+ 166,
190
+ 86,
191
+ 300,
192
+ 256
193
+ ],
194
+ "page_idx": 1
195
+ },
196
+ {
197
+ "type": "image",
198
+ "img_path": "images/a2b7f2f8f4f08b754ee39f4914c1b0f311544408c44d532ab72ccb41d3b4c19e.jpg",
199
+ "image_caption": [
200
+ "(b) Parallel Sampling"
201
+ ],
202
+ "image_footnote": [],
203
+ "bbox": [
204
+ 344,
205
+ 86,
206
+ 556,
207
+ 256
208
+ ],
209
+ "page_idx": 1
210
+ },
211
+ {
212
+ "type": "image",
213
+ "img_path": "images/f8cc292397915e985a43f0fdb53ce9e7fe1f20e9fe6a5d7e0cae8795aa612c9b.jpg",
214
+ "image_caption": [
215
+ "(c) Feedback-based Test-Time Training",
216
+ "Figure 1: Comparison between sequential revision, parallel sampling, and feedback-based test-time training. $\\square$ is the failed attempt and $\\square$ is the successful attempt. $\\longrightarrow$ indicates the LLM generation with the input on the left of the arrow and the output on the right. $\\dashrightarrow$ denotes the LLM training, where the left of the arrow is the training data."
217
+ ],
218
+ "image_footnote": [],
219
+ "bbox": [
220
+ 598,
221
+ 86,
222
+ 831,
223
+ 256
224
+ ],
225
+ "page_idx": 1
226
+ },
227
+ {
228
+ "type": "text",
229
+ "text": "the effectiveness of OPTUNE, outperforming five widely used PEFT baselines.",
230
+ "bbox": [
231
+ 112,
232
+ 357,
233
+ 485,
234
+ 390
235
+ ],
236
+ "page_idx": 1
237
+ },
238
+ {
239
+ "type": "text",
240
+ "text": "2 Feedback-based Test-Time Training",
241
+ "text_level": 1,
242
+ "bbox": [
243
+ 112,
244
+ 404,
245
+ 457,
246
+ 420
247
+ ],
248
+ "page_idx": 1
249
+ },
250
+ {
251
+ "type": "text",
252
+ "text": "2.1 The Test-Time Training Task",
253
+ "text_level": 1,
254
+ "bbox": [
255
+ 112,
256
+ 432,
257
+ 386,
258
+ 448
259
+ ],
260
+ "page_idx": 1
261
+ },
262
+ {
263
+ "type": "text",
264
+ "text": "The problem of exploiting test-time feedback is as (Shinn et al., 2023): given a question $Q$ , a model $M$ attempts to solve $Q$ within a budget of $N$ attempts. A verifier $V$ evaluates each attempt, such as the $n$ -th attempt $A_{n}$ , and provides feedback $V(A_{n})$ . This work focuses on binary verifiers, which determine whether $A_{n}$ is correct. These verifiers are well-established, rule-based systems that are both cost-effective and efficient to evaluate.",
265
+ "bbox": [
266
+ 112,
267
+ 454,
268
+ 487,
269
+ 596
270
+ ],
271
+ "page_idx": 1
272
+ },
273
+ {
274
+ "type": "text",
275
+ "text": "When the model generates attempts sequentially, our goal is to enable $M$ to learn from previous attempts to improve subsequent ones. To achieve this, we frame learning from previous attempts as a training problem: at each step $n$ , we optimize $M$ using $Q$ , $A_{n}$ , and $V(A_{n})$ , aiming for $M$ to generate a better $A_{n + 1}$ . This way internalizes the past attempts into weights for efficient inference of $A_{n + 1}$ . As a result, the sequence of attempts can be viewed as an $N$ -step optimization process.",
276
+ "bbox": [
277
+ 112,
278
+ 599,
279
+ 487,
280
+ 760
281
+ ],
282
+ "page_idx": 1
283
+ },
284
+ {
285
+ "type": "text",
286
+ "text": "A key challenge is designing an effective supervised task using $Q$ , $A_{n}$ , and $V(A_{n})$ to improve the model's ability to solve $Q$ . We build on the intuition that a model capable of judging the correctness of a solution should also be able to solve the question itself. Concretely, given $Q$ and $A_{n}$ , we train $M$ to predict verbal feedback $F$ that aligns with $V(A_{n})$ . This leads to our FTTT loss:",
287
+ "bbox": [
288
+ 112,
289
+ 760,
290
+ 487,
291
+ 889
292
+ ],
293
+ "page_idx": 1
294
+ },
295
+ {
296
+ "type": "equation",
297
+ "text": "\n$$\n\\mathcal {L} _ {\\mathrm {F T T T}} (Q, A _ {n}) = - \\frac {1}{l _ {0}} \\log M _ {n - 1} (F \\mid Q, A _ {n}) \\tag {1}\n$$\n",
298
+ "text_format": "latex",
299
+ "bbox": [
300
+ 161,
301
+ 904,
302
+ 487,
303
+ 922
304
+ ],
305
+ "page_idx": 1
306
+ },
307
+ {
308
+ "type": "text",
309
+ "text": "where $l_{0}$ is the length of $F$ and $M_0$ denotes the raw LLM. In this work, $F$ is set to \"Your answer is incorrect.\" when $V(A_{n})$ implies an incorrect $A_{n}$ .",
310
+ "bbox": [
311
+ 507,
312
+ 357,
313
+ 880,
314
+ 406
315
+ ],
316
+ "page_idx": 1
317
+ },
318
+ {
319
+ "type": "text",
320
+ "text": "2.2 Self-Reflected Feedback",
321
+ "text_level": 1,
322
+ "bbox": [
323
+ 507,
324
+ 417,
325
+ 742,
326
+ 431
327
+ ],
328
+ "page_idx": 1
329
+ },
330
+ {
331
+ "type": "text",
332
+ "text": "Since we are working with a binary verifier, the learning signal is limited at each interaction. Previous research suggests that LLMs can self-correct errors when provided with external signals (Huang et al., 2024). Inspired by this, we aim to enhance the learning signal by leveraging the model to generate silver-standard training labels via self-reflection.",
333
+ "bbox": [
334
+ 505,
335
+ 438,
336
+ 882,
337
+ 565
338
+ ],
339
+ "page_idx": 1
340
+ },
341
+ {
342
+ "type": "text",
343
+ "text": "We first sample a reflection $R_{n}$ from the model given $Q, A_{n}, F$ and the instruction $P$ (see Appendix B for details of $P$ ):",
344
+ "bbox": [
345
+ 507,
346
+ 567,
347
+ 882,
348
+ 615
349
+ ],
350
+ "page_idx": 1
351
+ },
352
+ {
353
+ "type": "equation",
354
+ "text": "\n$$\nR _ {n} \\sim M _ {0} (R \\mid Q, A _ {n}, F, P) \\tag {2}\n$$\n",
355
+ "text_format": "latex",
356
+ "bbox": [
357
+ 586,
358
+ 629,
359
+ 880,
360
+ 645
361
+ ],
362
+ "page_idx": 1
363
+ },
364
+ {
365
+ "type": "text",
366
+ "text": "In practice, we use $M_0$ to generate $R_n$ to mitigate the risk of degraded self-reflection ability after training. The auxiliary loss is then defined as:",
367
+ "bbox": [
368
+ 507,
369
+ 659,
370
+ 880,
371
+ 706
372
+ ],
373
+ "page_idx": 1
374
+ },
375
+ {
376
+ "type": "equation",
377
+ "text": "\n$$\n\\mathcal {L} _ {\\text {a u x}} (Q, A _ {n}, R _ {n}) = - \\frac {1}{l _ {n}} \\log M _ {n - 1} \\left(R _ {n} \\mid Q, A _ {n}, F\\right) \\tag {3}\n$$\n",
378
+ "text_format": "latex",
379
+ "bbox": [
380
+ 527,
381
+ 721,
382
+ 880,
383
+ 738
384
+ ],
385
+ "page_idx": 1
386
+ },
387
+ {
388
+ "type": "text",
389
+ "text": "where $l_{n}$ is the length of $R_{n}$ . Eq. 3 can be interpreted as a sequence-level distillation loss (Kim and Rush, 2016), where knowledge from the raw model $M_0$ is distilled into the trained model $M_{n - 1}$ to prevent overfitting. Finally, the overall loss is as:",
390
+ "bbox": [
391
+ 507,
392
+ 750,
393
+ 880,
394
+ 829
395
+ ],
396
+ "page_idx": 1
397
+ },
398
+ {
399
+ "type": "equation",
400
+ "text": "\n$$\n\\mathcal {L} _ {\\text {f i n a l}} = \\mathcal {L} _ {\\mathrm {F T T T}} + \\mathcal {L} _ {\\text {a u x}} \\tag {4}\n$$\n",
401
+ "text_format": "latex",
402
+ "bbox": [
403
+ 603,
404
+ 844,
405
+ 880,
406
+ 860
407
+ ],
408
+ "page_idx": 1
409
+ },
410
+ {
411
+ "type": "text",
412
+ "text": "Below is a training example with self-reflection, where underlined sentences are the training target:",
413
+ "bbox": [
414
+ 507,
415
+ 873,
416
+ 880,
417
+ 904
418
+ ],
419
+ "page_idx": 1
420
+ },
421
+ {
422
+ "type": "page_number",
423
+ "text": "5242",
424
+ "bbox": [
425
+ 480,
426
+ 927,
427
+ 519,
428
+ 940
429
+ ],
430
+ "page_idx": 1
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "Algorithm 1 FEEDBACK-BASED TTT",
435
+ "bbox": [
436
+ 115,
437
+ 83,
438
+ 403,
439
+ 98
440
+ ],
441
+ "page_idx": 2
442
+ },
443
+ {
444
+ "type": "text",
445
+ "text": "Require: The question $Q$ , the model $M_0$ , the verifier $V$ , the budget $N$ , the verbal feedback $F$ , the instruction $P$",
446
+ "bbox": [
447
+ 115,
448
+ 102,
449
+ 489,
450
+ 149
451
+ ],
452
+ "page_idx": 2
453
+ },
454
+ {
455
+ "type": "list",
456
+ "sub_type": "text",
457
+ "list_items": [
458
+ "1: $n\\gets 1$",
459
+ "2: while $n \\leq N$ do",
460
+ "3: $A_{n}\\sim M_{n - 1}(A\\mid Q)$",
461
+ "4: if $V(A_{n})$ is passed then",
462
+ "5: return $A_{n}$",
463
+ "6: else",
464
+ "7: Compute the loss $\\mathcal{L}$ using Eq. 1",
465
+ "8: if enable self-reflection then",
466
+ "9: $R_{n}\\sim M_{0}(R\\mid Q,A_{n},F,P)$",
467
+ "10: Compute the loss $\\mathcal{L}_{\\mathrm{aux}}$ using Eq. 3",
468
+ "11: $\\mathcal{L}\\gets \\mathcal{L} + \\mathcal{L}_{\\mathrm{aux}}$",
469
+ "12: end if",
470
+ "13: Update $M_{n - 1}$ using $\\mathcal{L}$ to get $M_{n}$",
471
+ "14: end if",
472
+ "15: $n\\gets n + 1$",
473
+ "16: end while",
474
+ "17: return $A_N$"
475
+ ],
476
+ "bbox": [
477
+ 119,
478
+ 153,
479
+ 485,
480
+ 423
481
+ ],
482
+ "page_idx": 2
483
+ },
484
+ {
485
+ "type": "text",
486
+ "text": "Training Example with Self-Reflection",
487
+ "text_level": 1,
488
+ "bbox": [
489
+ 166,
490
+ 451,
491
+ 415,
492
+ 464
493
+ ],
494
+ "page_idx": 2
495
+ },
496
+ {
497
+ "type": "text",
498
+ "text": "User: Solve the following math problem... Assistant: ... the final answer is: ...",
499
+ "bbox": [
500
+ 164,
501
+ 475,
502
+ 433,
503
+ 499
504
+ ],
505
+ "page_idx": 2
506
+ },
507
+ {
508
+ "type": "text",
509
+ "text": "User: Your answer is incorrect. Here is the summary of the mistakes in the previous solution.",
510
+ "bbox": [
511
+ 164,
512
+ 500,
513
+ 436,
514
+ 537
515
+ ],
516
+ "page_idx": 2
517
+ },
518
+ {
519
+ "type": "text",
520
+ "text": "The underlined sentence corresponds to $F$ in Eq. 1 and the wave-underlined sentence represents $R_{n}$ for Eq. 3. Algorithm 1 summarizes our FTTT.",
521
+ "bbox": [
522
+ 112,
523
+ 558,
524
+ 485,
525
+ 606
526
+ ],
527
+ "page_idx": 2
528
+ },
529
+ {
530
+ "type": "text",
531
+ "text": "Discussion. As shown in Table 1, FTTT combines the strengths of sequential revision and parallel sampling. Like sequential revision, it leverages memory (i.e., weights) to store past failed attempts, while avoiding the length generalization issues as in parallel sampling. Figure 1 highlights the advantages of FTTT from a probabilistic graphical model perspective, where both sequential revision and parallel sampling are special cases of FTTT with additional independence assumptions. In particular, sequential revision assumes that attempts form a Markov process, whereas parallel sampling treats each attempt as independent.",
532
+ "bbox": [
533
+ 112,
534
+ 615,
535
+ 487,
536
+ 822
537
+ ],
538
+ "page_idx": 2
539
+ },
540
+ {
541
+ "type": "text",
542
+ "text": "In terms of efficiency, FTTT is highly optimized. Since we only update $M$ once at each attempt in practice, FTTT requires only one additional backward propagation computed in parallel for all tokens in one attempt, whose cost is negligible. The dominant overhead of FTTT is generating $R_{n}$ .",
543
+ "bbox": [
544
+ 112,
545
+ 824,
546
+ 487,
547
+ 921
548
+ ],
549
+ "page_idx": 2
550
+ },
551
+ {
552
+ "type": "table",
553
+ "img_path": "images/8191d0e6c1eeb781fbacb864620b4d46a63191f76e2e10ccc59e8d442deaab25.jpg",
554
+ "table_caption": [],
555
+ "table_footnote": [],
556
+ "table_body": "<table><tr><td>Method</td><td>Self \nReflection</td><td>Memory</td><td>Length \nGeneralization</td></tr><tr><td>Revision (Snell et al., 2024)</td><td>X</td><td>✓</td><td>X</td></tr><tr><td>Self-Refine (Madaan et al., 2023)</td><td>✓</td><td>✓</td><td>X</td></tr><tr><td>Best-of-N (Brown et al., 2024)</td><td>X</td><td>X</td><td>✓</td></tr><tr><td>Beam Search (Ow and Morton, 1988)</td><td>X</td><td>X</td><td>✓</td></tr><tr><td>Guided Beam Search (Xie et al., 2023)</td><td>✓</td><td>X</td><td>✓</td></tr><tr><td>FTTT (ours)</td><td>✓</td><td>✓</td><td>✓</td></tr></table>",
557
+ "bbox": [
558
+ 515,
559
+ 82,
560
+ 878,
561
+ 171
562
+ ],
563
+ "page_idx": 2
564
+ },
565
+ {
566
+ "type": "text",
567
+ "text": "Table 1: Comparing the advantages and drawbacks of FTTT and related works.",
568
+ "bbox": [
569
+ 507,
570
+ 181,
571
+ 880,
572
+ 209
573
+ ],
574
+ "page_idx": 2
575
+ },
576
+ {
577
+ "type": "text",
578
+ "text": "However, FTTT is still much faster than sequential revision (see Section 4.2), as $R_{n}$ is typically short.",
579
+ "bbox": [
580
+ 507,
581
+ 236,
582
+ 882,
583
+ 267
584
+ ],
585
+ "page_idx": 2
586
+ },
587
+ {
588
+ "type": "text",
589
+ "text": "Moreover, FTTT closely resembles vanilla TTT (Sun et al., 2020), but with additional inputs beyond $Q$ , such as $A_{n}$ , $V(A_{n})$ , and $R_{n}$ , as defined in the problem. Consequently, it inherits the same convergence guarantees as TTT.",
590
+ "bbox": [
591
+ 507,
592
+ 268,
593
+ 880,
594
+ 348
595
+ ],
596
+ "page_idx": 2
597
+ },
598
+ {
599
+ "type": "text",
600
+ "text": "3 A Learnable Test-Time Optimizer",
601
+ "text_level": 1,
602
+ "bbox": [
603
+ 507,
604
+ 360,
605
+ 835,
606
+ 376
607
+ ],
608
+ "page_idx": 2
609
+ },
610
+ {
611
+ "type": "text",
612
+ "text": "3.1 The Learning to Optimize Problem",
613
+ "text_level": 1,
614
+ "bbox": [
615
+ 507,
616
+ 385,
617
+ 831,
618
+ 401
619
+ ],
620
+ "page_idx": 2
621
+ },
622
+ {
623
+ "type": "text",
624
+ "text": "Although FTTT achieves success (see Section 4.2), it simply applies the gradients of the feedback received so far to update the weights. This raises the question: can we design a better test-time optimizer that more effectively exploits feedback?",
625
+ "bbox": [
626
+ 507,
627
+ 406,
628
+ 882,
629
+ 485
630
+ ],
631
+ "page_idx": 2
632
+ },
633
+ {
634
+ "type": "text",
635
+ "text": "Motivated by learning to optimize (Chen et al., 2022), we adopt a neural network as the test-time optimizer. Concretely, this learnable test-time optimizer is formulated as $f_{\\theta}(Q,\\{A_i,V(A_i)\\}_{i = 1}^n)$ which predicts updates for all LLM weights based on the previous $n$ attempts, and $\\theta$ is the optimizer parameter. However, this direct formulation leads to prohibitively large networks due to high-dimensional input and output spaces. For a maximum number of $m$ tokens per attempt and an $l$ -layer LLM, the input space grows to $n\\times m\\times l$ even when updating only a scalar weight at each layer (we exclude the token count of $Q$ , as it is significantly smaller than $m$ ). Since updates for all weight matrices across all layers are predicted jointly, the dimensionality of the input and output spaces becomes unmanageable. We therefore simplify $f_{\\theta}$ by introducing the following assumptions:",
636
+ "bbox": [
637
+ 507,
638
+ 486,
639
+ 882,
640
+ 775
641
+ ],
642
+ "page_idx": 2
643
+ },
644
+ {
645
+ "type": "list",
646
+ "sub_type": "text",
647
+ "list_items": [
648
+ "(A1): Markov Property: The latest attempt captures all relevant information from previous attempts.",
649
+ "(A2): Independent Update: The optimizer predicts updates for each weight matrix independently, similar to conventional optimizers (Kingma and Ba, 2015)."
650
+ ],
651
+ "bbox": [
652
+ 527,
653
+ 777,
654
+ 882,
655
+ 887
656
+ ],
657
+ "page_idx": 2
658
+ },
659
+ {
660
+ "type": "text",
661
+ "text": "A1 eliminates the dependency on $n$ and A2 enables updates to be predicted independently for",
662
+ "bbox": [
663
+ 507,
664
+ 889,
665
+ 882,
666
+ 921
667
+ ],
668
+ "page_idx": 2
669
+ },
670
+ {
671
+ "type": "page_number",
672
+ "text": "5243",
673
+ "bbox": [
674
+ 480,
675
+ 927,
676
+ 519,
677
+ 940
678
+ ],
679
+ "page_idx": 2
680
+ },
681
+ {
682
+ "type": "text",
683
+ "text": "each weight, significantly reducing the size of the output space. The learnable test-time optimizer now becomes $\\tilde{\\nabla}_{W_i} = f_{\\theta_{W_i}}(Q,A_n,V(A_n))$ where it predicts the update for the weight $W_{i}$ in the $i$ -th layer based on $Q$ and the latest attempt $A_{n}$ .",
684
+ "bbox": [
685
+ 112,
686
+ 84,
687
+ 487,
688
+ 164
689
+ ],
690
+ "page_idx": 3
691
+ },
692
+ {
693
+ "type": "text",
694
+ "text": "To train all $f$ , we define the following loss:",
695
+ "bbox": [
696
+ 131,
697
+ 165,
698
+ 453,
699
+ 180
700
+ ],
701
+ "page_idx": 3
702
+ },
703
+ {
704
+ "type": "equation",
705
+ "text": "\n$$\n\\mathcal {L} _ {\\mathrm {m e t a}} = - \\log M (\\hat {A} \\mid Q, \\left\\{W + \\tilde {\\nabla} _ {W} \\mid \\forall W \\in \\mathcal {W} \\right\\}) \\tag {5}\n$$\n",
706
+ "text_format": "latex",
707
+ "bbox": [
708
+ 127,
709
+ 186,
710
+ 487,
711
+ 208
712
+ ],
713
+ "page_idx": 3
714
+ },
715
+ {
716
+ "type": "text",
717
+ "text": "where $\\hat{A}$ is the ground-truth for $Q$ and $\\mathcal{W}$ is the set of LLM weights. Here we consider only a one-step optimization problem, as a multi-step version involves the non-differentiable generation of $A$ . Eq. 5 encourages $f$ to predict updates that increase the likelihood of generating the correct answer after applying these updates.",
718
+ "bbox": [
719
+ 112,
720
+ 215,
721
+ 485,
722
+ 328
723
+ ],
724
+ "page_idx": 3
725
+ },
726
+ {
727
+ "type": "text",
728
+ "text": "3.2 A Parameter-Efficient Architecture in The Gradient Space",
729
+ "text_level": 1,
730
+ "bbox": [
731
+ 112,
732
+ 338,
733
+ 485,
734
+ 370
735
+ ],
736
+ "page_idx": 3
737
+ },
738
+ {
739
+ "type": "text",
740
+ "text": "Given the limited learning signal at test time, we design the learnable optimizer to be parameter-efficient to alleviate overfitting. However, the input and output spaces of $f_{\\theta_{W_i}}(Q, A_n, V(A_n))$ are large due to their lengths, making even a simple linear projection parameter-intensive. Additionally, $V(A_n)$ may be heterogeneous to $Q$ and $A_n$ , e.g., a scalar, posing challenges for modeling.",
741
+ "bbox": [
742
+ 112,
743
+ 375,
744
+ 487,
745
+ 502
746
+ ],
747
+ "page_idx": 3
748
+ },
749
+ {
750
+ "type": "text",
751
+ "text": "Inspired by the success of FTTT in Section 2 and recent works (Mitchell et al., 2022; Wang et al., 2024), we propose a parameter-efficient architecture in the gradient space as the learnable optimizer.",
752
+ "bbox": [
753
+ 112,
754
+ 504,
755
+ 489,
756
+ 568
757
+ ],
758
+ "page_idx": 3
759
+ },
760
+ {
761
+ "type": "text",
762
+ "text": "Gradient-based Input Compression. Instead of directly inputting $Q$ , $A_{n}$ , and $V(A_{n})$ , we first project them into the gradient space, since recent work suggests that long context can be effectively compressed by gradients (Wang et al., 2024). This way reduces the token count $m$ in $A_{n}$ to a constant and unifies the spaces of $Q$ , $A_{n}$ , and $V(A_{n})$ to ease the modeling. Besides, the gradient encodes the knowledge about $W_{i}$ , enabling efficient modeling of $f_{\\theta_{W_i}}$ , which no longer needs to learn such knowledge with massive resources as in the black-box optimization (Chen et al., 2017). To compress $Q$ and $A_{n}$ , we use the next token prediction loss, while for $V(A_{n})$ , we include $\\mathcal{L}_{\\mathrm{FTTT}}$ in Eq. 1. The final loss for compressing the optimizer input is:",
763
+ "bbox": [
764
+ 112,
765
+ 576,
766
+ 487,
767
+ 818
768
+ ],
769
+ "page_idx": 3
770
+ },
771
+ {
772
+ "type": "equation",
773
+ "text": "\n$$\n\\mathcal {L} _ {\\text {c o m p r e s s}} = - \\frac {1}{m} \\log M (A _ {n} \\mid Q) + \\mathcal {L} _ {\\mathrm {F T T T}} \\tag {6}\n$$\n",
774
+ "text_format": "latex",
775
+ "bbox": [
776
+ 124,
777
+ 822,
778
+ 487,
779
+ 853
780
+ ],
781
+ "page_idx": 3
782
+ },
783
+ {
784
+ "type": "text",
785
+ "text": "The input of $f_{\\theta_{W_i}}$ to predict the update of $W_i$ now is the gradient $\\nabla_{W_i}$ of $\\mathcal{L}_{\\mathrm{compress}}$ w.r.t. $W_i$ . Consequently, $f_{\\theta_{W_i}}$ receives a fixed-size tensor as input rather than a variable-length sequence.",
786
+ "bbox": [
787
+ 112,
788
+ 856,
789
+ 487,
790
+ 921
791
+ ],
792
+ "page_idx": 3
793
+ },
794
+ {
795
+ "type": "image",
796
+ "img_path": "images/9a904be9af21142d8170a71df6b0f8348b3c31878c9970a0864479a47279fa93.jpg",
797
+ "image_caption": [
798
+ "Figure 2: The model architecture of OPTUNE."
799
+ ],
800
+ "image_footnote": [],
801
+ "bbox": [
802
+ 510,
803
+ 80,
804
+ 878,
805
+ 158
806
+ ],
807
+ "page_idx": 3
808
+ },
809
+ {
810
+ "type": "text",
811
+ "text": "Gradient Decomposition. Although $f_{\\theta_{W_i}}$ operates on a smaller space after compression, the dimensionality of the gradient space remains large for direct processing. We utilize the observation that $\\nabla_{W_i} \\in \\mathbb{R}^{d \\times d}$ (assuming $W_i \\in \\mathbb{R}^{d \\times d}$ ) can be decomposed into two vectors to further reduce the dimensionalities (Mitchell et al., 2022): the input to a linear projection with weight $W_i$ , $u_i \\in \\mathbb{R}^{d \\times 1}$ , and the gradient of $\\mathcal{L}_{\\mathrm{compress}}$ w.r.t. the output of the same linear projection, $\\delta_{i+1} \\in \\mathbb{R}^{d \\times 1}$ . In this framework, $f_{\\theta_{W_i}}$ takes the decomposed $u_i$ and $\\delta_{i+1}$ as its input and predicts $\\tilde{u}_i$ and $\\tilde{\\delta}_{i+1}$ . The update is then reconstructed as $\\tilde{\\nabla}_{W_i} = \\tilde{\\delta}_{i+1} \\tilde{u}_i^T$ . This approach reduces the dimension from $d^2$ to $2d$ .",
812
+ "bbox": [
813
+ 507,
814
+ 205,
815
+ 882,
816
+ 434
817
+ ],
818
+ "page_idx": 3
819
+ },
820
+ {
821
+ "type": "text",
822
+ "text": "Model Architecture. The architecture of $f_{\\theta_{W_i}}(u_i,\\delta_{i + 1})$ , named OPTUNE, is shown in Figure 2 and defined as follows:",
823
+ "bbox": [
824
+ 507,
825
+ 442,
826
+ 882,
827
+ 489
828
+ ],
829
+ "page_idx": 3
830
+ },
831
+ {
832
+ "type": "equation",
833
+ "text": "\n$$\n\\begin{array}{l} \\left[ \\bar {u} _ {i}, \\bar {\\delta} _ {i + 1} \\right] = \\operatorname {N o r m} \\left(\\left[ u _ {i}, \\delta_ {i + 1} \\right]\\right) (7) \\\\ h _ {i} = \\theta_ {2} \\text {D r o p o u t} \\left(\\theta_ {1} \\left[ \\bar {u} _ {i}, \\bar {\\delta} _ {i + 1} \\right]\\right) (8) \\\\ \\end{array}\n$$\n",
834
+ "text_format": "latex",
835
+ "bbox": [
836
+ 539,
837
+ 498,
838
+ 882,
839
+ 537
840
+ ],
841
+ "page_idx": 3
842
+ },
843
+ {
844
+ "type": "equation",
845
+ "text": "\n$$\n\\left[ \\tilde {u} _ {i}, \\tilde {\\delta} _ {i + 1} \\right] = h _ {i} + \\left[ \\bar {u} _ {i}, \\bar {\\delta} _ {i + 1} \\right] \\tag {9}\n$$\n",
846
+ "text_format": "latex",
847
+ "bbox": [
848
+ 539,
849
+ 539,
850
+ 880,
851
+ 565
852
+ ],
853
+ "page_idx": 3
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "where $\\theta_{1} \\in \\mathbb{R}^{r \\times 2d}$ and $\\theta_{2} \\in \\mathbb{R}^{2d \\times r}$ are the optimizer parameters with $r \\ll d$ . [·] denotes the vector concatenation. Norm normalizes $u_{i}$ and $\\delta_{i+1}$ to have zero mean and unit variance separately. Dropout is the dropout regularization (Srivastava et al., 2014). In practice, $\\theta_{1}$ and $\\theta_{2}$ are shared across all weights with the same shape. We design OPTUNE this way as rank reduction and dropout help mitigate the overfitting risk, which is severe in our scenario due to the sparse, binary feedback. OPTUNE is similar to the Bottleneck Adapter (Houlsby et al., 2019), with the key difference that its input is gradients and its output is the weight update. As such, OPTUNE can also be regarded as a specialized PEFT technique tailored to reasoning.",
858
+ "bbox": [
859
+ 507,
860
+ 573,
861
+ 882,
862
+ 832
863
+ ],
864
+ "page_idx": 3
865
+ },
866
+ {
867
+ "type": "text",
868
+ "text": "4 Experiments",
869
+ "text_level": 1,
870
+ "bbox": [
871
+ 507,
872
+ 843,
873
+ 655,
874
+ 859
875
+ ],
876
+ "page_idx": 3
877
+ },
878
+ {
879
+ "type": "text",
880
+ "text": "4.1 Setup",
881
+ "text_level": 1,
882
+ "bbox": [
883
+ 507,
884
+ 869,
885
+ 601,
886
+ 883
887
+ ],
888
+ "page_idx": 3
889
+ },
890
+ {
891
+ "type": "text",
892
+ "text": "Datasets. We evaluate both baselines and our method on math and coding reasoning tasks: (a)",
893
+ "bbox": [
894
+ 507,
895
+ 889,
896
+ 882,
897
+ 921
898
+ ],
899
+ "page_idx": 3
900
+ },
901
+ {
902
+ "type": "page_number",
903
+ "text": "5244",
904
+ "bbox": [
905
+ 480,
906
+ 927,
907
+ 519,
908
+ 940
909
+ ],
910
+ "page_idx": 3
911
+ },
912
+ {
913
+ "type": "table",
914
+ "img_path": "images/6482624251e107de6c9f882c0270a3465262710130f70e373520993e9f207caf.jpg",
915
+ "table_caption": [],
916
+ "table_footnote": [],
917
+ "table_body": "<table><tr><td>Method</td><td>MATH</td><td>GSM8K</td><td>MBPP</td><td>HumanEval</td><td>Avg.</td></tr><tr><td colspan=\"6\">Llama-3.1-8B-Instruct</td></tr><tr><td>Revision (Snell et al., 2024)</td><td>0.2960</td><td>0.4570</td><td>0.2991</td><td>0.3889</td><td>0.3603</td></tr><tr><td>Beam Search (Ow and Morton, 1988)</td><td>0.2560</td><td>0.4842</td><td>0.1869</td><td>0.2407</td><td>0.2920</td></tr><tr><td>Self-Consistency (Wang et al., 2023)</td><td>0.30000.0057</td><td>0.45250.0111</td><td>0.13710.0180</td><td>0.12350.0531</td><td>0.2533</td></tr><tr><td>Self-Refine (Madaan et al., 2023)</td><td>0.46930.0207</td><td>0.78280.0064</td><td>0.23050.0088</td><td>0.29630.0800</td><td>0.4447</td></tr><tr><td>Best-of-N (Brown et al., 2024)</td><td>0.64270.0154</td><td>0.80690.0043</td><td>0.54520.0154</td><td>0.67280.0087</td><td>0.6669</td></tr><tr><td>FTTT</td><td>0.67070.0222</td><td>0.81000.0037</td><td>0.56070.0212</td><td>0.68520.0302</td><td>0.6817</td></tr><tr><td>+ w/o Self-Reflected Feedback</td><td>0.67200.0113</td><td>0.80540.0133</td><td>0.54050.0117</td><td>0.67900.0087</td><td>0.6742</td></tr><tr><td colspan=\"6\">Mistral-7B-Instruct-v0.3</td></tr><tr><td>Revision (Snell et al., 2024)</td><td>0.0497</td><td>0.1686</td><td>0.1351</td><td>0.1000</td><td>0.1134</td></tr><tr><td>Beam Search (Ow and Morton, 1988)</td><td>0.1783</td><td>0.4537</td><td>0.1318</td><td>0.1600</td><td>0.2310</td></tr><tr><td>Self-Consistency (Wang et al., 2023)</td><td>0.16180.0011</td><td>0.35490.0052</td><td>0.12430.0135</td><td>0.10330.0236</td><td>0.1861</td></tr><tr><td>Self-Refine (Madaan et al., 2023)</td><td>0.12870.0139</td><td>0.33120.0078</td><td>0.23470.0091</td><td>0.35330.0309</td><td>0.2620</td></tr><tr><td>Best-of-N (Brown et al., 2024)</td><td>0.46880.0138</td><td>0.78070.0055</td><td>0.49620.0171</td><td>0.65000.0141</td><td>0.5989</td></tr><tr><td>FTTT</td><td>0.47330.0087</td><td>0.78200.0045</td><td>0.49620.0015</td><td>0.66330.0125</td><td>0.6037</td></tr><tr><td>+ w/o Self-Reflected Feedback</td><td>0.48760.0133</td><td>0.78580.0021</td><td>0.49410.0040</td><td>0.68330.0205</td><td>0.6127</td></tr></table>",
918
+ "bbox": [
919
+ 117,
920
+ 80,
921
+ 878,
922
+ 381
923
+ ],
924
+ "page_idx": 4
925
+ },
926
+ {
927
+ "type": "text",
928
+ "text": "Table 2: Experimental results on four datasets with a budget of 32. For stochastic algorithms, we report the mean of three runs with different random seeds and standard deviation in the subscript. Bold entries are the best results, and underlined entries are the second-best results.",
929
+ "bbox": [
930
+ 112,
931
+ 388,
932
+ 882,
933
+ 432
934
+ ],
935
+ "page_idx": 4
936
+ },
937
+ {
938
+ "type": "text",
939
+ "text": "Mathematical reasoning: MATH (Hendrycks et al., 2021) and GSM8K (Cobbe et al., 2021), using the test split from Lightman et al. (2024) for MATH. (b) Code generation: MBPP (Austin et al., 2021) and HumanEval (Chen et al., 2021). For all datasets, we report results on subsets where models fail with greedy decoding. We use Exact Match as the evaluation metric as well as the verifier for math tasks and Pass@1 for code.",
940
+ "bbox": [
941
+ 112,
942
+ 458,
943
+ 487,
944
+ 602
945
+ ],
946
+ "page_idx": 4
947
+ },
948
+ {
949
+ "type": "text",
950
+ "text": "Models. We conduct experiments with Llama-3.1-8B-Instruct (Dubey et al., 2024) and Mistral-7B-Instruct-v0.3 (Jiang et al., 2023). We evaluate both models with zero-shot prompting and follow the official instructions when evaluating the model on each dataset<sup>2</sup>.",
951
+ "bbox": [
952
+ 112,
953
+ 614,
954
+ 487,
955
+ 709
956
+ ],
957
+ "page_idx": 4
958
+ },
959
+ {
960
+ "type": "text",
961
+ "text": "Baselines. We compare FTTT with the following test-time scaling methods:",
962
+ "bbox": [
963
+ 112,
964
+ 722,
965
+ 485,
966
+ 753
967
+ ],
968
+ "page_idx": 4
969
+ },
970
+ {
971
+ "type": "list",
972
+ "sub_type": "text",
973
+ "list_items": [
974
+ "- Beam Search (Ow and Morton, 1988) is a popular search algorithm that approximates the most confident model prediction.",
975
+ "- Self-Consistency (Wang et al., 2023) samples multiple predictions and selects the most frequent answer.",
976
+ "- Best-of-N (Brown et al., 2024) samples $N$ predictions independently and picks the best"
977
+ ],
978
+ "bbox": [
979
+ 136,
980
+ 755,
981
+ 487,
982
+ 883
983
+ ],
984
+ "page_idx": 4
985
+ },
986
+ {
987
+ "type": "text",
988
+ "text": "one based on external feedback.",
989
+ "bbox": [
990
+ 544,
991
+ 458,
992
+ 784,
993
+ 472
994
+ ],
995
+ "page_idx": 4
996
+ },
997
+ {
998
+ "type": "list",
999
+ "sub_type": "text",
1000
+ "list_items": [
1001
+ "- Revision (Snell et al., 2024) iteratively refines answers by conditioning the model on previous attempts. We pick the best answer according to feedback.",
1002
+ "- Self-Refine (Madaan et al., 2023) alternates between self-critique and refinement. We select the best solution based on feedback."
1003
+ ],
1004
+ "bbox": [
1005
+ 531,
1006
+ 474,
1007
+ 882,
1008
+ 586
1009
+ ],
1010
+ "page_idx": 4
1011
+ },
1012
+ {
1013
+ "type": "text",
1014
+ "text": "For sampling-based methods, we use nucleus sampling (Holtzman et al., 2020) with a temperature of 0.6 and $p = 0.95$ , following Brown et al. (2024). All methods are allocated a budget of 32. For FTTT, we fine-tune the model with LoRA (Hu et al., 2022), using a rank of 4 and a dropout ratio of 0.05. We use the Adam optimizer (Kingma and Ba, 2015) with a learning rate of 1e-5, except for Mistral-7B-Instruct-v0.3 in coding tasks, where we use 2e-5.",
1015
+ "bbox": [
1016
+ 507,
1017
+ 593,
1018
+ 884,
1019
+ 753
1020
+ ],
1021
+ "page_idx": 4
1022
+ },
1023
+ {
1024
+ "type": "text",
1025
+ "text": "As OPTUNE is a specialized PEFT method, we compare it with the following PEFT approaches: Adapter (Houlsby et al., 2019), $(\\mathbf{IA})^3$ (Liu et al., 2022), LoRA (Hu et al., 2022) and LN-Tuning (Zhao et al., 2024). We also include full fine-tuning that updates all LLM weights. For OPTUNE, $r = 16$ and the dropout ratio is 0.1. We only apply OPTUNE to the query and value projections in the last two layers of the LLM. Detailed configurations are in Appendix A.",
1026
+ "bbox": [
1027
+ 507,
1028
+ 760,
1029
+ 884,
1030
+ 921
1031
+ ],
1032
+ "page_idx": 4
1033
+ },
1034
+ {
1035
+ "type": "page_footnote",
1036
+ "text": "$^{2}$ https://huggingface.co/datasets/meta-llama/Llama-3.1-8B-Instruct-evals",
1037
+ "bbox": [
1038
+ 112,
1039
+ 894,
1040
+ 470,
1041
+ 919
1042
+ ],
1043
+ "page_idx": 4
1044
+ },
1045
+ {
1046
+ "type": "page_number",
1047
+ "text": "5245",
1048
+ "bbox": [
1049
+ 480,
1050
+ 928,
1051
+ 519,
1052
+ 940
1053
+ ],
1054
+ "page_idx": 4
1055
+ },
1056
+ {
1057
+ "type": "image",
1058
+ "img_path": "images/bf3377f742d2ad2a8b2fc8422678ff5183a2d691bb382e0442fb867a5a292f4e.jpg",
1059
+ "image_caption": [
1060
+ "Figure 3: The scaling trends of different methods under varying budgets. The colored area around the line denotes the standard deviation. The first row is the results of Llama-3.1-8B-Instruct and the second row is Mistral-7B-Instruct-v0.3."
1061
+ ],
1062
+ "image_footnote": [],
1063
+ "bbox": [
1064
+ 126,
1065
+ 84,
1066
+ 873,
1067
+ 372
1068
+ ],
1069
+ "page_idx": 5
1070
+ },
1071
+ {
1072
+ "type": "text",
1073
+ "text": "4.2 Test-Time Scaling Results",
1074
+ "text_level": 1,
1075
+ "bbox": [
1076
+ 112,
1077
+ 453,
1078
+ 363,
1079
+ 469
1080
+ ],
1081
+ "page_idx": 5
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "Table 2 compares FTTT with various baselines across four reasoning datasets. FTTT, both with and without self-reflected feedback, outperforms conventional test-time scaling methods on average. This success is partially explained by the findings of Ye et al. (2024a), which show that training with error-correction data enhances reasoning capabilities and models barely retry during inference. FTTT is also efficient. For instance, the inference time of L1ama-3.1-8B-Instruct on GSM8K with a budget of 32 is 3 GPU hours for the best parallel sampling method (Best-of-N) and 20 GPU hours for the best sequential revision method (Self-Refine). In contrast, FTTT achieves inference times of approximately 3 GPU hours without self-reflected feedback and 4 GPU hours with self-reflected feedback.",
1086
+ "bbox": [
1087
+ 112,
1088
+ 482,
1089
+ 489,
1090
+ 755
1091
+ ],
1092
+ "page_idx": 5
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "Notably, self-reflected feedback does not always improve results. Its effectiveness appears to depend on the LLM's self-reflection ability. To test this, we computed the Spearman rank correlation between FTTT and Self-Refine, a self-reflection-based algorithm. The Spearman coefficient $(r = 0.8656$ , $p \\leq 0.05)$ indicates a strong positive correlation, supporting our hypothesis. We also observe that Self-Consistency performs poorly on code tasks because sampled code snippets rarely match exactly,",
1097
+ "bbox": [
1098
+ 112,
1099
+ 760,
1100
+ 489,
1101
+ 921
1102
+ ],
1103
+ "page_idx": 5
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "making majority voting akin to random selection.",
1108
+ "bbox": [
1109
+ 507,
1110
+ 453,
1111
+ 877,
1112
+ 469
1113
+ ],
1114
+ "page_idx": 5
1115
+ },
1116
+ {
1117
+ "type": "text",
1118
+ "text": "Figure 3 illustrates performance for FTTT and baselines under varying budgets. FTTT consistently outperforms baselines, with greater gains under constrained budgets. In contrast, Revision and Self-Consistency do not scale well. Revision struggles with long-context reasoning due to length generalization issues (Li et al., 2024), while Self-Consistency fails to leverage feedback, often discarding correct answers during majority voting due to long-tailed distributions of correct answers (Brown et al., 2024).",
1119
+ "bbox": [
1120
+ 507,
1121
+ 469,
1122
+ 884,
1123
+ 645
1124
+ ],
1125
+ "page_idx": 5
1126
+ },
1127
+ {
1128
+ "type": "text",
1129
+ "text": "4.3 Fine-Tuning Results",
1130
+ "text_level": 1,
1131
+ "bbox": [
1132
+ 507,
1133
+ 658,
1134
+ 714,
1135
+ 674
1136
+ ],
1137
+ "page_idx": 5
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "We present the results of PEFT baselines and OPTUNE with a budget of 32 in Table 3. Best-of-N is applied to PEFT baselines to exploit test-time feedback. HumanEval is excluded as it lacks a training set. Table 3 highlights the effectiveness of OPTUNE, outperforming all PEFT baselines by at least $2.58\\%$ on average. OPTUNE is also parameter-efficient, with 439K trainable parameters that are comparable to the most lightweight PEFT method (LN-Tuning, 266K parameters), while surpassing the best PEFT method (LoRA, 1.7M parameters) with an order of magnitude fewer parameters. However, OPTUNE shows suboptimal performance on MATH for Mistral-7B-Instruct-v0.3, which is consistent",
1142
+ "bbox": [
1143
+ 505,
1144
+ 678,
1145
+ 884,
1146
+ 920
1147
+ ],
1148
+ "page_idx": 5
1149
+ },
1150
+ {
1151
+ "type": "page_number",
1152
+ "text": "5246",
1153
+ "bbox": [
1154
+ 480,
1155
+ 928,
1156
+ 521,
1157
+ 940
1158
+ ],
1159
+ "page_idx": 5
1160
+ },
1161
+ {
1162
+ "type": "table",
1163
+ "img_path": "images/a140dfa4db06d88f53579ec80d89e83d21fd60c27a92ded13e21749904320783.jpg",
1164
+ "table_caption": [],
1165
+ "table_footnote": [],
1166
+ "table_body": "<table><tr><td>Method</td><td>#Param.</td><td>MATH</td><td>GSM8K</td><td>MBPP</td><td>Avg.</td></tr><tr><td colspan=\"6\">Llama-3.1-8B-Instruct</td></tr><tr><td>Adapter (Houlsby et al., 2019)</td><td>134M</td><td>0.59330.0151</td><td>0.79790.0056</td><td>0.26320.0058</td><td>0.5515</td></tr><tr><td>(IA)3(Liu et al., 2022)</td><td>524K</td><td>0.61870.0105</td><td>0.89290.0107</td><td>0.56850.0022</td><td>0.6934</td></tr><tr><td>LoRA (Hu et al., 2022)</td><td>1.7M</td><td>0.63870.0136</td><td>0.91860.0037</td><td>0.56390.0242</td><td>0.7071</td></tr><tr><td>LN-Tuning (Zhao et al., 2024)</td><td>266K</td><td>0.62800.0113</td><td>0.88990.0056</td><td>0.57480.0175</td><td>0.6976</td></tr><tr><td>Full Fine-Tuning</td><td>8B</td><td>0.60270.0136</td><td>0.77220.0056</td><td>0.40340.0096</td><td>0.5928</td></tr><tr><td>OPTUNE</td><td>439K</td><td>0.70130.0050</td><td>0.92460.0056</td><td>0.61840.0159</td><td>0.7481</td></tr><tr><td colspan=\"6\">Mistral-7B-Instruct-v0.3</td></tr><tr><td>Adapter (Houlsby et al., 2019)</td><td>134M</td><td>0.54180.0111</td><td>0.82640.0021</td><td>0.27630.0076</td><td>0.5482</td></tr><tr><td>(IA)3(Liu et al., 2022)</td><td>524K</td><td>0.50410.0056</td><td>0.86860.0060</td><td>0.49140.0185</td><td>0.6214</td></tr><tr><td>LoRA (Hu et al., 2022)</td><td>1.7M</td><td>0.51170.0091</td><td>0.86860.0016</td><td>0.49680.0046</td><td>0.6257</td></tr><tr><td>LN-Tuning (Zhao et al., 2024)</td><td>266K</td><td>0.43570.0115</td><td>0.82590.0051</td><td>0.40650.0095</td><td>0.5560</td></tr><tr><td>Full Fine-Tuning</td><td>7B</td><td>0.53880.0157</td><td>0.73550.0016</td><td>0.25480.0095</td><td>0.5097</td></tr><tr><td>OPTUNE</td><td>439K</td><td>0.48910.0111</td><td>0.90030.0039</td><td>0.51940.0070</td><td>0.6363</td></tr></table>",
1167
+ "bbox": [
1168
+ 179,
1169
+ 80,
1170
+ 821,
1171
+ 311
1172
+ ],
1173
+ "page_idx": 6
1174
+ },
1175
+ {
1176
+ "type": "text",
1177
+ "text": "Table 3: Fine-tuning results on four datasets with a budget of 32. #Param. denotes the number of trainable parameters. We report the mean of three runs with different random seeds and standard deviation in the subscript. Bold entries are the best results.",
1178
+ "bbox": [
1179
+ 112,
1180
+ 319,
1181
+ 884,
1182
+ 363
1183
+ ],
1184
+ "page_idx": 6
1185
+ },
1186
+ {
1187
+ "type": "image",
1188
+ "img_path": "images/10b81f34ad1a0c1839df621d1c9bffbbdc547b464dc7564da48a1ab5b2b28068.jpg",
1189
+ "image_caption": [
1190
+ "Figure 4: The scaling trends of different fine-tuning methods under varying budgets. We report the mean results of three random trials. The first row is the results of Llama-3.1-8B-Instruct and the second row is Mistral-7B-Instruct-v0.3."
1191
+ ],
1192
+ "image_footnote": [],
1193
+ "bbox": [
1194
+ 124,
1195
+ 379,
1196
+ 872,
1197
+ 612
1198
+ ],
1199
+ "page_idx": 6
1200
+ },
1201
+ {
1202
+ "type": "text",
1203
+ "text": "with other PEFT methods with few trainable parameters (e.g., $(\\mathrm{IA})^3$ , LoRA, LN-Tuning). This is likely due to Mistral-7B-Instruct-v0.3's limited mathematical reasoning capabilities, requiring significant parameter updates to improve performance in this domain.",
1204
+ "bbox": [
1205
+ 112,
1206
+ 695,
1207
+ 487,
1208
+ 789
1209
+ ],
1210
+ "page_idx": 6
1211
+ },
1212
+ {
1213
+ "type": "text",
1214
+ "text": "OPTUNE incurs negligible inference overhead. For example, on GSM8K with Llama-3.1-8B-Instruct and a budget of 32, the best test-time scaling baseline (FTTT) requires 4 GPU hours, whereas OPTUNE uses only 1.5 GPU hours, benefiting from shorter yet accurate predictions.",
1215
+ "bbox": [
1216
+ 112,
1217
+ 791,
1218
+ 487,
1219
+ 903
1220
+ ],
1221
+ "page_idx": 6
1222
+ },
1223
+ {
1224
+ "type": "text",
1225
+ "text": "Finally, Figure 4 examines the scaling behavior",
1226
+ "bbox": [
1227
+ 131,
1228
+ 904,
1229
+ 489,
1230
+ 921
1231
+ ],
1232
+ "page_idx": 6
1233
+ },
1234
+ {
1235
+ "type": "text",
1236
+ "text": "ior of PEFT baselines and OPTUNE. Initially, OPTUNE underperforms compared to other PEFT methods and FTTT, but it mostly achieves superior results when the budget exceeds 2. OPTUNE's weaker performance with smaller budgets arises from its reliance on an initial attempt sampled from the raw LLM to initiate the process. This initial attempt often fails but is still counted as a valid attempt, making OPTUNE less competitive in low-budget settings.",
1237
+ "bbox": [
1238
+ 507,
1239
+ 694,
1240
+ 884,
1241
+ 854
1242
+ ],
1243
+ "page_idx": 6
1244
+ },
1245
+ {
1246
+ "type": "text",
1247
+ "text": "4.4 Analysis",
1248
+ "text_level": 1,
1249
+ "bbox": [
1250
+ 507,
1251
+ 868,
1252
+ 623,
1253
+ 883
1254
+ ],
1255
+ "page_idx": 6
1256
+ },
1257
+ {
1258
+ "type": "text",
1259
+ "text": "Ablation Study. Table 5 presents an ablation study on the architecture design of OPTUNE. The",
1260
+ "bbox": [
1261
+ 507,
1262
+ 889,
1263
+ 882,
1264
+ 921
1265
+ ],
1266
+ "page_idx": 6
1267
+ },
1268
+ {
1269
+ "type": "page_number",
1270
+ "text": "5247",
1271
+ "bbox": [
1272
+ 480,
1273
+ 928,
1274
+ 519,
1275
+ 940
1276
+ ],
1277
+ "page_idx": 6
1278
+ },
1279
+ {
1280
+ "type": "text",
1281
+ "text": "Question: Blake and Kelly are having a contest to see who can run the most in 15 minutes. They decide to do it on a football field that is 100 yards long. Blake runs back and forth 15 times. Kelly runs back and forth once, and then decides that she doesn't want to run next to Blake, so she starts to run to the 40-yard line and back. She does this 34 times. How much farther does the winner run than the loser?",
1282
+ "bbox": [
1283
+ 126,
1284
+ 89,
1285
+ 529,
1286
+ 172
1287
+ ],
1288
+ "page_idx": 7
1289
+ },
1290
+ {
1291
+ "type": "text",
1292
+ "text": "LoRA: Blake runs $15 * 100 * 2 = 3000$ yards.",
1293
+ "bbox": [
1294
+ 126,
1295
+ 184,
1296
+ 410,
1297
+ 197
1298
+ ],
1299
+ "page_idx": 7
1300
+ },
1301
+ {
1302
+ "type": "text",
1303
+ "text": "Kelly runs $100 * 2 = 200$ yards for each run to the 40-yard line and back.",
1304
+ "bbox": [
1305
+ 126,
1306
+ 197,
1307
+ 527,
1308
+ 219
1309
+ ],
1310
+ "page_idx": 7
1311
+ },
1312
+ {
1313
+ "type": "text",
1314
+ "text": "Kelly runs $200 * 34 = 6800$ yards.",
1315
+ "bbox": [
1316
+ 127,
1317
+ 219,
1318
+ 334,
1319
+ 231
1320
+ ],
1321
+ "page_idx": 7
1322
+ },
1323
+ {
1324
+ "type": "text",
1325
+ "text": "Kelly runs $6800 - 3000 = 3800$ yards more than Blake.",
1326
+ "bbox": [
1327
+ 127,
1328
+ 231,
1329
+ 460,
1330
+ 244
1331
+ ],
1332
+ "page_idx": 7
1333
+ },
1334
+ {
1335
+ "type": "text",
1336
+ "text": "The final answer is $3800 \\times$",
1337
+ "bbox": [
1338
+ 127,
1339
+ 244,
1340
+ 297,
1341
+ 256
1342
+ ],
1343
+ "page_idx": 7
1344
+ },
1345
+ {
1346
+ "type": "text",
1347
+ "text": "OPTUNE: Blake runs back and forth 15 times, and each time, he runs 100 yards twice because he runs to one end of the field and back. So, Blake's total running distance is $15 \\times 200 = 3000$ yards. Kelly runs back and forth once, which is 200 yards, and then runs to the 40-yard line and back, which is $40 \\times 2 = 80$ yards, and does this 34 times. Kelly's total running distance is $200 + (34 \\times 80) = 200 + 2720 = 2920$ yards.",
1348
+ "bbox": [
1349
+ 126,
1350
+ 267,
1351
+ 527,
1352
+ 350
1353
+ ],
1354
+ "page_idx": 7
1355
+ },
1356
+ {
1357
+ "type": "text",
1358
+ "text": "Therefore, Blake runs $3000 - 2920 = 80$ yards farther than Kelly. The final answer is $80 \\checkmark$ .",
1359
+ "bbox": [
1360
+ 126,
1361
+ 351,
1362
+ 519,
1363
+ 374
1364
+ ],
1365
+ "page_idx": 7
1366
+ },
1367
+ {
1368
+ "type": "text",
1369
+ "text": "Question: Josh decides to take up juggling to perform at the school talent show a month in the future. He starts off practicing juggling 3 balls, and slowly gets better adding 1 ball to his juggling act each week. After the end of the fourth week the talent show begins, but when Josh walks on stage he slips and drops three of his balls. 2 of them are caught by people in the crowd as they roll off the stage, but one gets lost completely since the auditorium is dark. With a sigh, Josh starts to juggle on stage with how many balls?",
1370
+ "bbox": [
1371
+ 541,
1372
+ 89,
1373
+ 870,
1374
+ 210
1375
+ ],
1376
+ "page_idx": 7
1377
+ },
1378
+ {
1379
+ "type": "text",
1380
+ "text": "LoRA: Josh started with 3 balls and added 1 ball each week for 4 weeks, so he had $3 + 4 = 7$ balls.",
1381
+ "bbox": [
1382
+ 542,
1383
+ 219,
1384
+ 868,
1385
+ 243
1386
+ ],
1387
+ "page_idx": 7
1388
+ },
1389
+ {
1390
+ "type": "text",
1391
+ "text": "He dropped 3 balls, but 2 were caught, so he lost 3 - 2 = 1 ball.",
1392
+ "bbox": [
1393
+ 542,
1394
+ 244,
1395
+ 868,
1396
+ 267
1397
+ ],
1398
+ "page_idx": 7
1399
+ },
1400
+ {
1401
+ "type": "text",
1402
+ "text": "He was left with $7 - 1 = 6$ balls.",
1403
+ "bbox": [
1404
+ 542,
1405
+ 267,
1406
+ 737,
1407
+ 279
1408
+ ],
1409
+ "page_idx": 7
1410
+ },
1411
+ {
1412
+ "type": "text",
1413
+ "text": "The final answer is $6 \\times$",
1414
+ "bbox": [
1415
+ 542,
1416
+ 280,
1417
+ 692,
1418
+ 291
1419
+ ],
1420
+ "page_idx": 7
1421
+ },
1422
+ {
1423
+ "type": "text",
1424
+ "text": "OPTUNE: Josh started with juggling 3 balls. After the end of the fourth week, Josh would have added 4 balls, making it a total of $3 + 4 = 7$ balls.",
1425
+ "bbox": [
1426
+ 542,
1427
+ 302,
1428
+ 868,
1429
+ 338
1430
+ ],
1431
+ "page_idx": 7
1432
+ },
1433
+ {
1434
+ "type": "text",
1435
+ "text": "Josh had 3 balls left after 2 of the balls were caught by people in the crowd, so he was left with $7 - 3 = 4$ balls.",
1436
+ "bbox": [
1437
+ 542,
1438
+ 338,
1439
+ 868,
1440
+ 363
1441
+ ],
1442
+ "page_idx": 7
1443
+ },
1444
+ {
1445
+ "type": "text",
1446
+ "text": "The final answer is $4\\checkmark$",
1447
+ "bbox": [
1448
+ 542,
1449
+ 363,
1450
+ 694,
1451
+ 374
1452
+ ],
1453
+ "page_idx": 7
1454
+ },
1455
+ {
1456
+ "type": "table",
1457
+ "img_path": "images/bcf27fc5b28998c66872a1486274524d9d5d6fec90f03bf6c80babdffc60b460.jpg",
1458
+ "table_caption": [
1459
+ "Table 4: Two GSM8K examples with model predictions. $\\checkmark$ means correct and $x$ means incorrect. Sentences marked in orange are incorrect reasoning steps and those marked in blue are the correct counterparts."
1460
+ ],
1461
+ "table_footnote": [],
1462
+ "table_body": "<table><tr><td>Method</td><td>#Params.</td><td>Pass@1</td></tr><tr><td>OPTUNE</td><td>439K</td><td>0.2600</td></tr><tr><td>+ w/o Dropout</td><td>439K</td><td>0.2243</td></tr><tr><td>+ w/o Norm</td><td>439K</td><td>0.2150</td></tr><tr><td>+ Not Share θ1 &amp; θ2</td><td>878K</td><td>0.2243</td></tr></table>",
1463
+ "bbox": [
1464
+ 156,
1465
+ 444,
1466
+ 445,
1467
+ 521
1468
+ ],
1469
+ "page_idx": 7
1470
+ },
1471
+ {
1472
+ "type": "text",
1473
+ "text": "Table 5: The ablation study of OPTUNE. We report results of Llama-3.1-8B-Instruct on MBPP with a budget of 2.",
1474
+ "bbox": [
1475
+ 112,
1476
+ 531,
1477
+ 485,
1478
+ 575
1479
+ ],
1480
+ "page_idx": 7
1481
+ },
1482
+ {
1483
+ "type": "text",
1484
+ "text": "results demonstrate that all components are essential, as removing any of them significantly degrades performance. Notably, normalization is the most critical component, as it makes the input gradient scales more stable.",
1485
+ "bbox": [
1486
+ 112,
1487
+ 600,
1488
+ 487,
1489
+ 678
1490
+ ],
1491
+ "page_idx": 7
1492
+ },
1493
+ {
1494
+ "type": "text",
1495
+ "text": "Case Study. Table 4 provides two examples on GSM8K where the leading PEFT method, LoRA, fails, but OPTUNE succeeds using Llama-3.1-8B-Instruct. These examples highlight OPTUNE's superior ability to correctly interpret and reason through questions, unlike LoRA.",
1496
+ "bbox": [
1497
+ 112,
1498
+ 690,
1499
+ 487,
1500
+ 785
1501
+ ],
1502
+ "page_idx": 7
1503
+ },
1504
+ {
1505
+ "type": "text",
1506
+ "text": "5 Related Work",
1507
+ "text_level": 1,
1508
+ "bbox": [
1509
+ 112,
1510
+ 799,
1511
+ 268,
1512
+ 814
1513
+ ],
1514
+ "page_idx": 7
1515
+ },
1516
+ {
1517
+ "type": "text",
1518
+ "text": "Learning from Feedback. Other than the heuristic binary feedback studied in this work, prior research has explored feedback from various sources, such as humans (Ouyang et al., 2022), other models (Yang et al., 2022), tools (Schick et al., 2023), and knowledge bases (Gao et al., 2023). This pa",
1519
+ "bbox": [
1520
+ 112,
1521
+ 824,
1522
+ 489,
1523
+ 921
1524
+ ],
1525
+ "page_idx": 7
1526
+ },
1527
+ {
1528
+ "type": "text",
1529
+ "text": "per focuses on demonstrating the effectiveness of the proposed method and other feedback types are beyond the scope of this paper.",
1530
+ "bbox": [
1531
+ 507,
1532
+ 447,
1533
+ 882,
1534
+ 495
1535
+ ],
1536
+ "page_idx": 7
1537
+ },
1538
+ {
1539
+ "type": "text",
1540
+ "text": "Test-Time Training. Test-Time Training (TTT) has shown success in the image modality by addressing distribution shifts and enhancing model capacity through self-supervised fine-tuning on each test case (Sun et al., 2020; Liu et al., 2021; Sun et al., 2023). Recent studies have extended TTT to the text modality (Hardt and Sun, 2024; Wang et al., 2024). The most relevant work, by Akyurek et al. (2024), uses TTT to enhance the reasoning ability of LLMs. However, their method relies heavily on human scaffolding for self-supervision and does not generalize beyond ARC-AGI (Chollet, 2019). In contrast, FTTT is generally applicable.",
1541
+ "bbox": [
1542
+ 507,
1543
+ 507,
1544
+ 882,
1545
+ 715
1546
+ ],
1547
+ "page_idx": 7
1548
+ },
1549
+ {
1550
+ "type": "text",
1551
+ "text": "Learning to Optimize. Learning to Optimize (L2O) trains a network to act as an optimizer for another network (Chen et al., 2022). Early approaches used reinforcement learning to train such optimizers (Li and Malik, 2017; Chen et al., 2017), while recent work focuses on discovering analytical white-box optimizers (Bello et al., 2017; Chen et al., 2023). The most relevant work, MEND (Mitchell et al., 2022), trains a network to predict weight updates from training gradients. OPTUNE builds on this idea, extending it to learn from test-time feedback with a distinct architecture.",
1552
+ "bbox": [
1553
+ 507,
1554
+ 728,
1555
+ 884,
1556
+ 919
1557
+ ],
1558
+ "page_idx": 7
1559
+ },
1560
+ {
1561
+ "type": "page_number",
1562
+ "text": "5248",
1563
+ "bbox": [
1564
+ 480,
1565
+ 928,
1566
+ 519,
1567
+ 940
1568
+ ],
1569
+ "page_idx": 7
1570
+ },
1571
+ {
1572
+ "type": "text",
1573
+ "text": "6 Conclusion",
1574
+ "text_level": 1,
1575
+ "bbox": [
1576
+ 114,
1577
+ 84,
1578
+ 247,
1579
+ 98
1580
+ ],
1581
+ "page_idx": 8
1582
+ },
1583
+ {
1584
+ "type": "text",
1585
+ "text": "In this paper, we propose a novel paradigm that leverages optimization to address the challenge of exploiting test-time feedback, resulting in improved scaling performance. We further present a learnable test-time optimizer, OPTUNE, which surpasses various PEFT baselines. Both FTTT and OPTUNE are efficient in terms of speed and trainable parameter count.",
1586
+ "bbox": [
1587
+ 112,
1588
+ 108,
1589
+ 490,
1590
+ 237
1591
+ ],
1592
+ "page_idx": 8
1593
+ },
1594
+ {
1595
+ "type": "text",
1596
+ "text": "Limitations",
1597
+ "text_level": 1,
1598
+ "bbox": [
1599
+ 114,
1600
+ 247,
1601
+ 220,
1602
+ 263
1603
+ ],
1604
+ "page_idx": 8
1605
+ },
1606
+ {
1607
+ "type": "text",
1608
+ "text": "The current evaluation setting limits FTTT's potential by providing only binary feedback (i.e., correct or incorrect) for each attempt. However, developing complex reasoning environments with rich feedback is beyond the scope of this work. Additionally, while continuous feedback, such as that from reward models (Yang et al., 2024), has been extensively studied, it is not examined here. Our method can be adapted to continuous feedback with minimal modifications, such as using REINFORCE (Williams, 1992). For coherence, we leave this exploration to future work.",
1609
+ "bbox": [
1610
+ 112,
1611
+ 272,
1612
+ 489,
1613
+ 464
1614
+ ],
1615
+ "page_idx": 8
1616
+ },
1617
+ {
1618
+ "type": "text",
1619
+ "text": "Acknowledgments",
1620
+ "text_level": 1,
1621
+ "bbox": [
1622
+ 114,
1623
+ 476,
1624
+ 278,
1625
+ 493
1626
+ ],
1627
+ "page_idx": 8
1628
+ },
1629
+ {
1630
+ "type": "text",
1631
+ "text": "This work is supported by National Key R&D Program of China (Project No. 2022ZD0161200, 2022ZD0161201). This work is also supported by the Research Grants Council of the HKSAR - Early Career Scheme (Grant No. 24200223) and Hong Kong Innovation and Technology Commission Project No. ITS/228/22FP. It is also partially supported by RGC Senior Research Fellow Scheme Ref. No. SRFS2425-4S03.",
1632
+ "bbox": [
1633
+ 112,
1634
+ 500,
1635
+ 489,
1636
+ 643
1637
+ ],
1638
+ "page_idx": 8
1639
+ },
1640
+ {
1641
+ "type": "text",
1642
+ "text": "References",
1643
+ "text_level": 1,
1644
+ "bbox": [
1645
+ 114,
1646
+ 671,
1647
+ 213,
1648
+ 686
1649
+ ],
1650
+ "page_idx": 8
1651
+ },
1652
+ {
1653
+ "type": "list",
1654
+ "sub_type": "ref_text",
1655
+ "list_items": [
1656
+ "Ekin Akyurek, Mehul Damani, Linlu Qiu, Han Guo, Yoon Kim, and Jacob Andreas. 2024. The surprising effectiveness of test-time training for abstract reasoning. Preprint, arXiv:2411.07279.",
1657
+ "Jacob Austin, Augustus Odena, Maxwell I. Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie J. Cai, Michael Terry, Quoc V. Le, and Charles Sutton. 2021. Program synthesis with large language models. CoRR, abs/2108.07732.",
1658
+ "Jimmy Ba, Geoffrey E. Hinton, Volodymyr Mnih, Joel Z. Leibo, and Catalin Ionescu. 2016. Using fast weights to attend to the recent past. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 4331-4339."
1659
+ ],
1660
+ "bbox": [
1661
+ 115,
1662
+ 693,
1663
+ 489,
1664
+ 921
1665
+ ],
1666
+ "page_idx": 8
1667
+ },
1668
+ {
1669
+ "type": "list",
1670
+ "sub_type": "ref_text",
1671
+ "list_items": [
1672
+ "Irwan Bello, Barret Zoph, Vijay Vasudevan, and Quoc V. Le. 2017. Neural optimizer search with reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pages 459-468. PMLR.",
1673
+ "Bradley C. A. Brown, Jordan Juravsky, Ryan Saul Ehrlich, Ronald Clark, Quoc V. Le, Christopher Ré, and Azalia Mirhoseini. 2024. Large language monkeys: Scaling inference compute with repeated sampling. CoRR, abs/2407.21787.",
1674
+ "Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidi Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Joshua Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. 2021. Evaluating large language models trained on code. CoRR, abs/2107.03374.",
1675
+ "Tianlong Chen, Xiaohan Chen, Wuyang Chen, Howard Heaton, Jialin Liu, Zhangyang Wang, and Wotao Yin. 2022. Learning to optimize: A primer and A benchmark. J. Mach. Learn. Res., 23:189:1-189:59.",
1676
+ "Xiangning Chen, Chen Liang, Da Huang, Esteban Real, Kaiyuan Wang, Hieu Pham, Xuanyi Dong, Thang Luong, Cho-Jui Hsieh, Yifeng Lu, and Quoc V. Le. 2023. Symbolic discovery of optimization algorithms. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.",
1677
+ "Yutian Chen, Matthew W. Hoffman, Sergio Gomez Colmenarejo, Misha Denil, Timothy P. Lillicrap, Matthew M. Botvinick, and Nando de Freitas. 2017. Learning to learn without gradient descent by gradient descent. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pages 748-756. PMLR.",
1678
+ "François Chollet. 2019. On the measure of intelligence. Preprint, arXiv:1911.01547.",
1679
+ "Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias"
1680
+ ],
1681
+ "bbox": [
1682
+ 510,
1683
+ 85,
1684
+ 884,
1685
+ 920
1686
+ ],
1687
+ "page_idx": 8
1688
+ },
1689
+ {
1690
+ "type": "page_number",
1691
+ "text": "5249",
1692
+ "bbox": [
1693
+ 480,
1694
+ 928,
1695
+ 519,
1696
+ 940
1697
+ ],
1698
+ "page_idx": 8
1699
+ },
1700
+ {
1701
+ "type": "list",
1702
+ "sub_type": "ref_text",
1703
+ "list_items": [
1704
+ "Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. 2021. Training verifiers to solve math word problems. CoRR, abs/2110.14168.",
1705
+ "Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, Anirudh Goyal, Anthony Hartshorn, Aobo Yang, Archi Mitra, Archie Sravankumar, Artem Korenev, Arthur Hinsvark, Arun Rao, Aston Zhang, Aurélien Rodriguez, Austen Gregerson, Ava Spataru, Baptiste Rozière, Bethany Biron, Binh Tang, Bobbie Chern, Charlotte Caucheteux, Chaya Nayak, Chloe Bi, Chris Marra, Chris McConnell, Christian Keller, Christophe Touret, Chunyang Wu, Corinne Wong, Cristian Canton Ferrer, Cyrus Nikolaidis, Damien Allonsius, Daniel Song, Danielle Pintz, Danny Livshits, David Esiobu, Dhruv Choudhary, Dhruv Mahajan, Diego Garcia-Olano, Diego Perino, Dieuwke Hupkes, Egor Lakomkin, Ehab AlBadawy, Elina Lobanova, Emily Dinan, Eric Michael Smith, Filip Radenovic, Frank Zhang, Gabriel Synnaeve, Gabrielle Lee, Georgia Lewis Anderson, Graeme Nail, Grégoire Mialon, Guan Pang, Guillem Cucurell, Hailey Nguyen, Hannah Korevaar, Hu Xu, Hugo Touvron, Iliyan Zarov, Imanol Arrieta Ibarra, Isabel M. Kloumann, Ishan Misra, Ivan Evtimov, Jade Copet, Jaewon Lee, Jan Geffert, Jana Vranes, Jason Park, Jay Mahadeokar, Jeet Shah, Jelmer van der Linde, Jennifer Billock, Jenny Hong, Jenya Lee, Jeremy Fu, Jianfeng Chi, Jianyu Huang, Jiawen Liu, Jie Wang, Jiecao Yu, Joanna Bitton, Joe Spisak, Jongsoo Park, Joseph Rocca, Joshua Johnstun, Joshua Saxe, Junteng Jia, Kalyan Vasuden Alwala, Kartikeya Upasani, Kate Plawiak, Ke Li, Kenneth Heafield, Kevin Stone, and et al. 2024. The llama 3 herd of models. CoRR abs/2407.21783.",
1706
+ "Luyu Gao, Zhuyun Dai, Panupong Pasupat, Anthony Chen, Arun Tejasvi Chaganty, Yicheng Fan, Vincent Zhao, Ni Lao, Hongrae Lee, Da-Cheng Juan, and Kelvin Guu. 2023. RARR: Researching and revising what language models say, using language models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 16477-16508, Toronto, Canada. Association for Computational Linguistics.",
1707
+ "Xinyu Guan, Li Lyna Zhang, Yifei Liu, Ning Shang, Youran Sun, Yi Zhu, Fan Yang, and Mao Yang. 2025. rstar-math: Small llms can master math reasoning with self-evolved deep thinking. Preprint, arXiv:2501.04519.",
1708
+ "Moritz Hardt and Yu Sun. 2024. Test-time training on nearest neighbors for large language models. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.",
1709
+ "Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. 2021. Measuring mathematical problem solving with the MATH dataset. In Proceedings"
1710
+ ],
1711
+ "bbox": [
1712
+ 115,
1713
+ 85,
1714
+ 489,
1715
+ 920
1716
+ ],
1717
+ "page_idx": 9
1718
+ },
1719
+ {
1720
+ "type": "list",
1721
+ "sub_type": "ref_text",
1722
+ "list_items": [
1723
+ "of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual.",
1724
+ "Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. The curious case of neural text degeneration. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net.",
1725
+ "Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-efficient transfer learning for NLP. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 2790-2799. PMLR.",
1726
+ "Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. Lora: Low-rank adaptation of large language models. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net.",
1727
+ "Jie Huang, Xinyun Chen, Swaroop Mishra, Huaixiu Steven Zheng, Adams Wei Yu, Xinying Song, and Denny Zhou. 2024. Large language models cannot self-correct reasoning yet. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.",
1728
+ "Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de Las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, Lélio Renard Lavaud, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timothee Lacroix, and William El Sayed. 2023. Mistral 7b. CoRR, abs/2310.06825.",
1729
+ "Yoon Kim and Alexander M. Rush. 2016. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1317-1327, Austin, Texas. Association for Computational Linguistics.",
1730
+ "Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings.",
1731
+ "Ke Li and Jitendra Malik. 2017. Learning to optimize. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. Open-Review.net."
1732
+ ],
1733
+ "bbox": [
1734
+ 510,
1735
+ 85,
1736
+ 884,
1737
+ 919
1738
+ ],
1739
+ "page_idx": 9
1740
+ },
1741
+ {
1742
+ "type": "page_number",
1743
+ "text": "5250",
1744
+ "bbox": [
1745
+ 480,
1746
+ 928,
1747
+ 519,
1748
+ 940
1749
+ ],
1750
+ "page_idx": 9
1751
+ },
1752
+ {
1753
+ "type": "list",
1754
+ "sub_type": "ref_text",
1755
+ "list_items": [
1756
+ "Yanyang Li, Shuo Liang, Michael Lyu, and Liwei Wang. 2024. Making long-context language models better multi-hop reasoners. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2462-2475, Bangkok, Thailand. Association for Computational Linguistics.",
1757
+ "Hunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. 2024. Let's verify step by step. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.",
1758
+ "Haokun Liu, Derek Tam, Mohammed Muqeeth, Jay Mohta, Tenghao Huang, Mohit Bansal, and Colin Raffel. 2022. Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.",
1759
+ "Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024. Lost in the middle: How language models use long contexts. Trans. Assoc. Comput. Linguistics, 12:157-173.",
1760
+ "Runze Liu, Junqi Gao, Jian Zhao, Kaiyan Zhang, Xiu Li, Biqing Qi, Wanli Ouyang, and Bowen Zhou. 2025. Can 1b llm surpass 405b llm? rethinking compute-optimal test-time scaling. Preprint, arXiv:2502.06703.",
1761
+ "Yuejiang Liu, Parth Kothari, Bastien van Delft, Baptiste Bellot-Gurlet, Taylor Mordan, and Alexandre Alahi. 2021. TTT++: when does self-supervised test-time training fail or thrive? In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pages 21808-21820.",
1762
+ "Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, Shashank Gupta, Bodhisattwa Prasad Majumder, Katherine Hermann, Sean Welleck, Amir Yazdanbakhsh, and Peter Clark. 2023. Self-refine: Iterative refinement with self-feedback. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.",
1763
+ "Eric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn, and Christopher D. Manning. 2022. Fast model editing at scale. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net."
1764
+ ],
1765
+ "bbox": [
1766
+ 115,
1767
+ 85,
1768
+ 489,
1769
+ 919
1770
+ ],
1771
+ "page_idx": 10
1772
+ },
1773
+ {
1774
+ "type": "list",
1775
+ "sub_type": "ref_text",
1776
+ "list_items": [
1777
+ "Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Li Fei-Fei, Hannaneh Hajishirzi, Luke Zettlemoyer, Percy Liang, Emmanuel Candès, and Tatsunori Hashimoto. 2025. s1: Simple test-time scaling. Preprint, arXiv:2501.19393.",
1778
+ "OpenAI, :, Ahmed El-Kishky, Alexander Wei, Andre Saraiva, Borys Minaev, Daniel Selsam, David Dohan, Francis Song, Hunter Lightman, Ignasi Clavera, Jakub Pachocki, Jerry Tworek, Lorenz Kuhn, Lukasz Kaiser, Mark Chen, Max Schwarzer, Mostafa Rohaninejad, Nat McAleese, o3 contributors, Oleg Mürk, Rhythm Garg, Rui Shu, Szymon Sidor, Vineet Kosaraju, and Wenda Zhou. 2025. Competitive programming with large reasoning models. Preprint, arXiv:2502.06807.",
1779
+ "Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F. Christiano, Jan Leike, and Ryan Lowe. 2022. Training language models to follow instructions with human feedback. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.",
1780
+ "Peng Si Ow and Thomas E Morton. 1988. Filtered beam search in scheduling. The International Journal Of Production Research, 26(1):35-62.",
1781
+ "Timo Schick, Jane Dwivedi-Yu, Roberto Dessi, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. 2023. Toolformer: Language models can teach themselves to use tools. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.",
1782
+ "Imanol Schlag, Kazuki Irie, and Jürgen Schmidhuber. 2021. Linear transformers are secretly fast weight programmers. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 9355-9366. PMLR.",
1783
+ "Jürgen Schmidhuber. 1992. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. *Neural Comput.*, 4(1):131-139.",
1784
+ "Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. 2023. Reflection: language agents with verbal reinforcement learning. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023."
1785
+ ],
1786
+ "bbox": [
1787
+ 510,
1788
+ 85,
1789
+ 884,
1790
+ 920
1791
+ ],
1792
+ "page_idx": 10
1793
+ },
1794
+ {
1795
+ "type": "page_number",
1796
+ "text": "5251",
1797
+ "bbox": [
1798
+ 480,
1799
+ 928,
1800
+ 517,
1801
+ 940
1802
+ ],
1803
+ "page_idx": 10
1804
+ },
1805
+ {
1806
+ "type": "list",
1807
+ "sub_type": "ref_text",
1808
+ "list_items": [
1809
+ "Charlie Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. 2024. Scaling LLM test-time compute optimally can be more effective than scaling model parameters. CoRR, abs/2408.03314.",
1810
+ "Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: a simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1):1929-1958.",
1811
+ "Yu Sun, Xinhao Li, Karan Dalal, Chloe Hsu, Sanmi Koyejo, Carlos Guestrin, Xiaolong Wang, Tatsunori Hashimoto, and Xinlei Chen. 2023. Learning to (learn at test time). CoRR, abs/2310.13807.",
1812
+ "Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei A. Efros, and Moritz Hardt. 2020. Test-time training with self-supervision for generalization under distribution shifts. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 9229-9248. PMLR.",
1813
+ "Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V. Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2023. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net.",
1814
+ "Yan Wang, D. Ma, and Deng Cai. 2024. With greater text comes greater necessity: Inference-time training helps long text generation. CoRR, abs/2401.11504.",
1815
+ "Ronald J. Williams. 1992. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn., 8:229-256.",
1816
+ "Yangzhen Wu, Zhiqing Sun, Shanda Li, Sean Welleck, and Yiming Yang. 2024. Inference scaling laws: An empirical analysis of compute-optimal inference for problem-solving with language models. Preprint, arXiv:2408.00724.",
1817
+ "Yuxi Xie, Kenji Kawaguchi, Yiran Zhao, James Xu Zhao, Min-Yen Kan, Junxian He, and Michael Qizhe Xie. 2023. Self-evaluation guided beam search for reasoning. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.",
1818
+ "An Yang, Beichen Zhang, Binyuan Hui, Bofei Gao, Bowen Yu, Chengpeng Li, Dayiheng Liu, Jianhong Tu, Jingren Zhou, Junyang Lin, Keming Lu, Mingfeng Xue, Runji Lin, Tianyu Liu, Xingzhang Ren, and Zhenru Zhang. 2024. Qwen2.5-math technical report: Toward mathematical expert model via self-improvement. CoRR, abs/2409.12122."
1819
+ ],
1820
+ "bbox": [
1821
+ 115,
1822
+ 85,
1823
+ 489,
1824
+ 920
1825
+ ],
1826
+ "page_idx": 11
1827
+ },
1828
+ {
1829
+ "type": "list",
1830
+ "sub_type": "ref_text",
1831
+ "list_items": [
1832
+ "Kevin Yang, Yuandong Tian, Nanyun Peng, and Dan Klein. 2022. Re3: Generating longer stories with recursive prompting and revision. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 4393-4479, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.",
1833
+ "Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R. Narasimhan, and Yuan Cao. 2023. React: Synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net.",
1834
+ "Tian Ye, Zicheng Xu, Yuanzhi Li, and Zeyuan Allen-Zhu. 2024a. Physics of language models: Part 2.2, how to learn from mistakes on grade-school math problems. Preprint, arXiv:2408.16293.",
1835
+ "Tianzhu Ye, Li Dong, Yuqing Xia, Yutao Sun, Yi Zhu, Gao Huang, and Furu Wei. 2024b. Differential transformer. Preprint, arXiv:2410.05258.",
1836
+ "Bingchen Zhao, Haoqin Tu, Chen Wei, Jieru Mei, and Cihang Xie. 2024. Tuning layernorm in attention: Towards efficient multi-modal LLM finetuning. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net."
1837
+ ],
1838
+ "bbox": [
1839
+ 510,
1840
+ 85,
1841
+ 882,
1842
+ 464
1843
+ ],
1844
+ "page_idx": 11
1845
+ },
1846
+ {
1847
+ "type": "text",
1848
+ "text": "A Hyperparameter Settings",
1849
+ "text_level": 1,
1850
+ "bbox": [
1851
+ 510,
1852
+ 478,
1853
+ 766,
1854
+ 494
1855
+ ],
1856
+ "page_idx": 11
1857
+ },
1858
+ {
1859
+ "type": "text",
1860
+ "text": "Below is the detailed configurations of different PEFT methods:",
1861
+ "bbox": [
1862
+ 510,
1863
+ 502,
1864
+ 880,
1865
+ 532
1866
+ ],
1867
+ "page_idx": 11
1868
+ },
1869
+ {
1870
+ "type": "list",
1871
+ "sub_type": "text",
1872
+ "list_items": [
1873
+ "- Adapter uses a learning rate of 1e-4 and the reduction factor of the bottleneck is 16.",
1874
+ "- $(\\mathbf{IA})^3$ uses a learning rate of 5e-5.",
1875
+ "- LoRA uses a learning rate of 2e-5. We only apply LoRA to the query and value projections in the last 8 layers, with a rank of 16 and a dropout ratio of 0.05.",
1876
+ "- LN-Tuning uses a learning rate of 4e-4.",
1877
+ "- Full Fine-Tuning uses a learning rate of 1e-5. The number of training epochs is 100, 10, and 3 for MBPP, GSM8K, and MATH, respectively. We use the Adam optimizer with a batch size of 20 for all methods in all datasets, including OPTUNE. We use the checkpoint of the last epoch for inference."
1878
+ ],
1879
+ "bbox": [
1880
+ 507,
1881
+ 535,
1882
+ 882,
1883
+ 758
1884
+ ],
1885
+ "page_idx": 11
1886
+ },
1887
+ {
1888
+ "type": "text",
1889
+ "text": "For OPTUNE, we sample 10 attempts for each training example together with the raw question to construct the model input. We employ nucleus sampling (Holtzman et al., 2020) with a temperature of 0.6 and $p = 0.95$ to generate attempts. The number of training epochs for MBPP, GSM8K, and MATH is set to 10, 3, and 3, respectively. The learning rate is 1e-5. In inference, we sample an attempt using the same hyperparameters as in data generation before applying OPTUNE to mitigate",
1890
+ "bbox": [
1891
+ 510,
1892
+ 760,
1893
+ 882,
1894
+ 920
1895
+ ],
1896
+ "page_idx": 11
1897
+ },
1898
+ {
1899
+ "type": "page_number",
1900
+ "text": "5252",
1901
+ "bbox": [
1902
+ 480,
1903
+ 928,
1904
+ 519,
1905
+ 940
1906
+ ],
1907
+ "page_idx": 11
1908
+ },
1909
+ {
1910
+ "type": "image",
1911
+ "img_path": "images/ed709c064596f2859ed390492256c68f283c062f7e684497550e6fb0538c0dc6.jpg",
1912
+ "image_caption": [
1913
+ "Figure 5: The training curves of PEFT methods when fine-tuning Llama-3.1-8B-Instruct on MBPP."
1914
+ ],
1915
+ "image_footnote": [],
1916
+ "bbox": [
1917
+ 129,
1918
+ 84,
1919
+ 473,
1920
+ 263
1921
+ ],
1922
+ "page_idx": 12
1923
+ },
1924
+ {
1925
+ "type": "text",
1926
+ "text": "the train-test discrepancy. We alternate between sampling attempts from the raw LLM and predicting refined attempts from sampled attempts when scaling OPTUNE with more budgets.",
1927
+ "bbox": [
1928
+ 112,
1929
+ 331,
1930
+ 489,
1931
+ 397
1932
+ ],
1933
+ "page_idx": 12
1934
+ },
1935
+ {
1936
+ "type": "text",
1937
+ "text": "B Prompts",
1938
+ "text_level": 1,
1939
+ "bbox": [
1940
+ 114,
1941
+ 407,
1942
+ 228,
1943
+ 425
1944
+ ],
1945
+ "page_idx": 12
1946
+ },
1947
+ {
1948
+ "type": "text",
1949
+ "text": "Below is the reflection generation prompts $P$ for Llama-3.1-8B-Instruct and Mistral-7B-Instruct-v0.3:",
1950
+ "bbox": [
1951
+ 112,
1952
+ 432,
1953
+ 487,
1954
+ 481
1955
+ ],
1956
+ "page_idx": 12
1957
+ },
1958
+ {
1959
+ "type": "text",
1960
+ "text": "Llama-3.1-8B-Instruct",
1961
+ "text_level": 1,
1962
+ "bbox": [
1963
+ 166,
1964
+ 491,
1965
+ 315,
1966
+ 502
1967
+ ],
1968
+ "page_idx": 12
1969
+ },
1970
+ {
1971
+ "type": "text",
1972
+ "text": "User: Solve the following math problem ... Assistant: ... the final answer is: ...",
1973
+ "bbox": [
1974
+ 164,
1975
+ 513,
1976
+ 435,
1977
+ 537
1978
+ ],
1979
+ "page_idx": 12
1980
+ },
1981
+ {
1982
+ "type": "text",
1983
+ "text": "User: Your answer is incorrect. Please carefully check the solution and summarize all mistakes in short. Do NOT provide the corrected solution. Do NOT say \"my solution\".",
1984
+ "bbox": [
1985
+ 164,
1986
+ 537,
1987
+ 436,
1988
+ 585
1989
+ ],
1990
+ "page_idx": 12
1991
+ },
1992
+ {
1993
+ "type": "text",
1994
+ "text": "Assistant: Here is the summary of the mistakes in the previous solution ...",
1995
+ "bbox": [
1996
+ 164,
1997
+ 585,
1998
+ 436,
1999
+ 609
2000
+ ],
2001
+ "page_idx": 12
2002
+ },
2003
+ {
2004
+ "type": "text",
2005
+ "text": "Mistral-7B-Instruct-v0.3",
2006
+ "text_level": 1,
2007
+ "bbox": [
2008
+ 166,
2009
+ 634,
2010
+ 329,
2011
+ 646
2012
+ ],
2013
+ "page_idx": 12
2014
+ },
2015
+ {
2016
+ "type": "text",
2017
+ "text": "User: Solve the following math problem ... Assistant: ... the final answer is: ...",
2018
+ "bbox": [
2019
+ 164,
2020
+ 655,
2021
+ 435,
2022
+ 678
2023
+ ],
2024
+ "page_idx": 12
2025
+ },
2026
+ {
2027
+ "type": "text",
2028
+ "text": "User: Your answer is incorrect. Carefully check the solution step-by-step and list all mistakes in short. MUST NOT provide the correct answer. Your response MUST be in the third person tone.",
2029
+ "bbox": [
2030
+ 164,
2031
+ 680,
2032
+ 435,
2033
+ 739
2034
+ ],
2035
+ "page_idx": 12
2036
+ },
2037
+ {
2038
+ "type": "text",
2039
+ "text": "Assistant: Here is the summary of the mistakes in the previous solution ...",
2040
+ "bbox": [
2041
+ 164,
2042
+ 739,
2043
+ 436,
2044
+ 764
2045
+ ],
2046
+ "page_idx": 12
2047
+ },
2048
+ {
2049
+ "type": "text",
2050
+ "text": "Sentences in gray are the prompt $P$ and the one in blue is the generated reflection.",
2051
+ "bbox": [
2052
+ 112,
2053
+ 787,
2054
+ 487,
2055
+ 819
2056
+ ],
2057
+ "page_idx": 12
2058
+ },
2059
+ {
2060
+ "type": "text",
2061
+ "text": "C Training Curves",
2062
+ "text_level": 1,
2063
+ "bbox": [
2064
+ 114,
2065
+ 831,
2066
+ 295,
2067
+ 848
2068
+ ],
2069
+ "page_idx": 12
2070
+ },
2071
+ {
2072
+ "type": "text",
2073
+ "text": "Figure 5 is the training curves of various PEFT methods, including OPTUNE. We observe that Adapter shows a clear signal of overfitting, where it has a training loss close to 0, while its performance",
2074
+ "bbox": [
2075
+ 112,
2076
+ 857,
2077
+ 487,
2078
+ 921
2079
+ ],
2080
+ "page_idx": 12
2081
+ },
2082
+ {
2083
+ "type": "table",
2084
+ "img_path": "images/ee8151b4c87717f7e7908671627fd250fe0da7f3becc5ede3b29fc78c9a8c83d.jpg",
2085
+ "table_caption": [],
2086
+ "table_footnote": [],
2087
+ "table_body": "<table><tr><td>Model</td><td>GSM8K (trained on MATH)</td><td>HumanEval (trained on MBPP)</td></tr><tr><td colspan=\"3\">Llama-3.1-8B-Instruct</td></tr><tr><td>Raw Model</td><td>0.8069</td><td>0.6728</td></tr><tr><td>+ OPTUNE</td><td>0.8914</td><td>0.7037</td></tr><tr><td colspan=\"3\">Mistral-7B-Instruct-v0.3</td></tr><tr><td>Raw Model</td><td>0.7807</td><td>0.6500</td></tr><tr><td>+ OPTUNE</td><td>0.7921</td><td>0.7100</td></tr></table>",
2088
+ "bbox": [
2089
+ 517,
2090
+ 80,
2091
+ 875,
2092
+ 200
2093
+ ],
2094
+ "page_idx": 12
2095
+ },
2096
+ {
2097
+ "type": "text",
2098
+ "text": "Table 6: The cross-task transferability of OPTUNE.",
2099
+ "bbox": [
2100
+ 519,
2101
+ 210,
2102
+ 868,
2103
+ 225
2104
+ ],
2105
+ "page_idx": 12
2106
+ },
2107
+ {
2108
+ "type": "text",
2109
+ "text": "on the test set is the worst. All PEFT methods seem to converge smoothly. For OPTUNE, its training is not as stable as baselines, suggesting the difficulty of learning to optimize problem.",
2110
+ "bbox": [
2111
+ 507,
2112
+ 250,
2113
+ 882,
2114
+ 315
2115
+ ],
2116
+ "page_idx": 12
2117
+ },
2118
+ {
2119
+ "type": "text",
2120
+ "text": "D Transferability",
2121
+ "text_level": 1,
2122
+ "bbox": [
2123
+ 507,
2124
+ 326,
2125
+ 678,
2126
+ 343
2127
+ ],
2128
+ "page_idx": 12
2129
+ },
2130
+ {
2131
+ "type": "text",
2132
+ "text": "While generalization and transfer are not the primary focus of this work, we demonstrate OPTUNE's transferability by training it on one dataset (MBPP/MATH) and testing it on another (HumanEval/GSM8K). Table 6 indicates that OPTUNE consistently improves baseline performance, even when tested on unseen datasets. This highlights OPTUNE's potential for generalization and transferability.",
2133
+ "bbox": [
2134
+ 507,
2135
+ 351,
2136
+ 885,
2137
+ 495
2138
+ ],
2139
+ "page_idx": 12
2140
+ },
2141
+ {
2142
+ "type": "page_number",
2143
+ "text": "5253",
2144
+ "bbox": [
2145
+ 480,
2146
+ 927,
2147
+ 519,
2148
+ 940
2149
+ ],
2150
+ "page_idx": 12
2151
+ }
2152
+ ]
2025/Learning to Reason from Feedback at Test-Time/73c5b89a-a858-47ba-a533-28d4db8adb18_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Reason from Feedback at Test-Time/73c5b89a-a858-47ba-a533-28d4db8adb18_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5cc1be697c35a02986db884048ff5355454e5aa475ae60a2aff8c1b102dfbf62
3
+ size 490513
2025/Learning to Reason from Feedback at Test-Time/full.md ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Learning to Reason from Feedback at Test-Time
2
+
3
+ Yanyang Li, Michael R. Lyu, Liwei Wang*
4
+
5
+ The Chinese University of Hong Kong
6
+
7
+ {yyli21,lyu,lwwang}@cse.cuhk.edu.hk
8
+
9
+ # Abstract
10
+
11
+ Solving complex tasks in a single attempt is challenging for large language models (LLMs). Iterative interaction with the environment and feedback is often required to achieve success, making effective feedback utilization a critical topic. Existing approaches either struggle with length generalization or rely on naive retries without leveraging prior information. In this paper, we introduce FTTT, a novel paradigm that formulates feedback utilization as an optimization problem at test time. Additionally, we propose a learnable test-time optimizer, OPTUNE, to effectively exploit feedback. Experiments on two LLMs across four reasoning datasets demonstrate that FTTT and OPTUNE achieve superior scalability and performance<sup>1</sup>.
12
+
13
+ # 1 Introduction
14
+
15
+ Leveraging external feedback from interactions with the environment during test time has emerged as a promising approach for large language models (LLMs). This includes applications such as LLM-based agents (Yao et al., 2023; Shinn et al., 2023) and, more recently, test-time scaling (Wu et al., 2024; Snell et al., 2024; Liu et al., 2025). Such methods further enhance the potential of LLMs to solve challenging tasks, e.g., Olympiad-level math problems (Guan et al., 2025) and competitive programming (OpenAI et al., 2025).
16
+
17
+ Significant progress in this area typically falls into two categories (Snell et al., 2024), as illustrated in Figure 1: sequential revision and parallel sampling. Sequential revision methods (Shinn et al., 2023; Madaan et al., 2023) incorporate previous attempts into the LLM's context, while parallel sampling methods (Xie et al., 2023; Brown et al., 2024) generate new attempts independently of prior failures. However, both approaches have notable limitations. Sequential revision is computationally
18
+
19
+ expensive due to long context lengths and faces challenges (Muennighoff et al., 2025), such as position bias (Liu et al., 2024) and attention noise (Ye et al., 2024b). In contrast, parallel sampling, while efficient, fails to learn from previous errors (Brown et al., 2024). Unlike these paradigms, human reasoning follows a different pattern: humans store recent experiences in "fast weights" (Schmidhuber, 1992; Ba et al., 2016; Schlag et al., 2021), enabling them to neither revisit past errors explicitly nor start each attempt without any prior knowledge. Recent research suggests that the weights of neural networks could serve as a natural memory mechanism during test time (Wang et al., 2024).
20
+
21
+ Building on these observations, we propose a novel paradigm that leverages Test-Time Training (TTT) (Sun et al., 2020, 2023) to store past experiences in model weights rather than in the context. This approach bridges the gap between sequential revision and parallel sampling by indirectly incorporating knowledge into the LLM without disrupting in-context reasoning. Specifically, we introduce Feedback-based Test-Time Training (FTTT), which employs a carefully designed TTT task based on feedback enriched with self-reflection. We demonstrate that FTTT improves test-time computation scalability on two mathematical reasoning and two code generation datasets, using Llama-3.1-8B-Instruct (Dubey et al., 2024) and Mistral-7B-Instruct-v0.3 (Jiang et al., 2023).
22
+
23
+ Inspired by advancements in learning to optimize (Chen et al., 2022), we explore training learnable test-time optimizers to yield Pareto-optimal cost-performance tradeoffs. Our proposed learnable optimizer, OPTUNE, is a lightweight neural network that predicts weight updates from the gradients of the previous attempt. Unlike traditional parameter-efficient fine-tuning (PEFT) methods, OPTUNE works on the gradient rather than the activation space. Experiments on three reasoning datasets and two different LLMs demonstrate
24
+
25
+ ![](images/a9a85fea0c26b5ff644fde305dbbc38b7bb01445804ac5a582cdf3e344e53bf2.jpg)
26
+ (a) Sequential Revision
27
+
28
+ ![](images/a2b7f2f8f4f08b754ee39f4914c1b0f311544408c44d532ab72ccb41d3b4c19e.jpg)
29
+ (b) Parallel Sampling
30
+
31
+ ![](images/f8cc292397915e985a43f0fdb53ce9e7fe1f20e9fe6a5d7e0cae8795aa612c9b.jpg)
32
+ (c) Feedback-based Test-Time Training
33
+ Figure 1: Comparison between sequential revision, parallel sampling, and feedback-based test-time training. $\square$ is the failed attempt and $\square$ is the successful attempt. $\longrightarrow$ indicates the LLM generation with the input on the left of the arrow and the output on the right. $\dashrightarrow$ denotes the LLM training, where the left of the arrow is the training data.
34
+
35
+ the effectiveness of OPTUNE, outperforming five widely used PEFT baselines.
36
+
37
+ # 2 Feedback-based Test-Time Training
38
+
39
+ # 2.1 The Test-Time Training Task
40
+
41
+ The problem of exploiting test-time feedback is as (Shinn et al., 2023): given a question $Q$ , a model $M$ attempts to solve $Q$ within a budget of $N$ attempts. A verifier $V$ evaluates each attempt, such as the $n$ -th attempt $A_{n}$ , and provides feedback $V(A_{n})$ . This work focuses on binary verifiers, which determine whether $A_{n}$ is correct. These verifiers are well-established, rule-based systems that are both cost-effective and efficient to evaluate.
42
+
43
+ When the model generates attempts sequentially, our goal is to enable $M$ to learn from previous attempts to improve subsequent ones. To achieve this, we frame learning from previous attempts as a training problem: at each step $n$ , we optimize $M$ using $Q$ , $A_{n}$ , and $V(A_{n})$ , aiming for $M$ to generate a better $A_{n + 1}$ . This way internalizes the past attempts into weights for efficient inference of $A_{n + 1}$ . As a result, the sequence of attempts can be viewed as an $N$ -step optimization process.
44
+
45
+ A key challenge is designing an effective supervised task using $Q$ , $A_{n}$ , and $V(A_{n})$ to improve the model's ability to solve $Q$ . We build on the intuition that a model capable of judging the correctness of a solution should also be able to solve the question itself. Concretely, given $Q$ and $A_{n}$ , we train $M$ to predict verbal feedback $F$ that aligns with $V(A_{n})$ . This leads to our FTTT loss:
46
+
47
+ $$
48
+ \mathcal {L} _ {\mathrm {F T T T}} (Q, A _ {n}) = - \frac {1}{l _ {0}} \log M _ {n - 1} (F \mid Q, A _ {n}) \tag {1}
49
+ $$
50
+
51
+ where $l_{0}$ is the length of $F$ and $M_0$ denotes the raw LLM. In this work, $F$ is set to "Your answer is incorrect." when $V(A_{n})$ implies an incorrect $A_{n}$ .
52
+
53
+ # 2.2 Self-Reflected Feedback
54
+
55
+ Since we are working with a binary verifier, the learning signal is limited at each interaction. Previous research suggests that LLMs can self-correct errors when provided with external signals (Huang et al., 2024). Inspired by this, we aim to enhance the learning signal by leveraging the model to generate silver-standard training labels via self-reflection.
56
+
57
+ We first sample a reflection $R_{n}$ from the model given $Q, A_{n}, F$ and the instruction $P$ (see Appendix B for details of $P$ ):
58
+
59
+ $$
60
+ R _ {n} \sim M _ {0} (R \mid Q, A _ {n}, F, P) \tag {2}
61
+ $$
62
+
63
+ In practice, we use $M_0$ to generate $R_n$ to mitigate the risk of degraded self-reflection ability after training. The auxiliary loss is then defined as:
64
+
65
+ $$
66
+ \mathcal {L} _ {\text {a u x}} (Q, A _ {n}, R _ {n}) = - \frac {1}{l _ {n}} \log M _ {n - 1} \left(R _ {n} \mid Q, A _ {n}, F\right) \tag {3}
67
+ $$
68
+
69
+ where $l_{n}$ is the length of $R_{n}$ . Eq. 3 can be interpreted as a sequence-level distillation loss (Kim and Rush, 2016), where knowledge from the raw model $M_0$ is distilled into the trained model $M_{n - 1}$ to prevent overfitting. Finally, the overall loss is as:
70
+
71
+ $$
72
+ \mathcal {L} _ {\text {f i n a l}} = \mathcal {L} _ {\mathrm {F T T T}} + \mathcal {L} _ {\text {a u x}} \tag {4}
73
+ $$
74
+
75
+ Below is a training example with self-reflection, where underlined sentences are the training target:
76
+
77
+ Algorithm 1 FEEDBACK-BASED TTT
78
+
79
+ Require: The question $Q$ , the model $M_0$ , the verifier $V$ , the budget $N$ , the verbal feedback $F$ , the instruction $P$
80
+
81
+ 1: $n\gets 1$
82
+ 2: while $n \leq N$ do
83
+ 3: $A_{n}\sim M_{n - 1}(A\mid Q)$
84
+ 4: if $V(A_{n})$ is passed then
85
+ 5: return $A_{n}$
86
+ 6: else
87
+ 7: Compute the loss $\mathcal{L}$ using Eq. 1
88
+ 8: if enable self-reflection then
89
+ 9: $R_{n}\sim M_{0}(R\mid Q,A_{n},F,P)$
90
+ 10: Compute the loss $\mathcal{L}_{\mathrm{aux}}$ using Eq. 3
91
+ 11: $\mathcal{L}\gets \mathcal{L} + \mathcal{L}_{\mathrm{aux}}$
92
+ 12: end if
93
+ 13: Update $M_{n - 1}$ using $\mathcal{L}$ to get $M_{n}$
94
+ 14: end if
95
+ 15: $n\gets n + 1$
96
+ 16: end while
97
+ 17: return $A_N$
98
+
99
+ # Training Example with Self-Reflection
100
+
101
+ User: Solve the following math problem... Assistant: ... the final answer is: ...
102
+
103
+ User: Your answer is incorrect. Here is the summary of the mistakes in the previous solution.
104
+
105
+ The underlined sentence corresponds to $F$ in Eq. 1 and the wave-underlined sentence represents $R_{n}$ for Eq. 3. Algorithm 1 summarizes our FTTT.
106
+
107
+ Discussion. As shown in Table 1, FTTT combines the strengths of sequential revision and parallel sampling. Like sequential revision, it leverages memory (i.e., weights) to store past failed attempts, while avoiding the length generalization issues as in parallel sampling. Figure 1 highlights the advantages of FTTT from a probabilistic graphical model perspective, where both sequential revision and parallel sampling are special cases of FTTT with additional independence assumptions. In particular, sequential revision assumes that attempts form a Markov process, whereas parallel sampling treats each attempt as independent.
108
+
109
+ In terms of efficiency, FTTT is highly optimized. Since we only update $M$ once at each attempt in practice, FTTT requires only one additional backward propagation computed in parallel for all tokens in one attempt, whose cost is negligible. The dominant overhead of FTTT is generating $R_{n}$ .
110
+
111
+ <table><tr><td>Method</td><td>Self
112
+ Reflection</td><td>Memory</td><td>Length
113
+ Generalization</td></tr><tr><td>Revision (Snell et al., 2024)</td><td>X</td><td>✓</td><td>X</td></tr><tr><td>Self-Refine (Madaan et al., 2023)</td><td>✓</td><td>✓</td><td>X</td></tr><tr><td>Best-of-N (Brown et al., 2024)</td><td>X</td><td>X</td><td>✓</td></tr><tr><td>Beam Search (Ow and Morton, 1988)</td><td>X</td><td>X</td><td>✓</td></tr><tr><td>Guided Beam Search (Xie et al., 2023)</td><td>✓</td><td>X</td><td>✓</td></tr><tr><td>FTTT (ours)</td><td>✓</td><td>✓</td><td>✓</td></tr></table>
114
+
115
+ Table 1: Comparing the advantages and drawbacks of FTTT and related works.
116
+
117
+ However, FTTT is still much faster than sequential revision (see Section 4.2), as $R_{n}$ is typically short.
118
+
119
+ Moreover, FTTT closely resembles vanilla TTT (Sun et al., 2020), but with additional inputs beyond $Q$ , such as $A_{n}$ , $V(A_{n})$ , and $R_{n}$ , as defined in the problem. Consequently, it inherits the same convergence guarantees as TTT.
120
+
121
+ # 3 A Learnable Test-Time Optimizer
122
+
123
+ # 3.1 The Learning to Optimize Problem
124
+
125
+ Although FTTT achieves success (see Section 4.2), it simply applies the gradients of the feedback received so far to update the weights. This raises the question: can we design a better test-time optimizer that more effectively exploits feedback?
126
+
127
+ Motivated by learning to optimize (Chen et al., 2022), we adopt a neural network as the test-time optimizer. Concretely, this learnable test-time optimizer is formulated as $f_{\theta}(Q,\{A_i,V(A_i)\}_{i = 1}^n)$ which predicts updates for all LLM weights based on the previous $n$ attempts, and $\theta$ is the optimizer parameter. However, this direct formulation leads to prohibitively large networks due to high-dimensional input and output spaces. For a maximum number of $m$ tokens per attempt and an $l$ -layer LLM, the input space grows to $n\times m\times l$ even when updating only a scalar weight at each layer (we exclude the token count of $Q$ , as it is significantly smaller than $m$ ). Since updates for all weight matrices across all layers are predicted jointly, the dimensionality of the input and output spaces becomes unmanageable. We therefore simplify $f_{\theta}$ by introducing the following assumptions:
128
+
129
+ (A1): Markov Property: The latest attempt captures all relevant information from previous attempts.
130
+ (A2): Independent Update: The optimizer predicts updates for each weight matrix independently, similar to conventional optimizers (Kingma and Ba, 2015).
131
+
132
+ A1 eliminates the dependency on $n$ and A2 enables updates to be predicted independently for
133
+
134
+ each weight, significantly reducing the size of the output space. The learnable test-time optimizer now becomes $\tilde{\nabla}_{W_i} = f_{\theta_{W_i}}(Q,A_n,V(A_n))$ where it predicts the update for the weight $W_{i}$ in the $i$ -th layer based on $Q$ and the latest attempt $A_{n}$ .
135
+
136
+ To train all $f$ , we define the following loss:
137
+
138
+ $$
139
+ \mathcal {L} _ {\mathrm {m e t a}} = - \log M (\hat {A} \mid Q, \left\{W + \tilde {\nabla} _ {W} \mid \forall W \in \mathcal {W} \right\}) \tag {5}
140
+ $$
141
+
142
+ where $\hat{A}$ is the ground-truth for $Q$ and $\mathcal{W}$ is the set of LLM weights. Here we consider only a one-step optimization problem, as a multi-step version involves the non-differentiable generation of $A$ . Eq. 5 encourages $f$ to predict updates that increase the likelihood of generating the correct answer after applying these updates.
143
+
144
+ # 3.2 A Parameter-Efficient Architecture in The Gradient Space
145
+
146
+ Given the limited learning signal at test time, we design the learnable optimizer to be parameter-efficient to alleviate overfitting. However, the input and output spaces of $f_{\theta_{W_i}}(Q, A_n, V(A_n))$ are large due to their lengths, making even a simple linear projection parameter-intensive. Additionally, $V(A_n)$ may be heterogeneous to $Q$ and $A_n$ , e.g., a scalar, posing challenges for modeling.
147
+
148
+ Inspired by the success of FTTT in Section 2 and recent works (Mitchell et al., 2022; Wang et al., 2024), we propose a parameter-efficient architecture in the gradient space as the learnable optimizer.
149
+
150
+ Gradient-based Input Compression. Instead of directly inputting $Q$ , $A_{n}$ , and $V(A_{n})$ , we first project them into the gradient space, since recent work suggests that long context can be effectively compressed by gradients (Wang et al., 2024). This way reduces the token count $m$ in $A_{n}$ to a constant and unifies the spaces of $Q$ , $A_{n}$ , and $V(A_{n})$ to ease the modeling. Besides, the gradient encodes the knowledge about $W_{i}$ , enabling efficient modeling of $f_{\theta_{W_i}}$ , which no longer needs to learn such knowledge with massive resources as in the black-box optimization (Chen et al., 2017). To compress $Q$ and $A_{n}$ , we use the next token prediction loss, while for $V(A_{n})$ , we include $\mathcal{L}_{\mathrm{FTTT}}$ in Eq. 1. The final loss for compressing the optimizer input is:
151
+
152
+ $$
153
+ \mathcal {L} _ {\text {c o m p r e s s}} = - \frac {1}{m} \log M (A _ {n} \mid Q) + \mathcal {L} _ {\mathrm {F T T T}} \tag {6}
154
+ $$
155
+
156
+ The input of $f_{\theta_{W_i}}$ to predict the update of $W_i$ now is the gradient $\nabla_{W_i}$ of $\mathcal{L}_{\mathrm{compress}}$ w.r.t. $W_i$ . Consequently, $f_{\theta_{W_i}}$ receives a fixed-size tensor as input rather than a variable-length sequence.
157
+
158
+ ![](images/9a904be9af21142d8170a71df6b0f8348b3c31878c9970a0864479a47279fa93.jpg)
159
+ Figure 2: The model architecture of OPTUNE.
160
+
161
+ Gradient Decomposition. Although $f_{\theta_{W_i}}$ operates on a smaller space after compression, the dimensionality of the gradient space remains large for direct processing. We utilize the observation that $\nabla_{W_i} \in \mathbb{R}^{d \times d}$ (assuming $W_i \in \mathbb{R}^{d \times d}$ ) can be decomposed into two vectors to further reduce the dimensionalities (Mitchell et al., 2022): the input to a linear projection with weight $W_i$ , $u_i \in \mathbb{R}^{d \times 1}$ , and the gradient of $\mathcal{L}_{\mathrm{compress}}$ w.r.t. the output of the same linear projection, $\delta_{i+1} \in \mathbb{R}^{d \times 1}$ . In this framework, $f_{\theta_{W_i}}$ takes the decomposed $u_i$ and $\delta_{i+1}$ as its input and predicts $\tilde{u}_i$ and $\tilde{\delta}_{i+1}$ . The update is then reconstructed as $\tilde{\nabla}_{W_i} = \tilde{\delta}_{i+1} \tilde{u}_i^T$ . This approach reduces the dimension from $d^2$ to $2d$ .
162
+
163
+ Model Architecture. The architecture of $f_{\theta_{W_i}}(u_i,\delta_{i + 1})$ , named OPTUNE, is shown in Figure 2 and defined as follows:
164
+
165
+ $$
166
+ \begin{array}{l} \left[ \bar {u} _ {i}, \bar {\delta} _ {i + 1} \right] = \operatorname {N o r m} \left(\left[ u _ {i}, \delta_ {i + 1} \right]\right) (7) \\ h _ {i} = \theta_ {2} \text {D r o p o u t} \left(\theta_ {1} \left[ \bar {u} _ {i}, \bar {\delta} _ {i + 1} \right]\right) (8) \\ \end{array}
167
+ $$
168
+
169
+ $$
170
+ \left[ \tilde {u} _ {i}, \tilde {\delta} _ {i + 1} \right] = h _ {i} + \left[ \bar {u} _ {i}, \bar {\delta} _ {i + 1} \right] \tag {9}
171
+ $$
172
+
173
+ where $\theta_{1} \in \mathbb{R}^{r \times 2d}$ and $\theta_{2} \in \mathbb{R}^{2d \times r}$ are the optimizer parameters with $r \ll d$ . [·] denotes the vector concatenation. Norm normalizes $u_{i}$ and $\delta_{i+1}$ to have zero mean and unit variance separately. Dropout is the dropout regularization (Srivastava et al., 2014). In practice, $\theta_{1}$ and $\theta_{2}$ are shared across all weights with the same shape. We design OPTUNE this way as rank reduction and dropout help mitigate the overfitting risk, which is severe in our scenario due to the sparse, binary feedback. OPTUNE is similar to the Bottleneck Adapter (Houlsby et al., 2019), with the key difference that its input is gradients and its output is the weight update. As such, OPTUNE can also be regarded as a specialized PEFT technique tailored to reasoning.
174
+
175
+ # 4 Experiments
176
+
177
+ # 4.1 Setup
178
+
179
+ Datasets. We evaluate both baselines and our method on math and coding reasoning tasks: (a)
180
+
181
+ <table><tr><td>Method</td><td>MATH</td><td>GSM8K</td><td>MBPP</td><td>HumanEval</td><td>Avg.</td></tr><tr><td colspan="6">Llama-3.1-8B-Instruct</td></tr><tr><td>Revision (Snell et al., 2024)</td><td>0.2960</td><td>0.4570</td><td>0.2991</td><td>0.3889</td><td>0.3603</td></tr><tr><td>Beam Search (Ow and Morton, 1988)</td><td>0.2560</td><td>0.4842</td><td>0.1869</td><td>0.2407</td><td>0.2920</td></tr><tr><td>Self-Consistency (Wang et al., 2023)</td><td>0.30000.0057</td><td>0.45250.0111</td><td>0.13710.0180</td><td>0.12350.0531</td><td>0.2533</td></tr><tr><td>Self-Refine (Madaan et al., 2023)</td><td>0.46930.0207</td><td>0.78280.0064</td><td>0.23050.0088</td><td>0.29630.0800</td><td>0.4447</td></tr><tr><td>Best-of-N (Brown et al., 2024)</td><td>0.64270.0154</td><td>0.80690.0043</td><td>0.54520.0154</td><td>0.67280.0087</td><td>0.6669</td></tr><tr><td>FTTT</td><td>0.67070.0222</td><td>0.81000.0037</td><td>0.56070.0212</td><td>0.68520.0302</td><td>0.6817</td></tr><tr><td>+ w/o Self-Reflected Feedback</td><td>0.67200.0113</td><td>0.80540.0133</td><td>0.54050.0117</td><td>0.67900.0087</td><td>0.6742</td></tr><tr><td colspan="6">Mistral-7B-Instruct-v0.3</td></tr><tr><td>Revision (Snell et al., 2024)</td><td>0.0497</td><td>0.1686</td><td>0.1351</td><td>0.1000</td><td>0.1134</td></tr><tr><td>Beam Search (Ow and Morton, 1988)</td><td>0.1783</td><td>0.4537</td><td>0.1318</td><td>0.1600</td><td>0.2310</td></tr><tr><td>Self-Consistency (Wang et al., 2023)</td><td>0.16180.0011</td><td>0.35490.0052</td><td>0.12430.0135</td><td>0.10330.0236</td><td>0.1861</td></tr><tr><td>Self-Refine (Madaan et al., 2023)</td><td>0.12870.0139</td><td>0.33120.0078</td><td>0.23470.0091</td><td>0.35330.0309</td><td>0.2620</td></tr><tr><td>Best-of-N (Brown et al., 2024)</td><td>0.46880.0138</td><td>0.78070.0055</td><td>0.49620.0171</td><td>0.65000.0141</td><td>0.5989</td></tr><tr><td>FTTT</td><td>0.47330.0087</td><td>0.78200.0045</td><td>0.49620.0015</td><td>0.66330.0125</td><td>0.6037</td></tr><tr><td>+ w/o Self-Reflected Feedback</td><td>0.48760.0133</td><td>0.78580.0021</td><td>0.49410.0040</td><td>0.68330.0205</td><td>0.6127</td></tr></table>
182
+
183
+ Table 2: Experimental results on four datasets with a budget of 32. For stochastic algorithms, we report the mean of three runs with different random seeds and standard deviation in the subscript. Bold entries are the best results, and underlined entries are the second-best results.
184
+
185
+ Mathematical reasoning: MATH (Hendrycks et al., 2021) and GSM8K (Cobbe et al., 2021), using the test split from Lightman et al. (2024) for MATH. (b) Code generation: MBPP (Austin et al., 2021) and HumanEval (Chen et al., 2021). For all datasets, we report results on subsets where models fail with greedy decoding. We use Exact Match as the evaluation metric as well as the verifier for math tasks and Pass@1 for code.
186
+
187
+ Models. We conduct experiments with Llama-3.1-8B-Instruct (Dubey et al., 2024) and Mistral-7B-Instruct-v0.3 (Jiang et al., 2023). We evaluate both models with zero-shot prompting and follow the official instructions when evaluating the model on each dataset<sup>2</sup>.
188
+
189
+ Baselines. We compare FTTT with the following test-time scaling methods:
190
+
191
+ - Beam Search (Ow and Morton, 1988) is a popular search algorithm that approximates the most confident model prediction.
192
+ - Self-Consistency (Wang et al., 2023) samples multiple predictions and selects the most frequent answer.
193
+ - Best-of-N (Brown et al., 2024) samples $N$ predictions independently and picks the best
194
+
195
+ one based on external feedback.
196
+
197
+ - Revision (Snell et al., 2024) iteratively refines answers by conditioning the model on previous attempts. We pick the best answer according to feedback.
198
+ - Self-Refine (Madaan et al., 2023) alternates between self-critique and refinement. We select the best solution based on feedback.
199
+
200
+ For sampling-based methods, we use nucleus sampling (Holtzman et al., 2020) with a temperature of 0.6 and $p = 0.95$ , following Brown et al. (2024). All methods are allocated a budget of 32. For FTTT, we fine-tune the model with LoRA (Hu et al., 2022), using a rank of 4 and a dropout ratio of 0.05. We use the Adam optimizer (Kingma and Ba, 2015) with a learning rate of 1e-5, except for Mistral-7B-Instruct-v0.3 in coding tasks, where we use 2e-5.
201
+
202
+ As OPTUNE is a specialized PEFT method, we compare it with the following PEFT approaches: Adapter (Houlsby et al., 2019), $(\mathbf{IA})^3$ (Liu et al., 2022), LoRA (Hu et al., 2022) and LN-Tuning (Zhao et al., 2024). We also include full fine-tuning that updates all LLM weights. For OPTUNE, $r = 16$ and the dropout ratio is 0.1. We only apply OPTUNE to the query and value projections in the last two layers of the LLM. Detailed configurations are in Appendix A.
203
+
204
+ ![](images/bf3377f742d2ad2a8b2fc8422678ff5183a2d691bb382e0442fb867a5a292f4e.jpg)
205
+ Figure 3: The scaling trends of different methods under varying budgets. The colored area around the line denotes the standard deviation. The first row is the results of Llama-3.1-8B-Instruct and the second row is Mistral-7B-Instruct-v0.3.
206
+
207
+ # 4.2 Test-Time Scaling Results
208
+
209
+ Table 2 compares FTTT with various baselines across four reasoning datasets. FTTT, both with and without self-reflected feedback, outperforms conventional test-time scaling methods on average. This success is partially explained by the findings of Ye et al. (2024a), which show that training with error-correction data enhances reasoning capabilities and models barely retry during inference. FTTT is also efficient. For instance, the inference time of L1ama-3.1-8B-Instruct on GSM8K with a budget of 32 is 3 GPU hours for the best parallel sampling method (Best-of-N) and 20 GPU hours for the best sequential revision method (Self-Refine). In contrast, FTTT achieves inference times of approximately 3 GPU hours without self-reflected feedback and 4 GPU hours with self-reflected feedback.
210
+
211
+ Notably, self-reflected feedback does not always improve results. Its effectiveness appears to depend on the LLM's self-reflection ability. To test this, we computed the Spearman rank correlation between FTTT and Self-Refine, a self-reflection-based algorithm. The Spearman coefficient $(r = 0.8656$ , $p \leq 0.05)$ indicates a strong positive correlation, supporting our hypothesis. We also observe that Self-Consistency performs poorly on code tasks because sampled code snippets rarely match exactly,
212
+
213
+ making majority voting akin to random selection.
214
+
215
+ Figure 3 illustrates performance for FTTT and baselines under varying budgets. FTTT consistently outperforms baselines, with greater gains under constrained budgets. In contrast, Revision and Self-Consistency do not scale well. Revision struggles with long-context reasoning due to length generalization issues (Li et al., 2024), while Self-Consistency fails to leverage feedback, often discarding correct answers during majority voting due to long-tailed distributions of correct answers (Brown et al., 2024).
216
+
217
+ # 4.3 Fine-Tuning Results
218
+
219
+ We present the results of PEFT baselines and OPTUNE with a budget of 32 in Table 3. Best-of-N is applied to PEFT baselines to exploit test-time feedback. HumanEval is excluded as it lacks a training set. Table 3 highlights the effectiveness of OPTUNE, outperforming all PEFT baselines by at least $2.58\%$ on average. OPTUNE is also parameter-efficient, with 439K trainable parameters that are comparable to the most lightweight PEFT method (LN-Tuning, 266K parameters), while surpassing the best PEFT method (LoRA, 1.7M parameters) with an order of magnitude fewer parameters. However, OPTUNE shows suboptimal performance on MATH for Mistral-7B-Instruct-v0.3, which is consistent
220
+
221
+ <table><tr><td>Method</td><td>#Param.</td><td>MATH</td><td>GSM8K</td><td>MBPP</td><td>Avg.</td></tr><tr><td colspan="6">Llama-3.1-8B-Instruct</td></tr><tr><td>Adapter (Houlsby et al., 2019)</td><td>134M</td><td>0.59330.0151</td><td>0.79790.0056</td><td>0.26320.0058</td><td>0.5515</td></tr><tr><td>(IA)3(Liu et al., 2022)</td><td>524K</td><td>0.61870.0105</td><td>0.89290.0107</td><td>0.56850.0022</td><td>0.6934</td></tr><tr><td>LoRA (Hu et al., 2022)</td><td>1.7M</td><td>0.63870.0136</td><td>0.91860.0037</td><td>0.56390.0242</td><td>0.7071</td></tr><tr><td>LN-Tuning (Zhao et al., 2024)</td><td>266K</td><td>0.62800.0113</td><td>0.88990.0056</td><td>0.57480.0175</td><td>0.6976</td></tr><tr><td>Full Fine-Tuning</td><td>8B</td><td>0.60270.0136</td><td>0.77220.0056</td><td>0.40340.0096</td><td>0.5928</td></tr><tr><td>OPTUNE</td><td>439K</td><td>0.70130.0050</td><td>0.92460.0056</td><td>0.61840.0159</td><td>0.7481</td></tr><tr><td colspan="6">Mistral-7B-Instruct-v0.3</td></tr><tr><td>Adapter (Houlsby et al., 2019)</td><td>134M</td><td>0.54180.0111</td><td>0.82640.0021</td><td>0.27630.0076</td><td>0.5482</td></tr><tr><td>(IA)3(Liu et al., 2022)</td><td>524K</td><td>0.50410.0056</td><td>0.86860.0060</td><td>0.49140.0185</td><td>0.6214</td></tr><tr><td>LoRA (Hu et al., 2022)</td><td>1.7M</td><td>0.51170.0091</td><td>0.86860.0016</td><td>0.49680.0046</td><td>0.6257</td></tr><tr><td>LN-Tuning (Zhao et al., 2024)</td><td>266K</td><td>0.43570.0115</td><td>0.82590.0051</td><td>0.40650.0095</td><td>0.5560</td></tr><tr><td>Full Fine-Tuning</td><td>7B</td><td>0.53880.0157</td><td>0.73550.0016</td><td>0.25480.0095</td><td>0.5097</td></tr><tr><td>OPTUNE</td><td>439K</td><td>0.48910.0111</td><td>0.90030.0039</td><td>0.51940.0070</td><td>0.6363</td></tr></table>
222
+
223
+ Table 3: Fine-tuning results on four datasets with a budget of 32. #Param. denotes the number of trainable parameters. We report the mean of three runs with different random seeds and standard deviation in the subscript. Bold entries are the best results.
224
+
225
+ ![](images/10b81f34ad1a0c1839df621d1c9bffbbdc547b464dc7564da48a1ab5b2b28068.jpg)
226
+ Figure 4: The scaling trends of different fine-tuning methods under varying budgets. We report the mean results of three random trials. The first row is the results of Llama-3.1-8B-Instruct and the second row is Mistral-7B-Instruct-v0.3.
227
+
228
+ with other PEFT methods with few trainable parameters (e.g., $(\mathrm{IA})^3$ , LoRA, LN-Tuning). This is likely due to Mistral-7B-Instruct-v0.3's limited mathematical reasoning capabilities, requiring significant parameter updates to improve performance in this domain.
229
+
230
+ OPTUNE incurs negligible inference overhead. For example, on GSM8K with Llama-3.1-8B-Instruct and a budget of 32, the best test-time scaling baseline (FTTT) requires 4 GPU hours, whereas OPTUNE uses only 1.5 GPU hours, benefiting from shorter yet accurate predictions.
231
+
232
+ Finally, Figure 4 examines the scaling behavior
233
+
234
+ ior of PEFT baselines and OPTUNE. Initially, OPTUNE underperforms compared to other PEFT methods and FTTT, but it mostly achieves superior results when the budget exceeds 2. OPTUNE's weaker performance with smaller budgets arises from its reliance on an initial attempt sampled from the raw LLM to initiate the process. This initial attempt often fails but is still counted as a valid attempt, making OPTUNE less competitive in low-budget settings.
235
+
236
+ # 4.4 Analysis
237
+
238
+ Ablation Study. Table 5 presents an ablation study on the architecture design of OPTUNE. The
239
+
240
+ Question: Blake and Kelly are having a contest to see who can run the most in 15 minutes. They decide to do it on a football field that is 100 yards long. Blake runs back and forth 15 times. Kelly runs back and forth once, and then decides that she doesn't want to run next to Blake, so she starts to run to the 40-yard line and back. She does this 34 times. How much farther does the winner run than the loser?
241
+
242
+ LoRA: Blake runs $15 * 100 * 2 = 3000$ yards.
243
+
244
+ Kelly runs $100 * 2 = 200$ yards for each run to the 40-yard line and back.
245
+
246
+ Kelly runs $200 * 34 = 6800$ yards.
247
+
248
+ Kelly runs $6800 - 3000 = 3800$ yards more than Blake.
249
+
250
+ The final answer is $3800 \times$
251
+
252
+ OPTUNE: Blake runs back and forth 15 times, and each time, he runs 100 yards twice because he runs to one end of the field and back. So, Blake's total running distance is $15 \times 200 = 3000$ yards. Kelly runs back and forth once, which is 200 yards, and then runs to the 40-yard line and back, which is $40 \times 2 = 80$ yards, and does this 34 times. Kelly's total running distance is $200 + (34 \times 80) = 200 + 2720 = 2920$ yards.
253
+
254
+ Therefore, Blake runs $3000 - 2920 = 80$ yards farther than Kelly. The final answer is $80 \checkmark$ .
255
+
256
+ Question: Josh decides to take up juggling to perform at the school talent show a month in the future. He starts off practicing juggling 3 balls, and slowly gets better adding 1 ball to his juggling act each week. After the end of the fourth week the talent show begins, but when Josh walks on stage he slips and drops three of his balls. 2 of them are caught by people in the crowd as they roll off the stage, but one gets lost completely since the auditorium is dark. With a sigh, Josh starts to juggle on stage with how many balls?
257
+
258
+ LoRA: Josh started with 3 balls and added 1 ball each week for 4 weeks, so he had $3 + 4 = 7$ balls.
259
+
260
+ He dropped 3 balls, but 2 were caught, so he lost 3 - 2 = 1 ball.
261
+
262
+ He was left with $7 - 1 = 6$ balls.
263
+
264
+ The final answer is $6 \times$
265
+
266
+ OPTUNE: Josh started with juggling 3 balls. After the end of the fourth week, Josh would have added 4 balls, making it a total of $3 + 4 = 7$ balls.
267
+
268
+ Josh had 3 balls left after 2 of the balls were caught by people in the crowd, so he was left with $7 - 3 = 4$ balls.
269
+
270
+ The final answer is $4\checkmark$
271
+
272
+ Table 4: Two GSM8K examples with model predictions. $\checkmark$ means correct and $x$ means incorrect. Sentences marked in orange are incorrect reasoning steps and those marked in blue are the correct counterparts.
273
+
274
+ <table><tr><td>Method</td><td>#Params.</td><td>Pass@1</td></tr><tr><td>OPTUNE</td><td>439K</td><td>0.2600</td></tr><tr><td>+ w/o Dropout</td><td>439K</td><td>0.2243</td></tr><tr><td>+ w/o Norm</td><td>439K</td><td>0.2150</td></tr><tr><td>+ Not Share θ1 &amp; θ2</td><td>878K</td><td>0.2243</td></tr></table>
275
+
276
+ Table 5: The ablation study of OPTUNE. We report results of Llama-3.1-8B-Instruct on MBPP with a budget of 2.
277
+
278
+ results demonstrate that all components are essential, as removing any of them significantly degrades performance. Notably, normalization is the most critical component, as it makes the input gradient scales more stable.
279
+
280
+ Case Study. Table 4 provides two examples on GSM8K where the leading PEFT method, LoRA, fails, but OPTUNE succeeds using Llama-3.1-8B-Instruct. These examples highlight OPTUNE's superior ability to correctly interpret and reason through questions, unlike LoRA.
281
+
282
+ # 5 Related Work
283
+
284
+ Learning from Feedback. Other than the heuristic binary feedback studied in this work, prior research has explored feedback from various sources, such as humans (Ouyang et al., 2022), other models (Yang et al., 2022), tools (Schick et al., 2023), and knowledge bases (Gao et al., 2023). This pa
285
+
286
+ per focuses on demonstrating the effectiveness of the proposed method and other feedback types are beyond the scope of this paper.
287
+
288
+ Test-Time Training. Test-Time Training (TTT) has shown success in the image modality by addressing distribution shifts and enhancing model capacity through self-supervised fine-tuning on each test case (Sun et al., 2020; Liu et al., 2021; Sun et al., 2023). Recent studies have extended TTT to the text modality (Hardt and Sun, 2024; Wang et al., 2024). The most relevant work, by Akyurek et al. (2024), uses TTT to enhance the reasoning ability of LLMs. However, their method relies heavily on human scaffolding for self-supervision and does not generalize beyond ARC-AGI (Chollet, 2019). In contrast, FTTT is generally applicable.
289
+
290
+ Learning to Optimize. Learning to Optimize (L2O) trains a network to act as an optimizer for another network (Chen et al., 2022). Early approaches used reinforcement learning to train such optimizers (Li and Malik, 2017; Chen et al., 2017), while recent work focuses on discovering analytical white-box optimizers (Bello et al., 2017; Chen et al., 2023). The most relevant work, MEND (Mitchell et al., 2022), trains a network to predict weight updates from training gradients. OPTUNE builds on this idea, extending it to learn from test-time feedback with a distinct architecture.
291
+
292
+ # 6 Conclusion
293
+
294
+ In this paper, we propose a novel paradigm that leverages optimization to address the challenge of exploiting test-time feedback, resulting in improved scaling performance. We further present a learnable test-time optimizer, OPTUNE, which surpasses various PEFT baselines. Both FTTT and OPTUNE are efficient in terms of speed and trainable parameter count.
295
+
296
+ # Limitations
297
+
298
+ The current evaluation setting limits FTTT's potential by providing only binary feedback (i.e., correct or incorrect) for each attempt. However, developing complex reasoning environments with rich feedback is beyond the scope of this work. Additionally, while continuous feedback, such as that from reward models (Yang et al., 2024), has been extensively studied, it is not examined here. Our method can be adapted to continuous feedback with minimal modifications, such as using REINFORCE (Williams, 1992). For coherence, we leave this exploration to future work.
299
+
300
+ # Acknowledgments
301
+
302
+ This work is supported by National Key R&D Program of China (Project No. 2022ZD0161200, 2022ZD0161201). This work is also supported by the Research Grants Council of the HKSAR - Early Career Scheme (Grant No. 24200223) and Hong Kong Innovation and Technology Commission Project No. ITS/228/22FP. It is also partially supported by RGC Senior Research Fellow Scheme Ref. No. SRFS2425-4S03.
303
+
304
+ # References
305
+
306
+ Ekin Akyurek, Mehul Damani, Linlu Qiu, Han Guo, Yoon Kim, and Jacob Andreas. 2024. The surprising effectiveness of test-time training for abstract reasoning. Preprint, arXiv:2411.07279.
307
+ Jacob Austin, Augustus Odena, Maxwell I. Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie J. Cai, Michael Terry, Quoc V. Le, and Charles Sutton. 2021. Program synthesis with large language models. CoRR, abs/2108.07732.
308
+ Jimmy Ba, Geoffrey E. Hinton, Volodymyr Mnih, Joel Z. Leibo, and Catalin Ionescu. 2016. Using fast weights to attend to the recent past. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 4331-4339.
309
+
310
+ Irwan Bello, Barret Zoph, Vijay Vasudevan, and Quoc V. Le. 2017. Neural optimizer search with reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pages 459-468. PMLR.
311
+ Bradley C. A. Brown, Jordan Juravsky, Ryan Saul Ehrlich, Ronald Clark, Quoc V. Le, Christopher Ré, and Azalia Mirhoseini. 2024. Large language monkeys: Scaling inference compute with repeated sampling. CoRR, abs/2407.21787.
312
+ Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidi Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Joshua Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. 2021. Evaluating large language models trained on code. CoRR, abs/2107.03374.
313
+ Tianlong Chen, Xiaohan Chen, Wuyang Chen, Howard Heaton, Jialin Liu, Zhangyang Wang, and Wotao Yin. 2022. Learning to optimize: A primer and A benchmark. J. Mach. Learn. Res., 23:189:1-189:59.
314
+ Xiangning Chen, Chen Liang, Da Huang, Esteban Real, Kaiyuan Wang, Hieu Pham, Xuanyi Dong, Thang Luong, Cho-Jui Hsieh, Yifeng Lu, and Quoc V. Le. 2023. Symbolic discovery of optimization algorithms. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.
315
+ Yutian Chen, Matthew W. Hoffman, Sergio Gomez Colmenarejo, Misha Denil, Timothy P. Lillicrap, Matthew M. Botvinick, and Nando de Freitas. 2017. Learning to learn without gradient descent by gradient descent. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pages 748-756. PMLR.
316
+ François Chollet. 2019. On the measure of intelligence. Preprint, arXiv:1911.01547.
317
+ Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias
318
+
319
+ Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. 2021. Training verifiers to solve math word problems. CoRR, abs/2110.14168.
320
+ Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, Anirudh Goyal, Anthony Hartshorn, Aobo Yang, Archi Mitra, Archie Sravankumar, Artem Korenev, Arthur Hinsvark, Arun Rao, Aston Zhang, Aurélien Rodriguez, Austen Gregerson, Ava Spataru, Baptiste Rozière, Bethany Biron, Binh Tang, Bobbie Chern, Charlotte Caucheteux, Chaya Nayak, Chloe Bi, Chris Marra, Chris McConnell, Christian Keller, Christophe Touret, Chunyang Wu, Corinne Wong, Cristian Canton Ferrer, Cyrus Nikolaidis, Damien Allonsius, Daniel Song, Danielle Pintz, Danny Livshits, David Esiobu, Dhruv Choudhary, Dhruv Mahajan, Diego Garcia-Olano, Diego Perino, Dieuwke Hupkes, Egor Lakomkin, Ehab AlBadawy, Elina Lobanova, Emily Dinan, Eric Michael Smith, Filip Radenovic, Frank Zhang, Gabriel Synnaeve, Gabrielle Lee, Georgia Lewis Anderson, Graeme Nail, Grégoire Mialon, Guan Pang, Guillem Cucurell, Hailey Nguyen, Hannah Korevaar, Hu Xu, Hugo Touvron, Iliyan Zarov, Imanol Arrieta Ibarra, Isabel M. Kloumann, Ishan Misra, Ivan Evtimov, Jade Copet, Jaewon Lee, Jan Geffert, Jana Vranes, Jason Park, Jay Mahadeokar, Jeet Shah, Jelmer van der Linde, Jennifer Billock, Jenny Hong, Jenya Lee, Jeremy Fu, Jianfeng Chi, Jianyu Huang, Jiawen Liu, Jie Wang, Jiecao Yu, Joanna Bitton, Joe Spisak, Jongsoo Park, Joseph Rocca, Joshua Johnstun, Joshua Saxe, Junteng Jia, Kalyan Vasuden Alwala, Kartikeya Upasani, Kate Plawiak, Ke Li, Kenneth Heafield, Kevin Stone, and et al. 2024. The llama 3 herd of models. CoRR abs/2407.21783.
321
+ Luyu Gao, Zhuyun Dai, Panupong Pasupat, Anthony Chen, Arun Tejasvi Chaganty, Yicheng Fan, Vincent Zhao, Ni Lao, Hongrae Lee, Da-Cheng Juan, and Kelvin Guu. 2023. RARR: Researching and revising what language models say, using language models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 16477-16508, Toronto, Canada. Association for Computational Linguistics.
322
+ Xinyu Guan, Li Lyna Zhang, Yifei Liu, Ning Shang, Youran Sun, Yi Zhu, Fan Yang, and Mao Yang. 2025. rstar-math: Small llms can master math reasoning with self-evolved deep thinking. Preprint, arXiv:2501.04519.
323
+ Moritz Hardt and Yu Sun. 2024. Test-time training on nearest neighbors for large language models. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.
324
+ Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. 2021. Measuring mathematical problem solving with the MATH dataset. In Proceedings
325
+
326
+ of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual.
327
+ Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. The curious case of neural text degeneration. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net.
328
+ Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-efficient transfer learning for NLP. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 2790-2799. PMLR.
329
+ Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. Lora: Low-rank adaptation of large language models. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net.
330
+ Jie Huang, Xinyun Chen, Swaroop Mishra, Huaixiu Steven Zheng, Adams Wei Yu, Xinying Song, and Denny Zhou. 2024. Large language models cannot self-correct reasoning yet. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.
331
+ Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de Las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, Lélio Renard Lavaud, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timothee Lacroix, and William El Sayed. 2023. Mistral 7b. CoRR, abs/2310.06825.
332
+ Yoon Kim and Alexander M. Rush. 2016. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1317-1327, Austin, Texas. Association for Computational Linguistics.
333
+ Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings.
334
+ Ke Li and Jitendra Malik. 2017. Learning to optimize. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. Open-Review.net.
335
+
336
+ Yanyang Li, Shuo Liang, Michael Lyu, and Liwei Wang. 2024. Making long-context language models better multi-hop reasoners. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2462-2475, Bangkok, Thailand. Association for Computational Linguistics.
337
+ Hunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. 2024. Let's verify step by step. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.
338
+ Haokun Liu, Derek Tam, Mohammed Muqeeth, Jay Mohta, Tenghao Huang, Mohit Bansal, and Colin Raffel. 2022. Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.
339
+ Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024. Lost in the middle: How language models use long contexts. Trans. Assoc. Comput. Linguistics, 12:157-173.
340
+ Runze Liu, Junqi Gao, Jian Zhao, Kaiyan Zhang, Xiu Li, Biqing Qi, Wanli Ouyang, and Bowen Zhou. 2025. Can 1b llm surpass 405b llm? rethinking compute-optimal test-time scaling. Preprint, arXiv:2502.06703.
341
+ Yuejiang Liu, Parth Kothari, Bastien van Delft, Baptiste Bellot-Gurlet, Taylor Mordan, and Alexandre Alahi. 2021. TTT++: when does self-supervised test-time training fail or thrive? In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pages 21808-21820.
342
+ Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, Shashank Gupta, Bodhisattwa Prasad Majumder, Katherine Hermann, Sean Welleck, Amir Yazdanbakhsh, and Peter Clark. 2023. Self-refine: Iterative refinement with self-feedback. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.
343
+ Eric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn, and Christopher D. Manning. 2022. Fast model editing at scale. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net.
344
+
345
+ Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Li Fei-Fei, Hannaneh Hajishirzi, Luke Zettlemoyer, Percy Liang, Emmanuel Candès, and Tatsunori Hashimoto. 2025. s1: Simple test-time scaling. Preprint, arXiv:2501.19393.
346
+ OpenAI, :, Ahmed El-Kishky, Alexander Wei, Andre Saraiva, Borys Minaev, Daniel Selsam, David Dohan, Francis Song, Hunter Lightman, Ignasi Clavera, Jakub Pachocki, Jerry Tworek, Lorenz Kuhn, Lukasz Kaiser, Mark Chen, Max Schwarzer, Mostafa Rohaninejad, Nat McAleese, o3 contributors, Oleg Mürk, Rhythm Garg, Rui Shu, Szymon Sidor, Vineet Kosaraju, and Wenda Zhou. 2025. Competitive programming with large reasoning models. Preprint, arXiv:2502.06807.
347
+ Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F. Christiano, Jan Leike, and Ryan Lowe. 2022. Training language models to follow instructions with human feedback. In Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.
348
+ Peng Si Ow and Thomas E Morton. 1988. Filtered beam search in scheduling. The International Journal Of Production Research, 26(1):35-62.
349
+ Timo Schick, Jane Dwivedi-Yu, Roberto Dessi, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. 2023. Toolformer: Language models can teach themselves to use tools. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.
350
+ Imanol Schlag, Kazuki Irie, and Jürgen Schmidhuber. 2021. Linear transformers are secretly fast weight programmers. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 9355-9366. PMLR.
351
+ Jürgen Schmidhuber. 1992. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. *Neural Comput.*, 4(1):131-139.
352
+ Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. 2023. Reflection: language agents with verbal reinforcement learning. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.
353
+
354
+ Charlie Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. 2024. Scaling LLM test-time compute optimally can be more effective than scaling model parameters. CoRR, abs/2408.03314.
355
+ Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: a simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1):1929-1958.
356
+ Yu Sun, Xinhao Li, Karan Dalal, Chloe Hsu, Sanmi Koyejo, Carlos Guestrin, Xiaolong Wang, Tatsunori Hashimoto, and Xinlei Chen. 2023. Learning to (learn at test time). CoRR, abs/2310.13807.
357
+ Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei A. Efros, and Moritz Hardt. 2020. Test-time training with self-supervision for generalization under distribution shifts. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 9229-9248. PMLR.
358
+ Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V. Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2023. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net.
359
+ Yan Wang, D. Ma, and Deng Cai. 2024. With greater text comes greater necessity: Inference-time training helps long text generation. CoRR, abs/2401.11504.
360
+ Ronald J. Williams. 1992. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn., 8:229-256.
361
+ Yangzhen Wu, Zhiqing Sun, Shanda Li, Sean Welleck, and Yiming Yang. 2024. Inference scaling laws: An empirical analysis of compute-optimal inference for problem-solving with language models. Preprint, arXiv:2408.00724.
362
+ Yuxi Xie, Kenji Kawaguchi, Yiran Zhao, James Xu Zhao, Min-Yen Kan, Junxian He, and Michael Qizhe Xie. 2023. Self-evaluation guided beam search for reasoning. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023.
363
+ An Yang, Beichen Zhang, Binyuan Hui, Bofei Gao, Bowen Yu, Chengpeng Li, Dayiheng Liu, Jianhong Tu, Jingren Zhou, Junyang Lin, Keming Lu, Mingfeng Xue, Runji Lin, Tianyu Liu, Xingzhang Ren, and Zhenru Zhang. 2024. Qwen2.5-math technical report: Toward mathematical expert model via self-improvement. CoRR, abs/2409.12122.
364
+
365
+ Kevin Yang, Yuandong Tian, Nanyun Peng, and Dan Klein. 2022. Re3: Generating longer stories with recursive prompting and revision. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 4393-4479, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
366
+ Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R. Narasimhan, and Yuan Cao. 2023. React: Synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net.
367
+ Tian Ye, Zicheng Xu, Yuanzhi Li, and Zeyuan Allen-Zhu. 2024a. Physics of language models: Part 2.2, how to learn from mistakes on grade-school math problems. Preprint, arXiv:2408.16293.
368
+ Tianzhu Ye, Li Dong, Yuqing Xia, Yutao Sun, Yi Zhu, Gao Huang, and Furu Wei. 2024b. Differential transformer. Preprint, arXiv:2410.05258.
369
+ Bingchen Zhao, Haoqin Tu, Chen Wei, Jieru Mei, and Cihang Xie. 2024. Tuning layernorm in attention: Towards efficient multi-modal LLM finetuning. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net.
370
+
371
+ # A Hyperparameter Settings
372
+
373
+ Below is the detailed configurations of different PEFT methods:
374
+
375
+ - Adapter uses a learning rate of 1e-4 and the reduction factor of the bottleneck is 16.
376
+ - $(\mathbf{IA})^3$ uses a learning rate of 5e-5.
377
+ - LoRA uses a learning rate of 2e-5. We only apply LoRA to the query and value projections in the last 8 layers, with a rank of 16 and a dropout ratio of 0.05.
378
+ - LN-Tuning uses a learning rate of 4e-4.
379
+ - Full Fine-Tuning uses a learning rate of 1e-5. The number of training epochs is 100, 10, and 3 for MBPP, GSM8K, and MATH, respectively. We use the Adam optimizer with a batch size of 20 for all methods in all datasets, including OPTUNE. We use the checkpoint of the last epoch for inference.
380
+
381
+ For OPTUNE, we sample 10 attempts for each training example together with the raw question to construct the model input. We employ nucleus sampling (Holtzman et al., 2020) with a temperature of 0.6 and $p = 0.95$ to generate attempts. The number of training epochs for MBPP, GSM8K, and MATH is set to 10, 3, and 3, respectively. The learning rate is 1e-5. In inference, we sample an attempt using the same hyperparameters as in data generation before applying OPTUNE to mitigate
382
+
383
+ ![](images/ed709c064596f2859ed390492256c68f283c062f7e684497550e6fb0538c0dc6.jpg)
384
+ Figure 5: The training curves of PEFT methods when fine-tuning Llama-3.1-8B-Instruct on MBPP.
385
+
386
+ the train-test discrepancy. We alternate between sampling attempts from the raw LLM and predicting refined attempts from sampled attempts when scaling OPTUNE with more budgets.
387
+
388
+ # B Prompts
389
+
390
+ Below is the reflection generation prompts $P$ for Llama-3.1-8B-Instruct and Mistral-7B-Instruct-v0.3:
391
+
392
+ # Llama-3.1-8B-Instruct
393
+
394
+ User: Solve the following math problem ... Assistant: ... the final answer is: ...
395
+
396
+ User: Your answer is incorrect. Please carefully check the solution and summarize all mistakes in short. Do NOT provide the corrected solution. Do NOT say "my solution".
397
+
398
+ Assistant: Here is the summary of the mistakes in the previous solution ...
399
+
400
+ # Mistral-7B-Instruct-v0.3
401
+
402
+ User: Solve the following math problem ... Assistant: ... the final answer is: ...
403
+
404
+ User: Your answer is incorrect. Carefully check the solution step-by-step and list all mistakes in short. MUST NOT provide the correct answer. Your response MUST be in the third person tone.
405
+
406
+ Assistant: Here is the summary of the mistakes in the previous solution ...
407
+
408
+ Sentences in gray are the prompt $P$ and the one in blue is the generated reflection.
409
+
410
+ # C Training Curves
411
+
412
+ Figure 5 is the training curves of various PEFT methods, including OPTUNE. We observe that Adapter shows a clear signal of overfitting, where it has a training loss close to 0, while its performance
413
+
414
+ <table><tr><td>Model</td><td>GSM8K (trained on MATH)</td><td>HumanEval (trained on MBPP)</td></tr><tr><td colspan="3">Llama-3.1-8B-Instruct</td></tr><tr><td>Raw Model</td><td>0.8069</td><td>0.6728</td></tr><tr><td>+ OPTUNE</td><td>0.8914</td><td>0.7037</td></tr><tr><td colspan="3">Mistral-7B-Instruct-v0.3</td></tr><tr><td>Raw Model</td><td>0.7807</td><td>0.6500</td></tr><tr><td>+ OPTUNE</td><td>0.7921</td><td>0.7100</td></tr></table>
415
+
416
+ Table 6: The cross-task transferability of OPTUNE.
417
+
418
+ on the test set is the worst. All PEFT methods seem to converge smoothly. For OPTUNE, its training is not as stable as baselines, suggesting the difficulty of learning to optimize problem.
419
+
420
+ # D Transferability
421
+
422
+ While generalization and transfer are not the primary focus of this work, we demonstrate OPTUNE's transferability by training it on one dataset (MBPP/MATH) and testing it on another (HumanEval/GSM8K). Table 6 indicates that OPTUNE consistently improves baseline performance, even when tested on unseen datasets. This highlights OPTUNE's potential for generalization and transferability.
2025/Learning to Reason from Feedback at Test-Time/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:865ef1b03960f0d2533bafd73f44e5b2669ab8f91d7d08cb2c93754064487522
3
+ size 631138
2025/Learning to Reason from Feedback at Test-Time/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/7e8e6ea3-0b1b-4f33-86f0-4eaba3c14cbc_content_list.json ADDED
@@ -0,0 +1,1822 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Learning to Rewrite: Generalized LLM-Generated Text Detection",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 154,
8
+ 90,
9
+ 842,
10
+ 111
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Wei Hao $^{1*}$ , Ran Li $^{1*}$ , Weiliang Zhao $^{1}$ , Junfeng Yang $^{1}$ , Chengzhi Mao $^{2}$ , Columbia University $^{1}$ , Rutgers University $^{2}$",
17
+ "bbox": [
18
+ 174,
19
+ 143,
20
+ 821,
21
+ 177
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "{rl3424,wh2473,wz2665,jy2324}@columbia.edu,cm1838@rutgers.edu",
28
+ "bbox": [
29
+ 169,
30
+ 179,
31
+ 826,
32
+ 193
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Abstract",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 260,
42
+ 225,
43
+ 339,
44
+ 240
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Detecting text generated by Large Language Models (LLMs) is crucial, yet current detectors often struggle to generalize in open-world settings. We introduce Learning2Rewrite, a novel framework to detect LLM-generated text with exceptional generalization to unseen domains. Capitalized on the finding that LLMs inherently modify LLM-generated content less than human-written text when rewriting, we train an LLM to amplify this disparity, yielding a more distinguishable and generalizable edit distance across diverse text distributions. Extensive experiments on data from 21 independent domains and four major LLMs (GPT-3.5, GPT-4, Gemini, and Llama-3) demonstrate that our detector outperforms state-of-the-art detection methods by up to $23.04\\%$ in AUROC for in-distribution tests, $35.10\\%$ for out-of-distribution tests, and $48.66\\%$ under adversarial attacks. Our unique training objective ensures better generalizability compared to directly training for classification, even when leveraging the same amount of tunable parameters. Our findings suggest that reinforcing LLMs' inherent rewriting tendencies offers a robust and scalable solution for detecting LLM-generated text.",
51
+ "bbox": [
52
+ 141,
53
+ 253,
54
+ 460,
55
+ 636
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 Introduction",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 114,
65
+ 649,
66
+ 258,
67
+ 664
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Large Language Models (LLMs) demonstrate exceptional capabilities in various tasks (Radford et al., 2019; Brown et al., 2020; Achiam et al., 2023; Touvron et al., 2023; Team et al., 2023; OpenAI, 2020). However, they can be misused for illegal or unethical activities, such as spreading misinformation (Chen and Shu, 2023), scaling phishing campaigns (Hao et al., 2025), manipulating social media (Zhang et al., 2024), and generating propaganda (Pan et al., 2023). LLMs also facilitate academic dishonesty (Zellers et al., 2019; Mvondo et al., 2023), and training foundation models with generated content can lead to irreversible defects in the resulting models (Shumailov et al., 2023).",
74
+ "bbox": [
75
+ 112,
76
+ 674,
77
+ 490,
78
+ 900
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "image",
84
+ "img_path": "images/24b17d2a3360beaa89902cc116fc5ac92d16d1b53a8cfe78bb64e33baee910dc.jpg",
85
+ "image_caption": [],
86
+ "image_footnote": [],
87
+ "bbox": [
88
+ 522,
89
+ 263,
90
+ 640,
91
+ 330
92
+ ],
93
+ "page_idx": 0
94
+ },
95
+ {
96
+ "type": "image",
97
+ "img_path": "images/a77a232b5a248e60701c61944dcf6c27280ef346dd03ac84b42349aeece0d043.jpg",
98
+ "image_caption": [],
99
+ "image_footnote": [],
100
+ "bbox": [
101
+ 643,
102
+ 266,
103
+ 761,
104
+ 330
105
+ ],
106
+ "page_idx": 0
107
+ },
108
+ {
109
+ "type": "image",
110
+ "img_path": "images/4ccb4fcf41bb3e11a4203383fcdddb9f2fcaf3a00cd6f957e21918f9e3086d42.jpg",
111
+ "image_caption": [],
112
+ "image_footnote": [],
113
+ "bbox": [
114
+ 769,
115
+ 263,
116
+ 863,
117
+ 326
118
+ ],
119
+ "page_idx": 0
120
+ },
121
+ {
122
+ "type": "image",
123
+ "img_path": "images/eba25e7ccce4ae215ca5d3e0d37cf9064e0e46271d4d2ec7482e94d04b522727.jpg",
124
+ "image_caption": [
125
+ "Figure 1: Rewriting for LLM-generated Text Detection. The histograms depict the edit distance distributions for texts generated by human and LLMs, illustrating how fine-tuning a rewrite model enhances their separation. We show two domains: Purple and Yellow represent human and LLM distributions for Product Review texts, while Blue and Orange represent those for Environmental texts. Without fine-tuning the rewrite model, human and LLM distributions are inseparable by a single threshold (red line, above). After fine-tuning, the texts can be separated by one threshold (below). On the right, we conceptualize L2R's intuition by showing that the rugged decision boundary between human and LLM texts, caused by varying data distributions across domains, can be better aligned and divided by a single threshold after fine-tuning. Specifically, the standard deviation in decision thresholds among all domains decreases from 0.7506 to 0.4428 after fine-tuning."
126
+ ],
127
+ "image_footnote": [],
128
+ "bbox": [
129
+ 522,
130
+ 340,
131
+ 640,
132
+ 404
133
+ ],
134
+ "page_idx": 0
135
+ },
136
+ {
137
+ "type": "image",
138
+ "img_path": "images/a73ff7f6d2854932ce86cbb34cf4686137358c2fd22dd5eb80354c33f6f62664.jpg",
139
+ "image_caption": [],
140
+ "image_footnote": [],
141
+ "bbox": [
142
+ 643,
143
+ 340,
144
+ 761,
145
+ 404
146
+ ],
147
+ "page_idx": 0
148
+ },
149
+ {
150
+ "type": "image",
151
+ "img_path": "images/0fd38b11b1fd5da522698535d1c4b687b365cc510172929a93d8cb35392c030b.jpg",
152
+ "image_caption": [],
153
+ "image_footnote": [],
154
+ "bbox": [
155
+ 769,
156
+ 336,
157
+ 863,
158
+ 399
159
+ ],
160
+ "page_idx": 0
161
+ },
162
+ {
163
+ "type": "text",
164
+ "text": "These issues highlight the urgent need for reliable algorithms to detect LLM-generated text.",
165
+ "bbox": [
166
+ 507,
167
+ 684,
168
+ 882,
169
+ 715
170
+ ],
171
+ "page_idx": 0
172
+ },
173
+ {
174
+ "type": "text",
175
+ "text": "Various methods for detecting LLM-generated text have been proposed (Solaiman et al., 2019; Mitrovic et al., 2023; Mitchell et al., 2023; Su et al., 2023; Liu et al., 2024; Bao et al., 2024; Mao et al., 2024; Verma et al., 2024; Gehrmann et al., 2019). Most of these detectors employ pre-trained models, extracting hand-crafted features and heuristics (e.g., loss curvature (Bao et al., 2024), edit distance from rewriting (Mao et al., 2024)), and apply thresholds to separate LLM from human text. However, these thresholds are highly domain-dependent, hindering a universal detection standard.",
176
+ "bbox": [
177
+ 507,
178
+ 715,
179
+ 884,
180
+ 908
181
+ ],
182
+ "page_idx": 0
183
+ },
184
+ {
185
+ "type": "page_footnote",
186
+ "text": "*Equal contribution, order is sorted by last name.",
187
+ "bbox": [
188
+ 134,
189
+ 906,
190
+ 435,
191
+ 920
192
+ ],
193
+ "page_idx": 0
194
+ },
195
+ {
196
+ "type": "page_number",
197
+ "text": "6421",
198
+ "bbox": [
199
+ 480,
200
+ 927,
201
+ 517,
202
+ 940
203
+ ],
204
+ "page_idx": 0
205
+ },
206
+ {
207
+ "type": "footer",
208
+ "text": "Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6421-6434 July 27 - August 1, 2025 ©2025 Association for Computational Linguistics",
209
+ "bbox": [
210
+ 90,
211
+ 945,
212
+ 905,
213
+ 973
214
+ ],
215
+ "page_idx": 0
216
+ },
217
+ {
218
+ "type": "text",
219
+ "text": "In this paper, we present L2R (Learning-to-Rewrite), which trains an LLM to specifically perform more edits when asked to rewrite human-generated text and fewer edits when rewriting LLM-generated text across a diverse set of domains, thus effectively distinguish LLM-generated text from human-generated one. Unlike traditional detectors designed solely for binary classification, which perform well in-distribution (ID) but struggle to generalize to out-of-distribution (OOD) domains including adversarial attacks, our method reinforces LLMs' inherent reluctance to rewrite their own outputs by using rewriting as an additional training objective to maximize this tendency, thereby enhancing generalizability and enabling a single detection threshold across diverse distributions. Figure 1 illustrates an example of how L2R learns to make LLM and human-generated text more separable across domains, compared to only rewriting using a pre-trained model (Mao et al., 2024).",
220
+ "bbox": [
221
+ 115,
222
+ 84,
223
+ 490,
224
+ 405
225
+ ],
226
+ "page_idx": 1
227
+ },
228
+ {
229
+ "type": "text",
230
+ "text": "On a dataset spanning 21 domains (e.g., finance, entertainment, cuisine) and constructed using four major LLMs (GPT-3.5, GPT-4, Gemini, and Llama3), L2R surpasses the state-of-the-art detectors, achieving up to $19.56\\%$ higher AUROC ID and $35.10\\%$ higher OOD than Verma et al. (2024), $23.04\\%$ higher ID and $9.90\\%$ higher OOD than Bao et al. (2024), and $10.39\\%$ higher ID and $4.67\\%$ higher OOD than Mao et al. (2024). Compared with fine-tuning a Llama-3 model for naive text classification, L2R has $51.35\\%$ higher AUROC OOD despite leveraging the same number of tunable parameters. L2R also outperforms the state-ofthe-art detectors by up to $48.66\\%$ under adversarial attacks. These results demonstrate that our training objective offers superior accuracy and generalizability. Furthermore, our method provides interpretability by highlighting the rewritten portions of the text. Our codebase is open-sourced<sup>1</sup> and our contributions are summarized as follows:",
231
+ "bbox": [
232
+ 115,
233
+ 407,
234
+ 489,
235
+ 726
236
+ ],
237
+ "page_idx": 1
238
+ },
239
+ {
240
+ "type": "list",
241
+ "sub_type": "text",
242
+ "list_items": [
243
+ "- While binary classifiers often learn spurious, domain-specific features for LLM-generated text detection, we propose L2R, which learns a proxy based on the minimal edit distance on LLM content, yielding a more robust and invariant detection threshold.",
244
+ "- We build a diversely generated dataset (21 domains) and design a calibration loss function to make fine-tuning both effective and stable.",
245
+ "- We conduct comprehensive evaluations on ID,"
246
+ ],
247
+ "bbox": [
248
+ 136,
249
+ 730,
250
+ 487,
251
+ 895
252
+ ],
253
+ "page_idx": 1
254
+ },
255
+ {
256
+ "type": "text",
257
+ "text": "OOD datasets and against different adversarial attacks (Decoherence and Rewrite bypassing), showing that L2R surpasses state-of-the-art detection methods.",
258
+ "bbox": [
259
+ 544,
260
+ 84,
261
+ 882,
262
+ 148
263
+ ],
264
+ "page_idx": 1
265
+ },
266
+ {
267
+ "type": "text",
268
+ "text": "2 Related Work",
269
+ "text_level": 1,
270
+ "bbox": [
271
+ 509,
272
+ 162,
273
+ 665,
274
+ 178
275
+ ],
276
+ "page_idx": 1
277
+ },
278
+ {
279
+ "type": "text",
280
+ "text": "Various LLM-generated text detectors have been proposed over the years. One set of detectors trains a model on the input text (Solaiman et al., 2019; Mitrovic et al., 2023; Liu et al., 2023). These methods excel in their training domains, but struggle under OOD evaluation (Pu et al., 2023), i.e., detection with text from different domains or unfamiliar models. The second set of detectors utilize the raw output, i.e., logits, from pre-trained LLMs to assign probability score for detection. GLTR (Gehrmann et al., 2019) utilizes statistical features like log probability, word rank, and entropy to assign score, Ghostbuster (Verma et al., 2024) utilizes log probability and unigram and bigram probability, DetectGPT (Mitchell et al., 2023) employs the delta in log probability of the input text after token perturbation to estimate AI likelihood, PECOLA (Liu et al., 2024) selectively applies perturbation for enhanced accuracy, and Fast-DetectGPT (Bao et al., 2024) simplifies the process by exploiting conditional probability curvature. This family of detectors shows improved generalizability, but all require access to the raw output of an LLM. Since the main targets, namely the commercial LLMs, are not open sourced, this poses a challenge for accurate probability estimation using proxy models. Lastly, RAID (Mao et al., 2024) is a detection method based on the observation that LLMs, when asked to rewrite a given text, tend to produce a higher number of edits for human-written text compared to LLM-generated text. Despite the attempt to capture the edit distance from rewrite as a domain-agnostic feature, the amount of edits still varies across distributions, and the threshold of edit amount between human and LLM texts learned on training domains does not generalize to OOD domains, which limits its full potential.",
281
+ "bbox": [
282
+ 507,
283
+ 187,
284
+ 884,
285
+ 785
286
+ ],
287
+ "page_idx": 1
288
+ },
289
+ {
290
+ "type": "text",
291
+ "text": "3 Method",
292
+ "text_level": 1,
293
+ "bbox": [
294
+ 509,
295
+ 789,
296
+ 613,
297
+ 803
298
+ ],
299
+ "page_idx": 1
300
+ },
301
+ {
302
+ "type": "text",
303
+ "text": "3.1 Rewriting for LLM Detection",
304
+ "text_level": 1,
305
+ "bbox": [
306
+ 509,
307
+ 807,
308
+ 788,
309
+ 822
310
+ ],
311
+ "page_idx": 1
312
+ },
313
+ {
314
+ "type": "text",
315
+ "text": "Rewriting input with LLM and then measuring the edits proves to be a successful way to detect LLM-generated text. Given an held-out input text set $\\mathbf{X}_{train}$ with LLM and human generated texts, and its corresponding label set $\\mathbf{Y}_{train}$ , an LLM $F(\\cdot)$ is",
316
+ "bbox": [
317
+ 507,
318
+ 828,
319
+ 882,
320
+ 909
321
+ ],
322
+ "page_idx": 1
323
+ },
324
+ {
325
+ "type": "page_footnote",
326
+ "text": "1https://github.com/ranhli/l2r_data",
327
+ "bbox": [
328
+ 136,
329
+ 903,
330
+ 403,
331
+ 917
332
+ ],
333
+ "page_idx": 1
334
+ },
335
+ {
336
+ "type": "page_number",
337
+ "text": "6422",
338
+ "bbox": [
339
+ 480,
340
+ 927,
341
+ 519,
342
+ 940
343
+ ],
344
+ "page_idx": 1
345
+ },
346
+ {
347
+ "type": "image",
348
+ "img_path": "images/87c44ec5ce13a61f735eadb12b9415de78cab70d03c18ab7d193b0f1b23ecf86.jpg",
349
+ "image_caption": [
350
+ "Figure 2: Rewriting examples with edits. Deleted characters are marked in red, added characters are marked in blue, and unmodified characters are in black. We exploit the difference in edit distance between human and LLM-generated text for classification. While the pre-trained Llama-3 model give different amount of edits for human and LLM-generated text (above), rewrites from our fine-tuned model are much more separable (below)."
351
+ ],
352
+ "image_footnote": [],
353
+ "bbox": [
354
+ 117,
355
+ 82,
356
+ 884,
357
+ 435
358
+ ],
359
+ "page_idx": 2
360
+ },
361
+ {
362
+ "type": "text",
363
+ "text": "prompted to rewrite the input $\\mathbf{x} \\in \\mathbf{X}_{train}$ using a prompt $\\mathbf{p}$ . The rewriting output is $F(\\mathbf{p},\\mathbf{x})$ . Particularly, the prompt $\\mathbf{p}$ can be set to: \"Refine this for me please\".",
364
+ "bbox": [
365
+ 112,
366
+ 514,
367
+ 487,
368
+ 577
369
+ ],
370
+ "page_idx": 2
371
+ },
372
+ {
373
+ "type": "text",
374
+ "text": "The edit distance between the input text and the rewritten output, $D(\\mathbf{x}, F(\\mathbf{p}, \\mathbf{x}))$ , is then computed for all $\\mathbf{x} \\in \\mathbf{X}_{train}$ . Mao et al. (2024) adopts the Levenshtein score (Levenshtein et al., 1966), which measures the minimum number of insertions, deletions, or substitutions required to transform one text into the other. A higher score denotes the two strings are more similar. With the Levenshtein score, an edit distance used for classification is calculated as:",
375
+ "bbox": [
376
+ 112,
377
+ 580,
378
+ 487,
379
+ 739
380
+ ],
381
+ "page_idx": 2
382
+ },
383
+ {
384
+ "type": "equation",
385
+ "text": "\n$$\nD _ {k} (\\mathbf {x}, F (\\mathbf {p}, \\mathbf {x})) = 1 - \\frac {\\text {L e v e n s h t e i n} (F (\\mathbf {p} , \\mathbf {x}) , \\mathbf {x})}{\\max (l e n (F (\\mathbf {p} , \\mathbf {x})) , l e n (\\mathbf {x}))}. \\tag {1}\n$$\n",
386
+ "text_format": "latex",
387
+ "bbox": [
388
+ 114,
389
+ 747,
390
+ 497,
391
+ 795
392
+ ],
393
+ "page_idx": 2
394
+ },
395
+ {
396
+ "type": "text",
397
+ "text": "Mao et al. (2024) trains a classifier, such as logistic regression or decision tree, to threshold the edit distance and predict if a text is written by an LLM. However, as shown in Figure 1, the threshold of rewriting with a pre-trained LLM often varies from one domain to another, causing RAIDAR to fail to generalize to new domains.",
398
+ "bbox": [
399
+ 112,
400
+ 795,
401
+ 487,
402
+ 908
403
+ ],
404
+ "page_idx": 2
405
+ },
406
+ {
407
+ "type": "text",
408
+ "text": "3.2 Fine-Tuning the Rewrite Model",
409
+ "text_level": 1,
410
+ "bbox": [
411
+ 507,
412
+ 514,
413
+ 803,
414
+ 531
415
+ ],
416
+ "page_idx": 2
417
+ },
418
+ {
419
+ "type": "text",
420
+ "text": "L2R works on the premise that human-written and LLM-generated text would cause a different amount of edits and a boundary can be drawn to separate both distributions. Thus we can finetune such a rewrite model $F'(\\cdot)$ , that gives as much edits as possible for human texts, while leaving the LLM texts unmodified, demonstrated in Figure 2. Given some human text $\\mathbf{x}_h \\in \\mathbf{X}_{train}$ and LLM text $\\mathbf{x}_{llm} \\in \\mathbf{X}_{train}$ , our objective becomes:",
421
+ "bbox": [
422
+ 505,
423
+ 536,
424
+ 882,
425
+ 681
426
+ ],
427
+ "page_idx": 2
428
+ },
429
+ {
430
+ "type": "equation",
431
+ "text": "\n$$\n\\left. \\max \\left\\{D \\left(\\mathbf {x} _ {h}, F ^ {\\prime} (\\mathbf {p}, \\mathbf {x} _ {h})\\right) - D \\left(\\mathbf {x} _ {l l m}, F ^ {\\prime} (\\mathbf {p}, \\mathbf {x} _ {l l m})\\right) \\right\\} \\right. \\tag {2}\n$$\n",
432
+ "text_format": "latex",
433
+ "bbox": [
434
+ 509,
435
+ 692,
436
+ 882,
437
+ 724
438
+ ],
439
+ "page_idx": 2
440
+ },
441
+ {
442
+ "type": "text",
443
+ "text": "Since the edit distance is not differentiable, we use the cross-entropy loss $L(\\cdot)$ assigned to the input $\\mathbf{x}$ by $F'(\\cdot)$ as a proxy to the edit distance. As a result, for each of input $\\mathbf{x}$ with label $y = 1$ (LLM) or 0 (human), our objective becomes:",
444
+ "bbox": [
445
+ 507,
446
+ 726,
447
+ 882,
448
+ 806
449
+ ],
450
+ "page_idx": 2
451
+ },
452
+ {
453
+ "type": "equation",
454
+ "text": "\n$$\n\\min \\left\\{L \\left(\\mathbf {X} _ {\\text {t r a i n}}\\right) \\cdot y _ {\\text {t r a i n}} \\right\\}, \\quad y _ {\\text {t r a i n}} = \\left\\{ \\begin{array}{l l} 1 & (\\text {L L M}) \\\\ - 1 & (\\text {h u m a n}) \\end{array} \\right. \\tag {3}\n$$\n",
455
+ "text_format": "latex",
456
+ "bbox": [
457
+ 507,
458
+ 818,
459
+ 882,
460
+ 871
461
+ ],
462
+ "page_idx": 2
463
+ },
464
+ {
465
+ "type": "text",
466
+ "text": "In this way, we flip the sign of the loss when the inputs are written by human. Since the overall loss would be minimized, this effectively encourages",
467
+ "bbox": [
468
+ 507,
469
+ 873,
470
+ 882,
471
+ 921
472
+ ],
473
+ "page_idx": 2
474
+ },
475
+ {
476
+ "type": "page_number",
477
+ "text": "6423",
478
+ "bbox": [
479
+ 480,
480
+ 928,
481
+ 519,
482
+ 940
483
+ ],
484
+ "page_idx": 2
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "the rewrites to be different from human input and identical to the LLM input.",
489
+ "bbox": [
490
+ 112,
491
+ 84,
492
+ 487,
493
+ 116
494
+ ],
495
+ "page_idx": 3
496
+ },
497
+ {
498
+ "type": "text",
499
+ "text": "3.3 Calibration Loss during Fine-Tuning",
500
+ "text_level": 1,
501
+ "bbox": [
502
+ 112,
503
+ 127,
504
+ 452,
505
+ 142
506
+ ],
507
+ "page_idx": 3
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "When fine-tuning the rewrite model on Equation 3, the rewrite model aims to minimize the edits on LLM-generated text and maximize the edits on human-generated text. However, without posting regularization and constraint on the unbounded loss, the rewrite model takes the risk of being corrupted (e.g., verbose output for all rewrite and overfitting with more edits on human-generated text rewrite) which we evaluated in §A.4.",
512
+ "bbox": [
513
+ 112,
514
+ 147,
515
+ 487,
516
+ 291
517
+ ],
518
+ "page_idx": 3
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "Therefore, we propose a calibration loss, which prevents the over-fitting problem by imposing a threshold value $t$ on the loss for each given input. For human text $\\mathbf{x}_h$ , we apply gradient backpropagation only if $L(\\mathbf{x}_h) < t$ . For LLM text $\\mathbf{x}_{llm}$ , we apply backpropagation only if $L(\\mathbf{x}_{llm}) > t$ . Otherwise, the gradient is set to 0. We show a pseudocode for the algorithm below:",
523
+ "bbox": [
524
+ 112,
525
+ 292,
526
+ 489,
527
+ 420
528
+ ],
529
+ "page_idx": 3
530
+ },
531
+ {
532
+ "type": "code",
533
+ "sub_type": "code",
534
+ "code_caption": [
535
+ "Algorithm 1 Calibration Loss Calculation"
536
+ ],
537
+ "code_body": "Require: Threshold $t$ , loss $L(\\cdot)$ , human text $x_{h}$ , LLM text $x_{llm}$",
538
+ "guess_lang": "verilog",
539
+ "bbox": [
540
+ 115,
541
+ 453,
542
+ 487,
543
+ 487
544
+ ],
545
+ "page_idx": 3
546
+ },
547
+ {
548
+ "type": "list",
549
+ "sub_type": "text",
550
+ "list_items": [
551
+ "1: $L_{h}\\gets L(x_{h}),L_{llm}\\gets L(x_{llm}),L\\gets 0$",
552
+ "2: $L\\gets L - L_{h}$ if $L_{h} < t$",
553
+ "3: $L \\gets L + L_{llm}$ if $L_{llm} > t$",
554
+ "4: return $L$"
555
+ ],
556
+ "bbox": [
557
+ 127,
558
+ 487,
559
+ 438,
560
+ 548
561
+ ],
562
+ "page_idx": 3
563
+ },
564
+ {
565
+ "type": "text",
566
+ "text": "Therefore, rather than minimizing the loss proxy, our objective becomes separating the distributions of the edit distance, for rewrites on human and LLM inputs, to two ends of the threshold $t$ . Concretely, this enables the model to only optimize against the hard examples, and leave those that are already classified correctly unchanged, to prevent overfitting. This is similar to DPO (Rafailov et al., 2023), where we fine-tune the rewrite model using only preference data, namely the rewrites that are not yet separated by the existing boundary. This process is depicted by the graphical illustrations in Figure 1.",
567
+ "bbox": [
568
+ 112,
569
+ 567,
570
+ 487,
571
+ 775
572
+ ],
573
+ "page_idx": 3
574
+ },
575
+ {
576
+ "type": "text",
577
+ "text": "To determine the threshold $t$ , we perform a forward pass using the rewrite model before finetuning on $\\mathbf{X}_{train}$ and train a logistic regression model on all loss values. The threshold $t$ can be derived from the weight and the intercept of the logistic regression model. In practice, applying the calibration loss improves detection performance by 4.54% in AUROC among the 21 domains, from 0.8555 to 0.9009.",
578
+ "bbox": [
579
+ 112,
580
+ 776,
581
+ 489,
582
+ 919
583
+ ],
584
+ "page_idx": 3
585
+ },
586
+ {
587
+ "type": "text",
588
+ "text": "4 Dataset",
589
+ "text_level": 1,
590
+ "bbox": [
591
+ 509,
592
+ 84,
593
+ 610,
594
+ 98
595
+ ],
596
+ "page_idx": 3
597
+ },
598
+ {
599
+ "type": "text",
600
+ "text": "Existing detectors are often evaluated on public datasets such as SQuAD (Rajpurkar et al., 2016), XSum (Narayan et al., 2018), and Writing Prompts (Fan et al., 2018) or self-constructed ones. However, these datasets typically represent a narrow subset of available data, both in terms of timeliness and domain coverage. This limitation raises concerns about over-fitting and uncertainty regarding how these detectors would perform when deployed in real-world scenarios, highlighting the necessity in creating a dataset of diversely-distributed texts for training.",
601
+ "bbox": [
602
+ 507,
603
+ 109,
604
+ 885,
605
+ 303
606
+ ],
607
+ "page_idx": 3
608
+ },
609
+ {
610
+ "type": "text",
611
+ "text": "4.1 Data Collection",
612
+ "text_level": 1,
613
+ "bbox": [
614
+ 507,
615
+ 313,
616
+ 678,
617
+ 326
618
+ ],
619
+ "page_idx": 3
620
+ },
621
+ {
622
+ "type": "text",
623
+ "text": "To ensure the robustness and generalizability of our detection model, we construct a dataset consisting of human-written text from 21 distinct domains, including finance, entertainment, cuisine, etc. For each domain, we collect the texts either by crawling online platforms like Wikipedia or by sampling from publicly available datasets. From these collections, we randomly select 200 complete paragraphs as text snippets which yields an average length of 120 words among the samples. For each of the human-written samples, we create four LLM-generated counterparts using four state-of-the-art LLMs: GPT-4o (OpenAI, 2024), GPT-3.5-Turbo (OpenAI, 2020), Gemini 1.5 Pro (Reid et al., 2024), and Llama-3-70B-Instruct (Meta, 2024). The entire process results in a total of 21,000 text samples. Details on data generation are listed in Table 5, and descriptions of the domains and their sources are provided in §A.1.",
624
+ "bbox": [
625
+ 507,
626
+ 332,
627
+ 885,
628
+ 639
629
+ ],
630
+ "page_idx": 3
631
+ },
632
+ {
633
+ "type": "text",
634
+ "text": "4.2 Prompt Diversity",
635
+ "text_level": 1,
636
+ "bbox": [
637
+ 507,
638
+ 650,
639
+ 690,
640
+ 665
641
+ ],
642
+ "page_idx": 3
643
+ },
644
+ {
645
+ "type": "text",
646
+ "text": "Conventionally, LLM-generated text is created by prompting LLMs to either rewrite a given text or continue writing from a given prefix, often using a single, static prompt for the entire process (Mitchell et al., 2023; Bao et al., 2024; Verma et al., 2024; Mao et al., 2024). However, real-world text generation involves a wide variety of prompts, which can significantly alter the distribution of the generated text. Previous work (Mao et al., 2024) has shown that one straightforward way to bypass the RAID detector is by using the prompt \"Help me rephrase it, so that another GPT rewriting will cause a lot of modifications\", which suggests that data generated by different prompts are different in distribu",
647
+ "bbox": [
648
+ 507,
649
+ 671,
650
+ 885,
651
+ 912
652
+ ],
653
+ "page_idx": 3
654
+ },
655
+ {
656
+ "type": "page_number",
657
+ "text": "6424",
658
+ "bbox": [
659
+ 480,
660
+ 928,
661
+ 519,
662
+ 940
663
+ ],
664
+ "page_idx": 3
665
+ },
666
+ {
667
+ "type": "text",
668
+ "text": "tion, indicating the importance of prompt diversity. To address this, we curate a dataset of 200 rewrite prompts, each containing slight variations in phrasing and instructions. For each generated text, a prompt is randomly sampled from this dataset. Examples of the prompts we use are provided below:",
669
+ "bbox": [
670
+ 112,
671
+ 84,
672
+ 489,
673
+ 180
674
+ ],
675
+ "page_idx": 4
676
+ },
677
+ {
678
+ "type": "list",
679
+ "sub_type": "text",
680
+ "list_items": [
681
+ "- Refine this for me please:",
682
+ "- Please rewrite this content in your own words:",
683
+ "- Make this text more formal and professional:",
684
+ "- Make this text more casual and friendly:",
685
+ "- Rephrase this text in a more elaborate way:",
686
+ "- Reframe this content in a more creative way:",
687
+ "- Rewrite this text to emphasize the key points:",
688
+ "- Help me rephrase it, so that another GPT rewriting will cause a lot of modifications:"
689
+ ],
690
+ "bbox": [
691
+ 136,
692
+ 184,
693
+ 487,
694
+ 343
695
+ ],
696
+ "page_idx": 4
697
+ },
698
+ {
699
+ "type": "text",
700
+ "text": "For a RAIDAR detector, training on a diversely-prompted dataset compared with a single-prompted dataset can increase its testing AUROC from 0.7302 to 0.7566 (detailed in A.2). This shows that diverse prompts enables the model to better capture the distribution of LLM texts in the real world, whose generation prompts are expected to vary significantly.",
701
+ "bbox": [
702
+ 112,
703
+ 347,
704
+ 489,
705
+ 475
706
+ ],
707
+ "page_idx": 4
708
+ },
709
+ {
710
+ "type": "text",
711
+ "text": "4.3 Data Cleaning",
712
+ "text_level": 1,
713
+ "bbox": [
714
+ 112,
715
+ 486,
716
+ 273,
717
+ 502
718
+ ],
719
+ "page_idx": 4
720
+ },
721
+ {
722
+ "type": "text",
723
+ "text": "In collecting human-written text, we ensure that no data is generated after November 30, 2022, the release date of ChatGPT (OpenAI, 2020), avoiding contamination of human dataset with LLM-generated content. Instead of manually introducing any truncations, we split all texts into natural paragraphs, yielding an overall average length of 120 words with a standard deviation of 108 words. For LLM-generated text, we carefully remove any extraneous suffixes, such as \"Sure, here is a...,\" to avoid them from being detected in this way.",
724
+ "bbox": [
725
+ 112,
726
+ 507,
727
+ 489,
728
+ 684
729
+ ],
730
+ "page_idx": 4
731
+ },
732
+ {
733
+ "type": "text",
734
+ "text": "5 Evaluation",
735
+ "text_level": 1,
736
+ "bbox": [
737
+ 112,
738
+ 696,
739
+ 243,
740
+ 711
741
+ ],
742
+ "page_idx": 4
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "This section answers the following questions:",
747
+ "bbox": [
748
+ 112,
749
+ 721,
750
+ 452,
751
+ 736
752
+ ],
753
+ "page_idx": 4
754
+ },
755
+ {
756
+ "type": "list",
757
+ "sub_type": "text",
758
+ "list_items": [
759
+ "Q1: How does L2R compare with other detectors? (§5.3)",
760
+ "Q2: How does L2R perform when OOD? (§5.4)",
761
+ "Q3: How does L2R perform under adversarial attacks? (§5.5)",
762
+ "Q4: How does L2R's training objective compare with directly training for binary classification? (§5.6)",
763
+ "Q5: How does training on our proposed dataset contribute to L2R's performance? (§5.7)"
764
+ ],
765
+ "bbox": [
766
+ 112,
767
+ 739,
768
+ 487,
769
+ 910
770
+ ],
771
+ "page_idx": 4
772
+ },
773
+ {
774
+ "type": "text",
775
+ "text": "5.1 Experiment Setup",
776
+ "text_level": 1,
777
+ "bbox": [
778
+ 507,
779
+ 84,
780
+ 699,
781
+ 99
782
+ ],
783
+ "page_idx": 4
784
+ },
785
+ {
786
+ "type": "text",
787
+ "text": "We perform all experiments on one NVIDIA A100 GPU with 40GB RAM. We use \"meta-Llama/Meta-Llama-3-8B-Instruct\" (AI@Meta, 2024) as the open-sourced rewrite model in all experiments. To fine-tune the Llama model with 8B parameters, we employ 4-bit QLoRA (Dettmers et al., 2024), with parameter r set to 16, lora_alpha set to 32, and lora_dropout set to 0.05, unless otherwise noted. We use an initial learning rate of 5e-6, a weight decay of 0.01, and a batch size of 32 to train until convergence. We set the sampling temperature to 0 when using Llama for rewriting during training and detection for deterministic and reproducible results, therefore taking the results from a single run for the experiments. We use $70\\%$ of the dataset for training and the rest for testing in all experiments. Training on the 21 domains takes around six GPU hours and rewriting a single text of 120 words takes an average of 13.5 seconds.",
788
+ "bbox": [
789
+ 507,
790
+ 105,
791
+ 884,
792
+ 411
793
+ ],
794
+ "page_idx": 4
795
+ },
796
+ {
797
+ "type": "text",
798
+ "text": "5.2 Baselines",
799
+ "text_level": 1,
800
+ "bbox": [
801
+ 507,
802
+ 420,
803
+ 628,
804
+ 435
805
+ ],
806
+ "page_idx": 4
807
+ },
808
+ {
809
+ "type": "text",
810
+ "text": "Our baseline detectors consist of Fast-DetectGPT (Bao et al., 2024), Ghostbusters (Verma et al., 2024), RAIDAR (Mao et al., 2024), and a custom approach named \"Llama Logits\", which involves training a Llama-3-8B model together with a classifier (same size as RAIDAR and L2R) on its logits output to perform naive text classification. For Ghostbuster, RAIDAR and Llama Logits, we train and test these detectors on the identical training and testing sets as L2R. For Fast-DetectGPT, we use its local version available at Fast-DetectGPT (2024). For Llama Logits, we train its Llama model using the same QLoRA configurations as the rewrite model in L2R for a fair comparison. We also experiment on using a close-sourced model, Gemini 1.5 Pro (Reid et al., 2024) (referred to as Gemini Rewrite), as the rewrite model for RAIDAR in addition to Llama.",
811
+ "bbox": [
812
+ 507,
813
+ 442,
814
+ 882,
815
+ 731
816
+ ],
817
+ "page_idx": 4
818
+ },
819
+ {
820
+ "type": "text",
821
+ "text": "5.3 Compare L2R with Other Detectors",
822
+ "text_level": 1,
823
+ "bbox": [
824
+ 507,
825
+ 736,
826
+ 838,
827
+ 751
828
+ ],
829
+ "page_idx": 4
830
+ },
831
+ {
832
+ "type": "text",
833
+ "text": "We compare the performance of L2R with Fast-DetectGPT, Ghostbusters, and RAIDAR (Llama Rewrite and Gemini Rewrite), by measuring the Area Under the Receiver Operating Characteristic Curve (AUROC) scores. The resulting scores for each domain along with their average and standard deviation can be found in Table 1. L2R constantly outperforms both configurations of RAIDAR in all domains; outperforms Fast-DetectGPT in 20 of 21 domains by an average of $23.04\\%$ in AU-",
834
+ "bbox": [
835
+ 507,
836
+ 756,
837
+ 884,
838
+ 917
839
+ ],
840
+ "page_idx": 4
841
+ },
842
+ {
843
+ "type": "page_number",
844
+ "text": "6425",
845
+ "bbox": [
846
+ 480,
847
+ 928,
848
+ 519,
849
+ 940
850
+ ],
851
+ "page_idx": 4
852
+ },
853
+ {
854
+ "type": "table",
855
+ "img_path": "images/427503bad21fe5942c49be667fc2c5c1e2f6997a96214981bd06eb9d95a2f6f2.jpg",
856
+ "table_caption": [],
857
+ "table_footnote": [],
858
+ "table_body": "<table><tr><td>Domain</td><td>Fast-DetectGPT</td><td>Ghostbusters</td><td>RAIDAR (Gemini Rewrite)</td><td>RAIDAR (Llama Rewrite)</td><td>Llama L2R</td></tr><tr><td>AcademicResearch</td><td>0.4664</td><td>0.6597</td><td>0.7911</td><td>0.8311</td><td>0.8406</td></tr><tr><td>ArtCulture</td><td>0.6292</td><td>0.6781</td><td>0.7711</td><td>0.6750</td><td>0.8328</td></tr><tr><td>Business</td><td>0.6829</td><td>0.8331</td><td>0.8153</td><td>0.8369</td><td>0.9156</td></tr><tr><td>Code</td><td>0.6808</td><td>0.3770</td><td>0.5670</td><td>0.3840</td><td>0.8383</td></tr><tr><td>EducationalMaterial</td><td>0.7474</td><td>0.8506</td><td>0.9339</td><td>0.9675</td><td>0.9644</td></tr><tr><td>Entertainment</td><td>0.8392</td><td>0.8600</td><td>0.7836</td><td>0.8319</td><td>0.9494</td></tr><tr><td>Environmental</td><td>0.8382</td><td>0.8447</td><td>0.9081</td><td>0.9228</td><td>0.9786</td></tr><tr><td>Finance</td><td>0.6879</td><td>0.7828</td><td>0.6917</td><td>0.8153</td><td>0.9400</td></tr><tr><td>FoodCuisine</td><td>0.7425</td><td>0.6703</td><td>0.7181</td><td>0.7831</td><td>0.9547</td></tr><tr><td>GovernmentPublic</td><td>0.7100</td><td>0.6833</td><td>0.7375</td><td>0.7619</td><td>0.8675</td></tr><tr><td>LegalDocument</td><td>0.8365</td><td>0.5453</td><td>0.5528</td><td>0.6594</td><td>0.7803</td></tr><tr><td>LiteratureCreativeWriting</td><td>0.7928</td><td>0.9456</td><td>0.8056</td><td>0.9161</td><td>0.9294</td></tr><tr><td>MedicalText</td><td>0.5693</td><td>0.6242</td><td>0.7614</td><td>0.7700</td><td>0.7857</td></tr><tr><td>NewsArticle</td><td>0.5808</td><td>0.6800</td><td>0.7714</td><td>0.8547</td><td>0.9242</td></tr><tr><td>OnlineContent</td><td>0.6292</td><td>0.5922</td><td>0.7408</td><td>0.8231</td><td>0.8881</td></tr><tr><td>PersonalCommunication</td><td>0.5392</td><td>0.7042</td><td>0.6783</td><td>0.7233</td><td>0.8239</td></tr><tr><td>ProductReview</td><td>0.6467</td><td>0.7364</td><td>0.7150</td><td>0.8075</td><td>0.9689</td></tr><tr><td>Religious</td><td>0.6314</td><td>0.6111</td><td>0.7772</td><td>0.8397</td><td>0.9775</td></tr><tr><td>Sports</td><td>0.6015</td><td>0.6561</td><td>0.6917</td><td>0.7869</td><td>0.8742</td></tr><tr><td>TechnicalWriting</td><td>0.6075</td><td>0.7242</td><td>0.8269</td><td>0.8575</td><td>0.9369</td></tr><tr><td>TravelTourism</td><td>0.6210</td><td>0.7517</td><td>0.8492</td><td>0.8897</td><td>0.9475</td></tr><tr><td>AVERAGE</td><td>0.6705</td><td>0.7053</td><td>0.7566</td><td>0.7970</td><td>0.9009</td></tr><tr><td>STD</td><td>0.1015</td><td>0.1259</td><td>0.0928</td><td>0.1212</td><td>0.0634</td></tr></table>",
859
+ "bbox": [
860
+ 119,
861
+ 84,
862
+ 878,
863
+ 457
864
+ ],
865
+ "page_idx": 5
866
+ },
867
+ {
868
+ "type": "text",
869
+ "text": "Table 1: Comparison of detection performance measured with AUROC scores. For Ghostbuster and all rewrite-based detectors, we train a single classifier on the training set of all domains, then test the model's performance on the test set of each individual domain. AVERAGE measures a detector's average performance among all independent domains, and STD measures the standard deviation across domains.",
870
+ "bbox": [
871
+ 112,
872
+ 464,
873
+ 882,
874
+ 523
875
+ ],
876
+ "page_idx": 5
877
+ },
878
+ {
879
+ "type": "text",
880
+ "text": "ROC; and outperforms Ghostbusters in 20 of 21 domains by an average of $19.56\\%$ in AUROC. L2R achieves a $5.62\\%$ lower AUROC score than Fast-DetectGPT on legal document domain, and a $1.62\\%$ lower AUROC score than Ghostbusters on literature creative writing domain. This may stem from the distinct distributions of these domains: legal documents demand a rigorous writing style, leaving little room for rewriting even with human input, whereas creative writing is more casual, allowing greater rewrite flexibility even for LLM input, thereby making it harder for L2R to distinguish.",
881
+ "bbox": [
882
+ 112,
883
+ 546,
884
+ 487,
885
+ 740
886
+ ],
887
+ "page_idx": 5
888
+ },
889
+ {
890
+ "type": "text",
891
+ "text": "In general, the fluctuating AUROC scores indicate the challenging nature of our dataset and the diversity and independence of the distributions across domains. These results also show that L2R has better knowledge of the intricate differences between human and LLM-generated text in various domains compared with the baselines, and is thus more capable in the real-world setting.",
892
+ "bbox": [
893
+ 112,
894
+ 741,
895
+ 487,
896
+ 869
897
+ ],
898
+ "page_idx": 5
899
+ },
900
+ {
901
+ "type": "text",
902
+ "text": "5.4 OOD Dataset Evaluation",
903
+ "text_level": 1,
904
+ "bbox": [
905
+ 507,
906
+ 548,
907
+ 752,
908
+ 562
909
+ ],
910
+ "page_idx": 5
911
+ },
912
+ {
913
+ "type": "text",
914
+ "text": "We showed that L2R outperforms the state-of-the-art detectors ID in terms of AUROC scores, but it is equally important to assess its robustness under OOD conditions, as training-based detectors are prone to overfitting to familiar domains and generator models. We first evaluate this by showing its performance on OOD datasets.",
915
+ "bbox": [
916
+ 505,
917
+ 568,
918
+ 882,
919
+ 680
920
+ ],
921
+ "page_idx": 5
922
+ },
923
+ {
924
+ "type": "text",
925
+ "text": "To assess L2R's performance on OOD data, we adopt the M4 dataset (Wang et al., 2024), an OOD dataset that is different from our training data in multiple dimensions, including data generation models, text length, decoding strategy, and domains. We show a detailed comparison in Table 2.",
926
+ "bbox": [
927
+ 507,
928
+ 681,
929
+ 882,
930
+ 777
931
+ ],
932
+ "page_idx": 5
933
+ },
934
+ {
935
+ "type": "text",
936
+ "text": "The results of the OOD evaluation are presented in Table 3. We include both ID and OOD results to highlight the degree of overfitting for each detector. While the Llama Logits method achieves the highest ID AUROC, its OOD result is the lowest, indicating significant overfitting to the training data. Similarly, Ghostbuster shows overfitting with its OOD AUROC being roughly half of its ID",
937
+ "bbox": [
938
+ 507,
939
+ 778,
940
+ 884,
941
+ 906
942
+ ],
943
+ "page_idx": 5
944
+ },
945
+ {
946
+ "type": "page_number",
947
+ "text": "6426",
948
+ "bbox": [
949
+ 480,
950
+ 928,
951
+ 521,
952
+ 940
953
+ ],
954
+ "page_idx": 5
955
+ },
956
+ {
957
+ "type": "table",
958
+ "img_path": "images/a990fd5cd23ae928102fddaeb46bc065d8f84a3ca7e336561dbb9f0b53e18e63.jpg",
959
+ "table_caption": [],
960
+ "table_footnote": [],
961
+ "table_body": "<table><tr><td>Dataset</td><td>Ours</td><td>M4</td></tr><tr><td>Generator</td><td>GPT-3.5-Turbo, GPT-4o, Llama-3-70B, Gemini 1.5 Pro</td><td>BLOOMz, ChatGPT, Davinci, Cohere, Dolly V2</td></tr><tr><td>Text Length</td><td>Mean: 765 chars, STD: 654 chars</td><td>Mean: 1365 chars, STD: 244 chars</td></tr><tr><td>Decoding Strategy</td><td>Nucleus Sampling, Temperature = 1, top_p = 1</td><td>Varies</td></tr><tr><td>Domains</td><td>21 English domains</td><td>5 English domains</td></tr></table>",
962
+ "bbox": [
963
+ 119,
964
+ 80,
965
+ 880,
966
+ 160
967
+ ],
968
+ "page_idx": 6
969
+ },
970
+ {
971
+ "type": "table",
972
+ "img_path": "images/13e78c7d1aa28d25fc2086c926db99a8e7b18fd3a53d42cf27de13376f34d322.jpg",
973
+ "table_caption": [
974
+ "Table 2: Comparison of characteristics of our dataset and M4 dataset, which we use for OOD evaluation."
975
+ ],
976
+ "table_footnote": [],
977
+ "table_body": "<table><tr><td>Model</td><td>In-Distribution</td><td>Out-of-Distribution</td></tr><tr><td>Ghostbusters</td><td>0.7053</td><td>0.3888</td></tr><tr><td>Fast-DetectGPT</td><td>0.6705</td><td>0.6408</td></tr><tr><td>Llama Logits</td><td>0.9774</td><td>0.1426</td></tr><tr><td>Llama Logits (Reduced Params)</td><td>0.8016</td><td>0.3450</td></tr><tr><td>Llama Rewrite</td><td>0.7970</td><td>0.6931</td></tr><tr><td>Llama L2R</td><td>0.9009</td><td>0.6561</td></tr><tr><td>Llama L2R (Reduced Params)</td><td>0.8315</td><td>0.7398</td></tr></table>",
978
+ "bbox": [
979
+ 119,
980
+ 205,
981
+ 485,
982
+ 307
983
+ ],
984
+ "page_idx": 6
985
+ },
986
+ {
987
+ "type": "text",
988
+ "text": "Table 3: ID and OOD performance measured in AUROC scores. For L2R and Llama Logits, the \"Reduced Params\" models are tuned with approximately 1/4 of the parameters for better generalizability. With reduced parameters, L2R has the highest OOD AUROC, outperforming the naive Llama Rewrite both ID and OOD by $3.45\\%$ and $4.67\\%$ respectively, suggesting its generalizability through fine-tuning.",
989
+ "bbox": [
990
+ 112,
991
+ 317,
992
+ 489,
993
+ 432
994
+ ],
995
+ "page_idx": 6
996
+ },
997
+ {
998
+ "type": "text",
999
+ "text": "performance. The naive rewrite-based approach shows superior robustness compared with these other methods, but L2R trained with reduced parameters, i.e. rank $r$ set to 4 and lora_alpha set to 8, outperforms Llama Rewrite by $3.45\\%$ ID and $4.67\\%$ OOD. This demonstrates that our fine-tuning does not simply overfits the rewrite model to the training data, but enhances its classification performance across diverse distributions.",
1000
+ "bbox": [
1001
+ 112,
1002
+ 456,
1003
+ 487,
1004
+ 600
1005
+ ],
1006
+ "page_idx": 6
1007
+ },
1008
+ {
1009
+ "type": "text",
1010
+ "text": "We notice that reducing the number of training parameters makes the model more generalizable, and further investigate the impact of fine-tuning parameters on L2R's performance ID and OOD. By adjusting the LoRA parameters $r$ and lora_alpha, we define four fine-tuning configurations with the number of trainable parameters ranging from 851,968 to 6,815,744, with details listed in §A.3. Figure 3 illustrates the results, where we observe a consistent increase in ID AUROC, accompanied by a decline in OOD AUROC as the number of parameters grows. This suggests that the model becomes increasingly overfitted to the training distribution. L2R either outperforms Llama Logits OOD or both ID and OOD, and all four configurations outperform Ghostbusters and Fast-DetectGPT both ID and OOD. Also, the first two configurations surpass Llama Rewrite in terms of AUROC across both settings.",
1011
+ "bbox": [
1012
+ 112,
1013
+ 601,
1014
+ 489,
1015
+ 906
1016
+ ],
1017
+ "page_idx": 6
1018
+ },
1019
+ {
1020
+ "type": "image",
1021
+ "img_path": "images/ff7a15b796675bec262bd0f8fe94d928e227196b1ae679dbbcef0ed674c538c4.jpg",
1022
+ "image_caption": [
1023
+ "Figure 3: Relationship between the number of trainable parameters and ID and OOD AUROC scores for L2R and RAIDAR. As the number of parameters increase from $1 \\times 10^{6}$ to $7 \\times 10^{6}$ , both L2R and Llama Logits show higher ID performance and lower OOD performance, showing how the effect of overfitting emerges as we increase the LLM's trainable parameters. However, L2R continuously outperforms Llama Logits either in OOD setting or in both ID and OOD settings, showing the superior robustness and accuracy of L2R."
1024
+ ],
1025
+ "image_footnote": [],
1026
+ "bbox": [
1027
+ 529,
1028
+ 208,
1029
+ 858,
1030
+ 344
1031
+ ],
1032
+ "page_idx": 6
1033
+ },
1034
+ {
1035
+ "type": "text",
1036
+ "text": "5.5 Adversarial Attack",
1037
+ "text_level": 1,
1038
+ "bbox": [
1039
+ 507,
1040
+ 520,
1041
+ 705,
1042
+ 533
1043
+ ],
1044
+ "page_idx": 6
1045
+ },
1046
+ {
1047
+ "type": "text",
1048
+ "text": "We employ two distinct types of attack to assess L2R's robustness against the baseline detectors. For both experiments, we apply the attack to all LLM-generated text in the testing set across all domains, while training L2R and the baselines on the unmodified training set and evaluating it on the modified testing set.",
1049
+ "bbox": [
1050
+ 507,
1051
+ 541,
1052
+ 882,
1053
+ 652
1054
+ ],
1055
+ "page_idx": 6
1056
+ },
1057
+ {
1058
+ "type": "text",
1059
+ "text": "5.5.1 Decoherence Attack",
1060
+ "text_level": 1,
1061
+ "bbox": [
1062
+ 507,
1063
+ 662,
1064
+ 726,
1065
+ 676
1066
+ ],
1067
+ "page_idx": 6
1068
+ },
1069
+ {
1070
+ "type": "text",
1071
+ "text": "Bao et al. (2024) introduces the decoherence attack where two adjacent, randomly selected words are transposed in all sentences longer than 20 words within a paragraph for LLM texts. Bao et al. (2024) demonstrated that this simple attack can be highly effective in degrading the performance of sate-of-the-art detectors, without affecting the core meaning of the input. We present the results of this attack in Table 4, where L2R achieves the highest AUROC on samples subjected to this attack, indicating its superior robustness compared to other models. This is because our rewrite-based objective function for fine-tuning teaches the model the innate distributions of human and LLM text, in",
1072
+ "bbox": [
1073
+ 505,
1074
+ 681,
1075
+ 884,
1076
+ 904
1077
+ ],
1078
+ "page_idx": 6
1079
+ },
1080
+ {
1081
+ "type": "page_number",
1082
+ "text": "6427",
1083
+ "bbox": [
1084
+ 480,
1085
+ 928,
1086
+ 519,
1087
+ 940
1088
+ ],
1089
+ "page_idx": 6
1090
+ },
1091
+ {
1092
+ "type": "table",
1093
+ "img_path": "images/8d8038da90f568640ee02335ba87f3d92be8ae270fef1a4ce13262ac6b4f4a35.jpg",
1094
+ "table_caption": [],
1095
+ "table_footnote": [],
1096
+ "table_body": "<table><tr><td>Model</td><td>No Attack</td><td>Decoherence Attack</td><td>Rewrite Attack</td></tr><tr><td>Ghostbusters</td><td>0.7053</td><td>0.4730</td><td>0.4061</td></tr><tr><td>Fast-DetectGPT</td><td>0.6705</td><td>0.4984</td><td>0.5100</td></tr><tr><td>Llama Logits</td><td>0.9774</td><td>0.7281</td><td>0.6563</td></tr><tr><td>Llama Rewrite</td><td>0.7970</td><td>0.7681</td><td>0.7944</td></tr><tr><td>Llama L2R</td><td>0.9009</td><td>0.8746</td><td>0.8927</td></tr></table>",
1097
+ "bbox": [
1098
+ 119,
1099
+ 80,
1100
+ 485,
1101
+ 162
1102
+ ],
1103
+ "page_idx": 7
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "stead of relying on brittle statistical features that are easily altered through this simple attack.",
1108
+ "bbox": [
1109
+ 112,
1110
+ 230,
1111
+ 485,
1112
+ 262
1113
+ ],
1114
+ "page_idx": 7
1115
+ },
1116
+ {
1117
+ "type": "text",
1118
+ "text": "5.5.2 Rewrite Attack",
1119
+ "text_level": 1,
1120
+ "bbox": [
1121
+ 112,
1122
+ 271,
1123
+ 294,
1124
+ 285
1125
+ ],
1126
+ "page_idx": 7
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "Previous work finds that paraphrase or rewrite attacks can degrade the performance of LLM-generated content detectors (Lu et al., 2024; Krishna et al., 2023; Mao et al., 2024). Mao et al. (2024) introduces the rewrite attack in which a GPT-3.5-Turbo model is prompted to refine an input paragraph generated by LLMs, in such a way that a subsequent rewrite by another LLM would result in significant changes (e.g., using the prompt \"Help me rephrase it, so that another GPT rewriting will cause a lot of modifications\"). Mao et al. (2024) showed that this type of attack is effective against RAIDAR and we further show it can affect other types of detectors as well in Table 4, even with our diverse training set. However, L2R still achieves the highest AUROC among all detectors, demonstrating its robustness against this attack. This is because its fine-tuning objective induces a sufficiently large separable gap between rewrites of human and LLM-generated text, allowing adversariably perturbed samples to remain within the LLM distribution. Before attack, the average edit distance is 0.3019 for human rewrites, and 0.1394 for LLM rewrites. After attack, the average edit distance for LLM increases to 0.1614, indicating that the rewrite attack partially shifts the LLM distribution toward the human distribution. However, a clear gap remains between the two, resulting in only a marginal degradation in L2R's classification performance.",
1131
+ "bbox": [
1132
+ 112,
1133
+ 290,
1134
+ 489,
1135
+ 774
1136
+ ],
1137
+ "page_idx": 7
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "5.6 Compare L2R with Direct Fine-Tuning",
1142
+ "text_level": 1,
1143
+ "bbox": [
1144
+ 112,
1145
+ 784,
1146
+ 467,
1147
+ 799
1148
+ ],
1149
+ "page_idx": 7
1150
+ },
1151
+ {
1152
+ "type": "text",
1153
+ "text": "A valid concern regarding L2R's superior performance is whether it is due to our fine-tuning objective, which enhances model's rewriting ability, or it stems solely from the fact that we exploit the vast parameters of an LLM. To answer this question, we compare L2R with the \"Llama Logit\" baseline in Table 3 and 4. The Llama Logits detector involves",
1154
+ "bbox": [
1155
+ 112,
1156
+ 804,
1157
+ 489,
1158
+ 917
1159
+ ],
1160
+ "page_idx": 7
1161
+ },
1162
+ {
1163
+ "type": "text",
1164
+ "text": "fine-tuning a Llama-3-8B model not for rewrite, but directly for binary classification.",
1165
+ "bbox": [
1166
+ 507,
1167
+ 84,
1168
+ 882,
1169
+ 115
1170
+ ],
1171
+ "page_idx": 7
1172
+ },
1173
+ {
1174
+ "type": "text",
1175
+ "text": "In §5.4, we show that despite the Llama Log-its has the highest ID AUROC score among all detectors, surpassing L2R by $7.65\\%$ , it has the lowest AUROC when evaluated OOD, up to $51.35\\%$ lower than L2R, suggesting that its performance ID is due to overfitting. This highlights the importance of our fine-tuning objective function in ensuring domain-agnostic detection accuracy. Also, the Llama Log-its is inferior under adversarial attacks, with $14.65\\%$ and $23.64\\%$ lower AUROC for decoherence and rewrite attacks, respectively. This again shows L2R's robustness in capturing the true underlying distributions of human and LLM texts.",
1176
+ "bbox": [
1177
+ 507,
1178
+ 116,
1179
+ 884,
1180
+ 325
1181
+ ],
1182
+ "page_idx": 7
1183
+ },
1184
+ {
1185
+ "type": "text",
1186
+ "text": "5.7 Effectiveness of the Diverse Dataset",
1187
+ "text_level": 1,
1188
+ "bbox": [
1189
+ 507,
1190
+ 336,
1191
+ 833,
1192
+ 350
1193
+ ],
1194
+ "page_idx": 7
1195
+ },
1196
+ {
1197
+ "type": "text",
1198
+ "text": "While there exists public datasets that emphasize data diversity, including RAID (Dugan et al., 2024), RuTAD (Maloyan et al., 2022), and MAGE (Li et al., 2024), the contribution of our proposed dataset lies in its ability to help train a robust and generalizable L2R model. We show this by training L2R on MAGE using the same number of texts and under the same training configurations, then test its performance ID and OOD on the M4 dataset. We compare the results in Table 5, where the L2R model trained on our dataset has $15.98\\%$ higher OOD AUROC, suggesting that the diverse text distributions in our dataset is effective in training a robust and generalizable L2R model.",
1199
+ "bbox": [
1200
+ 507,
1201
+ 357,
1202
+ 882,
1203
+ 581
1204
+ ],
1205
+ "page_idx": 7
1206
+ },
1207
+ {
1208
+ "type": "table",
1209
+ "img_path": "images/a9a638ed1af58b139ba9eaed05d77fdeeb9740f56202a7c3ee33a174a99f1bd5.jpg",
1210
+ "table_caption": [
1211
+ "Table 4: Adversarial attack results. While all detectors show performance degradation, L2R has the highest AUROC in both settings, suggesting its robustness."
1212
+ ],
1213
+ "table_footnote": [],
1214
+ "table_body": "<table><tr><td>Training Dataset</td><td>In-Distribution</td><td>Out-of-Distribution</td></tr><tr><td>MAGE</td><td>0.8333</td><td>0.4963</td></tr><tr><td>Ours</td><td>0.9009</td><td>0.6561</td></tr></table>",
1215
+ "bbox": [
1216
+ 512,
1217
+ 592,
1218
+ 878,
1219
+ 648
1220
+ ],
1221
+ "page_idx": 7
1222
+ },
1223
+ {
1224
+ "type": "text",
1225
+ "text": "Table 5: Comparison of L2R's ID and OOD performance when trained on MAGE and our dataset. The superior OOD AUROC from the model trained on our dataset suggests its training effectiveness.",
1226
+ "bbox": [
1227
+ 507,
1228
+ 657,
1229
+ 882,
1230
+ 715
1231
+ ],
1232
+ "page_idx": 7
1233
+ },
1234
+ {
1235
+ "type": "text",
1236
+ "text": "6 Conclusion",
1237
+ "text_level": 1,
1238
+ "bbox": [
1239
+ 507,
1240
+ 730,
1241
+ 640,
1242
+ 744
1243
+ ],
1244
+ "page_idx": 7
1245
+ },
1246
+ {
1247
+ "type": "text",
1248
+ "text": "We present L2R, a method designed to enhance the detection of LLM-generated text by learning to rewrite more on LLM-generated inputs and less on human-generated inputs. L2R excels in identifying LLM-generated text collected across various models and 21 unique domains, both ID and OOD, and under adversarial attacks. Our work demonstrates that LLMs can be trained to detect text generated by other LLMs, surpassing previous detection methods in accuracy and generalizability.",
1249
+ "bbox": [
1250
+ 507,
1251
+ 749,
1252
+ 882,
1253
+ 910
1254
+ ],
1255
+ "page_idx": 7
1256
+ },
1257
+ {
1258
+ "type": "page_number",
1259
+ "text": "6428",
1260
+ "bbox": [
1261
+ 480,
1262
+ 928,
1263
+ 519,
1264
+ 940
1265
+ ],
1266
+ "page_idx": 7
1267
+ },
1268
+ {
1269
+ "type": "text",
1270
+ "text": "7 Limitations",
1271
+ "text_level": 1,
1272
+ "bbox": [
1273
+ 114,
1274
+ 84,
1275
+ 250,
1276
+ 98
1277
+ ],
1278
+ "page_idx": 8
1279
+ },
1280
+ {
1281
+ "type": "text",
1282
+ "text": "A limitation of ours is the relatively slow inference runtime. As most detectors only requires a forward pass from the LLM being used, we need to call generate to create a rewrite. Nevertheless, this problem would be well alleviated considering the rapid improvement in LLM efficiency and computing power.",
1283
+ "bbox": [
1284
+ 112,
1285
+ 109,
1286
+ 490,
1287
+ 221
1288
+ ],
1289
+ "page_idx": 8
1290
+ },
1291
+ {
1292
+ "type": "text",
1293
+ "text": "8 Acknowledgments",
1294
+ "text_level": 1,
1295
+ "bbox": [
1296
+ 112,
1297
+ 233,
1298
+ 307,
1299
+ 249
1300
+ ],
1301
+ "page_idx": 8
1302
+ },
1303
+ {
1304
+ "type": "text",
1305
+ "text": "We thank Asaf Cidon for supporting Wei Hao's participation in this project. We thank anonymous reviewers for their insightful feedback that helped improve our work.",
1306
+ "bbox": [
1307
+ 112,
1308
+ 258,
1309
+ 487,
1310
+ 323
1311
+ ],
1312
+ "page_idx": 8
1313
+ },
1314
+ {
1315
+ "type": "text",
1316
+ "text": "References",
1317
+ "text_level": 1,
1318
+ "bbox": [
1319
+ 114,
1320
+ 350,
1321
+ 213,
1322
+ 363
1323
+ ],
1324
+ "page_idx": 8
1325
+ },
1326
+ {
1327
+ "type": "list",
1328
+ "sub_type": "ref_text",
1329
+ "list_items": [
1330
+ "Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. 2023. Gpt-4 technical report. arXiv Preprint arXiv:2303.08774.",
1331
+ "AI@Meta. 2024. Llama 3 model card.",
1332
+ "Guangsheng Bao, Yanbin Zhao, Zhiyang Teng, Linyi Yang, and Yue Zhang. 2024. Fast-detectgpt: Efficient zero-shot detection of machine-generated text via conditional probability curvature. In The Twelfth International Conference on Learning Representations.",
1333
+ "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.",
1334
+ "Canyu Chen and Kai Shu. 2023. Combating misinformation in the age of llms: Opportunities and challenges. AI Magazine.",
1335
+ "Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. 2024. Qlora: Efficient finetuning of quantized lms. Advances in Neural Information Processing Systems, 36.",
1336
+ "Liam Dugan, Alyssa Hwang, Filip Trhlik, Andrew Zhu, Josh Magnus Ludan, Hainiu Xu, Daphne Ippolito, and Chris Callison-Burch. 2024. RAID: A shared benchmark for robust evaluation of machine-generated text detectors. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 12463-12492, Bangkok, Thailand. Association for Computational Linguistics.",
1337
+ "Angela Fan, Mike Lewis, and Yann Dauphin. 2018. Hierarchical neural story generation. In Proceedings"
1338
+ ],
1339
+ "bbox": [
1340
+ 115,
1341
+ 372,
1342
+ 489,
1343
+ 917
1344
+ ],
1345
+ "page_idx": 8
1346
+ },
1347
+ {
1348
+ "type": "list",
1349
+ "sub_type": "ref_text",
1350
+ "list_items": [
1351
+ "of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 889-898.",
1352
+ "Fast-DetectGPT. 2024. GitHub Repository. [link].",
1353
+ "Sebastian Gehrmann, Hendrik Strobelt, and Alexander M Rush. 2019. Gltr: Statistical detection and visualization of generated text. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 111-116.",
1354
+ "Wei Hao, Van Tran, Vincent Rideout, Zixi Wang, AnMei Dasbach-Prisk, M. H. Afifi, Junfeng Yang, Ethan Katz-Bassett, Grant Ho, and Asaf Cidon. 2025. Do spammers dream of electric sheep? characterizing the prevalence of llm-generated malicious emails. In Proceedings of the 25th ACM Internet Measurement Conference, IMC '25, New York, NY, USA. Association for Computing Machinery.",
1355
+ "IMDb. 2024. Imdb non-commercial datasets. https://developer.imdb.com/non-commercial-datasets/.",
1356
+ "Qiao Jin, Bhuwan Dhingra, Zhengping Liu, William Cohen, and Xinghua Lu. 2019. Pubmedqa: A dataset for biomedical research question answering. 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 2567-2577.",
1357
+ "Kalpesh Krishna, Yixiao Song, Marzena Karpinska, John Wieting, and Mohit Iyyer. 2023. Paraphrasing evades detectors of ai-generated text, but retrieval is an effective defense. In Proceedings of the 37th International Conference on Neural Information Processing Systems, NIPS '23, Red Hook, NY, USA. Curran Associates Inc.",
1358
+ "Vladimir I Levenshtein et al. 1966. Binary codes capable of correcting deletions, insertions, and reversals. In Soviet Physics Doklady, volume 10, pages 707-710. Soviet Union.",
1359
+ "Yafu Li, Qintong Li, Leyang Cui, Wei Bi, Zhilin Wang, Longyue Wang, Linyi Yang, Shuming Shi, and Yue Zhang. 2024. Mage: Machine-generated text detection in the wild. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 36-53.",
1360
+ "Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. 2017. Dailydialog: A manually labelled multi-turn dialogue dataset. In Proceedings of The 8th International Joint Conference on Natural Language Processing (IJCNLP 2017).",
1361
+ "Shengchao Liu, Xiaoming Liu, Yichen Wang, Zehua Cheng, Chengzhengxu Li, Zhaohan Zhang, Yu Lan, and Chao Shen. 2024. Does detectgpt fully utilize perturbation? bridging selective perturbation to finetuned contrastive learning detector would be better. In Proceedings of the 62nd Annual Meeting of the"
1362
+ ],
1363
+ "bbox": [
1364
+ 510,
1365
+ 85,
1366
+ 882,
1367
+ 920
1368
+ ],
1369
+ "page_idx": 8
1370
+ },
1371
+ {
1372
+ "type": "page_number",
1373
+ "text": "6429",
1374
+ "bbox": [
1375
+ 480,
1376
+ 928,
1377
+ 519,
1378
+ 940
1379
+ ],
1380
+ "page_idx": 8
1381
+ },
1382
+ {
1383
+ "type": "list",
1384
+ "sub_type": "ref_text",
1385
+ "list_items": [
1386
+ "Association for Computational Linguistics (Volume 1: Long Papers), pages 1874-1889.",
1387
+ "Xiaoming Liu, Zhaohan Zhang, Yichen Wang, Hang Pu, Yu Lan, and Chao Shen. 2023. Coco: Coherence-enhanced machine-generated text detection under low resource with contrastive learning. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 16167-16188.",
1388
+ "Ning Lu, Shengcai Liu, Rui He, Yew-Soon Ong, Qi Wang, and Ke Tang. 2024. Large language models can be guided to evade AI-generated text detection. Transactions on Machine Learning Research.",
1389
+ "Narek Maloyan, Bulat Nutfullin, and Eugene Ilyshin. 2022. Dialog-22 ruatd generated text detection. In Computational Linguistics and Intellectual Technologies, page 394-401. RSUH.",
1390
+ "Chengzhi Mao, Carl Vondrick, Hao Wang, and Junfeng Yang. 2024. Raidar: Generative ai detection via rewriting. In The Twelfth International Conference on Learning Representations.",
1391
+ "Julian John McAuley and Jure Leskovec. 2013. From amateurs to connoisseurs: Modeling the evolution of user expertise through online reviews. In Proceedings of the 22nd International Conference on World Wide Web, pages 897-908.",
1392
+ "Meta. 2024. Llama 3. https://llama.meta.com/llama3/.",
1393
+ "Eric Mitchell, Yoonho Lee, Alexander Khazatsky, Christopher D Manning, and Chelsea Finn. 2023. Detectgpt: Zero-shot machine-generated text detection using probability curvature. In International Conference on Machine Learning, pages 24950-24962. PMLR.",
1394
+ "Sandra Mitrovic, Davide Andreoletti, and Omran Ayoub. 2023. Chatgpt or human? detect and explain. explaining decisions of machine learning model for detecting short chatgpt-generated text. arXiv Preprint arXiv:2301.13852, abs/2301.13852.",
1395
+ "Edoardo Mosca, Mohamed Hesham Ibrahim Abdalla, Paolo Basso, Margherita Musumeci, and Georg Groh. 2023. Distinguishing fact from fiction: A benchmark dataset for identifying machine-generated scientific papers in the lll era. In Proceedings of the 3rd Workshop on Trustworthy Natural Language Processing (TrustNLP 2023), pages 190-207, Toronto, Canada. Association for Computational Linguistics.",
1396
+ "Gustave Florentin Nkoulou Mvondo, Ben Niu, and Salman Eivazinezhad. 2023. Generative conversational ai and academic integrity: A mixed method investigation to understand the ethical use of llm chatbots in higher education. Available at SSRN 4548263.",
1397
+ "Shashi Narayan, Shay B Cohen, and Mirella Lapata. 2018. Don't give me the details, just the summary!"
1398
+ ],
1399
+ "bbox": [
1400
+ 115,
1401
+ 85,
1402
+ 485,
1403
+ 906
1404
+ ],
1405
+ "page_idx": 9
1406
+ },
1407
+ {
1408
+ "type": "list",
1409
+ "sub_type": "ref_text",
1410
+ "list_items": [
1411
+ "topic-aware convolutional neural networks for extreme summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1797-1807.",
1412
+ "Olympics. 2024. Olympics. https://olympics.com/en/.",
1413
+ "OpenAI. 2020. Chatgpt. https://openai.com/chatgpt.",
1414
+ "OpenAI. 2024. Gpt-4o. https://openai.com/index/hello-gpt-4o/.",
1415
+ "Yikang Pan, Liangming Pan, Wenhu Chen, Preslav Nakov, Min-Yen Kan, and William Yang Wang. 2023. On the risk of misinformation pollution with large language models. In The 2023 Conference on Empirical Methods in Natural Language Processing.",
1416
+ "Jiameng Pu, Zain Sarwar, Sifat Muhammad Abdullah, Abdullah Rehman, Yoonjin Kim, Parantapa Bhattacharya, Mobin Javed, and Bimal Viswanath. 2023. Deepfake text detection: Limitations and opportunities. In 2023 IEEE Symposium on Security and Privacy (SP), pages 1613-1630. IEEE.",
1417
+ "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9.",
1418
+ "Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. 2023. Direct preference optimization: Your language model is secretly a reward model. In Thirty-seventh Conference on Neural Information Processing Systems.",
1419
+ "Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: $100,000+$ questions for machine comprehension of text. arXiv Preprint arXiv:1606.05250.",
1420
+ "Machel Reid, Nikolay Savinov, Denis Teptyashin, Dmitry Lepikhin, Timothy Lillicrap, Jean-Baptiste Alayrac, Radu Soricut, Angeliki Lazaridou, Orhan Firat, Julian Schrittwieser, et al. 2024. Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context. arXiv Preprint arXiv:2403.05530.",
1421
+ "Jonathan Schler, Moshe Koppel, Shlomo Argamon, and James W Pennebaker. 2006. Effects of age and gender on blogging. In AAAI Spring Symposium: Computational Approaches to Analyzing Weblogs, volume 6, pages 199-205.",
1422
+ "Ilia Shumailov, Zakhar Shumaylov, Yiren Zhao, Yarin Gal, Nicolas Papernot, and Ross Anderson. 2023. The curse of recursion: Training on generated data makes models forget. arXiv Preprint arXiv:2305.17493.",
1423
+ "Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for"
1424
+ ],
1425
+ "bbox": [
1426
+ 510,
1427
+ 85,
1428
+ 880,
1429
+ 917
1430
+ ],
1431
+ "page_idx": 9
1432
+ },
1433
+ {
1434
+ "type": "page_number",
1435
+ "text": "6430",
1436
+ "bbox": [
1437
+ 480,
1438
+ 928,
1439
+ 519,
1440
+ 940
1441
+ ],
1442
+ "page_idx": 9
1443
+ },
1444
+ {
1445
+ "type": "list",
1446
+ "sub_type": "ref_text",
1447
+ "list_items": [
1448
+ "semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics.",
1449
+ "Irene Solaiman, Miles Brundage, Jack Clark, Amanda Askell, Ariel Herbert-Voss, Jeff Wu, Alec Radford, Gretchen Krueger, Jong Wook Kim, Sarah Kreps, et al. 2019. Release strategies and the social impacts of language models. arXiv Preprint arXiv:1908.09203.",
1450
+ "Daniel Spokoyny, Tanmay Laud, Tom Corringham, and Taylor Berg-Kirkpatrick. 2023. Towards answering climate questionnaires from unstructured climate reports. arXiv Preprint arXiv:2301.04253.",
1451
+ "Jinyan Su, Terry Yue Zhuo, Di Wang, and Preslav Nakov. 2023. Detectllm: Leveraging log rank information for zero-shot detection of machine-generated text. In The 2023 Conference on Empirical Methods in Natural Language Processing.",
1452
+ "Gemini Team, Rohan Anil, Sebastian Borgeaud, Yonghui Wu, Jean-Baptiste Alayrac, Jiahui Yu, Radu Soricut, Johan Schalkwyk, Andrew M Dai, Anja Hauth, et al. 2023. Gemini: A family of highly capable multimodal models. arXiv Preprint arXiv:2312.11805.",
1453
+ "Nandan Thakur, Nils Reimers, Andreas Rückle, Abhishek Srivastava, and Iryna Gurevych. 2021. Beir: A heterogeneous benchmark for zero-shot evaluation of information retrieval models. In Thirty-Fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2).",
1454
+ "Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv Preprint arXiv:2302.13971.",
1455
+ "Vivek Verma, Eve Fleisig, Nicholas Tomlin, and Dan Klein. 2024. Ghostbuster: Detecting text ghostwritten by large language models. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 1702-1717.",
1456
+ "Yuxia Wang, Jonibek Mansurov, Petar Ivanov, Jinyan Su, Artem Shelmanov, Akim Tsvigun, Chenxi Whitehouse, Osama Mohammed Afzal, Tarek Mahmoud, Toru Sasaki, Thomas Arnold, Alham Aji, Nizar Habash, Iryna Gurevych, and Preslav Nakov. 2024. M4: Multi-generator, multi-domain, and multilingual black-box machine-generated text detection. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1369-1407, St. Julian's, Malta. Association for Computational Linguistics."
1457
+ ],
1458
+ "bbox": [
1459
+ 115,
1460
+ 85,
1461
+ 487,
1462
+ 913
1463
+ ],
1464
+ "page_idx": 10
1465
+ },
1466
+ {
1467
+ "type": "list",
1468
+ "sub_type": "ref_text",
1469
+ "list_items": [
1470
+ "Rowan Zellers, Ari Holtzman, Hannah Rashkin, Yonatan Bisk, Ali Farhadi, Franziska Roesner, and Yejin Choi. 2019. Defending against neural fake news. Advances in Neural Information Processing Systems, 32.",
1471
+ "Yizhou Zhang, Karishma Sharma, Lun Du, and Yan Liu. 2024. Toward mitigating misinformation and social media manipulation in lmm era. In Companion Proceedings of the ACM on Web Conference 2024, pages 1302-1305.",
1472
+ "Lucia Zheng, Neel Guha, Brandon R Anderson, Peter Henderson, and Daniel E Ho. 2021. When does pretraining help? assessing self-supervised learning for law and the casehold dataset of $53,000+$ legal holdings. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Law, pages 159-168."
1473
+ ],
1474
+ "bbox": [
1475
+ 510,
1476
+ 85,
1477
+ 880,
1478
+ 326
1479
+ ],
1480
+ "page_idx": 10
1481
+ },
1482
+ {
1483
+ "type": "page_number",
1484
+ "text": "6431",
1485
+ "bbox": [
1486
+ 480,
1487
+ 928,
1488
+ 517,
1489
+ 940
1490
+ ],
1491
+ "page_idx": 10
1492
+ },
1493
+ {
1494
+ "type": "text",
1495
+ "text": "A Appendix",
1496
+ "text_level": 1,
1497
+ "bbox": [
1498
+ 114,
1499
+ 84,
1500
+ 238,
1501
+ 99
1502
+ ],
1503
+ "page_idx": 11
1504
+ },
1505
+ {
1506
+ "type": "text",
1507
+ "text": "A.1 Dataset Details",
1508
+ "text_level": 1,
1509
+ "bbox": [
1510
+ 114,
1511
+ 109,
1512
+ 282,
1513
+ 122
1514
+ ],
1515
+ "page_idx": 11
1516
+ },
1517
+ {
1518
+ "type": "text",
1519
+ "text": "Our dataset encompasses 21 independent English domains. Table 6 shows the source and license for each domain. For all domains, we manually verify that no personal or offensive content is included. For domains taken from third-party datasets, we use the data consistent with their intended use (detection of LLM-generated text).",
1520
+ "bbox": [
1521
+ 112,
1522
+ 130,
1523
+ 487,
1524
+ 242
1525
+ ],
1526
+ "page_idx": 11
1527
+ },
1528
+ {
1529
+ "type": "text",
1530
+ "text": "A.2 Effectiveness of the Diverse Prompt in Data Preparation",
1531
+ "text_level": 1,
1532
+ "bbox": [
1533
+ 112,
1534
+ 253,
1535
+ 463,
1536
+ 285
1537
+ ],
1538
+ "page_idx": 11
1539
+ },
1540
+ {
1541
+ "type": "text",
1542
+ "text": "The construction of our dataset involves 200 generation prompts, resembling more real-world use cases compared with traditional evaluation datasets which are usually constrained to one single generation prompt. To prove the superiority of our dataset in training more capable detection models, we create a parallel non-diverse dataset which is created on the same number of domains and source LLMs, but the LLM data is generated only using the prompt \"Rewrite this for me please.\" Then, we train two RAID detectors without finetuning, on the non-diverse dataset, and evaluate it on the diverse dataset. As shown in Table 8, the diverse prompts yields to $2.64\\%$ increase in AUROC score if the rewrite model is Gemini 1.5 Pro, and $0.82\\%$ increase in AUROC score if the rewrite model is Llama-3 8B. This validates the effectiveness of the diverse prompts we were using, and suggests that such diversity could help the detector to capture more information about real world data distributions.",
1543
+ "bbox": [
1544
+ 112,
1545
+ 290,
1546
+ 489,
1547
+ 626
1548
+ ],
1549
+ "page_idx": 11
1550
+ },
1551
+ {
1552
+ "type": "text",
1553
+ "text": "A.3 LoRA Configurations for Fine-Tuning",
1554
+ "text_level": 1,
1555
+ "bbox": [
1556
+ 112,
1557
+ 638,
1558
+ 463,
1559
+ 653
1560
+ ],
1561
+ "page_idx": 11
1562
+ },
1563
+ {
1564
+ "type": "text",
1565
+ "text": "We leverage QLoRA when fine-tuning L2R and the baselines. Despite the same quantization precision, Table 9 lists the four different LoRA configurations that we use for fine-tuning in §5.4.",
1566
+ "bbox": [
1567
+ 112,
1568
+ 659,
1569
+ 487,
1570
+ 722
1571
+ ],
1572
+ "page_idx": 11
1573
+ },
1574
+ {
1575
+ "type": "text",
1576
+ "text": "A.4 Effectiveness of the Calibration Loss",
1577
+ "text_level": 1,
1578
+ "bbox": [
1579
+ 112,
1580
+ 734,
1581
+ 450,
1582
+ 749
1583
+ ],
1584
+ "page_idx": 11
1585
+ },
1586
+ {
1587
+ "type": "text",
1588
+ "text": "An important contribution of ours that improves the fine-tuning performance is thresholding on the calibration loss, as proposed in §3.4. Without this method, the model tends to overfit during fine-tuning as shown in Figure 4, where the model loss drastically decreases after 1500 steps, resulting in verbose rewrite even for LLM-generated text. We find the overfitting harms L2R's performance from an ablation study on five domains where the AUROC score is only 0.62 after the model overfits.",
1589
+ "bbox": [
1590
+ 112,
1591
+ 755,
1592
+ 489,
1593
+ 915
1594
+ ],
1595
+ "page_idx": 11
1596
+ },
1597
+ {
1598
+ "type": "text",
1599
+ "text": "The calibration loss can benefit model learning because the threshold effectively prevents further modification to model weights once an input, labeled either LLM or human, falls in its corresponding distribution already. Since our purpose is simply to draw a boundary rather than separate the distributions as much as possible, halting further weight updates on already correctly classified inputs allows the model to focus parameter updates only on misclassified examples, leading to more efficient and effective convergence. Concretely, applying the calibration loss improves the L2R's performance by $4.54\\%$ in AUROC among 21 domains, even comparing to a model tuned without the calibration and before it overfits.",
1600
+ "bbox": [
1601
+ 507,
1602
+ 84,
1603
+ 884,
1604
+ 325
1605
+ ],
1606
+ "page_idx": 11
1607
+ },
1608
+ {
1609
+ "type": "image",
1610
+ "img_path": "images/f32719bf6a639d0162d6bc4e8353e3baea92d4d55b544768fdbc06250ada3b81.jpg",
1611
+ "image_caption": [
1612
+ "Figure 4: Training loss curves for the rewrite model. The orange line plots the loss trained without the calibration method, and the blue line plots the loss trained with calibration. The later one exhibits faster convergence and higher stability than the former one."
1613
+ ],
1614
+ "image_footnote": [],
1615
+ "bbox": [
1616
+ 534,
1617
+ 348,
1618
+ 845,
1619
+ 464
1620
+ ],
1621
+ "page_idx": 11
1622
+ },
1623
+ {
1624
+ "type": "text",
1625
+ "text": "A.5 Different Ways to Generate OOD Data",
1626
+ "text_level": 1,
1627
+ "bbox": [
1628
+ 507,
1629
+ 577,
1630
+ 865,
1631
+ 592
1632
+ ],
1633
+ "page_idx": 11
1634
+ },
1635
+ {
1636
+ "type": "text",
1637
+ "text": "There exists a variety of ways to generate OOD data, including using different generation models, decoding strategies, text lengths, and writing styles. While we show how M4, the OOD dataset we use for evaluation, deviates from our training domain in all above aspects in Table2, we conduct two additional ablation studies on how different text length and decoding strategy alone could influence detection performance.",
1638
+ "bbox": [
1639
+ 507,
1640
+ 598,
1641
+ 882,
1642
+ 741
1643
+ ],
1644
+ "page_idx": 11
1645
+ },
1646
+ {
1647
+ "type": "text",
1648
+ "text": "We use 200 randomly selected human-written texts from our dataset for both studies. For the study on decoding strategy, we use greedy decoding for GPT and Gemini models and beam search with num_beams $= 5$ for the Llama model during the construction of the LLM-generated counterparts. For the study on text length, we chunk the input texts to an average length of 60. We test different detectors on these two datasets and show results in Table 7, where L2R outperforms the others across both settings. These results further confirm L2R's",
1649
+ "bbox": [
1650
+ 507,
1651
+ 743,
1652
+ 882,
1653
+ 919
1654
+ ],
1655
+ "page_idx": 11
1656
+ },
1657
+ {
1658
+ "type": "page_number",
1659
+ "text": "6432",
1660
+ "bbox": [
1661
+ 480,
1662
+ 928,
1663
+ 519,
1664
+ 940
1665
+ ],
1666
+ "page_idx": 11
1667
+ },
1668
+ {
1669
+ "type": "table",
1670
+ "img_path": "images/8eb78311e4c028cfc6041da5b746b945cce6a4f8066720a91ad58144fb2d098d.jpg",
1671
+ "table_caption": [],
1672
+ "table_footnote": [],
1673
+ "table_body": "<table><tr><td>Category</td><td>Source</td><td>License</td></tr><tr><td>AcademicResearch</td><td>Arxiv abstracts (Mao et al., 2024)</td><td>Various CC licenses</td></tr><tr><td>ArtCulture</td><td>Wikipedia</td><td>CC BY-SA</td></tr><tr><td>Business</td><td>Wikipedia</td><td>CC BY-SA</td></tr><tr><td>Code</td><td>Code snippets (Mao et al., 2024)</td><td>MIT</td></tr><tr><td>EducationalMaterial</td><td>Ghostbuster essays (Verma et al., 2024)</td><td>CC BY 3.0</td></tr><tr><td>Entertainment</td><td>IMDb dataset (IMDb, 2024), Stanford SST2 (Socher et al., 2013)</td><td>IMDb terms of use, CC Zero</td></tr><tr><td>Environmental</td><td>Climate-Ins (Spokoyny et al., 2023)</td><td>CC Zero</td></tr><tr><td>Finance</td><td>Hugging Face FIQA (Thakur et al., 2021)</td><td>CC BY-NC</td></tr><tr><td>FoodCuisine</td><td>Kaggle fine food reviews (McAuley and Leskovec, 2013)</td><td>CC Zero</td></tr><tr><td>GovernmentPublic</td><td>Wikipedia</td><td>CC BY-SA</td></tr><tr><td>LegalDocument</td><td>CaseHOLD (Zheng et al., 2021)</td><td>Apache 2.0</td></tr><tr><td>CreativeWriting</td><td>Writing Prompts (Fan et al., 2018)</td><td>MIT</td></tr><tr><td>MedicalText</td><td>PubMedQA (Jin et al., 2019)</td><td>MIT</td></tr><tr><td>NewsArticle</td><td>XSum (Narayan et al., 2018)</td><td>MIT</td></tr><tr><td>OnlineContent</td><td>Hugging Face blog authorship (Schler et al., 2006)</td><td>Non-commercial</td></tr><tr><td>PersonalCommunication</td><td>Hugging Face daily dialogue (Li et al., 2017)</td><td>CC-BY-NC-SA 4.0</td></tr><tr><td>ProductReview</td><td>Yelp reviews (Mao et al., 2024)</td><td>Yelp terms of use</td></tr><tr><td>Religious</td><td>Bible, Buddha, Koran, Meditation, and Mormon</td><td>N/A</td></tr><tr><td>Sports</td><td>Olympics website (Olympics, 2024)</td><td>Olympics terms of use</td></tr><tr><td>TechnicalWriting</td><td>Scientific articles (Mosca et al., 2023)</td><td>CC Zero</td></tr><tr><td>TravelTourism</td><td>Wikipedia</td><td>CC BY-SA</td></tr></table>",
1674
+ "bbox": [
1675
+ 119,
1676
+ 80,
1677
+ 877,
1678
+ 382
1679
+ ],
1680
+ "page_idx": 12
1681
+ },
1682
+ {
1683
+ "type": "table",
1684
+ "img_path": "images/0ff1f7fab3581e621869df006d5ea7b3fcf2a1322dedcf77b2e51c50e7bd7764.jpg",
1685
+ "table_caption": [
1686
+ "Table 6: Source and license for each of the 21 domains in our dataset."
1687
+ ],
1688
+ "table_footnote": [],
1689
+ "table_body": "<table><tr><td>Avg Length</td><td>Decoding Strategy</td><td>Fast-DetectGPT</td><td>RAIDAR</td><td>L2R</td></tr><tr><td>120</td><td>Nucleus Sampling</td><td>0.6833</td><td>0.8186</td><td>0.9213</td></tr><tr><td>60</td><td>Nucleus Sampling</td><td>0.6500</td><td>0.7635</td><td>0.8632</td></tr><tr><td>120</td><td>Greedy Decoding &amp; Beam Search</td><td>0.6897</td><td>0.8009</td><td>0.8750</td></tr></table>",
1690
+ "bbox": [
1691
+ 157,
1692
+ 420,
1693
+ 838,
1694
+ 502
1695
+ ],
1696
+ "page_idx": 12
1697
+ },
1698
+ {
1699
+ "type": "table",
1700
+ "img_path": "images/1c6b085e4968f6ea7a1f068c6cf8c92fd7014ff1fbdbf66fabc38972e30f7d80.jpg",
1701
+ "table_caption": [
1702
+ "Table 7: Comparison of AUROC scores across the three methods under various OOD settings. L2R consistently outperforms the baselines, achieving the highest AUROC in all scenarios."
1703
+ ],
1704
+ "table_footnote": [],
1705
+ "table_body": "<table><tr><td>Dataset</td><td>Rewrite Model</td><td>AUROC</td></tr><tr><td>Single-Prompt</td><td>Gemini</td><td>0.7302</td></tr><tr><td>Multi-Domain Dataset</td><td>Llama</td><td>0.7888</td></tr><tr><td>Multi-Prompt</td><td>Gemini</td><td>0.7566</td></tr><tr><td>Multi-Domain Dataset</td><td>Llama</td><td>0.7970</td></tr></table>",
1706
+ "bbox": [
1707
+ 119,
1708
+ 563,
1709
+ 482,
1710
+ 659
1711
+ ],
1712
+ "page_idx": 12
1713
+ },
1714
+ {
1715
+ "type": "table",
1716
+ "img_path": "images/0cc17d32c2c2bc030770da7dc6d77af71e0470ac0b70788cb92865b44a64550e.jpg",
1717
+ "table_caption": [
1718
+ "Table 8: Comparison of AUROC scores of the Gemini and Llama rewrite models when trained on non-diverse versus diverse datasets. Incorporating diverse prompting during training leads to improved detection performance for both models on the same diverse test set."
1719
+ ],
1720
+ "table_footnote": [],
1721
+ "table_body": "<table><tr><td>r</td><td>lora_alpha</td><td>Trainable Parameters</td></tr><tr><td>2</td><td>4</td><td>851,968</td></tr><tr><td>4</td><td>8</td><td>1,703,936</td></tr><tr><td>8</td><td>16</td><td>3,407,872</td></tr><tr><td>16</td><td>32</td><td>6,815,744</td></tr></table>",
1722
+ "bbox": [
1723
+ 149,
1724
+ 753,
1725
+ 452,
1726
+ 843
1727
+ ],
1728
+ "page_idx": 12
1729
+ },
1730
+ {
1731
+ "type": "text",
1732
+ "text": "Table 9: Parameter settings for LoRA fine-tuning.",
1733
+ "bbox": [
1734
+ 129,
1735
+ 857,
1736
+ 470,
1737
+ 872
1738
+ ],
1739
+ "page_idx": 12
1740
+ },
1741
+ {
1742
+ "type": "text",
1743
+ "text": "robustness against different types of OOD data distributions.",
1744
+ "bbox": [
1745
+ 507,
1746
+ 565,
1747
+ 884,
1748
+ 596
1749
+ ],
1750
+ "page_idx": 12
1751
+ },
1752
+ {
1753
+ "type": "text",
1754
+ "text": "A.6 Rewrite Examples",
1755
+ "text_level": 1,
1756
+ "bbox": [
1757
+ 509,
1758
+ 609,
1759
+ 705,
1760
+ 625
1761
+ ],
1762
+ "page_idx": 12
1763
+ },
1764
+ {
1765
+ "type": "text",
1766
+ "text": "We show the text examples before and after L2R's rewriting, among multiple domains, in Figure 5.",
1767
+ "bbox": [
1768
+ 507,
1769
+ 630,
1770
+ 882,
1771
+ 663
1772
+ ],
1773
+ "page_idx": 12
1774
+ },
1775
+ {
1776
+ "type": "page_number",
1777
+ "text": "6433",
1778
+ "bbox": [
1779
+ 480,
1780
+ 928,
1781
+ 519,
1782
+ 940
1783
+ ],
1784
+ "page_idx": 12
1785
+ },
1786
+ {
1787
+ "type": "table",
1788
+ "img_path": "images/3def4e56a1054595da38f7e344bc6a7110dd3f84adafb61985f330dea7d7acea.jpg",
1789
+ "table_caption": [],
1790
+ "table_footnote": [],
1791
+ "table_body": "<table><tr><td rowspan=\"2\">Academic Research</td><td>INPUT HUMAN\nIn recent years, several techniques have been proposed for increasing robustness to adversarial examples --- and yet most of these have been quickly shown to be vulnerable to future attacks. For example, over half of the defenses proposed by papers accepted at ICLR 2018 have already been broken.</td><td>REWRITTEN HUMAN\nDespite recent efforts to increase robustness, most proposed techniques have been quickly shown to be vulnerable to future attacks. For instance, over half of the defenses presented at ICLR 2018 have already been breached.</td></tr><tr><td>INPUT LLAMA-3-70B\nDespite numerous attempts to develop robustness against these threats, most proposed defenses have been rapidly compromised by subsequent attacks. In fact, a staggering 50% of defenses presented at ICLR 2018 have already been breached.</td><td>REWRITTEN LLAMA-3-70B\nDespite numerous attempts to develop robustness against these threats, most proposed defenses have been rapidly compromised by subsequent attacks. In fact, a staggering 50% of defenses presented at ICLR 2018 have already been breached.</td></tr><tr><td rowspan=\"2\">Code\nIndentation\nhidden</td><td>INPUT HUMAN\ndef solve(s): fg = 0 idx = 0 new_str = list(s) for i in s: if i.isalpha(): new_str[idx] = i_swapcase() fg = 1 idx += 1 s = &quot;&quot; for i in new_str: s += i if fg == 0: return s[len(s)::-1] return s</td><td>REWRITTEN HUMAN\ndef solve(s): result = [] for char in s: if char.isalpha(): result.append(char_swapcase()) else: result.append(char.return &quot;&quot; .join(result) if not any(char.isalpha() for char in s) else &quot;&quot; .join(result)[:-1]</td></tr><tr><td>INPUT GPT-4o\ndef solve(s): has_letter = any(char.isalpha() for char in s) if has_letter: return &quot;join(char_swapcase() if char.isalpha() else char for char in s) else: return s[:-1]</td><td>REWRITTEN GPT-4o\ndef solve(s): has_letter = any(char.isalpha() for char in s) if has_letter: return &quot; .join(char_swapcase() if char.isalpha() else char for char in s) else: return s[:-1]</td></tr><tr><td rowspan=\"2\">Legal\nDocument</td><td>INPUT HUMAN\nThis type of information may constitute trade secrets. See G.L.c. 266, §30 (defining &quot;trade secret&quot; as used in G.L.c. 93, §42)</td><td>REWRITTEN HUMAN\nThis type of information may constitute trade secrets. Massachusetts General Laws, chapter 266, section 30</td></tr><tr><td>INPUT GEMINI 1.5 PRO\nThis type of information, such as customer data and proposals, can be legally protected as trade secrets under Massachusetts law (G.L.c. 266, §30).</td><td>REWRITTEN GEMINI 1.5 PRO\nThis type of information, such as customer data and proposals, can be legally protected as trade secrets under Massachusetts law (G.L. c. 266, § 30).</td></tr><tr><td rowspan=\"2\">Creative\nWriting</td><td>INPUT HUMAN\nA voice in the sky will tell you when you&#x27;ve left a place for the last time. You tell your SO goodbye and head out to [location of your choice]. Halfway there you hear &quot;You have visited a location for the last time.&quot; John wrinkled his nose and cleared his throat. Pausing, he put down his briefcase and adjusted his tie. It was a red tie with white stripes. This was one of his favorite ties.</td><td>REWRITTEN HUMAN\nAs John bid his SO farewell, he headed out to [location of his choice]. Halfway there, a voice in his mind whispered, &quot;You have visited this place for the last time.&quot; John&#x27;s expression faltered, and he paused to adjust his tie, a favorite red tie with white stripes.</td></tr><tr><td>INPUT LLAMA-3-70B\nAs John bid farewell to his partner and headed out to the city, a mysterious voice in the sky announced, &quot;You have visited a location for the last time.&quot; He paused, adjusting his favorite red tie with white stripes, and cleared his throat.</td><td>REWRITTEN LLAMA-3-70B\nAs John bid farewell to his partner and stepped out into the city, a mysterious voice in the sky announced, &quot;You have visited a location for the last time.&quot; He paused, adjusting his favorite red tie with white stripes, and cleared his throat.</td></tr></table>",
1792
+ "bbox": [
1793
+ 115,
1794
+ 168,
1795
+ 884,
1796
+ 763
1797
+ ],
1798
+ "page_idx": 13
1799
+ },
1800
+ {
1801
+ "type": "text",
1802
+ "text": "Figure 5: Examples of texts in our proposed dataset along with the amount of edits L2R model gives for human and LLM-generated text. Deleted characters are marked in red, inserted characters are in blue, and unmodified characters are in black. The examples demonstrate the diverse domains and source LLMs available in the dataset, as well as L2R's ability in separating human and LLM-generated text via rewriting.",
1803
+ "bbox": [
1804
+ 112,
1805
+ 771,
1806
+ 884,
1807
+ 829
1808
+ ],
1809
+ "page_idx": 13
1810
+ },
1811
+ {
1812
+ "type": "page_number",
1813
+ "text": "6434",
1814
+ "bbox": [
1815
+ 480,
1816
+ 928,
1817
+ 521,
1818
+ 940
1819
+ ],
1820
+ "page_idx": 13
1821
+ }
1822
+ ]
2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/7e8e6ea3-0b1b-4f33-86f0-4eaba3c14cbc_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/7e8e6ea3-0b1b-4f33-86f0-4eaba3c14cbc_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22a86e0b85630764c3c5aa12995fa074d26351cd3e194d84497fb136934e2e67
3
+ size 619381
2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/full.md ADDED
@@ -0,0 +1,368 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Learning to Rewrite: Generalized LLM-Generated Text Detection
2
+
3
+ Wei Hao $^{1*}$ , Ran Li $^{1*}$ , Weiliang Zhao $^{1}$ , Junfeng Yang $^{1}$ , Chengzhi Mao $^{2}$ , Columbia University $^{1}$ , Rutgers University $^{2}$
4
+
5
+ {rl3424,wh2473,wz2665,jy2324}@columbia.edu,cm1838@rutgers.edu
6
+
7
+ # Abstract
8
+
9
+ Detecting text generated by Large Language Models (LLMs) is crucial, yet current detectors often struggle to generalize in open-world settings. We introduce Learning2Rewrite, a novel framework to detect LLM-generated text with exceptional generalization to unseen domains. Capitalized on the finding that LLMs inherently modify LLM-generated content less than human-written text when rewriting, we train an LLM to amplify this disparity, yielding a more distinguishable and generalizable edit distance across diverse text distributions. Extensive experiments on data from 21 independent domains and four major LLMs (GPT-3.5, GPT-4, Gemini, and Llama-3) demonstrate that our detector outperforms state-of-the-art detection methods by up to $23.04\%$ in AUROC for in-distribution tests, $35.10\%$ for out-of-distribution tests, and $48.66\%$ under adversarial attacks. Our unique training objective ensures better generalizability compared to directly training for classification, even when leveraging the same amount of tunable parameters. Our findings suggest that reinforcing LLMs' inherent rewriting tendencies offers a robust and scalable solution for detecting LLM-generated text.
10
+
11
+ # 1 Introduction
12
+
13
+ Large Language Models (LLMs) demonstrate exceptional capabilities in various tasks (Radford et al., 2019; Brown et al., 2020; Achiam et al., 2023; Touvron et al., 2023; Team et al., 2023; OpenAI, 2020). However, they can be misused for illegal or unethical activities, such as spreading misinformation (Chen and Shu, 2023), scaling phishing campaigns (Hao et al., 2025), manipulating social media (Zhang et al., 2024), and generating propaganda (Pan et al., 2023). LLMs also facilitate academic dishonesty (Zellers et al., 2019; Mvondo et al., 2023), and training foundation models with generated content can lead to irreversible defects in the resulting models (Shumailov et al., 2023).
14
+
15
+ ![](images/24b17d2a3360beaa89902cc116fc5ac92d16d1b53a8cfe78bb64e33baee910dc.jpg)
16
+
17
+ ![](images/a77a232b5a248e60701c61944dcf6c27280ef346dd03ac84b42349aeece0d043.jpg)
18
+
19
+ ![](images/4ccb4fcf41bb3e11a4203383fcdddb9f2fcaf3a00cd6f957e21918f9e3086d42.jpg)
20
+
21
+ ![](images/eba25e7ccce4ae215ca5d3e0d37cf9064e0e46271d4d2ec7482e94d04b522727.jpg)
22
+ Figure 1: Rewriting for LLM-generated Text Detection. The histograms depict the edit distance distributions for texts generated by human and LLMs, illustrating how fine-tuning a rewrite model enhances their separation. We show two domains: Purple and Yellow represent human and LLM distributions for Product Review texts, while Blue and Orange represent those for Environmental texts. Without fine-tuning the rewrite model, human and LLM distributions are inseparable by a single threshold (red line, above). After fine-tuning, the texts can be separated by one threshold (below). On the right, we conceptualize L2R's intuition by showing that the rugged decision boundary between human and LLM texts, caused by varying data distributions across domains, can be better aligned and divided by a single threshold after fine-tuning. Specifically, the standard deviation in decision thresholds among all domains decreases from 0.7506 to 0.4428 after fine-tuning.
23
+
24
+ ![](images/a73ff7f6d2854932ce86cbb34cf4686137358c2fd22dd5eb80354c33f6f62664.jpg)
25
+
26
+ ![](images/0fd38b11b1fd5da522698535d1c4b687b365cc510172929a93d8cb35392c030b.jpg)
27
+
28
+ These issues highlight the urgent need for reliable algorithms to detect LLM-generated text.
29
+
30
+ Various methods for detecting LLM-generated text have been proposed (Solaiman et al., 2019; Mitrovic et al., 2023; Mitchell et al., 2023; Su et al., 2023; Liu et al., 2024; Bao et al., 2024; Mao et al., 2024; Verma et al., 2024; Gehrmann et al., 2019). Most of these detectors employ pre-trained models, extracting hand-crafted features and heuristics (e.g., loss curvature (Bao et al., 2024), edit distance from rewriting (Mao et al., 2024)), and apply thresholds to separate LLM from human text. However, these thresholds are highly domain-dependent, hindering a universal detection standard.
31
+
32
+ In this paper, we present L2R (Learning-to-Rewrite), which trains an LLM to specifically perform more edits when asked to rewrite human-generated text and fewer edits when rewriting LLM-generated text across a diverse set of domains, thus effectively distinguish LLM-generated text from human-generated one. Unlike traditional detectors designed solely for binary classification, which perform well in-distribution (ID) but struggle to generalize to out-of-distribution (OOD) domains including adversarial attacks, our method reinforces LLMs' inherent reluctance to rewrite their own outputs by using rewriting as an additional training objective to maximize this tendency, thereby enhancing generalizability and enabling a single detection threshold across diverse distributions. Figure 1 illustrates an example of how L2R learns to make LLM and human-generated text more separable across domains, compared to only rewriting using a pre-trained model (Mao et al., 2024).
33
+
34
+ On a dataset spanning 21 domains (e.g., finance, entertainment, cuisine) and constructed using four major LLMs (GPT-3.5, GPT-4, Gemini, and Llama3), L2R surpasses the state-of-the-art detectors, achieving up to $19.56\%$ higher AUROC ID and $35.10\%$ higher OOD than Verma et al. (2024), $23.04\%$ higher ID and $9.90\%$ higher OOD than Bao et al. (2024), and $10.39\%$ higher ID and $4.67\%$ higher OOD than Mao et al. (2024). Compared with fine-tuning a Llama-3 model for naive text classification, L2R has $51.35\%$ higher AUROC OOD despite leveraging the same number of tunable parameters. L2R also outperforms the state-ofthe-art detectors by up to $48.66\%$ under adversarial attacks. These results demonstrate that our training objective offers superior accuracy and generalizability. Furthermore, our method provides interpretability by highlighting the rewritten portions of the text. Our codebase is open-sourced<sup>1</sup> and our contributions are summarized as follows:
35
+
36
+ - While binary classifiers often learn spurious, domain-specific features for LLM-generated text detection, we propose L2R, which learns a proxy based on the minimal edit distance on LLM content, yielding a more robust and invariant detection threshold.
37
+ - We build a diversely generated dataset (21 domains) and design a calibration loss function to make fine-tuning both effective and stable.
38
+ - We conduct comprehensive evaluations on ID,
39
+
40
+ OOD datasets and against different adversarial attacks (Decoherence and Rewrite bypassing), showing that L2R surpasses state-of-the-art detection methods.
41
+
42
+ # 2 Related Work
43
+
44
+ Various LLM-generated text detectors have been proposed over the years. One set of detectors trains a model on the input text (Solaiman et al., 2019; Mitrovic et al., 2023; Liu et al., 2023). These methods excel in their training domains, but struggle under OOD evaluation (Pu et al., 2023), i.e., detection with text from different domains or unfamiliar models. The second set of detectors utilize the raw output, i.e., logits, from pre-trained LLMs to assign probability score for detection. GLTR (Gehrmann et al., 2019) utilizes statistical features like log probability, word rank, and entropy to assign score, Ghostbuster (Verma et al., 2024) utilizes log probability and unigram and bigram probability, DetectGPT (Mitchell et al., 2023) employs the delta in log probability of the input text after token perturbation to estimate AI likelihood, PECOLA (Liu et al., 2024) selectively applies perturbation for enhanced accuracy, and Fast-DetectGPT (Bao et al., 2024) simplifies the process by exploiting conditional probability curvature. This family of detectors shows improved generalizability, but all require access to the raw output of an LLM. Since the main targets, namely the commercial LLMs, are not open sourced, this poses a challenge for accurate probability estimation using proxy models. Lastly, RAID (Mao et al., 2024) is a detection method based on the observation that LLMs, when asked to rewrite a given text, tend to produce a higher number of edits for human-written text compared to LLM-generated text. Despite the attempt to capture the edit distance from rewrite as a domain-agnostic feature, the amount of edits still varies across distributions, and the threshold of edit amount between human and LLM texts learned on training domains does not generalize to OOD domains, which limits its full potential.
45
+
46
+ # 3 Method
47
+
48
+ # 3.1 Rewriting for LLM Detection
49
+
50
+ Rewriting input with LLM and then measuring the edits proves to be a successful way to detect LLM-generated text. Given an held-out input text set $\mathbf{X}_{train}$ with LLM and human generated texts, and its corresponding label set $\mathbf{Y}_{train}$ , an LLM $F(\cdot)$ is
51
+
52
+ ![](images/87c44ec5ce13a61f735eadb12b9415de78cab70d03c18ab7d193b0f1b23ecf86.jpg)
53
+ Figure 2: Rewriting examples with edits. Deleted characters are marked in red, added characters are marked in blue, and unmodified characters are in black. We exploit the difference in edit distance between human and LLM-generated text for classification. While the pre-trained Llama-3 model give different amount of edits for human and LLM-generated text (above), rewrites from our fine-tuned model are much more separable (below).
54
+
55
+ prompted to rewrite the input $\mathbf{x} \in \mathbf{X}_{train}$ using a prompt $\mathbf{p}$ . The rewriting output is $F(\mathbf{p},\mathbf{x})$ . Particularly, the prompt $\mathbf{p}$ can be set to: "Refine this for me please".
56
+
57
+ The edit distance between the input text and the rewritten output, $D(\mathbf{x}, F(\mathbf{p}, \mathbf{x}))$ , is then computed for all $\mathbf{x} \in \mathbf{X}_{train}$ . Mao et al. (2024) adopts the Levenshtein score (Levenshtein et al., 1966), which measures the minimum number of insertions, deletions, or substitutions required to transform one text into the other. A higher score denotes the two strings are more similar. With the Levenshtein score, an edit distance used for classification is calculated as:
58
+
59
+ $$
60
+ D _ {k} (\mathbf {x}, F (\mathbf {p}, \mathbf {x})) = 1 - \frac {\text {L e v e n s h t e i n} (F (\mathbf {p} , \mathbf {x}) , \mathbf {x})}{\max (l e n (F (\mathbf {p} , \mathbf {x})) , l e n (\mathbf {x}))}. \tag {1}
61
+ $$
62
+
63
+ Mao et al. (2024) trains a classifier, such as logistic regression or decision tree, to threshold the edit distance and predict if a text is written by an LLM. However, as shown in Figure 1, the threshold of rewriting with a pre-trained LLM often varies from one domain to another, causing RAIDAR to fail to generalize to new domains.
64
+
65
+ # 3.2 Fine-Tuning the Rewrite Model
66
+
67
+ L2R works on the premise that human-written and LLM-generated text would cause a different amount of edits and a boundary can be drawn to separate both distributions. Thus we can finetune such a rewrite model $F'(\cdot)$ , that gives as much edits as possible for human texts, while leaving the LLM texts unmodified, demonstrated in Figure 2. Given some human text $\mathbf{x}_h \in \mathbf{X}_{train}$ and LLM text $\mathbf{x}_{llm} \in \mathbf{X}_{train}$ , our objective becomes:
68
+
69
+ $$
70
+ \left. \max \left\{D \left(\mathbf {x} _ {h}, F ^ {\prime} (\mathbf {p}, \mathbf {x} _ {h})\right) - D \left(\mathbf {x} _ {l l m}, F ^ {\prime} (\mathbf {p}, \mathbf {x} _ {l l m})\right) \right\} \right. \tag {2}
71
+ $$
72
+
73
+ Since the edit distance is not differentiable, we use the cross-entropy loss $L(\cdot)$ assigned to the input $\mathbf{x}$ by $F'(\cdot)$ as a proxy to the edit distance. As a result, for each of input $\mathbf{x}$ with label $y = 1$ (LLM) or 0 (human), our objective becomes:
74
+
75
+ $$
76
+ \min \left\{L \left(\mathbf {X} _ {\text {t r a i n}}\right) \cdot y _ {\text {t r a i n}} \right\}, \quad y _ {\text {t r a i n}} = \left\{ \begin{array}{l l} 1 & (\text {L L M}) \\ - 1 & (\text {h u m a n}) \end{array} \right. \tag {3}
77
+ $$
78
+
79
+ In this way, we flip the sign of the loss when the inputs are written by human. Since the overall loss would be minimized, this effectively encourages
80
+
81
+ the rewrites to be different from human input and identical to the LLM input.
82
+
83
+ # 3.3 Calibration Loss during Fine-Tuning
84
+
85
+ When fine-tuning the rewrite model on Equation 3, the rewrite model aims to minimize the edits on LLM-generated text and maximize the edits on human-generated text. However, without posting regularization and constraint on the unbounded loss, the rewrite model takes the risk of being corrupted (e.g., verbose output for all rewrite and overfitting with more edits on human-generated text rewrite) which we evaluated in §A.4.
86
+
87
+ Therefore, we propose a calibration loss, which prevents the over-fitting problem by imposing a threshold value $t$ on the loss for each given input. For human text $\mathbf{x}_h$ , we apply gradient backpropagation only if $L(\mathbf{x}_h) < t$ . For LLM text $\mathbf{x}_{llm}$ , we apply backpropagation only if $L(\mathbf{x}_{llm}) > t$ . Otherwise, the gradient is set to 0. We show a pseudocode for the algorithm below:
88
+
89
+ Algorithm 1 Calibration Loss Calculation
90
+ ```verilog
91
+ Require: Threshold $t$ , loss $L(\cdot)$ , human text $x_{h}$ , LLM text $x_{llm}$
92
+ ```
93
+
94
+ 1: $L_{h}\gets L(x_{h}),L_{llm}\gets L(x_{llm}),L\gets 0$
95
+ 2: $L\gets L - L_{h}$ if $L_{h} < t$
96
+ 3: $L \gets L + L_{llm}$ if $L_{llm} > t$
97
+ 4: return $L$
98
+
99
+ Therefore, rather than minimizing the loss proxy, our objective becomes separating the distributions of the edit distance, for rewrites on human and LLM inputs, to two ends of the threshold $t$ . Concretely, this enables the model to only optimize against the hard examples, and leave those that are already classified correctly unchanged, to prevent overfitting. This is similar to DPO (Rafailov et al., 2023), where we fine-tune the rewrite model using only preference data, namely the rewrites that are not yet separated by the existing boundary. This process is depicted by the graphical illustrations in Figure 1.
100
+
101
+ To determine the threshold $t$ , we perform a forward pass using the rewrite model before finetuning on $\mathbf{X}_{train}$ and train a logistic regression model on all loss values. The threshold $t$ can be derived from the weight and the intercept of the logistic regression model. In practice, applying the calibration loss improves detection performance by 4.54% in AUROC among the 21 domains, from 0.8555 to 0.9009.
102
+
103
+ # 4 Dataset
104
+
105
+ Existing detectors are often evaluated on public datasets such as SQuAD (Rajpurkar et al., 2016), XSum (Narayan et al., 2018), and Writing Prompts (Fan et al., 2018) or self-constructed ones. However, these datasets typically represent a narrow subset of available data, both in terms of timeliness and domain coverage. This limitation raises concerns about over-fitting and uncertainty regarding how these detectors would perform when deployed in real-world scenarios, highlighting the necessity in creating a dataset of diversely-distributed texts for training.
106
+
107
+ # 4.1 Data Collection
108
+
109
+ To ensure the robustness and generalizability of our detection model, we construct a dataset consisting of human-written text from 21 distinct domains, including finance, entertainment, cuisine, etc. For each domain, we collect the texts either by crawling online platforms like Wikipedia or by sampling from publicly available datasets. From these collections, we randomly select 200 complete paragraphs as text snippets which yields an average length of 120 words among the samples. For each of the human-written samples, we create four LLM-generated counterparts using four state-of-the-art LLMs: GPT-4o (OpenAI, 2024), GPT-3.5-Turbo (OpenAI, 2020), Gemini 1.5 Pro (Reid et al., 2024), and Llama-3-70B-Instruct (Meta, 2024). The entire process results in a total of 21,000 text samples. Details on data generation are listed in Table 5, and descriptions of the domains and their sources are provided in §A.1.
110
+
111
+ # 4.2 Prompt Diversity
112
+
113
+ Conventionally, LLM-generated text is created by prompting LLMs to either rewrite a given text or continue writing from a given prefix, often using a single, static prompt for the entire process (Mitchell et al., 2023; Bao et al., 2024; Verma et al., 2024; Mao et al., 2024). However, real-world text generation involves a wide variety of prompts, which can significantly alter the distribution of the generated text. Previous work (Mao et al., 2024) has shown that one straightforward way to bypass the RAID detector is by using the prompt "Help me rephrase it, so that another GPT rewriting will cause a lot of modifications", which suggests that data generated by different prompts are different in distribu
114
+
115
+ tion, indicating the importance of prompt diversity. To address this, we curate a dataset of 200 rewrite prompts, each containing slight variations in phrasing and instructions. For each generated text, a prompt is randomly sampled from this dataset. Examples of the prompts we use are provided below:
116
+
117
+ - Refine this for me please:
118
+ - Please rewrite this content in your own words:
119
+ - Make this text more formal and professional:
120
+ - Make this text more casual and friendly:
121
+ - Rephrase this text in a more elaborate way:
122
+ - Reframe this content in a more creative way:
123
+ - Rewrite this text to emphasize the key points:
124
+ - Help me rephrase it, so that another GPT rewriting will cause a lot of modifications:
125
+
126
+ For a RAIDAR detector, training on a diversely-prompted dataset compared with a single-prompted dataset can increase its testing AUROC from 0.7302 to 0.7566 (detailed in A.2). This shows that diverse prompts enables the model to better capture the distribution of LLM texts in the real world, whose generation prompts are expected to vary significantly.
127
+
128
+ # 4.3 Data Cleaning
129
+
130
+ In collecting human-written text, we ensure that no data is generated after November 30, 2022, the release date of ChatGPT (OpenAI, 2020), avoiding contamination of human dataset with LLM-generated content. Instead of manually introducing any truncations, we split all texts into natural paragraphs, yielding an overall average length of 120 words with a standard deviation of 108 words. For LLM-generated text, we carefully remove any extraneous suffixes, such as "Sure, here is a...," to avoid them from being detected in this way.
131
+
132
+ # 5 Evaluation
133
+
134
+ This section answers the following questions:
135
+
136
+ Q1: How does L2R compare with other detectors? (§5.3)
137
+ Q2: How does L2R perform when OOD? (§5.4)
138
+ Q3: How does L2R perform under adversarial attacks? (§5.5)
139
+ Q4: How does L2R's training objective compare with directly training for binary classification? (§5.6)
140
+ Q5: How does training on our proposed dataset contribute to L2R's performance? (§5.7)
141
+
142
+ # 5.1 Experiment Setup
143
+
144
+ We perform all experiments on one NVIDIA A100 GPU with 40GB RAM. We use "meta-Llama/Meta-Llama-3-8B-Instruct" (AI@Meta, 2024) as the open-sourced rewrite model in all experiments. To fine-tune the Llama model with 8B parameters, we employ 4-bit QLoRA (Dettmers et al., 2024), with parameter r set to 16, lora_alpha set to 32, and lora_dropout set to 0.05, unless otherwise noted. We use an initial learning rate of 5e-6, a weight decay of 0.01, and a batch size of 32 to train until convergence. We set the sampling temperature to 0 when using Llama for rewriting during training and detection for deterministic and reproducible results, therefore taking the results from a single run for the experiments. We use $70\%$ of the dataset for training and the rest for testing in all experiments. Training on the 21 domains takes around six GPU hours and rewriting a single text of 120 words takes an average of 13.5 seconds.
145
+
146
+ # 5.2 Baselines
147
+
148
+ Our baseline detectors consist of Fast-DetectGPT (Bao et al., 2024), Ghostbusters (Verma et al., 2024), RAIDAR (Mao et al., 2024), and a custom approach named "Llama Logits", which involves training a Llama-3-8B model together with a classifier (same size as RAIDAR and L2R) on its logits output to perform naive text classification. For Ghostbuster, RAIDAR and Llama Logits, we train and test these detectors on the identical training and testing sets as L2R. For Fast-DetectGPT, we use its local version available at Fast-DetectGPT (2024). For Llama Logits, we train its Llama model using the same QLoRA configurations as the rewrite model in L2R for a fair comparison. We also experiment on using a close-sourced model, Gemini 1.5 Pro (Reid et al., 2024) (referred to as Gemini Rewrite), as the rewrite model for RAIDAR in addition to Llama.
149
+
150
+ # 5.3 Compare L2R with Other Detectors
151
+
152
+ We compare the performance of L2R with Fast-DetectGPT, Ghostbusters, and RAIDAR (Llama Rewrite and Gemini Rewrite), by measuring the Area Under the Receiver Operating Characteristic Curve (AUROC) scores. The resulting scores for each domain along with their average and standard deviation can be found in Table 1. L2R constantly outperforms both configurations of RAIDAR in all domains; outperforms Fast-DetectGPT in 20 of 21 domains by an average of $23.04\%$ in AU-
153
+
154
+ <table><tr><td>Domain</td><td>Fast-DetectGPT</td><td>Ghostbusters</td><td>RAIDAR (Gemini Rewrite)</td><td>RAIDAR (Llama Rewrite)</td><td>Llama L2R</td></tr><tr><td>AcademicResearch</td><td>0.4664</td><td>0.6597</td><td>0.7911</td><td>0.8311</td><td>0.8406</td></tr><tr><td>ArtCulture</td><td>0.6292</td><td>0.6781</td><td>0.7711</td><td>0.6750</td><td>0.8328</td></tr><tr><td>Business</td><td>0.6829</td><td>0.8331</td><td>0.8153</td><td>0.8369</td><td>0.9156</td></tr><tr><td>Code</td><td>0.6808</td><td>0.3770</td><td>0.5670</td><td>0.3840</td><td>0.8383</td></tr><tr><td>EducationalMaterial</td><td>0.7474</td><td>0.8506</td><td>0.9339</td><td>0.9675</td><td>0.9644</td></tr><tr><td>Entertainment</td><td>0.8392</td><td>0.8600</td><td>0.7836</td><td>0.8319</td><td>0.9494</td></tr><tr><td>Environmental</td><td>0.8382</td><td>0.8447</td><td>0.9081</td><td>0.9228</td><td>0.9786</td></tr><tr><td>Finance</td><td>0.6879</td><td>0.7828</td><td>0.6917</td><td>0.8153</td><td>0.9400</td></tr><tr><td>FoodCuisine</td><td>0.7425</td><td>0.6703</td><td>0.7181</td><td>0.7831</td><td>0.9547</td></tr><tr><td>GovernmentPublic</td><td>0.7100</td><td>0.6833</td><td>0.7375</td><td>0.7619</td><td>0.8675</td></tr><tr><td>LegalDocument</td><td>0.8365</td><td>0.5453</td><td>0.5528</td><td>0.6594</td><td>0.7803</td></tr><tr><td>LiteratureCreativeWriting</td><td>0.7928</td><td>0.9456</td><td>0.8056</td><td>0.9161</td><td>0.9294</td></tr><tr><td>MedicalText</td><td>0.5693</td><td>0.6242</td><td>0.7614</td><td>0.7700</td><td>0.7857</td></tr><tr><td>NewsArticle</td><td>0.5808</td><td>0.6800</td><td>0.7714</td><td>0.8547</td><td>0.9242</td></tr><tr><td>OnlineContent</td><td>0.6292</td><td>0.5922</td><td>0.7408</td><td>0.8231</td><td>0.8881</td></tr><tr><td>PersonalCommunication</td><td>0.5392</td><td>0.7042</td><td>0.6783</td><td>0.7233</td><td>0.8239</td></tr><tr><td>ProductReview</td><td>0.6467</td><td>0.7364</td><td>0.7150</td><td>0.8075</td><td>0.9689</td></tr><tr><td>Religious</td><td>0.6314</td><td>0.6111</td><td>0.7772</td><td>0.8397</td><td>0.9775</td></tr><tr><td>Sports</td><td>0.6015</td><td>0.6561</td><td>0.6917</td><td>0.7869</td><td>0.8742</td></tr><tr><td>TechnicalWriting</td><td>0.6075</td><td>0.7242</td><td>0.8269</td><td>0.8575</td><td>0.9369</td></tr><tr><td>TravelTourism</td><td>0.6210</td><td>0.7517</td><td>0.8492</td><td>0.8897</td><td>0.9475</td></tr><tr><td>AVERAGE</td><td>0.6705</td><td>0.7053</td><td>0.7566</td><td>0.7970</td><td>0.9009</td></tr><tr><td>STD</td><td>0.1015</td><td>0.1259</td><td>0.0928</td><td>0.1212</td><td>0.0634</td></tr></table>
155
+
156
+ Table 1: Comparison of detection performance measured with AUROC scores. For Ghostbuster and all rewrite-based detectors, we train a single classifier on the training set of all domains, then test the model's performance on the test set of each individual domain. AVERAGE measures a detector's average performance among all independent domains, and STD measures the standard deviation across domains.
157
+
158
+ ROC; and outperforms Ghostbusters in 20 of 21 domains by an average of $19.56\%$ in AUROC. L2R achieves a $5.62\%$ lower AUROC score than Fast-DetectGPT on legal document domain, and a $1.62\%$ lower AUROC score than Ghostbusters on literature creative writing domain. This may stem from the distinct distributions of these domains: legal documents demand a rigorous writing style, leaving little room for rewriting even with human input, whereas creative writing is more casual, allowing greater rewrite flexibility even for LLM input, thereby making it harder for L2R to distinguish.
159
+
160
+ In general, the fluctuating AUROC scores indicate the challenging nature of our dataset and the diversity and independence of the distributions across domains. These results also show that L2R has better knowledge of the intricate differences between human and LLM-generated text in various domains compared with the baselines, and is thus more capable in the real-world setting.
161
+
162
+ # 5.4 OOD Dataset Evaluation
163
+
164
+ We showed that L2R outperforms the state-of-the-art detectors ID in terms of AUROC scores, but it is equally important to assess its robustness under OOD conditions, as training-based detectors are prone to overfitting to familiar domains and generator models. We first evaluate this by showing its performance on OOD datasets.
165
+
166
+ To assess L2R's performance on OOD data, we adopt the M4 dataset (Wang et al., 2024), an OOD dataset that is different from our training data in multiple dimensions, including data generation models, text length, decoding strategy, and domains. We show a detailed comparison in Table 2.
167
+
168
+ The results of the OOD evaluation are presented in Table 3. We include both ID and OOD results to highlight the degree of overfitting for each detector. While the Llama Logits method achieves the highest ID AUROC, its OOD result is the lowest, indicating significant overfitting to the training data. Similarly, Ghostbuster shows overfitting with its OOD AUROC being roughly half of its ID
169
+
170
+ <table><tr><td>Dataset</td><td>Ours</td><td>M4</td></tr><tr><td>Generator</td><td>GPT-3.5-Turbo, GPT-4o, Llama-3-70B, Gemini 1.5 Pro</td><td>BLOOMz, ChatGPT, Davinci, Cohere, Dolly V2</td></tr><tr><td>Text Length</td><td>Mean: 765 chars, STD: 654 chars</td><td>Mean: 1365 chars, STD: 244 chars</td></tr><tr><td>Decoding Strategy</td><td>Nucleus Sampling, Temperature = 1, top_p = 1</td><td>Varies</td></tr><tr><td>Domains</td><td>21 English domains</td><td>5 English domains</td></tr></table>
171
+
172
+ Table 2: Comparison of characteristics of our dataset and M4 dataset, which we use for OOD evaluation.
173
+
174
+ <table><tr><td>Model</td><td>In-Distribution</td><td>Out-of-Distribution</td></tr><tr><td>Ghostbusters</td><td>0.7053</td><td>0.3888</td></tr><tr><td>Fast-DetectGPT</td><td>0.6705</td><td>0.6408</td></tr><tr><td>Llama Logits</td><td>0.9774</td><td>0.1426</td></tr><tr><td>Llama Logits (Reduced Params)</td><td>0.8016</td><td>0.3450</td></tr><tr><td>Llama Rewrite</td><td>0.7970</td><td>0.6931</td></tr><tr><td>Llama L2R</td><td>0.9009</td><td>0.6561</td></tr><tr><td>Llama L2R (Reduced Params)</td><td>0.8315</td><td>0.7398</td></tr></table>
175
+
176
+ Table 3: ID and OOD performance measured in AUROC scores. For L2R and Llama Logits, the "Reduced Params" models are tuned with approximately 1/4 of the parameters for better generalizability. With reduced parameters, L2R has the highest OOD AUROC, outperforming the naive Llama Rewrite both ID and OOD by $3.45\%$ and $4.67\%$ respectively, suggesting its generalizability through fine-tuning.
177
+
178
+ performance. The naive rewrite-based approach shows superior robustness compared with these other methods, but L2R trained with reduced parameters, i.e. rank $r$ set to 4 and lora_alpha set to 8, outperforms Llama Rewrite by $3.45\%$ ID and $4.67\%$ OOD. This demonstrates that our fine-tuning does not simply overfits the rewrite model to the training data, but enhances its classification performance across diverse distributions.
179
+
180
+ We notice that reducing the number of training parameters makes the model more generalizable, and further investigate the impact of fine-tuning parameters on L2R's performance ID and OOD. By adjusting the LoRA parameters $r$ and lora_alpha, we define four fine-tuning configurations with the number of trainable parameters ranging from 851,968 to 6,815,744, with details listed in §A.3. Figure 3 illustrates the results, where we observe a consistent increase in ID AUROC, accompanied by a decline in OOD AUROC as the number of parameters grows. This suggests that the model becomes increasingly overfitted to the training distribution. L2R either outperforms Llama Logits OOD or both ID and OOD, and all four configurations outperform Ghostbusters and Fast-DetectGPT both ID and OOD. Also, the first two configurations surpass Llama Rewrite in terms of AUROC across both settings.
181
+
182
+ ![](images/ff7a15b796675bec262bd0f8fe94d928e227196b1ae679dbbcef0ed674c538c4.jpg)
183
+ Figure 3: Relationship between the number of trainable parameters and ID and OOD AUROC scores for L2R and RAIDAR. As the number of parameters increase from $1 \times 10^{6}$ to $7 \times 10^{6}$ , both L2R and Llama Logits show higher ID performance and lower OOD performance, showing how the effect of overfitting emerges as we increase the LLM's trainable parameters. However, L2R continuously outperforms Llama Logits either in OOD setting or in both ID and OOD settings, showing the superior robustness and accuracy of L2R.
184
+
185
+ # 5.5 Adversarial Attack
186
+
187
+ We employ two distinct types of attack to assess L2R's robustness against the baseline detectors. For both experiments, we apply the attack to all LLM-generated text in the testing set across all domains, while training L2R and the baselines on the unmodified training set and evaluating it on the modified testing set.
188
+
189
+ # 5.5.1 Decoherence Attack
190
+
191
+ Bao et al. (2024) introduces the decoherence attack where two adjacent, randomly selected words are transposed in all sentences longer than 20 words within a paragraph for LLM texts. Bao et al. (2024) demonstrated that this simple attack can be highly effective in degrading the performance of sate-of-the-art detectors, without affecting the core meaning of the input. We present the results of this attack in Table 4, where L2R achieves the highest AUROC on samples subjected to this attack, indicating its superior robustness compared to other models. This is because our rewrite-based objective function for fine-tuning teaches the model the innate distributions of human and LLM text, in
192
+
193
+ <table><tr><td>Model</td><td>No Attack</td><td>Decoherence Attack</td><td>Rewrite Attack</td></tr><tr><td>Ghostbusters</td><td>0.7053</td><td>0.4730</td><td>0.4061</td></tr><tr><td>Fast-DetectGPT</td><td>0.6705</td><td>0.4984</td><td>0.5100</td></tr><tr><td>Llama Logits</td><td>0.9774</td><td>0.7281</td><td>0.6563</td></tr><tr><td>Llama Rewrite</td><td>0.7970</td><td>0.7681</td><td>0.7944</td></tr><tr><td>Llama L2R</td><td>0.9009</td><td>0.8746</td><td>0.8927</td></tr></table>
194
+
195
+ stead of relying on brittle statistical features that are easily altered through this simple attack.
196
+
197
+ # 5.5.2 Rewrite Attack
198
+
199
+ Previous work finds that paraphrase or rewrite attacks can degrade the performance of LLM-generated content detectors (Lu et al., 2024; Krishna et al., 2023; Mao et al., 2024). Mao et al. (2024) introduces the rewrite attack in which a GPT-3.5-Turbo model is prompted to refine an input paragraph generated by LLMs, in such a way that a subsequent rewrite by another LLM would result in significant changes (e.g., using the prompt "Help me rephrase it, so that another GPT rewriting will cause a lot of modifications"). Mao et al. (2024) showed that this type of attack is effective against RAIDAR and we further show it can affect other types of detectors as well in Table 4, even with our diverse training set. However, L2R still achieves the highest AUROC among all detectors, demonstrating its robustness against this attack. This is because its fine-tuning objective induces a sufficiently large separable gap between rewrites of human and LLM-generated text, allowing adversariably perturbed samples to remain within the LLM distribution. Before attack, the average edit distance is 0.3019 for human rewrites, and 0.1394 for LLM rewrites. After attack, the average edit distance for LLM increases to 0.1614, indicating that the rewrite attack partially shifts the LLM distribution toward the human distribution. However, a clear gap remains between the two, resulting in only a marginal degradation in L2R's classification performance.
200
+
201
+ # 5.6 Compare L2R with Direct Fine-Tuning
202
+
203
+ A valid concern regarding L2R's superior performance is whether it is due to our fine-tuning objective, which enhances model's rewriting ability, or it stems solely from the fact that we exploit the vast parameters of an LLM. To answer this question, we compare L2R with the "Llama Logit" baseline in Table 3 and 4. The Llama Logits detector involves
204
+
205
+ fine-tuning a Llama-3-8B model not for rewrite, but directly for binary classification.
206
+
207
+ In §5.4, we show that despite the Llama Log-its has the highest ID AUROC score among all detectors, surpassing L2R by $7.65\%$ , it has the lowest AUROC when evaluated OOD, up to $51.35\%$ lower than L2R, suggesting that its performance ID is due to overfitting. This highlights the importance of our fine-tuning objective function in ensuring domain-agnostic detection accuracy. Also, the Llama Log-its is inferior under adversarial attacks, with $14.65\%$ and $23.64\%$ lower AUROC for decoherence and rewrite attacks, respectively. This again shows L2R's robustness in capturing the true underlying distributions of human and LLM texts.
208
+
209
+ # 5.7 Effectiveness of the Diverse Dataset
210
+
211
+ While there exists public datasets that emphasize data diversity, including RAID (Dugan et al., 2024), RuTAD (Maloyan et al., 2022), and MAGE (Li et al., 2024), the contribution of our proposed dataset lies in its ability to help train a robust and generalizable L2R model. We show this by training L2R on MAGE using the same number of texts and under the same training configurations, then test its performance ID and OOD on the M4 dataset. We compare the results in Table 5, where the L2R model trained on our dataset has $15.98\%$ higher OOD AUROC, suggesting that the diverse text distributions in our dataset is effective in training a robust and generalizable L2R model.
212
+
213
+ Table 4: Adversarial attack results. While all detectors show performance degradation, L2R has the highest AUROC in both settings, suggesting its robustness.
214
+
215
+ <table><tr><td>Training Dataset</td><td>In-Distribution</td><td>Out-of-Distribution</td></tr><tr><td>MAGE</td><td>0.8333</td><td>0.4963</td></tr><tr><td>Ours</td><td>0.9009</td><td>0.6561</td></tr></table>
216
+
217
+ Table 5: Comparison of L2R's ID and OOD performance when trained on MAGE and our dataset. The superior OOD AUROC from the model trained on our dataset suggests its training effectiveness.
218
+
219
+ # 6 Conclusion
220
+
221
+ We present L2R, a method designed to enhance the detection of LLM-generated text by learning to rewrite more on LLM-generated inputs and less on human-generated inputs. L2R excels in identifying LLM-generated text collected across various models and 21 unique domains, both ID and OOD, and under adversarial attacks. Our work demonstrates that LLMs can be trained to detect text generated by other LLMs, surpassing previous detection methods in accuracy and generalizability.
222
+
223
+ # 7 Limitations
224
+
225
+ A limitation of ours is the relatively slow inference runtime. As most detectors only requires a forward pass from the LLM being used, we need to call generate to create a rewrite. Nevertheless, this problem would be well alleviated considering the rapid improvement in LLM efficiency and computing power.
226
+
227
+ # 8 Acknowledgments
228
+
229
+ We thank Asaf Cidon for supporting Wei Hao's participation in this project. We thank anonymous reviewers for their insightful feedback that helped improve our work.
230
+
231
+ # References
232
+
233
+ Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. 2023. Gpt-4 technical report. arXiv Preprint arXiv:2303.08774.
234
+ AI@Meta. 2024. Llama 3 model card.
235
+ Guangsheng Bao, Yanbin Zhao, Zhiyang Teng, Linyi Yang, and Yue Zhang. 2024. Fast-detectgpt: Efficient zero-shot detection of machine-generated text via conditional probability curvature. In The Twelfth International Conference on Learning Representations.
236
+ 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.
237
+ Canyu Chen and Kai Shu. 2023. Combating misinformation in the age of llms: Opportunities and challenges. AI Magazine.
238
+ Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. 2024. Qlora: Efficient finetuning of quantized lms. Advances in Neural Information Processing Systems, 36.
239
+ Liam Dugan, Alyssa Hwang, Filip Trhlik, Andrew Zhu, Josh Magnus Ludan, Hainiu Xu, Daphne Ippolito, and Chris Callison-Burch. 2024. RAID: A shared benchmark for robust evaluation of machine-generated text detectors. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 12463-12492, Bangkok, Thailand. Association for Computational Linguistics.
240
+ Angela Fan, Mike Lewis, and Yann Dauphin. 2018. Hierarchical neural story generation. In Proceedings
241
+
242
+ of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 889-898.
243
+ Fast-DetectGPT. 2024. GitHub Repository. [link].
244
+ Sebastian Gehrmann, Hendrik Strobelt, and Alexander M Rush. 2019. Gltr: Statistical detection and visualization of generated text. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 111-116.
245
+ Wei Hao, Van Tran, Vincent Rideout, Zixi Wang, AnMei Dasbach-Prisk, M. H. Afifi, Junfeng Yang, Ethan Katz-Bassett, Grant Ho, and Asaf Cidon. 2025. Do spammers dream of electric sheep? characterizing the prevalence of llm-generated malicious emails. In Proceedings of the 25th ACM Internet Measurement Conference, IMC '25, New York, NY, USA. Association for Computing Machinery.
246
+ IMDb. 2024. Imdb non-commercial datasets. https://developer.imdb.com/non-commercial-datasets/.
247
+ Qiao Jin, Bhuwan Dhingra, Zhengping Liu, William Cohen, and Xinghua Lu. 2019. Pubmedqa: A dataset for biomedical research question answering. 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 2567-2577.
248
+ Kalpesh Krishna, Yixiao Song, Marzena Karpinska, John Wieting, and Mohit Iyyer. 2023. Paraphrasing evades detectors of ai-generated text, but retrieval is an effective defense. In Proceedings of the 37th International Conference on Neural Information Processing Systems, NIPS '23, Red Hook, NY, USA. Curran Associates Inc.
249
+ Vladimir I Levenshtein et al. 1966. Binary codes capable of correcting deletions, insertions, and reversals. In Soviet Physics Doklady, volume 10, pages 707-710. Soviet Union.
250
+ Yafu Li, Qintong Li, Leyang Cui, Wei Bi, Zhilin Wang, Longyue Wang, Linyi Yang, Shuming Shi, and Yue Zhang. 2024. Mage: Machine-generated text detection in the wild. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 36-53.
251
+ Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. 2017. Dailydialog: A manually labelled multi-turn dialogue dataset. In Proceedings of The 8th International Joint Conference on Natural Language Processing (IJCNLP 2017).
252
+ Shengchao Liu, Xiaoming Liu, Yichen Wang, Zehua Cheng, Chengzhengxu Li, Zhaohan Zhang, Yu Lan, and Chao Shen. 2024. Does detectgpt fully utilize perturbation? bridging selective perturbation to finetuned contrastive learning detector would be better. In Proceedings of the 62nd Annual Meeting of the
253
+
254
+ Association for Computational Linguistics (Volume 1: Long Papers), pages 1874-1889.
255
+ Xiaoming Liu, Zhaohan Zhang, Yichen Wang, Hang Pu, Yu Lan, and Chao Shen. 2023. Coco: Coherence-enhanced machine-generated text detection under low resource with contrastive learning. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 16167-16188.
256
+ Ning Lu, Shengcai Liu, Rui He, Yew-Soon Ong, Qi Wang, and Ke Tang. 2024. Large language models can be guided to evade AI-generated text detection. Transactions on Machine Learning Research.
257
+ Narek Maloyan, Bulat Nutfullin, and Eugene Ilyshin. 2022. Dialog-22 ruatd generated text detection. In Computational Linguistics and Intellectual Technologies, page 394-401. RSUH.
258
+ Chengzhi Mao, Carl Vondrick, Hao Wang, and Junfeng Yang. 2024. Raidar: Generative ai detection via rewriting. In The Twelfth International Conference on Learning Representations.
259
+ Julian John McAuley and Jure Leskovec. 2013. From amateurs to connoisseurs: Modeling the evolution of user expertise through online reviews. In Proceedings of the 22nd International Conference on World Wide Web, pages 897-908.
260
+ Meta. 2024. Llama 3. https://llama.meta.com/llama3/.
261
+ Eric Mitchell, Yoonho Lee, Alexander Khazatsky, Christopher D Manning, and Chelsea Finn. 2023. Detectgpt: Zero-shot machine-generated text detection using probability curvature. In International Conference on Machine Learning, pages 24950-24962. PMLR.
262
+ Sandra Mitrovic, Davide Andreoletti, and Omran Ayoub. 2023. Chatgpt or human? detect and explain. explaining decisions of machine learning model for detecting short chatgpt-generated text. arXiv Preprint arXiv:2301.13852, abs/2301.13852.
263
+ Edoardo Mosca, Mohamed Hesham Ibrahim Abdalla, Paolo Basso, Margherita Musumeci, and Georg Groh. 2023. Distinguishing fact from fiction: A benchmark dataset for identifying machine-generated scientific papers in the lll era. In Proceedings of the 3rd Workshop on Trustworthy Natural Language Processing (TrustNLP 2023), pages 190-207, Toronto, Canada. Association for Computational Linguistics.
264
+ Gustave Florentin Nkoulou Mvondo, Ben Niu, and Salman Eivazinezhad. 2023. Generative conversational ai and academic integrity: A mixed method investigation to understand the ethical use of llm chatbots in higher education. Available at SSRN 4548263.
265
+ Shashi Narayan, Shay B Cohen, and Mirella Lapata. 2018. Don't give me the details, just the summary!
266
+
267
+ topic-aware convolutional neural networks for extreme summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1797-1807.
268
+ Olympics. 2024. Olympics. https://olympics.com/en/.
269
+ OpenAI. 2020. Chatgpt. https://openai.com/chatgpt.
270
+ OpenAI. 2024. Gpt-4o. https://openai.com/index/hello-gpt-4o/.
271
+ Yikang Pan, Liangming Pan, Wenhu Chen, Preslav Nakov, Min-Yen Kan, and William Yang Wang. 2023. On the risk of misinformation pollution with large language models. In The 2023 Conference on Empirical Methods in Natural Language Processing.
272
+ Jiameng Pu, Zain Sarwar, Sifat Muhammad Abdullah, Abdullah Rehman, Yoonjin Kim, Parantapa Bhattacharya, Mobin Javed, and Bimal Viswanath. 2023. Deepfake text detection: Limitations and opportunities. In 2023 IEEE Symposium on Security and Privacy (SP), pages 1613-1630. IEEE.
273
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9.
274
+ Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. 2023. Direct preference optimization: Your language model is secretly a reward model. In Thirty-seventh Conference on Neural Information Processing Systems.
275
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: $100,000+$ questions for machine comprehension of text. arXiv Preprint arXiv:1606.05250.
276
+ Machel Reid, Nikolay Savinov, Denis Teptyashin, Dmitry Lepikhin, Timothy Lillicrap, Jean-Baptiste Alayrac, Radu Soricut, Angeliki Lazaridou, Orhan Firat, Julian Schrittwieser, et al. 2024. Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context. arXiv Preprint arXiv:2403.05530.
277
+ Jonathan Schler, Moshe Koppel, Shlomo Argamon, and James W Pennebaker. 2006. Effects of age and gender on blogging. In AAAI Spring Symposium: Computational Approaches to Analyzing Weblogs, volume 6, pages 199-205.
278
+ Ilia Shumailov, Zakhar Shumaylov, Yiren Zhao, Yarin Gal, Nicolas Papernot, and Ross Anderson. 2023. The curse of recursion: Training on generated data makes models forget. arXiv Preprint arXiv:2305.17493.
279
+ Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for
280
+
281
+ semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics.
282
+ Irene Solaiman, Miles Brundage, Jack Clark, Amanda Askell, Ariel Herbert-Voss, Jeff Wu, Alec Radford, Gretchen Krueger, Jong Wook Kim, Sarah Kreps, et al. 2019. Release strategies and the social impacts of language models. arXiv Preprint arXiv:1908.09203.
283
+ Daniel Spokoyny, Tanmay Laud, Tom Corringham, and Taylor Berg-Kirkpatrick. 2023. Towards answering climate questionnaires from unstructured climate reports. arXiv Preprint arXiv:2301.04253.
284
+ Jinyan Su, Terry Yue Zhuo, Di Wang, and Preslav Nakov. 2023. Detectllm: Leveraging log rank information for zero-shot detection of machine-generated text. In The 2023 Conference on Empirical Methods in Natural Language Processing.
285
+ Gemini Team, Rohan Anil, Sebastian Borgeaud, Yonghui Wu, Jean-Baptiste Alayrac, Jiahui Yu, Radu Soricut, Johan Schalkwyk, Andrew M Dai, Anja Hauth, et al. 2023. Gemini: A family of highly capable multimodal models. arXiv Preprint arXiv:2312.11805.
286
+ Nandan Thakur, Nils Reimers, Andreas Rückle, Abhishek Srivastava, and Iryna Gurevych. 2021. Beir: A heterogeneous benchmark for zero-shot evaluation of information retrieval models. In Thirty-Fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2).
287
+ Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv Preprint arXiv:2302.13971.
288
+ Vivek Verma, Eve Fleisig, Nicholas Tomlin, and Dan Klein. 2024. Ghostbuster: Detecting text ghostwritten by large language models. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 1702-1717.
289
+ Yuxia Wang, Jonibek Mansurov, Petar Ivanov, Jinyan Su, Artem Shelmanov, Akim Tsvigun, Chenxi Whitehouse, Osama Mohammed Afzal, Tarek Mahmoud, Toru Sasaki, Thomas Arnold, Alham Aji, Nizar Habash, Iryna Gurevych, and Preslav Nakov. 2024. M4: Multi-generator, multi-domain, and multilingual black-box machine-generated text detection. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1369-1407, St. Julian's, Malta. Association for Computational Linguistics.
290
+
291
+ Rowan Zellers, Ari Holtzman, Hannah Rashkin, Yonatan Bisk, Ali Farhadi, Franziska Roesner, and Yejin Choi. 2019. Defending against neural fake news. Advances in Neural Information Processing Systems, 32.
292
+ Yizhou Zhang, Karishma Sharma, Lun Du, and Yan Liu. 2024. Toward mitigating misinformation and social media manipulation in lmm era. In Companion Proceedings of the ACM on Web Conference 2024, pages 1302-1305.
293
+ Lucia Zheng, Neel Guha, Brandon R Anderson, Peter Henderson, and Daniel E Ho. 2021. When does pretraining help? assessing self-supervised learning for law and the casehold dataset of $53,000+$ legal holdings. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Law, pages 159-168.
294
+
295
+ # A Appendix
296
+
297
+ # A.1 Dataset Details
298
+
299
+ Our dataset encompasses 21 independent English domains. Table 6 shows the source and license for each domain. For all domains, we manually verify that no personal or offensive content is included. For domains taken from third-party datasets, we use the data consistent with their intended use (detection of LLM-generated text).
300
+
301
+ # A.2 Effectiveness of the Diverse Prompt in Data Preparation
302
+
303
+ The construction of our dataset involves 200 generation prompts, resembling more real-world use cases compared with traditional evaluation datasets which are usually constrained to one single generation prompt. To prove the superiority of our dataset in training more capable detection models, we create a parallel non-diverse dataset which is created on the same number of domains and source LLMs, but the LLM data is generated only using the prompt "Rewrite this for me please." Then, we train two RAID detectors without finetuning, on the non-diverse dataset, and evaluate it on the diverse dataset. As shown in Table 8, the diverse prompts yields to $2.64\%$ increase in AUROC score if the rewrite model is Gemini 1.5 Pro, and $0.82\%$ increase in AUROC score if the rewrite model is Llama-3 8B. This validates the effectiveness of the diverse prompts we were using, and suggests that such diversity could help the detector to capture more information about real world data distributions.
304
+
305
+ # A.3 LoRA Configurations for Fine-Tuning
306
+
307
+ We leverage QLoRA when fine-tuning L2R and the baselines. Despite the same quantization precision, Table 9 lists the four different LoRA configurations that we use for fine-tuning in §5.4.
308
+
309
+ # A.4 Effectiveness of the Calibration Loss
310
+
311
+ An important contribution of ours that improves the fine-tuning performance is thresholding on the calibration loss, as proposed in §3.4. Without this method, the model tends to overfit during fine-tuning as shown in Figure 4, where the model loss drastically decreases after 1500 steps, resulting in verbose rewrite even for LLM-generated text. We find the overfitting harms L2R's performance from an ablation study on five domains where the AUROC score is only 0.62 after the model overfits.
312
+
313
+ The calibration loss can benefit model learning because the threshold effectively prevents further modification to model weights once an input, labeled either LLM or human, falls in its corresponding distribution already. Since our purpose is simply to draw a boundary rather than separate the distributions as much as possible, halting further weight updates on already correctly classified inputs allows the model to focus parameter updates only on misclassified examples, leading to more efficient and effective convergence. Concretely, applying the calibration loss improves the L2R's performance by $4.54\%$ in AUROC among 21 domains, even comparing to a model tuned without the calibration and before it overfits.
314
+
315
+ ![](images/f32719bf6a639d0162d6bc4e8353e3baea92d4d55b544768fdbc06250ada3b81.jpg)
316
+ Figure 4: Training loss curves for the rewrite model. The orange line plots the loss trained without the calibration method, and the blue line plots the loss trained with calibration. The later one exhibits faster convergence and higher stability than the former one.
317
+
318
+ # A.5 Different Ways to Generate OOD Data
319
+
320
+ There exists a variety of ways to generate OOD data, including using different generation models, decoding strategies, text lengths, and writing styles. While we show how M4, the OOD dataset we use for evaluation, deviates from our training domain in all above aspects in Table2, we conduct two additional ablation studies on how different text length and decoding strategy alone could influence detection performance.
321
+
322
+ We use 200 randomly selected human-written texts from our dataset for both studies. For the study on decoding strategy, we use greedy decoding for GPT and Gemini models and beam search with num_beams $= 5$ for the Llama model during the construction of the LLM-generated counterparts. For the study on text length, we chunk the input texts to an average length of 60. We test different detectors on these two datasets and show results in Table 7, where L2R outperforms the others across both settings. These results further confirm L2R's
323
+
324
+ <table><tr><td>Category</td><td>Source</td><td>License</td></tr><tr><td>AcademicResearch</td><td>Arxiv abstracts (Mao et al., 2024)</td><td>Various CC licenses</td></tr><tr><td>ArtCulture</td><td>Wikipedia</td><td>CC BY-SA</td></tr><tr><td>Business</td><td>Wikipedia</td><td>CC BY-SA</td></tr><tr><td>Code</td><td>Code snippets (Mao et al., 2024)</td><td>MIT</td></tr><tr><td>EducationalMaterial</td><td>Ghostbuster essays (Verma et al., 2024)</td><td>CC BY 3.0</td></tr><tr><td>Entertainment</td><td>IMDb dataset (IMDb, 2024), Stanford SST2 (Socher et al., 2013)</td><td>IMDb terms of use, CC Zero</td></tr><tr><td>Environmental</td><td>Climate-Ins (Spokoyny et al., 2023)</td><td>CC Zero</td></tr><tr><td>Finance</td><td>Hugging Face FIQA (Thakur et al., 2021)</td><td>CC BY-NC</td></tr><tr><td>FoodCuisine</td><td>Kaggle fine food reviews (McAuley and Leskovec, 2013)</td><td>CC Zero</td></tr><tr><td>GovernmentPublic</td><td>Wikipedia</td><td>CC BY-SA</td></tr><tr><td>LegalDocument</td><td>CaseHOLD (Zheng et al., 2021)</td><td>Apache 2.0</td></tr><tr><td>CreativeWriting</td><td>Writing Prompts (Fan et al., 2018)</td><td>MIT</td></tr><tr><td>MedicalText</td><td>PubMedQA (Jin et al., 2019)</td><td>MIT</td></tr><tr><td>NewsArticle</td><td>XSum (Narayan et al., 2018)</td><td>MIT</td></tr><tr><td>OnlineContent</td><td>Hugging Face blog authorship (Schler et al., 2006)</td><td>Non-commercial</td></tr><tr><td>PersonalCommunication</td><td>Hugging Face daily dialogue (Li et al., 2017)</td><td>CC-BY-NC-SA 4.0</td></tr><tr><td>ProductReview</td><td>Yelp reviews (Mao et al., 2024)</td><td>Yelp terms of use</td></tr><tr><td>Religious</td><td>Bible, Buddha, Koran, Meditation, and Mormon</td><td>N/A</td></tr><tr><td>Sports</td><td>Olympics website (Olympics, 2024)</td><td>Olympics terms of use</td></tr><tr><td>TechnicalWriting</td><td>Scientific articles (Mosca et al., 2023)</td><td>CC Zero</td></tr><tr><td>TravelTourism</td><td>Wikipedia</td><td>CC BY-SA</td></tr></table>
325
+
326
+ Table 6: Source and license for each of the 21 domains in our dataset.
327
+
328
+ <table><tr><td>Avg Length</td><td>Decoding Strategy</td><td>Fast-DetectGPT</td><td>RAIDAR</td><td>L2R</td></tr><tr><td>120</td><td>Nucleus Sampling</td><td>0.6833</td><td>0.8186</td><td>0.9213</td></tr><tr><td>60</td><td>Nucleus Sampling</td><td>0.6500</td><td>0.7635</td><td>0.8632</td></tr><tr><td>120</td><td>Greedy Decoding &amp; Beam Search</td><td>0.6897</td><td>0.8009</td><td>0.8750</td></tr></table>
329
+
330
+ Table 7: Comparison of AUROC scores across the three methods under various OOD settings. L2R consistently outperforms the baselines, achieving the highest AUROC in all scenarios.
331
+
332
+ <table><tr><td>Dataset</td><td>Rewrite Model</td><td>AUROC</td></tr><tr><td>Single-Prompt</td><td>Gemini</td><td>0.7302</td></tr><tr><td>Multi-Domain Dataset</td><td>Llama</td><td>0.7888</td></tr><tr><td>Multi-Prompt</td><td>Gemini</td><td>0.7566</td></tr><tr><td>Multi-Domain Dataset</td><td>Llama</td><td>0.7970</td></tr></table>
333
+
334
+ Table 8: Comparison of AUROC scores of the Gemini and Llama rewrite models when trained on non-diverse versus diverse datasets. Incorporating diverse prompting during training leads to improved detection performance for both models on the same diverse test set.
335
+
336
+ <table><tr><td>r</td><td>lora_alpha</td><td>Trainable Parameters</td></tr><tr><td>2</td><td>4</td><td>851,968</td></tr><tr><td>4</td><td>8</td><td>1,703,936</td></tr><tr><td>8</td><td>16</td><td>3,407,872</td></tr><tr><td>16</td><td>32</td><td>6,815,744</td></tr></table>
337
+
338
+ Table 9: Parameter settings for LoRA fine-tuning.
339
+
340
+ robustness against different types of OOD data distributions.
341
+
342
+ # A.6 Rewrite Examples
343
+
344
+ We show the text examples before and after L2R's rewriting, among multiple domains, in Figure 5.
345
+
346
+ <table><tr><td rowspan="2">Academic Research</td><td>INPUT HUMAN
347
+ In recent years, several techniques have been proposed for increasing robustness to adversarial examples --- and yet most of these have been quickly shown to be vulnerable to future attacks. For example, over half of the defenses proposed by papers accepted at ICLR 2018 have already been broken.</td><td>REWRITTEN HUMAN
348
+ Despite recent efforts to increase robustness, most proposed techniques have been quickly shown to be vulnerable to future attacks. For instance, over half of the defenses presented at ICLR 2018 have already been breached.</td></tr><tr><td>INPUT LLAMA-3-70B
349
+ Despite numerous attempts to develop robustness against these threats, most proposed defenses have been rapidly compromised by subsequent attacks. In fact, a staggering 50% of defenses presented at ICLR 2018 have already been breached.</td><td>REWRITTEN LLAMA-3-70B
350
+ Despite numerous attempts to develop robustness against these threats, most proposed defenses have been rapidly compromised by subsequent attacks. In fact, a staggering 50% of defenses presented at ICLR 2018 have already been breached.</td></tr><tr><td rowspan="2">Code
351
+ Indentation
352
+ hidden</td><td>INPUT HUMAN
353
+ def solve(s): fg = 0 idx = 0 new_str = list(s) for i in s: if i.isalpha(): new_str[idx] = i_swapcase() fg = 1 idx += 1 s = &quot;&quot; for i in new_str: s += i if fg == 0: return s[len(s)::-1] return s</td><td>REWRITTEN HUMAN
354
+ def solve(s): result = [] for char in s: if char.isalpha(): result.append(char_swapcase()) else: result.append(char.return &quot;&quot; .join(result) if not any(char.isalpha() for char in s) else &quot;&quot; .join(result)[:-1]</td></tr><tr><td>INPUT GPT-4o
355
+ def solve(s): has_letter = any(char.isalpha() for char in s) if has_letter: return &quot;join(char_swapcase() if char.isalpha() else char for char in s) else: return s[:-1]</td><td>REWRITTEN GPT-4o
356
+ def solve(s): has_letter = any(char.isalpha() for char in s) if has_letter: return &quot; .join(char_swapcase() if char.isalpha() else char for char in s) else: return s[:-1]</td></tr><tr><td rowspan="2">Legal
357
+ Document</td><td>INPUT HUMAN
358
+ This type of information may constitute trade secrets. See G.L.c. 266, §30 (defining &quot;trade secret&quot; as used in G.L.c. 93, §42)</td><td>REWRITTEN HUMAN
359
+ This type of information may constitute trade secrets. Massachusetts General Laws, chapter 266, section 30</td></tr><tr><td>INPUT GEMINI 1.5 PRO
360
+ This type of information, such as customer data and proposals, can be legally protected as trade secrets under Massachusetts law (G.L.c. 266, §30).</td><td>REWRITTEN GEMINI 1.5 PRO
361
+ This type of information, such as customer data and proposals, can be legally protected as trade secrets under Massachusetts law (G.L. c. 266, § 30).</td></tr><tr><td rowspan="2">Creative
362
+ Writing</td><td>INPUT HUMAN
363
+ A voice in the sky will tell you when you&#x27;ve left a place for the last time. You tell your SO goodbye and head out to [location of your choice]. Halfway there you hear &quot;You have visited a location for the last time.&quot; John wrinkled his nose and cleared his throat. Pausing, he put down his briefcase and adjusted his tie. It was a red tie with white stripes. This was one of his favorite ties.</td><td>REWRITTEN HUMAN
364
+ As John bid his SO farewell, he headed out to [location of his choice]. Halfway there, a voice in his mind whispered, &quot;You have visited this place for the last time.&quot; John&#x27;s expression faltered, and he paused to adjust his tie, a favorite red tie with white stripes.</td></tr><tr><td>INPUT LLAMA-3-70B
365
+ As John bid farewell to his partner and headed out to the city, a mysterious voice in the sky announced, &quot;You have visited a location for the last time.&quot; He paused, adjusting his favorite red tie with white stripes, and cleared his throat.</td><td>REWRITTEN LLAMA-3-70B
366
+ As John bid farewell to his partner and stepped out into the city, a mysterious voice in the sky announced, &quot;You have visited a location for the last time.&quot; He paused, adjusting his favorite red tie with white stripes, and cleared his throat.</td></tr></table>
367
+
368
+ Figure 5: Examples of texts in our proposed dataset along with the amount of edits L2R model gives for human and LLM-generated text. Deleted characters are marked in red, inserted characters are in blue, and unmodified characters are in black. The examples demonstrate the diverse domains and source LLMs available in the dataset, as well as L2R's ability in separating human and LLM-generated text via rewriting.
2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:336fe0ba90ac0d5e700de00ed8aeb6f0cf9e39f0f087e726a39bb29091f8971a
3
+ size 1049959
2025/Learning to Rewrite_ Generalized LLM-Generated Text Detection/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/66f11122-2fcc-4faa-9061-ce858a59cc45_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/66f11122-2fcc-4faa-9061-ce858a59cc45_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/66f11122-2fcc-4faa-9061-ce858a59cc45_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb3d07022fb32af83ce7a5eef9ba86a932dadf67508a94fabbd431afdcea3f87
3
+ size 445399
2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/full.md ADDED
@@ -0,0 +1,516 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LegalAgentBench: Evaluating LLM Agents in Legal Domain
2
+
3
+ Haitao Li $^{1*}$ , Junjie Chen $^{1*}$ , Jingli Yang $^{2}$ , Qingyao Ai $^{1}$ , Jia Wei $^{2}$ , Youfeng Liu $^{2}$ , Kai Lin $^{3}$ , Yueyue Wu $^{1}$ , Guozhi Yuan $^{4}$ , Yiran Hu $^{5}$ , Wuyue Wang $^{6}$ , Yiqun Liu $^{1}$ , Minlie Huang $^{1}$
4
+
5
+ $^{1}$ Department of Computer Science and Technology, Tsinghua University, $^{2}$ Zhipu A. Shanghai Amarsoft Enterprise Credit Information Service Co.,Ltd,
6
+
7
+ <sup>4</sup>Central South University, <sup>5</sup>University of Waterloo, <sup>6</sup>University of Notre Dame, liht22@mails.tsinghua.edu.cn
8
+
9
+ # Abstract
10
+
11
+ With the increasing intelligence and autonomy of LLM agents, their potential applications in the legal domain are becoming increasingly apparent. However, existing general-domain benchmarks cannot fully capture the complexity and subtle nuances of real-world judicial cognition and decision-making. Therefore, we propose LegalAgentBench, a comprehensive benchmark specifically designed to evaluate LLM Agents in the Chinese legal domain. LegalAgentBench includes 17 corpora from real-world legal scenarios and provides 37 tools for interacting with external knowledge. We designed a scalable task construction framework and carefully annotated 300 tasks. These tasks span various types, including multi-hop reasoning and writing, and range across different difficulty levels, effectively reflecting the complexity of real-world legal scenarios. Moreover, beyond evaluating final success, LegalAgentBench incorporates keyword analysis during intermediate processes to calculate progress rates, enabling more fine-grained evaluation. We evaluated eight popular LLMs, highlighting the strengths, limitations, and potential areas for improvement of existing models and methods. LegalAgentBench sets a new benchmark for the practical application of LLMs in the legal domain, with its code and data available at https://github.com/CSHaitao/LegalAgentBench.
12
+
13
+ # 1 Introduction
14
+
15
+ Recent advances in large language models (LLMs) have significantly increased the field of artificial intelligence (Achiam et al., 2023; Bai et al., 2023; Touvron et al., 2023). With their expansive neural networks and vast training datasets, LLMs have made remarkable strides in various natural language processing tasks, such as text generation
16
+
17
+ and machine translation (Li et al., 2024e,c; Zhao et al., 2024). At the same time, the rapid evolution of LLMs is transforming the traditional legal industry, empowering legal professionals to handle tasks such as legal research, contract drafting, and case analysis with greater efficiency. As a result, LLMs are rapidly becoming indispensable tools in modern legal workflows (Cui et al., 2023; Li et al., 2024d; Guha et al., 2024; Li et al., 2023).
18
+
19
+ Despite their immense potential, LLMs still face challenges in tackling complex legal issues, as real-world legal tasks often require multistep reasoning and specialized expertise beyond their current capabilities. A promising solution lies in the development of LLM-as-Agent systems (Dorri et al., 2018; Liu et al., 2023b). These agents can engage in step-by-step reasoning and acquire specialized knowledge through iterative interactions with external tools. Their impressive capabilities have attracted significant interest from both academia and industry (Qin et al., 2023; Li et al., 2024a).
20
+
21
+ Although LLM agents show great promise, the lack of standardized benchmarks to evaluate their performance in legal scenarios is a major challenge. Existing frameworks, such as AgentBench (Liu et al., 2023b) and ToolBench (Qin et al., 2023), are effective in assessing LLM agents in general domains. However, the insights gained from these evaluations often have limited relevance in highly specialized fields such as the legal domain (Li et al., 2024d). Moreover, existing datasets in the legal domain often focus on relatively basic tasks, such as legal case retrieval (Li et al., 2024f,b) or judgment prediction (Li et al., 2024d). In contrast, legal practice is significantly more complex, involving in-depth case analysis, legal reasoning, and comprehensive judgments based on a vast body of laws and precedents. Current datasets and evaluation systems fall short of thoroughly testing these advanced, multidimensional legal capabilities.
22
+
23
+ To fill this gap, we developed LegalAgent-
24
+
25
+ Bench, a comprehensive benchmark designed to evaluate the capabilities of LLM agents in the Chinese legal domain. Based on real-world legal needs, it includes 17 specialized corpora and 37 tools to interact with external knowledge. Within this framework, LLM agents coordinate and utilize these tools to address specific legal tasks.
26
+
27
+ LegalAgentBench is highlighted in the following three aspects:
28
+
29
+ - Focus on Authentic Legal Scenarios: LegalAgentBench is the first dataset to evaluate LLM agents in legal scenarios. It requires LLMs to demonstrate a solid understanding of legal principles, enabling them to appropriately select and utilize tools to solve complex legal problems. This represents a significant step forward in advancing the application of LLM agents in legal scenarios.
30
+ - Diverse Task Types and Difficulty Levels: LegalAgentBench adopts a scalable task construction framework aimed at comprehensively covering various task types and difficulty levels. Specifically, we construct a planning tree based on the dependencies between the corpus and tools, and select tasks through hierarchical sampling and a maximum coverage strategy. Finally, we constructed 300 distinct tasks, including multi-hop reasoning and writing tasks, to comprehensively evaluate the LLM's capabilities.
31
+ - Fine-Grained Evaluation Metrics: Rather than relying solely on final success rates as evaluation criteria, LegalAgentBench introduces the process rate through the annotation of intermediate steps, enabling fine-grained evaluation. This approach provides deeper insights into an agent's capabilities and identifies areas for improvement beyond the final result.
32
+
33
+ We evaluated a variety of commercial and open-source LLM agents, identifying several potential weaknesses in their current capabilities. These observations provide valuable insights, inspire new ideas, and pinpoint areas for further research and improvement.
34
+
35
+ # 2 Related Work
36
+
37
+ # 2.1 LLM Agents
38
+
39
+ Recently, large language models (LLMs) have achieved significant advancements in their applica
40
+
41
+ tion as intelligent agents. Leveraging the capabilities in natural language understanding and generation, LLM agents can efficiently solve complex tasks by appropriately invoking external tools such as calculators, search engines, and domain-specific APIs (Yao et al.; Wang et al., 2024, 2023; Shinn et al., 2024; Chu et al., 2024).
42
+
43
+ When faced with complex tasks, LLM agents need to devise appropriate plans and strategies to ensure efficient execution. Chain-of-Thought (CoT) (Wei et al., 2022) reasoning, a pioneering technique in this domain, enhances the reasoning capabilities of agents by decomposing challenging reasoning tasks into smaller, more manageable steps. Building upon this foundation, a series of advanced reasoning strategies have emerged, offering new perspectives for task planning and problem-solving. For instance, ReAct (Yao et al.) decouples reasoning and action, alternating between thinking steps and action steps, thereby significantly improving the planning efficiency for complex tasks.
44
+
45
+ Furthermore, the capabilities of LLM agents are further enhanced through deep integration with external tools. Methods such as HuggingGPT (Shen et al., 2024) exemplify this approach by positioning LLMs as controllers that decompose complex tasks into subtasks, invoke appropriate specialized models, and integrate the results to produce a final response. The LLM+P (Liu et al., 2023a) approach combines LLMs with a symbolic planner based on the Planning Domain Definition Language (PDDL), leveraging LLMs to formulate problems in PDDL syntax and employing a planning solver to generate solutions.
46
+
47
+ # 2.2 Benchmarks on LLM Agents
48
+
49
+ With the rapid advancement of LLM agents, the demand for evaluating their reasoning and decision-making capabilities in complex tasks has grown significantly. Numerous benchmarks have been developed, providing essential references for the systematic study of LLM agents (Liu et al., 2023b; Zhuang et al., 2023; Ye et al., 2024; Yao et al., 2024; Huang et al., 2023; Xie et al., 2023).
50
+
51
+ AgentBench (Liu et al., 2023b) is a multidimensional benchmark platform that spans eight distinct environments, including operating systems, databases, and knowledge graphs. It systematically evaluates the performance of LLM agents in multi-turn open-ended generation settings. AgentBoard (Ma et al., 2024) focuses on the systematic evaluation of LLMs in multi-turn interactions.
52
+
53
+ It introduces fine-grained progress rate metrics and multidimensional analysis tools to comprehensively assess LLMs' multitasking capabilities in partially observable environments, offering a scientific framework for evaluating interactive LLM performance. ToolQA (Zhuang et al., 2023) covers eight domains and 13 tools, with tasks specifically designed to require external tools and reference materials for problem-solving. This avoids reliance solely on the model's internal knowledge, establishing a new benchmark for assessing LLMs' tool-using abilities. T-Eval (Chen et al., 2024) decomposes the tool utilization abilities of LLMs into six dimensions: planning, reasoning, retrieval, understanding, instruction execution, and result evaluation. This framework comprehensively measures LLMs' performance in using external tools across multiple levels.
54
+
55
+ These benchmarks provide diverse tools for exploring the capability boundaries of LLM agents. However, they primarily focus on evaluating LLMs in general domains, lacking systematic guidance and targeted frameworks for vertical domains such as law and medicine. To address this gap, this paper introduces a dataset specifically designed to evaluate LLM agents in the legal domain, offering valuable insights and support for research and practice.
56
+
57
+ # 3 LegalAgentBench
58
+
59
+ # 3.1 Overview
60
+
61
+ LegalAgentBench consists of three key components: the environment, tools, and tasks. LLM agents rely on these tools to interact with the environment and tackle specific tasks. We define the environment as a text-based corpora, where both the observation and action spaces are represented in natural language. Specifically, the environment consists of 17 distinct corpora, 14 of which are tabular databases for lookup, while 3 are document collections for retrieval. To facilitate interaction with the environment, we provide 37 specialized tools for tasks such as text retrieval, database operations, and mathematical computations.
62
+
63
+ In addition, LegalAgentBench includes 300 tasks of varying difficulty levels and types. Figure 1 illustrates a task example. The key_answer represents the keywords in the answer, used to evaluate the success rate of the final result. The key_middle refers to the keywords in the intermediate steps of solving the task, providing a more granular eval
64
+
65
+ - Query: I would like detailed information about the court system in Beijing. Could you please tell me which courts are located in the area where the Beijing First Intermediate People's Court is situated?
66
+ - Answer: The Beijing First Intermediate People's Court and the Beijing Shijingshan District People's Court are located in this area.
67
+ Key_answer: ["Beijing First Intermediate People's Court", "Beijing Shijingshan District People's Court"]
68
+ Key_middle :["Shijingshan District, Beijing"]
69
+ - Path: get courthouse_info----get courthouse_info_list
70
+
71
+ Figure 1: A task example in LegalAgentBench (translated from Chinese).
72
+
73
+ uation. These keywords are derived from the observations returned by successful tool calls. The Path refers to the correct solution path for solving the task. A longer path signifies a higher level of difficulty associated with the task.
74
+
75
+ Upon receiving the task, the LLM agent gradually selects the appropriate tools and obtains corresponding feedback. After receiving feedback, the LLM agent updates its internal state based on the observation and then determines the next action. The agent's actions typically involve selecting the appropriate tool and inputting the necessary parameters, or adjusting the query strategy based on the feedback. Each action generates a new observation, and this cycle continues until the agent completes the task or reaches the predefined termination condition.
76
+
77
+ # 3.2 Corpora and Tools
78
+
79
+ In LegalAgentBench, we developed 17 real-world datasets, including 14 tabular databases designed for lookups and 3 document repositories intended for retrieving relevant information. Table 1 presents the basic information and a brief overview of these corpora. More details can be found in Appendix B.
80
+
81
+ Specifically, we gather publicly available real-world data, encompassing information about courts, law firms, listed companies, and their associated legal cases. Additionally, we compile legal knowledge, articles, and guiding cases to create comprehensive and searchable corpora. These corpora are sourced from real-world scenarios and can evolve over time, mitigating the risk of LLM overfitting. Due to the sensitivity of the legal domain, we discuss the license and ethical considerations in Appendix A.
82
+
83
+ To obtain information from these reference corpora, we designed 37 tools that are available to the LLM Agents. These tools are primarily divided into the following categories:
84
+
85
+ <table><tr><td>ID</td><td>Corpus</td><td>Format</td><td>Size</td><td>Brief overview</td></tr><tr><td>1</td><td>CompanyInfo</td><td>Tabular Database</td><td>695</td><td>Basic information of listed companies</td></tr><tr><td>2</td><td>CompanyRegister</td><td>Tabular Database</td><td>10,125</td><td>Registration information of listed companies</td></tr><tr><td>3</td><td>SubCompanyInfo</td><td>Tabular Database</td><td>9,433</td><td>Investment information of listed companies</td></tr><tr><td>4</td><td>LegalDoc</td><td>Tabular Database</td><td>24,372</td><td>Legal cases involving listed companies</td></tr><tr><td>5</td><td>LegalAbstract</td><td>Tabular Database</td><td>1,200</td><td>Summary information of legal cases</td></tr><tr><td>6</td><td>CourtInfo</td><td>Tabular Database</td><td>3,413</td><td>Basic information of courts</td></tr><tr><td>7</td><td>CourtCode</td><td>Tabular Database</td><td>3,348</td><td>Levels and administrative division codes of courts</td></tr><tr><td>8</td><td>LawfirmInfo</td><td>Tabular Database</td><td>4,768</td><td>Basic information of law firms</td></tr><tr><td>9</td><td>LawfirmLog</td><td>Tabular Database</td><td>101</td><td>Service information of law firms</td></tr><tr><td>10</td><td>AddrInfo</td><td>Tabular Database</td><td>19,533</td><td>Province, city, and district corresponding to the address</td></tr><tr><td>11</td><td>RestrictionCase</td><td>Tabular Database</td><td>46</td><td>Cases involving restrictions on high consumption</td></tr><tr><td>12</td><td>FinalizedCase</td><td>Tabular Database</td><td>119</td><td>Cases closed upon final enforcement</td></tr><tr><td>13</td><td>DishonestyCase</td><td>Tabular Database</td><td>13</td><td>Cases involving dishonest judgment debtors</td></tr><tr><td>14</td><td>AdministrativeCase</td><td>Tabular Database</td><td>443</td><td>Cases involving administrative penalty</td></tr><tr><td>15</td><td>LegalKonnowledge</td><td>Retrieval Corpus</td><td>26,951</td><td>Knowledge from legal books</td></tr><tr><td>16</td><td>LegalArticle</td><td>Retrieval Corpus</td><td>55,347</td><td>Legislatively enacted legal articles</td></tr><tr><td>17</td><td>LegalCases</td><td>Retrieval Corpus</td><td>2,370</td><td>Officially published guiding cases</td></tr></table>
86
+
87
+ Table 1: Basic information of the corpora.
88
+
89
+ - Text Retrievers: These tools are responsible for retrieving content relevant to a given query from document repositories. We use Embedding-3 as the default retriever. Additionally, users can integrate more advanced retrieval models to further improve query results. LegalAgentBench includes three text retrievers. For each retriever, the LLM can use the Number parameter to specify the number of relevant documents to be returned.
90
+ - Mathematical Tools: These tools perform basic arithmetic operations such as addition, subtraction, multiplication, and division. Additionally, they can handle more complex tasks like sorting data, and computing maximum or minimum values. There are five mathematical tools in LegalAgentBench.
91
+ - Database Tools: These tools interact with specific databases to extract content from particular columns based on predefined queries. They allow the LLM agents to access structured data, providing tailored responses that match the criteria defined in the query. There are 28 database tools in LegalAgentBench. For each Database Tool, the LLM can use the parameter Column to control the attributes returned from the corresponding tabular database.
92
+ - System Tools: The System tool currently only includes Finish, which parses the execution feedback and returns the answer to complete the task.
93
+
94
+ Due to space constraints, detailed descriptions of each tool, including their inputs, outputs, and usage examples, are provided in Appendix C.
95
+
96
+ # 3.3 Tasks
97
+
98
+ # 3.3.1 Task Definition
99
+
100
+ LegalAgentBench employs a unified framework to standardize all tasks, offering a formalized definition of the agent's interaction process in legal scenarios. At each time step $t$ , the agent performs an action $a_{t}$ , receives an observation $o_{t}$ , and updates its current state $s_{t}$ accordingly. This iterative process continues until the task is successfully completed or the maximum iteration limit $T$ is reached.
101
+
102
+ $s_t$ represents the agent's perceptual state at time $t$ , encompassing the acquired contextual information and the environmental state. The state $s_t$ is updated according to the following formula:
103
+
104
+ $$
105
+ s _ {t + 1} = u \left(s _ {t}, a _ {t}, o _ {t}\right),
106
+ $$
107
+
108
+ where $u$ is the state update function, responsible for integrating the agent's actions and feedback into a new perceptual state.
109
+
110
+ $a_{t}$ represents the specific action taken by the agent in the state $s_t$ , including tool invocation or information generation. The action $a_{t}$ is determined by the state $s_t$ and the sequence of past observations.
111
+
112
+ $$
113
+ a _ {t} = \pi (s _ {t}, o _ {1}, o _ {2},.., o _ {t - 1}),
114
+ $$
115
+
116
+ where $\pi$ is the agent's decision-making policy.
117
+
118
+ $o_{t}$ is the feedback information received by the agent after invoking a tool, including successful results or error messages.
119
+
120
+ $$
121
+ o _ {t} = f (a _ {t})
122
+ $$
123
+
124
+ Here, $f$ is the feedback function. If $a_{t}$ is a valid action, it returns the result of the operation; otherwise, it returns an error message.
125
+
126
+ ![](images/91e356078b04043408e754587f3bd75012cdbdeade008ff462326ad6d381e964.jpg)
127
+ Figure 2: The overview of the task construction process in LegalAgentBench.
128
+
129
+ # 3.3.2 Task Construction
130
+
131
+ During the task generation phase, our primary goal is to leverage corpus and tools to construct a diverse set of questions. The core principle is to ensure that tasks encompass a wide range of difficulty levels and types, enabling a comprehensive evaluation. In this section, we propose a scalable task construction process that can be extended to incorporate new knowledge bases and tools. The entire process is illustrated in Figure 2.
132
+
133
+ Planning Tree Construction: To better organize and structure the task, we first construct a planning tree based on the call relationships between the available tools. The root node of the tree represents the unknown entity, which typically corresponds to the starting point of the task. Each branch of the tree corresponds to a tool that can be utilized by the entity, while the child nodes contain the information obtained after invoking these tools. For each child node, subsequent tools may be called progressively, forming deeper branches. In this planning tree, each path represents a potential solution pathway, and the information at the leaf nodes corresponds to the final requirements of the task.
134
+
135
+ **Path Selection:** We select different paths from the planning tree to construct tasks that cover a variety of types and difficulty levels. In the planning tree, the depth of each branch represents the complexity of the task solution, while the breadth of all branches reflects the diversity of task types. Therefore, we extract solution paths layer by layer to ensure coverage of different difficulty levels. Moreover, we minimize overlap between solution paths for tasks of different difficulty levels, expanding the coverage of all branches to encompass a broader range of task types. We ultimately developed serial solution paths ranging from 1-hop to 5-hop.
136
+
137
+ In addition to using tools sequentially, our solu
138
+
139
+ tion paths also incorporate the parallel use of tools. We introduce the task of writing a defense document as a typical example. In this scenario, the LLM must query basic information about the plaintiff, defendant, and their lawyer based on a template, while simultaneously retrieving fundamental legal knowledge and relevant articles to formulate a defense against the complaint. In Appendix D, we provide examples for better understanding.
140
+
141
+ Entity Selection: After determining the solution path, we select entities to formulate the complete question. It is important to note that not all initial entities can complete the intended solution path, as there may be cases where the tool call returns no result. To address this issue, we iterate through all possible entities and select two successfully executed entities for each path.
142
+
143
+ Question Rewriting: After the above steps, we obtain the appropriate entities and can automatically generate multi-hop questions such as "What is entity<sub>3</sub> of entity<sub>2</sub> of entity<sub>1</sub>?" However, this type of question not only deviates from actual usage habits but also directly exposes the solution path to the model. To better align with real-world scenarios and obscure the solution path, we rephrase the questions using GPT-4 to make them more flexible and in line with human needs. The specific prompt can be found in Appendix D.
144
+
145
+ Answers Generation: For each question, since the entities and the toolchain used in the solution path are known, we can programmatically extract the answer from the reference corpora through the appropriate parameterized toolchain. This enables the automatic generation of correct answers, even for complex multi-hop reasoning tasks.
146
+
147
+ Human Verification: We manually validate all questions, solution paths, and answers in the tasks. This involves revising incompatible queries and tools, refining questions that deviate from everyday
148
+
149
+ <table><tr><td>Attribute</td><td>1-hop</td><td>2-hop</td><td>3-hop</td><td>4-hop</td><td>5-hop</td><td>Writing</td><td>ALL</td></tr><tr><td># Task</td><td>80</td><td>80</td><td>60</td><td>40</td><td>20</td><td>20</td><td>300</td></tr><tr><td>Avg. length per query</td><td>88.29</td><td>87.90</td><td>99.37</td><td>118.33</td><td>110.25</td><td>1059.95</td><td>160.65</td></tr><tr><td>Avg. length per answer</td><td>74.20</td><td>40.84</td><td>45.53</td><td>63.48</td><td>86.20</td><td>678.75</td><td>99.24</td></tr><tr><td># Avg. key_answer per query</td><td>1.88</td><td>1.44</td><td>1.20</td><td>1.40</td><td>2.25</td><td>10.25</td><td>2.14</td></tr><tr><td>Avg. length of key_answer</td><td>10.59</td><td>5.94</td><td>6.07</td><td>6.59</td><td>6.93</td><td>12.58</td><td>9.28</td></tr><tr><td># Avg. key_middle per query</td><td>0.13</td><td>1.45</td><td>2.87</td><td>4.78</td><td>5.60</td><td>6.20</td><td>2.42</td></tr><tr><td>Avg. length of key_middle</td><td>9.20</td><td>9.72</td><td>10.95</td><td>11.35</td><td>11.25</td><td>7.21</td><td>10.24</td></tr></table>
150
+
151
+ Table 2: Detailed Statistics of LegalAgentBench Tasks.
152
+
153
+ usage, and addressing queries related to specialized tools. Detailed guidelines for the validation process are provided in Appendix G.
154
+
155
+ # 3.3.3 Task Evaluation
156
+
157
+ Given the high accuracy requirements in the legal domain, we primarily evaluate performance using keyword matching to calculate the success rate. Specifically, we extract keywords from tool call results and record them as key_answer. The overlap between the agent's output and these keywords serves as a measure of its capabilities.
158
+
159
+ However, relying solely on the success rate fails to capture subtle differences, as it cannot distinguish between tasks that are nearly completed and those that are unfinished. To address this issue, we provide keywords not only for the final answers but also for the intermediate solution steps. Using these keywords, we calculate the progress rate, enabling a more fine-grained evaluation of the agent's performance at various stages of task completion. We provide the detailed calculation for the success rate and progress rate in Appendix E.
160
+
161
+ # 3.3.4 Task Statistics
162
+
163
+ After careful human verification, LegalAgentBench includes a total of 300 tasks across 6 different types. Table 2 presents the detailed statistics of the tasks. Overall, LegalAgentBench has a well-balanced distribution of difficulty and task types, making it an effective tool for evaluating the capabilities of agents in the legal domain.
164
+
165
+ # 4 Experiment
166
+
167
+ # 4.1 Experiment Setup
168
+
169
+ # 4.1.1 Baselines
170
+
171
+ We evaluated eight well-known LLMs on LegalAgentBench: GLM-4 (GLM et al., 2024), GLM4-Plus (GLM et al., 2024), LLaMA3.1-8B-instruct (Touvron et al., 2023), Qwen-max (Bai et al., 2023), Claude-sonnet (claude-3-5-sonnet20241022), GPT-3.5 (gpt-3.5-turbo-1106), GPT4o-mini (gpt-4o-mini-2024-07-18), and GPT-4o
172
+
173
+ (gpt-4o-2024-08-06). Except for LLaMA3.1-8B-Instruct, other LLMs are evaluated through API calls. To ensure the reproducibility of the results, we set the temperature for all LLMs to 0.
174
+
175
+ For each LLM, we implemented three different methods. 1) Plan-and-Solve (Wang et al., 2023): Outline a complete plan and execute it step by step. 2) Plan-and-Execute (Topsakal and Akinci, 2023): Develop a multi-step plan and complete it sequentially. After completing a task, the LLM can reassess the plan and make appropriate adjustments. 3) ReAct (Yao et al.): Perform reasoning incrementally through the "thought-action-observation" process, integrating reasoning and tool usage.
176
+
177
+ When given a task, the model first determines which tools are needed, and then uses the selected tools to gradually solve the task. When the LLM outputs Finish or reaches the maximum iteration limit $T = 10$ , it summarizes the current trajectory and provides the final answer. We included three examples for each process to guide the model in using the tools and following the specified output format. Additional implementation details are available in Appendix E.
178
+
179
+ # 4.1.2 Metrics
180
+
181
+ We apply three evaluation metrics, Success Rate, Process Rate, and BERT-Score (Zhang et al., 2019), to comprehensively evaluate the performance. Specifically, the success rate calculates the proportion of key_answer elements included in the LLM's answer. The process rate further incorporates key_middle, measuring the ratio of key_middle and key_answer elements present in the answer. Moreover, BERTScore is applied to compute the textual similarity between the generated answer and the reference answer, thus assessing the quality and accuracy of the output. In addition to these metrics, we also report the number of tokens consumed by the LLMs as a reference for efficiency. Due to space limitations, we report only the success rate in the main result. More results can be found in the Appendix F.
182
+
183
+ <table><tr><td>Model</td><td>Method</td><td>1-hop</td><td>2-hop</td><td>3-hop</td><td>4-hop</td><td>5-hop</td><td>Writing</td><td>ALL</td><td>Tokens</td></tr><tr><td rowspan="3">GLM-4</td><td>P-S</td><td>0.7588</td><td>0.4229</td><td>0.1806</td><td>0.3708</td><td>0.1750</td><td>0.5778</td><td>0.4509</td><td>5,100,468</td></tr><tr><td>P-E</td><td>0.7838</td><td>0.4042</td><td>0.2056</td><td>0.3083</td><td>0.1600</td><td>0.5469</td><td>0.4461</td><td>9,849,924</td></tr><tr><td>ReAct</td><td>0.8787</td><td>0.6771</td><td>0.4167</td><td>0.3875</td><td>0.2433</td><td>0.5937</td><td>0.6057</td><td>11,920,863</td></tr><tr><td rowspan="3">GLM-4-Plus</td><td>P-S</td><td>0.8519</td><td>0.4667</td><td>0.4167</td><td>0.3583</td><td>0.1167</td><td>0.7522</td><td>0.5406</td><td>5,657,827</td></tr><tr><td>P-E</td><td>0.8419</td><td>0.5000</td><td>0.3667</td><td>0.3458</td><td>0.1167</td><td>0.7679</td><td>0.5363</td><td>9,422,692</td></tr><tr><td>ReAct</td><td>0.9131</td><td>0.8104</td><td>0.6417</td><td>0.6167</td><td>0.4300</td><td>0.7659</td><td>0.7499</td><td>11,739,861</td></tr><tr><td rowspan="3">LLaMa3.1-8B</td><td>P-S</td><td>0.3406</td><td>0.1333</td><td>0.0333</td><td>0.0375</td><td>0.1083</td><td>0.2382</td><td>0.1612</td><td>9,279,701</td></tr><tr><td>P-E</td><td>0.3510</td><td>0.1042</td><td>0.0250</td><td>0.0500</td><td>0.0667</td><td>0.3484</td><td>0.1607</td><td>13,649,741</td></tr><tr><td>ReAct</td><td>0.6019</td><td>0.1542</td><td>0.0750</td><td>0.0708</td><td>0.0600</td><td>0.0872</td><td>0.2359</td><td>50,661,127</td></tr><tr><td rowspan="3">Qwen-max</td><td>P-S</td><td>0.8469</td><td>0.4958</td><td>0.4083</td><td>0.3792</td><td>0.2333</td><td>0.4836</td><td>0.5381</td><td>4,800,345</td></tr><tr><td>P-E</td><td>0.8594</td><td>0.5896</td><td>0.3583</td><td>0.4083</td><td>0.3017</td><td>0.5539</td><td>0.5695</td><td>9,884,307</td></tr><tr><td>ReAct</td><td>0.9062</td><td>0.7917</td><td>0.6333</td><td>0.5833</td><td>0.6083</td><td>0.6662</td><td>0.7422</td><td>11,473,873</td></tr><tr><td rowspan="3">Claude-sonnet</td><td>P-S</td><td>0.8137</td><td>0.6354</td><td>0.4833</td><td>0.3750</td><td>0.2400</td><td>0.8395</td><td>0.6051</td><td>7,100,962</td></tr><tr><td>P-E</td><td>0.8700</td><td>0.6771</td><td>0.5333</td><td>0.4667</td><td>0.4717</td><td>0.8610</td><td>0.6703</td><td>13,566,119</td></tr><tr><td>ReAct</td><td>0.8950</td><td>0.6979</td><td>0.4750</td><td>0.4792</td><td>0.4567</td><td>0.6567</td><td>0.6579</td><td>32,878,858</td></tr><tr><td rowspan="3">GPT-3.5</td><td>P-S</td><td>0.4906</td><td>0.2396</td><td>0.0500</td><td>0.1000</td><td>0.0667</td><td>0.0333</td><td>0.2247</td><td>5,007,391</td></tr><tr><td>P-E</td><td>0.4906</td><td>0.2062</td><td>0.0667</td><td>0.0625</td><td>0.0500</td><td>0.0405</td><td>0.2135</td><td>9,597,807</td></tr><tr><td>ReAct</td><td>0.6421</td><td>0.2854</td><td>0.1167</td><td>0.1000</td><td>0.1333</td><td>0.0852</td><td>0.2986</td><td>11,357,664</td></tr><tr><td rowspan="3">GPT-4o-mini</td><td>P-S</td><td>0.7117</td><td>0.3375</td><td>0.2750</td><td>0.2583</td><td>0.1250</td><td>0.6314</td><td>0.4196</td><td>5,482,556</td></tr><tr><td>P-E</td><td>0.7444</td><td>0.3771</td><td>0.3250</td><td>0.2417</td><td>0.1417</td><td>0.6681</td><td>0.4503</td><td>10,861,492</td></tr><tr><td>ReAct</td><td>0.9333</td><td>0.6500</td><td>0.4000</td><td>0.4208</td><td>0.2583</td><td>0.6087</td><td>0.6161</td><td>13,332,418</td></tr><tr><td rowspan="3">GPT-4o</td><td>P-S</td><td>0.7856</td><td>0.4437</td><td>0.2750</td><td>0.1875</td><td>0.2250</td><td>0.7971</td><td>0.4760</td><td>4,153,333</td></tr><tr><td>P-E</td><td>0.8106</td><td>0.3979</td><td>0.3167</td><td>0.2167</td><td>0.2767</td><td>0.8643</td><td>0.4906</td><td>7,261,238</td></tr><tr><td>ReAct</td><td>0.9262</td><td>0.8396</td><td>0.7500</td><td>0.6417</td><td>0.6117</td><td>0.6541</td><td>0.7908</td><td>11,206,957</td></tr></table>
184
+
185
+ Table 3: The success rate of different baselines on LegalAgentBench. P-S represents the Plan-and-Solve method, and P-E represents the Plan-and-Execute method. The best results are highlighted in bold.
186
+
187
+ # 4.2 Main Results
188
+
189
+ The performance comparison between different LLMs and baselines on LegalAgentBench is shown in Table 3. More experimental results can be found in Appendix F. Based on the experimental results, we draw the following observations.
190
+
191
+ - Comparing Different LLMs. In experiments across different LLMs, GPT-3.5 and LLaMA3.1-8B demonstrated poor performance, with success rates on LegalAgentBench below $30\%$ . This may stem from their limited ability to effectively use tools, restricting their problem-solving capacity in complex legal tasks. GLM4, GLM4-Plus, Qwen-Max, and GPT-4o-mini consumed tokens at similar levels. However, GLM4-Plus and Qwen-Max demonstrated superior performance. Claude-Sonnet also achieved competitive results, delivering the best performance under both P-S and P-E methods. However, it often required more tokens compared to other LLMs. Under the ReAct method, GPT-4o achieved the best performance with relatively fewer tokens, reaching a success rate of $79.08\%$ . Overall, LegalAgentBench effectively differentiates the capabilities of these two models.
192
+
193
+ ties of various LLMs, with those demonstrating stronger tool usage and logical reasoning achieving superior performance.
194
+
195
+ - Comparing different methods. By comparing different methods, we found that ReAct typically produces better results for multi-hop questions. However, this advantage comes with higher token consumption, suggesting that allowing more time for reasoning could improve performance. Additionally, we found that when LLMs are limited in capability, the P-E method doesn't always outperform P-S. LLMs like GLM-4, LLaMa3.1-8B, and GPT-3.5 show similar trends. This may be due to plan updates increasing the context length, which reduces the effectiveness of the attention mechanism. The performance gap between different reasoning methods for the same LLM can reach $65\%$ , emphasizing that effective methods better utilize the LLM's potential. Additionally, when designing effective reasoning methods, it is also crucial to balance model capability, reasoning time, and token consumption.
196
+
197
+ - Comparing different types of queries. As shown in Table 3, for multi-hop questions, all
198
+
199
+ belines showed decreased performance as the number of hops increased. The best performance achieved $93\%$ success on the 1-hop question, but only $61\%$ on the 5-hop question. This indicates that the questions in LegalAgentBench cover a wide range of difficulty levels. For the Writing task, we observed that ReAct performed poorly compared to other methods. We believe this may be due to the step-by-step update mechanism, which repeatedly attempts to solve individual steps when errors occur. In tasks like writing, which require parallel processing, this approach may overlook other potential paths that could lead to other answers. This also highlights that the diverse types of questions in LegalAgent-Bench effectively assess the potential of different methods.
200
+
201
+ # 4.3 Analysis
202
+
203
+ In this section, we analyze the unique challenges faced by LLM agents in LegalAgentBench and the potential improvements.
204
+
205
+ Lack of specialized legal knowledge. The terminology and concepts in the legal domain are highly specialized, and without sufficient legal knowledge, LLMs may struggle to generate accurate reasoning paths. For example, LMs often fail to distinguish between filing time and trial time or to interpret the specific meanings of different parts of a case number, all of which are crucial for arriving at the correct answer. Although we have provided a legal knowledge corpora, in practice, we find that LLMs often fail to recognize the necessity of consulting relevant legal knowledge. When handling legal issues, LLMs tend to rely on existing patterns and linguistic knowledge, overlooking the precision and details required in the legal domain. In the future, legal knowledge should be integrated into LLMs more systematically and in-depth to ensure accuracy and reliability in complex legal contexts. Moreover, LLMs should also intelligently recognize when to access external legal databases, enabling more flexible and accurate decision-making.
206
+
207
+ Insufficient understanding of legal articles and case law. The resolution of some legal issues relies on articles and case law, but LLMs may have significant limitations in this regard. During reasoning, LLMs often struggle to accurately interpret the scope and logic of legal articles. Even when retrievers successfully identify relevant articles and cases, LLMs may still encounter diffic
208
+
209
+ culties in understanding the judicial interpretations and practical applications of these referenced materials, especially in complex legal scenarios. In the future, to enhance the effectiveness of LLMs in the legal domain, it is essential to strengthen their ability to deeply understand and apply legal articles and cases.
210
+
211
+ Other Error Types In addition to the above challenges, LLM agents commonly encounter the following errors on LegalAgentBench: 1) Argument Errors: LLM agents fail to provide the correct argument when invoking tools. 2) Planning Errors: LLM agents generate incorrect planning paths or use inappropriate tools due to hallucinations or insufficient knowledge. 3) Exceeding Length Limitations: The encoded interaction history, observations, and tool usage plans exceed the length limit, preventing the LLM agents from resolving the task. 4) Getting Stuck in Loops: LLM agents may repeatedly attempt to solve the same problem, ultimately reaching the maximum iteration limit. Overall, LegalAgentBench provides a comprehensive and reliable evaluation platform, highlighting that LLM agents still have significant room for improvement in solving complex legal problems.
212
+
213
+ # 5 Conclusion
214
+
215
+ In this paper, we introduced LegalAgentBench, a benchmark designed to evaluate the performance of LLM agents in the legal domain. To achieve this, we collected real-world data to construct 17 databases and 37 tools. Additionally, we proposed a scalable task construction framework that comprises six steps: planning tree creation, path selection, entity verification, question rewriting, answer generation, and human verification. This framework is versatile and can be extended to incorporate new knowledge bases and tools, enabling the construction of tasks with varying types and difficulty levels. We conducted extensive experiments on LegalAgentBench, providing an in-depth analysis of the strengths, weaknesses, and potential improvement directions for existing models and methods. Looking ahead, we aim to expand LegalAgentBench to support additional languages and legal systems, fostering the development of legal LLMs worldwide.
216
+
217
+ # References
218
+
219
+ Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. 2023. Gpt-4 technical report. arXiv preprint arXiv:2303.08774.
220
+ Jinze Bai, Shuai Bai, Yunfei Chu, Zeyu Cui, Kai Dang, Xiaodong Deng, Yang Fan, Wenbin Ge, Yu Han, Fei Huang, et al. 2023. Qwen technical report. arXiv preprint arXiv:2309.16609.
221
+ Zehui Chen, Weihua Du, Wenwei Zhang, Kuikun Liu, Jiangning Liu, Miao Zheng, Jingming Zhuo, Songyang Zhang, Dahua Lin, Kai Chen, et al. 2024. T-eval: Evaluating the tool utilization capability of large language models step by step. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 9510-9529.
222
+ Zhumin Chu, Qingyao Ai, Yiteng Tu, Haitao Li, and Yiqun Liu. 2024. Pre: A peer review based large language model evaluator. arXiv preprint arXiv:2401.15641.
223
+ Jiaxi Cui, Zongjian Li, Yang Yan, Bohua Chen, and Li Yuan. 2023. Chatlaw: Open-source legal large language model with integrated external knowledge bases. arXiv preprint arXiv:2306.16092.
224
+ Ali Dorri, Salil S Kanhere, and Raja Jurdak. 2018. Multi-agent systems: A survey. IEEE Access, 6:28573-28593.
225
+ Team GLM, Aohan Zeng, Bin Xu, Bowen Wang, Chenhui Zhang, Da Yin, Dan Zhang, Diego Rojas, Guanyu Feng, Hanlin Zhao, et al. 2024. Chatglm: A family of large language models from glm-130b to glm-4 all tools. arXiv preprint arXiv:2406.12793.
226
+ Neel Guha, Julian Nyarko, Daniel Ho, Christopher Ré, Adam Chilton, Alex Chohlas-Wood, Austin Peters, Brandon Waldon, Daniel Rockmore, Diego Zambrano, et al. 2024. Legalbench: A collaboratively built benchmark for measuring legal reasoning in large language models. Advances in Neural Information Processing Systems, 36.
227
+ Yue Huang, Jiawen Shi, Yuan Li, Chenrui Fan, Siyuan Wu, Qihui Zhang, Yixin Liu, Pan Zhou, Yao Wan, Neil Zhenqiang Gong, et al. 2023. Metatool benchmark for large language models: Deciding whether to use tools and which to use. arXiv preprint arXiv:2310.03128.
228
+ Haitao Li, Qingyao Ai, Jia Chen, Qian Dong, Yueyue Wu, Yiqun Liu, Chong Chen, and Qi Tian. 2023. Sailer: structure-aware pre-trained language model for legal case retrieval. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 1035-1044.
229
+
230
+ Haitao Li, Qingyao Ai, Jia Chen, Qian Dong, Zhijing Wu, Yiqun Liu, Chong Chen, and Qi Tian. 2024a. Blade: Enhancing black-box large language models with small domain-specific models.
231
+ Haitao Li, Qingyao Ai, Xinyan Han, Jia Chen, Qian Dong, Yiqun Liu, Chong Chen, and Qi Tian. 2024b. Delta: Pre-train a discriminative encoder for legal case retrieval via structural word alignment. arXiv preprint arXiv:2403.18435.
232
+ Haitao Li, Junjie Chen, Qingyao Ai, Zhumin Chu, Yu-jia Zhou, Qian Dong, and Yiqun Liu. 2024c. Calibrateval: Calibrating prediction distribution to mitigate selection bias in llms-as-judges. arXiv preprint arXiv:2410.15393.
233
+ Haitao Li, You Chen, Qingyao Ai, Yueyue Wu, Ruizhe Zhang, and Yiqun Liu. 2024d. Lexeval: A comprehensive chinese legal benchmark for evaluating large language models. arXiv preprint arXiv:2409.20288.
234
+ Haitao Li, Qian Dong, Junjie Chen, Huixue Su, Yu-jia Zhou, Qingyao Ai, Ziyi Ye, and Yiqun Liu. 2024e. Llms-as-judges: A comprehensive survey on llm-based evaluation methods. arXiv preprint arXiv:2412.05579.
235
+ Haitao Li, Yunqiu Shao, Yueyue Wu, Qingyao Ai, Yixiao Ma, and Yiqun Liu. 2024f. Lecardv2: A large-scale chinese legal case retrieval dataset. In Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2251-2260.
236
+ Bo Liu, Yuqian Jiang, Xiaohan Zhang, Qiang Liu, Shiqi Zhang, Joydeep Biswas, and Peter Stone. 2023a. Llm+ p: Empowering large language models with optimal planning proficiency. arXiv preprint arXiv:2304.11477.
237
+ Xiao Liu, Hao Yu, Hanchen Zhang, Yifan Xu, Xuanyu Lei, Hanyu Lai, Yu Gu, Hangliang Ding, Kaiwen Men, Kejuan Yang, et al. 2023b. Agent-bench: Evaluating llms as agents. arXiv preprint arXiv:2308.03688.
238
+ Chang Ma, Junlei Zhang, Zhihao Zhu, Cheng Yang, Yujiu Yang, Yaohui Jin, Zhenzhong Lan, Lingpeng Kong, and Junxian He. 2024. Agentboard: An analytical evaluation board of multi-turn llm agents. arXiv preprint arXiv:2401.13178.
239
+ Yujia Qin, Shihao Liang, Yining Ye, Kunlun Zhu, Lan Yan, Yaxi Lu, Yankai Lin, Xin Cong, Xiangru Tang, Bill Qian, et al. 2023. Toollm: Facilitating large language models to master $16000+$ real-world apis. arXiv preprint arXiv:2307.16789.
240
+ Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. 2024. Hugging-gpt: Solving ai tasks with chatgpt and its friends in hugging face. Advances in Neural Information Processing Systems, 36.
241
+
242
+ Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. 2024. Reflexion: Language agents with verbal reinforcement learning. Advances in Neural Information Processing Systems, 36.
243
+ Oguzhan Topsakal and Tahir Cetin Akinci. 2023. Creating large language model applications utilizing langchain: A primer on developing llm apps fast. In International Conference on Applied Engineering and Natural Sciences, volume 1, pages 1050-1056.
244
+ 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.
245
+ Lei Wang, Chen Ma, Xueyang Feng, Zeyu Zhang, Hao Yang, Jingsen Zhang, Zhiyuan Chen, Jiakai Tang, Xu Chen, Yankai Lin, Wayne Xin Zhao, Zhewei Wei, and Jirong Wen. 2024. A survey on large language model based autonomous agents. Frontiers of Computer Science, 18(6).
246
+ Lei Wang, Wanyu Xu, Yihuai Lan, Zhiqiang Hu, Yunshi Lan, Roy Ka-Wei Lee, and Ee-Peng Lim. 2023. Plan-and-solve prompting: Improving zero-shot chain-of-thought reasoning by large language models. arXiv preprint arXiv:2305.04091.
247
+ Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. 2022. Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824-24837.
248
+ Xiaohui Xie, Qian Dong, Bingning Wang, Feiyang Lv, Ting Yao, Weinan Gan, Zhijing Wu, Xiangsheng Li, Haitao Li, Yiqun Liu, and Jin Ma. 2023. T2ranking: A large-scale chinese benchmark for passage ranking. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR '23, page 2681-2690, New York, NY, USA. Association for Computing Machinery.
249
+ Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Tom Griffiths, Yuan Cao, and Karthik Narasimhan. 2024. Tree of thoughts: Deliberate problem solving with large language models. Advances in Neural Information Processing Systems, 36.
250
+ Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R Narasimhan, and Yuan Cao. React: Synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations.
251
+ Junjie Ye, Guanyu Li, Songyang Gao, Caishuang Huang, Yilong Wu, Sixian Li, Xiaoran Fan, Shihan Dou, Qi Zhang, Tao Gui, et al. 2024. Tooleyes: Finegrained evaluation for tool learning capabilities of large language models in real-world scenarios. arXiv preprint arXiv:2401.00741.
252
+
253
+ Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. 2019. Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675.
254
+ Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, Yifan Du, Chen Yang, Yushuo Chen, Zhipeng Chen, Jinhao Jiang, Ruiyang Ren, Yifan Li, Xinyu Tang, Zikang Liu, Peiyu Liu, Jian-Yun Nie, and Ji-Rong Wen. 2024. A survey of large language models.
255
+ Yuchen Zhuang, Yue Yu, Kuan Wang, Haotian Sun, and Chao Zhang. 2023. Toolqa: A dataset for llm question answering with external tools. Advances in Neural Information Processing Systems, 36:50117-50143.
256
+
257
+ # A Discussion
258
+
259
+ In this section, we discuss limitations, potential impacts, license, and legal and ethical considerations.
260
+
261
+ # A.1 Limitation
262
+
263
+ We acknowledge several limitations in this study and aim to address them in future work. First, the current dataset is primarily constructed in Chinese, which limits its applicability in broader multilingual contexts. We plan to release an updated version in future iterations that will support English. Second, the task design primarily covers statutory law system, and its performance in case law systems requires further exploration. It may not fully capture the diversity of legal knowledge and systems across different countries. In future work, we will enrich the task types, broaden the scope, and incorporate legal scenarios from more countries and regions, thereby enhancing the applicability and comprehensiveness of our research.
264
+
265
+ # A.2 Broader Impact
266
+
267
+ LegalAgentBench aims to promote the application of LLM agents in the legal field and help legal professionals better understand and evaluate the performance of LLM agents through a standardized evaluation framework. By providing reliable evaluation methods and construction processes, LegalAgentBench not only facilitates the application of LLM agents in legal tasks but also offers valuable insights for building benchmarks in other vertical domains. The widespread use of LLM agents in the legal industry may influence the way legal professionals work, change how they use technological tools, and drive adjustments in legal education and practice. We are particularly focused on the far-reaching impact of LLM agents on the legal industry, ensuring that their application always adheres to principles of social justice and the rule of law. To guarantee fairness and transparency, the datasets and evaluation methods of LegalAgentBench will undergo rigorous ethical reviews and be subject to broad stakeholder involvement to ensure their impartiality.
268
+
269
+ It is important to note that LegalAgentBench does not advocate for the complete replacement of legal professionals by LLM agents but seeks to reduce the burden on legal personnel and enhance efficiency through supportive tools. The uniqueness and complexity of legal judgment require rich expertise and human insight, qualities that LLM
270
+
271
+ agents cannot fully replace. Our goal is to provide legal professionals with a standardized evaluation tool to help them make more informed decisions in practical applications, understanding when, where, and how to effectively use LLM agents. However, the evaluation results of LegalAgentBench should be used as a reference only, as applications in real-world legal scenarios still require further in-depth evaluation to ensure the legality and reasonableness of decisions. We believe that LegalAgentBench will contribute to the development of a more just and efficient legal system and promote the responsible application of AI technology in the legal field.
272
+
273
+ # A.3 License
274
+
275
+ In this section, we clarify the copyright and licensing status of LegalAgentBench to ensure that users can utilize this dataset in a legal and compliant manner.
276
+
277
+ In LegalAgentBench, all tabular databases is sourced from authentic, publicly available resources. We have obtained explicit copyright permissions to incorporate these databases into the benchmark. Additionally, the retrieval corpora are derived from publicly accessible legal materials that comply with relevant legal and ethical standards. These resources are made available in accordance with applicable norms for open access to legal information, ensuring that their inclusion in the benchmark does not raise any legal or ethical concerns. While the copyright for these resources remains with the respective government agencies, they have been publicly released and authorized for public use. Users are expected to adhere to the relevant laws, regulations, and provisions established by the respective government agencies when utilizing this data
278
+
279
+ The entire dataset is released under the MIT License. If you believe that LegalAgentBench contains content that infringes on your copyrighted work, please feel free to contact us at any time to request its removal.
280
+
281
+ # A.4 Legal and Ethical Considerations
282
+
283
+ The construction and release of LegalAgentBench adhere to strict legal and ethical standards to ensure its responsible use in research and development. All data in LegalAgentBench has undergone rigorous privacy screening and anonymization processes. Any personal or sensitive information has been removed to comply with applicable data protection laws and ethical research guidelines, ensur
284
+
285
+ ing the dataset can be used without compromising individual privacy or security. To prevent potential harm, the datasets in LegalAgentBench have been carefully curated and filtered to exclude discriminatory, explicit, violent, or offensive content. An ethical review by legal experts further ensures that the benchmark minimizes risks related to security, safety, discrimination, surveillance, deception, harassment, human rights, bias, and fairness. By addressing these considerations, LegalAgentBench aims to provide a legally compliant and ethically sound foundation for advancing AI capabilities in the legal domain, while upholding the principles of fairness, transparency, and social responsibility.
286
+
287
+ # B Corpus Details
288
+
289
+ Table 4 provides detailed information about the corpora in LegalAgentBench, it lists the keys for 14 different tabular databases along with the number of keys per table, ranging from 3 to 28. This variation reflects the diversity of scenarios in real-world applications. Additionally, basic examples are provided for the three retrieval corpus to clarify their content.
290
+
291
+ # C Tool Details
292
+
293
+ Tables 5 and 6 provide detailed information about the tools included in LegalAgentBench. Table 5 outlines the input and output for each tool, while Table 6 describes the basic functionality of each tool.
294
+
295
+ For each tool, beyond the basic input information, we also provide optional parameters to enhance flexibility in usage. For instance, the Database Tools include the parameter Columns, which specifies the keys of the structured data to be returned. Similarly, the text retriever offers a Number parameter that allows users to control the number of documents retrieved. To enhance understanding, Table 7 provides a concrete example of a tool call.
296
+
297
+ # D Task Details
298
+
299
+ Tables 8 and 9 provide concrete examples of the tasks included in LegalAgentBench. Table 8 illustrates a multi-hop task along with a human-provided solution path, showcasing the reasoning steps involved. Table 9 presents an example of the writing task from the dataset, where the task requires not only querying and retrieving various
300
+
301
+ pieces of information but also processing and organizing the information into a formatted legal defense document. This example highlights the challenges faced by LLM agents when applied to the legal domain, demonstrating the need for advanced reasoning, information synthesis, and adherence to domain-specific requirements.
302
+
303
+ # E More Implementation details
304
+
305
+ # E.1 Prompt
306
+
307
+ In this section, we present the key prompts used in LegalAgentBench. More details can be found in our code. Table 10 shows the prompt template for question rewriting during the task construction process. We used GPT-4 to rewrite the original questions and manually reviewed the rewritten questions for accuracy. Tables 11, 12 and 13 present the prompts used in different methods.
308
+
309
+ # E.2 Metrics
310
+
311
+ In this section, we provide a detailed explanation of the calculation for success rate and process rate. Assume there is a dataset $\mathcal{D}$ consisting of $N$ data points, where each data point includes a keyword set $\kappa_{i}$ and a model output $\mathcal{O}_i$ . The rate $s_i$ for the $i$ -th data point is calculated as:
312
+
313
+ $$
314
+ s _ {i} = \frac {| \mathcal {M} _ {i} |}{| \mathcal {K} _ {i} |}
315
+ $$
316
+
317
+ where $\mathcal{M}_i = \{k\in \mathcal{K}_i|k$ appears in $\mathcal{O}_i\}$ . The notation $|\cdot |$ represents the number of elements in a set. When the keyword set $\mathcal{K}_i =$ key_answer, $s_i$ represents the success rate. When $\mathcal{K}_i =$ key_answer $\cup$ key_middle, $s_i$ represents the progress rate. We report the average of all tasks in the experimental results.
318
+
319
+ # F More Evaluation Result
320
+
321
+ Tables 14 and 15 report the progress rate and BertScore of different LLMs and methods on LegalAgentBench. Table 14 highlights the progress rate as a more fine-grained evaluation metric. We observed that GLM-4-Plus surpasses GPT-4o in progress rate across all tasks. This suggests that, although GLM-4-Plus may not perform as well as GPT-4o in terms of final outcomes, it achieves a higher degree of intermediate completion in many tasks. This provides a more comprehensive and fine-grained perspective for analyzing model performance. In Table 15, BERTScore measures the semantic similarity between the model's output
322
+
323
+ and the answer. However, the differences between baselines become smaller, making it challenging to effectively distinguish the performance of different baselines. Given the high accuracy requirements in the legal domain, we recommend using success rate and progress rate to evaluate model performance.
324
+
325
+ # G Guidelines for Expert-Annotation
326
+
327
+ To ensure the quality and reliability of the dataset during its construction, we conducted human verification on LegalAgentBench. To guide the validation process and maintain consistency, we provided the following annotation guidelines:
328
+
329
+ Validation of Answer Accuracy: Annotators must independently call the relevant tools to generate correct answers, ensuring that the dataset reflects accurate and reliable outputs. Incorrect answers should be carefully reviewed and corrected to maintain the integrity of the dataset. This process involves cross-verifying outputs with authoritative sources, re-running tool-based evaluations where necessary, and documenting any adjustments made to ensure transparency and reproducibility.
330
+
331
+ Validation of Query Rewriting: Annotators must ensure that rewritten queries preserve the meaning and intent of the original query. Specifically, they must verify that the answers obtained from the original and rewritten queries are identical, thereby ensuring semantic equivalence and logical consistency. In addition, any rewritten query that does not align with practical, everyday usage should be modified to ensure naturalness and usability.
332
+
333
+ Verification of Relevant Legal Provisions: Certain tasks, such as Writing tasks, require citing legal knowledge, articles or cases. Annotators must verify that all references are accurate, up-to-date, and relevant to the task at hand. This ensures the legal soundness of the dataset and enhances its applicability in real-world scenarios.
334
+
335
+ Handling Doubts and Uncertainties: If annotators encounter doubts or uncertainties during validation, they are required to consult official documents, legal texts, or terminological glossaries associated with the relevant classification system. Collaboration with legal experts is strongly encouraged to resolve ambiguities and clarify issues, ensuring that the dataset remains precise and unambiguous.
336
+
337
+ Review and Quality Control: A robust review mechanism is established to maintain high-quality annotations. Senior annotators regularly cross-check and review the annotations, correcting sim
338
+
339
+ ple errors and refining complex cases. Each annotation undergoes multiple rounds of manual verification to ensure accuracy and consistency. In cases where disagreements arise among annotators, collaborative discussions are held to reach consensus, with the final decision documented to ensure transparency.
340
+
341
+ Feedback Mechanism: To promote continuous improvement, a feedback mechanism is in place, allowing annotators to provide insights and suggestions regarding the annotation guidelines. This iterative refinement ensures that the guidelines remain effective, up-to-date, and aligned with the evolving requirements of the dataset.
342
+
343
+ Ethical Considerations: Ensure that all annotations are conducted with integrity and impartiality, maintaining high standards of accuracy and fairness. Take proactive measures to avoid any biases or conflicts of interest that could compromise the quality or objectivity of the annotations.
344
+
345
+ By adhering to these guidelines, we aim to produce a high-quality dataset that is not only accurate and reliable but also capable of supporting meaningful advancements in legal AI applications.
346
+
347
+ <table><tr><td>ID</td><td>Corpus</td><td>Key</td><td># Key</td></tr><tr><td>1</td><td>CompanyInfo</td><td>Company Name, Company Abbreviation, English Name, Associated Security, Company Code, Former Abbreviation, Market, Industry, Date of Establishment, Listing Date, Legal Representative, General Manager, Board Secretary, Postal Code, Registered Address, Office Address, Telephone Number, Fax, Official Website, Email, Included Indices, Main Business, Business Scope, Company Profile, Par Value per Share (CNY), Initial Public Offering (IPO) Price (CNY), Net Proceeds from IPO (CNY), Lead Underwriter for IPO</td><td>28</td></tr><tr><td>2</td><td>CompanyRegister</td><td>Company Name, Registration Status, Unified Social Credit Code, Legal Representative, Registered Capital, Date of Establishment, Company Address, Contact Number, Contact Email, Registration Number, Organization Code, Number of Insured Persons, Primary Industry Category, Secondary Industry Category, Tertiary Industry Category, Former Name, Company Profile, Business Scope</td><td>18</td></tr><tr><td>3</td><td>SubCompanyInfo</td><td>Full Name of the Related Listed Company, Relationship to the Listed Company, Listed Company&#x27;s Shareholding Percentage, Listed Company&#x27;s Investment Amount, Company Name</td><td>5</td></tr><tr><td>4</td><td>LegalDoc</td><td>Related Company, Title, Case Number, Document Type, Plaintiff, Defendant, Plaintiff&#x27;s Law Firm, Defendant&#x27;s Law Firm, Cause of Action, Amount Involved (CNY), Judgment Outcome, Date, File Name</td><td>13</td></tr><tr><td>5</td><td>LegalAbstract</td><td>File Name, Case Number, Text Summary</td><td>3</td></tr><tr><td>6</td><td>CourtInfo</td><td>Court Name, Court Head, Date of Establishment, Court Address, Court Province, Court City, Court County, Court Contact Number, Court Official Website</td><td>9</td></tr><tr><td>7</td><td>CourtCode</td><td>Court Name, Administrative Level, Court Level, Court Code, Zoning Code, Rank</td><td>6</td></tr><tr><td>8</td><td>LawfirmInfo</td><td>Law Firm Name, Law Firm Unique Code, Law Firm Head, Law Firm Registered Capital, Date of Establishment, Law Firm Address, Law Firm Province, Law Firm City, Law Firm County, Contact Phone Number, Contact Email, Law Firm Profile, Law Firm Registration Authority</td><td>13</td></tr><tr><td>9</td><td>LawfirmLog</td><td>Law Firm Name, Business Volume Ranking, Served Listed Companies, Listed Companies with Violations During Reporting Period, Listed Companies Under Investigation During Reporting Period</td><td>5</td></tr><tr><td>10</td><td>AddrInfo</td><td>Address, Province, City, County</td><td>4</td></tr><tr><td>11</td><td>RestrictionCase</td><td>Restricted High-Consumption Enterprise Name, Case Number, Legal Representative, Applicant, Amount Involved (CNY), Executing Court, Filing Date, Restriction Publication Date</td><td>4</td></tr><tr><td>12</td><td>FinalizedCase</td><td>Finalized Company Name, Case Number, Person Subject To Execution, Suspected Applicant for Enforcement, Unfulfilled Amount (CNY), Executor Target (CNY), Executing Court, Filing Date, Finalized Date</td><td>8</td></tr><tr><td>13</td><td>DishonestyCase</td><td>Dishonest Executed Company Name, Case Number, Dishonest Executed Person, Suspected Applicant for Enforcement, Amount Involved (CNY), Executing Court, Filing Date, Publication Date</td><td>9</td></tr><tr><td>14</td><td>AdministrativeCase</td><td>Administrative Penalty Company Name, Case Number, Facts, Penalty Outcome, Penalty Amount (CNY), Penalizing Authority, Penalty Date</td><td>8</td></tr><tr><td>15</td><td>LegalKonnowledge</td><td>EXAMPLE: Tax Law, Tax Collection and Administration Law, Legal Liability (1) If a taxpayer fails to pay taxes within the prescribed period or if a withholding agent...</td><td>-</td></tr><tr><td>16</td><td>LegalArticle</td><td>EXAMPLE: Article 1082 of the Civil Code of the People&#x27;s Republic of China During the woman&#x27;s pregnancy, within one year after childbirth, or within six months after termination of pregnancy, the man shall not file for divorce...</td><td>-</td></tr><tr><td>17</td><td>LegalCases</td><td>EXAMPLE: Application for Recognition of a Civil Judgment by Kaohsiung County Court in Taiwan: Kang vs. Huang. (1) Basic Facts: On June 1, 2004, mainland resident Kang...</td><td>-</td></tr></table>
348
+
349
+ Table 4: More details about the corpus of LegalAgentBench.
350
+
351
+ <table><tr><td>ID</td><td>Tool</td><td>Input</td><td>Return</td></tr><tr><td>1</td><td>get_company_info</td><td>Company name or abbr. or code</td><td>CompanyInfo</td></tr><tr><td>2</td><td>get_company_register</td><td>Company name</td><td>CompanyRegister</td></tr><tr><td>3</td><td>get_company_register_name</td><td>Unified social credit code</td><td>Company name</td></tr><tr><td>4</td><td>get_sub_company_info</td><td>Company name</td><td>SubCompanyInfo</td></tr><tr><td>5</td><td>get_sub_company_info_list</td><td>Company name</td><td>List[SubCompanyInfo]</td></tr><tr><td>6</td><td>get/legal_doc</td><td>Case number</td><td>LegalDoc</td></tr><tr><td>7</td><td>get/legal_ABstract</td><td>Case number</td><td>LegalAbstract</td></tr><tr><td>8</td><td>get/legal_doc_company_list</td><td>Company name</td><td>List[LegalDoc]</td></tr><tr><td>9</td><td>get/legal_doc_lawfirm_list</td><td>Law firm name</td><td>List[LegalDoc]</td></tr><tr><td>10</td><td>get_court_info</td><td>Court name</td><td>CourtInfo</td></tr><tr><td>11</td><td>get_court_info_list</td><td>Province, city, and county</td><td>List[CourtInfo]</td></tr><tr><td>12</td><td>get_court_code</td><td>Court name or code</td><td>CourtCode</td></tr><tr><td>13</td><td>get_lawfirm_info</td><td>Law firm name</td><td>LawfirmInfo</td></tr><tr><td>14</td><td>get_lawfirm_info_list</td><td>Province, city, and county</td><td>List[LawfirmInfo]</td></tr><tr><td>15</td><td>get_lawfirm_log</td><td>Law firm name</td><td>LawfirmLog</td></tr><tr><td>16</td><td>get_address_info</td><td>Specific address</td><td>AddrInfo</td></tr><tr><td>17</td><td>get_restriction(case</td><td>Case number</td><td>RestrictionCase</td></tr><tr><td>18</td><td>get_restriction(case_company_list</td><td>Company name</td><td>List[RestrictionCase]</td></tr><tr><td>19</td><td>get_restriction(case-court_list</td><td>Court name</td><td>List[RestrictionCase]</td></tr><tr><td>20</td><td>get_finalized(case</td><td>Case number</td><td>FinalizedCase</td></tr><tr><td>21</td><td>get_finalized(case_company_list</td><td>Company name</td><td>List[FinalizedCase]</td></tr><tr><td>22</td><td>get_finalized(case-court_list</td><td>Court name</td><td>List[FinalizedCase]</td></tr><tr><td>23</td><td>get_dishonesty(case</td><td>Case number</td><td>DishonestyCase</td></tr><tr><td>24</td><td>get_dishonesty(case_company_list</td><td>Company name</td><td>List[DishonestyCase]</td></tr><tr><td>25</td><td>get_dishonesty(case-court_list</td><td>Court name</td><td>List[DishonestyCase]</td></tr><tr><td>26</td><td>get_administrative(case</td><td>Case number</td><td>AdministrativeCase</td></tr><tr><td>27</td><td>get_administrative(case_company_list</td><td>Company name</td><td>List[AdministrativeCase]</td></tr><tr><td>28</td><td>get_administrative(case況法院列表</td><td>Court name</td><td>List[AdministrativeCase]</td></tr><tr><td>29</td><td>legal_knowledge_retriever</td><td>Query text</td><td>Relevant knowledge</td></tr><tr><td>30</td><td>legal_article_retriever</td><td>Query text</td><td>Relevant articles</td></tr><tr><td>31</td><td>legal(case_retriever</td><td>Query text</td><td>Relevant cases</td></tr><tr><td>32</td><td>get_sum</td><td>List[num]</td><td>Summation results</td></tr><tr><td>33</td><td>get_subtraction</td><td>Minuend, subtrahend</td><td>Subtraction results</td></tr><tr><td>34</td><td>getmultiplication</td><td>List[num]</td><td>Multiplication results</td></tr><tr><td>35</td><td>get_division</td><td>Dividend, divisor</td><td>Division results</td></tr><tr><td>36</td><td>get_rank</td><td>List[num]</td><td>Sorting results</td></tr><tr><td>37</td><td>finish</td><td>-</td><td>Final results</td></tr></table>
352
+
353
+ Table 5: The input and output of the tools.
354
+
355
+ <table><tr><td>ID</td><td>Tool</td><td>Description</td></tr><tr><td>1</td><td>get_company_info</td><td>Query the corresponding listed company information in the [CompanyInfo] based on [Company Name, Company Abbreviation, or Company Code].</td></tr><tr><td>2</td><td>get_company_register</td><td>Query the corresponding company registration information in the [CompanyRegister] based on [CompanyName].</td></tr><tr><td>3</td><td>get_company_register_name</td><td>Query the corresponding company name in the [CompanyRegister] based on [Unified Social Credit Code].</td></tr><tr><td>4</td><td>get_sub_company_info</td><td>Query the corresponding parent company and investment information in the [Sub-CompanyInfo] based on [Company Name].</td></tr><tr><td>5</td><td>get_sub_company_info_list</td><td>Query all subsidiary companies invested by the parent company in the [SubCompa-nyInfo] based on [Company Name].</td></tr><tr><td>6</td><td>get/legal_documment</td><td>Query the corresponding judgment document information in the [LegalDoc] based on [Case Number].</td></tr><tr><td>7</td><td>get/legal_ABstract</td><td>Query the text summary of the case in the [LegalAbstract] based on [Case Number].</td></tr><tr><td>8</td><td>get/legal_documment_company_list</td><td>Query the corresponding judgment document information in the [LegalDoc] based on [Company Name].</td></tr><tr><td>9</td><td>get/legal_documment_lawfirm_list</td><td>Query the corresponding judgment document information in the [LegalDoc] based on [Law Firm Name].</td></tr><tr><td>10</td><td>get_court_info</td><td>Query the relevant court information in the [CourtInfo] based on [Court Name].</td></tr><tr><td>11</td><td>get_court_info_list</td><td>Query the relevant court information in the [CourtInfo] based on [Province, City, County].</td></tr><tr><td>12</td><td>get_court_code</td><td>Query the relevant court information in the [CourtCode] based on [Court Name or Court Code].</td></tr><tr><td>13</td><td>get_lawfirm_info</td><td>Query the relevant law firm information in the [LawfirmInfo] based on [Law Firm Name].</td></tr><tr><td>14</td><td>get_lawfirm_info_list</td><td>Query the relevant law firm information in the [LawfirmInfo] based on [Province, City, County].</td></tr><tr><td>15</td><td>get_lawfirm_log</td><td>Query the service records of the law firm in the [LawfirmLog] based on [Law Firm Name].</td></tr><tr><td>16</td><td>get_address_info</td><td>Query the province, city, and county of the address in the [AddrInfo] based on [Specific Address].</td></tr><tr><td>17</td><td>get_restriction(case</td><td>Query the relevant high-consumption restriction case information in the [Restriction-Case] based on [Case Number].</td></tr><tr><td>18</td><td>get_restriction(case_company_list</td><td>Query the relevant high-consumption restriction case information in the [Restriction-Case] based on [Company Name].</td></tr><tr><td>19</td><td>get_restriction(case-court_list</td><td>Query the relevant high-consumption restriction case information in the [Restriction-Case] based on [Executing Court Name].</td></tr><tr><td>20</td><td>get_finalized(case</td><td>Query the relevant finalized case information in the [FinalizedCase] based on [Case Number].</td></tr><tr><td>21</td><td>get_finalized(case_company_list</td><td>Query the relevant finalized case information in the [FinalizedCase] based on [Final-ized Company Name].</td></tr><tr><td>22</td><td>get_finalized(case況況目</td><td>Query the relevant finalized case information in the [FinalizedCase] based on [Executing Court Name].</td></tr><tr><td>23</td><td>get_dishonesty(case</td><td>Query the relevant dishonesty enforcement case information in the [DishonestyCase] based on [Case Number].</td></tr><tr><td>24</td><td>get_dishonesty(case_company_list</td><td>Query the relevant dishonesty enforcement case information in the [DishonestyCase] based on [Company Name].</td></tr><tr><td>25</td><td>get_dishonesty(case況況目</td><td>Query the relevant dishonesty enforcement case information in the [DishonestyCase] based on [Executing Court Name].</td></tr><tr><td>26</td><td>get_administrative(case</td><td>Query the relevant administrative penalty case information in the [Administrative-Case] based on [Case Number].</td></tr><tr><td>27</td><td>get_administrative(case_company_list</td><td>Query the relevant administrative penalty case information in the [Administrative-Case] based on [Company Name].</td></tr><tr><td>28</td><td>get_administrative(case況況目</td><td>Query the relevant administrative penalty case information in the [Administrative-Case] based on [Penalizing Authority].</td></tr><tr><td>29</td><td>legal_knowledge_retriever</td><td>Retrieve relevant legal knowledge based on [Query text].</td></tr><tr><td>30</td><td>legal ARTICLE_retriever</td><td>Retrieve relevant legal articles based on [Query text].</td></tr><tr><td>31</td><td>legal(case_retriever</td><td>Retrieve relevant legal cases based on [Query text].</td></tr><tr><td>32</td><td>get_sum</td><td>Perform [Summation] based on [List[num]].</td></tr><tr><td>33</td><td>get_subtraction</td><td>Perform [Subtraction] based on [Minuend, Subtrahend].</td></tr><tr><td>34</td><td>getmultiplication</td><td>Perform [Multiplication] based on [List[num]].</td></tr><tr><td>35</td><td>get_division</td><td>Perform [Division] based on [Dividend, Divisor].</td></tr><tr><td>36</td><td>get_rank</td><td>Perform [Sorting] based on [List[num]].</td></tr><tr><td>37</td><td>finish</td><td>Summarize existing information to generate an answer.</td></tr></table>
356
+
357
+ Table 6: The descriptions of the tool functions.
358
+
359
+ <table><tr><td>Example: Use get_limitation(case_company_list to query the amounts involved in all cases participated in by Jiangsu Yanning New Material Technology Development Co., Ltd.</td></tr><tr><td>Call Tool:
360
+ get_limitation(case_company_list( identifier=&quot;Jiangsu Yanning New Material Technology Development Co., Ltd.&quot;, columns=[&#x27;Amount Involved (CNY)&#x27;])</td></tr><tr><td>Return:
361
+ [{&#x27;Amount Involved (CNY): 686550}, {&#x27;Amount Involved (CNY): 385353}, {&#x27;Amount Involved (CNY): 17875}, {&#x27;Amount Involved (CNY): 2456446}]</td></tr></table>
362
+
363
+ Table 7: A concrete example of a tool call. There are four cases related to the specified company. Since the columns parameter specifies the Amount Involved (CNY) attribute, each dictionary in the returned list contains only the Amount Involved (CNY) key. If columns $= \left\lbrack \right\rbrack$ ,all keys in the corresponding table will be returned.
364
+
365
+ <table><tr><td>Task: What is the total amount of restricted high consumption for 91320115773957541H?</td></tr><tr><td>Step: Firstly, since the provided Unified Social Credit Code &quot;91320115773957541H&quot; cannot be directly used to query the total amount of restricted high consumption, we use the get_company_register_name tool to obtain the company name associated with this code. Result of Action: The query reveals that the company name is Jiangsu Yanning New Material Technology Development Co., Ltd.</td></tr><tr><td>Secondly, we use the get限制case_company_list tool to query all restricted high consumption cases involving this company, based on the company name retrieved in the previous step. Result of Action: The query returns the amounts involved in all cases as follows: {{‘Amount Involved (CNY)’: 686550}, {‘Amount Involved (CNY)’: 385353}, {‘Amount Involved (CNY)’: 17875}, {‘Amount Involved (CNY)’: 2456446}}]. Thirdly, we use the get_sum tool to calculate the total of the amounts obtained in the previous step. Result of Action: The calculation yields a total of 3546224 CNY. Finally, we summarize the information and answer the original question. Answer: The total amount of restricted high consumption for 91320115773957541H is 3546224 CNY.</td></tr></table>
366
+
367
+ Table 8: An example of the multi-hop task.
368
+
369
+ Task: PersonA has filed a lawsuit against CompanyX. The specific content of the complaint is as follows: [Complaint Content]. CompanyX has engaged Law Firm A for legal representation. As the head of Law Firm A, please draft a defense statement in response to the complaint based on the specified defense statement format: [Defense Statement Format].
370
+
371
+ # Step:
372
+
373
+ Firstly, we need to retrieve the address, legal representative, Unified Social Credit Code, and contact number of CompanyX.
374
+
375
+ Call Tool: get_company/register
376
+
377
+ Secondly, we need to retrieve the head and contact number of Law Firm A.
378
+
379
+ Call Tool: get courthouse_info
380
+
381
+ Thirdly, we need to retrieve relevant legal knowledge, legal article, and legal case
382
+
383
+ Call Tools: legal knowledge_retriever, legal_article_retriever, legal(case_retriever
384
+
385
+ Finally, we generate the answer following the specified defense statement format.
386
+
387
+ # Answer:
388
+
389
+ Defendant: [Company Name], [Address], [Legal Representative], [Unified Social Credit Code], [Contact Number]
390
+
391
+ Authorized Litigation Representative: [Law Firm Name], [Law Firm Head], [Law Firm Contact Number]
392
+
393
+ Plaintiff: [Name]
394
+
395
+ [Specific Content of the Defense Statement]
396
+
397
+ Table 9: An example of the writing task.
398
+
399
+ # The prompt used in question rewriting.
400
+
401
+ You are an advanced question rewriter. Your task is to rewrite the given questions to make them more relevant to real-life scenarios and sound more natural. Please adhere to the following requirements:
402
+
403
+ 1. Preserve the Core Inquiry: Do not change the core content or the focus of the original question. Ensure the user's intent is not misunderstood.
404
+ 2. Introduce Misleading Context: Add potentially misleading context to obscure the true purpose of the query.
405
+ 3. Maintain Logical Coherence: The rewritten question should align with daily usage scenarios, have smooth language, and be logically coherent.
406
+ 4. Relate to Legal Needs: Whenever possible, ensure the question remains tied to legal requirements.
407
+ 5. Ensure Clarity: Retain the critical points of the inquiry so that the answers to the original question and the rewritten question remain consistent.
408
+
409
+ Table 10: The prompt template for question rewriting during the task construction process.
410
+
411
+ <table><tr><td>Stage</td><td>The Prompt used in the Plan-and-Solve method.</td></tr><tr><td>Plan</td><td>Solve a Question-Answering Task. Please understand the question and develop a step-by-step plan to solve it.
412
+ Start your output with the title &quot;Plan:&quot; and follow it with a list of steps. Each step should begin with &quot;Step n:&quot;, where n is the current step number (1, 2, 3, ...).
413
+ The plan should include several distinct steps, and completing these steps sequentially will yield the correct answer.
414
+ Ensure the plan is sufficiently detailed to complete the task accurately, without skipping any steps or adding unnecessary ones.
415
+ The final step should always be: &quot;Based on the above steps, please answer the original question.&quot;
416
+ At the end of the plan, include the line &quot;End of Plan.&quot;
417
+ You can use the following tools:
418
+ {tools}
419
+ Relevant data tables and their fields (any field appearing in the table can be used as a value in the columns parameter):
420
+ {table_used_prompt}
421
+ Note: Your task is to develop the plan and output it as requested. Do not execute the plan!
422
+ Here are some examples:
423
+ {examples}
424
+ {Examples End}
425
+ Question: {question}</td></tr><tr><td>Solve</td><td>Given a single-step plan, please output the specific action you intend to execute based on the plan. &quot;Action&quot; is specified using a JSON block, which includes an action key (tool name) and an action_input key (tool input).
426
+ Valid values for the action key include: &quot;Final Answer&quot; or {tool_names}.
427
+ You may use the following tools:
428
+ {tools}
429
+ Relevant data tables and their available fields (any field in the table can be used as a value in the columns parameter):
430
+ {table_used_prompt}
431
+ Each &quot;Action&quot; can only call one tool at a time. If multiple tools need to be called, split them into separate steps.
432
+ The output of an &quot;Action&quot; must strictly follow the JSON format below and be parsable by Python&#x27;s json_loads function:
433
+ &quot;&quot;json
434
+ {{
435
+ &quot;action&quot;: TOOL_NAME,
436
+ &quot;action_input&quot;: INPUT}
437
+ }}
438
+ Here are some examples:
439
+ {examples}
440
+ {Examples End}
441
+ Plan you need to execute: {plan}
442
+ Steps you have already completed: {scratchpad}
443
+ Action:</td></tr></table>
444
+
445
+ Table 11: The prompt used in the Plan-and-Solve method.
446
+
447
+ <table><tr><td>Stage</td><td>The prompt used in the Plan-and-Execute method.</td></tr><tr><td rowspan="5">Replan</td><td>Solve a Question-Answering task. Please understand the question and develop a step-by-step plan to solve it.
448
+ Start your output with the title &quot;Plan:&quot; and follow it with a list of steps. Each step should begin with &quot;Step n:&quot;, where n is the current step number (1, 2, 3, ...).
449
+ The plan should include several distinct steps, and completing these steps sequentially will yield the correct answer.
450
+ Ensure the plan is sufficiently detailed to complete the task accurately, without skipping any steps or adding unnecessary ones.
451
+ The final step should always be: &quot;Based on the above steps, please answer the original question.&quot;
452
+ At the end of the plan, include the line &quot;End of Plan.&quot;</td></tr><tr><td>You may use the following tools:
453
+ {tools}
454
+ Relevant data tables and their fields (any field in the table can be used as a value in the columns parameter):
455
+ {table_used_prompt}</td></tr><tr><td>Note: You are only responsible for creating the plan according to the requirements. Do not execute the plan!</td></tr><tr><td>Examples:
456
+ {examples}
457
+ (Examples End)</td></tr><tr><td>Question: {question}
458
+ Your Original Plan: {plan}
459
+ Steps You Have Already Completed: {scratchpad}
460
+ Please update the plan based on the situation. If additional steps are needed, list the remaining steps strictly following the format requirements. Retain the already completed steps as they are and do not repeat them.
461
+ Each step should begin with &quot;Step n:&quot;, where n is the current step number (1, 2, 3, ...).
462
+ The final step should always be: &quot;Based on the above steps, please answer the original question.&quot;
463
+ At the end of the plan, include the line &quot;End of Plan.&quot;</td></tr></table>
464
+
465
+ Table 12: The prompt used in the Plan-and-Execute method.
466
+
467
+ # The prompt used in the ReAct method.
468
+
469
+ Solve a Question-Answering Task. The process involves alternating steps of "Thought", "Action", and "Observation".
470
+
471
+ - "Thought" is used to reason about the next step based on the current situation. Note that you only need to consider the immediate next step.
472
+ - "Action" refers to specifying the tool to use through a JSON block containing an 'action' key (tool name) and an 'action_input' key (tool input).
473
+ - Valid values for the 'action' key include: "Final Answer" or {tool_names}.
474
+ - You may use the following tools: {tools}
475
+ - Relevant data tables and their available fields (any field in the table can be used as a value in the 'columns' parameter) include: {table_used_prompt}
476
+ - Each "Action" can call only one tool. If multiple tools need to be called, break them into separate steps.
477
+ - The output of an "Action" strictly follows the JSON format below and be parsable by Python's `json.dumps' function:
478
+
479
+ ```
480
+ ```
481
+ ```
482
+ ```
483
+ ```
484
+ ```
485
+ ```
486
+ ``
487
+
488
+ "action": TOOL_NAME,
489
+
490
+ "action_input": INPUT
491
+ }
492
+
493
+ Examples:
494
+
495
+ {examples}
496
+
497
+ (Examples End)
498
+
499
+ Important Notes:
500
+
501
+ - When outputting "Action," the result must strictly follow the JSON format specified above.
502
+ - When outputting "Thought," only reason about the immediate next step, and avoid thinking about multiple steps ahead.
503
+
504
+ Question: {question}
505
+
506
+ {scratchpad}
507
+
508
+ Table 13: The prompt used in the ReAct method.
509
+
510
+ <table><tr><td>Model</td><td>Method</td><td>1-hop</td><td>2-hop</td><td>3-hop</td><td>4-hop</td><td>5-hop</td><td>Writing</td><td>ALL</td><td>Tokens</td></tr><tr><td rowspan="3">GLM-4</td><td>P-S</td><td>0.7519</td><td>0.5094</td><td>0.3502</td><td>0.3238</td><td>0.2334</td><td>0.4989</td><td>0.4984</td><td>5,100,468</td></tr><tr><td>P-E</td><td>0.7477</td><td>0.5225</td><td>0.4140</td><td>0.3080</td><td>0.2631</td><td>0.4801</td><td>0.5121</td><td>9,849,924</td></tr><tr><td>ReAct</td><td>0.8967</td><td>0.7092</td><td>0.5103</td><td>0.4191</td><td>0.2820</td><td>0.5179</td><td>0.6395</td><td>11,920,863</td></tr><tr><td rowspan="3">GLM-4-Plus</td><td>P-S</td><td>0.8231</td><td>0.6577</td><td>0.5336</td><td>0.4791</td><td>0.3366</td><td>0.6367</td><td>0.6304</td><td>5,657,827</td></tr><tr><td>P-E</td><td>0.8673</td><td>0.6531</td><td>0.5447</td><td>0.4762</td><td>0.3156</td><td>0.6401</td><td>0.6416</td><td>9,422,692</td></tr><tr><td>ReAct</td><td>0.9323</td><td>0.7835</td><td>0.6233</td><td>0.5788</td><td>0.4026</td><td>0.6273</td><td>0.7280</td><td>11,739,861</td></tr><tr><td rowspan="3">LLaMa3.1-8B</td><td>P-S</td><td>0.3475</td><td>0.2498</td><td>0.0999</td><td>0.0734</td><td>0.0859</td><td>0.2631</td><td>0.2123</td><td>9,279,701</td></tr><tr><td>P-E</td><td>0.3719</td><td>0.2248</td><td>0.1247</td><td>0.0934</td><td>0.1097</td><td>0.3334</td><td>0.2260</td><td>13,649,741</td></tr><tr><td>ReAct</td><td>0.6177</td><td>0.1573</td><td>0.0649</td><td>0.0468</td><td>0.0581</td><td>0.1074</td><td>0.2369</td><td>50,661,127</td></tr><tr><td rowspan="3">Qwen-max</td><td>P-S</td><td>0.8485</td><td>0.6442</td><td>0.4579</td><td>0.3994</td><td>0.2610</td><td>0.4557</td><td>0.5907</td><td>4,800,345</td></tr><tr><td>P-E</td><td>0.8979</td><td>0.7004</td><td>0.5233</td><td>0.4141</td><td>0.2836</td><td>0.5011</td><td>0.6384</td><td>9,884,307</td></tr><tr><td>ReAct</td><td>0.9229</td><td>0.7954</td><td>0.5832</td><td>0.5185</td><td>0.4908</td><td>0.5659</td><td>0.7144</td><td>11,473,873</td></tr><tr><td rowspan="3">Claude-sonnet</td><td>P-S</td><td>0.8304</td><td>0.6987</td><td>0.5975</td><td>0.4794</td><td>0.3195</td><td>0.6575</td><td>0.6563</td><td>7,100,962</td></tr><tr><td>P-E</td><td>0.8262</td><td>0.7340</td><td>0.6458</td><td>0.5188</td><td>0.4418</td><td>0.6776</td><td>0.6890</td><td>13,566,119</td></tr><tr><td>ReAct</td><td>0.8867</td><td>0.7356</td><td>0.4850</td><td>0.4533</td><td>0.3379</td><td>0.5504</td><td>0.6493</td><td>32,878,858</td></tr><tr><td rowspan="3">GPT-3.5</td><td>P-S</td><td>0.4994</td><td>0.2856</td><td>0.1296</td><td>0.0905</td><td>0.0412</td><td>0.0863</td><td>0.2558</td><td>5,007,391</td></tr><tr><td>P-E</td><td>0.5067</td><td>0.2731</td><td>0.1254</td><td>0.0886</td><td>0.0496</td><td>0.0973</td><td>0.2546</td><td>9,597,807</td></tr><tr><td>ReAct</td><td>0.6344</td><td>0.3117</td><td>0.1162</td><td>0.1018</td><td>0.1102</td><td>0.0813</td><td>0.3019</td><td>11,357,664</td></tr><tr><td rowspan="3">GPT-4o-mini</td><td>P-S</td><td>0.7010</td><td>0.5371</td><td>0.4269</td><td>0.3193</td><td>0.1637</td><td>0.5224</td><td>0.5039</td><td>5,482,556</td></tr><tr><td>P-E</td><td>0.7298</td><td>0.5548</td><td>0.4525</td><td>0.3124</td><td>0.2032</td><td>0.5547</td><td>0.5252</td><td>10,861,492</td></tr><tr><td>ReAct</td><td>0.9354</td><td>0.6746</td><td>0.4834</td><td>0.3652</td><td>0.3714</td><td>0.5014</td><td>0.6329</td><td>13,332,418</td></tr><tr><td rowspan="3">GPT-4o</td><td>P-S</td><td>0.6773</td><td>0.6137</td><td>0.4544</td><td>0.3813</td><td>0.2878</td><td>0.6336</td><td>0.5474</td><td>4,153,333</td></tr><tr><td>P-E</td><td>0.7669</td><td>0.6204</td><td>0.4772</td><td>0.3955</td><td>0.2424</td><td>0.6748</td><td>0.5793</td><td>7,261,238</td></tr><tr><td>ReAct</td><td>0.9344</td><td>0.7937</td><td>0.6397</td><td>0.4833</td><td>0.4880</td><td>0.5123</td><td>0.7199</td><td>11,206,957</td></tr></table>
511
+
512
+ Table 14: The process rate of different baselines on LegalAgentBench. P-S represents the Plan-and-Solve method, and P-E represents the Plan-and-Execute method. The best results are highlighted in bold.
513
+
514
+ <table><tr><td>Model</td><td>Method</td><td>1-hop</td><td>2-hop</td><td>3-hop</td><td>4-hop</td><td>5-hop</td><td>Writing</td><td>ALL</td><td>Tokens</td></tr><tr><td rowspan="3">GLM-4</td><td>P-S</td><td>0.8511</td><td>0.7585</td><td>0.6996</td><td>0.7289</td><td>0.7459</td><td>0.7754</td><td>0.7678</td><td>5,100,468</td></tr><tr><td>P-E</td><td>0.8392</td><td>0.7389</td><td>0.7131</td><td>0.7288</td><td>0.7270</td><td>0.7725</td><td>0.7606</td><td>9,849,924</td></tr><tr><td>ReAct</td><td>0.9086</td><td>0.8088</td><td>0.7913</td><td>0.7691</td><td>0.7597</td><td>0.7705</td><td>0.8208</td><td>11,920,863</td></tr><tr><td rowspan="3">GLM-4-Plus</td><td>P-S</td><td>0.8998</td><td>0.8036</td><td>0.7505</td><td>0.7726</td><td>0.7805</td><td>0.7790</td><td>0.8113</td><td>5,657,827</td></tr><tr><td>P-E</td><td>0.9000</td><td>0.8168</td><td>0.7453</td><td>0.7551</td><td>0.7530</td><td>0.7791</td><td>0.8097</td><td>9,422,692</td></tr><tr><td>ReAct</td><td>0.9284</td><td>0.8718</td><td>0.8254</td><td>0.8267</td><td>0.8277</td><td>0.7873</td><td>0.8630</td><td>11,739,861</td></tr><tr><td rowspan="3">LLaMa3.1-8B</td><td>P-S</td><td>0.7427</td><td>0.6674</td><td>0.6356</td><td>0.6241</td><td>0.6313</td><td>0.6640</td><td>0.6727</td><td>9,279,701</td></tr><tr><td>P-E</td><td>0.7278</td><td>0.6542</td><td>0.6421</td><td>0.6327</td><td>0.6413</td><td>0.7336</td><td>0.6730</td><td>13,649,741</td></tr><tr><td>ReAct</td><td>0.8080</td><td>0.6944</td><td>0.6583</td><td>0.6390</td><td>0.6672</td><td>0.5931</td><td>0.7015</td><td>50,661,127</td></tr><tr><td rowspan="3">Qwen-max</td><td>P-S</td><td>0.8581</td><td>0.7518</td><td>0.7240</td><td>0.7296</td><td>0.7338</td><td>0.7570</td><td>0.7708</td><td>4,800,345</td></tr><tr><td>P-E</td><td>0.8521</td><td>0.7664</td><td>0.7259</td><td>0.7035</td><td>0.7300</td><td>0.7602</td><td>0.7699</td><td>9,884,307</td></tr><tr><td>ReAct</td><td>0.9033</td><td>0.8315</td><td>0.8196</td><td>0.7676</td><td>0.7886</td><td>0.7835</td><td>0.8337</td><td>11,473,873</td></tr><tr><td rowspan="3">Claude-sonnet</td><td>P-S</td><td>0.8566</td><td>0.7841</td><td>0.7452</td><td>0.7246</td><td>0.7416</td><td>0.7928</td><td>0.7855</td><td>7,100,962</td></tr><tr><td>P-E</td><td>0.8538</td><td>0.7937</td><td>0.7441</td><td>0.7314</td><td>0.7560</td><td>0.7913</td><td>0.7888</td><td>13,566,119</td></tr><tr><td>ReAct</td><td>0.8722</td><td>0.8038</td><td>0.7770</td><td>0.7510</td><td>0.7747</td><td>0.7679</td><td>0.8053</td><td>32,878,858</td></tr><tr><td rowspan="3">GPT-3.5</td><td>P-S</td><td>0.8329</td><td>0.7344</td><td>0.6961</td><td>0.6856</td><td>0.6317</td><td>0.5332</td><td>0.7262</td><td>5,007,391</td></tr><tr><td>P-E</td><td>0.8325</td><td>0.7302</td><td>0.7008</td><td>0.6544</td><td>0.6201</td><td>0.5412</td><td>0.7216</td><td>9,597,807</td></tr><tr><td>ReAct</td><td>0.8695</td><td>0.7618</td><td>0.7182</td><td>0.6933</td><td>0.6459</td><td>0.5125</td><td>0.7483</td><td>11,357,664</td></tr><tr><td rowspan="3">GPT-4o-mini</td><td>P-S</td><td>0.8945</td><td>0.7811</td><td>0.7364</td><td>0.7498</td><td>0.7427</td><td>0.7766</td><td>0.7954</td><td>5,482,556</td></tr><tr><td>P-E</td><td>0.8958</td><td>0.7884</td><td>0.7376</td><td>0.7493</td><td>0.7372</td><td>0.7785</td><td>0.7976</td><td>10,861,492</td></tr><tr><td>ReAct</td><td>0.9303</td><td>0.8307</td><td>0.7917</td><td>0.7911</td><td>0.7900</td><td>0.7679</td><td>0.8373</td><td>13,332,418</td></tr><tr><td rowspan="3">GPT-4o</td><td>P-S</td><td>0.8966</td><td>0.7874</td><td>0.7432</td><td>0.7387</td><td>0.7450</td><td>0.7864</td><td>0.7983</td><td>4,153,333</td></tr><tr><td>P-E</td><td>0.8955</td><td>0.7822</td><td>0.7352</td><td>0.7407</td><td>0.7489</td><td>0.7964</td><td>0.7962</td><td>7,261,238</td></tr><tr><td>ReAct</td><td>0.9154</td><td>0.8346</td><td>0.8199</td><td>0.7848</td><td>0.8047</td><td>0.7792</td><td>0.8409</td><td>11,206,957</td></tr></table>
515
+
516
+ Table 15: The BERT-Score of different baselines on LegalAgentBench. P-S represents the Plan-and-Solve method, and P-E represents the Plan-and-Execute method. The best results are highlighted in bold.
2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21163d14453bedcbaa3b70b9a6abb290b48c8044650fc0031118b070d812b9e9
3
+ size 2647970
2025/LegalAgentBench_ Evaluating LLM Agents in Legal Domain/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/a6a843c1-4937-4a68-829f-b00fd5a1018d_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/a6a843c1-4937-4a68-829f-b00fd5a1018d_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/a6a843c1-4937-4a68-829f-b00fd5a1018d_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3a7048bf1b57c076788506bcd8e3484459dddff87e2504e8e10289e158715bd
3
+ size 710030
2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/full.md ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LegalReasoner: Step-wised Verification-Correction for Legal Judgment Reasoning
2
+
3
+ Weijie Shi $^{1*†}$ , Han Zhu $^{1*}$ , Jiaming Ji $^{2}$ , Mengze Li $^{1}$ , Jipeng Zhang $^{1}$ , Ruiyuan Zhang $^{1}$ , Jia Zhu $^{3}$ , Jiajie Xu $^{4}$ , Sirui Han $^{1‡}$ , Yike Guo $^{1‡}$
4
+
5
+ <sup>1</sup>The Hong Kong University of Science and Technology, <sup>2</sup>Peking University,
6
+
7
+ <sup>3</sup>Zhejiang Key Laboratory of Intelligent Education Technology and Application, Zhejiang Normal University, <sup>4</sup>Soochow University
8
+
9
+ # Abstract
10
+
11
+ Legal judgment prediction (LJP) aims to function as a judge by making final rulings based on case claims and facts, which plays a vital role in the judicial domain for supporting court decision-making and improving judicial efficiency. However, existing methods often struggle with logical errors when conducting complex legal reasoning. We propose LegalReasoner, which enhances LJP reliability through step-wise verification and correction of the reasoning process. Specifically, it first identifies dispute points to decompose complex cases, and then conducts step-wise reasoning while employing a process verifier to validate each step's logic from correctness, progressiveness, and potential perspectives. When errors are detected, expert-designed attribution and resolution strategies are applied for correction. To fine-tune LegalReasoner, we release the LegalHK dataset, containing 58,130 Hong Kong court cases with detailed annotations of dispute points, step-by-step reasoning chains, and process verification labels. Experiments demonstrate that Legal-Reasoner significantly improves concordance with court decisions from 72.37 to 80.27 on LLAMA-3.1-70B. The data is available at https://huggingface.co/datasets/weijiezz/LegalHK.
12
+
13
+ # 1 Introduction
14
+
15
+ Legal judgment prediction (LJP) aims to function as a judge by predicting rulings based on facts of legal cases. It serves crucial roles in supporting legal decision-making processes, improving judicial efficiency and justice (Cui et al., 2023), and enabling citizens to grasp potential case outcomes without expensive legal consultation (Feng et al., 2022a). However, when confronted with complex cases, LJP requires a highly specialized ability to
16
+
17
+ capture key points of cases and conduct a thorough analysis to reach reliable and well-founded conclusions.
18
+
19
+ Unfortunately, existing LJP methods overlook the importance of logical reasoning in judicial decision-making. While BERT-based models like LegalBERT (Chalkidis et al., 2019, 2020) and ju-rBERT (Masala et al., 2024) have demonstrated promising results, they inherently lack logical reasoning capabilities. Although large language models (LLMs) have shown significant improvements in executing complex multi-step reasoning through carefully designed prompts (Trautmann et al., 2022), retrieval-augmented generation (Santosh et al., 2024), and fine-tuning (Ammar et al., 2024), even state-of-the-art LLMs still frequently exhibit logical errors. To remedy the reasoning vulnerabilities of LLMs in the LJP task, particularly when dealing with high-complexity cases, there is a critical need for both guided reasoning and robust verification mechanisms that can detect and rectify logical errors throughout the inference process.
20
+
21
+ To enable effective legal reasoning, there are a series of challenges to maintain logical consistency and generate well-founded judgments. First, legal cases often involve implicit causal relations and contentions, making them more complex. Second, the lack of effective process supervisors in judicial reasoning makes it challenging to monitor and validate the logical flow of legal analysis, potentially leading to errors and inconsistent conclusions. Third, addressing reasoning errors requires problem attribution and solutions, with each type of error demanding a tailored remediation approach. For instance, when legal provisions are misunderstood, we need to review the relevant laws for clarity. Similarly, when reasoning doesn't match case facts, we must check that the logic aligns with the evidence.
22
+
23
+ In this paper, we propose LegalReasoner, which first identifies the disputes to decompose complex
24
+
25
+ ![](images/81c0fe9272bc420b3f794692e038d3d6a9809b7b951203d507e943f6b7956d99.jpg)
26
+ Figure 1: An illustration of legal judgment prediction. LegalReasoner first breaks down the process into identifying disputes, and then subsequent reasoning steps are monitored by a verifier. If errors occur, they are traced back to predefined issues and corrected by tailored strategies, ensuring reliable judicial reasoning.
27
+
28
+ cases, and then step-wise verifies and corrects potential errors in the legal reasoning process as depicted in Figure 1. To facilitate legal case decomposition and reasoning, we construct LegalHK, a comprehensive dataset containing 58,130 Hong Kong court cases, which are annotated with dispute points, evidence analysis, relevant statutory provisions, precedent citations, and step-by-step reasoning chains leading to final judgments. Upon this foundation, a process verifier is proposed to validate each legal reasoning step. When reasoning errors are detected, our correct component first attributes to specific error types designed by legal experts, such as legal principle misapplication, discrepancy between facts and reasoning, etc. Next, it activates targeted problem-solving mechanisms to address these issues through tailored strategies, like provision retrieval, fact tracking, enforcement pathway analysis, etc. Our key contributions can be summarized as follows:
29
+
30
+ - To ensure the reliability of judicial reasoning, we propose a process verifier to detect errors at each step, complemented by expert-designed attribution and resolution strategies to correct errors.
31
+ - To enhance case decomposition and structured reasoning in LLMs, we open-source the LegalHK dataset with detailed annotations.
32
+ - To the best of our knowledge, we are the first to propose verification and correction mechanisms for the legal reasoning process, improving concordance with court decisions from 72.37 to 80.27 on LLAMA-3.1-70B.
33
+
34
+ # 2 Related Work
35
+
36
+ # 2.1 Legal Judgment Prediction
37
+
38
+ Existing Legal judgment prediction (LJP) methods primarily fall into two categories: BERT-based and LLM-based approaches. BERT-based methods treat the LJP task as a multi-class classification to identify appropriate charges (Huang et al., 2024; de Arriba-Pérez et al., 2022). To enhance legal knowledge, many researchers (Chalkidis et al., 2019, 2020) focused on fine-tuning by legal corpora. Feng et al. (2022b) and Deroy et al. (2024) supplied judgment information by constrained event extraction and document summarization, respectively. Masala et al. (2024) introduced Longformer and SLiding Encoder-Decoder (Ivgi et al., 2023) to handle long legal documents, while Liu et al. (2022) incorporated case-based contrastive embedding enhancement. Nevertheless, these methods focus on picking up the token-level clues instead of thinking based on facts.
39
+
40
+ Recently, with the rise of LLMs, carefully designed legal prompts have been employed for judicial decision-making (Trautmann et al., 2022). ChatLaw (Cui et al., 2024) utilized multi-agent collaboration, while Santosh et al. (2024) incorporated precedents as judgment references to enhance reliability. These methods have been adapted for various regions and languages, including China (Sun et al., 2024), Europe (Santosh et al., 2024), Korea (Hwang et al., 2022), etc (Millan-Arias et al., 2023; Masala et al., 2024). Despite LLMs placing greater emphasis on reasoning, frequent logical errors lead to incorrect final predictions.
41
+
42
+ # 2.2 LLMs Reasoning and Verification
43
+
44
+ Although LLMs have demonstrated excellent potential in handling complex tasks, the accumula
45
+
46
+ tion of reasoning errors remains a serious challenge. Lightman et al. (2023) showed that models trained using process rewards outperform those supervised by outcome rewards. To automatically annotate training datasets for process rewards, MathShepherd (Wang et al., 2024) and ReST-MCTS (Zhang et al., 2024) defined it based on their potential to deduce the correct final answer.
47
+
48
+ To address reasoning errors, researchers have explored LLM self-correction based on output feedback. SELF-REFINE (Madaan et al., 2024) introduced an iterative self-improvement strategy, while REFINER (Paul et al., 2023) and $Re^3$ (Yang et al., 2022) employed dedicated critic models to provide step-by-step feedback. For code generation, CRITIC (Gou et al., 2023) leveraged external verification tools and fed their critiques back to LLMs. However, these process supervision approaches have mainly been applied to mathematical and coding tasks, and cannot adapt to the LJP task.
49
+
50
+ # 3 Task Definition
51
+
52
+ Given a legal case $c$ consisting of a plaintiff's claim $c_{\text{claim}}$ and factual descriptions $c_{\text{fact}}$ , we aim to perform judicial reasoning $\{s_i\}_{i=1}^n$ , where each step $s_i$ represents a distinct reasoning component. The goal is to generate judgments $\{j_k\}_{k=1}^m$ covering all judgment items provided by the court and ultimately summarize a final decision $d \in \{0,1\}$ , where $d = 1$ indicates support for the plaintiff's claim and $d = 0$ indicates rejection.
53
+
54
+ # 4 Methodology
55
+
56
+ To achieve LJP, LegalReasoner first identifies dispute points to decompose the core issues at hand, then conducts step-by-step reasoning to reach a judgment. During the reasoning process, a process verifier is employed to continuously monitor and validate the logic of each reasoning step. When reasoning flaws are detected, the correction component analyzes the nature of the error and implements targeted solutions to ensure the reliability of the final judgment.
57
+
58
+ # 4.1 Dataset Construction
59
+
60
+ To enable LLMs to learn dispute identification and conduct reasoning centered around these disputes, we first need to construct a suitable dataset.
61
+
62
+ Corpus Source. We collected 185,495 Hong Kong judicial cases<sup>1</sup> from 1900 to 2023, encompass
63
+
64
+ passing ten types of judicial decisions: Court of First Instance, Competition Tribunal, Family Court, Magistrates' Courts, etc. We excluded cases from the Court of Appeal and Court of Final Appeal as their official case descriptions are often abbreviated and incomplete.
65
+
66
+ Data Compression and Structuring. Considering there are extensive lengthy judicial documents, we first performed data compression (Pan et al., 2024), removing redundant characters while fully preserving semantics. The processed documents were reduced to approximately one-third to one-half of their original length. Next, we employed GPT-4 to extract structured information from judicial documents as depicted in Figure 5.
67
+
68
+ Refinement and Filtering. To ensure data quality, we implemented a three-fold refinement and filtering process: 1) We filtered out cases with missing essential components such as plaintiff's claim, dispute points, or legal judgment. 2) To ensure the fact description contained sufficient knowledge to produce judgments consistent with the court's decisions, we augmented it using GPT-4 based on the original document, extracted court reasoning, and legal judgment. 3) To prevent the fact description from revealing the judgment results prematurely, we conducted a thorough verification using both GPT-4 and manual review by judicial experts. After this comprehensive filtering process, the final dataset consisted of 58,130 cases.
69
+
70
+ Based on the extracted dispute points, stepwise reasoning, and final judgments from our dataset, we can fine-tune LLMs to learn a judicial reasoning approach that first decomposes cases around key disputes before conducting detailed legal analysis and reaching decisions.
71
+
72
+ # 4.2 Step-wised Verification-Correction
73
+
74
+ To enhance robustness and prevent the accumulation of errors during judicial reasoning, supervision of each step is crucial. Inspired by "LLM as a judge" (Zheng et al., 2023) and "verify step by step" approaches (Lightman et al., 2023; Wang et al., 2024), which utilize multiple LLMs or train dedicated process verifiers, we note that these methods are primarily designed for mathematics or general question-answering tasks. To adapt to the unique demands of judicial reasoning, we have developed a specialized verification and correction module specifically tailored for legal reasoning at each process step as shown in Figure 2.
75
+
76
+ ![](images/466ba13b83bcd4f2b47a5bb6b089abc01d6bc91726649ea571372cc783e807aa.jpg)
77
+ Figure 2: Automatic annotation for step-wised verification-correction.
78
+
79
+ # 4.2.1 Process Verifier
80
+
81
+ The Process Verifier assigns a score to each reasoning step in the sequence $\{s_i\}_{i=1}^n$ . It is built upon an LLM foundation, with fine-tuning focused on optimizing probability distributions across designated special tokens through:
82
+
83
+ $$
84
+ \mathcal {L} _ {\mathrm {P V}} = - \sum_ {i = 1} ^ {n} y _ {s _ {i}} \log r _ {s _ {i}} + (1 - y _ {s _ {i}}) \log \left(1 - r _ {s _ {i}}\right), \tag {2}
85
+ $$
86
+
87
+ where $y_{s_i} \in [0,1]$ represents the quality score of the $i$ -th reasoning step $s_i$ , $r_{s_i}$ is the sigmoid score of $s_i$ assigned by the verifier, and $n$ is the total number of reasoning steps in the sequence $\{s_i\}_{i=1}^n$ .
88
+
89
+ To automate the construction of label data $y_{s_i}$ for training the process verifier, we evaluate each reasoning step from three perspectives: Correctness, Progressiveness, and Potential. Specifically, Correctness measures whether the current reasoning step aligns with the facts presented in the case and follows proper legal logic, avoiding contradictions with established evidence. Progressiveness represents the effectiveness of advancing the reasoning toward the final judgment. Both metrics are evaluated through specialized prompts that enable GPT-4 to perform comparisons between case facts, annotated court reasoning, and judgment decisions. Potential indicates the capacity to generate correct judgments by sampling N possible judgment outcomes based on the current reasoning sequence $\{s_i\}_{i=1}^k$ . The potential score is formally defined as:
90
+
91
+ $$
92
+ \operatorname {P o t e n t i a l} \left(s _ {k}\right) = \frac {\sum_ {j = 1} ^ {N} \mathbb {I} \left(\left\{s _ {i} \right\} _ {i = 1} ^ {k} , \hat {s} _ {k + 1} ^ {j} , \dots , \hat {s} _ {n} ^ {j} \rightarrow d ^ {*}\right)}{N} \tag {2}
93
+ $$
94
+
95
+ where $s_k$ is the current reasoning step being evaluated, $\hat{s}_{k+1}^j, \dots, \hat{s}_n^j$ denotes the $j$ -th sampled completion of the remaining reasoning steps, $\mathbb{I}(\cdot)$ is the indicator function, $d^*$ is the true judgment decision from the court, and $N$ is the total number of sam
96
+
97
+ plies. Each aspect corresponds to a special token: [Correctness] [Progressiveness], and [Potential].
98
+
99
+ Finally, we take the minimum score among these three metrics as the final score for the current reasoning step, deliberately avoiding averaging manners that might assign inappropriately high scores to incorrect or ineffective reasoning steps. If the final score falls below a predetermined threshold $T$ , the reasoning step will be flagged as erroneous.
100
+
101
+ # 4.2.2 Problem Attributing and Solving
102
+
103
+ Once the Process Verifier identifies an error in the reasoning process, it is essential to determine the type of error and apply appropriate remediation strategies.
104
+
105
+ Under the guidance of legal experts, we categorized common legal reasoning errors into eight types and subsequently designed corresponding correction strategies based on the characteristics of each error type. Here we present three examples, with complete details provided in Appendix B:
106
+
107
+ - Legal Principle Misapplication: This error encompasses the inadequate understanding and incorrect application of legal constituent elements, including misinterpretation of essential legal requirements, failure to establish necessary causal relationships, and improper analysis of legal preconditions. The correction strategy involves: (1) retrieval and analysis of relevant statutory provisions and authoritative case precedents to establish a solid legal foundation, (2) systematic verification of whether each constituent element has been properly established through referencing retrieved legal sources, and (3) rigorous examination of the logical connections between legal requirements and factual evidence, ensuring alignment with established legal interpretations.
108
+ - Discrepancy between Facts and Reasoning: This error occurs when reasoning conclusions
109
+
110
+ lack sufficient factual support or contradict case facts, commonly resulting from overlooking crucial evidence, making unfounded assumptions, or selectively interpreting facts. The correction strategy employs fact tracking to ensure reasoning validity: (1) establishing explicit links between current reasoning steps and their corresponding factual basis in case materials, (2) validating the sufficiency and relevance of referenced facts for supporting the current inference, and (3) revising the reasoning step to maintain strict alignment with tracked factual evidence.
111
+
112
+ - Errors in Compensation Scope: This type of error involves incorrect determination of compensation amounts, including improper calculation methods, overlooked compensation items, or exceeding legal compensation limits. The correction strategy implements a structured validation framework: (1) decomposing claimed compensation into atomic components and validating each against specific legal provisions, (2) applying Python scripts to ensure each component's calculation adheres to statutory formulas and prescribed limits, and (3) cross-referencing similar cases to benchmark compensation ratios and identifying potential outliers that require additional justification or adjustment.
113
+
114
+ # 5 Experiments
115
+
116
+ In this section, we first introduce the experimental setup, and then conduct extensive empirical studies and show the effectiveness of our LegalReasoner.
117
+
118
+ # 5.1 Experiment Setup
119
+
120
+ # 5.1.1 Datasets
121
+
122
+ In addition to our constructed LegalHK dataset, we utilized the latest CMDL dataset (Huang et al., 2024), both of which underwent refinement and filtering processes as described in Section 4.1. The LegalHK dataset is derived from Hong Kong court cases spanning from 1900 to 2023, encompassing both civil and criminal cases. It was filtered from 185,495 to 58,130 cases, covering 10 case types and 827 law articles. The CMDL dataset is a Chinese criminal case dataset, sourced from China Judgments Online $^{2}$ over the past 20 years. It was
123
+
124
+ filtered from 699,263 to 393,945 cases, containing nearly 1.2 million defendants and involving 321 charges and 275 law articles. We split both datasets into training (50%), validation (10%), and test (40%) sets to ensure robust model evaluation.
125
+
126
+ # 5.1.2 Metrics
127
+
128
+ To evaluate our model's performance on LPJ, we employ metrics at two granularity levels. At the case level, we use Case-Level Accuracy (CL-Acc) and Case-Level F1 (CL-F1) to assess the consistency between predicted support/reject decisions and actual court decisions. At the element level, we introduce Element Coverage (E-Cov) to measure the proportion of court judgment elements successfully captured in the model's output, and Element Precision (E-Pre) to quantify the accuracy of the judgment elements when compared against the official court ruling. To compute E-Cov and E-Pre, we use GPT-4 to assess the inclusion of court judgment elements and accuracy of predicted elements. Manual verification confirms that GPT-4's assessments align closely with human evaluation. Predictions of fines are deemed correct if they match the true amount's order of magnitude.
129
+
130
+ # 5.1.3 Baselines
131
+
132
+ We conduct experiments on both BERT-based and LLM-based methods. For BERT-based methods:
133
+
134
+ - NeuralJudge (Chalkidis et al., 2019) enhances pre-trained BERT with LJP-specific fine-tuning.
135
+ - LegalBERT (Chalkidis et al., 2020) pre-trains BERT on legal documents from scratch.
136
+ - JurBERT (Masala et al., 2024) extends LegalBERT with a Sliding Encoder for improved long-context understanding.
137
+ - Contrastive-LJP (Liu et al., 2022) employs case triples modeling and relational attention to enhance BERT embeddings.
138
+ - ML-LJP (Liu et al., 2023) integrates contrastive learning and Graph Attention Networks to model law article interactions.
139
+
140
+ For LLM-based methods, we compare against both general and legally specialized LLMs:
141
+
142
+ - LLAMA-3.1 and Qwen-2.5 represent state-of-the-art open-source language models.
143
+
144
+ <table><tr><td rowspan="2">Model</td><td colspan="4">LegalHK</td><td colspan="4">CMDL</td></tr><tr><td>CL-Acc</td><td>CL-F1</td><td>E-Cov</td><td>E-Pre</td><td>CL-Acc</td><td>CL-F1</td><td>E-Cov</td><td>E-Pre</td></tr><tr><td colspan="9">BERT-based methods</td></tr><tr><td>NeuralJudge</td><td>63.52</td><td>61.27</td><td>13.62</td><td>14.41</td><td>57.48</td><td>55.39</td><td>12.85</td><td>13.56</td></tr><tr><td>LegalBERT</td><td>64.23</td><td>61.92</td><td>14.08</td><td>14.87</td><td>58.31</td><td>56.24</td><td>13.28</td><td>13.97</td></tr><tr><td>JurBERT</td><td>63.91</td><td>61.63</td><td>13.84</td><td>14.71</td><td>57.96</td><td>55.92</td><td>13.14</td><td>14.32</td></tr><tr><td>Contrastive-LJP</td><td>65.34</td><td>62.53</td><td>14.37</td><td>15.16</td><td>59.23</td><td>56.93</td><td>13.08</td><td>14.27</td></tr><tr><td>ML-LJP</td><td>64.92</td><td>62.21</td><td>14.40</td><td>15.02</td><td>58.83</td><td>56.52</td><td>13.42</td><td>14.12</td></tr><tr><td colspan="9">LLM-based methods</td></tr><tr><td>LLAMA-3.1-8B</td><td>61.59</td><td>21.05</td><td>32.23</td><td>28.42</td><td>58.32</td><td>20.14</td><td>20.21</td><td>21.33</td></tr><tr><td>+ Fine-tuning</td><td>64.47</td><td>58.52</td><td>45.48</td><td>46.52</td><td>60.27</td><td>55.64</td><td>43.61</td><td>44.15</td></tr><tr><td>LLAMA-3.1-70B</td><td>70.23</td><td>67.75</td><td>52.34</td><td>53.57</td><td>65.96</td><td>63.42</td><td>50.25</td><td>51.39</td></tr><tr><td>+ Fine-tuning</td><td>72.37</td><td>68.74</td><td>54.58</td><td>55.70</td><td>68.21</td><td>64.54</td><td>52.13</td><td>53.26</td></tr><tr><td>Qwen-2.5-7B</td><td>66.01</td><td>53.29</td><td>45.86</td><td>46.91</td><td>61.81</td><td>50.22</td><td>43.73</td><td>44.87</td></tr><tr><td>+ Fine-tuning</td><td>71.42</td><td>64.70</td><td>51.34</td><td>52.45</td><td>67.32</td><td>60.54</td><td>49.12</td><td>50.27</td></tr><tr><td>Qwen-2.5-14B</td><td>69.84</td><td>67.30</td><td>49.96</td><td>51.07</td><td>65.42</td><td>63.24</td><td>47.82</td><td>48.93</td></tr><tr><td>+ Fine-tuning</td><td>71.74</td><td>67.21</td><td>54.15</td><td>55.25</td><td>68.58</td><td>63.14</td><td>51.93</td><td>53.04</td></tr><tr><td>Qwen-2.5-72B</td><td>70.75</td><td>69.55</td><td>53.84</td><td>54.95</td><td>66.52</td><td>65.42</td><td>51.63</td><td>52.74</td></tr><tr><td>+ Fine-tuning</td><td>72.99</td><td>69.68</td><td>55.15</td><td>55.26</td><td>68.82</td><td>65.53</td><td>52.84</td><td>53.95</td></tr><tr><td>ChatGPT</td><td>71.43</td><td>67.86</td><td>53.93</td><td>55.04</td><td>66.35</td><td>63.72</td><td>51.84</td><td>52.95</td></tr><tr><td>GPT-4</td><td>73.53</td><td>70.92</td><td>61.15</td><td>62.25</td><td>68.42</td><td>66.83</td><td>57.93</td><td>57.04</td></tr><tr><td>Claude-3.5-Sonnet</td><td>73.80</td><td>70.93</td><td>62.83</td><td>62.96</td><td>68.74</td><td>67.83</td><td>58.65</td><td>57.71</td></tr><tr><td>GPT-o1</td><td>77.15</td><td>72.13</td><td>62.92</td><td>63.14</td><td>72.03</td><td>68.35</td><td>59.54</td><td>59.12</td></tr><tr><td>Dependency-LJP</td><td>66.61</td><td>60.27</td><td>47.40</td><td>48.49</td><td>62.64</td><td>57.22</td><td>45.01</td><td>46.43</td></tr><tr><td>Precedents-LJP</td><td>67.83</td><td>61.94</td><td>48.82</td><td>49.13</td><td>63.32</td><td>58.43</td><td>46.62</td><td>47.94</td></tr><tr><td colspan="9">Our method</td></tr><tr><td>LegalReasoner</td><td>80.27</td><td>76.33</td><td>64.59</td><td>65.41</td><td>76.95</td><td>72.04</td><td>62.20</td><td>62.36</td></tr></table>
145
+
146
+ Table 1: Overall performance on LegalHK and CMDL datasets. Bold numbers indicate the best score across all models, while underlined numbers represent the best score within each category.
147
+
148
+ - ChatGPT, GPT-4, GPT-o1, and Claude-3.5-Sonnet demonstrate strong performance as proprietary models.
149
+ - Dependency-LJP (Huang et al., 2021) adopts T5 to model logical dependencies in legal judgments.
150
+ - Precedents-LJP (Santosh et al., 2024) leverages relevant precedent cases to enhance prediction accuracy.
151
+
152
+ # 5.1.4 Implementation Details
153
+
154
+ For all BERT-based baselines and open-source LLMs, we fine-tuned them on the LegalHK and CMDL datasets, using plaintiffs' claims and fact descriptions as input and Legal Judgments as labels. For legally specialized LLMs, we utilized LLAMA-3.1-70B as the foundation model along with carefully designed prompts following Trautmann et al. (2022).
155
+
156
+ LegalReasoner consists of two components: a Reasoner and a Verifier, both based on LLAMA-3.1-70B. The Reasoner is fine-tuned on Disputes and Step-wise Reasoning data from LegalHK. The Verifier is fine-tuned using error detection and attribution data annotated as described in Section 4.2, with detailed training examples provided in
157
+
158
+ Appendix A. We conducted the fine-tuning process using the Llama factory framework (Zheng et al., 2024), employing the AdamW optimizer with a learning rate of 1e-5 and weight decay of 0.01, along with a Cosine learning rate schedule. The training epoch is set to 3. The threshold $T$ in process verifier is 0.5. In the correction module, we employ BGE as the case retriever, utilize LLAMA-3.1-8B with dictionary tree pruning for hierarchical statutory provision retrieval, and use LLAMA-3.1-70B for both reflection and Python script generation.
159
+
160
+ # 5.2 Experimental Results
161
+
162
+ Table 1 presents the performance comparison of various methods on LegalHK and CMDL. Among BERT-based methods, Contrastive-LJP achieves the best performance on most metrics for both datasets, with Case-Level Accuracy of 65.34 and 59.23 on LegalHK and CMDL respectively. The performance gap between different BERT-based models is relatively small, suggesting that these architectures may have reached their capacity limits for legal judgment prediction. The notably low E-Cov and E-Pre scores (around 13-15 for all BERT-based methods) indicate their limited ability to cap
163
+
164
+ ture and analyze detailed judgment elements, revealing significant challenges in fine-grained legal analysis.
165
+
166
+ For LLM-based methods, we observe a clear correlation between model size and performance, with larger models consistently outperforming their smaller counterparts. Fine-tuning on the LJP task significantly improves performance across all open-source LLMs, like Qwen-2.5-72B achieving incremental gains after fine-tuning from 70.75 CLAcc to 72.99 CL-Acc on LegalHK. Among proprietary models, GPT-o1 demonstrates superior performance, achieving 77.15 CL-Acc on LegalHK and 72.03 on CMDL, demonstrating its strong reasoning capabilities in analyzing complex legal scenarios.
167
+
168
+ Our proposed LegalReasoner outperforms all baseline methods across both datasets and all metrics. Compared to the strongest baseline (GPT-o1), it achieves gains of 3.12 in CL-Acc and 5.20 in CL-F1 on LegalHK, with even larger improvements of 4.92 in CL-Acc and 3.69 in CL-F1 on CMDL. The superior performance can be attributed to two key factors: the Reasoner component's dispute identification and step-wise reasoning approach that enables structured legal analysis, and the Verifier component that helps identify and correct potential errors. This effectiveness is particularly reflected in the element-level metrics, where we see improvements of 2.67 in E-Cov and 3.27 in E-Pre on LegalHK. The stronger performance on CMDL further demonstrates our model's capability in handling complex criminal cases. Even when using open-source models, we can achieve performance that surpasses GPT-o1.
169
+
170
+ # 5.3 Ablation Studies
171
+
172
+ To systematically evaluate the effectiveness of different components in LegalReasoner, we conduct comprehensive ablation studies by creating several model variants and analyzing their performance on both datasets:
173
+
174
+ - LLAMA-3.1-70B: The baseline model finetuned on the LJP task.
175
+ - LegalReasoner w/o Disputes: Removes the dispute identification component.
176
+ - LegalReasoner w/o SWR: Removes step-wise reasoning, generating judgments directly.
177
+ - LegalReasoner w/o VC: Removes verification-correction mechanism.
178
+
179
+ - LegalReasoner w/ LLM-Verifier: Replaces our Process Verifier with direct LLM prompting for verification.
180
+ - LegalReasoner w/ Judge-Verifier: Substitutes our ProcessVerifier with the "LLM as judge" approach (Zheng et al., 2023).
181
+
182
+ As shown in Table 2, removing dispute identification significantly impairs performance, with CL-Acc falling by 4.32 on LegalHK and 3.87 on CMDL. This demonstrates that decomposing complex cases into key disputes helps the model focus on critical issues and conduct more targeted analysis. The absence of step-wise reasoning also notably impacts performance as CL-Acc drops by 10.78 on LegalHK, indicating its importance in maintaining logical consistency throughout the reasoning process.
183
+
184
+ Further experiments on verification mechanisms reveal their crucial role in model performance. The removal of our verification-correction mechanism leads to substantial degradation, with CL-Acc declining by 5.78 on LegalHK and 5.95 on CMDL. Alternative approaches also show limitations: the LLM-Verifier variant achieves a 2.15 percentage point lower CL-Acc due to its lack of specialized legal knowledge, while the Judge-Verifier approach exhibits a 1.87 percentage point decrease in CL-Acc. In element-level metrics, E-Cov decreases by 2.17 on LegalHK and 2.47 on CMDL, validating the effectiveness of our process verifier. A more detailed analysis of each correction strategy can be found in Appendix C.
185
+
186
+ # 5.4 Comparison of Verification-Correction and Best of N
187
+
188
+ To further validate Verification-Correction approaches, we examine multiple sampling strategies where each case is processed multiple times $(N = 10)$ , with a verifier selecting the optimal prediction from the generated candidates, called Best of N. We compare several variants: Self-consistency (Wang et al., 2022) uses majority voting across reasoning paths, Outcome Verifier only evaluates final judgments, General Process Verifier (Lightman et al., 2023) employs a general reasoning corpus, and Legal Process Verifier utilizes training from LegalHK.
189
+
190
+ Results in Figure 3 show LegalReasoner outperforms all Best of N variants, achieving CL-Acc scores of 80.27 on LegalHK and 76.95 on CMDL. The Legal Process Verifier performs best among
191
+
192
+ <table><tr><td rowspan="2">Model Variant</td><td colspan="4">LegalHK</td><td colspan="4">CMDL</td></tr><tr><td>CL-Acc</td><td>CL-F1</td><td>E-Cov</td><td>E-Pre</td><td>CL-Acc</td><td>CL-F1</td><td>E-Cov</td><td>E-Pre</td></tr><tr><td>LLAMA-3.1-70B</td><td>72.37</td><td>68.74</td><td>54.58</td><td>55.70</td><td>68.21</td><td>64.54</td><td>52.13</td><td>53.26</td></tr><tr><td>LegalReasoner w/o Disputes</td><td>75.95</td><td>73.82</td><td>61.92</td><td>63.84</td><td>73.08</td><td>68.93</td><td>59.45</td><td>59.32</td></tr><tr><td>LegalReasoner w/o SWR</td><td>69.49</td><td>65.27</td><td>54.31</td><td>55.23</td><td>66.84</td><td>62.58</td><td>52.15</td><td>53.02</td></tr><tr><td>LegalReasoner w/o VC</td><td>74.49</td><td>71.36</td><td>56.47</td><td>58.39</td><td>71.00</td><td>67.87</td><td>55.08</td><td>56.95</td></tr><tr><td>LegalReasoner w/ LLM-Verifier</td><td>78.12</td><td>74.69</td><td>61.84</td><td>62.76</td><td>74.31</td><td>70.18</td><td>59.45</td><td>60.32</td></tr><tr><td>LegalReasoner w/ Judge-Verifier</td><td>78.40</td><td>74.87</td><td>62.42</td><td>63.34</td><td>74.59</td><td>70.76</td><td>60.03</td><td>60.90</td></tr><tr><td>LegalReasoner (Full)</td><td>80.27</td><td>76.33</td><td>64.59</td><td>65.41</td><td>76.95</td><td>72.04</td><td>62.20</td><td>62.36</td></tr></table>
193
+
194
+ Table 2: Ablation study results showing the impact of different components in LegalReasoner, where SWR represents Step-Wise Reasoning, VC represents Verification-Correction mechanism, and w/o denotes without.
195
+
196
+ ![](images/4b68595eca9d8a4b8c3c52f63b4130564d1bf7d51b54faccaec6f1c37ccd51b7.jpg)
197
+ (a) CL-Acc
198
+
199
+ ![](images/b2cde855c60114d3c0d361bf81d2b6f9d3d7be40c6b786b238acda2b51b304dc.jpg)
200
+ (b) E-Cov
201
+ Figure 4: Assessment of automatic annotations for process verification and attribution, where Corr stands for Correctness, Prog for Progressiveness, and Pot for Potential.
202
+
203
+ Best of N approaches with 76.82 on LegalHK and 74.55 on CMDL, while general approaches achieve around 74-75 on LegalHK and 71-72 on CMDL. As shown in Table 2, these scores match LegalReasoner's base performance of 74.49 without verification-correction, suggesting that increased sampling without proper error correction offers limited improvement in legal reasoning.
204
+
205
+ # 5.5 Quality of Automatic Annotations
206
+
207
+ To explore the quality of our automatic dataset, we manually annotated 160 reasoning steps randomly sampled from the training set of LegalHK. We employed different models to infer labels for each step and compared their performance.
208
+
209
+ Quality of Automatic Annotations. As shown in Figure 4(a), we evaluated both verification accuracy and attribution accuracy across different models. DeBERTa achieves verification accuracy of 71.2 and attribution accuracy of 65.4. LLAMA-3.1-70B with carefully designed prompts shows improved performance, reaching 76.8 and 72.3 respectively. GPT-4 further enhances the results to 83.5 and 79.1. Our fine-tuned Process Verifier demonstrates the best performance with 85.7 verification accuracy and 81.5 attribution accuracy, indicating
210
+
211
+ ![](images/09535172b6b6c83ad02d60e9227c79e3be78abef6be7a141cb6af4e7ccc6e7eb.jpg)
212
+ Figure 3: Comparison of Best of N (BON) and our approach, where SC is Self-consistency, OV is Outcome Verifier, GPV is General Process Verifier, and LPC is Legal Process Verifier.
213
+
214
+ ![](images/561c0172adb6dc4f861a6e391af92a1ac319fccef2033fbc1b99d4fcc90be551.jpg)
215
+ (a) Annotator Accuracy
216
+ (b) Impact of Verification Aspects
217
+
218
+ that our automatic annotation process achieves satisfactory quality.
219
+
220
+ Impact of Verification Perspectives. As shown in Figure 4(b), we evaluate each reasoning step from three perspectives: Correctness, Progressiveness, and Potential. The full model achieves 85.7 verification accuracy, while removing each perspective leads to different levels of performance degradation. Correctness proves crucial, with accuracy dropping to 80.6, while accuracy decreases to 78.3 without Potential and to 83.2 without Progressiveness. These results validate the effectiveness of our multi-perspective verification in generating quality training data for LegalReasoner.
221
+
222
+ # 6 Conclusion
223
+
224
+ In this paper, we proposed LegalReasoner to enhance the reliability of legal judgment prediction through step-wise verification and correction on the reasoning process. It first identifies dispute points to decompose complex cases and employs a process verifier to validate each reasoning step's logic. For errors detected, expert-designed strategies are applied for correction. We also released the LegalHK dataset with 58,130 annotated Hong
225
+
226
+ Kong court cases for the training of LegalReasoner. Experimental results demonstrated significant improvements over existing methods across multiple datasets.
227
+
228
+ # Limitations
229
+
230
+ Our work has several important limitations that should be acknowledged:
231
+
232
+ First, the computational cost of our verification-correction process is substantial. While the Process Verifier improves prediction reliability, it requires significant computing resources to validate each reasoning step and implement corrections. This is particularly evident when handling complex cases with multiple dispute points and lengthy reasoning chains. Our approach essentially extends the chain-of-thought (CoT) paradigm by adding verification and correction mechanisms at each step, resulting in longer and more complex reasoning pathways that demand additional computational overhead. However, compared to Best of N sampling approaches which require multiple complete reasoning paths to be generated, our single-path verification-correction method actually achieves better performance with lower computational cost. Although this cost is still lower than human legal analysis, it may limit the method's applicability in resource-constrained environments.
233
+
234
+ Second, the automatic annotation process for training the Process Verifier contains inherent noise. While our experiments demonstrate the effectiveness of our approach, the quality of verification labels generated through automated means may not fully match human expert annotations. This is particularly relevant for the scoring of reasoning steps from correctness, progressiveness, and potential perspectives. A comprehensive comparison between human and automated annotations could provide valuable insights for future improvements.
235
+
236
+ Third, while our model shows strong performance in the Chinese legal system, its generalizability to other jurisdictions requires further investigation. Different legal systems may have varying approaches to case analysis and judgment formation, which could affect the effectiveness of our dispute identification and reasoning verification mechanisms. Future work could explore adapting our approach to diverse legal frameworks and validating its performance across different jurisdictions.
237
+
238
+ # Ethics Statement
239
+
240
+ Our work utilizes publicly available court judgments from Hong Kong and Chinese court databases, which have undergone official anonymization processes by their respective judicial authorities. Personal information in these cases has been handled according to established judicial privacy protocols: private individuals' information is anonymized in the source documents, while information about public figures and companies remains unchanged as per standard legal practice. We do not perform additional anonymization beyond these official procedures.
241
+
242
+ It is crucial to acknowledge that training models on historical legal decisions may perpetuate existing biases in the judicial system. While our model shows improved accuracy in legal reasoning, it inherits biases both from the historical data and the pre-trained language models used as its foundation. This could potentially lead to disparities in performance across different demographic groups or case types.
243
+
244
+ We emphasize that LegalReasoner is developed as a research tool to advance our understanding of legal reasoning in AI systems, not as a replacement for human judicial decision-making. The legal judgment prediction (LJP) task raises significant ethical and legal concerns, particularly regarding the role of automated systems in judicial processes. We do not advocate for the direct deployment of LJP systems in courts. Instead, our research aims to explore how AI systems can better understand and process legal reasoning patterns while maintaining transparency and accountability.
245
+
246
+ The step-wise verification and correction mechanisms in LegalReasoner are designed to make the reasoning process more transparent and analyzable, allowing for better scrutiny of potential biases and errors. However, these mechanisms should be viewed as technical contributions toward more reliable and explainable legal AI systems, rather than as solutions for automated judicial decision-making.
247
+
248
+ Our research group remains committed to developing AI systems that can assist legal professionals while maintaining high standards of ethical responsibility, transparency, and fairness. We encourage future research to further investigate the ethical implications of legal AI systems and develop more robust methods for bias detection and mitigation.
249
+
250
+ # Acknowledgments
251
+
252
+ This work is funded in part by the HKUST Startup Fund (R9911), Theme-based Research Scheme grant (No. T45-205/21-N), the InnoHK funding for Hong Kong Generative AI Research and Development Center, Hong Kong SAR, the National Natural Science Foundation of China (Grant No. 62102277), the National Key R&D Program of China under Grant No. 2022YFC3303600, and the Zhejiang Provincial Natural Science Foundation of China under Grant No. LY23F020010.
253
+
254
+ # References
255
+
256
+ Adel Ammar, Anis Koubaa, Bilel Benjirda, Omer Naca, and Serry Sibae. 2024. Prediction of arabic legal rulings using large language models. *Electronics*, 13(4):764.
257
+ Ilias Chalkidis, Ion Androutsopoulos, and Nikolaos Aletras. 2019. Neural legal judgment prediction in english. arXiv.
258
+ Ilias Chalkidis, Manos Fergadiotis, Prodromos Malakasiotis, Nikolaos Aletras, and Ion Androutsopoulos. 2020. Legal-bert: The muppets straight out of law school. arXiv.
259
+ Jiaxi Cui, Munan Ning, Zongjian Li, Bohua Chen, Yang Yan, Hao Li, Bin Ling, Yonghong Tian, and Li Yuan. 2024. Chatlaw: A multi-agent collaborative legal assistant with knowledge graph enhanced mixture-of-experts large language model. arXiv.
260
+ Junyun Cui, Xiaoyu Shen, and Shaochun Wen. 2023. A survey on legal judgment prediction: Datasets, metrics, models and challenges. IEEE Access.
261
+ Francisco de Arriba-Pérez, Silvia García-Méndez, Francisco J González-Castano, and Jaime González-González. 2022. Explainable machine learning multi-label classification of spanish legal judgements. Journal of King Saud University-Computer and Information Sciences, 34(10):10180-10192.
262
+ Aniket Deroy, Kripabandhu Ghosh, and Saptarshi Ghosh. 2024. Ensemble methods for improving extractive summarization of legal case judgements. Artificial Intelligence and Law, 32(1):231-289.
263
+ Yi Feng, Chuanyi Li, and Vincent Ng. 2022a. Legal judgment prediction: A survey of the state of the art. In *IJCAI*, pages 5461-5469.
264
+ Yi Feng, Chuanyi Li, and Vincent Ng. 2022b. Legal judgment prediction via event extraction with constraints. In ACL, pages 648-664.
265
+ Zhibin Gou, Zhihong Shao, Yeyun Gong, Yelong Shen, Yujiu Yang, Nan Duan, and Weizhu Chen. 2023. Critic: Large language models can self-correct with tool-interactive critiquing. arXiv.
266
+
267
+ Wanhong Huang, Yi Feng, Chuanyi Li, Honghan Wu, Ji-dong Ge, and Vincent Ng. 2024. Cmdl: A large-scale chinese multi-defendant legal judgment prediction dataset. In Findings of ACL, pages 5895-5906.
268
+ Yunyun Huang, Xiaoyu Shen, Chuanyi Li, Jidong Ge, and Bin Luo. 2021. Dependency learning for legal judgment prediction with a unified text-to-text transformer. arXiv.
269
+ Wonseok Hwang, Dongjun Lee, Kyoungyeon Cho, Hanuhl Lee, and Minjoon Seo. 2022. A multi-task benchmark for korean legal language understanding and judgement prediction. NIPS, 35:32537-32551.
270
+ Maor Ivgi, Uri Shaham, and Jonathan Berant. 2023. Efficient long-text understanding with short-text models. TACL, 11:284-299.
271
+ Hunter Lightman, Vineet Kosaraju, Yura Burda, Harri Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. 2023. Let's verify step by step. arXiv.
272
+ Dugang Liu, Weihao Du, Lei Li, Weike Pan, and Zhong Ming. 2022. Augmenting legal judgment prediction with contrastive case relations. In Proceedings of the 29th International Conference on Computational Linguistics, pages 2658-2667.
273
+ Yifei Liu, Yiquan Wu, Yating Zhang, Changlong Sun, Weiming Lu, Fei Wu, and Kun Kuang. 2023. Ml-ljp: multi-law aware legal judgment prediction. In SIGIR, pages 1023-1034.
274
+ Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreff, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, et al. 2024. Self-refine: Iterative refinement with self-feedback. NIPS, 36.
275
+ Mihai Masala, Traian Rebedea, and Horia Velicu. 2024. Improving legal judgement prediction in Romanian with long text encoders. arXiv.
276
+ Cristian Millan-Arias, Marie Chantelle C Medina, Jean Felipe C Ferreira, Lucas M Da Silva Oliveira, Allana Rocha, Leandro Honorato de S Silva, Cleyton Mario O Rodrigues, João Fausto L de Oliveira, Paulo Christiano Sobral, Nathalia Cauás, et al. 2023. Legal judgement prediction: A comparative analysis of legal documents in brazil. In 2023 IEEE Latin American Conference on Computational Intelligence (LA-CCI), pages 1-6. IEEE.
277
+ Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang, Menglin Xia, Xufang Luo, Jue Zhang, Qingwei Lin, Victor Ruhle, Yuqing Yang, Chin-Yew Lin, et al. 2024. Llmlingua-2: Data distillation for efficient and faithful task-agnostic prompt compression. arXiv.
278
+ Debjit Paul, Mete Ismayilzada, Maxime Peyrard, Beatrix Borges, Antoine Bosselut, Robert West, and Boi Faltings. 2023. Refiner: Reasoning feedback on intermediate representations. arXiv.
279
+
280
+ TYSS Santosh, Mohamed Hesham Elganayni, Stanisław Sojka, and Matthias Grabmair. 2024. Incorporating precedents for legal judgement prediction on European court of human rights cases. arXiv.
281
+
282
+ Jingyun Sun, Shaobin Huang, and Chi Wei. 2024. Chinese legal judgment prediction via knowledgeable prompt learning. Expert Systems with Applications, 238:122177.
283
+
284
+ Dietrich Trautmann, Alina Petrova, and Frank Schilder. 2022. Legal prompt engineering for multilingual legal judgement prediction. arXiv.
285
+
286
+ Peiyi Wang, Lei Li, Zhihong Shao, Runxin Xu, Damai Dai, Yifei Li, Deli Chen, Yu Wu, and Zhifang Sui. 2024. Math-shepherd: Verify and reinforce llms step-by-step without human annotations. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 9426-9439.
287
+
288
+ 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.
289
+
290
+ Kevin Yang, Yuandong Tian, Nanyun Peng, and Dan Klein. 2022. Re3: Generating longer stories with recursive reprompting and revision. arXiv.
291
+
292
+ Dan Zhang, Sining Zhoubian, Ziniu Hu, Yisong Yue, Yuxiao Dong, and Jie Tang. 2024. Rest-mcts*: Llm self-training via process reward guided tree search. arXiv.
293
+
294
+ Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric Xing, et al. 2023. Judging llm-as-a-judge with mt-bench and chatbot arena. NIPS, 36:46595-46623.
295
+
296
+ Yaowei Zheng, Richong Zhang, Junhao Zhang, Yanhan Ye, Zheyan Luo, Zhangchi Feng, and Yongqiang Ma. 2024. Llamafactory: Unified efficient fine-tuning of $100+$ language models. arXiv.
297
+
298
+ # A Dataset Examples and Annotation Details
299
+
300
+ # A.1 Dataset Construction Process
301
+
302
+ The construction of LegalHK dataset involved a systematic multi-stage process beginning with comprehensive data collection from the Hong Kong Legal Information Institute (HKLII) database. The initial corpus encompassed 185,495 cases spanning from 1900 to 2023, drawn from the complete hierarchy of Hong Kong's judicial system. The dataset includes cases from fourteen distinct judicial bodies:
303
+
304
+ The Court of Final Appeal (HKCFA) represents the highest court, followed by cases from
305
+
306
+ the United Kingdom Privy Council Judgments for Hong Kong (UKPC) from the colonial period. The Court of Appeal (HKCA) and Court of First Instance (HKCFI) form the High Court level. The specialized tribunals include the Competition Tribunal (HKCT), Labour Tribunal (HKLaT), and Lands Tribunal (HKLdT). At the lower courts level, we have the District Court (HKDC), Family Court (HKFC), and Magistrates' Courts (HKMagC). Additionally, the dataset encompasses specialized judicial bodies including the Coroner's Court (HKCrC), Small Claims Tribunal (HKSCT), and Obscene Articles Tribunal (HKOAT).
307
+
308
+ We initially excluded cases from the Court of Final Appeal and Court of Appeal from our analysis set due to their tendency to present abbreviated case descriptions that lack detailed reasoning. However, these cases were retained in our reference database as they often contain important precedential value and legal principles that inform lower court decisions.
309
+
310
+ The first stage of processing focused on document compression while maintaining semantic integrity. We employed LLM-based compression techniques to reduce document length to approximately one-half to one-third of the original size. This compression preserved all essential legal content while eliminating redundant language and repetitive procedural descriptions that did not contribute to the core legal analysis.
311
+
312
+ Quality control formed a crucial component of our dataset construction methodology. We first applied a rigorous completeness check that filtered out cases missing any essential components such as plaintiff's claims, clear dispute points, or final legal judgments. This initial filtering significantly reduced our corpus to 58,130 cases, each containing complete information necessary for meaningful legal analysis.
313
+
314
+ # A.2 Fact Description Enhancement and Verification
315
+
316
+ The fact description sections underwent a specialized enhancement process to ensure they contained sufficient information for reproducing court judgments as shown in Table 3. This enhancement drew upon three primary sources: the original court documents, extracted court reasoning chains, and final legal judgments. The enhanced descriptions were carefully crafted to provide comprehensive context while maintaining neutrality and avoiding premature revelation of case outcomes.
317
+
318
+ To validate the enhanced fact descriptions, we implemented a two-tier verification system. The first tier utilized GPT-4 for automated screening to identify potential information leakage or bias in the descriptions. The second tier involved a manual review by legal experts who assessed both the completeness and neutrality of the enhanced content. Cases where fact descriptions could potentially telegraph the outcome were either revised or removed from the dataset.
319
+
320
+ # A.3 Annotation Schema and Example Analysis
321
+
322
+ Our annotation schema was designed to capture the full complexity of legal decision-making while maintaining consistent structure across diverse case types. Taking the example case illustrated in Figure 5, we can observe how this schema operates in practice. The case involves The Liquidator of The Union (V-Tex) Shirts Factory Limited seeking to set aside a sale of 330,000 shirt quota for $5,500 to Codify Limited.
323
+
324
+ The fact description captures several crucial elements: the company's status as a shirt manufacturer facing financial difficulties, the timing of an investigation in December 1974, the transfer's execution by Director LEE Kwok-yat on March 26, 1975, the company's debt situation, and expert valuations placing the quota rights between $50,000 and$ 55,000. These facts are presented chronologically and with clear attribution to establish a comprehensive factual foundation.
325
+
326
+ The dispute points section distills the case into two fundamental questions: whether the sale represented an arm's length transaction and whether the \(5,500 price constituted a gross undervaluation of the quota rights. This distillation helps focus the subsequent legal analysis on the core issues requiring judicial determination.
327
+
328
+ The court's reasoning follows a structured progression through several key considerations. It begins by examining the business relationship between the parties, evaluates expert testimony regarding valuation, analyzes price fluctuation patterns, investigates potential misrepresentation, and assesses the overall fairness of the bargaining process. This reasoning chain demonstrates the step-by-step logical progression typical of judicial decision-making.
329
+
330
+ # A.4 Quality Assurance and Validation
331
+
332
+ Our quality assurance process employed multiple validation mechanisms to ensure annotation consistency and accuracy. Rather than relying solely on individual annotator judgment, we implemented a consensus-based review system where multiple legal experts examined each annotation. Disagreements were resolved through structured discussion to establish consistent annotation standards across the dataset. Notice that all annotators were invited or volunteered to participate and were undergraduate students majoring in law.
333
+
334
+ The verification process included automated consistency checks using GPT-4, followed by targeted manual sampling to verify accuracy. We maintained detailed error rate monitoring and implemented immediate correction procedures when systematic issues were identified. This multi-layered approach helped ensure the reliability and reproducibility of our annotations while maintaining the nuanced understanding necessary for legal analysis.
335
+
336
+ Completeness validation formed the final stage of our quality assurance process. Each case underwent systematic checking for component completeness, cross-referencing with original documents, and validation of logical flow. This thorough approach helped ensure that our final dataset maintains high standards of accuracy and completeness while preserving the complex legal reasoning essential for judicial decision-making.
337
+
338
+ # B Error Types and Correction Strategies
339
+
340
+ Building upon the three examples introduced in Section 4.2.2, we present the remaining five error types and their corresponding correction strategies shown in Figure 6. These strategies primarily rely on three implementation approaches: retrieval of external information like statutory provisions, LLM-based self-reflection and adjustment through carefully designed prompts, and evidence tracking to ensure consistency.
341
+
342
+ Unenforceable Judgments occur when legal conclusions cannot be effectively executed due to practical limitations or jurisdictional issues. The correction process begins with retrieval of enforcement regulations and precedents to understand execution requirements. LLM-based reflection then evaluates practical feasibility and suggests alternative approaches while maintaining legal intent. Finally, consistency validation ensures the modi
343
+
344
+ <table><tr><td>Plaintiff</td><td>The Liquidator of The Union (V-Tex) Shirts Factory Limited</td><td>Defendant</td><td>Codify Limited</td><td>Lawsuit Type</td><td>Civil Litigation</td></tr><tr><td>Plaintiff&#x27;s Claim</td><td>To set aside the sale of the 330,000 shirt quota for $5,500</td><td>Related Provisions</td><td>Companies Ordinance Section 182, 199</td><td>Relevant Cases</td><td>Alexander Ward &amp; Company Limited v. Samyang Navigation Company Limited</td></tr><tr><td>Fact Description</td><td colspan="5">&quot;The Union (V-Tex) Shirts Factory Limited was a manufacturer of shirts that ran into financial difficulty.&quot;, &quot;An investigation was ordered and performed by Ian NaCabe &amp; Company in December 1974.&quot;, ...... &quot;The transfer was signed by another Director of the Union (V-Tex), Mr. LEE Kwok-yat, on 26th March 1975.&quot;, &quot;The Union (V-Tex) was heavily in debt to various creditors, including the Hong Kong &amp; Shanghai Banking Corporation, who presented a ...... &quot;The price fluctuation of quota rights was such that it was not possible to use any ex post facto argument as a guide for the price.&quot;, &quot;Experts Mr. Zorn and Mr. Peyer valued the quota rights at between $50,000 to $55,000.&quot;</td></tr><tr><td>Key Disputes</td><td colspan="5">Whether the sale of the quota rights was a dealing at arm&#x27;s length? Whether the price of $5,500 was a gross under value of the quota then available?</td></tr><tr><td>Court Reasoning</td><td colspan="5">&quot;The court found that the Union (V-Tex) and Codify Limited were business associates and that there was a close association between the two companies.&quot;, &quot;The court considered the evidence of two experts, Mr. Zorn and Mr. Peyer, who valued the quota rights at between $50,000 to $55,000.&quot;, &quot;The court found that the price fluctuation of quota rights was such that it was not possible to use any ex post facto argument as a guide for the price.&quot;, ...... &quot;The court found that there was no material misrepresentation and that the Liquidator had not been able to adduce evidence of any undue influence by one company over the other.&quot;, &quot;The court found that the bargain was not unconscionable and that the sale should not be set aside.&quot;</td></tr><tr><td>Legal Judgement</td><td colspan="3">&quot;The court refused to set aside the sale of the quota rights.&quot;, &quot;The court ordered that the injunction be discharged.&quot;, &quot;The court ordered that costs should follow the event and be paid out of the assets of the company.&quot;</td><td>Pros &amp; cons</td><td>Reject Claim</td></tr></table>
345
+
346
+ Figure 5: Illustration of LegalHK: an annotated legal judgment dataset with disputes and reasoning.
347
+
348
+ fied judgment aligns with established enforcement mechanisms.
349
+
350
+ Errors in Evidence Chain Integrity Judgment occurs when the analysis of evidence reliability and logical connections is flawed. The correction strategy employs a structured approach that systematically traces each piece of evidence cited in the reasoning process. Through careful prompt-based analysis, it examines both individual evidence reliability and interconnections between different pieces of evidence. The strategy evaluates factors such as credibility, relevance, and logical coherence, ensuring that conclusions drawn from the evidence chain are properly supported and logically sound.
351
+
352
+ Improper Joint Liability Determination represents errors in assigning responsibility among multiple parties. The strategy first retrieves relevant joint liability provisions and precedents. Through structured prompts, the LLM maps relationships between parties and analyzes their respective roles. Consistency checking ensures liability distribution aligns with both legal principles and factual evidence.
353
+
354
+ Unaddressed Key Disputes arise when significant legal issues raised by parties are overlooked in the reasoning process. The correction strategy begins by systematically identifying and extracting all disputes mentioned in the case materials, including both explicit claims and implicit contentions. Through structured prompting, it evaluates the cur
355
+
356
+ rent reasoning's coverage of each dispute and ensures appropriate analytical depth is applied to each issue.
357
+
358
+ Sentencing Bias manifests when penalties deviate from standards without justification. The strategy retrieves a database of similar cases and sentencing guidelines. Prompt-based analysis examines aggravating and mitigating factors, while consistency validation ensures penalties align with both legal principles and case-specific circumstances.
359
+
360
+ This implementation framework combines information retrieval, LLM-based reasoning, and consistency validation to systematically identify and address potential flaws in legal analysis. Each strategy leverages these approaches to not only correct immediate errors but also strengthen the overall reliability of legal reasoning.
361
+
362
+ # C Strategy-wise Effectiveness Analysis
363
+
364
+ To evaluate the contribution of each correction strategy, we conducted ablation experiments by removing individual strategies while keeping others intact. Figure 7 illustrates the performance impact of each strategy's removal on both LegalHK and CMDL datasets.
365
+
366
+ LegalReasoner with all correction strategies achieves the highest performance with a CA-Acc of 80.27 on LegalHK and 76.95 on CMDL. In con
367
+
368
+ ![](images/daba2e52d738b9a90448372589f694fbc389631d69549296916dbf4bf7c3b928.jpg)
369
+ Figure 6: Overview of error types and corresponding correction strategies in LegalReasoner. The framework consists of two main components: Problem Attributing (left) which identifies eight distinct types of legal reasoning errors, and Problem Solving (right) which implements specialized correction strategies for each error type.
370
+
371
+ ![](images/e4bea5ff1aaf455e9371eb7e0efd11e09cbba6fe9dd824630fa8d10d3bce8380.jpg)
372
+ Figure 7: Impact of different correction strategies on model performance. The base stands for removing all strategies, LP for Legal Principle, FD for Facts Discrepancy, CS for Compensation Scope, UE for Unenforceable, EC for Evidence Chain, JL for Joint Liability, KD for Key Disputes, and SB for Sentencing Bias.
373
+
374
+ trast, the baseline model without any correction strategies performs at 74.49 on LegalHK and 71.00 on CMDL. Ablation results reveal varying performance impacts: removing Legal Principle (LP) strategy reduces performance to 77.15 and 74.15 on LegalHK and CMDL respectively; without Facts Discrepancy (FD), performance drops to 78.83 and 75.83; removing Compensation Scope (CS) leads to 79.72 and 76.42; absence of Unenforceable (UE) results in 79.85 and 76.65; eliminating Evidence Chain (EC) decreases performance to 78.91 and 75.91; without Joint Liability (JL), accuracy falls
375
+
376
+ to 79.84 and 76.84; removing Key Disputes (KD) results in 78.32 and 75.32; and without Sentencing Bias (SB), performance declines to 78.76 and 75.76 respectively.
377
+
378
+ The consistent performance degradation observed when removing individual strategies across both datasets validates the effectiveness of our comprehensive correction framework. The varying magnitude of performance drops for different strategies suggests that a combination of verification and correction mechanisms is essential for robust legal reasoning.
379
+
380
+ # D Retrieval Implementation Details
381
+
382
+ For statutory provision retrieval, we constructed a hierarchical directory structure of legal provisions, enabling LLMs to perform progressive pruning through chapter names, part names, article names, section names, and specific provisions. This hierarchical approach significantly improves efficiency by avoiding unnecessary token consumption during the retrieval process and reduces the computational overhead of processing irrelevant legal provisions.
383
+
384
+ For case retrieval, we established a comprehensive case database on the Dify platform $^{4}$ containing all relevant precedents. We employed the BGE-M3 model as the primary retriever, followed by BGE-reranker-large for result reranking. To maintain efficiency while ensuring relevance, we retain only the top-3 ranked cases as supplementary context. It is then summarized and used to enhance the reasoning process and improve the accuracy of
385
+
386
+ legal analysis.
387
+
388
+ # E Definition of Dispute Points
389
+
390
+ Dispute points constitute the fundamental areas of disagreement between plaintiff and defendant in legal proceedings. To illustrate this concept, we present two paradigmatic examples:
391
+
392
+ 1. Contract Dispute Case: A critical dispute point may be formulated as "Whether the alleged oral agreement constitutes a binding legal obligation upon the contracting parties."
393
+ 2. Bankruptcy Liquidation Case: A pivotal dispute point might be expressed as "Whether the corporate entity possesses sufficient financial capacity to maintain ongoing operations."
394
+
395
+ In both instances, one party maintains an affirmative position while the opposing party presents a contradictory stance. This fundamental disagreement necessitates judicial determination—whether by a presiding judge or an LLM system performing Legal Judgment Prediction (LJP). Once this determination is rendered, the allocation of legal responsibility becomes unambiguous and enforceable.
396
+
397
+ # F Runtime Efficiency Analysis
398
+
399
+ The computational efficiency analysis of Legal-Reasoner reveals additional overhead beyond the foundation model's baseline reasoning capabilities. These incremental costs primarily stem from: (1) extended Chain-of-Thought (CoT) reasoning sequences, (2) Verifier classification processes, (3) LLM reflection mechanisms during error correction, and (4) intermittent legal provision and case law retrievals.
400
+
401
+ Utilizing the vLLM framework, our LLAMA-8B implementation processes approximately 15,000 input tokens and generates 793 output tokens per second on H800 server infrastructure. Consequently, our analysis focuses predominantly on output token generation metrics.
402
+
403
+ # Component-wise Token Consumption:
404
+
405
+ - Dispute Generation: 300 tokens (~0.4 seconds)
406
+ - Judicial Reasoning Process: 800-1,000 tokens ( $\sim$ 1.0 second)
407
+ - Verifier Classification: 1 token (~0.1 seconds)
408
+
409
+ - Legal Provision Retrieval: 2,500 tokens (~1.0 second) via 3B LLM for batch directory filtering
410
+ - Case Law Retrieval: Negligible computational cost (~0.1 seconds) using 300M BGE model with vector database optimization
411
+ - Reflection Process: 700 tokens (~0.9 seconds)
412
+
413
+ This architecture enables comprehensive user response generation within a 3-second timeframe. In comparative analysis with GPT-o1, which employs opaque reasoning processes, our system demonstrates superior efficiency with first-token response times of approximately 7 seconds, while avoiding substantial token expenditure on non-essential descriptive content unrelated to the reflection mechanism.
414
+
415
+ # G Case Example
416
+
417
+ The following case study demonstrates the practical application of LegalReasoner's analytical framework:
418
+
419
+ # Case Study: Chen v. MTR Corporation Limited
420
+
421
+ Case Facts: On 26 October 2009, Ms. Chen (plaintiff, aged 56, employed as editor for ecclesiastical organization) sustained injuries from a slip-and-fall incident within the South Passenger Concourse of Kowloon Tong Mass Transit Railway Station at approximately 09:00 hours during Chung Yeung Festival. Plaintiff alleges surface water presence as causative factor. Meteorological conditions were dry. Station experienced elevated passenger volume consistent with morning rush hour patterns. Defendant MTR Corporation had contracted Winson Cleaning Services as independent contractor for facility maintenance. Systematic inspections occurred bi-hourly. Comprehensive CCTV coverage and appropriate warning signage were maintained. Witness testimonies from Mr. Lau (plaintiff's associate) and Ms. Wong (bystander) presented contradictory accounts regarding floor conditions. Maintenance documentation indicated routine cleaning procedures 30 minutes prior to incident, with no reported spillage events.
422
+
423
+ Plaintiff's Allegations: Defendant's negligence and breach of common duty of care proximately caused slip-and-fall incident, resulting in substantial lower back and right knee injuries.
424
+
425
+ LegalReasoner Analysis: Initial assessment identified two principal legal issues: (1) determination of floor surface conditions at incident time, and (2) applicability of statutory defenses under Occupiers Liability Ordinance s. 3(4)(b). Preliminary analysis erroneously applied strict liability principles.
426
+
427
+ Legal Research Triggered: Occupiers Liability Ordinance, Cap. 314; relevant precedents including Hsu Li Yun v The Incorporated Owners of Yuen Fat Building [2000] 1 HKLRD 900, Cheung Wai Mei v The Excelsior Hotel, and Ward v Tesco Stores Ltd. [1976] 1 WLR 810.
428
+
429
+ Reflection and Correction: Corrected analysis established that Occupiers Liability Ordinance mandates reasonable care standard rather than strict liability. Evidence demonstrated defendant's compliance through: engagement of qualified contractor, systematic bi-hourly inspections, appropriate warning systems, and comprehensive monitoring protocols. Maintenance records and witness inconsistencies supported defendant's reasonable care demonstration under s. 3(4)(b).
430
+
431
+ Judgment: Plaintiff's claim dismissed. Costs awarded to defendant with counsel certification, effective 14 days postjudgment.
432
+
433
+ Outcome Classification: Claim Rejected
434
+
435
+ <table><tr><td colspan="2">Stage</td><td>Prompt Template</td></tr><tr><td rowspan="3">Initialtion</td><td rowspan="3">Extrac-tion</td><td>Please extract the following key information from the given court judgment and return it in JSON format:</td></tr><tr><td>{&quot;plaintiff&quot;: &quot;Name of the applicant/plaintiff&quot;, &quot;defendant&quot;: &quot;Name of the defendant&quot;, &quot;plaintiff_claim&quot;: &quot;claims made by the plaintiff&quot;, &quot;lawsuit_type&quot;: &quot;e.g., judicial review application&quot;, &quot;facts&quot;: [&quot;List of detailed factual background information&quot;], &quot;related_laws&quot;: [&quot;List of relevant laws or legal provisions&quot;], &quot;relevant Cases&quot;: [&quot;List of relevant case law or precedents cited&quot;], &quot;issues&quot;: [&quot;List of main issues in dispute (if any)&quot;], &quot;court_reasoning&quot;: [&quot;List of reasoning process or legal principles&quot;], &quot;judgment_decision&quot;: [&quot;List of court&#x27;s final decision and orders&quot;]}</td></tr><tr><td>Requirements: 1. Clearly distinguish between factual statements and court opinions 2. Organize facts and procedural content chronologically 3. Return empty string &quot;&quot; for fields where information is not explicit 4. Exhibit detailed information for facts and court reasoning 5. Maintain JSON format integrity and standards</td></tr><tr><td>Issue Generation</td><td>Genera-tion</td><td>Please generate disputes about plaintiff claim based on facts. These disputes are vital to determine whether Courts support or reject the application/appeal. plaintiff_claim: [plaintiff&#x27;s claims] facts: [list of facts]</td></tr><tr><td rowspan="3">Fact Enhancement</td><td rowspan="3">Enhancement</td><td>Please review the court&#x27;s reasoning section and extract any additional factual information to supplement the existing facts. Return the results in JSON format:</td></tr><tr><td>{&quot;plaintiff&quot;: &quot;...&quot;, &quot;defendant&quot;: &quot;...&quot;, &quot;plaintiff_claim&quot;: &quot;...&quot;, &quot;lawsuit_type&quot;: &quot;...&quot;, &quot;more_facts&quot;: [&quot;List of detailed factual information&quot;], &quot;related_laws&quot;: [&quot;...&quot;], &quot;relevant Cases&quot;: [&quot;...&quot;], &quot;issues&quot;: [&quot;...&quot;], &quot;courtreasoning&quot;: [&quot;...&quot;], &quot;judgment_decision&quot;: [&quot;...&quot;], &quot;support&amp;reject&quot;: &quot;support/reject&quot;}</td></tr><tr><td>Requirements: 1. Review court Reasoning to identify: - Facts mentioned in decision explanation - Facts referenced in evidence analysis - Facts cited when applying legal principles - Facts supporting final judgment 2. Extract only objective factual statements 3. Add new facts to more_facts if not in original facts 4. Maintain chronological order 5. Do not modify other sections</td></tr></table>
436
+
437
+ Table 3: Prompts for fact description enhancement and verification.
2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b193a094aa9d542eb08d713b7d264857ebd1d06dab7d00584ca297b95095456a
3
+ size 990615
2025/LegalReasoner_ Step-wised Verification-Correction for Legal Judgment Reasoning/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Length Controlled Generation for Black-box LLMs/6b4f4832-1066-453d-a13f-fc313f9a0e40_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Length Controlled Generation for Black-box LLMs/6b4f4832-1066-453d-a13f-fc313f9a0e40_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Length Controlled Generation for Black-box LLMs/6b4f4832-1066-453d-a13f-fc313f9a0e40_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a8f2be90033f1d807662abc0aa6133592c758e9732fb085f0d42261d2225b28
3
+ size 440311
2025/Length Controlled Generation for Black-box LLMs/full.md ADDED
@@ -0,0 +1,676 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Length Controlled Generation for Black-box LLMs
2
+
3
+ Yuxuan Gu $^{1}$ Wenjie Wang $^{2}$ Xiaocheng Feng $^{13}$ Weihong Zhong $^{1}$ Kun Zhu $^{1}$ Lei Huang $^{1}$ Ting Liu $^{1}$ Bing Qin $^{13}$ Tat-Seng Chua $^{2}$ Harbin Institute of Technology
4
+
5
+ $^{2}$ National University of Singapore $^{3}$ Peng Cheng Laboratory {yxgu, xcfeng, whzhong, kzhu, lhuang, tliu, qinb} @ir.hit.edu.cn wenjiewang96@gmail.com dcscts@nus.edu.sg
6
+
7
+ # Abstract
8
+
9
+ Large language models (LLMs) have demonstrated impressive instruction following capabilities, while still struggling to accurately manage the length of the generated text, which is a fundamental requirement in many real-world applications. Existing length control methods involve fine-tuning the parameters of LLMs, which is inefficient and suboptimal for practical use. In this paper, we propose a novel iterative sampling framework for text length control, integrating the Metropolis-Hastings algorithm with an importance sampling acceleration strategy. This framework efficiently and reliably regulates LLMs to generate length-constrained text without modifying the underlying parameters, thereby preserving the original capabilities of LLMs. Experimental results demonstrate that our framework achieves almost $100\%$ success rates of length control on LLAMA3.1 for tasks such as length-controlled abstractive summarization and length-constrained instruction following, with minimal additional computational overhead. This also highlights the significant potential of our method for precise length control across a broader range of applications, without compromising the versatility of LLMs.
10
+
11
+ # 1 Introduction
12
+
13
+ Recent advancement of pre-trained large language models (LLMs) has significantly improved the performance of various natural language processing tasks (Vaswani, 2017; Devlin, 2018; Brown, 2020). LLMs such as GPT-4 (Achiam et al., 2023) and LLAMA (Touvron et al., 2023a,b; Dubey et al., 2024) exhibit exceptional capabilities to follow instructions (Ouyang et al., 2022), allowing them to generate text aligning closely with user intentions. Applications such as dialogue generation (Yi et al., 2024), code completion (Jiang et al., 2024), and reasoning (Plaat et al., 2024) have benefited greatly from these advances, establishing LLMs as the core component in building general AI systems.
14
+
15
+ Despite the strong generative capability, LLMs still struggle to precisely manage the length of generated text (Wang et al., 2024; Huang et al., 2024; Li et al., 2024), due to inherent architectural limitations such as subword tokenization (Sennrich, 2015; Devlin, 2018) and autoregressive decoding (Sutskever, 2014; Vaswani, 2017; Brown, 2020). This issue is critical because length control is a fundamental requirement in many real-world applications. For example, summarization tasks often require outputs of specific lengths to balance informativeness and conciseness (Fan et al., 2017; Liu et al., 2018, 2022; Jie et al., 2024). In addition, LLM-based chatbots favor longer responses due to the length bias introduced in pairwise preference optimization (Singhal et al., 2023), which undermines the fairness of model evaluation (Dubois et al., 2024a; Yuan et al., 2024) and degrades the user experience in practical conversations.
16
+
17
+ To address the issue of length control, various methods have been proposed, including fine-tuning based on specifically designed length instructions (Yuan et al., 2024; Wang et al., 2024; Li et al., 2024) and reinforcement learning with length feedback (Stiennon et al., 2020; Jie et al., 2024). However, we argue that it is necessary to design length control methods tailored for black-box LLMs for the following reasons: (1) Fine-tuning LLMs specifically for length control requires extensive computational resources and can degrade their general-purpose utility (Lin et al., 2024). Worse still, not all LLMs are open source. The fine-tuning methods cannot be applied to black-box LLMs. (2) Length control has been actually considered in the instruction tuning phase of LLMs (Wang et al., 2022; Taori et al., 2023). As such, a superior and more efficient solution is to activate the inherent length-following capabilities within LLMs rather than undertaking a costly retraining process.
18
+
19
+ We propose a novel framework for black-box LLMs that operates length control without the need
20
+
21
+ for parameter training. The length controlled generation can be viewed as sampling from a target distribution, which is influenced simultaneously by the length constraint and language probability. However, it is intractable to directly sample from this distribution, and we utilize an iterative sampling framework called Metropolis-Hastings (Metropolis et al., 1953; Hastings, 1970), which is a classic and prevalent Markov chain Monte Carlo (MCMC) method specially suited for this complex scenario. In detail, our framework initiates from the original output of LLM and iteratively produces candidate outputs conditioned on the previous ones via a proposal distribution. The acceptance or rejection of these candidates is determined by their comparative advantage over previous candidates, which is quantified as an acceptance distribution that involves: the alignment with the target length, the generative probability density of the LLM, and the probability density of the proposal distribution. Furthermore, we leverage importance sampling (Kahn and Marshall, 1953; Owen and Zhou, 2000) in the proposal distribution to accelerate the iteration process, where candidates with lengths closer to the desired target are more likely to be sampled. We treat the LLM as an immutable component, enabling the integration of effective length control mechanisms across the broadest possible spectrum of LLMs.
22
+
23
+ We assess the effectiveness of our method on several tasks, including the abstract text summarization task with precise length control and the instruction following task with maximum length constraint. Experimental results demonstrate that our black-box approach significantly improves existing LLMs in length control and achieves the state-of-the-art performance without compromising the quality of generated contents. Specifically, in the case of the LLAMA3.1 model (Dubey et al., 2024), our method achieves success rates close to $100\%$ of the length control in only five iterations at most, highlighting its efficiency and practicality. Our contributions are summarized as follows:
24
+
25
+ 1. We propose a novel framework for black-box LLMs, offering more flexible and general length control compared to existing methods.
26
+ 2. We introduce an innovative integration of the classic Metropolis-Hastings algorithm with modern LLMs, thereby enhancing the efficiency and precision of length control.
27
+ 3. We achieve remarkable length control performance in advanced LLMs, showcasing the robustness and effectiveness of our framework.
28
+
29
+ # 2 Related Work
30
+
31
+ # 2.1 Instruction Following
32
+
33
+ LLMs are endowed with powerful instruction following capabilities in the supervised fine-tuning stage (Ouyang et al., 2022; Zhou et al., 2024). Despite being able to understand human instructions and handle a broad spectrum of tasks, LLMs still leave a large room for improvement in their instruction following capabilities (Liu et al., 2023). In addition to training stronger instruction following capabilities (Rafailov et al., 2024b,a), it is also important to better utilize and activate the power of LLMs (Wei et al., 2022; Yao et al., 2023).
34
+
35
+ # 2.2 Length Control
36
+
37
+ Controlling the output length is a crucial skill in text generation, particularly for tasks where lengths vary significantly. Early length controllable generation methods focus on the abstractive summarization task. For example, some methods discretize lengths into bins with specialized tokens (Fan et al., 2017), introduce length constraint factors to convolutional blocks (Liu et al., 2018), or optimize output quality through minimum risk training (Makino et al., 2019). In addition, length control signals can be incorporated in positional encodings (Takase and Okazaki, 2019), attention units (Yu et al., 2021; Liu et al., 2022), and natural language instructions (Yuan et al., 2024; Wang et al., 2024; Jie et al., 2024; Li et al., 2024). These methods require the length training, which is inefficient when applied to LLMs and has the potential to damage general abilities. Recent instruction-based control schemes (Juseon-Do et al., 2024) can alleviate these issues but still fail to achieve precise control. In contrast, our framework effectively enhances LLM's ability to enable more precise text generation.
38
+
39
+ # 3 Methodology
40
+
41
+ # 3.1 Overall Framework: Metropolis-Hastings
42
+
43
+ As illustrated in Figure 1, we introduce how to apply the Metropolis-Hastings framework (Metropolis et al., 1953; Hastings, 1970) to the length control scenario. Given the probability distribution of LLMs $P(y|x)$ and the score of length constraint $f(y)$ , our target distribution $\pi(y|x)$ is derived as:
44
+
45
+ $$
46
+ \pi (y | x) = \frac {f (y) P (y | x)}{\int f (y) P (y | x) \mathrm {d} y}, \tag {1}
47
+ $$
48
+
49
+ where $x$ is the human instruction and $y$ is the response of the target LLM. We cannot directly sam
50
+
51
+ ![](images/d576eaf11606e20c8841767294daaa9e4bcf2bb2efa1230f36654b841307f658.jpg)
52
+ Figure 1: The overall sampling process of our Metropolis-Hastings framework. The iteration starts by sampling an initial state from the distribution of LLM $y_0 \sim P(y|x)$ , and ends at $y_7$ , which maximizes the target combination of length constraints and probability densities $\pi(y|x) \propto f(y)P(y|x)$ . During each iteration, a new candidate content $y_i$ is generated based on the previous one $y_{i-1}$ via the proposal distribution $p(y_i|y_{i-1},x)$ . The generated candidate $y_i$ will be either accepted or rejected considering the degree to which the target objectives are satisfied. We enhance the original proposal distribution by incorporating length constraints, yielding the importance distribution $q(y_i|y_{i-1},x)$ , which increases the acceptance rate of candidates and significantly improves the iteration efficiency.
53
+
54
+ ple $y$ from the target distribution $\pi (y|x)$ because: (1) $f(y)$ is a deterministic function designed to evaluate length constraints, rather than a probability distribution, which is not suitable for sampling; and (2) the integral of the normalization constant $Z = \int f(y)P(y|x)\mathrm{d}y$ is intractable.
55
+
56
+ The Markov chain Monte Carlo algorithms can handle the problem by starting from an initial state $y_0 \sim P(y|x)$ , iteratively generating a collection of states $[y_1, \ldots, y_n]$ with a transition distribution $P(y_i | y_{i-1}, x)$ , and approaching the target distribution $\pi(y|x) = \lim_{n \to \infty} P(y_0|x) \prod_{i=1}^{n} P(y_i | y_{i-1}, x)$ . Therefore, $y_n$ can be considered as sampled from the target distribution $\pi(y|x)$ when $n \to \infty$ .
57
+
58
+ The Metropolis-Hastings algorithm designs the transition probability as a combination of two steps:
59
+
60
+ $$
61
+ P \left(y _ {i} \mid y _ {i - 1}, x\right) = p \left(y _ {i} \mid y _ {i - 1}, x\right) \mathcal {A} \left(y _ {i - 1} \rightarrow y _ {i}\right), \tag {2}
62
+ $$
63
+
64
+ where $p(y_{i}|y_{i - 1},x)$ is the proposal distribution that generates a new candidate $y_{i}$ given the previous one $y_{i - 1}$ . The acceptance distribution $\mathcal{A}(y_{i - 1}\to y_i)$ provides the probability of accepting the proposed candidate $y_{i}$ . To ensure convergence, $\pi (y|x)$ must be the unique stationary distribution of the Markov chain. Thus the Metropolis-Hastings algorithm further requires the transition probability $P(y_{i}|y_{i - 1},x)$
65
+
66
+ to fulfill the detailed balance condition, which is a sufficient condition for the stationary distribution,
67
+
68
+ $$
69
+ \pi \left(y _ {i - 1} | x\right) P \left(y _ {i} \mid y _ {i - 1}, x\right) = \pi \left(y _ {i} \mid x\right) P \left(y _ {i - 1} \mid y _ {i}, x\right). \tag {3}
70
+ $$
71
+
72
+ Based on eqs. (2) and (3), the acceptance distribution is derived to satisfy the following constraint:
73
+
74
+ $$
75
+ \begin{array}{l} \frac {\mathcal {A} \left(y _ {i - 1} \rightarrow y _ {i}\right)}{\mathcal {A} \left(y _ {i} \rightarrow y _ {i - 1}\right)} = \frac {\pi \left(y _ {i} \mid x\right) p \left(y _ {i - 1} \mid y _ {i} , x\right)}{\pi \left(y _ {i - 1} \mid x\right) p \left(y _ {i} \mid y _ {i - 1} , x\right)} \tag {4} \\ = \frac {f (y _ {i}) P (y _ {i} | x) p (y _ {i - 1} | y _ {i} , x)}{f (y _ {i - 1}) P (y _ {i - 1} | x) p (y _ {i} | y _ {i - 1} , x)}, \\ \end{array}
76
+ $$
77
+
78
+ where the normalization constant $Z$ cancels, making subsequent calculations convenient. In addition, the most popular choice of $\mathcal{A}(y_{i - 1}\to y_i)$ in Metropolis-Hastings that satisfies eq. (4) is:
79
+
80
+ $$
81
+ \min \left(1, \frac {f \left(y _ {i}\right) P \left(y _ {i} \mid x\right) p \left(y _ {i - 1} \mid y _ {i} , x\right)}{f \left(y _ {i - 1}\right) P \left(y _ {i - 1} \mid x\right) p \left(y _ {i} \mid y _ {i - 1} , x\right)}\right), \tag {5}
82
+ $$
83
+
84
+ The sampling process of Metropolis-Hastings is illustrated in algorithm 1. During each iteration loop, a new candidate $y_{i}$ is generated from the previous one $y_{i - 1}$ . Whether to accept or reject the new candidate is determined by the acceptance distribution $\mathcal{A}(y_{i - 1}\to y_i)$ , where the randomness is achieved with a uniform distribution $u\sim \mathcal{U}(0,1)$ .
85
+
86
+ In the black-box setting where direct access to the internal probability outputs of LLM is not
87
+
88
+ Algorithm 1 Metropolis-Hastings Algorithm
89
+
90
+ 1: Initialize the start state $y_0 \sim P(y|x)$
91
+ 2: for $i = 0$ to $n$ do
92
+ 3: Propose: $y_{i} \sim p(y_{i} | y_{i-1}, x)$
93
+ 4: Calculate: $\mathcal{A}(y_{i - 1}\to y_i)$ // eq. (5)
94
+ 5: Randomize: $u\sim \mathcal{U}(0,1)$
95
+ 6: if $u > \mathcal{A}(y_{i - 1} \to y_i)$ then
96
+ 7: $y_{i} = y_{i - 1}$ //Reject
97
+ 8: end if // else Accept
98
+ 9: end for
99
+ 10: Return $y_{n}$
100
+
101
+ available, the following key components of the Metropolis-Hastings algorithm require careful and specialized designs: (1) the length constraint score $f(y)$ (\$3.2), which serves as a quantitative metric to assess the degree to which the generated samples adhere to predefined length requirements; (2) the probability distribution of LLM $P(y|x)$ (\$3.3), which estimates the likelihood of the LLM generating the specific sample $y$ ; and (3) the proposal distribution $p(y_i|y_{i-1}, x)$ (\$3.4), which requires tailored construction to effectively generate candidate samples and efficiently explore the solution space, ensuring adherence to the length constraint while achieving sufficiently high generation quality.
102
+
103
+ # 3.2 Length Constraint Score $f(y)$
104
+
105
+ Given a word counter $\mathrm{Len}(\cdot)$ , such as the NLTK word tokenization function (Bird et al., 2009), the deviation of the LLM generated contents $y$ from the target length $\ell$ can be quantitatively measured using the Manhattan distance, which is:
106
+
107
+ $$
108
+ \mathcal {D} (y, \ell) = | \operatorname {L e n} (y) - \ell |. \tag {6}
109
+ $$
110
+
111
+ Considering the target of our sampling process, the combination of $f(y)P(y|x)$ , we observe a resemblance to the constrained optimization problem, where $\log f(y)$ can be interpreted as a constraint and $\log P(y|x)$ serves as an objective to be maximized. Our target is similar to a Lagrangian function $f(y)P(y|x) \propto \log P(y|x) + \lambda \log f(y)$ with the Lagrange multiplier $\lambda = 1$ . Furthermore, our sampling process can be seen as analogous to exterior optimization, where the proposed candidates $y_{i}$ are always unable to satisfy the constraints during each iteration prior to the termination of the loop. Therefore, the constraint function $f(y)$ needs to incentivize candidates that approximate the length constraint, and terminate the iterations with a significantly large reward when the length constraint
112
+
113
+ is satisfied. Thus our length constraint score is defined as follows. For an exact target length $\ell > 0$ :
114
+
115
+ $$
116
+ f (y) = \frac {1}{\mathscr {D} (y , \ell)}. \tag {7}
117
+ $$
118
+
119
+ For an interval of target length $[\ell_1,\ell_2]$ ..
120
+
121
+ $$
122
+ f (y) = \left\{ \begin{array}{l l} \frac {1}{\mathcal {D} (y , \ell_ {1})}, & y < \ell_ {1} \\ + \infty , & \ell_ {1} \leq y \leq \ell_ {2}, \\ \frac {1}{\mathcal {D} (y , \ell_ {2})}, & y > \ell_ {2} \end{array} \right. \tag {8}
123
+ $$
124
+
125
+ where $0 < \ell_1 < \ell_2 \leq +\infty$ and $\ell_2$ can be $+\infty$ .
126
+
127
+ # 3.3 Probability Distribution of LLM $P(y|x)$
128
+
129
+ We can obtain the responses generated by black-box LLMs such as GPT-4 (Achiam et al., 2023), i.e., sampling from their distributions $y \sim P(y|x)$
130
+
131
+ # Prompt Template: $y_0 \sim P(y|x)$
132
+
133
+ [USER]: Answer the following instruction using $\{\ell\}$ words or less: $\{x\}$
134
+
135
+ [ASSISTANT]: Answer: $\{y_0\}$
136
+
137
+ which is easily accomplished with a simple instruction. However, we are unable to access their internal parameters or underlying probability distributions. Consequently, it is intractable to verify the probability density $P(y|x)$ of specific samples $y$ .
138
+
139
+ To address this issue, we employ the LLM-as-a-Judge approach (Chiang et al., 2023; Zheng et al., 2023; Dubois et al., 2024b) as a solution. Leveraging the advanced understanding, reasoning, and mathematical capabilities of the model, we require LLMs to score samples generated by themselves, thus implicitly estimating their probability density distributions. Besides, we predefine a series of perspectives to unify the scoring mode for our tasks. For the abstractive summarization task, we measure the information coverage, linguistic fluency, conciseness, logical coherence, and faithfulness of the generated summaries. For instruction following, we measure the response with helpfulness, relevance, accuracy, depth, creativity, and level of detail. Denoting the score function as $\phi(y|x)$ , we get the estimated probability distribution as:
140
+
141
+ $$
142
+ P (y | x) \simeq \frac {\phi (y | x)}{\int \phi (y | x) \mathrm {d} y}. \tag {9}
143
+ $$
144
+
145
+ Similarly to the eq. (4), we can cancel the calculation of the normalization constant $\int \phi(y|x)\mathrm{d}y$ .
146
+
147
+ Since the eq. (4) requires the calculation of the ratio $P(y_{i}|x)\div P(y_{i - 1}|x)$ , where $y_{i}$ and $y_{i - 1}$ are both sampled from the target LLM, we can further refine the scoring function by employing a pairwise comparison function $\Phi (y_i,y_{i - 1}|x)$ that
148
+
149
+ $$
150
+ \frac {P \left(y _ {i} \mid x\right)}{P \left(y _ {i - 1} \mid x\right)} \simeq \Phi \left(y _ {i}, y _ {i - 1} \mid x\right) \simeq \frac {\phi \left(y _ {i} \mid x\right)}{\phi \left(y _ {i - 1} \mid x\right)}, \tag {10}
151
+ $$
152
+
153
+ where the pairwise score can discern subtle differences between the sample pair $(y_{i}, y_{i-1})$ at adjacent iteration steps. In addition, the pairwise function will produce scores with less fluctuation than the absolute one $\phi(y|x)$ (Zheng et al., 2023).
154
+
155
+ # 3.4 Proposal Distribution $p(y_{i}|y_{i - 1},x)$
156
+
157
+ The proposal distribution $p(y_{i}|y_{i - 1},x)$ plays a pivotal role, as it directly influences the efficiency and quality of the sampling process. Since the probability distribution of LLM, $P(y|x)$ , is estimated by itself (§3.3), requiring LLMs to further approximate the probability density of the proposal distribution $p(y_{i}|y_{i - 1},x)$ not only introduces additional complexity, but also amplifies the estimation errors. Therefore, we impose a symmetry constraint (Chib and Greenberg, 1995; Haario et al., 2001) on the design of the proposal distribution, which is $q(y_{i}|y_{i - 1},x) = q(y_{i - 1}|y_{i},x)$ . And the acceptance distribution $\mathcal{A}(y_{i - 1}\to y_i)$ (eq. (5)) reduces to
158
+
159
+ $$
160
+ \min \left(1, \frac {f \left(y _ {i}\right) P \left(y _ {i} \mid x\right)}{f \left(y _ {i - 1}\right) P \left(y _ {i - 1} \mid x\right)}\right), \tag {11}
161
+ $$
162
+
163
+ when current result is better than the previous one, we directly accept it. Otherwise, we accept with a probability equal to its ratio, enabling expansion of the sampling space. Therefore, we design time-unbiased instructions to make LLM satisfy the symmetry constraints as much as possible. The detailed prompt template for LLMs is as follows:
164
+
165
+ # Prompt Template: $y_{i} \sim p(y_{i} | y_{i-1}, x)$
166
+
167
+ [USER]: Answer the following instruction using $\{\ell\}$ words or less: $\{x\}$
168
+
169
+ [ASSISTANT]: Answer: $\{y_{i - 1}\}$
170
+
171
+ [USER]: Please generate a new answer based on the previous one:
172
+
173
+ [ASSISTANT]: Answer: $\{y_i\}$
174
+
175
+ where $y_{i}$ and $y_{i - 1}$ are equivalent and interchangeable in the semantics of this template.
176
+
177
+ However, this preliminary Metropolis-Hastings framework, constructed with the current proposal function $p(y_{i}|y_{i - 1},x)$ , is not efficient due to following reasons. (1) Intuitively, when generating new candidates, the length signal remains the initial one ("using $\ell$ words or less"). Without introducing updated length signals, LLM may remain trapped in its own errors, unable to converge to improved solutions. (2) From a theoretical perspective, the sampling efficiency and quality will be maximized when the proposal function $p(y_{i}|y_{i - 1},x)$ aligns closely with the target distribution $\pi (y|x)$ (Gelman et al., 1997). This means that the sampling efficiency decreases as this discrepancy increases.
178
+
179
+ Therefore, we apply the importance sampling strategy (Kahn and Marshall, 1953; Owen and Zhou, 2000) to improve the proposal distribution. We define an importance distribution $q(y_{i}|y_{i - 1},x)$ that complies with length constraints, serving as a replacement for the proposal distribution to facilitate accelerated sampling. Equations (5) and (11) can be further derived when $y_{i}\sim q(y_{i}|y_{i - 1},x)$ :
180
+
181
+ $$
182
+ \begin{array}{l} \mathcal {A} \left(y _ {i - 1} \rightarrow y _ {i}\right) = \frac {p \left(y _ {i} \mid y _ {i - 1} , x\right)}{q \left(y _ {i} \mid y _ {i - 1} , x\right)} \min \left(1, \frac {\pi \left(y _ {i} \mid x\right)}{\pi \left(y _ {i - 1} \mid x\right)}\right) \\ \leq \min \left(1, \frac {f \left(y _ {i}\right) P \left(y _ {i} \mid x\right)}{f \left(y _ {i - 1}\right) P \left(y _ {i - 1} \mid x\right)}\right), \tag {12} \\ \end{array}
183
+ $$
184
+
185
+ where $\frac{p(y_i|y_{i-1},x)}{q(y_i|y_{i-1},x)} \leq 1$ and eq. (11) becomes an upper bound of $\mathcal{A}(y_{i-1} \rightarrow y_i)$ . By simply replacing line 3 in algorithm 1 with $y_i \sim q(y_i|y_{i-1}|x)$ and calculating the acceptance rate with the upper bound eq. (12), we can significantly accelerate the sampling process. Although calculating this upper bound may lead to higher acceptance rates, potentially compromising generation quality, the remarkable capabilities of LLMs fortunately mitigate this risk to an almost negligible level. In addition, the detailed template for the importance distribution is:
186
+
187
+ # Prompt Template: $y_{i} \sim q(y_{i}|y_{i - 1},x)$
188
+
189
+ [USER]: Answer the following instruction using $\{\ell\}$ words or less: $\{x\}$
190
+ [ASSISTANT]: Answer: $\{y_{i - 1}\}$
191
+
192
+ [USER]: The generated answer is too (long / short) at $\{\mathrm{Len}(y)\}$ words.
193
+
194
+ Please (delete / add) $\{\mathcal{D}(y,\ell)\}$ words appropriately based on the previous response:
195
+
196
+ [ASSISTANT]: Answer: $\{y_i\}$
197
+
198
+ <table><tr><td>Models</td><td>Samplers</td><td>Acc↑</td><td>L1↓</td><td>L2↓</td><td>ROUGE-1/2/3</td><td>BERTSCORE-P/R/F</td></tr><tr><td rowspan="3">LLAMA2</td><td>INST</td><td>4.1%</td><td>11.42</td><td>15.20</td><td>0.37/0.13/0.24</td><td>0.89/0.88/0.89</td></tr><tr><td>CMP</td><td>4.5%</td><td>8.58</td><td>11.22</td><td>0.37/0.13/0.24</td><td>0.89/0.88/0.88</td></tr><tr><td>OURS</td><td>81.6%</td><td>0.24</td><td>0.64</td><td>0.36/0.12/0.24</td><td>0.88/0.88/0.88</td></tr><tr><td rowspan="3">QWEN2.5</td><td>INST</td><td>3.2%</td><td>8.64</td><td>10.83</td><td>0.33/0.10/0.21</td><td>0.88/0.88/0.88</td></tr><tr><td>CMP</td><td>4.1%</td><td>8.39</td><td>10.54</td><td>0.33/0.10/0.21</td><td>0.88/0.88/0.88</td></tr><tr><td>OURS</td><td>86.4%</td><td>0.18</td><td>0.72</td><td>0.33/0.10/0.21</td><td>0.88/0.88/0.88</td></tr><tr><td rowspan="3">LLAMA3</td><td>INST</td><td>9.1%</td><td>4.78</td><td>6.10</td><td>0.39/0.14/0.25</td><td>0.89/0.89/0.89</td></tr><tr><td>CMP</td><td>9.8%</td><td>4.53</td><td>5.94</td><td>0.39/0.14/0.25</td><td>0.89/0.89/0.89</td></tr><tr><td>OURS</td><td>78.6%</td><td>0.29</td><td>0.66</td><td>0.38/0.14/0.25</td><td>0.89/0.89/0.89</td></tr><tr><td rowspan="3">LLAMA3.1</td><td>INST</td><td>7.7%</td><td>3.88</td><td>5.10</td><td>0.38/0.13/0.24</td><td>0.89/0.88/0.89</td></tr><tr><td>CMP</td><td>10.8%</td><td>3.83</td><td>5.14</td><td>0.38/0.13/0.24</td><td>0.89/0.88/0.89</td></tr><tr><td>OURS</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td><td>0.88/0.88/0.88</td></tr><tr><td rowspan="3">GPT-3.5</td><td>INST</td><td>5.1%</td><td>8.29</td><td>13.69</td><td>0.36/0.12/0.23</td><td>0.88/0.88/0.88</td></tr><tr><td>CMP</td><td>32.5%</td><td>1.75</td><td>4.35</td><td>0.36/0.12/0.23</td><td>0.88/0.88/0.88</td></tr><tr><td>OURS</td><td>95.0%</td><td>0.14</td><td>1.11</td><td>0.36/0.12/0.23</td><td>0.88/0.88/0.88</td></tr><tr><td rowspan="3">GPT-4</td><td>INST</td><td>15.7%</td><td>2.10</td><td>2.67</td><td>0.36/0.12/0.23</td><td>0.88/0.88/0.88</td></tr><tr><td>CMP</td><td>35.3%</td><td>1.43</td><td>1.99</td><td>0.36/0.12/0.23</td><td>0.88/0.88/0.88</td></tr><tr><td>OURS</td><td>99.2%</td><td>0.01</td><td>0.12</td><td>0.36/0.12/0.23</td><td>0.88/0.88/0.88</td></tr></table>
199
+
200
+ It should be noted that our method can perform parallel sampling as long as the corresponding LLM supports it, further improving the control efficiency.
201
+
202
+ # 4 Experiments
203
+
204
+ # 4.1 Experimental Setup
205
+
206
+ Datasets For exact length control, we utilize the CNN/DailyMail dataset (CNNDM, Nallapati et al. (2016)), where the length instruction $\ell$ is extracted from the references. For length-interval control, we use the Alpaca-Eval-LI (ALPACA) and MT-BenchLI (MTBENCH) datasets (Yuan et al., 2024), which are derived from the Alpaca-Eval dataset (Dubois et al., 2024b) and the MT-Bench dataset (Zheng et al., 2023). The length interval instructions are already provided in the dataset, where $\ell_1 = 0$ and $\ell_2$ is the length of the reference response. For CNNDM, we randomly choose 1000 samples from the 3.0 version of the test set, since the instruction following task contains 1042 samples (802 from ALPACA and 240 from MTBENCH).
207
+
208
+ LLMs We evaluate the effectiveness of our framework in the latest LLMs, including Llama-2-7B (LLAMA2, Touvron et al. (2023b), Qwen-2.5-7B (QWEN2.5, Team (2024)), Llama-3/3.1-8B (LLAMA3/3.1, Dubey et al. (2024)), and GPT-3.5/4 (Achiam et al., 2023). For white-box LLMs like LLAMA, we use them as black-box models, where the maximum iteration trial is 5 with a beam size of 16. For black-box models based on APIs like GPT-4, we set the maximum iteration trial as
209
+
210
+ Table 1: Results of the length control on the CNN/DailyMail dataset. INST is the baseline response with length-guided instructions. CMP is the InstructCMP baseline. Ours represents our iterative sampling framework.
211
+
212
+ <table><tr><td>Models</td><td>Samp.</td><td>Acc↑</td><td>L1↓</td><td>L2↓</td><td>WIN.↑</td></tr><tr><td colspan="6">ALPACA-EVAL-LI</td></tr><tr><td rowspan="3">LLAMA3.1</td><td>INST</td><td>91.6%</td><td>2.47</td><td>15.64</td><td>71.6%</td></tr><tr><td>CMP</td><td>95.3%</td><td>0.79</td><td>7.18</td><td>71.9%</td></tr><tr><td>OURS</td><td>99.8%</td><td>0.06</td><td>1.69</td><td>76.7%</td></tr><tr><td rowspan="3">GPT-4</td><td>INST</td><td>37.2%</td><td>21.38</td><td>37.61</td><td>30.2%</td></tr><tr><td>CMP</td><td>82.4%</td><td>1.43</td><td>4.92</td><td>69.5%</td></tr><tr><td>OURS</td><td>99.2%</td><td>0.02</td><td>0.17</td><td>92.0%</td></tr><tr><td colspan="6">MT-BENCH-LI</td></tr><tr><td rowspan="3">LLAMA3.1</td><td>INST</td><td>80.4%</td><td>10.15</td><td>60.71</td><td>35.2%</td></tr><tr><td>CMP</td><td>90.1%</td><td>2.12</td><td>10.37</td><td>38.8%</td></tr><tr><td>OURS</td><td>98.8%</td><td>0.73</td><td>7.12</td><td>42.9%</td></tr><tr><td rowspan="3">GPT-4</td><td>INST</td><td>54.7%</td><td>13.99</td><td>29.16</td><td>27.4%</td></tr><tr><td>CMP</td><td>84.0%</td><td>1.69</td><td>6.13</td><td>41.8%</td></tr><tr><td>OURS</td><td>98.8%</td><td>0.05</td><td>0.41</td><td>63.7%</td></tr></table>
213
+
214
+ Table 2: Results of the length control on the AlpacaEval-LI dataset and the MT-Bench-LI dataset.
215
+
216
+ 15 without parallel sampling. We compare with two baselines: naive instructions and InstructCMP (Juseon-Do et al., 2024), which designs specialized instructions for length compression.
217
+
218
+ Evaluation Metrics We use several metrics to estimate the effect of the length control. ACCuracy measures the ratio of generated contents that are fully in accordance with the length constraint. Given $N$ generated contents, L1 measures the average Manhattan distance $\frac{1}{N}\sum_{y}|\mathrm{Len}(y) - \ell |$ and L2 measures the average Euclidean distance $\sqrt{\frac{1}{N}\sum_{y}|\mathrm{Len}(y) - \ell|^{2}}$ . For quality evaluation of the summary task, we use the classic score ROUGE
219
+
220
+ <table><tr><td>Models</td><td>WIN↑</td><td>TIE</td><td>LOSE↓</td><td>KAPPA↑</td></tr><tr><td>QWEN2.5</td><td>69.5%</td><td>10.0%</td><td>20.5%</td><td>0.57</td></tr><tr><td>LLAMA3.1</td><td>59.0%</td><td>12.5%</td><td>30.5%</td><td>0.48</td></tr></table>
221
+
222
+ Table 3: Human Evaluation: Ours vs INST.
223
+
224
+ <table><tr><td>Trials</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td><td>ROUGE-(1/2/L)</td></tr><tr><td colspan="5">LLAMA3.1</td></tr><tr><td>0</td><td>7.7%</td><td>3.88</td><td>5.10</td><td>0.38/0.13/0.24</td></tr><tr><td>1</td><td>86.4%</td><td>0.18</td><td>0.55</td><td>0.38/0.13/0.24</td></tr><tr><td>2</td><td>99.2%</td><td>0.04</td><td>0.28</td><td>0.38/0.13/0.24</td></tr><tr><td>3</td><td>99.8%</td><td>0.01</td><td>0.03</td><td>0.38/0.13/0.24</td></tr><tr><td>4</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td></tr><tr><td>5</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td></tr></table>
225
+
226
+ (Lin, 2004), BERTSCORE (Zhang* et al., 2020) and human evaluation. For instruction following tasks, we use the length-instructed WINrate (Yuan et al., 2024), where responses are compared pairwise with baselines. The winner is determined by both the quality of the responses provided by LLM-as-a-Judge (Zheng et al., 2023), and the adherence to the length constraints. If the response exceeds the length constraint, it is automatically lost.
227
+
228
+ # 4.2 Main Results
229
+
230
+ The detailed comparisons between the baselines and our framework are demonstrated in Tables 1 and 2. Table 1 presents the results of length control experiments conducted on the CNN/DailyMail dataset. Our method demonstrates significant improvements over the baseline instruction methods across all models and length-related metrics. Specifically, we achieve near-perfect or perfect accuracy (ACC), with values exceeding $95\%$ for the most advanced LLMs (LLAMA3.1, GPT-3.5, and GPT-4), while the baselines struggle with accuracy values below $36\%$ . Furthermore, our approach exhibits substantially lower errors of L1 and L2, indicating precise adherence to the target lengths. For example, on LLAMA3.1, our framework achieves an accuracy of $100\%$ , demonstrating flawless length control. Similarly, we attain a $99.2\%$ accuracy on GPT-4, reducing the L1 and L2 errors to 0.01 and 0.12, respectively. Beyond the significant improvement in length control, our method introduces almost no degradation in generation quality, where ROUGE and BERTSCORE remain almost the same to baselines.
231
+
232
+ Table 2 evaluates the performance of our method
233
+
234
+ Table 4: Analysis of the iteration trial on the CNNDM dataset, where the beam size is 16.
235
+
236
+ <table><tr><td>Beams</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td><td>ROUGE-(1/2/L)</td></tr><tr><td colspan="5">LLAMA3.1</td></tr><tr><td>0</td><td>7.7%</td><td>3.88</td><td>5.10</td><td>0.38/0.13/0.24</td></tr><tr><td>1</td><td>93.3%</td><td>0.14</td><td>0.88</td><td>0.37/0.13/0.24</td></tr><tr><td>2</td><td>98.9%</td><td>0.02</td><td>0.12</td><td>0.37/0.13/0.24</td></tr><tr><td>4</td><td>99.7%</td><td>0.01</td><td>0.05</td><td>0.38/0.14/0.25</td></tr><tr><td>8</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td></tr><tr><td>16</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td></tr></table>
237
+
238
+ Table 5: Analysis of the beam size on the CNNDM dataset, where the iteration trial is 5.
239
+
240
+ <table><tr><td>Samp.</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td><td>ROUGE-(1/2/L)</td></tr><tr><td>INST</td><td>7.7%</td><td>3.88</td><td>5.10</td><td>0.38/0.13/0.24</td></tr><tr><td>RAND</td><td>38.8%</td><td>1.18</td><td>1.85</td><td>0.38/0.14/0.24</td></tr><tr><td>MH</td><td>40.2%</td><td>1.47</td><td>3.20</td><td>0.36/0.13/0.23</td></tr><tr><td>MH+IS</td><td>93.3%</td><td>0.14</td><td>0.88</td><td>0.37/0.13/0.24</td></tr></table>
241
+
242
+ Table 6: Ablation study of LLAMA3.1 on CNNDM, where the iteration trial is 5 and the beam size is 1.
243
+
244
+ on Alpaca-Eval-LI and MT-Bench-LI datasets. Although these two datasets are relatively easier compared to the exact length control task, the performance improvement (with an accuracy increase of at least $4.5\%$ ) brought about by our method compared to the baselines is significant, confirming the consistent superiority of our framework across different benchmarks. In addition, the LLM judged pairwise WINrate of our approach improves. These results highlight the effectiveness of our iterative sampling framework in achieving robust and accurate length control across diverse LLMs.
245
+
246
+ Table 3 is the human evaluation on CNNDM with three human and three LLM annotators. Each evaluator is presented with the article and the paired summaries of two methods (OURS and INST). They are asked to assign the win, tie, or lose for each pair based on the informativeness and conciseness of each summary. We randomly select 100 cases for each method and shuffle their demonstrated positions. It is observed that our method shows a significant advantage over the baseline. Beides, the human and LLM evaluations are highly aligned, as evidenced by strong kappa correlations.
247
+
248
+ # 4.3 Analyses
249
+
250
+ We analyze the hyperparameters of our framework, the number of iteration trials and the beam size, which are illustrated in Tables 4 and 5. Both hyperparameters are used to expand and explore the sampling space, with larger iteration trials demanding greater time overhead and larger beam sizes in
251
+
252
+ <table><tr><td>Task</td><td>Samp.</td><td>STEP↓</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td></tr><tr><td rowspan="3">CNNDM</td><td>RAND</td><td>18.6</td><td>95.3%</td><td>0.06</td><td>0.35</td></tr><tr><td>MH</td><td>17.1</td><td>96.0%</td><td>0.34</td><td>1.85</td></tr><tr><td>MH+Is</td><td>2.4</td><td>100.0%</td><td>0.00</td><td>0.00</td></tr><tr><td rowspan="3">ALPACA</td><td>RAND</td><td>0.6</td><td>98.0%</td><td>0.21</td><td>1.71</td></tr><tr><td>MH</td><td>0.9</td><td>95.3%</td><td>0.32</td><td>2.67</td></tr><tr><td>MH+Is</td><td>0.1</td><td>100.0%</td><td>0.00</td><td>0.00</td></tr><tr><td rowspan="3">MTBENCH</td><td>RAND</td><td>3.0</td><td>97.9%</td><td>0.33</td><td>3.26</td></tr><tr><td>MH</td><td>3.3</td><td>96.7%</td><td>0.42</td><td>4.88</td></tr><tr><td>MH+Is</td><td>0.8</td><td>99.5%</td><td>0.06</td><td>0.85</td></tr></table>
253
+
254
+ currying higher space costs. As the sampling space reduces, the influence of length control progressively decreases. In particular, this reduction is non-linear, with the rate of decline accelerating significantly. Besides, comparing the two tables, we can observe that the number of iteration trials contributes more to the control effect than the beam size. With a smaller sampling space of 2 beams $\times 5$ trials, the accuracy $(98.9\%)$ outperforms the situation with 16 beams $\times 1$ trial $(86.4\%)$ .
255
+
256
+ # 4.4 Ablation Study
257
+
258
+ Table 6 presents an ablation study evaluating the performance of different sampling strategies for LLAMA3.1 on the CNN/DailyMail dataset. We examine four sampling strategies: (1) INST is the instruction following baseline without iterations; (2) RAND extends the baseline to resample at each iteration and retains the best one; (3) MH is our initial version of the Metropolis-Hastings framework that resamples with the proposal distribution $y \sim p(y_i | y_{i-1}, x)$ during each iteration; and (4) MH+IS is our complete method which replaces the proposal distribution with the importance distribution $q(y_i | y_{i-1}, x)$ . We set the beam size to 1, because sampling a batch of initial states $y_0 \sim P(y|x)$ is actually the RAND method and we want to eliminate this influence. Experimental results show that with the powerful instruction following capabilities of LLMs, random sampling of more candidates can achieve good control effects. However, the original Metropolis-Hastings method does not make the process more efficient and is sometimes even worse than random sampling. By replacing the proposal distribution with an importance sampling strategy, our method achieves significant improvements.
259
+
260
+ # 4.5 Convergence Study
261
+
262
+ Furthermore, we analyze the accurate convergence speed of different sampling methods in Tables 7
263
+
264
+ Table 7: Convergence steps on LLAMA3.1.
265
+
266
+ <table><tr><td>Task</td><td>Samp.</td><td>\( STEPS\downarrow \)</td><td>\( ACC\uparrow \)</td><td>\( L1\downarrow \)</td><td>\( L2\downarrow \)</td></tr><tr><td rowspan="3">CNNDM</td><td>RAND</td><td>2.6</td><td>93.8%</td><td>0.06</td><td>0.29</td></tr><tr><td>MH</td><td>2.5</td><td>91.4%</td><td>0.09</td><td>0.58</td></tr><tr><td>MH+IS</td><td>1.0</td><td>98.0%</td><td>0.02</td><td>0.14</td></tr><tr><td rowspan="3">ALPACA</td><td>RAND</td><td>2.5</td><td>77.3%</td><td>2.52</td><td>6.54</td></tr><tr><td>MH</td><td>3.0</td><td>93.6%</td><td>3.02</td><td>8.67</td></tr><tr><td>MH+IS</td><td>0.4</td><td>98.2%</td><td>0.09</td><td>0.81</td></tr><tr><td rowspan="3">MTBENCH</td><td>RAND</td><td>1.3</td><td>83.7%</td><td>2.57</td><td>7.89</td></tr><tr><td>MH</td><td>1.8</td><td>78.3%</td><td>4.09</td><td>14.71</td></tr><tr><td>MH+IS</td><td>0.1</td><td>99.8%</td><td>0.01</td><td>0.09</td></tr></table>
267
+
268
+ Table 8: Convergence steps on GPT-4.
269
+
270
+ and 8. We set the beam size to 1 as in section 4.4 and the maximum iteration step for each case is 100 for LLAMA3.1 and 15 for GPT-4. We report the average iteration STEPS required to satisfy the length constraints, which excludes the first sampling step $y_0 \sim P(y|x)$ . We observe that different models have different convergence steps for different tasks. In general, precise length control tasks are more difficult and require more iterations. Even so, we achieve an almost perfect control effect with only 2.4 iteration steps on average for LLAMA3.1. We even only need an average of 0.1 iterations for LLAMA3.1 to perform perfect control on the Alpaca-Eval-LI dataset. For GPT-4, we only need 1.0 iterations at most on average to obtain good control results. Therefore, our framework can achieve extremely effective length control performance with acceptable time overhead.
271
+
272
+ # 5 Conclusion
273
+
274
+ We propose a novel length controllable sampling framework for black-box models and verify the effectiveness with experiments and analyses. Our study confirms that an almost perfect length control can be achieved on LLMs, which is of great significance to improve their instruction following ability. In addition, although our framework performs well, its sampling efficiency and generation effect are affected by the capabilities of LLM itself. Fortunately, with the rapid development of LLMs, this concern will gradually disappear. Its worth noting that we do not directly compare with the length training methods, because (1) the black-box models are not trainable, and (2) the training methods are based on specific datasets and possess some data bias, which is contrary to the objective of a more generalized length control. We hope to explore more efficient and general length control schemes in our future studies.
275
+
276
+ # Limitations
277
+
278
+ Despite the promising results demonstrated in our experiments, our method has some limitations that merit further discussion:
279
+
280
+ # Inference Overhead:
281
+
282
+ Our approach introduces additional inference overhead due to the iterative nature of the method. Although the experimental results show that satisfactory results can often be achieved in 2 iterations for advanced models such as LLAMA3.1. However, more iteration steps are required for more difficult scenarios or weaker LLMs. This additional computational cost may present challenges for large-scale batch generation tasks where inference speed is critical. Future research could explore optimization techniques to reduce the number of iterations required or design lightweight variants to better suit the high-throughput applications.
283
+
284
+ # Dependency on Instruction Following Abilities:
285
+
286
+ The performance of our method is highly dependent on the instruction following capabilities of the underlying model. For state-of-the-art LLMs such as LLAMA3.1 and GPT-4, fewer iterations are typically sufficient to achieve satisfactory results. However, when applied to models with less robust instruction-following abilities, the number of iterations required may increase significantly, potentially affecting efficiency. Addressing this limitation could involve developing methods to enhance instruction alignment for less capable models or incorporating external mechanisms to mitigate the dependency on instruction following abilities.
287
+
288
+ Considering our experiments, the limitations are:
289
+
290
+ # Baselines:
291
+
292
+ We do not directly compare with training methods for length control because: (1) our framework is dedicated to black-box LLMs, which is not trainable; (2) length instructions have already been incorporated in the supervised fine-tuning stage of LLMs, which means LLMs themselves are length trainable baselines; (3) the training methods are based on specific datasets and possess some data bias, which is contrary to the objective of a more generalized length control; and (4) large-scale training of length instructions on LLMs such as LLAMA3.1 requires a lot of computing resources that we cannot currently afford.
293
+
294
+ # Models:
295
+
296
+ Currently, we only test the most widely used LLMs. Due to the limitations of computing resources and costs, we are unable to test white-box models with larger parameters (such as 70B), nor can we afford the test of other API-based black-box LLMs on a large scale.
297
+
298
+ # Ethics Statement
299
+
300
+ This research focuses on controlling the output length of LLMs to address practical usability and fairness concerns in various applications, such as summarization, dialogue systems, and content generation. By enabling precise length control, this work aims to enhance user experience, ensure relevance, and reduce unintended biases introduced by excessively verbose or overly concise outputs.
301
+
302
+ We recognize the potential ethical risks associated with the misuse of controlled generation, such as the creation of misleading or harmful content tailored to specific lengths. To mitigate such risks, our methodology emphasizes transparency, reproducibility, and alignment with ethical guidelines in AI development. Additionally, we advocate for integrating robust content moderation mechanisms in downstream applications to safeguard against unintended consequences.
303
+
304
+ This research was conducted following established ethical standards, ensuring that the datasets used respect privacy and are free of harmful biases to the best of our ability. Future work will further explore the societal implications of this technology, ensuring its responsible and equitable deployment.
305
+
306
+ # Acknowledgement
307
+
308
+ Xiaocheng Feng is the corresponding author of this work. We thank the anonymous reviewers for their insightful comments. This work was supported by the National Natural Science Foundation of China (NSFC) (grant 62276078, U22B2059), the Key R&D Program of Heilongjiang via grant 2022ZX01A32, and the Fundamental Research Funds for the Central Universities (Grant No.HIT.OCEF.2023018).
309
+
310
+ # References
311
+
312
+ Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman,
313
+
314
+ Shyamal Anadkat, et al. 2023. Gpt-4 technical report. arXiv preprint arXiv:2303.08774.
315
+ Steven Bird, Ewan Klein, and Edward Loper. 2009. Natural language processing with Python: analyzing text with the natural language toolkit. "O'Reilly Media, Inc."
316
+ Tom B Brown. 2020. Language models are few-shot learners. arXiv preprint arXiv:2005.14165.
317
+ Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E Gonzalez, et al. 2023. Vicuna: An open-source chatbot impressing gpt-4 with $90\%$ chatgpt quality. See https://vicuna.lmsys.org (accessed 14 April 2023), 2(3):6.
318
+ Siddhartha Chib and Edward Greenberg. 1995. Understanding the metropolis-hastings algorithm. The american statistician, 49(4):327-335.
319
+ Jacob Devlin. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
320
+ Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, et al. 2024. The llama 3 herd of models. arXiv preprint arXiv:2407.21783.
321
+ Yann Dubois, Balázs Galambosi, Percy Liang, and Tatsunori B Hashimoto. 2024a. Length-controlled alpacaeval: A simple way to debias automatic evaluators. arXiv preprint arXiv:2404.04475.
322
+ Yann Dubois, Chen Xuechen Li, Rohan Taori, Tianyi Zhang, Ishaan Gulrajani, Jimmy Ba, Carlos Guestrin, Percy S Liang, and Tatsunori B Hashimoto. 2024b. Alpacafarm: A simulation framework for methods that learn from human feedback. Advances in Neural Information Processing Systems, 36.
323
+ Angela Fan, David Grangier, and Michael Auli. 2017. Controllable abstractive summarization. arXiv preprint arXiv:1711.05217.
324
+ Andrew Gelman, Walter R Gilks, and Gareth O Roberts. 1997. Weak convergence and optimal scaling of random walk metropolis algorithms. The annals of applied probability, 7(1):110-120.
325
+ Heikki Haario, Eero Saksman, and Johanna Tamminen. 2001. An adaptive metropolis algorithm. Bernoulli, 7(6):223-242.
326
+ W. K. Hastings. 1970. Monte carlo sampling methods using markov chains and their applications. Biometrika, 57(1):97-109.
327
+ Chenyang Huang, Hao Zhou, Cameron Jen, Kangjie Zheng, Osmar Zaiane, and Lili Mou. 2024. A decoding algorithm for length-control summarization based on directed acyclic transformers. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 11572-11583, Miami, Florida, USA. Association for Computational Linguistics.
328
+
329
+ Juyong Jiang, Fan Wang, Jiasi Shen, Sungju Kim, and Sunghun Kim. 2024. A survey on large language models for code generation. arXiv preprint arXiv:2406.00515.
330
+ Renlong Jie, Xiaojun Meng, Lifeng Shang, Xin Jiang, and Qun Liu. 2024. Prompt-based length controlled generation with multiple control types. In Findings of the Association for Computational Linguistics: ACL 2024, pages 1067-1085, Bangkok, Thailand. Association for Computational Linguistics.
331
+ Juseon-Do, Jingun Kwon, Hidetaka Kamigaito, and Manabu Okumura. 2024. InstructCMP: Length control in sentence compression through instruction-based large language models. In Findings of the Association for Computational Linguistics: ACL 2024, pages 8980-8996, Bangkok, Thailand. Association for Computational Linguistics.
332
+ Herman Kahn and Andy W Marshall. 1953. Methods of reducing sample size in monte carlo computations. Journal of the Operations Research Society of America, 1(5):263-278.
333
+ Jiaming Li, Lei Zhang, Yunshui Li, Ziqiang Liu, Yuelin Bai, Run Luo, Longze Chen, and Min Yang. 2024. Ruler: A model-agnostic method to control generated length for large language models. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 3042-3059, Miami, Florida, USA. Association for Computational Linguistics.
334
+ Chin-Yew Lin. 2004. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pages 74-81, Barcelona, Spain. Association for Computational Linguistics.
335
+ Yong Lin, Hangyu Lin, Wei Xiong, Shizhe Diao, Jianmeng Liu, Jipeng Zhang, Rui Pan, Haoxiang Wang, Wenbin Hu, Hanning Zhang, Hanze Dong, Renjie Pi, Han Zhao, Nan Jiang, Heng Ji, Yuan Yao, and Tong Zhang. 2024. Mitigating the alignment tax of RLHF. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 580-606, Miami, Florida, USA. Association for Computational Linguistics.
336
+ Wei Liu, Weihao Zeng, Keqing He, Yong Jiang, and Junxian He. 2023. What makes good data for alignment? a comprehensive study of automatic data selection in instruction tuning. arXiv preprint arXiv:2312.15685.
337
+ Yizhu Liu, Qi Jia, and Kenny Zhu. 2022. Length control in abstractive summarization by pretraining information selection. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6885-6895.
338
+ Yizhu Liu, Zhiyi Luo, and Kenny Zhu. 2018. Controlling length in abstractive summarization using a convolutional neural network. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4110-4119.
339
+
340
+ Takuya Makino, Tomoya Iwakura, Hiroya Takamura, and Manabu Okumura. 2019. Global optimization under length constraint for neural text summarization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1039-1048.
341
+ Nicholas Metropolis, Arianna W Rosenbluth, Marshall N Rosenbluth, Augusta H Teller, and Edward Teller. 1953. Equation of state calculations by fast computing machines. The journal of chemical physics, 21(6):1087-1092.
342
+ Ramesh Nallapati, Bowen Zhou, Caglar Gulcehre, Bing Xiang, et al. 2016. Abstractive text summarization using sequence-to-sequence rnns and beyond. arXiv preprint arXiv:1602.06023.
343
+ 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.
344
+ Art Owen and Yi Zhou. 2000. Safe and effective importance sampling. Journal of the American Statistical Association, 95(449):135-143.
345
+ Aske Plaat, Annie Wong, Suzan Verberne, Joost Broekens, Niki van Stein, and Thomas Back. 2024. Reasoning with large language models, a survey. arXiv preprint arXiv:2407.11511.
346
+ Rafael Rafailov, Joey Hejna, Ryan Park, and Chelsea Finn. 2024a. From $r$ to $q^*$ : Your language model is secretly a q-function. arXiv preprint arXiv:2404.12358.
347
+ Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. 2024b. Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36.
348
+ Rico Sennrich. 2015. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909.
349
+ Prasann Singhal, Tanya Goyal, Jiacheng Xu, and Greg Durrett. 2023. A long way to go: Investigating length correlations in rlhf. arXiv preprint arXiv:2310.03716.
350
+ Nisan Stiennon, Long Ouyang, Jeffrey Wu, Daniel Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, and Paul F Christiano. 2020. Learning to summarize with human feedback. Advances in Neural Information Processing Systems, 33:3008-3021.
351
+ I Sutskever. 2014. Sequence to sequence learning with neural networks. arXiv preprint arXiv:1409.3215.
352
+ Sho Takase and Naoaki Okazaki. 2019. Positional encoding to control output sequence length. arXiv preprint arXiv:1904.07418.
353
+
354
+ Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. 2023. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca.
355
+ Qwen Team. 2024. Qwen2.5: A party of foundation models.
356
+ Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023a. Llama: open and efficient foundation language models. arxiv. arXiv preprint arXiv:2302.13971.
357
+ Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. 2023b. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288.
358
+ A Vaswani. 2017. Attention is all you need. Advances in Neural Information Processing Systems.
359
+ Noah Wang, Feiyu Duan, Yibo Zhang, Wangchunshu Zhou, Ke Xu, Wenhao Huang, and Jie Fu. 2024. PositionID: LLMs can control lengths, copy and paste with explicit positional awareness. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 16877-16915, Miami, Florida, USA. Association for Computational Linguistics.
360
+ Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A Smith, Daniel Khashabi, and Hannaneh Hajishirzi. 2022. Self-instruct: Aligning language models with self-generated instructions. arXiv preprint arXiv:2212.10560.
361
+ Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. 2022. Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824-24837.
362
+ Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R Narasimhan, and Yuan Cao. 2023. React: Synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations.
363
+ Zihao Yi, Jiarui Ouyang, Yuwen Liu, Tianhao Liao, Zhe Xu, and Ying Shen. 2024. A survey on recent advances in llm-based multi-turn dialogue systems. arXiv preprint arXiv:2402.18013.
364
+ Zhongyi Yu, Zhenghao Wu, Hao Zheng, Zhe Xuan Yuan, Jefferson Fong, and Weifeng Su. 2021. Lenatten: An effective length controlling unit for text summarization. arXiv preprint arXiv:2106.00316.
365
+ Weizhe Yuan, Ilia Kulikov, Ping Yu, Kyunghyun Cho, Sainbayar Sukhbaatar, Jason Weston, and Jing Xu. 2024. Following length constraints in instructions. arXiv preprint arXiv:2406.17744.
366
+
367
+ 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.
368
+
369
+ Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric Xing, et al. 2023. Judging llm-as-a-judge with mt-bench and chatbot arena. Advances in Neural Information Processing Systems, 36:46595-46623.
370
+
371
+ Chunting Zhou, Pengfei Liu, Puxin Xu, Srinivasan Iyer, Jiao Sun, Yuning Mao, Xuezhe Ma, Avia Efrat, Ping Yu, Lili Yu, et al. 2024. Lima: Less is more for alignment. Advances in Neural Information Processing Systems, 36.
372
+
373
+ # A Prompt Templates
374
+
375
+ # A.1 Initial States
376
+
377
+ For the abstractive summarization task with exact length constraints, we randomly choose an example $(x_{c},y_{c},\ell_{c})$ from the training set as an one-shot demonstration for LLMs, because the chat LLMs are not specifically trained for the output mode of summary tasks. The detailed template is:
378
+
379
+ # Prompt Template: $y_0 \sim P(y|x)$
380
+
381
+ [SYSTEM]: You are a powerful abstractive summarizer.
382
+
383
+ [USER]: Document: $\{x_{c}\}$
384
+
385
+ Based on the previous document, provide a high-quality summary in exactly $\{\ell_c\}$ words:
386
+
387
+ [ASSISTANT]: Summary: $\{y_{c}\}$
388
+
389
+ [USER]: Document: $\{x\}$
390
+
391
+ Based on the previous document, provide a high-quality summary in exactly $\{\ell\}$ words:
392
+
393
+ [ASSISTANT]: Summary: $\{y_0\}$
394
+
395
+ For instruction following tasks with length intervals, we directly use zero-shot with the template:
396
+
397
+ # Prompt Template: $y_0 \sim P(y|x)$
398
+
399
+ [USER]: Answer the following instruction using $\{\ell\}$ words or less: $\{x\}$
400
+
401
+ [ASSISTANT]: Answer: $\{y_0\}$
402
+
403
+ # A.2 Probability Densities of Current States
404
+
405
+ We demonstrate the detailed $\{Criteria\}$ of evaluation for different tasks. For abstractive summarization: we score the generated summaries in 5 dimensions on a scale of 1-10.
406
+
407
+ 1. Information Coverage: Does the summary include the most important and critical information from the document?
408
+ 2. Linguistic Fluency: Are the sentences in the summary fluent, natural, and grammatically correct?
409
+ 3. Conciseness: Does the summary avoid redundancy while retaining key information?
410
+ 4. Logical Coherence: Is the summary well-structured with clear and logical flow?
411
+
412
+ 5. Faithfulness: Does the summary accurately reflect the facts in the original document without adding false or misleading information?
413
+
414
+ The evaluation $\{Criteria\}$ for the general instruction following task is of 6 dimensions:
415
+
416
+ 1. Helpfulness: Does the response directly address the instruction and provide meaningful assistance?
417
+ 2. Relevance: Does the response stay on topic and avoid unnecessary or unrelated information?
418
+ 3. Accuracy: Is the information in the response factually correct and free of errors?
419
+ 4. Depth: Does the response demonstrate a deep understanding of the topic, including nuanced explanations where relevant?
420
+ 5. Creativity: Does the response display originality, creativity, or a unique approach to addressing the instruction?
421
+ 6. Level of Detail: Is the response sufficiently detailed, providing comprehensive and thorough explanations where necessary?
422
+
423
+ Following the setting of MT-Bench, we set a special evaluation $\{Criteria\}$ for math-related instruction following tasks such as reasoning, math and coding, which is described below.
424
+
425
+ 1. Correctness: Is the answer logically sound, factually accurate, and free from errors?
426
+ 2. Helpfulness: Does the response directly address the instruction and provide meaningful assistance?
427
+ 3. Clarity: Is the response well-structured and easy to understand?
428
+ 4. Efficiency: Does the response provide an optimal solution without unnecessary complexity?
429
+ 5. Completeness: Does the response fully cover the instruction's requirements and edge cases?
430
+ 6. Robustness: Can the response handle ambiguity or complexity in the instruction?
431
+
432
+ We formalize the output to facilitate the extraction of key information, where the $\{Format\}$ is
433
+
434
+ \*\*\*\* Response 1:
435
+
436
+ 1. Information Coverage:: [Score]/10
437
+ 2. Linguistic Fluency: [Score]/10
438
+
439
+ .
440
+
441
+ **Overall Score:** [Total Score]/50
442
+ ******** Response 2:
443
+
444
+ 1. Information Coverage:: [Score]/10
445
+ 2. Linguistic Fluency: [Score]/10
446
+
447
+ ···
448
+
449
+ **Overall Score:** [Total Score]/50
450
+ >>> Conclusion:
451
+
452
+ - **Better Response:** [Response 1/Response 2].
453
+ - **Score Ratio (Response $1 \div$ Response 2):** [Ratio, rounded to two decimal places].
454
+
455
+ We calculate the eq. (10) via
456
+
457
+ $$
458
+ \begin{array}{l} \frac {P \left(y _ {i} \mid x\right)}{P \left(y _ {i - 1} \mid x\right)} \simeq \frac {\phi \left(y _ {i} \mid x\right)}{\phi \left(y _ {i - 1} \mid x\right)} \tag {13} \\ = \frac {\text {S c o r e o f R e s p o n s e 1}}{\text {S c o r e o f R e s p o n s e 2}}. \\ \end{array}
459
+ $$
460
+
461
+ Therefore, the prompt templates for estimating the target probability density are:
462
+
463
+ # Prompt Template: $\Phi (y_{i},y_{i - 1}|x)$
464
+
465
+ [SYSTEM]: You are a powerful evaluator for abstractive summarization.
466
+
467
+ [USER]: I need to compare and evaluate the quality of two summaries generated for a given document. Please provide a quantitative assessment of their performance based on the criteria below.
468
+
469
+ Document: $\{x\}$
470
+
471
+ Summary 1: $\{y_i\}$
472
+
473
+ Summary 2: $\{y_{i - 1}\}$
474
+
475
+ Evaluation Criteria (each scored on a scale of 1-10, with 10 being the best): {Criteria} Instructions:
476
+
477
+ * Score each summary based on the above criteria.
478
+ * Calculate an overall score for each summary as the sum of all criteria scores (maximum 50).
479
+ * Conclude by identifying which summary is better overall.
480
+ * Calculate a score ratio of Summary 1 to Summary 2 (Summary 1 Score ÷ Summary 2 Score).
481
+
482
+ Output Format: {Format}
483
+
484
+ where we force LLMs to score the responses of the adjacent steps generated by itself. By extracting the score ratio from $\{Format\}$ , we can estimate the fraction of the target distribution.
485
+
486
+ For instruction following tasks, we use the pairwise template derived from the Alpaca-Eval, which emphasizes that the length of the generated content and the position of the presentation should not be a bias in scoring.
487
+
488
+ # Prompt Template: $\Phi (y_i,y_{i - 1}|x)$
489
+
490
+ [SYSTEM]: You are a highly efficient assistant, who evaluates and selects the best large language model (LLMs) based on the quality of their responses to a given instruction.
491
+
492
+ This process will be used to create a leaderboard reflecting the most accurate and human-preferred answers.
493
+
494
+ [USER]: I require a leaderboard for various large language models. I'll provide you with an instruction given to these models and their corresponding responses. Your task is to assess these responses, provide a quantitative assessment of their performance based on the criteria below, and select the model that produces the best output from a human perspective. Avoid any position biases and ensure that the order in which the responses were presented does not influence your decision.
495
+
496
+ Instruction: $\{x\}$
497
+
498
+ Response 1: $\{y_i\}$
499
+
500
+ Response 2: $\{y_{i - 1}\}$
501
+
502
+ Tasks:
503
+
504
+ * Score each response based on the above criteria.
505
+ * Calculate an overall score for each response as the sum of all criteria scores (maximum 60).
506
+ * Conclude by identifying which response is better overall.
507
+ * Calculate a score ratio of Response 1 to Response 2 (Response 1 Score ÷ Response 2 Score).
508
+ Output Format: {Format}
509
+
510
+ # A.3 Propose New States
511
+
512
+ Proposal Distribution For the abstractive summarization task, the prompt template for sampling from the proposal distribution $p(y_{i}|y_{i - 1},x)$ is:
513
+
514
+ # Prompt Template: $y_{i} \sim p(y_{i} | y_{i-1}, x)$
515
+
516
+ [SYSTEM]: You are a powerful abstractive summarizer.
517
+
518
+ [USER]: Document: $\{x\}$
519
+
520
+ Based on the previous document, provide a high-quality summary in exactly $\{\ell\}$ words:
521
+
522
+ [ASSISTANT]: Summary: $\{y_{i-1}\}$
523
+
524
+ [USER]: Please generate a new summary based on the previous one:
525
+
526
+ [ASSISTANT]: Summary: $\{y_i\}$
527
+
528
+ The template for instruction following task is:
529
+
530
+ # Prompt Template: $y_{i} \sim p(y_{i} | y_{i-1}, x)$
531
+
532
+ [USER]: Answer the following instruction using $\{\ell\}$ words or less. $\backslash n\backslash n$ $\{x\}$
533
+
534
+ [ASSISTANT]: Answer:\n $\{y_{i-1}\}$
535
+
536
+ [USER]: Please generate a new answer based on the previous one:
537
+
538
+ [ASSISTANT]: Answer: $\backslash n\{y_i\}$
539
+
540
+ Importance Distribution We split the importance distribution into two segments. When the candidate length is far from the target length $\mathcal{D}(y,\ell) > 3$ , we use a looser objective so that LLMs can have more opportunities for semantic organization, which is beneficial for the quality of generation. The template for abstractive summarization is:
541
+
542
+ # Prompt Template: $y_{i} \sim q(y_{i}|y_{i - 1},x)$
543
+
544
+ [SYSTEM]: You are a powerful abstractive summarizer.
545
+
546
+ [USER]: Document: \n \{x\} \n\nBased on the previous document, provide a high-quality summary in exactly $\{\ell\}$ words:
547
+
548
+ [ASSISTANT]: Summary: $\backslash n\{y_{i - 1}\}$
549
+
550
+ [USER]: The generated summary is too (long / short) at $\{\operatorname{Len}(y)\}$ words.
551
+
552
+ Please improve it to be exactly $\{\ell\}$ words by (focusing on the core ideas and removing some redundant details / adding some details and maintaining clarity and relevance):
553
+
554
+ [ASSISTANT]: Summary: $\backslash n\{y_i\}$
555
+
556
+ The prompt template for instruction following is:
557
+
558
+ # Prompt Template: $y_{i} \sim q(y_{i}|y_{i - 1},x)$
559
+
560
+ [USER]: Answer the following instruction using $\{\ell\}$ words or less. \n\n
561
+
562
+ [ASSISTANT]: Answer: $\backslash n\{y_{i - 1}\}$
563
+
564
+ [USER]: The generated answer is too long at $\{\mathrm{Len}(y)\}$ words. Please improve it to be exactly $\{\ell\}$ words or less by focusing on the core contents and removing any unhelpful, irrelevant, or inaccurate parts:
565
+
566
+ [ASSISTANT]: Answer: $\backslash n\{y_i\}$
567
+
568
+ When the candidate length is close to the target length $\mathcal{D}(y,\ell)\leq 3$ , we force an accurate length control such that LLMs are required to add or delete an exact number of words. The prompt template for abstractive summarization is:
569
+
570
+ # Prompt Template: $y_{i} \sim q(y_{i} | y_{i-1}, x)$
571
+
572
+ [SYSTEM]: You are a powerful abstractive summarizer.
573
+
574
+ [USER]: Document: \n \{x\} \n\nBased on the previous document, provide a high-quality summary in exactly $\{\ell\}$ words:
575
+
576
+ [ASSISTANT]: Summary: $\backslash n\{y_{i - 1}\}$
577
+
578
+ [USER]: Please (delete / add) $\{\mathcal{D}(y,\ell)\}$ words appropriately based on the previous summary:
579
+
580
+ [ASSISTANT]: Summary: $\backslash n\{y_i\}$
581
+
582
+ The prompt template for instruction following is:
583
+
584
+ # Prompt Template: $y_{i} \sim q(y_{i} | y_{i-1}, x)$
585
+
586
+ [USER]: Answer the following instruction using $\{\ell\}$ words or less. \n\n
587
+
588
+ [ASSISTANT]: Answer: $\backslash n\{y_{i - 1}\}$
589
+
590
+ [USER]: The generated answer is too long at $\{\mathrm{Len}(y)\}$ words. Please delete $\{\mathcal{D}(y,\ell)\}$ words appropriately based on the previous response:
591
+
592
+ [ASSISTANT]: Answer: $\backslash n\{y_i\}$
593
+
594
+ <table><tr><td>Models</td><td>Top-K</td><td>Top-P</td><td>Temp.</td><td>Rep.</td></tr><tr><td>QWEN2.5</td><td>20</td><td>0.8</td><td>0.7</td><td>1.05</td></tr><tr><td>LLAMA2</td><td>50</td><td>0.9</td><td>0.6</td><td>1.00</td></tr><tr><td>LLAMA3</td><td>50</td><td>0.9</td><td>0.6</td><td>1.00</td></tr><tr><td>LLAMA3.1</td><td>50</td><td>0.9</td><td>0.6</td><td>1.00</td></tr></table>
595
+
596
+ Table 9: Generation configurations of LLMs.
597
+
598
+ <table><tr><td>Models</td><td>WIN↑</td><td>TIE</td><td>LOSE↓</td><td>KAPPA↑</td></tr><tr><td>QWEN2.5</td><td>71.0%</td><td>12.0%</td><td>17.0%</td><td>0.61</td></tr><tr><td>LLAMA3.1</td><td>58.0%</td><td>14.0%</td><td>28.0%</td><td>0.53</td></tr></table>
599
+
600
+ Table 10: Human Evaluation: Ours vs INST. (three human evaluators)
601
+
602
+ # B Experimental Details
603
+
604
+ Our experiments are implemented on the Huggingface Transformers package<sup>1</sup>. All LLMs we used are the chat version trained with supervised fine tuning, where LLAMA2 and QWEN2.5 have 7B parameters while LLAMA3 and LLAMA3.1 have 8B parameters. The generation configurations of each model are set by default, as demonstrated in Table 9. There is no training stage of our framework, and the inference is performed on an NVIDIA A100 80GB GPU with a random seed of 0. For the CNN/Daily Mail dataset, we randomly choose 1000 samples from the 3.0 version of the test set, since the instruction following task contains 1042 samples (802 from Alpaca-Eval-LI and 240 from MT-Bench-LI).
605
+
606
+ We conduct a human evaluation involving three Ph.D. students with expertise in natural language processing and IELTS scores of at least 6.5. Each evaluator is presented with the article and the paired summaries of two methods (OURS and INST). They are tasked with assigning a score for each pair as a win, tie, or lose based on the informativeness and conciseness of each summary. We randomly shuffle the demonstrated position of summaries from different samplers and the evaluators are blinded to the identity of the samplers to prevent bias. We randomly select 100 cases for each model on CNNDM. To compensate for the inability to hire native English-speaking evaluators, we further leverage state-of-the-art English-oriented LLMs as additional evaluators, which are GPT-4o-latest, MetaLlama-3.1-405B-Instruct, and claude-3.5-sonnet20241022. These models have been extensively validated in numerous studies, demonstrating per
607
+
608
+ <table><tr><td>Models</td><td>WIN↑</td><td>TIE</td><td>LOSE↓</td><td>KAPPA↑</td></tr><tr><td>QWEN2.5</td><td>68.0%</td><td>8.0%</td><td>24.0%</td><td>0.68</td></tr><tr><td>LLAMA3.1</td><td>56.0%</td><td>11.0%</td><td>33.0%</td><td>0.59</td></tr></table>
609
+
610
+ Table 11: Human Evaluation: Ours vs INST. (three LLM evaluators)
611
+
612
+ <table><tr><td>Models</td><td>WIN↑</td><td>TIE</td><td>LOSE↓</td><td>KAPPA↑</td></tr><tr><td>QWEN2.5</td><td>69.5%</td><td>10.0%</td><td>20.5%</td><td>0.57</td></tr><tr><td>LLAMA3.1</td><td>59.0%</td><td>12.5%</td><td>30.5%</td><td>0.48</td></tr></table>
613
+
614
+ Table 12: Human Evaluation: Ours vs INST. (three human and three LLM evaluators)
615
+
616
+ formance that exceeds human evaluators in various NLP tasks. By incorporating both human and AI-based assessments, we ensure a more comprehensive and reliable evaluation of summary quality. The results and kappa correlations among three human evaluators, three LLM evaluators, and three human and three LLM evaluators are demonstrated in Tables 10 to 12. We can observe that the human evaluations are highly aligned with the LLM annotations, with strong kappa correlations. Our method shows a significant advantage over the instruction baseline considering the informativeness and conciseness of the summaries. This improvement is not in line with the ROUGE score. Because the ROUGE score calculates the correlation between the generated summaries and the reference summaries, and the zero-shot / one-shot LLMs share a totally different distribution compared to the references. Therefore, our method can improve both the accuracy of length control and the quality of generated contents. In addition, the slight decrease in the ROUGE score of our method can be explained by the fact that ROUGE is a recall score and it is easy for longer contents to have a higher score. The prompt used for LLM evaluators are as follows.
617
+
618
+ # C Analyses
619
+
620
+ Full results of the length control on the AlpacaEval-LI dataset and the MT-Bench-LI dataset are demonstrated in Table 15. We demonstrate the hyperparameter analyses in Tables 16 and 17. Similar to the observation in §4.3, the marginal effect of LLAMA3 as the sampling space grows is between QWEN2.5 and LLAMA3.1. For ablation studies in QWEN2.5 (Table 14) and LLAMA3 (Table 13), our sampling framework outperforms other methods. However, since the instruction following
621
+
622
+ # Prompt Template: LLM Evaluator
623
+
624
+ [SYSTEM]: Please act as an impartial judge and evaluate the quality of the summaries provided by two AI assistants to the document displayed below.
625
+
626
+ You should choose the assistant that summarizes the document more informative and concise.
627
+
628
+ Your evaluation should also consider factors such as the information coverage, linguistic fluency, conciseness, logical coherence, and faithfulness.
629
+
630
+ Begin your evaluation by comparing the two summaries and provide a short explanation.
631
+
632
+ Avoid any position biases and ensure that the order in which the summaries were presented does not influence your decision.
633
+
634
+ Do not allow the length of the summaries to influence your evaluation.
635
+
636
+ Do not favor certain names of the assistants. Be as objective as possible.
637
+
638
+ After providing your brief explanation, output your final verdict by strictly following this format: "[A]" if assistant A is better, "[B]" if assistant B is better, and "[C]" for a tie.
639
+
640
+ Document: article
641
+
642
+ Assistant A's Answer: summary1
643
+
644
+ Assistant B's Answer: summary2
645
+
646
+ capabilities of these models are not as powerful as LLAMA3.1, their improvement may not be as significant.
647
+
648
+ # D Generated Cases
649
+
650
+ The generated cases of LLAMA3.1 on the AlpacaEval-LI dataset are demonstrated in Table 18.
651
+
652
+ <table><tr><td>Samp.</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td><td>ROUGE-(1/2/L)</td></tr><tr><td>INST</td><td>9.1%</td><td>4.78</td><td>6.10</td><td>0.39/0.14/0.25</td></tr><tr><td>RAND</td><td>30.7%</td><td>3.05</td><td>5.49</td><td>0.38/0.14/0.25</td></tr><tr><td>MH</td><td>30.1%</td><td>4.07</td><td>5.98</td><td>0.38/0.13/0.24</td></tr><tr><td>MH+IS</td><td>36.4%</td><td>1.63</td><td>2.51</td><td>0.39/0.14/0.25</td></tr></table>
653
+
654
+ Table 13: Ablation study of LLAMA3 on CNNDM, where the iteration trial is 5 and the beam size is 1.
655
+
656
+ <table><tr><td>Samp.</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td><td>ROUGE-(1/2/L)</td></tr><tr><td>INST</td><td>3.2%</td><td>8.64</td><td>10.83</td><td>0.33/0.10/0.21</td></tr><tr><td>RAND</td><td>17.7%</td><td>3.54</td><td>5.23</td><td>0.33/0.10/0.21</td></tr><tr><td>MH</td><td>14.1%</td><td>4.73</td><td>7.65</td><td>0.32/0.10/0.21</td></tr><tr><td>MH+Is</td><td>24.6%</td><td>2.41</td><td>4.02</td><td>0.33/0.10/0.21</td></tr></table>
657
+
658
+ Table 14: Ablation study of QwEN2.5 on CNNDM, where the iteration trial is 5 and the beam size is 1.
659
+
660
+ <table><tr><td>Models</td><td>Samp.</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td><td>WIN.↑</td></tr><tr><td colspan="6">ALPACA-EVAL-LI</td></tr><tr><td rowspan="3">LLAMA3</td><td>INST</td><td>92.2%</td><td>1.48</td><td>9.12</td><td>76.5%</td></tr><tr><td>CMP</td><td>95.6%</td><td>0.37</td><td>3.01</td><td>73.3%</td></tr><tr><td>OURS</td><td>99.8%</td><td>0.02</td><td>0.05</td><td>83.5%</td></tr><tr><td rowspan="3">LLAMA3.1</td><td>INST</td><td>91.6%</td><td>2.47</td><td>15.64</td><td>71.6%</td></tr><tr><td>CMP</td><td>95.3%</td><td>0.79</td><td>7.18</td><td>71.9%</td></tr><tr><td>OURS</td><td>99.8%</td><td>0.06</td><td>1.69</td><td>76.7%</td></tr><tr><td rowspan="3">GPT-3.5</td><td>INST</td><td>91.5%</td><td>1.16</td><td>4.92</td><td>57.0%</td></tr><tr><td>CMP</td><td>94.0%</td><td>0.91</td><td>4.63</td><td>59.8%</td></tr><tr><td>OURS</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>65.3%</td></tr><tr><td rowspan="3">GPT-4</td><td>INST</td><td>37.2%</td><td>21.38</td><td>37.61</td><td>30.2%</td></tr><tr><td>CMP</td><td>82.4%</td><td>1.43</td><td>4.92</td><td>69.5%</td></tr><tr><td>OURS</td><td>99.2%</td><td>0.02</td><td>0.17</td><td>92.0%</td></tr></table>
661
+
662
+ <table><tr><td colspan="6">MT-BENCH-LI</td></tr><tr><td rowspan="3">LLAMA3</td><td>INST</td><td>78.8%</td><td>2.80</td><td>7.73</td><td>41.1%</td></tr><tr><td>CMP</td><td>83.3%</td><td>1.15</td><td>4.32</td><td>41.3%</td></tr><tr><td>OURS</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>42.1%</td></tr><tr><td rowspan="3">LLAMA3.1</td><td>INST</td><td>80.4%</td><td>10.15</td><td>60.71</td><td>35.2%</td></tr><tr><td>CMP</td><td>90.1%</td><td>2.12</td><td>10.37</td><td>38.8%</td></tr><tr><td>OURS</td><td>98.8%</td><td>0.73</td><td>7.12</td><td>42.9%</td></tr><tr><td rowspan="3">GPT-3.5</td><td>INST</td><td>87.9%</td><td>2.51</td><td>9.46</td><td>24.6%</td></tr><tr><td>CMP</td><td>93.5%</td><td>0.64</td><td>3.20</td><td>26.2%</td></tr><tr><td>OURS</td><td>98.6%</td><td>0.09</td><td>0.73</td><td>27.3%</td></tr><tr><td rowspan="3">GPT-4</td><td>INST</td><td>54.7%</td><td>13.99</td><td>29.16</td><td>27.4%</td></tr><tr><td>CMP</td><td>84.0%</td><td>1.69</td><td>6.13</td><td>41.8%</td></tr><tr><td>OURS</td><td>98.8%</td><td>0.05</td><td>0.41</td><td>63.7%</td></tr></table>
663
+
664
+ Table 15: Full results of the length control on the AlpacaEval-LI dataset and the MT-Bench-LI dataset.
665
+
666
+ <table><tr><td>Trials</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td><td>ROUGE-(1/2/L)</td></tr><tr><td colspan="5">QWEN2.5</td></tr><tr><td>0</td><td>3.2%</td><td>8.64</td><td>10.83</td><td>0.33/0.10/0.21</td></tr><tr><td>1</td><td>25.4%</td><td>3.58</td><td>5.80</td><td>0.33/0.10/0.21</td></tr><tr><td>2</td><td>52.8%</td><td>0.96</td><td>2.07</td><td>0.33/0.10/0.21</td></tr><tr><td>3</td><td>70.6%</td><td>0.51</td><td>1.55</td><td>0.33/0.10/0.21</td></tr><tr><td>4</td><td>79.1%</td><td>0.29</td><td>1.16</td><td>0.33/0.10/0.21</td></tr><tr><td>5</td><td>86.4%</td><td>0.18</td><td>0.72</td><td>0.33/0.10/0.21</td></tr><tr><td colspan="5">LLAMA3</td></tr><tr><td>0</td><td>9.1%</td><td>4.78</td><td>6.10</td><td>0.39/0.14/0.25</td></tr><tr><td>1</td><td>48.3%</td><td>0.98</td><td>1.80</td><td>0.38/0.14/0.24</td></tr><tr><td>2</td><td>64.8%</td><td>0.58</td><td>1.05</td><td>0.38/0.13/0.24</td></tr><tr><td>3</td><td>68.4%</td><td>0.44</td><td>0.85</td><td>0.38/0.13/0.24</td></tr><tr><td>4</td><td>72.3%</td><td>0.36</td><td>0.75</td><td>0.38/0.14/0.25</td></tr><tr><td>5</td><td>78.6%</td><td>0.29</td><td>0.66</td><td>0.38/0.14/0.25</td></tr><tr><td colspan="5">LLAMA3.1</td></tr><tr><td>0</td><td>7.7%</td><td>3.88</td><td>5.10</td><td>0.38/0.13/0.24</td></tr><tr><td>1</td><td>86.4%</td><td>0.18</td><td>0.55</td><td>0.38/0.13/0.24</td></tr><tr><td>2</td><td>99.2%</td><td>0.04</td><td>0.28</td><td>0.38/0.13/0.24</td></tr><tr><td>3</td><td>99.8%</td><td>0.01</td><td>0.03</td><td>0.38/0.13/0.24</td></tr><tr><td>4</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td></tr><tr><td>5</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td></tr></table>
667
+
668
+ Table 16: Analysis of the iteration trial on the CNNDM dataset, where the beam size is 16.
669
+
670
+ <table><tr><td>Beams</td><td>ACC↑</td><td>L1↓</td><td>L2↓</td><td>ROUGE-(1/2/L)</td></tr><tr><td colspan="5">QWEN2.5</td></tr><tr><td>0</td><td>3.2%</td><td>8.64</td><td>10.83</td><td>0.33/0.10/0.21</td></tr><tr><td>1</td><td>24.6%</td><td>2.41</td><td>4.02</td><td>0.33/0.10/0.21</td></tr><tr><td>2</td><td>38.7%</td><td>1.75</td><td>3.69</td><td>0.33/0.10/0.21</td></tr><tr><td>4</td><td>57.1%</td><td>0.82</td><td>1.93</td><td>0.32/0.10/0.21</td></tr><tr><td>8</td><td>72.6%</td><td>0.46</td><td>1.49</td><td>0.32/0.10/0.20</td></tr><tr><td>16</td><td>86.4%</td><td>0.18</td><td>0.72</td><td>0.33/0.10/0.21</td></tr><tr><td colspan="5">LLAMA3</td></tr><tr><td>0</td><td>9.1%</td><td>4.78</td><td>6.10</td><td>0.39/0.14/0.25</td></tr><tr><td>1</td><td>36.4%</td><td>1.63</td><td>2.51</td><td>0.39/0.14/0.25</td></tr><tr><td>2</td><td>47.2%</td><td>1.08</td><td>2.10</td><td>0.38/0.14/0.25</td></tr><tr><td>4</td><td>55.8%</td><td>0.72</td><td>1.25</td><td>0.38/0.14/0.25</td></tr><tr><td>8</td><td>67.2%</td><td>0.47</td><td>0.93</td><td>0.38/0.14/0.25</td></tr><tr><td>16</td><td>78.6%</td><td>0.29</td><td>0.66</td><td>0.38/0.14/0.25</td></tr><tr><td colspan="5">LLAMA3.1</td></tr><tr><td>0</td><td>7.7%</td><td>3.88</td><td>5.10</td><td>0.38/0.13/0.24</td></tr><tr><td>1</td><td>93.3%</td><td>0.14</td><td>0.88</td><td>0.37/0.13/0.24</td></tr><tr><td>2</td><td>98.9%</td><td>0.02</td><td>0.12</td><td>0.37/0.13/0.24</td></tr><tr><td>4</td><td>99.7%</td><td>0.01</td><td>0.05</td><td>0.38/0.14/0.25</td></tr><tr><td>8</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td></tr><tr><td>16</td><td>100.0%</td><td>0.00</td><td>0.00</td><td>0.38/0.13/0.24</td></tr></table>
671
+
672
+ Table 17: Analysis of the beam size on the CNNDM dataset, where the iteration trial is 5.
673
+
674
+ <table><tr><td>LLAMA3.1 INST</td><td>LLAMA3.1 Ours</td></tr><tr><td colspan="2">Answer the following instruction using 46 words or less.Is the US border open to Canada?</td></tr><tr><td>Number of Words: 48</td><td>Number of Words: 44</td></tr><tr><td>The US border with Canada is open, but with restrictions. Land and sea borders are open for essential travel, while air travel requires a valid visa or electronic travel authorization. Some re-strictions may apply, so it&#x27;s best to check the official government websites for the latest information.</td><td>The US-Canada border is open, but with restrictions.Travelers must provide proof of COVID-19 vaccination,a negative test, or recovery from the virus. Additionally,some land ports of entry may be closed or have limited hours, so it&#x27;s best to check before traveling.</td></tr><tr><td colspan="2">Answer the following instruction using 50 words or less.Write me a top 10 list of the funniest ways to die.</td></tr><tr><td>Number of Words: 110</td><td>Number of Words: 48</td></tr><tr><td>Please note that this is a dark humor list and not meant to be taken seriously. Here&#x27;s a list of the funniest ways to die (in a fictional context):1. Dying from laughing too hard at a dad joke.2. Choking on a chicken nugget.3. Falling into a giant pile of pillows.4. Getting hit by a runaway inflatable unicorn.5. Accidentally hugging a cactus.6. Dying from a massive sneeze.7. Getting stuck in a giant toilet.8. Falling off a unicycle while riding a unicycle.9. Dying from eating too much wasabi.10. Being attacked by a swarm of bees while trying to get a selfie.</td><td>Here&#x27;s a list of humorous ways to die:1. Laughing too hard.2. Choking on a whoopee.3. Drowning in Jell-O.4. Falling into feathers.5. Being crushed by cats.6. Overdosing on laughter.7. Sneezing from feather.8. Excessive flatulence.9. Cheese coma.10. Snoring loudly.</td></tr><tr><td colspan="2">Answer the following instruction using 128 words or less.Who made Berlin?</td></tr><tr><td>Number of Words: 151</td><td>Number of Words: 125</td></tr><tr><td>Berlin, the capital city of Germany, has a complex and multi-faceted history. The city&#x27;s origins date back to the 13th century when it was a small trading post on the Spree River. Over time, Berlin grew and became a significant center for trade, culture,and politics.In 1237, the Margraviate of Brandenburg was founded, and Berlin became its capital. In 1415, the Hohenzollern dynasty took control of the city, and Berlin continued to grow and prosper. Throughout the centuries, Berlin was influenced by various cultures and empires, including the Prussian Empire, the German Empire, and the Weimar Republic.The city&#x27;s modern history is marked by significant events, including World War I and II, the division of Germany during the Cold War, and the fall of the Berlin Wall in 1989. Today, Berlin is a vibrant and diverse city, known for its rich history, cultural attractions, and thriving arts scene.</td><td>Berlin, the capital of Germany, has a complex and evolving history. The area has been inhabited since the Stone Age, with various tribes and cultures contributing to its development.The city of Berlin as we know it today began to take shape in the 13th century, when it was a small trading post on the Spree River. In 1237, the Margraviate of Brandenburg was established, and Berlin became the capital. Over the centuries, the city grew and was influenced by various rulers, including the Hohenzollern dynasty, which played a significant role in shaping mod-en Berlin.In 1871, Berlin became the capital of Germany, and it continued to grow and evolve throughout the 20th century, experiencing significant changes under the Weimar regime, and the post-war period.</td></tr></table>
675
+
676
+ Table 18: Generated cases of LLAMA3.1 on the Alpaca-Eval-LI dataset.
2025/Length Controlled Generation for Black-box LLMs/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c900ff0dde4699b6823b39cb772db12a73a50a00630bd5f3ae4611c99e35e56c
3
+ size 1371748
2025/Length Controlled Generation for Black-box LLMs/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Length-Induced Embedding Collapse in PLM-based Models/4ec798cf-0a35-4837-9dc0-18b1a6b7d80e_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Length-Induced Embedding Collapse in PLM-based Models/4ec798cf-0a35-4837-9dc0-18b1a6b7d80e_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Length-Induced Embedding Collapse in PLM-based Models/4ec798cf-0a35-4837-9dc0-18b1a6b7d80e_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d09ed55b074bfecedcfad122fb7e0deccf610417fe0ebc027416f8eb77120a9
3
+ size 1359610
2025/Length-Induced Embedding Collapse in PLM-based Models/full.md ADDED
The diff for this file is too large to render. See raw diff
 
2025/Length-Induced Embedding Collapse in PLM-based Models/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77f1d4afc0594edf25b4c484fe6909047a00bf18ccf24a0951158b5cc55c42e6
3
+ size 1659942
2025/Length-Induced Embedding Collapse in PLM-based Models/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/Less Mature is More Adaptable for Sentence-level Language Modeling/638202b3-d3c6-4703-8b57-405e0e7df341_content_list.json ADDED
@@ -0,0 +1,1976 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Less Mature is More Adaptable for Sentence-level Language Modeling",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 132,
8
+ 89,
9
+ 867,
10
+ 112
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Abhilasha Sancheti $^{1*}$",
17
+ "bbox": [
18
+ 134,
19
+ 143,
20
+ 319,
21
+ 161
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "David Dale",
28
+ "bbox": [
29
+ 347,
30
+ 145,
31
+ 455,
32
+ 161
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Artyom Kozhevnikov²",
39
+ "bbox": [
40
+ 487,
41
+ 145,
42
+ 682,
43
+ 161
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Maha Elbayad²",
50
+ "bbox": [
51
+ 724,
52
+ 145,
53
+ 862,
54
+ 161
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "<sup>1</sup>University of Maryland, College Park <sup>2</sup>FAIR at Meta",
61
+ "bbox": [
62
+ 270,
63
+ 162,
64
+ 724,
65
+ 178
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "sancheti@umd.edu, {daviddale, artyomko, elbayadm}@meta.com",
72
+ "bbox": [
73
+ 206,
74
+ 179,
75
+ 791,
76
+ 193
77
+ ],
78
+ "page_idx": 0
79
+ },
80
+ {
81
+ "type": "text",
82
+ "text": "Abstract",
83
+ "text_level": 1,
84
+ "bbox": [
85
+ 260,
86
+ 260,
87
+ 339,
88
+ 275
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "This work investigates sentence-level models (i.e., models that operate at the sentence-level) to study how sentence representations from various encoders influence downstream task performance, and which syntactic, semantic, and discourse-level properties are essential for strong performance. Our experiments encompass encoders with diverse training regimes and pretraining domains, as well as various pooling strategies applied to multi-sentence input tasks (including sentence ordering, sentiment classification, and natural language inference) requiring coarse-to-fine-grained reasoning. We find that \"less mature\" representations (e.g., mean-pooled representations from BERT's first or last layer, or representations from encoders with limited fine-tuning) exhibit greater generalizability and adaptability to downstream tasks compared to representations from extensively fine-tuned models (e.g., SBERT or SimCSE). These findings are consistent across different pretraining seed initializations for BERT. Our probing analysis reveals that syntactic and discourse-level properties are stronger indicators of downstream performance than MTEB scores or decodability. Furthermore, the data and time efficiency of sentence-level models, often outperforming token-level models, underscores their potential for future research.",
95
+ "bbox": [
96
+ 141,
97
+ 288,
98
+ 460,
99
+ 702
100
+ ],
101
+ "page_idx": 0
102
+ },
103
+ {
104
+ "type": "text",
105
+ "text": "1 Introduction",
106
+ "text_level": 1,
107
+ "bbox": [
108
+ 114,
109
+ 727,
110
+ 258,
111
+ 741
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Sentence representation learning is an extensively researched area. Existing works either fine-tune encoders (such as BERT (Devlin et al., 2018)) using Siamese networks (Conneau et al., 2017; Reimers and Gurevych, 2019) or contrastive learning approaches (Gao et al., 2021) using Natural Language Inference (NLI) datasets (Bowman et al., 2015; Williams et al., 2018) or further pretraining encoders using conditional language modeling (Yang",
118
+ "bbox": [
119
+ 112,
120
+ 753,
121
+ 490,
122
+ 898
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "image",
128
+ "img_path": "images/40bef6eddb210350a35604b0baf7533bc2076afc31cc196eefd1c38e1131c90b.jpg",
129
+ "image_caption": [
130
+ "Figure 1: Sentence-level Model: Sentence representations from a frozen encoder are used as input to a randomly initialized BERT-like transformer model. This model is trained to predict the position (regression for sentence ordering) or category (for sequential sentence classification) for each sentence. MSE denotes mean-squared loss and CE denotes cross-entropy loss. For NLI task, we prepend a CLS token to the input and use the representation corresponding to this CLS token to predict the output class for a (premise, hypothesis) pair."
131
+ ],
132
+ "image_footnote": [],
133
+ "bbox": [
134
+ 521,
135
+ 261,
136
+ 873,
137
+ 411
138
+ ],
139
+ "page_idx": 0
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "et al., 2021) to incorporate discourse information in the representations. Others use encoder-decoder models for generating (Kiros et al., 2015) or predicting surrounding sentences (Logeswaran and Lee, 2018) to learn monolingual sentence representations or train encoder-decoder models on machine translation datasets (Conneau, 2019; Artetxe and Schwenk, 2019; Duquenne et al., 2023) to learn multilingual representations. Representations thus obtained are evaluated based on their performance on downstream tasks (Muennighoff et al., 2023) such as clustering, paraphrasing, classification, and retrieval. They are also evaluated on probing tasks to assess various surface-level, syntactic, semantic, and discourse properties encoded in them (Conneau et al., 2018; Conneau and Kiela, 2018; Chen et al., 2019).",
144
+ "bbox": [
145
+ 507,
146
+ 596,
147
+ 884,
148
+ 869
149
+ ],
150
+ "page_idx": 0
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "Apart from learning sentence representations, another line of research has used these sentence representations for causal language modeling or masked",
155
+ "bbox": [
156
+ 507,
157
+ 873,
158
+ 884,
159
+ 921
160
+ ],
161
+ "page_idx": 0
162
+ },
163
+ {
164
+ "type": "page_footnote",
165
+ "text": "*Work done during internship at Meta FAIR.",
166
+ "bbox": [
167
+ 136,
168
+ 906,
169
+ 408,
170
+ 920
171
+ ],
172
+ "page_idx": 0
173
+ },
174
+ {
175
+ "type": "page_number",
176
+ "text": "11680",
177
+ "bbox": [
178
+ 475,
179
+ 927,
180
+ 524,
181
+ 940
182
+ ],
183
+ "page_idx": 0
184
+ },
185
+ {
186
+ "type": "footer",
187
+ "text": "Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 11680-11695 July 27 - August 1, 2025 ©2025 Association for Computational Linguistics",
188
+ "bbox": [
189
+ 82,
190
+ 945,
191
+ 912,
192
+ 973
193
+ ],
194
+ "page_idx": 0
195
+ },
196
+ {
197
+ "type": "table",
198
+ "img_path": "images/3b845e18f0a278043cd9b6985f13aaa52dfc7233bf0862f3a0be2b594d0fd64a.jpg",
199
+ "table_caption": [],
200
+ "table_footnote": [],
201
+ "table_body": "<table><tr><td>Model</td><td>Pretraining Dataset</td><td>Pooling Strategies</td><td>Approach/Training objective</td></tr><tr><td rowspan=\"2\">BERT (Devlin et al., 2018)</td><td rowspan=\"2\">Wikipedia, Books.</td><td>Last layer: mean, CLS, CLS before pooler, max.</td><td rowspan=\"2\">Language modeling + Next sentence prediction.</td></tr><tr><td>First layer: mean, CLS before pooler, max.</td></tr><tr><td rowspan=\"2\">SciBERT (Beltagy et al., 2019)</td><td rowspan=\"2\">Science and Biomedical papers.</td><td>Last layer: mean, CLS, CLS before pooler, max.</td><td rowspan=\"2\">Language modeling + Next sentence prediction (Uses BERT architecture as the base model).</td></tr><tr><td>First layer: mean, CLS before pooler, max</td></tr><tr><td rowspan=\"2\">BERT-SimCSE (Gao et al., 2021)</td><td rowspan=\"2\">SNLI + MNLI.</td><td>Last layer: mean, CLS, CLS before pooler, max.</td><td rowspan=\"2\">Fine-tunes BERT on NLI datasets using contrastive learning.</td></tr><tr><td>First layer: mean, CLS before pooler, max</td></tr><tr><td>SBERT (Reimers and Gurevych, 2019)</td><td>NLI + Paraphrasing + Question Answering.</td><td>Mean</td><td>Fine-tunes BERT-based Siamese network using contrastive objective.</td></tr><tr><td>SBERT-NLI (Reimers and Gurevych, 2019)</td><td>SNLI + MNLI.</td><td>Mean</td><td>Fine-tunes BERT-based Siamese network using 3-class classification loss.</td></tr><tr><td>SciBERT-NLI¹</td><td>SNLI + MNLI.</td><td>Mean</td><td>Fine-tunes SciBERT-based Siamese network using 3-class classification loss.</td></tr><tr><td>CMLM (Yang et al., 2021)</td><td>Common CWEl.</td><td>Mean</td><td>Further pre-train BERT using Conditional Language Modeling.</td></tr></table>",
202
+ "bbox": [
203
+ 122,
204
+ 80,
205
+ 877,
206
+ 517
207
+ ],
208
+ "page_idx": 1
209
+ },
210
+ {
211
+ "type": "text",
212
+ "text": "Table 1: BERT-based encoders: Pretraining datasets, pooling strategies (first and last layers), and training objectives. All models use 768-dimensional representations. See respective papers for details",
213
+ "bbox": [
214
+ 112,
215
+ 526,
216
+ 882,
217
+ 555
218
+ ],
219
+ "page_idx": 1
220
+ },
221
+ {
222
+ "type": "text",
223
+ "text": "language modeling to build sentence-level models resulting in improved storyline generation (Ippolito et al., 2020) and document embeddings (Czinczoll et al., 2024). Such sentence-level models represent a sequence of sentences by a sequence of sentence representations (one per sentence) as opposed to standard token-level models which take in a sequence of token representations. There also exists works that use sentence-level modeling for the task of sentence ordering (Cui et al., 2018; Basu Roy Chowdhury et al., 2021; Kumar et al., 2020; Golestani et al., 2021; Bin et al., 2023), sentence infilling (Huang et al., 2020; Mori et al., 2020), or sequential sentence classification (Cohan et al., 2019; Hillebrand et al., 2024).",
224
+ "bbox": [
225
+ 112,
226
+ 580,
227
+ 489,
228
+ 821
229
+ ],
230
+ "page_idx": 1
231
+ },
232
+ {
233
+ "type": "text",
234
+ "text": "However, limited research has been done in assessing: (RQ1) how does a representation learning approach (such as fine-tuning, contrastive learning, conditional language modeling, etc.) impact the performance of a downstream sentence-level modeling task? (RQ2) what properties must be",
235
+ "bbox": [
236
+ 112,
237
+ 824,
238
+ 489,
239
+ 921
240
+ ],
241
+ "page_idx": 1
242
+ },
243
+ {
244
+ "type": "text",
245
+ "text": "encoded in sentence representations to enable sentence-level modeling tasks? And (RQ3) what are the advantages of sentence-level models over standard token-level models?",
246
+ "bbox": [
247
+ 507,
248
+ 580,
249
+ 884,
250
+ 644
251
+ ],
252
+ "page_idx": 1
253
+ },
254
+ {
255
+ "type": "text",
256
+ "text": "We experiment with several sentence representations, obtained from a variety of sentence encoders, to build sentence-level models for addressing (RQ1). We use existing sentence representation evaluation benchmarks (Conneau et al., 2018; Conneau and Kiela, 2018; Muennighoff et al., 2023; Chen et al., 2019) to assess the surface-level, syntactic, semantic, and discourse-level properties encoded in embeddings. We correlate these properties with their downstream task performance to answer (RQ2) in Section 4. We then compare the downstream task performance of a token-level model with that of sentence-level model in Section 4 to investigate (RQ3).",
257
+ "bbox": [
258
+ 507,
259
+ 646,
260
+ 884,
261
+ 871
262
+ ],
263
+ "page_idx": 1
264
+ },
265
+ {
266
+ "type": "text",
267
+ "text": "Additionally, we thoroughly study the impact of using different pooling strategies on downstream performance, investigate the robustness of our find",
268
+ "bbox": [
269
+ 507,
270
+ 873,
271
+ 882,
272
+ 921
273
+ ],
274
+ "page_idx": 1
275
+ },
276
+ {
277
+ "type": "page_number",
278
+ "text": "11681",
279
+ "bbox": [
280
+ 477,
281
+ 927,
282
+ 522,
283
+ 940
284
+ ],
285
+ "page_idx": 1
286
+ },
287
+ {
288
+ "type": "table",
289
+ "img_path": "images/8c95eefadc43fffe6f61fdd7555bcfab0dee90efdbc3d5b5c7a19a50dc919559.jpg",
290
+ "table_caption": [],
291
+ "table_footnote": [],
292
+ "table_body": "<table><tr><td>Task</td><td>Description</td><td>Domain</td><td>Datasets</td></tr><tr><td rowspan=\"4\">SO Sentence Ordering (coarse-grained)</td><td>Input: shuffled sequence of sentences</td><td rowspan=\"3\">General</td><td rowspan=\"3\">ROCStories (Mostafazadeh et al., 2016) - human written five sentence commonsense stories capturing causal and temporal relations between everyday life events. SIND (Huang et al., 2016) - humans write five sentence stories for a sequence of photos from Flickr album.</td></tr><tr><td>Output: relative position of each sentence</td></tr><tr><td>Task Formulation: Sentence-level regression</td></tr><tr><td></td><td>Scientific</td><td>NIPS (Logeswaran et al., 2016)- abstracts from NIPS papers from 2005-2015. AAN (Radev et al., 2016) - abstracts from ACL anthology until 2013.</td></tr><tr><td rowspan=\"3\">SSC Sequential Sentence Classification (coarse-grained)</td><td>Input: sequence of sentences in a paragraph</td><td rowspan=\"3\">Scientific</td><td rowspan=\"3\">CSAbstruct (Cohan et al., 2019) - manually annotated sentences from computer science abstracts (obtained from semantic scholar) for background, method, result, objective, and other.</td></tr><tr><td>Output: role of each sentence</td></tr><tr><td>Task Formulation: Sentence-level classification</td></tr><tr><td rowspan=\"3\">NLI Paragraph-level Natural Language Inference (fine-grained)</td><td>Input: Multi-sentence premise and a hypothesis</td><td rowspan=\"3\">General</td><td rowspan=\"3\">ANLI (Nie et al., 2020) - adversarial collected NLI dataset via human-and-machine in the loop. Premise (multi-sentence passages from Wikipedia) and target label (one of entailment, contradiction or neutral) are provided to humans to write a hypothesis.</td></tr><tr><td>Output: Whether premise entails, contradicts, or is neutral with respect to the hypothesis</td></tr><tr><td>Task Formulation: Paragraph-level classification</td></tr></table>",
293
+ "bbox": [
294
+ 121,
295
+ 80,
296
+ 877,
297
+ 406
298
+ ],
299
+ "page_idx": 2
300
+ },
301
+ {
302
+ "type": "text",
303
+ "text": "ings across multiple pretraining seed initializations of encoders, and assess if the ability to decode a sentence from its representation is indicative of the downstream task performance of the sentence-level model in Section 4.",
304
+ "bbox": [
305
+ 112,
306
+ 470,
307
+ 487,
308
+ 551
309
+ ],
310
+ "page_idx": 2
311
+ },
312
+ {
313
+ "type": "text",
314
+ "text": "2 What is a sentence-level model?",
315
+ "text_level": 1,
316
+ "bbox": [
317
+ 112,
318
+ 565,
319
+ 421,
320
+ 583
321
+ ],
322
+ "page_idx": 2
323
+ },
324
+ {
325
+ "type": "text",
326
+ "text": "A sentence-level model (Figure 1) takes in sentence representations as input as opposed to tokens that are used in standard token-level models (such as BERT). We consider an encoder-only Transformer architecture for the sentence-level model. The sentence-level model takes in a sequence of sentence representations from an encoder that is kept frozen during sentence-level model training. Note that for the task of sentence ordering, we remove positional embeddings since the input is a shuffled sequence of sentences. We provide details on the encoders, tasks, and datasets used in the following sections.",
327
+ "bbox": [
328
+ 112,
329
+ 594,
330
+ 489,
331
+ 803
332
+ ],
333
+ "page_idx": 2
334
+ },
335
+ {
336
+ "type": "text",
337
+ "text": "2.1 Sentence Encoders",
338
+ "text_level": 1,
339
+ "bbox": [
340
+ 112,
341
+ 818,
342
+ 309,
343
+ 832
344
+ ],
345
+ "page_idx": 2
346
+ },
347
+ {
348
+ "type": "text",
349
+ "text": "We experiment with sentence representations obtained from several BERT-based monolingual encoders (vanilla BERT, BERT-SimCSE, SBERT, etc.) spanning different training regimes, pretraining dataset domain, and pooling strategies. We",
350
+ "bbox": [
351
+ 112,
352
+ 841,
353
+ 489,
354
+ 921
355
+ ],
356
+ "page_idx": 2
357
+ },
358
+ {
359
+ "type": "table",
360
+ "img_path": "images/9938086482ad0b7a42cdb2eb2c1502420440a8254ad6aa147ddacb922db02ce7.jpg",
361
+ "table_caption": [
362
+ "Table 2: Three multi-sentence input tasks, their description, and datasets used in our study. We cover tasks requiring coarse-to-fine-grained reasoning spanning two domains."
363
+ ],
364
+ "table_footnote": [],
365
+ "table_body": "<table><tr><td rowspan=\"2\">Task</td><td rowspan=\"2\">Dataset</td><td rowspan=\"2\">Max/Mean</td><td colspan=\"3\">Dataset split</td></tr><tr><td>Train</td><td>Dev</td><td>Test</td></tr><tr><td rowspan=\"4\">SO</td><td>NIPS</td><td>15/6</td><td>2448</td><td>409</td><td>402</td></tr><tr><td>AAN</td><td>12/5</td><td>8569</td><td>962</td><td>2626</td></tr><tr><td>SIND</td><td>5/5</td><td>40155</td><td>4990</td><td>5055</td></tr><tr><td>RocStories</td><td>5/5</td><td>78529</td><td>9816</td><td>9817</td></tr><tr><td>SSC</td><td>CSAbstract</td><td>10/7</td><td>1668</td><td>295</td><td>226</td></tr><tr><td>NLI</td><td>ANLI</td><td>18/4</td><td>162865</td><td>3200</td><td>3200</td></tr></table>",
366
+ "bbox": [
367
+ 522,
368
+ 467,
369
+ 870,
370
+ 592
371
+ ],
372
+ "page_idx": 2
373
+ },
374
+ {
375
+ "type": "text",
376
+ "text": "Table 3: Sentence-level dataset statistics. Max/Mean are computed over the number of input sentences.",
377
+ "bbox": [
378
+ 507,
379
+ 602,
380
+ 882,
381
+ 632
382
+ ],
383
+ "page_idx": 2
384
+ },
385
+ {
386
+ "type": "text",
387
+ "text": "chose BERT-based encoders to facilitate controlled experiments and minimize confounding factors that can impact our findings. For a detailed list of encoders, see Table 1.",
388
+ "bbox": [
389
+ 507,
390
+ 658,
391
+ 884,
392
+ 721
393
+ ],
394
+ "page_idx": 2
395
+ },
396
+ {
397
+ "type": "text",
398
+ "text": "2.2 Downstream Tasks",
399
+ "text_level": 1,
400
+ "bbox": [
401
+ 507,
402
+ 734,
403
+ 705,
404
+ 750
405
+ ],
406
+ "page_idx": 2
407
+ },
408
+ {
409
+ "type": "text",
410
+ "text": "We consider several multi-sentence input tasks requiring coarse-to-fine-grained reasoning from two domains, scientific and general. We select a variety of tasks to study the generalizability of the findings. We provide details on the tasks, datasets, and task formulation in Table 2.",
411
+ "bbox": [
412
+ 507,
413
+ 757,
414
+ 884,
415
+ 852
416
+ ],
417
+ "page_idx": 2
418
+ },
419
+ {
420
+ "type": "text",
421
+ "text": "2.3 Experimental Details",
422
+ "text_level": 1,
423
+ "bbox": [
424
+ 507,
425
+ 866,
426
+ 722,
427
+ 882
428
+ ],
429
+ "page_idx": 2
430
+ },
431
+ {
432
+ "type": "text",
433
+ "text": "We provide details on the training objectives for each task, and evaluation measures below. Dataset",
434
+ "bbox": [
435
+ 507,
436
+ 889,
437
+ 882,
438
+ 920
439
+ ],
440
+ "page_idx": 2
441
+ },
442
+ {
443
+ "type": "page_number",
444
+ "text": "11682",
445
+ "bbox": [
446
+ 477,
447
+ 927,
448
+ 524,
449
+ 940
450
+ ],
451
+ "page_idx": 2
452
+ },
453
+ {
454
+ "type": "text",
455
+ "text": "statistics for each task are shown in Table 3.",
456
+ "bbox": [
457
+ 114,
458
+ 84,
459
+ 442,
460
+ 99
461
+ ],
462
+ "page_idx": 3
463
+ },
464
+ {
465
+ "type": "text",
466
+ "text": "Training objectives For the sentence ordering task, we utilize the final layer representations of each sentence to predict its relative position (as per the original sequence) within a shuffled sequence. Specifically, for a given shuffled sequence of sentences ([1,3,2,5,4]), we aim to predict the relative position of each sentence in the shuffled sequence (i.e., $[0.2 = 1/5, 0.6 = 3/5, 0.4 = 2/5, 1.0 = 5/5, 0.8 = 4/5]$ ). This sentence-level model is trained using mean-squared error (MSE) loss. In the sequence sentence classification task, we again use the final layer representations to predict the category of each sentence, training with cross-entropy loss. For NLI task, we employ the final layer representation of the [CLS] token (prepended to the input) to predict the relationship (entailment, contradiction, or neutrality) between the hypothesis and premise. This NLI model is also trained using cross-entropy loss.",
467
+ "bbox": [
468
+ 115,
469
+ 112,
470
+ 489,
471
+ 419
472
+ ],
473
+ "page_idx": 3
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "Evaluation For each task, we report the following metrics averaged over 4 runs:",
478
+ "bbox": [
479
+ 112,
480
+ 432,
481
+ 489,
482
+ 463
483
+ ],
484
+ "page_idx": 3
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "Sentence Ordering: Accuracy of correctly predicting a sentence's position in the original sequence. Sequence Classification: Accuracy of correctly predicting the category of each sentence in a sequence. NLI: Accuracy of predicting the entailment label.",
489
+ "bbox": [
490
+ 112,
491
+ 464,
492
+ 489,
493
+ 545
494
+ ],
495
+ "page_idx": 3
496
+ },
497
+ {
498
+ "type": "text",
499
+ "text": "To provide context for these results, we also include scores from a random baseline for each task as a lower bound performance. For the sentence ordering task, we additionally report the current state-of-the-art score (Robin et al., 2023) to establish an upper bound for performance. Please refer to Appendix A for implementation and datasets related details.",
500
+ "bbox": [
501
+ 112,
502
+ 548,
503
+ 489,
504
+ 675
505
+ ],
506
+ "page_idx": 3
507
+ },
508
+ {
509
+ "type": "text",
510
+ "text": "3 Main Findings",
511
+ "text_level": 1,
512
+ "bbox": [
513
+ 114,
514
+ 692,
515
+ 275,
516
+ 709
517
+ ],
518
+ "page_idx": 3
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "3.1 Less supervised training signals for better generalization - How BERT's mean pooling rivals specialized sentence representations.",
523
+ "text_level": 1,
524
+ "bbox": [
525
+ 112,
526
+ 720,
527
+ 487,
528
+ 784
529
+ ],
530
+ "page_idx": 3
531
+ },
532
+ {
533
+ "type": "text",
534
+ "text": "While specialized sentence representation encoders are known to top the MTEB benchmark (Muenninghoff et al., 2023) (which is a widely used benchmark for evaluating text representations on 8 types of tasks), Figure 2 demonstrates that mean-pooled BERT representations achieve performance comparable to CMLM and surpass specialized sentence representations like SBERT and BERT-SimCSE.",
535
+ "bbox": [
536
+ 112,
537
+ 791,
538
+ 489,
539
+ 921
540
+ ],
541
+ "page_idx": 3
542
+ },
543
+ {
544
+ "type": "text",
545
+ "text": "While SBERT representations result in the lowest downstream task accuracy for the scientific domain, their performance is relatively closer to other encoders (BERT, BERT-SimCSE, and CMLM) in the general domain. This difference may be attributed to SBERT's fine-tuning on a variety of general domain datasets. Although BERT-SimCSE is also trained on the same NLI datasets as SBERT-NLI, representations from BERT-SimCSE are more robust to the domain of downstream datasets as indicated by higher accuracy for the sequence classification task. This suggests that training using contrastive learning (BERT-SimCSE) is better than fine-tuning (SBERT-NLI) using cross-entropy loss.",
546
+ "bbox": [
547
+ 507,
548
+ 84,
549
+ 884,
550
+ 309
551
+ ],
552
+ "page_idx": 3
553
+ },
554
+ {
555
+ "type": "text",
556
+ "text": "While both BERT-SimCSE and SBERT use contrastive learning and SBERT has been fine-tuned on significantly larger amounts of data than BERT-SimCSE, representations from SBERT result in lower performance on scientific domain datasets than those from BERT-SimCSE. This shows that representations from less fine-tuned encoders are more generalizable and adaptable.",
557
+ "bbox": [
558
+ 507,
559
+ 310,
560
+ 884,
561
+ 437
562
+ ],
563
+ "page_idx": 3
564
+ },
565
+ {
566
+ "type": "text",
567
+ "text": "CMLM's best performance across all the tasks (except for sentence ordering in the scientific domain) indicates that continued pretraining of BERT using conditional language modeling (semi-supervised) results in more generalized representations as compared to contrastive learning (BERT-SimCSE, SBERT) or fine-tuning (SBERT-NLI).",
568
+ "bbox": [
569
+ 507,
570
+ 439,
571
+ 884,
572
+ 550
573
+ ],
574
+ "page_idx": 3
575
+ },
576
+ {
577
+ "type": "text",
578
+ "text": "As expected, representations from SciBERT outperform those from BERT for scientific domain datasets and perform lower than BERT for the general domain. Similar trends are observed between SBERT-NLI and SciBERT-NLI which is a scientific domain variant of SBERT-NLI. SciBERT-NLI which is a specifically fine-tuned (from SciBERT) Scientific analogue of SBERT-NLI also performs lower than SciBERT across all the tasks however it performs better on MTEB tasks (see Figure 10). Further analysis in Section 4 suggests that better performance of an encoder over another is due to having more syntactic and discourse-level properties encoded in their representations. All of these findings suggest that less mature representations are more adaptable to learning downstream task-specific properties than those that have already been tuned to strongly encode the semantics.",
579
+ "bbox": [
580
+ 507,
581
+ 552,
582
+ 884,
583
+ 841
584
+ ],
585
+ "page_idx": 3
586
+ },
587
+ {
588
+ "type": "text",
589
+ "text": "3.2 CLS token representations right before the pooling layer are surprisingly better.",
590
+ "text_level": 1,
591
+ "bbox": [
592
+ 507,
593
+ 852,
594
+ 870,
595
+ 883
596
+ ],
597
+ "page_idx": 3
598
+ },
599
+ {
600
+ "type": "text",
601
+ "text": "We study the impact of using different pooling strategies to obtain the representations from en",
602
+ "bbox": [
603
+ 507,
604
+ 889,
605
+ 882,
606
+ 921
607
+ ],
608
+ "page_idx": 3
609
+ },
610
+ {
611
+ "type": "page_number",
612
+ "text": "11683",
613
+ "bbox": [
614
+ 477,
615
+ 927,
616
+ 524,
617
+ 940
618
+ ],
619
+ "page_idx": 3
620
+ },
621
+ {
622
+ "type": "image",
623
+ "img_path": "images/d7ad5ce75e94fb1356b75e194ae61e6005acbb2577b705bd0fb0630618970350.jpg",
624
+ "image_caption": [
625
+ "Figure 2: Sentence-level model accuracy using representations from encoders with varying training regimes and pretraining domains. Mean pooling is used for all encoders except BERT-SimCSE (CLS pooling). Variance shown is across sentence ordering datasets."
626
+ ],
627
+ "image_footnote": [],
628
+ "bbox": [
629
+ 117,
630
+ 80,
631
+ 499,
632
+ 243
633
+ ],
634
+ "page_idx": 4
635
+ },
636
+ {
637
+ "type": "image",
638
+ "img_path": "images/4af5a8d7a3a49e78107accb466ecde5d1b21e2f4f8f3a87fad33b1fb841fc6eb.jpg",
639
+ "image_caption": [],
640
+ "image_footnote": [],
641
+ "bbox": [
642
+ 502,
643
+ 80,
644
+ 884,
645
+ 244
646
+ ],
647
+ "page_idx": 4
648
+ },
649
+ {
650
+ "type": "image",
651
+ "img_path": "images/e2f27dcd2054253d0a665755b9a73e34144fcd9ecc42a8267fa2a302eaaed1ce.jpg",
652
+ "image_caption": [
653
+ "Figure 3: Accuracy for sentence-level models trained using representations from BERT, BERT-SimCSE, and SciBERT obtained using different pooling strategies from the final transformer layer."
654
+ ],
655
+ "image_footnote": [],
656
+ "bbox": [
657
+ 117,
658
+ 309,
659
+ 880,
660
+ 435
661
+ ],
662
+ "page_idx": 4
663
+ },
664
+ {
665
+ "type": "image",
666
+ "img_path": "images/bc6c1a04cd6829877aff27fff5c5afd89bc547766aef6331434d98deddc0b89d.jpg",
667
+ "image_caption": [
668
+ "Figure 4: Sentence-level model accuracy: Comparing first/last layer pooling for BERT against SBERT and SBERT-NLI. Variance across sentence ordering datasets is shown."
669
+ ],
670
+ "image_footnote": [],
671
+ "bbox": [
672
+ 117,
673
+ 495,
674
+ 485,
675
+ 639
676
+ ],
677
+ "page_idx": 4
678
+ },
679
+ {
680
+ "type": "text",
681
+ "text": "coders on downstream sentence-level modeling task performance. We experiment with BERT, BERT-SimCSE, and SciBERT encoders, using representations pooled from the final layer. Specifically, we compare representations derived from the CLS token before the pooling layer (CLS-BP) with those derived after the pooling layer $(\\mathrm{CLS})^2$",
682
+ "bbox": [
683
+ 110,
684
+ 734,
685
+ 487,
686
+ 847
687
+ ],
688
+ "page_idx": 4
689
+ },
690
+ {
691
+ "type": "text",
692
+ "text": "Figure 3 shows that using CLS-BP yields surprisingly better downstream task accuracies than",
693
+ "bbox": [
694
+ 112,
695
+ 848,
696
+ 489,
697
+ 881
698
+ ],
699
+ "page_idx": 4
700
+ },
701
+ {
702
+ "type": "text",
703
+ "text": "using CLS. However, the performance difference between CLS and CLS-BP is smaller for BERT-SimCSE than for other models, possibly because BERT-SimCSE uses the CLS representation during fine-tuning with contrastive learning.",
704
+ "bbox": [
705
+ 507,
706
+ 499,
707
+ 882,
708
+ 580
709
+ ],
710
+ "page_idx": 4
711
+ },
712
+ {
713
+ "type": "text",
714
+ "text": "CLS-BP also results in improved downstream task performance over mean pooled representations in the scientific domain. However, in the general domain, the performance is comparable. These observations align with our previous finding that less mature representations have more capacity to adapt and learn properties required for the downstream task. Further analysis in Section 4 reveals that CLS-BP encodes higher syntactic, semantic, and discourse-level properties than CLS, which leads to its improved downstream task performance.",
715
+ "bbox": [
716
+ 507,
717
+ 581,
718
+ 882,
719
+ 758
720
+ ],
721
+ "page_idx": 4
722
+ },
723
+ {
724
+ "type": "text",
725
+ "text": "3.3 First-layer representations can be more effective than representations from specifically trained encoders.",
726
+ "text_level": 1,
727
+ "bbox": [
728
+ 507,
729
+ 770,
730
+ 865,
731
+ 819
732
+ ],
733
+ "page_idx": 4
734
+ },
735
+ {
736
+ "type": "text",
737
+ "text": "Given that less mature representations are generally more adaptable and that representations from the last layer are more task-specific than those from the first layer (Rogers et al., 2020), we investigated whether similar results are observed when pooling representations from the first layer. Focusing on",
738
+ "bbox": [
739
+ 507,
740
+ 825,
741
+ 882,
742
+ 921
743
+ ],
744
+ "page_idx": 4
745
+ },
746
+ {
747
+ "type": "page_footnote",
748
+ "text": "2The standard CLS representation from a BERT encoder uses an additional pooling layer during pretraining.",
749
+ "bbox": [
750
+ 112,
751
+ 894,
752
+ 487,
753
+ 921
754
+ ],
755
+ "page_idx": 4
756
+ },
757
+ {
758
+ "type": "page_number",
759
+ "text": "11684",
760
+ "bbox": [
761
+ 477,
762
+ 927,
763
+ 524,
764
+ 940
765
+ ],
766
+ "page_idx": 4
767
+ },
768
+ {
769
+ "type": "image",
770
+ "img_path": "images/d37c8a6cf31f6675ba57d852de425d556b331fcf6a80a33879da28e0e1bcd269.jpg",
771
+ "image_caption": [
772
+ "Figure 5: Sentence-level model accuracy (BERT and BERT-SimCSE) across different pretraining initializations. \"Default\" denotes Hugging Face models. Variance is across sentence ordering datasets."
773
+ ],
774
+ "image_footnote": [],
775
+ "bbox": [
776
+ 176,
777
+ 84,
778
+ 428,
779
+ 350
780
+ ],
781
+ "page_idx": 5
782
+ },
783
+ {
784
+ "type": "text",
785
+ "text": "the sentence ordering task, we report results for the BERT encoder in Figure 4, with results for BERT-SimCSE and SciBERT provided in the appendix (Figure 15). For the scientific domain datasets, mean-pooled representations from the first layer of BERT outperform SBERT. However, the reverse is true for the general domain, potentially due to SBERT's fine-tuning on general domain datasets. Across both domains, mean representations from the first layer are either better than or comparable to CLS representations from the last layer of BERT. This is likely because the first-layer representations encode higher syntactic, semantic, and discourse-level properties (see Figure 11).",
786
+ "bbox": [
787
+ 112,
788
+ 448,
789
+ 489,
790
+ 674
791
+ ],
792
+ "page_idx": 5
793
+ },
794
+ {
795
+ "type": "text",
796
+ "text": "4 Analysis and Discussion",
797
+ "text_level": 1,
798
+ "bbox": [
799
+ 112,
800
+ 689,
801
+ 356,
802
+ 706
803
+ ],
804
+ "page_idx": 5
805
+ },
806
+ {
807
+ "type": "text",
808
+ "text": "4.1 Robustness of Findings Across BERT Initializations.",
809
+ "text_level": 1,
810
+ "bbox": [
811
+ 112,
812
+ 717,
813
+ 453,
814
+ 749
815
+ ],
816
+ "page_idx": 5
817
+ },
818
+ {
819
+ "type": "text",
820
+ "text": "To ensure the robustness of our findings across different pretraining seed initializations of BERT encoder, we rerun all the sentence ordering experiments for BERT and BERT-SimCSE<sup>3</sup>. Using five randomly chosen off-the-shelf multiBERT models (Sellam et al., 2021), we train different versions of BERT-SimCSE starting from these models",
821
+ "bbox": [
822
+ 112,
823
+ 757,
824
+ 489,
825
+ 869
826
+ ],
827
+ "page_idx": 5
828
+ },
829
+ {
830
+ "type": "image",
831
+ "img_path": "images/779c4a114c136fbb5210b59a071c70f4721ff86bcb558fbf2db508734d3cf0cc.jpg",
832
+ "image_caption": [
833
+ "Figure 6: Correlations between probing and downstream task performance for encoders with different training regimes and domains. Gen: General, Sci: Scientific."
834
+ ],
835
+ "image_footnote": [],
836
+ "bbox": [
837
+ 532,
838
+ 84,
839
+ 860,
840
+ 247
841
+ ],
842
+ "page_idx": 5
843
+ },
844
+ {
845
+ "type": "text",
846
+ "text": "using the official implementation<sup>4</sup>. We then obtain representations from these trained encoders to train sentence-level models, reporting the results in Figure 5. The similar performance trends observed for BERT and BERT-SimCSE indicate the robustness of our findings. Similar trends were also observed for multiBERT models using different pooling strategies (see Figure 14 in appendix).",
847
+ "bbox": [
848
+ 507,
849
+ 326,
850
+ 884,
851
+ 457
852
+ ],
853
+ "page_idx": 5
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "4.2 Syntactic and Discourse Properties Drive Downstream Performance, Not MTEB.",
858
+ "text_level": 1,
859
+ "bbox": [
860
+ 507,
861
+ 482,
862
+ 877,
863
+ 514
864
+ ],
865
+ "page_idx": 5
866
+ },
867
+ {
868
+ "type": "text",
869
+ "text": "As established in Section 3, even mean-pooled representations from vanilla BERT encoder achieve comparable or better performance than representations from specifically trained encoders. To understand why this occurs and identify the properties crucial for strong performance on sentence-level tasks, we evaluate the syntactic, semantic, and discourse-level properties encoded in the representations using SentEval (Conneau et al., 2018) and DiscoEval (Chen et al., 2019) probing tasks<sup>5</sup>. We also investigate whether high performance on MTEB (Muennighoff et al., 2023), a widely used representation evaluation benchmark, correlates with high downstream performance. Figure 6 shows the Spearman's correlation between performance on the evaluation benchmarks and the downstream tasks. Our findings indicate that syntactic and discourse-level properties are more strongly associated with downstream task success. Surprisingly, higher MTEB performance does not guarantee better downstream performance. In fact, we even observe a negative correlation for the sen",
870
+ "bbox": [
871
+ 507,
872
+ 519,
873
+ 884,
874
+ 873
875
+ ],
876
+ "page_idx": 5
877
+ },
878
+ {
879
+ "type": "page_footnote",
880
+ "text": "3We only compare performance for these encoders as we were unable to reproduce SBERT results and CMLM code is not publicly available",
881
+ "bbox": [
882
+ 112,
883
+ 882,
884
+ 487,
885
+ 921
886
+ ],
887
+ "page_idx": 5
888
+ },
889
+ {
890
+ "type": "page_footnote",
891
+ "text": "4https://github.com/princeton-nlp/SimCSE",
892
+ "bbox": [
893
+ 529,
894
+ 882,
895
+ 836,
896
+ 895
897
+ ],
898
+ "page_idx": 5
899
+ },
900
+ {
901
+ "type": "page_footnote",
902
+ "text": "We focused on the probing tasks available in these benchmarks, as the downstream tasks are also included in MTEB.",
903
+ "bbox": [
904
+ 509,
905
+ 895,
906
+ 882,
907
+ 919
908
+ ],
909
+ "page_idx": 5
910
+ },
911
+ {
912
+ "type": "page_number",
913
+ "text": "11685",
914
+ "bbox": [
915
+ 477,
916
+ 927,
917
+ 524,
918
+ 940
919
+ ],
920
+ "page_idx": 5
921
+ },
922
+ {
923
+ "type": "image",
924
+ "img_path": "images/2dff096e50bebf35f4f8c1a5b078c676becfdccce1bad666655831a77f2aeb68.jpg",
925
+ "image_caption": [
926
+ "Figure 7: Correlations between probing task and downstream task performance for encoders with different pooling strategies. Gen: General, Sci: Scientific."
927
+ ],
928
+ "image_footnote": [],
929
+ "bbox": [
930
+ 117,
931
+ 82,
932
+ 487,
933
+ 181
934
+ ],
935
+ "page_idx": 6
936
+ },
937
+ {
938
+ "type": "image",
939
+ "img_path": "images/4ea60eda9c4d69f396e6174b5576a3c766699a8f752d03be3f8fe8db44fdc434.jpg",
940
+ "image_caption": [
941
+ "Figure 8: Correlations between decodability (measured via BLEU, ROUGE, and BERTScore) and downstream task performance for various encoders. Gen: General, Sci: Scientific."
942
+ ],
943
+ "image_footnote": [],
944
+ "bbox": [
945
+ 144,
946
+ 250,
947
+ 455,
948
+ 395
949
+ ],
950
+ "page_idx": 6
951
+ },
952
+ {
953
+ "type": "text",
954
+ "text": "tence ordering task. Further analysis of individual encoder scores (see Figure 10 in appendix) reveals that BERT representations exhibit the strongest discourse-level properties and comparable syntactic properties, contributing to their strong downstream performance. A potential explanation is that less mature representations, having undergone less task-specific fine-tuning, retain greater flexibility to adapt to the specific requirements of the downstream task.",
955
+ "bbox": [
956
+ 112,
957
+ 494,
958
+ 489,
959
+ 653
960
+ ],
961
+ "page_idx": 6
962
+ },
963
+ {
964
+ "type": "text",
965
+ "text": "A similar analysis for different pooling strategies across BERT, BERT-SimCSE, and SciBERT yielded similar results (Figure 7). However, in this case, MTEB performance showed a stronger correlation with downstream performance, suggesting that semantic properties become more influential when the base encoder is held constant. Further analysis (see Figures 11 to 13 in appendix) indicates that CLS-BP outperforms CLS across all probing benchmarks, explaining its superior downstream performance.",
966
+ "bbox": [
967
+ 112,
968
+ 657,
969
+ 489,
970
+ 834
971
+ ],
972
+ "page_idx": 6
973
+ },
974
+ {
975
+ "type": "text",
976
+ "text": "4.3 Decodability Does not Always Equal Downstream Success.",
977
+ "text_level": 1,
978
+ "bbox": [
979
+ 112,
980
+ 848,
981
+ 445,
982
+ 879
983
+ ],
984
+ "page_idx": 6
985
+ },
986
+ {
987
+ "type": "text",
988
+ "text": "We hypothesize that if, for a given sentence encoder, sentences can be decoded with high fidelity",
989
+ "bbox": [
990
+ 112,
991
+ 889,
992
+ 489,
993
+ 921
994
+ ],
995
+ "page_idx": 6
996
+ },
997
+ {
998
+ "type": "table",
999
+ "img_path": "images/f275821a18fb52e737a6c75d8a63868ccf868f3bbe3cb7090cd1f17040f775d6.jpg",
1000
+ "table_caption": [],
1001
+ "table_footnote": [],
1002
+ "table_body": "<table><tr><td rowspan=\"2\">Task</td><td rowspan=\"2\">Dataset</td><td colspan=\"2\">Accuracy</td></tr><tr><td>Token</td><td>Sentence</td></tr><tr><td rowspan=\"4\">SO</td><td>NIPS</td><td>36.31*</td><td>54.29</td></tr><tr><td>AAN</td><td>48.55*</td><td>63.98</td></tr><tr><td>SIND</td><td>48.30</td><td>48.33</td></tr><tr><td>RocStories</td><td>61.15</td><td>68.30</td></tr><tr><td>SSC</td><td>CSAbstract</td><td>73.76</td><td>74.06</td></tr><tr><td>NLI</td><td>ANLI</td><td>47.38</td><td>43.78</td></tr></table>",
1003
+ "bbox": [
1004
+ 534,
1005
+ 80,
1006
+ 858,
1007
+ 231
1008
+ ],
1009
+ "page_idx": 6
1010
+ },
1011
+ {
1012
+ "type": "text",
1013
+ "text": "Table 4: Accuracy $(\\%)$ for different tasks from a token-level and corresponding sentence-level model. * denotes that the model was trained with 8 permutations per training example.",
1014
+ "bbox": [
1015
+ 507,
1016
+ 241,
1017
+ 884,
1018
+ 299
1019
+ ],
1020
+ "page_idx": 6
1021
+ },
1022
+ {
1023
+ "type": "text",
1024
+ "text": "from their encoded representations, then this encoder will have strong downstream task performance in a sentence-level modeling paradigm. This hypothesis is based on recent findings that sentence representations are a bottleneck for sentence-level models (Kamath et al., 2023). To test this hypothesis, we train a T5 decoder (Raffel et al., 2020) for each encoder to reconstruct 2 million training instances from the BookCorpus dataset (Zhu et al., 2015). The decoder is conditioned on the fixed-size representation yielded by the encoder i.e., a single vector input to T5's cross-attention mechanism.",
1025
+ "bbox": [
1026
+ 505,
1027
+ 324,
1028
+ 882,
1029
+ 517
1030
+ ],
1031
+ "page_idx": 6
1032
+ },
1033
+ {
1034
+ "type": "text",
1035
+ "text": "Using beam search decoding (beam size = 4), we reconstruct sentences from the representations produced by each encoder. We then calculate the Spearman's correlation coefficient between decodability (measured using BLEU (Papineni et al., 2002) ROUGE (Lin and Hovy, 2003), and BERTScore (Zhang et al., 2019)) and downstream task accuracy across the encoders. Results are shown in Figure 8. The strong correlation observed for NLI and SSC tasks, as measured by BERTScore, supports our hypothesis. However, the weak to moderate correlation observed for the sentence ordering task suggests that higher decodability does not always translate to improved downstream performance.",
1036
+ "bbox": [
1037
+ 507,
1038
+ 518,
1039
+ 882,
1040
+ 759
1041
+ ],
1042
+ "page_idx": 6
1043
+ },
1044
+ {
1045
+ "type": "text",
1046
+ "text": "For completeness, the individual BLEU, ROUGE, and BERTScore metrics for each encoder are available in the appendix (Figure 9).",
1047
+ "bbox": [
1048
+ 507,
1049
+ 759,
1050
+ 882,
1051
+ 808
1052
+ ],
1053
+ "page_idx": 6
1054
+ },
1055
+ {
1056
+ "type": "text",
1057
+ "text": "4.4 The Efficiency Advantage of Sentence-Level Models.",
1058
+ "text_level": 1,
1059
+ "bbox": [
1060
+ 507,
1061
+ 819,
1062
+ 779,
1063
+ 850
1064
+ ],
1065
+ "page_idx": 6
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "text": "We hypothesize that token-level models excel at fine-grained downstream tasks, while sentence-level models are better suited for coarse-grained tasks. We define fine-grained tasks as those requir",
1070
+ "bbox": [
1071
+ 507,
1072
+ 856,
1073
+ 882,
1074
+ 921
1075
+ ],
1076
+ "page_idx": 6
1077
+ },
1078
+ {
1079
+ "type": "page_number",
1080
+ "text": "11686",
1081
+ "bbox": [
1082
+ 477,
1083
+ 927,
1084
+ 524,
1085
+ 940
1086
+ ],
1087
+ "page_idx": 6
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "text": "ing detailed analysis of individual words or phrases (e.g., Named Entity Recognition or NLI), while coarse-grained tasks operate at the sentence or document level (e.g., Sentence Ordering, Sentiment Classification). Token-level models can access all token representations across sentences in the input, potentially capturing more fine-grained semantic and discourse information.",
1092
+ "bbox": [
1093
+ 112,
1094
+ 84,
1095
+ 487,
1096
+ 211
1097
+ ],
1098
+ "page_idx": 7
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "To test this, we fine-tune a standard pretrained BERT model for all the tasks (see Appendix B in appendix) and compare its accuracy to that of corresponding sentence-level models trained using mean-pooled representations from the BERT encoder. For the coarse-grained tasks (SO and SSC), sentence-level models achieve comparable or better accuracy than token-level models (Table 4). Conversely, token-level models outperform sentence-level models on the fine-grained NLI task.",
1103
+ "bbox": [
1104
+ 115,
1105
+ 214,
1106
+ 489,
1107
+ 375
1108
+ ],
1109
+ "page_idx": 7
1110
+ },
1111
+ {
1112
+ "type": "text",
1113
+ "text": "For the NIPS and AAN datasets, where the number of sentences per input is significantly higher than in other datasets, sentence-level models achieved $65 - 75\\%$ higher accuracy than token-level models, despite using eight times fewer training examples. This suggests that sentence-level models are more effective at handling longer contexts. as opposed to a limit of 512 tokens in the token-level models. Furthermore, the sentencelevel models converged faster (10 epochs) than the token-level models (15 epochs), demonstrating their training-time efficiency.",
1114
+ "bbox": [
1115
+ 112,
1116
+ 376,
1117
+ 489,
1118
+ 570
1119
+ ],
1120
+ "page_idx": 7
1121
+ },
1122
+ {
1123
+ "type": "text",
1124
+ "text": "5 Related Work",
1125
+ "text_level": 1,
1126
+ "bbox": [
1127
+ 112,
1128
+ 586,
1129
+ 268,
1130
+ 602
1131
+ ],
1132
+ "page_idx": 7
1133
+ },
1134
+ {
1135
+ "type": "text",
1136
+ "text": "Sentence-level modeling has been applied to various tasks, including sentence ordering (Cui et al., 2018; Basu Roy Chowdhury et al., 2021; Kumar et al., 2020; Golestani et al., 2021; Bin et al., 2023), sentence infilling (Huang et al., 2020; Mori et al., 2020), sequential sentence classification (Cohan et al., 2019; Hillebrand et al., 2024) and story continuation (Ippolito et al., 2020). More recently, sentence-level (or concept-level) modeling has been explored to model language at a higher abstraction level (LCM team et al., 2024). Related to our work, Czinczoll et al. (2024) predicts representations of masked chunks instead of tokens. They show that the base encoder effectiveness doesn't always translate to chunk-level performance. However, their work doesn't explore the diverse encoders, training regimes, and pooling strategies that are the focus of our work.",
1137
+ "bbox": [
1138
+ 112,
1139
+ 615,
1140
+ 489,
1141
+ 920
1142
+ ],
1143
+ "page_idx": 7
1144
+ },
1145
+ {
1146
+ "type": "text",
1147
+ "text": "Probing sentence representations Probing sentence representations is a common technique to assess how linguistic properties are captured in learned representations (Ettinger et al., 2016; Veldhoen et al., 2016; Adi et al., 2016; Conneau et al., 2018; Hupkes et al., 2018; Conneau and Kiela, 2018; Chen et al., 2019). Shi et al. (2016) study syntactic knowledge in machine translation, and Vanmassenhove et al. (2017) investigate aspects of machine translation systems, showing that tense information can be extracted but is often lost during decoding. Conneau et al. (2018) introduces probing tasks to examine surface-level, syntactic, and semantic properties and correlate them with downstream tasks such as NLI and MT. Hupkes et al. (2018) train diagnostic classifiers to extract information from a sequence of hidden representations, hypothesizing that high classifier accuracy indicates the network's ability to track specific information. Giulianielli (2018), on the other hand, use these classifiers to predict numbers from the internal states of a language model. Kim et al. (2019) study what different NLP tasks teach models about function word comprehension. See Belinkov and Glass (2019) for a survey of related work.",
1148
+ "bbox": [
1149
+ 507,
1150
+ 84,
1151
+ 884,
1152
+ 485
1153
+ ],
1154
+ "page_idx": 7
1155
+ },
1156
+ {
1157
+ "type": "text",
1158
+ "text": "SemEval (Agirre et al., 2012) is a common benchmark for evaluating sentence representations. Conneau and Kiela (2018) aggregate multiple STS datasets to address the limited expressivity of individual SemEval datasets and focus on fine-tuning classifiers on top of representations. However, it lacks retrieval or clustering tasks where representations could be directly compared without additional classifiers. MTEB Muennighoff et al. (2023) unifies datasets from different representation tasks into one evaluation framework to provide a holistic performance review of sentence encoders. While these benchmarks focus on task-specific and linguistic properties, Chen et al. (2019) (DiscoEval) propose tasks to assess the discourse-level information.",
1159
+ "bbox": [
1160
+ 507,
1161
+ 488,
1162
+ 884,
1163
+ 728
1164
+ ],
1165
+ "page_idx": 7
1166
+ },
1167
+ {
1168
+ "type": "text",
1169
+ "text": "6 Conclusion",
1170
+ "text_level": 1,
1171
+ "bbox": [
1172
+ 507,
1173
+ 747,
1174
+ 640,
1175
+ 762
1176
+ ],
1177
+ "page_idx": 7
1178
+ },
1179
+ {
1180
+ "type": "text",
1181
+ "text": "This work provides a comprehensive analysis of sentence encoders for sentence-level modeling, establishing the importance of representation maturity, the crucial role of syntactic and discourse-level properties, and the efficiency of sentence-level models. Our findings challenge views regarding the benefits of extensive fine-tuning and highlight the potential of less mature representations for greater adaptability (e.g., exploring architectural modifi",
1182
+ "bbox": [
1183
+ 507,
1184
+ 776,
1185
+ 884,
1186
+ 921
1187
+ ],
1188
+ "page_idx": 7
1189
+ },
1190
+ {
1191
+ "type": "page_number",
1192
+ "text": "11687",
1193
+ "bbox": [
1194
+ 477,
1195
+ 927,
1196
+ 524,
1197
+ 940
1198
+ ],
1199
+ "page_idx": 7
1200
+ },
1201
+ {
1202
+ "type": "text",
1203
+ "text": "cations to preserve representation flexibility). The observation that syntactic and discourse-level properties are key drivers of downstream performance suggests fruitful avenues for future research such as, developing novel pretraining objectives that explicitly target these properties and move beyond MTEB evaluation. Further, the data and time efficiency of sentence-level models coupled with their competitive performance, makes them a promising direction for future work in language modeling. We believe these insights will contribute to the development of more effective and efficient sentence representation learning techniques.",
1204
+ "bbox": [
1205
+ 112,
1206
+ 84,
1207
+ 492,
1208
+ 294
1209
+ ],
1210
+ "page_idx": 8
1211
+ },
1212
+ {
1213
+ "type": "text",
1214
+ "text": "Limitations",
1215
+ "text_level": 1,
1216
+ "bbox": [
1217
+ 112,
1218
+ 304,
1219
+ 220,
1220
+ 319
1221
+ ],
1222
+ "page_idx": 8
1223
+ },
1224
+ {
1225
+ "type": "text",
1226
+ "text": "We acknowledge that our findings are limited to classification and regression tasks. Future works may consider extending this study to downstream generation tasks. Our study focused on encoder-only BERT-based sentence encoders in English to ensure a controlled setting. However, further investigation is required to determine whether our findings are generalizable to multilingual encoders. While we show that a sentence-level model is better or comparable to a token-level model, a promising future direction is to consider a hierarchical model that first operates on token-level followed by a sentence-level model to investigate if it results in a best-of-both-worlds model wherein both fine-grained and discourse-level information could be learned by the model for performing any downstream tasks. We acknowledge that 'maturity' in this work encompasses two key aspects (1) how advanced we are in the finetuning stage as well as (2) the location of the features in the network (early vs. late layer) and the primary focus of this work was on identifying a common thread between them and examining the high-level relationship with downstream performance and property probes, such as syntactic and discourse properties. However, future research may aim to disentangle these two factors and provide formal definitions.",
1227
+ "bbox": [
1228
+ 112,
1229
+ 328,
1230
+ 490,
1231
+ 764
1232
+ ],
1233
+ "page_idx": 8
1234
+ },
1235
+ {
1236
+ "type": "text",
1237
+ "text": "Acknowledgements",
1238
+ "text_level": 1,
1239
+ "bbox": [
1240
+ 112,
1241
+ 772,
1242
+ 287,
1243
+ 789
1244
+ ],
1245
+ "page_idx": 8
1246
+ },
1247
+ {
1248
+ "type": "text",
1249
+ "text": "We would like to thank all the anonymous reviewers and researchers at FAIR for their useful and constructive feedback.",
1250
+ "bbox": [
1251
+ 112,
1252
+ 797,
1253
+ 490,
1254
+ 846
1255
+ ],
1256
+ "page_idx": 8
1257
+ },
1258
+ {
1259
+ "type": "text",
1260
+ "text": "References",
1261
+ "text_level": 1,
1262
+ "bbox": [
1263
+ 115,
1264
+ 871,
1265
+ 213,
1266
+ 885
1267
+ ],
1268
+ "page_idx": 8
1269
+ },
1270
+ {
1271
+ "type": "ref_text",
1272
+ "text": "Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. 2016. Fine-grained analysis of",
1273
+ "bbox": [
1274
+ 115,
1275
+ 892,
1276
+ 489,
1277
+ 921
1278
+ ],
1279
+ "page_idx": 8
1280
+ },
1281
+ {
1282
+ "type": "list",
1283
+ "sub_type": "ref_text",
1284
+ "list_items": [
1285
+ "sentence embeddings using auxiliary prediction tasks. arXiv preprint arXiv:1608.04207.",
1286
+ "Eneko Agirre, Daniel Cer, Mona Diab, and Aitor Gonzalez-Agirre. 2012. Semeval-2012 task 6: A pilot on semantic textual similarity. in* sem 2012: The first joint conference on lexical and computational semantics-volume 1: Proceedings of the main conference and the shared task, and volume 2: Proceedings of the sixth international workshop on semantic evaluation (semeval 2012). Association for Computational Linguistics. URL http://www.aclweb.org/anthology/S12-1051.",
1287
+ "Mikel Artetxe and Holger Schwenk. 2019. Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond. Transactions of the association for computational linguistics, 7:597-610.",
1288
+ "Somnath Basu Roy Chowdhury, Faeze Brahman, and Snigdha Chaturvedi. 2021. Is everything in order? a simple way to order sentences. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10769-10779, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.",
1289
+ "Yonatan Belinkov and James Glass. 2019. Analysis methods in neural language processing: A survey. Transactions of the Association for Computational Linguistics, 7:49-72.",
1290
+ "Iz Beltagy, Kyle Lo, and Arman Cohan. 2019. SciBERT: A pretrained language model for scientific text. 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 3615-3620, Hong Kong, China. Association for Computational Linguistics.",
1291
+ "Yi Bin, Wenhao Shi, Bin Ji, Jipeng Zhang, Yujuan Ding, and Yang Yang. 2023. Non-autoregressive sentence ordering. In *Findings of the Association for Computational Linguistics: EMNLP* 2023, pages 4198-4214, Singapore. Association for Computational Linguistics.",
1292
+ "Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 632-642, Lisbon, Portugal. Association for Computational Linguistics.",
1293
+ "Mingda Chen, Zewei Chu, and Kevin Gimpel. 2019. Evaluation benchmarks and learning criteria for discourse-aware sentence 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 649-662, Hong Kong, China. Association for Computational Linguistics."
1294
+ ],
1295
+ "bbox": [
1296
+ 510,
1297
+ 85,
1298
+ 885,
1299
+ 920
1300
+ ],
1301
+ "page_idx": 8
1302
+ },
1303
+ {
1304
+ "type": "page_number",
1305
+ "text": "11688",
1306
+ "bbox": [
1307
+ 477,
1308
+ 927,
1309
+ 524,
1310
+ 940
1311
+ ],
1312
+ "page_idx": 8
1313
+ },
1314
+ {
1315
+ "type": "list",
1316
+ "sub_type": "ref_text",
1317
+ "list_items": [
1318
+ "Arman Cohan, Iz Beltagy, Daniel King, Bhavana Dalvi, and Dan Weld. 2019. Pretrained language models for sequential sentence classification. 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 3693-3699, Hong Kong, China. Association for Computational Linguistics.",
1319
+ "A Conneau. 2019. Unsupervised cross-lingual representation learning at scale. arXiv preprint arXiv:1911.02116.",
1320
+ "Alexis Conneau and Douwe Kiela. 2018. SentEval: An evaluation toolkit for universal sentence representations. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA).",
1321
+ "Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. 2017. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 670-680, Copenhagen, Denmark. Association for Computational Linguistics.",
1322
+ "Alexis Conneau, German Kruszewski, Guillaume Lample, Loic Barrault, and Marco Baroni. 2018. What you can cram into a single $\\$ \\& !\\#$ * vector: Probing sentence embeddings for linguistic properties. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2126-2136, Melbourne, Australia. Association for Computational Linguistics.",
1323
+ "Baiyun Cui, Yingming Li, Ming Chen, and Zhongfei Zhang. 2018. Deep attentive sentence ordering network. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4340-4349.",
1324
+ "Tamara Czinczoll, Christoph Hones, Maximilian Schall, and Gerard De Melo. 2024. NextLevelBERT: Masked language modeling with higher-level representations for long documents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4656-4666, Bangkok, Thailand. Association for Computational Linguistics.",
1325
+ "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.",
1326
+ "Paul-Ambroise Duquenne, Holger Schwenk, and Benoit Sagot. 2023. Sonar: sentence-level multimodal and language-agnostic representations. arXiv e-prints, pages arXiv-2308.",
1327
+ "Allyson Ettinger, Ahmed Elgohary, and Philip Resnik. 2016. Probing for semantic evidence of composition"
1328
+ ],
1329
+ "bbox": [
1330
+ 115,
1331
+ 85,
1332
+ 489,
1333
+ 920
1334
+ ],
1335
+ "page_idx": 9
1336
+ },
1337
+ {
1338
+ "type": "list",
1339
+ "sub_type": "ref_text",
1340
+ "list_items": [
1341
+ "by means of simple classification tasks. In Proceedings of the 1st workshop on evaluating vector-space representations for nlp, pages 134-139.",
1342
+ "Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021. SimCSE: Simple contrastive learning of sentence embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6894-6910, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.",
1343
+ "Mario Giulianielli. 2018. Under the hood: Using diagnostic classifiers to investigate and improve how language models track agreement information. arXiv preprint arXiv:1808.08079.",
1344
+ "Melika Golestani, Seyedeh Zahra Razavi, Zeinab Borhanifard, Farnaz Tahmasebian, and Hesham Faili. 2021. Using bert encoding and sentence-level language model for sentence ordering. In International Conference on Text, Speech, and Dialogue, pages 318-330. Springer.",
1345
+ "Lars Hillebrand, Prabhupad Pradhan, Christian Bauckhage, and Rafet Sifa. 2024. Pointer-guided pretraining: Infusing large language models with paragraph-level contextual awareness. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 386-402. Springer.",
1346
+ "Ting-Hao Kenneth Huang, Francis Ferraro, Nasrin Mostafazadeh, Ishan Misra, Aishwarya Agrawal, Jacob Devlin, Ross Girshick, Xiaodong He, Pushmeet Kohli, Dhruv Batra, C. Lawrence Zitnick, Devi Parikh, Lucy Vanderwende, Michel Galley, and Margaret Mitchell. 2016. Visual storytelling. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1233-1239, San Diego, California. Association for Computational Linguistics.",
1347
+ "Yichen Huang, Yizhe Zhang, OuSSama Elachqar, and Yu Cheng. 2020. Inset: Sentence infilling with intersentential transformer. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2502-2515.",
1348
+ "Dieuwke Hupkes, Sara Veldhoen, and Willem Zuidema. 2018. Visualisation and diagnostic classifiers' reveal how recurrent and recursive neural networks process hierarchical structure. Journal of Artificial Intelligence Research, 61:907-926.",
1349
+ "Daphne Ippolito, David Grangier, Douglas Eck, and Chris Callison-Burch. 2020. Toward better storylines with sentence-level language models. arXiv preprint arXiv:2005.05255.",
1350
+ "Amita Kamath, Jack Hessel, and Kai-Wei Chang. 2023. Text encoders bottleneck compositionality in contrastive vision-language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 4933–4944, Singapore. Association for Computational Linguistics."
1351
+ ],
1352
+ "bbox": [
1353
+ 510,
1354
+ 85,
1355
+ 882,
1356
+ 920
1357
+ ],
1358
+ "page_idx": 9
1359
+ },
1360
+ {
1361
+ "type": "page_number",
1362
+ "text": "11689",
1363
+ "bbox": [
1364
+ 477,
1365
+ 928,
1366
+ 524,
1367
+ 940
1368
+ ],
1369
+ "page_idx": 9
1370
+ },
1371
+ {
1372
+ "type": "list",
1373
+ "sub_type": "ref_text",
1374
+ "list_items": [
1375
+ "Najoung Kim, Roma Patel, Adam Poliak, Alex Wang, Patrick Xia, R Thomas McCoy, Ian Tenney, Alexis Ross, Tal Linzen, Benjamin Van Durme, et al. 2019. Probing what different nlp tasks teach machines about function word comprehension. arXiv preprint arXiv:1904.11544.",
1376
+ "Ryan Kiros, Yukun Zhu, Russ R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Skip-thought vectors. Advances in neural information processing systems, 28.",
1377
+ "Pawan Kumar, Dhanajit Brahma, Harish Karnick, and Piyush Rai. 2020. Deep attentive ranking networks for learning to order sentences. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 8115-8122.",
1378
+ "LCM team, Loïc Barrault, Paul-Ambroise Duquenne, Maha Elbayad, Artyom Kozhevnikov, Belen Alastruey, Pierre Andrews, Mariano Coria, Guillaume Couairon, Marta R. Costa-jussà, David Dale, Hady Elsahar, Kevin Heffernan, Joao Maria Janeiro, Tuan Tran, Christophe Ropers, Eduardo Sánchez, Robin San Roman, Alexandre Mourachko, Safiyyah Saleem, and Holger Schwenk. 2024. Large Concept Models: Language modeling in a sentence representation space.",
1379
+ "Chin-Yew Lin and Eduard Hovy. 2003. Automatic evaluation of summaries using n-gram co-occurrence statistics. In Proceedings of the 2003 Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics, pages 150-157.",
1380
+ "Lajanugen Logeswaran and Honglak Lee. 2018. An efficient framework for learning sentence representations. In International Conference on Learning Representations.",
1381
+ "Lajanugen Logeswaran, Honglak Lee, and Dragomir Radev. 2016. Sentence ordering using recurrent neural networks.",
1382
+ "Yusuke Mori, Hiroaki Yamane, Yusuke Mukuta, and Tatsuya Harada. 2020. Finding and generating a missing part for story completion. In Proceedings of the 4th Joint SIGHUM Workshop on Computational Linguistics for Cultural Heritage, Social Sciences, Humanities and Literature, pages 156-166.",
1383
+ "Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong He, Devi Parikh, Dhruv Batra, Lucy Vanderwende, Pushmeet Kohli, and James Allen. 2016. A corpus and cloze evaluation for deeper understanding of commonsense stories. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 839-849, San Diego, California. Association for Computational Linguistics.",
1384
+ "Niklas Muennighoff, Nouamane Tazi, Loic Magne, and Nils Reimers. 2023. MTEB: Massive text embedding benchmark. In Proceedings of the 17th Conference"
1385
+ ],
1386
+ "bbox": [
1387
+ 115,
1388
+ 85,
1389
+ 489,
1390
+ 919
1391
+ ],
1392
+ "page_idx": 10
1393
+ },
1394
+ {
1395
+ "type": "list",
1396
+ "sub_type": "ref_text",
1397
+ "list_items": [
1398
+ "of the European Chapter of the Association for Computational Linguistics, pages 2014-2037, Dubrovnik, Croatia. Association for Computational Linguistics.",
1399
+ "Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. 2020. Adversarial NLI: A new benchmark for natural language understanding. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4885-4901, Online. Association for Computational Linguistics.",
1400
+ "Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pages 311-318, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics.",
1401
+ "Dragomir R Radev, Mark Thomas Joseph, Bryan Gibson, and Pradeep Muthukrishnan. 2016. A bibliometric and network analysis of the field of computational linguistics. Journal of the Association for Information Science and Technology, 67(3):683-706.",
1402
+ "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. Journal of machine learning research, 21(140):1-67.",
1403
+ "Nils Reimers and Iryna Gurevych. 2019. SentenceBERT: Sentence embeddings using Siamese BERTnetworks. 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 3982-3992, Hong Kong, China. Association for Computational Linguistics.",
1404
+ "Cécile Robin, Atharva Kulkarni, and Paul Buitelaar. 2023. Identifying FrameNet lexical semantic structures for knowledge graph extraction from financial customer interactions. In Proceedings of the 12th Global Wordnet Conference, pages 91-100, University of the Basque Country, Donostia - San Sebastian, Basque Country. Global Wordnet Association.",
1405
+ "Anna Rogers, Olga Kovaleva, and Anna Rumshisky. 2020. A primer in BERTology: What we know about how BERT works. Transactions of the Association for Computational Linguistics, 8:842-866.",
1406
+ "Thibault Sellam, Steve Yadlowsky, Jason Wei, Naomi Saphra, Alexander D'Amour, Tal Linzen, Jasmijn Bastings, Iulia Turc, Jacob Eisenstein, Dipanjan Das, et al. 2021. The multiberts: Bert reproductions for robustness analysis. arXiv preprint arXiv:2106.16163.",
1407
+ "Xing Shi, Inkit Padhi, and Kevin Knight. 2016. Does string-based neural mt learn source syntax? In Proceedings of the 2016 conference on empirical methods in natural language processing, pages 1526-1534."
1408
+ ],
1409
+ "bbox": [
1410
+ 510,
1411
+ 85,
1412
+ 882,
1413
+ 917
1414
+ ],
1415
+ "page_idx": 10
1416
+ },
1417
+ {
1418
+ "type": "page_number",
1419
+ "text": "11690",
1420
+ "bbox": [
1421
+ 477,
1422
+ 928,
1423
+ 524,
1424
+ 940
1425
+ ],
1426
+ "page_idx": 10
1427
+ },
1428
+ {
1429
+ "type": "list",
1430
+ "sub_type": "ref_text",
1431
+ "list_items": [
1432
+ "Eva Vanmassenhove, Jinhua Du, and Andy Way. 2017. Investigating'aspect'in nmt and smt: translating the english simple past and present perfect. Computational Linguistics in the Netherlands Journal (CLIN), 7:109-128.",
1433
+ "Sara Veldhoen, Dieuwke Hupkes, Willem H Zuidema, et al. 2016. Diagnostic classifiers revealing how neural networks process hierarchical structure. In CoCo@ NIPS, pages 69-77. Barcelona.",
1434
+ "Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112-1122, New Orleans, Louisiana. Association for Computational Linguistics.",
1435
+ "Ziyi Yang, Yinfei Yang, Daniel Cer, Jax Law, and Eric Darve. 2021. Universal sentence representation learning with conditional masked language model. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6216-6228, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.",
1436
+ "Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. 2019. Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675.",
1437
+ "Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In The IEEE International Conference on Computer Vision (ICCV)."
1438
+ ],
1439
+ "bbox": [
1440
+ 115,
1441
+ 85,
1442
+ 489,
1443
+ 595
1444
+ ],
1445
+ "page_idx": 11
1446
+ },
1447
+ {
1448
+ "type": "page_number",
1449
+ "text": "11691",
1450
+ "bbox": [
1451
+ 477,
1452
+ 928,
1453
+ 522,
1454
+ 940
1455
+ ],
1456
+ "page_idx": 11
1457
+ },
1458
+ {
1459
+ "type": "text",
1460
+ "text": "A Implementation Details",
1461
+ "text_level": 1,
1462
+ "bbox": [
1463
+ 114,
1464
+ 84,
1465
+ 347,
1466
+ 99
1467
+ ],
1468
+ "page_idx": 12
1469
+ },
1470
+ {
1471
+ "type": "text",
1472
+ "text": "Experimental Settings Each model has 85,664,257 parameters and is trained for 10 epochs. For each task, we use hyperparameters (batch size $\\in$ {4,8,16,32,64}, learning rate $\\in$ {1e-5,2e-5,3e-5}, warmup ratio $\\in$ {0.06,0.03,0.3,0.6}) that give the best validation accuracy.",
1473
+ "bbox": [
1474
+ 112,
1475
+ 109,
1476
+ 489,
1477
+ 221
1478
+ ],
1479
+ "page_idx": 12
1480
+ },
1481
+ {
1482
+ "type": "text",
1483
+ "text": "Dataset We use the datasets made available publicly by the respective authors. We use all three rounds of data for ANLI dataset.",
1484
+ "bbox": [
1485
+ 112,
1486
+ 231,
1487
+ 489,
1488
+ 278
1489
+ ],
1490
+ "page_idx": 12
1491
+ },
1492
+ {
1493
+ "type": "text",
1494
+ "text": "B Token-level Model Details",
1495
+ "text_level": 1,
1496
+ "bbox": [
1497
+ 112,
1498
+ 291,
1499
+ 374,
1500
+ 307
1501
+ ],
1502
+ "page_idx": 12
1503
+ },
1504
+ {
1505
+ "type": "text",
1506
+ "text": "We fine-tune a vanilla BERT-base model on the three tasks as follows: (1) for the sentence ordering task, we preprocess each sentence with a [SEP] token and use the final layer representation corresponding to this token to train the model on the regression task of predicting the relative position of each sentence using mean-squared loss; (2) for the sequence classifications task, we take the representations corresponding to the [SEP] token and train on a 5-class classification task using the cross-entropy loss; and (3) for the NLI task, we take the representation corresponding to the [CLS] token to train the model on the 3-class classification task using cross-entropy loss. Each model has 108,929,281 parameters and is trained for 15 epochs. For AAN and NIPS datasets, the model was trained using 1 transformer layer (30,962,689 parameters) to avoid underfitting. For each task, we use hyperparameters (batch size $\\in$ {4,8,16,32,64}, learning rate $\\in$ $\\{1^{e - 5},2^{e - 5},3^{e - 5}\\}$ , warmup ratio $\\in$ {0.06,0.03,0.3,0.6}) that give the best validation accuracy.",
1507
+ "bbox": [
1508
+ 112,
1509
+ 317,
1510
+ 489,
1511
+ 670
1512
+ ],
1513
+ "page_idx": 12
1514
+ },
1515
+ {
1516
+ "type": "text",
1517
+ "text": "C Decoder Training Details and Results",
1518
+ "text_level": 1,
1519
+ "bbox": [
1520
+ 112,
1521
+ 683,
1522
+ 475,
1523
+ 699
1524
+ ],
1525
+ "page_idx": 12
1526
+ },
1527
+ {
1528
+ "type": "text",
1529
+ "text": "We train the decoder of T5-large (Raffel et al., 2020) conditioned on a fixed sentence representation obtained from each encoder we study in this work. To match the dimension of the representations from each encoder and the T5-large decoder, we add a linear layer followed by layer normalization. We keep the sentence encoder frozen and train the decoder for 1 epoch on randomly sampled 2M examples from the Bookcorpus dataset (Zhu et al., 2015) available on huggingface<sup>6</sup>. Sentences in this dataset are $14 \\pm 9$ words long and the model",
1530
+ "bbox": [
1531
+ 112,
1532
+ 709,
1533
+ 489,
1534
+ 885
1535
+ ],
1536
+ "page_idx": 12
1537
+ },
1538
+ {
1539
+ "type": "text",
1540
+ "text": "has 436, 416, 000 parameters which took $19hrs$ to train on 1 Tesla V100-SXM2-32GB GPU. We use a batch size of 32, Adam optimizer with default parameters, and a learning rate of $1e^{-5}$ . Decoding results are shown in Figure 9.",
1541
+ "bbox": [
1542
+ 507,
1543
+ 84,
1544
+ 882,
1545
+ 164
1546
+ ],
1547
+ "page_idx": 12
1548
+ },
1549
+ {
1550
+ "type": "text",
1551
+ "text": "D Probing Results",
1552
+ "text_level": 1,
1553
+ "bbox": [
1554
+ 507,
1555
+ 175,
1556
+ 687,
1557
+ 192
1558
+ ],
1559
+ "page_idx": 12
1560
+ },
1561
+ {
1562
+ "type": "text",
1563
+ "text": "We perform the probing results using the official implementation for SentEval<sup>7</sup>, DiscoEval<sup>8</sup>, and MTEB<sup>9</sup> tasks. We only use the English language tasks in the MTEB benchmark excluding 15 tasks for which we got a significant (< 0.8 Spearman's correlation) correlation between performance for encoders trained using different pretraining initialization seeds. These tasks include: FEVER, ArxivClusteringP2P, ImdbClassification, SICK-R, MedrxivClusteringS2S, STS13, ToxicConversationsClassification, RedditClusteringP2P, ArguAna, Touche2020, MedrxivClusteringP2P, BIOSSES, STS22, SummEval, Biorxiv-ClusteringP2P.",
1564
+ "bbox": [
1565
+ 507,
1566
+ 202,
1567
+ 884,
1568
+ 426
1569
+ ],
1570
+ "page_idx": 12
1571
+ },
1572
+ {
1573
+ "type": "text",
1574
+ "text": "We present the results related to specific scores for each encoder on the probing tasks in Figures 10, 11, 12, and 13.",
1575
+ "bbox": [
1576
+ 507,
1577
+ 426,
1578
+ 882,
1579
+ 473
1580
+ ],
1581
+ "page_idx": 12
1582
+ },
1583
+ {
1584
+ "type": "text",
1585
+ "text": "E Additional Results",
1586
+ "text_level": 1,
1587
+ "bbox": [
1588
+ 507,
1589
+ 486,
1590
+ 707,
1591
+ 502
1592
+ ],
1593
+ "page_idx": 12
1594
+ },
1595
+ {
1596
+ "type": "text",
1597
+ "text": "We provide additional pooling layer results in Figure 15 for SciBERT, where representations from the last layer are better than the first layer for the scientific domain indicating that pretraining dataset domain is more important than other factors. However, for general domain datasets, mean representations from the first layer perform better than CLS representations from the last layer and SciBERT-NLI or comparable to Max representations from the last layer.",
1598
+ "bbox": [
1599
+ 507,
1600
+ 512,
1601
+ 882,
1602
+ 673
1603
+ ],
1604
+ "page_idx": 12
1605
+ },
1606
+ {
1607
+ "type": "text",
1608
+ "text": "We provide results (Figure 14) for different pooling strategies when encoders with different pertaining initialization seeds were used.",
1609
+ "bbox": [
1610
+ 507,
1611
+ 673,
1612
+ 882,
1613
+ 721
1614
+ ],
1615
+ "page_idx": 12
1616
+ },
1617
+ {
1618
+ "type": "page_footnote",
1619
+ "text": "$^{6}$ https://huggingface.co/datasets/bookcorpus/ bookcorpus",
1620
+ "bbox": [
1621
+ 112,
1622
+ 894,
1623
+ 468,
1624
+ 919
1625
+ ],
1626
+ "page_idx": 12
1627
+ },
1628
+ {
1629
+ "type": "page_footnote",
1630
+ "text": "<sup>7</sup>https://github.com/facebookresearch/SentEval",
1631
+ "bbox": [
1632
+ 529,
1633
+ 879,
1634
+ 873,
1635
+ 892
1636
+ ],
1637
+ "page_idx": 12
1638
+ },
1639
+ {
1640
+ "type": "page_footnote",
1641
+ "text": "<sup>8</sup>https://github.com/ZeweiChu/DiscoEval",
1642
+ "bbox": [
1643
+ 532,
1644
+ 894,
1645
+ 820,
1646
+ 906
1647
+ ],
1648
+ "page_idx": 12
1649
+ },
1650
+ {
1651
+ "type": "page_footnote",
1652
+ "text": "<sup>9</sup>https://github.com/embeddings-benchmark/mteb",
1653
+ "bbox": [
1654
+ 532,
1655
+ 906,
1656
+ 873,
1657
+ 919
1658
+ ],
1659
+ "page_idx": 12
1660
+ },
1661
+ {
1662
+ "type": "page_number",
1663
+ "text": "11692",
1664
+ "bbox": [
1665
+ 477,
1666
+ 927,
1667
+ 524,
1668
+ 940
1669
+ ],
1670
+ "page_idx": 12
1671
+ },
1672
+ {
1673
+ "type": "image",
1674
+ "img_path": "images/4176a05a15dc334b889b74cdf7358a5076b5b4d1e4c5b309080cec421a981909.jpg",
1675
+ "image_caption": [
1676
+ "(a) Encoders (different training regimes)"
1677
+ ],
1678
+ "image_footnote": [],
1679
+ "bbox": [
1680
+ 117,
1681
+ 84,
1682
+ 366,
1683
+ 154
1684
+ ],
1685
+ "page_idx": 13
1686
+ },
1687
+ {
1688
+ "type": "image",
1689
+ "img_path": "images/6ebdaf836d6dd74362636d2778c0ded57c78d15f857f321572d923094f64814d.jpg",
1690
+ "image_caption": [
1691
+ "Figure 9: Metric scores for sentences decoded given their representations obtained from encoders with different training regimes (left), and using different pooling strategies from BERT (middle) and BERT-SimCSE (right) encoders."
1692
+ ],
1693
+ "image_footnote": [],
1694
+ "bbox": [
1695
+ 371,
1696
+ 82,
1697
+ 620,
1698
+ 152
1699
+ ],
1700
+ "page_idx": 13
1701
+ },
1702
+ {
1703
+ "type": "image",
1704
+ "img_path": "images/0028636b0236aa6c3d7a914d98d59c1d392ade81ab8009f95405f4b50f2770af.jpg",
1705
+ "image_caption": [
1706
+ "(b) BERT (different pooling strategies)",
1707
+ "(c) BERT-SimCSE (different pooling strategies)"
1708
+ ],
1709
+ "image_footnote": [],
1710
+ "bbox": [
1711
+ 628,
1712
+ 82,
1713
+ 880,
1714
+ 152
1715
+ ],
1716
+ "page_idx": 13
1717
+ },
1718
+ {
1719
+ "type": "image",
1720
+ "img_path": "images/b689a439164b8b3413dcf35a3fc1eb7edfffab42654002e0597ff0aaa5c501a1.jpg",
1721
+ "image_caption": [
1722
+ "(a) SentEval"
1723
+ ],
1724
+ "image_footnote": [],
1725
+ "bbox": [
1726
+ 117,
1727
+ 324,
1728
+ 485,
1729
+ 458
1730
+ ],
1731
+ "page_idx": 13
1732
+ },
1733
+ {
1734
+ "type": "image",
1735
+ "img_path": "images/0dbff2088a33a4ef25dd5fbc88995592a9cc973dbbde5257f70e50f1860cd4d8.jpg",
1736
+ "image_caption": [
1737
+ "(a) SentEval"
1738
+ ],
1739
+ "image_footnote": [],
1740
+ "bbox": [
1741
+ 514,
1742
+ 344,
1743
+ 878,
1744
+ 476
1745
+ ],
1746
+ "page_idx": 13
1747
+ },
1748
+ {
1749
+ "type": "image",
1750
+ "img_path": "images/5f6b0fe439503739ca03a32f59c5c7f78db69fa00eab62d0f79e01c0363e45ea.jpg",
1751
+ "image_caption": [],
1752
+ "image_footnote": [],
1753
+ "bbox": [
1754
+ 119,
1755
+ 480,
1756
+ 482,
1757
+ 620
1758
+ ],
1759
+ "page_idx": 13
1760
+ },
1761
+ {
1762
+ "type": "image",
1763
+ "img_path": "images/bfb00cf0164a44ecd3057e59c4ed239047e644feffb299a9820e607ed4a731e2.jpg",
1764
+ "image_caption": [],
1765
+ "image_footnote": [],
1766
+ "bbox": [
1767
+ 514,
1768
+ 500,
1769
+ 875,
1770
+ 612
1771
+ ],
1772
+ "page_idx": 13
1773
+ },
1774
+ {
1775
+ "type": "image",
1776
+ "img_path": "images/2f1525d44c245ca81e4edc4ceeec68faa12df52ae92b1d1ad55c0008066dd31b.jpg",
1777
+ "image_caption": [
1778
+ "(b) MTEB",
1779
+ "(c) DiscoEval",
1780
+ "Figure 10: Probing task scores for encoders with different training regimes. SentEval, Average (MTEB), and DiscoEval show the averaged scores across all the tasks in these evaluation benchmarks.",
1781
+ "Figure 11: Probing task scores for BERT encoder with different pooling strategies. SentEval, Average (MTEB), and DiscoEval show the averaged scores across all the tasks in these evaluation benchmarks."
1782
+ ],
1783
+ "image_footnote": [],
1784
+ "bbox": [
1785
+ 119,
1786
+ 642,
1787
+ 482,
1788
+ 762
1789
+ ],
1790
+ "page_idx": 13
1791
+ },
1792
+ {
1793
+ "type": "image",
1794
+ "img_path": "images/69b0f2e8dfdf0a1ff6e0bcc89b2135a33e565905489b639a06f2aca96402c84e.jpg",
1795
+ "image_caption": [
1796
+ "(b) MTEB",
1797
+ "(c) DiscoEval"
1798
+ ],
1799
+ "image_footnote": [],
1800
+ "bbox": [
1801
+ 514,
1802
+ 633,
1803
+ 877,
1804
+ 741
1805
+ ],
1806
+ "page_idx": 13
1807
+ },
1808
+ {
1809
+ "type": "page_number",
1810
+ "text": "11693",
1811
+ "bbox": [
1812
+ 475,
1813
+ 927,
1814
+ 524,
1815
+ 940
1816
+ ],
1817
+ "page_idx": 13
1818
+ },
1819
+ {
1820
+ "type": "image",
1821
+ "img_path": "images/cd590082ddf976fa3c331c5079a23f762acab9796453534063e81c8765f403f8.jpg",
1822
+ "image_caption": [],
1823
+ "image_footnote": [],
1824
+ "bbox": [
1825
+ 117,
1826
+ 256,
1827
+ 480,
1828
+ 388
1829
+ ],
1830
+ "page_idx": 14
1831
+ },
1832
+ {
1833
+ "type": "image",
1834
+ "img_path": "images/147875dbc3c40e46bbf30196291cdec96cedabc0d99bf6d774b42b4c2687399a.jpg",
1835
+ "image_caption": [
1836
+ "(a) SentEval"
1837
+ ],
1838
+ "image_footnote": [],
1839
+ "bbox": [
1840
+ 119,
1841
+ 411,
1842
+ 482,
1843
+ 523
1844
+ ],
1845
+ "page_idx": 14
1846
+ },
1847
+ {
1848
+ "type": "image",
1849
+ "img_path": "images/97ddfe29bdf9e97e04cbc7c06c07384cbbeada494baf062b141869c9cb944c78.jpg",
1850
+ "image_caption": [
1851
+ "(b) MTEB",
1852
+ "(c) DiscoEval",
1853
+ "Figure 12: Probing task scores for BERT-SimCSE encoder with different pooling strategies. SentEval, Average (MTEB), and DiscoEval show the averaged scores across all the tasks in these evaluation benchmarks."
1854
+ ],
1855
+ "image_footnote": [],
1856
+ "bbox": [
1857
+ 121,
1858
+ 543,
1859
+ 480,
1860
+ 652
1861
+ ],
1862
+ "page_idx": 14
1863
+ },
1864
+ {
1865
+ "type": "image",
1866
+ "img_path": "images/05b009ba677e7cd45996d574985db12fac065c93b01007cee35d94f94b0e731a.jpg",
1867
+ "image_caption": [
1868
+ "(a) SentEval"
1869
+ ],
1870
+ "image_footnote": [],
1871
+ "bbox": [
1872
+ 514,
1873
+ 258,
1874
+ 877,
1875
+ 388
1876
+ ],
1877
+ "page_idx": 14
1878
+ },
1879
+ {
1880
+ "type": "image",
1881
+ "img_path": "images/4bf3cb06857bdeb8631e1490c832eff83bd998bfa0c67914bbc3669f1aca0ba2.jpg",
1882
+ "image_caption": [],
1883
+ "image_footnote": [],
1884
+ "bbox": [
1885
+ 514,
1886
+ 411,
1887
+ 875,
1888
+ 523
1889
+ ],
1890
+ "page_idx": 14
1891
+ },
1892
+ {
1893
+ "type": "image",
1894
+ "img_path": "images/b7e820062d30803cf8f3ccc2189e2a861635a2289f56526a29e63abf33a09681.jpg",
1895
+ "image_caption": [
1896
+ "(b) MTEB",
1897
+ "(c) DiscoEval",
1898
+ "Figure 13: Probing task scores for SciBERT encoder with different pooling strategies. SentEval, Average (MTEB), and DiscoEval show the averaged scores across all the tasks in these evaluation benchmarks."
1899
+ ],
1900
+ "image_footnote": [],
1901
+ "bbox": [
1902
+ 514,
1903
+ 544,
1904
+ 875,
1905
+ 652
1906
+ ],
1907
+ "page_idx": 14
1908
+ },
1909
+ {
1910
+ "type": "page_number",
1911
+ "text": "11694",
1912
+ "bbox": [
1913
+ 477,
1914
+ 927,
1915
+ 524,
1916
+ 940
1917
+ ],
1918
+ "page_idx": 14
1919
+ },
1920
+ {
1921
+ "type": "image",
1922
+ "img_path": "images/3a41442b732e2e472e927e834cfad59d2568f4205d3e152af4294017dd48399b.jpg",
1923
+ "image_caption": [
1924
+ "Figure 14: Accuracy for sentence-level models trained using representations (with different pooling strategies) from BERT encoders using different pretraining initialization seeds. Default denotes the scores obtained with default encoders available on huggingface. Variance is across datasets for the sentence ordering task."
1925
+ ],
1926
+ "image_footnote": [],
1927
+ "bbox": [
1928
+ 119,
1929
+ 83,
1930
+ 880,
1931
+ 253
1932
+ ],
1933
+ "page_idx": 15
1934
+ },
1935
+ {
1936
+ "type": "image",
1937
+ "img_path": "images/bbe1cc803ef011eab4dbb528994cccb3f6945e05293d9fa24d8906b3c923cf31.jpg",
1938
+ "image_caption": [],
1939
+ "image_footnote": [],
1940
+ "bbox": [
1941
+ 117,
1942
+ 424,
1943
+ 487,
1944
+ 565
1945
+ ],
1946
+ "page_idx": 15
1947
+ },
1948
+ {
1949
+ "type": "image",
1950
+ "img_path": "images/6c2a81f8129c965192bae699c203bddd0939806ee4b6c1bfc159f1a3f7901dbf.jpg",
1951
+ "image_caption": [
1952
+ "(a) Different poolings from BERT-SimCSE encoder",
1953
+ "(b) Different poolings from SciBERT encoder",
1954
+ "Figure 15: Accuracy for sentence-level models trained using representations obtained by pooling from first and last layers of BERT-SimCSE (a) and SciBERT (b) encoders, and compared to other encoders. Variance is across datasets for the sentence ordering task."
1955
+ ],
1956
+ "image_footnote": [],
1957
+ "bbox": [
1958
+ 117,
1959
+ 586,
1960
+ 485,
1961
+ 721
1962
+ ],
1963
+ "page_idx": 15
1964
+ },
1965
+ {
1966
+ "type": "page_number",
1967
+ "text": "11695",
1968
+ "bbox": [
1969
+ 477,
1970
+ 928,
1971
+ 524,
1972
+ 940
1973
+ ],
1974
+ "page_idx": 15
1975
+ }
1976
+ ]