Localized Petrov–Galerkin Neural Residuals
Implementation & benchmark of arXiv:2607.20378 — PG-KINN: A Physics-Informed Petrov-Galerkin Kolmogorov-Arnold Network for Solving Forward and Inverse PDEs
Source paper: PG-KINN: A Physics-Informed Petrov-Galerkin Kolmogorov-Arnold Network for Solving Forward and Inverse PDEs arXiv:2607.20378 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace the pointwise strong-form PINN loss with a vector of localized weak residuals generated by fixed compactly supported polynomial test functions. Use a neural network or KAN as the trial function, integrate by parts once, and evaluate each test residual with Gauss–Legendre quadrature; this lowers the required derivative order and prevents a few high-curvature collocation points from dominating training.
Formulas
Mathematical statement
The paper considers the second-order boundary-value operator \(\mathcal{P}(u)=-\nabla\!\cdot(\bm{\kappa}\nabla u)+\bm{b}\cdot\nabla u+c u=f\) in \(\Omega\), with Dirichlet data \(u=\bar u\) on \(\Gamma^u\) and flux data \((\bm{\kappa}\nabla u)\cdot\bm n=\bar t\) on \(\Gamma^t\). Here \(u_\theta\) is the neural trial function, \(\bm\kappa(x)\) is a possibly anisotropic spatial coefficient, \(\bm b(x)\) is advection, \(c(x)\) is reaction, \(f(x)\) is forcing, and \(\bm n\) is the outward normal. For a test function \(v_e\) that vanishes on \(\Gamma^u\), integration by parts gives the localized weak residual \(R_e(\theta)=\int_e[\nabla u_\theta^\top\bm\kappa\nabla v_e+v_e\bm b\cdot\nabla u_\theta+c u_\theta v_e-fv_e]dx-\int_{\Gamma^t\cap\partial e}\bar t v_e ds\). Choosing \(v_e\) compactly supported in element \(e\) localizes the residual, and Gauss–Legendre quadrature approximates it using only first derivatives of \(u_\theta\). The loss is \(\mathcal L_{PG}=\sum_e\omega_eR_e^2+\lambda_D\mathcal L_D+\lambda_N\mathcal L_N\), where \(\omega_e\) are element weights and the boundary terms enforce Dirichlet and Neumann conditions.
Implementation notes
1. Integration point: modify the physics loss of a PINN or KAN, not the network forward pass. Partition the domain into 1D cells, 2D quadrilaterals or triangles, or small axis-aligned patches. For every element \(e\), define one or several fixed compactly supported test functions \(v_e\), such as linear hat functions or local Legendre polynomials that vanish outside the element. Precompute \(v_e\), \(\nabla v_e\), Gauss points \(x_{eq}\), weights \(w_q\), and Jacobian determinants \(|J_e|\). 2. Pseudocode: theta=init(); for step in range(T): u=net(x_g); grad_u=autograd(u,x_g); term=dot(grad_u,kappa(x_g)*grad_v)+v*(b(x_g)*grad_u)+c(x_g)*u*v-f(x_g)*v; R[e]=sum_q(w[q]*detJ[e]*term[e,q]); loss=sum_e omega[e]*R[e]**2 + lambdaD*mse(net(xD),uD) + lambdaN*mse(flux(xN),tN); theta=optimizer_step(loss,theta). Use first derivatives only and do not compute the strong residual \(-\nabla\cdot(\kappa\nabla u)\). 3. The weak residual and quadrature rule come from the mathematical construction; \(\kappa,\bm b,c,f\) are supplied by the PDE or represented by differentiable coefficient networks. Estimate optional weights empirically with \(\omega_e=1/(\operatorname{EMA}(R_e^2)+\epsilon)\), clipped to \([0.1,10]\), or use uniform weights initially. For inverse problems, replace \(\kappa\) by \(\kappa_\phi\) and evaluate residuals using the measured field \(u_{obs}\), while omitting boundary penalties from the coefficient-network loss. 4. First experiment: solve a 2D manufactured Poisson or advection–diffusion problem on the unit square, comparing an equal-width MLP strong-form PINN, the same MLP with pointwise residual loss, and this localized weak loss at equal network evaluations. Start with 16 elements, four Gauss points per element, and one linear test per element. Measure relative \(L^2\) error, gradient error, wall-clock time to a fixed error, and residual variance across elements. The expected signal is lower loss variance and faster convergence, especially for nonsmooth or high-frequency solutions; target at least 2x lower error at equal optimization steps or substantially fewer autodiff operations at equal accuracy. Then test inverse recovery of a spatially varying diffusion coefficient and check whether the recovered coefficient avoids the zero-coefficient collapse.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗
Stage 2 · Practical benchmark result: Significantly worse ✗
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built a localized 1D Petrov–Galerkin neural residual module using compact quadratic bubble tests, Gauss–Legendre quadrature, and only first derivatives of the trial network. Integration by parts matched to 9.8e-15 error, quadrature became exact at Q>=5 for the tested degree-8 case, and phase-averaged high-frequency attenuation had observed slope -1.977 versus predicted -2.0. The weak PINN achieved relative L2 error 1.69e-4 versus 1.28e-4 for strong form, so the mechanism manifested but no accuracy or speed win was observed in this smooth toy problem.
- Agent confidence
- 9/10
- Baseline
- Strong-form PINN: relative L2 1.2764e-4, final loss 8.9235e-4, 9.62 s, 900 steps
- Idea
- Localized weak PINN: relative L2 1.6916e-4, final loss 1.4811e-6, 39.69 s, 900 steps; integration-by-parts error 9.77e-15; oscillation attenuation slope -1.977 versus predicted -2
Limitations: Only a 1D smooth manufactured Poisson problem was tested. The experiment did not test 2D geometry, anisotropic or advection operators, nonsmooth or singular solutions, adaptive element weights, KAN trial functions, inverse coefficient recovery, equal-FLOP comparisons, or memory scaling.
How to run: python3 localized_pg_experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.20378)
Significantly WORSE than the tuned baseline (n/a, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Poisson_dirichlet_local
- Model
- mlp_tiny
- Paired seeds
- 8
- Baseline mean
- 0
- Idea mean
- 0.0545
- Effect (Δ)
- 0.0523 (n/a; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the available 1D manufactured Poisson track was tested; no 2D geometry, anisotropic coefficients, advection, nonsmooth or singular solutions, adaptive element weighting, KAN trial functions, inverse recovery, or equal-FLOP accuracy comparison was run. The benchmark used 80 epochs and the existing accepted local Poisson track.
How to run: python3 stage2_bench.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 10/10
Implemented and ran the structurally matched Stage-2 benchmark on the 1D Poisson Dirichlet PDE track using the same mlp_tiny architecture for strong-form and localized Petrov–Galerkin training. Across 8 paired seeds, the idea had higher test MSE (0.0545484 vs 0.00226854), with paired delta +0.0522799 and permutation p=0.0081, so it was significantly worse. The trained-model mechanism signature also failed: the weak system's observed strong-residual RMS was 1.48x the baseline rather than suppressed.
- Baseline
- test MSE mean 0.00226854118227493, std 0.001474510667970956, best lr 0.002, 8 seeds
- Delta mean
- 0.052279899318818934
- Idea
- test MSE mean 0.054548440501093864, std 0.004718308158831843, cells=16, q=4, 8 seeds
- Idea wins
- 0
- P value
- 0.0081
Benchmark result
Significantly WORSE than the tuned baseline (n/a, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Poisson_dirichlet_local
- Model
- mlp_tiny
- Paired seeds
- 8
- Baseline mean
- 0
- Idea mean
- 0.0545
- Effect (Δ)
- 0.0523 (n/a; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the available 1D manufactured Poisson track was tested; no 2D geometry, anisotropic coefficients, advection, nonsmooth or singular solutions, adaptive element weighting, KAN trial functions, inverse recovery, or equal-FLOP accuracy comparison was run. The benchmark used 80 epochs and the existing accepted local Poisson track.
How to run: python3 stage2_bench.py
Artifacts
- bench_report.json 3.0 KB View Raw
- localized_pg_experiment.py 6.7 KB View Raw
- report.md 1.4 KB View
- report_bench_2026-08-30T210443.md 3.1 KB View
- results.json 2.1 KB View Raw
- stage2_bench.py 5.5 KB View Raw