GGiriBioAI

/ module 16 · Bio-AI

Bio-AI with LLMs

Life is written in text. DNA is a string over four letters, proteins are strings over twenty, and molecules can be written as SMILES. Once something is text, everything you learned about tokens, embeddings and attention applies, which is why language models now help read genomes, design proteins and screen drugs.

By the end you can
  • Tokenize DNA into k-mers and codons
  • Explain masked prediction in protein language models
  • Read a SMILES string and name its token types

Try this first: Keep k = 3 and read the amino acid letters under each codon.

about 20 min hover ? for help

concept

Same machinery, new alphabets

The big question is again tokenization. English has natural word boundaries; DNA does not. Genomic models chop sequences into k-mers (DNABERT), learn BPE merges over bases, or read one base at a time with very long context (HyenaDNA, Evo). Protein models such as ESM and ProtBERT usually use one token per amino acid.

k-mer
A DNA substring of length k. Overlapping k-mers are a common way to tokenize genomes.
protein language model
A model trained on millions of protein sequences, learning which residues fit where (e.g. ESM).
masked language modeling
Hide a token and train the model to guess it from both sides. How BERT and ESM learn.
Live lab · DNA k-mer tokenizer
ATGMGCCACTGLTGGWATGMCGCRCTCLCTGLCCCPCTGLCTGLGCGACTGLCTGLGCCACTCLTGGWGGAGCCTPGACDCCAPGCCAGCAAGCCA
bases
72
tokens
24
vocab size 4^k
64
GC content
74%

With k = 3 and no overlap each token is a codon, and the blue letter under it is the amino acid it encodes. Reading frame matters: delete the first base and every codon changes.

Live lab · Protein tokens & masked prediction

Click a residue to mask it, the same way ESM is trained: hide a token, predict it from both sides.

hydrophobic · 13polar · 7+ charged · 4− charged · 2G / P (special) · 4
V
42.6%
A
8.6%
I
8.6%
L
8.6%
M
8.6%
F
8.6%
W
3.9%
C
3.9%
position 12
True residue: V (hydrophobic)
Rank in prediction: #1

The top guesses share chemistry with the hidden residue. Real protein LMs learn this from evolution alone, and a low score for a mutation often flags it as harmful.

Toy model: scores come from a hand-made rule (same chemical class, neighbours' class), not from a trained network.

Live lab · SMILES molecule tokenizer
CC(=O)OC1=CC=CC=C1C(=O)O
atomaromaticbondbranchringbracket
characters
24
tokens
24
heavy atoms
13
ring closures
1

Note how "Cl" and "Br" must be one token: a character-level split would read them as carbon + l. Chemistry LMs (ChemBERTa, MolGPT) use this kind of regex tokenizer before training.

landscape

Where LLM ideas show up in biology

  • Protein language models (ESM-2, ProtBERT, ProGen) learn from hundreds of millions of sequences. Their embeddings predict function, stability and the effect of mutations; ESMFold predicts 3D structure from them.
  • Structure models such as AlphaFold combine attention over sequences with geometry. They are not chat LLMs, but they use the same attention building block.
  • Genomic models (DNABERT, Nucleotide Transformer, HyenaDNA, Evo) read DNA to find promoters, splice sites and variant effects; long context matters because genes span thousands of bases.
  • Chemistry models generate or rank SMILES for drug discovery and predict properties such as solubility or toxicity.
  • Research agents combine a chat LLM with RAG over papers and tools such as PubMed, ChEMBL or UniProt, the same pattern as the orchestration module.

Caution: model predictions in biology are hypotheses. They need wet-lab or clinical validation before anyone relies on them.

SMILES
A line notation that writes a molecule as text, e.g. CCO for ethanol.
residue
One amino acid inside a protein chain, written as a single letter such as A, K or W.

Check yourself

Tick each one you could explain to a friend. If you can't yet, scroll back up and replay the lab.

Finished exploring?
Progress is saved only in this browser.