liveBook · Manning

Chapter 8: Generating protein structures

What you will learn in chapter 8 of Domain-Specific Small Language Models

This introduction previews examples of specialized small language models for drug R&D and chemistry, including structure generation and inference optimization.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction previews examples of specialized small language models for drug R&D and chemistry, including structure generation and inference optimization.

8.1 Applying Transformers in chemistry

This section explains how chemistry tasks can be represented for Transformer models and why specialized open-source language models are valuable in drug discovery.

Key terms: text-sequence problems, single-modal, multimodal, spectra, Molecular Transformer, product prediction, SMILES, reactants, reagents, chemical motifs

8.2 From natural language to protein structures

The section uses ProtGPT2 to show how a small language model can generate novel protein sequences and how to assess its outputs.

Key terms: ProtGPT2, decoder-only GPT-2, self-supervised, oligomer, UniRef50, Transformers, inference pipeline, prompt, protein sequences, zero-shot

8.3 Antibody generation with an SLM

This section shows how to generate antibody sequences with AntibodyGPT, validate them, and improve inference efficiency.

Key terms: Antibody Generator, AntibodyGPT, ProGen2, fine-tuned, ProGenForCausalLM, target antigen sequence, tokenizer, PyTorch tensor, decode, perplexity

8.4 From CIF files to crystal structures

The section explains how CrystaLLM learns from CIF text and walks through generating, validating, and optionally sharing crystal-structure models.

Key terms: CrystaLLM, CIF, next token, cross-entropy loss, prompt, target cell composition, cell composition, data_ prefix, make_prompt_file.py, sample.py

8.5 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 7: Generating Python code Chapter 9: Advanced quantization techniques →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.