Diodes incorporating a bilayer of a metal oxide and an organic semiconductor can show unipolar, nonvolatile memory behavior after electroforming. Electroforming involves dielectric breakdown induced by prolonged bias voltage stress. When the power dissipated during breakdown is limited, electroforming is reversible and involves formation of defects at the organic-oxide interface that can heal spontaneously. When the power dissipation during breakdown exceeds a certain threshold, electroforming becomes irreversible. The fully electroformed diodes show electrical bistability, featuring (meta) stable states with low and high conduction that can be programmed by voltage pulses. The high conduction results from current flowing via filamentary paths. The bistability is explained by the coexistence of two thermodynamically stable phases at the interface between semiconductor and oxide. One phase contains mainly ionized defects and has a low work function, while the other phase has mainly neutral defects and a high work function. In the diodes, domains of the phase with low work function give rise to current filaments. In the filaments, Joule heating will raise temperature locally. When the temperature exceeds the critical temperature, the filament will switch off. The switching involves a collective recombination of charge carriers trapped at the defects as evidenced by bursts of electroluminescence.