利用语言模型在多语言场景下生成日志语句:我们走了多远?
Leveraging Language Models for Log Statement Generation in Multilingual Scenarios: How Far Are We?
AI总结:
本文通过构建包含五种编程语言的多语言基准,比较评估了三种最先进的日志语句生成方法和五个大型语言模型,发现UniLog方法在多语言环境中表现最佳,并揭示了不同语言间日志生成难度的差异源于日志插入分布和语言特定日志习惯,指出单纯扩大模型规模或训练数据量不足以解决多语言日志生成问题,需针对目标语言特性设计方法。
摘要:
日志语句捕获了软件维护活动(如测试、调试和故障分析)的关键信息。由于这种重要性,开发人员必须精心设计日志语句,这需要大量的精力。为了支持开发人员,已经提出了各种端到端的自动化日志语句生成方法,然而这些方法主要在单一编程语言环境中进行评估,它们在多语言环境中的有效性仍未得到充分探索。因此,在本文中,我们跨多种编程语言比较评估了三种最先进的日志语句生成方法和五个大型语言模型(LLMs)。为此,我们构建了一个包含五种编程语言、共计150,000个实例的多语言基准。我们的实证结果表明,最先进的方法UniLog实现了最佳的整体性能,即使在多语言环境中也能保持高效性。我们还观察到不同语言之间日志生成难度的显著差异:Python带来了更大的挑战,而JavaScript则表现出相对更好的性能。详细分析揭示,这些差异源于日志插入分布和语言特定日志习惯的变化。我们的发现表明,单纯扩大模型规模或训练数据量不足以解决多语言日志生成问题;相反,设计针对目标语言特定特性的方法至关重要。这些发现表明,未来的自动化日志记录技术应明确考虑语言特定的日志记录特性,以在多语言软件开发环境中实现稳健的性能。
英文摘要:
Log statements capture critical information for software maintenance activities such as testing, debugging, and failure analysis. Because of this importance, developers must carefully design log statements, which requires significant effort. To support developers, various end-to-end automated log statement generation approaches have been proposed, whereas these approaches have mainly been evaluated within a single programming language environment and their effectiveness in multilingual environments remains underexplored. In this paper, we therefore comparatively evaluate three state-of-the-art log statement generation approaches and five large language models (LLMs) across multiple programming languages. For this purpose, we constructed a multilingual benchmark comprising 150,000 instances across five programming languages. Our empirical results demonstrate that UniLog, a state-of-the-art approach, achieves the best overall performance, maintaining high effectiveness even in multilingual environments. We also observe substantial variance in the difficulty of log generation across languages: Python presents a greater challenge, whereas JavaScript yields comparatively better performance. Detailed analysis reveals that these disparities stem from variations in log insertion distributions and language-specific logging idioms. Our findings indicate that simply scaling model size or the volume of training data is insufficient for multilingual log generation; rather, designing approaches tailored to the specific characteristics of target languages is crucial. These findings suggest that future automated logging techniques should explicitly account for language-specific logging characteristics to achieve robust performance in multilingual software development environments.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。