SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.13110 · NeurIPS · 2022

Optimal-er Auctions through Attention

Dmitry Ivanov, Iskander Safiulin, Igor Filippov, Ksenia Balabaeva

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2202.13110.json · badge: /api/ran/2202.13110.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
dimonenka/optimaler canonical (classifier label)
classifier basis: classifier_2025
7 ran · 1 no recorded run
FunctionStatusWhere it lives
AdditiveNet Ran
ran on a synthesized input · constructed an object; no result was computed
dimonenka/optimaler/core/nets/additive_net_attention.py
code served (permissive licence) · get_code("16d5893cc18a4c29")
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, AdditiveNet: 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 types import SimpleNamespace

torch.manual_seed(0)

# Create a minimal config object with all required attributes
model_config = SimpleNamespace(
    net=SimpleNamespace(
        init='gu',
        activation='relu',
        num_a_layers=3,
        num_p_layers=3,
        num_a_hidden_units=8,
        num_p_hidden_units=6,
        layer_norm=True
    ),
    num_agents=2,
    num_items=4
)

device = 'cpu'

ARGS = {
    'model_config': model_config,
    '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 AdditiveNet — 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 AdditiveNet 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
AttentionHead Ran
ran on a synthesized input · constructed an object; no result was computed
dimonenka/optimaler/core/nets/additive_net_attention.py
code served (permissive licence) · get_code("6c3b3e5a39c1e437")
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, AttentionHead: 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)

# The AttentionHead.__init__ takes one parameter: hid (hidden dimension)
# Looking at the forward method:
# - layer_norm operates on x with hid dimension
# - encoder_agent and encoder_item are Linear(hid, hid)
# - fc_payment is Linear(hid, 1)
# - temperature is hid ** 0.5
# The forward expects x with shape (batch, items, hid) based on:
#   - mean(2) suggests 3D tensor
#   - mean(1) suggests 3D tensor
#   - matmul between (batch, agents, hid) and (batch, hid, items)

hid = 4

ARGS = {
    'hid': hid
}
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 AttentionHead — 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 AttentionHead 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
Exchangeable Ran
ran on a synthesized input · constructed an object; no result was computed
dimonenka/optimaler/core/nets/additive_net_attention.py
code served (permissive licence) · get_code("61c156bc27fe3367")
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, Exchangeable: 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    "in_channels": 4,
    "out_channels": 3,
    "row": True,
    "col": True,
    "mat": True,
    "add_channel_dim": False,
    "sum_layers": True,
}
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 Exchangeable — 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 Exchangeable 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
MHAttentionBody Ran
ran on a synthesized input · constructed an object; no result was computed
dimonenka/optimaler/core/nets/additive_net_attention.py
code served (permissive licence) · get_code("970bd62b992448ea")
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, MHAttentionBody: 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)

# Define ScaledDotProductAttention first since it's used by MultiHeadAttention
class ScaledDotProductAttention(nn.Module):
    """Scaled Dot-Product Attention"""

    def __init__(self, temperature):
        super().__init__()
        self.temperature = temperature

    def forward(self, q, k, v, mask=None):
        import torch.nn.functional as F
        attn = torch.matmul(q / self.temperature, k.transpose(2, 3))
        if mask is not None:
            attn = attn.masked_fill(mask == 0, -1000000000.0)
        attn = F.softmax(attn, dim=-1)
        output = torch.matmul(attn, v)
        return (output, attn)

# Define MultiHeadAttention
class MultiHeadAttention(nn.Module):
    """Multi-Head Attention module"""

    def __init__(self, n_head, d_model, d_k):
        super().__init__()
        self.n_head = n_head
        self.d_k = d_k
        self.w_qs = nn.Linear(d_model, n_head * d_k, bias=False)
        self.w_ks = nn.Linear(d_model, n_head * d_k, bias=False)
        self.w_vs = nn.Linear(d_model, n_head * d_k, bias=False)
        self.fc = nn.Linear(n_head * d_k, d_model, bias=False)
        self.attention = ScaledDotProductAttention(temperature=d_k ** 0.5)
        self.layer_norm = nn.LayerNorm(d_model, eps=1e-06)

    def forward(self, x, mask=None):
        d_k, n_head = (self.d_k, self.n_head)
        sz_b, len_q = (x.size(0), x.size(1))
        residual = x
        x = self.layer_norm(x)
        q = self.w_qs(x).view(sz_b, len_q, n_head, d_k)
        k = self.w_ks(x).view(sz_b, len_q, n_head, d_k)
        v = self.w_vs(x).view(sz_b, len_q, n_head, d_k)
        q, k, v = (q.transpose(1, 2), k.transpose(1, 2), v.transpose(1, 2))
        if mask is not None:
            mask = mask.unsqueeze(1)
        q, attn = self.attention(q, k, v, mask=mask)
        q = q.transpose(1, 2).contiguous().view(sz_b, len_q, -1)
        q = self.fc(q)
        q += residual
        return (q, attn)

