Using Large Language Models to Support Thematic Analysis in Empirical Legal Studies

10 Pages Posted: 30 Nov 2023

See all articles by Jakub Drápal

Jakub Drápal

Charles University in Prague; Faculty of Law, Charles University; Academy of Sciences of the Czech Republic - Institute of State and Law; Leiden University

Hannes Westermann

University of Montreal - Cyberjustice Laboratory

Jaromir Savelka

Carnegie Mellon University

Date Written: October 30, 2023

Abstract

Thematic analysis and other variants of inductive coding are widely used qualitative analytic methods within empirical legal studies (ELS). We propose a novel framework facilitating effective collaboration of a legal expert with a large language model (LLM) for generating initial codes (phase 2 of thematic analysis), searching for themes (phase 3), and classifying the data in terms of the themes (to kick-start phase 4). We employed the framework for an analysis of a dataset~($n=785$) of facts descriptions from criminal court opinions regarding thefts. The goal of the analysis was to discover classes of typical thefts. Our results show that the LLM, namely OpenAI's GPT-4, generated reasonable initial codes, and it was capable of improving the quality of the codes based on expert feedback. They also suggest that the model performed well in zero-shot classification of facts descriptions in terms of the themes. Finally, the themes autonomously discovered by the LLM appear to map fairly well to the themes arrived at by legal experts. These findings can be leveraged by legal researchers to guide their decisions in integrating LLMs into their thematic analyses, as well as other inductive coding projects.

Keywords: Thematic analysis; empirical legal studies; criminal law; large language models; generative pre-trained transformers; GPT-4

Suggested Citation

Drápal, Jakub and Westermann, Hannes and Savelka, Jaromir, Using Large Language Models to Support Thematic Analysis in Empirical Legal Studies (October 30, 2023). Frontiers of Artificial Intelligence and Applications, Forthcoming, Charles University in Prague Faculty of Law Research Paper, University of Montreal Faculty of Law Research Paper, Available at SSRN: https://ssrn.com/abstract=4617116 or http://dx.doi.org/10.2139/ssrn.4617116

Jakub Drápal (Contact Author)

Charles University in Prague ( email )

Prague
Czech Republic

Faculty of Law, Charles University ( email )

Nám. Curieových 7
Praha 1, 11640
Czech Republic

Academy of Sciences of the Czech Republic - Institute of State and Law ( email )

Národní 18
Praha 1, 11600
Czech Republic

Leiden University ( email )

Postbus 9500
Leiden, Zuid Holland 2300 RA
Netherlands

Hannes Westermann

University of Montreal - Cyberjustice Laboratory ( email )

Montreal
Canada

Jaromir Savelka

Carnegie Mellon University ( email )

Pittsburgh, PA 15213-3890
United States

Do you have a job opening that you would like to promote on SSRN?

Paper statistics

Downloads
222
Abstract Views
1,106
Rank
296,239
PlumX Metrics