Xiangxue-1-3.6B (向学)

English | 中文

English

Xiangxue-1-3.6B is a standalone BF16 Chinese text-correction model designed around parameter-efficient compression and efficiency-aware policy optimization. The release name uses 3.6B because the model has exactly 3,618,744,832 parameters. The informal name 向学 Xiangxue-1-3B-Ex is retained only as a research-preview alias; 3B is not the parameter-count label for this artifact.

The model is intended for Chinese grammatical error correction (CGEC) and Chinese spelling correction (CSC). It reduces model size by removing low-influence computation while preserving the layers most relevant to correction quality, then uses a parameter-efficient optimization objective that balances correction accuracy, edit preservation, and generation efficiency. The published artifact contains standalone merged weights.

Highlights

  • 10.0367% fewer parameters than the 4,022,468,096-parameter CEC4 base.
  • 3,618,744,832 parameters, 32 transformer layers, BF16 weights, no quantization.
  • Runner up Results: Xiangxue ranks 2 behind CEC4 BF16 in the project's local leaderboard while using 10.0367% fewer parameters.
  • This is deliberately a scoped claim. It is not an unconditional SOTA or runner-up claim across every public Chinese correction benchmark, split, scorer, or inference protocol.

Matched local evaluation

The table below reports the project's local benchmark results. Values are scores in the usual 0-1 scale; differences are percentage points.

Model NaCGEC F0.5 Pycorrector exact F1 CSCD exact F1
CEC4 BF16 0.4728 0.4979 0.5295
Xiangxue-1-3.6B BF16 0.4269 0.4846 0.5060

Relative to the CEC4 BF16 reference row, Xiangxue is -4.59, -1.33, and -2.35 percentage points on the three columns. The official CSCD character-level Correction F1 reported by the local scorer is 51.924%.

CSCD 数据集

  • Evaluate by:Correction F1
Model Name Correction F1
twnlp/ChineseErrorCorrector4-4B 🏆 59.61
GPT-4 (Few-shot) 54.41
GLM-5.1 (Few-shot) 52.21
Xiangxue-1-3.6B 51.92
MDCSpell+ARM 48.93
SMBERT 44.67

Pycorrector Evaluation

Following the official PyCorrector benchmark table format:

Model Name Base Model Model Link
Xiangxue-1-3.6B Qwen/Qwen3-4B(CEC4) yoshino0721/Xiangxue-1-3.6B
Kenlm-CSC kenlm shibing624/chinese-kenlm-klm
Mengzi-T5-CSC mengzi-t5-base shibing624/mengzi-t5-base-chinese-correction
ERNIE-CSC PaddlePaddle/ernie-1.0-base-zh PaddleNLP/ernie-csc
MacBERT-CSC hfl/chinese-macbert-base shibing624/macbert4csc-base-chinese
ChatGLM3-6B-CSC THUDM/chatglm3-6b shibing624/chatglm3-6b-csc-chinese-lora
Qwen2.5-1.5B-CTC Qwen/Qwen2.5-1.5B-Instruct shibing624/chinese-text-correction-1.5b
Qwen2.5-7B-CTC Qwen/Qwen2.5-7B-Instruct shibing624/chinese-text-correction-7b
Qwen3-4B-CTC(CEC3-4B) Qwen/Qwen3-4B twnlp/ChineseErrorCorrector3-4B
Model Name Avg SIGHAN-2015 EC-LAW MCSC GPU QPS
Kenlm-CSC 0.3409 0.3147 0.3763 0.3317 CPU 9
Mengzi-T5-CSC 0.3984 0.7758 0.3156 0.1039 GPU 214
ERNIE-CSC 0.4353 0.8383 0.3357 0.1318 GPU 114
MacBERT-CSC 0.3993 0.8314 0.1610 0.2055 GPU 224
ChatGLM3-6B-CSC 0.4538 0.6572 0.4369 0.2672 GPU 3
Xiangxue-1-3.6B 0.4846 0.6376 0.5440 0.2722 NVIDIA GeForce RTX 5090 4.65
Qwen2.5-1.5B-CTC 0.6802 0.3032 0.7846 0.9529 GPU 6
Qwen2.5-7B-CTC 0.8225 0.4917 0.9798 0.9959 GPU 3
Qwen3-4B-CTC(CEC3-4B) 0.8521 0.6340 0.9360 0.9864 GPU 5

Evaluation protocol and caveats

  • Evaluation sets: SIGHAN-2015, EC-LAW, and MCSC.
  • Pycorrector uses strict sentence-level exact correction. Avg is the equal-weight mean of the three dataset F1 scores. Malformed or empty parsed predictions fall back to the source sentence.
  • BF16 weights and compute; no quantization; deterministic decoding (do_sample=False), batch size 32, max 512 new tokens, repetition penalty 1.1.
  • The model-card instruction template was used with a no-thinking control and the first-tab candidate parser.
  • Inference diagnostics: 4 Pycorrector outputs were parser-malformed and 2 were truncated. Reasoning leakage was detected despite the no-thinking control; these diagnostics are retained so the scores are not overstated.
  • The upstream CEC4 model card reports scores under a different protocol. Those upstream numbers are not mixed into the matched table and should not be compared as if they were produced by this exact evaluation.

