The stability of Nd(Fe,T) 12 and the site preference of ternary elements T (T=Ti, V, Cr, Si) are investigated by using pair potentials based on ab initio method and lattice inversion technique. The calculated lattice parameters are found in good agreement with the values deduced from experiments. The calculated results show that either V, Ti or Cr makes the cohesive energy decrease markedly, indicating that these atoms can stabilize Nd(Fe,T) 12 with ThMn 12 structure. When T occupies 8i site, the cohesive energy decrease greatly and the order of site preference of these stabilizing elements T is 8i, 8j and 8f. Based on the phase stability of compounds Nd(Fe,T) 12 and site preference of ternary elements, the effect of nitrogen atom on the crystal structure are studied. For T=Ti, the doped nitrogen atom does not affect the order of site preference of the stabilizing elements. Moreover, the nitrogen atom preferentially occupies 2b and 4c sites in our calculated model. Above results, together with the restoration of Nd–Fe–T and Nd–Fe–T–N system undergoing global deformation, atom random shift and high temperature disturbance, demonstrate that it is effective to simulate the phase stability and geometry structure of Nd–Fe–Ti–N intermetallics using the quasi ab initio interatomic potentials.