SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.03067 · 2023

Memory-Based Meta-Learning on Non-Stationary Distributions

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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/2302.03067.json · badge: /api/ran/2302.03067.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
deepmind/nonstationary_mbml canonical (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
FunctionStatusWhere it lives
broadcast_params_with_ones Ran
ran on a synthesized input
deepmind/nonstationary_mbml/experiments/distributions.py
code served (permissive licence) · get_code("9ef6aa69c3f44f19")
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 4, dtype family float, shape (2, 4, 1, 1) 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 numpy as np

torch.manual_seed(0)

# Create a small parameters tensor with shape (batch_size=2, parameter_size=4)
parameters = torch.randn(2, 4)

# Set num_dims_to_match to expand the tensor to have 4 dimensions total
# Current shape is (2, 4) which is 2 dims, so we need to add 2 more dims
num_dims_to_match = 4

ARGS = {
    "parameters": parameters,
    "num_dims_to_match": num_dims_to_match,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
chex, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 1, 1) — shape (2, 4, 1, 1) 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
compute_sliding_window_mask Ran
ran on a synthesized input
deepmind/nonstationary_mbml/models/transformer.py
code served (permissive licence) · get_code("1cb4ff823f79cdaf")
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 ArrayImpl, ndim 2, dtype family float, shape (5, 5) 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 jax.numpy as jnp

# Define arguments for compute_sliding_window_mask
ARGS = {
    "sequence_length": 5,
    "attention_window": 3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
chex, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (5, 5) — shape (5, 5) 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
make_cnn Ran
ran on a synthesized input
deepmind/nonstationary_mbml/models/basic.py
code served (permissive licence) · get_code("68e27970b95ab0f2")
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 jax
import jax.numpy as jnp
import haiku as hk

# Set a random seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

ARGS = {
    'channel_widths': [8, 16],
    'kernel_shape': (3, 3),
    'output_size': 5,
    'mlp_widths': [32, 16],
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
chex, haiku, jax — 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
make_mlp Ran
ran on a synthesized input
deepmind/nonstationary_mbml/models/basic.py
code served (permissive licence) · get_code("ee3072eb25987bed")
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 jax
import jax.numpy as jnp
import haiku as hk

# Set up JAX for reproducibility
jax.config.update("jax_platform_name", "cpu")

# Define arguments for make_mlp
hidden_layers_sizes = [8, 16, 32]
output_size = 5

ARGS = {
    "hidden_layers_sizes": hidden_layers_sizes,
    "output_size": output_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
haiku, jax — 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
make_rnn Ran
ran on a synthesized input
deepmind/nonstationary_mbml/models/basic.py
code served (permissive licence) · get_code("5db9086edd37b0e5")
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 jax
import jax.numpy as jnp
import haiku as hk

# Set seed for reproducibility
import jax.random as jrandom
key = jrandom.PRNGKey(0)

# Define ARGS dict with all parameters for make_rnn
ARGS = {
    "output_size": 8,
    "rnn_core": hk.LSTM,
    "return_all_outputs": False,
    "return_all_states": False,
    "input_window": 1,
    "rnn_kwargs": {
        "hidden_size": 16
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
haiku, jax — 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
relative_shift Ran
ran on a synthesized input
deepmind/nonstationary_mbml/models/positional_encodings.py
code served (permissive licence) · get_code("59b8b0486e25ba13")
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 ArrayImpl, ndim 4, dtype family float, shape (1, 1, 2, 3) 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 jax
import jax.numpy as jnp

# Set seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# For causal=False case: _rel_shift_inner
# logits shape: [T_q, T_v + T_q]
# attention_length: T_v
# Let's use T_q=2, T_v=3
T_q = 2
T_v = 3
total_len = T_q + T_v  # 5

logits_inner = jnp.arange(T_q * total_len, dtype=jnp.float32).reshape(T_q, total_len)
logits_inner = jnp.array([[-3., -2., -1., 0., 1.],
                           [-3., -2., -1., 0., 1.]], dtype=jnp.float32)

# For causal=True case: _rel_shift_causal
# logits shape: [T_q, T_v]
logits_causal = jnp.array([[-4., -3., -2., -1.],
                            [-4., -3., -2., -1.]], dtype=jnp.float32)

# Test both causal and non-causal
# The vmap in relative_shift applies vmap twice, so we need to add batch dimensions
# logits needs to be [batch1, batch2, T_q, T_v + T_q] for non-causal
# or [batch1, batch2, T_q, T_v] for causal

batch1 = 1
batch2 = 1

logits_for_non_causal = jnp.expand_dims(jnp.expand_dims(logits_inner, 0), 0)
logits_for_causal = jnp.expand_dims(jnp.expand_dims(logits_causal, 0), 0)

ARGS = {
    "logits": logits_for_non_causal,
    "attention_length": T_v,
    "causal": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 4, dtype family float, shape (1, 1, 2, 3) — shape (1, 1, 2, 3) 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
sinusoid_position_encoding Ran
ran on a synthesized input
deepmind/nonstationary_mbml/models/positional_encodings.py
code served (permissive licence) · get_code("565e280575548c15")
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 ndarray, ndim 2, dtype family float, shape (20, 16) 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 numpy as np

ARGS = {
    "sequence_length": 8,
    "hidden_size": 16,
    "memory_length": 4,
    "max_timescale": 10000.0,
    "min_timescale": 2.0,
    "clamp_length": 0,
    "causal": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (20, 16) — shape (20, 16) 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
compute_attention_with_relative_encodings Not yet run
unverified (harvested, no recorded run)
deepmind/nonstationary_mbml/models/positional_encodings.py
code served (permissive licence) · get_code("a9386608a261c842")
How it ran

no invocation recorded.

layer_norm Not yet run
unverified (harvested, no recorded run)
deepmind/nonstationary_mbml/models/transformer.py
code served (permissive licence) · get_code("5d83309868b4e1a6")
How it ran

no invocation recorded.

split_params Not yet run
unverified (harvested, no recorded run)
deepmind/nonstationary_mbml/experiments/distributions.py
code served (permissive licence) · get_code("4f8a3c3645fbb810")
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
layer_norm 2 other papers
2 dated earlier
2205.05055 (2022-05)
Data Distributional Properties Drive Emergent In-Context Learning in Transformers
2207.02098 (2022-07)
Neural Networks and the Chomsky Hierarchy
compute_sliding_window_mask 1 other paper
1 dated earlier
2207.02098 (2022-07)
Neural Networks and the Chomsky Hierarchy
sinusoid_position_encoding 1 other paper
1 dated earlier
2207.02098 (2022-07)
Neural Networks and the Chomsky Hierarchy

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-22.

Repositories linked to this paper

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

Abstract

Memory-based meta-learning is a technique for approximating Bayes-optimal predictors. Under fairly general conditions, minimizing sequential prediction error, measured by the log loss, leads to implicit meta-learning. The goal of this work is to investigate how far this interpretation can be realized by current sequence prediction models and training regimes. The focus is on piecewise stationary sources with unobserved switching-points, which arguably capture an important characteristic of natural language and action-observation sequences in partially observable environments. We show that various types of memory-based neural models, including Transformers, LSTMs, and RNNs can learn to accurately approximate known Bayes-optimal algorithms and behave as if performing Bayesian inference over the latent switching-points and the latent parameters governing the data distribution within each segment.

For agents

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

get_harvested_code_for_paper("2302.03067")
get_code_for_paper("2302.03067")
have("2302.03067")

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

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

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

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

Connect an agent — have() is free.