  Mean field approximation is a powerful technique to study the performance of
large stochastic systems represented as $n$ interacting objects. Applications
include load balancing models, epidemic spreading, cache replacement policies,
or large-scale data centers. Mean field approximation is asymptotically exact
for systems composed of $n$ homogeneous objects under mild conditions. In this
paper, we study what happens when objects are heterogeneous. This can represent
servers with different speeds or contents with different popularities. We
define an interaction model that allows obtaining asymptotic convergence
results for stochastic systems with heterogeneous object behavior, and show
that the error of the mean field approximation is of order $O(1/n)$. More
importantly, we show how to adapt the refined mean field approximation,
developed by Gast et al. 2019, and show that the error of this approximation is
reduced to $O(1/n^2)$. To illustrate the applicability of our result, we
present two examples. The first addresses a list-based cache replacement model
RANDOM($m$), which is an extension of the RANDOM policy. The second is a
heterogeneous supermarket model. These examples show that the proposed
approximations are computationally tractable and very accurate. They also show
that for moderate system sizes ($n\approx30$) the refined mean field
approximation tends to be more accurate than simulations for any reasonable
simulation time.
