SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.12307 · 2023

LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 2 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/2309.12307.json · badge: /api/ran/2309.12307.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
dvlab-research/longlora canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
dexter-gt-86/sinklora extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dvlab-research/longlora/gptneox_attn_replace.py
code served (permissive licence) · get_code("69a0f4765d90c784")
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 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)

# Small batch size, hidden dimensions that are even (for rotate_half)
batch_size = 2
num_heads = 3
seq_len = 4
head_dim = 4

# q: (batch_size, num_heads, seq_len, head_dim)
q = torch.randn(batch_size, num_heads, seq_len, head_dim)

# k: (batch_size, num_heads, seq_len, head_dim)
k = torch.randn(batch_size, num_heads, seq_len, head_dim)

# cos: (1, num_heads, max_pos, head_dim)
# The function gathers from dimension 2, so we need sufficient sequence length
max_pos = 8
cos = torch.randn(1, num_heads, max_pos, head_dim)

# sin: (1, num_heads, max_pos, head_dim)
sin = torch.randn(1, num_heads, max_pos, head_dim)

# position_ids: (batch_size, seq_len)
# Values should be valid indices into the max_pos dimension
position_ids = torch.tensor([[0, 1, 2, 3], [1, 2, 3, 4]], 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, 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 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
build_generator Ran
ran; our contract draft was wrong, not the code
dvlab-research/longlora/inference-qlora.py
code served (permissive licence) · get_code("6825ff72a7589319")
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 function. 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 transformers import GenerationConfig, TextStreamer, BitsAndBytesConfig

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.model_max_length = 512
    
    def __call__(self, prompt, return_tensors=None):
        # Return a mock input_ids tensor
        batch_size = 1
        seq_len = 10
        input_ids = torch.randint(0, 1000, (batch_size, seq_len))
        attention_mask = torch.ones((batch_size, seq_len))
        
        class TokenizerOutput:
            def __init__(self, input_ids, attention_mask):
                self.input_ids = input_ids
                self.attention_mask = attention_mask
            
            def to(self, device):
                return self
            
            def __iter__(self):
                yield self.input_ids
                yield self.attention_mask
            
            def keys(self):
                return ['input_ids', 'attention_mask']
            
            def __getitem__(self, key):
                if key == 'input_ids':
                    return self.input_ids
                elif key == 'attention_mask':
                    return self.attention_mask
        
        return TokenizerOutput(input_ids, attention_mask)
    
    def decode(self, token_ids, skip_special_tokens=False):
        return "This is a test prompt response output text"

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(10, 8)
        self.device_attr = torch.device('cpu')
    
    @property
    def device(self):
        return self.device_attr
    
    def generate(self, input_ids=None, attention_mask=None, max_new_tokens=None, 
                 temperature=None, top_p=None, use_cache=None, streamer=None):
        # Return mock generated token ids
        batch_size = input_ids.shape[0] if input_ids is not None else 1
        total_len = 15
        output = torch.randint(0, 1000, (batch_size, total_len))
        return output

model = MockModel()
tokenizer = MockTokenizer()

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'temperature': 0.6,
    'top_p': 0.9,
    'max_gen_len': 4096,
    'use_cache': True
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
build_generator Ran
ran; our contract draft was wrong, not the code
dvlab-research/longlora/inference.py
code served (permissive licence) · get_code("ac1119ee1865680d")
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 function. 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 transformers import GenerationConfig, TextStreamer

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.model_max_length = 512
        self.pad_token_id = 0
        self.eos_token_id = 2
    
    def __call__(self, prompt, return_tensors=None):
        # Return mock token ids
        token_ids = torch.tensor([[1, 2, 3, 4]], dtype=torch.long)
        if return_tensors == 'pt':
            return {'input_ids': token_ids, 'attention_mask': torch.ones_like(token_ids)}
        return {'input_ids': token_ids}
    
    def decode(self, token_ids, skip_special_tokens=False):
        # Mock decode that returns a string with prompt and response
        return "<s> This is the original prompt This is the generated response"

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.device_attr = 'cpu'
        self.linear = nn.Linear(4, 8)
    
    @property
    def device(self):
        return self.device_attr
    
    def generate(self, input_ids, attention_mask=None, max_new_tokens=None, 
                 temperature=None, top_p=None, use_cache=None, streamer=None):
        # Return mock generated token ids
        batch_size = input_ids.shape[0]
        return torch.tensor([[1, 2, 3, 4, 5, 6]], dtype=torch.long)

model = MockModel()
tokenizer = MockTokenizer()

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'temperature': 0.6,
    'top_p': 0.9,
    'max_gen_len': 4096,
    'use_cache': True,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
generate_prompt_landmark Ran
ran; our contract draft was wrong, not the code
dvlab-research/longlora/passkey_retrivial.py
code served (permissive licence) · get_code("7a94ab5fa9fb06b7")
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 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.

from numpy import random

ARGS = {
    'n_garbage': 100,
    'seed': 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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 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
greedy_generate Ran
ran; our contract draft was wrong, not the code
dvlab-research/longlora/run_streaming_llama_longalpaca.py
code served (permissive licence) · get_code("0a11ee057df336ca")
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 list, ndim 6, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal model that satisfies the function's usage
class MinimalLM(nn.Module):
    def __init__(self, vocab_size=100, hidden_dim=4, num_layers=2):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.lm_head = nn.Linear(hidden_dim, vocab_size)
        self.num_layers = num_layers
        
    def forward(self, input_ids, past_key_values=None, use_cache=False):
        # input_ids shape: (batch_size, seq_len)
        x = self.embedding(input_ids)  # (batch_size, seq_len, hidden_dim)
        
        # Simulate transformer output
        x = x.mean(dim=1, keepdim=True)  # (batch_size, 1, hidden_dim)
        logits = self.lm_head(x)  # (batch_size, 1, vocab_size)
        
        # Create mock past_key_values (list of tuples for each layer)
        if use_cache:
            past_key_values = [
                (torch.randn(2, 4, 4, 4), torch.randn(2, 4, 4, 4))
                for _ in range(self.num_layers)
            ]
        
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        output.past_key_values = past_key_values
        return output

# Build a minimal tokenizer
class MinimalTokenizer:
    def __init__(self):
        self.eos_token_id = 2
        self.vocab = {i: f"token_{i}" for i in range(100)}
        self.vocab[2] = "</s>"
    
    def decode(self, token_ids, skip_special_tokens=False, clean_up_tokenization_spaces=False, spaces_between_special_tokens=False):
        words = []
        for tid in token_ids:
            if tid == 2 and skip_special_tokens:
                continue
            words.append(self.vocab.get(tid, f"unk_{tid}"))
        return " ".join(words)

# Create instances
model = MinimalLM(vocab_size=100, hidden_dim=4, num_layers=2)
tokenizer = MinimalTokenizer()
input_ids = torch.tensor([[5, 10, 15]], dtype=torch.long)  # (batch_size=1, seq_len=3)
past_key_values = None
max_gen_len = 5

ARGS = {
    "model": model,
    "tokenizer": tokenizer,
    "input_ids": input_ids,
    "past_key_values": past_key_values,
    "max_gen_len": max_gen_len,
}
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 list, ndim 6, 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
jload Ran
ran; our contract draft was wrong, not the code
dvlab-research/longlora/supervised-fine-tune-qlora.py
code served (permissive licence) · get_code("d07d04439cd1d44f")
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 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 io
import json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

with open(temp_file, 'w') as f:
    json.dump(test_data, f)

# Define ARGS with the file path
ARGS = {
    "f": temp_file,
    "mode": "r"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
passkey_retrieval_test Ran
ran, honoured the contract we drafted
dvlab-research/longlora/passkey_retrivial.py
code served (permissive licence) · get_code("34957aa45775f8d7")
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. 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
from numpy import random

torch.manual_seed(0)

class MockTokenizer:
    def __call__(self, text, return_tensors=None):
        # Simple tokenizer: hash text to consistent token ids
        tokens = [hash(text) % 1000 for _ in range(10)]
        input_ids = torch.tensor([tokens], dtype=torch.long)
        
        class Output:
            def __init__(self, ids):
                self.input_ids = ids
            
            def __getitem__(self, idx):
                return self.input_ids[idx]
        
        return Output(input_ids)

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 8)
    
    def generate(self, input_ids, max_new_tokens, num_beams, use_cache=False):
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1]
        # Return generation with the new tokens appended
        new_tokens = torch.randint(0, 1000, (batch_size, max_new_tokens))
        output = torch.cat([input_ids, new_tokens], dim=1)
        return output

tokenizer = MockTokenizer()
model = MockModel()
device = 'cpu'

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'device': device,
    'use_cache': False,
    'n_garbage': 1000,
    'seed': 666
}
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 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
preprocess Ran
ran; our contract draft was wrong, not the code
dvlab-research/longlora/supervised-fine-tune-qlora.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from GCYZSL/O3-LLM-UNLEARNING, is pointer only (licence: NONE) · get_code("817d5f759487007d")
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 GCYZSL/O3-LLM-UNLEARNING, 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.

