SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.13952 · 2024

Spectral Adapter: Fine-Tuning in Spectral Space

arXiv · PDF · Open in the Atlas

Code that ran

6 of 12 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; 5 failures of our instrument; 6 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/2405.13952.json · badge: /api/ran/2405.13952.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
pilancilab/spectral_adapter canonical (classifier label)
classifier basis: census
6 ran · 6 no recorded run
FunctionStatusWhere it lives
bind_concept_prompt Ran
ran; our contract draft was wrong, not the code
pilancilab/spectral_adapter/adapter_fusion/spectral/mixofshow/pipelines/pipeline_edlora.py
pointer only (licence: MIT); the stored copy get_code serves, from jiahuadong/cifc, is pointer only (licence: NOASSERTION) · get_code("8dd9f992f25737d0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from jiahuadong/cifc, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

chunk_compute_mse Ran
ran; our contract draft was wrong, not the code
pilancilab/spectral_adapter/adapter_fusion/spectral/spectral_fusion.py
code served (permissive licence) · get_code("a4f1d0bdc88a4543")
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)

# K_target: input tensor of shape (batch_size, input_dim)
K_target = torch.randn(2, 4)

# V_target: target tensor of shape (batch_size, output_dim)
V_target = torch.randn(2, 3)

# W: weight matrix for linear transformation, shape (output_dim, input_dim)
W = torch.randn(3, 4)

# device: CPU device
device = torch.device('cpu')

# chunk_size: integer parameter
chunk_size = 5000

ARGS = {
    'K_target': K_target,
    'V_target': V_target,
    'W': W,
    'device': device,
    'chunk_size': chunk_size
}
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
load_new_concept Ran
ran; our contract draft was wrong, not the code
pilancilab/spectral_adapter/adapter_fusion/spectral/mixofshow/utils/convert_edlora_to_diffusers.py
pointer only (licence: MIT); the stored copy get_code serves, from TencentARC/Mix-of-Show, is pointer only (licence: NOASSERTION) · get_code("f37261b79083dbeb")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from TencentARC/Mix-of-Show, and GitHub could not classify the licence of that repository (NOASSERTION). 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_text Ran
ran; our contract draft was wrong, not the code
pilancilab/spectral_adapter/adapter_fusion/spectral/regionally_controlable_sampling.py
code served (permissive licence) · get_code("227f625068c9b457")
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)

# prompt: a string containing the global text prompt
prompt = "a beautiful landscape with mountains"

# region_prompts: a string with regions separated by '|', each region formatted as:
# [subject]-*-[attribute]-*-[position_list]
# where position_list is a Python-evaluable string representing coordinates
region_prompts = "[dog]-*-[fluffy]-*-[10, 20, 50, 60]|[cat]-*-[orange]-*-[100, 150, 200, 250]|"

# height: image height in pixels
height = 512

# width: image width in pixels
width = 512

ARGS = {
    "prompt": prompt,
    "region_prompts": region_prompts,
    "height": height,
    "width": width,
}
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
sample_image Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
pilancilab/spectral_adapter/adapter_fusion/spectral/regionally_controlable_sampling.py
code served (permissive licence) · get_code("6699803f1989c618")
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 4, 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)

# Create a mock pipe that behaves like a diffusion pipeline
class MockPipe(nn.Module):
    def __init__(self):
        super().__init__()
    
    def __call__(self, prompt, negative_prompt=None, keypose_adapter_input=None, 
                 keypose_adaptor_weight=None, region_keypose_adaptor_weight=None,
                 sketch_adapter_input=None, sketch_adaptor_weight=None, 
                 region_sketch_adaptor_weight=None, generator=None, 
                 guidance_scale=7.5, num_inference_steps=50, **kwargs):
        # Return a mock result with an images attribute
        batch_size = len(prompt) if isinstance(prompt, list) else 1
        result = type('obj', (object,), {
            'images': [torch.rand(3, 64, 64) for _ in range(batch_size)]
        })()
        return result

# Create mock condition tensors
keypose_condition = torch.rand(3, 8, 8)  # Mock keypose condition
sketch_condition = torch.rand(3, 8, 8)   # Mock sketch condition

# Create pipe instance
pipe = MockPipe()

# Create input prompts
input_prompt = ["a cat", "a dog"]
input_neg_prompt = ["blurry", "low quality"]

# Create generator
generator = torch.Generator()
generator.manual_seed(42)

