This hands-on three-day online workshop equips PhD students with the practical skills to fine-tune open-source LLMs for custom text analysis tasks, combining applied coding in Python and Google Colab with critical reflection on methodological and ethical research standards.
What Is This Course About?
This compact three-day online workshop is an intensive, hands-on seminar designed specifically for PhD students interested in fine-tuning open-source large language models (LLMs) for custom text analysis tasks. It provides practical training in parameter-efficient methods such as LoRA, covering the full pipeline from dataset preparation to model evaluation, using R, Python, and Google Colab. Throughout the workshop, participants will engage in applied coding exercises while also reflecting on the methodological and ethical implications of using fine-tuned models in research.
Learning Goals
After this course you will:
- Understand the core concepts of open-source large language models and be able to judge when fine-tuning is appropriate for your research
- Be able to apply parameter-efficient techniques such as LoRA (Low-Rank Adaptation) to fine-tune open-source LLMs for specific text analysis tasks
- Know how to prepare datasets, configure hyperparameters, and run full fine-tuning pipelines using Python and Google Colab
- Be familiar with appropriate metrics and methods to evaluate fine-tuned model performance and integrate fine-tuned models into your research workflow
Recommended Readings for the Course
- Alizadeh, M., Kubli, M., Samei, Z., Dehghani, S., Zahedivafa, M., Bermeo, J. D., Korobeynikova, M., & Gilardi, F. (2025). Open-source LLMs for text annotation: A practical guide for model setting and fine-tuning. Journal of Computational Social Science, 8(1), 1–25.
- Benoit, K., De Marchi, S., Laver, C., Laver, M., & Ma, J. (Forthcoming). Beyond text-as-data to natural language understanding: Qualitative analysis of political texts using LLMs. American Journal of Political Science.
- Bucher, M. J. J., & Martini, M. (2024). Fine-tuned ‘small’ LLMs (still) significantly outperform zero-shot generative AI models in text classification. arXiv preprint. https://doi.org/10.48550/arXiv.2406.08660
- Maerz, Seraphine F., Schafer Dean G., and Carsten Q. Schneider. 2026. “Listening to Leaders: Illiberal Speech as a Symptome of Democratic Decline", accepted for publication in Comparative Political Studies
- Halterman, A., & Keith, K. A. (2025). Codebook LLMs: Evaluating LLMs as measurement tools for political science concepts. Political Analysis, 1–17.
- Le Mens, G., & Gallego, A. (2025). Positioning political texts with large language models by asking and averaging. Political Analysis, 1–9.
Assignments for the Course
2 coding challenges to be completed in class
Schedule
Pre-Course Preparation (available 3 weeks before course start)
• Asynchronous materials (approx. 90 minutes total):
o Set-up instructions for R, RStudio, Google Colab, Ollama, and required packages
o Pre-reading on open-source LLMs and fine-tuning for text annotation
o Students are expected to complete these materials before Day 1.
o Materials and readings will be made available on Moodle.
Day 1: Foundations of open-source LLMs and fine-tuning
• 90’ synchronous lab
o Introduction to fine-tuning and workshop overview
o Prompt engineering basics and when to fine-tune vs. prompt
• 45’ office hour
o Live Q&A and troubleshooting set-up (R, Colab, Ollama)
• 90’ asynchronous materials (flexible, but before group learning)
o The open-source LLM landscape: capabilities, model families, and use cases
• 60’ independent small group learning (with TA)
o Reflection on potential fine-tuning use cases in participants’ own research
• 30’ office hour (with TA)
o Q&A and troubleshooting set-up
Day 2: Building datasets and the fine-tuning pipeline
• 90’ synchronous lab
o Dataset building and data preparation for fine-tuning
o Hands-on session: preparing a labelled dataset
• 45’ office hour
o Live Q&A and help with dataset preparation
• 90’ asynchronous materials (flexible, but before group learning)
o Parameter-efficient fine-tuning (PEFT) and LoRA fundamentals
• 60’ independent small group learning (with TA)
o Coding Challenge 1: building your own labelled dataset
• 30’ office hour (with TA)
o Q&A and feedback on Coding Challenge 1
Day 3: Applied fine-tuning, evaluation, and integration
• 90’ synchronous lab
o Hands-on session: running a PEFT/LoRA fine-tuning pipeline in Google Colab
o Hyperparameter tuning in practice
• 45’ office hour
o Live Q&A and help with fine-tuning issues
• 90’ asynchronous materials (flexible, but before group learning)
o Evaluating fine-tuned models: metrics, validation, and responsible reporting
• 60’ independent small group learning (with TA)
o Coding Challenge 2: run a full fine-tuning pipeline and evaluate model performance
• 30’ office hour (with TA)
o Q&A and feedback on Coding Challenge 2
In addition, students should plan for sufficient time to read the assigned literature in advance.
Who Is Your Instructor?
Seraphine F. Maerz is a political scientist and Senior Lecturer at the University of Melbourne, specializing in computational social science and quantitative methods. Her research focuses on democracy, authoritarianism, and political communication, with a methodological emphasis on text analysis and the application of large language models in political research. See her GoogleScholar profile for recent publications. She is co-founder of QuantLab and co-developer of quallmer. More information and regular updates about her work can be found on her website at seraphinem.github.io. Connect with her via LinkedIn.
Dr Seraphine Maerz
Lecturer komex




