[Paper Review] LILAC: Log Parsing using LLMs with Adaptive Parsing Cache
LILAC is a novel log parsing framework that leverages large language models (LLMs) with an adaptive parsing cache to achieve high-accuracy and efficient log parsing. By using hierarchical candidate sampling for high-quality in-context learning demonstrations and dynamically caching/refreshing parsed templates, LILAC improves F1 score by 69.5% over state-of-the-art methods while reducing LLM query counts by several orders of magnitude.
Log parsing transforms log messages into structured formats, serving as the prerequisite step for various log analysis tasks. Although a variety of log parsing approaches have been proposed, their performance on complicated log data remains compromised due to the use of human-crafted rules or learning-based models with limited training data. The recent emergence of powerful large language models (LLMs) demonstrates their vast pre-trained knowledge related to code and logging, making it promising to apply LLMs for log parsing. However, their lack of specialized log parsing capabilities currently hinders their accuracy in parsing. Moreover, the inherent inconsistent answers, as well as the substantial overhead, prevent the practical adoption of LLM-based log parsing. To address these challenges, we propose LILAC, the first practical log parsing framework using LLMs with adaptive parsing cache. To facilitate accurate and robust log parsing, LILAC leverages the in-context learning (ICL) capability of the LLM by performing a hierarchical candidate sampling algorithm and selecting high-quality demonstrations. Furthermore, LILAC incorporates a novel component, an adaptive parsing cache, to store and refine the templates generated by the LLM. It helps mitigate LLM's inefficiency issue by enabling rapid retrieval of previously processed log templates. In this process, LILAC adaptively updates the templates within the parsing cache to ensure the consistency of parsed results. The extensive evaluation on public large-scale datasets shows that LILAC outperforms state-of-the-art methods by 69.5% in terms of the average F1 score of template accuracy. In addition, LILAC reduces the query times to LLMs by several orders of magnitude, achieving a comparable efficiency to the fastest baseline.
Motivation & Objective
- To address the low accuracy and high inference cost of LLM-based log parsing in real-world systems.
- To overcome the inconsistency and inefficiency of LLMs when parsing large-scale, complex log data.
- To reduce reliance on extensive labeled data by enabling effective in-context learning with minimal human-annotated demonstrations.
- To improve parsing robustness and efficiency through a novel adaptive parsing cache mechanism.
- To enable practical deployment of LLMs in production log analysis pipelines.
Proposed method
- Leverages in-context learning (ICL) by selecting high-quality log message demonstrations through a hierarchical candidate sampling algorithm.
- Employs an adaptive parsing cache to store and retrieve previously generated log templates, reducing redundant LLM queries.
- Introduces a cache matching mechanism that ensures consistency by aligning new log messages with existing templates using semantic similarity.
- Applies adaptive template updating to refine and evolve cached templates over time, improving long-term parsing consistency.
- Uses a compact set of manually labeled log messages (e.g., 32) to bootstrap the ICL process, minimizing annotation overhead.
- Combines LLM inference with cache-based retrieval to balance accuracy and efficiency, achieving near-baseline speed.
Experimental results
Research questions
- RQ1Can LLMs be effectively and efficiently used for log parsing without extensive fine-tuning or large-scale labeled data?
- RQ2How can the inherent inconsistency of LLMs in log parsing be mitigated during repeated inference?
- RQ3To what extent can an adaptive caching mechanism reduce LLM query volume while maintaining high parsing accuracy?
- RQ4Can a minimal set of labeled examples enable high-performance log parsing via in-context learning?
- RQ5How does the proposed framework compare to state-of-the-art log parsers in terms of accuracy and efficiency on real-world datasets?
Key findings
- LILAC achieves a 69.5% higher average F1 score compared to state-of-the-art log parsing methods on public large-scale datasets.
- The framework reduces the number of LLM queries by several orders of magnitude, approaching the efficiency of the fastest non-LLM-based baselines.
- With only 32 labeled log messages, LILAC achieves significantly improved parsing accuracy, demonstrating the effectiveness of its ICL and caching strategy.
- The adaptive parsing cache ensures consistent template generation across repeated queries, resolving a key limitation of LLM-based parsing.
- LILAC outperforms existing LLM-based methods such as LogDiv and LLM-Parsing, which lack caching and suffer from high query overhead.
- The framework maintains high accuracy even on complex, real-world log datasets, demonstrating robustness and scalability.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.