Machine Learning

Reinforcement Learning

Reinforcement learning is machine learning in which an agent learns by acting in an environment and receiving rewards or penalties, gradually finding a policy that earns the most reward over time.

What is reinforcement learning?

Reinforcement learning is machine learning by trial and error. An agent observes the state of an environment, takes an action, and receives a reward or a penalty. Over many episodes it learns a policy, a rule for choosing the action in each state that leads to the highest total reward. Nobody supplies the right answer for each step. The agent discovers it from the consequences.

This differs from supervised learning, where every example carries a label. The feedback in reinforcement learning is sparse and delayed. A move made early in a game only pays off at the end, and the algorithm must assign credit backward through the whole sequence.

How reinforcement learning works

The loop is state, action, reward, new state. Early on the agent explores, trying actions at random to learn their effects. As experience accumulates it exploits what it knows, choosing actions with the best expected return while still exploring enough to find better ones. Value-based methods such as Q-learning estimate how good each action is in each state. Policy gradient methods train a neural network that outputs actions directly. Because learning takes millions of trials, training almost always happens in a simulation rather than in the live business.

Reinforcement learning in practice

A cold-storage warehouse operator wants to cut electricity use without letting product temperatures drift. A simulation of the building, fitted to a year of sensor data, becomes the environment. The agent chooses compressor and defrost schedules every fifteen minutes, earns reward for lower energy use, and is penalized heavily whenever a zone leaves its allowed range. The trained policy runs in shadow mode beside the existing controller before it is allowed to act. The same approach appears in dynamic pricing, inventory replenishment, and robot navigation, and reinforcement learning from human feedback applies the idea to language models with human ratings as the reward.

What to watch for

  • The reward defines the behavior. A badly specified reward produces an agent that games the metric, so review it with the people who own the process.
  • A policy trained in simulation inherits every inaccuracy of that simulation, so validate it against reality before it controls anything.
  • The word “agent” here is a technical term from the field and does not mean an AI agent built on a language model.
  • For problems with a clear formula, classic optimization is often cheaper and more reliable than reinforcement learning.

← Back to AI Glossary