A hybrid architecture for legal reasoning : integrating retrieval-augmented generation and prompt compliance filtering

By: Call Number: AIT PJPR PMDS no.25-04 Contributor(s): Material type: TextSeries: Asian Institute of Technology. Project ; no. PJPR PMDS-25-04Publication details: Pathum Thani, Thailand : Asian Institute of Technology, 2025Description: 46 leaves : ill.+ 1 online resourceSubject(s): Online resources: Dissertation note: Master of Science (Professional) - Asian Institute of Technology, 2025 Summary: In the evolving landscape of legal technology, the application of Large Language Models (LLMs) presents new opportunities for automating legal reasoning, document understanding, and case-based decision support. However, traditional LLMs often lack factual grounding and suffer from hallucinations, posing risks in high-stakes legal contexts. To address these challenges, this thesis proposes a hybrid architecture that integrates Retrieval-Augmented Generation (RAG) with a prompt compliance filtering mechanism to build a robust and trustworthy legal assistant system.The architecture leverages a combination of cutting-edge LLMs, including GPT-4 (OpenAI, 2024), Qwen3 (Team, 2025), and Llama (Llama Team, 2024), as the generative core. These models are dynamically augmented with context retrieved from a comprehensive legal corpus comprising statutes, regulations, and historical legal cases. A dense retriever module queries relevant documents from the legal knowledge base, which are then combined with the user{u2019}s prompt to form a retrieval-augmented input for the generator. To ensure domain-specific compliance and output integrity, a template-based prompt-validation gateway is applied at both the input and output stages. This layer enforces structured syntax, filters unsafe or incomplete queries, and verifies legal accuracy and tone in the generated responses.The system is evaluated on tasks such as legal case prediction, statute-based question answering, and legal argument synthesis. Experimental results demonstrate that the hybrid approach improves factual consistency, legal relevance, and prompt adherence compared to baseline LLM outputs. The architecture is modular, scalable, and adaptable to multilingual legal systems, positioning it as a practical framework for future intelligent legal assistants.
Tags from this library: No tags from this library for this title. Log in to add tags.
Star ratings
    Average rating: 0.0 (0 votes)
Holdings
Cover image Item type Current library Home library Collection Shelving location Call number Materials specified Vol info URL Copy number Status Notes Date due Barcode Item holds Item hold queue priority Course reserves
67-Electronic Resource Asian Institute of Technology Library Archives AIT PJPR PMDS no.25-04 (Browse shelf(Opens below)) 1 Not for loan

A project report submitted in partial fulfillment of the requirements for the Degree of Master of Science (Professional) in Data Science and Artificial Intelligence Applications

Master of Science (Professional) - Asian Institute of Technology, 2025

In the evolving landscape of legal technology, the application of Large Language Models (LLMs) presents new opportunities for automating legal reasoning, document understanding, and case-based decision support. However, traditional LLMs often lack factual grounding and suffer from hallucinations, posing risks in high-stakes legal contexts. To address these challenges, this thesis proposes a hybrid architecture that integrates Retrieval-Augmented Generation (RAG) with a prompt compliance filtering mechanism to build a robust and trustworthy legal assistant system.The architecture leverages a combination of cutting-edge LLMs, including GPT-4 (OpenAI, 2024), Qwen3 (Team, 2025), and Llama (Llama Team, 2024), as the generative core. These models are dynamically augmented with context retrieved from a comprehensive legal corpus comprising statutes, regulations, and historical legal cases. A dense retriever module queries relevant documents from the legal knowledge base, which are then combined with the user{u2019}s prompt to form a retrieval-augmented input for the generator. To ensure domain-specific compliance and output integrity, a template-based prompt-validation gateway is applied at both the input and output stages. This layer enforces structured syntax, filters unsafe or incomplete queries, and verifies legal accuracy and tone in the generated responses.The system is evaluated on tasks such as legal case prediction, statute-based question answering, and legal argument synthesis. Experimental results demonstrate that the hybrid approach improves factual consistency, legal relevance, and prompt adherence compared to baseline LLM outputs. The architecture is modular, scalable, and adaptable to multilingual legal systems, positioning it as a practical framework for future intelligent legal assistants.

There are no comments on this title.

to post a comment.
คัดลอกแล้ว!