It's All Just Vectorization: einx, a Universal Notation for Tensor Operations

Florian Fervers, Sebastian Bullinger, Christoph Bodensteiner, Michael Arens

International Conference on Learning Representations 2026 · Oral

Overview

This talk introduces einx, a novel and universal notation designed to simplify and standardize tensor programming across various machine learning frameworks. Presented by Florian Fervers and his colleagues, the core idea behind einx is that all tensor operations can be fundamentally understood and expressed as a combination of an "elementary operation" applied repeatedly through "vectorization." The motivation stems from the prevalent challenges in current tensor programming, such as frequent shape errors, the complexity of diverse API surfaces (e.g., NumPy, PyTorch), and the high cognitive load associated with understanding and writing tensor manipulations.

Watch on SlidesLive

Visual summary for It's All Just Vectorization: einx, a Universal Notation for Tensor Operations by Florian Fervers, Sebastian Bullinger, Christoph Bodensteiner, Michael Arens
Visual summary for It's All Just Vectorization: einx, a Universal Notation for Tensor Operations by Florian Fervers, Sebastian Bullinger, Christoph Bodensteiner, Michael Arens

Key moments

  1. 0:00 Current tensor programming challenges and limitations
  2. 1:10 Introducing einx: elementary operations and vectorization
  3. 2:00 Einx notation explained via matrix multiplication example
  4. 4:15 Einx unifies diverse operations, simplifies mental model
  5. 6:10 Einx library: efficient compilation to frameworks, custom ops
  6. 7:20 Summary: Einx's universal, self-documenting tensor notation
  7. 8:00 Multi-head attention in just three lines of einx
  8. 8:20 Q&A: Ensuring backpropagation with deep learning backends

It's All Just Vectorization: einx, a Universal Notation for Tensor Operations

Speakers: Florian Fervers, Sebastian Bullinger, Christoph Bodensteiner, Michael Arens

Conference: ICLR 2026

YouTube: https://slideslive.com/39062223

Overview

This talk introduces einx, a novel and universal notation designed to simplify and standardize tensor programming across various machine learning frameworks. Presented by Florian Fervers and his colleagues, the core idea behind einx is that all tensor operations can be fundamentally understood and expressed as a combination of an "elementary operation" applied repeatedly through "vectorization." The motivation stems from the prevalent challenges in current tensor programming, such as frequent shape errors, the complexity of diverse API surfaces (e.g., NumPy, PyTorch), and the high cognitive load associated with understanding and writing tensor manipulations.

The significance of einx lies in its potential to revolutionize how researchers and practitioners interact with tensors. By offering a more intuitive, self-documenting, and unified language, einx aims to reduce common pitfalls, streamline development, and foster a deeper conceptual understanding of tensor transformations. It proposes a new mental model that not only clarifies existing operations but also provides a consistent framework for defining new ones, promising a future where tensor code is more readable, less error-prone, and universally applicable.

Background

▶ Watch: Current tensor programming challenges and limitations (0:00)

Tensor programming forms the bedrock of modern machine learning, serving as the primary means to represent and manipulate diverse data types—from images and point clouds to audio, text, and the internal activations within neural networks. Frameworks such as NumPy, PyTorch, TensorFlow, and JAX provide the tools for these operations, yet the current state of tensor notation presents several significant hurdles.

A primary concern is the susceptibility to shape errors, a common frustration for ML developers that often leads to debugging headaches. Beyond this, existing APIs are characterized by their sheer size and complexity, demanding a substantial learning investment. This complexity contributes to a high mental load, as developers must constantly recall specific function signatures, parameter orders, and the often-implicit behaviors of operations. Furthermore, many current notations lack self-documentation, making it difficult to infer an operation's intent or effect without consulting extensive documentation or tracing its execution.

While efforts like einsum (Einstein summation convention) and einops have emerged to address specific subsets of these problems, they are not universally applicable. Einsum excels at expressing summation-based operations but falls short for non-arithmetic transformations like permutations or broadcasting. Einops offers a more flexible approach to reshaping and rearranging dimensions but still doesn't cover the full spectrum of tensor manipulations. Consequently, the ML community has been left without a truly unified and intuitive language for tensor operations, necessitating a new approach that rethinks how we not only read and write but, more importantly, think about tensor programming. The einx project directly tackles this fundamental challenge by proposing a comprehensive and consistent conceptual model.

Key Findings

▶ Watch: Einx notation explained via matrix multiplication example (2:00)

The central finding of the einx project is the profound insight that seemingly disparate tensor operations can be decomposed into two universal components: an elementary operation and vectorization. This decomposition forms the basis of the einx notation, providing a unified and consistent framework for expressing virtually any tensor manipulation.

