Abstract
The task of legal judgment prediction (LJP) involves predicting court decisions based on the facts of the case, including identifying the applicable law article, the charge, and the term of penalty. While neural methods have made significant strides in this area, they often fail to fully harness the rich semantic potential of language models (LMs). Prompt learning is a novel paradigm in natural language processing (NLP) that reformulates downstream tasks into cloze-style or prefix-style prediction challenges by utilizing specialized prompt templates. This paradigm shows significant potential across various NLP domains, including short text classification. However, the dynamic word lengths of LJP labels present a challenge to the general prompt templates designed for single-word [MASK] tokens commonly used in many NLP tasks. To address this gap, we introduce the Prompt4LJP framework, a new method based on the prompt learning paradigm for the complex LJP task. Our framework employs a dual-slot prompt template in conjunction with a correlation scoring mechanism to maximize the utility of LMs without requiring additional resources or complex tokenization schemes. Specifically, the dual-slot template consists of two distinct slots: one dedicated to factual descriptions and the other to labels. This approach effectively tackles the challenge of dynamic word lengths in LJP labels, reformulating the LJP classification task as an evaluation of the applicability of each label. By incorporating a correlation scoring mechanism, we can identify the final result label. The experimental results show that our Prompt4LJP method, whether using discrete or continuous templates, outperforms baseline methods, particularly in charges and terms of penalty prediction. Compared to the best baseline model EPM, Prompt4LJP shows F1-score improvements of 2.25% and 4.76% (charge prediction and term of penalty prediction) with discrete templates, and 3.24% and 4.05% with the continuous template, demonstrating prompt4LJP ability to leverage pretrained knowledge and adapt flexibly to specific tasks. The source code can be obtained from https://github.com/huangqiongyannn/Prompt4LJP.




