Downloads · 30 days
74
65% of all-time downloads
xu2409324124/qwen3-4b-latex-correction-v3-bf16
qwen3-4b-latex-correction-v3-bf16 is a text generation model from xu2409324124. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
The historical repository name contains v3; its main now serves v5.2 checkpoint-30. The previous v3 release remains available at v3-archive-20261023, commit 455d0a161457f4e95efa8ff7d74addcdcfff32b1.
Downloads · 30 days
74
65% of all-time downloads
All-time downloads
114
Public
Parameters
4B
16.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
The historical repository name contains v3; its main now serves v5.2 checkpoint-30. The previous v3 release remains available at v3-archive-20261023, commit 455d0a161457f4e95efa8ff7d74addcdcfff32b1.
This is a complete, unquantized BF16 model, with the rank-64 LoRA merged into Qwen/Qwen3-4B-Instruct-2507. No adapter loading or extra base-model download is needed to use this repository. Intended task: faithfully restore explicitly expressed mathematics as LaTeX; do not use formula names to invent missing mathematical content.
cdbee75f17c01a7cc42f958dc650907174af0554.xu2409324124/qwen3-4b-latex-correction-v5-2 (private), revision 3721b25f40f3e9383d99b2991ba9dd0e4749dc86.runs/v52-20261023T073851Z-d239b61a/sft/checkpoint-30.0b7aaf8f6a624bd89a01a155d4265ec861cbdf38, PEFT 0.18.1, Transformers 5.6.0.Use the tokenizer's chat template with system-prompt.txt as the system message and the text to correct as the user message. Start with greedy decoding and max_new_tokens=256; inspect truncation rather than silently accepting incomplete formulas. This is an output limit for formula correction, not a mathematics-benchmark protocol.
from pathlib import Path
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import hf_hub_download
repo = "xu2409324124/qwen3-4b-latex-correction-v3-bf16"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
system = Path(hf_hub_download(repo, "system-prompt.txt")).read_text()
messages = [{"role": "system", "content": system}, {"role": "user", "content": "x平方加y平方"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, do_sample=False, max_new_tokens=256)
print(tokenizer.decode(outputs[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))
The checkpoint was selected using the reviewed formula-correction development set: base 33/56 (58.93%) → checkpoint-30 48/56 (85.71%); equal-weight formula-group mean 77.22% → 92.12%. There are only four development formula groups; the final test set has not been run. These are measurements of the original base-plus-adapter evaluation, not a new benchmark of this exported artifact.
General mathematics results are mixed: GSM8K first 200 at 4K output budget 90.0% → 89.5%; MATH-500 first 200 at 4K conservative answer-validation score 56.5% → 66.0% (format-sensitive); AIME25 all 30 at 32K 40.0% → 36.67%. SFT hit the 32K limit on 9/30 versus base 3/30, with more repeated boxed answers. This is not evidence of universal reasoning improvement, and does not establish overfitting. No MATH 16K or three-item 8K rerun was performed.
Outputs are not guaranteed mathematically correct. Keep symbol fidelity and independent verification checks in downstream applications. Long output limits can amplify repetition.