Key findings and contributions include:

  • Universality: einx is designed to be a truly universal notation, capable of representing any tensor operation, from simple element-wise additions to complex matrix multiplications, permutations, and broadcasting. This contrasts sharply with prior specialized notations like einsum or einops.
  • A Unified Mental Model: By explicitly separating the elementary function (what happens at the lowest dimension, e.g., a dot product, scalar multiplication, or identity map) from its vectorization (how this elementary function is applied across higher dimensions), einx offers a clearer and more intuitive mental model for tensor programming. This model directly addresses the cognitive load issues of existing APIs.
  • Self-Documenting and Interpretable: The einx expression itself, analogous to loop notation, clearly describes the input and output tensor shapes and how dimensions are transformed. This inherent clarity makes einx operations significantly more self-documenting than their traditional counterparts, reducing the need for extensive API lookups.
  • Reduced API Complexity and Inconsistency: einx demonstrates how many operations that traditionally require distinct function calls and inconsistent interfaces (e.g., np.stack, np.concatenate, np.squeeze, np.transpose, np.expand_dims) can all be expressed as vectorized applications of a single elementary operation, such as the identity map. This drastically reduces the surface area of APIs that practitioners need to learn and remember.
  • Performance Equivalence and Gradient Flow: The accompanying einx Python library does not implement operations via slow Python loops. Instead, it compiles the einx expression into highly optimized, framework-specific function calls (e.g., NumPy, PyTorch, JAX). This ensures that einx operations execute with performance identical to directly invoking backend functions, with only a negligible initial compilation and cache lookup overhead. Crucially, the library fully supports automatic differentiation, allowing gradients to flow unimpeded through the computational graph.
  • Extensibility: Beyond a comprehensive set of built-in operations, einx supports custom user-defined operations through flexible function adapters. This allows practitioners to integrate their specialized functions into the einx ecosystem, further enhancing its universality and utility.
  • Conciseness for Complex Architectures: The talk highlights the power of einx by demonstrating how a complex operation like the multi-head attention mechanism from the Transformer architecture can be expressed in just three lines of einx code, showcasing its ability to simplify and condense intricate tensor logic.

In essence, einx provides a robust conceptual framework and a practical library implementation that addresses long-standing challenges in tensor programming, offering a path towards more readable, maintainable, and less error-prone ML code.

Technical Deep Dive

▶ Watch: Einx library: efficient compilation to frameworks, custom ops (6:10)

The core of einx notation revolves around representing any tensor operation as an elementary_operation applied with a specific vectorization strategy. This is formally expressed using a function call structure like einx.operation_name(einx_expression, inputs, outputs).

Elementary Operation

An elementary operation is defined as a simple function that operates on low-dimensional tensors, typically scalars or vectors. Examples include:

  • Dot product: Used for matrix multiplication, convolutions.
  • Scalar multiplication: For element-wise products, outer products.
  • Identity map (ID function): For permutations, broadcasting, stacking, squeezing, and reshaping that only rearrange data.
  • Softmax: Applied along a single axis (a vector).
  • Indexing: For operations like gather or scatter.

The choice of elementary operation determines the fundamental mathematical transformation being performed.

Vectorization

Vectorization describes how the elementary operation is repeatedly applied to different "sub-tensors" or parts of the input and output tensors. The talk draws a clear analogy to traditional Python loop notation:

In this loop, a, c, and b are loop variables defining how the elementary scalar multiplication and summation are vectorized across the dimensions of X, Y, and Z.

einx Expression Syntax

The einx expression is a string that directly encodes this vectorization logic, mirroring the loop notation. It follows the general format: input_axes, input_axes, ... -> output_axes.

  • Comma (,): Delimits different input tensors.
  • Arrow (->): Separates input axis specifications from output axis specifications.
  • Loop Variables: Single letters (e.g., a, b, c) represent axes that are iterated over (vectorized). These variables must appear consistently across inputs and outputs to indicate shared dimensions.
  • Brackets ([...]): Axes enclosed in square brackets are not vectorized; instead, they are forwarded directly to the elementary operation. This signifies that the elementary operation operates on a sub-tensor defined by these bracketed axes. If an elementary operation operates on scalars (0-dimensional tensors), no brackets are used.

