From be98cdbb67dc587df01de07bb12010f1782fab29 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Wed, 5 Aug 2026 11:59:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: icekern/zagreus-0.4B-xmoons Source: Original Platform --- .gitattributes | 36 +++++++++++++++++ README.md | 89 ++++++++++++++++++++++++++++++++++++++++++ chat_template.jinja | 5 +++ config.json | 32 +++++++++++++++ generation_config.json | 6 +++ model.safetensors | 3 ++ tokenizer.json | 3 ++ tokenizer_config.json | 15 +++++++ 8 files changed, 189 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 chat_template.jinja create mode 100644 config.json create mode 100644 generation_config.json create mode 100644 model.safetensors create mode 100644 tokenizer.json create mode 100644 tokenizer_config.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..52373fe --- /dev/null +++ b/.gitattributes @@ -0,0 +1,36 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +tokenizer.json filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..140bd28 --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +--- +license: apache-2.0 +language: +- it +base_model: mii-llm/zagreus-0.4B-ita +pipeline_tag: text-generation +tags: +- italian +- multiple-choice +- italic +--- + +# zagreus-0.4B-xmoons + +Supervised fine-tune of [`mii-llm/zagreus-0.4B-ita`](https://huggingface.co/mii-llm/zagreus-0.4B-ita) +for the [mii-llm Post-Training Challenge](https://huggingface.co/spaces/mii-llm/Post-Training-Challenge), +evaluated on [ITALIC](https://italicbench.it/) (10,000 Italian multiple-choice questions). + +## Result + +| | Accuracy | +|---|---| +| baseline `mii-llm/zagreus-0.4B-ita` | 28.88 | +| **this model** | **41.02** (4102/10000) | +| random uniform (options vary 2-5) | 27.02 | + +Culture and commonsense **43.40** · Language capability **37.51** · unparsed answers **0**. + +The gain is statistically significant on the paired test set: McNemar chi2 = 326.4, +p = 5.9e-73; paired bootstrap 95% CI of the delta [+10.84, +13.46]; Wilson 95% CI +of the accuracy [40.06, 41.99]. + +## Method + +One supervised fine-tuning pass on gold answers — **no distillation**. + +- **Benchmark**: the official `italic.jsonl` (10,000) and `5_shots.jsonl` are fetched + byte-for-byte from the ITALIC repository at a pinned commit and verified by SHA-256. + Evaluation data is never rebuilt or modified. +- **Data**: Italian MCQ from four public HF datasets (revisions pinned), balanced by + **inverse frequency** so language and culture are equally represented. The weighting + derives from the data counts alone — no decision is taken by looking at the test set. +- **Holdout**: a dev split of 7,568 **unique** questions is carved before any + upsampling and used for recipe selection; the ITALIC test is never used for tuning. +- **Decontamination**: two independent signals (TF-IDF char-ngram cosine >= 0.80 and + MinHash/LSH word-shingle Jaccard >= 0.70) against both the test set and the official + few-shot exemplars. Measured overlap of the final training pool: **0** with the + 10,000 test questions, **0** with the 5-shot exemplars. +- **Training**: 1 epoch, loss on the completion only, `max_len` 2048 so the supervised + target is never truncated, option permutation to remove the positional answer prior, + few-shot demonstrations drawn from the training pool. +- **Evaluation**: the official `fast` protocol — templates, system message and + `extract_answer_fast` reproduced verbatim from ITALIC's `run_eval.py`. + +## Usage + +```python +from transformers import AutoModelForCausalLM, AutoTokenizer + +model_id = "icekern/zagreus-0.4B-xmoons" +tok = AutoTokenizer.from_pretrained(model_id) +model = AutoModelForCausalLM.from_pretrained(model_id) + +messages = [ + {{"role": "system", "content": "Sei un assistente utile."}}, + {{"role": "user", "content": "Rispondi alla seguente domanda a scelta multipla ..."}}, +] +prompt = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False) +``` + +The model answers multiple-choice questions with a single letter, following the +ITALIC `fast` prompt format. + +## Limitations + +- The four weakest categories are all linguistic (morphology 30.71, synonyms 35.43, + orthography 35.63, syntax 35.77). Public Italian MCQ corpora hold only ~2.5k unique + grammar questions, so the balanced pool repeats them: the model sees little *unique* + linguistic information. +- `efederici/pinocchio` and ITALIC draw on overlapping source material (Italian + public-competition questions). Exact and near-duplicate contamination is removed and + audited, but source-level overlap cannot be fully excluded. +- The reported score comes from a local HF-generate harness reproducing the official + `fast` protocol. + +## Code + +Full pipeline, raw evaluation output and per-example predictions: +https://github.com/firekern/italic-post-training-challenge diff --git a/chat_template.jinja b/chat_template.jinja new file mode 100644 index 0000000..39bd0c9 --- /dev/null +++ b/chat_template.jinja @@ -0,0 +1,5 @@ +{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|> + +'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|> + +' }}{% endif %} \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..b34db0d --- /dev/null +++ b/config.json @@ -0,0 +1,32 @@ +{ + "architectures": [ + "LlamaForCausalLM" + ], + "attention_bias": false, + "attention_dropout": 0.0, + "bos_token_id": 128000, + "dtype": "float32", + "eos_token_id": 128009, + "head_dim": 64, + "hidden_act": "silu", + "hidden_size": 960, + "initializer_range": 0.02, + "intermediate_size": 2560, + "max_position_embeddings": 4096, + "mlp_bias": false, + "model_type": "llama", + "num_attention_heads": 15, + "num_hidden_layers": 32, + "num_key_value_heads": 5, + "pad_token_id": null, + "pretraining_tp": 1, + "rms_norm_eps": 1e-05, + "rope_parameters": { + "rope_theta": 10000.0, + "rope_type": "default" + }, + "tie_word_embeddings": true, + "transformers_version": "5.14.1", + "use_cache": true, + "vocab_size": 128256 +} diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..f2ce98b --- /dev/null +++ b/generation_config.json @@ -0,0 +1,6 @@ +{ + "_from_model_config": true, + "bos_token_id": 128000, + "eos_token_id": 128009, + "transformers_version": "5.14.1" +} diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..299891d --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81357e5f05a0be785938877833020504997304c09be457a13cc1d44ffbce9f40 +size 1751076576 diff --git a/tokenizer.json b/tokenizer.json new file mode 100644 index 0000000..ee7aa36 --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01e3be37353fbc0be479c7509d53c76860b7915a6b1852d5e75ec0c92707138b +size 17208753 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..b76464f --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,15 @@ +{ + "backend": "tokenizers", + "bos_token": "<|begin_of_text|>", + "clean_up_tokenization_spaces": true, + "eos_token": "<|eot_id|>", + "is_local": true, + "local_files_only": false, + "model_input_names": [ + "input_ids", + "attention_mask" + ], + "model_max_length": 1000000000000000019884624838656, + "pad_token": "<|eot_id|>", + "tokenizer_class": "TokenizersBackend" +}