Prompting is used to guide or steer a language model in generating an appropriate response that is consistent with the desired outcome. Chaining is a strategy used to decompose complex tasks into smaller, manageable components. In this study, we utilize prompt chaining for extensive legal document classification tasks, which present difficulties due to their intricate domain-specific language and considerable length. Our approach begins with the creation of a concise summary of the original document, followed by a semantic search for related exemplar texts and their corresponding annotations from a training corpus. Finally, we prompt for a label - based on the task - to assign, by leveraging the in-context learning from the few-shot prompt. We demonstrate that through prompt chaining, we can not only enhance the performance over zero-shot, but also surpass the micro-F1 score achieved by larger models, such as ChatGPT zero-shot, using smaller models.
翻译:提示用于引导或操控语言模型生成与期望结果一致的适当响应。链式策略是一种将复杂任务分解为更小、更易管理组件的技术。在本研究中,我们利用提示链处理长篇幅法律文档分类任务,此类任务因其领域特定的复杂语言和显著长度而具有挑战性。我们的方法首先创建原始文档的简洁摘要,随后从训练语料库中通过语义搜索获取相关示例文本及其对应标注。最后,基于任务要求,我们利用少样本提示中的上下文学习能力,引导模型分配标签。研究表明,通过提示链,我们不仅能提升相对于零样本的性能,还能在使用较小模型的情况下,超越如ChatGPT零样本等较大模型所达到的微F1分数。