GESIS Training Courses
user_jsdisabled
Search

Scientific Coordination

Verena Kunz

Administrative Coordination

Janina Götsche

Adapters: Lightweight Machine Learning for Social Science Research

About
Location:
hybrid (online via Zoom / Unter Sachsenhausen 6-8)
 
General Topics:
Course Level:
Format:
Software used:
Duration:
Language:
Fees:
Students: 330 €
Academics: 495 €
Commercial: 990 €
 
Keywords
Additional links
Lecturer(s): Julia Romberg, Vigneshwaran Shankaran, Maximilian Maurer

About the lecturer - Julia Romberg

About the lecturer - Vigneshwaran Shankaran

About the lecturer - Maximilian Maurer

Course description

The significant progress in computational models for text analysis offers immense potential for social science research (e.g., for large-scale analysis of opinions or harmful language). The rich statistical language representations captured in pre-trained modern language models (e.g., BERT, Llama-2/3, and GPT-3/4) provide an excellent starting point for use-case specific models. Most commonly, the pre-trained models are adapted to the task at hand through fine-tuning, a technique which involves further training of the models on labeled (also referred to as annotated or coded) data.
 
However, fine-tuning is costly given the enormous number of parameters that modern language models consist of (e.g., up to 340 million for BERT, up to 65 billion for Llama-2, up to trillions for GPT-4). Optimizing the full set of parameters for a new application task requires substantial computing resources, significant time, and enough training data. The energy-intensive process also raises environmental concerns. All these reasons can pose severe restrictions to social science scholars in leveraging the enormous potential of modern language models.
 
A more parameter-efficient solution for addressing these challenges is the use of adapter modules. Instead of fine-tuning the entire model, only a small number of newly introduced parameters are adapted for the specific application task. This approach not only significantly reduces complexity but also demonstrates performance that is typically on par with that of their fully-tuned counterparts.
 
In this course, we provide an introduction to adapters. After a brief recap of modern language model architectures, we go into detail about how adapters function, explore different types of adapters, and discuss their use cases. Alongside the theoretical foundations, participants will engage with practical Python-based implementation examples through hands-on tutorials using real digital behavior datasets. Participants will also have the possibility to discuss their own applications with the instructors.
 
 
Organizational Structure of the Course
The course will take place in a hybrid setting with participants on-site and online. In the morning sessions, we will cover the theoretical foundations and showcase the practical implementation using Python notebooks. In the afternoon sessions, participants will have the opportunity to apply the learned content autonomously during lab sessions with hands-on exercises. Participants can reach out for support to the lecturers at any time during the practical sessions. While we provide tasks and data for the lab sessions on day 1 and day 2, on day 3, participants have the option to transfer the gained knowledge onto their own research questions. This will be accompanied by individual consultation slots with the lecturers.


Target group

You will find the course useful if:
  • You work on or aim to apply state-of-the-art computational methods for text analysis
  • You have a background in Computational Social Science or related fields
  • You feel constrained by the computational costs of applying language models to your research / fine-tuning models for use with your data and target task


  • Learning objectives

    By the end of the course you will:
  • Have a solid understanding of the problems and challenges of fine-tuning pre-trained large language models for your own analyses
  • Gain both theoretical and practical understanding of the concept of adapters and how they enable lightweight and parameter-efficient machine learning with transformer models
  • Be able to apply adapters to language models in Python to address your own research question


  • Prerequisites

  • Solid knowledge of programming in Python (e.g., data processing with pandas, basic syntax) (required)
  • First experiences and conceptual understanding of machine learning (e.g., classification) (required)
  • Basic understanding of natural language processing (e.g., preprocessing with tokenization) and language models (e.g., BERT) (required)
  • Familiarity with the Hugging Face ecosystem (recommended)
  •  
    Software Requirements
    We are planning to use Google Colab (free version) for the practical parts of the course for GPU access and to avoid system-specific troubleshooting. For this, the participants need a Google account. If participants choose not to use Google Colab (not recommended), they need to install the Transformers library on Python 3.8+ as described in https://huggingface.co/docs/transformers/installation (CPU-support only option if no GPU is locally available) and the Adapters library as described in https://github.com/adapter-hub/adapters.


    Schedule

    Recommended readings