Before the AI Boom — Chemometrics and Learning from Data
Techniques:
Modalities:

(Week 11, reading 1 of 9.) Every technique week so far ended with a number: a peak area, a mass loss, a percentage dissolved. This week’s readings ask what happens when the number comes from a model fitted to a measurement, and the module follows one recurring question: what evidence makes a model useful for a particular pharmaceutical decision?
The one idea
Chemists were using computers to learn patterns from measurements decades before today’s generative AI, and chemometrics became an identifiable field in the early 1970s. Its enduring question is still the useful one: what relationship can we learn from these measurements, and what evidence makes that relationship dependable for a particular decision?
Modern machine learning and language models extend this story. They bring substantial advances in architecture, scale and capability, while keeping familiar challenges: representative examples, misleading correlations, independent evaluation and limits on use.
A container arrives at the warehouse
A pharmaceutical manufacturer receives a container labeled lactose monohydrate, an excipient used in tablets. Before the material enters manufacturing, the company needs evidence that the contents have the expected identity.
The label describes what the supplier says is inside. The analytical procedure must produce evidence about what is actually inside.
One possible approach is near-infrared (NIR) spectroscopy, met at survey depth in Week 6. The instrument illuminates the sample and records its response across many wavelengths. That response reflects molecular vibrations, particularly overtones and combinations involving bonds such as O–H, C–H and N–H. In powders, the spectrum is also affected by scattering and physical properties [2, 3].
This is where the solid-state readings from Week 9 return: moisture, particle size and solid form can all change what an instrument sees. A spectral difference might indicate the wrong material, or an expected variation in the right material.
The practical question becomes: can we distinguish acceptable lactose from plausible alternatives despite normal variation in the measurement?
This is an illustrative teaching case, not a validated identification procedure or a claim that one scan establishes every aspect of material quality.

