We use a few cookies

Essential cookies keep the library working. With your permission, we'd also like to use analytics to see what's useful and improve the experience. Read our Privacy Policy or Cookie Policy.

Skip to main content
Home/e-Resources/Artificial Intelligence & Machine Learning/Enhancing legal question answering with data generation and knowledge distillation from large language models
PeriodicalsArtificial Intelligence & Machine Learning

Enhancing legal question answering with data generation and knowledge distillation from large language models

Checking your access to this record.

Abstract & Overview

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 .

Cite this record

Paolo Italiani, Gianluca Moro, Luca Ragazzi (2025). Enhancing legal question answering with data generation and knowledge distillation from large language models. Artificial Intelligence and Law. https://doi.org/10.1007/s10506-025-09463-9

Copy in another style

Italiani, P., Moro, G., & Ragazzi, L. (2025). Enhancing legal question answering with data generation and knowledge distillation from large language models. Artificial Intelligence and Law. https://doi.org/10.1007/s10506-025-09463-9
Author names are used as deposited, so check their order before you submit.

Metadata is harvested from open-access indexes and can be incomplete. Check a citation against the published version before relying on it — see our open access & attribution policy.