Source-linked AI summary

Large Language Models for Forecasting and Anomaly Detection: A Systematic Literature Review

Jing Su, Chufeng Jiang, Xin Jin, Yuxin Qiao, Tingsong Xiao, Hongda Ma, Rong Wei, Zhi Jing, Jiajun Xu, Junhong Lin

arXiv:2402.10350v1cs.LGcs.AI

TL;DR

Forecasting and anomaly detection require models that can handle complex temporal behavior, scarce labels, and evolving events. This systematic literature review surveys LLM applications, methods, challenges, and future directions, finding both strong task-specific results and important limits around generalization, knowledge boundaries, and computational demands.

  • Problem

    Complex temporal patterns, scarce anomaly labels, and evolving events make forecasting and anomaly detection difficult for conventional modeling approaches.

  • Method

    The paper conducts a systematic literature review of LLM methodologies applied to forecasting and anomaly detection across domains and tasks.

  • Results

    The review reports strong task-specific outcomes, including BERT-Log F1-scores of 99.3% on HDFS and 99.4% on BGL, while GPT-2 outperforms unsupervised algorithms in many tasks but trails supervised fine-tuning.

  • Takeaways & Limitations

    LLMs offer substantial potential for forecasting and anomaly detection, but their practical value depends on addressing limited generalization, unseen events, and real-time computational requirements.

  • Takeaways & Limitations

    The review identifies dataset dependence, limited generalizability, real-time safety and reliability concerns, and computational resource requirements as important constraints.

Abstract

from arXiv · show

This systematic literature review comprehensively examines the application of Large Language Models (LLMs) in forecasting and anomaly detection, highlighting the current state of research, inherent challenges, and prospective future directions. LLMs have demonstrated significant potential in parsing and analyzing extensive datasets to identify patterns, predict future events, and detect anomalous behavior across various domains. However, this review identifies several critical challenges that impede their broader adoption and effectiveness, including the reliance on vast historical datasets, issues with generalizability across different contexts, the phenomenon of model hallucinations, limitations within the models' knowledge boundaries, and the substantial computational resources required. Through detailed analysis, this review discusses potential solutions and strategies to overcome these obstacles, such as integrating multimodal data, advancements in learning methodologies, and emphasizing model explainability and computational efficiency. Moreover, this review outlines critical trends that are likely to shape the evolution of LLMs in these fields, including the push toward real-time processing, the importance of sustainable modeling practices, and the value of interdisciplinary collaboration. Conclusively, this review underscores the transformative impact LLMs could have on forecasting and anomaly detection while emphasizing the need for continuous innovation, ethical considerations, and practical solutions to realize their full potential.

1 Introduction

This section introduces LLMs and their potential application to forecasting and anomaly detection, particularly for time series and timestamped data. It also frames the review’s contribution as a systematic examination of current applications, challenges, and future research directions.

  • LLM foundations: LLMs use large-scale training and extensive parameter spaces to understand, generate, summarize, and predict content from text inputs.Their operation involves iteratively predicting subsequent tokens or words.
  • Core tasks: Forecasting uses historical data to predict future trends, while anomaly detection identifies observations that significantly deviate from typical patterns.Both tasks support planning, risk management, surveillance, and security across domains such as finance and healthcare.
  • Data setting: Forecasting and anomaly detection are well suited to time series and timestamped data because temporal structure exposes trends, cycles, and deviations from established patterns.The input data in the reviewed framework is often time series or timestamped data.
  • Review focus: The review examines how LLMs can augment traditionally quantitative forecasting and anomaly-detection workflows with qualitative insights and broader data analysis.It considers applications across sectors including finance, cybersecurity, and healthcare.
  • Contributions: The paper presents a comprehensive systematic literature review dedicated to LLM applications in forecasting and anomaly detection.It also compiles practical guidelines, develops theoretical insight into LLM capabilities, and identifies future research paths.

2 Methodology

