Spaces:
Running
Running
Download index.html from kriss/helpdesk-rules-writeup: direct link, hf CLI and curl.
- Browser
- Download file 8.54 kB
-
https://huggingface.co/spaces/kriss/helpdesk-rules-writeup/resolve/main/index.html
- Command line
-
hf download hf://spaces/kriss/helpdesk-rules-writeup/index.html
-
curl -L -o index.html https://huggingface.co/spaces/kriss/helpdesk-rules-writeup/resolve/main/index.html
8.54 kB
| <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>A help-desk agent that follows the rules page it is given</title><style>:root{color-scheme:light dark}body{font:17px/1.6 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;max-width:46rem;margin:0 auto;padding:2rem 1.2rem 4rem;color:#1b1f24;background:#fdfdfc} | |
| h1{font-size:1.9rem;line-height:1.25;margin:0 0 1rem}h2{font-size:1.3rem;margin:2.2rem 0 .6rem;padding-top:.6rem;border-top:1px solid #d9dde3} | |
| code{font:.88em ui-monospace,SFMono-Regular,Menlo,monospace;background:#eef1f4;padding:.1em .3em;border-radius:4px}pre{background:#eef1f4;padding:1rem;border-radius:8px;overflow-x:auto}pre code{background:none;padding:0} | |
| .t{overflow-x:auto}table{border-collapse:collapse;width:100%;margin:1rem 0;font-size:.95rem}th,td{border-bottom:1px solid #d9dde3;padding:.5rem .6rem;text-align:left;vertical-align:top}th{font-weight:600} | |
| a{color:#0b57d0}ul{padding-left:1.2rem}li{margin:.3rem 0} | |
| @media (prefers-color-scheme:dark){body{color:#e6e8eb;background:#14171a}code,pre{background:#22272e}th,td,h2{border-color:#333a42}a{color:#8ab4f8}}</style></head><body><main><h1>A help-desk agent that follows the rules page it is given</h1><p>Halo Competition, track <code>ft-hf</code>, model <code>Qwen/Qwen3-4B-Instruct-2507</code>. Team lead: @ofirkris</p><h2>What and why</h2><p>A help-desk agent can look things up and change records with tools. The tools do whatever they are told. The rules (who may cancel, how late, how often) are a page of text in the prompt, and they differ from desk to desk and from day to day. The useful behaviour is: read this page, look up the records that decide the request, make only the changes the page allows, and report exactly what was done.</p><p>The untrained 4B model does this badly. With the plain rules page it mostly talks instead of acting. With a long guidance text and a reminder loop it reaches about half of the tasks. We post-trained it with Halo SFT (LoRA) on synthetic desks so that the plain rules page is enough, and we test it on desks it never saw.</p><h2>Task and grading</h2><p>One episode is one customer message with one or two requests. The agent gets the rules page as the system prompt and the desk's tools. An episode counts as a success only if both hold:</p><ul><li>the final data equals the gold data (allowed changes made, barred changes not made), and</li><li>the last line of the reply, <code>OUTCOME: <id>=done, <id>=declined</code>, matches what was allowed.</li></ul><p>Everything is graded by code. There is no judge model.</p><h2>Data</h2><p>All training rows come from a generator in this repository (<code>competition/entry/factory.py</code>) and a scripted agent that plays each episode (<code>factory_agent.py</code>). No model wrote the desk rows.</p><ul><li>16 themed desks share one schema (a person, their records, a linked resource; cancel, move, book). 12 themes are for training, 4 are held out.</li><li>Every episode draws its own rules page: which conditions each rule has, their values and one of two wordings. So the list of things to check cannot be memorised per action.</li><li>The scripted agent first copies each sentence of the rule from the page, word for word, then checks them one by one with the values it read from tool results, then acts.</li><li>Final training file: 4,800 factory episodes plus 437 "keep" rows. A keep row is an everyday instruction from <code>databricks/databricks-dolly-15k</code> with the base model's own answer, so the tuned model keeps answering ordinary requests the way the base model does (<code>make_keep_rows.py</code>).</li></ul><p>Half of all requests must be declined. A policy that does everything, or nothing, fails.</p><h2>Training</h2><p>Halo SFT, LoRA rank 64 on attention and MLP projections, 2 epochs, learning rate 1e-4, seed 42, loss on assistant turns only. Config: <code>competition/entry/sft_desk_qwen3_4b_lora.yaml</code>. One GPU, about 85 minutes.</p><h2>Results</h2><p>Headline: a desk nothing was trained on and nothing was tuned on (a gym: class bookings, cancellations, membership freezes). It was written before the final model and no model was run on it until the final measurement. 108 tasks, 3 sampling seeds, plain rules page, same command for both models.</p><div class="t"><table><thead><tr><th scope="col">Gym desk, task success</th><th scope="col">Base model</th><th scope="col">Tuned model</th></tr></thead><tbody><tr><td>Plain rules page, mean of 3 seeds</td><td>18.2%</td><td>58.6%</td></tr><tr><td>By seed</td><td>18.5, 17.6, 18.5</td><td>62.0, 57.4, 56.5</td></tr><tr><td>Allowed requests done</td><td>6.9%</td><td>61.4%</td></tr><tr><td>Barred requests left alone</td><td>92.1%</td><td>94.2%</td></tr></tbody></table></div><p>The difference is 40.4 points, 95% bootstrap interval over tasks 32.1 to 49.1. The base model with its guidance text and one reminder reaches 37.7% on the same tasks (38.0, 35.2, 39.8); the tuned model with the plain page is 21.0 points above that (13.0 to 29.3) and uses fewer tokens per episode (7,038 in and 326 out against 10,990 and 499).</p><p>Further points (216 tasks, one sampling seed, 95% bootstrap intervals over tasks where given):</p><div class="t"><table><thead><tr><th scope="col">Set</th><th scope="col">Untrained best</th><th scope="col">Tuned, plain page</th><th scope="col">Difference</th></tr></thead><tbody><tr><td>Four held-out desk themes</td><td>47.2</td><td>99.1</td><td>+51.9 (44.9 to 58.3)</td></tr><tr><td>Library desk, hand-written, never trained on, used during development</td><td>53.7</td><td>91.2</td><td>+37.5 (30.1 to 44.9)</td></tr><tr><td>Held-out themes with rule kinds no training row shows</td><td>68.5</td><td>78.2</td><td>+9.7 (1.9 to 17.1)</td></tr></tbody></table></div><p>"Untrained best" is the base model with a guidance text and one reminder, the strongest setting we found for it. The tuned model gets the plain page and no reminder.</p><p>Does it read the record before it decides? On the library desk a request counts as "supported" only if it is right and every record that decides it was read with a tool before the change: untrained best 42.3%, tuned 83.8%. On the gym desk: base 39.9% (plain page), tuned 57.3%.</p><p>General ability (200 GSM8K test items, 120 reply-form instructions, 116 single tool calls with unrelated tools, one seed): math 91.0 base, 92.5 tuned; reply form 95.0 and 94.2; tool calls 84.5 and 81.9.</p><h2>What does not work</h2><ul><li>New bookings on the gym desk mostly fail (24% of allowed booking tasks succeed). The customer says "the Lane Swim class", the model searches for "Lane Swim class", the lookup finds nothing, and it gives up instead of trying the shorter name.</li><li>On the library desk it wrongly declines some allowed requests (85.7% of allowed requests are done).</li><li>Rule kinds it never trained on improve only a little (+9.7 points). It reads the new sentence but often applies it wrongly.</li><li>Single tool calls outside the desk drop from 84.5% to 81.9% (3 items of 116).</li><li>Every desk comes from our own generator and one author. There is no slice from real help-desk logs.</li><li>Requests are single messages. There is no second customer turn, no pushback, no tool errors.</li><li>The further points are one sampling seed, and everything is one training seed.</li></ul><h2>How to reproduce</h2><pre><code>python competition/entry/run_desk2.py --model Qwen/Qwen3-4B-Instruct-2507 --revision cdbee75f17c01a7cc42f958dc650907174af0554 --adapter kriss/qwen3-4b-helpdesk-rules-lora --desk gym --n 108 --conditions plain --out /tmp/desk_eval</code></pre><p>Drop <code>--adapter</code> for the base model. Training rows: <code>python competition/entry/make_sft_rows.py --desk factory --n 4800 --seed 400000 --out rows.jsonl</code>, then <code>python competition/entry/make_keep_rows.py --model Qwen/Qwen3-4B-Instruct-2507 --n 640 --out keep.jsonl</code> and append. Training: <code>python scripts/training/sft.py competition/entry/sft_desk_qwen3_4b_lora.yaml</code>.</p><h2>Third-party materials</h2><ul><li>Base model: <code>Qwen/Qwen3-4B-Instruct-2507</code>.</li><li>GSM8K (test split) for the math part of the general check.</li><li><code>databricks/databricks-dolly-15k</code> for the instructions of the keep rows.</li><li>Halo 1.3.0 for training.</li></ul><h2>Platforms used</h2><p>None of the partner platforms. Training and evaluation ran on one B200 GPU of our own.</p></main></body></html> |