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 \url{https://github.com/zjunlp/DeepKE/tree/main/example/llm.
翻译:扩展语言模型已彻底改变了广泛自然语言处理任务,但针对大语言模型在少样本关系抽取中的系统性探索仍然不足。本文通过GPT-3.5的穷尽实验,研究了面向少样本关系抽取的两种核心方法:上下文学习与数据生成。为提升少样本性能,我们进一步提出了任务相关指令与模式约束的数据生成方案。实验表明,上下文学习性能可媲美先前的提示学习方法,而基于大语言模型的数据生成能推动已有解决方案在四个广泛研究的关系抽取数据集上取得新的少样本最优结果。希望本研究能启发未来关于大语言模型在少样本关系抽取中能力的探索。代码开源地址:\url{https://github.com/zjunlp/DeepKE/tree/main/example/llm}。