Y2O3/AlN composite films with different thicknesses of AlN interlayer were prepared on CVD diamond by RF magnetron sputtering. The influence of AlN thickness on the microstructure, adhesion strength, film stress, thermal shock resistance and infrared transmittance of the films was investigated by X-ray diffractometer, scanning electron microscopy, scanning probe microscopy, UV–Vis spectrophotometer, Fourier transform infrared spectrometer, scratch tester and 3-D optical surface profiler. The results show that CVD diamond coated with Y2O3/AlN composite films with different thicknesses of AlN have different degrees of anti-reflective effects in the 8–10 μm infrared band. The adhesion strength and quality of the composite film were improved with the AlN thickness increased, and the anti-reflective and anti-thermal shock of the film showed a trend of first increasing and then decreasing. CVD diamond coated with Y2O3/AlN composite films with 700 nm AlN interlayer has an average transmittance of 77 % in the 8–10 μm band and a good adhesion between interfaces. It can withstand rapid temperature changes and effectively protect the diamond substrate with little or no degradation of infrared optical properties.