TGT: A Temporal Gating Transformer for Smartphone App Usage Prediction

Longlong Li, Cunquan Qu, Guanghui Wang · DOI

TL;DR

TGT (Temporal Gating Transformer) is a new framework that significantly improves smartphone app usage prediction by adaptively rescaling feature importance based on the hour of the day. By combining a Transformer backbone with a novel "temporal gating" mechanism and continuous Fourier-based time encodings, it outperforms 15 state-of-the-art baselines, particularly in "cold-start" scenarios where user history is scarce.

What Problem Does This Paper Address?

Predicting which app a user will open next is a "holy grail" for mobile UX—it enables proactive resource scheduling, battery optimization, and personalized shortcuts. However, user behavior is notoriously sparse and irregular.

The authors identify two major gaps in current models:

  1. Coarse Temporal Encoding: Most models treat time as discrete "buckets" (e.g., morning vs. evening), which fails to capture the continuous, subtle shifts in how we use our phones throughout the day.
  2. Static Feature Aggregation: Standard Transformers treat all features with equal weight regardless of the time context. In reality, the "importance" of a specific behavioral cue (like your last opened app) changes depending on whether it's 3:00 AM or 3:00 PM.

These issues are magnified in "cold-start" situations, where a new user has little to no interaction history, making it difficult for models to rely on established personal patterns.

Methods

The TGT architecture introduces three key innovations to the standard Transformer setup:

  • Fourier-Based Encoding: Instead of using discrete tokens for time, TGT uses learnable sinusoidal projections. This maps time into a continuous, expressive space that captures periodic rhythms across multiple scales.
  • Temporal Gating Module: This is the core contribution. Rather than just adding time as an extra input feature, TGT uses the time encoding to generate a feature-wise gating vector. This vector is multiplied element-wise with the session representation, effectively "turning up the volume" on certain features and "muting" others based on the hour of the day.
  • Context-Aware Encoder: The model jointly embeds app identities, usage durations, and user profiles into a unified representation before passing them through an L-layer Transformer encoder to capture sequential dependencies.

Datasets

The researchers evaluated TGT on two prominent real-world datasets:

  • Tsinghua App Usage: A large-scale dataset containing over 4.1 million records from 1,000 users over 7 days.
  • LSApp: A more concentrated dataset with roughly 600,000 records from 292 users over a 24-hour period.

The evaluation used two protocols: a Standard Split (chronological split for known users) and a Cold-Start Split (testing on entirely unseen users).

Key Insights and Ideas

  • Gating vs. Attention: While self-attention is great at finding relationships within a sequence, the authors argue that gating is superior for conditioning the entire representation on external context (like time). Gating works orthogonally to attention, providing a lightweight way to inject "temporal sensitivity."
  • The "Inductive Bias" of Time: By forcing the model to scale its features based on time, the authors provide a strong inductive bias that mirrors human behavior. We are creatures of habit; our "app-opening logic" is fundamentally different during a morning commute than during a late-night scroll.
  • Transferable Rhythms: In cold-start scenarios, TGT excels because it learns "population-level" temporal regularities. Even if the model doesn't know you, it knows how humans in general tend to shift their behavior throughout the day, allowing it to make educated guesses for new users.

Key Results

TGT consistently outperformed 15 competitive baselines, including specialized models like AppUsage2Vec and generic time-series predictors like TimesNet.

  • Accuracy Gains: On the Tsinghua dataset (Standard Split), TGT achieved a Hit Ratio@1 (HR@1) of 52.66%, surpassing the best baseline.
  • Cold-Start Dominance: In the user cold-start setting, TGT reached 64.25% HR@1, a significant margin over traditional Transformer and LSTM-based models.
  • Ablation Impact: Removing the temporal gating module led to an 18.58% drop in HR@1, proving that the gating mechanism is the primary driver of the model's success.
  • Interpretability: By visualizing the gating weights, the researchers found that the model naturally assigns higher importance to features during peak usage hours (e.g., 10:00 AM and 4:00 PM) and lower importance during the early morning (1:00 AM – 5:00 AM), aligning with actual human activity cycles.

Limitations and Future Work

While TGT is powerful, the authors note a few areas for growth:

  • On-Device Efficiency: While the gating module is lightweight, the underlying Transformer architecture can be resource-intensive. Future work will explore "lightweight Transformer variants" for direct deployment on mobile hardware.
  • Deeper Personalization: The current model is excellent at capturing general human rhythms. The authors plan to further integrate user-specific preferences to better balance "cross-user transferability" with "individualized prediction."
  • Feature Expansion: The model currently focuses on app ID and duration; incorporating more environmental context (like GPS or motion sensors) could further refine the temporal gates.

Summary updated

Abstract

Accurately predicting smartphone app usage is challenging due to the sparsity and irregularity of user behavior, especially under cold-start and low-activity conditions. Existing approaches mostly rely on static or attention-only architectures, which struggle to model fine-grained temporal dynamics. We propose TGT, a Transformer framework equipped with a temporal gating module that conditions hidden representations on the hour-of-day. Unlike conventional time embeddings, temporal gating adaptively rescales feature dimensions in a time-aware manner, working orthogonally to self-attention and strengthening temporal sensitivity. TGT further incorporates a context-aware encoder that integrates session sequences and user profiles into a unified representation. Experiments on two real-world datasets, Tsinghua App Usage and LSApp, demonstrate that TGT significantly outperforms 15 competitive baselines, achieving notable gains in HR@1 and maintaining robustness under cold-start scenarios. Beyond accuracy, analysis of gating vectors uncovers interpretable daily usage rhythms, showing that TGT learns human-consistent patterns of app behavior. These results establish TGT as both a powerful and interpretable framework for time-aware app usage prediction.
BibTeX
@misc{li2025tgt,
  author = {Longlong Li and Cunquan Qu and Guanghui Wang},
  title = {{TGT: A Temporal Gating Transformer for Smartphone App Usage Prediction}},
  year = {2025},
  eprint = {2502.16957},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.16957},
}
Figure