[ norboten ]
automation · lab ollama-02

The Assistant That Forgets Its Rules

· about 35 minutes · runs on ubuntu-26.04-automation · unrated

An unrated lab. It runs on your machine with no account and no network, and everything about it — the faults, the checks, the hints and the reference solution — is in the repository. An attempt on it is recorded on your profile and never moves a rating: only rated labs do. Rated and unrated labs.

The briefing

The billing team's support assistant is a custom Ollama model, support-bot, built from /srv/support-bot/Modelfile on top of qwen2.5:0.5b. Its system prompt lists thirty-nine rules the assistant must follow — above all, never promise a refund date. Customers reach it through /opt/support-chat/ask, a small script the web chat calls with the customer's question.

Support leads say the assistant ignores its rules: it promises dates, its tone changes from one answer to the next, and asking the same question twice gives two different stories. Last week someone read that the context window might be too small and raised it in the Modelfile. Nothing changed. The rules themselves are correct.

A small model will never follow rules perfectly, and this lab does not grade what it says. It grades whether the model is given its rules at all.

What is expected, and graded — the grader sends a customer question and reads what Ollama reports about the prompt it evaluated:

  1. Asked a question directly, support-bot evaluates its whole system prompt, not a truncated piece of it.
  2. The same holds when the question comes through /opt/support-chat/ask.
  3. support-bot samples with a temperature of 0.3 or less.
  4. /srv/support-bot/Modelfile sets the same parameters and the same rules the server holds, so rebuilding from it gives the same model.

You have root through sudo. Everything must still hold after a reboot.

What is graded

The machine is checked, rebooted, and checked again. A check passes only if it passes both times.

CheckObjective
01_the_model_sees_all_its_rulesGive a model a context window its instructions fit in, and keep clients from shrinking it
02_the_chat_app_keeps_the_whole_promptGive a model a context window its instructions fit in, and keep clients from shrinking it
03_answers_are_steadyBuild a custom model from a Modelfile and read back what the server really holds
04_the_modelfile_is_the_sourceKeep the Modelfile the source of truth

Start it

  1. 2Labs
  2. ollama-02select this one
  3. udownload it
  4. sstart the machine

Reading

Where the lab's hints send you, level by level, as you ask for them (h, then l opens a journal section in the TUI).

Theory for this lab

4 questions on the same topic, in the lab's Theory tab. They never affect the lab's grade. Three of them, to answer here:

Question 1

A Modelfile's PARAMETER num_ctx is changed from 256 to 2048, and support-bot still shows num_ctx 256. What was missed?

Question 2

A 1,388-token prompt is sent to a model whose num_ctx is 256. In Ollama 0.34 the response says prompt_eval_count 130. What happened?

Question 3

A model's Modelfile sets num_ctx 4096, and a client sends "options": {"num_ctx": 512} with its request. Which window does that request use?