Q-learning is a foundational reinforcement learning algorithm where an agent learns to make decisions by interacting with its environment. The goal is to find an optimal policy that maximizes cumulative reward over time.
The algorithm works by maintaining a Q-table that estimates the value of taking each action in each state. Through trial and error, the agent updates these estimates using the Bellman equation:
Q(s, a) = r + γ * max(Q(s', a'))
Where s is the current state, a is the action, r is the reward received, s' is the next state, and γ is the discount factor. This iterative process allows the agent to converge to the optimal policy.
Q-learning is model-free, meaning it doesn't require knowledge of the environment's dynamics, and off-policy, as it can learn from actions not necessarily chosen by its current policy. It's widely used in robotics, game playing, and autonomous systems.