初始化项目,由ModelHub XC社区提供模型
Model: icekern/zagreus-0.4B-xmoons Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -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
|
||||||
89
README.md
Normal file
89
README.md
Normal file
@@ -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
|
||||||
5
chat_template.jinja
Normal file
5
chat_template.jinja
Normal file
@@ -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 %}
|
||||||
32
config.json
Normal file
32
config.json
Normal file
@@ -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
|
||||||
|
}
|
||||||
6
generation_config.json
Normal file
6
generation_config.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 128000,
|
||||||
|
"eos_token_id": 128009,
|
||||||
|
"transformers_version": "5.14.1"
|
||||||
|
}
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:81357e5f05a0be785938877833020504997304c09be457a13cc1d44ffbce9f40
|
||||||
|
size 1751076576
|
||||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:01e3be37353fbc0be479c7509d53c76860b7915a6b1852d5e75ec0c92707138b
|
||||||
|
size 17208753
|
||||||
15
tokenizer_config.json
Normal file
15
tokenizer_config.json
Normal file
@@ -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"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user