The student is c·v^a·f(θ): a power of the speed times one of eight functions of the angle.
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.
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.
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
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.
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.
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.
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.
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.
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.
A formula from a black box. A neural network learned a projectile's range from four hundred noisy shots, with an error of 2.6 percent. Then we asked a symbolic student to imitate it. The student wrote: the range equals 0.1023 times the speed squared, times the sine of twice the angle. That's the textbook law, with one over g equal to 0.102. And the student was more accurate than its teacher. The student was 0.4 percent off. The teacher was 2.6 percent off. Distillation turns a black box into a formula you can read. This last video is about distillation, symbolic features, generated data, and what comes next. Part one: distilling a neural teacher. Part two: what a student explains, and distilling trees. Part three: symbolic regression as feature engineering. Part four: generated data. Part five: what's next.
Distilling a neural teacher. Our data: four hundred shots on flat ground without drag, at speeds from five to twenty metres per second and angles from ten to eighty degrees, with two percent noise. The law: the range equals the speed squared times the sine of twice the angle, over g. The teacher: a small neural network, two layers of thirty-two units, trained on the shots. The student: a constant, times a power of the speed, times one of eight functions of the angle, from a sine to a simple parabola. We asked the teacher two thousand questions inside its training range, and fitted the student to its answers. Why two thousand questions, when we only had four hundred shots? A teacher can be asked as often as we like, so the student gets as many answers as it needs, spread evenly over the range. The student matched its teacher to within 2.7 percent. It matched the truth to within 0.4. Why better than the teacher? The student's shape is restricted, so it can't follow the teacher's small wiggles. It keeps what the teacher learned that a formula can express, and drops the rest. And because the student's formula is the law, it was just as good at speeds from twenty to thirty metres per second, where the teacher had never seen a shot: 0.4 percent off there too. Fitted directly to the four hundred shots, the same student found the law too, even more precisely. So when you have the data, fit the data. Distil when you have the model but not the data: a published network, a simulator too slow to search, or a model trained on data you can't share. A good student isn't a copy. It's the part of the teacher that can be written down.
What a student explains. Part two: what a student explains. A student fitted to a teacher explains the teacher, not the world. Ask the network about speeds it never saw, from twenty to thirty metres per second, and its error grows to fourteen percent. Now ask the teacher over that wider range, and the student copies the teacher's mistakes. It wrote the speed to the power 1.5, times a parabola in the angle: forty percent off inside the original range, fourteen beyond it. The parabola looks a lot like the sine of twice the angle: both are zero at zero and ninety degrees, and both peak at forty-five. Given a teacher's slightly wrong answers, the student can't tell which one is the physics. They're close, not equal. Scaled to agree at forty-five degrees, at eighty degrees the parabola gives 0.40. The sine gives 0.34. A small gap, easily hidden by a teacher's errors. Gradient-boosted trees, three hundred small ones, make the point sharper. Their predictions are a staircase: 7.2 percent off inside the range, and flat beyond it, 39 percent off at the higher speeds. Trees can only predict values they've seen in training. Beyond the data, each tree returns the value of its outermost leaf, which is why the staircase goes flat. Distilled inside the range, the trees' student was the true law again, 0.7 percent off. Yet it matched its teacher only to 8.4 percent. Distilled over the wider range, it put the speed to the first power, and was seventy percent off inside the original range. So query the teacher where it learned from data, and nowhere else. And report fidelity, how well the student copies its teacher, separately from accuracy, how well it matches the world. Distillation can't add knowledge the teacher doesn't have. It can only make that knowledge readable.
Symbolic features. Part three: symbolic regression as feature engineering. A linear model on the raw speed and angle is forty-eight percent off. The same linear model on one found feature, the speed squared times the sine of twice the angle, is 0.19 percent off. At speeds it never saw, it is 0.03 percent off. That one feature did more than either black box: the trees were 7.2 percent off inside the range. The network was 2.6 percent off. And both were much worse beyond it. Why does it work? The hard part of the problem, how the range bends with speed and angle, is inside the feature. What's left for the model is a straight line. A straight line extrapolates well when the feature is right, and badly when it isn't. That suggests a modest way to use symbolic regression: not as the final model, but as a source of a few strong features for a model you already trust. A representation bank goes one step further: a list of candidate features, here eleven, and a sparse fit that chooses among them. With any threshold from 0.2 to 0.8, it kept exactly one: the speed squared times the sine of twice the angle. With lower thresholds, it kept four, all of them the speed squared times something. At 1.2, it kept nothing. The threshold is a choice, as it was for sparse regression earlier in the course: sweep it, and report what survives across the sweep. Symbolic features let simple models do the work of complex ones, and carry them beyond the data.
Generated data. Part four: generated data. Suppose we only had forty real shots. Could a generative model add more? We fitted a mixture of Gaussians to the forty shots, and drew four hundred new ones from it. With the forty real shots alone, the search found the law in all twenty trials, 0.3 percent off. With the four hundred generated shots added, it found the law in none, and was thirty-three percent off. Why so much worse? The search trusted every shot equally, and ten generated shots outnumbered each real one. The law had to fit the generator's version of the world. The real shots scattered about two percent around the law. A typical generated shot was nineteen percent off, and seven in ten were more than ten percent off: the generator copied the spread of the data, not the physics. One trial's answer was a parabola in the angle, with a constant that fitted the generator, not gravity. Larger generators, including diffusion models, are far better at looking realistic. The rule doesn't change: generated data carry the generator's assumptions, not new measurements. Use them to test a pipeline, as we used simulations throughout this course, not as evidence for a law. A generator can't measure. Only experiments can.
What comes next. Part five: what comes next. Discovery systems that plan experiments in real laboratories, with critics that know units, conservation and symmetry. Laws found across many systems at once, with parameters that change from case to case. Uncertainty reported as routinely as the formula. And benchmarks that test discovery, not memory. Some questions are still open: how to search when the right variables were never measured, and how to tell a law from a habit of one dataset. And when people and algorithms find a law together, who gets the credit? Each of those is a place where the habits of this course still apply: state the claim, test it where it could fail, and report what you find. And through all of it, the questions of this course: what do the data really say, what would refute this law, and how would anyone check it?
Recap. Let's recap. Distil a teacher inside the range where it learned, and report fidelity and accuracy separately. When you have the data, fit the data. A student explains its teacher, mistakes included. Symbolic features let simple models extrapolate. And generated data carry the generator's assumptions, not new evidence. In the lab, you'll distil a black box into a formula, and test it beyond the data. That's the end of the course. Thank you for discovering with us.
8:28Video 21 · 10.1Symbolic regression inside bigger AI systemsWith 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.
8:27Video 22 · 10.2Distillation, symbolic features, generated data, and what's nextDistilled 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.
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.
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.
A student can copy its teacher well and still be wrong, or copy it loosely and be right.
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.
–
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.
Challenges
Each one is checked as you go.
- Ask a teacher inside its data, and get a student that is the true law (v² times sin 2θ) and less than 2% off.
- Find a student that is more accurate than its teacher, inside the data.
- Make a student copy its teacher's mistakes: ask beyond the data, and see it more than 10% off at 20–30 m/s.
- 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.
