Downloads · 30 days
19
18% of all-time downloads
grpvam/multitoken-gpt2-metamathqa
multitoken-gpt2-metamathqa is a text generation model from grpvam. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This is a GPT-2 model enhanced with Multi-Token Prediction (MTP) architecture, trained on the MetaMathQA dataset for mathematical reasoning tasks.
Downloads · 30 days
19
18% of all-time downloads
All-time downloads
107
Public
Repo size
3.7 GB
Likes
0
Public
Click a slice to open those files.
.pt2.1 GB · 57%
From the Hugging Face model README
This is a GPT-2 model enhanced with Multi-Token Prediction (MTP) architecture, trained on the MetaMathQA dataset for mathematical reasoning tasks.
This model implements the Multi-Token Prediction approach from the paper "Better & Faster Large Language Models via Multi-token Prediction" by Meta AI. Key features:
import torch
from transformers import GPT2Tokenizer
# Note: You'll need the custom MultiTokenGPT2 class from the training code
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
tokenizer.pad_token = tokenizer.eos_token
# Load your model (custom loading required)
# model = MultiTokenGPT2.from_pretrained("Goldenwert/multitoken-gpt2-metamathqa")
prompt = "What is the derivative of f(x) = x^3?"
input_ids = tokenizer.encode(prompt, return_tensors="pt")
# Standard generation
generated = model.generate(
input_ids,
max_new_tokens=50,
use_speculative=False
)
# Fast speculative generation
generated_fast = model.generate(
input_ids,
max_new_tokens=50,
use_speculative=True
)
print(tokenizer.decode(generated[0], skip_special_tokens=True))
Based on the paper "Better & Faster Large Language Models via Multi-token Prediction" which demonstrates that predicting multiple tokens simultaneously can improve both training efficiency and inference speed.
pytorch_model.bin: Model weightsconfig.json: Model configurationApache 2.0 (following GPT-2 base model)