SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_25934 · AAAI · 2023

DiFA: Differentiable Feature Acquisition

Aritra Ghosh, Andrew Lan

Open in the Atlas

Code that ran

8 of 12 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; 1 failure of our instrument; 4 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/aaai_25934.json · badge: /api/ran/aaai_25934.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
arghosh/DiFA canonical (classifier label)
classifier basis: census
8 ran · 4 no recorded run
FunctionStatusWhere it lives
compute_batch_loss Ran
ran on a synthesized input
arghosh/DiFA/src/models/model_utils.py
code served (permissive licence) · get_code("20c67a6213c70000")
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 1, dtype family float, shape (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 torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal model that has:
# - model.metric (string attribute)
# - model.params.weight (tensor for CrossEntropyLoss weight)
class MinimalParams:
    def __init__(self):
        self.weight = torch.tensor([0.5, 1.5, 2.0, 1.0])

class MinimalModel(nn.Module):
    def __init__(self, metric='accuracy'):
        super().__init__()
        self.metric = metric
        self.params = MinimalParams()

# Construct the arguments
# Batch size: 2, output dim: 4 (for CrossEntropyLoss)
model_accuracy = MinimalModel(metric='accuracy')
batch_size = 2
num_classes = 4

# For accuracy/f1_score path: output is logits (batch_size, num_classes)
# batch is (batch_size, features_with_label_at_end)
output = torch.randn(batch_size, num_classes)
batch = torch.randn(batch_size, 5)  # 5 features, last column is label
batch[:, -1] = torch.tensor([0.0, 2.0])  # Valid class indices

ARGS = {
    'model': model_accuracy,
    'output': output,
    'batch': batch
}
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 1, dtype family float, shape (2,) — shape (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
compute_loss Ran
ran on a synthesized input
arghosh/DiFA/src/models/model_utils.py
code served (permissive licence) · get_code("d05db34e86f0a4d7")
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 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 torch.nn as nn

torch.manual_seed(0)

# Create a simple model class that satisfies the function's usage
class SimpleModel(nn.Module):
    def __init__(self, metric, weight):
        super().__init__()
        self.metric = metric
        self.params = type('Params', (), {'weight': weight})()
    
    def forward(self, x):
        return x

# Test case 1: Classification task (accuracy)
model_classification = SimpleModel(
    metric='accuracy',
    weight=torch.tensor([1.0, 2.0, 3.0])
)

# Output for classification: shape (batch_size, num_classes)
output_classification = torch.randn(2, 3)

# Batch: shape (batch_size, features+1) where last column is label
batch_classification = torch.cat([
    torch.randn(2, 4),
    torch.tensor([[0], [2]], dtype=torch.float32)
], dim=1)

ARGS = {
    'model': model_classification,
    'output': output_classification,
    'batch': batch_classification
}
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 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
conv_block Ran
ran; our contract draft was wrong, not the code
arghosh/DiFA/src/models/layers.py
pointer only (licence: MIT); the stored copy get_code serves, from alviur/pocon_wacv2024, is pointer only (licence: NONE) · get_code("e2a5fdc0a059abac")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from alviur/pocon_wacv2024, and GitHub detected no licence in that repository when it was checked. 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.

gen_cube Ran
ran on a synthesized input
arghosh/DiFA/src/models/data_utils.py
code served (permissive licence) · get_code("8ac6005fad47c1d5")
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 3, dtype family float; 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 numpy as np

ARGS = {
    'n_features': 15,
    'data_points': 100,
    'sigma': 0.1,
    'seed': 123
}
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 tuple, ndim 3, dtype family float — 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
hard_gumbel_sample Ran
ran on a synthesized input
arghosh/DiFA/src/models/actor_critic.py
code served (permissive licence) · get_code("a592686edd6235bf")
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. 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.functional as F

torch.manual_seed(0)

# Create a small logits tensor (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

# Create ARGS dictionary with all parameters
ARGS = {
    'logits': logits,
    'dim': -1,
    'tau': 1.0
}
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 tuple — a tuple output has no array shape of its own; none is 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
hard_sample Ran
ran on a synthesized input
arghosh/DiFA/src/models/actor_critic.py
code served (permissive licence) · get_code("062c9e60f64801eb")
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. 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.functional as F

torch.manual_seed(0)

# Create a small logits tensor (batch=2, num_classes=4)
logits = torch.randn(2, 4)

ARGS = {
    "logits": logits,
    "dim": -1
}
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 tuple — a tuple output has no array shape of its own; none is 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
normalize_features Ran
ran on a synthesized input
arghosh/DiFA/src/models/data_utils.py
code served (permissive licence) · get_code("7260787959e04dee")
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 (5, 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

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

# Create sample features array (5 samples, 4 features)
features = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.0, np.nan, 5.0, 6.0],
    [3.0, 4.0, np.nan, 8.0],
    [4.0, 6.0, 7.0, np.nan],
    [5.0, 8.0, 9.0, 10.0]
], dtype=np.float64)

