SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.27037 · 2026

Hypencoder Revisited: Reproducibility and Analysis of Non-Linear Scoring for First-Stage Retrieval

Mohammad Aliannejadi, Yongkang Li, Arne Eichholtz, Jutte Vijverberg, Tobias Groot

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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; 5 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2604.27037.json · badge: /api/ran/2604.27037.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
arneeichholtz/Hypencoder-reprod canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
activation_factory Ran
ran; our contract draft was wrong, not the code
arneeichholtz/Hypencoder-reprod/hypencoder_cb/modeling/q_net.py
code served (permissive licence) · get_code("e9a6de3ebb8e8fb3")
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 ReLU. 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 function takes a single parameter: activation_type (str)
# It returns different activation functions based on the string input
# We need to test with valid activation types

ARGS = {
    'activation_type': 'relu'
}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
in_batch_negatives_hypecoder_similarity Ran
ran; our contract draft was wrong, not the code
arneeichholtz/Hypencoder-reprod/hypencoder_cb/modeling/similarity_and_losses.py
code served (permissive licence) · get_code("45bb8865f32964ee")
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, 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 torch
import torch.nn as nn

torch.manual_seed(0)

class QueryModels(nn.Module):
    def __init__(self, num_queries, item_emb_dim, output_dim):
        super().__init__()
        self.num_queries = num_queries
        self.item_emb_dim = item_emb_dim
        self.output_dim = output_dim
        self.linear = nn.Linear(item_emb_dim, 1)
    
    def forward(self, item_embeddings):
        # item_embeddings shape: (num_queries, num_items, item_emb_dim)
        # output shape: (num_queries, num_items, 1)
        batch_size, num_items, emb_dim = item_embeddings.shape
        similarities = self.linear(item_embeddings)  # (num_queries, num_items, 1)
        return similarities

num_queries = 2
num_items = 3
item_emb_dim = 4

query_models = QueryModels(num_queries=num_queries, item_emb_dim=item_emb_dim, output_dim=1)
item_embeddings = torch.randn(num_items, item_emb_dim)

ARGS = {
    "query_models": query_models,
    "item_embeddings": item_embeddings,
    "required_num_items_per_query": None,
}
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, 3) — shape (2, 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
no_in_batch_negatives_hypecoder_similarity Ran
ran; our contract draft was wrong, not the code
arneeichholtz/Hypencoder-reprod/hypencoder_cb/modeling/similarity_and_losses.py
code served (permissive licence) · get_code("c665033345af9d1a")
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, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small callable query_models class
class QueryModels(nn.Module):
    def __init__(self, num_queries, item_emb_dim, num_items_per_query):
        super().__init__()
        self.num_queries = num_queries
        self.item_emb_dim = item_emb_dim
        self.num_items_per_query = num_items_per_query
        # Simple linear layer to compute similarities
        self.similarity_layer = nn.Linear(item_emb_dim, 1)
    
    def forward(self, item_embeddings):
        # item_embeddings shape: (num_queries, num_items_per_query, item_emb_dim)
        # Compute similarity for each item
        batch_size, num_items, emb_dim = item_embeddings.shape
        # Reshape to (num_queries * num_items_per_query, item_emb_dim)
        flat_embeddings = item_embeddings.view(-1, emb_dim)
        # Compute similarities
        similarities = self.similarity_layer(flat_embeddings)
        # Reshape back to (num_queries, num_items_per_query, 1)
        similarities = similarities.view(batch_size, num_items, -1)
        return similarities

# Set up parameters
num_queries = 2
num_items_per_query = 3
item_emb_dim = 4
total_num_items = num_queries * num_items_per_query

# Create query_models
query_models = QueryModels(num_queries, item_emb_dim, num_items_per_query)

# Create item_embeddings with shape (num_items, item_emb_dim)
item_embeddings = torch.randn(total_num_items, item_emb_dim)

# Optional: required_num_items_per_query
required_num_items_per_query = num_items_per_query

ARGS = {
    "query_models": query_models,
    "item_embeddings": item_embeddings,
    "required_num_items_per_query": required_num_items_per_query,
}
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, 3) — shape (2, 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
pos_neg_triplets_from_similarity Ran
ran; our contract draft was wrong, not the code
arneeichholtz/Hypencoder-reprod/hypencoder_cb/modeling/similarity_and_losses.py
code served (permissive licence) · get_code("f897781f4710cbd0")
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 (6, 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

torch.manual_seed(0)

# Create a similarity matrix with shape (num_queries, num_items_per_query)
# num_queries = 2, num_items_per_query = 4
# First column is the positive item, remaining columns are negatives
similarity = torch.randn(2, 4)

ARGS = {
    "similarity": similarity
}
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 (6, 2) — shape (6, 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
scaled_dot_product_attention Ran
ran; our contract draft was wrong, not the code
arneeichholtz/Hypencoder-reprod/hypencoder_cb/modeling/hypencoder.py
code served (permissive licence) · get_code("6e979b51a5011c36")
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 math

torch.manual_seed(0)

# Create small tensors for query, key, value
batch_size = 2
seq_len_query = 3
seq_len_key = 4
dim = 5

query = torch.randn(batch_size, seq_len_query, dim)
key = torch.randn(batch_size, seq_len_key, dim)
value = torch.randn(batch_size, seq_len_key, dim)

# Create an optional mask (batch_size, seq_len_key)
# 1 means keep, 0 means mask out
mask = torch.ones(batch_size, seq_len_key, dtype=torch.long)

ARGS = {
    "query": query,
    "key": key,
    "value": value,
    "dim": dim,
    "mask": mask
}
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

Also present in other papers' code

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

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-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The Hypencoder, proposed by Killingback et al. [23], is a retrieval framework that replaces the fixed inner-product scoring function used in standard bi-encoders with a query-specific neural network (the 𝑞-net), whose weights are generated by a hypernetwork from the contextualized query embeddings. This design enables more expressive relevance estimation while preserving independent query and document encoding. In this work, we conduct a reproducibility study of the Hypencoder and extend the original analysis in three directions. Our reproduction confirms that the Hypencoder outperforms a similarly trained bi-encoder baseline on in-domain and out-of-domain benchmarks, and that the proposed efficient search algorithm substantially reduces query latency with minimal performance loss. On hard retrieval tasks, we find partial support: the Hypencoder outperforms the baseline on DL-Hard and Fol-lowIR, but not on TREC TOT, where checkpoint incompatibility and fine-tuning sensitivity complicate full verification. Beyond reproduction, we investigate three extensions: (i) integrating alternative pre-trained encoders into the Hypencoder framework, where we find that performance gains depend on the encoder and finetuning strategy; (ii) comparing query latency against a Faiss-based bi-encoder pipeline, revealing that standard bi-encoder retrieval remains faster under both exhaustive and efficient search settings; and (iii) evaluating adversarial robustness, where we find that the 𝑞-net's non-linear scoring does not provide a consistent robustness disadvantage over inner-product scoring. Our code is publicly available at https://github.com/arneeichholtz/Hypencoder-reprod. • Information systems → Retrieval models and ranking; • Computing methodologies → Natural language processing.

For agents

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

get_harvested_code_for_paper("2604.27037")
get_code_for_paper("2604.27037")
have("2604.27037")

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

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

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

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

Connect an agent — have() is free.