Transition metal oxide memristors, or resistive random-access memory (RRAM) switches, are under intense development for storage-class memory because of their favorable operating power, endurance, speed, and density. Their commercial deployment critically depends on predictive compact models based on understanding nanoscale physicochemical forces, which remains elusive and controversial owing to the difficulties in directly observing atomic motions during resistive switching, Here, using scanning transmission synchrotron x-ray spectromicroscopy to study in-situ switching of hafnium oxide memristors, we directly observed the formation of a localized oxygen-deficiency-derived conductive channel surrounded by a low-conductivity ring of excess oxygen. Subsequent thermal annealing homogenized the segregated oxygen, resetting the cells towards their as-grown resistance state. We show that the formation and dissolution of the conduction channel are successfully modeled by radial thermophoresis and Fick diffusion of oxygen atoms driven by Joule heating. This confirmation and quantification of two opposing nanoscale radial forces that affect bipolar memristor switching are important components for any future physics-based compact model for the electronic switching of these devices.Keywords: Memristors, thermophoresis, operating mechanism, oxygen migration, filament.The recent surge in technological and commercial interest in transition-metal-oxide memristors, especially those utilizing hafnium oxide as the switching material, is accompanied by urgent efforts to formulate a compact predictive model of their behavior in large-scale integrated circuits. 1-9 Several efforts in this direction include first-principles and analytical modeling, 8,10,11 materials characterization, 2,12,13 and circuit characterization and modeling. 14,15 The resultant models are incomplete and controversial owing to a lack of understanding of the nanoscale physico-chemical forces that determine atomic motions during switching, particularly with regard to the presence and sign of temperaturegradient-driven thermophoresis of oxygen atoms, and quantification of the concentration-gradient-driven Fick diffusion. 7,8,11,16,17 Direct in-situ and in-operando studies of localized atomic motion during memristor switching can resolve these issues and improve our modeling, but such observations face steep experimental challenges due to the extremely high resolution and sensitivity required to detect atomic motions inside a functioning cell. 2,4,18,19 In order to non-destructively study the chemical and position changes associated with oxygen atoms during memristor operation, we utilized a synchrotron-based scanning transmission x-ray microscopy (STXM) system tuned to the O K-edge with a spatial resolution of <31 nm and a spectral resolution of ~70 meV. 20 We analyzed a prototype device that had only one oxide layer to permit an unambiguous analysis of the results. To enable x-ray transmission experiments, operational memristor cells for this study wer...