SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.29706 · 2026

ARMOR: Adaptive Retriever Optimization for Low-Resource Telecom Question Answering

Tianyi Chen, Quan Xiao, Heshan Fernando, Yan Xin

arXiv · PDF · Open in the Atlas

Code that ran

27 of 33 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 1 violated it and 9 have no contract verdict; 14 failures of our instrument; 6 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/2606.29706.json · badge: /api/ran/2606.29706.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
heshandevaka/ARMOR community
Papers with Code archive
27 ran · 6 no recorded run
FunctionStatusWhere it lives
AdaptiveObjectiveTemperatures Ran
ran on a synthesized input · constructed an object; no result was computed
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("a7a176dada3c4729")
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, AdaptiveObjectiveTemperatures: 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
import numpy as np

torch.manual_seed(0)

ARGS = {
    "init_retr_temperature": 0.5,
    "init_contrastive_temperature": 0.7,
    "temperature_min": 0.1,
    "temperature_max": 2.0,
}
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 AdaptiveObjectiveTemperatures — 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 AdaptiveObjectiveTemperatures 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
AutoChunkStore Ran
ran on a synthesized input · constructed an object; no result was computed
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("575cff217132a28d")
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, AutoChunkStore: 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 sqlite3
import tempfile
import os

# Create a temporary SQLite database for testing
temp_db = tempfile.NamedTemporaryFile(delete=False, suffix='.db')
temp_db_path = temp_db.name
temp_db.close()

# Initialize the database with a test table
conn = sqlite3.connect(temp_db_path)
cur = conn.cursor()

# Create a table that matches the expected schema
cur.execute('''
    CREATE TABLE documents (
        vid INTEGER PRIMARY KEY,
        text TEXT NOT NULL,
        doc_id INTEGER
    )
''')

# Insert some test data
cur.execute("INSERT INTO documents (vid, text, doc_id) VALUES (1, 'This is chunk one', 101)")
cur.execute("INSERT INTO documents (vid, text, doc_id) VALUES (2, 'This is chunk two', 102)")
cur.execute("INSERT INTO documents (vid, text, doc_id) VALUES (3, 'This is chunk three', 101)")

conn.commit()
conn.close()

# Define the arguments dict
ARGS = {
    'sqlite_path': temp_db_path
}
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 AutoChunkStore — 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 AutoChunkStore 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
ShardedDataset Ran
ran on a synthesized input · constructed an object; no result was computed
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("b030b7567ea03385")
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, ShardedDataset: 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 random
from typing import List, Any

torch_imported = False
try:
    import torch
    torch_imported = True
    torch.manual_seed(0)
except ImportError:
    pass

# Create sample items for the dataset
items = [
    {"id": 0, "value": "item_0"},
    {"id": 1, "value": "item_1"},
    {"id": 2, "value": "item_2"},
    {"id": 3, "value": "item_3"},
    {"id": 4, "value": "item_4"},
    {"id": 5, "value": "item_5"},
]

ARGS = {
    "items": items,
    "seed": 42,
}
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 ShardedDataset — 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 ShardedDataset 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
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("dcaf1f4539036931")
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 numpy as np
from dataclasses import dataclass
from typing import Set

torch.manual_seed(0)

ARGS = {
    "top_k": 5,
    "retr_max_len": 256,
    "lm_max_len": 512,
    "teacher_batch_size": 2,
    "retrieval_encode_batch_size": 4,
    "normalize_by_y_length": True,
    "qa_prompt_prefix": "Question: ",
    "doc_prefix": "Document: ",
    "question_prefix": "Q: ",
    "answer_prefix": "A: ",
    "section_sep": " | ",
    "contrastive_num_negatives": 3,
    "contrastive_exclude_same_doc": False,
    "mix_rag_weight": 0.5,
    "mix_contriever_weight": 0.3,
    "temperature_min": 0.1,
    "temperature_max": 1.0,
    "temperature_l2": 0.01,
    "regularizers": {"l2", "dropout"},
    "weight_anchor_coef": 0.2,
    "query_distill_coef": 0.4,
    "rank_distill_coef": 0.3,
    "query_distill_type": "kl",
    "rank_distill_temperature": 2.0,
}
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 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
_normalize_answers Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("6fcabd142bda955f")
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
from typing import Union, List

