Research log Small Model Experimentation
GitHub

Qwen Episodic Soft-Prompt Task Vectors

Finished2026-06-27imported · line YBenchmark GeneralizationGitHub ↗
Tuned hidden hints do not beat plain prompting

The one idea you need

A soft prompt is a handful of invisible primer tokens slipped in front of every request to a frozen model. Here each reformatting task gets its own tiny set, shaped by that task's four worked examples to steer output, while the model itself never changes.

The question

If you tune a small set of hidden primer tokens for each reformatting task, does a frozen small model nail more of those tasks perfectly than plain instructions?

What we found

No. Tuning the primer tokens on each task's own examples solved exactly the same share of tasks perfectly as plain instructions: just over half either way. The tuning genuinely worked, beating a version trained on deliberately scrambled examples by more than 7 points, yet that edge was too small to finish even one extra task, and per-item accuracy inched up by only one point.

Why it matters

When adapting a frozen small model from just a few examples per task, a tuned hidden prefix is not worth the training cost here: plain instructions already capture what those few examples can teach. Test that gap before investing.

Tasks solved perfectly52.5% → 52.5%tuned hidden prefix vs plain instructions, no change
Per-item accuracy70.4% → 71.5%tuning added barely one point
Edge over scrambled-example version+7.5 pointstasks solved perfectly, proof the tuning learned the right target
Tasks that changed1 helped, 1 hurtout of 40 tasks; 38 unchanged
On this page
  1. Results at a glance
  2. Overview
  3. Report
    1. Question
    2. Setup
    3. Main Result
    4. Interpretation
    5. Charts
    6. Deltas Versus Direct Row Baseline
    7. Task Details
    8. Train Loss Log
    9. Files
  4. Experiment log
  5. Figures
  6. Data files
  7. Reproduce
  8. Related

Results at a glance 6

How often each method solved tasks correctly on unseen examples

How to read

Bars group six methods, from plain instructions to the tuned hidden prefix. Height is accuracy on examples never trained on; taller is better. Each method shows two bars: the whole task solved perfectly, and individual answers correct.

0%20%40%60%80%direct (row-by-row)direct (row-by-row)52.5%70.4%learned soft prompt (row)learned soft prompt (row)52.5%71.5%untrained soft prompt (row)untrained soft prompt (row)50%71.7%shuffled-label soft prompt (row)shuffled-label soft prompt (row)45%63.5%learned soft prompt (batch)learned soft prompt (batch)42.5%63.7%direct (batch)direct (batch)40%65%

Takeaway → The plain-instructions bar and the tuned-prefix bar reach identical height for whole tasks, so the tuning added nothing over asking the model directly.

Data table
methodfull-task exactrow exact
direct (row-by-row)52.5%70.4%
learned soft prompt (row)52.5%71.5%
untrained soft prompt (row)50%71.7%
shuffled-label soft prompt (row)45%63.5%
learned soft prompt (batch)42.5%63.7%
direct (batch)40%65%

Numbers from analysis/summary.csv

Technical framing

Held-out accuracy by method: learned soft prompt vs direct inference and controls — The learned per-task soft prompt ties direct row-by-row inference on full-task exact (52.5%) and beats the shuffled-label control, but never beats direct.

Change in fully-solved tasks versus plain instructions

How to read

Bars show each method's change in how many tasks it solved perfectly, measured against plain instructions at the zero line. Above zero means improvement; every bar here rests on or dips below the line.

-15%-10%-5%-0%learned soft prompt (row)learned soft prompt (row)0%untrained soft prompt (row)untrained soft prompt (row)-2.5%shuffled-label soft prompt (row)shuffled-label soft prompt (row)-7.5%learned soft prompt (batch)learned soft prompt (batch)-10%direct (batch)direct (batch)-12.5%

Takeaway → The tuned prefix's bar sits exactly on zero and every other method falls below it, so nothing beat plain instructions on fully solved tasks.

Data table
methodfull-task exact delta
learned soft prompt (row)0%
untrained soft prompt (row)-2.5%
shuffled-label soft prompt (row)-7.5%
learned soft prompt (batch)-10%
direct (batch)-12.5%

Numbers from analysis/method_deltas.csv

Technical framing

Change vs direct row-by-row baseline (full-task exact) — No condition beats the direct baseline on fully solved tasks; the learned prefix is neutral (1 task helped, 1 hurt, 38 tied).

Training progress on real versus scrambled examples

How to read

Two lines track how far off the prefix's fit is as tuning proceeds step by step; lower means a better fit. One line trains on the task's real examples, the other on deliberately scrambled ones.

