Symbolic Physical Laws DiscoveryTrust and beyond

Module 10Extensions of symbolic regression

Symbolic regression rarely works alone. We describe a tool by its interface: data with units and claims in; candidates, uncertainty, tests and a log out. On eight textbook laws measured in a narrow range, a one-shot search that keeps the best fit got 131 of 160 right; a small loop that proposes the simplest formula and lets three critics (units, fit to the noise, a wider range) check it got all 160, with about two tool calls per task, and ablations show what each critic does. Then we distil black boxes: a neural network and boosted trees learn a projectile's range, and symbolic students fitted to their answers recover the law where the teachers learned, and copy their mistakes where they did not. One found feature lets a straight line beat both black boxes, a representation bank picks it out, and data from a generative model corrupt the search. We end with research directions and the questions of the whole course.

By the end you should be able to describe a discovery tool by its interface, build a loop with critics and evaluate it on known answers with costs, abstentions and ablations, distil a black box into a formula and report fidelity and accuracy separately, use found formulas as features, and keep generated data out of the evidence.

Key ideas, one per video

  • Video 21With gravity nearly fixed, the best fit chose the wrong power of g in 15 of 20 water-pressure trials; one answer had the wrong units and missed wider data by 220%. The units critic cut the fits from about 144 to about 2 per task; either critic alone was enough here, but with only a fit check the loop was wrong 95 times in 160.
  • Video 22Distilled where the teachers learned, both students wrote R = v²·sin 2θ / g (0.4% and 0.7% off); distilled over wider speeds they copied their teachers' mistakes (40% and 70% off). A straight line on the found feature was 0.19% off, and 0.03% beyond the data; with 400 generated shots added to 40 real ones, the search found the law in 0 of 20 trials.

Book: Chapter 10 of Computational Methods for Symbolic Physical Laws Discovery by Teddy Lazebnik (coming soon). The videos and slides follow the chapter’s topics in our own words, figures and simulations; nothing is copied from the book.

The title slide of Module 10: Extensions of symbolic regression

22 slides, written to be read on your own, with worked examples, our own small simulations and check-yourself questions (answers at the end). PDF, 1.3 MB.

Watch

2 videos for this module, each about 8 to 15 minutes. Pick one from the list, and open the transcript to read along: each timestamp plays the video from there. The narration is generated with a voice clone of Teddy, used with his permission.

Video 21 · 8:28

Symbolic regression inside bigger AI systems

Eight textbook laws, 160 trials: the best fit was right 131 times. A loop with three critics was right every time, after about two tool calls.

With gravity nearly fixed, the best fit chose the wrong power of g in 15 of 20 water-pressure trials; one answer had the wrong units and missed wider data by 220%. The units critic cut the fits from about 144 to about 2 per task; either critic alone was enough here, but with only a fit check the loop was wrong 95 times in 160.

TranscriptVideo 21
0:00

One-shot search or a loop?. We gave the same eight textbook laws to two procedures. Each law came with thirty noisy measurements from a narrow range. A one-shot search, which returns the formula that fits best, got 131 right, out of 160. A small loop, which proposes the simplest formula not yet tried, fits it, and lets three critics check it, got all 160 right, with about two tool calls per task. Same search space, same data. The difference was orchestration. This video is about symbolic regression inside bigger systems. This is Module ten, the last module: extensions of symbolic regression. Part one: interfaces. Part two: discovery as orchestration. Part three: mechanisms and agents. Part four: how to evaluate a discovery system.

0:55

