Crystal generative models can now propose plausible new inorganic crystals, but a materials chemist rarely wants a brand-new crystal. They want the one they already have, for example formamidinium lead iodide (FAPbI3), with one flaw fixed. FAPbI3 absorbs sunlight almost ideally, yet its photoactive black phase collapses in humid air into a useless yellow phase. The usual fixes, such as swapping in cesium or bromine, stabilize the lattice but widen the bandgap and cost efficiency. This proposal treats that repair as an image-editing problem. We map a known crystal back into a generator's noise space, change only what must change, and require that a named property (the bandgap) stays put while a stability property improves.
The pieces exist separately. Image editing gets faithful reconstruction by running a diffusion model's deterministic sampling path backwards. A diffusion model is a generator that learns to turn random noise into samples by gradual denoising. Image editing has also learned that pushing one attribute with a single guidance knob drags correlated attributes along with it. Crystal generators such as Open Materials Generation with Stochastic Interpolants are strong forward samplers but have never been inverted. Property-driven perovskite design such as MEIDNet moves through a latent space in which bandgap and stability stay coupled. We propose to connect the two, and to measure honestly whether editing beats simply enumerating substitutions.
Core Claim
A crystal flow model can be run as a deterministic ordinary differential equation (ODE) over atom positions and lattice vectors. That makes it invertible for a fixed composition, and gives a well-defined "latent" for any known crystal. Starting from that latent, we allow only a masked subset of sites to change their chemical species. We then steer with decoupled guidance: the stability condition gets a boosted weight, and the bandgap condition is anchored at the source crystal's own value with neutral weight. Under this procedure, edits should raise density functional theory (DFT)-verified stability while moving the bandgap measurably less than two alternatives: single-weight guidance, and latent-gradient navigation of the MEIDNet kind.
The claim that is new relative to the closest work has three parts. Edits start from an inverted real crystal rather than from fresh samples. A property is explicitly protected rather than jointly optimized. And "entanglement" is measured as DFT-verified bandgap drift per unit of stability gained. That last quantity is directly the performance-versus-durability trade-off that perovskite chemists fight.
We do not claim true counterfactuals. Counterfactual Image Editing proves those cannot be identified from observational samples alone, and Materials Project–style datasets are purely observational. Our edit is defined operationally instead: the target property changes, the protected property is verified unchanged, and the structure changes minimally. This sidesteps the impossibility result by checking outcomes with DFT rather than trusting the model's notion of causality.
Relation to Prior Work
Three groups of prior work play different roles.
Work that supplies the method. Denoising Diffusion Implicit Models recast diffusion sampling as a deterministic ODE, and Image Embedding for Denoising Generative Models showed that this ODE reconstructs real images almost exactly when run backwards. DiffEdit showed that combining inversion with a mask keeps unedited regions intact. Decoupled Classifier-Free Guidance (DCFG) splits the conditioning into per-attribute heads and holds non-target attributes at neutral guidance, which suppresses the "attribute amplification" that plain classifier-free guidance causes on CelebA-HQ and medical images. We transfer all three techniques to periodic crystals. That transfer is non-trivial in two ways: coordinates live on a torus, and atom species are discrete, so they cannot be ODE-inverted. DCFG has never been tested outside pixel images.
Work that motivates the proposal. MEIDNet aligns structure, bandgap, and formation enthalpy in one contrastive latent and navigates it by gradient descent. It reports a 13.6% stable-unique-novel rate for low-bandgap perovskites. Because its bandgap and enthalpy axes are not separated, a step toward one property can move the other. The perovskite synthesis literature establishes the physical form of this coupling:
- Mitigating residual MA+ for stable FAPbI3 perovskite photovoltaics stabilizes the α-phase chemically, reaching 26.1% efficiency and surviving 120 h at 85°C.
- polymer-mediated α-FAPbI3 microcrystals stay phase-pure for more than six months in ambient air.
- CsPbBr3 stabilization illustrates the compositional route, which widens the gap.
All three are processing solutions for one composition. We ask the complementary compositional question.
Work that constrains the design. Compositional Generative Inverse Design shows that optimizing directly through a learned property predictor falls into unphysical "adversarial" designs. It reports a lift-to-drag ratio of 0.97 for predictor backpropagation versus 1.42 with a diffusion prior. That rules out a predictor-only editor. GANSpace shows that unsupervised principal directions inherit dataset correlations. That rules out discovering a "stability direction" by principal component analysis (PCA), because stable perovskites in the data skew wide-gap. DiffCSP and OMatG supply the backbones and benchmarks, but they offer no editing and no property conditioning.
Research Program
Stage one: build and test the inversion. We start from the released FERMat-ML/OMatG code in crystal-structure-prediction mode, where composition is fixed. In that mode the continuous part of the model (fractional coordinates on the torus, plus the lattice) admits an ODE form. We integrate this ODE backwards from a known relaxed crystal to an intermediate time $t^*$. We then check round-trip reconstruction: forward re-integration should recover the source under the standard structure-matching criterion. We run this for varied step counts and for trigonometric versus linear interpolants. Periodic wrapping and curved paths may accumulate error, so this first result is uncertain and worth reporting whichever way it goes.
Stage two: the edit. The discrete species are handled by a site mask, which is our DiffEdit analog. Sites outside the mask keep their species. Masked sites, for example the A-site or a fraction of halide sites in a supercell, are re-noised in species space at $t^*$ and regenerated. Meanwhile the continuous state resumes from its inverted value, not from fresh noise. The time $t^*$ controls edit strength: a small $t^*$ allows only local relaxation, and a large $t^*$ allows reorganization. Guidance follows DCFG, with separate conditioning heads for bandgap $E_g$ and for a stability target $s$. We use energy above the convex hull, which is available for Materials Project entries. The guided velocity is
$$v = v_\varnothing + \omega_s\,(v_{s} - v_\varnothing) + \omega_g\,(v_{E_g = E_g^{\text{src}}} - v_\varnothing),$$
where $v_\varnothing$ is the unconditional velocity, $v_s$ is conditioned on the improved stability target, $v_{E_g=E_g^{\text{src}}}$ is conditioned on the source crystal's own bandgap, $\omega_s>1$, and $\omega_g=1$.
Stage three: an ambient-specific check. Hull energy at zero temperature is only a proxy for ambient failure. For the final candidates we therefore also compute, by DFT, the "polymorph margin." This is the energy of the corner-sharing perovskite polymorph relative to a hexagonal non-perovskite polymorph of the same composition, and it is the static analog of the α-to-δ collapse. We say plainly that moisture kinetics and iodine loss are not modeled. This project tests whether the editing machinery works on the thermodynamic part of the problem.
Baselines
Naive reference. The do-nothing reference is the source crystal itself, together with its own hull energy, polymorph margin, and bandgap. Every edit is scored as a change from this point. Any method whose median edit does not improve stability by more than the DFT noise floor has failed, whatever else it shows.
Strongest competitor: enumerate and filter. For each source, enumerate every single- and double-site species substitution from a fixed element palette, relax each candidate with the same backbone in structure-prediction mode, and keep those whose predicted properties meet the target. This is the most dangerous baseline on 5-atom perovskites, where the substitution space is small. It gets the same predictor, the same DFT verification budget per source, and the same palette. We expect to match it on Perov-5 at lower cost. We expect to beat it on MP-20 halides and on mixed-cation supercells, where enumeration grows combinatorially. "Beating" means a higher rate of DFT-verified successes at an equal number of DFT calls.
Latent-navigation baseline. This is a MEIDNet-style navigator: a contrastive latent over structure, bandgap, and enthalpy, walked by gradient descent toward lower enthalpy with an added penalty on bandgap change. It is retrained on our splits, with an equal tuning budget over the penalty weight. It represents the published perovskite approach. Its reported 13.6% stable-unique-novel rate is for de novo generation, not editing. For editing, no reported result was found on Lacuna.
Ablations that isolate the key ingredients.
- Single-weight guidance. The same model with one scalar guidance weight on the concatenated condition. This is the "plain classifier-free guidance" competitor, and it isolates the decoupling.
- Fresh noise instead of inversion. The same guided sampler started from fresh noise with the same composition mask. This isolates the inversion.
- Predictor-only optimization. Gradient steps on a property predictor with no generative prior. This is the adversarial-trap reference.
Reference numbers for the backbone. OMatG's reported Perov-5 match rate is 83.06%, against 53.08% for DiffCSP, and its MP-20 stable-unique-novel rate is 22.48% with an average hull energy of 0.1482 eV/atom (OMatG). Our reconstruction and edit numbers should be read against these figures.
Why not just…?
Why not just enumerate substitutions and screen them? For ABX3 cells this is a real threat, and we treat it as the primary baseline rather than arguing around it. The proposal's value must show up where enumeration breaks. One such regime is mixed A-site or halide alloys in supercells from MP-20 and MPTS-52, where assignments multiply. Another is edits that also require coordinated lattice and position changes, which enumerate-then-relax handles only if the relaxer is good. DiffCSP's reported 10 seconds versus 12.5 hours for USPEX on 15 compounds shows why DFT-in-the-loop enumeration is not an option at that scale. If our method only ties enumeration on Perov-5 and never wins on larger cells, the conclusion is that editing is unnecessary for this problem, and we will report exactly that.
Why not just backpropagate through a property predictor? The CinDM results above show this finds designs the predictor likes but physics does not (0.97 versus 1.42 lift-to-drag), and species are discrete in any case. Our predictor-only ablation measures the same trap in crystals by the gap between predicted and DFT-verified success.
Why not just condition on both properties with standard guidance, or generate from scratch? DCFG's CelebA-HQ experiments show that single-weight guidance shifts non-target attributes. We expect the same coupling for bandgap here, because stable perovskites in the data are wider-gap. Generating from scratch discards the source crystal, and with it the transferable processing knowledge. The single-weight and fresh-noise ablations test each point directly. If either matches the full method on bandgap drift and structural fidelity, the corresponding component is dropped.
Proposed Experiments
The data are Perov-5 and the halide-containing subset of MP-20, with MPTS-52's chronological split used as an out-of-distribution test of edit transfer. Each method edits a fixed pool of source crystals chosen to be above-hull or to have small polymorph margins. We use one fixed element palette and the same DFT budget for every method.
Metrics. We report five quantities, all verified with DFT on the edited crystals:
- round-trip reconstruction match rate;
- edit success, meaning hull energy lowered past a preset threshold with the bandgap held within a preset tolerance of its source value, both thresholds fixed before any runs;
- leakage, the slope of DFT bandgap change against DFT stability gain across all edits, which is our entanglement measure;
- structural fidelity, the fraction of unmasked sites whose species and local environment are preserved;
- successes per DFT call.
Decisive checks. There are four.
- Does inversion reconstruct known crystals well enough to edit from? If round-trip match falls far below forward match rates, the project reduces to fresh-noise editing.
- Does decoupled guidance cut leakage relative to single-weight guidance at equal stability gain? This is the core claim.
- Does the method beat enumerate-and-filter per DFT call on supercells?
- On the FAPbI3 family, do edits that hold the bandgap fixed and increase the polymorph margin exist at all, or does the method, like the chemistry literature, only find Cs- or Br-type moves that widen the gap? A negative answer to the last question would itself be informative. It would suggest the trade-off is physical rather than an artifact of entangled models, and that processing routes like those of Zhao et al. and Shen et al. are the only way through.
References
- Open Materials Generation with Stochastic Interpolants
- MEIDNet: Multimodal generative AI framework for inverse materials design
- Counterfactual Image Editing
- Denoising Diffusion Implicit Models
- Image embedding for denoising generative models
- DiffEdit: Diffusion-based semantic image editing with mask guidance
- Decoupled Classifier-Free Guidance for Counterfactual Diffusion Models
- Mitigating residual MA+ for stable FAPbI3 perovskite photovoltaics
- Scalable Fabrication of High‐Efficiency Thin‐Film Perovskite Solar Cells in Air via Polymer‐Mediated Synthesis of α‐FAPbI 3 Microcrystals
- Facile synthesis of CsPbBr3 perovskite for improved stability and luminescence behavior in an aquatic environment
- Compositional Generative Inverse Design
- GANSpace: Discovering Interpretable GAN Controls
- Crystal Structure Prediction by Joint Equivariant Diffusion