DeePMD-kit Configuration: Trust Levels & Descriptor sel#
Two configuration areas are most commonly the source of subtle bugs in DeePMD-kit / DP-GEN workflows: (1) model deviation trust level thresholds that drive active-learning frame selection in DP-GEN, and (2) the descriptor sel parameter whose ordering is coupled to type_map.
Model Deviation Trust Levels (DP-GEN param.json)#
During DP-GEN's exploration step, each MD frame is classified by comparing the committee model deviation against force (and optionally virial/energy) thresholds:
| Class | Condition | Action |
|---|---|---|
| Accurate | deviation < model_devi_f_trust_lo | Discarded |
| Candidate | model_devi_f_trust_lo ≤ deviation < model_devi_f_trust_hi | Sent to first-principles labeling |
| Failed | deviation ≥ model_devi_f_trust_hi | Discarded (too uncertain) |
Key parameters#
model_devi_f_trust_lo/model_devi_f_trust_hi— lower/upper force bounds (eV/Å). Required. Typical starting values:0.05/0.15.model_devi_v_trust_lo/model_devi_v_trust_hi— equivalent virial bounds. Requires DeePMD-kit v2+. Default:1e10(effectively disabled).model_devi_e_trust_lo/model_devi_e_trust_hi— energy-per-atom bounds. Requires DeePMD-kit ≥ 2.2.2.
Each threshold can be a scalar float or a dict/list to set per-system values — useful when different sys_configs have very different force scales .
Adaptive lower bound#
Setting model_devi_adapt_trust_lo: true lets DP-GEN ignore a fixed lower bound and instead pick the top-N frames by model deviation below _trust_hi. Configure with model_devi_numb_candi_f (count) and/or model_devi_perc_candi_f (fraction).
Related controls#
fp_task_max/fp_task_min— caps and minimum on candidates sent to labeling per system per iteration.fp_accurate_threshold— if the accurate-frame ratio exceeds this, the FP step is skipped entirely.
Descriptor sel and type_map Ordering#
What sel means#
sel is a list[int] on the descriptor where sel[i] = the maximum number of type-i neighbors within the cutoff radius (rcut) that the descriptor will store per center atom.
The order of sel must match the order of type_map: sel[0] counts neighbors of the type named type_map[0], sel[1] counts neighbors of type_map[1], etc. An example for methane with type_map: ["H", "C"] uses sel: [16, 4] — 16 H-neighbors and 4 C-neighbors.
Warning: If
type_maporder changes (e.g., swapping["H","C"]to["C","H"]) thesellist must change accordingly. A mismatch silently produces wrong descriptors and degraded model quality. DP-GEN also requires the sametype_maporder inparam.json,type.raw, anddata.lmp(for LAMMPS).
Undersized sel degrades accuracy#
The total sel must be ≥ the actual neighbor count at all geometries encountered during training and MD. If sel is too small for any frame, neighbors are silently truncated, breaking energy conservation and degrading accuracy. DP-GEN will emit a warning:
"sel of type {i} is not enough! The expected value is not less than {tt}, but you set it to {dd}. The accuracy of your model may get worse."
Oversized sel wastes memory and compute; the total cannot exceed 4096 on GPU.
Auto-determination#
Pass sel: "auto" (default) or sel: "auto:<factor>" to let DeePMD-kit compute sel from training-data neighbor statistics. The algorithm: scan all training frames → find per-type max neighbor count → multiply by factor (default 1.1) → round up to nearest multiple of 4.
For manual tuning, run dp neighbor-stat on the training data first to see actual neighbor counts, then add a safety margin.
The update_sel class method on descriptors (e.g., DescrptSeA.update_sel) is the entry point called during training initialization to perform this auto-computation using the BaseUpdateSel utility.
Quick Reference#
| Parameter | Location | Default | Notes |
|---|---|---|---|
model_devi_f_trust_lo | param.json | — (required) | Force lower bound (eV/Å) |
model_devi_f_trust_hi | param.json | — (required) | Force upper bound (eV/Å) |
model_devi_v_trust_lo/hi | param.json | 1e10 | Virial; DeePMD-kit v2+ |
model_devi_adapt_trust_lo | param.json | false | Adaptive lower bound |
sel | model.descriptor | "auto" | List length = len(type_map) |
type_map | model / param.json | — | Must be consistent across all files |
Primary Sources#
- DP-GEN run param reference
- DeePMD-kit training parameters
argcheck.py—se_e2_adescriptor argsupdate_sel.py— auto-sel logicse_e2_a.py—DescrptSeA.update_sel- Example
param.jsonfor methane/CP2K and methane/ABACUS