SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.01129 · 2024

RILQ: Rank-Insensitive LoRA-based Quantization Error Compensation for Boosting 2-bit Large Language Model Accuracy

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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 0 have no contract verdict; 4 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2412.01129.json · badge: /api/ran/2412.01129.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
aiha-lab/rilq canonical (classifier label)
classifier basis: census
4 ran · 3 no recorded run
FunctionStatusWhere it lives
collate_data Ran
ran; our contract draft was wrong, not the code
aiha-lab/rilq/rilq_utils/data.py
code served (permissive licence) · get_code("13026bb5f6d06789")
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

torch.manual_seed(0)

# Create sample blocks with input_ids and attention_mask
block1 = {
    'input_ids': torch.randint(0, 100, (2, 4)),  # batch_size=2, seq_len=4
    'attention_mask': torch.ones((2, 4), dtype=torch.long),
}

block2 = {
    'input_ids': torch.randint(0, 100, (2, 3)),  # batch_size=2, seq_len=3 (shorter)
    'attention_mask': torch.ones((2, 3), dtype=torch.long),
}

# Create blocks with labels for testing contain_labels=True
block3 = {
    'input_ids': torch.randint(0, 100, (2, 5)),
    'attention_mask': torch.ones((2, 5), dtype=torch.long),
    'labels': torch.randint(0, 100, (2, 4)),
}

block4 = {
    'input_ids': torch.randint(0, 100, (2, 5)),
    'attention_mask': torch.ones((2, 5), dtype=torch.long),
    'labels': torch.randint(0, 100, (2, 3)),
}

ARGS = {
    'blocks': [block1, block2],
    'contain_labels': False,
    'pad_token_id': 0,
}
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
extract_alpaca_dataset Ran
ran; our contract draft was wrong, not the code
aiha-lab/rilq/rilq_utils/calib_data_loader.py
code served (permissive licence) · get_code("b5445674ab17410f")
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.

# Setup code for extract_alpaca_dataset

ARGS = {
    'example': {
        'instruction': 'What is the capital of France?',
        'input': 'France is a country in Europe.',
        'output': 'The capital of France is Paris.'
    }
}
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
get_gt_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aiha-lab/rilq/rilq_utils/utils.py
code served (permissive licence) · get_code("378e5dcfb3855a58")
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

torch.manual_seed(0)

class MockConfig:
    def __init__(self):
        self.vocab_size = 8
        self.pretraining_tp = 1

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = MockConfig()
        self.lm_head = nn.Linear(4, self.config.vocab_size)
    
    def forward(self, x):
        return self.lm_head(x)

model = MockModel()

# Create input tensor: shape (batch=2, seq_len=5, hidden_dim=4)
input_tensor = torch.randn(2, 5, 4)

# Create labels tensor: shape (batch=2, seq_len=5)
# Labels should be valid vocab indices (0 to vocab_size-1)
labels = torch.randint(0, model.config.vocab_size, (2, 5))

ARGS = {
    "model": model,
    "labels": labels,
    "input_tensor": input_tensor,
    "is_logit": False
}
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
get_target_modules Ran
ran; our contract draft was wrong, not the code
aiha-lab/rilq/rilq_utils/utils.py
code served (permissive licence) · get_code("cdc4db6e5237cfc4")
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 nn.Module with named submodules
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.relu = nn.ReLU()
        self.linear2 = nn.Linear(3, 2)
        self.dropout = nn.Dropout(0.1)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.relu(x)
        x = self.linear2(x)
        x = self.dropout(x)
        return x

module = SimpleModel()

# Target module names to filter by (last component of the full path)
targets = {'linear1', 'relu', 'dropout'}

ARGS = {
    'module': module,
    'targets': targets
}
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
get_logger Not yet run
unverified (harvested, no recorded run)
aiha-lab/rilq/rilq_utils/utils.py
code served (permissive licence) · get_code("0a74f9fd1675c6e9")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
aiha-lab/rilq/rilq_utils/data.py
code served (permissive licence) · get_code("0cfa46cd7236cebe")
How it ran

no invocation recorded.

prepare_dataset Not yet run
unverified (harvested, no recorded run)
aiha-lab/rilq/rilq_utils/data.py
code served (permissive licence) · get_code("2379dffb2ba023d0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
extract_alpaca_dataset 8 other papers
6 dated earlier, 2 later
2305.14314 (2023-05)
QLORA: Efficient Finetuning of Quantized LLMs
2305.16300 (2023-05)
Random-Access Infinite Context Length for Transformers
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 5 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

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

Abstract

Low-rank adaptation (LoRA) has become the dominant method for parameter-efficient LLM fine-tuning, with LoRA-based quantization error compensation (LQEC) emerging as a powerful tool for recovering accuracy in compressed LLMs. However, LQEC has underperformed in sub-4-bit scenarios, with no prior investigation into understanding this limitation. We propose RILQ (Rank-Insensitive LoRA-based Quantization Error Compensation) to understand fundamental limitation and boost 2-bit LLM accuracy. Based on rank analysis revealing model-wise activation discrepancy loss's rank-insensitive nature, RILQ employs this loss to adjust adapters cooperatively across layers, enabling robust error compensation with low-rank adapters. Evaluations on LLaMA-2 and LLaMA-3 demonstrate RILQ's consistent improvements in 2-bit quantized inference across various state-of-the-art quantizers and enhanced accuracy in task-specific fine-tuning. RILQ maintains computational efficiency comparable to existing LoRA methods, enabling adapter-merged weight-quantized LLM inference with significantly enhanced accuracy, making it a promising approach for boosting 2-bit LLM performance. Our code is available at https://github.com/aiha-lab/RILQ.

For agents

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

get_harvested_code_for_paper("2412.01129")
get_code_for_paper("2412.01129")
have("2412.01129")

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

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

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

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

Connect an agent — have() is free.