arXiv:2611.12251cs.LGNov 2026

Manuscript Offprint

arXiv:2611.12251

RAIL: Representation-Aligned Imitation Learning for Student-Compatible Teacher Policies

Meraj Mammadov, Pedro Zuidberg Dos Martires, Johannes Andreas Stork

Abstract

Reinforcement learning (RL) from raw sensory inputs such as images or onboard sensors can be challenging due to high-dimensional observations and sparse rewards. A common strategy is to train a teacher policy with access to privileged state information and then distill it into a student policy that acts from raw inputs alone. However, when the teacher relies on information unavailable to the student, exact imitation may be impossible, creating an irreducible imitation gap. Existing approaches typically mitigate this mismatch through careful reward shaping or additional reinforcement learning on the student policy after the teacher has been trained. Instead, we introduce Representation-Aligned Imitation Learning (RAIL), which addresses the mismatch during teacher training itself. RAIL learns a latent representation shared across teacher and student observations using contrastive learning, and trains the teacher policy directly in this space. Because the teacher policy is constrained to operate on this shared space, it learns behaviors that are reproducible from student observations. This substantially reduces the imitation gap while preserving task performance. Across multiple environments, RAIL outperforms strong baselines without reward modification or post-hoc student fine-tuning, and surpasses direct reinforcement learning from raw observations. The learned representations further enable zero-shot transfer to new tasks through teacher-only training. Project site: https://merajmammadov.com/rail/.

1 Introduction

Training reinforcement learning policies directly on the target observation space can be impractical due to high dimensional observation space, sparse rewards, or costly exploration. A common strategy is therefore to first train a teacher policy with RL using privileged state information, and then to distill its behavior into a student policy that operates with the actual deployment observations [2]. For example, in navigation tasks the teacher may observe a full map, obstacle locations, or target coordinates, while the student must act on onboard camera images or limited local sensing.

While this teacher–student paradigm can greatly simplify training, it also introduces a fundamental mismatch: when the teacher exploits privileged variables that are not recoverable from the student’s observations, the resulting policy may be impossible for the student to reproduce. In that case, no policy conditioned only on student observations can exactly match the teacher’s decisions, leading to an irreducible imitation gap [31].

To illustrate this, consider the navigation task to the right (Figure 1), where an agent is dropped on the black tile and must reach the goal (green tile), while avoiding obstacles (red tiles). A privileged teacher observes all neighboring cells (dashed blue) and can move toward the goal without the need to change orientation. In contrast, the student observes only three cells in front of it (dashed orange) and needs to actively change its orientation to complete the mission successfully. This means that the

Figure

Figure 1: Observation mismatch in TunnelVision: Teacher (blue) vs. student (orange).

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

teacher can distinguish between states that are indistinguishable to the student, which in turn means that the teacher is capable of taking more informed actions than the student.

Existing approaches typically address this mismatch after teacher training, either by incorporating teacher signals into the student's RL objective [13, 14], or by additional RL fine-tuning of the student [33]. While effective in certain settings, these methods reintroduce the cost of RL optimization and do not remove the underlying information asymmetry.

In this work, we address the teacher–student imitation gap at its source: instead of training an unconstrained teacher and repairing the student afterward, we constrain the teacher to act only on information accessible to the student. We propose Representation-Aligned Imitation Learning (RAIL), which learns a common representation of teacher and student observations that captures only the information available to both. The teacher policy is trained with RL in this space, and the same policy is applied by the student at deployment time.

The contributions of this paper are: (1) We propose RAIL, a teacher–student imitation framework that enforces imitability during teacher training by restricting the teacher policy to a shared latent space that is also recoverable from student observations. (2) We introduce a contrastive representation-learning objective with gradient blocking, alignment, and stability regularization to prevent the leakage of private teacher information and enable direct policy transfer. (3) Across multiple environments, we show that RAIL reduces the imitation gap, outperforms strong baselines, learns faster than pixel-based RL, and supports zero-shot transfer to new tasks.

References (34)