Introduction
Smart home systems have become increasingly sophisticated, relying on deep learning models to perform critical tasks such as anomaly detection (e.g., identifying a forgotten stove) and behavior prediction (e.g., automating lighting based on sunset). However, these systems face a significant hurdle: behavioral drift. In real-world environments, user habits are not static; they shift due to seasonal changes, schedule adjustments, or changes in household occupancy.
Traditional deep learning models, trained on static datasets, often become brittle and inaccurate when these shifts occur. Addressing this drift typically requires weeks or months of new data collection, a process that is not only slow and expensive but also raises substantial privacy concerns for residents. To bridge this gap, we introduce SmartGen, a framework that leverages the reasoning capabilities of Large Language Models (LLMs) to synthesize high-quality, context-aware training data, allowing smart home systems to adapt to new behaviors instantly.
The SmartGen Framework
SmartGen is designed as a four-stage pipeline to overcome common LLM limitations, such as limited context windows and the tendency to generate logically sound but statistically improbable sequences.
1. Time and Semantic-aware Split (TSS)
Standard data processing often cuts behavior streams at arbitrary time intervals, which can fragment coherent routines (like a morning shower followed by breakfast). TSS employs a semantic checker and specific time thresholds to divide long behavior streams into logically grouped "sub-sequences." This ensures that the LLM receives prompts that maintain the integrity of user habits.
2. Semantic-aware Sequence Compression (SSC)
To provide the LLM with sufficient historical context without exceeding token limits, SmartGen utilizes a Transformer-based autoencoder. This module maps behaviors into a latent space and performs clustering to identify the most representative samples. By keeping only the "essence" of a user's habits, SSC achieves an average data reduction rate of 63.60%, saving hundreds of thousands of tokens while preserving the diversity of the original data.
3. Graph-guided Sequence Synthesis (GSS)
While LLMs excel at reasoning, they often struggle to replicate the statistical frequencies of real-world events. GSS addresses this "frequency gap" by building a behavior relationship graph from historical data. This graph extracts frequent transition patterns (e.g., "TV off" followed by "Bedroom light on") and provides them to the LLM as JSON-formatted hints. This grounds the LLM’s generation in the statistical reality of the specific home environment.
4. Two-stage Outlier Filter (TOF)
To ensure the quality of the synthetic data, TOF applies a dual-layer check. First, it uses reconstruction loss to flag and remove sequences that are logically inconsistent. Second, it performs a "valuable selection" step to ensure that rare but valid behaviors—which are crucial for training robust anomaly detection models—are not accidentally discarded.
Evaluation and Results
We evaluated SmartGen across three real-world smart home datasets (FR, SP, and US), simulating transitions across seasons, schedules, and occupancy levels. The synthetic data generated by SmartGen was used to retrain downstream models, yielding significant performance improvements:
- Anomaly Detection: The F1-score improved by an average of 85.43% compared to static models that did not adapt to the new context.
- Behavior Prediction: Performance in NDCG@10 and HR@10 scores saw an average increase of 70.51%.
- Model Efficiency: GPT-4o emerged as the most effective engine for SmartGen, significantly outperforming open-source models like Llama-3 in maintaining logical consistency across complex multi-device interactions.
Conclusion and Future Work
SmartGen demonstrates that LLMs can serve as powerful contextual reasoners for smart home adaptation, transforming existing data into plausible future scenarios. While the framework is highly effective, its success is currently tied to the reasoning depth of high-end LLMs, and the computational cost of large-scale synthesis remains a factor. Future research will explore more granular environmental factors, such as precise temperature and humidity, to further refine seasonal transition logic and enhance multi-user coherence in complex household environments.
Summary updated