Downloads · 30 days
275
55% of all-time downloads
motionlabs/random-llama-small
random-llama-small is a text generation model from motionlabs. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Random-Llama-Small is a randomly initialized transformer-based language model with approximately 2 billion parameters, built using the LLaMA architecture. It is designed for research purposes, providing a starting poi…
Downloads · 30 days
275
55% of all-time downloads
All-time downloads
498
Public
Parameters
2B
8 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
Random-Llama-Small is a randomly initialized transformer-based language model with approximately 2 billion parameters, built using the LLaMA architecture. It is designed for research purposes, providing a starting point for pretraining or fine-tuning on custom datasets. The model uses the tokenizer from HuggingFaceTB/SmolLM2-1.7B-Instruct and is configured for causal language modeling. As a randomly initialized model, it produces incoherent outputs until trained, making it ideal for researchers studying transformer training dynamics or developing custom language models.
HuggingFaceTB/SmolLM2-1.7B-InstructThe LLaMA architecture, developed by Meta AI, is a family of efficient transformer-based models optimized for research. Random-Llama-Small follows this design, incorporating several key features:
tie_word_embeddings=True), reducing parameter count by ~295M.This model uses random weights and:
transformers >= 4.45.0torch >= 2.0# Use a pipeline as a high-level helper
from transformers import pipeline
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe = pipeline("text-generation", model="reflex-ai/random-llama-small")
print(pipe(messages))
Note: Outputs will be random and incoherent due to the model’s untrained state.
from transformers import Trainer, TrainingArguments, DataCollatorForLanguageModeling, LlamaForCausalLM, AutoTokenizer
model = LlamaForCausalLM.from_pretrained("your_username/random-llama-small")
tokenizer = AutoTokenizer.from_pretrained("your_username/random-llama-small")
training_args = TrainingArguments(
output_dir="./random_llama_small_finetuned",
per_device_train_batch_size=4,
num_train_epochs=3,
fp16=True,
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=your_dataset,
data_collator=DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=False),
)
trainer.train()
{
"architectures": ["LlamaForCausalLM"],
"hidden_size": 2304,
"num_hidden_layers": 22,
"num_attention_heads": 36,
"num_key_value_heads": 9,
"intermediate_size": 9216,
"vocab_size": 128256,
"max_position_embeddings": 131072,
"rope_scaling": {
"factor": 32.0,
"high_freq_factor": 4.0,
"low_freq_factor": 1.0,
"original_max_position_embeddings": 8192,
"rope_type": "llama3"
},
"torch_dtype": "bfloat16",
"tie_word_embeddings": true
}
For questions or issues, please open an issue on the Hugging Face repository.
Model card created on April 20, 2025.