SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.11188 · NeurIPS · 2024

AMAGO-2: Breaking the Multi-Task Barrier in Meta-Reinforcement Learning with Transformers

Amy Zhang, Yuke Zhu, Jake Grigsby, Justin Sasek, Samyak Parajuli, Daniel Adebi

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2411.11188.json · badge: /api/ran/2411.11188.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ut-austin-rpl/amago canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
add_cli Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from UT-Austin-RPL/amago
pointer only · get_code("0813fc39f3d9ebb0")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_action_dim_and_type Ran
ran, honoured the contract we drafted
ut-austin-rpl/amago/amago/agent.py
code served (permissive licence) · get_code("2ffee777eb103fb3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import gymnasium as gym
import numpy as np

# Test with a Discrete action space
discrete_space = gym.spaces.Discrete(n=5)

# Test with a MultiBinary action space
multibinary_space = gym.spaces.MultiBinary(n=3)

# Test with a Box action space
box_space = gym.spaces.Box(low=-1.0, high=1.0, shape=(4,), dtype=np.float32)

# We'll test with the Discrete space as the primary example
ARGS = {
    "action_space": discrete_space
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gymnasium, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_path_to_trajs Ran
ran; our contract draft was wrong, not the code
ut-austin-rpl/amago/amago/loading.py
code served (permissive licence) · get_code("7176a351fc668593")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os

# Construct valid arguments for get_path_to_trajs
ARGS = {
    'dset_root': '/tmp/datasets',
    'dset_name': 'my_dataset',
    'fifo': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
register_agent Ran
ran; our contract draft was wrong, not the code
ut-austin-rpl/amago/amago/agent.py
code served (permissive licence) · get_code("cb28542e368fc51b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# Clear the registry to ensure clean state
_AGENT_REGISTRY = {}

class DummyAgent(nn.Module):
    """A minimal Agent class for testing."""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)

# Test the decorator with a valid name
ARGS = {
    "name": "test_agent"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
register_traj_encoder Ran
ran; our contract draft was wrong, not the code
ut-austin-rpl/amago/amago/nets/traj_encoders.py
code served (permissive licence) · get_code("60a00fe723fb7874")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from abc import ABC, abstractmethod

# Define a minimal TrajEncoder base class
class TrajEncoder(nn.Module, ABC):
    """Base class for trajectory encoders."""
    
    def __init__(self):
        super().__init__()
    
    @abstractmethod
    def forward(self, x):
        pass

# Initialize the registry (this would typically be defined in the module)
_TRAJ_ENCODER_REGISTRY = {}

# Define the decorator function
def register_traj_encoder(name: str):
    """Decorator to register a TrajEncoder class under a shortcut name.

    Args:
        name: The shortcut name to register the encoder under (e.g., "transformer", "ff").

    Example:
        @gin.configurable
        @register_traj_encoder("my_encoder")
        class MyCustomTrajEncoder(TrajEncoder):
            ...
    """

    def decorator(cls):
        if name in _TRAJ_ENCODER_REGISTRY:
            raise ValueError(f"TrajEncoder '{name}' is already registered to {_TRAJ_ENCODER_REGISTRY[name]}. Cannot re-register to {cls}.")
        _TRAJ_ENCODER_REGISTRY[name] = cls
        return cls
    return decorator

# Create a simple test encoder class
class SimpleEncoder(TrajEncoder):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 8)
    
    def forward(self, x):
        return self.linear(x)

# Set up arguments for the function
ARGS = {
    "name": "simple_encoder"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
softplus_bounded_positive Ran
ran; our contract draft was wrong, not the code
ut-austin-rpl/amago/amago/nets/policy_dists.py
code served (permissive licence) · get_code("9f588318c9339dd5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small input tensor with batch size 2 and dimension 4
x = torch.randn(2, 4)

# Define the parameters
low = 0.5
high = 10.0

# Construct the ARGS dictionary
ARGS = {
    "x": x,
    "low": low,
    "high": high
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tanh_bounded_positive Ran
ran; our contract draft was wrong, not the code
ut-austin-rpl/amago/amago/nets/policy_dists.py
code served (permissive licence) · get_code("679514cf7e0c892c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# Create a small tensor to pass as x
# Shape: (2, 4) - batch size 2, feature dimension 4
x = torch.randn(2, 4)

# Define low and high bounds for the mapping
low = 0.1
high = 10.0

ARGS = {
    "x": x,
    "low": low,
    "high": high,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
RLData_pad_collate Not yet run
unverified (harvested, no recorded run)
ut-austin-rpl/amago/amago/loading.py
code served (permissive licence) · get_code("9069125b4b210054")
How it ran

no invocation recorded.

get_agent_cls Not yet run
unverified (harvested, no recorded run)
ut-austin-rpl/amago/amago/agent.py
code served (permissive licence) · get_code("ae3524026f11fa9f")
How it ran

no invocation recorded.

get_traj_encoder_cls Not yet run
unverified (harvested, no recorded run)
ut-austin-rpl/amago/amago/nets/traj_encoders.py
code served (permissive licence) · get_code("0f3f64d4db295213")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
add_cli 1 other paper
1 dated earlier
2310.09971 (2023-10)
AMAGO: SCALABLE IN-CONTEXT REINFORCEMENT LEARNING FOR ADAPTIVE AGENTS
get_agent_cls 1 other paper
1 dated earlier
2310.09971 (2023-10)
AMAGO: SCALABLE IN-CONTEXT REINFORCEMENT LEARNING FOR ADAPTIVE AGENTS
register_agent 1 other paper
1 dated earlier
2310.09971 (2023-10)
AMAGO: SCALABLE IN-CONTEXT REINFORCEMENT LEARNING FOR ADAPTIVE AGENTS

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Language models trained on diverse datasets unlock generalization by in-context learning. Reinforcement Learning (RL) policies can achieve a similar effect by meta-learning within the memory of a sequence model. However, meta-RL research primarily focuses on adapting to minor variations of a single task. It is difficult to scale towards more general behavior without confronting challenges in multi-task optimization, and few solutions are compatible with meta-RL's goal of learning from large training sets of unlabeled tasks. To address this challenge, we revisit the idea that multi-task RL is bottlenecked by imbalanced training losses created by uneven return scales across different tasks. We build upon recent advancements in Transformer-based (in-context) meta-RL and evaluate a simple yet scalable solution where both an agent's actor and critic objectives are converted to classification terms that decouple optimization from the current scale of returns. Large-scale comparisons in Meta-World ML45, Multi-Game Procgen, Multi-Task POPGym, Multi-Game Atari, and BabyAI find that this design unlocks significant progress in online multi-task adaptation and memory problems without explicit task labels.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2411.11188")
get_code_for_paper("2411.11188")
have("2411.11188")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2411.11188.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2411.11188.svg)](https://syntology.ai/paper/2411.11188)

Connect an agent — have() is free.