  Legal document retrieval and judgment prediction are crucial tasks in
intelligent legal systems. In practice, determining whether two documents share
the same judgments is essential for establishing their relevance in legal
retrieval. However, existing legal retrieval studies either ignore the vital
role of judgment prediction or rely on implicit training objectives, expecting
a proper alignment of legal documents in vector space based on their judgments.
Neither approach provides explicit evidence of judgment consistency for
relevance modeling, leading to inaccuracies and a lack of transparency in
retrieval. To address this issue, we propose a law-guided method, namely GEAR,
within the generative retrieval framework. GEAR explicitly integrates judgment
prediction with legal document retrieval in a sequence-to-sequence manner.
Experiments on two Chinese legal case retrieval datasets show the superiority
of GEAR over state-of-the-art methods while maintaining competitive judgment
prediction performance. Moreover, we validate its robustness across languages
and domains on a French statutory article retrieval dataset.
