SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.10636 · 2026

DistilVDR: A Compact End-to-End Visual Document Retriever via Dual-Student Distillation

Yao Zhang, Ziyi Wang, Zhuchenyang Liu, Yu Xiao

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-24; 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/2608.10636.json · badge: /api/ran/2608.10636.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
Ryenhails/NanoVDR community
Papers with Code archive
5 ran · 3 no recorded run
FunctionStatusWhere it lives
Repr Ran
ran on a synthesized input · constructed an object; no result was computed
Ryenhails/NanoVDR/nanovdr/train/engine.py
code served (permissive licence) · get_code("40867bc0746dec51")
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, Repr: 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 dataclasses import dataclass

torch.manual_seed(0)

@dataclass
class Repr:
    """A student or teacher representation, in either geometry.

    Exactly one of ``vec`` / ``tokens`` is set.  Vectors are expected to be
    L2-normalised by the tower before they reach a loss; losses do not
    normalise defensively, so a mis-normalised tower fails loudly in tests
    rather than silently degrading.

    Attributes
    ----------
    vec : (B, D) float tensor, or None
        Single-vector representation.
    tokens : (B, K, D) float tensor, or None
        Multi-vector representation.  ``K`` may differ between student and
        teacher; no token correspondence is assumed.
    mask : (B, K) bool tensor, or None
        Valid-token mask.  Required whenever ``tokens`` is set.
    weights : (B, K) float tensor, or None
        Optional per-token logits for the student measure.  Consumed only by
        objectives supporting a non-uniform marginal; ignored otherwise.
    """
    vec: torch.Tensor | None = None
    tokens: torch.Tensor | None = None
    mask: torch.Tensor | None = None
    weights: torch.Tensor | None = None

    def __post_init__(self) -> None:
        if (self.vec is None) == (self.tokens is None):
            raise ValueError('Repr takes exactly one of `vec` or `tokens`.')
        if self.tokens is not None and self.mask is None:
            raise ValueError('Multi-vector Repr requires `mask`.')

    @property
    def geometry(self):
        return 'single' if self.vec is not None else 'multi'

    @property
    def dim(self) -> int:
        return self.vec.shape[-1] if self.vec is not None else self.tokens.shape[-1]

    @property
    def batch_size(self) -> int:
        return self.vec.shape[0] if self.vec is not None else self.tokens.shape[0]


# Single-vector case
vec_single = torch.randn(2, 4)

