Downloads · 30 days
323
73% of all-time downloads
Madras1/MTLM2-40M
MTLM2-40M is a text generation model from Madras1. 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.
MTLM2-40M is a highly experimental, tiny language model (~40 Million parameters) designed as a research artifact to explore the lower bounds of language modeling capabilities.
Downloads · 30 days
323
73% of all-time downloads
All-time downloads
445
Public
Parameters
41.5M
499 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors166 MB · 98%
From the Hugging Face model README
MTLM2-40M is a highly experimental, tiny language model (~40 Million parameters) designed as a research artifact to explore the lower bounds of language modeling capabilities.
The primary research question driving this model was:
Can a microscopic model (40M params), when saturated with a large amount of data (14B tokens), generate minimally coherent narrative text?
The answer is yes. Validated by a Perplexity of 54.21 on WikiText-2, the model demonstrates surprising structural and narrative cohesion for its size.
Llama-style architecture with tweaks for small-scale efficiency).| Benchmark | Metric | Result |
|---|---|---|
| WikiText-2 | Perplexity (PPL) | 54.21 |
Note: Evaluation performed using sliding window approach. The low PPL confirms strong grammatical alignment despite the small parameter count.
This model requires trust_remote_code=True.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Madras1/MTLM2-40M"
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1")
prompt = "The future of AI is"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=50, do_sample=True, temperature=0.7)
print(tokenizer.decode(output[0]))
Author Developed by Madras1 (Gabriel).