HomeAboutProjectsSkillsContactLab

· 3 min read · experiment log, prompting

Three prompts, no new weights

What changed, and what did not, across the first Qwen3 1.7B configuration experiments.

Diagram of three prompt layers stacked above one unchanged block of model weights
Original illustration: three configurations, one set of base weights.

The question behind this lab is narrow: can a small local model, qwen3:1.7b-q4_K_M running in Ollama, be made into a more reliable coding assistant? The experiments were run with ChatGPT's help, starting with the cheapest lever available: the system prompt and a few generation settings.

The short answer so far: not demonstrably. Some answers changed for the better, others for the worse, and the sample is far too small to call either a trend.

The workflow

Each round follows the same loop. A Modelfile defines a variant, a script sends six prompts to the local Ollama server, the raw responses are saved as JSON, and the answers are screened and read.

Workflow: Modelfile, then benchmark script, then local Ollama, then saved JSON, then keyword screen and manual review, which informs the next Modelfile
Diagram of the experiment loop, drawn from the scripts and records.

The three configurations

All three start FROM the same quantised base model. Only the instructions and temperature differ.

Settings as written in each Modelfile. Benchmark scripts override temperature per request.
ConfigurationTemperaturenum_ctxSystem promptBenchmark
First (Modelfile)0.24096119 wordsNo saved responses
Second (Modelfile-v2)0.14096103 wordsRound 1
Third (Modelfile-v3)0.054096179 wordsRound 2

First configuration

A general brief: identify the language and constraints, ask when information is missing, prefer minimal fixes, never invent APIs or test results.

Modelfile
FROM qwen3:1.7b-q4_K_M
PARAMETER temperature 0.2
PARAMETER num_ctx 4096
SYSTEM "You are a careful, practical coding assistant. Help users write, understand, debug, and improve software. First identify the language, runtime, framework, and constraints from the user's context. If essential information is missing, ask one focused question instead of guessing. Prefer correct, minimal, maintainable solutions over clever ones. When debugging, explain the root cause and provide a concrete patch. Check edge cases, input validation, errors, security, and performance when relevant. Never invent libraries, APIs, commands, or test results. If you cannot run code, say so and provide tests the user can run. Preserve the user's existing architecture and style unless asked to change them. Provide complete code when requested, and clearly label filenames and commands. Keep explanations concise and beginner-friendly."

The changelog reports that both the base model and this variant suggested calling .then() on the array returned by Array.map(). No raw response for that test is saved, so treat it as a recorded observation that cannot be re-checked.

Second configuration

This one targets that mistake directly, spelling out the Promise.all pattern, and lowers the temperature to 0.1.

Modelfile-v2
FROM qwen3:1.7b-q4_K_M
PARAMETER temperature 0.1
PARAMETER num_ctx 4096
SYSTEM "You are a careful coding assistant. Correctness is more important than sounding confident. Before presenting code, mentally check that every method exists on the value's actual type, that promises are awaited correctly, and that the snippet is syntactically valid. Never call .then() on an array returned by Array.map. For concurrent async work, use await Promise.all(items.map(async item => save(item))) inside an async function, or Promise.all(items.map(save)); explain that Promise.all rejects if any input promise rejects. If all operations should settle regardless of failures, use Promise.allSettled. Do not claim code was executed unless it actually was. Prefer minimal, correct, maintainable code. State assumptions and uncertainty honestly."

The early follow-up is recorded two slightly different ways. The changelog says the correct pattern appeared but the answer was cut off at the output limit. The log post says the follow-up still produced an incorrect mock example. Without the raw output, this page cannot settle which description is more complete.

Third configuration

After round 1, the third variant added language-specific rules: preserve signatures, no unrequested async, reject zero, keep SQL in SQL, and use exact shell commands when specified.

Modelfile-v3
FROM qwen3:1.7b-q4_K_M
PARAMETER temperature 0.05
PARAMETER num_ctx 4096
SYSTEM "You are a precise coding assistant. Solve the exact task, not a nearby task. Preserve requested language, function signatures, types, and constraints. Before answering, check code against the prompt line by line. Do not invent behavior of standard-library functions: for Python, sum([]) is 0; for JavaScript, Array.map returns an array, not a Promise. For concurrent JavaScript async work use await Promise.all(items.map(item => save(item))); Promise.all preserves input order and rejects if any promise rejects. Do not call .then on an array. For Python validation, distinguish strings from other input types when required, reject zero for positive integers, and do not add async unless requested. For TypeScript, preserve declared types and prefer nullish coalescing when appropriate. For SQL, provide a parameterized query and keep the example in SQL unless another language is requested. For shell commands, use the exact requested command when one is specified. Do not add irrelevant complexity, unsupported assumptions, or misleading comments. If uncertain, say what assumption is needed. Return complete, concise, syntactically valid code and a brief explanation. Never claim you ran code unless you actually did."

What the two rounds recorded

The automated screen counts whether expected strings appear anywhere in an answer. It is a rough diagnostic and not a correctness score.

Automated keyword screenBasev2v3
Required-keyword matches, all six tasks
Base15/19
v216/19
v314/19

Automated string matching. Not a correctness score. Forbidden-pattern flags: Base 1, v2 0, v3 0. The v3 run used a different prompt suffix and temperature.

The count went 15, 16, 14 out of 19. These totals should not be read as a ranking: each is one sample per task, and the v3 run also used a different prompt suffix and temperature from round 1.

Improvements, regressions and failures

  • v2, regression: its Python parser became async without being asked, so a plain call raises nothing and returns a coroutine.
  • v3, change for the better: its parser is synchronous again and passes the five prompt inputs. The base model's parser also passed them.
  • v3, regression: asked for JavaScript, it answered with Python-style syntax around Promise.all.
  • Persistent miss: none of the three recorded Git answers used git switch -c. All used git checkout -b, which works but is not the requested form. v3's prompt asked for exact commands, but this prompt did not literally name switch.
  • Persistent miss: none of the three TypeScript answers used ??.

The experiment log's own conclusion stands: prompt iteration alone is not reliably solving the coding errors.

Written with AI assistance from the experiment records at commit 415868d.

Related articles

· 2 min read

Prompting is not training

Why no weights have changed, and what has to be true before a LoRA experiment starts.

hardwarefine-tuningprompting