CatLLM: An Open-Source Pipeline for Coding Open-Ended Text in Experiments

Date:

Session: AI 4: Advice & Algorithm Aversion.

Experiments generate open-ended text that rarely gets analyzed: strategy explanations, free-form justifications, debrief responses, chat logs from communication treatments. Coding it by hand is slow and expensive, and asking a language model ad hoc gives results that are hard to reproduce or validate. I present CatLLM, an open-source pipeline with Python, R, and Stata interfaces that covers the full workflow. Saturation prompting discovers categories by repeated extraction and reports how reliably the same taxonomy recurs across runs (0.93 consistency against 0.79 for a single pass). Classification then assigns responses to those categories with any of nine providers, or with local open-weight models when data cannot leave the researcher’s machine, and multi-model ensembles report agreement for each response. Validated against trained human coders, the pipeline agrees on about 97% of straightforward items and 88 to 91% of complex interpretive ones. The talk walks through a worked example, the recommended settings, where the pipeline fails, and what it costs to run.