Table of Contents
Fetching ...

Tensor Logic: The Language of AI

Pedro Domingos

TL;DR

Tensor logic proposes a unified AI language built from tensor equations, unifying neural and symbolic AI by treating logic rules as tensor einsums and embedding-aware transformations. It formalizes representations, inference, and learning within a single framework and demonstrates how neural networks, symbolic reasoning, kernel methods, and graphical models can be implemented as tensor equations, including reasoning in embedding space with explicit control over deductive versus analogical behavior via a temperature parameter. The approach supports scalable execution on GPUs, hybrid dense-sparse implementations, and a Tucker-decomposition–based scaling path, with potential benefits in transparency, reliability, and reduced hallucinations compared to large language models. If adopted, tensor logic could provide a new core language for AI, aiding reasoning, knowledge acquisition, and interpretable machine intelligence across domains while maintaining compatibility with existing Python tooling and ecosystems.

Abstract

Progress in AI is hindered by the lack of a programming language with all the requisite features. Libraries like PyTorch and TensorFlow provide automatic differentiation and efficient GPU implementation, but are additions to Python, which was never intended for AI. Their lack of support for automated reasoning and knowledge acquisition has led to a long and costly series of hacky attempts to tack them on. On the other hand, AI languages like LISP and Prolog lack scalability and support for learning. This paper proposes tensor logic, a language that solves these problems by unifying neural and symbolic AI at a fundamental level. The sole construct in tensor logic is the tensor equation, based on the observation that logical rules and Einstein summation are essentially the same operation, and all else can be reduced to them. I show how to elegantly implement key forms of neural, symbolic and statistical AI in tensor logic, including transformers, formal reasoning, kernel machines and graphical models. Most importantly, tensor logic makes new directions possible, such as sound reasoning in embedding space. This combines the scalability and learnability of neural networks with the reliability and transparency of symbolic reasoning, and is potentially a basis for the wider adoption of AI.

Tensor Logic: The Language of AI

TL;DR

Tensor logic proposes a unified AI language built from tensor equations, unifying neural and symbolic AI by treating logic rules as tensor einsums and embedding-aware transformations. It formalizes representations, inference, and learning within a single framework and demonstrates how neural networks, symbolic reasoning, kernel methods, and graphical models can be implemented as tensor equations, including reasoning in embedding space with explicit control over deductive versus analogical behavior via a temperature parameter. The approach supports scalable execution on GPUs, hybrid dense-sparse implementations, and a Tucker-decomposition–based scaling path, with potential benefits in transparency, reliability, and reduced hallucinations compared to large language models. If adopted, tensor logic could provide a new core language for AI, aiding reasoning, knowledge acquisition, and interpretable machine intelligence across domains while maintaining compatibility with existing Python tooling and ecosystems.

Abstract

Progress in AI is hindered by the lack of a programming language with all the requisite features. Libraries like PyTorch and TensorFlow provide automatic differentiation and efficient GPU implementation, but are additions to Python, which was never intended for AI. Their lack of support for automated reasoning and knowledge acquisition has led to a long and costly series of hacky attempts to tack them on. On the other hand, AI languages like LISP and Prolog lack scalability and support for learning. This paper proposes tensor logic, a language that solves these problems by unifying neural and symbolic AI at a fundamental level. The sole construct in tensor logic is the tensor equation, based on the observation that logical rules and Einstein summation are essentially the same operation, and all else can be reduced to them. I show how to elegantly implement key forms of neural, symbolic and statistical AI in tensor logic, including transformers, formal reasoning, kernel machines and graphical models. Most importantly, tensor logic makes new directions possible, such as sound reasoning in embedding space. This combines the scalability and learnability of neural networks with the reliability and transparency of symbolic reasoning, and is potentially a basis for the wider adoption of AI.
Paper Structure (16 sections, 45 equations, 3 tables)