Olifant is a
memory-based language model
that uses
TiMBL
(Tilburg Memory-Based Learner) instead of neural networks. It stores training instances in an indexed instance base and uses k-nearest neighbors for prediction.
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model (requires trust_remote_code for custom architecture)
model = AutoModelForCausalLM.from_pretrained(
"antalvdb/olifant-hf",
trust_remote_code=True
)
# Load tokenizer (uses GPT-2 tokenizer)
tokenizer = AutoTokenizer.from_pretrained("gpt2")
model.set_tokenizer(tokenizer)
# Generate text
input_ids = tokenizer.encode("The quick brown", return_tensors="pt")
output_ids = model.generate(
input_ids,
max_length=20,
do_sample=False,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(output_ids[0]))
Model Details
Architecture
: Memory-based learning with TiMBL (TRIBL2 algorithm)
Training data
: EduFineWeb subset (100K lines, 24M tokens)
Context window
: 4 tokens (l4r0 configuration)
Vocabulary
: GPT-2 tokenizer (50,257 tokens)
How It Works
Unlike neural language models that learn distributed representations, Olifant:
Stores all training n-grams as instances in an indexed database
At inference time, finds the k-nearest neighbors to the input context
Returns a probability distribution based on the class labels of neighbors
This approach provides full transparency: you can inspect exactly which training examples influenced each prediction.
Citation
If you use this model, please cite:
@misc{bosch2025memorybasedlanguagemodelsefficient,
title={Memory-based Language Models: An Efficient, Explainable, and Eco-friendly Approach to Large Language Modeling},
author={Antal van den Bosch and Ainhoa Risco Patón and Teun Buijse and Peter Berck and Maarten van Gompel},
year={2025},
eprint={2510.22317},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2510.22317},
}
License
GPL3.0 License
Runs of antalvdb olifant-hf on huggingface.co
12
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
2
30-day runs
More Information About olifant-hf huggingface.co Model
olifant-hf huggingface.co is an AI model on huggingface.co that provides olifant-hf's model effect (), which can be used instantly with this antalvdb olifant-hf model. huggingface.co supports a free trial of the olifant-hf model, and also provides paid use of the olifant-hf. Support call olifant-hf model through api, including Node.js, Python, http.
olifant-hf huggingface.co is an online trial and call api platform, which integrates olifant-hf's modeling effects, including api services, and provides a free online trial of olifant-hf, you can try olifant-hf online for free by clicking the link below.
antalvdb olifant-hf online free url in huggingface.co:
olifant-hf is an open source model from GitHub that offers a free installation service, and any user can find olifant-hf on GitHub to install. At the same time, huggingface.co provides the effect of olifant-hf install, users can directly use olifant-hf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.