AnswerType = Union[str, List[str]]

def _normalize_answers(val: AnswerType) -> List[str]:
    if isinstance(val, str):
        val = val.strip()
        return [val] if val else []
    if isinstance(val, list):
        out = []
        for item in val:
            if isinstance(item, str) and item.strip():
                out.append(item.strip())
        return out
    return []

# Test cases for the parameter
ARGS = {
    "val": "hello world"
}
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
_normalize_int_list Ran
ran, honoured the contract we drafted
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("2b89c44dd201f528")
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 int; 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 numpy as np
from typing import List

torch.manual_seed(0)

# Analyzing the function _normalize_int_list:
# - Parameter: val (object)
# - The function checks if val is a list
# - If it is a list, it iterates through items and tries to convert each to int
# - Returns a list of ints, or empty list if val is not a list

# Test case 1: A list with mixed types that can be converted to int
test_val_1 = [1, 2, "3", 4.5, "not_a_number", None]

ARGS = {
    "val": test_val_1
}
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 list, ndim 1, dtype family int — 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
_normalize_question Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("0ce0323714172269")
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 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
import numpy as np
from typing import List, Union

torch.manual_seed(0)

QuestionType = Union[str, List[str]]

ARGS = {
    "val": "  hello world  "
}
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 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
_normalize_str_list Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("ed2e1f6c9b9472d9")
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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# _normalize_str_list takes one parameter: val (object)
# The function checks:
# - isinstance(val, list): iterates and converts to str, filters by isinstance(x, str) and x.strip()
# - isinstance(val, str) and val.strip(): returns [val.strip()]
# - otherwise returns []

# Valid test cases for val parameter:
# 1. A list of strings (some with whitespace)
# 2. A single string with whitespace
# 3. A list with mixed types
# 4. An empty string
# 5. Empty list
# 6. Non-string, non-list object

ARGS = {
    "val": ["hello", "  world  ", "test", "  ", ""]
}
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 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
_pick_first_present Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("e33ac12e574bf6a8")
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 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
from typing import List, Optional

torch.manual_seed(0)

# Construct test arguments for _pick_first_present
obj = {
    "key1": None,
    "key2": "value2",
    "key3": 42,
    "key4": torch.tensor([1, 2, 3, 4])
}

keys = ["key1", "key2", "key3"]

ARGS = {
    "obj": obj,
    "keys": keys
}
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 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
apply_regularizers Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("d82b5c3d1f6645f5")
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
from dataclasses import dataclass
from typing import Dict, Optional, Set

torch.manual_seed(0)

@dataclass
class TrainConfig:
    top_k: int
    retr_max_len: int
    lm_max_len: int
    teacher_batch_size: int
    retrieval_encode_batch_size: int
    normalize_by_y_length: bool
    qa_prompt_prefix: str
    doc_prefix: str
    question_prefix: str
    answer_prefix: str
    section_sep: str
    contrastive_num_negatives: int
    contrastive_exclude_same_doc: bool
    mix_rag_weight: float
    mix_contriever_weight: float
    temperature_min: float
    temperature_max: float
    temperature_l2: float
    regularizers: Set[str]
    weight_anchor_coef: float
    query_distill_coef: float
    rank_distill_coef: float
    query_distill_type: str
    rank_distill_temperature: float

class SimpleQueryModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 8)
        self.linear2 = nn.Linear(8, 4)
    
    def forward(self, x):
        return self.linear2(self.linear1(x))

