What is Q-learning?

Q-learning is a reinforcement learning algorithm in which an agent learns by trial and error the expected long-term total reward of each action in each state, its Q value, without needing a model of the environment.

It differs from Proximal Policy Optimisation in what is learned: PPO improves the policy that chooses actions directly, while Q-learning first learns action values and the policy follows from choosing the highest. Reinforcement learning is the broader field it belongs to.

Topic
Machine learning, models and training
Also known as
Q learning
Origin
1989, Chris Watkins

How Q-learning works

  1. The agent observes a state, chooses an action, receives a reward and moves to a new state.
  2. The estimated Q value for that state and action is updated towards the reward plus the discounted highest Q value in the new state.
  3. Exploration is balanced against using current knowledge, for example by choosing a random action a small share of the time.
  4. Small problems keep Q values in a table; large state spaces use a neural network to estimate them instead.

In more detail

Overestimation bias, double Q-learning and DQN

Because taking the maximum over noisy value estimates introduces positive overestimation bias, standard Q-learning can systematically overvalue sub-optimal actions. Double Q-learning mitigates this by decoupling action selection from value evaluation across two separate estimators, while Deep Q-Networks (DQN) add experience replay buffers and frozen target networks to stabilise neural-network training.

The discrete action limit and continuous control

Classic Q-learning relies on taking a maximum over all candidate actions, which limits it directly to discrete, relatively small action spaces. Continuous control tasks (such as exact valve positions or robotic torque) require discretising the action space or switching to actor-critic architectures such as DDPG, TD3 or Soft Actor-Critic (SAC).

Offline Q-learning and learning from historical logs

In industrial settings where live trial-and-error is unacceptable, training relies on historical logs rather than live exploration (offline RL). Standard Q-learning fails offline because it queries unseen out-of-distribution actions and overestimates their value; Conservative Q-Learning (CQL) addresses this by penalising Q values on actions absent from the dataset.

Commonly confused terms

TermHow it differs
SARSABoth are model-free temporal-difference control algorithms, but Q-learning is off-policy (updating towards the maximum next-state Q value regardless of the exploratory action taken), whereas SARSA is on-policy (updating using the actual next action chosen by the current policy, making it more conservative near risky states).

Why Q-learning matters for on-premises AI

In-house, Q-learning is tried on sequential decision problems such as cooling, energy management, resource allocation and maintenance scheduling. Trial-and-error learning is risky on a live system, so training happens first in a simulation and moves to the real environment with human approval and defined limits. Language model alignment mostly uses methods such as PPO, DPO and GRPO; Q-learning remains a foundation.

ON-PREMISES EXAMPLE

An energy company first optimises data centre cooling settings with a Q-learning agent in simulation; the agent's suggested settings reach the real system only after operator approval and safety limit checks.

Common questions

How does Q-learning differ from PPO?

Q-learning learns each action's value and picks the most valuable. PPO improves the action policy directly in small steps and is more common in language model alignment.

Does Q-learning work on large problems?

The table form is impractical for large state spaces. Deep methods estimating Q values with a neural network overcome this but are harder to train.

Sources

In the glossary: Glossary, M to Q

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.