Greenhouse gases emitted by the aluminum electrolysis industry have brought great challenges to environmental protection. To address this problem, understanding the micro-generation mechanism of greenhouse gases in the electrolysis process is of great significance to their source suppression. Based on the first principles calculation method, the formation paths of CO, CO2 and COF2 during normal electrolysis were obtained by studying the adsorption behavior of oxygen and fluorine complex anions (short for [O]2−, [F]−) on the anode surface in cryolite alumina molten salt. The calculation results indicate that the O and F atoms prefer to adsorb at bridge site 1 of Model A, with the adsorption energies of −4.82 eV and −3.33 eV. In the [O]2− priority discharge stage, Path 3 is the most likely path for CO2 generation, while in the [O]2−, [F]− co-discharge stage, Path 3 is the most likely path for COF2 generation. It is deduced that the thermal decomposition of COF2 at high temperature should account for the generation of CF4 with a low concentration of the so-called non-anode effect PFC (NAE-PFC). Experiments were also conducted to verify the calculation by disclosing the bonding information of C, O and F, which are in good accordance with the results calculated by the first principle.