ARGS = {
    'pipe': pipe,
    'input_prompt': input_prompt,
    'input_neg_prompt': input_neg_prompt,
    'generator': generator,
    'num_inference_steps': 50,
    'guidance_scale': 7.5,
    'sketch_adaptor_weight': 1.0,
    'region_sketch_adaptor_weight': '',
    'keypose_adaptor_weight': 1.0,
    'region_keypose_adaptor_weight': '',
    'keypose_condition': keypose_condition,
    'sketch_condition': sketch_condition,
}
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 4, 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
update_quasi_newton Ran
ran on a synthesized input
pilancilab/spectral_adapter/adapter_fusion/spectral/spectral_fusion.py
code served (permissive licence) · get_code("c41cf9c5f2ce087a")
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; 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 numpy as np

torch.manual_seed(0)

# Set up small tensors for the function
n_constraints = 2
n_features = 4
n_targets = 3

# K_target: size [n_constraints, n_features]
K_target = torch.randn(n_constraints, n_features, dtype=torch.float32)

# V_target: size [n_constraints, n_targets]
V_target = torch.randn(n_constraints, n_targets, dtype=torch.float32)

# W: size [n_targets, n_features] - weight matrix for linear transformation
W = torch.randn(n_targets, n_features, dtype=torch.float32)

# iters: number of iterations for LBFGS optimizer
iters = 2

# device: CPU only
device = torch.device('cpu')

ARGS = {
    'K_target': K_target,
    'V_target': V_target,
    'W': W,
    'iters': iters,
    'device': device,
}
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 Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:TypeError)
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
convert_edlora Not yet run
unverified (harvested, no recorded run)
pilancilab/spectral_adapter/adapter_fusion/spectral/mixofshow/utils/convert_edlora_to_diffusers.py
code served (permissive licence) · get_code("19b18f2d94a9de5b")
How it ran

no invocation recorded.

merge_spectral_into_weight Not yet run
unverified (harvested, no recorded run)
pilancilab/spectral_adapter/adapter_fusion/spectral/spectral_fusion.py
code served (permissive licence) · get_code("37149872c19db912")
How it ran

no invocation recorded.

merge_spectralpart_into_weight Not yet run
unverified (harvested, no recorded run)
pilancilab/spectral_adapter/adapter_fusion/spectral/mixofshow/utils/convert_edlora_to_diffusers.py
code served (permissive licence) · get_code("07093af0abab1071")
How it ran

no invocation recorded.

revise_edlora_unet_attention_controller_forward Not yet run
unverified (harvested, no recorded run)
pilancilab/spectral_adapter/adapter_fusion/spectral/mixofshow/models/edlora.py
code served (permissive licence) · get_code("1a139b8d8a9acd03")
How it ran

no invocation recorded.

revise_edlora_unet_attention_forward Not yet run
unverified (harvested, no recorded run)
pilancilab/spectral_adapter/adapter_fusion/spectral/mixofshow/models/edlora.py
code served (permissive licence) · get_code("f8741ceac3b6747e")
How it ran

no invocation recorded.

revise_regionally_t2iadapter_attention_forward Not yet run
unverified (harvested, no recorded run)
pilancilab/spectral_adapter/adapter_fusion/spectral/mixofshow/pipelines/pipeline_regionally_t2iadapter.py
code served (permissive licence) · get_code("c344424fb37826d9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
bind_concept_prompt 2 other papers
2 dated earlier
2208.12242 (2022-08)
DreamBooth: Fine Tuning Text-to-Image Diffusion Models for Subject-Driven Generation
2305.18292 (2023-05)
Mix-of-Show: Decentralized Low-Rank Adaptation for Multi-Concept Customization of Diffusion Models
load_new_concept 1 other paper
1 dated earlier
2305.18292 (2023-05)
Mix-of-Show: Decentralized Low-Rank Adaptation for Multi-Concept Customization of Diffusion 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-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

Recent developments in Parameter-Efficient Fine-Tuning (PEFT) methods for pretrained deep neural networks have captured widespread interest. In this work, we study the enhancement of current PEFT methods by incorporating the spectral information of pretrained weight matrices into the fine-tuning procedure. We investigate two spectral adaptation mechanisms, namely additive tuning and orthogonal rotation of the top singular vectors, both are done via first carrying out Singular Value Decomposition (SVD) of pretrained weights and then fine-tuning the top spectral space. We provide a theoretical analysis of spectral fine-tuning and show that our approach improves the rank capacity of low-rank adapters given a fixed trainable parameter budget. We show through extensive experiments that the proposed fine-tuning model enables better parameter efficiency and tuning performance as well as benefits multi-adapter fusion.

For agents

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

get_harvested_code_for_paper("2405.13952")
get_code_for_paper("2405.13952")
have("2405.13952")

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

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

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

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

Connect an agent — have() is free.