DL4Sci 2026 · Day 2

Day 2: Constrained and discrete diffusion, inductive biases, AI for research

Lecture notes from the Deep Learning for Science Summer School at Berkeley Lab.

Date
Jul 21, 2026
Talks
3
Where
Berkeley Lab & UC Berkeley
Source
Markdown on GitHub

The second day of DL4SCI moved from how generative models work to what we should ask of them. The morning opened with constrained generation: if a diffusion model is going to propose a molecule, a material or a robot trajectory, its samples must satisfy hard physical rules, not just look plausible. Andrew Wilson then revisited one of the oldest lessons in machine learning, that simpler models generalize better, and argued that it is the wrong lesson. The afternoon closed with Daniel Freeman on how fast the research loop itself is accelerating. Taken together, the talks addressed three questions that matter for scientific ML: how to make outputs valid, why flexible models generalize, and how quickly the field can iterate.

Talks

Discrete Diffusion — Ferdinando Fioretto (University of Virginia)

Fioretto's central idea is that sampling from a diffusion model can be treated as a sequence of optimization problems. Once each reverse step is an optimization step, constraints can be enforced along the way, so the final sample lands in a feasible set instead of merely near the data distribution. The talk was organized in three parts: foundations (how should we think about constrained generation?), applications (from convex to black-box constraints and verifiers), and discrete diffusion (how can global rules steer local token updates?).

Foundations: what constrained generation means

A diffusion model generates by running a learned reverse process: starting from noise $x_T$, it repeatedly maps the current state $x_t$ to a slightly less noisy $x_{t-1}$ until it reaches a clean sample $x_0$. Each update is driven by the learned denoiser and nothing else, so the reverse process is free to wander. By default, nothing guarantees that the output satisfies any rule beyond what the training data implicitly encode.

Constrained generation asks for more. Samples must lie in a feasible set defined by explicit rules, and examples are easy to find across science:

Constraints come in two flavors. Hard constraints must always hold, chemical valence being the canonical case. Soft constraints are penalized when violated but tolerated to some degree.

The key move in constraint-based diffusion is to recast sampling as sequential optimization. At every reverse step the sample is projected, or pushed, toward the region that satisfies the constraints, so the trajectory ends inside the feasible set. A useful analogy: unconstrained generation is drawing freely, while constrained generation is drawing inside the lines, with each step correcting the stroke so it stays in bounds.

Applications: from convex constraints to black-box verifiers

Microstructure design with constrained porosity

The first application was designing material microstructures with a prescribed porosity, that is, a target or allowed pore fraction. Two difficulties make it hard. Training data are sparse, and the requested porosity can fall outside the range seen during training, so the constraint itself is out of distribution.

Physics-informed motion

The second example generated video frames that obey physical principles. What stood out is that the constraints are applied at inference time, during sampling, with no retraining. The slide used a discretized kinematics model (notation approximate from slide):

$$ p_t = p_{t-1} + \left(v_t + \tfrac{1}{2}\,\frac{dv_t}{dt}\right), \qquad v_{t+1} = \frac{dp_t}{dt} + \frac{dv_t}{dt} $$

Here $p_t$ is the position of the moving object at frame $t$, $v_t$ its velocity, and $dv_t/dt$ its acceleration. The challenges are to make the generated trajectory satisfy these ODEs and to generalize to constraints outside the training distribution. The key insight was that what looks out of distribution in terms of data similarity becomes in-distribution once samples are judged by whether they satisfy the physics. Raw frames may look unfamiliar in pixel space while still lying inside the physically feasible set.

Augmented Lagrangian sampling

Projection works when the feasible set is tractable. Fioretto presented augmented Lagrangian sampling for the harder regimes: when the constraint set $C$ is highly non-convex, or when only violation residuals can be computed. In the second case one can measure how much a constraint is violated, for instance through a verifier, but cannot project onto $C$ or solve for it exactly. As standard background, augmented Lagrangian methods combine a Lagrange multiplier term with a quadratic penalty on the constraint residual and update the multipliers iteratively, which is why they need residuals rather than an explicit description of the feasible set.

Safe autonomy in multi-robot settings

In multi-robot scenarios the constrained approach reached high success rates in all scenarios (96 to 100%), while state-of-the-art models degraded significantly as the number of robots grew, by more than 15%.

Protein design

The naive route to constrained protein design is to generate many samples and then filter those that satisfy physical, chemical and biological constraints, which yields few valid designs. Against an RFdiffusion baseline, the authors propose CADM, a constraint-aware diffusion model. It produced usable structures in 21.0% of all generations, and up to 83.0% for well-posed ligands.

Inverse design of mechanical metamaterials

Metamaterials are materials whose mechanical properties come from periodic arrangements of small-scale structural building blocks rather than from composition alone. The goal here is a target stress–strain response, and the challenge is the inverse problem: going from a desired stress–strain curve to a small-scale structure that produces it.

Discrete diffusion: global rules, local updates

The final part turned to discrete diffusion, where the state is a sequence of tokens and each step updates tokens locally. Constraints, however, are often global: they apply to the sample as a whole. The open question is how global rules can steer these per-token updates.

Molecular generation for synthetic chemistry illustrates the tension. The vocabulary is small, around 80 tokens, so models are easy to train and get good results. Yet searching for valid molecules remains hard: even with a tiny vocabulary and good training, ensuring that generated molecules satisfy validity constraints is still the bottleneck.

Foundations — Andrew Wilson (NYU)

