Enhancing legal question answering with data generation and knowledge distillation from large language models. Italiani, P., Moro, G., & Ragazzi, L. Artificial Intelligence and Law, July, 2025.
Paper doi abstract bibtex Abstract Legal question answering (LQA) relies on supervised methods to automatically handle law-related queries. These solutions require a substantial amount of carefully annotated data for training, which makes the process very costly. Although large language models (LLMs) show promise in zero-shot QA, their computational demands limit their practical use, making specialized small language models (SLMs) more favorable. Furthermore, the growing interest in synthetic data generation has recently surged, spurred by the impressive generation capabilities of LLMs. This paper presents Ace-Attorney , an LLM distillation approach devised to develop LQA data and supervised models without human annotation. Given a textual prompt, a frozen LLM generates artificial examples that are used as knowledge to train a student SLM with an order of magnitude fewer parameters. Taking into account a realistic retrieval-based scenario to fetch the correct document for answer generation, we propose Selective Generative Paradigm, a novel approach designed to improve retrieval efficacy. Extensive experiments demonstrate the effectiveness and efficiency of distilled models on Syn-LeQA , our human-free synthetic dataset, and a public expert-annotated corpus. Notably, by using only a few dozen training samples, our best SLM achieves LLM-comparable performance with $$\approx $$ ≈ 1200% less CO $$_2$$ 2 emissions. The data and the code to fully reproduce our results are available at https://github.com/disi-unibo-nlp/ace-attorney .
@article{italiani_enhancing_2025,
title = {Enhancing legal question answering with data generation and knowledge distillation from large language models},
issn = {0924-8463, 1572-8382},
url = {https://link.springer.com/10.1007/s10506-025-09463-9},
doi = {10.1007/s10506-025-09463-9},
abstract = {Abstract
Legal question answering (LQA) relies on supervised methods to automatically handle law-related queries. These solutions require a substantial amount of carefully annotated data for training, which makes the process very costly. Although large language models (LLMs) show promise in zero-shot QA, their computational demands limit their practical use, making specialized small language models (SLMs) more favorable. Furthermore, the growing interest in synthetic data generation has recently surged, spurred by the impressive generation capabilities of LLMs. This paper presents
Ace-Attorney
, an LLM distillation approach devised to develop LQA data and supervised models without human annotation. Given a textual prompt, a frozen LLM generates artificial examples that are used as knowledge to train a student SLM with an order of magnitude fewer parameters. Taking into account a realistic retrieval-based scenario to fetch the correct document for answer generation, we propose Selective Generative Paradigm, a novel approach designed to improve retrieval efficacy. Extensive experiments demonstrate the effectiveness and efficiency of distilled models on
Syn-LeQA
, our human-free synthetic dataset, and a public expert-annotated corpus. Notably, by using only a few dozen training samples, our best SLM achieves LLM-comparable performance with
\$\${\textbackslash}approx \$\$
≈
1200\% less CO
\$\$\_2\$\$
2
emissions. The data and the code to fully reproduce our results are available at
https://github.com/disi-unibo-nlp/ace-attorney
.},
language = {en},
urldate = {2026-08-05},
journal = {Artificial Intelligence and Law},
author = {Italiani, Paolo and Moro, Gianluca and Ragazzi, Luca},
month = jul,
year = {2025},
keywords = {SP1, WP4},
}
Downloads: 0
{"_id":"pSh5WYTspaaFj74AP","bibbaseid":"italiani-moro-ragazzi-enhancinglegalquestionansweringwithdatagenerationandknowledgedistillationfromlargelanguagemodels-2025","author_short":["Italiani, P.","Moro, G.","Ragazzi, L."],"bibdata":{"bibtype":"article","type":"article","title":"Enhancing legal question answering with data generation and knowledge distillation from large language models","issn":"0924-8463, 1572-8382","url":"https://link.springer.com/10.1007/s10506-025-09463-9","doi":"10.1007/s10506-025-09463-9","abstract":"Abstract Legal question answering (LQA) relies on supervised methods to automatically handle law-related queries. These solutions require a substantial amount of carefully annotated data for training, which makes the process very costly. Although large language models (LLMs) show promise in zero-shot QA, their computational demands limit their practical use, making specialized small language models (SLMs) more favorable. Furthermore, the growing interest in synthetic data generation has recently surged, spurred by the impressive generation capabilities of LLMs. This paper presents Ace-Attorney , an LLM distillation approach devised to develop LQA data and supervised models without human annotation. Given a textual prompt, a frozen LLM generates artificial examples that are used as knowledge to train a student SLM with an order of magnitude fewer parameters. Taking into account a realistic retrieval-based scenario to fetch the correct document for answer generation, we propose Selective Generative Paradigm, a novel approach designed to improve retrieval efficacy. Extensive experiments demonstrate the effectiveness and efficiency of distilled models on Syn-LeQA , our human-free synthetic dataset, and a public expert-annotated corpus. Notably, by using only a few dozen training samples, our best SLM achieves LLM-comparable performance with $$\\approx $$ ≈ 1200% less CO $$_2$$ 2 emissions. The data and the code to fully reproduce our results are available at https://github.com/disi-unibo-nlp/ace-attorney .","language":"en","urldate":"2026-08-05","journal":"Artificial Intelligence and Law","author":[{"propositions":[],"lastnames":["Italiani"],"firstnames":["Paolo"],"suffixes":[]},{"propositions":[],"lastnames":["Moro"],"firstnames":["Gianluca"],"suffixes":[]},{"propositions":[],"lastnames":["Ragazzi"],"firstnames":["Luca"],"suffixes":[]}],"month":"July","year":"2025","keywords":"SP1, WP4","bibtex":"@article{italiani_enhancing_2025,\n\ttitle = {Enhancing legal question answering with data generation and knowledge distillation from large language models},\n\tissn = {0924-8463, 1572-8382},\n\turl = {https://link.springer.com/10.1007/s10506-025-09463-9},\n\tdoi = {10.1007/s10506-025-09463-9},\n\tabstract = {Abstract\n \n Legal question answering (LQA) relies on supervised methods to automatically handle law-related queries. These solutions require a substantial amount of carefully annotated data for training, which makes the process very costly. Although large language models (LLMs) show promise in zero-shot QA, their computational demands limit their practical use, making specialized small language models (SLMs) more favorable. Furthermore, the growing interest in synthetic data generation has recently surged, spurred by the impressive generation capabilities of LLMs. This paper presents\n Ace-Attorney\n , an LLM distillation approach devised to develop LQA data and supervised models without human annotation. Given a textual prompt, a frozen LLM generates artificial examples that are used as knowledge to train a student SLM with an order of magnitude fewer parameters. Taking into account a realistic retrieval-based scenario to fetch the correct document for answer generation, we propose Selective Generative Paradigm, a novel approach designed to improve retrieval efficacy. Extensive experiments demonstrate the effectiveness and efficiency of distilled models on\n Syn-LeQA\n , our human-free synthetic dataset, and a public expert-annotated corpus. Notably, by using only a few dozen training samples, our best SLM achieves LLM-comparable performance with\n \n \n \\$\\${\\textbackslash}approx \\$\\$\n \n ≈\n \n \n \n 1200\\% less CO\n \n \n \\$\\$\\_2\\$\\$\n \n \n \n 2\n \n \n \n \n \n emissions. The data and the code to fully reproduce our results are available at\n https://github.com/disi-unibo-nlp/ace-attorney\n .},\n\tlanguage = {en},\n\turldate = {2026-08-05},\n\tjournal = {Artificial Intelligence and Law},\n\tauthor = {Italiani, Paolo and Moro, Gianluca and Ragazzi, Luca},\n\tmonth = jul,\n\tyear = {2025},\n\tkeywords = {SP1, WP4},\n}\n\n\n\n\n\n\n\n","author_short":["Italiani, P.","Moro, G.","Ragazzi, L."],"key":"italiani_enhancing_2025","id":"italiani_enhancing_2025","bibbaseid":"italiani-moro-ragazzi-enhancinglegalquestionansweringwithdatagenerationandknowledgedistillationfromlargelanguagemodels-2025","role":"author","urls":{"Paper":"https://link.springer.com/10.1007/s10506-025-09463-9"},"keyword":["SP1","WP4"],"metadata":{"authorlinks":{}}},"bibtype":"article","biburl":"https://bibbase.org/zotero-group/DARE-DigitalLifelongPrevention/5687428","dataSources":["GE2tmzBoAwwNB4hwK"],"keywords":["sp1","wp4"],"search_terms":["enhancing","legal","question","answering","data","generation","knowledge","distillation","large","language","models","italiani","moro","ragazzi"],"title":"Enhancing legal question answering with data generation and knowledge distillation from large language models","year":2025}