Back close

A Reusable Prompting Framework for Applying Large Language Models to Legal Tasks

Publication Type : Journal Article

Publisher : Institute of Electrical and Electronics Engineers (IEEE)

Source : IEEE Access

Url : https://doi.org/10.1109/ACCESS.2026.3650941

Keywords : Law;Cognition;Large language models;Accuracy;Contracts;Artificial intelligence;Retrieval augmented generation;Prompt engineering;Reviews;Benchmark testing;Chain-of-thought;legal AI;prompt engineering;retrieval-augmented generation;role-based prompting

Campus : Chennai

School : School of Computing

Department : Computer Science and Engineering

Year : 2026

Abstract :

Large language models are increasingly used for legal research, drafting, and analysis, but their answers can be inconsistent, hard to verify, and sensitive to small changes in prompt wording. This paper introduces a structured prompting framework for applying large language models to five core legal tasks: statutory interpretation, contract review, case summarization, legal question-answering, and clause extraction. The framework helps draft prompts using task-specific templates, role-based instructions, example-based guidance, chain-of-thought reasoning and context-layered reasoning, and is paired with an evaluation that measures exact match, F1, ROUGE-L, macro F1, and a legal hallucination rate defined through a rubric for unsupported or incorrect legal claims. To contextualize these results, a Retrieval-Augmented Generation baseline is implemented and evaluated on the same tasks. Statistical analysis over multiple runs, using mean, variance, standard deviation, and 95% confidence intervals, indicates that the best model–prompt combinations are both strong and stable. The findings offer practical guidance on which structured prompting strategies are most effective for different categories of legal tasks. 

Cite this Research Publication : Suthir Sriram, Nivethitha Vijayaraj, G. Rajiv Krishna, S. Vijay Bhanu, Gaurav Choudhary, Thangavel Murugan, A Reusable Prompting Framework for Applying Large Language Models to Legal Tasks, IEEE Access, Institute of Electrical and Electronics Engineers (IEEE), 2026, https://doi.org/10.1109/ACCESS.2026.3650941

Admissions Apply Now