Semi-supervised Reinforcement Learning

Machine Learning
Introduced by
Multiple contributors (Laskin, Srinivas, Abbeel et al.)
Year
2020s
Type
Semi-supervised training paradigm for RL agents
Family
Deep learning / NLP / CV

What does it do?

Semi-supervised reinforcement learning (SSRL) is a label-efficient setting in which an agent learns from a mixture of reward-labelled transitions and unlabelled environment interactions.

Unlabelled transitions are used through auxiliary objectives that shape the state representation, while the reward signal continues to drive policy learning. The term is used loosely in the literature, so any study should state explicitly where it draws the boundary with self-supervised RL and standard RL.

The intuition behind the method

A reinforcement learning agent often needs many environment interactions before its reward signal is informative enough to guide behaviour. In SSRL, most of those interactions are treated as unlabelled data. Auxiliary objectives, such as contrastive prediction, forward or inverse dynamics prediction, or augmentation consistency, are applied to all transitions to learn a state representation. The intended effect is that the policy can learn from fewer reward-labelled samples, in a way loosely analogous to fine-tuning a pre-trained model on a small labelled dataset.

History

Methods that use unlabelled experience to aid RL have developed alongside contrastive and self-supervised representation learning. The term 'semi-supervised reinforcement learning' has no single originator and is not used uniformly in the literature. CURL (Laskin, Srinivas & Abbeel, ICML 2020) is a representative example of an auxiliary contrastive objective for RL on pixel observations. Its contrastive loss is trained jointly with the RL agent's objective on replay-buffer samples, rather than as a separate reward-free pretraining stage. Whether CURL counts as SSRL depends on the definition adopted: its auxiliary loss is applied to the same reward-driven data used for the RL update, so the labelled versus unlabelled distinction used on this page does not clearly apply. The boundary with self-supervised RL should be checked against each source.

When to use it

Choose SSRL when reward feedback is sparse, costly to obtain, or available only for part of the experience, and when a substantial body of unlabelled interaction data exists, such as pre-collected logs or exploratory rollouts. Pixel or other high-dimensional observations are the setting where contrastive auxiliary objectives are most often proposed. Do not use SSRL when the reward is dense and standard RL already converges quickly, since the auxiliary objectives add cost without a clear gain. It is also a poor choice when the unlabelled transitions visit states unrelated to the reward-relevant region, or when they are dominated by noise that carries little predictive information about the dynamics. Before adopting it, check whether the unlabelled transitions overlap with the states where reward is observed (see inPractice).

Limitations and considerations

  • The auxiliary loss weight and learning rates must be tuned jointly with the RL objective, which adds hyperparameters to search.
  • If unlabelled transitions do not share structure with reward-relevant states, the auxiliary objective can shape the encoder in ways that do not help the policy.
  • Encoder updates on the full buffer and value updates on the labelled batch compete for the same parameters, so the combined training dynamics are harder to analyse than those of standard RL.
  • Few formal guarantees are established for this combined objective; any convergence claim should be checked against the specific algorithm and objectives used.
  • Training runs two objectives, which increases computation per update relative to vanilla RL.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Uses transitions that a reward-only learner would discard, by applying auxiliary objectives to unlabelled experience.
  • Reduces the amount of reward annotation needed to train the policy head, which is useful when reward labels require expert effort or long delays.
  • Auxiliary objectives can be attached to existing RL algorithms such as PPO, SAC or DQN without replacing the reward-driven update.
  • Can be applied to pre-collected offline transition logs as well as to online experience.

Applications

  • Pixel-based control and game environments, the setting in which contrastive auxiliary objectives are most often proposed.
  • Robotic manipulation and other control tasks with sparse task-completion rewards and abundant trajectory logs. This is a candidate setting rather than an established application and should be checked against the literature.
  • Any control problem where logged or exploratory transitions are plentiful but reward annotation is costly, provided the unlabelled data covers the reward-relevant states.

