arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.08979cs.CLcs.AI
收藏

CoCoP:通过代码补全提示利用 LLM 增强文本分类

CoCoP: Enhancing Text Classification with LLM through Code Completion Prompt

University of Tehran(德黑兰大学)

Mohammad Mahdi Mohajeri, Mohammad Javad Dousti, Majid Nili Ahmadabadi

AI总结:

提出 CoCoP 方法将文本分类转化为代码补全任务,利用 LLMs 的代码能力显著提升分类性能,在仅用十分之一模型规模时即可媲美或超越少样本学习。

摘要:

文本分类是自然语言处理(NLP)中的一项基础任务,而大型语言模型(LLMs)已经证明了其在各个领域执行此任务的能力。然而,LLMs 的性能在很大程度上取决于其输入提示的质量。近期的研究还表明,LLMs 在代码相关任务中展现出卓越的结果。为了利用 LLMs 在文本分类中的能力,我们提出了代码补全提示(Code Completion Prompt, CoCoP)方法,该方法将文本分类问题转化为代码补全任务。通过利用 LLMs 的代码补全能力,CoCoP 显著提升了在多种数据集上的文本分类性能。例如,CoCoP 将 SST2 数据集的准确率提高了 20% 以上。此外,当 CoCoP 与专为代码相关任务设计的 LLMs(代码模型,如 CodeLLaMA)集成时,该方法在使用仅十分之一模型规模的情况下,展现出与少样本学习技术相当或更好的性能。我们提出方法的源代码将在论文被接受后向公众开放。

英文摘要:

Text classification is a fundamental task in natural language processing (NLP), and large language models (LLMs) have demonstrated their capability to perform this task across various domains. However, the performance of LLMs heavily depends on the quality of their input prompts. Recent studies have also shown that LLMs exhibit remarkable results in code-related tasks. To leverage the capabilities of LLMs in text classification, we propose the Code Completion Prompt (CoCoP) method, which transforms the text classification problem into a code completion task. CoCoP significantly improves text classification performance across diverse datasets by utilizing LLMs' code-completion capability. For instance, CoCoP enhances the accuracy of the SST2 dataset by more than 20%. Moreover, when CoCoP integrated with LLMs specifically designed for code-related tasks (code models), such as CodeLLaMA, this method demonstrates better or comparable performance to few-shot learning techniques while using only one-tenth of the model size. The source code of our proposed method will be available to the public upon the acceptance of the paper.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