Predicting User Behavior in Smart Spaces with LLM-Enhanced Logs and Personalized Prompts

Yunpeng Song, Li, Jiawei, Bian, Yiheng, Cai, Zhongmin · DOI

Abstract

Enhancing the intelligence of smart systems, such as smart homes, smart vehicles, and smart grids, critically depends on developing sophisticated planning capabilities that can anticipate the next desired function based on historical interactions. While existing methods view user behaviors as sequential data and apply models like RNNs and Transformers to predict future actions, they often fail to incorporate domain knowledge and capture personalized user preferences. In this paper, we propose a novel approach that incorporates LLM-enhanced logs and personalized prompts. Our approach first constructs a graph that captures individual behavior preferences derived from their interaction histories. This graph effectively transforms into a soft continuous prompt that precedes the sequence of user behaviors. Then our approach leverages the vast general knowledge and robust reasoning capabilities of a pretrained LLM to enrich the oversimplified and incomplete log records. By enhancing these logs semantically, our approach better understands the user's actions and intentions, especially for those rare events in the dataset. We evaluate the method across four real-world datasets from both smart vehicle and smart home settings. The findings validate the effectiveness of our LLM-enhanced description and personalized prompt, shedding light on potential ways to advance the intelligence of smart space.

Introduction

Predicting user behavior in smart spaces—such as a driver wanting the seat heated or a homeowner wanting the lights dimmed—is notoriously difficult. Traditional sequential models (like Transformers or RNNs) struggle with two primary challenges:

  1. Cryptic and Sparse Data: System logs are often technical shorthand (e.g., ExCrtLtAutoCfg: 0). Treating these as simple IDs misses the semantic relationships between actions.
  2. Personalization: Most models use a single logic for all users, failing to account for individual habits and routines.

Methodology

The proposed framework addresses these issues through a two-pronged approach: LLM-enhanced semantic logs and personalized soft prompts.

The overall architecture of the proposed framework, including Personalized Prompt Generation, Action Decoder, and Knowledge Enhancement & Encoding.

LLM-Enhanced Semantic Logs

Instead of raw IDs, an LLM (e.g., Qwen or Ernie Bot) acts as an "expert engineer" to expand abbreviations into natural language descriptions. For instance, RRDoorSts: 1 is expanded into a detailed explanation of the rear right door opening. These descriptions are converted into embeddings using BERT, allowing the model to understand the underlying intent.

Personalized Soft Prompts

To capture individual habits, the system constructs Transition and Co-occurrence Graphs from each user's history. A Graph Convolutional Network (GCN) processes these graphs to create "soft prompts"—continuous vectors that prefix the input sequence. These prompts prime the Transformer decoder to tailor predictions to specific user styles.

Experimental Evaluation

The framework was evaluated on four real-world datasets:

  • Industrial Smart Vehicle Datasets (City A & City B): 9.5 million events from 100 vehicles over 90 days.
  • Public Smart Home Datasets (Aruba & Milan): Sensor-based interactions from the WSU CASAS project.

Key Results and Discussion

The proposed method consistently outperformed state-of-the-art baselines like BERT4Rec and RecFormer. On smart vehicle datasets, the model achieved a Hit Rate@1 (H@1) of up to 0.3743.

Impact on Rare Events

A significant finding is that LLM enrichment primarily benefits "long-tail" or rare events. By understanding the semantics of an action, the model can relate rare commands to more common, semantically similar ones.

Performance comparison showing the benefit of LLM-enhanced logs over raw logs across different event frequencies, highlighting significant gains for rare events.

As shown in the ablation studies, removing either the personalized prompt or the LLM-enhanced logs led to a measurable drop in performance, confirming that both semantic meaning and individual context are vital for accurate prediction.

Conclusion

This research demonstrates that integrating LLM-based semantic enrichment with graph-based personalized prompts significantly improves behavior prediction in smart spaces. Future work will focus on addressing data privacy through on-device processing and tackling "cold-start" scenarios for new users or environments.

Summary updated

BibTeX
@inproceedings{song2025predicting,
  author = {Yunpeng Song and Li, Jiawei and Bian, Yiheng and Cai, Zhongmin},
  title = {{Predicting User Behavior in Smart Spaces with LLM-Enhanced Logs and Personalized Prompts}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i1.32059},
}
Figure