SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.06564 · NeurIPS · 2022

Robust Neural Posterior Estimation and Statistical Model Criticism

Sebastian Schmon, Patrick Cannon, Mark Beaumont, Daniel Ward, Matteo Fasiolo

arXiv · PDF · Open in the Atlas

Code that ran

9 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 9 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2210.06564.json · badge: /api/ran/2210.06564.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
danielward27/flowjax canonical (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
FunctionStatusWhere it lives
arraylike_to_array Ran
ran on a synthesized input
danielward27/flowjax/flowjax/utils.py
code served (permissive licence) · get_code("bc7da1b56f0084fe")
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 1, dtype family float, shape (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 numpy as np
import jax.numpy as jnp

ARGS = {
    'arr': np.array([1.0, 2.0, 3.0, 4.0]),
    'err_name': 'test_input',
    'dtype': jnp.float32,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
equinox, jax, jaxtyping, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 1, dtype family float, shape (4,) — shape (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
block_diag_mask Ran
ran on a synthesized input
danielward27/flowjax/flowjax/masks.py
code served (permissive licence) · get_code("ca34b754581d6b60")
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 (6, 6) 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

ARGS = {
    "block_shape": (3, 3),
    "n_blocks": 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, jaxtyping — 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 (6, 6) — shape (6, 6) 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
block_tril_mask Ran
ran on a synthesized input
danielward27/flowjax/flowjax/masks.py
code served (permissive licence) · get_code("c313bf672bf53b58")
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 (12, 12) 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

ARGS = {
    "block_shape": (3, 3),
    "n_blocks": 4,
    "k": 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, jaxtyping — 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 (12, 12) — shape (12, 12) 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
logmatmulexp Ran
ran on a synthesized input
danielward27/flowjax/flowjax/bijections/block_autoregressive_network.py
code served (permissive licence) · get_code("efa300dd757575bc")
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 3, dtype family float, shape (2, 4, 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
import jax.numpy as jnp

# Set seed for reproducibility
jax.config.update('jax_default_prng_impl', 'threefry2x32')

# Create small test matrices for x and y
# x and y should be numeric arrays suitable for matrix multiplication
# x will be (batch, m, n) and y will be (batch, n, p) or similar
# The function does matmul(exp(x - x_shift), exp(y - y_shift))
# So we need compatible dimensions

# Create x: shape (2, 4, 3) - batch of 2, 4x3 matrices
x = jnp.array([
    [[1.0, 2.0, 3.0],
     [0.5, 1.5, 2.5],
     [0.1, 0.2, 0.3],
     [2.0, 2.5, 3.0]],
    [[0.8, 1.2, 1.5],
     [0.3, 0.7, 1.0],
     [0.2, 0.4, 0.6],
     [1.5, 2.0, 2.5]]
])

# Create y: shape (2, 3, 5) - batch of 2, 3x5 matrices
# This allows matmul(x, y) to produce (2, 4, 5)
y = jnp.array([
    [[0.5, 1.0, 1.5, 2.0, 2.5],
     [0.3, 0.6, 0.9, 1.2, 1.5],
     [0.1, 0.2, 0.3, 0.4, 0.5]],
    [[0.4, 0.8, 1.2, 1.6, 2.0],
     [0.2, 0.4, 0.6, 0.8, 1.0],
     [0.1, 0.2, 0.3, 0.4, 0.5]]
])

ARGS = {
    "x": x,
    "y": y,
}
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 3, dtype family float, shape (2, 4, 5) — shape (2, 4, 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
max_steps_while_loop Ran
ran on a synthesized input
danielward27/flowjax/flowjax/root_finding.py
code served (permissive licence) · get_code("cff21ac0e654efbe")
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 WhileResult. 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.numpy as jnp
import equinox as eqx
from collections.abc import Callable
from typing import Any

# Define a simple state class for testing
class SimpleState(eqx.Module):
    value: Any
    counter: Any

# Define condition function - returns True while counter < 5
def cond_fun(state):
    return state.counter < 5

# Define body function - increments counter and updates value
def body_fun(state):
    return SimpleState(
        value=state.value + 1.0,
        counter=state.counter + 1
    )

# Initialize state
init_val = SimpleState(
    value=jnp.array(0.0),
    counter=jnp.array(0)
)

# Define ARGS dictionary with all parameters
ARGS = {
    'cond_fun': cond_fun,
    'body_fun': body_fun,
    'init_val': init_val,
    'max_steps': 10,
    'throw': False,
    'error_context': ' (test context)'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
equinox, jax, jaxtyping — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type WhileResult — a WhileResult output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a WhileResult 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
merge_cond_shapes Ran
ran on a synthesized input
danielward27/flowjax/flowjax/utils.py
code served (permissive licence) · get_code("4f28e523944baf36")
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 torch
import numpy as np
from collections.abc import Sequence

torch.manual_seed(0)

# Test case 1: All None shapes
shapes_all_none = (None, None, None)

# Test case 2: All matching shapes
shapes_matching = ((2, 3, 4), (2, 3, 4), (2, 3, 4))

# Test case 3: Some None, some matching shapes
shapes_mixed = (None, (5, 6), (5, 6), None)

# Use the mixed case as the main test
ARGS = {
    "shapes": shapes_mixed
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
rank_based_mask Ran
ran on a synthesized input
danielward27/flowjax/flowjax/masks.py
code served (permissive licence) · get_code("3022a15994813faa")
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 (4, 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 torch
import numpy as np

torch.manual_seed(0)

# The function expects:
# - in_ranks: 1D integer array of shape (a,)
# - out_ranks: 1D integer array of shape (b,)
# - eq: boolean flag (optional, defaults to False)
# Returns: Boolean array of shape (b, a)

ARGS = {
    'in_ranks': torch.tensor([1, 3, 2], dtype=torch.int64),
    'out_ranks': torch.tensor([2, 4, 1, 5], dtype=torch.int64),
    'eq': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, 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 2, dtype family float, shape (4, 3) — shape (4, 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
root_finder_to_inverter Ran
ran on a synthesized input
danielward27/flowjax/flowjax/root_finding.py
code served (permissive licence) · get_code("9036420ab972300b")
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 _JitWrapper. 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 jax
import jax.numpy as jnp
import equinox as eqx
from functools import partial

torch.manual_seed(0)

# Create a simple bijection mock that has a transform method
class SimpleBijection(eqx.Module):
    weight: jnp.ndarray
    
    def __init__(self, input_dim=4, output_dim=3):
        self.weight = jnp.ones((output_dim, input_dim))
    
    def transform(self, x, condition=None):
        # Simple linear transformation
        return jnp.dot(self.weight, x)

# Create a simple root finder that takes a function and returns (root, aux_info)
def simple_root_finder(fn, initial_guess=None):
    """
    A minimal root finder that returns a root and auxiliary information.
    Takes a function fn and returns (root_array, aux_dict).
    """
    if initial_guess is None:
        initial_guess = jnp.array([0.1, 0.2, 0.3, 0.4])
    
    # Simple mock: just return the initial guess and some aux info
    root = initial_guess
    aux_info = {"converged": True, "iterations": 1}
    return root, aux_info

# Create the root_finder callable that will be passed to root_finder_to_inverter
# It should be a function that takes a single argument (the function to invert)
root_finder = simple_root_finder

ARGS = {
    "root_finder": root_finder
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
equinox, jax, jaxtyping, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _JitWrapper — a _JitWrapper output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _JitWrapper 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
two_moons Ran
ran on a synthesized input
danielward27/flowjax/flowjax/tasks.py
code served (permissive licence) · get_code("f54515af38e6b7d9")
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 (2, 2) 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
import jax.random as jr

# Create a PRNG key for JAX
key = jr.PRNGKey(0)

# Define arguments for two_moons function
ARGS = {
    "key": key,
    "n_samples": 2,
    "noise_std": 0.2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, jaxtyping — 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 (2, 2) — shape (2, 2) 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
get_ravelled_pytree_constructor Not yet run
unverified (harvested, no recorded run)
danielward27/flowjax/flowjax/utils.py
code served (permissive licence) · get_code("247bf759a4548654")
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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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

Computer simulations have proven a valuable tool for understanding complex phenomena across the sciences. However, the utility of simulators for modelling and forecasting purposes is often restricted by low data quality, as well as practical limits to model fidelity. In order to circumvent these difficulties, we argue that modellers must treat simulators as idealistic representations of the true data generating process, and consequently should thoughtfully consider the risk of model misspecification. In this work we revisit neural posterior estimation (NPE), a class of algorithms that enable black-box parameter inference in simulation models, and consider the implication of a simulation-to-reality gap. While recent works have demonstrated reliable performance of these methods, the analyses have been performed using synthetic data generated by the simulator model itself, and have therefore only addressed the well-specified case. In this paper, we find that the presence of misspecification, in contrast, leads to unreliable inference when NPE is used naïvely. As a remedy we argue that principled scientific inquiry with simulators should incorporate a model criticism component, to facilitate interpretable identification of misspecification and a robust inference component, to fit 'wrong but useful' models. We propose robust neural posterior estimation (RNPE), an extension of NPE to simultaneously achieve both these aims, through explicitly modelling the discrepancies between simulations and the observed data. We assess the approach on a range of artificially misspecified examples, and find RNPE performs well across the tasks, whereas naïvely using NPE leads to misleading and erratic posteriors. 36th Conference on Neural Information Processing Systems (NeurIPS 2022).

For agents

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

get_harvested_code_for_paper("2210.06564")
get_code_for_paper("2210.06564")
have("2210.06564")

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

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

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

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

Connect an agent — have() is free.