The methodology uses a rigorous systematic literature review to identify, assess, and organize research on LLMs for forecasting and anomaly detection. It defines research questions, searches multiple databases, filters studies, and categorizes methods, datasets, tasks, and evaluation metrics.

  • Review design: The review follows Kitchenham’s systematic literature review methodology to rigorously identify, evaluate, and interpret research relevant to its questions.The approach is rules-driven, transparent, and designed to integrate findings across studies.
  • Research questions: The research questions address forecasting methodologies across domains, anomaly-detection effectiveness relative to traditional methods, and limitations affecting LLM deployment.The questions cover domain adaptation, comparative performance, data prerequisites, computational expenditure, and interpretability.
  • Search strategy: The search strategy combines multiple search engines and databases, including OpenReview to locate forthcoming research with relevant insights or data.The goal is to identify pertinent and cutting-edge studies.
  • Study selection: Retrieved studies undergo relevance assessment using predefined inclusion and exclusion criteria, selecting primary studies that provide direct evidence for the research questions.The selection emphasizes recent research and academically credible publication venues.
  • Evidence organization: The review organizes studies by LLM type, task, methodological approach, datasets, and performance metrics.The categorized overview covers forecasting, anomaly detection, zero-shot, few-shot, fine-tuning, foundation-model, and prompt-based approaches.

3 Overview

This section surveys the current state and evolution of LLMs, describing their foundations, development trajectories, and role in transforming data analysis and predictive modeling.

  • Overview: The overview traces LLM foundations, development, and applications in data analysis and predictive modeling.It begins with background on LLMs and follows their evolution toward forecasting and anomaly detection.

3.1 Background of Large Language Models

Language models evolved from fixed-context statistical systems through neural architectures to pretrained foundation models such as GPT. This progression expanded generalization and task flexibility but retained important context and resource limitations.

  • Pre-trained foundation models: Pretraining followed by fine-tuning became a dominant paradigm after BERT and GPT, using large-scale corpora before adapting models to downstream tasks.This approach separates broad language learning from task-specific adaptation.
  • Statistical language models: Statistical language models predict words from fixed-length contexts, with higher-order models facing exponentially growing transition probabilities and reduced accuracy.Unigram, bigram, and trigram models progressively use one, two, and three-word contexts.
  • Neural Network Language Model: Neural language models improved on statistical models by learning distributed representations and modeling longer-range dependencies.Feed-forward models use embedding, fully connected, and output layers, while recurrent models address context dependence more effectively.
  • Pre-trained foundation models: GPT-2 demonstrated zero-shot task performance without downstream fine-tuning, although supervised fine-tuning remained stronger in some comparisons.The model reformulated downstream tasks as natural-language inputs.
  • Pre-trained foundation models: GPT-4 extended the GPT approach through larger scale, reinforcement learning from human feedback, multimodal prompting, and chain-of-thought mechanisms.The review describes GPT-4 as processing image and text inputs and generating text outputs.

3.2 Task Categorization

The review categorizes LLM use in forecasting and anomaly detection by how models are adapted to time-series data and by the anomaly-detection setting examined. Forecasting approaches either convert time series into model inputs or train models specifically on time-series datasets.

  • Forecasting: LLM-based time-series forecasting is divided into direct prediction with converted inputs and domain training across multiple time-series datasets.The direct approach adapts time-series data for models such as GPT and Llama, whereas the second trains an LLM on time-series data.
  • Forecasting: The paper focuses on the second forecasting type, examining how researchers train LLMs across varied domains.Its emphasis is on cross-domain time-series model training rather than only input conversion.
  • Anomaly detection: Anomaly detection includes labeled open-set recognition and a second category whose examined subcategory trains LLMs across diverse domains.In open-set recognition, classifiers identify newly acquired data that differ from the original labeled distribution.

3.3 Approaches

The review describes several ways to adapt LLMs for forecasting and anomaly detection, ranging from prompts and limited-example learning to fine-tuning, reprogramming, and hybrid systems. These approaches trade adaptation requirements, resource use, and flexibility differently.

  • Prompt-based methods: Prompt-based methods restructure input text with templates so pretrained language models can perform downstream tasks.Prompt learning can support few-shot or zero-shot adaptation without the parameter changes typically associated with fine-tuning.
  • Fine-tuning: Fine-tuning specializes a pretrained model on a smaller task-specific dataset rather than training a model from scratch.The review characterizes fine-tuning as requiring fewer resources, less time, and less financial investment than full training.
  • Limited-example learning: Zero-shot, one-shot, and few-shot learning differ in whether adaptation uses no examples, one example, or a handful of examples per new class.Few-shot learning lies between one-shot and zero-shot settings in the described taxonomy.
  • Model reprogramming: Model reprogramming modifies inputs to repurpose an existing model for a new task without retraining or fine-tuning the original model.The approach is described as lowering computational cost and access requirements.
  • Hybrid methodologies: Hybrid methodologies combine rule-based and machine-learning approaches to use explicit knowledge representations alongside learned methods.Rule-based components can provide expressive and actionable descriptions through linguistic rules and knowledge graphs.

