🚀 Theta-35
Theta-35 是 SVECTOR 推出的 Theta 系列中的先進推理模型。與傳統的指令微調模型相比,Theta-35 專注於複雜思維和推理,在下游任務中表現顯著提升,尤其在需要深度邏輯分析和多步推理的難題上表現出色。
🚀 快速開始
以下是一段代碼片段,展示瞭如何加載分詞器和模型,以及如何生成內容:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "SVECTOR-CORPORATION/Theta-35"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "How many planets are in our solar system? Explain your reasoning."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=32768,
temperature=0.6,
top_p=0.95,
top_k=30
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
使用指南
為了讓 Theta-35 達到最佳性能,我們建議採用以下設置:
-
強制輸出深思熟慮的結果:確保模型以 "<reasoning>\n" 開頭,以促進逐步思考,從而提高輸出質量。如果使用 apply_chat_template
並將 add_generation_prompt
設置為 True
,則會自動實現這一點。
-
採樣參數:
- 使用 Temperature=0.6 和 TopP=0.95 代替貪心解碼,以避免重複。
- 使用 20 到 40 之間的 TopK 來過濾掉罕見的標記出現,同時保持多樣性。
-
標準化輸出格式:我們建議在進行基準測試時使用提示來標準化模型輸出。
- 數學問題:在提示中包含 "Please reason step by step, and put your final answer within \boxed{}."。
- 多項選擇題:在提示中添加 "Please show your choice in the
answer
field with only the choice letter, e.g.,\"answer\": \"C\"
."。
-
處理長輸入:對於超過 32,768 個標記的輸入,啟用滑動窗口注意力,以提高模型有效處理長序列的能力。
對於支持的框架,可以在 config.json
中添加以下內容以啟用擴展上下文處理:
{
...,
"use_sliding_window": true,
"sliding_window": 32768
}
✨ 主要特性
本倉庫包含 Theta-35 模型,它具有以下特點:
- 訓練階段:預訓練和後訓練(監督微調與強化學習)
- 架構:採用 RoPE、SwiGLU、RMSNorm 和注意力 QKV 偏置的 Transformer
- 參數數量:330 億
- 非嵌入參數數量:330 億
- 層數:64
- 注意力頭數量(GQA):Q 為 40,KV 為 8
- 上下文長度:完整的 131,072 個標記
- 滑動窗口:32,768 個標記
注意:為獲得最佳體驗,請在部署 Theta 模型之前查看使用指南。
如需更多詳細信息,請參考我們的文檔。
📦 安裝指南
Theta-35 需要最新版本的 Hugging Face transformers
。我們建議使用 4.43.1 或更高版本。
使用較舊版本的 transformers 時,可能會遇到以下錯誤:
KeyError: 'theta'
🔧 技術細節
Theta-35 在各種推理任務中表現卓越,包括:
- 數學推理
- 邏輯演繹
- 多步問題解決
- 代碼理解與生成
- 科學推理
詳細的評估結果請參考我們的文檔。
📄 許可證
本項目採用 Apache-2.0 許可證。
📚 引用
如果您覺得我們的工作有幫助,請隨意引用:
@misc{theta35,
title = {Theta-35: Advanced Reasoning in Large Language Models},
url = {https://www.svector.co.in/models/theta-35},
author = {SVECTOR Team},
month = {March},
year = {2025}
}
@article{theta,
title={Theta Technical Report},
author={SVECTOR Research Team},
year={2025}
}