Epitaxially grown ternary and quaternary layers of GaAs based dilute nitrides have been exposed to H+ and D+ ion bombardment to investigate the interaction between hydrogen (deuterium) and nitrogen. Low-temperature Fourier transform infrared absorption measurements reveal the formation of N-H (N-D) complexes by the appearance of high-frequency absorption bands in the mid-infrared due to vibrational modes of H(D). In thin layers, the transformation of isolated substitutional nitrogen, N-As, into complexes involving H (D) is complete, in thick (500-1000 nm) layers only partial. Analyses for the band intensities dependent on variations of the sample structure and parameters during ion irradiation challenge the model of a unique defect associated with the observed vibrational modes. A new model is proposed based to two different N-H (N-D) centers, each involving one H (D) atom.