AFM-4.5B-Base-Pre-Anneal is a 4.5 billion parameter instruction-tuned model developed by Arcee.ai, designed for enterprise-grade performance across diverse deployment environments from cloud to edge. The base model was trained on a dataset of 6.5 trillion tokens of general pretraining data. We use a modified version of
TorchTitan for pretraining.
The development of AFM-4.5B prioritized data quality as a fundamental requirement for achieving robust model performance. We collaborated with DatologyAI, a company specializing in large-scale data curation. DatologyAI's curation pipeline integrates a suite of proprietary algorithms—model-based quality filtering, embedding-based curation, target distribution-matching, source mixing, and synthetic data. Their expertise enabled the creation of a curated dataset tailored to support strong real-world performance.
The model architecture follows a standard transformer decoder-only design based on Vaswani et al., incorporating several key modifications for enhanced performance and efficiency. Notable architectural features include grouped query attention for improved inference efficiency and ReLU^2 activation functions instead of SwiGLU to enable sparsification while maintaining or exceeding performance benchmarks.
The model available in this repo is the base model before it was annealed with math and code and before merging and context extension.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "arcee-ai/AFM-4.5B-Base-Pre-Anneal"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForCausalLM.from_pretrained(
7 model_id,
8 torch_dtype=torch.bfloat16,
9 device_map="auto"
10)
11
12prompt = "Once upon a time "
13input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(model.device)
14
15# Generate text
16outputs = model.generate(
17 input_ids,
18 max_new_tokens=100,
19 do_sample=True,
20 temperature=0.7,
21 top_p=0.95
22)
23
24generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
25print(generated_text)
AFM-4.5B is released under the Apache-2.0 license.