Basic Reasoning with Tensor Product Representations

Paul Smolensky, Moontae Lee, Xiaodong He, Wen-tau Yih, Jianfeng Gao, Li DengarXiv 2016

Abstract

This paper explores the integration of symbolic logic and vector-based computation through Tensor Product Representations (TPRs). By mapping logical axioms to multilinear tensor operations, the authors demonstrate that complex reasoning tasks, such as tracking object locations over time, can be performed with near-perfect accuracy using high-dimensional linear algebra. The framework is validated on the bAbI dataset, showing that "programmed" tensor algebra can effectively handle structured reasoning that often eludes traditional neural models.

Introduction

The divide between symbolic reasoning and connectionism has long been a central challenge in artificial intelligence. While symbolic systems excel at logic and structure, neural networks are superior at learning from data and handling noise. A major goal in modern AI is "neural-symbolic" integration: the ability to represent complex, structured information (e.g., "John is in the kitchen") in a vector space such that a model can perform multi-step logical reasoning.

The authors address this by mapping predicate logic—specifically inference rules like transitivity and persistence—into a vectorial format. They utilize the bAbI dataset to prove that these tensor-based methods can handle the "common sense" logic required to answer questions about moving objects and spatial paths.

Methods: Tensor Product Representations

The core technique is the Tensor Product Representation (TPR). In a TPR, a symbolic structure is decomposed into "fillers" (the content, such as John or Apple) and "roles" (the position or relationship, such as Subject or Location).

Binding and Unbinding

Fillers and roles are encoded as vectors. Binding them together is performed via the outer product, which creates a tensor. Crucially, if the vectors are linearly independent, the information can be "unbound" (retrieved) with perfect accuracy using an inner product.

Axioms as Operators

The authors translate logical axioms directly into tensor operations. For example, the Persistence Axiom (objects stay where they are unless moved) is mapped to a persistence matrix that propagates facts forward in time. Similarly, the Transitivity Axiom (if $A$ is in $B$, and $B$ is in $C$, then $A$ is in $C$) is mapped to a multilinear tensor operation.

Penrose Tensor Diagrams

To manage the complexity of these contractions, the paper utilizes Penrose tensor diagrams. This visual notation represents how different indices interact during inference, providing a clear mapping between logical queries and algebraic expressions.

A Penrose tensor diagram and its component-wise expression for a complex query regarding object location.

Evaluation on the bAbI Dataset

The paper evaluates its framework on the bAbI question-answering task. The authors specifically focus on tasks involving tracking locations (Type-3), three-place predicates (e.g., "travelled from X to Y"), and Path Finding (Category 19). While these tasks are simple for humans, they require a model to maintain a "world state" and perform logical deductions over multiple sentences.

Key Results

Because the reasoning is "programmed" via exact tensor algebra rather than learned through noisy gradient descent, the performance is nearly flawless:

  • 100% Accuracy: Achieved on almost all bAbI question categories.
  • Superiority over Learned Models: This approach significantly outperforms early "learned" models like the Neural Reasoner, which struggled with the more difficult Path Finding (Task 19) and Positional Reasoning (Task 17) benchmarks.

Key Insights and Ideas

  • Inference as Algebra: Logical deduction is not merely simulated by neural networks; it can be formally defined as a series of precise tensor contractions.
  • The Frame Problem Solution: By using a persistence operator, the model handles the "frame problem" (knowing what remains true as time passes) by mathematically canceling out old facts when new, contradictory information arrives.
  • Distributed Compatibility: While the math works with simple "one-hot" vectors, the authors emphasize that it holds for distributed representations, making it compatible with modern deep learning architectures.

Limitations and Future Work

The authors acknowledge that this paper describes programmed vector procedures where the logic is "hard-wired" into the tensor operations. The next step is determining how a neural network could learn these specific tensor-product-based reasoning rules from raw data. Furthermore, high-order tensors can lead to a "dimensionality explosion." While the authors touch on simplifications like matrix multiplication, applying this to massive, real-world knowledge graphs remains a significant challenge. Finally, integrating this tensor reasoning directly with raw, ambiguous natural language—rather than pre-parsed logical forms—is a major future direction.

Summary updated

BibTeX
@misc{smolensky2016basic,
  author = {Paul Smolensky and Moontae Lee and Xiaodong He and Wen-tau Yih and Jianfeng Gao and Li Deng},
  title = {{Basic Reasoning with Tensor Product Representations}},
  year = {2016},
  eprint = {1601.02745},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1601.02745},
}
Figure