What is imitation learning?

Imitation learning is a machine learning approach in which an agent learns behaviour from state and action examples or observation sequences demonstrated by experts rather than from a reward function.

Behaviour cloning is its simplest form. Unlike reinforcement learning, where the agent maximises reward by trial and error, here it sees what the expert did and learns to repeat it. Supervised fine-tuning of language models on example answers is a kind of behaviour cloning.

Topic
Machine learning, models and training
Also known as
Behaviour cloning, behavioral cloning

How imitation learning works

  1. The situations an expert person or system faced and the actions taken are recorded as demonstration data.
  2. In behaviour cloning, a model predicting action from state is trained on these pairs with supervised learning.
  3. When the model reaches a situation the expert never saw, small errors can accumulate; this is distribution shift.
  4. Methods such as DAgger run the model, ask the expert for the correct action in new situations it reaches and add these to the data.

In more detail

Inverse reinforcement learning and adversarial imitation (GAIL)

Beyond behaviour cloning and DAgger, Inverse Reinforcement Learning (IRL) infers the latent reward function that explains expert behaviour, while Generative Adversarial Imitation Learning (GAIL) matches the expert's state-action occupancy distribution directly. IRL is especially valuable when the goal is to transfer the expert's underlying intent to new environments or dynamics.

Compounding error: quadratic versus linear growth

The distribution shift problem has a well-known theoretical cost: in standard behaviour cloning, an error rate of epsilon per step compounds quadratically with the horizon length T. Interactive methods such as DAgger keep this error growth linear in T by querying the expert on states visited by the learned policy.

Multimodal demonstrations and hybrid imitation with RL

Real-world demonstrations are often noisy and multi-modal; there may be several equally valid ways to solve the same task, so naive regression averages conflicting actions into invalid behaviour. Modern approaches such as Diffusion Policy, Action Chunking with Transformers (ACT) and Vision-Language-Action (VLA) models capture multi-modal action distributions, while hybrid pipelines follow imitation pre-training with RL or preference tuning (such as DPO or GRPO).

Causal confusion and learning from observation

In many enterprise settings, only screen recordings, text logs or video traces are available without explicit action labels, requiring Learning from Observation (LfO). Models can also suffer from causal confusion, where a policy latches onto spurious correlates in demonstrations rather than the true causal cues governing the expert's decision.

Why imitation learning matters for on-premises AI

In agent systems, experienced staff's past work records, such as the steps used to resolve a request, can serve as demonstrations to train an agent to follow the same steps. These records often hold personal and confidential information, so they stay in-house. The model also copies experts' mistakes and is weak outside the demonstrations, so human approval and out-of-scope detection are needed.

ON-PREMISES EXAMPLE

A telecom operator trains a recommendation agent on diagnostic steps from experienced network engineers' past fault records; for a new fault it suggests the next step, which runs only after an engineer approves.

Common questions

How does imitation learning differ from reinforcement learning?

In reinforcement learning the agent learns from a reward signal by trial and error. In imitation learning it watches the expert's actions and learns to repeat them, with no reward to define.

Why is distribution shift a problem?

When the model reaches a situation the expert never met, it does not know what to do and small errors compound. Methods such as DAgger add these situations to the data.

Sources

In the glossary: Glossary, D to L

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.