Enhancing Legal LLMs through Metadata-Enriched RAG Pipelines and Direct Preference Optimization
Suyash Maniyar, Deepali Singh, Rohith Reddy

TL;DR
This paper introduces Metadata Enriched Hybrid RAG and Direct Preference Optimization to improve the grounding, safety, and reliability of legal language models, especially in handling long documents and ensuring accurate outputs.
Contribution
It presents novel retrieval and optimization techniques tailored for legal LLMs, addressing their limitations in long document understanding and safe response generation.
Findings
Enhanced retrieval accuracy in legal corpora
Reduced hallucinations and errors in generated legal texts
Improved safety through better refusal mechanisms
Abstract
Large Language Models (LLMs) perform well in short contexts but degrade on long legal documents, often producing hallucinations such as incorrect clauses or precedents. In the legal domain, where precision is critical, such errors undermine reliability and trust. Retrieval Augmented Generation (RAG) helps ground outputs but remains limited in legal settings, especially with small, locally deployed models required for data privacy. We identify two failure modes: retrieval errors due to lexical redundancy in legal corpora, and decoding errors where models generate answers despite insufficient context. To address this, we propose Metadata Enriched Hybrid RAG to improve document level retrieval, and apply Direct Preference Optimization (DPO) to enforce safe refusal when context is inadequate. Together, these methods improve grounding, reliability, and safety in legal language models.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Artificial Intelligence in Law · Artificial Intelligence in Healthcare and Education
