# Query Languages for Machine-Learning Models

arXiv: https://arxiv.org/abs/2601.09381 · HTML: https://mlsanity.com/paper/2601.09381/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 9 of its 32 references that are in the map.
- First posted on arXiv 14 Jan 2026.

## Builds on (most cited first, 9 of 9)

- [What Formal Languages Can Transformers Express? A Survey](https://mlsanity.com/paper/2311.00208/) (2023)
- [The Logic of Graph Neural Networks](https://mlsanity.com/paper/2104.14624/) (2021)
- [The Descriptive Complexity of Graph Neural Networks](https://mlsanity.com/paper/2303.04613/) (2023)
- [First-Order Logic with Counting: At Least, Weak Hanf Normal Forms Always Exist and Can Be Computed!](https://mlsanity.com/paper/1703.01122/) (2017)
- [Learning Concepts Described by Weight Aggregation Logic](https://mlsanity.com/paper/2009.10574/) (2020)
- [Aggregate Queries on Sparse Databases](https://mlsanity.com/paper/1912.12338/) (2019)
- [Query languages for neural networks](https://mlsanity.com/paper/2408.10362/) (2024)
- [Recursive querying of neural networks via weighted structures](https://mlsanity.com/paper/2601.03201/) (2026)
- [Provenance Analysis and Semiring Semantics for First-Order Logic](https://mlsanity.com/paper/2412.07986/) (2024)

## Abstract (arXiv)

In this paper, I discuss two logics for weighted finite structures: first-order logic with summation (FO(SUM)) and its recursive extension IFP(SUM). These logics originate from foundational work by Gr"adel, Gurevich, and Meer in the 1990s. In recent joint work with Standke, Steegmans, and Van den Bussche, we have investigated these logics as query languages for machine learning models, specifically neural networks, which are naturally represented as weighted graphs. I present illustrative examples of queries to neural networks that can be expressed in these logics and discuss fundamental results on their expressiveness and computational complexity.
