The reversible switching between the amorphous and crystalline phases of Ge2Sb2Te5 (GST) is investigated with ab initio molecular dynamics. We apply different quench rates (-16 K/ps, -5 K/ps, -2 K/ps, and -0.45 K/ps) and different annealing temperatures (500 K, 600 K, 700 K, and 800 K) to amorphize and crystallize GST respectively. Results show that the generated amorphous is strongly dependent on the quench rate. For -16 K/ps and -5 K/ps, generated amorphous samples have different density of crystal seeds, higher in the later. The amorphous structure formed at -2 K/ps contains a single crystalline cluster, while that formed at the quench rate of -0.45 K/ps had sufficient time to completely crystallize the amorphous phase. Annealing the amorphous systems formed at different rates shows that crystallization depends both on the annealing temperature and on the structure of the initial system (i.e., whether or not it contains crystalline clusters or crystal seeds). At 500 K, formation of crystalline clusters occurs readily within a few ps while the rate at which they grow is slow, taking 0.9 ns to complete the crystallization. In contrast, crystalline cluster formation is inhibited at 800 K. In the intermediate temperature range, both crystalline cluster formation and growth occur within a few hundred ps indicating that these temperatures leads to the fastest crystallization. The crystallization of a 63-atom at ∼900 K resulted in a highly relaxed crystal structure showing a clear tendency for separation of Ge and Sb species in layers. This model also indicates a tendency of segregation of vacancies, suggesting that vacancy layering may play a key role in the crystallization process.