Wilson's talk was built around soft inductive biases as a unifying intuition. Instead of hard constraints that forbid certain solutions, he advocated flexible hypothesis spaces that express a preference toward simpler or more plausible solutions without ruling the others out. The argument reframes what Occam's razor should mean for modern, heavily overparameterized models.

The polynomial problem

The natural place to rethink generalization is the classic polynomial regression example, because it is where the usual lesson is learned. Fit a dataset with polynomials of increasing order. A line underfits. A high-order polynomial overfits, oscillating wildly between data points (the Runge phenomenon). The standard conclusion is that simpler models generalize better, so one should restrict the model class by capping the order. Occam's razor is read as "less flexibility is better."

Wilson's reframing separates two things that this story conflates. The support of a model is the set of functions it can represent. The distribution of belief is how much prior probability it places on each of them. The problem in the polynomial example is not the support but the belief. An order-100 polynomial need not overfit: with a sensible prior over its coefficients, one that favors smooth functions without forbidding complex ones, it generalizes well.

Hard inductive bias Soft inductive bias
Mechanism Restrict the support (e.g. order ≤ 3) Large support plus a prior that concentrates mass
What it excludes Whole functions, permanently Nothing; it only makes some functions less probable
Risk If the truth lies outside, it is never reached Can recover the truth if the data demand it

The recipe follows directly: a large support, able to express many functions including the true one, combined with a soft inductive bias that concentrates probability mass on reasonable solutions while keeping it nonzero elsewhere.

Why this matters for neural networks

This view connects to the paradox raised by Zhang et al. (2017): a neural network can memorize random labels, so its capacity is enormous, yet it still generalizes on real data. Under the "restrict capacity" logic, those two facts contradict each other. Under the soft-bias view they do not. The network has broad support and can represent almost anything, but the architecture and the implicit bias of SGD place prior mass on structured functions.

The Bayesian tool that makes this precise is the marginal likelihood, often called the Bayesian Occam's razor. For a model $\mathcal{M}$ with parameters $\theta$ and data $\mathcal{D}$, it is the probability of the data averaged over the prior:

$$ p(\mathcal{D} \mid \mathcal{M}) = \int p(\mathcal{D} \mid \theta, \mathcal{M})\, p(\theta \mid \mathcal{M})\, d\theta $$

As standard background, a model that spreads its prior over too many possible datasets assigns little probability to any one of them, so the marginal likelihood penalizes needless complexity automatically, with no hard cap on capacity. In the framing of the talk, a simple model is not inherently better; a flexible model with the right distribution assigns more evidence to the honest explanation of the data. The core thesis: we do not want less flexible models, we want models that are honest about where they place their belief.

The research loop is collapsing — Daniel Freeman (Anthropic)

Freeman's session, titled "Science is still not AGI-pilled enough," argued that the speed of scientific progress is governed by how quickly a researcher can complete one iteration of the research loop, and that this iteration time is shrinking fast.

What "AGI-pilled" means

"AGI-pilled" borrows the "-pilled" suffix from "red-pilled": it describes someone persuaded that AGI is coming, and coming soon, who lets that belief reorganize how they work and what they prioritize. It is less a probability estimate than a stance, acting as if transformative AI is the near-term default rather than a distant possibility. In practice it shifts the questions one asks. Instead of "can a model do this narrow task?", one asks what happens when models can do most cognitive tasks. Instead of optimizing today's benchmarks, one builds for capabilities that do not exist yet but plausibly will, such as scaling, agents, tool use and long-horizon autonomy. It also raises the urgency of safety, alignment and evaluation: if broad capability is near, getting the guardrails right stops being academic. The provocative framing names a worldview, and invites the audience to notice how much of the current research agenda only makes sense if the near-term premise is taken seriously.

One lap of the loop

Freeman described the unit of progress as one lap of a four-stage loop:

  1. Hypothesis: form the idea or question to test.
  2. Build: implement the experiment, whether code, setup or training run.
  3. Check: run it and measure whether it confirms or refutes the hypothesis.
  4. Write: record what was learned, which sharpens the next hypothesis and closes the loop.

What matters is not any single lap but how fast one can go all the way around. In 2013, one lap took about a week: an idea, days of wiring up the experiment, waiting for a training run, and only then a result. That meant roughly one informative iteration per week.

Since then the loop time has been collapsing, through better tooling, faster hardware, and now models that help write code, run experiments and interpret results. As a lap shrinks from a week toward hours or minutes, the number of ideas that can be tested per unit time explodes. Research throughput is dominated by loop latency, not by the supply of ideas. If models increasingly automate the inner steps of the loop, progress compounds, which is why near-term capability jumps feel plausible from the inside.

A worked example: the thermal toric code

As a concrete instance of the loop applied to real work, Freeman showed his own thermal-toric-code repository. It contains tools to study Kitaev's toric code, a quantum error-correction model, at finite temperature: how the system behaves under thermal noise and which error-correction strategies work. The project evolved through four codebases built in sequence:

  1. TCPython: the original Python simulation of toric-code dynamics at finite temperature, now deprecated, which produced the data for arXiv:1405.2315.
  2. CyclingAlgorithm: a 1D Ising model with a measurement-free error-correction protocol (arXiv:1603.05005).
  3. FastCpp: a C++ reimplementation of TCPython, used to probe entanglement dynamics.
  4. ToricLearning: an OpenAI-gym-style reinforcement learning environment for error-correcting the toric code, the machine learning angle of the project.

The through-line is understanding quantum error-correction codes under realistic thermal conditions and developing practical error-mitigation strategies for fault-tolerant quantum computing.

Key takeaways

Open questions

These are my own notes and may contain errors. Not official course material. Source on GitHub.