Home Domains AI Engineering

AI Engineering

AI engineering for science: machine-learning fundamentals, neural networks, LLM and RAG applications, evaluation, and applied AI in biology and drug discovery.

Nothing in this guide requires a paid API or a cloud account. The concepts and the open-source tooling are the same on a laptop.

AI engineering is the part of AI that is actually buildable: data you can inspect, models you can evaluate, and systems whose failures you can see coming. That is more valuable in a lab than a model that scores well once.

This guide follows the engineering order rather than the hype order. Data and evaluation come before architectures, because in biological work they decide the outcome. If a result here cannot survive a leakage-free split and a baseline comparison, it does not matter how large the model was.

Everything described uses open-source tools and runs on ordinary hardware. No paid API is required to learn or to practise any of it.

AI, machine learning and deep learning

The terms are used interchangeably in headlines and mean different things in engineering. Being precise about which approach a problem needs is the first practical skill, because a linear model with clean data beats a neural network with bad splits.

  • Machine learning learns a mapping from data instead of following hand-written rules; deep learning is machine learning with many-layered neural networks.
  • Generative and large language models are one family of models, not a synonym for AI.
  • Rule-based code still wins for deterministic problems — reach for learning when the rule cannot be written down.
  • The engineering question is never only "which model"; it is data, objective, evaluation and failure modes together.

Data first: splits, leakage and baselines

Most disappointing model results are data problems. In biological datasets the dangerous cases are subtle: near-duplicate sequences, patients appearing in more than one split, and batch effects that correlate with the label.

  • Split by the unit that matters — patient, protein family, scaffold, time — not randomly by row.
  • Normalise and fit preprocessing on the training split only, then apply it unchanged to validation and test.
  • Establish a trivial baseline (most common class, simple linear model, published benchmark) before any deep model.
  • Keep a test set that is looked at rarely; every glance at it spends its value.

Neural networks without the mystique

A network is a stack of parameterised functions trained by gradient descent against a loss. Understanding the training loop, overfitting and transfer learning is enough to build useful models and enough to read the literature critically.

  • Layers, weights, activations and the forward pass — and why depth buys expressive power.
  • Loss functions define what the model optimises; a mis-specified loss produces a confidently wrong model.
  • Training, validation and overfitting: watch the gap, not the headline accuracy.
  • Transfer learning is the practical default in biology, where labelled data is scarce and expensive.
  • Calibration and uncertainty matter more than the top score when a model informs a real decision.

LLMs and retrieval-augmented generation

Language models are components, not products. Prompting, embeddings and retrieval are the engineering around them that decides whether an output is grounded in sources or invented fluently.

  • Prompting is interface design: what the model is told, in what order, and what output shape it must return.
  • Embeddings turn text into vectors that support semantic search over your own documents.
  • Retrieval-augmented generation answers from retrieved passages, which lets you cite the source and detect a miss.
  • Evaluation is not optional: build a small set of questions with known answers before you tune anything.
  • Cost, latency and privacy are design constraints — decide which of them your application can trade.

AI for biological data

Biology brings its own failure modes: tiny labelled sets, extreme class imbalance, distribution shift between studies, and structure in the data that a generic pipeline will quietly ignore. The modelling ideas are transferable; the evaluation has to be domain-aware.

  • Sequences: representation choices (k-mers, one-hot, learned embeddings) and why class balance is rarely the real problem.
  • Structures: predicted structure databases changed what is possible, but a predicted fold is not an experimental structure.
  • Molecules: property and activity prediction, where scaffold splits change the reported performance dramatically.
  • Images and single-cell data: batch effects and stain or protocol differences that a model can learn instead of biology.
  • Always ask whether the model learned the biology or the batch.

Responsible engineering and shipping

A model that is never deployed cannot do harm; one that is deployed needs monitoring, documentation and a plan for being wrong. Responsible practice here is concrete engineering work, not a paragraph in an ethics statement.

  • Privacy and consent for training data, especially anything patient-derived.
  • Bias and coverage: report who and what is under-represented in the data the model learned from.
  • Hallucination and grounding: prefer systems that cite sources and can say "not found".
  • Monitoring and drift: measure live inputs and outputs, not just the offline test score.
  • Reproducibility: versions, seeds, data snapshots and a model card that states what the system should not be used for.

Learning path

Four stages, each ending in something you can show — a prepared file, a figure, a reproducible run. The order matters more than the speed.

Start

Python and data handling

Get comfortable loading, cleaning and splitting a real dataset before any modelling. If Python is new, start with the Python Programming guide.

Build

Classical machine learning

Train, validate and compare baseline models on tabular data, with a leakage-free split and an honest error analysis.

Deepen

Neural networks

Implement a small network from scratch to understand the loop, then fine-tune a pretrained model on your own task.

Apply

LLM and retrieval applications

Build a grounded question-answering tool over a document set you have, with an evaluation set and citation of retrieved passages.

Ship

Evaluate, document, monitor

Write the evaluation report and the model card, and define what would make you pull the model.

Tools this domain uses

Open-source and freely available — that is what we teach. Commercial platforms exist, but none of them are required to learn the work.

  • scikit-learnThe baseline toolkit: splits, pipelines, classical models and metrics that keep evaluation honest.
  • PyTorchThe deep-learning framework to learn on, with readable training loops and a large scientific ecosystem.
  • Hugging Face Transformers and DatasetsPretrained models and datasets for transfer learning, including protein and molecule models.
  • JupyterExploration environment for experiments — and the place to keep the evaluation reproducible.
  • AlphaFold Protein Structure DatabasePredicted structures for proteins without an experimental one, used as input data rather than as ground truth.
  • pytestTests for data pipelines and evaluation code, which is where silent bugs cost the most.

Still being built

Listed openly so nothing here is mistaken for something you can use today. None of these are published yet.

  • Evaluation checklist for biological machine-learning projects — In development — not published yet
  • Worked retrieval-augmented generation example over the research hub — In development — not published yet

Questions learners ask

Do I need a GPU to learn AI engineering?

No. Classical machine learning, data pipelines, evaluation and small neural networks all run on a laptop CPU. A GPU changes what you can train in a reasonable time, not what you can learn.

Should I start with PyTorch or TensorFlow?

Pick one and go deep. PyTorch is the common choice in research code and has readable training loops, which is an advantage while you are learning the mechanics.

Is machine learning always the right answer?

No. If the rule is known or the data is small and structured, a simpler method is usually more accurate and far easier to defend. Learning is for problems where the rule cannot be written down.

What is RAG, in one sentence?

Retrieval-augmented generation answers a question by first retrieving relevant passages from a source you control, then having a language model compose an answer from those passages so the claim can be traced back.

Do I need paid AI APIs to follow this?

No. Everything can be learned with open-source models running locally or on free tiers. The engineering skills — data, evaluation, grounding, monitoring — are what transfer.

01/Related domains