From a fingerprint to a pattern-recognition problem
With a simple calibration, such as Beer–Lambert in Week 6, one absorbance value estimates a concentration. An NIR spectrum offers something different: many measurements that can be interpreted together.
Imagine collecting spectra from authenticated lots of lactose, mannitol and microcrystalline cellulose. Within each material, include the suppliers, grades, physical properties and measurement conditions relevant to the proposed use.
The analyst now has two linked sets of information:
| Information | What it contributes |
|---|---|
| Spectra | The measured patterns the procedure will interpret |
| Independently established identities | The reference information used to develop and evaluate the procedure |
A computer can compare patterns across the spectral variables. But its ability to separate the training examples does not establish that it will correctly handle tomorrow’s incoming lot.
That distinction, between describing examples already seen and performing dependably on new ones, is central to chemometrics and machine learning.
The 1970s: this problem already had a community
In the early 1970s, Svante Wold and Bruce Kowalski were developing approaches to chemical data that combined chemistry, statistics, computing and pattern recognition. Wold’s firsthand account describes their meeting in 1973 and the formation of the Chemometrics Society in 1974 [1].
Their work included principal component analysis (PCA), nearest-neighbor classification, and methods described at the time as learning machines. Wold also developed soft independent modeling of class analogy (SIMCA), a class-modeling approach built on principal components. These were recognizable attempts to extract useful relationships from chemical measurements long before the current AI boom [1].
The mathematical roots go back further. The 1970s mark the emergence and organization of chemometrics as a field, not the invention of statistics or the first mathematical model in chemistry.
For this course, chemometrics means applying mathematical and statistical methods to obtain useful chemical information from measurements and to design informative experiments. It covers more than prediction: experimental design, exploration of variation, classification, calibration and monitoring all belong in the picture.
Three questions, three different jobs
Return to the incoming-material example. Several tools can work with the same spectra, but they answer different questions.
| Tool or approach | Question it helps answer | Pharmaceutical use |
|---|---|---|
| PCA | What major patterns of variation are present? | Explore grouping among raw-material spectra and investigate unusual lots |
| Classification or class modeling, such as SIMCA | Does the sample satisfy the defined criteria for a material class? | Support an identity decision against authenticated materials and relevant challenges |
| Partial least squares (PLS) regression | What numerical reference property can be predicted from the measurements? | Predict moisture or active pharmaceutical ingredient (API) concentration using calibration samples with reference results |
PCA can produce a score plot in which samples occupy positions along a few principal components. Those positions summarize variation across many original variables. The components themselves do not automatically have chemical names: the analyst must investigate what drives them.
A cluster labeled “lactose” on a PCA plot is an observation to investigate. Turning it into a dependable identification procedure requires a defined decision rule and evidence of performance. Likewise, a PCA score is not automatically a concentration. Reading 3 develops these distinctions.
A model can learn the wrong distinction
Suppose every lactose spectrum in development came from Supplier A and was measured on Monday. Every mannitol spectrum came from Supplier B and was measured on Friday.
The groups separate beautifully. Have we learned chemical identity, supplier-specific particle size, a change in humidity, an instrument difference, or some combination?
The plot alone cannot settle the question.
This is confounding: factors vary together, so it is hard to tell which relationship supports the prediction. A model may use a correlation that performs well in development but fails when the circumstances change.
Consider this deliberately invented challenge set. These are teaching outcomes, not experimental data or recommended acceptance limits.
| New sample | Illustrative model outcome | Interpretation |
|---|---|---|
| Authenticated lactose from a represented supplier | Accepted as lactose | Expected performance, but only one part of the evidence |
| Authenticated lactose from a new supplier | Rejected | Investigate whether a relevant source of acceptable variation was omitted |
| Authenticated mannitol | Accepted as lactose | A serious specificity failure against this challenge material |
| Lactose containing a small amount of another material | Accepted as lactose | Identity acceptance does not establish purity or mixture-detection capability |
The last row matters particularly in pharmaceutical quality. A procedure developed for identity cannot be assumed to control low-level contamination, adulteration or any other quality attribute. The heparin case on the Week 11 page is what that gap costs when it is real.
To evaluate the intended identity decision, challenge the procedure with independent samples and relevant alternatives. Include expected variation and define what happens when a sample falls outside the supported conditions. Repeated scans of one lot cannot substitute for evidence across independent lots [2, 3].
Where machine learning and AI fit
Chemometrics is organized around chemical problems. Machine learning (ML) is organized around computational methods that learn useful relationships from data. Artificial intelligence (AI) is a broader field covering approaches to tasks associated with intelligent behavior.
These areas overlap. A classification algorithm can be described as machine learning and used within a chemometric analytical procedure. Chemometrics also includes activities not usually presented as AI, and AI includes approaches beyond statistical learning.
So a simple sequence, “chemometrics became machine learning, which became AI”, would misrepresent the history. The stronger lesson is that chemical scientists have long taken part in learning from data, while methods and capabilities have kept evolving.
Later developments include the Transformer architecture introduced in 2017 and large-scale language-model work such as GPT-3 in 2020. These are substantial technical developments, not a change in terminology [4, 5].
From a spectrum to a sentence
An NIR identification procedure interprets a measured spectrum to support a defined material decision. An autoregressive language model learns relationships in token sequences and generates tokens conditioned on the preceding context. Next-token prediction is a foundational training objective; many deployed assistants receive additional training to improve instruction following and other behavior. Language modeling also extends beyond English [5].
The outputs need different kinds of evaluation. A material model needs evidence against independently established material identities. A generated investigation summary needs checking against the underlying records and the requirements of that task. Reading 8 works that second case.
The shared discipline is to ask what was learned, where it applies, and what independent evidence supports its use. A model’s apparent confidence or fluent explanation cannot supply that evidence by itself.
Where the analyst sits
The analyst connects measurements, chemistry and decisions. In the warehouse example, that means knowing why particle size might change a spectrum, which materials could be confused, how reference identities were established, and when a result needs investigation.
Chemometrics makes more information accessible from complex measurements. Pharmaceutical analysis is responsible for establishing when that information is adequate for the decision being made.
For discussion
- A PCA plot separates three excipients perfectly. What additional evidence would you need before using a procedure based on these spectra for incoming-material identification?
- Why might twenty lots be more informative than twenty scans of one lot? What could repeated scans still help you assess?
- A new supplier’s lactose is rejected by the model but confirmed by an independent identity procedure. What would you investigate before changing the model?
- Why does accepting a sample as lactose fail to establish that it is free from all contaminants?
Bridge back to the week
Next: From Pharmaceutical Question to Tested Prediction, which turns the identity question into a moisture prediction and walks the full development workflow. Return to Week 11.
Sources
[1] S. Wold, “Chemometrics and Bruce: Some Fond Memories,” in 40 Years of Chemometrics — From Bruce Kowalski to the Future, ACS Symposium Series 1199 (2015). A firsthand account of early chemical pattern recognition and the formation of the chemometrics community; read the historical opening. Publisher access may need an institutional subscription. ACS chapter.
[2] US Food and Drug Administration (FDA), Development and Submission of Near Infrared Analytical Procedures (guidance, 2021). NIR analytical procedures using chemometric models. Its historical Q2(R1) references should be read alongside current Q2(R2) and Q14. FDA guidance.
[3] European Medicines Agency (EMA), Guideline on the Use of Near Infrared Spectroscopy by the Pharmaceutical Industry and the Data Requirements for New Submissions and Variations (2014). Qualitative and quantitative applications, development and validation. EMA guideline.
[4] A. Vaswani et al., “Attention Is All You Need” (2017). Optional: the abstract and introduction, for the Transformer milestone. arXiv.
[5] T. Brown et al., “Language Models are Few-Shot Learners” (2020). Optional: the abstract and introduction, for autoregressive language modeling and the effects of scale. This historical example does not describe every current assistant’s architecture or training. arXiv.
The warehouse case and the challenge-set outcomes are constructed teaching examples, not experimental data or recommended acceptance criteria.