Because of their brightness , gamma-ray burst ( GRB ) afterglows are viable targets for investigating the dust content in their host galaxies . Simple intrinsic spectral shapes of GRB afterglows allow us to derive the dust extinction . Recently , the extinction data of GRB afterglows are compiled up to redshift z = 6.3 , in combination with hydrogen column densities and metallicities . This data set enables us to investigate the relation between dust-to-gas ratio and metallicity out to high redshift for a wide metallicity range . By applying our evolution models of dust content in galaxies , we find that the dust-to-gas ratio derived from GRB afterglow extinction data are excessively high such that they can be explained with a fraction of gas-phase metals condensed into dust ( f _ { \mathrm { in } } ) \sim 1 , while theoretical calculations on dust formation in the wind of asymptotic giant branch stars and in the ejecta of Type II supernovae suggest a much more moderate condensation efficiency ( f _ { \mathrm { in } } \sim 0.1 ) . Efficient dust growth in dense clouds has difficulty in explaining the excessive dust-to-gas ratio at metallicities Z / \mathrm { Z } _ { \sun } < \epsilon , where \epsilon is the star formation efficiency of the dense clouds . However , if \epsilon is as small as 0.01 , the dust-to-gas ratio at Z \sim 10 ^ { -2 } Z _ { \sun } can be explained with n _ { \mathrm { H } } \ga 10 ^ { 6 } cm ^ { -3 } . Therefore , a dense environment hosting dust growth is required to explain the large fraction of metals condensed into dust , but such clouds should have low star formation efficiencies to avoid rapid metal enrichment by stars .