Retrieval-Augmented Legal Judgment Prediction with Adaptive Case Retrieval
Legal judgment prediction (LJP) models are mostly parametric, although judges routinely consult precedents, and recent retrieval-augmented LJP systems attach a fixed number of precedents to every case. We propose adaptive case retrieval (ACR), which treats a calibrated parametric predictor and the precedent votes of a sparse and a dense retriever at seven retrieval depths as experts, and learns a gate that mixes them from confidence, similarity, label-dispersion and agreement features. The dense retriever is a judgment-consistent contrastive (JCC) encoder whose objective adapts the contrastive knowledge-infusion loss of LegalReasoner by treating cases with agreeing judgments as positives. On CAIL2018-Small with train–test duplicates removed (112 charges, 91 law articles, 11 term intervals), JCC raises 10-nearest-neighbour charge accuracy from 76.9% to 90.7%, and ACR improves a TF-IDF+SVM predictor by 0.62 and 1.28 accuracy points on law-article and prison-term prediction (p < 0.001), matching the best validation-tuned fixed-k interpolation in distribution. Its advantage grows when the precedent memory expands without re-training: with every component fitted on 20% of the labels, expanding the memory to the full training set raises term accuracy by 1.87 points under ACR versus 0.53 points under the fixed scheme, recovering 86.8% of the gap to a fully re-trained model, and the gains do not stem from near-duplicate precedents. A confidence-based routing rule bypasses retrieval for the 70–90% most confident cases while preserving the full charge and article gains, and the complete pipeline costs about 11 ms per case on one CPU core.
References
- Zhong, H., Xiao, C., Tu, C., Zhang, T., Liu, Z., & Sun, M. (2020). How does NLP benefit legal system: A summary of legal artificial intelligence. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (ACL) (pp. 5218-5230). Association for Computational Linguistics. https://doi.org/10.18653/v1/2020.acl-main.466
- Xiao, C., Zhong, H., Guo, Z., Tu, C., Liu, Z., Sun, M., Feng, Y., Han, X., Hu, Z., Wang, H., & Xu, J. (2018). CAIL2018: A large-scale legal dataset for judgment prediction. arXiv, arXiv:1807.02478. https://doi.org/10.48550/arXiv.1807.02478
- Aletras, N., Tsarapatsanis, D., Preoţiuc-Pietro, D., & Lampos, V. (2016). Predicting judicial decisions of the European Court of Human Rights: A natural language processing perspective. PeerJ Computer Science, 2, Article e93. https://doi.org/10.7717/peerj-cs.93
- Chalkidis, I., Androutsopoulos, I., & Aletras, N. (2019). Neural legal judgment prediction in English. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (ACL) (pp. 4317-4323). Association for Computational Linguistics. https://doi.org/10.18653/v1/P19-1424
- Luo, B., Feng, Y., Xu, J., Zhang, X., & Zhao, D. (2017). Learning to predict charges for criminal cases with legal basis. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP) (pp. 2727-2736). Association for Computational Linguistics. https://doi.org/10.18653/v1/D17-1289
- Zhong, H., Guo, Z., Tu, C., Xiao, C., Liu, Z., & Sun, M. (2018). Legal judgment prediction via topological learning. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP) (pp. 3540-3549). Association for Computational Linguistics. https://doi.org/10.18653/v1/D18-1390
- Ma, Y., Shao, Y., Wu, Y., Liu, Y., Zhang, R., Zhang, M., & Ma, S. (2021). LeCaRD: A legal case retrieval dataset for Chinese law system. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval (pp. 2342-2348). ACM. https://doi.org/10.1145/3404835.3463250
- Shao, Y., Mao, J., Liu, Y., Ma, W., Satoh, K., Zhang, M., & Ma, S. (2020). BERT-PLI: Modeling paragraph-level interactions for legal case retrieval. In Proceedings of the 29th International Joint Conference on Artificial Intelligence (IJCAI) (pp. 3501-3507). https://doi.org/10.24963/ijcai.2020/484
- Xu, N., Wang, P., Chen, L., Pan, L., Wang, X., & Zhao, J. (2020). Distinguish confusing law articles for legal judgment prediction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (ACL) (pp. 3086-3095). Association for Computational Linguistics. https://doi.org/10.18653/v1/2020.acl-main.280
- Yue, L., Liu, Q., Jin, B., Wu, H., Zhang, K., An, Y., Cheng, M., Yin, B., & Wu, D. (2021). NeurJudge: A circumstance-aware neural framework for legal judgment prediction. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval (pp. 973-982). ACM. https://doi.org/10.1145/3404835.3462826
- Yue, X., & Zhu, R. (2024). An explainable hybrid machine learning framework for cash-flow-conditioned multi-horizon liquidity risk early warning: An SME-oriented benchmark study. World Journal of Management Science, 2(1), 63-72.
- Zhang, H., & Dou, Z. (2023). Case retrieval for legal judgment prediction in legal artificial intelligence. In Proceedings of the 22nd Chinese National Conference on Computational Linguistics (CCL) (pp. 801-812).
- Wang, X., Zhang, X., Hoo, V., Shao, Z., & Zhang, X. (2024). LegalReasoner: A multi-stage framework for legal judgment prediction via large language models and knowledge integration. IEEE Access, 12, 166843-166854. https://doi.org/10.1109/ACCESS.2024.3496666
- Mallen, A., Asai, A., Zhong, V., Das, R., Khashabi, D., & Hajishirzi, H. (2023). When not to trust language models: Investigating effectiveness of parametric and non-parametric memories. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (ACL) (pp. 9802-9822). Association for Computational Linguistics. https://doi.org/10.18653/v1/2023.acl-long.546
- Asai, A., Wu, Z., Wang, Y., Sil, A., & Hajishirzi, H. (2024). Self-RAG: Learning to retrieve, generate, and critique through self-reflection. In Proceedings of the International Conference on Learning Representations (ICLR).
- Jeong, S., Baek, J., Cho, S., Hwang, S. J., & Park, J. C. (2024). Adaptive-RAG: Learning to adapt retrieval-augmented large language models through question complexity. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL) (pp. 7036-7050). Association for Computational Linguistics. https://doi.org/10.18653/v1/2024.naacl-long.389
- Zheng, X., Zhang, Z., Guo, J., Huang, S., Chen, B., Luo, W., & Chen, J. (2021). Adaptive nearest neighbor machine translation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (ACL-IJCNLP) (pp. 368-374). Association for Computational Linguistics. https://doi.org/10.18653/v1/2021.acl-short.47
- Zhou, F. (2026). Moment-constrained side-force allocation for wind-assisted merchant ships: Hydrodynamic performance of retractable anti-leeway fins and flap rudders. Innovation and Technology Studies, 3(1), 27-41.
- Yang, W., Jia, W., Zhou, X., & Luo, Y. (2019). Legal judgment prediction via multi-perspective bi-feedback network. In Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI) (pp. 4085-4091). https://doi.org/10.24963/ijcai.2019/567
- Chalkidis, I., Fergadiotis, M., Malakasiotis, P., Aletras, N., & Androutsopoulos, I. (2020). LEGAL-BERT: The muppets straight out of law school. In Findings of the Association for Computational Linguistics: EMNLP 2020 (pp. 2898-2904). Association for Computational Linguistics. https://doi.org/10.18653/v1/2020.findings-emnlp.261
- Xiao, C., Hu, X., Liu, Z., Tu, C., & Sun, M. (2021). Lawformer: A pre-trained language model for Chinese legal long documents. AI Open, 2, 79-84. https://doi.org/10.1016/j.aiopen.2021.06.003
- Karpukhin, V., Oguz, B., Min, S., Lewis, P., Wu, L., Edunov, S., Chen, D., & Yih, W.-T. (2020). Dense passage retrieval for open-domain question answering. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP) (pp. 6769-6781). Association for Computational Linguistics. https://doi.org/10.18653/v1/2020.emnlp-main.550
- Khosla, P., Teterwak, P., Wang, C., Sarna, A., Tian, Y., Isola, P., Maschinot, A., Liu, C., & Krishnan, D. (2020). Supervised contrastive learning. In Advances in Neural Information Processing Systems 33 (NeurIPS) (pp. 18661-18673).
- Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W.-T., Rocktäschel, T., Riedel, S., & Kiela, D. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. In Advances in Neural Information Processing Systems 33 (NeurIPS) (pp. 9459-9474).
- Khandelwal, U., Levy, O., Jurafsky, D., Zettlemoyer, L., & Lewis, M. (2020). Generalization through memorization: Nearest neighbor language models. In Proceedings of the International Conference on Learning Representations (ICLR).
- Khandelwal, U., Fan, A., Jurafsky, D., Zettlemoyer, L., & Lewis, M. (2021). Nearest neighbor machine translation. In Proceedings of the International Conference on Learning Representations (ICLR).
- Guo, C., Pleiss, G., Sun, Y., & Weinberger, K. Q. (2017). On calibration of modern neural networks. In Proceedings of the 34th International Conference on Machine Learning (ICML) (pp. 1321-1330). PMLR.
- Robertson, S., & Zaragoza, H. (2009). The probabilistic relevance framework: BM25 and beyond. Foundations and Trends in Information Retrieval, 3(4), 333-389. https://doi.org/10.1561/1500000019
- Deerwester, S., Dumais, S. T., Furnas, G. W., Landauer, T. K., & Harshman, R. (1990). Indexing by latent semantic analysis. Journal of the American Society for Information Science, 41(6), 391-407. https://doi.org/10.1002/(SICI)1097-4571(199009)41:6<391::AID-ASI1>3.0.CO;2-9
- Dietterich, T. G. (1998). Approximate statistical tests for comparing supervised classification learning algorithms. Neural Computation, 10(7), 1895-1923. https://doi.org/10.1162/089976698300017197
- Yang, J.-S., Zeng, Z., & Shen, Z. (2025). Neural-symbolic dual-indexing architectures for scalable retrieval-augmented generation. IEEE Access, 13, 1-15. https://doi.org/10.1109/ACCESS.2025.3638761
- Rhee, M., Zhang, Y., Li, H., Wang, J., & Chen, X. (2026). Enhancing web search agents with self-play contrastive fine-tuning. IEEE Access, 14, 1-14. https://doi.org/10.1109/ACCESS.2026.3717594