Question: “What is the difference between GDP deflator and CPI?”
1) GDP Deflator reflects prices of all goods and services produced within the country, whereas CPI reflects the prices of a representative basket of goods and services purchased by the consumers.
2) CPI uses a fixed basket of goods and services whereas the GDP deflator compared the price of currently produced goods relative to price of goods in the base year.
The two measures of inflation generally in tandem.
See p536-537 of Mankiw(4th edition)