ML for Scientists: Introductions

 

Carol(ina) Cuesta-Lazaro

  • Use AI as much as you want. Part of the learning objectives is for you to learn how to use AI effectively in your research.

AI Usage

  • Everything you hand in is your responsibility. You will disclose your AI usage for every assignment. If the honest answer feels uncomfortable, it probably is! 

 

  •  Assignments are a way for me to understand where you are at and help you learn.
  • Coming up with good projects and being scientifically creative is a skill that one learns. You have a chance to learn in a safe space an iterate over your ideas. I would love to hear your voice, and not Claude's.
  • Name and domain area?
  • What is your prior experience with Machine Learning? Have you trained a neural net before? What are you most confused by?
  • What do you hope to get out of this class? One thing you want to be able to do by December?

About You

  • Get you into the AI cult. How can this possibly work???
  • By December, you can read and AI paper and understand it
  • Be able to develop interesting ideas at the intersection of physics and ML.

My goals

GANS

Deep Belief Networks

2006

VAEs

Normalising Flows

BigGAN

Diffusion Models

2014

2017

2019

2022

A folk music band of anthropomorphic autumn leaves playing bluegrass instruments

Contrastive Learning

2023

Generative Models

2026

"Write a C compiler"

AGI?

\hat \phi = \argmax \left[ \log p_\phi (x_\mathrm{train}) \right]
p(\mathrm{World}|\mathrm{Prompt})
["Genie 2: A large-scale foundation model" Parker-Holder et al (2024)]

Probabilistic ML has made high dimensional inference tractable

1024x1024xTime

["Genie 3: A new frontier for world models" Parker-Holder et al (2025)]

True

Reconstructed

\delta_\mathrm{Obs}
\delta_\mathrm{ICs}
p(\delta_\mathrm{ICs}, \theta|\delta_\mathrm{Obs})
["Joint cosmological parameter inference and initial condition reconstruction with Stochastic Interpolants" 
Cuesta-Lazaro, Bayer, Albergo et al 
NeurIPs 2024 ML for the Physical Sciences]

 

\mathcal{O}(10^9)

Supervised Models

["GraphCast: Learning skillful medium-range global weather forecasting" Lam et al (2023)]

Empirical models on steroids

AlphaFold

["Highly accurate protein structure prediction with AlphaFold " Jumper et al (2021)]
["The Optical and Infrared Are Connected" Jespersen et al (2026)]

Physics models

Optical

IR

\theta

Forward Model

Observable

x
\color{darkgray}{\Omega_m}, \color{darkgreen}{w_0, w_a},\color{purple}{f_\mathrm{NL}}\, ...

Dark matter

Dark energy

Inflation

Predict

Infer

Parameters

Inverse mapping

\color{darkgray}{\sigma}, \color{darkgreen}{v}, ...

Fault line stress

Plate velocity

Solving Inverse Problems and Uncertainty Quantification

\hat \phi = \argmax \left[ \log p_\phi (\theta|x) \right]

Self Supervised Learning

AutoEncoder

Masked Autoencoder

Contrastive Learning

[arXiv:2503.15312]

Euclid Quick Data Release (Q1) 

Looking for Rare Objects

["Learning What’s Real: Disentangling Signals from Measurement Artifacts in Multi-Sensor Data, with Applications to Astrophysics" Mercader-Perez et al (2026)]

Am I a Foundation Model?

   Regression of   Physical Parameters

Retrieval of rare objects

Outlier/Anomaly detection

Follow up priorities

Predict missing modalities

Super Resolution

Learning from scratch: Reinforcement Learning

\hat \phi = \argmax \left[ \mathrm{Reward} \right]
["Improving cosmological reach of LIGO using Deep Loop Shaping" Buchli et al (2025)]

Reward Hacking

BEFORE

Artificial General Intelligence?

AFTER

Physics students at NYU are

Pre-trained on next word prediction

...

OVER-CAFFEINATED

RESILIENT

SMART

ATHLETIC

Large Language Models

https://www.astralcodexten.com/p/janus-simulators

How do we encode "helpful" in the loss function?

Reinforcement Learning from Human Feedback (RLHF)

BEFORE RLHF

AFTER RLHF

Reinforcement Learning from Verifiable Rewards (RLVR)

"find the smallest positive integer n such that 10ⁿ can be written as a product of two positive integers, neither of which has a 0 anywhere in its decimal representation."

Gold Medal IMO

Research Level Maths

AlphaEvolve

DiscoverPhysics: Benchmarking LLMs for
Out-of-the-Box Scientific Thinking

Hypothesis

Simulate World

Invisible particles

Extra dimensions

Multi Species ...

Simulate World

Invisible particles

Extra dimensions

Multi Species ...

Propose Experiment

Simulate

