Instructions to use yingfanbot/gsm-cot-gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yingfanbot/gsm-cot-gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yingfanbot/gsm-cot-gpt2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yingfanbot/gsm-cot-gpt2") model = AutoModelForCausalLM.from_pretrained("yingfanbot/gsm-cot-gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yingfanbot/gsm-cot-gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yingfanbot/gsm-cot-gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yingfanbot/gsm-cot-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yingfanbot/gsm-cot-gpt2
- SGLang
How to use yingfanbot/gsm-cot-gpt2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yingfanbot/gsm-cot-gpt2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yingfanbot/gsm-cot-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yingfanbot/gsm-cot-gpt2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yingfanbot/gsm-cot-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use yingfanbot/gsm-cot-gpt2 with Docker Model Runner:
docker model run hf.co/yingfanbot/gsm-cot-gpt2
LOTUS (Looped Transformers with parallel supervision on latents)
This model checkpoint is part of the project LOTUS, introduced in the paper Bridging the Gap Between Latent and Explicit Reasoning with Looped Transformers.
LOTUS is a latent Chain-of-Thought (CoT) reasoning method designed for looped Transformers. It processes reasoning steps in parallel in the model's hidden states, allowing for significantly lower latency than explicit token-by-token generation while bridging the performance gap to explicit CoT.
Model Details
- Developed by: Ying Fan, Anej Svete, Kangwook Lee
- License: MIT
- Base Model: GPT-2
Resources
- Repository: GitHub - yingfan-bot/lotus
- Paper: Bridging the Gap Between Latent and Explicit Reasoning with Looped Transformers
Evaluation
To evaluate this checkpoint on the GSM8K dataset, you can run the evaluation script from the official repository:
python scripts/eval.py \
--checkpoint yingfanbot/gsm-lotus-gpt2 \
--model_id gpt2 \
--datasets gsm8k \
--n_looped_iters 6 --c_thought 13
For environment setup, training details, and further evaluation instructions, please refer to the official GitHub Repository.
Citation
@misc{fan2026bridginggaplatentexplicit,
title={Bridging the Gap Between Latent and Explicit Reasoning with Looped Transformers},
author={Ying Fan and Anej Svete and Kangwook Lee},
year={2026},
eprint={2606.31779},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2606.31779},
}
- Downloads last month
- 254