Explanation Extraction from Hierarchical Classification Frameworks for Long Legal Documents (2024)

Abstract: Hierarchical classification frameworks have been widely used to process long sequences, especially in the legal domain for predictions from long legal documents. But being black-box models they are unable to explain their predictions making them less reliable for practical applications, more so in the legal domain. In this work, we develop an extractive explanation algorithm for hierarchical frameworks for long sequences based on the sensitivity of the trained model to its input perturbations. We perturb using occlusion and develop Ob-HEx; an Occlusion-based Hierarchical Explanation-extractor. We adapt Ob-HEx to Hierarchical Transformer models trained on long Indian legal texts. And use Ob-HEx to analyze them and extract their explanations for the ILDC-Expert dataset, achieving a minimum gain of 1 point over the previous benchmark on most of our performance evaluation metrics.

## introduction deep-learning-based hierarchical classification models are one of the important techniques for classifying inputs with long sequences and in terms of performance and computational requirements, these hierarchical models have shown to be at par (or better in some cases) with single standalone models which are limited to a certain input length @xcite @xcite . these hierarchical models have been largely used recently in the legal nlp domain, especially because of the long lengths of legal case documents. amongst them, the variants of hierarchical transformers have seen quite a lot of usage @xcite @xcite @xcite @xcite @xcite . one of their major drawbacks is they are black boxes with no explanation for their predictions, and explanations are desired especially for reliability in highstakes fields such as law and medicine. in this work, we develop and test ob-hex, an attribution-based post-hoc explanation @xcite extraction algorithm for these hierarchical classification models, which does not require training and relies only on the trained model and its input. in scenarios where there is a lack of annotation to train an explanation algorithm, an extractive explanation method is a good fit to create interpretations of the predicted judgments, which is synonym to the idea of our explanation algorithm. also, explaining predictions of hierarchical models from long legal documents is a major problem in developing a reliable legal judgment prediction system. in our work, we focus on interpreting the hierarchical predictive models trained on long legal documents, where we rank and extract relevant sentences from the input document that impacted the prediction from the model. these sentences can serve as an explanation, to guide an expert on what led to/triggered a certain prediction. we test ob-hex for analysis and explanation from hierarchical models of @xcite and @xcite on ildc expert @xcite obtaining new benchmarks. ## related work past work on the explainability of deep neural networks (dnn) @xcite used the attributionbased perturbation methods for explanations of images and short-text dnn classification models @xcite @xcite that rely on the input and the dnn model's sensitivity to it, but these methods in our experiments and also of @xcite become complex to adapt to hierarchical dnn models for long documents. in the explanation of hierarchical models, little work has been done of which one is by @xcite where they developed contribution propagation to explain individual image classification. more recently, in the legal domain, some strategies such as occlusion sensitivity, keyword-based matching, extractive summarization, and span lengths were used for explanation extraction from hierarchical transformer models for long documents @xcite . since we aim to extract explanations without training and solely relying on the trained model we develop the idea of attribution-based perturbation/occlusion sensitivity @xcite for hierarchical models for long legal documents, where the sentences/paragraphs are scored hierarchically (using a scoring function) against their absence in the input, and finally chosen according to the desirability of the scores (higher or lower). ## results and discussions analysis of explanation lengths: figure 2 shows the distribution of percentage variation of the explanation length from cjpe to ob-hex, over the whole dataset, and shows that it is not influenced by a few documents. as seen in figure 2 , explanations from cjpe are quite long. the explanation from cjpe is 8.62% longer than ob-hex with @xmath0.15, and 21.4% and 8.9% longer than ob-hex@@xmath1.1 for their top 512 and 265 words respectively. so we compare ob-hex's and cjpe's explanations on three fronts, (a) long explanations, (b) short explanations and (c) brief explanations as shown in figure 2 . this shows that the ranking-performance/length ratio of ob-hex is better than cjpe. this can be attributed to how ob-hex ranks the sentences, where it hierarchically uses the s i ( §3.1) from the previous layers which helps it to relatively measure the importance of each part of the input document. even though cjpe has longer explanation lengths (figure (2)) for long, short and brief explanations, its performance is lower than that of shorter explanations from ob-hex. overall, for the same base hierarchical model, ob-hex gives shorter and better-ranked sentences as explanations than cjpe. since the ob-hex does not train and depends on the hierarchical model we get the same results for every run (except when the hierarchical model is updated with new weights). so we cannot perform a significance test for the runs. but in such situations, the significance could be seen from different test sets, where every expert's explanation is a distinct test set ( §6, §3.5), and for each expert, ob-hex performs better than the baseline on most of the metrics. ## conclusion we explore the problem of explaining a hierarchical model's prediction from long sequences in the legal domain and develop ob-hex based on the perturbations-based occlusion sensitivity of the trained model. for it, we develop a 'normalized weighted occlusion sensitivity score' to hierarchically score parts of a long input that is ranked and used as explanations. we adapt ob-hex to hierarchical transformers of @xcite and @xcite and experiment with ildc expert to achieve new benchmarks over the previous methods. we also used ob-hex to analyze and interpret the focus points for our base model. ob-hex can be generalized and uses a layer-wise loss function (occlusion-sensitivity impact function) to score the occlusions, and uses the "normalized weighted occlusion-sensitivity score" to score the input fragments taking into the impacts from the previous layers. in future, we aim to use ob-hex as a selective-re-training strategy for the trained hierarchical models and analyze its effects on predictions. we also aim to implement ob-hex in other domains using hierarchical frameworks.