[Paper Review] Open-Source LLMs for Text Annotation: A Practical Guide for Model Setting and Fine-Tuning
The study compares open-source LLMs (HuggingChat, FLAN) with ChatGPT and MTurk across 11 text-annotation tasks, exploring zero-shot and few-shot settings with different temperatures, finding open-source LLMs often outperform MTurk and can approach ChatGPT.
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 text annotation applications. We provide a Python notebook facilitating the application of LLMs in text annotation for other researchers.
Motivation & Objective
- Assess open-source LLMs (HuggingChat, FLAN) versus ChatGPT and MTurk on multiple text-annotation tasks.
- Investigate zero-shot and few-shot learning across varying temperature settings.
- Examine how model size and prompts influence annotation accuracy and intercoder agreement.
- Evaluate practical aspects: cost, data protection, and reproducibility of open-source LLMs.
- Provide guidance on model setting choices for text-annotation tasks.
Proposed method
- Compare ChatGPT, HuggingChat, and FLAN across 11 annotation tasks on 4 datasets.
- Test ChatGPT and HuggingChat with zero-shot and several temperature settings; FLAN tested in zero-shot across L/XL/XXL sizes.
- Use two runs per setting to compute intercoder agreement.
- Apply few-shot prompting with Chain-of-Thought (CoT) using two human-annotated examples per class.
- Measure accuracy against trained annotators and MTurk as gold standards.

Experimental results
Research questions
- RQ1Do open-source LLMs outperform crowd workers and approach ChatGPT in text-annotation tasks?
- RQ2How do zero-shot versus few-shot prompting and temperature settings affect performance across tasks?
- RQ3What are the cost and data-protection implications of using open-source LLMs for annotation compared to proprietary models and MTurk?
- RQ4How consistent are model outputs with human annotators as measured by intercoder agreement?
Key findings
- ChatGPT generally achieves the highest average accuracy across tasks.
- Open-source LLMs surpass MTurk in the majority of tasks and, for top models, can outperform ChatGPT in some tasks.
- Top-performing open-source LLMs beat MTurk in nine of eleven tasks and approach ChatGPT in several others.
- Performance varies by dataset and task; no single setting universally maximizes performance for all models.
- Lower temperature settings often improve HuggingChat performance, while FLAN’s larger size does not guarantee better results (FLAN tested only in zero-shot).
- Open-source LLMs offer substantial cost advantages (free to use) and enhanced data protection (no third-party data sharing).

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.