Saved in:
Bibliographic Details
Main Authors: Lupo, Lorenzo, Magnusson, Oscar, Hovy, Dirk, Naurin, Elin, Wängnerud, Lena
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2311.11844
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929476939546624
author Lupo, Lorenzo
Magnusson, Oscar
Hovy, Dirk
Naurin, Elin
Wängnerud, Lena
author_facet Lupo, Lorenzo
Magnusson, Oscar
Hovy, Dirk
Naurin, Elin
Wängnerud, Lena
contents Recent advances in large language models (LLMs) like GPT-3.5 and GPT-4 promise automation with better results and less programming, opening up new opportunities for text analysis in political science. In this study, we evaluate LLMs on three original coding tasks involving typical complexities encountered in political science settings: a non-English language, legal and political jargon, and complex labels based on abstract constructs. Along the paper, we propose a practical workflow to optimize the choice of the model and the prompt. We find that the best prompting strategy consists of providing the LLMs with a detailed codebook, as the one provided to human coders. In this setting, an LLM can be as good as or possibly better than a human annotator while being much faster, considerably cheaper, and much easier to scale to large amounts of text. We also provide a comparison of GPT and popular open-source LLMs, discussing the trade-offs in the model's choice. Our software allows LLMs to be easily used as annotators and is publicly available: https://github.com/lorelupo/pappa.
format Preprint
id arxiv_https___arxiv_org_abs_2311_11844
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Towards Human-Level Text Coding with LLMs: The Case of Fatherhood Roles in Public Policy Documents
Lupo, Lorenzo
Magnusson, Oscar
Hovy, Dirk
Naurin, Elin
Wängnerud, Lena
Computation and Language
Computers and Society
J.4; I.2
Recent advances in large language models (LLMs) like GPT-3.5 and GPT-4 promise automation with better results and less programming, opening up new opportunities for text analysis in political science. In this study, we evaluate LLMs on three original coding tasks involving typical complexities encountered in political science settings: a non-English language, legal and political jargon, and complex labels based on abstract constructs. Along the paper, we propose a practical workflow to optimize the choice of the model and the prompt. We find that the best prompting strategy consists of providing the LLMs with a detailed codebook, as the one provided to human coders. In this setting, an LLM can be as good as or possibly better than a human annotator while being much faster, considerably cheaper, and much easier to scale to large amounts of text. We also provide a comparison of GPT and popular open-source LLMs, discussing the trade-offs in the model's choice. Our software allows LLMs to be easily used as annotators and is publicly available: https://github.com/lorelupo/pappa.
title Towards Human-Level Text Coding with LLMs: The Case of Fatherhood Roles in Public Policy Documents
topic Computation and Language
Computers and Society
J.4; I.2
url https://arxiv.org/abs/2311.11844