There are a lot of things on our planet which don't have a mouth or ears or eyes. I was thinking about how one might construct some sort of universal language that might be interpretible to anything, and I thought maybe a language of chemistry could do it! Encoding meaning directly into matter means any being made of matter can interact with it, interpret it, maybe even understand it. The recipient of a message could be a tree which perceives time at a different speed than humans, or a bacterium without sense organs at the human scale, or aliens — why not — and even entities we don't generally label as living such as the ocean. Really, the only ones left out of the fun are beings made of anti-matter who will unfortunately have to wait until we first decide whether antimatter exists or not.
After some research, I couldn't find any constructed languages based on chemistry or even any language based on any sort of physical laws. So I thought I'd give it a shot. Here's my first stab at a translation tool for a language with the grammar of chemistry — the first constructed language to be dictated by physical laws.
The way I've been thinking about it, at its core this translation challenge boils down to a mapping problem. How can we map semantic meaning to chemical structure while maintaining some semblance of "smoothness" (similar molecules should be assigned similar meanings) and "consistency" (assigned meanings should reflect deeper chemical properties like acidity, reactivity, etc.). Without these the translation starts to feel rather arbitrary, a garble of random words pasted onto random molecular bits.
Markov chains are a very straightforward way of modelling evolving sequences. At its simplest, a Markov chain boils down to just keeping a tally of the most likely next thing after the current thing. For text, it's simple enough to keep a running tally of which words follow which words and bam — you have a lookup table. Once you have a Markov chain, you can quickly generate new sequences by iteratively selecting each subsequent token from the probabilities of which tokens are most likely to come next.
On the other side, Morgan fingerprints are bitwise vector descriptors of molecules where each bit corresponds to whether a functional group is present within a molecule. Functional groups are short chemical motifs within a molecule; largely, the study of organic chemistry is the study of functional groups. In other words, functional groups are kind of the building block of molecules (akin to words in a sentence).
The mapping takes a dataset of text and a dataset of molecules (as SMILES strings). Using Morgan fingerprints, I break each molecule into its component functional groups and tally how often each appears across the whole pool. I do the same for words in the text, then create a correspondence table mapping each functional group to a word purely by ranked commonality — the most common word maps to the most common functional group, and so on. It's a clumsy approach, but it captures relative importance, and perhaps the "flavor" of each dataset. I generate the fingerprints to describe 2-atom functional groups (bonds), so words map directly onto the bonds for the visualization.
Next, to make the translation flow rather than read as word soup, I build a Markov chain over the text. Because we're generating a word for each bond, the structure is a graph, not a line — so I run the Markov generation as a breadth-first traversal from a random starting bond. Finally, to balance chemistry against grammar, I blend the two with a weighted sum:
This a term is the gibberish slider in the app. Near 0 we draw from the Markov chain and grammar is preserved; near 1 we weight the chemical makeup of the graph, and words follow the functional groups.
This isn't the first approach I tried. The first was a much heavier neural-network framework — a joint autoencoder mapping words and molecules into a shared latent space (BERT, GPT-2, Morgan fingerprints, Junction-Tree VAEs). It trained reasonably, but was a black box, hard to fine-tune, and nontrivial to retrain on new data. So I went with this simpler, more tunable approach. I'd still love a bidirectional mapping, and bringing reaction mechanics and thermodynamics into the process would be amazing.
Let me know what you think! If you have any suggestions or ideas please don't hesitate to reach out. — Yitong (email: yitongt [at] mit [dot] edu)