Coherent anti-Stokes Raman spectroscopy (CARS) temperature measurements were performed in the unburned gas in a spark ignition engine.First, as the residual gas mass fraction is one of the factor that is known to cause to autoignition, the effect of the residual gas mass fraction on the unburned gas temperature is estimated. In order to control the residual gas mass fraction, a skip fired cycle method was used., and the single cylinder test engine used in this study was fueled with gasoline (89.9 RON). The residual gas causes the unburned gas temperature to rise by approximately 55 K and it also produces a large temperature variation on the order of ±20 K when expressed as a standard deviation.Second, the unburned gas temperature of the single cylinder test engine and the 4 valve production engine was measured under steady-state engine operation in order to compare the residual gas mass fraction of the test engine with that of the production engine. Because the residual gas mass fraction of the production engine seemed to be smaller than that of the test engine, knock doesn't occur for the 4 valve production engine under the same unburned gas temperature condition of the single cylinder test engine. The results of these experiments concluded that the residual gas mass fraction has a significant effect on the occurrence of knock.