EuroLLM-22B Legislative Text — LoRA 50% Merged (AI4TRAD)
Merged version of a LoRA fine-tuned EuroLLM-22B-Instruct-2512, with LoRA weights scaled at 50% before merging. This scaling balances the fine-tuned specialization with the base model's instruction-following capabilities.
Model Details
| Field | Value |
|---|---|
| Base model | utter-project/EuroLLM-22B-Instruct-2512 |
| Fine-tuning method | LoRA (Low-Rank Adaptation), merged at 50% scaling |
| LoRA rank | 32 |
| LoRA alpha | 64 |
| LoRA target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Task | EN → 23 EU languages translation (legislative domain) |
| Precision | bf16 |
| Developed by | AI4TRAD |
| Organization | European Parliament |
| Compute | EuroHPC (Discoverer supercomputer, Sofia, Bulgaria) |
Why LoRA at 50%?
Applying LoRA weights at 50% (instead of 100%) produces better results in our evaluations: the model retains the base model's general instruction-following and fluency while incorporating the domain specialization from fine-tuning. This is equivalent to setting scaling = 0.5 * (alpha / rank) during inference.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_path = "DanieleMarcoaldi/EuroLLM-22B-Instruct-LoRA50"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path, torch_dtype=torch.bfloat16, device_map="auto"
)
messages = [
{"role": "user", "content": "Translate the following English text to French:\n\nThe regulation applies to all member states."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Authors
Daniele Marcoaldi
Acknowledgements
This work was supported by EuroHPC resources on the Discoverer supercomputer (Sofia, Bulgaria).
- Downloads last month
- -
Model tree for DanieleMarcoaldi/EuroLLM-22B-Instruct-LoRA50
Base model
utter-project/EuroLLM-22B-2512 Finetuned
utter-project/EuroLLM-22B-Instruct-2512