Introduction
Time series anomaly detection (TSAD) is a critical task in modern data science, essential for identifying irregular patterns in sequences such as heart rates, industrial sensor readings, and financial metrics. Traditionally, TSAD models are trained on centralized datasets. However, in many real-world scenarios, data is distributed across edge devices—such as smartphones or factory sensors—where privacy regulations and bandwidth limitations prevent raw data sharing.
Federated Learning (FL) has emerged as a solution, allowing devices to collaboratively train a model without sharing raw data. Yet, applying FL to TSAD introduces three significant hurdles: data scarcity on individual devices, the "unsupervised trap" (where models learn to reconstruct anomalies as if they were normal), and data heterogeneity (Non-IID data), where different devices observe vastly different patterns. This paper introduces PeFAD (Parameter-Efficient Federated Anomaly Detection), the first framework to leverage Pre-trained Language Models (PLMs) to address these challenges in a federated setting.
The PeFAD Framework
PeFAD integrates four core innovations to create a robust, efficient, and privacy-preserving detection system.
1. PLM as a Backbone
PeFAD utilizes a Pre-trained Language Model (specifically GPT-2) as its foundational architecture. This approach is based on the concept of "cross-modality" knowledge: models trained on massive text corpora learn universal structural patterns that can be effectively transferred to time series data. By using a PLM, PeFAD overcomes local data scarcity by leveraging the broad, pre-existing knowledge embedded in the model.
2. Anomaly-Driven Mask Selection (ADMS)
Standard unsupervised models often learn by reconstructing masked portions of a sequence. However, if the training data contains anomalies, the model may learn to reconstruct those anomalies perfectly, rendering them undetectable. ADMS mitigates this by identifying likely anomalies during training and masking them more frequently. This forces the model to learn how to reconstruct normal data from context, making it significantly more sensitive to deviations during the detection phase.
3. Privacy-Preserving Shared Dataset Synthesis (PPDS)
To combat data heterogeneity (Non-IID data), PeFAD introduces a synthetic data-sharing mechanism. Each client uses a Variational Autoencoder (VAE) to generate synthetic data that is statistically similar to their local data but does not contain private details. By applying a Mutual Information constraint, the framework ensures that this synthetic data does not leak sensitive information. These synthetic datasets are pooled to facilitate Knowledge Distillation, helping the global model align with the diverse local distributions without compromising privacy.
4. Parameter-Efficient Fine-Tuning (PEFT)
To minimize the communication burden of transmitting large model updates, PeFAD employs PEFT. Instead of updating the entire PLM, clients only fine-tune and transmit a small fraction of the parameters, such as specific attention blocks and the final layers. This drastically reduces the bandwidth required for federated rounds.
Experimental Evaluation
The framework was evaluated against 12 baseline models using four real-world benchmarks:
- SMD (Server Machine Dataset): Internet company server metrics.
- PSM (Pooled Server Metrics): eBay application server data.
- SWaT (Secure Water Treatment): Critical infrastructure telemetry.
- MSL (Mars Science Laboratory): Curiosity rover telemetry.
Key Results
- Performance Gains: PeFAD outperformed all baselines, improving F1-scores by an average of 3.83% to 28.74% across the benchmarks.
- Communication Efficiency: By utilizing PEFT, PeFAD achieved a 41.2% reduction in communication costs on SMD and a 94.9% reduction on MSL compared to full model fine-tuning.
- Component Synergy: Ablation studies confirmed that the PLM backbone, ADMS, and PPDS are all essential; removing any single component resulted in a significant performance decline.
Discussion and Future Work
While PeFAD represents a significant leap forward, it faces certain limitations. Performance can dip slightly when the number of clients scales beyond a specific threshold (approximately 14 in current tests), likely due to increased noise during aggregation. Furthermore, while communication is efficient, the local compute requirements of running a PLM may be high for low-power edge devices. Future research will explore the use of smaller, distilled PLMs and methods to improve stability as the client base grows.
Conclusion
PeFAD demonstrates that Pre-trained Language Models can be successfully adapted for federated time series anomaly detection. By combining parameter-efficient tuning with intelligent masking and privacy-preserving synthesis, PeFAD provides a scalable and highly accurate solution for detecting anomalies in distributed, privacy-sensitive environments.
Summary updated