Similar content being viewed by others
Data availability
No datasets were generated or analyzed during the current study.
Change history
02 April 2025
The original online version of this article was revised: " an affiliation has been added to Hui Fang, Yin Guan, and Ge Xu. Acknowlegments section has been added.
01 April 2025
A Correction to this paper has been published: https://doi.org/10.1007/s11227-025-07090-4
References
Luo B, Feng Y, Xu J, Zhang X, Zhao D (2017) Learning to predict charges for criminal cases with legal basis. arXiv preprint arXiv:1707.09168
Feng Y, Li C, Ng V (2022) Legal judgment prediction via event extraction with constraints. In: Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 648–664
Zhang H, Dou Z, Zhu Y, Wen J-R (2023) Contrastive learning for legal judgment prediction. ACM Trans Inf Syst 41(4):1–25
Fei Z, Shen X, Zhu D, Zhou F, Han Z, Zhang S, Chen K, Shen Z, Ge J (2023) Lawbench: Benchmarking legal knowledge of large language models. arXiv preprint arXiv:2309.16289
Schick T, Schütze H (2020) Exploiting cloze questions for few shot text classification and natural language inference. arXiv preprint arXiv:2001.07676
Zhu Y, Wang Y, Qiang J, Wu X (2023) Prompt-learning for short text classification. IEEE Trans Knowl Data Eng 36:5328–5339
Wang C, Wang J, Qiu M, Huang J, Gao M (2021) Transprompt: Towards an automatic transferable prompting framework for few-shot text classification. In: Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 2792–2802
Zhang Z, Wang B (2023) Prompt learning for news recommendation. In: Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 227–237
Ding N, Chen Y, Han X, Xu G, Xie P, Zheng H-T, Liu Z, Li J, Kim H-G (2021) Prompt-learning for fine-grained entity typing. arXiv preprint arXiv:2108.10604
Zhu T, Qin Y, Chen Q, Hu B, Xiang Y (2022) Enhancing entity representations with prompt learning for biomedical entity linking. In: IJCAI, pp. 4036–4042
Xiang W, Wang Z, Dai L, Wang B (2022) Connprompt: Connective-cloze prompt learning for implicit discourse relation recognition. In: Proceedings of the 29th International Conference on Computational Linguistics, pp. 902–911
Sahoo P, Singh AK, Saha S, Jain V, Mondal S, Chadha A (2024) A systematic survey of prompt engineering in large language models: Techniques and applications. arXiv preprint arXiv:2402.07927
Sabbatella A, Ponti A, Giordani I, Candelieri A, Archetti F (2024) Prompt optimization in large language models. Mathematics 12(6):929
Xiao C, Zhong H, Guo Z, Tu C, Liu Z, Sun M, Feng Y, Han X, Hu Z, Wang H, et al. (2018) Cail2018: A large-scale legal dataset for judgment prediction. arXiv preprint arXiv:1807.02478
Kort F (1957) Predicting supreme court decisions mathematically: a quantitative analysis of the right to counsel cases. Am Polit Sci Rev 51(1):1–12
Segal JA (1984) Predicting supreme court cases probabilistically: the search and seizure cases, 1962–1981. Am Polit Sci Rev 78(4):891–900
Ulmer SS (1963) Quantitative analysis of judicial processes: some practical and theoretical applications. Law Contemp Probl 28(1):164–184
Zhong H, Guo Z, Tu C, Xiao C, Liu Z, Sun M (2018) Legal judgment prediction via topological learning. In: Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 3540–3549
Yang W, Jia W, Zhou X, Luo Y (2019) Legal judgment prediction via multi-perspective bi-feedback network. arXiv preprint arXiv:1905.03969
Xu N, Wang P, Chen L, Pan L, Wang X, Zhao J (2020) Distinguish confusing law articles for legal judgment prediction. arXiv preprint arXiv:2004.02557
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
Liu Y, Wu Y, Zhang Y, Sun C, Lu W, Wu F, Kuang K (2023) Ml-ljp: Multi-law aware legal judgment prediction. In: Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 1023–1034
Devlin J, Chang M-W, Lee K, Toutanova K (2018) Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805
Brown TB, Mann B, Ryder N, Subbiah M, Kaplan J, Dhariwal P, Neelakantan A, Shyam P, Sastry G, Askell A et al (2020) Language models are few-shot learners. Adv Neural Inf Process Syst 33:1877–1901
Sun J, Huang S, Wei C (2024) Chinese legal judgment prediction via knowledgeable prompt learning. Expert Syst Appl 238:122177
Rubinstein RY, Kroese DP (2004) The cross-entropy method: a Unified approach to combinatorial Optimization, Monte-Carlo Simulation, and Machine Learning. Springer, New York
Loshchilov I, Hutter F (2017) Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101
Wolf T, Debut L, Sanh V, Chaumond J, Delangue C, Moi A, Cistac P, Rault T, Louf R, Funtowicz M, et al (2020) Transformers: State-of-the-art natural language processing. In: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 38–45
Bai J, Bai S, Chu Y, Cui Z, Dang K, Deng X, Fan Y, Ge W, Han Y, Huang F, Hui B, Ji L, Li M, Lin J, Lin R, Liu D, Liu G, Lu C, Lu K, Ma J, Men R, Ren X, Ren X, Tan C, Tan S, Tu J, Wang P, Wang S, Wang W, Wu S, Xu B, Xu J, Yang A, Yang H, Yang J, Yang S, Yao Y, Yu B, Yuan H, Yuan Z, Zhang J, Zhang X, Zhang Y, Zhang Z, Zhou C, Zhou J, Zhou X, Zhu T (2023) Qwen technical report. arXiv preprint arXiv:2309.16609
Hu EJ, Shen Y, Wallis P, Allen-Zhu Z, Li Y, Wang S, Wang L, Chen W (2021) Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685
Zheng Y, Zhang R, Zhang J, Ye Y, Luo Z, Ma Y (2024) Llamafactory: Unified efficient fine-tuning of 100+ language models. arXiv preprint arXiv:2403.13372
Acknowledgments
This research was supported by the Fuzhou Science and Technology Major Special Project 'Open bidding for selecting the best candidates' Initiative (AFZ2024FZZD01080003), Minjiang University 'Open bidding for selecting the best candidates' Project (ZD202401), Minjiang University Introduced Talents Science and Technology Pre-research Project (MJY23033), Minjiang University Introduced Talents Science and Technology Pre-research Project (MJY21032), Fuzhou Marine Research Institute 'Open bidding for selecting the best candidates' Project (2024F02), and Fujian Province Middle-aged and Young Teachers Education and Scientific Research Project (Science and Technology Category) (JAT231095).
Author information
Authors and Affiliations
Contributions
Q.H. was responsible for the experimental design, data collection and analysis, and drafting the manuscript. Y.X. and Y.L. contributed to supplementing the experiments, refining experimental details, and revising and editing the initial manuscript. H.F., Y.G., and G.X. primarily focused on in-depth revisions of the initial manuscript, providing key feedback and suggestions, and improving the overall content. R.L. was responsible for conducting the supplementary experiments.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no Conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
In this article, there were errors in Tables 8 and 10: Table 8: The asterisk (*) was incorrectly placed on the results for the “Discrete” and “Continuous” models. These results were obtained from our own experiments and should not have been marked as sourced from ML-LJP. The corrected version of the table removes the asterisks from these two models. Table 10: The formatting of the table was incorrect, causing misalignment of data in certain rows. The corrected table ensures proper alignment for improved clarity. The original article has been corrected.
The original online version of this article was revised: " an affiliation has been added to Hui Fang, Yin Guan, and Ge Xu. Acknowlegments section has been added.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Huang, Q., Xia, Y., Long, Y. et al. Prompt4LJP: prompt learning for legal judgment prediction. J Supercomput 81, 420 (2025). https://doi.org/10.1007/s11227-025-06945-0
Accepted:
Published:
DOI: https://doi.org/10.1007/s11227-025-06945-0