File size: 11,345 Bytes
c550583
 
 
 
 
58dc5c2
c550583
 
 
 
 
 
 
 
 
 
 
58dc5c2
c550583
58dc5c2
 
 
 
c550583
 
 
58dc5c2
 
 
 
c550583
 
 
58dc5c2
 
 
 
c550583
 
 
58dc5c2
 
 
 
c550583
 
 
58dc5c2
 
 
 
c550583
 
 
 
 
 
 
 
 
 
 
 
58dc5c2
c550583
58dc5c2
c550583
 
 
 
 
 
 
 
 
 
 
 
 
 
58dc5c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c550583
 
58dc5c2
c550583
58dc5c2
 
 
c550583
 
58dc5c2
 
 
 
 
 
 
c550583
 
 
 
 
 
58dc5c2
c550583
 
 
58dc5c2
 
 
 
 
c550583
58dc5c2
 
 
c550583
 
 
58dc5c2
c550583
58dc5c2
c550583
 
58dc5c2
c550583
58dc5c2
 
c550583
58dc5c2
c550583
58dc5c2
8a8bfd2
58dc5c2
8a8bfd2
58dc5c2
 
8a8bfd2
58dc5c2
8a8bfd2
58dc5c2
 
8a8bfd2
 
58dc5c2
c550583
58dc5c2
c550583
58dc5c2
 
 
 
c550583
58dc5c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
---
license: cc-by-4.0
---
# Description

