Downloads · 30 days
145
2% of all-time downloads
alea-institute/kl3m-003-3.7b
kl3m-003-3.7b is a text generation model from alea-institute. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-4.0.
kl3m-003-3.7b is a small language model (SLM) trained on clean, legally-permissible data. Originally developed by 273 Ventures and donated to the ALEA Institute, kl3m-003-3.7b was part of the first LLM family to obtai…
Downloads · 30 days
145
2% of all-time downloads
All-time downloads
6.6K
Public
Parameters
3.7B
14.8 GB on disk
Likes
5
Public
Click a slice to open those files.
.safetensors14.8 GB · 100%
From the Hugging Face model README
kl3m-003-3.7b is a small language model (SLM) trained on clean, legally-permissible data. Originally developed by 273 Ventures and donated to the ALEA Institute, kl3m-003-3.7b was part of the first LLM family to obtain the Fairly Trained L-Certification for its ethical training data and practices. The model is designed for legal, regulatory, and financial workflows, with a focus on low toxicity and high efficiency.
Given its small size and lack of training data for instruction alignment, kl3m-003-3.7b is best suited for use either in SLM fine-tuning or as part of training larger models without using unethical data or models.
num_local_experts=4, num_experts_per_tok=2)kl3m-003-3.7b is particularly effective for:
| Dataset | Score |
|---|---|
| Wiki | 18.25 |
| CNN/Daily Mail | 9.61 |
| Legal Domain | 2.00 |
The model demonstrates particularly strong per-parameter performance on legal domain content, outperforming many larger models as of its training date.
Basic usage for text generation:
import json
from transformers import pipeline
# Load the model and tokenizer
p = pipeline('text-generation', 'alea-institute/kl3m-003-3.7b', device='cuda')
# Example usage on GPU
text = "Under this"
print(
json.dumps(
[
r.get("generated_text")
for r in p(text, do_sample=True, temperature=0.5, num_return_sequences=3, max_new_tokens=32)
],
indent=2
)
)
[
"Under this section, any person who is a party to the proceeding may be required to file ",
"Under this subsection, the term **eligible entity** means a State, a political subdivision of ",
"Under this section, the Secretary shall— (1)\nmake a grant to the National Academy of Sc"
]
text = "Governing Law. "
print(
json.dumps(
[
r.get("generated_text")
for r in p(text, do_sample=True, temperature=0.5, num_return_sequences=3, max_new_tokens=32)
],
indent=2
)
)
[
"Governing Law. The validity, construction, enforcement and interpretation of this Agreement and of the War",
"Governing Law. This Agreement shall be governed by and construed in accordance with the laws of",
"Governing Law. This Agreement shall be governed by and construed and enforced in accordance"
]
The model supports various parameters to control the generation process:
temperature: Controls randomness (lower = more deterministic)top_p: Nucleus sampling parameter (lower = more focused)top_k: Limits vocabulary selection to top k tokensmax_new_tokens: Maximum number of tokens to generatedo_sample: Whether to use sampling vs. greedy decodingnum_return_sequences: Number of different sequences to generateThe model was originally trained between February-March 2024 on a 4x8xH100-80G cluster in DDP. A similar model is
being provided with complete source and data replication as part of the kl3m-004 family to be released in Q1 2025.
The model implements several techniques during training:
While the original training data collection and training infrastructure relies on software that was not donated by 273 Ventures, ALEA Institute is open-sourcing an improved dataset, including both replication and an API.
https://github.com/alea-institute/kl3m-data
Data is available upon request at this time via S3 under a Requester Pays model. We are actively working on a zero-cost distribution model as soon as we can obtain additional support.
This model, the original kl3m-003-3.7b model, was trained on a US-only subset of the Kelvin Legal DataPack that
we believe is 100% public domain material. However, so as to enforce maximum transparency to all
downstream users in the event of any future determination otherwise, we are licensing this model under CC-BY 4.0.
This model is intended for use in:
kl3m-003-3.7b uses the following special tokens:
<s> (ID: 0): Beginning of sequence token (BOS)</s> (ID: 1): End of sequence token (EOS)<pad> (ID: 2): Padding tokenhttps://github.com/alea-institute/kl3m-model-research
@misc{kl3m-003-3.7b,
author = {ALEA Institute},
title = {kl3m-003-3.7b: A Small Language Model for Legal and Regulatory Text},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/alea-institute/kl3m-003-3.7b}}
}
@article{bommarito2025kl3m,
title={KL3M Tokenizers: A Family of Domain-Specific and Character-Level Tokenizers for Legal, Financial, and Preprocessing Applications},
author={Bommarito, Michael J and Katz, Daniel Martin and Bommarito, Jillian},
journal={arXiv preprint arXiv:2503.17247},
year={2025}
}
This model was originally developed by 273 Ventures and has been donated to the ALEA Institute.
The model weights are released under the CC-BY 4.0 License.
The KL3M model family is now maintained by the ALEA Institute. For technical support, collaboration opportunities, or general inquiries:
