The relationship between the optical and structural properties in GaAs/Si heteroepitaxial layers (heteroepilayers) grown by molecular beam epitaxy with various buffer layers (GaAs, AlAs, GaAs/AlAs superlattice (SL), and GaAs/Si SL with layer thickness of 10-50 nm) at the interface between the GaAs and Si are examined using photoluminescence (PL) spectroscopy, double-crystal X-ray diffraction, and transmission electron microscopy (TEM). In as-grown samples, the use of various buffer layers grown at low temperatures improves the crystalline quality and reduces the density of non-radiative centers. The optimum annealing temperature for improving the crystalline quality of GaAs/Si heteroepilayers, regardless of whether a buffer layer was used during growth, is between 950 and 1000-degrees-C as determined by PL intensities, full width at half-maximum of X-ray rocking curves, and threading-dislocation density. In contrast, annealing at temperatures higher than 900-degrees-C for GaAs/Si heteroepilayers with SL buffer layers degrades the surface morphology and does not improve either the optical or structural properties, because annealing damages the SL structures. The crystalline quality of a 1 mum thick GaAs heteroepilayer without a buffer layer or with a GaAs buffer layer is drastically improved by ex-situ annealing at temperatures higher than 950-degrees-C. The threading-dislocation density decreases from values on the order of 10(11)-10(12) cm-2 in the as-grown state to values on the order of 10(6)-10(7) cm-2 near the surface.