In Reinforcement Learning (RL), an agent interacts with its environment and tries to learn how to behave optimally by receiving rewards which depend on which actions are taken and which states are reached. A policy refers to the rule that determines which action should be performed given a certain state of the environment. It can be defined as a mapping from states to a distribution over actions:

A policy can be written as:
`π(a | s) = p(a|s)` where `s` is any possible state and `a` is any possible action. 

The symbol `π` is often used instead of `p` for convenience when writing down policies explicitly. Policies can either be deterministic: mapping each state to a single action(assigning that action a probability of 1), or stochastic: mapping each state to a distribution over possible actions. In general, finding an optimal policy requires the agent to balance exploitation (i.e., choosing actions that have led to high reward in the past) and exploration (trying new actions that may lead to even higher rewards).
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence