Digital Twin-Enabled Sim-to-Real Reinforcement Learning for Linear and Multi-Level Analog Memristor Programming
Developing effective programming strategies for analog memristors remains a key bottleneck for analog in-memory computing because nonlinear and stochastic switching dynamics force optimization to rely on costly, experiment-driven trial-and-error. Here, we present a physics-informed digital twin framework that integrates characterization, modeling, and optimization into a unified workflow, demonstrated on a four-terminal planar TiO2-x memristor. The framework calibrates a physics-based model from experimental data to build a digital twin for large-scale reinforcement learning pretraining; the agent is then fine-tuned on hardware via limited on-device interaction and deployed for multi-level programming. Because simulated episodes run more than four orders of magnitude faster than on-device episodes in wall-clock time, most trial-and-error exploration is shifted from physical hardware to the digital twin. The framework reliably programs linearly spaced conductance levels and automatically discovers policies spanning distinct accuracy-efficiency trade-offs. The most efficient policy achieves 32-level programming in only 45 write pulses on average, approximately 13x fewer than a calibrated feedforward-pulse scheme. Crossbar inference simulations on four image-classification benchmarks, using measured conductance distributions, show that programming precision requirements are strongly task-dependent: simpler tasks tolerate lower placement precision, whereas demanding tasks benefit measurably from tighter control. These results show that reinforcement learning on a physics-informed digital twin can automatically generate programming policies tailored to diverse objectives, providing a practical foundation for autonomous memristor optimization and analog AI hardware deployment.