4 Challenges

LLM applications in forecasting and anomaly detection are constrained by complex temporal structure, scarce labels, missing data, and noisy unstructured text. The review therefore emphasizes richer data, specialized learning strategies, robust preprocessing, and optimization as ongoing requirements.

  • Complex seasonality and patterns: Complex seasonality requires models to capture dynamic temporal behavior, interacting patterns, external influences, and nonlinear dependencies.Relevant factors include multiple temporal resolutions, holidays, economic fluctuations, weather, and social events.
  • Complex seasonality and patterns: Effective modeling of complex seasonality requires substantial high-quality data spanning multiple seasonal cycles and, where relevant, external contextual information.The review states that LLMs must recognize patterns and understand their underlying causes and interactions.
  • Complex seasonality and patterns: Stochastic optimization and careful parameter tuning are presented as tools for adapting LLMs to diverse temporal patterns and sequential decisions.The described methods can incorporate discrete variables and operate across different time horizons.
  • Label deficiency: Label scarcity is especially problematic for anomaly detection because anomalous events are rare and therefore underrepresented in training data.Forecasting also lacks explicit labels for future time points, complicating training and evaluation.
  • Label deficiency: Semi-supervised learning, data augmentation, and transfer learning are proposed to reduce dependence on labeled examples.These strategies use unlabeled data, synthetic instances, or pretrained representations to support tasks with limited annotations.
  • Noisy and unstructured text: Noisy and unstructured text complicates feature and pattern extraction because it may contain irrelevant information, typos, slang, and ambiguous expressions.The review identifies social media posts, news articles, and log files as examples of such data.

5 Datasets

The review surveys datasets used for forecasting and anomaly detection, emphasizing their varied temporal, domain, labeling, and normal-versus-anomalous characteristics. It also highlights persistent dataset challenges, including limited quantity, complex samples, missing labels, and acquisition costs.

  • High-quality datasets support algorithm development, fine-tuning, and benchmarking, but obtaining them requires substantial financial, material, and workforce investment.
  • Forecasting datasets: The ECL, ICEWS, and ETT datasets provide electricity, socio-political event, and transformer-station data for forecasting studies.ECL contains consumption data from 321 users; ICEWS contains 4.5 million events from 1995–2014; ETT supports long-sequence forecasting.
  • Anomaly-detection datasets: Anomaly-detection datasets must represent ordinary and anomalous behavior adequately so models can learn normal patterns and identify deviations.
  • Anomaly-detection datasets: BGL and HDFS provide large labeled log collections, with anomalies comprising 7.34% of BGL messages and 2.93% of HDFS blocks.BGL contains 4,747,963 logs, while HDFS contains 11,175,629 log events.
  • Anomaly-detection datasets: Additional anomaly-detection resources include OpenStack, Spirit, SMD, and Thunderbird datasets covering injected failures, supercomputer logs, server sensors, and manually identified abnormal messages.

6 Evaluation Metrics

The review presents forecasting and anomaly-detection metrics as complementary tools for measuring predictive accuracy, scale-independent error, class-sensitive detection, and trade-offs between false alarms and missed anomalies. It also explains how individual metrics serve different evaluation purposes.

  • Forecasting metrics: Forecasting evaluation commonly uses MAE, MSE, RMSE, MAPE, and sMAPE to quantify prediction error and compare performance across scales.
  • Anomaly-detection metrics: Anomaly-detection evaluation uses precision, recall, F1, AUROC, and confusion-matrix rates to assess correct detections, false alarms, and missed anomalies.F1 is especially useful for imbalanced datasets because it balances precision and recall.
  • Forecasting metrics: sMAPE treats over-forecasting and under-forecasting symmetrically and normalizes error by forecast and actual values, reducing division-by-small-number issues.
  • Forecasting metrics: MSE emphasizes larger errors through squaring, while RMSE returns error magnitude to the original output units for easier interpretation.
  • Forecasting metrics: RMSPE expresses squared percentage errors and is scale-independent, making it useful for comparing forecasting errors across datasets.
  • Forecasting metrics: MASE compares forecast accuracy with a naive benchmark, whereas OWA combines normalized MASE and sMAPE components to reflect absolute and relative improvement over Naive2.