read_txt_file Ran
ran; our contract draft was wrong, not the code
dexter-gt-86/sinklora/inference.py
code served (permissive licence) · get_code("fd83f4f62a5a7d95")
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 tempfile
import os

# Create a temporary text file to read
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "material.txt")

# Write some sample content to the file
with open(temp_file, 'w') as f:
    f.write("This is line 1\n")
    f.write("This is line 2\n")
    f.write("This is line 3\n")

ARGS = {
    'material_txt': temp_file
}
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 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
rotate_half Ran
ran; our contract draft was wrong, not the code
dvlab-research/longlora/gptneox_attn_replace.py
code served (permissive licence) · get_code("e03d53ba9d4f9ae5")
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 takes a single parameter 'x' which is a tensor
# It accesses x[..., :x.shape[-1] // 2] and x[..., x.shape[-1] // 2:]
# So x needs to be a tensor with a last dimension that can be split in half
# Let's create a small tensor with batch size 2 and feature dimension 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_fn Ran
ran; our contract draft was wrong, not the code
dexter-gt-86/sinklora/fine-tune.py
code served (permissive licence) · get_code("ad4c52b7c7083143")
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)

# Create a minimal tokenizer stand-in that has the required attributes/methods
class MinimalTokenizer:
    def __init__(self):
        self.eos_token = "[EOS]"
        self.model_max_length = 4
    
    def __call__(self, text, truncation=False, return_tensors=None, pad_to_multiple_of=None, padding=False):
        # Simulate tokenization: convert text to token ids
        # Return a dict with 'input_ids' key
        # We'll create a tensor of shape (1, 8) to test the view(-1, context_length) operation
        token_ids = torch.tensor([[1, 2, 3, 4, 5, 6, 7, 8]], dtype=torch.long)
        return {'input_ids': token_ids}

