Sub topic 8
Carrying inferences from source to target
What this chapter covers
You have a source domain, a target problem, and a mapping between their entities. This chapter covers the next step: using the source's relations to generate claims about the target. These claims are hypotheses. They tell you where to look and what to test. They do not tell you what is true.
This chapter assumes you have read the earlier chapters on source and target, surface versus structure, and structure mapping. You should be able to write a mapping as a table of "source entity → target entity" pairs. The code examples need only basic Python reading ability.
The core move: transfer, then flag
Inference transfer has two parts:
- Rewrite. Take each relation in the source and replace its entities with their mapped counterparts in the target.
- Flag. Mark each rewritten relation as a candidate claim. It has not been confirmed.
The rewrite step is mechanical. The flag step is where the skill lies, because a rewritten relation always looks plausible. It is written in the target's vocabulary, so it reads as if it were a finding.
The first code example does the rewrite step for the solar system and the atom.
# Source domain: planets orbiting a sun (relations among entities)
source_relations = [
("attracts", "sun", "planet"),
("more_massive_than", "sun", "planet"),
("orbits", "planet", "sun"),
]
# Mapping between entities of the source and the target (the atom)
mapping = {"sun": "nucleus", "planet": "electron"}
def transfer(relations, entity_map):
"""Rewrite each source relation in terms of target entities."""
return [(rel, entity_map[a], entity_map[b]) for rel, a, b in relations]
candidates = transfer(source_relations, mapping)
for rel in candidates:
print(rel)
# ('attracts', 'nucleus', 'electron')
# ('more_massive_than', 'nucleus', 'electron')
# ('orbits', 'electron', 'nucleus')The function produced three claims about atoms. The first two hold up well: the nucleus attracts electrons, and it is far more massive. The third is where trouble starts. In the classic planetary picture, electrons follow fixed orbits. Quantum mechanics replaces those orbits with probability distributions. The code cannot tell you this. It rewrote every relation with equal confidence.
Why the output is only a candidate
The function has no notion of truth. It carries over whatever relations you gave it. The structure of the source decides what is proposed, and the target's facts decide what is accepted. Keep these two roles separate.
| Step | Who decides | Output |
|---|---|---|
| Rewrite relations through the mapping | The mapping | Candidate claims |
| Check each claim against the target | Evidence from the target | Supported, refuted, or untested |
| Decide what to act on | You, weighing cost of being wrong | A decision or an experiment |
A candidate claim that survives checking is a real finding. A claim that has not been checked is a question.
Three kinds of transferred inference
Not all candidate claims have the same use. It helps to sort them.
Predictions about the target
The source says "A relates to B this way", so you predict the same of the mapped entities in the target. Example: in a river system, a narrow channel raises flow speed. If you map road traffic onto the river, you predict that a lane closure raises vehicle speed through the gap. Test it. In practice, a narrow point often causes queueing instead, so the prediction fails and you learn that cars do not behave like water at that point.
Missing pieces
The source contains an entity or relation that the target has no counterpart for. This suggests something to look for. Example: a hospital emergency department is mapped onto a factory line. A factory has a quality-control station, and the department seems to lack an equivalent. The inference is "perhaps there should be a step that checks work before it leaves". This is a design question, not a fact.
Solutions
The source has a way of dealing with a problem, and the mapped problem exists in the target. You transfer the method. This is the most valuable inference and also the riskiest, since a solution depends on many relations holding at once. The chapter on adaptation covers fitting it to the target.
A worked example: simulated annealing
Metallurgists make strong metal by heating it and cooling it slowly. At high temperature the atoms move freely and can escape poor arrangements. As the metal cools, they settle into a low-energy structure. Quenching, which means cooling quickly, locks in defects.
The target problem is minimizing a cost function. A greedy search always takes the better neighbor, so it gets stuck in a local minimum, which is a solution better than its neighbors but worse than the best overall.
Here is the mapping.
| Source (metal) | Target (search) |
|---|---|
| Atom arrangement | Candidate solution `x` |
| Energy of arrangement | `cost(x)` |
| Small atomic shift | Move to a neighbor |
| Temperature | Willingness to accept worse moves |
| Slow cooling | Gradually lowering that willingness |
| Low-energy crystal | Good minimum |
Transferring the relations gives these candidate claims:
- Higher temperature allows moves to higher energy. So in search, a high setting should allow moves to higher cost.
- Slow cooling produces better final structures than quenching. So in search, a slow reduction should find better minima than an abrupt one.
Neither claim is obvious from the target alone. Both become a concrete procedure.
import math
import random
def anneal(cost, neighbor, x, temp=1.0, cooling=0.995, steps=5000):
"""Minimize cost(x), borrowing the idea of slow cooling from metallurgy."""
best = x
for _ in range(steps):
candidate = neighbor(x)
delta = cost(candidate) - cost(x)
# Always accept improvements; accept worse moves with a probability
# that shrinks as the temperature falls.
if delta <= 0 or random.random() < math.exp(-delta / temp):
x = candidate
if cost(x) < cost(best):
best = x
temp *= cooling
return best
result = anneal(
cost=lambda x: (x - 3) ** 2,
neighbor=lambda x: x + random.uniform(-0.5, 0.5),
x=0.0,
)
print(round(result, 2)) # close to 3.0Notice what came from the source and what did not. The idea of a temperature that falls came from the source. The specific formula exp(-delta / temp) also has a physical origin, in the Boltzmann distribution. But the cooling rate 0.995, the step count, and the neighbor function are choices you make for your problem. The analogy proposed the shape of the solution, and the target's constraints decided the details.
Checking the inference as you go
For each candidate claim, ask three questions:
- Does it depend on a relation that the mapping preserved? If the claim relies on a feature of the source that you did not map, it has no support in your analogy.
- Is there a causal reason, or only a correlation? In the source, why does the relation hold? If you know the mechanism, ask whether the mechanism exists in the target.
- What would show it false? Name an observation in the target that would refute the claim. If none exists, the claim cannot be tested and should not drive a decision.
Take the traffic claim above. Question 1: the mapping preserved "narrowing". Question 2: in water, incompressible flow must speed up through a narrow gap, because the same volume must pass. Cars are not incompressible, and drivers brake. The mechanism is missing. Question 3: measure speeds through the gap. The claim fails the second question, and the data confirm it.
Where inference transfer goes wrong
- Transferring relations you did not map. If you map only three entities, claims about a fourth have no basis. Add it to the mapping and justify it, or drop the claim.
- Treating the rewritten claim as a result. The wording is in the target's terms, which makes it feel established. Keep a visible label such as "candidate" until it is checked.
- Carrying over incidental relations. In the source, "the sun is yellow" is true, but it is not part of the structure that matters. Transfer only relations that connect to your goal.
- Stopping at the first match. One transferred claim that works encourages you to transfer more. Each additional claim is a fresh bet.
A small routine
- List the source's relations that connect to your goal.
- Rewrite them through the mapping.
- Mark each result as a prediction, a missing piece, or a solution.
- For each, answer the three checking questions.
- Test the cheapest, most informative claim first.
The refuted branch matters as much as the supported one. A failed claim shows where the two domains differ, and that is useful information for the evaluation step in the next chapters.
Exercise
You map a beehive (source) onto a software team (target), with bees as developers and the queen as the product manager. In a hive, the queen lays all the eggs, so the hive depends on her. You transfer the claim "the team's output depends entirely on the product manager". Which of the three checking questions does this claim most clearly fail, and why?
Show answer
It fails question 2, whether there is a causal reason in the target. The queen's role in the hive has a biological mechanism: she is the only reproductive individual. A product manager does not produce the team's output in that way. Developers write the code. The relation "produces all new members" was carried over without a matching mechanism. It also arguably fails question 1, since the mapping aligned roles by position in a hierarchy, not by the relation that matters. You would need to say what the queen does in the hive that is relevant to the problem, then find the target counterpart of that function, not of her title.
Exercise
In the annealing example, which parts of the algorithm came from the source domain, and which parts did the target problem force you to choose?
Show answer
From the source: the idea of a temperature that controls how willing the search is to accept worse moves, the gradual cooling, and the acceptance probability of the form exp(-delta / temp). From the target: the cost function, the neighbor function, the starting point, the cooling rate, and the number of steps. These depend on the problem being solved, and the analogy does not set them.