Dear Student,
In the electrolytic reduction of alumina, oxygen is evolved which goes to anode and reacts with graphite to give CO2 or CO. This prevents the oxidation of aluminium by oxygen. In doing so, the graphite gets consumed and thus needs to be replaced.
Regards,