# Create example input
example = {
    'text': ['hello world', 'foo bar baz']
}

tokenizer = MinimalTokenizer()

ARGS = {
    'tokenizer': tokenizer,
    'example': example
}
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
forward_noflashattn Not yet run
unverified (harvested, no recorded run)
dvlab-research/longlora/llama_attn_replace.py
code served (permissive licence) · get_code("16874ed1d391bd65")
How it ran

no invocation recorded.

make_supervised_data_module Not yet run
unverified (harvested, no recorded run)
dvlab-research/longlora/supervised-fine-tune-qlora.py
code served (permissive licence) · get_code("fa5531158d53f0a8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 8 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 3 the same month, 7 later) and 4 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
24 dated earlier, 3 the same month, 330 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
jload 46 other papers
9 dated earlier, 1 the same month, 36 later
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
2305.12870 (2023-05)
Lion: Adversarial Distillation of Proprietary Large Language Models
2305.13068 (2023-05)
Making Language Models Better Tool Learners with Execution Feedback
and 43 more not named here
preprocess 23 other papers
4 dated earlier, 19 later
2305.12870 (2023-05)
Lion: Adversarial Distillation of Proprietary Large Language Models
2306.17194 (2023-06)
On the Exploitability of Instruction Tuning
2308.07286 (2023-08)
The Devil is in the Errors: Leveraging Large Language Models for Fine-grained Machine Translation Evaluation
and 20 more not named here
make_supervised_data_module 2 other papers
1 dated earlier, 1 later
2308.06259 (2023-08)
Self-Alignment with Instruction Backtranslation
2406.02395 (2024-06)
GrootVL: Tree Topology is All You Need in State Space Model
tokenize_fn 2 other papers
2 later
2409.12181 (2024-09)
A Controlled Study on Long Context Extension and Generalization in LLMs
aaai_34662 (2025 (year only))
3D-RPE: Enhancing Long-Context Modeling Through 3D Rotary Position Encoding
forward_noflashattn 1 other paper
1 later
2402.10886 (2024-02)
Reviewer2: Optimizing Review Generation Through Prompt Generation
generate_prompt_landmark 1 other paper
1 later
2404.07143 (2024-04)
Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention
greedy_generate 1 other paper
1 the same month
2309.17453 (2023-09)
Efficient Streaming Language Models with Attention Sinks

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

We present LongLoRA, an efficient fine-tuning approach that extends the context sizes of pre-trained large language models (LLMs), with limited computation cost. Typically, training LLMs with long context sizes is computationally expensive, requiring extensive training hours and GPU resources. For example, training on the context length of 8192 needs 16x computational costs in self-attention layers as that of 2048. In this paper, we speed up the context extension of LLMs in two aspects. On the one hand, although dense global attention is needed during inference, fine-tuning the model can be effectively and efficiently done by sparse local attention. The proposed shifted sparse attention effectively enables context extension, leading to non-trivial computation saving with similar performance to fine-tuning with vanilla attention. Particularly, it can be implemented with only two lines of code in training, while being optional in inference. On the other hand, we revisit the parameter-efficient fine-tuning regime for context expansion. Notably, we find that LoRA for context extension works well under the premise of trainable embedding and normalization. LongLoRA combines this improved LoRA with S^2-Attn. LongLoRA demonstrates strong empirical results on various tasks on Llama2 models from 7B/13B to 70B. LongLoRA extends Llama2 7B from 4k context to 100k, or Llama2 70B to 32k on a single 8x A100 machine. LongLoRA extends models' context while retaining their original architectures, and is compatible with most existing techniques, like Flash-Attention2. In addition, we further conduct supervised fine-tuning with LongLoRA and our long instruction-following LongAlpaca dataset.

For agents

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

get_harvested_code_for_paper("2309.12307")
get_code_for_paper("2309.12307")
have("2309.12307")

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

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

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

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

Connect an agent — have() is free.