Text Generation
PEFT
Safetensors
lora
numerical-analysis
floating-point
halo
white-circle-halo-competition
conversational
Run this model with HF Jobs
Run doraking/precisionpatch-qwen3-4b-lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/doraking/precisionpatch-qwen3-4b-lora. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/doraking/precisionpatch-qwen3-4b-lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/doraking/precisionpatch-qwen3-4b-lora. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/doraking/precisionpatch-qwen3-4b-lora. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use doraking/precisionpatch-qwen3-4b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use doraking/precisionpatch-qwen3-4b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = PeftModel.from_pretrained(base_model, "doraking/precisionpatch-qwen3-4b-lora") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from doraking/precisionpatch-qwen3-4b-lora: direct link, hf CLI and curl.
- Browser
- Download file 3.99 kB
-
https://huggingface.co/doraking/precisionpatch-qwen3-4b-lora/resolve/main/README.md
- Command line
-
hf download hf://doraking/precisionpatch-qwen3-4b-lora/README.md
-
curl -L -o README.md https://huggingface.co/doraking/precisionpatch-qwen3-4b-lora/resolve/main/README.md
3.99 kB
| license: apache-2.0 | |
| base_model: Qwen/Qwen3-4B-Instruct-2507 | |
| library_name: peft | |
| pipeline_tag: text-generation | |
| tags: | |
| - lora | |
| - numerical-analysis | |
| - floating-point | |
| - halo | |
| - white-circle-halo-competition | |
| datasets: | |
| - doraking/precisionpatch-data | |
| # PrecisionPatch: Qwen3-4B LoRA for verified floating-point accuracy fixes | |
| **Made for the White Circle Halo Competition (track `ft-hf`).** A LoRA adapter for | |
| [`Qwen/Qwen3-4B-Instruct-2507`](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507) (revision `cdbee75f`), post-trained | |
| with [Halo](https://github.com/whitecircle/halo) 1.3.0 to rewrite small numerical expressions so that they are more | |
| accurate in IEEE-754 binary64 **without changing their real-number meaning**. | |
| The model receives a protected program (guards and constants fixed, constants by ID, input box per branch) and | |
| answers with JSON: `{"edits": {"b0": "<FPCore expression>"}}`, or `{"edits": {}}` to keep the program. An independent | |
| verifier decides whether an answer counts: it must parse in a restricted grammar, be **certified** equal to the | |
| original by a chain of sound rewrite rules on the branch's input box, and lower the error (bits = log2(1 + ULP distance) | |
| against a correctly rounded reference) on held-out inputs. | |
| ## Result (pre-registered analysis, held-out test split) | |
| 54 test tasks in 40 expression groups (FPBench + Herbie benchmark problems never used for training data, prompts or | |
| checkpoint choice). Effective-improvement rate at k = 8 candidates (1 greedy + 7 sampled): | |
| | Method | rate | | |
| |---|---| | |
| | Qwen3-4B-Instruct-2507 (Base) | 0.000 | | |
| | Base with two worked examples (few-shot) | 0.019 | | |
| | **SFT, mean of 3 training x 3 sampling seeds (pre-registered primary)** | **0.113** | | |
| | **This adapter (training seed 0), 3 sampling seeds** | **0.130** | | |
| | Rule beam search over the same rewrite space (no LLM) | 0.167 | | |
| | Herbie 2.3, guard-fixed, outputs inside the same contract | 0.074 | | |
| Paired differences with 95% group-bootstrap intervals: SFT − Base +0.113 [+0.029, +0.218] (positive); | |
| SFT − few-shot Base +0.095 [-0.002, +0.206], SFT − rule search -0.053 [-0.167, +0.051], SFT − Herbie | |
| +0.039 [-0.039, +0.128] (all contain 0). **The adapter clearly helps the base model, but it is not better than a | |
| simple rule search over the same rewrite rules.** Certified candidates: SFT 0.107, Base 0.000. | |
| ## Training | |
| - Halo 1.3.0 (`competition` branch), `scripts/training/sft.py`, recipe `simulation/configs/sft_qwen3_4b_lora_teacher_v1.yaml` | |
| (LoRA r 64, alpha 128, all attention and MLP projections, lr 1e-4 cosine, 2 epochs, packing, max length 2048), seed 0. | |
| - One H200 on Hugging Face Jobs; 42 optimizer steps. | |
| - Data: [`doraking/precisionpatch-data`](https://huggingface.co/datasets/doraking/precisionpatch-data), `teacher_v1` | |
| (1,471 rows from the train split only: 885 certified edits, 585 explicit keeps). Teacher answers come from a rule | |
| search and Herbie, filtered by the same verifier; no LLM generated training data. | |
| ## Evaluate | |
| From a checkout of the project's code (Halo image, no extra install): | |
| ```bash | |
| python simulation/scripts/eval_model.py --model doraking/precisionpatch-qwen3-4b-lora --split test --sampling-seed 0 | |
| ``` | |
| The adapter is loaded on the base model and revision recorded in `adapter_config.json`. Training seeds 1 and 2 | |
| scored 0.105 each; this adapter is seed 0, the recipe's seed fixed before the test split was opened. | |
| ## Limits | |
| - Only expressions with 1–3 variables over `+ - * / sqrt log exp log1p expm1 fabs`, with guards that compare a | |
| variable with a constant. Certification covers only the verifier's rule set. | |
| - The public benchmarks may be part of the base model's pre-training data: "held out" means held out from this | |
| post-training, not unseen. | |
| - Not a tool for repairing production code; the verifier, not the model, is what makes an answer trustworthy. | |
| ## License | |
| Adapter: Apache-2.0, as the base model. Code: Apache-2.0 (separate from Halo). Benchmarks: FPBench and Herbie (MIT). | |