# Specify which columns are real features (numeric features to normalize)
real_features = [0, 1, 2, 3]

ARGS = {
    "features": features,
    "real_features": real_features
}
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 (5, 4) — shape (5, 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
train_test_split Ran
ran on a synthesized input
arghosh/DiFA/src/models/data_utils.py
code served (permissive licence) · get_code("256a7b364b25e06a")
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. 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 numpy as np
import random

torch.manual_seed(0)

# The function expects:
# - X: indexable collection (supports indexing with lists)
# - y: indexable collection (supports indexing with lists)
# - test_size: float between 0 and 1
# - random_state: int for seeding

# Create simple numpy arrays that support fancy indexing
X = np.array([[1.0, 2.0, 3.0, 4.0],
              [5.0, 6.0, 7.0, 8.0],
              [9.0, 10.0, 11.0, 12.0],
              [13.0, 14.0, 15.0, 16.0]])

y = np.array([0, 1, 0, 1])

ARGS = {
    "X": X,
    "y": y,
    "test_size": 0.25,
    "random_state": 42
}
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 — a tuple output has no array shape of its own; none is 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
finetune_step Not yet run
unverified (harvested, no recorded run)
arghosh/DiFA/src/models/model_utils.py
code served (permissive licence) · get_code("8fc54350bb7bc641")
How it ran

no invocation recorded.

get_ac_network_cnn Not yet run
unverified (harvested, no recorded run)
arghosh/DiFA/src/models/network_utils.py
code served (permissive licence) · get_code("def0d914a9269bab")
How it ran

no invocation recorded.

get_pred_network Not yet run
unverified (harvested, no recorded run)
arghosh/DiFA/src/models/network_utils.py
code served (permissive licence) · get_code("039730efe7770d3b")
How it ran

no invocation recorded.

get_pred_network_cnn Not yet run
unverified (harvested, no recorded run)
arghosh/DiFA/src/models/network_utils.py
code served (permissive licence) · get_code("869565087fc4387a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 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 11 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
conv_block 2 other papers
1 dated earlier, 1 same year, order not determinable
2201.10055 (2022-01)
Identifying a Training-Set Attack's Target Using Renormalized Influence Estimation
2309.06086 (2023-09)
Plasticity-Optimized Complementary Networks for Unsupervised Continual Learning

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

Feature acquisition in predictive modeling is an important task in many practical applications. For example, in patient health prediction, we do not fully observe their personal features and need to dynamically select features to acquire. Our goal is to acquire a small subset of features that maximize prediction performance. Recently, some works reformulated feature acquisition as a Markov decision process and applied reinforcement learning (RL) algorithms, where the reward reflects both prediction performance and feature acquisition cost. However, RL algorithms only use zeroth-order information on the reward, which leads to slow empirical convergence, especially when there are many actions (number of features) to consider. For predictive modeling, it is possible to use firstorder information on the reward, i.e., gradients, since we are often given an already collected dataset. Therefore, we propose differentiable feature acquisition (DiFA), which uses a differentiable representation of the feature selection policy to enable gradients to flow from the prediction loss to the policy parameters. We conduct extensive experiments on various real-world datasets and show that DiFA significantly outperforms existing feature acquisition methods when the number of features is large.

For agents

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

get_harvested_code_for_paper("aaai_25934")
get_code_for_paper("aaai_25934")
have("aaai_25934")

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

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

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

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

Connect an agent — have() is free.