Run this model with HF Jobs

Run axiomlaborg/cable-edufineweb-md-1024 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/axiomlaborg/cable-edufineweb-md-1024. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/axiomlaborg/cable-edufineweb-md-1024 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/axiomlaborg/cable-edufineweb-md-1024. Ask me which benchmark to run, then save the scores and the per-example results to a new private dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/axiomlaborg/cable-edufineweb-md-1024. Push it to a new private model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Context-aware Biases for Length Extrapolation

The source code of (Context-aware Biases for Length Extrapolation)

🚀 News

  • [2025.02.3] Code release

Upcoming

  • Cleaning codebase
  • Adding scripts for training ALiBi, RoPE, T5-bias

Datasets and Models

Download the datasets from HuggingFace and use use dataset_preparation.py for saving tokenized dataset.

Some of trained models:

Dataset Model Parameters Sequence Length Checkpoint
Fineweb-Edu(10B) GPT-Medium 334M 1024 Link
Fineweb-Edu(10B) GPT-Medium 334M 512 Link
WikiText-103 GPT-Tiny 44M 1024 Link
WikiText-103 GPT-Tiny 44M 512 Link

Training

  • Single GPU

    python Cable.py --dataset-dir "path to dataset" --model "medium or small or tiny" --save-dir "dir for logs"
    
  • Multiple GPUs

    torchrun --standalone --nproc_per_node=2 Cable.py
    

For Hellaswag benchmark and evaluating extrapolation please use evaluation.ipynb notebook.

Length Extrapolation

A Cable model trained on T=1024 can extrapolate on T=8192, achieving a better performance (PPL=22.22) compared to the sinusoidal model (PPL=22.81) trained on T=8192.

Runtime and Memory Overhead

Cable improves the model's extrapolation ability significantly with a negligible burden in time and memory compared to the vanilla transformer. Furthermore, compared to existing RPE methods, our approach maintains nearly identical training time and GPU memory usage, while its inference overhead remains either negligible or comparable, depending on the sequence length.

Citation

If you use this repository for your research or wish to refer to our positional encoding method, please use the following BibTeX entry:

@article{veisi2025context,
  title={Context-aware Biases for Length Extrapolation},
  author={Ali Veisi and Amir Mansourian},
  journal={arXiv preprint arXiv:2503.08067},
  year={2025}
}

Acknowledgement

This repo is based on Karpathy/Build-NanoGPT. Thanks for their excellent work.

Downloads last month
-
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for axiomlaborg/cable-edufineweb-md-1024

Finetuned
(2,347)
this model

Dataset used to train axiomlaborg/cable-edufineweb-md-1024

Papers for axiomlaborg/cable-edufineweb-md-1024