Scaling language models have revolutionized widespread NLP tasks, yet little comprehensively explored few-shot relation extraction with large language models. In this paper, we investigate principal methodologies, in-context learning and data generation, for few-shot relation extraction via GPT-3.5 through exhaustive experiments. To enhance few-shot performance, we further propose task-related instructions and schema-constrained data generation. We observe that in-context learning can achieve performance on par with previous prompt learning approaches, and data generation with the large language model can boost previous solutions to obtain new state-of-the-art few-shot results on four widely-studied relation extraction datasets. We hope our work can inspire future research for the capabilities of large language models in few-shot relation extraction. Code is available in https://github.com/zjunlp/DeepKE/tree/main/example/llm.
翻译:扩展语言模型已革新了广泛的自然语言处理任务,但关于利用大型语言模型进行少样本关系抽取的全面研究尚不充分。本文通过详尽的实验,探究了基于GPT-3.5进行少样本关系抽取的两类核心方法:上下文学习和数据生成。为提升少样本性能,我们进一步提出了任务相关指令和模式约束的数据生成。我们观察到,上下文学习可实现与先前提示学习方法相当的性能,而利用大型语言模型进行数据生成则能提升现有方案,在四个广泛研究的关系抽取数据集上取得新的少样本最优结果。希望本研究能启发未来关于大型语言模型在少样本关系抽取中能力的研究。代码开源于:https://github.com/zjunlp/DeepKE/tree/main/example/llm。