Lesson 3 · Method Families: What Is in the Box?
01What sits inside the model box?Deck pages 2
The predicted label is a function of the two drug representations and the model parameters.
0 / 4 ·Start with two drugs. A drug name is a sample identifier; the model still needs a usable description.
Two sample identifiers
Features / graph / text
Written or learned rule
Compare with the label
Same task + same test → a meaningful model comparison.
Open the box without forgetting how the input and test were defined.
Read all steps as text
- Start with two drugs. A drug name is a sample identifier; the model still needs a usable description.
- Encode the pair into X: chosen features, molecular graphs or text. These are different views of the same pair.
- The box applies a function f. Its internal rule may be written by a person or learned from examples.
- The output is a prediction. A measured or recorded label is separate evidence used to train or test it.
- A score evaluates predictions on a specified test set. It does not explain the biological mechanism by itself.
02Who chooses the information and the rule?Deck pages 3–4, 7, 13, 22
0 / 4 ·Read each row as two choices: how a drug is described, and how a prediction is produced.
More automated feature learning moves human choices; it does not remove them.
Read all steps as text
- Read each row as two choices: how a drug is described, and how a prediction is produced.
- Rules: a person supplies both the recorded facts and the decision rule.
- Chosen features: people decide which measurements or fragments matter; the model learns how to combine them.
- Graphs: the model learns from connections, but people still choose the graph, node attributes and training labels.
- Language models and agents: learned representations can use text; agents add tool calls and a workflow. They are not free of human design.
03How does a human-written rule work?Deck pages 5–6
When both conditions are true, the rule raises an alert.
0 / 4 ·A rule has conditions and an output. The computer checks the rule; it does not discover its mechanism.
Condition to check
Amiodarone example
Both conditions matched
New pair → no entry → unknown, rather than a negative interaction label.
A readable rule is limited by the coverage of its rule base.
Read all steps as text
- A rule has conditions and an output. The computer checks the rule; it does not discover its mechanism.
- Condition 1 matches: warfarin is present in the example pair.
- Condition 2 matches: the added drug is an inhibitor relevant to warfarin metabolism.
- Both conditions match, so the rule produces an interaction alert. The supporting mechanism comes from prior evidence.
- Now consider a new pair with no matching entry. “No rule found” means a knowledge gap, not demonstrated safety.
04Can similarity suggest an interaction?Deck pages 8–10
For the sets of active features, divide the intersection size by the union size: three divided by five.
0 / 4 ·These eight-bit fingerprints for fictional drugs A and A′ are invented. Each position asks the same feature question.
0.60 is feature similarity, not a 60% interaction probability.
The features define which kinds of similarity the model can see.
Read all steps as text
- These eight-bit fingerprints for fictional drugs A and A′ are invented. Each position asks the same feature question.
- Count the shared “1” positions: there are 3. These are the features present in both descriptions.
- Count positions where either has a “1”: there are 5. Jaccard similarity is 3/5 = 0.60.
- If A has a recorded interaction with B, similarity makes A′ + B a candidate. It does not make the label certain.
- A small structural difference can change metabolism or binding. A good-looking match still needs a suitable test and evidence.
05What changes with a neural network?Deck pages 11–12
ReLU keeps positive values and sets negative values to zero. Sigmoid maps each type output to a score between 0 and 1; independent scores need not sum to 1.
0 / 4 ·Keep the input fixed. This tiny network uses three invented binary features, not a real drug descriptor.
Chosen features
b = −0.2
One illustrative hidden unit
Output weights a = (1.4, 0.3, −0.9). Sigmoid scores are rounded to two decimals.
Flexible rules do not recover evidence that is missing from features or labels.
Read all steps as text
- Keep the input fixed. This tiny network uses three invented binary features, not a real drug descriptor.
- A parameter is a number the model can adjust during training. Here the chosen weights are 0.8, −0.2 and 0.4.
- Multiply, add a bias of −0.2, then apply ReLU: negative values become zero. For this input the hidden value is 1.0.
- Separate sigmoid outputs give three illustrative type scores: 0.80, 0.57 and 0.29. Multiple types can pass a threshold.
- At an illustrative 0.50 threshold, types 1 and 2 are selected. These scores are not calibrated patient risks or DeepDDI results.
06What is a graph representation?Deck pages 14
A graph consists of a node set and an edge set. Each node begins with its initial attributes.
0 / 4 ·This invented graph contains five nodes. It demonstrates a representation, not a molecule from the paper.
Entity + initial attributes
A defined relationship
Attributes + neighbourhood
The graph is a chosen view of evidence, not the whole biological world.
Graph learning uses structure while retaining design choices and coverage limits.
Read all steps as text
- This invented graph contains five nodes. It demonstrates a representation, not a molecule from the paper.
- A node stands for an entity. Its initial attributes might include atom type or a drug descriptor, depending on the graph.
- An edge records a connection. A bond and a drug–protein relationship have different meanings; they are not interchangeable.
- The model combines node attributes with the pattern of connections. It learns a useful internal description.
- People still decide what counts as a node, an edge and a label. Missing connections constrain what the graph can communicate.
07How does message passing spread information?Deck pages 15–17, 21
At the next round, take half the old node value plus half the mean of its old neighbour values.
0 / 4 ·Only A starts at 1; the other nodes start at 0. Track the outlined node C. This is a numerical teaching example.
- A1
- B0
- C0
- D0
- E0
This averaging rule has no learned weights. A trained GNN can use richer, learned updates.
Depth expands the neighbourhood; it can also erase differences.
Read all steps as text
- Only A starts at 1; the other nodes start at 0. Track the outlined node C. This is a numerical teaching example.
- Round 1: use half the old self-value and half the mean old neighbour-value. All nodes update simultaneously. C is still 0.
- Round 2: B can now pass information from A to C. C becomes 0.0625; the receptive field reaches two hops.
- Round 3: the same rule mixes a larger neighbourhood. C becomes 0.09375. More depth changes what can reach it.
- After 40 toy rounds, all values approach 0.125. Nodes become hard to distinguish. This illustrates oversmoothing, not a claim that every GNN fails at 40 layers.
08One molecule, or one biomedical network?Deck pages 18–20
Readout combines node representations. A pair model then uses drug representations; the exact architecture depends on the task.
0 / 4 ·Two uses of graphs sit side by side. The molecular shapes are invented; the enzyme connection is a simplified mechanism illustration.
Atoms & bonds
Per-drug representation → pair prediction
Drugs & proteins
Network neighbourhood → relation prediction
Left: invented molecular shapes. Right: mechanism sketch, not an extracted graph from SSI-DDI or Decagon.
Same word “graph”, different entities, evidence coverage and prediction tasks.
Read all steps as text
- Two uses of graphs sit side by side. The molecular shapes are invented; the enzyme connection is a simplified mechanism illustration.
- Molecular graphs: each drug has its own atoms and bonds. A model reads both graphs to describe the pair.
- A readout combines node information into a drug representation. Substructure interactions can also be modelled; SSI-DDI is one paper example.
- Biomedical networks: nodes can be drugs and proteins. Decagon predicts relation types between drug nodes using a larger network.
- The target DDI edge must be withheld for a prediction test. Indirect enzyme links can be clues, but do not prove a clinical outcome; a new drug may have little neighbourhood evidence.
09Where does a language model fit?Deck pages 23–25, 27
0 / 4 ·Start with role, not model size. Ask whether the model encodes input, predicts a label or writes an explanation.
Encoder
Direct answer
No language model runs here. All generated-answer examples are teaching illustrations.
A vector is a representation; a sentence is a claim. Neither is evidence by itself.
Read all steps as text
- Start with role, not model size. Ask whether the model encodes input, predicts a label or writes an explanation.
- Encoder role: a molecular string becomes a learned vector. MoLFormer is a chemical-language representation example, not a ready-made clinical DDI oracle.
- The vector can feed a downstream predictor. Performance still depends on its task, labels and test design.
- Direct-answer role: a language model may produce both a judgement and an explanation. The fluent text needs external checking.
- A generated citation may not exist, and a familiar benchmark may have appeared in pretraining. Verify sources and test genuinely unseen settings.
10What makes an agent a workflow?Deck pages 26, 28–29
0 / 4 ·An agent begins with a question and a plan. This is a simulated workflow; no database or prediction service is queried.
Question → useful tools
Recorded fact + source
Candidate + model context
Support / contradiction / gap
Supported by a cited source
A model or mechanism suggests it
A needed check is unresolved
Choose a method by its evidence and assumptions, then test the intended use.
Read all steps as text
- An agent begins with a question and a plan. This is a simulated workflow; no database or prediction service is queried.
- Retrieve recorded information and retain its source. Mark what is directly supported.
- Call a predictor for a candidate relation. Keep the model output separate from the retrieved fact.
- Search for mechanistic support and contradictions. A missing result should stay visible as missing.
- Assemble a traceable conclusion: known, inferred and missing. Next ask whether the evaluation tests the kinds of new drugs you care about.
Compare assumptions, then compare scores
The families differ in what evidence they use and what their internal rule can learn. No family removes the need for a suitable evaluation.
| Method | What it sees | What it relies on | Where to inspect a gap |
|---|---|---|---|
| Rules | Recorded entries | Relevant knowledge is already written | Missing entries and outdated rules |
| Chosen features | Designed drug descriptions | Features and labels capture the task | Feature limits and biased labels |
| Graph models | Entities and connections | The neighbourhood carries useful signals | Coverage, leakage and oversmoothing |
| Language models & agents | Text, representations and tool outputs | Sources and tools support the task | Unsupported claims and missing checks |
A high score on familiar drug pairs is not automatically a good score on unfamiliar drugs. Carry that question into Lesson 4.