Table of Contents
Fetching ...

Tailored Behavior-Change Messaging for Physical Activity: Integrating Contextual Bandits and Large Language Models

Haochen Song, Dominik Hofer, Rania Islambouli, Laura Hawkins, Ananya Bhattacharjee, Zahra Hassanzadeh, Jan Smeddinck, Meredith Franklin, Joseph Jay Williams

TL;DR

The paper introduces a hybrid cMABxLLM framework that separates the decision of which behavior-change intervention to deliver from the linguistic personalization of its content. In a 30-day trial with 93 participants (n=54 active), five delivery models (RCT, cMAB, LLM-only, LLM-tracing, and cMABxLLM) were compared using four PA-promoting intervention types and ecological momentary assessments of message acceptance and motivation. Results show that LLM-based personalization increases message acceptance relative to fixed templates, with cMABxLLM achieving comparable acceptance while offering transparent decision rules and reduced token usage. Motivation changes were modest and noisy, underscoring the need for larger, longer studies and continuous outcome measures; overall, the hybrid approach demonstrates feasibility and provides a deployable blueprint for integrating Bayesian adaptive experimentation with generative models in digital health messaging.

Abstract

Contextual multi-armed bandit (cMAB) algorithms offer a promising framework for adapting behavioral interventions to individuals over time. However, cMABs often require large samples to learn effectively and typically rely on a finite pre-set of fixed message templates. In this paper, we present a hybrid cMABxLLM approach in which the cMAB selects an intervention type, and a large language model (LLM) which personalizes the message content within the selected type. We deployed this approach in a 30-day physical-activity intervention, comparing four behavioral change intervention types: behavioral self-monitoring, gain-framing, loss-framing, and social comparison, delivered as daily motivational messages to support motivation and achieve a daily step count. Message content is personalized using dynamic contextual factors, including daily fluctuations in self-efficacy, social influence, and regulatory focus. Over the trial, participants received daily messages assigned by one of five models: equal randomization (RCT), cMAB only, LLM only, LLM with interaction history, or cMABxLLM. Outcomes include motivation towards physical activity and message usefulness, assessed via ecological momentary assessments (EMAs). We evaluate and compare the five delivery models using pre-specified statistical analyses that account for repeated measures and time trends. We find that the cMABxLLM approach retains the perceived acceptance of LLM-generated messages, while reducing token usage and providing an explicit, reproducible decision rule for intervention selection. This hybrid approach also avoids the skew in intervention delivery by improving support for under-delivered intervention types. More broadly, our approach provides a deployable template for combining Bayesian adaptive experimentation with generative models in a way that supports both personalization and interpretability.

Tailored Behavior-Change Messaging for Physical Activity: Integrating Contextual Bandits and Large Language Models

TL;DR

The paper introduces a hybrid cMABxLLM framework that separates the decision of which behavior-change intervention to deliver from the linguistic personalization of its content. In a 30-day trial with 93 participants (n=54 active), five delivery models (RCT, cMAB, LLM-only, LLM-tracing, and cMABxLLM) were compared using four PA-promoting intervention types and ecological momentary assessments of message acceptance and motivation. Results show that LLM-based personalization increases message acceptance relative to fixed templates, with cMABxLLM achieving comparable acceptance while offering transparent decision rules and reduced token usage. Motivation changes were modest and noisy, underscoring the need for larger, longer studies and continuous outcome measures; overall, the hybrid approach demonstrates feasibility and provides a deployable blueprint for integrating Bayesian adaptive experimentation with generative models in digital health messaging.

Abstract

Contextual multi-armed bandit (cMAB) algorithms offer a promising framework for adapting behavioral interventions to individuals over time. However, cMABs often require large samples to learn effectively and typically rely on a finite pre-set of fixed message templates. In this paper, we present a hybrid cMABxLLM approach in which the cMAB selects an intervention type, and a large language model (LLM) which personalizes the message content within the selected type. We deployed this approach in a 30-day physical-activity intervention, comparing four behavioral change intervention types: behavioral self-monitoring, gain-framing, loss-framing, and social comparison, delivered as daily motivational messages to support motivation and achieve a daily step count. Message content is personalized using dynamic contextual factors, including daily fluctuations in self-efficacy, social influence, and regulatory focus. Over the trial, participants received daily messages assigned by one of five models: equal randomization (RCT), cMAB only, LLM only, LLM with interaction history, or cMABxLLM. Outcomes include motivation towards physical activity and message usefulness, assessed via ecological momentary assessments (EMAs). We evaluate and compare the five delivery models using pre-specified statistical analyses that account for repeated measures and time trends. We find that the cMABxLLM approach retains the perceived acceptance of LLM-generated messages, while reducing token usage and providing an explicit, reproducible decision rule for intervention selection. This hybrid approach also avoids the skew in intervention delivery by improving support for under-delivered intervention types. More broadly, our approach provides a deployable template for combining Bayesian adaptive experimentation with generative models in a way that supports both personalization and interpretability.

Paper Structure

This paper contains 35 sections, 9 equations, 3 figures, 6 tables, 4 algorithms.

Figures (3)

  • Figure 1: Study timeline (Days 1-30): pre-study questionnaire (Day 1), daily EMA and message delivery (Days 2-29), and post-study questionnaire (Day 30).
  • Figure 2: Statistical Directed Acyclic Graphs (DAG) describing the modeling structure of our study.
  • Figure 3: Acceptance rating distributions, stratified by intervention type and model type (e.g., behavioral monitoring; RCT).