Interfaces matter more than labels. Part one: interfaces matter more than labels. Call it a neural network, an agent or a genetic program: what matters is what goes in and what comes out. A good symbolic regression tool takes data with units and ranges, the knowledge you trust, and the claim you want to test. It returns not one formula, but candidates with their errors, their uncertainty, the tests they passed and failed, and a log of how they were found. Ranges matter as much as units. A formula is only claimed where it was tested, so a tool that reports the range of its data tells you where its answer stops. Logs matter more than they seem. A formula without its history can't be checked: you don't know how many candidates were tried, which data were used, or which tests it failed before one passed. That interface lets a bigger system use the tool: call it, check its answer, and call it again with a better question. In Module three, units were a rule inside the search. Here, they're a critic outside it. Whatever is inside, judge a discovery tool by what it promises at its edges.

1:54

Discovery as orchestration. Part two: orchestration rather than one-shot generation. Our eight tasks: a projectile's range, a pendulum's period, the speed of water from a hole, kinetic energy, a spring's period, drag, a centripetal force, and water pressure. Each had thirty measurements with two percent noise, in a narrow range, with gravity held near Earth's value. The search space was the same for both procedures: a constant times the inputs raised to powers from minus two to two, about three hundred candidates per task. Some tasks include an input that doesn't matter, like the pendulum's mass, to see whether the search leaves it out. The one-shot search picked the best fit, and in 29 of 160 cases that was wrong. For water pressure it was wrong fifteen times in twenty: with gravity nearly fixed, the data couldn't tell which power of gravity to use, and the noise chose for it. That's a general trap. When an input barely varies in the data, any power of it fits about equally well, so the fit can't choose. Only data where gravity changes, or a units check, can decide. One of its answers: the density squared, times the square root of gravity, times the depth. It fitted the narrow data as well as the law did. On wider data, including the Moon and Mars, it was off by 220 percent. And its units are wrong: anyone who checked them would have thrown it out. For the pendulum, one wrong answer dropped gravity altogether: a constant times the square root of the length. It missed the wider data by 37 percent. For the water from a hole, the same mistake missed by 93. The loop works differently. A proposer offers formulas, simplest first. A units critic rejects any formula whose units don't match, before fitting anything. A fit critic asks whether the error is within one and a half times the noise. And a range critic tests the survivor on thirty measurements from a wider range, from less than half to two and a half times the narrow one, with gravity on Earth, Mars and the Moon. The units critic is cheap and strict. Of the 343 candidate formulas for the pendulum, only one has units of seconds. For the range, eight have units of length, and the fit critic chose among them. Units checks are this strong because they don't depend on the data at all. A formula with the wrong units can fit one range by luck, but it can't be a law in every system of units. The loop found every law, with about two tool calls per task: one fit and one range check. Without the units critic, it still found them all, but needed about 144 tool calls per task. Without the range critic, it also found them all: in our tasks, either critic was enough on its own. Remove both, keeping only the fit check, and the loop went wrong in 95 of 160 cases. Simplest first isn't enough: in a narrow range, a simple wrong formula fits as well as the right one. An agent is a search with critics. The critics are where the science goes.

4:46

Mechanisms and agents. Part three: mechanisms and agents. A mechanistic agent goes further: it proposes mechanisms, not just formulas, and designs experiments to choose among them. We ran a small version in Module nine. The loop fitted three rival laws for a draining tank, chose the starting level where they disagreed most, forecast the result before seeing it, and dropped the laws that missed. One experiment was enough, every time. That loop had the same parts as today's: a proposer, critics, and a list of what had been ruled out. The new part was the experiment. Instead of judging candidates on the data it had, it chose the data that would judge them best. The list of what's been ruled out matters too. Without it, a proposer can suggest the same failed idea again in new words, and the loop pays for the same test twice. Language models can now take the proposer's seat: suggesting mechanisms, writing code, reading the literature. That makes the critics more important, not less. A fluent proposal is not evidence. A language model can propose a mechanism in a sentence, and write the code to fit it in a minute. It can also propose a mechanism that sounds right and isn't, or write code with a quiet bug. So its proposals get the same critics: units, fit to the noise, a wider range, and a designed experiment. Let anything propose. Let only evidence decide.

6:03

