SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.21853 · ICML · 2026

LEMUR: Learned Multi-Vector Retrieval

Teemu Roos, Elias Jääsaari, Ville Hyvönen

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 (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 4 failures of our instrument; 1 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/2601.21853.json · badge: /api/ran/2601.21853.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
ejaasaari/lemur community
Papers with Code archive
7 ran · 1 no recorded run
FunctionStatusWhere it lives
ELM Ran
ran on a synthesized input
ejaasaari/lemur/lemur/lemur.py
code served (permissive licence) · get_code("80244ea5798052c8")
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 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 math
import torch.nn as nn
import torch.nn.functional as F

def _activation_fn(activation: str):
    functions = {'relu': torch.relu, 'gelu': F.gelu, 'silu': F.silu, 'mish': F.mish}
    return functions[activation]

def _validate_activation(activation: str) -> str:
    allowed = {'relu', 'gelu', 'silu', 'mish'}
    if activation not in allowed:
        raise ValueError(f"activation must be one of: {', '.join(allowed)}")
    return activation

class RandomActivationFeatures(nn.Module):

    def __init__(self, input_dim: int, output_dim: int, activation: str='gelu'):
        super().__init__()
        if input_dim <= 0:
            raise ValueError('input_dim must be > 0 for random activation features')
        if output_dim <= 0:
            raise ValueError('output_dim must be > 0 for random activation features')
        activation = _validate_activation(activation)
        self.register_buffer('weight', torch.randn(input_dim, output_dim))
        self.activation = activation
        self._activation_fn = _activation_fn(activation)
        self.scale = math.sqrt(2.0 / output_dim)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.scale * self._activation_fn(x @ self.weight)

class ELM(nn.Module):

    def __init__(self, input_dim: int, output_dim: int, final_hidden_dim: int, activation: str='gelu'):
        super().__init__()
        if final_hidden_dim <= 0:
            raise ValueError('final_hidden_dim must be > 0')
        activation = _validate_activation(activation)
        self.config = {'model_type': 'elm', 'input_dim': input_dim, 'output_dim': output_dim, 'final_hidden_dim': final_hidden_dim, 'activation': activation}
        random_features = RandomActivationFeatures(input_dim=input_dim, output_dim=final_hidden_dim, activation=activation)
        self.feature_extractor = nn.Sequential(random_features, nn.LayerNorm(final_hidden_dim, elementwise_affine=False))
        self.output_layer = nn.Linear(final_hidden_dim, output_dim, bias=False)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        feats = self.feature_extractor(x)
        return self.output_layer(feats)

INIT_ARGS = {
    'input_dim': 4,
    'output_dim': 3,
    'final_hidden_dim': 8,
    'activation': 'gelu'
}

ARGS = {
    'x': torch.randn(2, 4)
}
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 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MLP Ran
ran on a synthesized input
ejaasaari/lemur/lemur/lemur.py
code served (permissive licence) · get_code("9fc125d141b40235")
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 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

INIT_ARGS = {
    'input_dim': 4,
    'output_dim': 3,
    'hidden_dim': 8,
    'final_hidden_dim': 6,
    'num_layers': 2,
    'activation': 'relu',
}

ARGS = {
    'x': torch.randn(2, 4),
}
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 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RandomActivationFeatures Ran
ran on a synthesized input
ejaasaari/lemur/lemur/lemur.py
code served (permissive licence) · get_code("3f68f611c62f1970")
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 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 math
import torch.nn as nn

def _activation_fn(activation: str):
    functions = {'relu': torch.relu, 'gelu': torch.nn.functional.gelu, 'silu': torch.nn.functional.silu, 'mish': torch.nn.functional.mish}
    return functions[activation]

def _validate_activation(activation: str) -> str:
    allowed = {'relu', 'gelu', 'silu', 'mish'}
    if activation not in allowed:
        raise ValueError(f"activation must be one of: {', '.join(allowed)}")
    return activation

class RandomActivationFeatures(nn.Module):

    def __init__(self, input_dim: int, output_dim: int, activation: str='gelu'):
        super().__init__()
        if input_dim <= 0:
            raise ValueError('input_dim must be > 0 for random activation features')
        if output_dim <= 0:
            raise ValueError('output_dim must be > 0 for random activation features')
        activation = _validate_activation(activation)
        self.register_buffer('weight', torch.randn(input_dim, output_dim))
        self.activation = activation
        self._activation_fn = _activation_fn(activation)
        self.scale = math.sqrt(2.0 / output_dim)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.scale * self._activation_fn(x @ self.weight)


INIT_ARGS = {
    'input_dim': 4,
    'output_dim': 3,
    'activation': 'gelu'
}

ARGS = {
    'x': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = RandomActivationFeatures(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
_activation_cls Ran
ran; our contract draft was wrong, not the code
ejaasaari/lemur/lemur/lemur.py
code served (permissive licence) · get_code("e61ce15e7fc7dd02")
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 type. 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 = {
    'activation': 'relu'
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
_activation_fn Ran
ran; our contract draft was wrong, not the code
ejaasaari/lemur/lemur/lemur.py
code served (permissive licence) · get_code("71965bf68e477424")
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 builtin_function_or_method. 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

torch.manual_seed(0)

ARGS = {
    'activation': 'relu'
}
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 builtin_function_or_method — a builtin_function_or_method output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a builtin_function_or_method 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
_validate_activation Ran
ran; our contract draft was wrong, not the code
ejaasaari/lemur/lemur/lemur.py
code served (permissive licence) · get_code("f1291f1e06fa0ce3")
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 str. 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

torch.manual_seed(0)

ARGS = {
    "activation": "relu"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
single_maxsim Ran
ran; our contract draft was wrong, not the code
ejaasaari/lemur/lemur/lemur.py
code served (permissive licence) · get_code("5b638a77437c9195")
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 (3, 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 tiny tensors for corpus and queries
# corpus: 2D tensor with shape (6, 4) - 6 documents, 4 dimensions
corpus = torch.randn(6, 4, dtype=torch.float32)

# queries: 2D tensor with shape (3, 4) - 3 queries, 4 dimensions
queries = torch.randn(3, 4, dtype=torch.float32)

# corpus_counts: sequence of ints that sum to corpus.shape[0] (6)
# Split corpus into 2 segments: 3 docs + 3 docs
corpus_counts = [3, 3]

# block_bytes: optional parameter for memory-efficient processing
# Use a reasonable block size
block_bytes = 256

ARGS = {
    'corpus': corpus,
    'corpus_counts': corpus_counts,
    'queries': queries,
    'block_bytes': block_bytes
}
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 (3, 2) — shape (3, 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
Lemur Not yet run
unverified (harvested, no recorded run)
ejaasaari/lemur/lemur/lemur.py
code served (permissive licence) · get_code("58242427cd54d8dd")
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-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

Multi-vector representations generated by late interaction models, such as ColBERT, enable superior retrieval quality compared to single-vector representations in information retrieval applications. In multi-vector retrieval systems, both queries and documents are encoded using one embedding per token, and similarity between queries and documents is measured by the MaxSim similarity measure. However, the improved quality of multi-vector retrieval comes at the expense of significantly increased search latency. In this work, we introduce LEMUR, a simple yet efficient framework for multi-vector similarity search. LEMUR consists of two consecutive problem reductions: First, we formulate multivector similarity search as a supervised learning problem that can be solved using a one-hiddenlayer neural network. Second, we reduce inference under this model to single-vector similarity search in its latent space, enabling the use of existing single-vector search indexes to accelerate retrieval. LEMUR is an order of magnitude faster than prior multi-vector similarity search methods. Our code is available at https: //github.com/ejaasaari/lemur

For agents

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

get_harvested_code_for_paper("2601.21853")
get_code_for_paper("2601.21853")
have("2601.21853")

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

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

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

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

Connect an agent — have() is free.