Blog (auf Englisch)Dieser Artikel ist nur auf Englisch verfügbar.

Style prompts: examples beat rules

A style preset rewrites your dictated text in a chosen tone, for example more formal. A language model does the rewriting, and it follows a written instruction. Tuning that instruction taught us one thing we did not expect: telling the model what not to do makes it worse.

What goes wrong

The model sometimes does something annoying. It opens with “Sure, here’s a casual rewrite:”. It copies your text word for word. It starts a reply with “Hey”. The natural fix is to add a line to the instruction: do not open with an introduction, do not say “Hey”.

We tried that, and measured it four times on three presets, on real dictation. Every time the added prohibitions made the result worse:

  • A rule against the “Sure, here’s…” opening pushed the score below where we started.
  • Five attempts in a row to forbid the greeting “Hey” all failed.
  • A rule with no example dropped the number of clean cases from 19 to 7.

Our guess is that the model clings to the exact words it was told to avoid, instead of avoiding them.

What works instead

A ready-made pair: an input phrase, and the output we want. Two such examples gave twelve more fixed phrases and only one that got worse.

Not every example helps. Examples we invented from our heads gave a small gain. The gain was large when we took the specific phrases where the model failed on the previous run and wrote the right answer for each one. So the loop is: run the test, pick the phrases that failed, turn them into examples, run again.

One more thing to know. The two worst habits, the introduction and the word-for-word copy, show up only on long texts with several thoughts in them. On short one-sentence phrases they hardly appear at all. A test made of short phrases would tell you everything is fine.

How we score it

We keep a fixed set of phrases, split in two halves. We tune on one half. The other half stays closed until the end, as an exam, so that we do not fit the prompt to the phrases we look at.

Each output goes through simple checks that need no model: did the numbers survive, did a question stay a question, did foreign characters appear. Then a second language model acts as a judge and answers five fixed questions about each result. Changing the judge changes all the numbers, so a candidate and its baseline are always scored by the same one.

With this method we shortened the instruction for the business tone from 1,699 to 1,490 tokens, and the judge’s score went from 264 to 271 out of 282. A shorter prompt, scored higher, with no new prohibitions.

Mehr aus dem Blog