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.
No takes yet. Share an insight, caveat, or question.
Qin et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: