Skip to main content
QUICK REVIEW

[论文解读] Codebook LLMs: Evaluating LLMs as Measurement Tools for Political Science Concepts

Andrew Halterman, Katherine A. Keith|arXiv (Cornell University)|Jul 15, 2024
Digital Rights Management and SecurityComputer Science被引用 3
一句话总结

本文提出了一种基于代码本-概念标签假设的方法,以改进政治科学中基于大语言模型(LLM)的测量方法,主张LLM必须严格遵循详细的代码本定义,而非依赖通用的标签含义。基于Mistral 7B Instruct模型的实验表明,指令微调显著提升了性能(F1从0.53提升至0.76),而代码本重构仅带来小幅改进,凸显了对LLM合规性检查及半结构化代码本格式的必要性。

ABSTRACT

Codebooks -- documents that operationalize concepts and outline annotation procedures -- are used almost universally by social scientists when coding political texts. To code these texts automatically, researchers are increasing turning to generative large language models (LLMs). However, there is limited empirical evidence on whether "off-the-shelf" LLMs faithfully follow real-world codebook operationalizations and measure complex political constructs with sufficient accuracy. To address this, we gather and curate three real-world political science codebooks -- covering protest events, political violence and manifestos -- along with their unstructured texts and human labels. We also propose a five-stage framework for codebook-LLM measurement: preparing a codebook for both humans and LLMs, testing LLMs' basic capabilities on a codebook, evaluating zero-shot measurement accuracy (i.e. off-the-shelf performance), analyzing errors, and further (parameter-efficient) supervised training of LLMs. We provide an empirical demonstration of this framework using our three codebook datasets and several pretrained 7-12 billion open-weight LLMs. We find current open-weight LLMs have limitations in following codebooks zero-shot, but that supervised instruction tuning can substantially improve performance. Rather than suggesting the "best" LLM, our contribution lies in our codebook datasets, evaluation framework, and guidance for applied researchers who wish to implement their own codebook-LLM measurement projects.

研究动机与目标

  • 通过以代码本-概念标签假设替代通用标签假设,解决零样本LLM分类在政治科学中的局限性。
  • 评估重构政治科学代码本是否能提升LLM零样本性能。
  • 评估在代码本-文档-标签三元组上对LLM进行指令微调是否能提升分类准确率,相较于零样本推理。
  • 开发一种面向LLM的半结构化、友好型代码本格式,支持人工与机器标注。
  • 建立诊断工具,用于衡量LLM在社会科学应用中对代码本指令的合规性。

提出的方法

  • 作者收集了三个真实世界的政治科学数据集及其原始代码本,确保数据隔离,防止LLM训练过程中发生数据污染。
  • 将原始代码本重构为半结构化、LLM可读的格式,以提升模型理解能力。
  • 使用Mistral 7B Instruct模型,将原始和重构后的代码本作为提示,执行零样本分类。
  • 通过参数高效微调(PEFT)在代码本-文档-标签三元组上进行指令微调,以提升模型合规性。
  • 通过所有数据集的微F1分数评估性能,并通过错误分析识别模型失败原因与代码本中的模糊性。
  • 开发了一种合规性度量指标,用于检测幻觉或错误的标签预测,特别是在模型偏离代码本规则程度较高的情况下。

实验结果

研究问题

  • RQ1提供完整代码本(无论原始或重构形式)是否能显著提升政治科学文本的零样本LLM分类性能?
  • RQ2将代码本重写为半结构化、LLM优化格式是否能提升零样本LLM性能?
  • RQ3在代码本-文档-标签三元组上对LLM进行指令微调,是否能带来显著优于零样本推理的性能提升?
  • RQ4LLM在多大程度上能遵守复杂代码本约束,如排除标准和层级标签规则?
  • RQ5LLM是否可用于在迭代开发过程中识别代码本中的缺口或不一致性?

主要发现

  • 在代码本-文档-标签三元组上对Mistral 7B Instruct进行指令微调,使某一数据集的微F1从0.53提升至0.76,表明性能有显著提升。
  • 代码本重构仅带来微小的零样本性能改进,表明结构清晰度本身不足以确保LLM合规。
  • LLM在Manifesto数据集上表现出显著的非合规行为,将近一半文档的标签被幻觉化,表明其对代码本规则的遵守程度极低。
  • 尽管使用了详尽的代码本,LLM仍难以遵循排除标准和层级标签区分,揭示了零样本推理的局限性。
  • 人工错误分析揭示了代码本语言的模糊性及潜在的标注错误,表明LLM可在开发过程中协助优化代码本。
  • 半结构化代码本格式提升了模型可解释性,并为未来LLM训练与合规性测试奠定了基础。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。