Resistive switching devices (RRAMs) have been proposed a promising candidate for future memory and neuromorphic applications. Central to the successful application of these emerging devices is the understanding of the resistance switching and failure mechanism, and identification of key physical parameters that will enable continued device optimization. In this study, we report detailed retention analysis of a TaOx based RRAM at high temperatures and the development of a microscopic oxygen diffusion model that fully explains the experimental results and can be used to guide future device developments. The device conductance in low resistance state (LRS) was constantly monitored at several elevated temperatures (above 300 degrees C), and an initial gradual conductivity drift followed by a sudden conductance drop were observed during retention failure. These observations were explained by a microscopic model based on oxygen vacancy diffusion, which quantitatively explains both the initial gradual conductance drift and the sudden conductance drop. Additionally, a non-monotonic conductance change, with an initial conductance increase followed by the gradual conductance decay over time, was observed experimentally and explained within the same model framework. Specifically, our analysis shows that important microscopic physical parameters such as the activation energy for oxygen vacancy migration can be directly calculated from the failure time versus temperature relationship. Results from the analytical model were further supported by detailed numerical multi-physics simulation, which confirms the filamentary nature of the conduction path in LRS and the importance of oxygen vacancy diffusion in device reliability. Finally, these high-temperature stability measurements also reveal the existence of multiple filaments in the same device. (C) 2014 AIP Publishing LLC.