SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.13147 · NeurIPS · 2024

SPRINQL: Sub-optimal Demonstrations driven Offline Imitation Learning

Pradeep Varakantham, Huy Hoang, Tien Mai

arXiv · PDF · Open in the Atlas

Code that ran

2 of 3 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 0 have no contract verdict; 2 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/2402.13147.json · badge: /api/ran/2402.13147.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
hmhuy0/sprinql canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
hmhuy0/SPRINQL marked official in Papers with Code
Papers with Code archive
1 ran · 1 no recorded run
FunctionStatusWhere it lives
update Ran
ran; our contract draft was wrong, not the code
hmhuy0/SPRINQL/Sources/algos/sprinql.py
code served (permissive licence) · get_code("ac2a3a2383d7e234")
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) and returned dict. 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)

# Define minimal networks
class CriticNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 1)
    
    def forward(self, x):
        return self.fc(x)

class ActorNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.fc(x)

# Define minimal buffer class
class Buffer:
    def __init__(self, device='cpu'):
        self.device = device
    
    def get_samples(self, batch_size, device):
        # Returns a batch: (observations, actions, rewards, next_obs, dones)
        obs = torch.randn(batch_size, 4)
        actions = torch.randn(batch_size, 2)
        rewards = torch.randn(batch_size, 1)
        next_obs = torch.randn(batch_size, 4)
        dones = torch.randn(batch_size, 1)
        return (obs, actions, rewards, next_obs, dones)

# Define minimal agent class with required methods and attributes
class Agent:
    def __init__(self):
        self.batch_size = 2
        self.device = 'cpu'
        self.critic_net = CriticNet()
        self.critic_target_net = CriticNet()
        self.actor_net = ActorNet()
        self.critic_tau = 0.005
        self.first_log = True
    
    def update_critic(self, add_batches, step):
        # Returns a dict with update info
        return {'critic_loss': 0.5}
    
    def update_actor(self, obs, step):
        # Returns a dict with actor loss info
        return {'actor_loss': 0.3}

# Create instances
agent = Agent()
buffers = [Buffer(device='cpu'), Buffer(device='cpu')]
step = 0

# Define ARGS
ARGS = {
    'self': agent,
    'buffers': buffers,
    'step': step
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
update_actor Ran
ran; our contract draft was wrong, not the code
hmhuy0/sprinql/Sources/algos/sprinql.py
code served (permissive licence) · get_code("a3f7499d4a8e409e")
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) and returned dict. 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 torch.optim as optim

torch.manual_seed(0)

# Define minimal actor network
class Actor(nn.Module):
    def __init__(self, obs_dim, action_dim):
        super().__init__()
        self.fc = nn.Linear(obs_dim, action_dim)
    
    def sample(self, obs):
        mean = self.fc(obs)
        log_prob = torch.randn(obs.shape[0], 1)
        return mean, log_prob, None
    
    def get_log_prob(self, obs, action):
        return torch.randn(obs.shape[0], 1)

# Define minimal critic network
class Critic(nn.Module):
    def __init__(self, obs_dim, action_dim):
        super().__init__()
        self.fc = nn.Linear(obs_dim + action_dim, 1)
    
    def forward(self, obs, action):
        x = torch.cat([obs, action], dim=-1)
        return self.fc(x)

# Define minimal args config
class Args:
    def __init__(self):
        self.train = type('obj', (object,), {'KL_start': 100})()

# Define minimal self object
class Agent:
    def __init__(self):
        self.actor = Actor(obs_dim=4, action_dim=3)
        self.critic = Critic(obs_dim=4, action_dim=3)
        self.temp_actor = Actor(obs_dim=4, action_dim=3)
        self.alpha = torch.tensor(0.2)
        self.args = Args()
        self.actor_optimizer = optim.Adam(self.actor.parameters(), lr=0.001)

# Create instances
agent = Agent()
obs = torch.randn(2, 4)
step = 50

ARGS = {
    'self': agent,
    'obs': obs,
    'step': step
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
soft_update Not yet run
unverified (harvested, no recorded run)
hmhuy0/SPRINQL/Sources/algos/sprinql.py
code served (permissive licence) · get_code("168373daffe72add")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 2 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
soft_update
brick of this paper's assembly: helper
1 other paper
1 later
2411.00610 (2024-11)
Provably and Practically Efficient Adversarial Imitation Learning with General Function Approximation

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

We focus on offline imitation learning (IL), which aims to mimic an expert's behavior using demonstrations without any interaction with the environment. One of the main challenges in offline IL is the limited support of expert demonstrations, which typically cover only a small fraction of the state-action space. While it may not be feasible to obtain numerous expert demonstrations, it is often possible to gather a larger set of sub-optimal demonstrations. For example, in treatment optimization problems, there are varying levels of doctor treatments available for different chronic conditions. These range from treatment specialists and experienced general practitioners to less experienced general practitioners. Similarly, when robots are trained to imitate humans in routine tasks, they might learn from individuals with different levels of expertise and efficiency. In this paper, we propose an offline IL approach that leverages the larger set of sub-optimal demonstrations while effectively mimicking expert trajectories. Existing offline IL methods based on behavior cloning or distribution matching often face issues such as overfitting to the limited set of expert demonstrations or inadvertently imitating sub-optimal trajectories from the larger dataset. Our approach, which is based on inverse soft-Q learning, learns from both expert and sub-optimal demonstrations. It assigns higher importance (through learned weights) to aligning with expert demonstrations and lower importance to aligning with sub-optimal ones. A key contribution of our approach, called SPRINQL, is transforming the offline IL problem into a convex optimization over the space of Q functions. Through comprehensive experimental evaluations, we demonstrate that the SPRINQL algorithm achieves state-of-the-art (SOTA) performance on offline IL benchmarks. Code is available at https://github.com/hmhuy0/SPRINQL.

For agents

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

get_harvested_code_for_paper("2402.13147")
get_code_for_paper("2402.13147")
have("2402.13147")

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

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

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

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

Connect an agent — have() is free.