SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.00132 · 2024

QuanTA: Efficient High-Rank Fine-Tuning of LLMs with Quantum-Informed Tensor Adaptation

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 3 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/2406.00132.json · badge: /api/ran/2406.00132.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
quanta-fine-tuning/quanta canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
bloom_model_postprocess_past_key_value Ran
ran; our contract draft was wrong, not the code
quanta-fine-tuning/quanta/quanta/quanta/utils/other.py
code served (permissive licence) · get_code("ecf94b05123201e3")
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

torch.manual_seed(0)

# Construct past_key_values as a list of tensors
# The function expects to concatenate them into shape:
# (total_layers, batch_size, num_attention_heads, num_virtual_tokens, head_dim)

batch_size = 2
num_attention_heads = 3
num_virtual_tokens = 4
head_dim = 5
total_layers = 6

# Create a list of tensors that will be concatenated
# Each tensor has shape (1, batch_size, num_attention_heads, num_virtual_tokens, head_dim)
past_key_values = [
    torch.randn(1, batch_size, num_attention_heads, num_virtual_tokens, head_dim)
    for _ in range(total_layers)
]

ARGS = {
    "past_key_values": past_key_values
}
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
calculate_metric Ran
ran, honoured the contract we drafted
quanta-fine-tuning/quanta/run/utils/metrics.py
code served (permissive licence) · get_code("add335e0714d42b3")
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 float64, 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 numpy as np

class Prediction:
    def __init__(self, correct_candidate, predicted_candidate):
        self.correct_candidate = correct_candidate
        self.predicted_candidate = predicted_candidate

# Test case 1: accuracy metric with list of correct candidates
predictions_accuracy = [
    Prediction(['cat', 'dog'], 'cat'),
    Prediction(['bird', 'plane'], 'bird'),
]

# Test case 2: em metric
predictions_em = [
    Prediction(['the quick brown fox'], 'quick brown fox'),
    Prediction(['hello world'], 'hello world'),
]

# Test case 3: f1 metric
predictions_f1 = [
    Prediction(['the cat is here'], 'cat is here'),
    Prediction(['CANNOTANSWER'], 'cannotanswer'),
]

# Test case 4: math metric with numeric answers
predictions_math = [
    Prediction('42', '42.0001'),
    Prediction('A', 'The answer is A'),
]

