RumiFold: Teaching an LLM to Natively Fold Proteins and Reason About Their Function

Kevin Lu, David Bau*, Wengong Jin*
Northeastern University
*Co-advisors

Paper thumbnail
Paper
(coming soon)
Code thumbnail
Source Code
(coming soon)
Hugging Face thumbnail
Models and Data
(coming soon)

Can We Teach a Language Model to Fold Proteins?

Can we teach a general-purpose language model to fold proteins? And if so, what does learning to fold enable beyond structure prediction itself? We introduce RumiFold, a pretrained chat model that learns to predict protein structures directly from its own hidden states. RumiFold processes proteins through repeated folding passes, then uses these folded representations to answer questions in natural language. It achieves folding accuracy comparable to dedicated single-representation models such as SimpleFold, alongside state-of-the-art performance on Gene Ontology protein function prediction and free-text function description. We find that folding organizes the model's hidden states around protein function, creating an internal per-residue workspace that the model uses when it answers.

0:00 / 0:00
RumiFold folds, then answers. Given a protein sequence and a question, the model first folds the protein in its own hidden states, and then answers from that folded representation. The wording of the answer is simplified here for illustration.

How Does RumiFold Work?

RumiFold is built on Qwen3-8B, a general-purpose chat model, fine-tuned with LoRA adapters. It has no pair representation, no multiple sequence alignment and no diffusion module. The whole computation happens in three steps.

0:00 / 0:00
The RumiFold architecture. The same weights fold the protein, then answer questions using the folded representations.

1. Embed. A frozen ESM-C encoder reads the amino-acid sequence. A small trained bridge turns its embeddings into protein tokens that the language model can read, one per residue.

2. Fold. The language model processes the protein tokens in repeated passes with the same weights. A single linear head reads the backbone structure directly out of the hidden states.

3. Answer. The same model then reads the question alongside its own folded hidden states and replies in natural language.

A Chat Model That Folds as Well as Dedicated Folding Models

We compare RumiFold with single-sequence folding models. It matches SimpleFold on FoldBench and CASP16. ESMFold, which uses a pair representation, remains ahead, and models given a multiple sequence alignment are stronger still.

FoldBench
TM-score, 334 targets
ESMFold0.871
RumiFold0.840
SimpleFold 3B0.840
SimpleFold 700M0.832
ESM3-open0.783
DPLM-2 3B0.709
CASP16
TM-score, 155 domains
ESMFold0.764
RumiFold0.714
SimpleFold 3B0.706
SimpleFold 700M0.706
ESM3-open0.651
DPLM-2 3B0.547
Folding accuracy of single-sequence models. Mean TM-score; higher is better. Bars start at 0.60 (FoldBench) and 0.50 (CASP16). With a multiple sequence alignment, AlphaFold3 reaches 0.937 and 0.858.

Learning to Fold Makes the Model Better at Function

After folding training, we fine-tune RumiFold to predict function. On Gene Ontology prediction it is ahead of GO-GPT v2 and BioReason-Pro. The most informative comparison is the control: the same language model with the same ESM-C input and the same function data, but without folding training, scores lower. When describing proteins whose descriptions never appear in training, RumiFold is well ahead of Prot2Text-V2.

Bar charts. Gene Ontology weighted F1: Base Qwen with ESM-C 0.638, BioReason-Pro (RL) 0.655, GO-GPT v2 0.666, RumiFold 0.683. BLEU-4 on novel Prot2Text proteins: Prot2Text-V2 15.9, RumiFold 21.1.
Function prediction. Left: weighted F1 on the GO-GPT v2 Gene Ontology benchmark (bars start at 0.60). Right: BLEU-4 on Prot2Text test proteins whose reference description does not occur in training.

Folding Organizes the Hidden States Around Function

Why does folding help? We compare how proteins are arranged in representation space before and after training. In the ESM-C features that the model reads, proteins of different function are mixed together. After learning to fold, with no function labels at all, they begin to separate by function. Function training then sharpens the separation.

