The discovery of slow earthquakes illuminates the existence of a strange depth dependence of seismogenesis, which contradicts the common understanding of smooth brittle/seismic-ductile/aseismic transition as going deeper into the Earth’s surface layers. However, within the transitional layer on plate interfaces, observations have clarified slip velocities of slow earthquakes changing from those slower to faster with increasing depth, as described by the “seismogenic inversion layer.” We propose a new mechanical model that can consistently explain the classic brittle-ductile transition and this inversion phenomenon by considering the heterogeneous fault zone composed of brittle blocks in the ductile matrix. The key mechanism is the interplay between the volumetric fraction of brittle blocks and the viscosity of the surrounding plastically deformed matrix, where the former and the latter decrease with increasing temperature. This model is extended to shallow-slow earthquakes. Our results open a new pathway to infer the deformation mechanisms underlying slow earthquakes.