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.
翻译:上下文:日志解析是软件系统中一项关键的标准操作流程,支持系统监控、异常检测和故障诊断。然而,由于日志格式的异构性、训练数据与部署数据之间的分布偏移以及基于规则的方法的脆弱性,自动化日志解析仍面临挑战。目标:本研究旨在系统评估序列建模架构、表示选择、序列长度以及训练数据可用性如何影响自动日志解析的性能和计算成本。方法:我们开展了一项受控实证研究,比较了四种序列建模架构: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是一个强有力的替代方案。这些结果还阐明了表示选择、序列长度和样本效率的作用,为研究人员和从业者提供了实用指导。