Laakkonen, Tuomas
On the Anatomy of Attention
Khatri, Nikhil, Laakkonen, Tuomas, Liu, Jonathon, Wang-Maścianica, Vincent
Many efforts have been directed towards providing an overarching framework for different deep learning (DL) architectures, which have gained interest in light of the massive proliferation of variants of the transformer [Vaswani et al., 2017]. These frameworks have come in various forms, such as taxonomic surveys [Lin et al., 2022] that organise certain groups of architectures, and more prescriptive high-level conceptual characterisations [Bronstein et al., 2021]. However, taxonomies risk arbitrariness in their organising criteria and theoretical frameworks risk abstracting away important practical details. The ideal would be to build taxonomies and organising theories starting from the precise computational descriptions of architectures as they occur "in the wild". How to systematically notate and communicate these computational descriptions in a human-friendly manner is a question as old as computer science [Goldstine and von Neumann, 1947], and the triedand-true solution remains the same even today: flowcharts. A mathematical fact that deserves to be better known is that flowcharts, of the same sort that are customary in DL papers introducing architectures, are often already formal representations with unambiguous (but implicit) semantics in the mathematical setting of smooth functions between Euclidean spaces and their sequential and parallel composites [Selinger, 2010]. Even setting aside the formality of flowcharts, in our view there remain two fatal drawbacks from the practitioner's perspective that, to the best of our knowledge, every graphical notational system for DL currently on offer suffers from.
A Pattern Language for Machine Learning Tasks
Rodatz, Benjamin, Fan, Ian, Laakkonen, Tuomas, Ortega, Neil John, Hoffman, Thomas, Wang-Mascianica, Vincent
Idealised as universal approximators, learners such as neural networks can be viewed as "variable functions" that may become one of a range of concrete functions after training. In the same way that equations constrain the possible values of variables in algebra, we may view objective functions as constraints on the behaviour of learners. We extract the equivalences perfectly optimised objective functions impose, calling them "tasks". For these tasks, we develop a formal graphical language that allows us to: (1) separate the core tasks of a behaviour from its implementation details; (2) reason about and design behaviours model-agnostically; and (3) simply describe and unify approaches in machine learning across domains. As proof-of-concept, we design a novel task that enables converting classifiers into generative models we call "manipulators", which we implement by directly translating task specifications into code. The resulting models exhibit capabilities such as style transfer and interpretable latent-space editing, without the need for custom architectures, adversarial training or random sampling. We formally relate the behaviour of manipulators to GANs, and empirically demonstrate their competitive performance with VAEs. We report on experiments across vision and language domains aiming to characterise manipulators as approximate Bayesian inversions of discriminative classifiers.
Quantum Circuit Optimization with AlphaTensor
Ruiz, Francisco J. R., Laakkonen, Tuomas, Bausch, Johannes, Balog, Matej, Barekatain, Mohammadamin, Heras, Francisco J. H., Novikov, Alexander, Fitzpatrick, Nathan, Romera-Paredes, Bernardino, van de Wetering, John, Fawzi, Alhussein, Meichanetzidis, Konstantinos, Kohli, Pushmeet
A key challenge in realizing fault-tolerant quantum computers is circuit optimization. Focusing on the most expensive gates in fault-tolerant quantum computation (namely, the T gates), we address the problem of T-count optimization, i.e., minimizing the number of T gates that are needed to implement a given circuit. To achieve this, we develop AlphaTensor-Quantum, a method based on deep reinforcement learning that exploits the relationship between optimizing T-count and tensor decomposition. Unlike existing methods for T-count optimization, AlphaTensor-Quantum can incorporate domain-specific knowledge about quantum computation and leverage gadgets, which significantly reduces the T-count of the optimized circuits. AlphaTensor-Quantum outperforms the existing methods for T-count optimization on a set of arithmetic benchmarks (even when compared without making use of gadgets). Remarkably, it discovers an efficient algorithm akin to Karatsuba's method for multiplication in finite fields. AlphaTensor-Quantum also finds the best human-designed solutions for relevant arithmetic computations used in Shor's algorithm and for quantum chemistry simulation, thus demonstrating it can save hundreds of hours of research by optimizing relevant quantum circuits in a fully automated way.