diffractgpt_mistral_chemical_formula

DiffractGPT‑Mistral‑Chemical‑Formula knc6/diffractgpt_mistral_chemical_formula ) is a specialized generative transformer built on the Mistral‑7B‑BNB‑4‑bit

knc6 243K downloads mit Text Generation
Frameworkssafetensors
Languagesen
Tagspeftchemistryatomgptdiffractiontext-generationbase_model:unsloth/mistral-7b-bnb-4bitbase_model:adapter:unsloth/mistral-7b-bnb-4bit
Downloads
243K
License
mit
Pipeline
Text Generation
Author
knc6

Run diffractgpt_mistral_chemical_formula locally on a Q4KM hard drive

Accelerate your crystallography workflow with a Q4KM hard drive pre‑loaded with DiffractGPT‑Mistral‑Chemical‑Formula. Enjoy instant, plug‑and‑play access to the model without any download delays. Get...

Shop Q4KM Drives

Technical Overview

DiffractGPT‑Mistral‑Chemical‑Formula (model ID: knc6/diffractgpt_mistral_chemical_formula) is a specialized generative transformer built on the Mistral‑7B‑BNB‑4‑bit foundation model. It is fine‑tuned with the PEFT (Parameter‑Efficient Fine‑Tuning) library to translate raw X‑ray diffraction (XRD) patterns directly into chemically accurate molecular formulas and crystal structure descriptors. In practice, a user supplies a one‑dimensional intensity‑vs‑2θ array (or a textual representation of the pattern) and the model returns a ranked list of plausible stoichiometries, space‑group assignments, and atom‑level coordinates.

  • Key Features & Capabilities
    • End‑to‑end inference from diffraction data to chemical formula without intermediate indexing steps.
    • Supports English‑language prompts and can output LaTeX‑formatted crystallographic notation.
    • Parameter‑efficient fine‑tuning (PEFT) keeps the model size at ~7 B parameters while enabling rapid adaptation to new datasets.
    • Optimized for 4‑bit quantization, allowing inference on consumer‑grade GPUs.
  • Architecture Highlights
    • Base model: Mistral‑7B, a decoder‑only transformer with 32 attention heads and a 4096‑token context window.
    • Quantization: 4‑bit (BNB) weight compression reduces VRAM footprint by ~75 %.
    • PEFT Adapter: LoRA‑style low‑rank adapters (rank = 8) inject domain‑specific knowledge while keeping the original weights frozen.
    • Output head: A custom linear layer maps hidden states to a token vocabulary enriched with crystallographic symbols (e.g., “2”, “(hkl)”).
  • Intended Use Cases
    • Rapid screening of unknown powders in academic labs.
    • Automated validation of synthesis pipelines in pharmaceutical and materials‑science R&D.
    • Integration into cloud‑based XRD analysis pipelines (e.g., via the AtomGPT web app).

Benchmark Performance

For X‑ray diffraction interpretation, the most relevant benchmarks are formulastrong>Formula Prediction Accuracy (FPA) and Space‑Group Classification (SGC). The authors report a top‑1 FPA of 92.3 % and a top‑5 FPA of 98.7 % on a curated test set of 5 000 synthetic patterns covering 150 crystal systems. SGC reaches 89.5 % top‑1 accuracy. These numbers are derived from the Journal of Physical Chemistry Letters (2025) study, where DiffractGPT is compared against traditional indexing software (e.g., GSAS‑II) and a baseline BERT‑style model. The transformer consistently outperforms the baseline by >15 % in FPA while requiring < 2 seconds per pattern on a single RTX 4090.

  • Why these benchmarks matter: Accurate formula prediction directly impacts downstream synthesis decisions, and correct space‑group assignment is essential for reliable crystal‑structure refinement.
  • Comparison: Conventional pipelines achieve ~78 % top‑1 FPA and often need manual intervention; DiffractGPT’s end‑to‑end approach eliminates that bottleneck.

Hardware Requirements

Because the model is quantized to 4‑bit and uses LoRA adapters, the VRAM demand is modest. A single RTX 4090 (24 GB) can host the full model plus a batch of 8 XRD inputs simultaneously. Minimum viable hardware includes a GPU with ≥ 12 GB VRAM (e.g., RTX 3060 12 GB) for single‑sample inference, though latency will increase to ~5 seconds per pattern.

  • CPU: Any modern x86‑64 processor; 8‑core Intel i7 or AMD Ryzen 7 is recommended for preprocessing.
  • Storage: Model checkpoint (~7 GB) plus LoRA adapters (~150 MB). SSD preferred for fast loading.
  • Performance Characteristics: 4‑bit inference runs at ~200 tokens / ms; the typical XRD token length (~512) translates to < 3 seconds per prediction on the RTX 4090.

Use Cases

DiffractGPT is engineered for scientists who need rapid, automated interpretation of diffraction data.

  • Academic Research: Graduate students can feed raw XRD patterns from a lab diffractometer into the model to obtain immediate formula suggestions, accelerating the discovery of new inorganic compounds.
  • Pharmaceutical R&D: Early‑stage polymorph screening can be automated, reducing manual indexing time from hours to seconds.
  • Materials‑Science Industry: High‑throughput screening of alloy libraries benefits from the model’s ability to batch‑process thousands of patterns on a GPU cluster.
  • Software Integration: The model can be wrapped as a REST API (via Hugging Face discussions) and embedded in ELN (Electronic Lab Notebook) platforms.

Training Details

Training leveraged the PEFT library (v0.11.1) to apply LoRA adapters to the frozen Mistral‑7B backbone. The dataset comprised ≈ 1.2 million synthetic XRD patterns generated from the Materials Project crystal structure database, covering 150 space groups and a wide range of atomic compositions. Each pattern was paired with its ground‑truth chemical formula and space‑group label.

  • Compute: Training was performed on a cluster of 4 × NVIDIA A100 80 GB GPUs for ~48 hours, using mixed‑precision (bfloat16) to accelerate convergence.
  • Fine‑Tuning Capability: Users can add domain‑specific LoRA adapters (e.g., for organic molecules) with as few as 500 labeled patterns, thanks to the low‑rank nature of the adapters.
  • Training Procedure: 3‑epoch curriculum learning—starting with low‑noise synthetic data, then progressively adding experimental noise and background scattering.

Licensing Information

The model card lists the MIT license for the base model and adapters, but the overall license is marked unknown. In practice, the MIT‑licensed components grant broad permission to use, modify, and distribute the software, provided the original copyright notice is retained. Because the overarching license is not explicitly defined, users should treat the model as “use‑at‑your‑own‑risk” and verify compliance before commercial deployment.

  • Commercial Use: Allowed under MIT for the core model; however, any proprietary data or downstream applications should be reviewed for potential conflicts.
  • Restrictions: No explicit patent grant; users must ensure they do not infringe on third‑party patents related to XRD analysis algorithms.
  • Attribution: Cite the original paper (Choudhary 2025) and include the Hugging Face model card link in any public release.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives