Learning Next Action Predictors from Human-Computer Interaction

Omar Shaikh, Valentin Teutschbein, Kanishk Gandhi, Yikun Chi, Nick Haber, Thomas N. Robinson, Nilam Ram, Byron Reeves, Sherry Yang, Michael S. Bernstein, Diyi Yang

TL;DR

This paper introduces Next Action Prediction (NAP), a task where AI models anticipate a user's future computer interactions based on their multimodal history. The authors present NAPsack, a pipeline for passively annotating massive datasets of naturalistic device use, and LongNAP, a model that uses reinforcement learning to retrieve and reason over long-term user history to significantly outperform standard fine-tuning and prompting baselines.

What Problem Does This Paper Address?

Current AI assistants are largely reactive—they wait for a prompt to act. To become truly proactive, an AI must understand the "why" behind our actions by reasoning over our entire interaction history, not just the last few text inputs.

However, building such a system faces two major hurdles:

  1. Data Scarcity: Collecting naturalistic, longitudinal data of how people actually use their devices is difficult, expensive, and raises significant privacy concerns.
  2. Modeling Long Contexts: Standard parametric models (like fine-tuned LLMs) struggle to retain "latent" information—details that aren't immediately relevant but become crucial later. Conversely, stuffing an entire month of history into a prompt is computationally infeasible and introduces performance-degrading noise.

Methods

The authors propose a two-part solution:

1. NAPsack (Data Pipeline): To scale data collection, they developed NAPsack, which continuously records screenshots and I/O events (clicks, keystrokes). It uses a vision-language model (VLM) to compress these raw signals into high-level natural language action captions (e.g., "Clicked the 'Downloads' folder").

Figure 2: NAPsack enables passive collec- tion of human-computer interaction data. It ingests screenshots and input events, com- presses them to retain only meaningful frames, and annotates with action descriptions.

2. LongNAP (The Model): LongNAP is a user model that operates in two distinct phases:

  • Reasoning to Retrieve: Conditioned on the current screen, the model generates a "reasoning trace" (a thought process about what the user might do) and uses it as a query to retrieve relevant past traces from a memory library using BM25.
  • Reasoning to Predict: The model integrates these retrieved memories to refine its reasoning and predict the next 8 actions.

The system is trained end-to-end using Group Relative Policy Optimization (GRPO). Instead of standard cross-entropy loss, it is optimized against a "temporal reward" generated by an LLM-as-a-judge, which scores the semantic similarity between the model's predictions and what the user actually did next.

Figure 1: Predictions from LongNAP are generated in a two-phase process. First, Long- NAP Reasons to Retrieve: conditioned on what the user sees now (a set of paper reviews), LongNAP generates a trace and uses it to retrieve past traces. With retrieved traces, Long- NAP Reasons to Predict: generating a revised trace, adding it back to memory, and then predicting the next steps a user might take. The prediction is compared against a ground truth (LLM-as-a-judge reward), then optimized with GRPO (Shao et al., 2024b).

Datasets

  • Screenomics: The authors leveraged a massive existing repository of ~170M timelapse screenshots from 257 users.
  • NAP Dataset: Using NAPsack, they annotated a month of continuous phone usage from 20 users, resulting in 360K actions across 1,800 hours of screen time. This dataset covers diverse activities from shopping and gaming to professional workflows.

Key Insights and Ideas

  • Reasoning as a Retrieval Query: One of the most clever aspects is using the model's own "Chain-of-Thought" as a semantic query for retrieval. This allows the model to search its memory for patterns like "this user usually procrastinates on reviews" rather than just looking for keyword matches in screenshots.
  • Natural Language Models of the User: The reasoning traces evolve during training. Retrieval traces become short and query-like, while prediction traces become descriptive "explanations" of user behavior.
  • Predictability Variance: The authors found that some users are inherently more predictable than others. Users who repeat similar tasks daily (e.g., taking surveys) are easier to model, whereas "house-hunters" or social media users exhibit more diverse, harder-to-predict patterns.
Figure 6: LongNAP learns diverse reasoning strategies when trained on different users. Different colors correspond to different users. We embed (using the all-MiniLM-L6-v2 model; Wang et al. (2020); Reimers & Gurevych (2019)) and visualize traces from the reasoning to predict phase across a subset of users with tSNE. For some users (e.g. u7, blue, almost exclusively takes online surveys), reasoning strategies are homogenous. For others, LongNAP generates a library of reasoning patterns for specific contexts (u8; in orange).

Key Results

  • Superior Performance: LongNAP achieved a 79% relative improvement over supervised fine-tuning (SFT) and a 39% improvement over few-shot RAG baselines when trained on individual users.
  • Generalization: When trained across multiple individuals, LongNAP still outperformed the strongest closed-source baseline (Gemini 3.0 Flash RAG) by 13%.
  • Alignment: 17.1% of LongNAP's predicted trajectories were well-aligned with ground truth (score ≥ 0.5). For the model's most confident predictions, this accuracy rose to 26%.
Comparison of LongNAP against SFT and prompted baselines

Limitations and Future Work

  • Privacy: Operating over a user's entire device history is highly sensitive. The authors suggest future work should focus on decentralized, on-device training and inference to mitigate these risks.
  • Environmental Context: The model only sees what is on the screen. It lacks context about the user's physical world (e.g., a meeting happening in the room) which often dictates the next action.
  • Reward Hacking: While not observed in this study, the authors acknowledge that models trained with LLM-as-a-judge rewards may eventually learn to "hack" the judge rather than improve actual prediction quality.
  • Horizon: The current model predicts 8 actions ahead; extending this to longer time horizons remains a challenge.

Summary updated

BibTeX
@inproceedings{shaikh2026learning,
  author = {Omar Shaikh and Valentin Teutschbein and Kanishk Gandhi and Yikun Chi and Nick Haber and Thomas N. Robinson and Nilam Ram and Byron Reeves and Sherry Yang and Michael S. Bernstein and Diyi Yang},
  title = {{Learning Next Action Predictors from Human-Computer Interaction}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=SX7AUEqs4L},
}
Figure