SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.19286 · ECCV · 2024

Soft Prompt Generation for Domain Generalization

Wanqi Zhou, Shuanghao Bai, Badong Chen, Zhirong Luan, Yuedi Zhang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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; 6 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/2404.19286.json · badge: /api/ran/2404.19286.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
renytek13/Soft-Prompt-Generation-with-CGAN canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
basic_clean Ran
ran; our contract draft was wrong, not the code
renytek13/Soft-Prompt-Generation-with-CGAN/clip/simple_tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("98f385d847636a3e")
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 ltpwy/MSCI, 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.

fixed_patch Ran
ran; our contract draft was wrong, not the code
renytek13/Soft-Prompt-Generation-with-CGAN/utils/visual_prompt.py
code served (permissive licence) · get_code("fb8b765f896ca77c")
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 FixedPatchPrompter. 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)

class Config:
    def __init__(self):
        self.GPU = 0
        self.INPUT = InputConfig()
        self.TRAINER = TrainerConfig()

class InputConfig:
    def __init__(self):
        self.SIZE = [8]

class TrainerConfig:
    def __init__(self):
        self.VPT = VPTConfig()

class VPTConfig:
    def __init__(self):
        self.NUM_TOKENS = 4

cfg = Config()

ARGS = {
    'cfg': cfg
}
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 FixedPatchPrompter — a FixedPatchPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FixedPatchPrompter 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_pairs Ran
ran; our contract draft was wrong, not the code
renytek13/Soft-Prompt-Generation-with-CGAN/clip/simple_tokenizer.py
code served (permissive licence) · get_code("d919ae32e5e4e616")
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 set. 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)

# The function get_pairs takes a word parameter
# A word is represented as a tuple of symbols (variable-length strings)
# The function iterates through the word and creates pairs of consecutive symbols

word = ("hello", "world", "test")

ARGS = {
    "word": word
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
padding Ran
ran; our contract draft was wrong, not the code
renytek13/Soft-Prompt-Generation-with-CGAN/utils/visual_prompt.py
code served (permissive licence) · get_code("98c70398b832504f")
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 PadPrompter. 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)

class Config:
    def __init__(self):
        self.GPU = 0
        self.TRAINER = TrainerConfig()
        self.INPUT = InputConfig()

class TrainerConfig:
    def __init__(self):
        self.VPT = VPTConfig()

class VPTConfig:
    def __init__(self):
        self.NUM_TOKENS = 2

class InputConfig:
    def __init__(self):
        self.SIZE = [8]

cfg = Config()

ARGS = {
    'cfg': cfg
}
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 PadPrompter — a PadPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PadPrompter 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
random_patch Ran
ran; our contract draft was wrong, not the code
renytek13/Soft-Prompt-Generation-with-CGAN/utils/visual_prompt.py
code served (permissive licence) · get_code("3f8752aa7aac40b9")
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 RandomPatchPrompter. 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 numpy as np

torch.manual_seed(0)

class Config:
    def __init__(self):
        self.GPU = 0
        self.INPUT = InputConfig()
        self.TRAINER = TrainerConfig()

class InputConfig:
    def __init__(self):
        self.SIZE = [32]

class TrainerConfig:
    def __init__(self):
        self.VPT = VPTConfig()

class VPTConfig:
    def __init__(self):
        self.NUM_TOKENS = 8

cfg = Config()

ARGS = {
    "cfg": cfg
}
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 RandomPatchPrompter — a RandomPatchPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RandomPatchPrompter 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
whitespace_clean Ran
ran; our contract draft was wrong, not the code
renytek13/Soft-Prompt-Generation-with-CGAN/clip/simple_tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("9542161e9640b858")
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 ltpwy/MSCI, 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.

build_model Not yet run
unverified (harvested, no recorded run)
renytek13/Soft-Prompt-Generation-with-CGAN/clip/model.py
code served (permissive licence) · get_code("39e6b23b55f376ea")
How it ran

no invocation recorded.