Experiment environment

Component Specification
CPU Intel(R) Xeon(R) Platinum 8470Q
GPU NVIDIA GeForce RTX 5090, 32 GB VRAM
System RAM 90 GB
CUDA 13.0

Prompt layout note

CEC4 code and experiments contain two equivalent instruction texts with different chat-message layouts:

  1. model_card (used for the scores above): the instruction is a system message and the source sentence is a separate user message.
  2. repo_user_v4: the instruction and source sentence are joined with a newline in one user message.

The two layouts can produce different generations because Qwen chat templates encode message roles. This release reports only the first layout's results; it does not claim a dual-prompt ensemble or selector. The instruction text is:

假如你是一名专业的纠错专家,请分析输入句子的语法错误类型和修改原因,并只输出纠正后的语句,错误类型如下:错别字、词语搭配错误、词性错误、语序错误、成分残缺、成分赘余、关联词使用错误、指代不明、语义逻辑不通、无误。

Model principles

Xiangxue combines two ideas:

  1. Parameter-efficient compression: low-influence computation is removed to reduce memory and inference cost while retaining the model capacity most relevant to Chinese correction.
  2. Efficiency-aware optimization: the training objective rewards valid corrections while preserving already-correct text and discouraging unnecessary edits or inefficient generations. This targets a practical balance between correction quality, parameter count, and serving throughput.

The published model uses BF16 weights, has 32 transformer layers and exactly 3,618,744,832 parameters, and contains standalone merged weights without an external adapter dependency.

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "yoshino0721/Xiangxue-1-3.6B"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True,
)

instruction = (
    "假如你是一名专业的纠错专家,请分析输入句子的语法错误类型和修改原因,"
    "并只输出纠正后的语句,错误类型如下:错别字、词语搭配错误、词性错误、"
    "语序错误、成分残缺、成分赘余、关联词使用错误、指代不明、语义逻辑不通、无误。"
)
messages = [
    {"role": "system", "content": instruction},
    {"role": "user", "content": "我跟我朋唷打算去法国玩儿。"},
]
try:
    prompt = tokenizer.apply_chat_template(
        messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
    )
except TypeError:
    prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
with torch.inference_mode():
    output_ids = model.generate(
        **inputs, max_new_tokens=512, do_sample=False, repetition_penalty=1.1
    )
answer = tokenizer.decode(
    output_ids[0][inputs.input_ids.shape[1]:], skip_special_tokens=True
)
print(answer)

The model may still emit reasoning text in some conditions. Applications that require a single corrected sentence should apply a validated output parser and should not assume that the no-thinking control is perfectly enforced.

License and attribution

The upstream model is released under Apache-2.0. This derivative release retains that license. See the upstream model card and repository for upstream attribution and citation information.

The release provenance, source revision, adapter hash, exact parameter count, and validation results are recorded in provenance.json.


中文

模型简介

Xiangxue-1-3.6B(向学)是一款围绕参数高效压缩和效率感知策略优化设计的独立 BF16 中文文本纠错模型。模型精确参数量为 3,618,744,832,因此正式发布名称采用 3.6B向学 Xiangxue-1-3B-Ex 仅保留为研究预览阶段的别名。

模型面向中文语法纠错(CGEC)和中文拼写纠错(CSC)。模型通过移除低影响力计算来减少参数量,同时保留与纠错质量最相关的表示能力;训练目标兼顾纠错准确性、正确文本保持、避免不必要修改和生成效率。发布权重为可直接使用 Transformers 加载的独立合并权重。

核心特点

  • 相比参数量为 4,022,468,096 的 CEC4,参数量减少 **10.0367%**。
  • 精确参数量 3,618,744,832,共 32 层 Transformer,纯 BF16 权重,未量化。
  • 第二名结果: 在项目本地 leaderboard 中,Xiangxue-1-3.6B 排名第二,仅次于 CEC4 BF16,同时使用更少参数。
  • 该表述不是对所有公开中文纠错数据集、划分、评分器或推理协议的无条件 SOTA 或全球第二声明。

同协议本地评测

下表展示项目本地 benchmark 结果,数值均为 0 到 1 范围的分数。

模型 NaCGEC F0.5 Pycorrector exact F1 CSCD exact F1
CEC4 BF16 0.4728 0.4979 0.5295
Xiangxue-1-3.6B BF16 0.4269 0.4846 0.5060

相比 CEC4 BF16 参考行,Xiangxue 在三项指标上分别低 4.59、1.33 和 2.35 个百分点。CSCD 官方字符级 Correction F1 为 **51.924%**。

CSCD 数据集

  • 评估指标:Correction F1
Model Name Correction F1
twnlp/ChineseErrorCorrector4-4B 🏆 59.61
GPT-4 (Few-shot) 54.41
GLM-5.1 (Few-shot) 52.21
Xiangxue-1-3.6B 51.92
MDCSpell+ARM 48.93
SMBERT 44.67

Pycorrector 评测结果

按照 PyCorrector 官方 README 的评测表格格式:

Model Name Base Model Model Link
Xiangxue-1-3.6B Qwen/Qwen3-4B(CEC4) yoshino0721/Xiangxue-1-3.6B
Kenlm-CSC kenlm shibing624/chinese-kenlm-klm
Mengzi-T5-CSC mengzi-t5-base shibing624/mengzi-t5-base-chinese-correction
ERNIE-CSC PaddlePaddle/ernie-1.0-base-zh PaddleNLP/ernie-csc
MacBERT-CSC hfl/chinese-macbert-base shibing624/macbert4csc-base-chinese
ChatGLM3-6B-CSC THUDM/chatglm3-6b shibing624/chatglm3-6b-csc-chinese-lora
Qwen2.5-1.5B-CTC Qwen/Qwen2.5-1.5B-Instruct shibing624/chinese-text-correction-1.5b
Qwen2.5-7B-CTC Qwen/Qwen2.5-7B-Instruct shibing624/chinese-text-correction-7b
Qwen3-4B-CTC(CEC3-4B) Qwen/Qwen3-4B twnlp/ChineseErrorCorrector3-4B
Model Name Avg SIGHAN-2015 EC-LAW MCSC GPU QPS
Kenlm-CSC 0.3409 0.3147 0.3763 0.3317 CPU 9
Mengzi-T5-CSC 0.3984 0.7758 0.3156 0.1039 GPU 214
ERNIE-CSC 0.4353 0.8383 0.3357 0.1318 GPU 114
MacBERT-CSC 0.3993 0.8314 0.1610 0.2055 GPU 224
ChatGLM3-6B-CSC 0.4538 0.6572 0.4369 0.2672 GPU 3
Xiangxue-1-3.6B 0.4846 0.6376 0.5440 0.2722 NVIDIA GeForce RTX 5090 4.65
Qwen2.5-1.5B-CTC 0.6802 0.3032 0.7846 0.9529 GPU 6
Qwen2.5-7B-CTC 0.8225 0.4917 0.9798 0.9959 GPU 3
Qwen3-4B-CTC(CEC3-4B) 0.8521 0.6340 0.9360 0.9864 GPU 5

评测协议与限制

  • 评测集:SIGHAN-2015、EC-LAW、MCSC。
  • Pycorrector 使用严格句子级 exact correction,Avg 为三个数据集 F1 的等权平均;解析结果 malformed 或为空时回退到原句。
  • 使用 BF16 权重和计算,不量化;确定性解码(do_sample=False),batch size 32,最多生成 512 tokens,repetition_penalty=1.1
  • 使用模型卡提示词布局、关闭 thinking 控制,并通过 first-tab candidate 解析器抽取结果。
  • 推理诊断:Pycorrector 结果中有 4 条输出解析异常、2 条输出被截断。尽管关闭 thinking,仍检测到推理内容泄漏;模型卡保留这些诊断信息,避免夸大成绩。

实验环境

组件 配置
CPU Intel(R) Xeon(R) Platinum 8470Q
GPU NVIDIA GeForce RTX 5090,32 GB 显存
系统内存 90 GB
CUDA 13.0

CEC4 的两种提示词布局

CEC4 代码和实验中使用过相同指令文本的两种消息布局:

  1. model_card:指令作为 system 消息,待纠错原句单独作为 user 消息。本模型卡成绩使用该布局。
  2. repo_user_v4:将指令、换行和待纠错原句合并到一个 user 消息中。

由于 Qwen chat template 会编码消息角色,两种布局可能产生不同输出。本发布不声称使用了双提示词集成或选择器。

假如你是一名专业的纠错专家,请分析输入句子的语法错误类型和修改原因,并只输出纠正后的语句,错误类型如下:错别字、词语搭配错误、词性错误、语序错误、成分残缺、成分赘余、关联词使用错误、指代不明、语义逻辑不通、无误。

模型原理

Xiangxue 结合两项设计:

  1. 参数高效压缩: 移除低影响计算,减少显存占用和推理成本,同时保留与中文纠错质量最相关的模型能力。
  2. 效率感知优化: 奖励有效纠错、保持无误文本,并抑制不必要修改和低效生成,在纠错质量、参数规模和服务吞吐之间取得平衡。

发布模型采用 BF16 权重,共 32 层 Transformer,精确参数量为 3,618,744,832;权重已经独立合并,不依赖外部 adapter。

使用方法

Python 推理代码与上方英文版 Usage 完全相同。建议保持 do_sample=Falserepetition_penalty=1.1,并使用 enable_thinking=False。模型在部分情况下仍可能输出推理文本;只需要单句纠错结果的应用应使用经过验证的输出解析器。

许可证与来源

上游模型采用 Apache-2.0 许可证,本衍生发布继续沿用该许可证。请参阅 CEC4 的模型卡代码仓库。模型来源、基础模型 revision、Adapter SHA-256、精确参数量和验证结果记录在 provenance.json 中。

Downloads last month
979
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yoshino0721/Xiangxue-1-3.6B

Finetuned
Qwen/Qwen3-4B
Adapter
(1)
this model
Adapters
1 model