Papers › In-Context Imitation Learning via Next-Token Prediction

In-Context Imitation Learning via Next-Token Prediction

28 Aug 2024arXiv:2408.15980archive 2025-07-28

Letian Fu, Huang Huang, Gaurav Datta, Lawrence Yunliang Chen, William Chung-Ho Panitch, Fangchen Liu, Hui Li, Ken Goldberg

We explore how to enhance next-token prediction models to perform in-context imitation learning on a real robot, where the robot executes new tasks by interpreting contextual information provided during the input phase, without updating its underlying policy parameters. We propose In-Context Robot Transformer (ICRT), a causal transformer that performs autoregressive prediction on sensorimotor trajectories without relying on any linguistic data or reward function. This formulation enables flexible and training-free execution of new tasks at test time, achieved by prompting the model with sensorimotor trajectories of the new task composing of image observations, actions and states tuples, collected through human teleoperation. Experiments with a Franka Emika robot demonstrate that the ICRT can adapt to new tasks specified by prompts, even in environment configurations that differ from both the prompt and the training data. In a multitask environment setup, ICRT significantly outperforms current state-of-the-art next-token prediction models in robotics on generalizing to unseen tasks. Code, checkpoints and data are available on https://icrt.dev/

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

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="2408.15980")

Code

Syntology Ran 9 of 11 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 1 ran · violated contract; 8 ran with no contract checked.

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

Max-Fu/icrt officialmentioned on GitHubpytorchApache-2.0 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

11 samples harvested; 9 ran; 0 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

1ran · violated contract
8ran
2unverified

Licence: 0 of the 11 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 Max-Fu/icrt. “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.

apply_rotary_emb Max-Fu/icrt/icrt/models/policy/llama.py official repository ran Apache-2.0 (permissive) · 373a3280ff76d40d · report
get_2d_sincos_pos_embed Max-Fu/icrt/icrt/models/backbones/pos_embed.py official repository ran fingerprinted Apache-2.0 (permissive) · cd809ededc7ba250 · report
get_2d_sincos_pos_embed_for_coords Max-Fu/icrt/icrt/models/backbones/pos_embed.py official repository ran Apache-2.0 (permissive) · 45dd229701ef23a9 · report
get_default_vision_aug Max-Fu/icrt/icrt/models/backbones/preprocess.py official repository ran Apache-2.0 (permissive) · a9138b353bdf772d · report
precompute_freqs_cis Max-Fu/icrt/icrt/models/policy/llama.py official repository ran · violated contract Apache-2.0 (permissive) · 14a84c2cbfebc413 · report
reshape_for_broadcast Max-Fu/icrt/icrt/models/policy/llama.py official repository ran Apache-2.0 (permissive) · 61fd8b1b4e07b8c9 · report
to_pil Max-Fu/icrt/icrt/models/backbones/preprocess.py official repository ran Apache-2.0 (permissive) · 7823943fccca7f70 · report
undo_vision_transform Max-Fu/icrt/icrt/models/policy/icrt_wrapper.py official repository ran Apache-2.0 (permissive) · 101148492ee6fc64 · report
unnormalize_fn Max-Fu/icrt/icrt/models/backbones/preprocess.py official repository ran Apache-2.0 (permissive) · 9a73cbb66f31231c · report
get_2d_sincos_pos_embed_from_grid Max-Fu/icrt/icrt/models/backbones/pos_embed.py official repository unverified Apache-2.0 (permissive) · b7482295ffca3e2c · report
handle_flash_attn Max-Fu/icrt/icrt/models/backbones/utils.py official repository unverified Apache-2.0 (permissive) · 1a3e01d4552a3b11 · report

Tasks

Imitation LearningPrediction

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

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