UNB Research

Dr. Stijn De Baerdemacker: A deeper dive into neural networks and machine learning

Author: UNB Research

Posted on Apr 14, 2025

Category: Research , Faculty of Science

Dr. Stijn De Baerdemacker is the Canada Research Chair in Quantum Chemistry at UNB, as well as an associate professor of chemistry and associate research director of UNB’s Research Institute for Data Science and Artificial Intelligence.

We spoke with him about his research and what he hopes to accomplish as chair. As part of that conversation, we also spoke about what doors quantum computing is opening for research, and about how he applies machine learning to chemistry.

For example: how can large language models like ChatGPT help us discover new drugs and medical treatments? Don’t they just rely on the words they already know?

As it turns out, the answer is math.

Or, more specifically, the concept of vectors.

Here’s how de Baerdemacker describes how that works, and the “aha!” moment that helped him make an important connection:

Neural networks are capable of making reliable predictions about properties for which they have been fed training data. As chemists, we are interested in what the energy of a particular molecule might be, as that energy governs almost all of its behaviour, including chemical reactions.

Neural networks are extremely efficient in predicting these energies, and we wanted to understand how these neural networks, these machine learning algorithms, came up with such good conclusions.

Basically, a neural network passes a vector of signals from one neuron to another as it makes its predictions. We took a closer look at those vectors of signals along their pathways during this process.

One of my students, a chemist, did an analysis. He put all these vectors of signals on a graph and looked at how they organized themselves: which signals are sitting close together, which ones are not. He started thinking out loud along the lines of, how would I look at these as a chemist? What is the functionality of those signals? What functional groups do they belong to? What makes them similar and how are they different?’

He found all of these things clustered together according to chemical rules! This discovery—that these neural networks learn chemistry in pretty much the same way we teach undergraduate students in their first year—is profoundly interesting.

When you then dig a little deeper, we're not the first people to see hints of this pattern and how it maps onto everything else.

But we went even further, and now we're looking into how all these clusters of signals are related to each other.

I want to reiterate how valuable I’ve found it to have people from different fields, with different perspectives, working together.

There’s a famous example with ChatGPT, which works in a similar way to these neural networks. Basically, they both work on vectors of signals. It’s not one signal, it’s a collection of signals combined together.

In essence, a vector is just an arrow in space. If we take, say, a cyclist as an example, their velocity can be represented by means of an arrow with a direction (where you’re cycling to), and a magnitude (how fast you’re peddling). This concept can easily be generalized to larger spaces with more than three dimensions.

The important part is that you can do arithmetic with vectors; you can add, subtract, multiply, divide them.

Another well-known example is if you take the signal vector for “king,” subtract the signal for “man” from it, and then add the signal for “woman,” you get “queen.” Represented arithmetically, this becomes king - man + woman = queen.

This seems simple and logical when we’re thinking about language, but it means that ChatGPT has, in a way, taught itself this kind of arithmetic, or that the mathematics underlying the model arranged itself in this way when it trained itself on billions and billions of text samples.

So, we investigated this self-arrangement in a chemistry context, and found that if we applied the same vector analogies here, we would recognize them as chemical reactions. That is, a chemical reaction is now the same thing as a cyclist riding along a path.

If a chemical reaction is a vector, that means that we can use arithmetic to substitute one detail for another, one chemical for another. And because it’s a vector, I know what the outcome will be mathematically. In other words, we can use simple vector methods to predict reactions or to predict other properties resulting from those reactions.

That has an enormous predictive power, and we only found this analogy because we knew about developments that went on in Natural Language Processing, and because we had a diverse set of people with different perspectives and knowledge at the table.

More information

Dr. Stijn De Baerdemacker [UNB profile | CRC profile]| Department of Chemistry | Faculty of Science (Fredericton)

Research at UNB | Graduate Studies at UNB | Postdoctoral fellowships