Tuning Language Models for Robust Prediction of Diverse User Behaviors

Fanjin Meng, Jingtao Ding, Jiahui Gong, Chen Yang, Hong Chen, Zuojian Wang, Haisheng Lu, Yong Li

Abstract

Predicting user behavior is essential for intelligent assistant services, yet deep learning models often struggle to capture long-tailed behaviors. Large language models (LLMs), with their pretraining on vast corpora containing rich behavioral knowledge, offer promise. However, existing fine-tuning approaches tend to overfit to frequent "anchor" behaviors, reducing their ability to predict less common "tail" behaviors. In this paper, we introduce BehaviorLM, a progressive fine-tuning approach that addresses this issue. In the first stage, LLMs are fine-tuned on anchor behaviors while preserving general behavioral knowledge. In the second stage, fine-tuning uses a balanced subset of all behaviors based on sample difficulty to improve tail behavior predictions without sacrificing anchor performance. Experimental results on two real-world datasets demonstrate that BehaviorLM robustly predicts both anchor and tail behaviors and effectively leverages LLM behavioral knowledge to master tail behavior prediction with few-shot examples.

Introduction

Intelligent assistants rely on predicting a user's next action—from opening a fitness app to hailing a taxi. However, human behavior follows a punishingly long-tailed distribution. Most user interactions are dominated by a few "anchor" behaviors (e.g., social media usage, commuting), while a vast array of "tail" activities (e.g., booking a flight, niche app usage) occur rarely.

The long-tailed distribution of user behaviors, highlighting the disparity between frequent anchor behaviors and rare tail behaviors.

Traditional deep learning models, such as Transformers, often struggle with this imbalance, either overfitting to anchors or failing to capture the semantic nuances of rare events. While LLMs possess extensive behavioral knowledge from pre-training, standard fine-tuning often degrades this knowledge, causing the model to prioritize the majority class at the expense of the tail.

Methodology: BehaviorLM

To address these challenges, we propose BehaviorLM, a two-stage progressive fine-tuning framework:

  1. Anchor Tuning (A-Tuning): The model is first fine-tuned on "anchor" behaviors (those with >1% frequency). This is implemented as a multi-task setup where the LLM simultaneously performs general conversation tasks. This "warm-up" phase allows the model to specialize in the behavior prediction format while preserving its general reasoning capabilities.
  2. Balanced Tuning (B-Tuning): The model is then exposed to a balanced subset of all behaviors, including rare tail events. Instead of random sampling, we employ Difficulty-based Data Selection. We identify "hard" samples where the model from Stage 1 struggled to distinguish between semantically similar behaviors. Training on these few-shot examples enables the model to learn fine-grained nuances.

The framework utilizes LoRA (Low-Rank Adaptation) for parameter-efficient tuning, making it feasible to train 8B-parameter models on standard hardware.

Experimental Setup

BehaviorLM was evaluated on two datasets:

  • App Usage Dataset: 1,753 users across 24 behavior categories.
  • Behavior Dataset: A large-scale proprietary dataset containing over 50 million events from 24,133 users, covering 37 daily behaviors.

Results and Discussion

BehaviorLM demonstrates significant improvements in predicting tail behaviors without sacrificing performance on anchor behaviors. Specifically, it outperformed the best LLM-based baselines by 27.4% on the App dataset and 20.4% on the Behavior dataset for tail activities.

Comparison of behavior prediction accuracy across different tuning strategies. BehaviorLM shows superior performance on tail behaviors compared to standard fine-tuning and zero-shot baselines.

Key Insights

  • Semantic Anchoring: Visualization of the latent space reveals that tail behaviors naturally cluster around semantically related anchors (e.g., "watching sports" near "watching videos"). Mastering anchors provides a semantic foothold for understanding the tail.
  • Sample Efficiency: BehaviorLM is remarkably efficient, achieving superior accuracy with 100x fewer samples than traditional models like SASRec. It can effectively learn a new behavior with as few as 20 examples.
  • Robustness: Unlike baseline methods that often trade off anchor precision for tail recall, BehaviorLM improves performance across the entire distribution.

Conclusion

BehaviorLM effectively bridges the gap between routine habit prediction and rare activity understanding. By leveraging progressive tuning and difficulty-based selection, it unlocks the latent behavioral knowledge within LLMs. Future work will focus on cross-domain behavior prediction and model compression for real-time on-device deployment.

Summary updated

Abstract

Predicting user behavior is essential for intelligent assistant services, yet deep learning models often struggle to capture long-tailed behaviors. Large language models (LLMs), with their pretraining on vast corpora containing rich behavioral knowledge, offer promise. However, existing fine-tuning approaches tend to overfit to frequent ``anchor'' behaviors, reducing their ability to predict less common ``tail'' behaviors. In this paper, we introduce BehaviorLM, a progressive fine-tuning approach that addresses this issue. In the first stage, LLMs are fine-tuned on anchor behaviors while preserving general behavioral knowledge. In the second stage, fine-tuning uses a balanced subset of all behaviors based on sample difficulty to improve tail behavior predictions without sacrificing anchor performance. Experimental results on two real-world datasets demonstrate that BehaviorLM robustly predicts both anchor and tail behaviors and effectively leverages LLM behavioral knowledge to master tail behavior prediction with few-shot examples.
BibTeX
@misc{meng2025tuning,
  author = {Fanjin Meng and Jingtao Ding and Jiahui Gong and Chen Yang and Hong Chen and Zuojian Wang and Haisheng Lu and Yong Li},
  title = {{Tuning Language Models for Robust Prediction of Diverse User Behaviors}},
  year = {2025},
  eprint = {2505.17682},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.17682},
}
Figure