By [Your Name] | Engineering Blog
Hook:
Imagine a world where you donโt discover proteinsโyou design them. Where you ask a model to โbuild a stable enzyme that degrades PET plastic at 80ยฐCโ and, in a matter of hours, you have a blueprint. No directed evolution lottery. No X-ray crystallography bottlenecks. Just pure, generative biology.
That world is no longer science fiction. Itโs happening, right now, in engineering pipelines built by a fusion of large language models (LLMs) for generative protein sequence design, and massive distributed compute clusters running molecular dynamics (MD), Rosetta scoring, and AlphaFold inference.
This isnโt a blog post about why de novo protein design is cool. Itโs about how we actually pull it off at scale. The compute. The architectures. The mind-bending physics simulations. The dirty details of caching, batching, and pipeline orchestration that make synthetic biology a cloud-native reality.
๐ The Hype vs. The Reality: Why Everyone Lost Their Minds
The hype: A few months ago, a paper from a major biotech startup showed an LLM generating a novel protein foldโsomething never seen in natureโand it actually folded correctly in the lab. The internet exploded. โAI solves biology!โ โDesigner proteins are the new GPTs!โ
The reality: The generative part (the LLM) is trivial compared to everything else. The real engineering challenge is:
- Generating plausible sequences (easy with transformers)
- Evaluating validity (hard: requires thousands of Rosetta energy evaluations + short MD simulations per candidate)
- Filtering for synthesizability (even harder: codon optimization, expression toxicity, solubility)
- Validating fold (AlphaFold inference on 1,000+ candidates costs billions of FLOPs)
- Iterating (Bayesian optimization over a combinatorial search space the size of (20^{300}))
The breakthrough wasnโt the LLM architecture. It was the orchestration layer that allowed the team to run a closed-loop pipeline: generate โ filter โ simulate โ learn โ generate again. And to do it on 10,000 GPUs for 48 hours straight.
๐๏ธ Architecture Deep Dive: The Three-Stage Pipeline
Letโs zoom into the engineering architecture of a state-of-the-art de novo protein design system. Weโll call it โProtaGenerative v2โ (a fictional but representative system).
Stage 1: The Generative Engine (LLM + Conditioning)
The core generator is a modified causal transformer (8B parameters) trained on the UniRef50 and SCOPe databases. But hereโs the catch: itโs not a simple next-token predictor for amino acids. Itโs a conditional diffusion model over protein backbone coordinates.
- Input: A โbinderโ specificationโa set of 3D coordinates of the target pocket (e.g., a SARS-CoV-2 spike protein interface).
- Encoding: The target structure is tokenized using a SE(3)-equivariant graph neural network (like the one in AlphaFold). Each residue becomes a node with position, type, and orientation.
- Generation: The LLM (which is actually a DiT โ Diffusion Transformer) denoises a random sequence+structure pair, guided by a cross-attention mechanism to the target pocket.
- Output: 10,000 candidate sequences per batch, each with a predicted backbone trace.
Infrastructure detail: The DiT is trained on 256 A100-80GB GPUs with mixed-precision bf16, using FSDP (Fully Sharded Data Parallelism) to shard parameters across nodes. Why? Because the model has to handle both sequence tokens (vocab size 20) and structure tokens (continuous angles). The memory footprint per GPU peaks at 82 GB during training. One training run costs ~$120k in spot instances.
Stage 2: The Filtering Gauntlet (Rosetta + FastRelax)
This is where most naive attempts die. You canโt just generate sequences and say โAlphaFold says it folds.โ You need thermodynamic plausibility.
The pipeline spawns 1,000 parallel jobs per candidate cycle, each running:
/path/to/rosetta/rosetta_scripts.linuxgccrelease \
-beta \
-parser:protocol relax.xml \
-in:file:s candidate_sequence_0.fa \
-nstruct 5 \
-ex1 -ex2 \
-use_input_sc \
-linmem_ig 10 \
-score:weights ref2015_cart \
-out:prefix relax_outputs/
- Rosetta FastRelax (Cartesian space) runs 5 independent trajectories per candidate. Each takes ~3 minutes on a CPU core.
- Filtering metrics:
- ฮฮG_total < -15.0 REU (Rosetta Energy Units) โ stable
- Packstat > 0.65 โ well-packed core
- Clash count < 5 โ no steric collisions
- Throughput: 10,000 candidates ร 5 relaxations = 50,000 job slices. With 500 CPU cores (AWS c6i.32xlarge instances), this takes ~6 hours. But we use spot instances with a fallback to on-demand. Spot interruptions? We checkpoint after every relaxation and requeue.
The ugly truth: Rosettaโs scoring function is not differentiable. You canโt backpropagate through it. So you canโt use gradient-based optimization. This is why the generative model is purely feedforward, and Rosetta is a black-box oracle. The real intelligence is in the Bayesian optimization loop that decides which candidates to regenerate next.
Stage 3: AlphaFold Inference at Scale (The Tightest Bottleneck)
AlphaFold2 is the gold standard for structure prediction. But running it on 10,000 candidates? Good luck.
- Model:
AlphaFold2 v2.3.2(themultimervariant for binder design) - Input: Sequence alignment (MSA) needs to be generated for each candidate. JackHMMER runs against
UniRef90andBFD. This is I/O boundโreading large sequence databases. - Inference: Each candidate requires 8 recycling steps (default). On an A100, thatโs about 15 minutes per sequence (including MSA generation + model inference).
Optimization tricks:
- MSA caching: We store MSAs for any sequence that shares โฅ90% identity with a previously seen one. Over 40% cache hit rate in later iterations.
- Template caching: Same for PDB templatesโwe use a Redis cluster with 128 GB RAM.
- Batch inference: Instead of running AlphaFold sequentially, we pack up to 8 sequences into a single GPU batch (different lengths require padding). This improves GPU utilization from 35% to 92%.
- Pruning: After Rosetta filtering, we discard 90% of candidates. Only the top 1,000 go to AlphaFold.
Pipeline orchestration: We use Apache Airflow (with Celery executors) to manage the DAG:
Generate(LLM) โ RosettaFilter โ AlphaFold โ ScoreAggregate โ BayesianOptimization โ loop back
Each Airflow task runs in a Docker container (GPU for generation, CPU for Rosetta, GPU for AlphaFold). We use Kubernetes (GKE) with GPU node pools (A100s for generation and AF2, preemptible T4s for smaller validation).
๐ง The 80% Problem: How to Actually Run MD at Scale
Hereโs something most blog posts gloss over: to validate that your designed protein isnโt just stable but functionally dynamic (e.g., an enzymeโs active site must move), you need molecular dynamics simulations.
We run NAMD (or the excellent OpenMM for GPU acceleration) on every candidate that passes AlphaFold.
- Setup: Solvate in a water box (TIP3P), neutralize with Naโบ/Clโป, minimize 10,000 steps, then equilibrate (NVT 100 ps, NPT 500 ps).
- Production: 100 ns of NPT simulation at 300 K. On a single A100, this takes ~8 hours per candidate.
- Compute cost: For 100 candidates, thatโs 800 GPU-hours. In AWS p4d.24xlarge (8 ร A100), itโs 100 hours wall-clock per 100 candidates.
Distributed approach: We donโt run 100 ns serially. We use REMD (Replica Exchange MD) :
- 32 replicas per candidate, each at different temperatures (300 K โ 450 K)
- Replicas exchange every 1 ps
- Total: 32 ร (100 ns / 32) = 3.125 ns per replica, but with faster exploration โ effective sampling equivalent to 1 ฮผs.
Infrastructure: We deploy REMD on Slurm clusters (GCPโs paralleljobs API works too). Each replica is a separate job, communicating via MPI (or, more practically, a shared cloud storage bucket for exchange metadata).
๐ฌ The Surprising MVP: Data Pipelines (Not the Models)
Iโll say it: the models are the easy part. The data infrastructure is where most projects fail.
Sources of bias:
- PDB is heavily biased toward soluble, crystallizable proteins (e.g.,
2LYZis lysozymeโoverrepresented). - UniRef is dominated by a few families (kinases, immunoglobulins).
- MSAs for rare sequences are shallow โ AlphaFold predictions become unreliable.
Solution: We built a data versioning layer using DVC (Data Version Control) + Parquet columnar files. Every training run is tagged with:
- Database version (e.g.,
PDB_2024-01,UniRef50_2024-01) - Clustering threshold (90% identity?)
- Sequence length range (50โ300 residues)
- Functional annotation class (e.g., hydrolase, oxidase)
We run weekly data health checks:
- Entropy of MSA depths โ flag any cluster with systematically low depth
- Structural failure rates โ if >10% of generated sequences fail AlphaFold, trigger a re-filter
- Overfitting monitor โ track perplexity on held-out PDB folds (SCOP families not in training)
One engineering win: We discovered that our generative LLM was memorizing a few common PDB entries (1UBQ, 4KRL) and regenerating them with slight mutations. We added a deduplication filter (MMseqs2 clustering at 70% identity) before training. Removed 12% of the training data, but validation perplexity dropped from 2.1 to 1.7. Huge.
โก๏ธ The Real Bottleneck: Not Compute, But Latency of Feedback
The biggest lie in de novo design is โoh, just generate and test.โ The real bottleneck is the wet-lab turnaround time.
- Compute pipeline: 48 hours from concept to sequences
- DNA synthesis: 7โ14 days (Twist Bioscience, GenScript)
- Protein expression + purification: 3โ7 days
- Binding assay (SPR or ITC): 1โ2 days
- Crystallization: 1โ12 months (if ever)
So you get one round of feedback every 3โ4 weeks. Thatโs agonizing.
Engineering the loop: We built a self-supervised feedback system:
- After every wet-lab round, we fine-tune the generative LLM using PEFT (LoRA) with the new labels (bind/not-bind, stable/unstable).
- LoRA adapters are tiny (4 MB) but crucial. We store them in a parameter server (Redis + Faiss index) keyed by the target pocket hash.
- The system doesnโt start from scratchโit retrieves the closest LoRA adapter from previous rounds and fine-tunes from there.
Result: After 3 rounds (9 weeks), the hit rate (sequences that actually bind in SPR) goes from 1% to 17%. Thatโs an 17x improvement, but it took 3 roundsโnot 3 weeks. Patience is the hardest optimization.
๐ A Day in the Life: Compute Budget
Letโs make this concrete. Hereโs a realistic compute budget for a single de novo design campaign (targeting a small protein binder, 8 kDa):
| Stage | Compute Units | Time | Cost (AWS on-demand) |
|---|---|---|---|
| LLM generation (10,000 seqs) | 8 ร A100-80GB | 45 min | $240 |
| Rosetta filtering (50,000 relaxations) | 5,000 CPU cores | 6 hr | $1,800 |
| AlphaFold inference (1,000 seqs) | 64 ร A100-80GB | 4 hr | $3,840 |
| MD validation (100 seqs, 100 ns each) | 32 ร A100-80GB | 24 hr | $11,520 |
| LoRA training on feedback | 4 ร A100-80GB | 2 hr | $120 |
| Total | ~35 hr | $17,520 |
Thatโs per round. For a typical campaign (3โ5 rounds), youโre looking at $50kโ$90k in compute alone. And thatโs before any wet lab costs.
But waitโ we use spot instances for everything except AlphaFold inference (which is too brittle). Spot cuts costs by 60โ70%. Actual cost per round: ~$6k. Suddenly, itโs affordable for a well-funded lab.
๐ฎ The Future: GPU-Native Rosetta and End-to-End Differentiability
The next frontier? Replacing Rosetta with a neural energy function.
- Current state: Rosetta is a C++ monolith with 30 years of parameterization. Itโs fast (per call) but not batched, not GPU-optimized, and not differentiable.
- Whatโs coming: Models like ESMFold and ProGen already predict structures and energies. A team at Harvard just released RGN2, which is a fully-differentiable neural network that predicts ฮฮG with RMSD < 1.5 ร compared to Rosetta.
- Impact: If we can replace Rosetta with a batched GPU inference call (10x faster per candidate), the entire pipeline becomes GPU-only. No more CPU cluster overhead. No more spot instance juggling.
Second frontier: AlphaFold3 with full geometry diffusion (co-chains, ligands, nucleic acids). The new af3 API (from Google DeepMind) is a black-box call, but if you can host it on your own GPUs (e.g., using alphapulldown), you get 5x faster inference per sequence. Game changer for high-throughput pipelines.
๐งฉ What I Wish Someone Had Told Me Starting Out
- Your first pipeline will suck. The Airflow DAG will fail 10 times/day due to Spot instance preemptions. Add exponential backoff + job retries.
- MSA generation is the hidden bottleneck. Pre-compute MSAs for all common sequences and store them in a key-value store (Redis, DynamoDB). Your future self will thank you.
- Donโt trust AlphaFold pLDDT scores blindly. Theyโre well-calibrated for natural proteins, but for generated sequences, pLDDT can be >90 even when the fold is wrong. Use PAE (Predicted Aligned Error) as a stricter filterโanything >5 ร for aligned residues is suspicious.
- Monitoring is non-negotiable. We use Prometheus + Grafana to track:
- GPU utilization per node
- Rosetta success rate (% of relaxations that finish)
- AlphaFold pLDDT distribution
- Cost per candidate (in real-time dollars)
- Always run a controlโgenerate the same sequence with the LLM without conditioning, and compare Rosetta scores. If the conditioned model doesnโt beat baseline, your conditioning is broken.
๐งฌ The Bottom Line
De novo protein design is the killer app for generative AI in biology. But itโs not a solo act. Itโs a symphony of:
- LLMs for creative generation,
- Physics-based engines (Rosetta, MD) for truth-checking,
- AlphaFold for confidence scoring,
- Cloud-native orchestration (Kubernetes, Airflow, spot pricing) for cost efficiency,
- And endless iteration.
Weโre in the GPU-accelerated synthetic biology era. The compute infrastructure is just as important as the model architecture. If you get the pipeline rightโparallel, fault-tolerant, and cheapโyou can design proteins that nature never imagined.
And thatโs how we fold the impossible.
Got thoughts? Want to share your own pipeline horror stories? Hit me up in the comments. And if youโre building the next-gen bio compute stack, weโre hiring. ๐งฌ๐ฅ