Tensor Logic "Unifies" AI Paradigms [Pedro Domingos]
Pedro Domingos introduces Tensor Logic, a new programming language designed to be the fundamental language for AI. It unifies the two major paradigms: the learning capabilities of deep learning (neural networks) and the transparent, verifiable reasoning of symbolic AI (logic programming), aiming to solve critical issues like hallucination and the opacity of current models.
Pedro Domingos argues that a field cannot truly take off until it finds its language, citing calculus for physics and Boolean logic for circuit design. He posits that AI has been missing its unified language, and introduces Tensor Logic as the solution—a deep unification of the tensor algebra used in deep learning and the logic programming of symbolic AI.
The Core Problem: Unifying Two Worlds
Current AI is split between two paradigms that do not integrate well:
- Deep Learning: Excellent at learning from data (e.g., PyTorch, TensorFlow) but lacks transparent, reliable reasoning capabilities.
- Symbolic AI: Built for reasoning (e.g., Lisp, Prolog) but struggles with learning from messy, real-world data and lacks features like auto-differentiation.
Tensor Logic aims to provide the best of both worlds in a single, elegant framework. It offers the automated, verifiable reasoning of symbolic systems alongside the auto-differentiation, learning capabilities, and GPU scalability of modern deep learning frameworks.
The Fundamental Insight: Einsum is a Logical Rule
The entire language is built on a single construct: the tensor equation. Domingos highlights a “gobsmacking observation” that forms the foundation of Tensor Logic:
The Einstein summation convention (Einsum), which can express all operations in deep learning, is functionally identical to a rule in logic programming.
The only difference is that one operates on real numbers and the other on Booleans. Tensor Logic generalizes the core database operations of joins and projections to the numeric tensor domain. These generalized “tensor joins” and “tensor projections” become the universal building blocks. When the tensors are Boolean, they behave as standard logical operations; when numeric, they perform tensor algebra.
Key Features and Advantages
- A Better Abstraction: Tensor Logic provides a cleaner, more powerful level of abstraction. For example, an entire multi-layer perceptron (MLP) or a Convolutional Neural Network (CNN) can be expressed with a single tensor equation, as opposed to verbose code. This makes it easier to think, code, and reason about models.
- Structure Learning and Predicate Invention: A key challenge in AI is learning the right structure or representation, not just the weights. In Tensor Logic, structure learning falls naturally out of gradient descent. By setting up a general rule schema, the learning process discovers the best representation, akin to how tensor decomposition finds compact, meaningful factors. This extends to “predicate invention”—the ability to discover new, higher-level concepts (like “objects” from pixels) that best explain the data. This process is analogous to the Tucker decomposition of tensors.
- Transparent Reasoning in Embedding Space: One of the most powerful ideas is the ability to perform sound, deductive reasoning directly within an embedding space. This is achieved by controlling a “temperature” parameter, which adjusts the stiffness of a sigmoid non-linearity.
- At high temperatures, the system performs “analogical reasoning.” Inferences are made between objects with similar embedding vectors (high dot-product), allowing for fuzzy, creative connections.
- At zero temperature, the sigmoid becomes a step function. The similarity matrix is discretized to 0s and 1s, forcing the system into a mode of pure, verifiable deductive reasoning. The rules operate on Boolean tensors, and the system computes the deductive closure of its knowledge with zero hallucinations.
- Solving Hallucination: This temperature control directly addresses the hallucination problem in LLMs.
“Every Fortune 500 company… needs to have a mode where the logic of the business is just obeyed… We got to have that, or AI will not take off. And transformers can’t do that. Tensor logic can do that precisely because… if you set the temperature to zero, it does purely deductive reasoning.”
You can set different temperatures for different rules, allowing for a mix of hard constraints (the laws of logic, physics, or business) and softer, learned heuristics.
The Path to Adoption
Domingos outlines a practical migration path:
- Start with a Pre-processor: Developers can begin by writing tensor equations that a pre-processor converts into standard PyTorch or Python code. This allows them to use the clearer syntax for reasoning and modeling without abandoning their existing codebase.
- Education: Tensor Logic is an ideal language for teaching AI because it unifies the entire field under one simple set of concepts, abstracting away unnecessary implementation details.
- Solving Critical Pains: The language’s ability to solve pressing issues like hallucination, model opacity, and safety will drive adoption in enterprise settings where reliability is non-negotiable.
The Trillion-Dollar Waste
Domingos concludes with a sharp critique of the current brute-force approach in AI, where companies spend vast sums on compute to rediscover principles that have been known in symbolic AI for decades.
“Why don’t you spend an afternoon reading a couple of chapters of Russell and Norvig and save a hundred billion dollars in wasted compute? Please, just do that.”
He argues that the industry is reinventing reasoning in an inefficient and costly way, and a unified language like Tensor Logic provides a more principled and efficient path forward. It provides the scaffolding to build towards a “universal induction machine”—the learning equivalent of the Turing machine—which he sees as the true goal of AI.