Three UMAP panels: ESM-C features, after learning to fold, and after Gene Ontology training.
Learning to fold separates proteins by function. UMAP of the same 23,084 proteins, coloured by molecular-function class: (a) the ESM-C layer the model reads; (b) RumiFold after folding training only; (c) the same model after Gene Ontology fine-tuning. The percentage is the share of a test protein's ten nearest training proteins that carry its class; chance is 4%.

RumiFold Uses Its Folding Workspace When It Answers

The folded hidden states are not only organized by function; the model reads them. Take subtilisin Carlsberg, a bacterial protease. Its three catalytic residues, Asp137, His168 and Ser325, are 188 positions apart in the sequence and side by side in the fold. When RumiFold names the function of subtilisin, its attention falls on exactly those three. Below, the structure is coloured by how much RumiFold attends to each residue while it writes its answer. Drag to rotate, scroll to zoom.

Structure shown: AlphaFold Database model of the mature enzyme (residues 106–379), for display. Colour: share of the answer's attention on each residue, from RumiFold.

QuestionWhich GO molecular-function terms describe this protein?
RumiFoldprotein binding; serine-type endopeptidase activity
ResidueRoleShare of attention
Asp137catalytic triad
His168catalytic triad
Ser325catalytic triad
Average residue
Share of the answer's attention on each residue Hover over the plot; click a bar to find that residue in the structure.
106position in the sequence379

To test whether this attention matters, we mutate the catalytic residues of 1,448 held-out enzymes to alanine. The answer “catalytic” disappears for 32% of them, against 3% when random residues are mutated. Restoring the folded memory at those residues alone, while leaving the mutated sequence in place, recovers 90% of the lost answers.

Editing the Memory Changes the Answer

If the answer is read from the memory, writing to the memory should change it. Each entry of the memory has a key and a value, and we edit only the values. For each of five molecular functions we find one direction in the memory's value space: the mean value vector of proteins that have the function, minus the mean over proteins that do not. We then add that direction to the values of held-out proteins that lack the function, about 2,600 per function, leave the keys untouched, and ask what the protein does.

0:00 / 0:00
From attention to interventions. Step 1: when RumiFold names the function of subtilisin, its attention falls on the catalytic triad. Steps 2 and 3: mutating the catalytic residues removes the answer, and restoring the original memory at those residues alone brings it back. Steps 4 and 5: a function's direction in the memory's value space is the difference of two means, and adding it to a protein's values makes the model write that function. The subtilisin structure is the AlphaFold Database model, coloured by RumiFold's attention; the short sequence and the scatter are schematics; the percentages are measured.

The model then writes the added function: for 76% of proteins given the RNA-binding direction and 46% for calcium binding, down to 9% for ATP binding, the weakest of the five. The edit is not precise. It also disturbs other answers: proteins keep only 14 to 57% of the terms they wrote before the edit, against 84 to 89% under a random direction.

A Protein Held Out of Training: TMEM68

Human TMEM68 and its homologues were excluded from residue and function training, and the experiments that identified its catalytic histidine were published in 2023. When RumiFold names the function of TMEM68, 11% of the answer's attention is on His130, more than on any other of the 324 residues. Removing His130 from the folding memory lowers the probability of answering yes for catalytic activity from 0.85 to 0.65.

0:00 / 0:00
TMEM68, read and then edited. RumiFold's answer attends most to His130, and wiping His130 from the folding memory lowers the probability of the answer. The structure shown is the AlphaFold Database model, coloured by RumiFold's attention; the attention plot is the one in the figure below.
RumiFold's attention along the TMEM68 sequence peaks at His130; wiping His130 lowers the probability of the answer.
RumiFold reads the active site of TMEM68. (a) Share of the answer's attention per residue. (b) The effect of wiping His130 from the folding memory.

Example Answers

