SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.09257 · ICML · 2023

PromptBoosting: Black-Box Text Classification with Ten Forward Passes

Jacob Andreas, Shiyu Chang, Yang Zhang, Bairu Hou, Joe O'connor

arXiv · PDF · Open in the Atlas

Code that ran

5 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure 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/2212.09257.json · badge: /api/ran/2212.09257.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
ucsb-nlp-chang/promptboosting canonical (classifier label)
classifier basis: classifier_2025
1 ran · 2 no recorded run
zcrwind/prefer community
Papers with Code archive
4 ran · 4 no recorded run
FunctionStatusWhere it lives
BaseModel Ran
ran on a synthesized input · constructed an object; no result was computed
zcrwind/prefer/src/multicls_trainer.py
code served (permissive licence) · get_code("3f1f55bc76a0d531")
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 an instance of its own class, BaseModel: the run constructed the object and did not call it, so no result was computed. 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 typing import Dict, List, Union

torch.manual_seed(0)

# Define ARGS dictionary mapping all BaseModel.__init__ parameters
ARGS = {
    "num_labels": 2,
    "max_length": 512,
}
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 BaseModel — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BaseModel 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
BaseMuticlsTrainer Ran
ran on a synthesized input · constructed an object; no result was computed
zcrwind/prefer/src/multicls_trainer.py
code served (permissive licence) · get_code("5d2c3ddeee791f10")
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 an instance of its own class, BaseMuticlsTrainer: the run constructed the object and did not call it, so no result was computed. 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 stand-in classes and objects for the function
class MockModelOutput:
    def __init__(self, use_logits=False):
        self.use_logits = use_logits
        if use_logits:
            self.all_token_logits = torch.randn(2, 4)  # batch_size=2, num_classes=4
        else:
            self.all_token_probs = torch.softmax(torch.randn(2, 4), dim=1)

class MockVTuningModel(nn.Module):
    def __init__(self, use_logits=False):
        super().__init__()
        self.use_logits = use_logits
    
    def predict(self, batch_input, template, use_verbalizer):
        # Return mock output with appropriate shape
        return MockModelOutput(use_logits=self.use_logits)

class MockTemplate:
    def __init__(self):
        self.name = "test_template"

# Create minimal evaluation dataset
eval_dataset = (
    ["sentence one", "sentence two", "sentence three", "sentence four"],  # 4 sentences
    torch.tensor([0, 1, 0, 1])  # 4 labels
)

# Create mock vtuning model
vtuning_model = MockVTuningModel(use_logits=False)

# Create mock template
template = MockTemplate()

