Atomic switches are considered to be building blocks for future non-volatile data storage and internet of things. However, obtaining device structures capable of ultrahigh density data storage, high endurance, and long data retention, and more importantly, understanding the switching mechanisms are still a challenge for atomic switches. Here, we achieved improved resistive switching performance in a bilayer structure containing aluminum oxide, with an oxygen-deficient oxide as the top switching layer and stoichiometric oxide as the bottom switching layer, using atomic layer deposition. This bilayer device showed a high on/off ratio (10(5)) with better endurance (similar to 2000 cycles) and longer data retention (10(4) s) than single-oxide layers. In addition, depending on the compliance current, the bilayer device could be operated in four different resistance states. Furthermore, the depth profiles of the hourglass-shaped conductive filament of the bilayer device was observed by conductive atomic force microscopy.