A Tensor-Based Compiler and a Runtime for Neuron-Level DNN Certifier Specifications CCS: Software and its engineering Compilers
Avaljot Singh, Yasmin Chandini Sarita, Aditya Mishra, Ishaan Goyal, Gagandeep Singh, Charith Mendis · 2025
Read A Tensor-Based Compiler and a Runtime for Neuron-Level DNN Certifier Specifications CCS: Software and its engineering Compilers by Avaljot Singh, Yasmin Chandini Sarita, Aditya Mishra, Ishaan Goyal, Gagandeep Singh, Charith Mendis (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-20055.txt.
Introduction
Avaljot Singh and co-authors automate the grind of turning math-level safety proofs for neural networks into fast code, in a 2025 paper. Certifiers that prove a network robust are designed neuron by neuron, in clean mathematics. Running them demands tensor-level programs, a different skill entirely, so new certifier ideas often die unimplemented.
Their framework, Neuton, compiles neuron-level specifications — written in a dedicated language — into tensor executables automatically. A stack-based intermediate form plus shape analysis infers the missing tensor operations, including broadcasting. The team show it expresses existing certifiers and runs them on real networks. Lowering the implementation wall should speed the whole field of verified AI.
Catalog record
| CREATOR | Avaljot Singh, Yasmin Chandini Sarita, Aditya Mishra, Ishaan Goyal, Gagandeep Singh, Charith Mendis |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 133 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2507-20055
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
A Tensor-Based Compiler and a Runtime for Neuron-Level DNN Certifier Specifications CCS: Software and its engineering Compilers Avaljot Singh, Yasmin Chandini Sarita, Aditya Mishra, Ishaan Goyal, Gagandeep Singh, Charith Mendis Abstract . The uninterpretability of DNNs has led to the widespread adoption of abstract interpretation-based certification as a practical means to establish trust in real-world systems that rely on DNNs. However, the current landscape supports only a limited set of certifiers, and developing new ones or modifying existing ones to suit different applications remains difficult. This is because the mathematical design of certifiers is expressed at the neuron level, while their implementations are optimized and executed at the tensor level. This mismatch creates a semantic gap between the design and implementation, making manual bridging both complex and expertise-intensive—requiring deep knowledge in formal methods, high-performance computing, etc. In this work, we propose a compiler framework that automatically translates neuron-level specifications of DNN certifiers into tensor-based, layer-level implementations. This is enabled by two key innovations: a novel stack-based intermediate representation (IR) and a shape analysis that infers the implicit tensor operations required to simulate the original neuron-level semantics. During lifting the neuron-level specification to tensor operations, the shape analysis creates the tensors that are in the minimal shape needed to perform the corresponding operations. Further, the IR also allows domain-specific optimizations as rewrites. At runtime, we observe that the tensor computations lead to sparsity specific to the input DNN architecture. This sparsity does not align well with any existing tensor formats. To address this, we introduce g-BSCR, a novel double-compression format that represents tensors as collections of blocks of varying sizes, each of which may exhibit internal sparsity, enabling efficient runtime execution of a wide range of certifiers. Through extensive evaluation, we demonstrate that using the compiler and g-BSCR, for the first time, it is easy to develop new useful certifiers. We can thus analyze the utility of new designs or modified variants of the existing ones on diverse DNNs. Despite its flexibility and generality, the compiler produces executables with performance comparable to hand-optimized implementations of existing certifiers. 1. Introduction Due to recent advances, Deep Neural Networks (DNNs) have started being deployed in a wide range of applications. Their growing use in safety-critical domains—such as healthcare, autonomous driving, and finance—has raised serious concerns about their trustworthiness. In response, Neural Network Certification has emerged as a promising solution by formally verifying certain desirable properties, such as local robustness, monotonicity, output bounds for bounded inputs, etc. Unlike empirical testing, which examines only specific examples, NNC provides mathematical guarantees over input regions, making it a key tool for safely deploying DNNs in high-stakes settings. However, developing new DNN certifiers remains difficult in practice. Due to the complexity involved in implementing such analyses, users typically have to choose between using a small set of existing, hard-coded certifiers or falling back on less rigorous techniques such as testing. In the following section, we outline how DNN certification differs from other algorithms on DNNs and why these differences motivate the need for specialized tools that ease the development of new certifiers. 1.1. Differences from Typical DNN applications. Most practical DNN certifiers that balance precision and scalability are based on Abstract Interpretation, and are typically specified at the neuron level. This is to capture the semantics of the DNNs at a finer granularity, and more easily prove overapproximation-based soundness, a crucial property in Abstract Interpretation ( Campion et al. 2022 ) . However, this is unlike standard DNN algorithms, which are designed for layer-level computations. While the fine-grained design allows precise control over soundness and precision, executing neuron-level logic directly using explicit loops over millions of neurons is computationally infeasible. Consequently, certifier designs are manually transformed into tensor-based, layer-level implementations that use modern optimized tensor libraries such as PyTorch and TensorFlow. This introduces a semantic gap between the neuron-level mathematical design and the layer-level implementation, and makes certifier development accessible only to experts with rare cross-disciplinary knowledge spanning abstract interpretation, formal proofs, DNN applications, and efficient tensor programming. Another key difference is that in typical DNN pipelines, computation begins by initializing input values as concrete tensors, which are then propagated forward through the layers. In DNN certification, however, the process starts with constraints over the input neurons These constraints can range from simple interval bounds on individual neurons to complex high-dimensional polyhedral or zonotope bounds. While such constraint-based reasoning is essential for proving meaningful properties about DNNs, it marks a significant departure from the standard execution model of DNN systems. These fundamental differences highlight the need for a principled solution that bridges the gap between neuron-level specifications and efficient, layer-level implementations. Developing such a solution, however, is nontrivial and raises several technical challenges, which we discuss next. 1.2. Key Challenges The challenges arise because neuron-level specifications capture only the mathematical intent, omitting structural details needed for tensor-based execution. This leads to two key challenges: implicit tensor operations and nonstandard sparsity patterns. Implicit Tensor Operations A central issue is that the necessary tensor operations in the corresponding tensor-based implementation are often implicit in the high-level specification. For example, expressions like multiplying a scalar with a polyhedral bound—common in DNN certifiers—assume broadcasting semantics, where the scalar is conceptually repeated across dimensions. However, such details are not made explicit in neuron-wise logic, making it difficult to infer the correct tensor-level behavior. Broadcasting is a widely used feature in tensor libraries that enables element-wise operations between arrays of different shapes by implicitly expanding dimensions. For example, a tensor of shape [n] can be multiplied with one of shape [m,n] by broadcasting the former to [m,n] . Frameworks like NumPy ( Im et al. 2004a ) and XLA ( Sabne 2020 ) support such automatic broadcasting, but only in well-defined and restricted cases. When the shape mismatch is more complex or when multiple interpretations are possible, these systems raise an error and require manual intervention. Such ambiguous cases frequently arise in DNN certifiers. Worse, even when broadcasting succeeds, the result may violate the intended behavior of the specification. For instance, multiplying a tensor of shape [n] with one of shape [n,n] may succeed by implicitly reshaping the first tensor to either [1,n] or [n,1] and then repeating accordingly, leading to different outputs. The broadcasting mechanism will apply one of these under the hood, even though only one reflects the correct semantics. So, although these frameworks may produce efficient results, a naive translation using these frameworks needs manual intervention to perform the implicit transformations needed to translate neuron-level specifications into accurate layer-level implementations. Sparsity Patterns Another challenge is that the tensors that arise in the layer-level implementation of the mathematical specification are generally sparse. However, not only is this sparsity unspecified in the neuron-level design, but it also does not fit well into any existing sparse tensor representations, such as CSR ( Saad 2003 ) or COO ( Bader and Kolda 2008 ) , that can generate efficient implementations. In contrast, the sparsity observed in DNN certifiers is often block-based with different block sizes, arising from the semantics of the certifier itself and the architecture of the input DNN. Note that these challenges do not arise in any existing implementations of the DNN certifiers because