We have investigated a growth technique to realize high-quality multiple stacking of self-assembled InAs quantum dots (QDs) on GaAs (001) substrates, in which GaNxAs1-x dilute nitride material was used as a strain compensation layer (SCL). The growth was achieved by atomic hydrogen-assisted rf molecular beam epitaxy, and the effect of strain compensation was systematically investigated by using high-resolution x-ray diffraction measurements. By controlling the net average lattice strain to a minimum by covering each QD layer with a 40-nm-thick GaN0.005As0.995 SCL, we obtained a superior QD structure with no degradation in size homogeneity. Further, no dislocations were generated even after 30 layers of stacking, and the area density of QDs amounted to as high as 3×1012 cm-2. The photoluminescence peak linewidth was improved by about 22% for QDs embedded in GaNAs SCLs as the accumulation of lattice strain with increasing growth of QD layers was avoided, which would otherwise commonly lead to degradation of size homogeneity and generation of dislocations.