load Not yet run
unverified (harvested, no recorded run)
renytek13/Soft-Prompt-Generation-with-CGAN/clip/clip.py
code served (permissive licence) · get_code("021a688e5389b8b6")
How it ran

no invocation recorded.

save_split Not yet run
unverified (harvested, no recorded run)
renytek13/Soft-Prompt-Generation-with-CGAN/datasets/domainnet_coop.py
code served (permissive licence) · get_code("60e8a0a6b4aae51d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 4 the same month, 5 later) and 1 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
get_pairs 258 other papers
131 dated earlier, 11 the same month, 108 later, 7 same year, order not determinable, 1 undated · 4 only as an assembly brick
1802.06474 (2018-02)
A Closed-form Solution to Photorealistic Image Stylization
1803.01128 (2018-03)
Seq2Sick: Evaluating the Robustness of Sequence-to-Sequence Models with Adversarial Examples
1809.00125 (2018-09)
Simple Fusion: Return of the Language Model
and 255 more not named here
whitespace_clean 231 other papers
112 dated earlier, 11 the same month, 100 later, 7 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 228 more not named here
basic_clean 218 other papers
112 dated earlier, 11 the same month, 87 later, 7 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 215 more not named here
build_model 53 other papers
20 dated earlier, 3 the same month, 28 later, 2 same year, order not determinable
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2210.01115 (2022-10)
LASP: Text-to-Text Optimization for Language-Aware Soft Prompting of Vision & Language Models
2211.09552 (2022-11)
UniFormerV2: Spatiotemporal Learning by Arming Image ViTs with Video UniFormer
and 50 more not named here
load 18 other papers
5 dated earlier, 13 later
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2311.11261 (2023-11)
Adversarial Prompt Tuning for Vision-Language Models
2311.18231 (2023-11)
TCP:Textual-based Class-aware Prompt tuning for Visual-Language Model
and 15 more not named here
fixed_patch 2 other papers
1 dated earlier, 1 same year, order not determinable
2312.09553 (2023-12)
Prompt-based Distribution Alignment for Unsupervised Domain Adaptation
aaai_27830 (2024 (year only))
Prompt-Based Distribution Alignment for Unsupervised Domain Adaptation
padding 2 other papers
1 dated earlier, 1 same year, order not determinable
2312.09553 (2023-12)
Prompt-based Distribution Alignment for Unsupervised Domain Adaptation
aaai_27830 (2024 (year only))
Prompt-Based Distribution Alignment for Unsupervised Domain Adaptation
random_patch 2 other papers
1 dated earlier, 1 same year, order not determinable
2312.09553 (2023-12)
Prompt-based Distribution Alignment for Unsupervised Domain Adaptation
aaai_27830 (2024 (year only))
Prompt-Based Distribution Alignment for Unsupervised Domain Adaptation

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

Large pre-trained vision language models (VLMs) have shown impressive zero-shot ability on downstream tasks with manually designed prompt. To further adapt VLMs to downstream tasks, soft prompt is proposed to replace manually designed prompt, which undergoes finetuning based on specific domain data. Prior prompt learning methods primarily learn a fixed prompt or residuled prompt from training samples. However, the learned prompts lack diversity and ignore information about unseen domains. In this paper, we reframe the prompt learning framework from a generative perspective and propose a simple yet efficient method for the Domain Generalization (DG) task, namely Soft Prompt Generation (SPG). Specifically, SPG consists of a two-stage training phase and an inference phase. During the training phase, we introduce soft prompt label for each domain, aiming to incorporate the generative model domain knowledge. During the inference phase, the generator of the generative model is employed to obtain instance-specific soft prompts for the unseen target domain. Extensive experiments on five domain generalization benchmarks of three DG tasks demonstrate that SPG achieves state-of-the-art performance. The code is available at https://github.com/renytek13/Soft-Prompt-Generation-with-CGAN.

For agents

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

get_harvested_code_for_paper("2404.19286")
get_code_for_paper("2404.19286")
have("2404.19286")

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

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

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

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

Connect an agent — have() is free.