Papers › DiffTORI: Differentiable Trajectory Optimization for Deep Reinforcement and Imitation Learning

DiffTORI: Differentiable Trajectory Optimization for Deep Reinforcement and Imitation Learning

8 Feb 2024arXiv:2402.05421archive 2025-07-28

Weikang Wan, Ziyu Wang, YuFei Wang, Zackory Erickson, David Held

This paper introduces DiffTORI, which utilizes Differentiable Trajectory Optimization as the policy representation to generate actions for deep Reinforcement and Imitation learning. Trajectory optimization is a powerful and widely used algorithm in control, parameterized by a cost and a dynamics function. The key to our approach is to leverage the recent progress in differentiable trajectory optimization, which enables computing the gradients of the loss with respect to the parameters of trajectory optimization. As a result, the cost and dynamics functions of trajectory optimization can be learned end-to-end. DiffTORI addresses the ``objective mismatch'' issue of prior model-based RL algorithms, as the dynamics model in DiffTORI is learned to directly maximize task performance by differentiating the policy gradient loss through the trajectory optimization process. We further benchmark DiffTORI for imitation learning on standard robotic manipulation task suites with high-dimensional sensory observations and compare our method to feed-forward policy classes as well as Energy-Based Models (EBM) and Diffusion. Across 15 model-based RL tasks and 35 imitation learning tasks with high-dimensional image and point cloud inputs, DiffTORI outperforms prior state-of-the-art methods in both domains. Our code is available at https://github.com/wkwan7/DiffTORI.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.05421")

Code

Syntology Ran 7 of 8 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 7 ran with no contract checked.

By repository: official repository: 8 samples from 1 repository, 7 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

wkwan7/difftori officialmentioned in papermentioned on GitHub report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

8 samples harvested; 7 ran; 0 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

7ran
1unverified

Licence: 8 of the 8 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from wkwan7/DiffTORI. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

create_indices wkwan7/DiffTORI/DiffTORI_IL_Metaworld/DiffTORI/diffusion_policy_3d/common/sampler.py official repository ran no licence file found · pointer only · 0a16eab1dfc7ced0 · report
dict_apply wkwan7/DiffTORI/DiffTORI_IL_Metaworld/DiffTORI/diffusion_policy_3d/common/pytorch_util.py official repository ran no licence file found · pointer only · e889bd81b4735ee5 · report
dict_apply_split wkwan7/DiffTORI/DiffTORI_IL_Metaworld/DiffTORI/diffusion_policy_3d/common/pytorch_util.py official repository ran no licence file found · pointer only · 8c6a9f390c7af799 · report
downsample_mask wkwan7/DiffTORI/DiffTORI_IL_Metaworld/DiffTORI/diffusion_policy_3d/common/sampler.py official repository ran no licence file found · pointer only · 85ef80fba2caa71d · report
get_optimal_chunks wkwan7/DiffTORI/DiffTORI_IL_Metaworld/DiffTORI/diffusion_policy_3d/common/replay_buffer.py official repository ran no licence file found · pointer only · 1d4ddad52e215d73 · report
get_val_mask wkwan7/DiffTORI/DiffTORI_IL_Metaworld/DiffTORI/diffusion_policy_3d/common/sampler.py official repository ran no licence file found · pointer only · ed689847c85c1288 · report
pad_remaining_dims wkwan7/DiffTORI/DiffTORI_IL_Metaworld/DiffTORI/diffusion_policy_3d/common/pytorch_util.py official repository ran fingerprinted no licence file found · pointer only · ad05722d0bd12d1e · report
read_json_log wkwan7/DiffTORI/DiffTORI_IL_Metaworld/DiffTORI/diffusion_policy_3d/common/json_logger.py official repository unverified no licence file found · pointer only · d83f4930e9aa9202 · report

Tasks

Imitation Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Diffusion

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections