SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.13872 · ICLR · 2025

BLEND: Behavior-guided Neural Population Dynamics Modeling via Privileged Knowledge Distillation

Wei Wu, Hao Chen, Zhengrui Guo, Fangxu Zhou, Qichen Sun, Lishuang Feng, Jinzhuo Wang

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 4 have no contract verdict; 0 failures of our instrument; 1 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/2410.13872.json · badge: /api/ran/2410.13872.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
dddavid4real/BLEND marked official in Papers with Code
Papers with Code archive
5 ran · 1 no recorded run
FunctionStatusWhere it lives
PositionalEncoding Ran
ran on a synthesized input · constructed an object; no result was computed
dddavid4real/BLEND/src/model.py
code served (permissive licence) · get_code("a58c325e7ceeff07")
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, PositionalEncoding: 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 torch
import torch.nn as nn
import math

torch.manual_seed(0)

# Create a minimal config class with required attributes
class Config:
    def __init__(self):
        self.DROPOUT_EMBEDDING = 0.1
        self.LEARNABLE_POSITION = False
        self.POSITION = type('obj', (object,), {'OFFSET': False})()

cfg = Config()
trial_length = 8
d_model = 4
device = 'cpu'

ARGS = {
    'cfg': cfg,
    'trial_length': trial_length,
    'd_model': d_model,
    'device': device
}
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 PositionalEncoding — 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 PositionalEncoding 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
ScaleNorm Ran
ran on a synthesized input · constructed an object; no result was computed
dddavid4real/BLEND/src/model.py
code served (permissive licence) · get_code("c6e50336678bd3b9")
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, ScaleNorm: 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 torch
import torch.nn as nn

torch.manual_seed(0)

# ScaleNorm is a simple normalization layer that:
# - Takes a scale parameter in __init__
# - Takes an eps parameter (default 1e-05)
# - In forward, computes norm along last dimension and scales x by scale/norm

# For forward pass, we need to pass a tensor x
# The forward method uses: torch.norm(x, dim=-1, keepdim=True).clamp(min=self.eps)
# and returns x * norm

# Create a small input tensor (batch=2, dim=4)
x = torch.randn(2, 4)

# Create ScaleNorm instance with reasonable parameters
scale = 1.0
eps = 1e-05

ARGS = {
    "scale": scale,
    "eps": eps,
}
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 ScaleNorm — 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 ScaleNorm 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
TransformerEncoderLayerWithHooks Ran
ran on a synthesized input · constructed an object; no result was computed
dddavid4real/BLEND/src/model.py
code served (permissive licence) · get_code("399ce0c84ef92e6e")
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, TransformerEncoderLayerWithHooks: 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 torch
import torch.nn as nn

torch.manual_seed(0)

class Config:
    def __init__(self):
        self.NUM_HEADS = 2
        self.HIDDEN_SIZE = 8
        self.DROPOUT = 0.1
        self.ACTIVATION = 'relu'
        self.FIXUP_INIT = False
        self.NUM_LAYERS = 4
        self.PRE_NORM = True

config = Config()
d_model = 4
device = None

ARGS = {
    'config': config,
    'd_model': d_model,
    'device': device,
}
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 TransformerEncoderLayerWithHooks — 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 TransformerEncoderLayerWithHooks 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
TransformerEncoderWithHooks Ran
ran on a synthesized input · constructed an object; no result was computed
dddavid4real/BLEND/src/model.py
code served (permissive licence) · get_code("af5d8da6f90d2ea3")
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, TransformerEncoderWithHooks: 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 torch
import torch.nn as nn
from torch.nn import TransformerEncoderLayer

torch.manual_seed(0)

# Stand-in config class with required attributes
class Config:
    def __init__(self):
        self.NUM_LAYERS = 2
        self.d_model = 4
        self.nhead = 2
        self.dim_feedforward = 8
        self.dropout = 0.1

