Open-Source LLMs for Text Annotation: A Practical Guide for Model Setting and Fine-Tuning
Meysam Alizadeh, Ma\"el Kubli, Zeynab Samei, Shirin Dehghani,, Mohammadmasiha Zahedivafa, Juan Diego Bermeo, Maria Korobeynikova, Fabrizio, Gilardi

TL;DR
This paper evaluates open-source LLMs for political science text classification, demonstrating that fine-tuning enhances their performance to rival proprietary models and providing practical guidance for researchers.
Contribution
It offers a comprehensive assessment of open-source LLMs in text annotation, highlighting the benefits of fine-tuning over zero-shot and few-shot approaches.
Findings
Fine-tuning improves open-source LLM performance.
Fine-tuned open-source LLMs can match or surpass GPT-3.5 in some tasks.
A Python notebook is provided for practical application.
Abstract
This paper studies the performance of open-source Large Language Models (LLMs) in text classification tasks typical for political science research. By examining tasks like stance, topic, and relevance classification, we aim to guide scholars in making informed decisions about their use of LLMs for text analysis. Specifically, we conduct an assessment of both zero-shot and fine-tuned LLMs across a range of text annotation tasks using news articles and tweets datasets. Our analysis shows that fine-tuning improves the performance of open-source LLMs, allowing them to match or even surpass zero-shot GPT-3.5 and GPT-4, though still lagging behind fine-tuned GPT-3.5. We further establish that fine-tuning is preferable to few-shot training with a relatively modest quantity of annotated text. Our findings show that fine-tuned open-source LLMs can be effectively deployed in a broad spectrum of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · FinTech, Crowdfunding, Digital Finance · Privacy-Preserving Technologies in Data
MethodsRefunds@Expedia|||How do I get a full refund from Expedia? · 15 Ways to Contact How can i speak to someone at Delta Airlines · Attention Is All You Need · Label Smoothing · Adam · Position-Wise Feed-Forward Layer · Dropout · Dense Connections · Absolute Position Encodings · Softmax
