SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.01720 · 2024

LamRA: Large Multimodal Model as Your Advanced Retrieval Assistant

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; 3 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 0 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/2412.01720.json · badge: /api/ran/2412.01720.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
Code-kunkun/LamRA community (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
ceil_by_factor Ran
ran, honoured the contract we drafted
Code-kunkun/LamRA/collators/qwen2_vision_process.py
code served (permissive licence) · get_code("6e45201fa27cb24a")
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 int, ndim 0, dtype family int, 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 math

def ceil_by_factor(number: int, factor: int) -> int:
    """Returns the smallest integer greater than or equal to 'number' that is divisible by 'factor'."""
    return math.ceil(number / factor) * factor

ARGS = {
    "number": 10,
    "factor": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
extract_inputs Ran
ran on a synthesized input
Code-kunkun/LamRA/collators/mbeir_rerank.py
code served (permissive licence) · get_code("60134dd1f6eb9025")
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 as nn

torch.manual_seed(0)

# Define token IDs
PAD_TOKEN_ID = 0
IGNORE_TOKEN_ID = -100

# Create input_ids tensor (batch_size=2, seq_length=4)
input_ids = torch.tensor([
    [1, 2, 3, 0],
    [4, 5, 0, 0]
], dtype=torch.long)

# Create attention_mask tensor (batch_size=2, seq_length=4)
attention_mask = torch.tensor([
    [1, 1, 1, 0],
    [1, 1, 0, 0]
], dtype=torch.long)

# Create pixel_values tensor (batch_size=2, channels=3, height=8, width=8)
pixel_values = torch.randn(2, 3, 8, 8)

# Create image_grid_thw - list of tuples with (time, height, width) for each image
image_grid_thw = [(1, 2, 2), (1, 2, 2)]

# Construct the inputs dict
inputs = {
    'input_ids': input_ids,
    'attention_mask': attention_mask,
    'pixel_values': pixel_values,
    'image_grid_thw': image_grid_thw
}

# Define ARGS mapping all parameters
ARGS = {
    'inputs': inputs,
    'PAD_TOKEN_ID': PAD_TOKEN_ID,
    'IGNORE_TOKEN_ID': IGNORE_TOKEN_ID
}
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
find_all_linear_names Ran
ran on a synthesized input
Code-kunkun/LamRA/utils.py
code served (permissive licence) · get_code("db7c18eeb2aa3486")
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 list, ndim 1, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small model with named modules
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.attention_linear = nn.Linear(2, 2)
        self.lm_head = nn.Linear(2, 10)
        self.other_layer = nn.Linear(10, 5)

model = SimpleModel()

# Get named_modules as a dict
named_modules = dict(model.named_modules())

# Define target_modules to search for
target_modules = ['linear', 'attention']

ARGS = {
    'named_modules': named_modules,
    'target_modules': target_modules
}
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 list, ndim 1, dtype family float — a list 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
floor_by_factor Ran
ran, honoured the contract we drafted
Code-kunkun/LamRA/collators/qwen2_vision_process.py
code served (permissive licence) · get_code("8155263d7ff19bb3")
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 int, ndim 0, dtype family int, 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 math

ARGS = {
    "number": 17,
    "factor": 5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
round_by_factor Ran
ran, honoured the contract we drafted
Code-kunkun/LamRA/collators/qwen2_vision_process.py
code served (permissive licence) · get_code("e252767324188623")
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 int, ndim 0, dtype family int, 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 numpy as np

# Analyze the function:
# round_by_factor(number: int, factor: int) -> int
# The function takes two integers and returns an integer.
# It divides number by factor, rounds to nearest integer, then multiplies by factor.

# Set up arguments
number_arg = 17
factor_arg = 5

ARGS = {
    "number": number_arg,
    "factor": factor_arg,
}
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 int, ndim 0, dtype family int, 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

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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 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
round_by_factor 25 other papers
2 dated earlier, 22 later, 1 undated
2409.12191 (2024-09)
Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution
2410.11623 (2024-10)
VidEgoThink: Assessing Egocentric Video Understanding Capabilities for Embodied AI
2025.acl-long.1603 (2025 (year only))
Design Choices for Extending the Context Length of Visual Language Models
and 22 more not named here
ceil_by_factor 23 other papers
2 dated earlier, 20 later, 1 undated
2409.12191 (2024-09)
Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution
2410.11623 (2024-10)
VidEgoThink: Assessing Egocentric Video Understanding Capabilities for Embodied AI
2025.acl-long.1603 (2025 (year only))
Design Choices for Extending the Context Length of Visual Language Models
and 20 more not named here
floor_by_factor 23 other papers
2 dated earlier, 20 later, 1 undated
2409.12191 (2024-09)
Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution
2410.11623 (2024-10)
VidEgoThink: Assessing Egocentric Video Understanding Capabilities for Embodied AI
2025.acl-long.1603 (2025 (year only))
Design Choices for Extending the Context Length of Visual Language Models
and 20 more not named here

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

With the rapid advancement of multimodal information retrieval, increasingly complex retrieval tasks have emerged. Existing methods predominately rely on task-specific fine-tuning of vision-language models, often those trained with image-text contrastive learning. In this paper, we explore the possibility of re-purposing generative Large Multimodal Models (LMMs) for retrieval. This approach enables unifying all retrieval tasks under the same formulation and, more importantly, allows for extrapolation towards unseen retrieval tasks without additional training. Our contributions can be summarised in the following aspects: (i) We introduce LamRA, a versatile framework designed to empower LMMs with sophisticated retrieval and reranking capabilities. (ii) For retrieval, we adopt a two-stage training strategy comprising language-only pre-training and multimodal instruction tuning to progressively enhance LMM's retrieval performance. (iii) For reranking, we employ joint training for both pointwise and listwise reranking, offering two distinct ways to further boost the retrieval performance. (iv) Extensive experimental results underscore the efficacy of our method in handling more than ten retrieval tasks, demonstrating robust performance in both supervised and zero-shot settings, including scenarios involving previously unseen retrieval tasks.

For agents

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

get_harvested_code_for_paper("2412.01720")
get_code_for_paper("2412.01720")
have("2412.01720")

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

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

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

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

Connect an agent — have() is free.