cfg = TrainConfig(
    top_k=10,
    retr_max_len=512,
    lm_max_len=256,
    teacher_batch_size=32,
    retrieval_encode_batch_size=16,
    normalize_by_y_length=True,
    qa_prompt_prefix="Q: ",
    doc_prefix="Doc: ",
    question_prefix="Question: ",
    answer_prefix="Answer: ",
    section_sep=" | ",
    contrastive_num_negatives=7,
    contrastive_exclude_same_doc=False,
    mix_rag_weight=0.5,
    mix_contriever_weight=0.3,
    temperature_min=0.1,
    temperature_max=1.0,
    temperature_l2=0.01,
    regularizers={'weight_anchor', 'query_distill', 'rank_distill'},
    weight_anchor_coef=0.1,
    query_distill_coef=0.2,
    rank_distill_coef=0.3,
    query_distill_type='cosine',
    rank_distill_temperature=0.5
)

query_model = SimpleQueryModel()

base_param_snapshot = {
    'linear1.weight': torch.randn(8, 4),
    'linear1.bias': torch.randn(8),
    'linear2.weight': torch.randn(4, 8),
    'linear2.bias': torch.randn(4),
}

q_ft = torch.randn(2, 4)
q_base = torch.randn(2, 4)

student_logits = torch.randn(2, 3)
teacher_logits = torch.randn(2, 3)

ARGS = {
    'cfg': cfg,
    'query_model': query_model,
    'base_param_snapshot': base_param_snapshot,
    'q_ft': q_ft,
    'q_base': q_base,
    'student_logits': student_logits,
    'teacher_logits': teacher_logits,
}
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
build_base_param_snapshot Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("30b3f00c2ac45eef")
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 dict. 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)

# Build a simple model with some parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
contrastive_infonce_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("0d327923ab0f0085")
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.functional as F

torch.manual_seed(0)

# Construct arguments for contrastive_infonce_loss
# The function expects:
# - query_emb: torch.Tensor (query embedding, will be squeezed and used in matrix mult)
# - doc_embs: torch.Tensor (document embeddings, transposed for matrix mult)
# - temperature: torch.Tensor (scalar for temperature scaling)

# query_emb should be shape (1, embedding_dim) based on .squeeze(0) in logits calculation
query_emb = torch.randn(1, 4)

# doc_embs should be shape (num_docs, embedding_dim)
# Using 2 documents with embedding_dim of 4 to match query_emb
doc_embs = torch.randn(2, 4)

# temperature should be a scalar tensor
temperature = torch.tensor(0.07)

ARGS = {
    "query_emb": query_emb,
    "doc_embs": doc_embs,
    "temperature": temperature,
}
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
format_qa_prompt Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("273047a351449803")
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 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
import numpy as np
from dataclasses import dataclass
from typing import Set

torch.manual_seed(0)

@dataclass
class TrainConfig:
    top_k: int
    retr_max_len: int
    lm_max_len: int
    teacher_batch_size: int
    retrieval_encode_batch_size: int
    normalize_by_y_length: bool
    qa_prompt_prefix: str
    doc_prefix: str
    question_prefix: str
    answer_prefix: str
    section_sep: str
    contrastive_num_negatives: int
    contrastive_exclude_same_doc: bool
    mix_rag_weight: float
    mix_contriever_weight: float
    temperature_min: float
    temperature_max: float
    temperature_l2: float
    regularizers: Set[str]
    weight_anchor_coef: float
    query_distill_coef: float
    rank_distill_coef: float
    query_distill_type: str
    rank_distill_temperature: float

config = TrainConfig(
    top_k=5,
    retr_max_len=256,
    lm_max_len=512,
    teacher_batch_size=8,
    retrieval_encode_batch_size=16,
    normalize_by_y_length=True,
    qa_prompt_prefix="Q: ",
    doc_prefix="Document: ",
    question_prefix="Question: ",
    answer_prefix="Answer: ",
    section_sep=" | ",
    contrastive_num_negatives=4,
    contrastive_exclude_same_doc=False,
    mix_rag_weight=0.5,
    mix_contriever_weight=0.3,
    temperature_min=0.1,
    temperature_max=1.0,
    temperature_l2=0.01,
    regularizers={"l2", "dropout"},
    weight_anchor_coef=0.5,
    query_distill_coef=0.3,
    rank_distill_coef=0.2,
    query_distill_type="kl",
    rank_distill_temperature=4.0
)

