Learning Next Action Predictors from Human-Computer Interaction
Organizations: Stanford University · Hasso Plattner Institute · New York University
Abstract
Truly proactive AI systems must anticipate what we will do next. This foresight demands far richer information than the sparse signals we type into our prompts -- it demands reasoning over the entire context of what we see and do. We formalize this as next action prediction (NAP): given a sequence of a user's multimodal interactions with a computer (screenshots, clicks, sensor data), predict that user's next action. Progress on this task requires both new data and modeling approaches. To scale data, we annotate longitudinal, naturalistic computer use with vision-language models. We release an open-source pipeline for performing this labeling on private infrastructure, and label over 360K actions across one month of continuous phone usage from 20 users, amounting to 1,800 hours of screen time. We then introduce LongNAP, a user model that combines parametric and in-context learning to reason over long interaction histories. LongNAP is trained via policy gradient methods to generate user-specific reasoning traces given some context; retrieve relevant traces from a library of past traces; and then apply retrieved traces in-context to predict future actions. Using an LLM-as-judge evaluation metric (0-1 similarity to ground truth), LongNAP significantly outperforms supervised finetuning and prompted baselines on held-out data (by 79% and 39% respectively). Additionally, LongNAP generalizes to held out users when trained across individuals. The space of next actions a user might take at any moment is unbounded, spanning thousands of possible outcomes. Despite this, 17.1% of LongNAP's predicted trajectories are well-aligned with what a user does next (LLM-judge score 0.5). This rises to 26% when we filter to highly confident predictions. In sum, we argue that learning from the full context of user behavior to anticipate user needs is now a viable task with substantial opportunity.
Figures & tables
| Ground-Truth | Predicted | Predicted | Predicted | |
|---|---|---|---|---|
| Score = 1.0 | Score = 0.72 | Score = 0.52 | Score = 0.15 | |
| 1 | Switched to “Australia vs Zimbabwe” tab, entered fullscreen | Switched to “Australia vs Zimbabwe” tab, entered fullscreen | Switched to “Australia vs Zimbabwe” tab, clicked player | Clicked on YouTube home page, browsed recommended videos |
| 2 | Clicked thumbnail in “Key Moments” section | Clicked on video player timeline to skip forward | Pressed “f” to enter fullscreen on cricket video | Clicked video titled “Best Cricket Catches of 2025” |
| 3 | Pressed “esc” to exit fullscreen | Pressed “esc” to exit fullscreen | Pressed “esc” to exit fullscreen | Pressed “esc” to exit fullscreen |
| 4 | Switched to W&B workspace, clicked “Runs” icon | Switched to W&B workspace, scrolled through dashboard | Opened new tab, typed “wandb.ai” into address bar | Typed “australia cricket schedule” into Google search bar |
| 5 | Switched to “Australia vs Zimbabwe,” entered fullscreen | Switched to “Australia vs Zimbabwe” tab, entered fullscreen | Scrolled through W&B charts for training metrics | Clicked ESPN Cricinfo link in search results |
| Method | Judge Score ( ) | Human WR % ( ) | Size ( ) |
|---|---|---|---|
| naive | 0.48 0.03 | 19.2 6.7 | |
| + split | 0.57 0.03 | 45.4 8.7 | |
| + split + compress | 0.60 0.03 | 49.6 8.9 | |
| + split + compress + IO | 0.70 0.03 | 85.8 6.0 |
| User | Gemini | Qwen-2.5-VL-7B | ||||
|---|---|---|---|---|---|---|
| Zero-shot | RAG | Zero-shot | RAG | SFT | LongNAP | |
| 0.28 | 0.29 | 0.21 | 0.23 | 0.23 | +0.12 0.41 | |
| 0.21 | 0.22 | 0.15 | 0.17 | 0.18 | +0.12 0.34 | |
| 0.23 | 0.23 | 0.19 | 0.18 | 0.17 | +0.10 0.33 | |
| 0.24 | 0.23 | 0.14 | 0.16 | 0.17 | +0.09 0.32 | |
| 0.23 | 0.24 | 0.18 | 0.16 | 0.16 | +0.10 0.34 | |
| Model | Method | Win Rate (%) |
| Qwen 2.5 VL | LongNAP | 79.0 6.6 |
| SFT | ||
| Few-shot RAG | ||
| Zero-shot | ||
| Gemini | Few-shot RAG | |
| Zero-shot |
| Model | Method | ||||||
|---|---|---|---|---|---|---|---|
| Gemini | Zero-shot | 0.22 | 0.27 | 0.22 | 0.20 | 0.20 | 0.21 |
| Few-shot RAG | 0.23 | 0.26 | 0.23 | 0.22 | 0.21 | 0.22 | |
| Qwen VL | Zero-shot | 0.16 | 0.22 | 0.13 | 0.14 | 0.16 | 0.14 |
| Few-shot RAG | 0.17 | 0.23 | 0.15 | 0.18 | 0.14 | 0.18 | |
| SFT | 0.17 | 0.22 | 0.14 | 0.16 | 0.15 | 0.17 | |
| LongNAP | 0.26 | 0.31 | 0.28 | 0.22 | 0.21 | 0.26 |
| Model | ||||||
|---|---|---|---|---|---|---|
| LongNAP | ||||||
| Ablations | ||||||
| Remove reasoning | (-0.07) | (-0.09) | (-0.06) | (-0.06) | (-0.09) | (-0.06) |
| Remove retriever | (-0.06) | (-0.07) | (-0.07) | (-0.01) | (-0.08) | (+0.01) |
| Shuffle dataset | (-0.04) | (-0.05) | (-0.04) | (+0.00) | (-0.05) | (-0.00) |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Event type | GAP threshold (s) | MAX duration (s) |
|---|---|---|
| Click | 0.2 | 0.3 |
| Move | 0.5 | 4.0 |
| Scroll | 0.5 | 3.0 |
| Key | 0.5 | 6.0 |
| Hyperparameter | LongNAP | SFT |
| Effective Batch Size | 16 | 16 |
| Learning Rate | 3e-5 | 1e-4 |
| Group Size | 4 | - |
| Epochs | 10 | 10 |
| Actions in history | 16 | 16 |
| Actions to predict | 8 | 8 |
| Score | Ground Truth | Predicted Actions |
|---|---|---|
| 0.05 | 1. Typed “icc world cup” into search bar 2. Clicked “STANDINGS” tab in ICC T20 World Cup widget 3. Scrolled through standings table 4. Clicked “SL” (Sri Lanka) in standings 5. Switched to W&B dashboard tab 6. Scrolled through W&B charts 7. Clicked “train/entropy” chart in W&B 8. Clicked chat with “Omar Shaikh” in Slack | 1. Typed “x” into address bar, pressed Enter 2. Clicked Twitter logo in top left 3. Typed “arch” into Twitter search bar 4. Clicked search result for “Arch Labor” 5. Clicked “Home” button in Twitter sidebar 6. Scrolled through Twitter feed 7. Clicked search button on Twitter 8. Typed “forms” into Twitter search bar |
| 0.12 | 1. Clicked “rouge-score” on PyPI, copied install command 2. Ran uv pip install rouge-score in terminal 3. Scrolled through “rouge-score” PyPI page 4. Ran accelerate launch training command 5. Scrolled through “rouge-score” PyPI page 6. Switched between W&B, Google Doc, and terminal 7. Typed training command, cancelled with Ctrl+C 8. Ran cd sim-v2 and git pull | 1. Scrolled through search results for “install rouge score” 2. Clicked on a search result for “install rouge score” 3. Scrolled down “crag” repository on GitHub 4. Clicked “hub/parouza” link in GitHub repo 5. Clicked “eval” directory in file explorer 6. Pressed Enter to run evaluate_qm9.py 7. Switched to Google Chrome window 8. Copied pip install command from GitHub |
| 0.20 | 1. Clicked on a purple property pin on the map 2. Clicked on the “2.8k” property pin 4. Clicked on the “3.3k” property pin 6. Clicked on the “5.3k” property pin 8. Clicked on the “$2.8k” property pin | 1. Scrolled through search results and map on Zillow 2. Clicked on a property marker on the Zillow map 3. Clicked “Down” arrow to expand price filter 4. Clicked “OK” to apply price filter settings 5. Scrolled through filtered search results 6. Selected a property listing card from results 7. Clicked “Show on map” on the listing page 8. Scrolled through rental listings on Zillow map |
| 0.35 | 1. Scrolled through W&B dashboard 2. Clicked “kanishkgandhi” project link in W&B 3. Clicked on a run in W&B sidebar 4. Clicked “kanishkgandhi’s workspace” tab 5. Scrolled through Claude conversation 6. Clicked “New Tab” button in Chrome 7. Switched to W&B tab 8. Scrolled through W&B for “context-distillation-goyal” | 1. Scrolled through W&B charts on “NAP Time” dashboard 2. Closed W&B dashboard tab in Chrome 3. Switched to Claude.ai tab 4. Closed current tab in Chrome 5. Switched to Claude tab 6. Inspected text in Claude chat 7. Re-fetched view selection content from Claude 8. Re-fetched view selection content from Claude |
| 0.42 | 1. Switched to “Australia vs Zimbabwe” tab, entered fullscreen 2. Clicked thumbnail in “Key Moments” section 3. Pressed “esc” to exit fullscreen 4. Switched to W&B workspace, clicked “Runs” icon 5. Switched to “Australia vs Zimbabwe,” entered fullscreen 6. Pressed “esc” to exit fullscreen 7. Switched to W&B tab, scrolled through charts 8. Scrolled through W&B dashboard | 1. Switched to “Australia vs Zimbabwe” tab 2. Clicked full screen button on cricket video 3. Clicked History channel logo at bottom of player bar 4. Pressed “escape” in Chrome 5. Clicked on the video player 6. Clicked History channel logo at bottom of player bar 7. Clicked History channel logo, pressed “space” 8. Pressed “space” in Chrome |
| Score | Ground Truth | Predicted Actions |
|---|---|---|
| 0.52 | 1. Switched to “Australia vs Zimbabwe” tab, entered fullscreen 2. Clicked thumbnail in “Key Moments” section 3. Pressed “esc” to exit fullscreen 4. Switched to W&B workspace, clicked “Runs” icon 5. Switched to “Australia vs Zimbabwe,” entered fullscreen 6. Pressed “esc” to exit fullscreen 7. Switched to W&B tab, scrolled through charts 8. Scrolled through W&B dashboard | 1. Switched to “Australia vs Zimbabwe” tab, clicked player 2. Pressed “f” to enter fullscreen on cricket video 3. Pressed “esc” to exit fullscreen 4. Opened new tab, typed “wandb.ai” into address bar 5. Scrolled through W&B charts for training metrics 6. Clicked “Table” view in W&B dashboard 7. Switched to YouTube, clicked recommended video 8. Scrolled through comments section on YouTube |
| 0.72 | 1. Switched to “Australia vs Zimbabwe” tab, entered fullscreen 2. Clicked thumbnail in “Key Moments” section 3. Pressed “esc” to exit fullscreen 4. Switched to W&B workspace, clicked “Runs” icon 5. Switched to “Australia vs Zimbabwe,” entered fullscreen 6. Pressed “esc” to exit fullscreen 7. Switched to W&B tab, scrolled through charts 8. Scrolled through W&B dashboard | 1. Switched to “Australia vs Zimbabwe” tab, entered fullscreen 2. Clicked on video player timeline to skip forward 3. Pressed “esc” to exit fullscreen 4. Switched to W&B workspace, scrolled through dashboard 5. Switched to “Australia vs Zimbabwe” tab, entered fullscreen 6. Pressed “esc” to exit fullscreen 7. Switched to W&B tab, clicked on a chart 8. Clicked “Table” view in W&B workspace |
| 0.78 | 1. Clicked on a purple property pin on the map 2. Clicked on the “2.8k” property pin 4. Clicked on the “3.3k” property pin 6. Clicked on the “5.3k” property pin 8. Clicked on the “$2.8k” property pin | 1. Clicked on a purple property pin on the map 2. Clicked on the “2.8k” property pin 4. Clicked on the “3.3k” property pin 6. Clicked on the “4.2k” property pin 8. Clicked on the “$3.1k” property pin |
| 0.82 | 1. Typed “icc world cup” into search bar 2. Clicked “STANDINGS” tab in ICC T20 World Cup widget 3. Scrolled through standings table 4. Clicked “SL” (Sri Lanka) in standings 5. Switched to W&B dashboard tab 6. Scrolled through W&B charts 7. Clicked “train/entropy” chart in W&B 8. Clicked chat with “Omar Shaikh” in Slack | 1. Typed “icc world cup” into search bar 2. Clicked “STANDINGS” tab in ICC T20 World Cup widget 3. Scrolled through standings table 4. Clicked “IND” (India) in standings 5. Switched to W&B dashboard tab 6. Scrolled through W&B charts 7. Clicked “train/loss” chart in W&B 8. Clicked chat with “Omar Shaikh” in Slack |
| 0.98 | 1. Clicked “rouge-score” on PyPI, copied install command 2. Ran uv pip install rouge-score in terminal 3. Scrolled through “rouge-score” PyPI page 4. Ran accelerate launch training command 5. Scrolled through “rouge-score” PyPI page 6. Switched between W&B, Google Doc, and terminal 7. Typed training command, cancelled with Ctrl+C 8. Ran cd sim-v2 and git pull | 1. Clicked “rouge-score” on PyPI, copied install command 2. Ran uv pip install rouge-score in terminal 3. Scrolled through “rouge-score” PyPI page 4. Ran accelerate launch with dataset arguments 5. Scrolled through “rouge-score” PyPI page 6. Switched between W&B, Google Doc, and terminal 7. Typed CUDA training command, cancelled with Ctrl+C 8. Ran cd sim-v2 and git pull |