{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/enhancing-legal-case-retrieval-via-scaling","title":"Enhancing Legal Case Retrieval via Scaling High-quality Synthetic Query-Candidate Pairs","arxiv_id":"2410.06581","date":"2024-10-09","proceeding":null,"authors":["Cheng Gao","Chaojun Xiao","Zhenghao Liu","Huimin Chen","Zhiyuan Liu","Maosong Sun"],"abstract":"Legal case retrieval (LCR) aims to provide similar cases as references for a given fact description. This task is crucial for promoting consistent judgments in similar cases, effectively enhancing judicial fairness and improving work efficiency for judges. However, existing works face two main challenges for real-world applications: existing works mainly focus on case-to-case retrieval using lengthy queries, which does not match real-world scenarios; and the limited data scale, with current datasets containing only hundreds of queries, is insufficient to satisfy the training requirements of existing data-hungry neural models. To address these issues, we introduce an automated method to construct synthetic query-candidate pairs and build the largest LCR dataset to date, LEAD, which is hundreds of times larger than existing datasets. This data construction method can provide ample training signals for LCR models. Experimental results demonstrate that model training with our constructed data can achieve state-of-the-art results on two widely-used LCR benchmarks. Besides, the construction method can also be applied to civil cases and achieve promising results. The data and codes can be found in https://github.com/thunlp/LEAD.","url_abs":"https://arxiv.org/abs/2410.06581v1","url_pdf":"https://arxiv.org/pdf/2410.06581v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"enhancing-legal-case-retrieval-via-scaling","repo_url":"https://github.com/thunlp/lead","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"fairness","task_name":"Fairness"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2410.06581","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.06581"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/thunlp/LEAD","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/thunlp/DeepTHULAC","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran":12,"unverified":3},"by_repo_kind":{"official":{"samples":5,"ran":3,"repositories":1},"found_in_text":{"samples":12,"ran":11,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"928414780ee23e45","entry":"dot_product_scores","repo":"thunlp/LEAD","repo_kind":"official","path":"dpr/models/biencoder.py","file_url":"https://github.com/thunlp/LEAD/blob/HEAD/dpr/models/biencoder.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"928414780ee23e45"}},{"code_sha256_prefix":"82cfb42a4b5e2b79","entry":"adjust_pos","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/seg/post_process.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/seg/post_process.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"82cfb42a4b5e2b79"}},{"code_sha256_prefix":"4c7d079ed8d8dd58","entry":"cosine_scores","repo":"thunlp/LEAD","repo_kind":"official","path":"dpr/models/biencoder.py","file_url":"https://github.com/thunlp/LEAD/blob/HEAD/dpr/models/biencoder.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4c7d079ed8d8dd58"}},{"code_sha256_prefix":"3b6aa5f3934d43fb","entry":"kd_ce_loss","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/model_old.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/model_old.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3b6aa5f3934d43fb"}},{"code_sha256_prefix":"aa5ae133f5e4c5b5","entry":"labels2spans","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/seg/seg_utils.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/seg/seg_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa5ae133f5e4c5b5"}},{"code_sha256_prefix":"55c0dbc360ed8346","entry":"make_pair","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/seg/data_format.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/seg/data_format.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"55c0dbc360ed8346"}},{"code_sha256_prefix":"a6887cb2464e843e","entry":"ndcg","repo":"thunlp/LEAD","repo_kind":"official","path":"LeCaRD/metrics.py","file_url":"https://github.com/thunlp/LEAD/blob/HEAD/LeCaRD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a6887cb2464e843e"}},{"code_sha256_prefix":"fab034afea35e8d1","entry":"restore_batch","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/seg/cut_sent.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/seg/cut_sent.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fab034afea35e8d1"}},{"code_sha256_prefix":"0a8363e288b83218","entry":"segs2spans","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/seg/seg_utils.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/seg/seg_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0a8363e288b83218"}},{"code_sha256_prefix":"b573a2abcfda8b28","entry":"set_device","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/utils.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b573a2abcfda8b28"}},{"code_sha256_prefix":"99ce594fba45f85d","entry":"spans2segs","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/seg/seg_utils.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/seg/seg_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"99ce594fba45f85d"}},{"code_sha256_prefix":"ce6b466b301b7acb","entry":"split_batch","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/seg/cut_sent.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/seg/cut_sent.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ce6b466b301b7acb"}},{"code_sha256_prefix":"658e8c99ca132cf3","entry":"split_batch_with_group_texts","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/seg/cut_sent.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/seg/cut_sent.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"658e8c99ca132cf3"}},{"code_sha256_prefix":"bbee4044c3876d25","entry":"timer","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/utils.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bbee4044c3876d25"}},{"code_sha256_prefix":"be2f28a5dece9ffc","entry":"fleiss_kappa","repo":"thunlp/LEAD","repo_kind":"official","path":"LeCaRD/metrics.py","file_url":"https://github.com/thunlp/LEAD/blob/HEAD/LeCaRD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"be2f28a5dece9ffc"}},{"code_sha256_prefix":"3631933778b26cb1","entry":"init_saved_path","repo":"thunlp/DeepTHULAC","repo_kind":"found_in_text","path":"deepthulac/utils.py","file_url":"https://github.com/thunlp/DeepTHULAC/blob/HEAD/deepthulac/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3631933778b26cb1"}},{"code_sha256_prefix":"2244531c0f009dd7","entry":"kappa","repo":"thunlp/LEAD","repo_kind":"official","path":"LeCaRD/metrics.py","file_url":"https://github.com/thunlp/LEAD/blob/HEAD/LeCaRD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2244531c0f009dd7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}