Table of Contents
Fetching ...

InSaAF: Incorporating Safety through Accuracy and Fairness | Are LLMs ready for the Indian Legal Domain?

Yogesh Tripathi, Raghav Donakanti, Sahil Girhepuje, Ishan Kavathekar, Bhaskara Hanuma Vedula, Gokul S Krishnan, Shreya Goyal, Anmol Goel, Balaraman Ravindran, Ponnurangam Kumaraguru

TL;DR

This work investigates the safety of large language models in the Indian legal domain by formalizing a fairness-accuracy measure, the $LSS_{\beta}$, and constructing a Binary Statutory Reasoning dataset that includes identity-aware prompts. It introduces two open-LMM finetuning strategies (with and without identity) using LoRA to improve the model's legal decision-making while tracking avoidance of catastrophic forgetting via a baseline NL loss. Empirical results on LLaMA and LLaMA-2 show that finetuning increases the $LSS_{\beta}$ score, indicating improved safety and usability for statutory reasoning in a diverse Indian context. The study argues for responsible open-model deployment in critical sectors and provides release-ready code and data to advance further research on safety, fairness, and bias mitigation in legal NLP.

Abstract

Recent advancements in language technology and Artificial Intelligence have resulted in numerous Language Models being proposed to perform various tasks in the legal domain ranging from predicting judgments to generating summaries. Despite their immense potential, these models have been proven to learn and exhibit societal biases and make unfair predictions. In this study, we explore the ability of Large Language Models (LLMs) to perform legal tasks in the Indian landscape when social factors are involved. We present a novel metric, $β$-weighted $\textit{Legal Safety Score ($LSS_β$)}$, which encapsulates both the fairness and accuracy aspects of the LLM. We assess LLMs' safety by considering its performance in the $\textit{Binary Statutory Reasoning}$ task and its fairness exhibition with respect to various axes of disparities in the Indian society. Task performance and fairness scores of LLaMA and LLaMA--2 models indicate that the proposed $LSS_β$ metric can effectively determine the readiness of a model for safe usage in the legal sector. We also propose finetuning pipelines, utilising specialised legal datasets, as a potential method to mitigate bias and improve model safety. The finetuning procedures on LLaMA and LLaMA--2 models increase the $LSS_β$, improving their usability in the Indian legal domain. Our code is publicly released.

InSaAF: Incorporating Safety through Accuracy and Fairness | Are LLMs ready for the Indian Legal Domain?

TL;DR

This work investigates the safety of large language models in the Indian legal domain by formalizing a fairness-accuracy measure, the , and constructing a Binary Statutory Reasoning dataset that includes identity-aware prompts. It introduces two open-LMM finetuning strategies (with and without identity) using LoRA to improve the model's legal decision-making while tracking avoidance of catastrophic forgetting via a baseline NL loss. Empirical results on LLaMA and LLaMA-2 show that finetuning increases the score, indicating improved safety and usability for statutory reasoning in a diverse Indian context. The study argues for responsible open-model deployment in critical sectors and provides release-ready code and data to advance further research on safety, fairness, and bias mitigation in legal NLP.

Abstract

Recent advancements in language technology and Artificial Intelligence have resulted in numerous Language Models being proposed to perform various tasks in the legal domain ranging from predicting judgments to generating summaries. Despite their immense potential, these models have been proven to learn and exhibit societal biases and make unfair predictions. In this study, we explore the ability of Large Language Models (LLMs) to perform legal tasks in the Indian landscape when social factors are involved. We present a novel metric, -weighted LSS_β, which encapsulates both the fairness and accuracy aspects of the LLM. We assess LLMs' safety by considering its performance in the task and its fairness exhibition with respect to various axes of disparities in the Indian society. Task performance and fairness scores of LLaMA and LLaMA--2 models indicate that the proposed metric can effectively determine the readiness of a model for safe usage in the legal sector. We also propose finetuning pipelines, utilising specialised legal datasets, as a potential method to mitigate bias and improve model safety. The finetuning procedures on LLaMA and LLaMA--2 models increase the , improving their usability in the Indian legal domain. Our code is publicly released.
Paper Structure (32 sections, 4 equations, 8 figures, 4 tables)

This paper contains 32 sections, 4 equations, 8 figures, 4 tables.

Figures (8)

  • Figure 1: LLaMA model predicting a different output for two prompts varying by only the identity of the individual (Christian vs. Hindu). Deployment of such LLMs in real-world applications may lead to biased and unfavourable outcomes.
  • Figure 2: The proposed finetuning pipeline for legal safety in LLMs. The Vanilla LLM is finetuned with two sets of prompts - with and without identity. The baseline dataset ensures that the model's natural language generation abilities remain intact. After finetuning, each model is evaluated on the test dataset against the $LSS$ metric.
  • Figure 3: Trends of $F_1$ score, $RFS$ and $LSS$ across various finetuning checkpoints for LLaMA and LLaMA-2 models on $\text{BSR}_\text{with ID}$ and $\text{BSR}_\text{without ID}$. We can see that the $LSS$ progressively increases for each of the models across finetuning checkpoints. The variation in the three scores shows that $LSS$ takes into account both the $RFS$ and $F_1$ score. The Vanilla LLM corresponds to the checkpoint--0, marked separately by ◦ .
  • Figure 4: Heatmap showing the $LSS$ value across various law and identity type for $\text{LLaMA}_{\text{Vanilla}}$. $\text{LLaMA--2}_{\text{Vanilla}}$ demonstrates an $LSS$ of nearly zero, across law and identity types due to its poor $F_1$ score. Prior to finetuning, we observe LLaMA is more effective than LLaMA--2 in Binary Statutory Reasoning task.
  • Figure 5: Effect of $\beta$ on $LSS_{\beta}$ for $\text{LLaMA}_{\text{Vanilla}}$ and $\text{LLaMA--2}_{\text{Vanilla}}$. We set $\beta=1$ for all the previous experiments. As $\beta$ increases, higher weightage gets assigned to the fairness component as compared to the $F_1$ score. Additionally, $LSS_{\beta}$ for $\text{LLaMA--2}_{\text{Vanilla}}$ increases due to a high $RFS$, and for $\text{LLaMA}_{\text{Vanilla}}$ it stays stable because of similar $RFS$ and $F_1$ score.
  • ...and 3 more figures