DeepLL: Considering Linear Logic for the Analysis of Deep Learning Experiments
Nick Papoulias Director of Research OrgD. Labs https://orgdlabs.com [email protected] · 2025
Read DeepLL: Considering Linear Logic for the Analysis of Deep Learning Experiments by Nick Papoulias Director of Research OrgD. Labs https://orgdlabs.com [email protected] (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-2501-00169.txt.
Introduction
Nick Papoulias proposes checking deep learning experiments the way a logician checks resource use. This paper, published in 2024, starts from two everyday hazards: careless data handling that quietly spoils results, and sloppy hardware calls that waste the machines or mislead readers. Linear logic, where premises are consumed rather than reused freely, fits that world of one-use datasets and device calls.
The proposed model renders three things in the logic: an abstract map of an experiment's control flow, the pool of resources it may use, and the rules for consuming them correctly. The model stays lightweight, with both symbolic and visual faces. Its descriptions of experiments are themselves proofs, checkable by standard reasoners, so a malformed experiment can fail the check before it burns compute. Papoulias frames the work as bookkeeping discipline for a field whose experiments are easy to corrupt by accident.
Catalog record
| CREATOR | Nick Papoulias Director of Research OrgD. Labs https://orgdlabs.com [email protected] |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 25 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2501-00169
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
DeepLL: Considering Linear Logic for the Analysis of Deep Learning Experiments Nick Papoulias Director of Research OrgD. Labs https://orgdlabs.com [email protected] Abstract Deep Learning experiments have critical requirements regarding the careful handling of their datasets as well as the efficient and correct usage of APIs that interact with hardware accelerators. On the one hand, software mistakes during data handling can contaminate experiments and lead to incorrect results. On the other hand, poorly coded APIs that interact with the hardware can lead to sub-optimal usage and untrustworthy conclusions. In this work we investigate the use of Linear Logic for the analysis of Deep Learning experiments. We show that primitives and operators of Linear Logic can be used to express: (i) an abstract representation of the control flow of an experiment, (ii) a set of available experimental resources, such as API calls to the underlying data-structures and hardware as well as (iii) reasoning rules about the correct consumption of resources during experiments. Our proposed model is not only lightweight but also easy to comprehend having both a symbolic and a visual component. Finally, its artifacts are themselves proofs in Linear Logic that can be readily verified by off-the-shelf reasoners. 1 Introduction Deep Learning Requirements The increased usage of Deep Learning [ 10 , 8 , 2 ] experiments in all areas of science and engineering, necessitates the careful study of current experimental practices. This is a pressing concern, especially because most practitioners are domain experts in their respective fields and not software engineers or computer scientists. Moreover, the increased usage of generated code in experiments can introduce problems that are harder to detect. In this work we observe that experimental settings [ 4 , 9 ] in Deep Learning, have both: a . Critical data-provenance requirements that mandate the careful handling of datasets during different experimental phases (such as training , validation and testing ) and b . Strong correctness and efficiency requirements for the usage of modern APIs that interact with hardware accelerators (such as GPUs and TPUs [ 19 ] ) On the one hand, software mistakes during data handling can contaminate experiments and lead to incorrect results. Indeed if data-structures (such as lists, sets, tensors, etc) that are meant to be used in different parts of the experiments are not handled correctly, they can invalidate all metrics relating to accuracy and generalization of a model. Consider for example the crucial separation between training and validation datasets. If data from the validation set is used for training or if data from the training set are leaked into the validation set, then (i) all metrics regarding overfitting during training are invalidated and consequently (ii) all metrics and results considering the ability of a model to generalize are also put into question. Crucially, since the validation set itself is used to tune hyperparameters (such as learning rate, batch size, etc) during training, the existence of yet a third set of data (the test set) is required to confirm the generalization of a model in completely unseen data after training [ 18 ] . e Experiment t Training f_{n} Function in path m API as resource \pi_{n} Path transition ⬇ 1 2 #Experimental Environment of Interest e 3 training_slice = None 4 validation_slice = None 5 testing_slice = None 6 model = None 7 8 #Data Processing 9 def load_training_slice ( dataset ): 10 ... 11 12 def load_validation_slice ( dataset ): 13 ... 14 15 def load_testing_slice ( dataset ): 16 ... 17 18 #Model Design & API 19 def create_model (): 20 ... 21 22 def forward_pass ( model , x ): /*!\circled[black! 3 0 !yellow]{$f_ 1 $}!*/ 23 return model ( x ) /*!\circled[black! 3 0 !green]{$m_{}$}!*/ 24 25 def forward_sampling_pass ( model , x , t ): /*!\circled[black! 3 0 !yellow]{$f_ 2 $}!*/ 26 return model ( x , t ). sample /*!\circled[black! 3 0 !green]{$m_{}$}!*/ 27 28 #Experimental Phases 29 def training (): /*!\circled[black! 3 0 !orange]{$t_{}$}!*/ 30 ... 31 if needs_sampling : 32 model_output = \ 33 forward_sampling_pass ( model , x , t ) 34 else : 35 model_output = forward_pass ( model , x ) 36 ... 37 38 def validation (): 39 ... 40 41 def testing (): 42 ... \lst@ifdisplaystyle Control-flow and resources as a petri net e \pi_{1} t \pi_{2a} \pi_{2b} f_{1} \pi_{3} f_{2} \pi_{4} m Control-flow and resources in Linear Logic – M=e,m – \pi_{1} = !(e\multimap t) – \pi_{2} = !(t\otimes m\multimap f_{1}\&f_{2}) – \pi_{3} = !(f_{1}\multimap e) – \pi_{4} = !(f_{2}\multimap e) – \Pi = \pi_{1},\pi_{2},\pi_{3},\pi_{4} Does \Pi,M\vdash e hold for all paths and models ? Figure 1 : A first approximate mapping of a training phase ( left ), with its execution paths and resources (petri net, top-right ), mapped into propositional Linear Logic ( bottom-right ). Keeping track of these different sets is a non-trivial task, since they are frequently mere slices of the same dataset. Moreover information leakage between these sets can take subtler forms other than erroneous usage of a train sample during validation. For example if augmentation [ 9 , 4 ] operations to enrich the dataset is performed before slicing, then we may not have an exact sample leaked but a variation of it. This variation still contains information that can invalidate our training. Resources wasted from these mistakes are not mere computational but also economic, since a lot of these experiments have runtimes measured in months that require expensive hardware. On the other hand, poorly coded APIs that interact with accelerator hardware can lead to sub-optimal usage (with significant economic cost) but also to incorrect conclusions, if there is no way to verify their correctness. These problems become even more pressing with the increased usage of generated code in experiments (such as code generated by Large Language Models [ 1 , 15 ] ) that can suffer from subtle bugs, version mismatches and hallucinations [ 14 ] that are harder to detect. Linear Logic Reasoning Inference rules in sequent calculus The inference rules for left (l) or right (r) introduction of multiplicative conjunction (resource-and) \otimes , can be expressed as follows: • M,A,B\vdash\gamma \Pi \ \ \otimes l M,A\otimes B\vdash\gamma • M_{1}\vdash A M_{2}\vdash B \Pi \ \ \otimes r M_{1},M_{2}\vdash A\otimes B The inference rules for introducing linear implication (lolli) \multimap : • M_{1}\vdash A M_{2},B\vdash\gamma \Pi \ \ \multimap l M_{1},M_{2},A\multimap B\vdash\gamma The inference rules for additive conjunction (choice / fork) \& , can be expressed as: • M,B\vdash\gamma \Pi \ \ \&l_{A} M,A\&B\vdash\gamma • M,A\vdash\gamma \Pi \ \ \&l_{B} M,A\&B\vdash\gamma Finally, the equivalent of an identity axiom can be expressed as: • \Pi id \gamma\vdash\gamma Figure 2 : The sequent calculus, describing the inference rules for our linear logic model. In this work, in order to mitigate these issues, we investigate the use of Linear Logic for the analysis of Deep Learning experiments. We show that primitives and operators of Linear Logic [ 7 ] can be used to express: (i) an abstract representation of the control flow of an experiment, (ii) a set of available experimental resources, such as API calls to the underlying data-structures and hardware as well as (iii) reasoning rules about the correct consumption of resources