ARGS = {
    'predictions': predictions_accuracy,
    'metric_name': 'accuracy'
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
encode_prompt Ran
ran; our contract draft was wrong, not the code
quanta-fine-tuning/quanta/run/utils/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zimingyy/subzero, is pointer only (licence: GPL-3.0) · get_code("f53e3216ab15d617")
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 zimingyy/subzero, 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.

forward_wrap_with_option_len Ran
ran; our contract draft was wrong, not the code
quanta-fine-tuning/quanta/run/utils/utils.py
code served (permissive licence) · get_code("b5c3235f294e77c4")
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 CausalLMOutputWithPast. 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 torch.nn.functional as F
from transformers.modeling_outputs import CausalLMOutputWithPast

torch.manual_seed(0)

# Create a minimal config class
class MinimalConfig:
    def __init__(self):
        self.pad_token_id = 0
        self.vocab_size = 5

# Create a minimal model that has the structure needed
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = MinimalConfig()
        self.embedding = nn.Embedding(5, 4)
        self.lm_head = nn.Linear(4, 5)
    
    def original_forward(self, input_ids=None, **kwargs):
        # Simulate the original forward pass
        batch_size, seq_len = input_ids.shape
        hidden_states = self.embedding(input_ids)
        logits = self.lm_head(hidden_states)
        
        return CausalLMOutputWithPast(
            loss=None,
            logits=logits,
            past_key_values=None,
            hidden_states=hidden_states,
            attentions=None
        )

# Instantiate model
model = MinimalModel()

# Create tensors
batch_size = 2
seq_len = 3
vocab_size = 5

input_ids = torch.randint(1, vocab_size, (batch_size, seq_len))
labels = torch.randint(0, batch_size, (batch_size,))

# Setup arguments
ARGS = {
    'self': model,
    'input_ids': input_ids,
    'labels': labels,
    'option_len': [1, 2],
    'num_options': [2, 2],
    'return_dict': 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 CausalLMOutputWithPast — a CausalLMOutputWithPast output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CausalLMOutputWithPast 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
is_numeric Ran
ran, violated the contract we drafted
quanta-fine-tuning/quanta/run/utils/metrics.py
code served (permissive licence) · get_code("9dfc4c4547d0b93e")
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
import numpy as np

torch.manual_seed(0)

def setup():
    # The function is_numeric takes a parameter 's' which it attempts to convert to float
    # It returns True if successful, False if ValueError is raised
    # So 's' should be a string or string-like object
    
    s = "3.14"
    
    return {"s": s}

ARGS = setup()
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 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
normalize_answer Ran
ran; our contract draft was wrong, not the code
quanta-fine-tuning/quanta/run/utils/metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from borealisai/radar-decoding, is pointer only (licence: LGPL-3.0) · get_code("e7e75981cb464788")
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 borealisai/radar-decoding, and LGPL-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.

prepare_model_for_int8_training Ran
ran; our contract draft was wrong, not the code
quanta-fine-tuning/quanta/quanta/quanta/utils/other.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from gccnlp/light-peft, is pointer only (licence: NONE) · get_code("f3ce42648e83a4dd")
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 gccnlp/light-peft, 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.

shift_tokens_right Ran
ran; our contract draft was wrong, not the code
quanta-fine-tuning/quanta/quanta/quanta/utils/other.py
code served (permissive licence) · get_code("5af2b785cc55d3ea")
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 int, 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 a batch of input_ids with shape (batch_size=2, sequence_length=4)
input_ids = torch.tensor([
    [101, 2054, 2003, 102],
    [101, 2054, 2054, 102]
], dtype=torch.long)

# Define pad_token_id and decoder_start_token_id
pad_token_id = 0
decoder_start_token_id = 2

ARGS = {
    "input_ids": input_ids,
    "pad_token_id": pad_token_id,
    "decoder_start_token_id": decoder_start_token_id,
}
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 int, 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
get_peft_model_state_dict Not yet run
unverified (harvested, no recorded run)
quanta-fine-tuning/quanta/quanta/quanta/utils/save_and_load.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from gccnlp/light-peft, is pointer only (licence: NONE) · get_code("6405b3acf7821b9d")
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 gccnlp/light-peft, 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. No invocation recorded.

get_task Not yet run
unverified (harvested, no recorded run)
quanta-fine-tuning/quanta/run/utils/tasks.py
code served (permissive licence) · get_code("f7c384f1e681ea7a")
How it ran

no invocation recorded.

set_peft_model_state_dict Not yet run
unverified (harvested, no recorded run)
quanta-fine-tuning/quanta/quanta/quanta/utils/save_and_load.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from gccnlp/light-peft, is pointer only (licence: NONE) · get_code("fbb3cd1c8af5bf8e")
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 gccnlp/light-peft, 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. No invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 8 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 6 the same month, 5 later) and 3 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
normalize_answer 133 other papers
77 dated earlier, 8 the same month, 47 later, 1 undated · 1 only as an assembly brick
1508.06615 (2015-08)
Character-Aware Neural Language Models
1606.05250 (2016-06)
SQuAD: 100,000+ Questions for Machine Comprehension of Text
1608.07905 (2016-08)
Machine Comprehension Using Match-LSTM and Answer Pointer
and 130 more not named here
shift_tokens_right 18 other papers
12 dated earlier, 2 the same month, 4 later · 1 only as an assembly brick
2021.acl-demo.21 (2021 (year only))
KuiLeiXi: a Chinese Open-Ended Text Adventure Game
2203.07836 (2022-03)
Graph Pre-training for AMR Parsing and Generation
2203.11239 (2022-03)
DQ-BART: Efficient Sequence-to-Sequence Model via Joint Distillation and Quantization
and 15 more not named here
get_task 7 other papers
4 dated earlier, 3 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2310.09639 (2023-10)
DPZero: Private Fine-Tuning of Language Models without Backpropagation
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
and 4 more not named here
bloom_model_postprocess_past_key_value 5 other papers
1 dated earlier, 1 the same month, 3 later
2405.12130 (2024-05)
MoRA: High-Rank Updating for Parameter-Efficient Fine-Tuning
2406.03792 (2024-06)
Light-PEFT: Lightening Parameter-Efficient Fine-Tuning via Early Pruning
2409.10673 (2024-09)
A Bayesian Interpretation of Adaptive Low-Rank Adaptation
and 2 more not named here
encode_prompt 2 other papers
1 dated earlier, 1 later
2402.11592 (2024-02)
Revisiting Zeroth-Order Optimization for Memory-Efficient LLM Fine-Tuning: A Benchmark
2410.08989 (2024-10)
Zeroth-Order Fine-Tuning of LLMs in Random Subspaces
get_peft_model_state_dict 1 other paper
1 the same month
2406.03792 (2024-06)
Light-PEFT: Lightening Parameter-Efficient Fine-Tuning via Early Pruning
prepare_model_for_int8_training 1 other paper
1 the same month
2406.03792 (2024-06)
Light-PEFT: Lightening Parameter-Efficient Fine-Tuning via Early Pruning
set_peft_model_state_dict 1 other paper
1 the same month
2406.03792 (2024-06)
Light-PEFT: Lightening Parameter-Efficient Fine-Tuning via Early Pruning

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 propose Quantum-informed Tensor Adaptation (QuanTA), a novel, easy-to-implement, fine-tuning method with no inference overhead for large-scale pre-trained language models. By leveraging quantum-inspired methods derived from quantum circuit structures, QuanTA enables efficient high-rank fine-tuning, surpassing the limitations of Low-Rank Adaptation (LoRA)--low-rank approximation may fail for complicated downstream tasks. Our approach is theoretically supported by the universality theorem and the rank representation theorem to achieve efficient high-rank adaptations. Experiments demonstrate that QuanTA significantly enhances commonsense reasoning, arithmetic reasoning, and scalability compared to traditional methods. Furthermore, QuanTA shows superior performance with fewer trainable parameters compared to other approaches and can be designed to integrate with existing fine-tuning algorithms for further improvement, providing a scalable and efficient solution for fine-tuning large language models and advancing state-of-the-art in natural language processing.

For agents

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

get_harvested_code_for_paper("2406.00132")
get_code_for_paper("2406.00132")
have("2406.00132")

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

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

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

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

Connect an agent — have() is free.