Text: Conceptual Understanding

Trajectories (.csv)

Science Agent (LLM)

Science Agent (LLM)

Outputs

Python Code: Trajectory MSE

["DiscoverPhysics: Benchmarking LLMs for Out-of-the-Box Scientific Thinking" Wiemann, Smith et al ]

def discovered_law(pos1, pos2, p1, p2, velocity2, duration, **params):
    """Particle 2 is accelerated toward particle 1 by a radial force 
    per unit along r^ that combines a static source term G*p1,
    a radial-velocity term (analogous to an advective/retardation
    coupling), and a centripetal-like tangential kinetic-energy 
    term, all scaled by 1/r and independent of p2."""
    ...
    return trajectories

def fit_parameters():
    return {
        "G":     {"init": 1.0, "bounds": [0.1, 5.0]},
        ...
    }

Predictive Code

Rubric Based LLM judge

Mean Square Error

Agent Explanation

You are an expert physicist tasked with discovering scientific laws in a simulated universe. Your goal is to propose experiments, analyse the data they return, and ultimately deduce the underlying scientific law. Note that the laws of physics in this universe may differ from those in our own. You can perform experiments to gather data but must follow the protocol strictly.

If F = G/r²: G = 80. If F = G/r: G = 8. Linear in 1/r!

 

m=1: a = 0.664 · m=2: a = 0.614 · m=4: a = 0.664 · m=8: a = 0.714 … That's strange."

 

Consistent pattern: small +y 'extra' force (~0.05) regardless of position … maybe the anchor itself moves.

 

a_y_extra ≈ +0.05 everywhere on probes. Spot on! So anchor too just experiences g_y = 0.05 … g = (0, 0.05) is a uniform external acceleration on every particle.

You are an expert physicist tasked with discovering scientific laws in a simulated universe. Your goal is to propose experiments, analyse the data they return, and ultimately deduce the underlying scientific law. Note that the laws of physics in this universe may differ from those in our own. You can perform experiments to gather data but must follow the protocol strictly.

Confirmed: a ∝ 1/r.

 

 

observed −5.18. WAY too small. Something is very wrong with my understanding!

 

 

artifact of integration accuracy, NOT the true law. Probably because of close encounters causing chaos.

 

I'll just submit my law. The functional form is solid.

 

You are an expert physicist tasked with discovering scientific laws in a simulated universe. Your goal is to propose experiments, analyse the data they return, and ultimately deduce the underlying scientific law. Note that the laws of physics in this universe may differ from those in our own. You can perform experiments to gather data but must follow the protocol strictly.

a × r seems roughly constant … not quite 1/r.

 

Let me try a × r²: … Not consistent.

 

 

So at large r, a ~ 1/r. At small r, a ~ 1/r².

   

Actually note the file path in the error message: 'extra_dimensions.csv'! This is a hint! The world might have an extra compactified dimension…

 

[Model starts fitting Yukawa potential, Bessel functions... At some point fitting tool errors.]

Conceptual Understanding

Trajectory Prediction

Random Seeds

World Generator

World Solver


def simulate(
	pos1, 
    pos2, 
    duration, 
    **params,
  ):
	"Simulate Universe"

    return trajectories

Convergence,

Re-implementation tests....


def discovered_law(pos1, pos2, p1, p2, velocity2, duration, **params):
    """Particle 2 is accelerated toward particle 1 by a radial force 
    per unit along r^ that combines a static source term G*p1,
    a radial-velocity term (analogous to an advective/retardation
    coupling), and a centripetal-like tangential kinetic-energy 
    term, all scaled by 1/r and independent of p2."""
    ...
    return trajectories

def fit_parameters():
    return {
        "G":     {"init": 1.0, "bounds": [0.1, 5.0]},
        ...
    }

Running Experiment...

Reward

Predictiveness

Conceptual Understanding

(MSE)

(Evaluation Score)

"This world consists of ..."

World Definition

Simulation Code

1) Look up ML papers in your domain area. Which ones seem interesting?

How to Chose A Project

Machine Learning and the Physical Sciences (NeurIPS)

AI for Science (NeurIPS & ICML)

2) Having trouble? Ask me directly!

1. What have people done in this area before? Baselines?

2. Where is the gap? 

3. Imagine everything works perfectly: write an abstract. Are you excited?

Is it worth doing?

4. Is the problem you are tackling part of a more general class of problems? or is it very niche?

5. Be ambitious! If learning is the objective there is no way to fail

1. Literature review

2. Research Proposal

3. Money Plot

Checkpoints

Should help you answer question 1

Interesting Seminars

Wednesdays at 3 pm -> First seminar September 16th by Pavel Izmailov

(Contact me at east two days before to be added to the FI guest list)

Fridays 2-4 pm