Abstract
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. 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. 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. 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. 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.
Abstract (translated)
日志解析是软件系统中的一个关键标准操作程序,它能够实现监控、异常检测和故障诊断。然而,由于异构的日志格式、训练数据与部署数据之间的分布变化以及基于规则方法的脆弱性,自动化日志解析仍然具有挑战性。本研究旨在系统地评估序列建模架构的选择、表示方式选择、序列长度及可用训练数据量如何影响自动化日志解析的表现和计算成本。 我们进行了一项受控实证研究,比较了四种序列建模架构:Transformer、Mamba状态空间模型、单向LSTM(Long Short-Term Memory)以及双向LSTM模型。总计396个模型在不同的数据集配置下进行了训练,并使用相对Levenshtein编辑距离进行评估,且包含统计显著性检验。 结果表明: - Transformer实现了最低的平均相对编辑距离(0.111),其次是Mamba(0.145)、单向LSTM(0.186)和双向LSTM(0.265)。较低值代表更好的表现。 - Mamba在计算成本大幅降低的情况下提供了竞争力的准确性。 - 字符级别的标记化通常改善了性能,而Transformer的精度受序列长度的影响较小。 - 与循环模型相比,Mamba和Transformer展示了更强的数据样本效率。 总体而言,使用Transformer能够将解析错误减少23.4%,而在数据或计算资源受限的情况下,Mamba是一个强有力的选择。这些结果还阐明了表示选择、序列长度及样本效率的作用,并为研究者和实践者提供了实用指导。
URL
https://arxiv.org/abs/2602.07698