arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.03677cs.SE
收藏

基于提示学习的Stack Overflow自动双模态问题标题生成

Automatic Bi-modal Question Title Generation for Stack Overflow with Prompt Learning

Shaoyu Yang, Xiang Chen, Ke Liu, Guang Yang, Chi Yu

AI总结:

针对Stack Overflow问题标题质量不佳的问题,提出结合代码与文本双模态信息、采用混合提示微调CodeT5的SOTitle+方法,在多语言语料上的表现优于现有最优基线。

摘要:

开发者在Stack Overflow撰写问题帖子时,可能无法在问题标题中准确总结核心问题,导致这些问题无法及时获得帮助。因此,提升问题标题质量受到了研究人员的广泛关注。一项初步研究仅通过分析问题正文中的代码片段来自动生成标题,但该研究忽略了对应问题描述中的有效信息。为此,我们提出了SOTitle+方法,该方法考虑问题正文中的双模态信息(即代码片段和问题描述)。随后,我们将不同编程语言的标题生成任务形式化为相互独立但又相关的任务,并利用多任务学习解决这些任务,之后对预训练语言模型CodeT5进行微调以自动生成标题。遗憾的是,预训练任务与我们研究的任务之间存在输入和优化目标不一致的问题,这可能导致微调难以充分挖掘预训练模型的知识。为解决这一问题,SOTitle+进一步采用混合提示(即硬提示与软提示的结合)对CodeT5进行提示微调。为验证SOTitle+的有效性,我们基于Stack Overflow共享的最新数据转储构建了一个大规模高质量语料库,该语料库包含6种流行编程语言的179119篇高质量问题帖子。实验结果表明,在自动评估和人工评估中,SOTitle+的表现均显著优于4种当前最优的基线模型。我们的研究表明,在Stack Overflow标题生成中结合双模态信息与提示学习是一个极具前景的探索方向。

英文摘要:

When drafting question posts for Stack Overflow, developers may not accurately summarize the core problems in the question titles, which can cause these questions to not get timely help. Therefore, improving the quality of question titles has attracted the wide attention of researchers. An initial study aimed to automatically generate the titles by only analyzing the code snippets in the question body. However, this study ignored the helpful information in their corresponding problem descriptions. Therefore, we propose an approach SOTitle+ by considering bi-modal information (i.e., the code snippets and the problem descriptions) in the question body. Then we formalize the title generation for different programming languages as separate but related tasks and utilize multi-task learning to solve these tasks. Later we fine-tune the pre-trained language model CodeT5 to automatically generate the titles. Unfortunately, the inconsistent inputs and optimization objectives between the pre-training task and our investigated task may make fine-tuning hard to fully explore the knowledge of the pre-trained model. To solve this issue, SOTitle+ further prompt-tunes CodeT5 with hybrid prompts (i.e., mixture of hard and soft prompts). To verify the effectiveness of SOTitle+, we construct a large-scale high-quality corpus from recent data dumps shared by Stack Overflow. Our corpus includes 179,119 high-quality question posts for six popular programming languages. Experimental results show that SOTitle+ can significantly outperform four state-of-the-art baselines in both automatic evaluation and human evaluation. Our work indicates that considering bi-modal information and prompt learning in Stack Overflow title generation is a promising exploration direction.

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

↑