{"title":"Investigating legal question generation using large language models","authors":"Aniket Deroy, Kripabandhu Ghosh, Saptarshi Ghosh","doi":"10.1007/s10506-025-09452-y","DOIUrl":null,"url":null,"abstract":"<div><p>We propose the task of <i>legal question generation</i> (QG) as an application in Legal NLP. Specifically, the task is to generate a question, given a context and an optional keyword. We create the first dataset for the QG task in the legal domain, called <i>LegalQ</i>, consisting of 2023 <context, question> pairs spanning the legal systems of multiple countries, and multiple languages. We then use this dataset to benchmark several Large Language Models (LLMs) including Turbo-GPT-3.5, GPT-4, Llama2-70b, Llama2-13b, and Aalap-Mistral-7b (a legal domain-specific LLM). We also fine-tune several open-source LLMs such as T5, BART, Pegasus, and Flan-T5, which helps to improve results over zero-shot prompting of LLMs. We also use the idea of in-context learning (via few-shot examples) to generate questions of varying types and difficulty levels. Furthermore, we introduce a novel domain-specific prompting strategy based on chain-of-thoughts prompting for question generation. Further, we perform Bloom Taxonomy analysis of the questions generated by the LLMs, thereby showing that ‘understanding’ and ‘remembering’ are the two most dominant types of questions generated by the LLMs. Human evaluation of the generated questions shows promise in terms of generating grammatically correct, relevant, appropriate, complex, and novel questions. Finally, we analyze the incomplete or unanswerable generated questions to find possible reasons for these issues.</p></div>","PeriodicalId":51336,"journal":{"name":"Artificial Intelligence and Law","volume":"34 3","pages":"775 - 813"},"PeriodicalIF":5.3000,"publicationDate":"2025-04-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Artificial Intelligence and Law","FirstCategoryId":"94","ListUrlMain":"https://link.springer.com/article/10.1007/s10506-025-09452-y","RegionNum":2,"RegionCategory":"社会学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE","Score":null,"Total":0}
引用次数: 0
Abstract
We propose the task of legal question generation (QG) as an application in Legal NLP. Specifically, the task is to generate a question, given a context and an optional keyword. We create the first dataset for the QG task in the legal domain, called LegalQ, consisting of 2023 <context, question> pairs spanning the legal systems of multiple countries, and multiple languages. We then use this dataset to benchmark several Large Language Models (LLMs) including Turbo-GPT-3.5, GPT-4, Llama2-70b, Llama2-13b, and Aalap-Mistral-7b (a legal domain-specific LLM). We also fine-tune several open-source LLMs such as T5, BART, Pegasus, and Flan-T5, which helps to improve results over zero-shot prompting of LLMs. We also use the idea of in-context learning (via few-shot examples) to generate questions of varying types and difficulty levels. Furthermore, we introduce a novel domain-specific prompting strategy based on chain-of-thoughts prompting for question generation. Further, we perform Bloom Taxonomy analysis of the questions generated by the LLMs, thereby showing that ‘understanding’ and ‘remembering’ are the two most dominant types of questions generated by the LLMs. Human evaluation of the generated questions shows promise in terms of generating grammatically correct, relevant, appropriate, complex, and novel questions. Finally, we analyze the incomplete or unanswerable generated questions to find possible reasons for these issues.
期刊介绍:
Artificial Intelligence and Law is an international forum for the dissemination of original interdisciplinary research in the following areas: Theoretical or empirical studies in artificial intelligence (AI), cognitive psychology, jurisprudence, linguistics, or philosophy which address the development of formal or computational models of legal knowledge, reasoning, and decision making. In-depth studies of innovative artificial intelligence systems that are being used in the legal domain. Studies which address the legal, ethical and social implications of the field of Artificial Intelligence and Law.
Topics of interest include, but are not limited to, the following: Computational models of legal reasoning and decision making; judgmental reasoning, adversarial reasoning, case-based reasoning, deontic reasoning, and normative reasoning. Formal representation of legal knowledge: deontic notions, normative
modalities, rights, factors, values, rules. Jurisprudential theories of legal reasoning. Specialized logics for law. Psychological and linguistic studies concerning legal reasoning. Legal expert systems; statutory systems, legal practice systems, predictive systems, and normative systems. AI and law support for legislative drafting, judicial decision-making, and
public administration. Intelligent processing of legal documents; conceptual retrieval of cases and statutes, automatic text understanding, intelligent document assembly systems, hypertext, and semantic markup of legal documents. Intelligent processing of legal information on the World Wide Web, legal ontologies, automated intelligent legal agents, electronic legal institutions, computational models of legal texts. Ramifications for AI and Law in e-Commerce, automatic contracting and negotiation, digital rights management, and automated dispute resolution. Ramifications for AI and Law in e-governance, e-government, e-Democracy, and knowledge-based systems supporting public services, public dialogue and mediation. Intelligent computer-assisted instructional systems in law or ethics. Evaluation and auditing techniques for legal AI systems. Systemic problems in the construction and delivery of legal AI systems. Impact of AI on the law and legal institutions. Ethical issues concerning legal AI systems. In addition to original research contributions, the Journal will include a Book Review section, a series of Technology Reports describing existing and emerging products, applications and technologies, and a Research Notes section of occasional essays posing interesting and timely research challenges for the field of Artificial Intelligence and Law. Financial support for the Journal of Artificial Intelligence and Law is provided by the University of Pittsburgh School of Law.