# Define MHAttentionBody
class MHAttentionBody(nn.Module):

    def __init__(self, n_head, hid, hid_att):
        super().__init__()
        self.attention_item = MultiHeadAttention(n_head, hid, hid_att)
        self.attention_agent = MultiHeadAttention(n_head, hid, hid_att)
        self.fc = nn.Linear(2 * hid, hid)

    def forward(self, x):
        import torch.nn.functional as F
        residual = x
        bs, na, ni, hid = x.shape
        x_item = x.reshape(-1, ni, hid)
        x_item, _ = self.attention_item(x_item)
        x_item = x_item.reshape(x.shape)
        x_agent = x.permute(0, 2, 1, 3).reshape(-1, na, hid)
        x_agent, _ = self.attention_agent(x_agent)
        x_agent = x_agent.reshape(bs, ni, na, hid).permute(0, 2, 1, 3)
        x = F.tanh(torch.cat([x_item, x_agent], dim=-1))
        x = self.fc(x) + residual
        return x

# Set up parameters for MHAttentionBody
n_head = 2
hid = 4
hid_att = 2

# Create input tensor with shape (batch_size, n_agents, n_items, hidden_dim)
# bs=2, na=3, ni=5, hid=4
x = torch.randn(2, 3, 5, 4)

ARGS = {
    "n_head": n_head,
    "hid": hid,
    "hid_att": hid_att,
}
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 MHAttentionBody — 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 MHAttentionBody 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
MultiHeadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
dimonenka/optimaler/core/nets/additive_net_attention.py
code served (permissive licence) · get_code("2a4cfe231bde233c")
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, MultiHeadAttention: 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)

ARGS = {
    "n_head": 2,
    "d_model": 4,
    "d_k": 2,
}
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 MultiHeadAttention — 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 MultiHeadAttention 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
PositionalEncoding Ran
ran on a synthesized input · constructed an object; no result was computed
dimonenka/optimaler/core/nets/additive_net_attention.py
code served (permissive licence) · get_code("3298160008ddb060")
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
from torch import nn
from math import log as mlog

torch.manual_seed(0)

# Construct arguments for PositionalEncoding
ARGS = {
    "max_len": 8,
    "d_model": 4,
    "item_wise": True,
}
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
ScaledDotProductAttention Ran
ran on a synthesized input
dimonenka/optimaler/core/nets/additive_net_attention.py
code served (permissive licence) · get_code("2f715bdea4c18c5f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn
from torch.nn import functional as F

class ScaledDotProductAttention(nn.Module):
    """Scaled Dot-Product Attention"""

    def __init__(self, temperature):
        super().__init__()
        self.temperature = temperature

    def forward(self, q, k, v, mask=None):
        attn = torch.matmul(q / self.temperature, k.transpose(2, 3))
        if mask is not None:
            attn = attn.masked_fill(mask == 0, -1000000000.0)
        attn = F.softmax(attn, dim=-1)
        output = torch.matmul(attn, v)
        return (output, attn)


INIT_ARGS = {
    'temperature': 8.0
}

ARGS = {
    'q': torch.randn(2, 3, 4, 5),
    'k': torch.randn(2, 3, 6, 5),
    'v': torch.randn(2, 3, 6, 7),
    'mask': None
}

if __name__ == '__main__':
    model = ScaledDotProductAttention(**INIT_ARGS)
    output, attn = model(**ARGS)
    print("Output shape:", output.shape)
    print("Attention shape:", attn.shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
AdditiveNetAttention Not yet run
unverified (harvested, no recorded run)
dimonenka/optimaler/core/nets/additive_net_attention.py
code served (permissive licence) · get_code("ace83588d2159d55")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 8 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-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

RegretNet is a recent breakthrough in the automated design of revenue-maximizing auctions. It combines the flexibility of deep learning with the regret-based approach to relax the Incentive Compatibility (IC) constraint (that participants prefer to bid truthfully) in order to approximate optimal auctions. We propose two independent improvements of RegretNet. The first is a neural architecture denoted as Regret-Former that is based on attention layers. The second is a loss function that requires explicit specification of an acceptable IC violation denoted as regret budget. We investigate both modifications in an extensive experimental study that includes settings with constant and inconstant number of items and participants, as well as novel validation procedures tailored to regret-based approaches. We find that RegretFormer consistently outperforms RegretNet in revenue (i.e. is optimal-er) and that our loss function both simplifies hyperparameter tuning and allows to unambiguously control the revenue-regret trade-off by selecting the regret budget. 2

For agents

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

get_harvested_code_for_paper("2202.13110")
get_code_for_paper("2202.13110")
have("2202.13110")

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

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

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

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

Connect an agent — have() is free.