Econ Papers Daily / 期刊论文
经济史研究中运用大型语言模型与生成式AI的实践指南
A practitioner’s guide to using large language models and generative AI in economic history
摘要
Large language models (LLMs) are lowering the barriers to entry for working with previously hard-to-use data sources that once required strong data science skills, such as handwritten ledgers, text, images, or sound recordings. This guide provides an introduction for researchers who are new to LLMs. It sets out a step-by-step workflow for turning a research idea into working code, data, theoretical models, or replication packages. It then works through the decisions a practitioner faces in sequence, beginning with whether an LLM is the right tool and whether the data are allowed to be sent to one, then how to select models, write prompts, manage context limits, and control costs, and finally how to validate, reproduce, document, and correct LLM-generated measures in regression settings. A review of recent research shows how these tools already extract, link, harmonize, and classify historical data at scale. Four worked examples with replication files illustrate the use of LLMs. They classify emotions in paintings, link census records without names, measure newspaper salience and sentiment around the 1882 Chinese Exclusion Act, and score the emotional delivery of Franklin D. Roosevelt’s wartime speeches. The guide also condenses the workflow, best-practice recommendations, and preparation of replication packages into summary tables and checklists to aid applied economists.
中文摘要
大语言模型(LLMs)正在降低使用以往难以获取的数据源的门槛,这些数据源过去需要很强的数据科学技能,例如手写账簿、文本、图像或录音。本指南为初次接触LLMs的研究人员提供入门介绍。它提出了一套分步工作流程,用于将研究想法转化为可运行的代码、数据、理论模型或复制包。随后,它依次梳理实践者所面临的决策,首先是大语言模型是否是合适的工具,以及数据是否被允许发送给大语言模型;然后是如何选择模型、撰写提示词、管理上下文限制并控制成本;最后是如何在回归设定中验证、复现、记录并修正由大语言模型生成的测量指标。对近期研究的综述表明,这些工具已经能够大规模地提取、链接、协调和分类历史数据。四个带有复制文件的实操示例展示了LLMs的使用。它们对绘画中的情绪进行分类,在没有姓名的情况下链接人口普查记录,测量围绕1882年《排华法案》的报纸显著性与情感,并对富兰克林·D·罗斯福战时演讲的情感表达进行评分。本指南还将该工作流程、最佳实践建议以及复制包的准备浓缩为汇总表和清单,以帮助应用经济学家。