ARGS = {
    'vec': vec_single,
    'tokens': None,
    'mask': None,
    'weights': 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 Repr — 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 Repr 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
TrainConfig Ran
ran on a synthesized input · constructed an object; no result was computed
Ryenhails/NanoVDR/nanovdr/train/engine.py
code served (permissive licence) · get_code("3c17b286018b4152")
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, TrainConfig: 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 dataclasses import dataclass, field

torch.manual_seed(0)

ARGS = {
    'epochs': 3,
    'batch_size': 16,
    'grad_accum': 8,
    'peak_lr': 0.001,
    'warmup_pct': 0.03,
    'weight_decay': 0.01,
    'num_workers': 8,
    'amp_dtype': 'bfloat16',
    'log_every': 50,
    'output_dir': 'outputs/run',
    'seed': 42,
    'max_grad_norm': 1.0,
    'extra': {}
}
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 TrainConfig — 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 TrainConfig 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
_target_repr Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Ryenhails/NanoVDR/nanovdr/train/engine.py
code served (permissive licence) · get_code("7ef997cf9f9d62cd")
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 Repr. 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.functional as F

torch.manual_seed(0)

# For 'single' geometry: target should be (B, D) float tensor
target_single = torch.randn(2, 4)

# For 'multi' geometry: target should be (B, K, D) float tensor
target_multi = torch.randn(2, 3, 4)

ARGS = {
    'target': target_single,
    'geometry': 'single',
}
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 Repr — a Repr output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Repr 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
evaluate Ran
ran on a synthesized input
Ryenhails/NanoVDR/nanovdr/train/engine.py
code served (permissive licence) · get_code("96f127afa2c3dc3b")
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 float, ndim 0, dtype family float, 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 torch.nn as nn
import torch.nn.functional as F
from dataclasses import dataclass

torch.manual_seed(0)

# Define a minimal core model
class SimpleCore(nn.Module):
    def __init__(self, input_dim=5, output_dim=4):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Define a minimal dataset
class SimpleDataset:
    def __init__(self, size=4):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return {
            'input': torch.randn(5),
            'target': torch.randn(4)
        }

# Define a minimal collate function
def simple_collate_fn(batch):
    inputs = torch.stack([item['input'] for item in batch])
    targets = torch.stack([item['target'] for item in batch])
    return {
        'input': inputs,
        'target': targets
    }

# Define a minimal loss function
def simple_loss_fn(student_repr, teacher_repr):
    if student_repr.vec is not None:
        loss = F.mse_loss(student_repr.vec, teacher_repr.vec)
    else:
        loss = F.mse_loss(student_repr.tokens, teacher_repr.tokens)
    return {'loss': loss}

# Define a minimal forward function
def simple_forward_fn(core, batch):
    output = core(batch['input'])
    return Repr(vec=F.normalize(output, p=2, dim=-1))

# Define config class
@dataclass
class SimpleConfig:
    batch_size: int = 2
    num_workers: int = 0

# Define Repr class (from the function signature)
@dataclass
class Repr:
    vec: torch.Tensor | None = None
    tokens: torch.Tensor | None = None
    mask: torch.Tensor | None = None
    weights: torch.Tensor | None = None

    def __post_init__(self) -> None:
        if (self.vec is None) == (self.tokens is None):
            raise ValueError('Repr takes exactly one of `vec` or `tokens`.')
        if self.tokens is not None and self.mask is None:
            raise ValueError('Multi-vector Repr requires `mask`.')

    @property
    def geometry(self) -> str:
        return 'single' if self.vec is not None else 'multi'

    @property
    def dim(self) -> int:
        return self.vec.shape[-1] if self.vec is not None else self.tokens.shape[-1]

    @property
    def batch_size(self) -> int:
        return self.vec.shape[0] if self.vec is not None else self.tokens.shape[0]

# Construct arguments
ARGS = {
    'core': SimpleCore(input_dim=5, output_dim=4),
    'dataset': SimpleDataset(size=4),
    'collate_fn': simple_collate_fn,
    'loss_fn': simple_loss_fn,
    'cfg': SimpleConfig(batch_size=2, num_workers=0),
    'forward_fn': simple_forward_fn,
    'device': torch.device('cpu'),
    'geometry': 'single'
}
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 float, ndim 0, dtype family float, 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
setup_distributed Ran
ran on a synthesized input
Ryenhails/NanoVDR/nanovdr/train/engine.py
code served (permissive licence) · get_code("9dc0b2955340c00f")
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, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 os
import torch
import torch.distributed as dist

torch.manual_seed(0)

# setup_distributed() takes no parameters
ARGS = {}
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, ndim 1, dtype family int — a tuple 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
AlignLoss Not yet run
unverified (harvested, no recorded run)
Ryenhails/NanoVDR/nanovdr/train/engine.py
code served (permissive licence) · get_code("fa3017a01f068805")
How it ran

no invocation recorded.

_save Not yet run
unverified (harvested, no recorded run)
Ryenhails/NanoVDR/nanovdr/train/engine.py
code served (permissive licence) · get_code("3599cfa97aa2b8ca")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
Ryenhails/NanoVDR/nanovdr/train/engine.py
code served (permissive licence) · get_code("127a0feff3a2188e")
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-24.

Repositories linked to this paper

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

Abstract

Visual document retrieval (VDR) is dominated by multi-billion-parameter models that are slow to index at full corpus scale and expensive to serve. Prior compression routes either train a smaller multi-vector encoder from scratch or distil only the query side; neither yields a compact single-vector retriever end-to-end. We present DistilVDR, a 524 M end-to-end VDR system distilled bilaterally from a single 8 B vision-language teacher under a pointwise cosine alignment loss. All supervision comes from the frozen teacher's embedding space, which was itself trained with relevance supervision, so the student objective needs no relevance labels, negative sampling, or contrastive term. We match VDR's text-query and image-document input asymmetry with an asymmetric encoder-only student that concentrates visual capacity on the document side and keeps the query side at 70 M parameters. We release two variants that share the same encoders and training and differ only in the document encoder's visual-tile budget: DistilVDR-HiRes attains 61.74 average NDCG@5 on ViDoRe v1+v2+v3 (86.9 % of the 8 B teacher) and leads every reproduced sub-1 B baseline on the high-resolution-sensitive v3 benchmark, while DistilVDR-Fast attains 59.98 at a 3× smaller visual-token budget. Both variants store one million documents in a 15.6 times smaller index than the strongest sub-1 B multivector baseline and index the corpus an order of magnitude faster. The code is available at https://github.com/Ryenhails/NanoVDR.

For agents

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

get_harvested_code_for_paper("2608.10636")
get_code_for_paper("2608.10636")
have("2608.10636")

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

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

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

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

Connect an agent — have() is free.