Policy network

On this page 7

A policy network is a neural network that represents an agent’s policy: it takes an observation of the environment as input and outputs either an action directly or a probability distribution over actions. Reinforcement learning uses policy networks whenever the state or action space is too large for a lookup table, which covers nearly all modern problems in robotics, games and language model training.

The network’s weights are the policy parameters, usually written θ, and learning means adjusting θ so that the agent collects more expected cumulative reward. Policy networks are the core component of policy gradient methods, actor-critic algorithms such as proximal policy optimization, and systems such as AlphaGo, where a policy network proposed promising moves for tree search.

How a policy network maps states to actions

A policy network implements the function π(a | s; θ), the probability of choosing action a in state s. The input layer receives the observation, hidden layers extract features, and the output head turns those features into an action choice. The architecture of the body depends on the input: convolutional layers for images, multilayer perceptrons for vectors of joint angles, and transformers for text or long histories.

The output head depends on the action space. For discrete actions, a softmax layer produces one probability per action. For continuous control, the network usually outputs the mean and standard deviation of a Gaussian, from which the action is sampled, and a squashing function such as tanh keeps actions within physical limits.

Action spaceOutput headExample task
DiscreteSoftmax over action logitsChoosing a joystick move in Atari games
ContinuousGaussian mean and log standard deviationSetting torques on robot joints
Bounded continuousSquashed Gaussian with tanhSteering angle and throttle
Multi-discreteSeveral independent softmax headsUnit commands in strategy games
Token sequenceSoftmax over a vocabularyLanguage model fine-tuning with RLHF
Output heads for different action spaces

Stochastic and deterministic policy networks

A policy network can be stochastic or deterministic, and the choice shapes the learning algorithm. A stochastic policy samples actions from a distribution, which provides built-in exploration and is required by REINFORCE and PPO. A deterministic policy outputs a single action and relies on added noise for exploration, as in DDPG and TD3.

PropertyStochastic policy networkDeterministic policy network
OutputAction distributionSingle action
ExplorationSampling and entropy bonusExternal noise on actions
Typical algorithmsREINFORCE, PPO, SACDDPG, TD3
Gradient estimateLikelihood-ratio gradientGradient through a critic
StrengthHandles ambiguity and partial observabilitySample-efficient in continuous control
Comparison of policy network types

Soft actor-critic sits between the two: it trains a stochastic policy network but maximizes an entropy-regularized objective, which keeps the policy from collapsing too early to a single action.

How policy networks are trained

Policy networks are trained by gradient ascent on expected return. The policy gradient theorem shows that the gradient equals the expected value of ∇ log π(a | s; θ) multiplied by an advantage estimate, so actions that turned out better than expected become more likely. Raw returns give high variance, which is why practical methods subtract a baseline learned by a value network.

In actor-critic methods, the policy network is the actor and a value network is the critic. Generalized advantage estimation blends short and long horizons to balance bias and variance. PPO adds a clipped objective that limits how far each update can move the policy, which prevents the destructive updates that once made policy optimization unstable.

Policy networks can also be pretrained by imitation. Behavior cloning trains the network with supervised learning on expert demonstrations, and reinforcement learning then refines it. AlphaGo followed this pattern, and RLHF for language models starts from a supervised fine-tuned policy before reward-based optimization.

Policy network versus value network

A policy network answers “what should the agent do?”, whereas a value network answers “how good is this situation?” The distinction matters because value-based agents such as a deep Q-network derive actions indirectly by taking the maximum over predicted Q-values, which does not scale to continuous action spaces.

NetworkOutputRole in learning
Policy networkAction or action probabilitiesSelects actions directly
Value networkExpected return of a stateBaseline and critic for the policy
Q-networkExpected return per actionImplicit policy by argmax
World modelPredicted next state and rewardPlanning in model-based methods
Policy network compared with related function approximators

Many architectures use a shared trunk with two heads, one for the policy and one for the value. Sharing features saves computation, but the two losses can conflict, so some implementations keep separate networks for stability.

Limitations and common pitfalls

Policy networks are sample-hungry, especially in on-policy methods that discard data after each update. They are also sensitive to hyperparameters, reward scale and observation normalization, and small implementation details can change results substantially between otherwise identical algorithms.

  • Premature convergence: the policy becomes nearly deterministic before finding good behavior; an entropy bonus helps.
  • Overfitting to the training environment: the network exploits simulator quirks and fails on real hardware.
  • Reward hacking: the policy maximizes a flawed reward function rather than the intended goal.
  • Unstable updates: large learning rates or missing clipping cause sudden performance collapse.
  • Distribution shift: a cloned policy drifts into states that experts never demonstrated.

Practitioners counter these issues with domain randomization, careful reward design, observation and advantage normalization, and evaluation over many random seeds rather than a single run.

Understanding it simply

A policy network is the decision-maker inside a learning agent. It looks at the current situation and picks what to do next. At first its choices are close to random. Rewards gradually teach it which choices work.

Think of a new driver who slowly builds instincts. Each good outcome strengthens a habit. Each bad outcome weakens one. Over time, good decisions become automatic.

Applied in practice

A warehouse robotics team wants a robotic arm to pick mixed items from bins. They train a policy network in simulation that receives camera images and joint positions and outputs continuous motor commands for the arm and gripper.

The team first uses behavior cloning on a few hundred teleoperated demonstrations, then fine-tunes with PPO across thousands of simulated bins with randomized lighting, friction and object shapes. After about two days of training on a GPU cluster, the simulated success rate rises from roughly 60% to above 90%.

When the policy is transferred to the physical arm, domain randomization keeps performance close to the simulated results, and the remaining failures, mostly with transparent packaging, are collected as new training data for the next iteration.