arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

ThinkLog:利用推理进行日志语句生成

ThinkLog: Leveraging Reasoning for Log Statement Generation

Kazuki Kusama, Honglin Shu, Masanari Kondo, Tao Xiao, Yasutaka Kamei

arXiv 2607.11615首次发表:更新:

AI 中文总结

针对现有端到端日志语句生成方法准确性有限的问题,提出ThinkLog,该方法基于LLM,通过将推理融入提示作为少样本示例,引导LLM生成日志语句,在准确率提升15.4%的同时,推理成本约为现有最佳方法的50%。

AI 中文摘要

运行时日志是支持软件维护的重要信息来源。为获取有用日志,开发者需花费大量精力确定合适的日志位置、分配正确的严重级别并编写简洁且信息丰富的消息。因此,端到端自动日志语句生成有助于减轻此负担,先前工作已提出多种方法,但现有方法准确性仍有限。我们提出ThinkLog,一种基于大语言模型(LLM)的端到端日志语句生成方法。其核心思想是融入推理,帮助LLM在日志插入、严重级别分配和消息生成方面做出决策,从而提高日志语句生成准确性。ThinkLog将推理作为少样本示例注入提示中,引导LLM生成合适的日志语句。在从公共GitHub仓库提取的9619个Java方法上进行评估,ThinkLog实现了20.55%的日志语句生成准确率,比现有最佳方法提高了15.4%。此外,与现有最佳方法相比,推理成本约为其50%。这些结果表明,利用推理是提高端到端日志语句生成准确性的有效且经济高效的方法。

英文摘要

Runtime logs are an important source of information that supports software maintenance. To obtain useful logs, developers spend significant effort identifying appropriate log locations, assigning correct severity levels, and writing concise yet informative messages. Therefore, end-to-end automated log statement generation can help reduce this burden, and prior work has proposed many methods for this task. However, existing methods still exhibit limited accuracy. To address this problem, we propose ThinkLog, an LLM-based end-to-end log statement generation method. The core idea of ThinkLog is to incorporate reasoning that helps LLMs make decisions about log insertion, severity level assignment, and message generation, thereby improving log statement generation accuracy. ThinkLog injects reasoning into prompts as few-shot examples and guides LLMs to generate appropriate log statements. Evaluated on 9,619 Java methods extracted from public GitHub repositories, ThinkLog achieves 20.55% log statement generation accuracy, representing a 15.4% improvement over the best existing method. Moreover, these improvements were achieved at approximately 50% of the inference cost (USD) compared to the best existing method. These results show that leveraging reasoning is an effective and cost-efficient way to improve the accuracy of end-to-end log statement generation.

Comments16 pages, Accepted at the 26th IEEE International Conference on Software Quality, Reliability, and Security (QRS 2026), Short Papers Track

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