# Define ARGS dict with all parameters for BaseMuticlsTrainer.__init__
ARGS = {
    "adaboost_lr": 1.0,
    "num_classes": 2,
    "use_logits": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BaseMuticlsTrainer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BaseMuticlsTrainer 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
SentenceTemplate Ran
ran on a synthesized input · constructed an object; no result was computed
zcrwind/prefer/src/multicls_trainer.py
code served (permissive licence) · get_code("970c8a82aad02567")
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 an instance of its own class, SentenceTemplate: the run constructed the object and did not call it, so no result was computed. 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 json
import tempfile
import os
from transformers import PreTrainedTokenizer

# Create a minimal tokenizer stand-in
class MockTokenizer(PreTrainedTokenizer):
    def __init__(self):
        super().__init__()
        self.model_max_length = 512
        self.vocab_size = 100
    
    def _tokenize(self, text):
        return text.split()
    
    def _convert_token_to_id(self, token):
        return hash(token) % self.vocab_size
    
    def _convert_id_to_token(self, token_id):
        return f"token_{token_id}"
    
    @property
    def vocab_size(self):
        return 100

# Create a temporary template file
template_content = {
    "name": "test_template",
    "template": [
        {"meta": "prompt_segment", "content": "The sentence is: "},
        {"meta": "text", "content": ""},
        {"meta": "prompt_segment", "content": " Answer: "},
        {"meta": "output_token", "content": ""}
    ]
}

with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.json') as f:
    json.dump(template_content, f)
    template_path = f.name

try:
    ARGS = {
        'template_path': template_path,
        'template_json_string': None,
        'output_token': '[MASK]',
        'read_from_raw_file': True
    }
finally:
    # Clean up will happen after execution
    pass
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SentenceTemplate — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SentenceTemplate 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
VTuningOutput Ran
ran on a synthesized input · constructed an object; no result was computed
zcrwind/prefer/src/multicls_trainer.py
code served (permissive licence) · get_code("39f6235b4ac9a14c")
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 an instance of its own class, VTuningOutput: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

# Construct valid arguments for VTuningOutput
ARGS = {
    "positive_probs": torch.tensor([[0.8, 0.2], [0.6, 0.4]], dtype=torch.float32),
    "negative_probs": torch.tensor([[0.2, 0.8], [0.4, 0.6]], dtype=torch.float32),
    "positive_prob": torch.tensor([0.75, 0.65], dtype=torch.float32),
    "negative_prob": torch.tensor([0.25, 0.35], dtype=torch.float32),
    "pred_labels": torch.tensor([1, 0], dtype=torch.long),
    "all_token_probs": torch.randn(2, 4, 5),
    "all_token_logits": torch.randn(2, 4, 5),
}
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 VTuningOutput — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VTuningOutput 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
load_datasets Ran
ran; our contract draft was wrong, not the code
ucsb-nlp-chang/promptboosting/scripts/generate_k_shot_data.py
pointer only (licence: NONE) · get_code("aa8835750b7967cd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ucsb-nlp-chang/promptboosting 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.

PromptBoostingTrainer Not yet run
unverified (harvested, no recorded run)
zcrwind/prefer/src/multicls_trainer.py
code served (permissive licence) · get_code("465ec3f4b677b5d8")
How it ran

no invocation recorded.

RoBERTaVTuningClassification Not yet run
unverified (harvested, no recorded run)
zcrwind/prefer/src/multicls_trainer.py
code served (permissive licence) · get_code("22f2c0be4c2641d9")
How it ran

no invocation recorded.

TestPredictionSaver Not yet run
unverified (harvested, no recorded run)
zcrwind/prefer/src/multicls_trainer.py
code served (permissive licence) · get_code("ccf4038d8b3a7c59")
How it ran

no invocation recorded.

generate_multicls_l1_label_set_with_cache Not yet run
unverified (harvested, no recorded run)
zcrwind/prefer/src/multicls_trainer.py
code served (permissive licence) · get_code("4177055e7fb0c42c")
How it ran

no invocation recorded.

get_label Not yet run
unverified (harvested, no recorded run)
ucsb-nlp-chang/promptboosting/scripts/generate_k_shot_data.py
pointer only (licence: NONE) · get_code("304c3d4159dc6bfe")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ucsb-nlp-chang/promptboosting 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.

split_header Not yet run
unverified (harvested, no recorded run)
ucsb-nlp-chang/promptboosting/scripts/generate_k_shot_data.py
pointer only (licence: NONE) · get_code("54f8d13ea8aad5c6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ucsb-nlp-chang/promptboosting 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, 9 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 7 later) and 2 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
split_header 7 other papers
3 dated earlier, 4 later
2108.04106 (2021-08)
Noisy Channel Language Model Prompting for Few-Shot Text Classification
2112.08348 (2021-12)
Prompt Waywardness: The Curious Case of Discretized Interpretation of Continuous Prompts
2211.03044 (2022-11)
Tuning Language Models as Training Data Generators for Augmentation-Enhanced Few-Shot Learning
and 4 more not named here
BaseModel
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later · 1 only as an assembly brick
2012.15723 (2020-12)
Making Pre-trained Language Models Better Few-shot Learners
2305.03495 (2023-05)
Automatic Prompt Optimization with "Gradient Descent" and Beam Search
VTuningOutput
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later · 2 only as an assembly brick
2012.15723 (2020-12)
Making Pre-trained Language Models Better Few-shot Learners
2305.03495 (2023-05)
Automatic Prompt Optimization with "Gradient Descent" and Beam Search
RoBERTaVTuningClassification
brick of this paper's assembly: helper
1 other paper
1 later
2305.03495 (2023-05)
Automatic Prompt Optimization with "Gradient Descent" and Beam Search
SentenceTemplate
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2305.03495 (2023-05)
Automatic Prompt Optimization with "Gradient Descent" and Beam Search
TestPredictionSaver
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2012.15723 (2020-12)
Making Pre-trained Language Models Better Few-shot Learners
generate_multicls_l1_label_set_with_cache
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2012.15723 (2020-12)
Making Pre-trained Language Models Better Few-shot Learners
get_label 1 other paper
1 later
2308.12033 (2023-08)
PREFER: Prompt Ensemble Learning via Feedback-Reflect-Refine
load_datasets 1 other paper
1 later
2308.12033 (2023-08)
PREFER: Prompt Ensemble Learning via Feedback-Reflect-Refine

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

We describe PROMPTBOOSTING, a queryefficient procedure for building a text classifier from a neural language model (LM) without access to the LM's parameters, gradients, or hidden representations. This form of "black-box" classifier training has become increasingly important as the cost of training and inference in large-scale LMs has grown. But existing black-box LM classifier learning approaches are themselves computationally inefficient, typically specializing LMs to the target task by searching in a large space of (discrete or continuous) prompts using zerothorder optimization methods. Instead of directly optimizing in prompt space, PROMPTBOOSTING obtains a small pool of prompts via a gradientfree approach, and then constructs a large pool of weak learners by pairing these prompts with different elements of the LM's output distribution. These weak learners are then ensembled using the ADABOOST algorithm. The entire learning process requires only a small number of forward passes per batch and no backward pass. Experiments show that PROMPTBOOSTING achieves state-of-the-art performance in multiple blackbox few-shot classification tasks, and matches or outperforms full fine-tuning in both few-shot and standard learning paradigms, while training 10x faster than existing black-box methods.Codes are available at https://github.com/ UCSB-NLP-Chang/PromptBoosting.

For agents

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

get_harvested_code_for_paper("2212.09257")
get_code_for_paper("2212.09257")
have("2212.09257")

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

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

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

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

Connect an agent — have() is free.