CoolFace
Modelpublic

xl-zhao/PromptCoT-Mamba-Math-7B

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes14downloads
Model Card

Scaling Reasoning without Attention

![ArXiv](http://arxiv.org/abs/2505.22425) ![GitHub](https://github.com/inclusionAI/PromptCoT)


๐Ÿš€ Overview

PromptCoT-Mamba establishes the first attention-free foundation model capable of surpassing strong Transformer baselines across a broad suite of competition-level math and code reasoning tasks. Built on the Mamba-2 architecture and trained through a structured, two-stage curriculum using the **PromptCoT** pipeline, it delivers high accuracy with constant-memory inference, eliminating the need for KV caching.


๐Ÿ“ˆ Key Results

๐Ÿ”น General Performance

ModelMATH-500AIME 24AIME 25OlympiadBenchHumanEvalHumanEval+Livecodebench
PromptCoT-Mamba-7B84.635.224.650.781.775.029.9
Gemma3-27B89.032.624.054.286.078.026.9
Gemma3-12B83.822.919.249.981.173.222.2
Sky-T1-7B85.019.219.249.241.537.218.3
S1.1-7B82.019.217.543.164.056.713.3
Bespoke-Stratos-7B81.218.316.345.073.268.38.6
Nemotron-H-8B77.6------79.374.4--
M1-3B81.723.022.043.6------
๐Ÿ” PromptCoT-Mamba-7B consistently outperforms all 7B-scale Transformer and hybrid Mamba-Transformer baselines across all tasks.

๐Ÿ”น Math Specialization vs. Generalist

ModelMATH-500AIME 24AIME 25OlympiadBenchHumanEvalHumanEval+Livecodebench
PromptCoT-Mamba-Math-7B88.042.930.852.171.366.520.3
PromptCoT-Mamba-7B84.635.224.650.781.775.029.9
๐ŸŽฏ The math-specialized variant improves AIME 24 by +7.7% and AIME 25 by +6.2%, with a slight trade-off in code-related performance.

โšก Inference Efficiency

Using vLLM under constrained memory, PromptCoT-Mamba-7B demonstrates substantial speedups over the S1.1-7B Transformer baseline:

  • โ€”๐Ÿ’ก 3.66ร— faster at long-sequence generation on 24GB GPU
  • โ€”๐Ÿ’ก 1.69ร— faster under 72GB memory
โš™๏ธ Practical for cost-sensitive or long-context inference workloads at scale.

๐Ÿงช Quick Start

๐Ÿ”ง Install Requirements

bash
pip install transformers vllm torch accelerate

๐Ÿง  Load and Run the Model

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "xl-zhao/PromptCoT-Mamba-Math-7B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name).to("cuda")

problem_statement = (
    "A robe takes 2 bolts of blue fiber and half that much white fiber.  How many bolts in total does it take?"
)

prompt = (
    f"<|im_start|>user\n{problem_statement}\nPlease reason step by step, and put your final answer within \\boxed{{}}.<|im_end|>\n"
    "<|im_start|>assistant\n"
)

inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

with torch.no_grad():
    output = model.generate(**inputs, max_length=65536, temperature=0.8)

generated_solution = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_solution)

โšก Fast Inference with vLLM

python
from vllm import LLM, SamplingParams

model_name = "xl-zhao/PromptCoT-Mamba-Math-7B"
llm = LLM(model=model_name, tensor_parallel_size=1)

problem_statement = (
    "A robe takes 2 bolts of blue fiber and half that much white fiber.  How many bolts in total does it take?"
)

prompt = (
    f"<|im_start|>user\n{problem_statement}\nPlease reason step by step, and put your final answer within \\boxed{{}}.<|im_end|>\n"
    "<|im_start|>assistant\n"
)

sampling_params = SamplingParams(temperature=0.8, max_tokens=65536)
outputs = llm.generate([prompt], sampling_params)

print(outputs[0].outputs[0].text)

๐Ÿ“œ Citation

bibtex
@article{zhao2025scaling,
  author    = {Xueliang Zhao and Wei Wu and Lingpeng Kong},
  title     = {Scaling Reasoning without Attention},
  journal   = {arXiv preprint arXiv:2505.22425},
  year      = {2025},
  url       = {https://arxiv.org/abs/2505.22425}
}