  Since the seminal works in the fifties it has been known that a bath of
non-interacting electrons mediates an interaction between local moments (such
as nuclear spins or magnetic impurities) coupled to distant sites of the
lattice. Recent efforts in simultaneous control of multi-qubit arrays rely on
defining quantum dots in environments which likewise contain electrons capable
of mediating effective interactions. It is therefore interesting to analyze
systems with more than two impurities in higher orders of perturbation theory.
Here we derive and discuss the significance of the effective spin interactions
between four impurities in fourth order of the coupling between the impurities
and the substrate, mediated by conduction electrons of a two-dimensional square
lattice. This effective interaction resembles the ring exchange -- a coupling
of four spins appearing in perturbative treatment of the Hubbard model. Despite
it being a higher-order effect, it can dramatically influence the magnetic
ordering. We show that as an effective interaction between impurity spins, the
ring exchange can also compete with the more familiar two-spin interactions.
