Downloads · 30 days
0
Efekan35/axonlm-jepa
axonlm-jepa is a text generation model from Efekan35. Use it when you need the model to write or continue text. It is set up for pytorch. The card lists the license as mit.
A 124M-parameter GPT-2-style language model exploring whether JEPA-style self-supervised pretraining (Joint-Embedding Predictive Architecture, LeCun 2022) produces more usable representations than standard next-token…
Downloads · 30 days
0
Access
Public
Updated Jul 25, 2026
Repo size
5 GB
Likes
0
Public
Click a slice to open those files.
.pt5 GB · 100%
From the Hugging Face model README
A 124M-parameter GPT-2-style language model exploring whether JEPA-style self-supervised pretraining (Joint-Embedding Predictive Architecture, LeCun 2022) produces more usable representations than standard next-token pretraining — tested through a neuroscience-grounded probing methodology.
This repository hosts the model checkpoints for the AxonLM-JEPA paper. Full code, training configs, and the four-probe evaluation battery are on GitHub.
I pretrained a GPT-2-style encoder with a JEPA objective (span masking, EMA target encoder, VICReg loss) on PubMed abstracts, then fine-tuned it with a standard language-modeling head, and compared it against an identical model trained from scratch on the same data with no JEPA stage. Both were probed for whether they encode real mouse-brain anatomical connectivity information (from the Allen Mouse Brain Connectivity Atlas) in their internal activations, and whether that information is causally used during generation.
Result: at this scale (124M params, 117M training tokens, single consumer GPU), JEPA pretraining does not outperform the scratch-trained baseline on generation quality, causal knowledge activation, or retrieval accuracy, and roughly ties on linear representation-probing quality. Full details, four independent probing methods, and a documented self-correction of an early methodological artifact are in the paper.
| File | Description |
|---|---|
jepa_pretrain.pt | JEPA-pretrained context encoder (50k steps), before any LM fine-tuning |
jepa_lm_finetuned.pt | JEPA encoder + fine-tuned LM head (joint fine-tuning, 20k steps) |
baseline_lm.pt | Identical architecture, trained from scratch on the same data (no JEPA stage) |
All three share the same architecture (see below) and tokenizer (GPT-2 BPE), so any can be loaded with the same code.
torch.compilePubMed biomedical abstracts, ~117M training tokens. This is a small, single-domain, single-GPU-scale corpus by design — the study is explicitly framed around what is reachable in a compute-constrained, independent-research setting, well below Chinchilla-optimal token counts for this model size (~2.5B tokens would be optimal).
import torch
from model.encoder import EncoderConfig, TransformerEncoder # from the GitHub repo
from model.lm_head import AxonLMWithHead
config = EncoderConfig(
vocab_size=50304, block_size=256,
n_layer=12, n_head=12, n_embd=768,
dropout=0.0, bias=False,
)
encoder = TransformerEncoder(config)
model = AxonLMWithHead(encoder=encoder)
state = torch.load("jepa_lm_finetuned.pt", map_location="cpu", weights_only=False)
model.load_state_dict(state["model_state_dict"])
model.eval()
The model classes (TransformerEncoder, AxonLMWithHead, etc.) are defined in the GitHub repository — this is a research artifact meant to be paired with that code, not a drop-in transformers-library model.
This model is a research artifact for interpretability and self-supervised learning research, not a general-purpose text generation model. It was trained on a narrow biomedical corpus at small scale, and its generation quality (perplexity ≈ 15.7–20.3 depending on variant) reflects that. Its value is in what its internal activations reveal about representation learning, not in the fluency of its outputs.
@misc{salman2026axonlmjepa,
author = {Salman, Efekan},
title = {AxonLM-JEPA: A Controlled Study of Joint-Embedding Predictive
Pretraining for Sleeping Knowledge in Language Models},
year = {2026},
howpublished = {\url{https://github.com/EfekanSalman/axonlm-jepa}}
}