SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.17411 · NeurIPS · 2025

Enhancing Interpretability in Deep Reinforcement Learning through Semantic Clustering

Liang Zhang, Justin Lieffers, Adarsh Pyarelal

arXiv · PDF · Open in the Atlas

Code that ran

9 of 17 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 6 have no contract verdict; 2 failures of our instrument; 8 no recorded run), measured 2026-11-22; 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/2409.17411.json · badge: /api/ran/2409.17411.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
ualiangzhang/semantic_rl community
Papers with Code archive
9 ran · 8 no recorded run
FunctionStatusWhere it lives
BernoulliPd Ran
ran on a synthesized input · constructed an object; no result was computed
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("48deda091b590818")
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 an instance of its own class, BernoulliPd: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Set random seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create a small logits tensor with shape (2, 4)
# batch size = 2, feature dimension = 4
logits = tf.constant([
    [0.5, -0.3, 0.2, -0.1],
    [-0.2, 0.4, -0.5, 0.1]
], dtype=tf.float32)

ARGS = {
    'logits': logits
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BernoulliPd — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BernoulliPd 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
BernoulliPdType Ran
ran on a synthesized input · constructed an object; no result was computed
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("2d3c30ed29c2e7e3")
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 an instance of its own class, BernoulliPdType: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Set random seed for reproducibility
np.random.seed(0)
tf.compat.v1.set_random_seed(0)

# Create a BernoulliPdType instance
# The only parameter is 'size' which specifies the dimensionality of the Bernoulli distribution
bernoulli_size = 4

ARGS = {
    "size": bernoulli_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BernoulliPdType — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BernoulliPdType 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
CategoricalPd Ran
ran on a synthesized input · constructed an object; no result was computed
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("e9c69749d0d0f987")
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 an instance of its own class, CategoricalPd: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Set random seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create a small logits tensor for CategoricalPd
# Shape: (batch_size=2, num_classes=4)
logits = tf.constant([
    [1.0, 2.0, 0.5, 1.5],
    [0.2, 1.1, 2.3, 0.8]
], dtype=tf.float32)

ARGS = {
    "logits": logits
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CategoricalPd — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CategoricalPd 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
DiagGaussianPd Ran
ran on a synthesized input · constructed an object; no result was computed
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("879ce0b5e2572140")
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 an instance of its own class, DiagGaussianPd: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Create a small flat parameter tensor
# The DiagGaussianPd expects a flat tensor that will be split into mean and logstd
# Using shape [2, 8] - batch size 2, with 8 values (4 for mean, 4 for logstd)
flat_param = tf.constant([
    [0.1, 0.2, 0.3, 0.4, -0.5, -0.3, -0.1, 0.2],
    [0.05, 0.15, 0.25, 0.35, -0.4, -0.2, 0.0, 0.1]
], dtype=tf.float32)

ARGS = {
    'flat': flat_param
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DiagGaussianPd — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DiagGaussianPd 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
DiagGaussianPdType Ran
ran on a synthesized input · constructed an object; no result was computed
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("23f71541edfa1c7d")
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 an instance of its own class, DiagGaussianPdType: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Set random seeds for reproducibility
np.random.seed(0)
tf.compat.v1.set_random_seed(0)

# The DiagGaussianPdType class takes a single parameter: size
# This represents the dimensionality of the action space
size = 4

ARGS = {
    "size": size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DiagGaussianPdType — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DiagGaussianPdType 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
MultiCategoricalPd Ran
ran on a synthesized input · constructed an object; no result was computed
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("7e6302fe75e8ce5b")
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 an instance of its own class, MultiCategoricalPd: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Set random seed for reproducibility
np.random.seed(0)
tf.random.set_seed(0)

# Create small tensors for testing
batch_size = 2
num_categories_1 = 3
num_categories_2 = 4
num_categories_3 = 2

# nvec specifies the number of categories for each discrete action
nvec = np.array([num_categories_1, num_categories_2, num_categories_3], dtype=np.int32)

# flat is the concatenated logits tensor
# Shape: (batch_size, sum(nvec))
flat = tf.constant([
    [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
    [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1]
], dtype=tf.float32)

ARGS = {
    "nvec": nvec,
    "flat": flat,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MultiCategoricalPd — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiCategoricalPd 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
_check_shape Ran
ran, violated the contract we drafted
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("8e365d56648e8635")
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 bool, ndim 0, dtype family float, shape () 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 _check_shape takes two parameters: placeholder_shape and data_shape
# Both are expected to be sequences (lists or tuples) of integers representing shapes
# The function compares them after squeezing out dimensions of size 1

# Create two compatible shapes that differ by dimensions of size 1
placeholder_shape = [1, 4, 1, 3]  # Has dimensions of size 1 that can be squeezed
data_shape = [2, 4, 3]  # Same shape after squeezing, differs only in batch/1 dims

ARGS = {
    "placeholder_shape": placeholder_shape,
    "data_shape": data_shape
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
_squeeze_shape Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("bf4c4a4198b648b7")
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 list, 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

torch.manual_seed(0)

# _squeeze_shape takes a shape parameter and returns a list with all dimensions of size 1 removed
# shape should be a list or tuple of integers

shape = [1, 4, 1, 3, 1]

ARGS = {
    "shape": shape
}
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 list, ndim 1, dtype family int — a list 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
adjust_shape Ran
ran; our contract draft was wrong, not the code
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("42b26c636fbd04d3")
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 3, dtype family float, shape (2, 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 numpy as np

# Create a mock TensorFlow placeholder
class MockPlaceholder:
    def __init__(self, shape):
        self.shape = self
        self._shape = shape
    
    def as_list(self):
        return self._shape

# Create test data and placeholder
placeholder = MockPlaceholder([2, 4, 3])
data = np.random.randn(2, 4, 3).astype(np.float32)

ARGS = {
    "placeholder": placeholder,
    "data": data
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 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
CategoricalPdType Not yet run
unverified (harvested, no recorded run)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("bf5613ab09afe878")
How it ran

no invocation recorded.

MultiCategoricalPdType Not yet run
unverified (harvested, no recorded run)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("bd9b09139e3e25ac")
How it ran

no invocation recorded.

Pd Not yet run
unverified (harvested, no recorded run)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("f4660cce49b495df")
How it ran

no invocation recorded.

PdType Not yet run
unverified (harvested, no recorded run)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("8bf8ba4c04fac914")
How it ran

no invocation recorded.

PolicyWithValue Not yet run
unverified (harvested, no recorded run)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("deffac091561a023")
How it ran

no invocation recorded.

_matching_fc Not yet run
unverified (harvested, no recorded run)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("3a78065dfb9d4a00")
How it ran

no invocation recorded.

fc Not yet run
unverified (harvested, no recorded run)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("7b8dee118869a28b")
How it ran

no invocation recorded.

make_pdtype Not yet run
unverified (harvested, no recorded run)
ualiangzhang/semantic_rl/baselines/common/spolicies.py
code served (permissive licence) · get_code("014517e29fd80d71")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 16 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
make_pdtype
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2006.14154 (2020-06)
Strictly Batch Imitation Learning by Energy-based Distribution Matching

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

In this paper, we explore semantic clustering properties of deep reinforcement learning (DRL) to improve its interpretability and deepen our understanding of its internal semantic organization. In this context, semantic clustering refers to the ability of neural networks to cluster inputs based on their semantic similarity in the feature space. We propose a DRL architecture that incorporates a novel semantic clustering module that combines feature dimensionality reduction with online clustering. This module integrates seamlessly into the DRL training pipeline, addressing the instability of t-SNE and eliminating the need for extensive manual annotation inherent to prior semantic analysis methods. We experimentally validate the effectiveness of the proposed module and demonstrate its ability to reveal semantic clustering properties within DRL. Furthermore, we introduce new analytical methods based on these properties to provide insights into the hierarchical structure of policies and semantic organization within the feature space. Our code is available at https://github.com/ualiangzhang/semantic_rl. 39th Conference on Neural Information Processing Systems (NeurIPS 2025).

For agents

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

get_harvested_code_for_paper("2409.17411")
get_code_for_paper("2409.17411")
have("2409.17411")

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

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

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

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

Connect an agent — have() is free.