02460246shuffled labelslearned (real labels)learned (real lab…

Takeaway → The real-example line drops steadily and far lower, showing the prefix genuinely learned, so the flat end result is not a training failure.

Data table
optimization steplearned (real labels)shuffled labels
01.063.92
10.7473.43
20.5883.04
30.4872.63
40.3722.21
50.2891.87
60.2481.58

Numbers from report table 'Train Loss Log' (per-step means of analysis/train_log.csv)

Technical framing

Soft-prompt training loss: real labels vs shuffled labels — The prefix optimizes cleanly on real labels (mean loss 1.06 to 0.25 in 6 steps), so the null result is not a failure to train.

Tasks made better, worse, or unchanged versus plain instructions

How to read

For each of five methods, three bars count how many of the forty tasks it improved, worsened, or left unchanged compared with plain instructions. More improved and fewer worsened is better.

010203040Learned soft prompt (row)Learned soft prompt (row)1138Untrained init prefix (row)Untrained init prefix (row)0139Shuffled-label prefix (row)Shuffled-label prefix (row)1435Learned soft prompt (batch)Learned soft prompt (batch)0436Direct (batch)Direct (batch)0535

Takeaway → Nearly every task lands in the unchanged pile; the tuned prefix helped one task and hurt one, a wash overall.

Data table
MethodTasks helpedTasks hurtTasks tied
Learned soft prompt (row)1138
Untrained init prefix (row)0139
Shuffled-label prefix (row)1435
Learned soft prompt (batch)0436
Direct (batch)0535

Numbers from experiments/qwen_episodic_soft_prompt_task_vectors/analysis/method_deltas.csv

Technical framing

Tasks helped vs hurt relative to direct row-by-row (40-task run) — Almost every task ties the direct baseline; the learned prefix helps 1 task and hurts 1, while controls only hurt.

Change in single-answer accuracy versus plain instructions

How to read

Bars show each method's change in how often individual answers matched exactly, against plain instructions at the zero line; above zero is better. Both the tuned prefix and an untuned prefix rise slightly.

-7.5%-5%-2.5%-0%2.5%Learned soft prompt (row)Learned soft prompt (row)1%Untrained init prefix (row)Untrained init prefix (row)1.2%Shuffled-label prefix (row)Shuffled-label prefix (row)-6.9%Learned soft prompt (batch)Learned soft prompt (batch)-6.7%Direct (batch)Direct (batch)-5.4%

Takeaway → An untuned prefix rises just as much as the tuned one, so the tiny gain comes from having any prefix, not from tuning it.

Data table
MethodChange in row exact vs direct row
Learned soft prompt (row)1%
Untrained init prefix (row)1.2%
Shuffled-label prefix (row)-6.9%
Learned soft prompt (batch)-6.7%
Direct (batch)-5.4%

Numbers from experiments/qwen_episodic_soft_prompt_task_vectors/analysis/method_deltas.csv

Technical framing

Row-level accuracy change vs direct row-by-row baseline (40-task run) — At row level the untrained init prefix gains as much as the learned one, so training adds nothing beyond having any prefix.

Single-answer accuracy at two test-set sizes

How to read

Bars show how often single answers matched exactly for each of six methods, measured on a smaller and a larger set of test tasks; taller is better. The two sizes check whether the ranking holds.

0%20%40%60%80%Direct (row)Direct (row)67.5%70.4%Learned soft prompt (row)Learned soft prompt (row)70.4%71.5%Untrained init prefix (row)Untrained init prefix (row)68.8%71.7%Shuffled-label prefix (row)Shuffled-label prefix (row)62.5%63.5%Learned soft prompt (batch)Learned soft prompt (batch)67.1%63.7%Direct (batch)Direct (batch)61.3%65%

Takeaway → Method ordering barely shifts between the two sizes, and the tuned prefix's edge over plain instructions stays tiny either way.

Data table
Method20 tasks40 tasks
Direct (row)67.5%70.4%
Learned soft prompt (row)70.4%71.5%
Untrained init prefix (row)68.8%71.7%
Shuffled-label prefix (row)62.5%63.5%
Learned soft prompt (batch)67.1%63.7%
Direct (batch)61.3%65%

Numbers from experiments/qwen_episodic_soft_prompt_task_vectors/runs/main_qwen_soft_prompt_20_s6_lr001/summary.csv and runs/main_qwen_soft_prompt_40_s6_lr001/summary.csv

Technical framing

Held-out row accuracy at 20-task vs 40-task evaluation budgets — Method ordering is roughly stable across budgets: row-by-row decoding beats batch, and the learned prefix edge over direct stays tiny.

In the author’s words from the Report · “Interpretation”

The learned soft-prompt row method changes strict full-task exact by 0.0 points relative to direct row-by-row inference. It changes full-task exact by 2.5 points relative to the untrained initialized prefix and by 7.5 points relative to a prefix optimized on shuffled training outputs. The learned prefix changes row exact by 1.0 points relative to direct row-by-row inference. It helps 1 tasks and hurts 1 tasks on strict full-task exact. A positive result requires learned_soft_row to beat direct inference and both soft-prefix controls. This run is neutral for strict full-task exact and weakly positive only at row level. … Read the full result →

Overview

Standalone experiment testing whether a short continuous prefix optimized per task can improve Qwen's held-out text-transformation consistency.

Main Run

  • Run directory: runs/main_qwen_soft_prompt_40_s6_lr001
  • Markdown report: reports/qwen_episodic_soft_prompt_task_vectors_report.md
  • HTML report: reports/qwen_episodic_soft_prompt_task_vectors_report.html
  • Persistent log: experiment_log.md

Key CSVs

  • analysis/summary.csv: method-level metrics.
  • analysis/method_deltas.csv: wins/losses versus direct row-by-row inference.
  • analysis/task_details.csv: task-level outputs and exactness.
  • analysis/row_details.csv: row-level outputs and exactness.
  • analysis/train_log.csv: leave-one-out soft-prompt training loss.

Key Charts

Data Placement

Large benchmark data is kept outside the experiment directory under:

/workspace/large_artifacts/qwen_episodic_soft_prompt_task_vectors

Report

Rendered from reports/qwen_episodic_soft_prompt_task_vectors_report.md

Question

Can a frozen language model become more consistent on text-transformation tasks by learning a small continuous task vector from that task's examples?

Each task receives its own optimized soft prefix. The model weights are frozen. The prefix is trained on leave-one-out versions of the task's training rows, then evaluated on held-out rows.

Setup

  • Dataset root: /workspace/large_artifacts/qwen_episodic_soft_prompt_task_vectors/prose-benchmarks
  • Run: main_qwen_soft_prompt_40_s6_lr001
  • Model: Qwen/Qwen3-4B
  • Tasks: 40
  • Soft tokens: 8
  • Optimization steps: 6
  • Learning rate: 0.01
  • Train examples per task: 4
  • Held-out cap per task: 4

Main Result

methodtasksrow_exactfull_task_exactparse_okavg_outputs
direct_row4070.4%52.5%100.0%3.750
learned_soft_row4071.5%52.5%100.0%3.750
init_soft_row4071.7%50.0%100.0%3.750
shuffled_soft_row4063.5%45.0%100.0%3.750
learned_soft_batch4063.7%42.5%95.0%3.750
direct_batch4065.0%40.0%95.0%3.750

Interpretation

The learned soft-prompt row method changes strict full-task exact by 0.0 points relative to direct row-by-row inference. It changes full-task exact by 2.5 points relative to the untrained initialized prefix and by 7.5 points relative to a prefix optimized on shuffled training outputs.

The learned prefix changes row exact by 1.0 points relative to direct row-by-row inference. It helps 1 tasks and hurts 1 tasks on strict full-task exact. A positive result requires learned_soft_row to beat direct inference and both soft-prefix controls.

This run is neutral for strict full-task exact and weakly positive only at row level. The learned prefix beats the shuffled-label control, showing that the optimization target matters, but it does not improve the number of fully solved tasks over direct row-by-row inference.

Charts

Full-task exact by method

Row versus full-task accuracy

Wins and losses versus direct

Family heatmap

Train loss curves

Deltas Versus Direct Row Baseline

methodtasksfull_task_deltarow_exact_deltatasks_helpedtasks_hurttasks_tied
learned_soft_row400.0%1.0%1138
init_soft_row40-2.5%1.2%0139
shuffled_soft_row40-7.5%-6.9%1435
learned_soft_batch40-10.0%-6.7%0436
direct_batch40-12.5%-5.4%0535

Task Details

task_idfamilymethodrow_exactfull_task_exactparse_okparse_statusoutput_count
Address.000002Addressdirect_batch33.3%FalseTrueok3
Address.000013Addressdirect_batch50.0%FalseTrueok4
BillingCode.000007BillingCodedirect_batch0.0%FalseTrueok3
City.000010Citydirect_batch100.0%TrueTrueok3
City.000011Citydirect_batch75.0%FalseTrueok4
Column.000001Columndirect_batch100.0%TrueTrueok4
DateTime.000004DateTimedirect_batch100.0%TrueTrueok4
DateTime.000007DateTimedirect_batch100.0%TrueTrueok4
DateTime.000017DateTimedirect_batch75.0%FalseTrueok4
DateTime.000025DateTimedirect_batch75.0%FalseTrueok4
DateTime.000027DateTimedirect_batch50.0%FalseTrueok4
DateTime.000034DateTimedirect_batch100.0%TrueTrueok4
DateTime.000051DateTimedirect_batch0.0%FalseTrueok3
DateTime.000076DateTimedirect_batch75.0%FalseTrueok4
DateTime.000081DateTimedirect_batch0.0%FalseTrueok4
DateTime.000094DateTimedirect_batch100.0%TrueTrueok4
DateTime.000104DateTimedirect_batch100.0%TrueTrueok4
DateTime.000108DateTimedirect_batch100.0%TrueTrueok4
DateTime.000111DateTimedirect_batch75.0%FalseTrueok4
DateTime.000114DateTimedirect_batch75.0%FalseTrueok4
DateTime.000115DateTimedirect_batch0.0%FalseTrueok4
DateTime.000116DateTimedirect_batch50.0%FalseTrueok4
FilePath.000001FilePathdirect_batch100.0%TrueTrueok4
Gender.000001Genderdirect_batch66.7%FalseTrueok3
Language.000002Languagedirect_batch100.0%TrueTrueok4
Name.000028Namedirect_batch100.0%TrueTrueok4
Number.000008Numberdirect_batch25.0%FalseTrueok4
Number.000015Numberdirect_batch75.0%FalseTrueok4
Number.000016Numberdirect_batch0.0%FalseFalseparse_fail4
Number.000022Numberdirect_batch50.0%FalseTrueok4
Number.000028Numberdirect_batch100.0%TrueTrueok3
Number.000029Numberdirect_batch0.0%FalseTrueok3
Number.000043Numberdirect_batch100.0%TrueTrueok4
Number.000049Numberdirect_batch0.0%FalseFalseparse_fail4
Number.000075Numberdirect_batch50.0%FalseTrueok4
Number.000077Numberdirect_batch66.7%FalseTrueok3
Phone.000008Phonedirect_batch100.0%TrueTrueok4
Phone.000011Phonedirect_batch100.0%TrueTrueok3
ShippingCode.000008ShippingCodedirect_batch33.3%FalseTrueok3
UserAgent.000003UserAgentdirect_batch100.0%TrueTrueok4
Address.000002Addressdirect_row33.3%FalseTruerow_clean3
Address.000013Addressdirect_row50.0%FalseTruerow_clean4
BillingCode.000007BillingCodedirect_row33.3%FalseTruerow_clean3
City.000010Citydirect_row100.0%TrueTruerow_clean3
City.000011Citydirect_row100.0%TrueTruerow_clean4
Column.000001Columndirect_row100.0%TrueTruerow_clean4
DateTime.000004DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000007DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000017DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000025DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000027DateTimedirect_row25.0%FalseTruerow_clean4
DateTime.000034DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000051DateTimedirect_row33.3%FalseTruerow_clean3
DateTime.000076DateTimedirect_row50.0%FalseTruerow_clean4
DateTime.000081DateTimedirect_row50.0%FalseTruerow_clean4
DateTime.000094DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000104DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000108DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000111DateTimedirect_row100.0%TrueTruerow_clean4
DateTime.000114DateTimedirect_row0.0%FalseTruerow_clean4
DateTime.000115DateTimedirect_row0.0%FalseTruerow_clean4
DateTime.000116DateTimedirect_row50.0%FalseTruerow_clean4
FilePath.000001FilePathdirect_row100.0%TrueTruerow_clean4
Gender.000001Genderdirect_row66.7%FalseTruerow_clean3
Language.000002Languagedirect_row100.0%TrueTruerow_clean4
Name.000028Namedirect_row100.0%TrueTruerow_clean4
Number.000008Numberdirect_row50.0%FalseTruerow_clean4
Number.000015Numberdirect_row25.0%FalseTruerow_clean4
Number.000016Numberdirect_row50.0%FalseTruerow_clean4
Number.000022Numberdirect_row100.0%TrueTruerow_clean4
Number.000028Numberdirect_row100.0%TrueTruerow_clean3
Number.000029Numberdirect_row33.3%FalseTruerow_clean3
Number.000043Numberdirect_row100.0%TrueTruerow_clean4
Number.000049Numberdirect_row50.0%FalseTruerow_clean4
Number.000075Numberdirect_row50.0%FalseTruerow_clean4
Number.000077Numberdirect_row33.3%FalseTruerow_clean3
Phone.000008Phonedirect_row100.0%TrueTruerow_clean4
Phone.000011Phonedirect_row100.0%TrueTruerow_clean3
ShippingCode.000008ShippingCodedirect_row33.3%FalseTruerow_clean3
UserAgent.000003UserAgentdirect_row100.0%TrueTruerow_clean4
Address.000002Addressinit_soft_row33.3%FalseTruerow_clean3
Address.000013Addressinit_soft_row50.0%FalseTruerow_clean4
BillingCode.000007BillingCodeinit_soft_row33.3%FalseTruerow_clean3
City.000010Cityinit_soft_row100.0%TrueTruerow_clean3
City.000011Cityinit_soft_row75.0%FalseTruerow_clean4
Column.000001Columninit_soft_row100.0%TrueTruerow_clean4
DateTime.000004DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000007DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000017DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000025DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000027DateTimeinit_soft_row50.0%FalseTruerow_clean4
DateTime.000034DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000051DateTimeinit_soft_row33.3%FalseTruerow_clean3
DateTime.000076DateTimeinit_soft_row75.0%FalseTruerow_clean4
DateTime.000081DateTimeinit_soft_row50.0%FalseTruerow_clean4
DateTime.000094DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000104DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000108DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000111DateTimeinit_soft_row100.0%TrueTruerow_clean4
DateTime.000114DateTimeinit_soft_row25.0%FalseTruerow_clean4
DateTime.000115DateTimeinit_soft_row0.0%FalseTruerow_clean4
DateTime.000116DateTimeinit_soft_row50.0%FalseTruerow_clean4
FilePath.000001FilePathinit_soft_row100.0%TrueTruerow_clean4
Gender.000001Genderinit_soft_row66.7%FalseTruerow_clean3
Language.000002Languageinit_soft_row100.0%TrueTruerow_clean4
Name.000028Nameinit_soft_row100.0%TrueTruerow_clean4
Number.000008Numberinit_soft_row50.0%FalseTruerow_clean4
Number.000015Numberinit_soft_row25.0%FalseTruerow_clean4
Number.000016Numberinit_soft_row50.0%FalseTruerow_clean4
Number.000022Numberinit_soft_row100.0%TrueTruerow_clean4
Number.000028Numberinit_soft_row100.0%TrueTruerow_clean3
Number.000029Numberinit_soft_row33.3%FalseTruerow_clean3
Number.000043Numberinit_soft_row100.0%TrueTruerow_clean4
Number.000049Numberinit_soft_row50.0%FalseTruerow_clean4
Number.000075Numberinit_soft_row50.0%FalseTruerow_clean4
Number.000077Numberinit_soft_row33.3%FalseTruerow_clean3
Phone.000008Phoneinit_soft_row100.0%TrueTruerow_clean4
Phone.000011Phoneinit_soft_row100.0%TrueTruerow_clean3
ShippingCode.000008ShippingCodeinit_soft_row33.3%FalseTruerow_clean3
UserAgent.000003UserAgentinit_soft_row100.0%TrueTruerow_clean4
Address.000002Addresslearned_soft_batch33.3%FalseTrueok3
Address.000013Addresslearned_soft_batch50.0%FalseTrueok4
BillingCode.000007BillingCodelearned_soft_batch0.0%FalseTrueok3
City.000010Citylearned_soft_batch100.0%TrueTrueok3
City.000011Citylearned_soft_batch50.0%FalseTrueok4
Column.000001Columnlearned_soft_batch100.0%TrueTrueok4
DateTime.000004DateTimelearned_soft_batch100.0%TrueTrueok4
DateTime.000007DateTimelearned_soft_batch100.0%TrueTrueok4
DateTime.000017DateTimelearned_soft_batch100.0%TrueTrueok4
DateTime.000025DateTimelearned_soft_batch100.0%TrueTrueok4
DateTime.000027DateTimelearned_soft_batch25.0%FalseTrueok4
DateTime.000034DateTimelearned_soft_batch100.0%TrueTrueok4
DateTime.000051DateTimelearned_soft_batch0.0%FalseTrueok3
DateTime.000076DateTimelearned_soft_batch75.0%FalseTrueok4
DateTime.000081DateTimelearned_soft_batch0.0%FalseTrueok4
DateTime.000094DateTimelearned_soft_batch100.0%TrueTrueok4
DateTime.000104DateTimelearned_soft_batch100.0%TrueTrueok4
DateTime.000108DateTimelearned_soft_batch100.0%TrueTrueok4
DateTime.000111DateTimelearned_soft_batch75.0%FalseTrueok4
DateTime.000114DateTimelearned_soft_batch0.0%FalseFalseparse_fail4
DateTime.000115DateTimelearned_soft_batch0.0%FalseTrueok4
DateTime.000116DateTimelearned_soft_batch50.0%FalseTrueok4
FilePath.000001FilePathlearned_soft_batch100.0%TrueTrueok4
Gender.000001Genderlearned_soft_batch66.7%FalseTrueok3
Language.000002Languagelearned_soft_batch100.0%TrueTrueok4
Name.000028Namelearned_soft_batch100.0%TrueTrueok4
Number.000008Numberlearned_soft_batch50.0%FalseTrueok4
Number.000015Numberlearned_soft_batch75.0%FalseTrueok4
Number.000016Numberlearned_soft_batch50.0%FalseTrueok4
Number.000022Numberlearned_soft_batch50.0%FalseTrueok4
Number.000028Numberlearned_soft_batch0.0%FalseFalseparse_fail3
Number.000029Numberlearned_soft_batch66.7%FalseTrueok3
Number.000043Numberlearned_soft_batch100.0%TrueTrueok4
Number.000049Numberlearned_soft_batch50.0%FalseTrueok4
Number.000075Numberlearned_soft_batch50.0%FalseTrueok4
Number.000077Numberlearned_soft_batch33.3%FalseTrueok3
Phone.000008Phonelearned_soft_batch100.0%TrueTrueok4
Phone.000011Phonelearned_soft_batch100.0%TrueTrueok3
ShippingCode.000008ShippingCodelearned_soft_batch0.0%FalseTrueok3
UserAgent.000003UserAgentlearned_soft_batch100.0%TrueTrueok4
Address.000002Addresslearned_soft_row33.3%FalseTruerow_clean3
Address.000013Addresslearned_soft_row50.0%FalseTruerow_clean4
BillingCode.000007BillingCodelearned_soft_row33.3%FalseTruerow_clean3
City.000010Citylearned_soft_row100.0%TrueTruerow_clean3
City.000011Citylearned_soft_row50.0%FalseTruerow_clean4
Column.000001Columnlearned_soft_row100.0%TrueTruerow_clean4
DateTime.000004DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000007DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000017DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000025DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000027DateTimelearned_soft_row75.0%FalseTruerow_clean4
DateTime.000034DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000051DateTimelearned_soft_row33.3%FalseTruerow_clean3
DateTime.000076DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000081DateTimelearned_soft_row50.0%FalseTruerow_clean4
DateTime.000094DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000104DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000108DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000111DateTimelearned_soft_row100.0%TrueTruerow_clean4
DateTime.000114DateTimelearned_soft_row25.0%FalseTruerow_clean4
DateTime.000115DateTimelearned_soft_row0.0%FalseTruerow_clean4
DateTime.000116DateTimelearned_soft_row50.0%FalseTruerow_clean4
FilePath.000001FilePathlearned_soft_row100.0%TrueTruerow_clean4
Gender.000001Genderlearned_soft_row66.7%FalseTruerow_clean3
Language.000002Languagelearned_soft_row100.0%TrueTruerow_clean4
Name.000028Namelearned_soft_row100.0%TrueTruerow_clean4
Number.000008Numberlearned_soft_row50.0%FalseTruerow_clean4
Number.000015Numberlearned_soft_row25.0%FalseTruerow_clean4
Number.000016Numberlearned_soft_row75.0%FalseTruerow_clean4
Number.000022Numberlearned_soft_row100.0%TrueTruerow_clean4
Number.000028Numberlearned_soft_row100.0%TrueTruerow_clean3
Number.000029Numberlearned_soft_row66.7%FalseTruerow_clean3
Number.000043Numberlearned_soft_row100.0%TrueTruerow_clean4
Number.000049Numberlearned_soft_row25.0%FalseTruerow_clean4
Number.000075Numberlearned_soft_row50.0%FalseTruerow_clean4
Number.000077Numberlearned_soft_row0.0%FalseTruerow_clean3
Phone.000008Phonelearned_soft_row100.0%TrueTruerow_clean4
Phone.000011Phonelearned_soft_row100.0%TrueTruerow_clean3
ShippingCode.000008ShippingCodelearned_soft_row0.0%FalseTruerow_clean3
UserAgent.000003UserAgentlearned_soft_row100.0%TrueTruerow_clean4
Address.000002Addressshuffled_soft_row33.3%FalseTruerow_clean3
Address.000013Addressshuffled_soft_row100.0%TrueTruerow_clean4
BillingCode.000007BillingCodeshuffled_soft_row33.3%FalseTruerow_clean3
City.000010Cityshuffled_soft_row100.0%TrueTruerow_clean3
City.000011Cityshuffled_soft_row50.0%FalseTruerow_clean4
Column.000001Columnshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000004DateTimeshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000007DateTimeshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000017DateTimeshuffled_soft_row75.0%FalseTruerow_clean4
DateTime.000025DateTimeshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000027DateTimeshuffled_soft_row25.0%FalseTruerow_clean4
DateTime.000034DateTimeshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000051DateTimeshuffled_soft_row33.3%FalseTruerow_clean3
DateTime.000076DateTimeshuffled_soft_row75.0%FalseTruerow_clean4
DateTime.000081DateTimeshuffled_soft_row25.0%FalseTruerow_clean4
DateTime.000094DateTimeshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000104DateTimeshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000108DateTimeshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000111DateTimeshuffled_soft_row100.0%TrueTruerow_clean4
DateTime.000114DateTimeshuffled_soft_row25.0%FalseTruerow_clean4

Train Loss Log

armsteploss
learned01.059
learned10.747
learned20.588
learned30.487
learned40.372
learned50.289
learned60.248
shuffled03.920
shuffled13.429
shuffled23.038
shuffled32.631
shuffled42.213
shuffled51.868
shuffled61.580

Files

  • runs/main_qwen_soft_prompt_40_s6_lr001/task_details.csv
  • runs/main_qwen_soft_prompt_40_s6_lr001/row_details.csv
  • runs/main_qwen_soft_prompt_40_s6_lr001/train_log.csv
  • runs/main_qwen_soft_prompt_40_s6_lr001/summary.csv
  • runs/main_qwen_soft_prompt_40_s6_lr001/method_deltas.csv
  • analysis/summary.csv
  • analysis/method_deltas.csv
  • analysis/task_details.csv
  • analysis/row_details.csv
  • analysis/train_log.csv

Experiment log 11

Show the running log (11 entries, 2026-06-27)

Objective

Test whether a small continuous task vector learned from a task's training examples can improve a frozen model's held-out text-transformation consistency.

The core intervention is episodic soft-prompt optimization: for each task, freeze the model, optimize a short sequence of continuous prefix embeddings on the task's training examples, and then prepend that learned task vector during held-out inference.

The primary metric is strict full-task exact on held-out rows: a task counts as correct only if every held-out output is exactly correct.

The experiment is standalone. It stores run-local caches, learned-prefix diagnostics, analyses, charts, Markdown report, and HTML report under this directory. Large benchmark data is referenced through /workspace/large_artifacts/qwen_episodic_soft_prompt_task_vectors.

Initial Plan

  1. Create a fresh experiment directory and separate large-artifact root.
  2. Load public text-transformation tasks.
  3. Compare direct row-by-row and batched baselines against learned soft prompts.
  4. Include controls:

    • frozen random soft prompt
    • shuffled-label learned soft prompt
    • zero/initialized soft prompt baseline
  5. Track train loss, train exactness, held-out row exactness, held-out full-task exactness, parse success, and overfit signatures.
  6. Run no-Qwen smoke, small real-Qwen pilot, then a main run.
  7. Generate CSVs, charts, Markdown report, and HTML report.

Run Notes

2026-06-27 09:08 UTC - Scaffold

2026-06-27 09:09 UTC - No-Qwen Smoke

Command:

python -m py_compile /workspace/experiments/qwen_episodic_soft_prompt_task_vectors/src/qwen_episodic_soft_prompt_task_vectors.py
python /workspace/experiments/qwen_episodic_soft_prompt_task_vectors/src/qwen_episodic_soft_prompt_task_vectors.py \
  --run_name smoke_no_qwen \
  --task_limit 3 \
  --heldout_cap 3 \
  --steps 1 \
  --no_qwen

Result:

  • Smoke completed on 3 tasks.
  • CSVs, charts, Markdown report, and HTML report were generated.
  • Metrics are not interpreted because --no_qwen leaves generations blank.

2026-06-27 09:10 UTC - Tiny Real-Qwen Gradient/Generation Pilot

Command:

python /workspace/experiments/qwen_episodic_soft_prompt_task_vectors/src/qwen_episodic_soft_prompt_task_vectors.py \
  --run_name pilot_qwen_2_step1 \
  --task_limit 2 \
  --heldout_cap 3 \
  --soft_tokens 4 \
  --steps 1 \
  --lr 0.05

Result:

  • Real-model training and soft-prefix generation completed successfully.
  • This validated that gradients through the frozen 4-bit model to input soft prompts work in this environment.
  • One-step optimization was too aggressive on a numeric task: learned and shuffled soft prompts both degraded that row output.

2026-06-27 09:12 UTC - Lower-LR Pilot

Command:

python /workspace/experiments/qwen_episodic_soft_prompt_task_vectors/src/qwen_episodic_soft_prompt_task_vectors.py \
  --run_name pilot_qwen_4_lr001_s6 \
  --task_limit 4 \
  --heldout_cap 3 \
  --soft_tokens 8 \
  --steps 6 \
  --lr 0.01

Result:

  • direct_row: 83.3% row exact, 75.0% full-task exact.
  • learned_soft_row: 75.0% row exact, 75.0% full-task exact.
  • shuffled_soft_row: 75.0% row exact, 75.0% full-task exact.
  • Training loss sometimes overshot by the final step, so final-step prefix selection was not safe.

2026-06-27 09:13 UTC - Best-Loss Prefix Selection

Changed the optimizer to return the best-loss prefix checkpoint instead of the final optimization step.

Reran the four-task pilot:

python /workspace/experiments/qwen_episodic_soft_prompt_task_vectors/src/qwen_episodic_soft_prompt_task_vectors.py \
  --run_name pilot_qwen_4_best_lr001_s6 \
  --task_limit 4 \
  --heldout_cap 3 \
  --soft_tokens 8 \
  --steps 6 \
  --lr 0.01

Result:

  • All row methods tied on full-task exact at 75.0%.
  • learned_soft_row no longer damaged the numeric task relative to direct row-by-row.
  • Chose soft_tokens=8, steps=6, lr=0.01, best-loss checkpoint selection for the main runs.

2026-06-27 09:15 UTC - Main Run, 20 Tasks

Command:

python /workspace/experiments/qwen_episodic_soft_prompt_task_vectors/src/qwen_episodic_soft_prompt_task_vectors.py \
  --run_name main_qwen_soft_prompt_20_s6_lr001 \
  --task_limit 20 \
  --heldout_cap 4 \
  --soft_tokens 8 \
  --steps 6 \
  --lr 0.01

Result:

  • direct_row: 67.5% row exact, 50.0% full-task exact.
  • learned_soft_row: 70.4% row exact, 50.0% full-task exact.
  • init_soft_row: 68.8% row exact, 50.0% full-task exact.
  • shuffled_soft_row: 62.5% row exact, 45.0% full-task exact.

Read:

  • Learned soft prompts improved row exact slightly but did not solve more full tasks.
  • The result was close enough to warrant a 40-task run.

2026-06-27 09:16 UTC - Main Run, 40 Tasks

Command:

python /workspace/experiments/qwen_episodic_soft_prompt_task_vectors/src/qwen_episodic_soft_prompt_task_vectors.py \
  --run_name main_qwen_soft_prompt_40_s6_lr001 \
  --task_limit 40 \
  --heldout_cap 4 \
  --soft_tokens 8 \
  --steps 6 \
  --lr 0.01

Result:

  • 40 tasks.
  • Runtime: 481.45 seconds.
  • direct_row: 70.4% row exact, 52.5% full-task exact.
  • learned_soft_row: 71.5% row exact, 52.5% full-task exact.
  • init_soft_row: 71.7% row exact, 50.0% full-task exact.
  • shuffled_soft_row: 63.5% row exact, 45.0% full-task exact.
  • learned_soft_batch: 63.8% row exact, 42.5% full-task exact.
  • direct_batch: 65.0% row exact, 40.0% full-task exact.

Deltas versus direct_row:

  • learned_soft_row: +0.0 full-task points, +1.0 row-exact points; helped 1 task, hurt 1 task, tied 38 tasks.
  • init_soft_row: -2.5 full-task points, +1.2 row-exact points.
  • shuffled_soft_row: -7.5 full-task points, -6.9 row-exact points.
  • learned_soft_batch: -10.0 full-task points.
  • direct_batch: -12.5 full-task points.

Task-level movement:

  • learned_soft_row fixed DateTime.000076.
  • learned_soft_row broke City.000011.
  • Net strict full-task exact was unchanged.

Final diagnosis:

  • Neutral for strict full-task exact.
  • Weakly positive at row level.
  • The learned target matters: shuffled-label prefixes are worse.
  • The untrained initialized prefix also changes row behavior, so not all row-level movement should be credited to task learning.
  • Episodic soft prompts do not produce a deployable improvement under this configuration, but they are not inert: they can move individual rows and one full task in each direction.

2026-06-27 09:25 UTC - Report Hardening

  • Added report-only regeneration path to avoid rerunning Qwen when editing the report.
  • Regenerated the Markdown and HTML reports from the 40-task CSVs.
  • Updated report interpretation to state the neutral full-task result and weak row-level gain explicitly.

Final artifacts:

  • README.md
  • experiment_log.md
  • src/qwen_episodic_soft_prompt_task_vectors.py
  • runs/main_qwen_soft_prompt_40_s6_lr001/task_details.csv
  • runs/main_qwen_soft_prompt_40_s6_lr001/row_details.csv
  • runs/main_qwen_soft_prompt_40_s6_lr001/train_log.csv
  • runs/main_qwen_soft_prompt_40_s6_lr001/summary.csv
  • runs/main_qwen_soft_prompt_40_s6_lr001/method_deltas.csv
  • analysis/*.csv
  • analysis/figures/*.png
  • reports/qwen_episodic_soft_prompt_task_vectors_report.md
  • reports/qwen_episodic_soft_prompt_task_vectors_report.html

Figures 5

family heatmap
family heatmap · analysis/figures/
method full task exact
method full task exact · analysis/figures/
row vs full task
row vs full task · analysis/figures/
train loss curves
train loss curves · analysis/figures/
wins losses vs direct
wins losses vs direct · analysis/figures/

Data files 7

Result tables and metrics copied from the experiment folder — preview inline or open the raw file.

Reproduce

This entry is source code or analysis only — there is no separate run to reproduce.

Browse the experiment folder on GitHub ↗