  Reinforcement learning (RL) is an effective framework for solving sequential
decision-making tasks. However, applying RL methods in medical care settings is
challenging in part due to heterogeneity in treatment response among patients.
Some patients can be treated with standard protocols whereas others, such as
those with chronic diseases, need personalized treatment planning. Traditional
RL methods often fail to account for this heterogeneity, because they assume
that all patients respond to the treatment in the same way (i.e., transition
dynamics are shared). We introduce Compositional Fitted $Q$-iteration (CFQI),
which uses a compositional task structure to represent heterogeneous treatment
responses in medical care settings. A compositional task consists of several
variations of the same task, each progressing in difficulty; solving simpler
variants of the task can enable efficient solving of harder variants. CFQI uses
a compositional $Q$-value function with separate modules for each task variant,
allowing it to take advantage of shared knowledge while learning distinct
policies for each variant. We validate CFQI's performance using a Cartpole
environment and use CFQI to recommend electrolyte repletion for patients with
and without renal disease. Our results demonstrate that CFQI is robust even in
the presence of class imbalance, enabling effective information usage across
patient sub-populations. CFQI exhibits great promise for clinical applications
in scenarios characterized by known compositional structures.
