# Efficient physics-informed neural networks using hash encoding

Source: [Efficient physics-informed neural networks using hash encoding](<https://www.sota2.com/research/paper/68fa461e1e209131ce91df9b>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-25T05:38:51.350Z

Authors: Xinquan Huang, Tariq Alkhalifah

Published: 2023-02-26T20:00:23.000Z

## Abstract

Physics-informed neural networks (PINNs) have attracted a lot of attention in scientific computing as their functional representation of partial differential equation (PDE) solutions offers flexibility and accuracy features. However, their training cost has limited their practical use as a real alternative to classic numerical methods. Thus, we propose to incorporate multi-resolution hash encoding into PINNs to improve the training efficiency, as such encoding offers a locally-aware (at multi resolution) coordinate inputs to the neural network. Borrowed from the neural representation field community (NeRF), we investigate the robustness of calculating the derivatives of such hash encoded neural networks with respect to the input coordinates, which is often needed by the PINN loss terms. We propose to replace the automatic differentiation with finite-difference calculations of the derivatives to address the discontinuous nature of such derivatives. We also share the appropriate ranges for the hash encoding hyperparameters to obtain robust derivatives. We test the proposed method on three problems, including Burgers equation, Helmholtz equation, and Navier-Stokes equation. The proposed method admits about a 10-fold improvement in efficiency over the vanilla PINN implementation.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Learning PDEs on Helmholtz 3D a=10](<https://www.sota2.com/research/sota/learning-pdes-on-helmholtz-3d-a-10.md>): Learning PDEs; Helmholtz 3D a=10; Relative L2 Error: 0.0721.

- [Learning PDEs on Helmholtz 2D a=100](<https://www.sota2.com/research/sota/learning-pdes-on-helmholtz-2d-a-100.md>): Learning PDEs; Helmholtz 2D a=100; Relative L2 Error: 0.498.

- [Learning PDEs on Helmholtz 3D a=3](<https://www.sota2.com/research/sota/learning-pdes-on-helmholtz-3d-a-3.md>): Learning PDEs; Helmholtz 3D a=3; Relative L2 Error: 0.00404.

- [Learning PDEs on Helmholtz 2D a=20](<https://www.sota2.com/research/sota/learning-pdes-on-helmholtz-2d-a-20.md>): Learning PDEs; Helmholtz 2D a=20; Relative L2 Error: 0.277.

- [PDE Solving on Taylor-Green Vortex nu=0.01](<https://www.sota2.com/research/sota/pde-solving-on-taylor-green-vortex-nu-0-01.md>): Learning PDEs; Taylor-Green Vortex nu=0.01; Relative L2 Error: 0.68.

- [Learning PDEs on Helmholtz 2D a=10](<https://www.sota2.com/research/sota/learning-pdes-on-helmholtz-2d-a-10.md>): Learning PDEs; Helmholtz 2D a=10; Relative L2 Error: 0.00167.

- [Learning PDEs on Convection c=30](<https://www.sota2.com/research/sota/learning-pdes-on-convection-c-30.md>): Learning PDEs; Convection c=30; Relative L2 Error: 0.702.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2302.13397>)

[PDF](<https://arxiv.org/pdf/2302.13397.pdf>)
