In the course of reactive diffusion of hydrogen in metal-doped glasses, at some conditions, metallic nanoparticles grow forming quasi-periodic layered structure. We have developed a model defining conditions necessary for the formation of the layered structures. The model indicates relatively narrow range of parameters providing the quasi-periodic growth of the nanoparticles. The layered structure arises at relatively low over-saturation by neutral metal in the diffusion zone, due to the competition of two processes: enrichment of the glass by neutral metal atoms via reducing of metal ions by diffusing hydrogen and depletion of the glass by the metal atoms caused their diffusion to the nanoparticles. The model can be also applied to other situations where reactive diffusion inducing the formation and growth of nanoparticles occurs.