Back to Blog
Data Science
February 27, 202610 min read

What a Femtosecond Laser Taught Me About Machine Learning

Six things ultrafast laser physics taught me about ML before I had any formal ML training, from pump-probe as train/test to alignment as gradient descent.

PhysicsMachine LearningCareer TransitionData Science

Dr. Deepak K. Pandey

Experimental Physicist & Data Science Specialist bridging fundamental research with real-world solutions. Based in Kassel, Germany, transitioning to industry roles in the DACH region.

A femtosecond is one millionth of one billionth of a second. It is so short that light, traveling at 300,000 kilometers per second, moves less than the width of a human hair during that time.

I spent years working with instruments that resolve events at this timescale. Pump-probe spectroscopy. Ti:Sapphire oscillators. Pulse compressors. Optical delay lines that move in steps of a few micrometers to change the arrival time of a laser pulse by a few femtoseconds.

Femtosecond laser and machine learning concepts

Bridging ultrafast physics and machine learning through shared principles

When I started learning machine learning properly (gradient descent, neural networks, loss functions, regularization) I expected to feel like a beginner. Instead, I kept having this unsettling feeling of recognition. Not that the mathematics was familiar. It was not, not immediately. But the logic underneath it was.

I had been doing machine learning. I just did not know what it was called.

This post is about the six things ultrafast laser physics taught me about ML before I had any formal ML training. I am writing it for two audiences: physicists who think machine learning is a foreign language, and data scientists who have never thought about why their field feels the way it does.

1. Pump-Probe is Train/Test on Time

In pump-probe spectroscopy, you use two laser pulses. The first, the pump, excites your sample. It kicks a molecule into an excited state, drives a reaction, deposits energy. Then you wait. You send in the second pulse, the probe, after a controlled time delay and measure what changed.

The trick is the delay. You vary it systematically: 100 femtoseconds, 500 femtoseconds, 1 picosecond, 10 picoseconds. At each delay, the probe sees the system in a different state of its evolution. By scanning across time delays, you reconstruct the dynamics. You watch a chemical reaction unfold in slow motion, even though the actual event lasts fractions of a trillionth of a second.

Laser optics in a laboratory setup

Precision optics in a laser laboratory, where every adjustment matters

Here is what I now recognize: this is temporal generalization. You train your understanding of the system on its behavior at known time points, and you extrapolate to understand what happens in between. Your model of the dynamics has to generalize across the time axis.

Every time I failed to generalize correctly (misidentified a timescale, misread the dynamics) it was because my mental model did not capture the underlying physics. The data was correct. My model was wrong.

In machine learning, this is the entire problem. Your data is correct. Your model may or may not capture the true function. Training on a subset of examples and evaluating on held-out data is pump-probe with a different vocabulary.

2. Alignment is Gradient Descent

Aligning a femtosecond laser system is a deeply iterative, deeply frustrating process.

You have many degrees of freedom: mirror angles, lens positions, grating angles in the pulse compressor, the position of the beam focus in the sample. Each one affects the output signal. Turn one mirror slightly and the signal goes up. Turn it more and it peaks, then falls. Turn another mirror, which couples to the first, and now you have to go back. You are navigating a high-dimensional parameter space by feel, one adjustment at a time, always moving toward higher signal and lower noise.

I was doing gradient descent. By hand. On a physical system.

The Laser-ML Alignment Analogy

  • The laser beam is the forward pass
  • The signal on the detector is the loss function
  • Each mirror adjustment is a parameter update
  • The coupling between degrees of freedom is the off-diagonal terms in the Hessian

The reason you cannot just maximize one parameter at a time and call it done is exactly the reason vanilla gradient descent can get stuck: the landscape is not separable.

Experienced laser physicists develop a physical intuition for this that takes years. They learn which parameters are strongly coupled, which adjustments disturb the most downstream elements, which order to optimize in. This intuition is not magic. It is second-order gradient information, learned from thousands of hours of trial.

When I first read about adaptive learning rate optimizers in ML (Adam, RMSProp, the family of methods that try to estimate curvature from gradient history) I thought: yes, this is what we do when we develop alignment intuition. We are learning the geometry of the loss landscape from experience.

3. Lock-In Detection is Regularization

One of the most elegant techniques in experimental physics is lock-in detection.

Your signal is buried in noise. The noise is broadband, coming from electrical interference, environmental vibrations, thermal fluctuations. The signal is tiny. You cannot just measure and average and hope for the best.

Data visualization and signal analysis

Extracting signal from noise, whether in the lab or in a dataset

So you modulate your signal at a specific reference frequency, typically by chopping the pump beam mechanically. Then you use a lock-in amplifier that only listens at that frequency. Everything else, all the noise at all other frequencies, is rejected. You narrow your attention to exactly the frequency you care about, and suddenly a signal that was invisible in the raw data becomes clean and measurable.

This is feature selection and regularization applied to physics.

