From Statement of Facts to Statutory Provisions - Efficient Retrieval of Relevant Legislation
摘要
Legal question-answering systems play a crucial role in enhancing access to justice by providing both citizens and legal professionals with accurate interpretations of the law. However, existing AI-based legal models struggle with processing layperson inputs, mapping them to formal legal language, and ensuring robustness across different languages and jurisdictions. This study explores the use of retrieval-augmented generation (RAG) systems to address Polish legal queries, with a focus on improving information retrieval components. We evaluate several pre-trained retrieval models across four legal datasets to identify the most effective architectures. Subsequently, we fine-tune the best-performing models to determine which dataset types yield the greatest improvements when addressing lay-language questions. Our results demonstrate that fine-tuning on provision-based datasets significantly enhances retrieval accuracy and contextual relevance. Conversely, datasets with high lexical overlap between questions and provisions offer limited benefit when models are applied to layperson inputs—challenging the common practice of using large language models to generate training questions. In response, we propose a novel dataset construction method based on legal judgments, which performs nearly as well as manually annotated datasets containing layperson queries.