CoolFace
Modelpublic

SINAI/ALIA-es-cultural-heritage-7B-Base

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes6downloads
Model Card

ALIA Spanish Cultural and Heritage 7B Base Model

This repository contains a domain-adapted version of the Salamandra 7B model, optimized for the Spanish cultural heritage domain.

This model is the result of a continual pre-training process on the Salamandra 7B model, followed by instruction tuning using curated cultural heritage corpora.

[!WARNING] DISCLAIMER: This model is a domain-specific proof-of-concept for cultural heritage use. It has NOT been validated for production use in institutional, archival or heritage-critical workflows. It may produce incorrect, incomplete, or misleading information about cultural assets, historical sources or heritage documentation. Users should verify outputs against authoritative sources.

Model Details

Description

This model is a Transformer-based decoder-only language model that builds on the Salamandra 7B architecture through domain adaptation targeted to Spanish cultural heritage.

Continual Pre-training (CPT): The base model was further pre-trained on the SINAI/ALIA-es-cultural-heritage corpus to adapt its weights to the specific vocabulary and structures of cultural and heritage Spanish texts.

Architecture

Base ModelSalamandra 7B
Total Parameters7,768,117,248
Embedding Parameters1,048,576,000
Layers32
Hidden size4,096
Attention heads32
Context length8,192
Vocabulary size256,000
Precisionbfloat16
Embedding typeRoPE
Activation FunctionSwiGLU
Layer normalizationRMS Norm
Flash attention
Grouped Query Attention
Num. query groups8

Hyperparameters

ParameterValue
Sequence length8,192
Num. epochs2
Learning rate1.63e-5
Optimizeradamwtorchfused
Adam beta10.9
Adam beta20.9435750969
Adam epsilon1e-8
LR schedulercosine
Cosine min. LR ratio0.2098344114
Warmup ratio0.001567993392
Weight decay1.99373126
NEFTune noise alpha5
Max grad norm0.07158097239
Micro batch size8
Gradient accumulation steps2
Eval batch size1
Gradient checkpointingtrue
Distributed backendnccl
Val set size1,000
Eval table size5
Eval max new tokens100
Do causal LM evaltrue
BF16true
FP16false
Seed42
Strictfalse

Intended Use

Direct Use

The model is intended for research and development applications within Spanish cultural and heritage natural language processing. Representative use cases include:

  • Summarization of heritage documents, museum records and historical publications for research purposes.
  • Question answering over cultural and archival texts to support information retrieval.
  • Plain-language explanations of heritage content for dissemination and educational use.

Out-of-scope Use

This model is not approved for operational decision-making in heritage institutions. It must not be used as the sole source for cataloguing, legal attribution, conservation, provenance assessment or other actions that directly affect cultural assets. Any deployment that impacts heritage management requires expert validation and review.


How to use

Python Example

python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "SINAI/ALIA-es-cultural-heritage-7B-Base"

prompt = "Resume la importancia histórica y patrimonial del Castillo de Jaén."

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map="auto",
    torch_dtype=torch.bfloat16
)

inputs = tokenizer.encode(prompt, return_tensors="pt")
inputs = inputs.to(model.device)
outputs = model.generate(input_ids=inputs, max_new_tokens=200)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Data

Domain Adaptation Data

To adapt the model to Spanish cultural and heritage texts we used the following resources created and curated by the SINAI Research Group (Universidad de Jaén):

  • Continual Pre-training
  • Dataset: SINAI/ALIA-es-cultural-heritage
  • Description: A large collection of cultural and heritage Spanish texts, including heritage inventories, journals, archival records, institutional publications and reference resources used to adapt the base model's language distribution to the cultural and heritage domain.

Original Pre-training Data (Base Model)

The underlying base model (Salamandra 7B) was pre-trained on 12.875 trillion tokens of highly curated data, covering 35 European languages and code. For a full detailed list of the original pre-training sources, please refer to the Original Salamandra Model Card.


Additional Information

License

Apache License, Version 2.0

Citation

bibtex
@misc{ALIA-es-cultural-heritage-7B-Base,
    title={ALIA Spanish Cultural and Heritage 7B Base Model},
    author={SINAI Research Group},
    year={2026},
    publisher={HuggingFace},
    howpublished={\url{https://huggingface.co/datasets/SINAI/ALIA-es-cultural-heritage-7B-Base}}
}

Please also cite the base models:

bibtex
@misc{gonzalezagirre2025salamandratechnicalreport,
      title={Salamandra Technical Report}, 
      author={Aitor Gonzalez-Agirre and Marc Pàmies and Joan Llop and Irene Baucells and Severino Da Dalt and Daniel Tamayo and José Javier Saiz and Ferran Espuña and Jaume Prats and Javier Aula-Blasco and Mario Mina and Adrián Rubio and Alexander Shvets and Anna Sallés and Iñaki Lacunza and Iñigo Pikabea and Jorge Palomar and Júlia Falcão and Lucía Tormo and Luis Vasquez-Reina and Montserrat Marimon and Valle Ruíz-Fernández and Marta Villegas},
      year={2025},
      eprint={2502.08489},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2502.08489}, 
}

Funding

This work is funded by the Ministerio para la Transformación Digital y de la Función Pública - Funded by EU – NextGenerationEU within the framework of the project ALIA.

Acknowledgments

Training of this model was conducted thanks to BSC (Barcelona Supercomputing Center) on MareNostrum 5, a pre-exascale EuroHPC supercomputer hosted and operated by them.


Contact: ALIA Project - SINAI Research Group - Universidad de Jaén

More Information: SINAI Research Group | ALIA-UJA Project