,
Christoph Standke
,
Juno Steegmans
,
Jan Van den Bussche
Creative Commons Attribution 4.0 International license
We lay the foundations for a database-inspired approach to interpreting and understanding neural network models by querying them using declarative languages. Towards this end we study different query languages, based on first-order logic, that mainly differ in their access to the neural network model. First-order logic over the reals naturally yields a language which views the network as a black box; only the input-output function defined by the network can be queried. This is essentially the approach of constraint query languages. On the other hand, a white-box language can be obtained by viewing the network as a weighted graph, and extending first-order logic with summation over weight terms. The latter approach is essentially an abstraction of SQL . In general, the two approaches are incomparable in expressive power, as we will show. Under natural circumstances, however, the white-box approach can subsume the black-box approach; this is our main result. We prove the result concretely for linear constraint queries over real functions definable by feedforward neural networks with a fixed number of hidden layers and piecewise linear activation functions.
@InProceedings{grohe_et_al:LIPIcs.ICDT.2025.9,
author = {Grohe, Martin and Standke, Christoph and Steegmans, Juno and Van den Bussche, Jan},
title = {{Query Languages for Neural Networks}},
booktitle = {28th International Conference on Database Theory (ICDT 2025)},
pages = {9:1--9:18},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-364-5},
ISSN = {1868-8969},
year = {2025},
volume = {328},
editor = {Roy, Sudeepa and Kara, Ahmet},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICDT.2025.9},
URN = {urn:nbn:de:0030-drops-229508},
doi = {10.4230/LIPIcs.ICDT.2025.9},
annote = {Keywords: Expressive power of query languages, Machine learning models, languages for interpretability, explainable AI}
}