We characterize the atomic processes that underlie forming, reset, and set in HfO 2 -based resistive random access memory (RRAM) cells through molecular dynamics (MD) simulations, using an extended charge equilibration method to describe external electric fields. By tracking the migration of oxygen ions and the change in coordination of Hf atoms in the dielectric, we characterize the formation and dissolution of conductive filaments (CFs) during the operation of the device with atomic detail. Simulations of the forming process show that the CFs form through an oxygen exchange mechanism, induced by a cascade of oxygen displacements from the oxide to the active electrode, as opposed to aggregation of pre-existing oxygen vacancies. However, the filament breakup is dominated by lateral, rather than vertical (along the filament), motion of vacancies. In addition, depending on the temperature of the system, the reset can be achieved through a redox effect (bipolar switch), where oxygen diffusion is governed by the applied bias, or by a thermochemical process (unipolar switch), where the diffusion is driven by temperature. Unlike forming and similar to reset, the set process involves lateral oxygen atoms as well. This is driven by field localization associated with conductive paths.