GenAI for Sociology#

Welcome to the computational companion for SOC-GA 3000: Interdisciplinary Seminar on Generative AI in Sociology at NYU.

About This Course#

This course introduces students to Generative AI (GenAI) technologies and their applications in sociological research. We focus on methods: what GenAI is, how it works, and how to use it for rigorous social science inquiry.

Course Goals#

  • Build foundational fluency in Python and computational reasoning to implement GenAI models

  • Understand how LLMs work and how they can be applied in sociological research

  • Critically assess strengths, limitations, and ethical implications of generative AI in research contexts

  • Design, implement, and evaluate LLM-driven sociological research projects

Course Schedule#

Week 1: Introduction to LLMs and Social Science#

What LLMs are and why they matter for sociological research; opportunities and pitfalls.

Week 2: Foundations: Embeddings and Representations#

How text is represented as vectors: static embeddings, geometric interpretation, and cultural meanings.

Week 3: Toward LLMs: Transformers and Contextual Models#

The transformer architecture, self-attention, and contextual embeddings; sociological applications.

Week 4: LLMs for Annotation I - Automated Content Analysis#

Using LLMs to annotate political text at scale; zero-shot and few-shot classification; measurement error.

Week 5: LLMs for Annotation II: Qualitative Coding and Thematic Analysis#

LLMs for qualitative coding: inductive and deductive thematic analysis, hybrid human-LLM workflows, and validation.

Week 6: LLMs for Annotation III: Prompt Engineering and Validation#

Advanced prompt-engineering strategies and robust validation for LLM-based annotation.

Week 7: LLMs for Synthetic Data I: Simulating Survey Respondents#

Using LLMs to simulate survey respondents; algorithmic fidelity and bias in synthetic samples (“silicon sampling”).

Week 8: LLMs for Synthetic Data II - Behavioral Tests#

Interactive experiments: personalized persuasion, microtargeting, belief-change dialogues, and group dynamics.

Week 9: LLMs for Simulation I: Generative Agents#

Architectures for generative agents and scaling social simulations with LLMs.

Week 10: LLMs for Simulation II: Experiments#

Predicting experimental outcomes with LLMs; modeling human cognition; LLMs as experimental stand-ins.

Week 11: LLMs and Social Interaction#

Why socially aware LLMs require rich interaction datasets; bridging interactionist sociology and AI.

About the Notebooks#

Each computational notebook in this book includes:

  • Clear learning objectives for the session

  • Setup instructions for Google Colab and local environments

  • Working code examples demonstrating core techniques

  • Exercises to reinforce concepts

  • Further readings and resources

How to Use This Book#

Running Locally#

  1. Clone or download the repository

  2. Install Python 3.8+ and dependencies: pip install -r requirements.txt

  3. Launch Jupyter: jupyter notebook

  4. Open the desired .ipynb file

Prerequisites#

  • Basic Python programming: variables, functions, loops, conditionals

  • Familiarity with NumPy and pandas for data manipulation

  • Basic ML concepts: training/testing, classification, evaluation

  • (Optional) OpenAI API key for Weeks 4-6 (required for some exercises)

Required Textbook#

Allen B. Downey, Think Python: How to Think Like a Computer Scientist, 3rd Edition. Green Tea Press. Available free online: https://greenteapress.com/wp/think-python-3rd-edition/

AI Use Statement#

This course is about generative AI—so AI use is not just permitted, it’s expected. But ask yourself: am I using this as a tool to augment my learning, or as a substitute for thinking?

Language models are powerful technologies that can enhance research at unprecedented scale and pace. They can also be a crutch that prevents you from developing the fluency and deep understanding required to excel in this field.

The question is: Are you building the intellectual muscles needed to operate in this world, or are you outsourcing the hard work?

Assignments in this course are primarily lab-based and collaborative. You’ll work through notebooks together, check each other’s code, and explain your implementations. Don’t outsource your learning—you’ll only shortchange yourself.

Acknowledgments#

This book builds on open-source tools and cutting-edge research:

  • Hugging Face Transformers for pretrained models

  • OpenAI API for large language model access

  • scikit-learn for ML utilities

  • Jupyter Book for publishing

Special thanks to the researchers whose work informs this curriculum (full citations in each chapter).

License#

  • Code: MIT License

  • Content: CC BY 4.0

Getting Started#

Ready to begin? Start with the first computational notebook:

→ Week 4: LLMs for Annotation I - Automated Content Analysis

(Weeks 1-3 provide theoretical foundations covered in lecture; computational labs begin in Week 4.)