# Custom encoder layer that matches the expected interface
class CustomEncoderLayer(TransformerEncoderLayer):
    def __init__(self, d_model, nhead, dim_feedforward, dropout=0.1):
        super().__init__(d_model, nhead, dim_feedforward, dropout, batch_first=False)
        self.config = None
    
    def update_config(self, config):
        self.config = config
    
    def forward(self, src, src_mask=None, **kwargs):
        # Return src, weights, and layer_cost as expected by TransformerEncoderWithHooks
        output = super().forward(src, src_mask=src_mask)
        weights = torch.randn(2, 4, 4)  # dummy weights
        layer_cost = torch.tensor(0.5)  # dummy cost
        return output, weights, layer_cost

# Create config
config = Config()

# Create encoder layer
encoder_layer = CustomEncoderLayer(
    d_model=config.d_model,
    nhead=config.nhead,
    dim_feedforward=config.dim_feedforward,
    dropout=config.dropout
)

# Create normalization layer
norm = nn.LayerNorm(config.d_model)

# Device
device = 'cpu'

# Number of layers (though this is overridden by config.NUM_LAYERS)
num_layers = config.NUM_LAYERS

ARGS = {
    'encoder_layer': encoder_layer,
    'norm': norm,
    'config': config,
    'num_layers': num_layers,
    'device': device
}
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 TransformerEncoderWithHooks — 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 TransformerEncoderWithHooks 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
binary_mask_to_attn_mask Ran
ran, violated the contract we drafted
dddavid4real/BLEND/src/model.py
code served (permissive licence) · get_code("534905c1bdb93a5e")
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

torch.manual_seed(0)

# The function takes a binary mask tensor and converts it to an attention mask
# by replacing 0s with -inf and 1s with 0.0
# We need to create a binary mask tensor with shape that shows the operation clearly

x = torch.tensor([
    [1, 0, 1, 0],
    [0, 1, 0, 1]
], dtype=torch.long)

ARGS = {
    "x": x
}
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
NeuralDataTransformerTeacher Not yet run
unverified (harvested, no recorded run)
dddavid4real/BLEND/src/model.py
code served (permissive licence) · get_code("63e23d37f1f070dd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 5 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
binary_mask_to_attn_mask
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2108.01210 (2021-08)
Representation learning for neural population activity with Neural Data Transformers

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

Modeling the nonlinear dynamics of neuronal populations represents a key pursuit in computational neuroscience. Recent research has increasingly focused on jointly modeling neural activity and behavior to unravel their interconnections. Despite significant efforts, these approaches often necessitate either intricate model designs or oversimplified assumptions. Given the frequent absence of perfectly paired neural-behavioral datasets in real-world scenarios when deploying these models, a critical yet understudied research question emerges: how to develop a model that performs well using only neural activity as input at inference, while benefiting from the insights gained from behavioral signals during training? To this end, we propose BLEND, the Behavior-guided neuraL population dynamics modElling framework via privileged kNowledge Distillation. By considering behavior as privileged information, we train a teacher model that takes both behavior observations (privileged features) and neural activities (regular features) as inputs. A student model is then distilled using only neural activity. Unlike existing methods, our framework is model-agnostic and avoids making strong assumptions about the relationship between behavior and neural activity. This allows BLEND to enhance existing neural dynamics modeling architectures without developing specialized models from scratch. Extensive experiments across neural population activity modeling and transcriptomic neuron identity prediction tasks demonstrate strong capabilities of BLEND, reporting over 50% improvement in behavioral decoding and over 15% improvement in transcriptomic neuron identity prediction after behavior-guided distillation. Furthermore, we empirically explore various behavior-guided distillation strategies within the BLEND framework and present a comprehensive analysis of effectiveness and implications for model performance. Code will be made available at https://github.com/dddavid4real/BLEND.

For agents

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

get_harvested_code_for_paper("2410.13872")
get_code_for_paper("2410.13872")
have("2410.13872")

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

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

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

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

Connect an agent — have() is free.