In situ second harmonic generation (SHG) observation of PMDA–ODA–DR1 polyimide films prepared by different preparative procedures were studied to understand the effects of the residual acid and the imidization byproduct and the extent of imidization on the SHG characteristics of the PMDA–ODA–DR1 polyimides. PMDA–ODA–DR1 polyimides with or without removal of salt were also investigated to study the influence of remaining triethyl hydrogen ammonium chloride salt on the SHG characteristics and reliability of the polymers. A blue shift in the UV/vis spectrum during poling was observed for the low temperature‐baked film, but did not occur for the high‐temperature‐baked film. Both high temperature imidization and removal of the byproduct organic salt did not only improve the poling efficiency of PMDA–ODA–DR1 polyimide as a SHG material, but also slowed down the relaxation of the film and made the film more reliable. © 1995 John Wiley & Sons, Inc.