SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.12033 · 2023

PREFER: Prompt Ensemble Learning via Feedback-Reflect-Refine

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 0 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/2308.12033.json · badge: /api/ran/2308.12033.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
zcrwind/prefer canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
ResPromptBooster Ran
ran on a synthesized input · constructed an object; no result was computed
zcrwind/prefer/prefer.py
code served (permissive licence) · get_code("377ef4c66c11a227")
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, ResPromptBooster: 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 numpy as np
import random

class MockArgs:
    def __init__(self):
        self.fewshot_seed = 42
        self.num_monte_carlo = 5
        self.num_feedbacks = 3
        self.adaboost_lr = 0.1
        self.max_error = 0.5
        self.patience = 3
        self.fewshot_k = 4
        self.num_test = 2
        self.average_mode = 'macro'
        self.dataset = 'agnews'
        self.timeout = 30

def set_random_seed(seed):
    random.seed(seed)
    np.random.seed(seed)

# Create small datasets
train_texts = [
    "Apple Inc. announced new products today.",
    "The basketball team won the championship.",
    "Stock market rises by 5% this quarter.",
    "Scientists discover new exoplanet."
]
train_labels = [3, 1, 2, 3]  # 0=World, 1=Sports, 2=Business, 3=Science

valid_texts = [
    "Global news from Europe.",
    "Football match results."
]
valid_labels = [0, 1]

test_texts = [
    "Technology breakthrough announced.",
    "Olympics closing ceremony."
]
test_labels = [3, 1]

train_dataset = (train_texts, train_labels)
valid_dataset = (valid_texts, valid_labels)
test_dataset = (test_texts, test_labels)

args = MockArgs()

ARGS = {
    'args': args,
    'train_dataset': train_dataset,
    'valid_dataset': valid_dataset,
    'test_dataset': test_dataset
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, requests, sklearn, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ResPromptBooster — 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 ResPromptBooster 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_label Ran
ran; our contract draft was wrong, not the code
zcrwind/prefer/scripts/generate_k_shot_data.py
code served (permissive licence) · get_code("5592e63376c0d5fa")
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 str. 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

# Test cases for get_label function
# The function takes a task name and a line (tab-separated string)
# and returns a label based on the task type

ARGS = {
    'task': 'SST-2',
    'line': '0\tThis is a great movie!\t1'
}

# Additional test cases to verify the function works:
test_cases = [
    {'task': 'CoLA', 'line': '0\t1\tSentence here'},
    {'task': 'MNLI', 'line': 'id\tpremise\thypothesis\tentailment'},
    {'task': 'MRPC', 'line': '1\t0\tSent1\tSent2'},
    {'task': 'QNLI', 'line': 'id\tquestion\tsentence\tentailment'},
    {'task': 'QQP', 'line': 'id\tq1\tq2\tduplicate'},
    {'task': 'RTE', 'line': 'id\tsentence1\tsentence2\tentailment'},
    {'task': 'SNLI', 'line': 'id\tpremise\thypothesis\tlabel'},
    {'task': 'SST-2', 'line': 'sentence\t1'},
    {'task': 'STS-B', 'line': 'sent1\tsent2\t2.3'},
    {'task': 'WNLI', 'line': 'id\tsentence1\tsentence2\tlabel'},
    {'task': 'imdb', 'line': 'review text\t1'},
    {'task': 'agnews', 'line': 'text\t2'},
    {'task': 'other', 'line': '0\tother data'},
]
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_num_classes Ran
ran, honoured the contract we drafted
zcrwind/prefer/prefer.py
code served (permissive licence) · get_code("01f18670482745e3")
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 int, ndim 0, dtype family int, 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)

ARGS = {
    'dataset_name': 'agnews'
}
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 int, ndim 0, dtype family int, 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_datasets Ran
ran; our contract draft was wrong, not the code
zcrwind/prefer/scripts/generate_k_shot_data.py
code served (permissive licence) · get_code("635e168c990149fd")
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.