These are answers from RumiFold on held-out proteins, next to the reference. We include the mistakes: the typical error is getting the kind of protein right and one specific wrong.

Novel Prot2Text test proteins, whose reference text does not occur in training.

P0A625Right

RumiFoldPart of the binding-protein-dependent transport system for molybdenum; probably responsible for the translocation of the substrate across the membrane.

ReferencePart of the binding-protein-dependent transport system ModABCD for molybdenum; probably responsible for the translocation of the substrate across the membrane.

P0AE25Right mechanism, wrong substrate

RumiFoldUptake of galactose across the boundary membrane with the concomitant transport of protons into the cell (symport system).

ReferenceUptake of L-arabinose across the cytoplasmic membrane with the concomitant transport of protons into the cell (symport system).

O31266Right enzyme class, wrong substrate

RumiFoldRing-cleaving dioxygenase involved in oxoquinoline degradation and utilization.

ReferenceRing-cleaving dioxygenase involved in quinaldine degradation and utilization.

O13563Wrong

RumiFoldMatches the consensus sequence of the alpha chain of parvalbumins.

ReferenceComponent of the 19S cap proteasome complex which acts as a regulatory subunit of the 26S proteasome, involved in the ATP-dependent degradation of ubiquitinated proteins.

During function training the model can write out the residues it finds, what they imply, and then the function. Answers from an earlier checkpoint, lightly reformatted.

Q5VV17, a deubiquitinaseRight

RumiFoldObservations: active site: Asp317, Cys320, His431 (Cα–Cα 5–9 Å, one cluster). Inference: The residues form a catalytic site of 3 residues. The chemistry is a hydrolysis. Function: catalytic activity › hydrolase activity › peptidase activity › ubiquitin-like protein peptidase activity › deubiquitinase activity › cysteine-type deubiquitinase activity. EC 3.4.19.12.

ReferenceThe same three residues (5–10 Å), the same lineage and EC number.

D0E8I4, an iron-dependent dioxygenaseRight class, wrong enzyme

RumiFoldObservations: binds Fe cation: His118, Asp120, His198 (Cα–Cα 6–8 Å, one cluster). Inference: The residues form an iron centre of 3 residues. The chemistry is an oxidoreduction. Function: catalytic activity › oxidoreductase activity › … › 2-oxoglutarate-dependent dioxygenase activity. EC 1.14.11.55.

ReferenceThe same residues and lineage, but EC 1.14.11.46, (2-aminoethyl)phosphonate dioxygenase.

Discussion

RumiFold shows that a general-purpose language model can learn to fold proteins in its own hidden states, and that doing so gives it a biologically grounded workspace for reasoning about function. It also has clear limits: it predicts backbone structure only, it trails models that use a pair representation or an alignment, and protein training costs it several points on general language benchmarks. We see RumiFold as a step toward native biomolecular intelligence, where protein-based computation and language-based reasoning become integrated capabilities of general-purpose language models.

Why “RumiFold”?

The RumiFold mascot: a small cow inside a circular arrow.

The name is short for RuminantFold. A ruminant is an animal, such as a cow, that digests its food in more than one pass: it chews and swallows, brings the food back up, and chews it again before it can use what the food contains.

We think of RumiFold the same way. Many language models ingest proteins: they take a sequence in as text or as embeddings and answer straight away. RumiFold digests them. It passes the protein through its own layers more than once, folding it in its hidden states, and it answers only after that work is done. The circular arrow around the mascot is that repeated pass.

How to cite

The paper can be cited as follows.

bibliography

Lu, K., Bau, D., & Jin, W. (2026). RumiFold: Teaching an LLM to Natively Fold Proteins and Reason About Their Function. Preprint.

bibtex

@article{lu2026rumifold,
  title={RumiFold: Teaching an LLM to Natively Fold Proteins and Reason About Their Function},
  author={Lu, Kevin and Bau, David and Jin, Wengong},
  year={2026}
}