无需梯度的微调?基于冻结编码器、由大语言模型编写的闭式分类器

arXiv cs.CL 论文

摘要

本文提出了权重空间编程(WSP),其中大语言模型充当设计助手,编写程序,在冻结的 RoBERTa-large 编码器上以闭式解拟合分类头,无需进行梯度更新。在不同标注预算下,该方法的表现持平或略优于全量微调和 LoRA,同时接近基于提示的微调。

arXiv:2611.33972v1 Announce Type: new Abstract: Can a classifier computed in closed form on a frozen encoder match gradient fine-tuning? We present closed-form weight-space programming (WSP): a large language model (LLM), used as a design assistant, writes programs that read a frozen masked language model through cloze-style prompt templates at several layers, fit closed-form heads (shrinkage discriminant analysis, kernel ridge regression and the encoder's label-word prior) on labelled data, and select among a pool of candidate heads by cross-fitting. No gradient is computed and no encoder weight changes. We instantiate the framework on RoBERTa-large. On 11 development datasets with 512 to 8,192 training labels, WSP is ahead of full fine-tuning (FT) and LoRA at every label budget (by 0.3 to 0.6 points on average; the registered non-inferiority tests pass) and within 0.5 points of prompt-based fine-tuning (PFT); these datasets also shaped the recipe. With fewer labels its lead over FT and LoRA grows: 1.2 to 3.5 points with 64 and 128 labels, and 3.8 to 5.3 points in the few-shot setting of 16 labels per class, where WSP is again within half a point of PFT on the development datasets. On six held-out datasets, WSP stays ahead of LoRA and within half a point of FT on average, although with six datasets no registered test passes, and PFT is ahead, by 1.30 points with 8,192 labels. WSP never collapses and is deterministic, but it needs one encoder pass per template (17 here). We report all eight recipe versions, every decision that saw test results, and 27 ideas that did not help.
查看原文
查看缓存全文

缓存时间: 2026/11/26 09:35

# Fine-Tuning Without Gradients?Closed-Form, LLM-Written Classifiers on a Frozen Encoder
Source: [https://arxiv.org/html/2611.33972](https://arxiv.org/html/2611.33972)
Md Nasir Uddin††thanks:Research Associate, CSE, BUET\. Funded by BIRDI Grant EOI122 under SICIP Project\.Affiliation:Department of Computer Science and EngineeringBangladesh University of Engineering and Technology \(BUET\), Dhaka\-1000, BangladeshEmail:[nasir\.iit\.du@gmail\.com](mailto:)Musa Tur FaraziAffiliation:Department of Computer Science and EngineeringBangladesh University of Engineering and Technology \(BUET\), Dhaka\-1000, BangladeshSoumik BhattacharjeeAffiliation:Department of Computer Science and EngineeringBangladesh University of Engineering and Technology \(BUET\), Dhaka\-1000, BangladeshTishna SabrinaAffiliation:Department of Electrical and Electronic EngineeringUniversity of Asia Pacific, Dhaka, BangladeshChowdhury Mohammad Rakin HaiderAffiliation:Department of Computer Science and EngineeringBangladesh University of Engineering and Technology \(BUET\), Dhaka\-1000, Bangladesh

###### Abstract

Can a classifier computed in closed form on a*frozen*encoder match gradient fine\-tuning? We present closed\-form weight\-space programming \(WSP\): a large language model \(LLM\), used as a design assistant, writes programs that read a frozen masked language model through cloze\-style prompt templates at several layers, fit closed\-form heads \(shrinkage discriminant analysis, kernel ridge regression and the encoder’s label\-word prior\) on labelled data, and select among a pool of candidate heads by cross\-fitting\. No gradient is computed and no encoder weight changes\. We instantiate the framework on RoBERTa\-large\. On 11 development datasets with 512 to 8,192 training labels,WSPis ahead of full fine\-tuning \(FT\) and LoRA at every label budget \(by 0\.3 to 0\.6 points on average; the registered non\-inferiority tests pass\) and within 0\.5 points of prompt\-based fine\-tuning \(PFT\); these datasets also shaped the recipe\. With fewer labels its lead over FT and LoRA grows: 1\.2 to 3\.5 points with 64 and 128 labels, and 3\.8 to 5\.3 points in the few\-shot setting of 16 labels per class, whereWSPis again within half a point of PFT on the development datasets\. On six held\-out datasets,WSPstays ahead of LoRA and within half a point of FT on average, although with six datasets no registered test passes, and PFT is ahead, by 1\.30 points with 8,192 labels\.WSPnever collapses and is deterministic, but it needs one encoder pass per template \(17 here\)\. We report all eight recipe versions, every decision that saw test results, and 27 ideas that did not help\.

## 1Introduction

Fine\-tuning dominates task adaptation: full fine\-tuning \(FT\), parameter\-efficient variants such as LoRA\([Hu et al\., 2022a](https://arxiv.org/html/2611.33972#bib.bib15)\), and, with few labels, prompt\-based fine\-tuning\([Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11), PFT;\)\. They need gradient training per task, a learning\-rate search, a dev set to select on, and a copy of the weights or an adapter per task, and fine\-tuning large encoders on small data can collapse to a constant classifier\([Dodge et al\., 2020](https://arxiv.org/html/2611.33972#bib.bib9);[Mosbach et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib33)\)\. A frozen encoder already holds much of what a few\-class task needs: linear and prompted probes of frozen representations are long\-standing baselines\([Peters et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib37);[Conneau and Kiela, 2018](https://arxiv.org/html/2611.33972#bib.bib7);[Cho et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib6)\), and gradient\-free classifiers on frozen masked language models read through prompts have been compared with fine\-tuning before\([Sun et al\., 2022b](https://arxiv.org/html/2611.33972#bib.bib47);[Sun et al\., 2022a](https://arxiv.org/html/2611.33972#bib.bib46);[Hou et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib13)\)\. In vision, training\-free adaptation of frozen CLIP\-style encoders mixes a zero\-shot classifier with closed\-form heads\([Zhang et al\., 2022](https://arxiv.org/html/2611.33972#bib.bib54);[Wang et al\., 2024](https://arxiv.org/html/2611.33972#bib.bib49)\)\. We ask how far a closed\-form readout of a frozen text encoder can go when the readout itself is a selected program over many prompts, layers and heads, and where the remaining gap to fine\-tuning lies\.

#### The method, and its name\.

We call the method closed\-form weight\-space programming \(WSP\); in established terms it is prompt\-based probing with closed\-form heads and LLM\-written prompts\. The name follows[Takehi et al\. \(2026\)](https://arxiv.org/html/2611.33972#bib.bib48), who use*weight\-space programming*for an LLM that reads and writes a network’s weights directly, and[Ok and Lee \(2026\)](https://arxiv.org/html/2611.33972#bib.bib34), who let LLMs write the weights of small models by hand\. Our variant departs from that meaning: here the LLM writes no weight\. It writes a*program*\(which cloze templates to wrap an input in, which layers and token positions to read, which closed\-form heads to fit and how to select among them\), and the classifier’s weights are then computed from labelled data by classical estimators: shrinkage linear discriminant analysis \(LDA\), exact kernel ridge regression and the encoder’s own masked\-language\-model \(MLM\) label\-word prior\. The LLM’s role is design assistance; we did not compare its programs with human\-written or published templates, so the paper makes no claim that LLM authorship itself helps \(§[2](https://arxiv.org/html/2611.33972#S2), Appendix[J](https://arxiv.org/html/2611.33972#A10)\)\.

#### When would one choose it?

WSPis meant for a setting in which one frozen encoder serves many classification tasks and per\-task gradient training is unwanted or unavailable: for example a shared inference service that must add tasks without training jobs, or a deployment that needs bit\-for\-bit reproducible classifiers whose adaptation step is a closed\-form fit\. Its costs fall elsewhere\. Whoever serves the classifier pays one encoder pass per template instead of one pass in all \(17 in our instantiation\), and kernel heads keep the training features of every view \(§[4\.8](https://arxiv.org/html/2611.33972#S4.SS8)\); whoever builds a task still needs the same labelled training and dev data as fine\-tuning, and the design of the recipe used LLM rounds\. When one can afford a large LLM per prediction, classifying with it directly may be simpler; when one can afford training, PFT remains the stronger choice on new tasks in our study\.

#### How the evidence should be read\.

Every method sees the same labelled subsets \(paired by seed\) and the same dev set, used only for selection; the trained baselines get a learning\-rate grid, step\-matched training and the best checkpoint on dev\. EveryWSPrecipe version and every statistical test was written down with a time stamp before its own results were computed, and every version is reported\. This is an internal, time\-stamped plan, not a public pre\-registration, and it did not stop the development test sets from informing the design: some decisions were taken with their test results in view \(Appendix[I](https://arxiv.org/html/2611.33972#A9)lists all of them\)\. The results on the 11 development datasets are therefore development results\. Six held\-out datasets, run with fixed programs, are the cleaner check, but with six datasets that check has little power \(§[4\.4](https://arxiv.org/html/2611.33972#S4.SS4)\)\.

#### Findings\.

- •*Better than FT and LoRA*\(§[4\.1](https://arxiv.org/html/2611.33972#S4.SS1), §[4\.5](https://arxiv.org/html/2611.33972#S4.SS5), §[4\.6](https://arxiv.org/html/2611.33972#S4.SS6)\)\. On the 11 development datasets,WSP’s averages are above FT and LoRA at every label budget, and the registered non\-inferiority tests pass\. With 64 and 128 labels the lead grows to 1\.2 to 3\.5 points, and with 16 labels per class and a dev set of the same size to 3\.8 \(LoRA\) and 5\.3 \(FT\) points \(§[4\.6](https://arxiv.org/html/2611.33972#S4.SS6)\)\. On the six held\-out datasets,WSPis ahead of LoRA and within about half a point of FT on average \(ahead of FT with 512 labels, behind with 8,192\), though six datasets are too few for the tests to pass\.
- •*Competitive with PFT on the development datasets, behind it on new tasks*\(§[4\.2](https://arxiv.org/html/2611.33972#S4.SS2), §[4\.4](https://arxiv.org/html/2611.33972#S4.SS4)\)\. On the development datasetsWSPis within the 0\.5\-point margin of PFT, which reads one template whereWSPreads eight \(and 16 for its prior\); with 64 and 128 labels it is 0\.61 and 0\.47 points behind, and with 16 labels per class 0\.47 points behind, while ahead on 6 of 11 datasets\. On the held\-out datasets PFT is ahead by 0\.51 points with 512 labels and by 1\.30 with 8,192, the latter beyond the margin \(90% interval−\-1\.96 to−\-0\.64\), and by 1\.39 with 16 labels per class, and every trained baseline is ahead on CoLA with 512 or more labels\.
- •*Probes*\(§[4\.3](https://arxiv.org/html/2611.33972#S4.SS3)\)\. On the same frozen encoder,WSPis above every probe on every dataset at every budget, development and held\-out, with one exception \(LP\-prompt on Yahoo\-10 with 512 labels\)\. This includes a probe that reads its 16 templates in 12 layers, by 0\.9 to 1\.3 points on average on the development datasets and 1\.7 to 3\.4 on the held\-out ones\. With those views, a logistic probe comes within about one point of FT and LoRA on the development datasets, but stays 1\.5 to 2\.8 points behind them on the held\-out ones\.
- •*Stability and cost*\(§[4\.8](https://arxiv.org/html/2611.33972#S4.SS8)\)\.WSPnever collapsed and is deterministic for a fixed program, but it reads one encoder pass per template \(17 here\), takes 2\.3 to 4\.8 times as long to adapt as a tuned baseline \(SST\-2\), and its kernel heads store gigabytes at 8,192 labels\.
- •*What mattered*\(§[4\.9](https://arxiv.org/html/2611.33972#S4.SS9)\)\. The steps that movedWSPchanged how heads are selected and how the task is phrased in the prompt; 27 other ideas, including closed\-form edits of the encoder’s weights and demonstrations in the input, did not help\.

Our main lesson is where the gap between a frozen encoder and fine\-tuning lies on these tasks\. Against FT and LoRA, most of it is a readout gap: on the development datasets a logistic probe on many frozen views comes within about one point, andWSP’s heads and selection cover the rest; on the held\-out datasets the same probe is 1\.5 to 2\.8 points behind, whileWSPis within about half a point of FT and ahead of LoRA on average\. Against PFT on new tasks, a gap of about one point remains that no frozen\-side idea we tried closed; we read it, as a hypothesis, as the part of fine\-tuning that adapts the representation itself\.

## 2Method

textxx1\+Tp1\+T\_\{p\}inputsplain \+ templatesfrozenencoderVVviews\+ label\-word scoresHHheadsclosed formselectioncross\-fittedclassifierLLM editor \(design time\)Figure 1:Closed\-form weight\-space programming\. At design time an LLM editor writes the program: the cloze templates a text is wrapped in, the views read from the frozen encoder, the closed\-form heads \(shrinkage LDA, kernel ridge, the MLM label\-word prior\) and the rule that selects among them\. The plain input andTvT\_\{v\}view templates are read asV=\(1\+Tv\)×2×LV=\(1\+T\_\{v\}\)\\times 2\\times Lviews \(2 poolings at each ofLLlayers\);Tp≥TvT\_\{p\}\\geq T\_\{v\}templates give label\-word scores at<mask\>, so one prediction reads the encoder1\+Tp1\+T\_\{p\}times\. In our RoBERTa\-large instantiation,Tv=8T\_\{v\}=8,Tp=16T\_\{p\}=16,L=12L=12,V=216V=216andH=113H=113\. The classifier’s weights are computed from labelled data, not trained, and no encoder weight changes\.#### Views\.

Letffbe a frozen masked language model, and let a*template*wrap a textxxin a cloze sentence with one<mask\>slot, such as “xIt was<mask\>\.”\. For each text,ffis run on the plain input and on each template\. A*view*is one pooled hidden state of one input at one layer: for the plain input, the first\-token state and the mean of the token states; for a template, the<mask\>state and the mean of the token states\. WithTvT\_\{v\}view templates read at the topLLlayers, a text givesV=\(1\+Tv\)×2×LV=\(1\+T\_\{v\}\)\\times 2\\times Lviews\. Separately, the MLM head’s scores for the task’s label words at<mask\>are read for a set ofTp≥TvT\_\{p\}\\geq T\_\{v\}templates, which gives the label\-word prior; one prediction therefore runsffon1\+Tp1\+T\_\{p\}inputs\. The program fixes the templates, the label words and how view templates are chosen; §[3](https://arxiv.org/html/2611.33972#S3)gives the values of our RoBERTa\-large instantiation\.

#### Closed\-form heads\.

Every head is solved exactly \(Appendix[B](https://arxiv.org/html/2611.33972#A2), Table[10](https://arxiv.org/html/2611.33972#A2.T10)with every grid\): per\-view shrinkage LDA\([Friedman, 1989](https://arxiv.org/html/2611.33972#bib.bib10);[Ledoit and Wolf, 2004](https://arxiv.org/html/2611.33972#bib.bib22)\), averaged over views; LDA on concatenated per\-view principal\-component \(PCA\) projections; a stacked LDA on cross\-fitted per\-view posteriors; template\-pooled LDA; random\-Fourier\-feature ridge\([Rahimi and Recht, 2007](https://arxiv.org/html/2611.33972#bib.bib39)\); exact linear, radial\-basis\-function \(RBF\) and additive multi\-view RBF kernel ridge in dual form; and the zero\-shot label\-word prior of the frozen MLM head\([Zhao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib57), calibrated as in\), alone, as LDA features, as an additive mixture with a supervised head, or as the prior mean of a kernel ridge\. With their hyperparameter grids, the families give a pool ofHHcandidate heads per run\.

#### Selection\.

The selection rule never reads the test set\. Its held\-out rows are the dev set plus 5\-fold cross\-fitted predictions on the labelled training set\([Stone, 1974](https://arxiv.org/html/2611.33972#bib.bib45)\)\(with our budgets, 1\.5 to 9 times as many rows as the dev set\)\. Three rules are candidates: the best head, the average of the top three, and Occam’s window\([Breiman et al\., 1984](https://arxiv.org/html/2611.33972#bib.bib3);[Madigan and Raftery, 1994](https://arxiv.org/html/2611.33972#bib.bib27), every head within one standard error of the best, the one\-standard\-error rule of\); the rule is itself chosen by 20 random half\-splits of the held\-out rows\. The final heads are fitted on all labelled training data\.

#### The editor\.

The editor is an LLM; in this study, Claude \(Anthropic\), used through the Claude Code agent \(Appendix[J](https://arxiv.org/html/2611.33972#A10)\)\. It proposed every program family, template, label\-word set, selection rule and registered round, implemented and ran them, and drafted the analyses; the authors set the goals and constraints, left the technical decisions to the agent, and checked the results\. When writing or revising a program the editor reads dev data, never test data; but as the agent that ran the study it saw the test results of every earlier version, one more reason why the development results are development results\. Its rounds are of two kinds:*editor rounds*, which rewrite the templates of a task and adopt the rewrite only if it gains at least one point of<mask\>\-LDA dev accuracy, and*registered rounds*, each one idea with a pass rule fixed before its first run, scored on dev data and, from the demonstrations round on, on dev and cross\-fitted train rows of a fresh data subset \(§[4\.9](https://arxiv.org/html/2611.33972#S4.SS9)\)\.

## 3Experimental setup

#### Datasets\.

Eleven development datasets: SST\-2\([Socher et al\., 2013](https://arxiv.org/html/2611.33972#bib.bib44)\), AG News, Yelp\-2 and Amazon\-2\([Zhang et al\., 2015](https://arxiv.org/html/2611.33972#bib.bib56)\), MR\([Pang and Lee, 2005](https://arxiv.org/html/2611.33972#bib.bib36)\), SUBJ\([Pang and Lee, 2004](https://arxiv.org/html/2611.33972#bib.bib35)\), CR\([Hu and Liu, 2004](https://arxiv.org/html/2611.33972#bib.bib16)\), MPQA\([Wiebe et al\., 2005](https://arxiv.org/html/2611.33972#bib.bib51)\), TREC\-6\([Li and Roth, 2002](https://arxiv.org/html/2611.33972#bib.bib24)\), BBC News\([Greene and Cunningham, 2006](https://arxiv.org/html/2611.33972#bib.bib12)\)and IMDB\([Maas et al\., 2011](https://arxiv.org/html/2611.33972#bib.bib26)\)\. Six held\-out datasets: SST\-5, CoLA\([Warstadt et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib50)\), DBpedia\-14, Yahoo\-10, Yelp\-5 and Amazon\-5\([Zhang et al\., 2015](https://arxiv.org/html/2611.33972#bib.bib56)\)\. All are English single\-text tasks with 2 to 14 classes and label words of one token, which is what we mean by*few\-class*\. Eight of the 11 development datasets are binary, against one of the six held\-out datasets\. Details are in Appendix[A](https://arxiv.org/html/2611.33972#A1)\.

#### Encoder and recipe\.

We instantiateWSPon RoBERTa\-large\([Liu et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib25)\)\(24 layers, 1,024 dimensions\)\. The final recipe \(v8\) reads the topL=12L=12layers andTv=8T\_\{v\}=8view templates: the four of the task’s program and four of a second batch of twelve \(written by the editor before any of them was scored\), chosen per data subset by 5\-fold train\-only cross\-validated accuracy of the<mask\>\-state LDA \(Appendix[K](https://arxiv.org/html/2611.33972#A11)lists every template and how often each was chosen\)\. That givesV=\(1\+8\)×2×12=216V=\(1\+8\)\\times 2\\times 12=216views of 1,024 dimensions\. The prior reads allTp=16T\_\{p\}=16templates, so one prediction reads the encoder 17 times, and the head pool hasH=113H=113candidates \(Table[10](https://arxiv.org/html/2611.33972#A2.T10)\)\.

#### Labels\.

Each method is run with 512, 2,048 and 8,192 labelled training examples \(the whole pool when it is smaller; BBC News has no 2,048\-label setting\), on 3 data subsets drawn with seeds 0–2; a registered extension adds 64 and 128 labels on the development datasets \(§[4\.5](https://arxiv.org/html/2611.33972#S4.SS5)\), and a second the few\-shot setting of LM\-BFF, 16 labels per class with a dev set of 16 per class, on all 17 datasets \(§[4\.6](https://arxiv.org/html/2611.33972#S4.SS6)\)\. A fixed dev split of 1,024 examples \(BBC News: 245\) is carved from train and used by every method for selection, so the total labelled data is 1,536, 3,072 and 9,216 examples\. This is far more than the 16 examples per class for which PFT was designed\([Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11)\); our budgets test it outside its few\-shot regime\.

#### Baselines\.

FT, LoRA\([Hu et al\., 2022a](https://arxiv.org/html/2611.33972#bib.bib15), rank 8 on query and value;\)and PFT\([Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11), as LM\-BFF without demonstrations;\), all on the same subsets, with seedkktrained on subsetkk\. Each is trained for 768 optimizer steps \(step\-matched across budgets; 654 to 834 where the whole, smaller pool is used\) with two learning rates, and the learning rate and checkpoint are chosen on dev for each seed \(Appendix[A](https://arxiv.org/html/2611.33972#A1)gives every setting and the learning rates selected\)\. PFT trains every weight through the*first*template and the label words of the task’sWSPprogram\. It therefore sharesWSP’s label words and one of its templates, but not the other seven view templates nor the 16\-template prior: the comparison with PFT confounds two contrasts: closed\-form readout against gradient training, and many prompts against one\. Probes on the same frozen encoder: LP, logistic regression on the last layer of the plain input, and LP\-prompt, the same on the<mask\>state of PFT’s template, with the regularisation chosen on dev; two multi\-layer probes, one of them over 16 templates \(§[4\.3](https://arxiv.org/html/2611.33972#S4.SS3)\), read many of the viewsWSPreads\.

#### Statistics\.

Cells are means over the 3 subsets or seeds;±\\pmgives the standard deviation with divisor 3, a descriptive spread of the three runs \(the sample standard deviation, divisor 2, is3/2≈1\.22\\sqrt\{3/2\}\\approx 1\.22times larger\); the tests below use the per\-dataset means\. Across datasets, we test non\-inferiority at a margin of 0\.5 points: a one\-sided pairedtt\-test ofH0H\_\{0\}: mean\(WSP−\-baseline\)≤−0\.5\\leq\-0\.5, together with the 5th percentile of 10,000 bootstrap resamples of datasets; both must clear the margin\. The margin was fixed after the 11\-dataset differences against FT and LoRA were known and before any PFT or held\-out result; it is about the size of the spread of a method across data subsets on our smaller test sets \(Appendix[C](https://arxiv.org/html/2611.33972#A3)\)\. We report, for every comparison, the two\-sided 90%tt\-interval and the complementary test of inferiority beyond the margin \(H0H\_\{0\}: mean≥−0\.5\\geq\-0\.5\), and we make no multiplicity correction across the 15 registered comparisons\. With a Bonferroni correction \(α=0\.05/15\\alpha=0\.05/15\), every development test against FT and LoRA would still pass \(the closest, LoRA at 512 labels, hasp=0\.0028p=0\.0028\), but against PFT only the one at 8,192 labels would \(p=0\.031p=0\.031and0\.0060\.006at 512 and 2,048 labels\)\. A baseline run counts as collapsed when its best dev accuracy is within one point of the majority\-class rate; collapsed seeds are left out of the baseline means \(this only changes LoRA on MPQA at 8,192 labels\)\.

## 4Results

frozen encoder, no gradient traininggradient trainingDatasetsLabelsZero\-shotLPLP\-promptLP\-mlLP\-prompt\-mlWSP \(ours\)FTLoRAPFTWSP−\-PFT11 development51287\.4487\.2190\.0989\.7392\.4693\.7793\.2293\.4293\.85−\-0\.0810 development2,04886\.9789\.3891\.1191\.6193\.3194\.2993\.9593\.8794\.29±\\pm0\.0011 development8,19287\.5691\.3292\.5493\.0394\.0794\.9994\.6594\.6395\.08−\-0\.096 held\-out51259\.1263\.0068\.8363\.4967\.3770\.7470\.2169\.6171\.26−\-0\.516 held\-out8,19259\.2169\.5272\.0270\.2772\.2273\.8974\.2873\.6875\.19−\-1\.30Table 1:Average test accuracy \(%\) over datasets\. Every method is trained or fitted on the same labelled examples and selects on the same 1,024\-example dev set\.Bold: the best of WSP, FT, LoRA and PFT in the row;Underlined: the second best \(none when two tie for the best\); many gaps are a few hundredths of a point, so the ranks are descriptive, and the registered tests \(Table[3](https://arxiv.org/html/2611.33972#S4.T3)\) are the evidence\. Zero\-shot: the calibrated label\-word scores of the frozen MLM head; it fits no head, but its calibration uses the training subset and, for the datasets revised by the editor rounds, its prompts were chosen on dev, so it varies slightly with the budget\. LP and LP\-prompt are linear probes on the last layer of the same frozen encoder \(LP\-prompt: PFT’s template\)\. LP\-ml and LP\-prompt\-ml read many views, as WSP does: the top 12 layers of the plain input with both poolings \(24 views\), and the<mask\>state of the 16 templates of WSP’s prior in the top 12 layers \(192 views\), each view reduced to principal components \(6,144 features\)\. WSP: mean over 3 data subsets \(one run where the whole pool is used\); FT, LoRA, PFT: mean over 3 seeds on the same subsets \(collapsed seeds left out\)\. WSP−\-PFT: the mean of the per\-dataset differences, from unrounded accuracies\. Development rows: these datasets shaped the recipe; held\-out rows: programs fixed before any run on them\. BBC News has no 2,048\-label row \(its pool is smaller\)\.Table 2:Test accuracy \(%\) on each development dataset\.Bold: the best of the four methods at that label budget;Underlined: the second best \(none when two tie for the best\); many gaps are a few hundredths of a point, so the ranks are descriptive, and the registered tests \(Table[3](https://arxiv.org/html/2611.33972#S4.T3)\) are the evidence\. Means over 3 data subsets \(WSP; one run where the whole pool is used\) or 3 seeds \(baselines\); standard deviations and the 2,048\-label results are in Appendix[C](https://arxiv.org/html/2611.33972#A3)\.### 4\.1Development datasets

Table[1](https://arxiv.org/html/2611.33972#S4.T1)gives the averages and Table[2](https://arxiv.org/html/2611.33972#S4.T2)the datasets; these are development results\. With 512 labelsWSPaverages 93\.77%, against 93\.22% for FT, 93\.42% for LoRA and 93\.85% for PFT; with 2,048 labels it is level with PFT \(94\.29% against 94\.29%\) and ahead of FT and LoRA\. The margins are a few tenths of a point, and per dataset they are not uniform: at 512 labelsWSPis above FT on 8 of 11 datasets and above LoRA on 7 of 11, with one tie \(sign tests, ties left out:p=0\.23p=0\.23and0\.340\.34\); the evidence for the average lead comes from the paired tests below, not from a consistent sign\.

#### WhereWSPwins and loses \(512 labels\)\.

Against FT and LoRA,WSPwins most on sentence and review sentiment \(MR, IMDB, SST\-2, Amazon\-2\) and loses most on short opinion phrases \(MPQA\)\. Against PFT the picture is mixed:WSPis ahead on the long reviews \(IMDB, Amazon\-2, Yelp\-2\), on TREC\-6 and on AG News, and behind on the short opinion and review texts, most of all MPQA and CR, where PFT leads by about one point, and on BBC News\. Our hypothesis is that fine\-tuning through a prompt adapts the representation, which a closed\-form readout of a frozen encoder cannot; we did not test it directly\.

#### What the program selects\.

The selection trace of every run is saved\. In the runs with 512 labels, the rule usually averages many heads \(Occam’s window in two thirds of the runs\), and the best single head is most often a supervised head mixed with the zero\-shot prior: with few labels, the encoder’s own label\-word prior carries real weight\. With more labels the additive multi\-view kernel takes over and fewer heads are averaged\. No family is best everywhere\.

Table 3:Registered tests across datasets\. Each cell: the mean of WSP minus the baseline \(points, from unrounded accuracies, so it can differ by 0\.01 from the difference of the rounded averages in Table[1](https://arxiv.org/html/2611.33972#S4.T1)\), and below it the two\-sided 90%tt\-interval; ✓: non\-inferior at a 0\.5\-point margin;×\\times: not shown;‡\\ddagger: inferior by more than the margin \(the whole interval below−0\.5\-0\.5\);bold: WSP ahead with 95% confidence \(bootstrap lower bound above 0\)\. Development rows are development results \(these datasets shaped the recipe\)\. Bounds andpp\-values: Table[16](https://arxiv.org/html/2611.33972#A3.T16)\.

### 4\.2Registered tests

Table[3](https://arxiv.org/html/2611.33972#S4.T3)gives the registered tests with their 90% intervals\. On the development datasets,WSPis non\-inferior to FT, LoRA and PFT at every budget; against PFT the intervals are\[−0\.44,\+0\.28\]\[\-0\.44,\+0\.28\],\[−0\.29,\+0\.28\]\[\-0\.29,\+0\.28\]and\[−0\.21,\+0\.04\]\[\-0\.21,\+0\.04\]at 512, 2,048 and 8,192 labels, so the margin is cleared by 0\.06 to 0\.29 points, a distance of the same order as the steps of the recipe ladder that the development datasets informed\. Against FT the intervals lie above zero at every budget, and against LoRA at 2,048 and 8,192 labels\. On the held\-out datasets no test passes\. Against LoRA,WSPis ahead on average but the test narrowly misses \(p=0\.052p=0\.052and0\.0640\.064\)\. Against FT the intervals are wide \(\[−0\.74,\+1\.80\]\[\-0\.74,\+1\.80\]and\[−1\.33,\+0\.54\]\[\-1\.33,\+0\.54\]\)\. Against PFT, the interval at 8,192 labels,\[−1\.96,−0\.64\]\[\-1\.96,\-0\.64\], lies wholly below the margin: thereWSPis inferior to PFT by more than 0\.5 points \(complementary testp=0\.029p=0\.029; behind on 5 of 6 datasets\)\.

### 4\.3Against probes on the same encoder

A tuned linear probe on the last layer of the frozen encoder is 87\.21% at 512 labels, no better than the zero\-shot prior \(87\.44%\), and a prompted probe on one template is 90\.09%\.WSPis ahead of both on every development dataset at every budget, by 6\.6, 4\.9 and 3\.7 points \(LP\) and 3\.7, 3\.2 and 2\.5 points \(LP\-prompt\) on average at 512, 2,048 and 8,192 labels; on the held\-out datasets LP\-prompt is ahead on Yahoo\-10 with 512 labels\. But both read far less thanWSP: one layer, and at most one template\. Two stronger probes, registered in the revision, read many ofWSP’s views: LP\-ml takes the top 12 layers of the plain input with both poolings \(24 views\), and LP\-prompt\-ml the<mask\>state of the 16 templates ofWSP’s prior, which include its eight view templates, in the top 12 layers \(192 views\)\. Together they cover 120 ofWSP’s 216 views, all but the token means of the templates\. Each view is reduced to principal components fitted on the training subset \(6,144 features\), followed by the same logistic regression with the regularisation chosen on dev\. More views help: LP\-prompt\-ml averages 92\.46%, 93\.31% and 94\.07% on the development datasets at 512, 2,048 and 8,192 labels, 1\.5 to 2\.4 points above LP\-prompt and 0\.6 to 1\.0 points below FT and LoRA\.WSPis still ahead of both new probes on every development dataset at every budget; its average difference to LP\-prompt\-ml is\+\+1\.31,\+\+0\.98 and\+\+0\.92 points \(Table[17](https://arxiv.org/html/2611.33972#A3.T17)\)\. On the held\-out datasetsWSPis ahead of both new probes on all six datasets at both budgets, with an average difference to LP\-prompt\-ml of\+\+3\.37 and\+\+1\.67 points, and there more views do not help the probe: LP\-prompt\-ml averages 67\.37% and 72\.22% at 512 and 8,192 labels, against 68\.83% and 72\.02% for LP\-prompt, and is 1\.5 to 2\.8 points below FT and LoRA\. So on the development datasets, reading more views accounts for most ofWSP’s lead over the last\-layer probes, but not all of it: withWSP’s templates and layers, a tuned logistic regression stays about one point behind\. On the held\-out datasets, a logistic probe gains little or nothing from the same views, andWSP’s lead over the probes stays\. We read this as an interpretation, not a decomposition:WSPalso differs from these probes in its heads, the label\-word prior among them, and in its selection, and we have not separated the two\.

### 4\.4Held\-out datasets

The recipe was built on the development datasets, and some decisions saw their test results \(Appendix[I](https://arxiv.org/html/2611.33972#A9)\)\. The held\-out datasets were run with programs fixed before any run on them: their first templates were written blind, and a mechanical rule fixed beforehand gave five of the six datasets one dev\-only editor round\. They are a cleaner check, with three limits\. \(i\)*Power*: with six datasets, the registered test passes a truly level method only if the standard deviation of the per\-dataset differences is below about 0\.61 points; the observed values are 0\.80 to 2\.01\. \(ii\)*Task mix*: five of the six held\-out datasets have 5 to 14 classes, against two of the 11 development datasets\. \(iii\)*Sequencing*: the second batch \(Yahoo\-10, Yelp\-5, Amazon\-5\) was run after the first batch’s results were known, the held\-out datasets were scored with v7 before v8, and the batch of templates that became v8’s extra views was written for every task, held\-out ones included\.

There, the average difference betweenWSPand FT is\+\+0\.53 points with 512 labels and−\-0\.39 with 8,192; against LoRA it is\+\+1\.13 and\+\+0\.21, and against PFT−\-0\.51 and−\-1\.30 \(Table[1](https://arxiv.org/html/2611.33972#S4.T1), Appendix[C](https://arxiv.org/html/2611.33972#A3)\)\.WSPis the best method on fine\-grained SST\-5 with 512 labels and level with all three on DBpedia\-14, but it is behind every trained baseline on CoLA \(Matthews correlation in Appendix[C](https://arxiv.org/html/2611.33972#A3)\), where the zero\-shot prior of the frozen model is below the majority rate \(45\.1% against 69\.1%\)\. PFT’s lead grows with more labels, and v8’s extra templates bring no gain over v7 on these datasets \(−\-0\.13 and\+\+0\.05 points\)\.

Table 4:Low\-label extension: test accuracy \(%\) on each development dataset with 64 and 128 labelled training examples\. Every method selects on the same 1,024\-example dev set \(BBC News: 245\), more labelled data than the training set itself\. Means over 3 data subsets \(WSP\) or 3 seeds on the same subsets \(FT, LoRA, PFT; collapsed seeds left out\)\.Bold: the best of the four in the row and budget;underlined: the second best \(none when two tie for the best\); the ranks are descriptive, and the registered tests \(Table[5](https://arxiv.org/html/2611.33972#S4.T5)\) are the evidence\. WSP is v8 unchanged, except for a fix for classes absent from a cross\-fitting part, which changes TREC\-6 only\. Standard deviations, the probes per dataset and the fix: Appendix[F](https://arxiv.org/html/2611.33972#A6)\.
### 4\.5Fewer labels: 64 and 128

The main study has no budget below 512 labels\. A registered extension \(Appendix[F](https://arxiv.org/html/2611.33972#A6)\), fixed before any of its runs, runsWSPv8 unchanged and the three trained baselines under the study’s protocol on the 11 development datasets with 64 and 128 labelled training examples \(3 subsets; the baselines train for 768 steps and select learning rate and checkpoint on dev\)\. These are the development datasets, but no part of the recipe was chosen at these budgets\. The dev set stays the study’s 1,024 examples \(BBC News: 245\), more labelled data than the training set itself; it is the same for every method and used only for selection, so this is a low\-label setting, not few\-shot learning in the sense of LM\-BFF, which §[4\.6](https://arxiv.org/html/2611.33972#S4.SS6)tests\. Table[4](https://arxiv.org/html/2611.33972#S4.T4)gives the datasets and Table[5](https://arxiv.org/html/2611.33972#S4.T5)the registered tests\.

With 64 labelsWSPaverages 91\.30%, against 87\.82% for FT, 88\.35% for LoRA and 91\.91% for PFT; with 128 labels it averages 92\.37%, against 90\.69%, 91\.20% and 92\.84%\. The tests give the picture of the main study’s development results, with larger gaps to FT and LoRA:WSPis non\-inferior to both at both budgets, with the whole 90% interval above zero \(\+\+3\.48 and\+\+2\.94 points with 64 labels,\+\+1\.68 and\+\+1\.18 with 128\), and ahead of both on 9 of the 11 datasets with 64 labels\. FT and LoRA lose most where their seeds vary most \(MPQA, TREC\-6 and CR; standard deviations up to 12 points with 64 labels\); after the learning\-rate choice on dev, no baseline seed stays collapsed\. Against PFT no test passes:WSPis−\-0\.61 and−\-0\.47 points behind on average \(90% intervals\[−1\.57,\+0\.36\]\[\-1\.57,\+0\.36\]and\[−1\.23,\+0\.30\]\[\-1\.23,\+0\.30\]\), ahead on 5 and 3 of the 11 datasets, and behind most on MPQA \(by 4\.5 and 3\.5 points\) and CR; it is ahead on MR, Amazon\-2 and IMDB at both budgets\. The zero\-shot prior alone averages 87\.25% with 64 labels, within a point of FT, andWSPfalls below it on MPQA with 64 labels \(by 2\.7 points\) and slightly on SST\-2 and MR with 128; the last\-layer probes are far behind \(LP 77\.32%, LP\-prompt 86\.48% with 64 labels\)\.

Table 5:Registered tests of the low\-label extension \(11 development datasets\), as in Table[3](https://arxiv.org/html/2611.33972#S4.T3): mean of WSP minus the baseline, two\-sided 90%tt\-interval below; ✓: non\-inferior at the 0\.5\-point margin \(registeredtt\-test and bootstrap bound\);×\\times: not shown;‡\\ddagger: inferior by more than the margin;bold: WSP ahead with 95% confidence \(bootstrap lower bound above 0\), as in Table[3](https://arxiv.org/html/2611.33972#S4.T3)\. Full numbers: Table[23](https://arxiv.org/html/2611.33972#A6.T23)\.Table 6:Few\-shot extension: test accuracy \(%\) with 16 labelled examples per class and a dev set of 16 per class, mean over 5 data subsets \(WSP\) or 5 seeds on the same subsets \(FT, LoRA, PFT; trained as in LM\-BFF: batch size 8, 1,000 steps\)\. Top: the 11 development datasets; bottom: the 6 held\-out datasets\.Bold: the best;underlined: the second best \(none when two tie for the best\)\. Standard deviations and the registered tests: Table[24](https://arxiv.org/html/2611.33972#A7.T24)\.
### 4\.6Few\-shot: 16 labels per class

The low\-label extension keeps the study’s large dev set\. A second registered extension \(Appendix[G](https://arxiv.org/html/2611.33972#A7)\), also fixed before any of its runs, uses the few\-shot setting in which PFT was introduced\([Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11)\): 16 labelled training examples per class and a dev set of 16 per class, on all 17 datasets and 5 data subsets\.WSPis v8 unchanged; FT, LoRA and PFT are trained as in LM\-BFF \(batch size 8, 1,000 steps, learning rate and checkpoint chosen on the small dev set\)\. Table[6](https://arxiv.org/html/2611.33972#S4.T6)gives every dataset\.

On the development datasetsWSPaverages 90\.03%, against 84\.71% for FT, 86\.24% for LoRA and 90\.50% for PFT\. It is non\-inferior to FT and LoRA, with average differences of\+\+5\.31 and\+\+3\.79 points and the whole 90% interval above zero, the largest leads of the study: with so few labels, FT and LoRA vary strongly across seeds and fall far behind on SST\-2, MR and CR, whileWSPhas no training run to go astray\. Against PFT the test does not pass: the average difference is−\-0\.47 points \(90% interval\[−1\.85,\+0\.92\]\[\-1\.85,\+0\.92\]\), ahead on 6 of 11 datasets\. On the held\-out datasetsWSPaverages 63\.81%, against 61\.44%, 61\.29% and 65\.20%: ahead of FT and LoRA \(differences\+\+2\.37 and\+\+2\.52 points\), though with six datasets no test passes, and behind PFT \(difference−\-1\.39 points\), which is ahead on 5 of the 6\. CoLA is again the exception for FT and LoRA, which leadWSPthere by 5 to 9 points\.

Table 7:Out\-of\-domain accuracy \(%\) of sentiment models\.Bold: the best in the row;underlined: the second best\. Top: SST\-2 models on IMDB and Yelp reviews\. Bottom: mean over the six binary sentiment datasets as sources, each tested on review sets from other corpora\. WSP is v7 here, the recipe before v8 \(v8 reads 16 templates for its prior instead of 4 and adds four view templates\)\.
### 4\.7Out of domain \(recipe v7\)

Table[7](https://arxiv.org/html/2611.33972#S4.T7)tests sentiment models on review sets from other corpora; this analysis was run with v7, the recipe before v8, whose label\-word prior reads 4 templates instead of 16 and which lacks v8’s four extra view templates\. With SST\-2 as the source, PFT is 3 to 5 points belowWSPon IMDB and Yelp reviews at every budget\. A registered follow\-up at 512 labels with all six binary sentiment datasets as sources shows that this is not general: over the six sources,WSPis level with PFT and slightly behind FT and LoRA\. PFT’s deficit comes from the two sources built from Rotten Tomatoes sentences \(SST\-2 and MR\)\. We therefore do not claim that a frozen encoder makes a classifier more robust\.

### 4\.8Stability, determinism and cost

#### Stability\.

Over both learning rates, 4 of 264 FT runs, 20 of 264 LoRA runs and 0 of 264 PFT runs collapsed\. After the learning\-rate choice on dev, one of the 132 reported LoRA seeds of the main study \(512 to 8,192 labels; the low\-label extension is reported in §[4\.5](https://arxiv.org/html/2611.33972#S4.SS5)\) stays collapsed and no FT or PFT seed does\.WSPhas no optimisation trajectory: none of its 329 runs over all recipe versions collapsed\.

#### Determinism\.

For a fixed program, data subset, hardware and software stack, re\-runningWSPreproduced every prediction file exactly \(73 of 73 files across 23 re\-run configurations\)\. The editor is outside this claim: a new editor round can produce a different program\.

#### Cost\.

WSPreads 17 encoder passes per input at inference where the trained models read one, and the headline results use all 17\. Adapting is not faster\. Timed on an idle GPU \(Appendix[H](https://arxiv.org/html/2611.33972#A8)\), one v8 run on SST\-2 took 8\.9 minutes with 512 labels and 19\.0 minutes with 8,192, against 1\.97 minutes for one FT run \(step\-matched, so about the same at every budget\): 2\.3 and 4\.8 times the two\-run learning\-rate search of a tuned baseline\. Storage depends on the selected head\. Per\-view LDA heads take a few megabytes per task and the PCA\-based heads about 0\.2 GB, but kernel heads must keep the training features of all 216 views: about 0\.45 GB per task with 512 labels and 7\.2 GB with 8,192 \(float32\), against 1\.4 GB for a fine\-tuned copy of RoBERTa\-large and about 3 MB for a LoRA adapter\. At the larger budgets the selected program is usually a kernel head\. A new task also needs what fine\-tuning needs \(the training labels and the dev set\), and new templates need an editor round\.

Table 8:The recipe ladder: average test accuracy \(%\) of every WSP version on the development datasets \(11, 10 and 11 datasets\)\. Each version was written down with a time stamp before its own results and keeps everything above it; every version was scored on these test sets, and the steps have no intervals\. The shaded row is the final recipe\. v6 and v7 rewrote prompts using dev data only, for datasets chosen with their test results in view\. The first recipe, R, exists for one data subset of a few datasets only \(Appendix[I](https://arxiv.org/html/2611.33972#A9)\)\.

### 4\.9What mattered, and what did not

Table[8](https://arxiv.org/html/2611.33972#S4.T8)shows the recipe ladder: each version was fixed, with its time stamp, before its own results, and every version was scored on the development test sets, which is why these are development results\. The steps were built in one order and their gains have no intervals, so they show what each step added in this sequence, not a decomposition\. The steps that bought accuracy changed the program around the encoder\.*The label\-word prior*\(v2\) entered every later recipe\.*Cross\-fitted selection*\(v5\) adds little in domain but raises the out\-of\-domain accuracy of the SST\-2 programs at 8,192 labels from 82\.1% to 92\.5% on IMDB and Yelp \(a gap seen on the out\-of\-domain test sets\): the dev set alone could not tell a robust head from a brittle one of equal dev accuracy\.*Dev\-only editor rounds*\(v6, v7\) rewrote the prompts of four datasets \(\+\+1\.35 on MPQA at 512 labels\), but the tasks to revise were chosen with their test results in view\.*More templates*\(v8: a label\-word prior over 16 templates, four of which are added as views by train\-only cross\-validation\) gave\+\+0\.22,\+\+0\.29 and\+\+0\.11 points at 512, 2,048 and 8,192 labels, but nothing on the held\-out datasets \(−\-0\.13 and\+\+0\.05\)\. Further templates gave nothing more: a further batch in new framings and a batch that names the classes in the prompt, each added only where train\-only cross\-validation favoured it \(−\-0\.003 and−\-0\.03 on fresh data subsets\)\.

After v7, every new idea went through a registered screen on dev and cross\-fitted train rows, never the test set \(from the demonstrations round on, on a fresh data subset\), and only one passed: v8\. Demonstrations in the input, the one idea that feeds labelled examples through the frozen network, came close three times \(on v7, on v8, and on v8 restricted to inputs where every demonstration fits uncut:\+\+0\.17,\+\+0\.06 and\+\+0\.06 against bars of\+\+0\.20,\+\+0\.10 and\+\+0\.10\), with small gains on short inputs and none on long ones\. Among the 27 ideas that did not help \(Appendix[D](https://arxiv.org/html/2611.33972#A4), which marks the ideas judged on test data\) are closed\-form edits of the encoder’s feed\-forward \(FFN\) weights, attention\-head amplification, closed\-form self\-training on unlabelled text, demonstrations in the input, tangent\-kernel views of the kind that describe prompt\-based fine\-tuning in the few\-shot regime\([Malladi et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib28)\), views from inside the network, all sixteen templates as views, class\-offset calibration and greedy ensemble selection\([Caruana et al\., 2004](https://arxiv.org/html/2611.33972#bib.bib5)\)\. At 512 labels, the best head of each family we tried lands on about the same selection estimate \(dev and cross\-fitted train rows\): for the readouts we tried, reading the frozen encoder differently did not move this plateau, while more labels and better prompts did\.

## 5Related work

#### Fine\-tuning and its alternatives\.

Full fine\-tuning\([Devlin et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib8);[Liu et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib25)\)and parameter\-efficient methods such as adapters\([Houlsby et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib14)\), BitFit\([Ben Zaken et al\., 2022](https://arxiv.org/html/2611.33972#bib.bib1)\), prompt tuning\([Lester et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib23)\)and LoRA\([Hu et al\., 2022a](https://arxiv.org/html/2611.33972#bib.bib15)\)train per task;WSPcomputes no gradient and trains no encoder weight\. Fine\-tuning large encoders on small data is unstable\([Dodge et al\., 2020](https://arxiv.org/html/2611.33972#bib.bib9);[Mosbach et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib33);[Zhang et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib55)\), and it can distort pretrained features, which linear probing followed by fine\-tuning avoids\([Kumar et al\., 2022](https://arxiv.org/html/2611.33972#bib.bib21)\)\. In\-context learning\([Brown et al\., 2020](https://arxiv.org/html/2611.33972#bib.bib4)\)adapts without any fit at all, at the cost of a large model per prediction\.

#### Readouts of frozen encoders\.

Whether to fine\-tune or to read frozen layers was studied early for contextual encoders: feature\-based BERT with a good layer combination comes close to fine\-tuning on some tasks\([Devlin et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib8);[Peters et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib37)\), and probe suites read frozen sentence representations\([Conneau and Kiela, 2018](https://arxiv.org/html/2611.33972#bib.bib7)\)\. Closer to us, prompt\-augmented linear probing trains a linear head on prompted representations of a frozen language model\([Cho et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib6)\), and PromptBERT reads the<mask\>state of a template as the representation\([Jiang et al\., 2022](https://arxiv.org/html/2611.33972#bib.bib19)\); our LP\-prompt baseline is a single\-template version of the former\. kNN prompting classifies by nearest neighbours over prompted outputs\([Xu et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib52)\)\. Closed\-form ridge and discriminant heads on frozen backbones are used in few\-shot and continual learning\([Bertinetto et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib2);[McDonnell et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib29)\)\. WhatWSPadds to this line is a selected program over many prompted views, layers, head families and a label\-word prior, cross\-fitted on the labelled data and compared with tuned fine\-tuning under one protocol\.

#### Gradient\-free prompted classifiers\.

Black\-box tuning searches continuous prompts of a frozen model without gradients\([Sun et al\., 2022b](https://arxiv.org/html/2611.33972#bib.bib47);[Sun et al\., 2022a](https://arxiv.org/html/2611.33972#bib.bib46)\), and PromptBoosting boosts prompt\-based weak classifiers built from a frozen model’s outputs with few forward passes\([Hou et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib13)\); both report results close to fine\-tuning in few\-shot settings\.WSPdiffers in reading hidden states as well as label\-word scores and in fitting its heads in closed form rather than searching\.

#### Prompts, verbalizers and calibration\.

Cloze templates turn classification into masked\-word prediction\([Schick and Schütze, 2021](https://arxiv.org/html/2611.33972#bib.bib42);[Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11)\); templates and label words can be searched automatically\([Shin et al\., 2020](https://arxiv.org/html/2611.33972#bib.bib43);[Schick et al\., 2020](https://arxiv.org/html/2611.33972#bib.bib41)\)or expanded with knowledge\([Hu et al\., 2022b](https://arxiv.org/html/2611.33972#bib.bib17)\), and ensembles of prompts\([Jiang et al\., 2020](https://arxiv.org/html/2611.33972#bib.bib20);[Schick and Schütze, 2021](https://arxiv.org/html/2611.33972#bib.bib42)\)and calibration\([Zhao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib57)\)make zero\-shot scores more reliable\. Many of our templates and label words follow LM\-BFF and PET\([Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11);[Schick and Schütze, 2021](https://arxiv.org/html/2611.33972#bib.bib42)\)\(Appendix[K](https://arxiv.org/html/2611.33972#A11)\)\. We use prompts as views of a frozen encoder and as a zero\-shot prior; PFT, which fine\-tunes through them, is our strongest baseline\.

#### Training\-free adaptation in vision\.

Tip\-Adapter mixes the zero\-shot classifier of a frozen CLIP model with a cache kernel over few\-shot training features\([Zhang et al\., 2022](https://arxiv.org/html/2611.33972#bib.bib54)\), and Gaussian discriminant analysis on frozen CLIP features is a hard\-to\-beat training\-free baseline\([Wang et al\., 2024](https://arxiv.org/html/2611.33972#bib.bib49)\); LLM\-written class descriptions improve such zero\-shot classifiers\([Menon and Vondrick, 2023](https://arxiv.org/html/2611.33972#bib.bib32);[Pratt et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib38)\)\.WSP’s mixture and prior\-mean kernel heads are close relatives of these designs, carried over to masked language models with prompted views\.

#### LLMs that design programs\.

LLMs have been used to write and optimise prompts\([Zhou et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib58);[Yang et al\., 2024](https://arxiv.org/html/2611.33972#bib.bib53)\)and to search over programs\([Romera\-Paredes et al\., 2024](https://arxiv.org/html/2611.33972#bib.bib40)\), a form of automated machine learning\([Hutter et al\., 2019](https://arxiv.org/html/2611.33972#bib.bib18)\)\. Our editor is used in that spirit, but we do not evaluate it as a search method\.

#### Editing and programming weights\.

Closed\-form edits of factual associations change a network’s weights\([Meng et al\., 2022](https://arxiv.org/html/2611.33972#bib.bib30);[Meng et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib31)\)\. In weight\-space programming as introduced, an LLM reads and writes a network’s weights directly\([Takehi et al\., 2026](https://arxiv.org/html/2611.33972#bib.bib48)\)\. Concurrently with us,[Ok and Lee \(2026\)](https://arxiv.org/html/2611.33972#bib.bib34)let LLMs write the weights of small models by hand, with no fitting on data: on the combined ARC\-Easy and ARC\-Challenge test sets of the AI2 Reasoning Challenge their best written model reaches 54\.4%, against 82\.1% for a fine\-tuned pretrained model of 0\.8B parameters \(Qwen3\.5\-0\.8B\), but its weights are readable and editable\. Our variant writes no weight; it writes a program that computes a classifier’s weights in closed form from labelled data on a frozen pretrained encoder\. On our development datasets this comes within 0\.5 points of the fine\-tuning baselines, with no gradient step; on new tasks it stays behind prompt\-based fine\-tuning\. We also tried editing the encoder’s own weights in closed form \(Appendix[D](https://arxiv.org/html/2611.33972#A4)\); for classification, fitting the classifier’s weights on read activations mattered far more\.

## 6Conclusion

A closed\-form program over prompted views of a frozen encoder, written with an LLM as design assistant, is better than tuned full fine\-tuning and LoRA in our RoBERTa\-large study: above both on 11 development datasets at every label budget, by more with 64 and 128 labels and most with 16 labels per class, and ahead of LoRA and within about half a point of FT on six held\-out datasets, with no gradient step, no collapse and exact reproducibility for a fixed program\. It is competitive with single\-template prompt\-based fine\-tuning on the development datasets, within half a point, which shaped the recipe; on the held\-out datasets, the cleaner but small check, PFT is ahead, by more than half a point with 8,192 labels, and every trained baseline is ahead on CoLA\. What moved it were how heads are selected and how the task is phrased in the prompt; on new tasks, the remaining gap to prompt\-based fine\-tuning was not closed by any frozen\-side idea we tried\.

## Limitations

- •Development results\.The comparisons on the 11 development datasets informed the recipe \(Appendix[I](https://arxiv.org/html/2611.33972#A9)\); they are development results, not confirmatory ones\.
- •PFT is not matched, and not beaten\.PFT reads one template whereWSPreads eight and a 16\-template prior; a multi\-template PFT was not run\. On the held\-out datasets PFT is ahead \(by 0\.51 points with 512 labels and 1\.30 with 8,192, the latter beyond the margin\), most of all on CoLA and, with 8,192 labels, on the 5\- and 10\-class datasets\.
- •Held\-out check\.Six datasets give little power, their task mix differs from the development datasets, and they were run in two batches \(§[4\.4](https://arxiv.org/html/2611.33972#S4.SS4)\)\.
- •Acceptability and short opinion phrases\.WSPtrails every trained baseline on CoLA and is about one point behind PFT on MPQA and CR with 512 labels\.
- •Cost\.17 encoder passes per input, slower adaptation than a tuned baseline, and gigabytes of stored features for kernel heads at 8,192 labels \(§[4\.8](https://arxiv.org/html/2611.33972#S4.SS8)\)\.
- •Scope\.One main encoder, RoBERTa\-large\. The final recipe matched FT and LoRA on roberta\-base \(within 0\.12 points\) but was 0\.46 to 1\.72 points behind them on bert\-large \(Appendix[E](https://arxiv.org/html/2611.33972#A5)\); English single\-text tasks with one\-token label words only; the few\-shot extension has one budget \(16 labels per class\); small test sets \(CR: 376, TREC\-6: 500, SST\-2: 872\) make differences under one point noisy\.
- •The editor\.The LLM\-written programs were not compared with human\-written or published templates, and an editor round is not deterministic\.

## Ethics statement

We use public English text\-classification datasets under their research licences and release no new data\.WSPneeds no gradient training, but its inference cost \(17 encoder passes per input\) falls on whoever deploys it, and its kernel heads store training features, which matters when the training texts are sensitive\. The LLM editor \(Claude, Anthropic, through the Claude Code agent\) wrote the programs, templates and code, ran the experiments and drafted analyses and text \(Appendix[J](https://arxiv.org/html/2611.33972#A10)\); it read no test data while writing a program, and the authors checked and are responsible for everything reported\.

## Availability

Code, the recipe programs and templates, the indices of every data subset, the time\-stamped plan with every registration and deviation, and the prediction files will be released\.

## References

- Ben Zaken et al\. \(2022\)Elad Ben Zaken, Yoav Goldberg, and Shauli Ravfogel\. 2022\.[BitFit: Simple parameter\-efficient fine\-tuning for transformer\-based masked language\-models](https://doi.org/10.18653/v1/2022.acl-short.1)\.In*Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics \(Volume 2: Short Papers\)*\.
- Bertinetto et al\. \(2019\)Luca Bertinetto, João F\. Henriques, Philip H\. S\. Torr, and Andrea Vedaldi\. 2019\.Meta\-learning with differentiable closed\-form solvers\.In*International Conference on Learning Representations*\.
- Breiman et al\. \(1984\)Leo Breiman, Jerome H\. Friedman, Richard A\. Olshen, and Charles J\. Stone\. 1984\.*Classification and Regression Trees*\.Wadsworth\.
- Brown et al\. \(2020\)Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D\. Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al\. 2020\.Language models are few\-shot learners\.In*Advances in Neural Information Processing Systems*\.
- Caruana et al\. \(2004\)Rich Caruana, Alexandru Niculescu\-Mizil, Geoff Crew, and Alex Ksikes\. 2004\.[Ensemble selection from libraries of models](https://doi.org/10.1145/1015330.1015432)\.In*Proceedings of the 21st International Conference on Machine Learning*\.
- Cho et al\. \(2023\)Hyunsoo Cho, Hyuhng Joon Kim, Junyeob Kim, Sang\-Woo Lee, Sang\-goo Lee, Kang Min Yoo, and Taeuk Kim\. 2023\.Prompt\-augmented linear probing: Scaling beyond the limit of few\-shot in\-context learners\.In*Proceedings of the AAAI Conference on Artificial Intelligence*, volume 37\.
- Conneau and Kiela \(2018\)Alexis Conneau and Douwe Kiela\. 2018\.[SentEval: An evaluation toolkit for universal sentence representations](https://aclanthology.org/L18-1269)\.In*Proceedings of the Eleventh International Conference on Language Resources and Evaluation \(LREC 2018\)*\.
- Devlin et al\. \(2019\)Jacob Devlin, Ming\-Wei Chang, Kenton Lee, and Kristina Toutanova\. 2019\.[BERT: Pre\-training of deep bidirectional transformers for language understanding](https://doi.org/10.18653/v1/N19-1423)\.In*Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies*\.
- Dodge et al\. \(2020\)Jesse Dodge, Gabriel Ilharco, Roy Schwartz, Ali Farhadi, Hannaneh Hajishirzi, and Noah Smith\. 2020\.Fine\-tuning pretrained language models: Weight initializations, data orders, and early stopping\.*arXiv preprint arXiv:2002\.06305*\.
- Friedman \(1989\)Jerome H\. Friedman\. 1989\.[Regularized discriminant analysis](https://doi.org/10.1080/01621459.1989.10478752)\.*Journal of the American Statistical Association*, 84\(405\):165–175\.
- Gao et al\. \(2021\)Tianyu Gao, Adam Fisch, and Danqi Chen\. 2021\.[Making pre\-trained language models better few\-shot learners](https://doi.org/10.18653/v1/2021.acl-long.295)\.In*Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing \(Volume 1: Long Papers\)*\.
- Greene and Cunningham \(2006\)Derek Greene and Pádraig Cunningham\. 2006\.Practical solutions to the problem of diagonal dominance in kernel document clustering\.In*Proceedings of the 23rd International Conference on Machine Learning*\.
- Hou et al\. \(2023\)Bairu Hou, Joe O’Connor, Jacob Andreas, Shiyu Chang, and Yang Zhang\. 2023\.PromptBoosting: Black\-box text classification with ten forward passes\.In*Proceedings of the 40th International Conference on Machine Learning*\.
- Houlsby et al\. \(2019\)Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly\. 2019\.Parameter\-efficient transfer learning for NLP\.In*Proceedings of the 36th International Conference on Machine Learning*\.
- Hu et al\. \(2022a\)Edward J\. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen\-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen\. 2022a\.[LoRA: Low\-rank adaptation of large language models](https://openreview.net/forum?id=nZeVKeeFYf9)\.In*International Conference on Learning Representations*\.
- Hu and Liu \(2004\)Minqing Hu and Bing Liu\. 2004\.[Mining and summarizing customer reviews](https://doi.org/10.1145/1014052.1014073)\.In*Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining*\.
- Hu et al\. \(2022b\)Shengding Hu, Ning Ding, Huadong Wang, Zhiyuan Liu, Jingang Wang, Juanzi Li, Wei Wu, and Maosong Sun\. 2022b\.Knowledgeable prompt\-tuning: Incorporating knowledge into prompt verbalizer for text classification\.In*Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\)*\.
- Hutter et al\. \(2019\)Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren, editors\. 2019\.[*Automated Machine Learning: Methods, Systems, Challenges*](https://doi.org/10.1007/978-3-030-05318-5)\.Springer\.
- Jiang et al\. \(2022\)Ting Jiang, Jian Jiao, Shaohan Huang, Zihan Zhang, Deqing Wang, Fuzhen Zhuang, Furu Wei, Haizhen Huang, Denvy Deng, and Qi Zhang\. 2022\.PromptBERT: Improving BERT sentence embeddings with prompts\.In*Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing*\.
- Jiang et al\. \(2020\)Zhengbao Jiang, Frank F\. Xu, Jun Araki, and Graham Neubig\. 2020\.[How can we know what language models know?](https://doi.org/10.1162/tacl_a_00324)*Transactions of the Association for Computational Linguistics*, 8:423–438\.
- Kumar et al\. \(2022\)Ananya Kumar, Aditi Raghunathan, Robbie Jones, Tengyu Ma, and Percy Liang\. 2022\.Fine\-tuning can distort pretrained features and underperform out\-of\-distribution\.In*International Conference on Learning Representations*\.
- Ledoit and Wolf \(2004\)Olivier Ledoit and Michael Wolf\. 2004\.[A well\-conditioned estimator for large\-dimensional covariance matrices](https://doi.org/10.1016/S0047-259X(03)00096-4)\.*Journal of Multivariate Analysis*, 88\(2\):365–411\.
- Lester et al\. \(2021\)Brian Lester, Rami Al\-Rfou, and Noah Constant\. 2021\.[The power of scale for parameter\-efficient prompt tuning](https://doi.org/10.18653/v1/2021.emnlp-main.243)\.In*Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing*\.
- Li and Roth \(2002\)Xin Li and Dan Roth\. 2002\.[Learning question classifiers](https://aclanthology.org/C02-1150)\.In*COLING 2002: The 19th International Conference on Computational Linguistics*\.
- Liu et al\. \(2019\)Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov\. 2019\.RoBERTa: A robustly optimized BERT pretraining approach\.*arXiv preprint arXiv:1907\.11692*\.
- Maas et al\. \(2011\)Andrew L\. Maas, Raymond E\. Daly, Peter T\. Pham, Dan Huang, Andrew Y\. Ng, and Christopher Potts\. 2011\.[Learning word vectors for sentiment analysis](https://aclanthology.org/P11-1015)\.In*Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies*\.
- Madigan and Raftery \(1994\)David Madigan and Adrian E\. Raftery\. 1994\.[Model selection and accounting for model uncertainty in graphical models using Occam’s window](https://doi.org/10.1080/01621459.1994.10476894)\.*Journal of the American Statistical Association*, 89\(428\):1535–1546\.
- Malladi et al\. \(2023\)Sadhika Malladi, Alexander Wettig, Dingli Yu, Danqi Chen, and Sanjeev Arora\. 2023\.A kernel\-based view of language model fine\-tuning\.In*Proceedings of the 40th International Conference on Machine Learning*\.
- McDonnell et al\. \(2023\)Mark D\. McDonnell, Dong Gong, Amin Parvaneh, Ehsan Abbasnejad, and Anton van den Hengel\. 2023\.RanPAC: Random projections and pre\-trained models for continual learning\.In*Advances in Neural Information Processing Systems*\.
- Meng et al\. \(2022\)Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov\. 2022\.Locating and editing factual associations in GPT\.In*Advances in Neural Information Processing Systems*\.
- Meng et al\. \(2023\)Kevin Meng, Arnab Sen Sharma, Alex Andonian, Yonatan Belinkov, and David Bau\. 2023\.Mass\-editing memory in a transformer\.In*International Conference on Learning Representations*\.
- Menon and Vondrick \(2023\)Sachit Menon and Carl Vondrick\. 2023\.Visual classification via description from large language models\.In*International Conference on Learning Representations*\.
- Mosbach et al\. \(2021\)Marius Mosbach, Maksym Andriushchenko, and Dietrich Klakow\. 2021\.On the stability of fine\-tuning BERT: Misconceptions, explanations, and strong baselines\.In*International Conference on Learning Representations*\.
- Ok and Lee \(2026\)Hyunjong Ok and Jaeho Lee\. 2026\.[Weight\-space programming doesn’t need transformers](https://arxiv.org/abs/2611.22055)\.*arXiv preprint arXiv:2611\.22055*\.
- Pang and Lee \(2004\)Bo Pang and Lillian Lee\. 2004\.[A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts](https://aclanthology.org/P04-1035)\.In*Proceedings of the 42nd Annual Meeting of the Association for Computational Linguistics*\.
- Pang and Lee \(2005\)Bo Pang and Lillian Lee\. 2005\.[Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales](https://aclanthology.org/P05-1015)\.In*Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics*\.
- Peters et al\. \(2019\)Matthew E\. Peters, Sebastian Ruder, and Noah A\. Smith\. 2019\.[To tune or not to tune? Adapting pretrained representations to diverse tasks](https://doi.org/10.18653/v1/W19-4302)\.In*Proceedings of the 4th Workshop on Representation Learning for NLP \(RepL4NLP\-2019\)*, pages 7–14\.
- Pratt et al\. \(2023\)Sarah Pratt, Ian Covert, Rosanne Liu, and Ali Farhadi\. 2023\.What does a platypus look like? Generating customized prompts for zero\-shot image classification\.In*Proceedings of the IEEE/CVF International Conference on Computer Vision*\.
- Rahimi and Recht \(2007\)Ali Rahimi and Benjamin Recht\. 2007\.Random features for large\-scale kernel machines\.In*Advances in Neural Information Processing Systems*\.
- Romera\-Paredes et al\. \(2024\)Bernardino Romera\-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M\. Pawan Kumar, Emilien Dupont, Francisco J\. R\. Ruiz, Jordan S\. Ellenberg, Pengming Wang, Omar Fawzi, Pushmeet Kohli, and Alhussein Fawzi\. 2024\.[Mathematical discoveries from program search with large language models](https://doi.org/10.1038/s41586-023-06924-6)\.*Nature*, 625:468–475\.
- Schick et al\. \(2020\)Timo Schick, Helmut Schmid, and Hinrich Schütze\. 2020\.Automatically identifying words that can serve as labels for few\-shot text classification\.In*Proceedings of the 28th International Conference on Computational Linguistics*\.
- Schick and Schütze \(2021\)Timo Schick and Hinrich Schütze\. 2021\.[Exploiting cloze\-questions for few\-shot text classification and natural language inference](https://doi.org/10.18653/v1/2021.eacl-main.20)\.In*Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume*\.
- Shin et al\. \(2020\)Taylor Shin, Yasaman Razeghi, Robert L\. Logan IV, Eric Wallace, and Sameer Singh\. 2020\.[AutoPrompt: Eliciting knowledge from language models with automatically generated prompts](https://doi.org/10.18653/v1/2020.emnlp-main.346)\.In*Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing*\.
- Socher et al\. \(2013\)Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D\. Manning, Andrew Ng, and Christopher Potts\. 2013\.[Recursive deep models for semantic compositionality over a sentiment treebank](https://aclanthology.org/D13-1170)\.In*Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing*\.
- Stone \(1974\)Mervyn Stone\. 1974\.[Cross\-validatory choice and assessment of statistical predictions](https://doi.org/10.1111/j.2517-6161.1974.tb00994.x)\.*Journal of the Royal Statistical Society: Series B \(Methodological\)*, 36\(2\):111–147\.
- Sun et al\. \(2022a\)Tianxiang Sun, Zhengfu He, Hong Qian, Yunhua Zhou, Xuanjing Huang, and Xipeng Qiu\. 2022a\.BBTv2: Towards a gradient\-free future with large language models\.In*Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing*\.
- Sun et al\. \(2022b\)Tianxiang Sun, Yunfan Shao, Hong Qian, Xuanjing Huang, and Xipeng Qiu\. 2022b\.Black\-box tuning for language\-model\-as\-a\-service\.In*Proceedings of the 39th International Conference on Machine Learning*\.
- Takehi et al\. \(2026\)Rikiya Takehi, Jayden Teoh, Alex Zhang, and Omar Khattab\. 2026\.[Sparks of weight\-space programming: LLMs can natively read & write neural network weights](https://rikiyat.github.io/blog/weight-space-programming/)\.Blog post, MIT CSAIL, 2 November 2026\.
- Wang et al\. \(2024\)Zhengbo Wang, Jian Liang, Lijun Sheng, Ran He, Zilei Wang, and Tieniu Tan\. 2024\.A hard\-to\-beat baseline for training\-free CLIP\-based adaptation\.In*International Conference on Learning Representations*\.
- Warstadt et al\. \(2019\)Alex Warstadt, Amanpreet Singh, and Samuel R\. Bowman\. 2019\.[Neural network acceptability judgments](https://doi.org/10.1162/tacl_a_00290)\.*Transactions of the Association for Computational Linguistics*, 7:625–641\.
- Wiebe et al\. \(2005\)Janyce Wiebe, Theresa Wilson, and Claire Cardie\. 2005\.[Annotating expressions of opinions and emotions in language](https://doi.org/10.1007/s10579-005-7880-9)\.*Language Resources and Evaluation*, 39:165–210\.
- Xu et al\. \(2023\)Benfeng Xu, Quan Wang, Zhendong Mao, Yajuan Lyu, Qiaoqiao She, and Yongdong Zhang\. 2023\.[kNN prompting: Beyond\-context learning with calibration\-free nearest neighbor inference](https://arxiv.org/abs/2303.13824)\.In*International Conference on Learning Representations*\.
- Yang et al\. \(2024\)Chengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu, Quoc V\. Le, Denny Zhou, and Xinyun Chen\. 2024\.[Large language models as optimizers](https://arxiv.org/abs/2309.03409)\.In*International Conference on Learning Representations*\.
- Zhang et al\. \(2022\)Renrui Zhang, Wei Zhang, Rongyao Fang, Peng Gao, Kunchang Li, Jifeng Dai, Yu Qiao, and Hongsheng Li\. 2022\.Tip\-Adapter: Training\-free adaption of CLIP for few\-shot classification\.In*Computer Vision – ECCV 2022*\.
- Zhang et al\. \(2021\)Tianyi Zhang, Felix Wu, Arzoo Katiyar, Kilian Q\. Weinberger, and Yoav Artzi\. 2021\.Revisiting few\-sample BERT fine\-tuning\.In*International Conference on Learning Representations*\.
- Zhang et al\. \(2015\)Xiang Zhang, Junbo Zhao, and Yann LeCun\. 2015\.Character\-level convolutional networks for text classification\.In*Advances in Neural Information Processing Systems*\.
- Zhao et al\. \(2021\)Zihao Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh\. 2021\.Calibrate before use: Improving few\-shot performance of language models\.In*Proceedings of the 38th International Conference on Machine Learning*\.
- Zhou et al\. \(2023\)Yongchao Zhou, Andrei Ioan Muresanu, Ziwen Han, Keiran Paster, Silviu Pitis, Harris Chan, and Jimmy Ba\. 2023\.Large language models are human\-level prompt engineers\.In*International Conference on Learning Representations*\.

## Appendix ADatasets and setup

DatasetClassesTrain poolTestMax\. tokensSST\-2266k87264AG News4119k7,600128MR27\.5k1,06664SUBJ27\.0k2,00064CR22\.4k37696MPQA27\.8k2,00032TREC\-664\.4k50048BBC News59811,000256Yelp\-2249k5,000∗256Amazon\-2249k5,000∗192IMDB224k5,000∗256SST\-558\.6k‡2,21064CoLA27\.5k1,04364DBpedia\-141450k†5,000∗128Yahoo\-101050k†5,000∗256Yelp\-5550k†5,000∗256Amazon\-5550k†5,000∗192Table 9:Datasets\. Train pool: what remains after the 1,024\-example dev split \(BBC News: 245\)\.∗A fixed class\-stratified sample of the official test set\.†A random sample of the training set\.‡The official train and dev sets combined, before the dev split\. CoLA’s test set is the GLUE validation set \(69\.1% acceptable\)\.#### Budgets and subsets\.

Every dataset is run with 512 and 8,192 labelled examples, and all development datasets but BBC News also with 2,048\. When the pool is smaller than the budget \(MR, SUBJ, CR, MPQA, TREC\-6, BBC News and CoLA at 8,192\) the whole pool is used, and the cell has one data subset\. Subsetkkis drawn with seedkk; FT, LoRA and PFT seedkktrain on exactly subsetkk\. Every method also uses the dev split \(1,024 examples, BBC News 245\) for selection, so the labelled data per cell is the budget plus the dev split\.

#### Held\-out datasets\.

SST\-5 and CoLA complete the single\-sentence tasks of the LM\-BFF suite\([Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11)\); DBpedia\-14, Yahoo\-10, Yelp\-5 and Amazon\-5 complete the suite of[Zhang et al\. \(2015\)](https://arxiv.org/html/2611.33972#bib.bib56)\. Their round\-1 programs were written blind, and a mechanical rule, fixed beforehand, gave a task one dev\-only editor round if its zero\-shot dev accuracy was below 85%; five of the six met it \(DBpedia\-14 did not\)\. Their programs are blind to their test data, but not to the literature: several of their templates and label words are those of LM\-BFF or close to PET patterns \(Appendix[K](https://arxiv.org/html/2611.33972#A11)\)\. The second batch \(Yahoo\-10, Yelp\-5, Amazon\-5\) was run after the first batch’s results were known; it had been named as optional from the start\.

#### Trained baselines\.

FT trains every parameter with a linear classification head; LoRA uses rank 8,α=16\\alpha=16and dropout 0\.1 on the query and value projections\. All use AdamW \(weight decay 0\.01, none on biases and layer norms\), batch size 32, 6% linear warm\-up, gradient clipping at 1\.0, and the same maximum length asWSP\. Training is step\-matched: 768 optimizer steps, the number of steps of 3 epochs on 8,192 labels \(48 epochs at 512 labels, 12 at 2,048\)\. Where the whole pool is used because it is smaller than the budget, the epochs are set to give a similar count: 654 to 834 steps \(3 epochs for MR, SUBJ, MPQA, CoLA and SST\-5, 6 for TREC\-6, 10 for CR, 25 for BBC News\)\. Learning rates: FT and PFT\{10−5,3⋅10−5\}\\\{10^\{\-5\},3\\cdot 10^\{\-5\}\\\}, LoRA\{3⋅10−4,10−3\}\\\{3\\cdot 10^\{\-4\},10^\{\-3\}\\\}; dev accuracy is evaluated every 50 steps \(100 at 8,192 labels\), and the learning rate and checkpoint with the best dev accuracy are kept per seed\. On the development datasets the selected learning rates were: FT10−510^\{\-5\}in 76 of 96 seeds; LoRA3⋅10−43\\cdot 10^\{\-4\}in 55 of 96; PFT10−510^\{\-5\}in 70 of 96\. FT’s frequent choice of the lower edge of its grid suggests that a smaller learning rate might have helped it; we did not extend the grid\. The long\-text datasets are trained with bf16 autocast\. PFT wraps the input in the first template of the task’sWSPprogram, scores a class by the mean logit of its label words at<mask\>from the pretrained MLM head, and adds no parameter\. For CR, whose program changed in v7, PFT is run with both prompts and the better one on dev is kept per seed\. The development effort was unequal:WSPwent through eight recipe versions, editor rounds and 27 screened ideas, the baselines through one fixed protocol\.

#### Probes\.

LP isℓ2\\ell\_\{2\}\-regularised logistic regression on the last layer of the plain input \(the<s\>state or the mean of the token states, chosen on dev\); LP\-prompt is the same on the<mask\>state of the first template, as prompt\-augmented linear probing\([Cho et al\., 2023](https://arxiv.org/html/2611.33972#bib.bib6)\)with one template\. The regularisation strength \(9 values\) is chosen on dev\. LP\-ml and LP\-prompt\-ml, registered in the revision before any of their runs, read the top 12 layers of the plain input \(24 views\) or the<mask\>state of the 16 prior templates at the top 12 layers \(192 views\), each view reduced to principal components fitted on the training subset \(256 or 32 per view, 6,144 features\), with the same fitting and selection\.

## Appendix BThe closed\-form heads

Table 10:Candidate heads and their grids \(113 per run\)\. Bandwidths are relative to the median distancemvm\_\{v\}; ridge values are relative to the trace of the kernel\. Calibration of zs: the label\-word scores minus their mean over the training subset\([Zhao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib57)\)\.#### Selection\.

The held\-out rows of the selection are the dev rows and the 5\-fold cross\-fitted rows of the labelled training set\. The stacked head’s cross\-fitted score is optimistic \(its meta\-head is fitted on posteriors whose own fits saw the other folds; 0\.67 points above a fully nested cross\-fit on average in control runs\)\. This can only change which head is selected, never a reported test accuracy, since selection never reads test data\.

## Appendix CResults for every dataset

Tables[11](https://arxiv.org/html/2611.33972#A3.T11)–[15](https://arxiv.org/html/2611.33972#A3.T15)give every method on every dataset with standard deviations, Table[16](https://arxiv.org/html/2611.33972#A3.T16)the registered tests in full with the complementary statistics, Table[17](https://arxiv.org/html/2611.33972#A3.T17)the multi\-view probes of §[4\.3](https://arxiv.org/html/2611.33972#S4.SS3)on every dataset, and Table[18](https://arxiv.org/html/2611.33972#A3.T18)CoLA’s Matthews correlation\. Per\-run comparisons: in the 33 paired runs per baseline at 512 labels on the development datasets \(WSPon subsetkkagainst the baseline seed trained on subsetkk\),WSPis significantly better than FT in 9 and worse in 0 \(McNemar’s exact test,p<0\.05p<0\.05\), against LoRA 11 and 0, and against PFT 5 and 6; with 8,192 labels the counts are 3 and 0, 4 and 0, and 0 and 2\.

Table 11:Development datasets, 512 labels: test accuracy \(%\)\. Small numbers: standard deviation \(divisor 3\) over 3 data subsets \(WSP\) or 3 seeds on the same subsets \(baselines; collapsed seeds left out\)\. A whole\-pool cell has one subset, and WSP’s has no deviation\. Zero\-shot: calibrated label\-word scores \(calibration on the training subset\); LP and LP\-prompt: last\-layer probes\.Table 12:Development datasets, 2,048 labels: test accuracy \(%\)\. Small numbers: standard deviation \(divisor 3\) over 3 data subsets \(WSP\) or 3 seeds on the same subsets \(baselines; collapsed seeds left out\)\. A whole\-pool cell has one subset, and WSP’s has no deviation\. Zero\-shot: calibrated label\-word scores \(calibration on the training subset\); LP and LP\-prompt: last\-layer probes\.Table 13:Development datasets, 8,192 labels \(whole pool when smaller\): test accuracy \(%\)\. Small numbers: standard deviation \(divisor 3\) over 3 data subsets \(WSP\) or 3 seeds on the same subsets \(baselines; collapsed seeds left out\)\. A whole\-pool cell has one subset, and WSP’s has no deviation \(LoRA on MPQA: the mean of its 2 seeds that did not collapse, no deviation shown\)\. Zero\-shot: calibrated label\-word scores \(calibration on the training subset\); LP and LP\-prompt: last\-layer probes\.Table 14:Held\-out datasets, 512 labels: test accuracy \(%\), as in Table[11](https://arxiv.org/html/2611.33972#A3.T11)\. The held\-out datasets were added after the recipe ladder up to v7 was fixed; their programs were fixed before any run on them, and each recipe version \(v2 to v7, later v8\) was run on them once\.Table 15:Held\-out datasets, 8,192 labels: test accuracy \(%\), as in Table[11](https://arxiv.org/html/2611.33972#A3.T11)\. The held\-out datasets were added after the recipe ladder up to v7 was fixed; their programs were fixed before any run on them, and each recipe version \(v2 to v7, later v8\) was run on them once\.Table 16:The registered non\-inferiority tests in full, with the complementary statistics added in the revision\.kk: datasets; Mean diff\.: mean over datasets of WSP minus the baseline \(points\); SD: sample standard deviation of the per\-dataset differences; 90% interval: two\-sidedtt\-interval\. Lower bound: 5th percentile of 10,000 bootstrap resamples of datasets\. Non\-inferior: one\-sided pairedtt\-test ofH0H\_\{0\}: mean difference≤−0\.5\\leq\-0\.5withp<0\.05p<0\.05, and the lower bound above−0\.5\-0\.5\(the registered test\)\. Inferior: the complementary one\-sided test ofH0H\_\{0\}: mean difference≥−0\.5\\geq\-0\.5\. No correction for the 15 comparisons; with Bonferroni \(α=0\.05/15\\alpha=0\.05/15\) the development tests against PFT at 512 and 2,048 labels would not pass\. With six held\-out datasets, the registered test can pass for a truly level method only if the SD is below about 0\.61\.Table 17:The stronger probes \(registered and added in the revision, §[4\.3](https://arxiv.org/html/2611.33972#S4.SS3)\) against WSP, test accuracy \(%\), means over 3 data subsets \(one whole\-pool run where the pool is smaller than 8,192\)\. LP\-p \(LP\-prompt\): last\-layer<mask\>state of PFT’s template\. LP\-ml: the top 12 layers of the plain input, both poolings \(24 views\); LP\-p\-ml \(LP\-prompt\-ml\): the<mask\>state of the 16 templates of WSP’s prior in the top 12 layers \(192 views\); each view reduced to principal components fit on the training subset \(6,144 features\), then the same logistic regression with the regularisation chosen on dev\.Bold: the best of the four\.Table 18:CoLA: Matthews correlation \(×100\\times 100\) on the GLUE validation set, computed from the saved test predictions \(mean over 3 subsets or seeds; WSP at 8,192 labels: one whole\-pool run\)\. The majority rate is 69\.1%, and the zero\-shot prior reaches 45\.1% accuracy\.
## Appendix DNegative results

Table 19:The 27 ideas that did not help, with their evidence, in the order they were tried\.†Judged partly on test results \(the first, weight\-editing phase of the project\); every later idea was judged on dev data or on the held\-out estimate \(dev and cross\-fitted train rows\)\. The registered rounds \(from the demonstrations on\) were scored before any test run, on dev and cross\-fitted train rows of a fresh data subset at 512 labels, against a control arm\. The ideas that were adopted are not listed here; they are the recipe versions of Table[25](https://arxiv.org/html/2611.33972#A9.T25)\. The tangent\-view results concern the closed\-form kernels of our recipe at 512 labels, not the few\-shot regime in which[Malladi et al\. \(2023\)](https://arxiv.org/html/2611.33972#bib.bib28)describe prompt\-based fine\-tuning as kernel regression\.Table[19](https://arxiv.org/html/2611.33972#A4.T19)lists every idea that did not help\. A methodological lesson from the demonstrations round: when labelled training items enter the features \(here as demonstrations in the input of other items\), cross\-fitted scores leak a held\-out item’s label through its neighbours’ demonstrations\. In our runs this raised cross\-fitted accuracy by 0\.4 to 0\.6 points on average over the candidates, and by up to 6\.8 points for single heads, until every cross\-fitted score was rebuilt fold\-clean\.

## Appendix EOther encoders

We ran the recipe, unchanged, on roberta\-base and bert\-large \(SST\-2 and AG News, 8,192 labels, 3 subsets\), with the same baseline protocol, first with v7 and then with v8; each check was registered before any of its runs\. Table[20](https://arxiv.org/html/2611.33972#A5.T20)gives the v8 results\. On roberta\-base,WSPis within 0\.12 points of the better of FT and LoRA, as on roberta\-large, and PFT is ahead \(by 1\.03 points on SST\-2 and 0\.37 on AG News\)\. On bert\-large the result does not transfer:WSPis 1\.72 points behind LoRA on SST\-2 and 0\.46 behind FT on AG News\. On bert\-large SST\-2 we also ran the encoder\-specific program of a registered editor round, which is v7 on this encoder; with v8’s added templates and views it is 0\.95 points below its v7 result \(91\.55\) and 2\.06 behind LoRA, so v8’s additions did not help on this encoder\. The recipe reads the encoder through cloze prompts and the<mask\>state, a signal much stronger in RoBERTa than in BERT\.

Table 20:Other encoders, 8,192 labels, test accuracy \(%\), mean \(and standard deviation forWSP\) over 3 subsets\.ΔFT/LoRA\\Delta\_\{\\text\{FT/LoRA\}\}:WSPv8 minus the better of FT and LoRA, from unrounded means\.eThe registered encoder\-specific editor\-round program \(v7’s on bert\-large SST\-2\); every other row is the unchanged recipe, for which v7 equals v5 on these two datasets\.
## Appendix FLow\-label extension: 64 and 128 labels

#### Design\.

The extension was registered on 22 November 2026, before any of its runs, as an evaluation of the final recipe, not a recipe change:WSPis v8, and nothing in it was changed in response to these results\. It covers the 11 development datasets with 64 and 128 labelled training examples, on 3 stratified data subsets \(seedkk= subsetkk, as in the main study\)\. FT, LoRA and PFT use the study’s learning\-rate grids and train for 768 optimizer steps at batch size 32 \(384 epochs at 64 labels, 192 at 128\), with the dev set evaluated every 50 steps and the learning rate and checkpoint with the best dev accuracy kept per seed; CR’s PFT is run with both of its programs, and the better one on dev is kept per seed\. LP and LP\-prompt are run as in the main study\. The analysis was fixed with the design: the per\-dataset and average tables and the registered non\-inferiority tests of §[3](https://arxiv.org/html/2611.33972#S3)at each budget against FT, LoRA and PFT, reported whatever they show\.

#### Two disclosures\.

\(i\)*The dev set\.*The dev split stays the study’s fixed 1,024 examples \(BBC News: 245\), larger than the training set at these budgets\. It is the same for every method and is used for selection only, but it means the methods see more labelled data than the budget names; a setting with a dev set as small as the training set is the separate few\-shot extension \(Appendix[G](https://arxiv.org/html/2611.33972#A7)\)\. \(ii\)*A crash fix\.*WSPon TREC\-6 at 64 labels, subset 0, stopped with an error: the stacked LDA head’s linear system was singular\. Its five cross\-fitting folds are not stratified, and with 64 labels a TREC\-6 class can have a single example, so the training part of a fold can miss a class, whose mean was then undefined\. The fix gives a class absent from an LDA’s training rows the overall mean as its class mean and floors the class priors at10−610^\{\-6\}; when every class is present, the computation is unchanged bit for bit\. We checked every data subset: the fix changes TREC\-6 only, whose rarest class has one or two training examples at these budgets and is missing from some cross\-fitting part in all six of its subsets\. On the other ten datasets at 64 and 128 labels, and on all 17 datasets at 512 labels, the smallest budget of the main study, every class is present in every part\. The failed run had produced no result; it was rerun with the fixed code, which every TREC\-6 run used\.

Tables[21](https://arxiv.org/html/2611.33972#A6.T21)and[22](https://arxiv.org/html/2611.33972#A6.T22)give every method with standard deviations \(no baseline seed stayed collapsed after the learning\-rate choice\), and Table[23](https://arxiv.org/html/2611.33972#A6.T23)the registered tests in full\.

Table 21:Low\-label extension, 64 labels: test accuracy \(%\)\. Small numbers: standard deviation \(divisor 3\) over 3 data subsets \(WSP, probes\) or 3 seeds on the same subsets \(FT, LoRA, PFT\)\. No baseline seed stayed collapsed after the learning\-rate choice on dev\. Zero\-shot: calibrated label\-word scores \(calibration on the training subset\); LP and LP\-prompt: last\-layer probes\.Table 22:Low\-label extension, 128 labels: test accuracy \(%\)\. Small numbers: standard deviation \(divisor 3\) over 3 data subsets \(WSP, probes\) or 3 seeds on the same subsets \(FT, LoRA, PFT\)\. No baseline seed stayed collapsed after the learning\-rate choice on dev\. Zero\-shot: calibrated label\-word scores \(calibration on the training subset\); LP and LP\-prompt: last\-layer probes\.Table 23:The registered tests of the low\-label extension in full, as in Table[16](https://arxiv.org/html/2611.33972#A3.T16)\. Non\-inferior: one\-sided pairedtt\-test ofH0H\_\{0\}: mean difference≤−0\.5\\leq\-0\.5\(with the bootstrap bound, the registered test\); Inferior: the complementary test ofH0H\_\{0\}: mean difference≥−0\.5\\geq\-0\.5\. No multiplicity correction\.

## Appendix GFew\-shot extension: 16 labels per class

#### Design\.

The extension was registered on 23 November 2026, before any of its runs, as an evaluation of the final recipe, not a recipe change:WSPis v8 \(with the fix of Appendix[F](https://arxiv.org/html/2611.33972#A6)\), and nothing in it was changed in response to these results\. Every one of the 17 datasets is run withK=16K=16labelled training examples per class and a dev set of 16 per class, drawn from the study’s fixed dev split with its own seed, on 5 data subsets \(seeds 0–4, as in LM\-BFF\); every method sees the same training and dev examples\.WSPselects on the small dev set plus its cross\-fitted training rows, as always\. FT, LoRA and PFT are trained as in the few\-shot setting of LM\-BFF: batch size 8, 1,000 optimizer steps, the dev set evaluated every 100 steps, and the learning rate \(the study’s grids\) and checkpoint with the best dev accuracy kept per seed; CR’s PFT is run with both of its programs, and the better on dev is kept per seed\. The analysis was fixed with the design: per\-dataset means and averages for the development and the held\-out datasets separately, and the registered non\-inferiority tests of §[3](https://arxiv.org/html/2611.33972#S3)with the complementary statistics\.

#### Disclosures\.

The runs were paused for about 13 hours to free the GPU for another project and resumed from the record of finished runs; the two runs in progress at the pause were rerun from the start\. The analysis script was written after the runs, implementing the analysis fixed at registration; it breaks ties between learning rates in favour of the lower one\. No baseline seed collapsed\. Table[24](https://arxiv.org/html/2611.33972#A7.T24)gives every dataset with standard deviations and the tests in full\.

Table 24:Few\-shot extension \(16 labels per class, dev 16 per class\): test accuracy \(%\) with the standard deviation \(divisor 5\) over 5 data subsets \(WSP\) or 5 seeds \(baselines\), and the registered tests across datasets as in Table[3](https://arxiv.org/html/2611.33972#S4.T3): non\-inferiority at a 0\.5\-point margin \(one\-sidedtt\-test and bootstrap lower bound; ✓: both clear the margin\), the two\-sided 90%tt\-interval and the datasets ahead and behind\. No baseline seed collapsed\.

## Appendix HCompute and storage

#### Time\.

One RTX 5090 \(32 GB\), timed with the GPU otherwise idle \(the other jobs on the machine paused\) and checked against FT control runs\. The v8 timing control was 21% faster than its reference that day, so by a rule fixed before any v8 time was read, v8 is reported as a ratio to the FT control of the same queue, on the reference scale: on SST\-2, one v8 run took 9\.65 times one FT run at 8,192 labels \(19\.0 minutes on the reference scale; peak GPU memory 11\.9 GB\) and 4\.51 times at 512 labels \(8\.9 minutes; 5\.8 GB\), where one FT run takes 1\.97 minutes\. A tuned baseline needs two runs \(its learning\-rate grid\) per subset, so v8 takes 4\.8 and 2\.3 times as long\. The AG News timings of the same queue are not used: the process that paused the other jobs stopped early, so those runs shared the GPU\. Earlier, one v7 run \(5 encoder passes\) took 3 to 6\.5 minutes and one training run 1\.7 to 2\.9 minutes\. These times cover model loading, featurisation, all candidate heads and their selection, and the test evaluation; inference itself needs 17 encoder passes per input for v8 \(5 for v7\) where a trained model needs one\.

#### Storage\.

WSPkeeps one frozen encoder for all tasks plus a head per task\. Per\-view LDA heads take a few megabytes per task; the PCA\-based heads keep 216 projection matrices \(about 0\.2 GB\); the kernel heads keep the standardised training features of all 216 views,n×221,184n\\times 221\{,\}184values: about 0\.45 GB with 512 labels and 7\.2 GB with 8,192 in float32\. A fine\-tuned copy of RoBERTa\-large is 1\.4 GB \(355M parameters in float32\) and a LoRA adapter about 3 MB \(0\.8M parameters\)\.

#### Determinism\.

Re\-runningWSPwith the same program, data subset, hardware and software reproduced every prediction file exactly \(73 of 73 files across 23 re\-run configurations\)\.

## Appendix IProtocol: what was fixed when, and every deviation

#### The records\.

Every recipe version, registered round and statistical test was written as a dated entry, with its lab\-clock time, in a plan file kept during the project, before its own results were computed\. The file was not under version control and was not deposited with a third\-party registry, so its times cannot be verified independently; we release it unchanged with the code\. We call this a time\-stamped internal plan, not a pre\-registration\. Several time stamps were written wrongly, by minutes, and later corrected in the file with notes; none changes the order of events\.

Table 25:The recipe ladder\. R to v5 had no adoption rule: each was written down as a complete recipe before its results, run on every development dataset and carried forward as the next recipe, and all are reported\. Six development datasets \(Yelp\-2, Amazon\-2, IMDB, MPQA, TREC\-6 and BBC News\) were held out from the design of R to v4: they were added to the study before any run on them\. The registered rounds after v7 each had a pass rule fixed before their first run; only round 9 \(v8\) passed\.Table 26:Recipe R, which exists for data subset 0 of a few development datasets only, against later versions on the same datasets \(test accuracy, %\)\.
#### Every decision that saw test results\.

1. \(1\)The tasks revised by the editor rounds of v6 \(MPQA, TREC\-6, SUBJ: whereWSPtrailed most\) and v7 \(CR\) were chosen with their test results in view; the revisions themselves used dev data only\.
2. \(2\)Cross\-fitted selection \(v5\) was motivated by an out\-of\-domain gap of the SST\-2 programs seen on the out\-of\-domain test sets\.
3. \(3\)The ideas of the first, weight\-editing phase \(marked†in Table[19](https://arxiv.org/html/2611.33972#A4.T19)\) were judged partly on test results\.
4. \(4\)The 0\.5\-point margin was fixed after the development differences against FT and LoRA were known, before any PFT or held\-out result\.
5. \(5\)The registered rounds after v7 were motivated by the test results of earlier versions \(for instance, that PFT led on MPQA, CR, BBC News, SST\-2 and SUBJ\); their pass rules read dev and cross\-fitted train rows of fresh data subsets only\.
6. \(6\)The idea behind v8 came from reading an earlier round’s dev\-only screen, so its screen used a new data subset\.
7. \(7\)The second held\-out batch was run after the first batch’s results were known, and the held\-out datasets were scored with v7 before v8 was designed\.
8. \(8\)The batch of templates that became v8’s extra views was written for every task, held\-out ones included, after the held\-out v7 results were known\.

Three further deviations concern the measurements, not the design: the v8 timing used a ratio rule registered after its first control run \(above\), its AG News runs were discarded by the registered rules, and in the low\-label extension a fix for classes absent from a cross\-fitting part was made after a crash; it changes TREC\-6 only \(Appendix[F](https://arxiv.org/html/2611.33972#A6)\)\.

## Appendix JThe editor

#### What it was\.

The editor was Claude \(Anthropic\), used through the Claude Code agent in one continuous working session from 15 to 22 November 2026; the session log records Claude Opus 5\.5 for most of the work and Claude Fable 5\.2 for part of it\. It worked on a laptop that sent jobs to one GPU machine\.

#### Who decided what\.

The human authors set the research goal and its constraints \(for example, the requests to keep improvingWSPuntil it is level with PFT, to run every heavy job on the GPU machine, and to report results honestly\), chose the venue, and left the technical decisions to the agent\. The agent proposed and implemented every program, template, label\-word set, head family, selection rule and registered round; wrote each registration and its pass rule; chose the tasks of the editor rounds of v6 and v7; ran all experiments; and drafted the analyses and this paper\. The human authors checked the results and the text and are responsible for them\.

#### What it read\.

When writing or revising a program, the editor read the task description, examples from the training and dev data and dev accuracies of candidate templates, never test data\. As the agent that ran the study, it also saw every earlier test result \(Appendix[I](https://arxiv.org/html/2611.33972#A9)\)\.

#### How much it proposed\.

Editor round 1: four templates and a label\-word set per task, written blind\. Round 2 \(v6\): 8 new templates \(6 for SUBJ\) and one alternative label\-word set for each of three tasks, written before any was scored\. Round 3 \(v7\): new templates for CR and MPQA and new label words for AG News, adopted for CR only\. Registered round 7: a batch of 12 templates for every one of the 17 tasks \(Table[32](https://arxiv.org/html/2611.33972#A11.T32)\)\. Later batches: 8 error\-driven templates per task, 12 templates in new framings, 12 templates that name the classes\. In all, 27 ideas did not pass \(Table[19](https://arxiv.org/html/2611.33972#A4.T19)\)\.

#### One example round\.

In round 2 for MPQA, the editor wrote 8 templates before scoring any; each was scored by the dev accuracy of an LDA on its<mask\>state \(512 labels, subset 0, the test set never featurised\), and the best four of the twelve \(old and new\) became the program: 86\.52% to 88\.89%<mask\>\-LDA dev accuracy, above the one\-point rule\. Selecting the best four of twelve on dev is itself optimistic\.

#### What was not tested\.

We did not compare the editor’s programs with human\-written or published templates, nor with an automatic template search, and an editor round is not deterministic: rerunning it can give other templates\.

## Appendix KTemplates and label words

Tables[27](https://arxiv.org/html/2611.33972#A11.T27)–[35](https://arxiv.org/html/2611.33972#A11.T35)give every template and label word;xis the input text, and label words that are not a single token are dropped at run time\. Templates marked⋆are identical to manual templates of LM\-BFF\([Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11)\)\.

Table 27:Round\-1 programs of the development datasets, written once before any run on the dataset; the final program of every dataset not listed in Table[29](https://arxiv.org/html/2611.33972#A11.T29)\.⋆: identical to a manual template of LM\-BFF\([Gao et al\., 2021](https://arxiv.org/html/2611.33972#bib.bib11)\), whose label words great and terrible we also use; AG News’ second template is close to a PET pattern\([Schick and Schütze, 2021](https://arxiv.org/html/2611.33972#bib.bib42)\)\.Table 28:Round\-1 programs of the development datasets, written once before any run on the dataset; the final program of every dataset not listed in Table[29](https://arxiv.org/html/2611.33972#A11.T29)\(continued\)\.Table 29:Programs revised by the dev\-only editor rounds: MPQA, TREC\-6 and SUBJ in round 2 \(v6\), CR in round 3 \(v7\)\.Table 30:Held\-out datasets: round\-1 programs \(r1\), written before any run, and the final programs after the mechanical editor round \(final; DBpedia\-14 did not meet its trigger and keeps r1\)\.Table 31:Held\-out datasets: round\-1 programs \(r1\), written before any run, and the final programs after the mechanical editor round \(final; DBpedia\-14 did not meet its trigger and keeps r1\) \(continued\)\.Table 32:The second batch of editor templates, written before any of them was scored, for every dataset, held\-out ones included\. In v8, all 16 templates \(the program’s 4 and these 12; a duplicate of a program template is dropped\) feed the label\-word prior, and in every run the 4 of these 12 with the best 5\-fold train\-only cross\-validated<mask\>\-LDA accuracy are added as views \(Table[35](https://arxiv.org/html/2611.33972#A11.T35)\)\.Table 33:The second batch of editor templates \(continued\)\.DatasetsThe second batch of 12 templates \(round 7\), numbered as in Table[35](https://arxiv.org/html/2611.33972#A11.T35)Yelp\-5\(1\)xThe food was<mask\>\.
\(2\)xThe service was<mask\>\.
\(3\)xA<mask\>place \.
\(4\)xMy verdict :<mask\>\.
\(5\)xIn a word ,<mask\>\.
\(6\)xI found it<mask\>\.\(7\)xOverall , a<mask\>experience \.
\(8\)xIt was<mask\>\.
\(9\)xRating :<mask\>\.
\(10\) A<mask\>review :x
\(11\)xI would say it is<mask\>\.
\(12\)xSimply<mask\>\.Table 34:The second batch of editor templates \(continued\)\.Table 35:Which of the 12 round\-7 templates \(Tables[32](https://arxiv.org/html/2611.33972#A11.T32)–[34](https://arxiv.org/html/2611.33972#A11.T34)\) v8 added as views: in each run \(every budget and data subset of the main study\) the 4 with the best train\-only cross\-validated accuracy are chosen, so the views differ between runs\.
## Appendix LGlossary

ProgramThe templates, label words, views, heads and selection rule of a task\.

ViewOne pooled state \(<mask\>, token mean, or<s\>\) of one layer for one input form \(plain or a template\)\.

Recipe version \(R, v2–v8\)One complete way of building programs; v8 is the final recipe\.

Editor roundA dev\-only rewrite of a task’s templates, adopted if it gains at least one point of<mask\>\-LDA dev accuracy\.

Registered roundOne idea with a pass rule fixed before its first run; rounds 3 to 16 in the plan’s numbering, of which round 9 became v8\.

Stage\-1 screenThe first test of a registered round, on dev and cross\-fitted train rows \(from the demonstrations round on, of a fresh data subset\), against a control arm; the test set is never loaded\.

estThe selection’s held\-out estimate: accuracy on the dev rows and the 5\-fold cross\-fitted train rows\.

Development datasetsThe 11 datasets the recipe was built on\.

Held\-out datasetsThe 6 datasets added later, with programs fixed before any run on them\.

Dev setThe 1,024 labelled examples carved from train and used for selection by every method\.

相似文章

权重空间编程可直接写入上下文学习,效果媲美语言模型微调

arXiv cs.CL

本文首次对权重空间编程进行了受控评估,表明前沿大语言模型能够直接将上下文学习写入另一个模型的权重中——仅修改 0.002-0.9% 的参数——在六项任务、四种编辑器和三个模型系列上,其效果与上下文学习准确率及基于梯度的微调相当。

使用ART微调多模态大语言模型:基于艺术强化训练

Hugging Face Daily Papers

ART(基于艺术强化训练)通过梯度反向传播优化原始视觉输入,实现对冻结的多模态大语言模型的参数高效微调,其性能与LoRA相当,同时支持为vLLM等高吞吐引擎预编译的计算图。

基于权重空间元学习的机器人策略自适应

Hugging Face Daily Papers

提出WIZARD,一种权重空间元学习框架,它从语言指令和演示视频中为冻结的VLA策略生成任务特定的LoRA参数,从而实现无需微调的高效任务自适应。