# TRAIL: Towards Effective Log Parsing for Rare Logs through Template-Preserving Augmentation

DevFeed: [TRAIL: Towards Effective Log Parsing for Rare Logs through Template-Preserving Augmentation](<https://devfeed.tech/articles/trail-towards-effective-log-parsing-for-rare-logs-through-template-preserving-augmentation-113478.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2609.25261>)

Author: Sepideh Hodaeian, Zhenhao Li, An Ran Chen

Published: 2026-11-03T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [data augmentation](<https://devfeed.tech/topics/data-augmentation.md>), [ai observability](<https://devfeed.tech/topics/ai-observability.md>), [managing large-scale text data in AI](<https://devfeed.tech/topics/managing-large-scale-text-data-in-ai.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [account](<https://devfeed.tech/tags/account.md>), [all](<https://devfeed.tech/tags/all.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [anomaly-detection](<https://devfeed.tech/tags/anomaly-detection.md>), [architectures](<https://devfeed.tech/tags/architectures.md>), [arxiv](<https://devfeed.tech/tags/arxiv.md>), [based](<https://devfeed.tech/tags/based.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [but](<https://devfeed.tech/tags/but.md>), [challenge](<https://devfeed.tech/tags/challenge.md>), [complete](<https://devfeed.tech/tags/complete.md>), [contain](<https://devfeed.tech/tags/contain.md>), [core](<https://devfeed.tech/tags/core.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [datasets](<https://devfeed.tech/tags/datasets.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [effective](<https://devfeed.tech/tags/effective.md>), [logs](<https://devfeed.tech/tags/logs.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [template](<https://devfeed.tech/tags/template.md>)

## AI overview

On Loghub-2.0, log groups with fewer than five instances make up nearly 20% of templates but less than 0.01% of log messages, and evaluated parsers perform substantially worse on them. The paper proposes TAILOR, which augments rare groups with template-consistent messages before inference; the added structural evidence helps separate static tokens from dynamic variables. The authors report a 19% parsing-accuracy improvement on rare groups over the strongest baseline while maintaining competitive performance on complete datasets. The augmentation generalizes across LLM backbones and improves existing LLM-based parsers without changing their core architectures.

## Source excerpt

arXiv:2609.25261v2 Announce Type: replace Abstract: Log parsing is essential for system log analysis because it supports tasks such as debugging, monitoring, and anomaly detection by transforming unstructured log messages into structured log templates. However, real-world log datasets exhibit highly imbalanced, long-tailed distributions, where a small number of frequent templates dominate while many rare templates appear only a few times. This imbalance causes evaluation results to be overly optimistic by allowing frequent templates to dominate benchmark metrics, while poor performance on rare yet operationally important events remains largely hidden. In this paper, we investigate the prevalence and impact of rare log groups, defined as log groups with fewer than five instances. Our empirical study on the widely used Loghub-2.0 benchmark shows that rare log groups account for nearly 20% of all templates but less than 0.01% of log messages. Because they contain only a handful of instances, all evaluated parsers experience substantial performance degradation on these groups. To address this challenge, we propose TAILOR, a log parsing framework that improves template inference for rare log groups through template-preserving augmentation. TAILOR enriches rare log groups with template- consistent log messages before template inference. The additional structural evidence helps distinguish static tokens from dynamic variables. Our experimental results show that TAILOR improves parsing accuracy on rare log groups by 19% over the strongest baseline while maintaining competitive performance on complete datasets. We further show that the proposed augmentation strategy generalizes across different LLM backbones and consistently improves existing LLM-based parsers without modifying their core architectures.