RamanGPT: Bidirectional Raman Framework
- RamanGPT is a unified framework that bridges structure-to-spectrum and spectrum-to-structure translation using data-driven models.
- It combines ALIGNN for forward regression, a transformer for generative inversion, and a retrieval module for consistency checks.
- The system drastically reduces computational cost compared to DFPT and enables new structure proposals beyond existing datasets.
RamanGPT is a unified, data-driven framework for the bidirectional Raman problem in crystalline inorganic materials: it predicts a Raman spectrum from a known crystal structure and, conversely, proposes a plausible crystal structure from a Raman spectrum plus chemical formula. It combines an Atomistic Line Graph Neural Network (ALIGNN) for structure-to-spectrum regression, a generative transformer based on AtomGPT and Mistral-7B for spectrum-to-structure generation, and a retrieval module, all deployed in a web application at https://atomgpt.org/raman (Abel et al., 2 Jun 2026).
1. Scientific setting and problem formulation
Raman spectroscopy probes vibrational modes determined by the interatomic force constants and the Raman tensor, defined as the derivative of the electronic susceptibility with respect to atomic displacements. In density functional perturbation theory, computing a Raman spectrum requires phonon eigenmodes at and Raman tensor derivatives, scaling as roughly $3N+1$ self-consistent field calculations for a unit cell with atoms. This computational cost makes systematic DFPT Raman calculations expensive and restricts high-throughput studies to a few thousand materials (Abel et al., 2 Jun 2026).
The forward Raman problem is therefore computationally costly, while the inverse problem is more difficult because the mapping from structure to spectrum is indirect and many-to-one. Traditional inverse workflows are retrieval-based: an experimental spectrum is compared against libraries of computed or measured references, and the closest match is returned. This is fast and interpretable, but it cannot generate new structures and cannot extrapolate beyond the database (Abel et al., 2 Jun 2026).
RamanGPT addresses these limits by combining surrogate prediction, generative inversion, and retrieval in a single system.
| Component | Direction | Function |
|---|---|---|
| ALIGNN | Structure spectrum | Predicts 200-bin Raman spectra from crystal graphs |
| AtomGPT with Mistral-7B and QLoRA | Spectrum formula structure | Generates lattice parameters, angles, atom types, and fractional coordinates |
| Retrieval and consistency loop | Bidirectional support | Matches spectra to CRD entries and checks inverse predictions by round-trip reconstruction |
2. Data model and representations
RamanGPT is trained and evaluated on the Computational Raman Database of Bagheri and Komsa, which contains DFPT-computed Raman tensors for 5,099 inorganic crystalline materials. The CRD builds on the Phonon Database and Materials Project. Structures are VASP-optimized with PBEsol; dynamical matrices and phonon eigenvectors at are computed; and materials are pre-screened for Raman activity, dynamical and thermodynamic stability with eV/atom, and a band gap eV. The dataset spans all seven crystal systems with 2–100+ atoms in the primitive cell and is dominated by oxides (approximately 52%) and halides (approximately 27%) (Abel et al., 2 Jun 2026).
For polycrystalline samples, orientation-averaged Raman intensities are computed from Raman tensor invariants as
The resulting spectra are discretized into 200 bins from 50–1000 cm$3N+1$0 with a grid spacing of 4.75 cm$3N+1$1, and each spectrum is normalized to unit peak intensity. Numerically, each Raman spectrum is therefore a 200-dimensional vector of non-negative intensities (Abel et al., 2 Jun 2026).
Crystal structures are represented in standard periodic form: atomic species, fractional coordinates, lattice vectors specified by $3N+1$2 and $3N+1$3, and periodic boundary conditions. For machine learning, the forward model consumes graphs derived from the crystal, whereas the inverse model consumes the Raman spectrum as a text sequence of intensity values together with the chemical formula and emits a text serialization of the structure. The CRD is split 80/10/10 into train, validation, and test sets, yielding 509 forward-model test materials and 508 inverse-model test materials (Abel et al., 2 Jun 2026).
3. Forward mapping: ALIGNN as a DFPT surrogate
The forward component uses ALIGNN, a graph neural network that represents both pairwise and angular information through a primary atomic graph $3N+1$4 and a line graph $3N+1$5. Nodes in $3N+1$6 are atoms, edges are neighbor bonds within a cutoff, and nodes in $3N+1$7 correspond to bonds, with edges encoding bond-bond triplets. This is physically well matched to vibrational response because bond lengths and bond angles enter the dynamical matrix and polarizability derivatives that determine Raman intensities (Abel et al., 2 Jun 2026).
In RamanGPT, the ALIGNN model uses 4 ALIGNN layers and 4 edge-gated convolution layers, a hidden feature dimension of 256, a cutoff radius of 8.0 Å with up to 12 neighbors per atom, and 92 atomic input features. Its regression head outputs a 200-dimensional Raman intensity vector. Training minimizes mean squared error,
$3N+1$8
with AdamW, an initial learning rate of 0.001, a one-cycle scheduler, batch size 16, and 100 epochs (Abel et al., 2 Jun 2026).
On the 509-material test set, the model achieves a mean MAE of 0.032 across all 200 bins and a median MAE of 0.029; 88% of predicted spectra have MAE $3N+1$9, and 99.4% have MAE 0. Because very small MAE values can still mask qualitative differences, the paper emphasizes cosine similarity. Under that metric, 42.5% of test materials achieve cosine similarity 1, regarded as a threshold for reasonable qualitative matching, 14.2% achieve 2, and about 0.2% are near-perfect matches (Abel et al., 2 Jun 2026).
Qualitatively, ALIGNN reproduces simple spectra with few, well-separated peaks more accurately than complex spectra with many sharp, closely spaced lines, where it tends to smooth or merge peaks while preserving the overall envelope. The largest deviations occur in the 100–400 cm3 region, where many CRD materials have strong Raman activity; errors diminish above 600 cm4, where spectra are sparse. Resolution analysis shows that MAE decreases from 0.053 at 50 bins to 0.031 at 500 bins and then saturates, while cosine similarity remains approximately 0.53–0.56 across resolutions; 200 bins are therefore used as a practical compromise (Abel et al., 2 Jun 2026).
A notable out-of-distribution test involves metallic 1T-VSe5, which is absent from CRD because the database excludes materials with band gap below 0.5 eV. An experimental thin-flake spectrum shows modes at about 137.4 and 206.6 cm6; when the known JVASP-18940 structure is provided to the forward model, the predicted spectrum qualitatively reproduces the main features, including similar relative intensities, though shifted to higher wavenumber. This suggests qualitative generalization beyond the semiconducting training distribution (Abel et al., 2 Jun 2026).
4. Inverse mapping: generative structure reconstruction from spectra
The inverse component recasts Raman-based structure prediction as sequence generation. It uses the AtomGPT paradigm: a decoder-only transformer, Mistral-7B-Instruct, fine-tuned by Quantized Low-Rank Adaptation. The pretrained transformer weights remain frozen in 4-bit quantized form, while low-rank adapters are trained so that
7
Only about 0.3% of total parameters are updated, reducing memory and compute requirements (Abel et al., 2 Jun 2026).
The Raman spectrum is represented as a text sequence of the 200 intensity values, concatenated with the chemical formula in an Alpaca-style prompt:
“Below is a description of a material. The chemical formula is [formula]. The Raman spectrum is [intensities]. Generate atomic structure description with lattice lengths, angles, coordinates and atom types.”
The model autoregressively generates lattice lengths 8, lattice angles 9, element symbols, and fractional coordinates. Fine-tuning uses standard next-token cross-entropy, and the generated text is then parsed into numerical structure data. Symmetry analysis with spglib and the jarvis.core.atoms canonicalizer is used to determine the space group, compute reduced formula, and canonicalize the structure (Abel et al., 2 Jun 2026).
On 508 held-out CRD materials, the inverse model yields lattice-parameter MAEs of 1.137 Å for 0, 1.197 Å for 1, and 2.158 Å for 2; lattice-angle MAEs of 17.085° for 3, 17.590° for 4, and 20.803° for 5; a volume MAE of 107.06 Å6; and a density MAE of 0.741 g/cm7. Density is particularly well captured, with KLD = 0.025 and EMD = 0.206, whereas lattice angles are weaker, with KLD around 0.4–0.5 and EMD of several degrees (Abel et al., 2 Jun 2026).
The paper reports reduced-formula consistency of 86.8% and mean element composition accuracy of 76.3%. It explicitly notes that the chemical formula is supplied in the prompt, so the 86.8% figure measures how reliably the model preserves and expresses the given formula during structure generation, not how often it infers formula directly from Raman data. Space-group recovery is 18.9%, and the median fractional-coordinate RMSE is 0.265, corresponding to roughly 1.5–3 Å positional error in typical 5–12 Å cells (Abel et al., 2 Jun 2026).
A natural baseline is pure retrieval: cosine-similarity matching of each test spectrum against all other CRD spectra and selecting the nearest neighbor. On the same 508 spectra, this baseline recovers the correct reduced formula only about 41% of the time and the correct space group about 9% of the time. The fine-tuned LLM therefore roughly doubles both reduced-formula and space-group recovery while outputting full atomic coordinates rather than a database index (Abel et al., 2 Jun 2026).
5. Consistency loop, retrieval, and deployment
RamanGPT includes an inverse8relax9forward workflow. First, the inverse model generates a candidate crystal structure from the input spectrum and formula. Second, the generated structure can be relaxed with ALIGNN-FF, a universal graph-neural-network force field trained on DFT energies and forces. Third, the relaxed structure is passed to the ALIGNN Raman model to predict a spectrum. Fourth, that spectrum is compared to the original input, for example by cosine similarity. The loop functions as an internal self-consistency check: if the forward model cannot reproduce the input spectrum from the inverse model’s structure, the inverse result is likely unreliable (Abel et al., 2 Jun 2026).
The deployed Raman Suite exposes three workflows. In retrieval or matching mode, a user uploads or pastes a spectrum, which is broadened with a Gaussian kernel with default 0 cm1, resampled onto the CRD grid, and compared to all CRD spectra using cosine similarity; optional formula filtering is supported. In forward mode, a user provides a POSCAR-format crystal structure and receives a predicted Raman spectrum in the 50–1000 cm2 window, discretized into 200 normalized bins. In inverse mode, a user provides a Raman spectrum together with the chemical formula, and the QLoRA-fine-tuned Mistral-7B model generates a structure description that can be displayed directly or passed through the optional inverse3ALIGNN-FF4forward loop (Abel et al., 2 Jun 2026).
The deployed system inherits the model constraints. Its spectral range is limited to 50–1000 cm5; higher-frequency stretching modes, such as O–H or C–H, are not modeled. Its training domain consists of inorganic crystalline materials similar to those in CRD, primarily nonmetallic and dynamically stable. Inputs are expected to be reasonably normalized and aligned to the 50–1000 cm6 window for best performance (Abel et al., 2 Jun 2026).
6. Position within Raman AI, limitations, and implications
RamanGPT occupies a distinct position within machine learning for Raman spectroscopy. The Raman ML literature has often emphasized classification and denoising. For example, a GAN-CNN model for bilayer graphene twist-angle identification operated directly on normalized spectra and achieved test accuracy exceeding 99.9% and recall accuracy of 99.9% on an augmented dataset containing 4209 spectra, including ultra-low-SNR cases (Hu et al., 2024). An unsupervised CycleGAN denoising approach cast Raman denoising as style transfer and reported TMMSE of 0.00372 and MCSE of 0.00341 on paired evaluation data, without requiring paired training spectra (Bench et al., 2023). A 2026 benchmark across three open-source Raman datasets found that Raman-specific deep classifiers, especially multi-scale CNNs such as SANet, remain strong baselines for spectral classification tasks (Sineesh et al., 22 Jan 2026). RamanGPT differs in that it targets explicit structure7spectrum translation rather than label prediction or denoising alone (Abel et al., 2 Jun 2026).
Relative to DFPT-based Raman simulation, the forward ALIGNN surrogate replaces a calculation that scales as roughly 8 self-consistent field evaluations with a single GNN inference, which the paper describes as orders of magnitude faster once trained. Relative to retrieval-only inverse approaches, RamanGPT adds generative capability: it can propose new structures consistent with an input spectrum and formula, and it can extrapolate outside CRD coverage (Abel et al., 2 Jun 2026).
Its limitations are correspondingly specific. The training data cover only dynamically stable inorganic crystals with band gap greater than 0.5 eV; metals, strongly anharmonic systems, disordered phases, materials with defects, amorphous systems, molecular crystals, and organic materials are underrepresented or absent. The 50–1000 cm9 window omits high-frequency modes. Lattice angles are poorly predicted, with MAEs of about 17–21°, and space-group recovery remains modest at about 19%. The forward and inverse models are trained on DFPT spectra rather than experimental spectra, so broadening, defects, temperature, instrument response, and anharmonicity remain sources of domain shift (Abel et al., 2 Jun 2026).
The paper identifies several extension paths: larger and more diverse datasets including metals and disordered systems, broader Raman windows, conditioning on crystal system or Bravais lattice, ablations in which formula is not provided, broader experimental validation against libraries such as RRUFF, and multimodal prompting that combines Raman with PXRD or microscopy (Abel et al., 2 Jun 2026). This suggests a broader role for RamanGPT as a crystallographic inference layer within multi-modal materials characterization rather than as a standalone replacement for experiment or first-principles theory.