ctokx/regexgym-qwen3-4b
The ctokx/regexgym-qwen3-4b is a 4 billion parameter Qwen3-based causal language model fine-tuned by ctokx. This model specializes in generating regular expressions from positive and negative examples, demonstrating a 44% pass@1 score on unseen tasks. It was trained on the regexgym-verified-traces dataset, focusing on producing accurate regexes that separate matching and non-matching strings. Its primary strength lies in its ability to induce precise regular expressions, outperforming its base model and classical induction methods.
Loading preview...
RegexGym-Qwen3-4B: Regular Expression Induction Model
This model, ctokx/regexgym-qwen3-4b, is a 4 billion parameter Qwen3-based language model specifically fine-tuned by ctokx for generating regular expressions. Its core capability is to infer a single regex that correctly matches all provided positive examples and rejects all negative examples.
Key Capabilities & Performance
- Regex Induction: Generates regular expressions from user-provided positive and negative string examples.
- Performance: Achieves a 44% pass@1 on 120 held-out, decontaminated tasks, meaning it produces a fully correct regex for 44% of unseen problems. This is a significant improvement over the base Qwen3-4B (37% pass@1) and classical regex induction methods (10% pass@1).
- High Hidden Accuracy: Demonstrates a mean hidden accuracy of 0.82, indicating that even when not perfectly correct, its generated regexes are usually very close to the optimal solution.
- Training Methodology: Fine-tuned over three epochs on the
regexgym-verified-tracesdataset, which consists of teacher reasoning traces generated by Gemma-4-31B and verified by execution against hidden holdouts.
When to Use This Model
- Automated Regex Generation: Ideal for applications requiring the programmatic creation of regular expressions based on example data.
- Data Cleaning & Validation: Useful for quickly generating patterns to identify or filter specific string formats.
- Educational Tools: Can serve as a component in tools designed to teach or assist with regular expression construction.
While it doesn't fully match the performance of its 8x larger teacher model (Gemma-4-31B), this 4B parameter model offers a highly efficient and specialized solution for regex induction tasks.