Full supervised fine-tune of meta-llama/Llama-3.2-1B on a Latin American instruction mixture, with sequence packing and assistant-only loss masking.
Training data
Dataset
Role
latam-gpt/wikipedia-qa-iberoamerica-clean
Iberoamerican QA
latam-gpt/tulu-3-sft-mixture-no-identity-clean
General SFT mixture
latam-gpt/sft-mcqa-unified-clean
Multiple-choice QA
latam-gpt/self-identity-v3-clean
Self-identity
latam-gpt/copuchatV2-clean
Chilean conversational
After tokenization with the Llama 3 chat template and FFD packing at 4096 tokens (99.16% packing efficiency), the training set is 175,995 packed sequences (~721M tokens) with 119,573 validation examples.
Training setup
Base model:meta-llama/Llama-3.2-1B
Method: Full fine-tune (no LoRA)
Sequence length: 4096, packed with assistant-only loss masking
Epochs: 2
Learning rate: 1e-5 (cosine, 3% warmup)
Batch: 8 per device × 8 grad accumulation × 2 GPUs = 128 effective
fromtransformersimportAutoTokenizer,AutoModelForCausalLMtok=AutoTokenizer.from_pretrained("latam-gpt/latamgpt-1b-sft")model=AutoModelForCausalLM.from_pretrained("latam-gpt/latamgpt-1b-sft",torch_dtype="bfloat16",device_map="auto")messages=[{"role":"user","content":"¿Cuál es la capital de Chile?"}]inputs=tok.apply_chat_template(messages,add_generation_prompt=True,return_tensors="pt").to(model.device)out=model.generate(inputs,max_new_tokens=256,do_sample=True,temperature=0.7)print(tok.decode(out[0][inputs.shape[-1]:],skip_special_tokens=True))