DPA-3.2-5M is trained using a multitask strategy on the [OpenLAM datasets V2](https://www.aissquare.com/datasets/detail?pageType=datasets&name=OpenLAM-TrainingSet-v2&id=391). Compared with DPA-3.1-3M, the following changes were made:

1. The model depth was increased from 16 layers to 24 layers.
2. OMol25 was adopted to replace the molecular training data used in OpenLAM Datasets V1.
3. The OpenCSP training set was added to better cover inorganic materials under high-pressure conditions.
4. Redundant datasets and datasets of low importance (e.g., HfO₂) were removed.
5. A frame-level parameterization was introduced to handle spin multiplicity and charge as explicit inputs.

# Benchmark Results

## LAMBench

*Note: this tests were carried out with the latest version of LAMBench, new tasks and test datasets were added (code will be released soon). The results may differ from the published version.*

| Model                     | GeneralizationError - ForceField↓|  GeneralizationError - PropertyCalculation↓ | Efficiency↑|Instability↓|
|-------------------------- |-------------------------------|------------------------------------------|------------|------------|
| DPA-3.1-3M                |   0.187                       |   0.293                                  |    0.261   |   0.000    |
| DPA-3.2-5M                |   0.147                       |   0.260                                  |    0.200   |   0.000    |

## Wiggle150

| Model       | MAE (kcal/mol) ↓ | RMSE (kcal/mol) ↓ |
|-------------|------------------|-------------------|
| DPA-3.1-3M  | 1.722            | 2.239             |
| DPA-3.2-5M  | 1.192            | 1.543             |

## TorsionNet-500

| Model       | MAE (kcal/mol) ↓ | MAEB (kcal/mol) ↓ | NABH  ↓ |
|-------------|------------------|-------------------|---------|
| DPA-3.1-3M  | 0.338            |  0.551            |  76     |
| DPA-3.2-5M  | 0.295            |  0.466            |  50     |

## PhononMDR

| Model       |  MAE ω_max ↓ |  MAE S ↓ |  MAE F ↓ |  MAE Cv ↓ |
|-------------|--------------|----------|----------|-----------|
| DPA-3.1-3M  |   13.24      |  13.06   |   4.03   |   3.88    |
| DPA-3.2-5M  |   11.97      |  11.57   |   3.60   |   3.25    |

## OC20NEB

| Model       | MAE Ea (eV) ↓  | MAE dE (eV) ↓  | φ_Transfer ↓  | φ_Dissociation ↓ | φ_Desorption ↓ |
|-------------|----------------|----------------|---------------|------------------|----------------|
| DPA-3.1-3M  |    1.172       |    0.158       |    65.1       |     69.0         |    59.8        |
| DPA-3.2-5M  |    1.183       |    0.164       |    69.7       |     75.3         |    63.0        |

# How to use

## Installation

To use the pretrained model, you need to first install the corresponding version of DeePMD-kit. You can try easy installation:

```bash
pip install torch torchvision torchaudio
pip install git+https://github.com/deepmodeling/deepmd-kit@v3.1.2
```

For other installation options, please visit the [Releases page](https://github.com/deepmodeling/deepmd-kit/releases/tag/v3.1.2) page to download the off-line package for **deepmd-kit devel**, and refer to the [official documentation](https://docs.deepmodeling.com/projects/deepmd/en/v3.1.2/install/easy-install.html) for off-line installation instructions.

## Direct Inference

The pretrained model can be used directly for prediction tasks, such as serving as an ASE calculator.

This model is pretrained in a multi-task manner, featuring a unified backbone (referred to as the unified descriptor and the unified fitting net) and an dataset encoding vector for different tasks. For detailed information, refer to the [DPA-3 paper](https://arxiv.org/abs/2506.01686).

The first step involves selecting a specific dataset id from the model to make predictions. To list the available fitting nets (`model-branch`) in this pretrained model, use the following command:

```bash
dp --pt show DPA-3.2-5M.pt model-branch
```

This will generate an output similar to the following:

```plaintext
Available model branches are ['Domains_Alloy', 'Domains_Anode', 'Domains_Cluster', 'Domains_FerroEle', 
'Domains_SSE_PBE', 'Domains_SemiCond', 'H2O_H2O_PD', 'Metals_AlMgCu', 'Metals_AgAu_PBED3', 'Others_In2Se3',
 'MPGen_OpenCSP', 'Alloy_APEX', 'SSE_ABACUS', 'Hybrid_Perovskite', 'Electrolyte', 'ODAC23', 'Alex2D', 'Omat24', 
'OC20M', 'OC22', 'Organic_Reactions', 'OMol25', 'MPTrj', 'RANDOM'], where 'RANDOM' means using a randomly 
initialized fitting net.

+-------------------+---------------------------+--------------------------------+--------------------------------+
| Model Branch      | Alias                     | description                    | observed_type                  |
+-------------------+---------------------------+--------------------------------+--------------------------------+
| OMat24            | Default, Materials,       | OMat24 is a large-scale open   | ['H', 'He', 'Li', 'Be', 'B',   |
|                   | Omat24, materials, omat24 | dataset containing over 110    | 'C', 'N', 'O', 'F', 'Ne',      |
|                   |                           | million DFT calculations       | 'Na', 'Mg', 'Al', 'Si', 'P',   |
|                   |                           | spanning diverse structures    | 'S', 'Cl', 'Ar', 'K', 'Ca',    |
|                   |                           | and compositions. It is        | 'Sc', 'Ti', 'V', 'Cr', 'Mn',   |
|                   |                           | designed to support AI-driven  | 'Fe', 'Co', 'Ni', 'Cu', 'Zn',  |
|                   |                           | materials discovery by         | 'Ga', 'Ge', 'As', 'Se', 'Br',  |
|                   |                           | providing broad and deep       | 'Kr', 'Rb', 'Sr', 'Y', 'Zr',   |
|                   |                           | coverage of chemical space.    | 'Nb', 'Mo', 'Tc', 'Ru', 'Rh',  |
|                   |                           |                                | 'Pd', 'Ag', 'Cd', 'In', 'Sn',  |
|                   |                           |                                | 'Sb', 'Te', 'I', 'Xe', 'Cs',   |
|                   |                           |                                | 'Ba', 'La', 'Ce', 'Pr', 'Nd',  |
|                   |                           |                                | 'Pm', 'Sm', 'Eu', 'Gd', 'Tb',  |
|                   |                           |                                | 'Dy', 'Ho', 'Er', 'Tm', 'Yb',  |
|                   |                           |                                | 'Lu', 'Hf', 'Ta', 'W', 'Re',   |
|                   |                           |                                | 'Os', 'Ir', 'Pt', 'Au', 'Hg',  |
|                   |                           |                                | 'Tl', 'Pb', 'Bi', 'Ac', 'Th',  |
|                   |                           |                                | 'Pa', 'U', 'Np', 'Pu']         |
+-------------------+---------------------------+--------------------------------+--------------------------------+
```

Together with the available branch list, a table containing detailed information of each branch is provided. Select a model branch that closely matches your system. Ensure that the elements in your system are included in the corresponding task if you are conducting direct predictions or simulations. For more information on the pretrained datasets, refer to [OpenLAM datasets V2](https://www.aissquare.com/datasets/detail?pageType=datasets&name=OpenLAM-TrainingSet-v2&id=391).

*Note: If you are unsure which model branch to use, we recommend starting with Omat24, which performs well across a wide range of systems, including inorganic materials, catalytic systems, and molecular systems. If the accuracy of the Omat24 branch does not meet your needs for catalytic applications, consider trying the OC20M branch. For molecular systems, we recommend the OMol25 branch. For 2D inorganic materials, we recommend the Alex2D branch, and for inorganic materials under high pressure, the MPGen_OpenCSP branch. For alloy systems, we recommend the Alloy_APEX branch. *

Assuming you choose `OMol25`, you can first freeze the model branch from the multi-task pretrained model:

```bash
dp --pt freeze -c DPA-3.2-5M.pt -o frozen_model.pth --model-branch  OMol25
```

or use the alias like

```bash
dp --pt freeze -c DPA-3.2-5M.pt -o frozen_model.pth --model-branch  omol25
```

Then you can use the following Python code for prediction or optimization:

```python
## Compute potential energy
from ase.build import molecule
from deepmd.calculator import DP as DPCalculator
dp = DPCalculator("frozen_model.pth")

singlet = molecule("CH2_s1A1d")

#To set the total charge and spin multiplicity of a structure,
#update fparam as [charge, multiplicity]. The default is [0, 1].
singlet.info.update({"fparam": [0, 1]})

singlet.calc = dp
print(singlet.get_potential_energy())
print(singlet.get_forces())

## Run BFGS structure optimization
from ase.optimize import BFGS
dyn = BFGS(singlet)
dyn.run(fmax=1e-6)
print(singlet.get_positions())
```

## Zero-Shot Inference

Given that energy labels calculated via DFT can vary by an arbitrary constant, LAMs are consistently used to predict the energy difference between the label and a dummy model that estimates potential energy solely based on the chemical formula.
Specifically, the dummy model is defined as

$\qquad E = \sum_e n_{e} \times \hat{b}_e$;

where $E$ is the predicted energy, $n_{e}$ is the number of atoms of element $e$, and $\hat{b}_e$ is the per-atom energy of element $e$ obtained via least-squares fitting:

$ \qquad \hat{b} =  \arg\min \sum_i \left( y_i - \sum_e n_{i,e}\, b_e \right)^2$,

with $n_{i,e}$ denoting the number of atoms of element $e$ in sample $i$, and $y_i$ the corresponding DFT energy label.
When applying the pretrained model to a new downstream system, it is advisable to adjust the energy bias term to better align with the DFT energy labels of the downstream system. This adjustment can enhance prediction accuracy without necessitating further training of the neural network parameters.

To be specific, given a new downstream system, we use `dp --pt change-bias` to do zero-shot procedure, which will inherit the neural network parameters of the pretrained multitask model, but updating the energy bias to better align with the downstream system.

```bash
dp --pt change-bias DPA-3.2-5M.pt -s <your_system> --model-branch OMat24
```

## Fine-tuning

To fine-tune a pretrained model, you need to ensure that the model configuration (model/descriptor and model/fitting_net) matches exactly with the pretrained model. The input_finetune.json file provided on this page contains the same model configuration as the pretrained model.

To prepare for fine-tuning, replace the model/type_map and training/training(validation)_data sections in input_finetune.json with your specific dataset information, just the same as from scratch. Additionally, adjust the learning rate for fine-tuning, typically a small learning rate such as 1e-4 for learning_rate/start_lr is recommended. One can inherit a pretrained fitting net by using the `--model-branch` argument.

```bash
dp --pt train input_finetune.json --finetune DPA-3.2-5M.pt --model-branch OMat24
```