7 Forecasting with Large Language Models

LLMs are being adapted for forecasting by recasting time series and event prediction as language-modeling or prompt-based tasks, while studies also explore multimodal and domain-specific approaches. The literature reports broad potential across forecasting settings but highlights limitations involving generalizability, interpretability, data quality, and computational demands.

  • Time Series Forecasting: LLMs can forecast time series by encoding numerical values as token sequences, enabling zero-shot prediction without task-specific prior training.The approach uses GPT-3 and LLaMA-2 and is reported as comparable or superior to traditional time series models in the cited work.
  • Time Series Forecasting: A unified framework applies frozen pre-trained language or vision transformers across classification, forecasting, imputation, anomaly detection, and few-shot or zero-shot tasks.The authors relate transformer self-attention to a function similar to Principal Component Analysis, offering a theoretical explanation for cross-task reuse.
  • Event Forecasting: LLM-based event prediction can combine abductive reasoning with historical-event retrieval to suggest causes and support predictions about real-world event sequences.The LAMP framework targets event sequences accompanied by rich textual information and reports checks addressing data leakage and generalization concerns.
  • Prompt-Based Forecasting: Prompt-based methods transform numerical time series forecasting into language-model inputs, but their effective translation from numerical data into textual prompts remains challenging.PromptCast also identifies a need for additional benchmarks to evaluate prompt-based forecasting methods.
  • Application Challenges: Applications such as traffic-accident forecasting use compact LLMs and multimodal cues for real-time autonomous-driving interventions, but face concerns about black-box interpretability, dataset-specific generalizability, and computational requirements.The cited work combines modern deep learning with traditional time series models and uses PCA loadings to examine feature importance.
  • Multimodal and Domain-Specific Forecasting: Forecasting approaches increasingly incorporate multimodal data, external knowledge bases, domain-specific fine-tuning, and probabilistic reasoning for financial and technical analysis.The proposed scheme aims to improve the accuracy and reliability of domain-specific outputs, while manipulated financial data remains a threat to prediction accuracy.

8 Anomaly Detection using Large Language Models

LLMs are applied to time-series and log anomaly detection by modeling semantic, sequential, and contextual information. Reported approaches improve detection performance or reduce training overhead, but their applicability remains constrained by data and deployment requirements.

  • Scope: LLM-based anomaly detection covers sequential data and log analysis for identifying irregularities associated with errors, fraud, system failures, and cyber threats.The review discusses both time-series anomaly detection and log data analysis as major application areas.
  • Time Series Anomaly Detection: BERT-based time-series methods use limited labels or pre-training to model long-distance dependencies and outperform reported state-of-the-art or Spectral Residual baselines.One method achieves better results with a small amount of labeled data, while another reports higher accuracy on KPI and Yahoo and higher F1 than SR variants.
  • Limitations: Reported limitations include reliance on massive pre-training data, dataset-specific training, and uncertainty about generalization across log types and software systems.The time-series method may be unsuitable when historical data are scarce, LanoBERT requires individual training for each dataset, and LogADSBERT identifies validity threats involving semantic capture and broad applicability.
  • Log Anomaly Analysis: BERT-Log represents log sequences as natural-language sequences, capturing context and position while reporting F1-scores of 99.3% on HDFS and 99.4% on BGL.On BGL, the reported 99.4% F1 represents a 19% improvement over LogRobust and a 7% improvement over HitAnomaly; high F1 scores were also obtained using 1% of the dataset.
  • Log Anomaly Analysis: Other log methods model contextual and sequential semantics through LanoBERT, prompt tuning, hierarchical transformers, and semantic feature extraction.LanoBERT reports higher F1 and AUROC than existing methods, while LogPrompt, HilBERT, and LLM-based feature extraction target semantic or sequence-level information.
  • Log Anomaly Analysis: LogBP-LoRA combines BERT with Low-Rank Adaptation and a self-attention bypass connection to reduce training overhead while extracting semantic information from logs.The approach is designed to address the high computational requirements of traditional BERT-based anomaly detection.

9 Threats

LLMs for forecasting and anomaly detection face interconnected data, generalization, reliability, knowledge, and computational constraints. The review discusses data, methodological, interpretability, and efficiency strategies to mitigate these threats.

  • Extensive Historical Datasets Dependence: Extensive historical-data dependence raises concerns about availability, representativeness, quality, bias, and the capture of future trends or rare anomalies.Acquiring such datasets can also involve financial, legal, and ethical considerations.
  • Extensive Historical Datasets Dependence: Data augmentation, synthetic data generation, transfer learning, cleaning, preprocessing, active learning, and few-shot learning are proposed to improve dataset quality and generalization.
  • Generalizability: Generalizability remains difficult when models trained on one domain or period must perform accurately on different data, often producing suboptimal predictions and detections.
  • Generalizability: Domain adaptation, multi-task learning, and evaluation across heterogeneous datasets are proposed to improve adaptability across settings.
  • Hallucination and Robustness: Hallucinations can produce plausible but fabricated trends, while adversarial or noisy conditions can degrade performance and undermine output credibility.
  • Knowledge Boundary and Computational Efficiency: Knowledge boundaries limit insights beyond training data, while computational demands restrict accessibility, scalability, and real-time practicality.Continuous learning, external knowledge, advanced reasoning, validation, interpretability, and efficiency-focused development are identified as responses.

10 Future Directions and Trends

The review identifies future directions centered on richer data integration, adaptability, explainability, real-time deployment, sustainability, and interdisciplinary collaboration. These trends aim to improve the usefulness and responsible deployment of LLMs in forecasting and anomaly detection.

  • Integration of Multimodal Data Sources: Multimodal data integration could combine textual, visual, auditory, and sensor information to support more holistic analysis of complex phenomena.
  • Advancements in Transfer and Meta-Learning: Transfer and meta-learning could help models adjust to new domains or tasks with minimal additional training, especially under data scarcity.
  • Focus on Explainability and Trustworthiness: Explainability and trustworthiness are expected to become priorities because transparent outputs can build user trust and facilitate bias identification.
  • Real-time Processing and Edge Computing: Real-time processing and edge computing can reduce latency and increase the timeliness of insights by moving models closer to data sources.The review connects this direction to applications requiring immediate responses, including finance, healthcare, manufacturing, and indoor positioning.
  • Sustainable and Energy-efficient Modeling: Sustainable modeling will emphasize optimized algorithms, energy-efficient hardware, and practices that minimize the carbon footprint of training and deployment.
  • Collaboration Across Disciplines: Interdisciplinary collaboration across computing, statistics, machinery, robotics, domain-specific fields, and ethics could provide diverse expertise for robust and ethically sound solutions.

11 Related Surveys and Reviews

The review situates itself among broader surveys of LLM foundations, downstream applications, evaluation, capabilities, constraints, and reasoning. These prior reviews address wider facets rather than this review’s specific focus.

  • Scope of Existing Reviews: Existing surveys cover LLM backgrounds, fundamental discoveries, core technologies, and broad research developments.
  • Scope of Existing Reviews: Other reviews examine downstream applications and deployment challenges, evaluation methodologies, capabilities and constraints, and reasoning enhancement.

12 Conclusion

The review finds substantial potential for LLMs in forecasting and anomaly detection while identifying major barriers to reliable deployment. It highlights multimodal, adaptive, explainable, real-time, interdisciplinary, and sustainable directions for addressing those barriers.

  • Contributions and Potential: LLMs can parse extensive datasets to predict future events and identify deviations from norms across forecasting and anomaly-detection applications.
  • Challenges: The principal challenges are extensive historical-data dependence, limited generalizability, hallucinations, knowledge boundaries, and computational-efficiency requirements.
  • Future Directions: Future directions include multimodal data, transfer and meta-learning, explainability, real-time processing, edge computing, interdisciplinary collaboration, and sustainable modeling.
  • Practical and Ethical Priorities: The review calls for models that are powerful and accurate while also transparent, adaptable, accessible, and ethically deployed.
  • Practical and Ethical Priorities: Realizing LLMs’ potential requires concerted efforts across the scientific community, industry stakeholders, and policymakers.
Loading 2402.10350v1…