enekovalero commited on
Commit
6cce1c2
·
verified ·
1 Parent(s): 2022afc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +61 -0
README.md CHANGED
@@ -7,3 +7,64 @@ license: llama3.1
7
  base_model:
8
  - meta-llama/Llama-3.1-8B
9
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  base_model:
8
  - meta-llama/Llama-3.1-8B
9
  ---
10
+
11
+ # HiTZ/es_Llama-3.1-8B
12
+
13
+ This is a **Spanish (es) language-specific base language model** trained by the HiTZ Research Center, starting from **Llama 3.1** and further pretrained on curated Spanish data.
14
+
15
+ This model is released as a **base model**, intended for further fine-tuning or adaptation (e.g., instruction tuning, domain adaptation).
16
+
17
+ ---
18
+
19
+ ## Training Data
20
+
21
+ To train language-specific base LLMs, we followed the methodology proposed by [Etxaniz et al. (2024)](https://aclanthology.org/2024.acl-long.799/), originally developed for Basque, and extended it to other low-resource languages. To enable fair comparisons across languages, we limited the corpus size for each language to roughly the same number of tokens. We also included a small English subset to mitigate catastrophic forgetting.
22
+
23
+ ### Corpus composition
24
+
25
+ | Language | Documents | Tokens (Llama 3.1) |
26
+ |----------|-----------|-------------------:|
27
+ | Spanish (es) | 3.8M | ~3.4B |
28
+ | English (en) | 0.5M | ~0.3B |
29
+
30
+ Token counts vary slightly depending on the tokenizer, but remain comparable in overall size.
31
+
32
+ ### Data sources
33
+
34
+ Spanish data was extracted from the multilingual CulturaX corpus. Given the substantially larger size of CulturaX compared to the Basque and Galician resources, we applied targeted filtering to obtain a more representative subset. Specifically, we retained only documents whose URLs indicate origin in Spain (i.e., containing the top-level domains `.es`, `.eus`, `.cat`, or `.gal`).
35
+ In addition, the Spanish data was filtered using the Dolma toolkit with the Gopher and C4 heuristics.
36
+ The English subset was sampled from the FineWeb corpus.
37
+
38
+ ---
39
+
40
+ ## Model Training
41
+
42
+ - Sequence length: 8,196 tokens
43
+ - Effective batch size: 256 sequences
44
+ - Tokens per optimization step: ~2M
45
+ - Learning rate schedule: cosine decay with 10% warm-up
46
+ - Peak learning rate: 1e-5
47
+
48
+ Training was conducted on the CINECA Leonardo high-performance computing cluster using Fully Sharded Data Parallel (FSDP) across 32 nodes, each equipped with 4 NVIDIA A100 GPUs (64 GB).
49
+
50
+ ---
51
+
52
+ ## Getting Started
53
+
54
+ ```python
55
+ from transformers import AutoModelForCausalLM, AutoTokenizer
56
+
57
+ model_id = "HiTZ/es_Llama-3.1-8B"
58
+
59
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
60
+ model = AutoModelForCausalLM.from_pretrained(model_id)
61
+
62
+ inputs = tokenizer("Hola!", return_tensors="pt")
63
+ outputs = model.generate(**inputs, max_new_tokens=50)
64
+
65
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
66
+ ```
67
+
68
+ ## Acknowledgements
69
+
70
+ This work has been partially supported by the Basque Government (Research group funding IT1570-22 and IKER-GAITU project), the Spanish Ministry for Digital Transformation and of Civil Service, and the EU-funded NextGenerationEU Recovery, Transformation and Resilience Plan (ILENIA project, 2022/TL22/00215335; and ALIA project).