question = "What is the capital of France?"
document = "France is a country in Europe. Its capital is Paris."

ARGS = {
    "question": question,
    "document": document,
    "cfg": config
}
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 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
gather_scalar Ran
ran, honoured the contract we drafted
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("312e21cb9a5b6812")
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.distributed as dist

torch.manual_seed(0)

# The function gather_scalar takes a single parameter: x (a torch.Tensor)
# It calls:
# - x.item() (requires a scalar tensor or single-element tensor)
# - x.detach() and .clone() (standard tensor methods)
# - dist.all_reduce() if distributed (but we won't initialize dist)
# 
# Since is_dist() will return False (dist is not initialized in this sandbox),
# the function will take the non-distributed path and just call x.item()

# Create a small scalar tensor
x = torch.tensor(3.14)

ARGS = {
    "x": x
}
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
get_rank Ran
ran on a synthesized input
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("d4209866bbf0ccb4")
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; 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.distributed as dist

torch.manual_seed(0)

# The function get_rank() takes no parameters
# It calls is_dist() which checks if dist is available and initialized
# If distributed is initialized, it returns dist.get_rank(), otherwise returns 0

# Since get_rank() has no parameters, ARGS should be an empty dict
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 int, ndim 0, dtype family int — no output shape is stated: observe_signature.py could not observe it (no_inputs)
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
get_world_size Ran
ran on a synthesized input
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("5039f00cdc24e4e8")
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; 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
import torch.distributed as dist

torch.manual_seed(0)

# The function get_world_size() takes no parameters
# It calls dist.get_world_size() if is_dist() returns True, otherwise returns 1
# Since we're in a non-distributed setup (dist is not initialized),
# the function will return 1

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 int, ndim 0, dtype family int — no output shape is stated: observe_signature.py could not observe it (no_inputs)
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
is_dist Ran
ran on a synthesized input
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("4c18d7b3ac82955d")
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 bool, ndim 0, 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.distributed as dist

torch.manual_seed(0)

# The function is_dist() takes no parameters
# It simply checks if distributed training is available and initialized
# No arguments are needed

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 bool, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (no_inputs)
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
is_main_process Ran
ran on a synthesized input
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("b8a27cf66abebb43")
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 bool, ndim 0, 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
import torch.distributed as dist

torch.manual_seed(0)

# The function is_main_process() takes no parameters
# It calls get_rank() which calls is_dist() and dist.get_rank()
# We need to set up distributed training context or mock it

# Since we're in a sandbox without actual distributed setup,
# we'll initialize a minimal distributed process group
# For CPU-only testing, we use the 'gloo' backend

try:
    # Try to initialize the default process group
    # This will only work if we're actually running with torchrun or similar
    if not dist.is_available():
        # If distributed is not available, we can't test this properly
        # But the function will still work - it will return 0 (main process)
        pass
    elif not dist.is_initialized():
        # Initialize with a single process for testing
        dist.init_process_group(
            backend='gloo',
            init_method='tcp://127.0.0.1:29500',
            rank=0,
            world_size=1
        )
except Exception:
    # If initialization fails, that's OK - the function will just return 0
    pass

# is_main_process() takes no arguments
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 bool, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (no_inputs)
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
load_contriever_examples_from_jsonl Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("5feeb153680053c7")
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 json
import tempfile
import os

# Create a temporary JSONL file with valid examples
temp_dir = tempfile.mkdtemp()
jsonl_path = os.path.join(temp_dir, "test_examples.jsonl")

# Write sample JSONL data
sample_data = [
    {
        "question": "What is the capital of France?",
        "answer": "Paris",
        "top_positive_text": "Paris is the capital and largest city of France.",
        "doc_id": "doc_1",
        "reason": "Direct answer to the question"
    },
    {
        "query": "What is machine learning?",
        "completion": "Machine learning is a subset of AI",
        "positive_text": "Machine learning enables computers to learn from data.",
        "top_positive_vid": 42,
        "rationale": "Relevant context"
    },
    {
        "input": "Name a planet",
        "output": "Earth",
        "context": "Earth is the third planet from the Sun.",
        "positive_vids": [1, 2, 3],
        "id": "example_3"
    },
    {
        "prompt": "What is Python?",
        "target": "A programming language",
        "top_positive_text": "Python is a high-level programming language.",
        "positive_texts": ["Python was created by Guido van Rossum", "It is widely used in data science"],
        "example_id": "py_example"
    }
]

