Text Generation
Transformers
English
Chinese
finance
reinforcement-learning
reasoning
qwen3
alpha-screening
quantitative-finance
Run this model with HF Jobs
Run AFatRat/Alpha-R1 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/AFatRat/Alpha-R1. Ask me which dataset to train on, then push the fine-tuned model to a new 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/AFatRat/Alpha-R1 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/AFatRat/Alpha-R1. Ask me which benchmark to run, then save the scores and the per-example results to a new 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/AFatRat/Alpha-R1. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use AFatRat/Alpha-R1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AFatRat/Alpha-R1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AFatRat/Alpha-R1")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AFatRat/Alpha-R1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AFatRat/Alpha-R1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AFatRat/Alpha-R1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AFatRat/Alpha-R1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AFatRat/Alpha-R1
- SGLang
How to use AFatRat/Alpha-R1 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 "AFatRat/Alpha-R1" \ --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": "AFatRat/Alpha-R1", "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 "AFatRat/Alpha-R1" \ --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": "AFatRat/Alpha-R1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AFatRat/Alpha-R1 with Docker Model Runner:
docker model run hf.co/AFatRat/Alpha-R1
Update README.md
Browse files121 unmodified lines1221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782798 unmodified lines288289290139291292293294121 unmodified lines
---
# Usage
Alpha-R1 is designed for **alpha screening** in quantitative investment research rather than general-purpose conversation.
Given:
- Current market conditions- Historical market memory- Candidate alpha factor descriptions- Asset universe information
the model reasons about factor effectiveness under the prevailing market regime and selects factors that are more likely to generate excess returns.
## Example
```pythonfrom transformers import AutoTokenizer, AutoModelForCausalLMimport torch
model_name = "FinStep-AI/Alpha-R1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype="auto", device_map="auto")
model.eval()
system_prompt = """You are a senior quantitative investment expert, skilled in selectingthe most suitable alpha factor combinations based on market environmentand asset characteristics.
You need to analyze current market conditions, the characteristics ofeach factor, and asset portfolio situations to provide scientific andreasonable factor selection recommendations."""
user_prompt = """Based on the following information, select the most suitable factorcombinations for {target_date}'s trading day for a {holding_days}-dayshort-term strategy stock selection(buy at market open, sell at market close after {holding_days} trading days).
Target Date:{target_date}
Market Environment Information:
• Previous Trading Day Closing Data ({previous_trading_day}):{market_price_data}
• Previous Trading Day Market Analysis ({previous_trading_day}):{market_analysis}
• Current Day Pre-Market News ({target_date}):{financial_news}
Available Factor Descriptions:
• {factor_1_name}:{factor_1_description}
• {factor_2_name}:{factor_2_description}
• {factor_3_name}:{factor_3_description}
...
Asset Portfolio Information:
{asset_pool_information}
Analysis Framework:
1. Analyze each factor's nature and characteristics.2. Evaluate factors' expected performance in the current market.3. Consider portfolio characteristics for further screening.4. Make the final selection (maximum 10 factors).
Output Requirements:
• Provide detailed analytical reasoning first.• Output XML-tagged factor list: <alpha_list><alpha001>...</alpha_list>• Maximum 10 factors allowed.• Skip selection if no factors are expected to yield positive returns."""
messages = [ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt},]
text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True,)
inputs = tokenizer( text, return_tensors="pt").to(model.device)
with torch.no_grad(): outputs = model.generate( **inputs, max_new_tokens=4096, temperature=0.6, top_p=0.95, pad_token_id=tokenizer.eos_token_id, )
response = tokenizer.decode( outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True,)
print(response)```
## Expected Output
```textFactor analysis reasoning: [Detailed explanation of selection logic...]The most suitable factor selection for the current market is: <alpha_list><alpha001><alpha003><alpha007></alpha_list>```
## Generation Recommendations
```pythongeneration_config = { "temperature": 0.6, "top_p": 0.95, "max_new_tokens": 4096,}```
For reproducible factor-screening results, we recommend:
```pythontemperature=0```
which is also consistent with the evaluation setting reported in the paper.
# Limitations
- This model is **not** a financial advisor.8 unmodified linesIf you use Alpha-R1 in your research, please cite our paper:
```bibtex@article{alphar1,@article{jiang2025alphar1, title={Alpha-R1: Alpha Screening with LLM Reasoning via Reinforcement Learning}, author={Jiang, Zuoyou and Zhao, Li and Sun, Rui and Sun, Ruohan and Li, Zhongjian and Li, Jing and Jiang, Daxin and Bai, Zuo and Hua, Cheng}, journal={arXiv preprint arXiv:2512.23515},README.md+153-1