Reinforcement learning is a type of machine learning for learning how to act. Its main components are an agent, an environment, observations or states, actions, rewards, and a policy. The agent selects an action according to its policy, the environment changes, and the agent receives feedback. Training uses these experiences to improve the policy so that it maximizes expected cumulative reward, often with future rewards discounted.
The key exam distinction is the learning signal. Supervised learning learns from examples paired with target labels, such as transactions labeled fraudulent or legitimate. Unsupervised learning identifies structure in data without supplied target labels, such as customer clusters. Reinforcement learning learns from the consequences of actions through reward feedback. It does not require a correct action label for every situation, but it does require a meaningful reward signal and experience from an environment or previously collected interactions.
Rewards can be immediate or delayed. A warehouse robot might receive a positive reward for completing a delivery and a penalty for a collision. An action that initially moves away from the destination might still be useful if it avoids an obstacle and enables successful delivery later. Assigning later outcomes to earlier decisions is called credit assignment. This is why reinforcement learning is not simply choosing the action with the largest immediate reward.
A central challenge is balancing exploration and exploitation. Exploration tries actions to learn their consequences, while exploitation chooses actions already expected to perform well. Exploration can consume compute, waste resources, or cause unsafe behavior. Engineers therefore often train in simulations, restrict the available actions, and evaluate policies before allowing them to control production systems. Offline reinforcement learning instead trains from previously collected interaction data, although learning reliable behavior outside that data's coverage remains difficult.
In the cloud, engineers can run simulated environments across compute instances, collect interaction trajectories, and train policies using reinforcement learning frameworks. For example, an inventory simulator could expose stock levels and demand signals as observations, accept replenishment quantities as actions, and calculate rewards from sales revenue minus storage and stockout costs. A trained policy could then be deployed behind an inference endpoint, with application code translating its output into permitted business actions.
Reinforcement learning can require many interactions and substantial compute. A simulator that poorly represents real conditions can produce a policy that performs well during training but fails after deployment. Poorly designed rewards can also encourage unintended behavior: rewarding low infrastructure cost without adequately penalizing failed requests could teach a resource controller to remove too much capacity. Hard safety limits should be enforced independently of the reward function.
Not every automated decision system uses reinforcement learning. Threshold-based autoscaling is rule-based, and a demand forecast trained against historical demand is typically supervised learning. Reinforcement learning is most appropriate when actions influence later states and long-term outcomes. Production evaluation should compare the learned policy with simpler baselines, test unusual conditions, monitor business and safety metrics, and provide a fallback policy. Deploying a trained policy does not automatically mean that it continues learning from live traffic.