with open(jsonl_path, 'w', encoding='utf-8') as f:
    for item in sample_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "jsonl_path": jsonl_path,
    "max_examples": 0
}
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 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
load_faiss_index Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("19071e1b0656c357")
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 IndexIVFFlat. 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 faiss
import numpy as np
import tempfile
import os

# Create a temporary directory for the index file
temp_dir = tempfile.mkdtemp()

# Create a simple FAISS index and save it
dimension = 4
nb = 10
np.random.seed(0)
data = np.random.random((nb, dimension)).astype('float32')

# Create an IVF index (which has nprobe attribute)
quantizer = faiss.IndexFlatL2(dimension)
index = faiss.IndexIVFFlat(quantizer, dimension, 5)
index.train(data)
index.add(data)

# Save the index to a temporary file
index_path = os.path.join(temp_dir, "test_index.faiss")
faiss.write_index(index, index_path)

# Define arguments for load_faiss_index
ARGS = {
    'index_path': index_path,
    'nprobe': 2,
    'ef_search': 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
faiss, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type IndexIVFFlat — a IndexIVFFlat output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a IndexIVFFlat 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
mean_pool Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("53d65b0319c42e89")
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, 4) 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 small tensors for mean_pool
# batch_size=2, seq_len=3, hidden_dim=4
batch_size = 2
seq_len = 3
hidden_dim = 4

# last_hidden: shape (batch_size, seq_len, hidden_dim)
last_hidden = torch.randn(batch_size, seq_len, hidden_dim)

# attention_mask: shape (batch_size, seq_len)
# Values should be 0 or 1 to mask padding tokens
attention_mask = torch.ones(batch_size, seq_len, dtype=torch.long)
attention_mask[0, 2] = 0  # Mask the last token in first sequence

ARGS = {
    "last_hidden": last_hidden,
    "attention_mask": attention_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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
needs_e5_prefix Ran
ran, violated the contract we drafted
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("4956a87a3e6b0836")
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 bool, 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

torch.manual_seed(0)

# The function takes a model_name string and checks if 'e5' is in it (case-insensitive)
# We need to provide a valid string argument

ARGS = {
    'model_name': 'e5-base'
}
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 bool, 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
query_distill_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("69e3422bb14a2d0c")
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 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.functional as F

torch.manual_seed(0)

# Create two small tensors with shape (batch_size=2, feature_dim=4)
q_ft = torch.randn(2, 4)
q_base = torch.randn(2, 4)

# reg_type can be either 'cosine' or 'mse'
reg_type = 'cosine'

ARGS = {
    'q_ft': q_ft,
    'q_base': q_base,
    'reg_type': reg_type,
}
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 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
rag_sequence_marginal_nll Ran
ran; our contract draft was wrong, not the code
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("d58afb1bd852862a")
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 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.functional as F

torch.manual_seed(0)

# Create small tensors for the function parameters
# retrieval_logits: shape (num_docs,) - logits over documents for log_softmax
# doc_loglik: shape (num_docs,) - log-likelihood of documents

retrieval_logits = torch.randn(4)  # 4 documents
doc_loglik = torch.randn(4)  # 4 documents, log-likelihoods

ARGS = {
    "retrieval_logits": retrieval_logits,
    "doc_loglik": doc_loglik,
}
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 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
rank_distill_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("cf3881f2cdf1c924")
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 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.functional as F

torch.manual_seed(0)

# Create small tensors for student and teacher logits
# Batch size: 2, Number of classes: 4
batch_size = 2
num_classes = 4

student_logits = torch.randn(batch_size, num_classes)
teacher_logits = torch.randn(batch_size, num_classes)

temperature = 2.0

ARGS = {
    "student_logits": student_logits,
    "teacher_logits": teacher_logits,
    "temperature": temperature,
}
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 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
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("6da8d76c33a470c1")
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)

