molecular-structure-decoding
Summary
Decoding latent representations from diffusion models into interpretable molecular structure formats (SMILES, InChI, or molecular graphs). This skill bridges generative model outputs to chemically valid, ranked candidate structures for downstream validation and analysis.
When to use
Apply this skill after running spectrum-conditioned diffusion generation that produces latent molecular representations, when you need to convert continuous or abstract model outputs into discrete chemical formats suitable for structure matching, library comparison, or chemical database lookup. Specifically use when the diffusion model has completed iterative denoising and you have latent state tensors that encode both 2D topology and 3D geometry but are not yet in a queryable chemical format.
When NOT to use
- Input is already in a queryable chemical format (SMILES, InChI, SDF, MOL2) — skip directly to structure matching.
- Latent representations have not completed the full diffusion denoising cycle — apply this skill only after generation is complete.
- You need to preserve probabilistic uncertainty across the full candidate ensemble rather than deterministic point estimates — consider sampling multiple trajectories before decoding instead.
Inputs
- Latent molecular representations from diffusion model (tensors encoding 2D topology and 3D geometry)
- Diffusion model confidence scores or denoising log-likelihoods
- Trained Diffusion Molecule Transformer checkpoint
Outputs
- Decoded molecular structures in SMILES format
- Decoded molecular structures in InChI format
- Molecular graphs with ranked confidence scores
- Ranked list of candidate structures with reconstruction likelihood metrics
How to apply
After the diffusion-based generation process completes iterative denoising conditioned on input spectra, retrieve the final latent state from the Diffusion Molecule Transformer (DMT). Decode these latent representations into molecular structure format by inverting the SE(3)-equivariant encoding: extract 2D bond topology and atomic coordinates to construct a molecular graph, then serialize into SMILES or InChI strings. Rank candidate structures by the model's confidence scores (typically denoising log-likelihood or reconstruction error at the final timestep). Filter candidates by a threshold (e.g., top-10 by confidence) and optionally apply chemical validity checks (valence, aromaticity) to eliminate chemically infeasible structures. Output a ranked list paired with confidence metrics for retrieval against reference spectroscopic databases or known compound libraries.
Related tools
- Diffusion Molecule Transformer (DMT) (SE(3)-equivariant denoising network that generates latent molecular representations encoding both 2D topology and 3D geometry; outputs are decoded by this skill) — https://github.com/AzureLeon1/DiffSpectra
- DiffSpectra (End-to-end framework housing the diffusion pipeline; this skill is invoked as the output decoding stage of the full DiffSpectra workflow) — https://github.com/AzureLeon1/DiffSpectra
Examples
CUDA_VISIBLE_DEVICES=0,1 python main.py --config configs/diffspectra_qm9s.py --config_original_qm9 configs/base_qm9.py --mode eval --workdir exp/allspectra --config.eval.ckpts '40' --config.eval.num_samples 10000 --config.eval.save_mols true --config.data.spectra_version allspectra
Evaluation signals
- Decoded SMILES/InChI strings pass chemical validity checks (valence, aromaticity, atom count > 0).
- Top-1 accuracy on held-out test spectra: recovered structure exactly matches ground-truth molecular identity (exact match to reference SMILES or InChI).
- Top-10 accuracy: ground-truth structure appears in ranked list of top-10 candidates by confidence score (expected ≥99% per README performance claim).
- Ranked confidence scores are monotonic or non-increasing from rank 1 to rank 10 — no rank inversions.
- Generated molecules can be successfully imported and validated by RDKit or OpenBabel without errors; 3D coordinates satisfy SE(3) equivariance constraints (e.g., invariance to rigid rotations and translations).
Limitations
- Decoding accuracy depends critically on quality of latent representations from the DMT; poor denoising leads to invalid or chemically infeasible structures.
- Framework achieves 40.76% top-1 accuracy, meaning ~59% of single-best predictions are incorrect — rank-1 structures should not be trusted without additional confirmation.
- Decoding is deterministic given a latent state; stochasticity must be injected at the diffusion generation stage, not the decoding stage, to explore alternative candidate structures.
- Performance is benchmarked on QM9S dataset; generalization to out-of-domain spectra or larger molecular weight ranges (>900 Da) is not explicitly reported.
- SE(3)-equivariance assumes rigid 3D molecular geometry; highly flexible or disordered molecular ensembles may not decode correctly.
Evidence
- [other] Decode the generated latent representations into molecular structure format (SMILES, InChI, or molecular graph).: "Decode the generated latent representations into molecular structure format (SMILES, InChI, or molecular graph)."
- [other] Rank and filter candidate structures by model confidence scores or reconstruction likelihood.: "Rank and filter candidate structures by model confidence scores or reconstruction likelihood."
- [readme] Diffusion Molecule Transformer (DMT): An SE(3)-equivariant denoising network that models both 2D topology and 3D geometry of molecules.: "Diffusion Molecule Transformer (DMT): An SE(3)-equivariant denoising network that models both 2D topology and 3D geometry of molecules."
- [readme] Through spectrum-conditioned diffusion modeling, DiffSpectra unifies multi-modal reasoning with 2D/3D generative modeling. Extensive experiments demonstrate that DiffSpectra achieves 40.76% top-1 accuracy and 99.49% top-10 accuracy in recovering exact molecular structures.: "DiffSpectra achieves 40.76% top-1 accuracy and 99.49% top-10 accuracy in recovering exact molecular structures."
- [other] Output ranked list of candidate structures with associated confidence metrics.: "Output ranked list of candidate structures with associated confidence metrics."
1---2name: molecular-structure-decoding3description: Use when after running spectrum-conditioned diffusion generation that produces latent molecular representations, when you need to convert continuous or abstract model outputs into discrete chemical formats suitable for structure matching, library comparison, or chemical database lookup.4license: CC-BY-4.05---67# molecular-structure-decoding89## Summary1011Decoding latent representations from diffusion models into interpretable molecular structure formats (SMILES, InChI, or molecular graphs). This skill bridges generative model outputs to chemically valid, ranked candidate structures for downstream validation and analysis.1213## When to use1415Apply this skill after running spectrum-conditioned diffusion generation that produces latent molecular representations, when you need to convert continuous or abstract model outputs into discrete chemical formats suitable for structure matching, library comparison, or chemical database lookup. Specifically use when the diffusion model has completed iterative denoising and you have latent state tensors that encode both 2D topology and 3D geometry but are not yet in a queryable chemical format.1617## When NOT to use1819- Input is already in a queryable chemical format (SMILES, InChI, SDF, MOL2) — skip directly to structure matching.20- Latent representations have not completed the full diffusion denoising cycle — apply this skill only after generation is complete.21- You need to preserve probabilistic uncertainty across the full candidate ensemble rather than deterministic point estimates — consider sampling multiple trajectories before decoding instead.2223## Inputs2425- Latent molecular representations from diffusion model (tensors encoding 2D topology and 3D geometry)26- Diffusion model confidence scores or denoising log-likelihoods27- Trained Diffusion Molecule Transformer checkpoint2829## Outputs3031- Decoded molecular structures in SMILES format32- Decoded molecular structures in InChI format33- Molecular graphs with ranked confidence scores34- Ranked list of candidate structures with reconstruction likelihood metrics3536## How to apply3738After the diffusion-based generation process completes iterative denoising conditioned on input spectra, retrieve the final latent state from the Diffusion Molecule Transformer (DMT). Decode these latent representations into molecular structure format by inverting the SE(3)-equivariant encoding: extract 2D bond topology and atomic coordinates to construct a molecular graph, then serialize into SMILES or InChI strings. Rank candidate structures by the model's confidence scores (typically denoising log-likelihood or reconstruction error at the final timestep). Filter candidates by a threshold (e.g., top-10 by confidence) and optionally apply chemical validity checks (valence, aromaticity) to eliminate chemically infeasible structures. Output a ranked list paired with confidence metrics for retrieval against reference spectroscopic databases or known compound libraries.3940## Related tools4142- **Diffusion Molecule Transformer (DMT)** (SE(3)-equivariant denoising network that generates latent molecular representations encoding both 2D topology and 3D geometry; outputs are decoded by this skill) — https://github.com/AzureLeon1/DiffSpectra43- **DiffSpectra** (End-to-end framework housing the diffusion pipeline; this skill is invoked as the output decoding stage of the full DiffSpectra workflow) — https://github.com/AzureLeon1/DiffSpectra4445## Examples4647```48CUDA_VISIBLE_DEVICES=0,1 python main.py --config configs/diffspectra_qm9s.py --config_original_qm9 configs/base_qm9.py --mode eval --workdir exp/allspectra --config.eval.ckpts '40' --config.eval.num_samples 10000 --config.eval.save_mols true --config.data.spectra_version allspectra49```5051## Evaluation signals5253- Decoded SMILES/InChI strings pass chemical validity checks (valence, aromaticity, atom count > 0).54- Top-1 accuracy on held-out test spectra: recovered structure exactly matches ground-truth molecular identity (exact match to reference SMILES or InChI).55- Top-10 accuracy: ground-truth structure appears in ranked list of top-10 candidates by confidence score (expected ≥99% per README performance claim).56- Ranked confidence scores are monotonic or non-increasing from rank 1 to rank 10 — no rank inversions.57- Generated molecules can be successfully imported and validated by RDKit or OpenBabel without errors; 3D coordinates satisfy SE(3) equivariance constraints (e.g., invariance to rigid rotations and translations).5859## Limitations6061- Decoding accuracy depends critically on quality of latent representations from the DMT; poor denoising leads to invalid or chemically infeasible structures.62- Framework achieves 40.76% top-1 accuracy, meaning ~59% of single-best predictions are incorrect — rank-1 structures should not be trusted without additional confirmation.63- Decoding is deterministic given a latent state; stochasticity must be injected at the diffusion generation stage, not the decoding stage, to explore alternative candidate structures.64- Performance is benchmarked on QM9S dataset; generalization to out-of-domain spectra or larger molecular weight ranges (>900 Da) is not explicitly reported.65- SE(3)-equivariance assumes rigid 3D molecular geometry; highly flexible or disordered molecular ensembles may not decode correctly.6667## Evidence6869- [other] Decode the generated latent representations into molecular structure format (SMILES, InChI, or molecular graph).: "Decode the generated latent representations into molecular structure format (SMILES, InChI, or molecular graph)."70- [other] Rank and filter candidate structures by model confidence scores or reconstruction likelihood.: "Rank and filter candidate structures by model confidence scores or reconstruction likelihood."71- [readme] Diffusion Molecule Transformer (DMT): An SE(3)-equivariant denoising network that models both 2D topology and 3D geometry of molecules.: "Diffusion Molecule Transformer (DMT): An SE(3)-equivariant denoising network that models both 2D topology and 3D geometry of molecules."72- [readme] Through spectrum-conditioned diffusion modeling, DiffSpectra unifies multi-modal reasoning with 2D/3D generative modeling. Extensive experiments demonstrate that DiffSpectra achieves 40.76% top-1 accuracy and 99.49% top-10 accuracy in recovering exact molecular structures.: "DiffSpectra achieves 40.76% top-1 accuracy and 99.49% top-10 accuracy in recovering exact molecular structures."73- [other] Output ranked list of candidate structures with associated confidence metrics.: "Output ranked list of candidate structures with associated confidence metrics."