Regularization in machine learning forces a model to concentrate its explanatory power on the most relevant structure in the data. L1 regularization zeros out irrelevant features entirely, which is aggressive, like a narrow bandpass filter. L2 regularization shrinks them but keeps them, like a softer frequency weighting. In both cases, you are telling the model: do not spread your attention across all the noise. Focus on what actually matters.

The deeper principle is the same. Weak signal extraction requires prior knowledge about where the signal lives. That prior knowledge, whether encoded in a reference frequency or in a regularization penalty, is what separates signal from noise.

4. Data Quality Is Everything, and It Always Will Be

The moment a femtosecond experiment starts producing data, you face a problem that no amount of analysis elegance can fix: garbage in, garbage out.

Bad alignment corrupts the time zero. Coherent artifacts from pump scatter masquerade as real dynamics. Long-term laser drift introduces baseline variation that trends look like real signal. Air currents change the optical path length and broaden your pulses. If you are not rigorous about identifying and eliminating these sources of contamination, you will publish dynamics that are an artifact of your setup rather than the physics of your sample.

I have spent long nights staring at data, not analyzing it, just questioning it. Is this real? What would it look like if it were an artifact? What control experiment disproves the artifact hypothesis?

This skepticism is the most transferable skill I have. Machine learning data has all the same problems: measurement noise, systematic biases, label errors, distribution shifts, temporal leakage in time series splits. The specific pathologies are different, but the habit of mind is identical.

The best machine learning practitioners I have observed are not the ones who know the most architectures. They are the ones who are most paranoid about their data. They build validation sets with deliberate care. They look at their data before modeling it. They run sanity checks that a naive practitioner would skip.

In ultrafast spectroscopy, this is called being a careful experimentalist. In ML, they call it data hygiene. Same thing.

5. The Noise Floor Is Your Baseline Metric

In every experiment, before you touch the sample, you measure the noise floor. You block the pump, record the probe signal, characterize the baseline. You need to know the noise floor before you can claim anything has happened above it.

The signal-to-noise ratio is not an abstract concept. It is the entire question. Is there something real here, or are you looking at fluctuations?

This translates directly to model evaluation. Before you celebrate that your model achieved 92% accuracy, you need to know the baseline. What does a naive predictor achieve? What does always-predicting-the-majority-class give you? What does the simplest possible benchmark score?

I see practitioners skip this constantly. They train a neural network, achieve impressive-sounding numbers, and declare victory without asking whether those numbers represent anything real over baseline. In physics, this would be publishing a result without characterizing your noise floor. Nobody would accept it.

A 92% accuracy on a dataset where the majority class is 91% is not a good model. It is almost no model at all. The noise floor matters.

6. You Are Always Building a Model of Reality, Not Capturing Reality Itself

This is the deepest one, and the one that took me the longest to see clearly.

Neural network and artificial intelligence visualization

Models, whether physical or computational, are always approximations of reality

In ultrafast spectroscopy, you do not observe molecules directly. You observe how they absorb and emit light. You build a model of what the molecules must be doing based on the spectroscopic signatures: transient absorption spectra, time-resolved emission profiles, kinetic traces. The model is not the molecule. The model is your best theory of what the molecule is doing, constrained by the data you can collect.

Every result you publish is a model. A good model fits the data, makes falsifiable predictions, and fails gracefully when those predictions are tested. A bad model fits the data but cannot predict anything new.

Machine learning models are exactly this. A neural network does not understand your data. It builds a compressed representation of statistical patterns in your training distribution. That representation may generalize beautifully to new data, or it may fail catastrophically when something changes. The question is always: what is the model actually capturing, and under what conditions does it hold?

Physicists are trained to ask this question relentlessly. We build models and then we try to break them. We run experiments designed to falsify our interpretation, not confirm it. We report not just where the model works but where it breaks down.

This scientific epistemology is something the ML community has been rediscovering through bitter experience with model failures. It has a name in physics. We call it rigor.

Why This Matters Beyond the Analogy

I am making a career transition. People sometimes ask whether my physics background is relevant to what I am doing now with machine learning and data systems.

The honest answer is: it is the most relevant thing I have.

Not because ultrafast spectroscopy and neural networks share mathematical structure, although they do in places. But because experimental physics is seven years of intensive training in the following: how to extract reliable information from noisy systems, how to build and criticize quantitative models, how to optimize complex systems with coupled degrees of freedom, how to know when you are fooling yourself, and how to communicate uncertainty without hiding it.

These are not physics skills. They are scientific reasoning skills that happen to have been forged in a physics laboratory. And they are extremely useful in a field where data can deceive you, models can overfit, and the difference between a useful system and a confident-sounding disaster often comes down to rigor.

The vocabulary changes. The underlying epistemology does not.

A femtosecond laser taught me machine learning. I just did not know it at the time.

If you are a physicist wondering how your training maps to industry data roles, or a data scientist curious about where experimental rigor comes from, I am happy to talk. Find me on LinkedIn or through the contact page.

Ready to Explore More?

Discover more insights on bridging science and technology for career success.