Run this model with HF Jobs

Run SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
How to use from
Docker Model Runner
docker model run hf.co/SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct
Quick Links

Llama-3.1-8B-Italian-LAPT-instruct

The Llama-3.1-8B-Adapted collection of large language models (LLMs), is a collection of adapted generative models in 7B (text in/text out), adapted models from Mistral-7B-Base-v0.1.

Llama-3.1-8B-Italian-LAPT-instruct is a continually trained and instruction tuned Llama model.

Model developer: SapienzaNLP, ISTI-CNR, ILC-CNR

Model Architecture: Llama-3.1-8B-Adapted is an auto-regressive language model that uses an optimized transformer architecture.

Data used for the adaptation

The Llama-3.1-8B-Adapted models are trained on a collection of Italian and English data extracted from CulturaX. The data are extracted to be skewed toward Italian language with a ration of one over four. Extracting the first 9B tokens from Italian part of CulturaX and the first 3B tokens from English part of CulturaX.

Data used for the instruction tuning (SFT)

The data used in the instruction following training procedure:

Dataset Language Instances
TÜLU-v3 EN 940,000
LIMA IT/EN 2,000
WildChat-IT IT 5,000
TowerBlocks-v0.2 IT/EN 7,276
GPT-4o-ITA-Instruct IT 15,000
Aya IT 700

The model is trained for two epoches in the aforementioned data.

Evaluation

Adapted models are evaluated on ITA-Bench.

Model MMLU (5-shots) ARC-C (5-shots) Hellaswag (0-shots) IFEval (inst_level)
Llama-3.1-SAVA 56.9 42.3 58.1 62.3
Llama-3.1-LAPT 58.5 47.9 62.4 67.3
Mistral-0.1-SAVA 51.5 41.6 57.5 61.7
Mistral-0.1-LAPT 52.9 39.9 58.4 60.0
Llama-3.1-Original 47.4 43.1 57.9 66.8
Mistral-0.1-Original 41.6 38.9 50.0 42.2

Use with Transformers

You can run conversational inference using the Transformers pipeline abstraction or by leveraging the Auto classes with the generate() function.

Make sure to update your transformers installation via pip install --upgrade transformers.

import transformers
import torch

model_id = "SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct"

tokenizer = AutoTokenizer.from_pretrained(model_name)

generator = pipeline(
    "text-generation",
    model=model_name,
    device_map="auto",
    dtype=torch.bfloat16
)

conversations.append([
    {"role": "system", "content": "Sei un assistente utile, rispondi in modo conciso e coerente."},
    {"role": "user", "content": "Cosa si può fare in una bella giornata di sole?"},
])

chat_samples = tokenizer.apply_chat_template(conversations, tokenize=False)

# get number of prompt tokens
prompt_tokens_number = len(tokenizer(chat_samples)["input_ids"])

outputs = generator(
    conversations,
    max_new_tokens=2048,
    eos_token_id=[
        tokenizer.eos_token_id,
        tokenizer.convert_tokens_to_ids("<|eot_id|>"),
    ],
)

Code: https://github.com/SapienzaNLP/sava

Aknowledgement

Thanks to Leonardo Colosi (colosi@diag.uniroma1.it) for helping in instruction tuning phase.

We acknowledge ISCRA for awarding this project access to the LEONARDO supercomputer, owned by the EuroHPC Joint Undertaking, hosted by CINECA (Italy).

Citation

If you use any part of this work, please consider citing the paper as follows:

@misc{moroni2025optimizingllmsitalianreducing,
      title={Optimizing LLMs for Italian: Reducing Token Fertility and Enhancing Efficiency Through Vocabulary Adaptation}, 
      author={Luca Moroni and Giovanni Puccetti and Pere-Lluis Huguet Cabot and Andrei Stefan Bejgu and Edoardo Barba and Alessio Miaschi and Felice Dell'Orletta and Andrea Esuli and Roberto Navigli},
      year={2025},
      eprint={2504.17025},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2504.17025}, 
}
Downloads last month
23
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct

Quantizations
2 models

Collection including SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct

Paper for SemanticAlignment/Llama-3.1-8B-Italian-LAPT-instruct