Sample-Efficient LLM-Based Detection of Malicious Web Server Logs with Forensically Explainable Reasoning
Not on the map. Why?
Abstract (arXiv)
Forensic analysis of web server logs demands both accurate detection and human-readable explanations that can satisfy legal requirements. We present CEF-Log, a context-enhanced few-shot chain-of-thought prompting strategy for Large Language Models that addresses this dual requirement. CEF-Log embeds expert investigative methodology through a structured five-step reasoning template, enabling the model to learn textithow to analyze logs rather than textitwhat patterns to memorize. Experimental evaluation demonstrates that CEF-Log achieves an F1-score of 0.99 on the CSIC 2010 dataset using only four examples while providing a 10× improvement in sample efficiency compared to other prompting-based methods. We also introduce ForenWebLog, a new dataset that incorporates real-world attacks and multi-step attack sequences for comprehensive evaluation. Qualitative analysis confirms that CEF-Log generates traceable, accurate explanations suitable for forensic documentation, addressing the critical "black-box" limitation of traditional machine learning approaches.
Key facts. No citing papers in the map yet (data through 13 Oct 2026). Builds on 12 of its 46 references that are in the map. First posted on arXiv 7 Jun 2026.
Builds on
12 of 46 references.
References · 12
- 2020Language Models are Few-Shot Learnerscited by 32,320
- 2023A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questionscited by 1,594
- 2023A Survey on Evaluation of Large Language Modelscited by 1,236
- 2022Log-based Anomaly Detection with Deep Learning: How Far Are We?cited by 57
- 2020Self-Attentive Classification-Based Anomaly Detection in Unstructured Logscited by 36
- 2023LogGPT: Exploring ChatGPT for Log-Based Anomaly Detectioncited by 34
- 2022Deep Learning for Anomaly Detection in Log Data: A Surveycited by 28
- 2024LogLLM: Log-based Anomaly Detection Using Large Language Modelscited by 22
- 2023RAGLog: Log Anomaly Detection using Retrieval Augmented Generationcited by 19
- 2023ChatGPT for Digital Forensic Investigation: The Good, The Bad, and The Unknowncited by 17
- 2023ChatGPT, Llama, can you write my report? An experiment on assisted digital forensics reports written using (Local) Large Language Modelscited by 8
- 2024LLM meets ML: Data-efficient Anomaly Detection on Unstable Logscited by 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Context Contamination in LLM Analysis of Network Security Logs: Poison with Passive Prompt Injection and Mitigation Evaluation
- 2025GView: A Survey of Binary Forensics via Visual, Semantic, and AI-Enhanced Analysis
- 2026Retrieval-Augmented LLMs for Security Incident Analysis
- 2024LLMs are One-Shot URL Classifiers and Explainers
- 2025Cloud Investigation Automation Framework (CIAF): An AI-Driven Approach to Cloud Forensics
- 2026AsmRAG: LLM-Driven Malware Detection by Retrieving Functionally Similar Assembly Code
- 2026Automating Cloud Security and Forensics Through a Secure-by-Design Generative AI Framework
- 2025XGen-Q: An Explainable Domain-Adaptive LLM Framework with Retrieval-Augmented Generation for Software Security