Implementation of Support Vector Machines using Reaction Networks

Amey Choudhary, Jiaxin Jin, Abhishek Deshpande · 2025

Read Implementation of Support Vector Machines using Reaction Networks by Amey Choudhary, Jiaxin Jin, Abhishek Deshpande (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-19115.txt.

Introduction

Amey Choudhary, Jiaxin Jin, and Abhishek Deshpande show that a classic learning algorithm can run on chemistry instead of electronics, in a 2025 paper. Support vector machines sort data by drawing the widest possible boundary between classes, and they cope well with rich data and small samples. The team designs a network of chemical reactions whose settling behavior mirrors the math of the machine, offering a biochemical route to classification.

Catalog record

CREATORAmey Choudhary, Jiaxin Jin, Abhishek Deshpande
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE42 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2503-19115

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Implementation of Support Vector Machines using Reaction Networks Amey Choudhary, Jiaxin Jin, Abhishek Deshpande Abstract Can machine learning algorithms be implemented using chemical reaction networks? We demonstrate that this is possible in the case of support vector machines (SVMs). SVMs are powerful tools for data classification, leveraging VC theory to handle high-dimensional data and small datasets effectively. In this work, we propose a reaction network scheme for implementing SVMs, utilizing the steady-state behavior of reaction network dynamics to model key computational aspects of SVMs. This approach introduces a novel biochemical framework for implementing machine learning algorithms in non-traditional computational environments. 1 Introduction Living cells respond to external stimuli through mechanisms such as gene regulatory networks. Systems biology hopes to construct complex circuits such as oscillators/switches from simple building blocks. Recently, these designs have enabled the development of complicated biological circuits for real-world applications. Our work aims to enable computation in living environments, where modern computers are currently unable to operate. Reaction networks offer a robust framework for biomolecular interactions and can be realized through DNA strand displacement reactions, providing a physical basis in cellular environments. This makes them a powerful “programming language” for molecular computation, owing to DNA’s sequence specificity and high-density information storage. However, programming reaction networks for more sophisticated tasks like training and testing remains a challenge. The idea of using reaction networks for performing computation dates back to the 1940s. McCulloch and Pitt were the first to link neural networks to cellular automata [ 18 ] . In the 1960s, Jacob, Sugita, and Rossler used chemistry for implementing logical circuits [ 15 , 24 , 27 ] . Later, in 1994, Adleman solved a seven-node Hamiltonian problem using DNA strands [ 1 ] . Subsequently, Winfree and Qian [ 7 , 23 ] have developed DNA strand displacement schemes to create more complex circuits. Recently, reaction networks have been used to implement various machine learning algorithms. In particular, these include the work of Stojanovic et al. [ 19 ] who construct reaction networks to automate decision tree implementations and Gopalkrishnan et al. [ 12 , 30 , 31 ] who have designed reaction network schemes that calculate maximum likelihood estimates and simulate Boltzmann machines [ 20 , 21 , 22 , 25 ] . More recently, reaction networks have been shown to implement neural network dynamics [ 3 , 8 , 16 ] . In this paper, our focus is on Support Vector Machines (SVMs). Introduced by Vapnik and Chervonenkis in the 1960s, SVMs are supervised classification algorithms. The essential idea of SVM is to construct a hyperplane that maximally separates data points from different classes, creating the largest possible margin. For data that can be separated linearly, SVM works perfectly well, but for nonlinear cases, one needs to use the kernel functions for mapping data onto spaces that are high-dimensional. In this work, we design a reaction network scheme to implement a Hard-Margin SVM, leveraging biochemical processes for machine learning tasks. Our reaction network-based model can load input data points, perform inference, back-propagate loss, and update weights via gradient descent. To ensure these operations proceed in a controlled and sequential manner, we utilize oscillating molecular species to achieve time-scale separation. We validate our approach by simulating the reaction network on synthetic data in Python, demonstrating effective convergence with weight updates comparable to those of standard SVM library implementations. This work introduces a novel biochemical framework for executing complex machine learning algorithms beyond traditional computational systems, expanding the potential applications of reaction networks in computational and synthetic biology. Structure of the paper: The paper is organized as follows. In Section 2 , we introduce reaction networks and recall their properties. Section 3 introduces support vector machines and describes their functioning as an optimization problem. In Section 4 , we introduce the concept of dual-rail encoding to handle negative weights and biases. Further, we describe basic modules like addition, subtraction, multiplication, comparison and approximate majority that will be used as building blocks in the reaction network that simulates the SVM. Sections 5 and 6 describe the reaction network that simulates the feedforward part and the learning part of SVM, respectively. In Section 7 , we introduce an experimental setup to train an SVM using a reaction network scheme. Our goal is to predict the weights and biases of the SVM obtained using reaction networks and compare them with the traditional machine learning implementation. In Section 8 , we tabulate the values of weights and biases obtained using reaction networks and those obtained using the traditional SVM implementations. To validate these results, we also compare their trajectories as a function of time (epochs in our case) and find that they are in close agreement. Section 9 summarizes our contributions and outlines directions for future work. 2 Chemical Reaction Networks Definition 1 ( [ 11 ] ) . A Chemical Reaction Network (reaction network) is a triple (\mathcal{S},\mathcal{C},\mathcal{R}) consisting of a finite set of species \mathcal{S}=\{X_{1},\dots,X_{n}\} , a set of complexes \mathcal{C}=\{C_{1},\dots,C_{r}\} , and a set of reactions \mathcal{R}=\{R_{1},\dots,R_{r}\} . Each reaction describes an interaction between species given by: R_{j}:\sum_{i=1}^{n}\alpha_{ij}X_{i}\rightarrow\sum_{i=1}^{n}\beta_{ij}X_{i}\ \text{ with }j=1,\dots,r, where the left-hand side ( reactant complex ) and the right-hand side ( product complex ) are linear combinations of species. For each reaction R_{j} , the nonnegative integer coefficients \alpha_{ij} and \beta_{ij} represent the stoichiometric coefficients of species X_{i} in the reactant and product complexes, respectively. Example 2 . Consider the reaction network (\mathcal{S},\mathcal{C},\mathcal{R}) shown in Figure 1 . It consists of three species: \mathcal{S}=\{X_{1},X_{2},X_{3}\}, three complexes: \mathcal{C}=\{X_{1}+X_{2},\ 2X_{2},\ X_{3}\}, and four reactions: \mathcal{R}=\{X_{1}+X_{2}\to X_{3},\quad 2X_{2}\to X_{1}+X_{2},\quad 2X_{2}\to X_{3},\quad X_{3}\to 2X_{1}+3X_{2}\}. \bullet \bullet \bullet X_{1}+X_{2} 2X_{2} X_{3} Figure 1 : A reaction network (\mathcal{S},\mathcal{C},\mathcal{R}) with three species, three complexes, and four reactions. One of the most widely used models in reaction network studies is based on mass-action kinetics [ 2 , 13 , 32 , 14 , 33 , 10 ] . In this framework, the reaction rate is determined by the product of the reactant concentrations, each raised to its corresponding stoichiometric coefficient. The detailed definition is provided below. Definition 3 ( [ 11 ] ) . Given a reaction network (\mathcal{S},\mathcal{C},\mathcal{R}) , each reaction R_{j} is assigned a positive constant k_{j} ( reaction rate constant ) for 1\leq j\leq r . Denote by \boldsymbol{k}=(k_{1},\dots,k_{r})\in\mathbb{R}_{>0}^{r} the reaction rate vector . The associated mass-action system generated by (\mathcal{S},\mathcal{C},\mathcal{R},\boldsymbol{k}) is given by: \frac{dx_{i}(t)}{dt}=\sum_{j=1}^{r}k_{j}\prod_{l=1}^{n}x_{l}^{\alpha_{lj}}(\beta_{ij}-\alpha_{ij})\ \text{ with }i=1,\dots,n, where \boldsymbol{x}(t)=(x_{1}(t),\dots,x_{n}(t)) represents the concentrations of species X_{1},\dots,X_{n} at time t . For example, recall the reaction network from Figure 1 (see Example 2 ). Given the reaction rate vector \boldsymbol{k}=(k_{1},\dots,k_{4}) , the reaction rates are assigned as follows: X_{1}+X_{2}\xrightarrow{k_{1}}X_{3},\quad 2X_{2}\xrightarrow{k_{2}}X_{1}+X_{2},\quad 2X_{2}\xrightarrow{k_{3}}X_{3},\quad X_{3}\xrightarrow{k_{4}}X_{1}+X_{2}. Under mass-action kinetics, the associated dynamical system is \begin{split}\frac{\mathrm{d}\boldsymbol{x}}{\mathrm{d}t}&=k_{1}x_{1}x_{2}\begin{pmatrix}-1\\ -1\\ 0\end{pmatrix}+k_{2}x_{2}^{2}\begin{pmatrix}1\\ -1\\ 0\end{pmatrix}+k_{3}x_{2}^{2}\begin{pmatrix}0\\ -2\\ 1\end{pmatrix}+k_{4}x_{3}\begin{pmatrix}1\\ 1\\ -1\end{pmatrix}\\ &=\begin{pmatrix}-k_{1}x_{1}x_{2}+k_{2}x_{2}^{2}+k_{4}x_{3}\\ -k_{1}x_{1}x_{2}+(k_{2}-k_{3})x_{2}^{2}+k_{4}x_{3}\\ k_{3}x_{2}^{2}-k_{4}x_{3}\end{pmatrix}.\end{split} Reaction networks offer a robust framework for implementing molecular-level computations since the mass-action systems generated by them have polynomial right-hand sides. When coupled with DNA strand displacement techniques, reaction networks can be physically realized, bridging the gap from abstract models to practical applications. Example 4 ( [ 26 ] ) . Consider the mass-action system (\mathcal{S},\mathcal{C},\mathcal{R},\boldsymbol{k}) shown in Figure 2 . It consists of four species, \mathcal{S}=\{X_{1},X_{2},X_{3},X_{4}\} ,

Read the complete text