Skip to main content

What is self-supervised learning?

The AI Glossary

In our classes, we often pause to explain the ideas behind AI and the language used to describe it. These posts grew out of those conversations. They’re for anyone who would like to understand AI better, with no technical background assumed.

Self-supervised learning is a way to train a model using tasks whose target answers are generated from the data itself. Rather than asking people to label every example, developers create a prediction problem from information already present in text, images or other records.

Self-supervised learning is a fundamental mechanism behind training large language models (LLMs) such as BERT, GPT models, and Gemini, enabling them to learn language patterns at scale before being adapted for specific tasks.

For text, one approach hides a word and asks the model to recover it from the surrounding words. Another asks it to predict the next piece of text from what came before. Those pieces are called tokens: they may be words, word fragments or punctuation. The original text supplies the target answer, so a person does not need to write a separate answer for every training example.

Images offer other possibilities. A model can learn to recover missing regions or recognize that two altered views came from the same photograph. In contrastive learning, examples that should be related are brought closer together in the model’s numerical representation, while other examples are pushed apart. A representation is simply the set of numbers the model uses to describe an input.

“Self-supervised” does not mean the system chooses its own purpose or teaches itself without people. Developers choose the data, the learning task and the methods used to assess the result. It also does not mean the data was created without human effort: books, photographs and clinical notes already contain substantial human work.

The boundary with supervised learning needs care. Supervised targets are not always manually entered by people; they can come from measurements or existing records. Self-supervision specifically describes deriving learning signals from the structure of the input data. Different research communities sometimes group it differently within broader learning categories.

A research team could use an archive of physiological recordings to learn useful signal patterns before training a detector for a particular clinical event. This may reduce the number of specialist-labeled examples needed later. It does not establish that the patterns represent disease rather than equipment differences, or that the detector will work in another population. Learning a useful representation and validating a clinical use remain separate tasks.

Sources: Devlin and colleagues — BERT (2019); Chen and colleagues — A Simple Framework for Contrastive Learning of Visual Representations (2020)

Further reading from Harvard Chan: Public Health Perspectives — To Meet Future Needs, Health Care Leaders Must Look at the Data (Science) (2022).

To learn more, take a look at the AI in Health Care Certificate of Specialization from the Advanced Learning Academy at Harvard T.H. Chan School of Public Health. You can take an individual course or work toward the full certificate.


I’m a doctor, not a statistician. I teach the AI in Health Care Certificate of Specialization with Dr. Heather Mattie, a statistician and co-director of Harvard Chan’s Health Data Science master’s program. For more on data science and statistics, see Harvard Chan’s Health Data Science resources.

AI is a fast-moving field. This explanation reflects our class discussions and related material at the time of writing. Terminology, capabilities and tools may change.

For suggested additions or corrections, please email me at tpanch@hsph.harvard.edu.

Dr. Trishan Panch
Program Director, AI in Health Care
Harvard T.H. Chan School of Public Health — Advanced Learning Academy

Lead with AI in Health Care

The AI Pragmatist is a monthly newsletter from ALA faculty, with new explainers & essays from the Advanced Learning Academy