Evaluating discovery systems. Part four: how to evaluate a discovery system. First, tasks with known answers, and enough of them: we used eight laws, with twenty noise draws each. Twenty draws turn anecdotes into rates. Second, measure more than success. Count wrong answers separately from abstentions: a system that says I don't know is better than one that is confidently wrong. And count the cost: fits, experiments, time. Cost matters because some steps are cheap and some aren't. A units check costs nothing, a fit costs a little, and a new experiment can cost a week. Good loops spend the cheap checks first. Our loop could abstain: if no candidate passed all three critics, it would return nothing. Here, it never had to. On harder tasks, a good loop abstains more often, and that should count in its favour. Third, test outside the training range, as our range critic did, and report the failures task by task. Our one-shot search was perfect on four laws, and right only thirteen and five times in twenty on two others. Fourth, beware of memory. Textbook laws can be recognised rather than discovered, especially by systems trained on textbooks. Good benchmarks rename variables, change units, or use laws that no one has written down yet. And fifth, ablations. Remove each critic and count what breaks. Ours showed something we didn't expect: either critic alone was enough here, and the units critic was far cheaper. Only an ablation tells you which parts of a system are doing the work. A discovery system is a scientific instrument. Calibrate it before you trust it.

7:33

Recap. Let's recap. Interfaces matter more than labels: data, units and claims in; candidates, uncertainty, tests and logs out. Orchestration beats one-shot generation when the critics carry real knowledge: units, noise and range. Agents can propose mechanisms and experiments, but evidence must still decide. And evaluate discovery systems on known answers, with costs, abstentions, failures and ablations. Next video, the last of the course: distillation, symbolic features, generated data, and what comes next.

Interactive lab

Distil a black box

Train a black box on a projectile's range, ask it questions inside or beyond its data, and fit a symbolic student to its answers. Compare fidelity with accuracy, see a student copy its teacher's mistakes, and use the formula you found as a feature for a straight line.

The shots are simulated in your browser (flat ground, no drag, the noise you choose), and both black boxes are trained there: a nearest-neighbour average and a degree-4 polynomial. Four challenges are checked as you go.

Simple math

A projectile, a black box and a student

The page simulates 400 shots on flat ground without drag, at speeds from 5 to 20 m/s and angles from 10° to 80°, with the noise you choose. A black box learns the range from them. You ask it questions, fit a simple formula to its answers, and check that formula against the true law, inside the data and at 20 to 30 m/s. Everything runs in your browser.

The law
R = v²·sin 2θ / g, g = 9.81 m/s²

The student is c·v^a·f(θ): a power of the speed times one of eight functions of the angle.

Two different numbers
fidelity: student vs teacher · accuracy: student vs the law

A student can copy its teacher well and still be wrong, or copy it loosely and be right.

A formula as a feature
R ≈ b₀ + b₁·(the student's formula)

A straight line on a good feature can work far beyond the data.

–

Teacher and student at 45°

Grey: the true law. Purple: the black box. Orange: the student. Shaded: the speeds in the data.

–

Teacher off the law, 5–20 / 20–30 m/s
–
Fidelity (student vs teacher)
–
Student off the law, 5–20 m/s
–
Student off the law, 20–30 m/s
–

The formula as a feature

Two straight lines fitted to the 400 shots: one on the raw speed and angle, one on the student's formula.

Line on v and θ, 5–20 / 20–30 m/s
–
Line on the student's formula, 5–20 / 20–30 m/s
–

Challenges

Each one is checked as you go.

  1. Ask a teacher inside its data, and get a student that is the true law (v² times sin 2θ) and less than 2% off.
  2. Find a student that is more accurate than its teacher, inside the data.
  3. Make a student copy its teacher's mistakes: ask beyond the data, and see it more than 10% off at 20–30 m/s.
  4. Use a formula distilled from a teacher as a feature: a straight line on it less than 1% off at 20–30 m/s, while the line on v and θ is more than 20% off.