SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.05695 · 2023

ReLoRA: High-Rank Training Through Low-Rank Updates

arXiv · PDF · Open in the Atlas

Code that ran

8 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 7 failures of our instrument; 6 no recorded run), measured 2026-11-23; 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/2307.05695.json · badge: /api/ran/2307.05695.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
guitaricet/peft_pretraining canonical (classifier label)
classifier basis: census
8 ran · 4 no recorded run
guitaricet/relora canonical (classifier label)
classifier basis: census
0 ran · 2 no recorded run
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
guitaricet/peft_pretraining/peft_pretraining/modeling_llama.py
code served (permissive licence) · get_code("f725bc2d76076485")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 5, 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

torch.manual_seed(0)

# Create small tensors for q and k
# Shape: (batch_size=2, seq_len=3, hidden_dim=4)
q = torch.randn(2, 3, 4)
k = torch.randn(2, 3, 4)

# Create cos and sin tensors
# The function squeezes dimensions 1 and 0, then indexes by position_ids
# So we need shape that allows this: (1, 1, seq_len, hidden_dim)
cos = torch.randn(1, 1, 5, 4)
sin = torch.randn(1, 1, 5, 4)

# Create position_ids
# Shape: (batch_size=2, seq_len=3)
position_ids = torch.tensor([[0, 1, 2], [1, 2, 3]])

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
    "position_ids": position_ids,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, dtype family float — 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
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
guitaricet/peft_pretraining/peft_pretraining/modeling_pythia.py
code served (permissive licence) · get_code("9b4dff79d5e6102c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 5, 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

torch.manual_seed(0)

# Analyze the function to understand tensor shapes:
# q, k: used in element-wise operations with cos, sin
# cos, sin: gathered using position_ids, shape [batch, heads, seq_len, dim]
# position_ids: shape [batch, seq_len], used to gather from cos/sin at dim 2

batch_size = 2
num_heads = 3
seq_len = 4
head_dim = 4

# q and k: [batch, heads, seq_len, head_dim]
q = torch.randn(batch_size, num_heads, seq_len, head_dim)
k = torch.randn(batch_size, num_heads, seq_len, head_dim)

# cos and sin: [1, heads, seq_len, head_dim] (will be repeated to batch_size)
cos = torch.randn(1, num_heads, seq_len, head_dim)
sin = torch.randn(1, num_heads, seq_len, head_dim)

# position_ids: [batch, seq_len] with values in range [0, seq_len)
position_ids = torch.tensor([
    [0, 1, 2, 3],
    [0, 1, 2, 3]
], dtype=torch.long)

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
    "position_ids": position_ids,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, dtype family float — 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
attention_mask_func Ran
ran; our contract draft was wrong, not the code
guitaricet/peft_pretraining/peft_pretraining/modeling_pythia.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from pkumelon/Golore, is pointer only (licence: GPL-3.0) · get_code("4397f33726a2999e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from pkumelon/Golore, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_cyclical_cosine_schedule_with_min_lr Ran
ran; our contract draft was wrong, not the code
guitaricet/peft_pretraining/peft_pretraining/training_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from QiaoXiao7282/SMET, is pointer only (licence: NONE) · get_code("f58a7fbb020fe7cd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from QiaoXiao7282/SMET, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_scheculer Ran
ran; our contract draft was wrong, not the code
guitaricet/peft_pretraining/peft_pretraining/training_utils.py
code served (permissive licence) · get_code("08daf3e9bcd8741a")
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 LambdaLR. 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 torch.optim import SGD

torch.manual_seed(0)

# Create a minimal model
class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create optimizer
model = TinyModel()
optimizer = SGD(model.parameters(), lr=0.1)

# Define arguments for get_scheculer
ARGS = {
    'optimizer': optimizer,
    'scheduler_type': 'cosine',
    'num_training_steps': 1000,
    'warmup_steps': 100,
    'min_lr_ratio': 0.1,
    'cycle_length': 1000,
    'restart_warmup_steps': None,
    'adjust_step': 0,
    'last_epoch': -1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LambdaLR — a LambdaLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LambdaLR 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
make_data_loader Ran
ran on a synthesized input
guitaricet/peft_pretraining/peft_pretraining/megatron_dataset/dataloader.py
code served (permissive licence) · get_code("d49462681436c44b")
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 DataLoader. 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.utils.data

torch.manual_seed(0)

class SimpleDataset(torch.utils.data.Dataset):
    """Minimal dataset implementation."""
    def __init__(self, size=8):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return torch.randn(4), torch.randint(0, 2, (1,)).item()

dataset = SimpleDataset(size=8)
batch_size = 2
num_workers = 0

ARGS = {
    'dataset': dataset,
    'batch_size': batch_size,
    'num_workers': num_workers,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
loguru, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
rotate_half Ran
ran; our contract draft was wrong, not the code
guitaricet/peft_pretraining/peft_pretraining/modeling_llama.py
code served (permissive licence) · get_code("b99eea6376d1e212")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned 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)

# The function rotate_half takes a single parameter 'x' which is a tensor
# It accesses x.shape[-1] to get the last dimension
# It uses indexing with [..., :] slicing notation
# It calls torch.cat() to concatenate tensors

# Create a small tensor with shape (2, 4) - batch size 2, hidden dim 4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
tokenize_and_chunk Ran
ran; our contract draft was wrong, not the code
guitaricet/peft_pretraining/peft_pretraining/dataloader.py
code served (permissive licence) · get_code("cb60aa6ee1172448")
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 DatasetDict. 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 multiprocessing
from transformers import AutoTokenizer
from datasets import Dataset, DatasetDict

torch.manual_seed(0)

# Create a minimal stand-in tokenizer with required methods
class StandInTokenizer:
    def __init__(self):
        self.eos_token = "</s>"
    
    def __call__(self, texts):
        # Return a dict with input_ids and attention_mask
        # Simulate tokenization by creating token sequences
        input_ids = []
        attention_mask = []
        for text in texts:
            tokens = [1, 2, 3, 4, 5]  # Simulate token IDs
            input_ids.append(tokens)
            attention_mask.append([1] * len(tokens))
        return {
            "input_ids": input_ids,
            "attention_mask": attention_mask
        }

# Create a minimal dataset
def create_test_dataset():
    data = {
        "text": [
            "Hello world example one",
            "Another text sample",
            "Third example here",
            "Fourth text block"
        ]
    }
    dataset = Dataset.from_dict(data)
    # Create a DatasetDict with train split
    dataset_dict = DatasetDict({
        "train": dataset
    })
    return dataset_dict

tokenizer = StandInTokenizer()
dataset = create_test_dataset()
text_field = "text"
sequence_length = 8
num_cpu = 2

ARGS = {
    "tokenizer": tokenizer,
    "dataset": dataset,
    "text_field": text_field,
    "sequence_length": sequence_length,
    "num_cpu": num_cpu
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, loguru, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DatasetDict — a DatasetDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DatasetDict 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
check_args_torchrun_main Not yet run
unverified (harvested, no recorded run)
guitaricet/peft_pretraining/peft_pretraining/args_utils.py
code served (permissive licence) · get_code("986b5739285a8cbf")
How it ran

no invocation recorded.

evaluate_model Not yet run
unverified (harvested, no recorded run)
guitaricet/relora/torchrun_main.py
code served (permissive licence) · get_code("6cd1023ec2204c22")
How it ran

no invocation recorded.

infer_dataset_impl Not yet run
unverified (harvested, no recorded run)
guitaricet/peft_pretraining/peft_pretraining/megatron_dataset/indexed_dataset.py
code served (permissive licence) · get_code("a02bf1a7d404234a")
How it ran

no invocation recorded.

make_builder Not yet run
unverified (harvested, no recorded run)
guitaricet/peft_pretraining/peft_pretraining/megatron_dataset/indexed_dataset.py
code served (permissive licence) · get_code("8f615d9849c1a372")
How it ran

no invocation recorded.

make_dataset Not yet run
unverified (harvested, no recorded run)
guitaricet/peft_pretraining/peft_pretraining/megatron_dataset/indexed_dataset.py
code served (permissive licence) · get_code("a4741eec9c94fa3c")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
guitaricet/relora/pretokenize.py
code served (permissive licence) · get_code("72e11d65aa630194")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 7 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 3 the same month, 7 later) and 7 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
rotate_half 360 other papers
10 dated earlier, 5 the same month, 342 later, 3 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here
apply_rotary_pos_emb 83 other papers
1 dated earlier, 3 the same month, 79 later · 6 only as an assembly brick
2306.15595 (2023-06)
Extending Context Window of Large Language Models via Positional Interpolation
2307.06945 (2023-07)
In-context Autoencoder for Context Compression in a Large Language Model
2307.08072 (2023-07)
Do Emergent Abilities Exist in Quantized Large Language Models: An Empirical Study
and 80 more not named here
apply_rotary_pos_emb 47 other papers
4 dated earlier, 1 the same month, 42 later
2305.14167 (2023-05)
DetGPT: Detect What You Need via Reasoning
2305.16103 (2023-05)
ChatBridge: Bridging Modalities with Large Language Model as a Language Catalyst
2305.16355 (2023-05)
PandaGPT: One Model To Instruction-Follow Them All
and 44 more not named here
get_cyclical_cosine_schedule_with_min_lr 7 other papers
7 later
2406.02214 (2024-06)
SLTrain: a sparse plus low-rank approach for parameter and memory efficient pretraining
2407.08296 (2024-07)
Q-GaLore: Quantized GaLore with INT4 Projection and Layer-Adaptive Low-Rank Gradients
2408.12857 (2024-08)
Memory-Efficient LLM Training with Online Subspace Descent
and 4 more not named here
attention_mask_func 4 other papers
4 later
2311.13230 (2023-11)
Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus
2403.19928 (2024-03)
DiJiang: Efficient Large Language Models through Compact Kernelization
2409.01193 (2024-09)
CLIBE: Detecting Dynamic Backdoors in Transformer-based NLP Models
and 1 more not named here
get_scheculer 3 other papers
3 later
2406.02214 (2024-06)
SLTrain: a sparse plus low-rank approach for parameter and memory efficient pretraining
2407.08296 (2024-07)
Q-GaLore: Quantized GaLore with INT4 Projection and Layer-Adaptive Low-Rank Gradients
2408.12857 (2024-08)
Memory-Efficient LLM Training with Online Subspace Descent
infer_dataset_impl 1 other paper
1 later
2410.17215 (2024-10)
MiniPLM: Knowledge Distillation for Pre-Training Language Models

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

Despite the dominance and effectiveness of scaling, resulting in large networks with hundreds of billions of parameters, the necessity to train overparameterized models remains poorly understood, while training costs grow exponentially. In this paper, we explore parameter-efficient training techniques as an approach to training large neural networks. We introduce a novel method called ReLoRA, which utilizes low-rank updates to train high-rank networks. We apply ReLoRA to training transformer language models with up to 1.3B parameters and demonstrate comparable performance to regular neural network training. ReLoRA saves up to 5.5Gb of RAM per GPU and improves training speed by 9-40% depending on the model size and hardware setup. Our findings show the potential of parameter-efficient techniques for large-scale pre-training.

For agents

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

get_harvested_code_for_paper("2307.05695")
get_code_for_paper("2307.05695")
have("2307.05695")

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

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

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

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

Connect an agent — have() is free.