NeurIPS 2026Coming to NeurIPS in Sydney?Explore papers, orals & directions

Distance weighted self-attention for nonlocal density functional approximation by artificial neural network

Kulaev Kirill Dmitrievich, Bogdan Protsenko, Alexander Ryabov, Alexander Guda, Evgeny Burnaev, Vladimir VanovskiyAI4X 2025

TL;DR

This paper introduces a novel neural network architecture, "Attentive Density" (AD), that leverages a distance-weighted self-attention mechanism to efficiently approximate the exchange-correlation functional in Density Functional Theory (DFT). By treating electron density as a sequence and applying attention, AD effectively captures nonlocal interactions, achieving high accuracy comparable to established methods while maintaining computational efficiency.

What Problem Does This Paper Address?

Density Functional Theory (DFT) is a cornerstone of quantum chemistry for simulating molecular systems. At its heart lies the exchange-correlation (XC) functional, which describes complex electron-electron interactions. While local approximations to the XC functional are computationally inexpensive, they struggle to accurately capture nonlocal correlation effects, particularly those important for phenomena like Van-der-Waals interactions. More sophisticated nonlocal functionals exist but are computationally demanding. This paper addresses the challenge of developing a method that can accurately and efficiently account for these nonlocal interactions within the DFT framework, bridging the gap between accuracy and computational cost.

Methods

The authors propose a novel deep learning architecture called "Attentive Density" (AD) for approximating the XC functional. The core innovation lies in adapting the transformer's self-attention mechanism to operate on electron density grids. The architecture consists of three main components:

  • Encoder: Maps local electron density features (including density, reduced density gradient, spin-polarization, and kinetic energy density) at each point into a higher-dimensional embedding vector.
  • Distance-Weighted Self-Attention: This is the key novelty. Unlike standard self-attention which treats all input elements equally, this block incorporates spatial distances between points. Attention weights are scaled by a distance-dependent function, allowing the model to prioritize interactions between nearby electron density points while still considering more distant ones. This is achieved by modifying the attention formula to include a distance-based weighting factor.
  • Decoder: Projects the nonlocal embeddings generated by the attention mechanism back into the exchange-correlation energy per particle.

To improve computational efficiency, the attention mechanism is applied locally around each atom within a defined radius (R_attn). The authors also incorporate pre- and post-processing steps to ensure physical constraints, such as the correct asymptotic behavior of the functional and a non-empirical Hartree-Fock exchange coefficient.

Datasets

The training dataset was constructed from accurate reaction energies and corresponding molecular electron densities. It comprises several established datasets: G3, W4-17, S66x8, G21EA, G21IP, MB-165, and BH76. Molecular electron densities were calculated using the PBE0 functional with the def2-QZVPD basis set. The paper does not introduce a new benchmark dataset but evaluates its functional on standard test benchmarks.

Key Insights and Ideas

  • Attention for Electron Density: Applying the transformer's self-attention mechanism, typically used for sequential data like text, to the spatial grid of electron density is a novel approach for capturing nonlocal interactions.
  • Distance Weighting is Crucial: Explicitly incorporating spatial distances into the attention mechanism is key to effectively modeling the nonlocal nature of electron correlation. This allows the model to learn how interactions decay with distance.
  • Local Attention for Efficiency: Restricting the attention computation to a local neighborhood around each atom significantly improves computational efficiency without sacrificing accuracy, making the approach practical for larger systems.
  • Hybrid Functional Design: The proposed functional is a hybrid, combining the strengths of local approximations with the nonlocal capabilities learned by the attention mechanism, aiming for a more balanced and accurate description.

Key Results

The "Attentive Density" (AD) functional demonstrates competitive performance on various benchmarks. Table 1 shows the mean absolute deviation in reaction energy (kcal/mol) for AD compared to established functionals like B3LYP, SCAN, and M06-2X. AD achieves an average deviation of 2.61 kcal/mol, which is comparable to or better than the other tested functionals (B3LYP: 5.74, SCAN: 7.79, M06-2X: 2.48). Notably, AD performs particularly well on the BHPERI and BSR36 benchmarks. The authors also state that their functional allows for self-consistent calculations, a crucial requirement for practical DFT applications.

Limitations and Future Work

The paper acknowledges that the attention is computed locally around each atom for computational efficiency. While this is a strength, it might limit the model's ability to capture very long-range nonlocal interactions that extend beyond the defined R_attn radius. Future work could explore strategies to better capture these truly long-range effects or investigate the impact of different distance weighting functions and attention radii. The authors also suggest that this architecture could be extended to other quantum chemistry problems beyond XC functional approximation.

Summary updated

BibTeX
@inproceedings{dmitrievich2025distance,
  author = {Kulaev Kirill Dmitrievich and Bogdan Protsenko and Alexander Ryabov and Alexander Guda and Evgeny Burnaev and Vladimir Vanovskiy},
  title = {{Distance weighted self-attention for nonlocal density functional approximation by artificial neural network}},
  booktitle = {AI4X},
  year = {2025},
  url = {https://openreview.net/forum?id=WCKeq3QW3k},
}

Loading related content...

Figure