where r r r λ denotes the D-MPNN learned representation (can be augmented by QM descriptors as shown in Equation ) of an atom or a bond, and f λ is an atom or bond embedding subsequently learned from a FFNN. The unconstrained prediction of q λ for an individual atom or bond target is then computed via a linear transformation on f λ . Because q λ is predicted independently for each individual atom or bond without imposing any overall constraints at the molecular level, additional engineering of the model architecture is required to ensure that the predictions for all atoms or bonds as a whole satisfy corresponding physical constraints for an entire molecule whenever applicable. To resolve this issue, a seemingly intuitive approach at first glance would be to spread the error evenly across each atom, but the contribution of each atom to the aggregated value is not the same. Therefore, to better address the discrepancy between λ∈G q λ and Q, we adopt an attention-based constraining technique from Guan et al. to determine the weight of correction for each atom, which is inspired by the attention mechanism in natural language processing. Finally, the constraint-corrected value of q final λ is obtained by: