Few-Shot Law Acquisition

Transfer across laws, not across parameters. The decomposition overturned the intended narrative — and is reported as measured.
Sehaj Randhir Singh
Independent researcher; partial affiliation with NYU Tandon School of Engineering

Few-shot transfer in physics ML usually means: same equation, more parameters. We transfer across laws: a generalist that has seen five laws adapts to a held-out sixth with a quarter of the data at 2.9× lower error than a from-scratch specialist. Then we decompose why, with ablations that overturned the intended narrative: the quantity vocabulary is the dominant carrier (removing it is 10× worse), and the physics residual — helpful in general — constrains trajectory specialization at tiny budgets (removing it improves trajectory error 7× while answers stay flat). Both findings are per-seed, committed, and re-runnable.

What transfers, measured

The token stream of quantities and operators is the cross-law memory: ablation is catastrophic (10×). The physics residual is a constraint: at 24 samples it pins trajectories to equation-consistent shapes before the data can specialize them — removing it frees the curve 7× while answers are unaffected.

2.9×

lower answer error than a from-scratch specialist at the 25% budget, on the held-out law.

10× vocabulary

removing the vocabulary token stream is catastrophic — it is the main carrier of cross-law knowledge.

7× residual

removing the physics residual frees trajectory specialization at tiny budgets while answers stay flat — the residual constrains curves before data can.

The numbers

Median answer rel-MAE at the 25% budget, and the ablation decomposition.

Conditionanswer rel-MAE (25% budget)note
Generalist (real signature)0.1972.9× better than specialist
Dummy control0.239same data, no law identity
From-scratch specialist0.580the baseline transfer beats
Ablationanswer rel-MAEvs. frozen
no vocabulary2.02210.2×
no physics residual0.214answers flat; curve freed 7×
frozen body0.198reference
Ablations: no vocabulary stream, no physics residual, frozen body. The 10× vocabulary ratio and the 7× curve effect are median ratios over three seeds, each committed per-seed in transfer_ablations.json.

Reproduce

git clone https://github.com/sehajr-singhs/fewshot-law-acquisition
cd fewshot-law-acquisition
python -m unittest tests.test_physx        # 49 physics tests
python figs/make_figures.py                # figures from committed fewshot_data.json
python src/physx/train_fewshot.py          # re-run the few-shot protocol
python src/physx/run_transfer_ablations.py # re-run the ablations

Simulation-only, CPU-scale, deterministic seeds. No GPU required.

Sister papers in the series

Seven manuscripts, one codebase, one guarantee: every number traces to a committed JSON and regenerates from a committed script.

AGE-artificial-general-engineer

the system and its project root

physics-transformers

the PhysFormer architecture; the falsified regime theory

physbench

the 12-domain verifiable benchmark

verification-gated-agents

the gate as the missing control in agent evaluation

physics-loss-channel

when physics in the loss helps — and when it only enforces consistency

field-consistency

the cost of consistency on 2D fields