Towards Automation in Log Parsing: Auto-Prompt Optimization with Natural Language Gradients
摘要
Log parsing aims to transform raw log information into structured log templates and parameters, enabling automated analysis and improving downstream tasks such as anomaly detection. Existing LLM-based log parsing approaches primarily rely on manually crafted prompts or static prompt selection, which limits their adaptability to diverse real-world log formats. To address this issue, we introduce NLGLP, a framework for automated prompt tuning. Specifically, NLGLP first selects representative examples that best match the current task through a candidate example set, then applies natural language gradient–based optimization to iteratively refine prompts. This dynamic adjustment improves both adaptability and parsing accuracy across heterogeneous log data. Experiments on 16 public loghub datasets demonstrate the effectiveness of our method. The codes are available at: https://github.com/Theshy1245/AutoPrompt.git .