Generative Legal Document Retrieval in Multi-Law-Code Scenarios
Open Access
- 21 October 2026
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Information Systems
Abstract
Legal document retrieval is a core component of intelligent legal systems. In practice, candidate documents often originate from multiple law codes, each with distinct structures, formats, and textual styles. However, most existing retrieval methods assume all documents belong to a single law code, making them ill-suited to handle the structural diversity and textual inconsistencies inherent in multi-law-code (multi-LC) scenarios. This mismatch leads to degraded retrieval performance in practical deployments. To address this, we propose UniGEAR, a generative retrieval framework for multi-LC legal scenarios. UniGEAR encodes candidate documents with unified hierarchical identifiers that capture both structural and semantic information across heterogeneous law codes. Retrieval is performed via a sequence-to-sequence generation process guided by these identifiers. To construct the identifiers, we design a Residual Quantization Variational Autoencoder (RQ-VAE) enhanced with contrastive learning to align document semantics with legal code structures. For queries, large language models generate structured, multi-step chain-of-thought summaries, producing consistent representations for diverse query styles. A constrained decoding mechanism ensures generated identifiers remain valid within the legal hierarchy, improving precision and interpretability. Experiments on multi-LC benchmarks show UniGEAR significantly outperforms state-of-the-art methods in accuracy and efficiency, while maintaining strong performance in single-LC settings, demonstrating its adaptability and practical value.Keywords
This publication has 28 references indexed in Scilit:
- Adapting Large Language Models by Integrating Collaborative Semantics for Recommendation2024
- Explainable Legal Case Matching via Graph Optimal TransportIEEE Transactions on Knowledge and Data Engineering, 2023
- SAILER: Structure-aware Pre-trained Language Model for Legal Case Retrieval2023
- Bibliometric‐enhanced legal information retrieval: Combining usage and citations as flavors of impact relevanceJournal of the Association for Information Science and Technology, 2023
- Explainable Legal Case Matching via Inverse Optimal Transport-based Rationale Extraction2022
- Autoregressive Image Generation using Residual Quantization2022
- Lawformer: A pre-trained language model for Chinese legal long documentsAI Open, 2021
- Trie: An alternative data structure for data mining algorithmsMathematical and Computer Modelling, 2003
- Innovative techniques for legal text retrievalArtificial Intelligence and Law, 2001
- Context-Dependence in Legal Decision MakingThe Journal of Legal Studies, 1996