How it works

How it works

1

The agent rolls out in the environment and stores a buffer of (state, action, next-state) transitions. Only a subset of these transitions includes an observed reward; the remainder are treated as unlabelled experience.

2

Auxiliary self-supervised or semi-supervised objectives, such as contrastive prediction (as in CURL), forward or inverse dynamics models, or data-augmentation consistency losses, are applied to all transitions, labelled and unlabelled alike. These objectives train a shared encoder to produce state representations.

3

Reward-bearing transitions are used to fit a value function and advantage estimates. Because the encoder is shaped by the unlabelled data, the policy head has the potential to learn from fewer reward samples; whether this holds depends on how well the unlabelled data covers the reward-relevant states.

4

The policy is updated with a standard RL objective (for example PPO, SAC or DQN) on the reward-labelled batch, while the auxiliary objective updates the encoder on the full buffer, either in parallel or in alternating steps.

5

Performance is evaluated on held-out episodes using cumulative reward and sample-efficiency curves. The ratio of unlabelled to labelled data, the auxiliary loss weight, and the encoder architecture are the main hyperparameters to tune.

Common pitfalls

  • Treating the auxiliary objective as a plug-in module without checking that the unlabelled data covers the state region where the reward is informative.
  • Fixing the auxiliary loss weight without a sweep; an overly dominant auxiliary loss can suppress the reward-driven learning of the policy.
  • Reporting only final episodic reward rather than sample-efficiency curves, although faster learning from fewer reward labels is the main benefit SSRL needs to demonstrate.
  • Ignoring forgetting when the encoder keeps updating on unlabelled data late in training, which can overwrite representations shaped by earlier reward signal.
  • Conflating self-supervised RL, where no reward is used during representation learning, with semi-supervised RL, where reward-labelled transitions are used throughout. The two are defined differently across papers, so the chosen definition should be stated.

Frequently asked questions

How is semi-supervised RL different from self-supervised RL?

In the definition used on this page, self-supervised RL learns representations without reward during pre-training, relying on intrinsic signals. SSRL keeps a reward signal throughout and adds auxiliary objectives on unlabelled transitions. Other papers draw this line differently, so the definition should be stated in any write-up.

What auxiliary objectives are commonly used?

Contrastive losses (as in CURL), forward and inverse dynamics prediction, data-augmentation consistency and variational state prediction are examples. Contrastive methods are usually proposed for pixel inputs, while dynamics models are a common choice for low-dimensional state spaces.

Does SSRL always outperform standard RL?

No. When the reward is dense and learning converges quickly, the auxiliary overhead may add cost without a measurable benefit. The approach is most relevant when reward is sparse or expensive and the unlabelled transitions cover the relevant state space.

Can I apply SSRL with offline data?

Yes, the unlabelled buffer can be a pre-collected offline dataset, and the encoder trained on it can then be carried into online RL with sparse reward. This is one possible configuration rather than a guaranteed one. Offline-to-online transfer can suffer from distribution shift between the logged data and the new policy's rollouts, and pretrained features may be overwritten during online updates. Its benefit should be checked against a reward-only baseline.

What metrics should I report?

Report sample-efficiency curves (cumulative reward against environment steps) and final performance. When comparing against a reward-only baseline, also report the number of environment steps at which the SSRL agent first reaches the baseline's final performance.

Related methods

Sources

  1. Zhan, X., Zhu, X., & Shi, H. (2022). Deepthermal: Combustion optimization for thermal power generating units using offline reinforcement learning. Proceedings of the AAAI Conference on Artificial Intelligence, 36(4), 4680–4688.

    Open publication reference
  2. Laskin, M., Srinivas, A., & Abbeel, P. (2020). CURL: Contrastive Unsupervised Representations for Reinforcement Learning. Proceedings of the 37th International Conference on Machine Learning (ICML), PMLR 119, 5639–5650.

    Open publication reference