Examples:

  1. Matrix Multiplication:
  • Traditional: np.matmul(X, Y) or X @ Y
  • einx: einx.dot("a [b], b [c] -> a [c]", X, Y)
  • Here, X has dimensions (a, b) and Y has (b, c).
  • The elementary operation is a dot product, applied to vectors b from X and c from Y.
  • The a and c dimensions are vectorized.
  1. Softmax:
  • Traditional: torch.softmax(X, dim=-1)
  • einx: einx.softmax("a [b] -> a [b]", X)
  • The elementary operation is a softmax applied to a vector b.
  • The a dimension is vectorized, meaning softmax is applied independently along b for each a.
  1. Outer Product:
  • Traditional: np.outer(X, Y)
  • einx: einx.multiply("a, b -> a b", X, Y)
  • Here, X is a vector (a,) and Y is (b,).
  • The elementary operation is scalar multiplication, as indicated by no brackets.
  • The a and b dimensions are both vectorized, creating an (a, b) output.
  1. Axis Permutation (Transpose):
  • Traditional: X.transpose(1, 0)
  • einx: einx.identity("a b -> b a", X)
  • The elementary operation is the identity map (einx.identity), as values are only rearranged.
  • The a and b dimensions are vectorized and their order is swapped in the output.
  1. Broadcasting (Adding a new axis):
  • Traditional: np.expand_dims(X, axis=1)
  • einx: einx.identity("a -> a b", X, b=...)
  • Again, the elementary operation is the identity map.
  • The b axis is introduced, often with a placeholder value (e.g., b=1 or b=...) to define its extent.

Unification of Operations

A powerful aspect of einx is its ability to unify many seemingly distinct operations under common elementary operations. For instance:

  • Operations like np.stack, np.concatenate, np.squeeze, np.expand_dims, np.transpose, and np.reshape (when only rearranging) can all be expressed as vectorized applications of the identity map. This highlights their shared underlying mechanism of data rearrangement without value modification.
  • Complex operations like matrix multiplication (matmul), convolutions (conv), and generic Einstein summations (einsum) often reduce to a vectorized dot product.
  • Data access operations like gather, scatter, or index can be seen as vectorized indexing operations.

This unification significantly reduces the number of distinct concepts and API calls a developer needs to master, making tensor programming far more consistent and intuitive.

einx Library Implementation

The einx Python library is not a re-implementation of tensor operations in Python. Instead, it acts as a compiler. Given an einx expression and input tensors, it translates this high-level description into an optimized sequence of function calls to the underlying backend framework (e.g., NumPy, PyTorch, JAX, TensorFlow). This compilation ensures:

  • Performance: Operations are as fast as directly calling the backend functions, bypassing the performance overhead of Python loops.
  • Backend Agnosticism: The same einx code can run on different frameworks by simply changing the backend configuration.
  • Gradient Flow: Since einx ultimately calls native backend functions, the automatic differentiation capabilities of frameworks like PyTorch and JAX are fully preserved, allowing for proper backpropagation during training.
  • Extensibility: The library includes mechanisms (function adapters) to allow users to define and integrate their own custom elementary operations into the einx system.

The compilation process involves parsing the einx expression, inferring input/output shapes, and generating a series of backend-specific tensor manipulations that achieve the desired vectorization. This compiled code is then cached for subsequent invocations, minimizing any initial overhead.

Experimental Setup & Results

▶ Watch: Summary: Einx's universal, self-documenting tensor notation (7:20)

The talk on einx primarily introduces a novel notation and a conceptual framework for tensor programming, along with its reference implementation as a Python library. As such, it does not present traditional experimental results in the sense of benchmarking model accuracy, training times, or resource consumption against other methods. The "results" are more focused on the design capabilities, expressiveness, and conceptual advantages of the notation itself.

However, the presentation does make key assertions regarding the practical performance and utility of the einx library:

  1. Performance Equivalence: A crucial "result" articulated is that "invoking the einx operation will be as fast as invoking those backend operations yourself aside from the compilation and the cache lookup." This means that once an einx expression is compiled to framework-specific calls (e.g., NumPy, PyTorch, JAX), its runtime performance is on par with hand-written, optimized code using those native frameworks. The initial compilation step introduces a minor overhead, but this is mitigated by caching compiled operations. This ensures that the benefits of the new notation do not come at the cost of execution speed, which is paramount in ML.
  1. Gradient Flow: The talk explicitly confirms that when using deep learning backends, einx properly supports backpropagation and gradient flow. This is because einx compiles down to standard backend function calls, and these functions inherently manage the computational graph for automatic differentiation. This is a critical capability for any library intended for machine learning research and development.
  1. Conciseness and Clarity: While not a quantitative metric, the ability to express complex operations in significantly fewer lines of code is a qualitative "result" demonstrated. The speaker highlights the implementation of the multi-head attention operation from the Transformer architecture in "just these three lines of code" using einx. This serves as a powerful illustration of the notation's conciseness and its potential to reduce complexity in real-world ML models.
  1. Unification and Consistency: The demonstration of how numerous disparate NumPy-like operations (e.g., stack, concatenate, transpose, expand_dims) can all be represented as vectorized identity map operations within einx constitutes a "result" in terms of API simplification and conceptual unification. This showcases a reduction in mental load and an increase in consistency across the tensor programming landscape.

In summary, while there are no headline numbers from traditional ML experiments (e.g., "einx achieved 90% accuracy on ImageNet"), the "results" presented are foundational to the utility and viability of the einx project: it is performant, compatible with deep learning workflows, highly expressive, and conceptually unifying. The "experimental setup" is, therefore, the design and implementation of the einx compiler and its integration with existing ML frameworks.

