﻿# Diffusion Policy has separate prediction, observation, and execution horizons

Distinguish a Diffusion Policy trajectory from its executable slice, inspect observation-action alignment conventions, and retain dataset padding and inference configuration.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-diffusion-policy-prediction-observation-execution-horizons/
Language: en

## The longest output is not automatically the control command

A policy adapter may receive a predicted action trajectory and send its first entry to a robot. That shortcut can select the wrong temporal position when the policy conditions on observation history. The original implementation distinguishes the full prediction from the action segment chosen for execution.

The [Diffusion Policy repository](https://raw.githubusercontent.com/real-stanford/diffusion_policy/main/README.md) publishes task-specific configurations and checkpoints. Preserve their relationship instead of interpreting a weight file independently from its trained temporal setup.

## Several horizons answer different questions

In the [low-dimensional policy implementation](https://raw.githubusercontent.com/real-stanford/diffusion_policy/main/diffusion_policy/policy/diffusion_unet_lowdim_policy.py), `horizon` describes a sampled trajectory extent, `n_obs_steps` controls observed history, and `n_action_steps` selects an execution extent. These are not interchangeable names for one chunk size.

Changing a control wrapper to consume more steps does not establish that the model was trained with different history or a different trajectory shape. Record model settings and execution settings separately when comparing rollouts.

## The slice start follows an alignment convention

The implementation chooses the returned segment using observation length and `oa_step_convention`, with a separate path for prediction of action steps only. Consequently, copying a slice from a different configuration can shift the command timeline.

Inspect `action` and `action_pred` as separately named outputs. The [tensor-axis guide](/journal/tensor-axes-batch-sequence-hidden/) helps distinguish a temporal index from an action component. A matching vector width cannot reveal an incorrectly selected time position.

## Dataset padding must match the trained timeline

The [PushT task configuration](https://raw.githubusercontent.com/real-stanford/diffusion_policy/main/diffusion_policy/config/task/pusht_lowdim.yaml) ties dataset padding to observation, execution, and latency settings. Boundary examples therefore depend on more than a tensor's final dimensions.

Retain episode boundaries and the resolved configuration when preparing training or replay data. A valid padded array does not mean that an artificial historical observation was measured. Nor does altering latency padding alone recreate the behavior of a policy retrained under another delay distribution.

## Validate an indexed replay before timing denoising

Use an offline trajectory with recoverable observation and action timestamps. Follow its history window, full generated extent, selected execution slice, and next replanning boundary. This checks temporal interpretation without requiring claims about physical task success.

The [diffusion training-target guide](/journal/diffusion-forward-noise-training-target/) provides mathematical context for sampling. A faster denoising run is only one part of policy evaluation; correctly aligned action selection and the actual feedback schedule remain separate computational responsibilities.
