Front Matter
F1 · Foreword

Why This Book Exists

"They gave me a billion parameters and told me to discover something. I searched the hypothesis space, designed the experiment, ran the simulation, and found a result that surprised even my gradient. Then they asked me to explain it in three sentences."

A Hypothesis Generator With Too Many Degrees of Freedom

Discovery is what humans do when everything else is settled. Once survival is secure and the tools are built, the deepest impulse is to find out what else is true: to write a program that solves a new problem, to synthesize a molecule with a property no one has measured, to propose a hypothesis that reframes an entire field. For most of history, discovery required a human mind working at the boundary of the known, armed with intuition, domain knowledge, and patience. That is changing. Large language models can now generate, critique, and refine code in minutes. Reasoning models score at the graduate level on mathematics and science benchmarks. Foundation models trained on protein sequences, molecular graphs, and crystal structures predict properties that once required months of laboratory work. The machinery of discovery itself is becoming programmable.

This book maps the full arc of that transformation across seven parts and fifty-eight chapters. Part I lays the foundations: discovery as search, scientific methodology, Bayesian reasoning, causal inference, and the architecture of the Discovery Workbench platform that grows chapter by chapter through the rest of the book. Part II takes up the practice that brought many readers here: vibe coding, the use of large language models to generate software through natural-language conversation. The term began as slang, but this book treats it as a rigorous engineering discipline. Specification, verification, repair, test generation, and multi-agent orchestration each receive their own chapter, because a prompt that produces working code is only the beginning; a prompt whose output you can trust under production conditions is the real goal.

Parts III through V extend the same logic of AI-assisted discovery into progressively deeper territory. Part III covers discovery through data and models: automated machine learning, neural architecture search, experiment tracking, and the model-selection pipelines that let a researcher move from raw observations to validated predictions without manual hyperparameter archaeology. Part IV turns to discovery through knowledge: retrieval-augmented generation, knowledge graphs, ontology alignment, and the extraction of structured claims from unstructured literature, the machinery that lets an AI system read a thousand papers and surface the contradictions a human would need a year to find. Part V addresses discovery through simulation and optimization: surrogate models, Bayesian optimization, active learning loops, and digital twins that compress months of physical experimentation into hours of computation.

Part VI is where the book becomes domain-specific. Scientific foundation models for drug discovery, materials science, genomics, and climate modeling each receive a chapter, because the general-purpose reasoning of a language model meets its sharpest test when confronted with the constraints of thermodynamics, binding affinity, or crystallographic symmetry. These chapters do not survey the literature from a distance; they build working pipelines, call real APIs, and evaluate predictions against experimental ground truth. Part VII completes the arc with autonomous discovery systems: AI scientists that form hypotheses, design experiments, interpret results, and iterate, the self-driving laboratories and closed-loop research agents that represent the frontier of what discovery can become when the human steps back from execution (though never from judgment).

Why does this book span so many disciplines? Because the boundary between software engineering and scientific research has dissolved. The engineer building a code-generation agent and the chemist building a molecular-property predictor face the same core problems: how to specify what you want, how to search a combinatorial space efficiently, how to verify that the output is correct, and how to close the loop so the system improves with each iteration. The Discovery Workbench, the cumulative platform that readers build and extend across all seven parts, embodies this convergence. A module written in Chapter 8 for structured code generation reappears in Chapter 42 driving a materials-screening pipeline. The Bayesian optimization engine from Chapter 34 powers the autonomous experiment designer in Chapter 55. Read in sequence, the chapters form a single, growing system; read selectively, each chapter stands on its own with clear prerequisites listed at the top.

Why write this book now? Because the pieces have arrived in the same decade and no single community owns them all. The software engineers who mastered prompt engineering and agentic workflows rarely read the active-learning or surrogate-modeling literature. The computational scientists who run molecular dynamics simulations rarely build multi-agent LLM pipelines. The machine-learning researchers who design neural architecture search do not always connect their methods to the older, powerful traditions of Bayesian experimental design. Each community holds part of the map. This book assembles the full map, at graduate depth, with running code for every idea.

Fifty-eight chapters, seven parts, one platform, built for people who believe that the most important thing a tool can do is help you find something that was not known before. That is why this book exists. Welcome to it.