Practical Implications

▶ Watch: Q&A: Ensuring backpropagation with deep learning backends (8:20)

The einx notation and its accompanying library carry significant practical implications for various roles within the machine learning ecosystem.

For Practitioners and Model Builders

  • Reduced Mental Load & Cognitive Overhead: By providing a unified and intuitive mental model based on elementary operations and vectorization, einx drastically reduces the cognitive effort required to understand and write complex tensor manipulations. Developers no longer need to remember the specific, often inconsistent, APIs for dozens of operations across different frameworks.
  • Fewer Shape Errors: The explicit nature of the einx expression, which clearly maps input dimensions to output dimensions, makes it inherently less prone to the dreaded shape errors. Debugging becomes simpler as the transformation logic is transparently encoded in the notation itself.
  • Enhanced Code Readability and Self-Documentation: einx expressions are designed to be self-documenting. A well-constructed einx string immediately conveys the intent and effect of an operation, improving code readability and maintainability, especially for collaborative projects or when revisiting old code.
  • Framework Agnosticism and Portability: With einx, the same core tensor logic can be expressed once and executed across multiple backends (NumPy, PyTorch, JAX, etc.) without modification. This is invaluable for research that needs to prototype rapidly in one framework and then deploy or scale in another, or for libraries aiming for broad compatibility.
  • Simplified Learning Curve for New Operations: Once the core einx syntax is understood, it can be applied to virtually any tensor operation, including custom ones. This means less time spent learning new API calls and more time focusing on the core ML problem.
  • Conciseness for Complex Architectures: As demonstrated with the multi-head attention example, einx enables the expression of intricate tensor operations in a highly concise manner, leading to cleaner and more compact model definitions.

For Infrastructure Teams

  • Standardization and Maintainability: Adopting a universal notation like einx could lead to more standardized and maintainable codebases across large organizations. This reduces the "bus factor" and simplifies onboarding for new team members.
  • Potential for Optimization: While einx currently compiles to existing backend operations, a unified intermediate representation for tensor operations could open doors for more advanced, cross-framework optimizations in the future.
  • Easier Code Reviews: The clarity of einx expressions can make code reviews more efficient, as the tensor logic is easier to verify at a glance.

Tradeoffs and Limitations

  • Learning Curve: While designed to be intuitive, einx is still a new notation, and practitioners will need to invest time in learning its syntax and mental model. This initial adoption barrier could slow its widespread acceptance.
  • Initial Compilation Overhead: Although minimal and cached, the first invocation of an einx operation incurs a small compilation overhead. For extremely latency-sensitive applications with many unique, single-shot operations, this might be a consideration, though generally negligible for ML workloads.
  • Dependency on Backend Capabilities: The elementary operations ultimately rely on the capabilities and performance of the underlying backend frameworks. If a specific elementary operation is not efficiently supported by a backend, einx cannot magically make it faster.
  • Community Adoption: The true impact of einx hinges on its adoption by the broader ML community. Without widespread usage, its benefits in terms of standardization and portability will be limited.

In conclusion, einx represents a significant step forward in making tensor programming more accessible, less error-prone, and more enjoyable. Its practical implications are far-reaching, promising to streamline development cycles and foster a deeper, more consistent understanding of the fundamental operations that power modern AI.

Key Takeaways

  • einx is a novel, universal notation for tensor operations, designed to address the complexity, error-proneness, and lack of self-documentation in existing ML frameworks like NumPy and PyTorch.
  • It introduces a powerful mental model by decomposing all tensor operations into an elementary operation (what happens at the lowest dimension) and vectorization (how this operation is applied across higher dimensions).
  • The einx expression uses a concise string syntax (input_axes, ... -> output_axes) with loop variables and brackets to explicitly define the vectorization and the dimensions forwarded to the elementary operation, making code self-documenting and reducing shape errors.
  • The einx Python library compiles these expressions into highly optimized, framework-specific function calls (NumPy, PyTorch, JAX), ensuring performance equivalent to native backend operations and full support for automatic differentiation and gradient flow.
  • einx unifies many disparate tensor operations (e.g., stack, transpose, expand_dims, matmul) under a consistent set of elementary operations (like the identity map or dot product), significantly simplifying the API surface and reducing cognitive load.
  • It offers substantial practical benefits, including increased code readability, reduced debugging time, improved portability across ML frameworks, and the ability to express complex architectures like multi-head attention in a highly concise manner.

About the Speaker(s)

The talk was presented by Florian Fervers, Sebastian Bullinger, Christoph Bodensteiner, and Michael Arens. The transcript does not provide specific titles, affiliations, or detailed biographical information beyond their names as the speakers of this research.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026