# The function setup_distributed() takes no parameters
# It checks environment variables and optionally initializes distributed training
# Since we're running in a non-distributed environment, we should NOT set the
# environment variables that would trigger dist.init_process_group(), as that
# would fail in a single-process CPU-only sandbox

# Clear any existing distributed env vars to ensure we hit the fallback path
for key in ['RANK', 'WORLD_SIZE', 'LOCAL_RANK']:
    if key in os.environ:
        del os.environ[key]

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
weight_anchor_loss Ran
ran, honoured the contract we drafted
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("1e948e36e83a1dcb")
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 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

torch.manual_seed(0)

# Create a simple model with some trainable parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# Create a base snapshot with the same structure as model parameters
base_snapshot = {}
for name, param in model.named_parameters():
    base_snapshot[name] = param.data.clone().detach()

ARGS = {
    'model': model,
    'base_snapshot': base_snapshot
}
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 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
BiEncoderSide Not yet run
unverified (harvested, no recorded run)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("d937c306d603237c")
How it ran

no invocation recorded.

barrier Not yet run
unverified (harvested, no recorded run)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("85795bf4b228dcd0")
How it ran

no invocation recorded.

cleanup_distributed Not yet run
unverified (harvested, no recorded run)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("f0c662063ea71a4d")
How it ran

no invocation recorded.

configure_faiss_index Not yet run
unverified (harvested, no recorded run)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("7aa3ce7c80e785e2")
How it ran

no invocation recorded.

lm_loglikelihood_of_continuation Not yet run
unverified (harvested, no recorded run)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("263d98699e78358a")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
heshandevaka/ARMOR/retriever_training/train_armor.py
code served (permissive licence) · get_code("fd86ed415f30d13b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 33 samples lifted from this paper's linked repositories, 33 carry a function identity and 0 do not. Of the 33 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 0 later) and 32 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
is_main_process
brick of this paper's assembly: helper
7 other papers
6 dated earlier, 1 the same month · 6 only as an assembly brick
1706.02690 (2017-06)
Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networks
2203.10807 (2022-03)
ViM: Out-Of-Distribution with Virtual-logit Matching
2309.14888 (2023-09)
Nearest Neighbor Guidance for Out-of-Distribution Detection
and 4 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-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

Telecom question answering (QA) is a challenging setting for retrieval-augmented generation (RAG): evidence is fragmented across standards, papers, encyclopedic resources, and web documents, and answers often hinge on technical tables, equations, and specialized protocol language. In low-resource subdomains, generator fine-tuning can over-specialize and degrade general capability, making query-side retriever adaptation an attractive alternative. To this end, we ask whether a fixedgenerator, query-adapted RAG system can outperform generator-side adaptation, and which retriever objectives best support that setting. We motivate retrieval, rather than generator fine-tuning, as the adaptation target through a capacity comparison: under bounded-parameter and soft-retrieval assumptions, query-encoder tuning can have a smaller estimation term than supervised fine-tuning when its effective dimension is smaller. We identify two particularly relevant objectives-the latentdocument RAG likelihood, which optimizes generation utility, and the InfoNCE contrastive objective, which improves semantic retrieval geometry-and leverage them jointly through a retriever optimization method targeting downstream QA performance in the telecom domain. Specifically, we introduce ARMOR, Adaptive Regularized Mixture Optimization for Retrievers, which learns separate temperatures for the RAG retrieval distribution and InfoNCE softmax and regularizes the adapted query encoder toward the frozen base query encoder. Across telecomspecific retrieval and generative QA benchmarks, we show that ARMOR improves evidence retrieval and answer generation in several in-domain settings. Code is available at https://github.com/heshandevaka/ARMOR.git.

For agents

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

get_harvested_code_for_paper("2606.29706")
get_code_for_paper("2606.29706")
have("2606.29706")

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

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

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

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

Connect an agent — have() is free.