English

NewsXQL SystemsApache DataFusion

Neural Networks and Automatic Differentiation Implemented in SQL, Presented at DataFusion Showcase

This article is a translation. Read the Japanese original

Researchers at XQL Systems have implemented automatic differentiation and neural networks in SQL as an extension of the array database library Xarray-SQL. They stated that the implementation was built based on DataFusion's visitor pattern and referenced the implementation of JAX. They also mentioned that Claude Code was used during the development process.

While demonstrating through Coiled's geospatial benchmarks that common operations in geography and climate science can be expressed via relational algebra, they confirmed that regridding can be reduced to matrix multiplication of sparse matrices, which can be written in SQL using JOIN and GROUP BY with SUM. Based on this insight, they believed that if calculus could also be handled in SQL, physical calculations could be pushed down to the database, leading them to implement automatic differentiation.

In a simplified array model, only the partial derivatives of the diagonal components of the Jacobian matrix are required, making it possible to implement grad(), jvp, and vjp as row-wise operations. The results were presented at the first DataFusion showcase. The presenter stated that due to the separation of the logical and physical layers in relational databases, neural networks on SQL could potentially be useful for distributed training across more than 1,000 GPUs in the future. XQL Systems reports that they are currently exploring this "relational array" direction in collaboration with several researchers and engineers.


Source: Show HN: I implemented a neural network in SQL (HN 121pt, 20 comments) (HN Search (backfill), 2026-07-14)