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

This paper introduces and validates a hybrid cMABxLLM framework for physical activity interventions that combines contextual bandits for selecting intervention types with large language models for personalized message generation, demonstrating superior adaptability, reduced token usage, and improved support for under-delivered strategies compared to standalone models in a 30-day trial.

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

Published 2026-03-04
📖 4 min read☕ Coffee break read

Imagine you are trying to get a friend to start walking more every day. You know that what works for them on a sunny Monday morning might be totally different from what works on a rainy, stressful Friday afternoon.

This paper is about building a "Super-Coach" that knows exactly what to say to keep people moving, without getting tired or confused. The researchers combined two powerful tools to create this coach: a Smart Decision-Maker and a Creative Writer.

Here is the breakdown of their experiment in simple terms:

1. The Two Tools in the Toolbox

  • The Smart Decision-Maker (Contextual Bandit): Think of this as a traffic controller. It looks at the "traffic" (the user's mood, stress level, and confidence) and decides which type of message to send. It has four pre-set strategies:

    1. Self-Monitoring: "Hey, let's track your steps."
    2. Gain-Framing: "Walking will make you feel energetic and happy!" (Focus on the good stuff).
    3. Loss-Framing: "If you don't walk, you might feel sluggish and gain weight." (Focus on avoiding the bad stuff).
    4. Social Comparison: "Everyone else in your group is walking; join them!"
    • The Problem: This controller is great at picking the right strategy, but it's stuck using the same old, pre-written scripts. It can't change the tone or wording to fit the person's specific mood that day.
  • The Creative Writer (Large Language Model / LLM): Think of this as a talented speechwriter. It can write a unique, personalized message for any situation. It can sound empathetic, funny, or serious depending on what the user just wrote.

    • The Problem: If you let the speechwriter choose the strategy and write the message, it can get confused, make inconsistent choices, or become too expensive to run (like hiring a writer for every single sentence).

2. The "Hybrid" Solution: The Best of Both Worlds

The researchers created a Hybrid Coach (cMABxLLM) that splits the job:

  1. The Traffic Controller looks at the data and says, "Today, this person needs a Gain-Framed message."
  2. The Speechwriter takes that instruction and writes a beautiful, unique message: "Since you're feeling a bit tired from work, remember that a quick 15-minute walk could be the perfect reset button to boost your energy for the evening!"

This way, the decision is logical and transparent (we know why they chose that strategy), but the words are fresh and personal.

3. The Experiment: A 30-Day Challenge

The team tested this on 54 people over 30 days. They split the participants into five groups to see which "Coach" worked best:

  • Group A (Random): Got messages assigned by a coin flip.
  • Group B (Traffic Controller Only): Got the right strategy, but with boring, pre-written templates.
  • Group C (Speechwriter Only): The AI picked the strategy and wrote the message.
  • Group D (Speechwriter + History): The AI picked the strategy and wrote the message, remembering what it said yesterday to avoid repetition.
  • Group E (The Hybrid): The Traffic Controller picked the strategy, and the Speechwriter wrote the message.

4. What Did They Find?

  • Personalization Wins: People loved the messages written by the Speechwriter (Groups C, D, and E) much more than the boring, pre-written templates. They felt the messages were "for them."
  • The Hybrid is the Sweet Spot: The Hybrid Coach (Group E) was just as popular as the pure Speechwriter groups, but it had two huge advantages:
    1. It was cheaper: It didn't need to ask the AI to "think" about which strategy to pick, saving money and computing power.
    2. It was clearer: Because the Traffic Controller made the choice, the researchers knew exactly why a specific message was sent. This makes it easier to trust and improve the system later.
  • The "Good News" vs. "Bad News" Rule: Interestingly, people generally liked messages that focused on the benefits of walking (Gain-Framing) more than messages that focused on the costs of not walking (Loss-Framing). Even the AI couldn't make the "scary" messages feel as good as the "encouraging" ones.

5. The Takeaway

The study shows that you don't have to choose between a logical robot and a creative human-like writer. By letting a logical algorithm decide what to say and a creative AI decide how to say it, you get a system that is:

  • Personalized: It feels like a real friend talking to you.
  • Efficient: It doesn't waste money or energy.
  • Trustworthy: We can understand the logic behind the decisions.

In short: They built a coach that knows when to be tough, when to be gentle, and how to say it in a way that makes you actually want to go for a walk.

Get papers like this in your inbox

Personalized daily or weekly digests matching your interests. Gists or technical summaries, in your language.

Try Digest →