Text Generation
Transformers
Safetensors
PyTorch
looped_gpt2
looped-transformer
custom_code

looped-distilgpt2-pointer-chasing-5k-dense

DistilGPT2 fine-tuned on synthetic pointer chasing with a plain PyTorch loop. The middle blocks [2, 4) execute 1 time(s); all other blocks execute once. Weights are shared across iterations, and all parameters are trained. No KV cache is used.

Status: complete, step 5000 / 5000. See metrics.json for exact-match accuracy by path length, history.jsonl for training progress, and source/ for the complete recipe. The checkpoint has 81,912,576 unique parameters and executes 6 blocks per forward pass.

from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "ariG23498/looped-distilgpt2-pointer-chasing-5k-dense"
tokenizer = AutoTokenizer.from_pretrained(repo, padding_side="left")
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True).eval()
prompt = "A>B B>C C>D D>E E>F F>G G>H H>A\nStart: A. Steps: 3. Answer:"
inputs = tokenizer(prompt, return_tensors="pt")
print(tokenizer.decode(model.generate(**inputs, max_new_tokens=1,
    do_sample=False, use_cache=False)[0, inputs.input_ids.shape[1]:]))

Install the pinned source/requirements.txt. Inspect model.py before allowing custom model code. Generation is ordinary autoregressive decoding without a KV cache; this benchmark scores one unconstrained answer token from the full vocabulary. There are eight possible answers (uniform guessing: 12.5%).

Train/validation/test graphs are disjoint. Training uses 1–3 hops; test_long uses 4–6 hops. Longer paths are a harder generalization check. This is a toy algorithmic task, not evidence of general reasoning. A single seed and more compute in the looped variant do not establish a causal benefit from looping. Check the dense baseline and inference-loop ablations before drawing conclusions. Checkpoints contain inference weights, not optimizer state for exact resumption.

Downloads last month
-
Safetensors
Model size
81.9M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for ariG23498/looped-distilgpt2-pointer-chasing-5k-dense

Finetuned
(1,596)
this model

Dataset used to train ariG23498/looped-distilgpt2-pointer-chasing-5k-dense