Post-training a small open-weight model to write regular expressions

posted on 20/10/2026

TL;DR:

  • I post-trained Qwen-3-0.6B to generate JS-flavored regular expressions from natural language
  • Resulting model runs on a playground locally in-browser (1.6GB model download): https://regex-vibes.netlify.app
  • Results are mixed: 7 good results out of 10 on simple prompts, 2 out of 10 on harder ones

Why ?

What is post-training ?

As everybody now knows, large language models are basically machine learning models predicting pieces of text (= tokens) statistically coming after given pieces of text.

Choose the base-model

Our constraints :

Build the training dataset

Figure out what post-training method to use

Learning by imitation

Learning by preferences

Learning by trying and being judged

How to apply the post-training

The right method based on the need

Need Recommended pipeline
Often-changing knowledge base No post-training: RAG. Fine-tuning doesn't handle new facts well
Specific domain or vocabulary Continued pretraining then SFT
Specific output format, tone, style, or precise task SFT + LoRA
Reduce unwanted answer, improve model "UX" DPO, or KTO
Reasoning, maths/code, tool use, agents GRPO (RLVR)
Make a small model better at reasoning Distillation from a bigger LLM