Downloads · 30 days
4
31% of all-time downloads
vivekkopthsd/vajra-1
vajra-1 is a machine learning model from vivekkopthsd. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A 703K-parameter GPT trained from scratch on ML/statistics/coding research text. Raw PyTorch throughout: custom BPE tokenizer, hand-written causal attention, no training frameworks, no pretrained weights.
Downloads · 30 days
4
31% of all-time downloads
All-time downloads
13
Public
Repo size
3 MB
Likes
0
Public
Click a slice to open those files.
.bin3 MB · 100%
From the Hugging Face model README
A 703K-parameter GPT trained from scratch on ML/statistics/coding research text. Raw PyTorch throughout: custom BPE tokenizer, hand-written causal attention, no training frameworks, no pretrained weights.
Trained on a Kaggle P100 (torch 2.4.0+cu121). 3,000 steps take about a minute on that GPU.
| Param | Value |
|---|---|
| Parameters | 702,948 |
| Layers / heads / d_model | 3 / 4 / 128 |
| Context length | 128 tokens |
| Vocabulary | 356 (BPE, 100 merges, trained on 1.5M chars of the corpus) |
| Dropout | 0.1 |
This is a small model on a small corpus. It learned the surface structure of ML abstracts: paper format, domain vocabulary, sentence scaffolding. It does not produce coherent text, and the generations should not be read as content. At this scale that is the expected outcome; the model's purpose is to demonstrate the pretraining pipeline end to end, not to generate usable prose.
Clone the repo and run the included CLI:
python txcat_gpt_infer.py "TITLE: Bias-variance tradeoff
ABSTRACT:"
Generates 160 tokens at temperature 0.8 on CPU. No GPU needed.
from txcat_gpt_infer import load_model, generate
text, obj = generate("def gradient_descent(X, y,", n_tokens=120, temperature=0.8)
txcat_gpt_infer.py contains the model definition, the BPE tokenizer, and the generation loop. It loads pytorch_model.bin, config.json, and merges.json from this repo.
| File | Contents |
|---|---|
pytorch_model.bin | State dict (3.0 MB) |
config.json | Architecture and training config |
merges.json | BPE merge table |
txcat_gpt_infer.py | Model, tokenizer, generation CLI |
vivekkopthsd/txcat-gpt on Kaggle (private). Four revisions; the log documents each failure.vivekkopthsd/txcat-ml-corpus on Kaggle (private).Two bugs were found and fixed during development; both are documented in the training kernel log.
nn.TransformerEncoderLayer, which is bidirectional. It reported val perplexity 1.03, which was not a real language-modeling result: the model could attend to future tokens during training and collapsed at generation time. Replaced with hand-written causal attention (triangular mask). All numbers above are from the causal model.str was passed to bytearray.extend). Fixed by decoding to bytes at every recursion level and decoding UTF-8 once at the top.Weights trained from scratch on public arXiv abstracts (see arXiv terms of use) and the author's own code. Educational use.