import os
import tempfile
import pandas as pd

# Create temporary directory structure with mock data files
temp_dir = tempfile.mkdtemp()

# Create GLUE task directories and files
glue_tasks = ['MNLI', 'MRPC', 'QNLI', 'QQP', 'RTE', 'SNLI', 'SST-2', 'STS-B', 'WNLI', 'CoLA']
for task in glue_tasks:
    task_dir = os.path.join(temp_dir, task)
    os.makedirs(task_dir, exist_ok=True)
    
    if task == 'MNLI':
        splits = ['train', 'dev_matched', 'dev_mismatched']
    else:
        splits = ['train', 'dev']
    
    for split in splits:
        filename = os.path.join(task_dir, f'{split}.tsv')
        with open(filename, 'w') as f:
            f.write("index\tsentence1\tsentence2\tlabel\n")
            f.write("0\tThis is a test.\tThis is another test.\t0\n")
            f.write("1\tHello world.\tHello there.\t1\n")

# Create agnews directory and files
agnews_dir = os.path.join(temp_dir, 'agnews')
os.makedirs(agnews_dir, exist_ok=True)
for split in ['train', 'test']:
    filename = os.path.join(agnews_dir, f'{split}.csv')
    df = pd.DataFrame({
        'class': [1, 2],
        'title': ['News Title 1', 'News Title 2'],
        'description': ['Description 1', 'Description 2']
    })
    df.to_csv(filename, index=False, header=True)

# Create a custom task directory and files
custom_dir = os.path.join(temp_dir, 'custom_task')
os.makedirs(custom_dir, exist_ok=True)
for split in ['train', 'test']:
    filename = os.path.join(custom_dir, f'{split}.csv')
    df = pd.DataFrame([
        ['text1', 'label1'],
        ['text2', 'label2']
    ])
    df.to_csv(filename, index=False, header=False)

ARGS = {
    'data_dir': temp_dir,
    'tasks': ['MNLI', 'MRPC', 'agnews', 'custom_task']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
pandas — 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
split_header Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from alrope123/prompt-waywardness
pointer only; the stored copy get_code serves, from alrope123/prompt-waywardness, is pointer only (licence: NONE) · get_code("efd1b7718b950470")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 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
5 dated earlier, 2 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
get_label 1 other paper
1 dated earlier
2212.09257 (2022-12)
PromptBoosting: Black-Box Text Classification with Ten Forward Passes
load_datasets 1 other paper
1 dated earlier
2212.09257 (2022-12)
PromptBoosting: Black-Box Text Classification with Ten Forward Passes

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

As an effective tool for eliciting the power of Large Language Models (LLMs), prompting has recently demonstrated unprecedented abilities across a variety of complex tasks. To further improve the performance, prompt ensemble has attracted substantial interest for tackling the hallucination and instability of LLMs. However, existing methods usually adopt a two-stage paradigm, which requires a pre-prepared set of prompts with substantial manual effort, and is unable to perform directed optimization for different weak learners. In this paper, we propose a simple, universal, and automatic method named PREFER (Pompt Ensemble learning via Feedback-Reflect-Refine) to address the stated limitations. Specifically, given the fact that weak learners are supposed to focus on hard examples during boosting, PREFER builds a feedback mechanism for reflecting on the inadequacies of existing weak learners. Based on this, the LLM is required to automatically synthesize new prompts for iterative refinement. Moreover, to enhance stability of the prompt effect evaluation, we propose a novel prompt bagging method involving forward and backward thinking, which is superior to majority voting and is beneficial for both feedback and weight calculation in boosting. Extensive experiments demonstrate that our PREFER achieves state-of-the-art performance in multiple types of tasks by a significant margin. We have made our code publicly available.

For agents

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

get_harvested_code_for_paper("2308.12033")
get_code_for_paper("2308.12033")
have("2308.12033")

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

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

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

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

Connect an agent — have() is free.