arXiv:2602.07698cs.SEcs.CL2026-02

对比四种模型,发现Transformer最准,Mamba省算力。

On Sequence-to-Sequence Models for Automated Log Parsing

  • 用四种序列模型对比解析日志,统一测试条件
  • Transformer误差最低(0.111),比LSTM低23.4%
  • Mamba在算力有限时是高效替代方案

日志解析是软件系统监控、异常检测和故障诊断的关键环节,但自动化解析仍面临日志格式异构、训练与部署数据分布偏移及规则方法脆弱等问题。本研究系统评估了序列建模架构、表示选择、序列长度和训练数据量对自动日志解析性能与计算成本的影响。通过控制实验,对比了Transformer、Mamba状态空间模型、单向LSTM和双向LSTM四种架构,在多个数据集配置下共训练396个模型,并使用相对编辑距离进行评估,辅以统计显著性检验。结果表明,Transformer的平均相对编辑距离最低(0.111),其次为Mamba(0.145)、单向LSTM(0.186)和双向LSTM(0.265),数值越低越好。Mamba在保持较高准确率的同时,计算成本显著更低。字符级分词普遍提升性能,序列长度对Transformer精度影响可忽略,且Mamba与Transformer均表现出优于循环模型的样本效率。总体而言,Transformer将解析误差降低23.4%,而Mamba是数据或算力受限场景下的有力替代。研究明确了表示选择、序列长度和样本效率的作用,为研究者与实践者提供实用指导。

原文摘要 · Abstract (English)

Context: Log parsing is a critical standard operating procedure in software systems, enabling monitoring, anomaly detection, and failure diagnosis. However, automated log parsing remains challenging due to heterogeneous log formats, distribution shifts between training and deployment data, and the brittleness of rule-based approaches. Objectives: This study aims to systematically evaluate how sequence modelling architecture, representation choice, sequence length, and training data availability influence automated log parsing performance and computational cost. Methods: We conduct a controlled empirical study comparing four sequence modelling architectures: Transformer, Mamba state-space, monodirectional LSTM, and bidirectional LSTM models. In total, 396 models are trained across multiple dataset configurations and evaluated using relative Levenshtein edit distance with statistical significance testing. Results: Transformer achieves the lowest mean relative edit distance (0.111), followed by Mamba (0.145), mono-LSTM (0.186), and bi-LSTM (0.265), where lower values are better. Mamba provides competitive accuracy with substantially lower computational cost. Character-level tokenization generally improves performance, sequence length has negligible practical impact on Transformer accuracy, and both Mamba and Transformer demonstrate stronger sample efficiency than recurrent models. Conclusion: Overall, Transformers reduce parsing error by 23.4%, while Mamba is a strong alternative under data or compute constraints. These results also clarify the roles of representation choice, sequence length, and sample efficiency, providing practical guidance for researchers and practitioners.

日志解析序列建模TransformerMamba

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。