🚀 Nova 0.5 e3
Nova 0.5 e3是一個文本生成模型,它展現出了有趣的推理能力,在處理複雜問題時能給出合理的解答。
🚀 快速開始
運行模型的基本示例
以下是使用Python和Hugging Face的transformers
庫加載並運行Nova 0.5 e3的基本示例。請確保你已安裝所需的依賴項(如transformers
、torch
等)。
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "oscar128372/Nova-0.5-e3-7B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
chatml_prompt = """
<|im_start|>system
{}<|im_end|>
<|im_start|>user
{}<|im_end|>
<|im_start|>assistant
"""
system_prompt = "You are a helpful assistant."
prompt = "Solve x^2 + x = 8."
inputs = tokenizer(
[
chatml_prompt.format(
system_prompt,
prompt
)
], return_tensors="pt").to(device)
outputs = model.generate(
**inputs,
max_length=1024,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
✨ 主要特性
該模型具有以下有趣的特性:
- 推理能力:當被問到像“4 x 2等於多少?”這樣簡單的問題時,它能直接給出答案“8”。而對於更復雜的問題,如求解方程“x^2 + x = 8”,它會開始進行推理並正確解答。
<|begin_of_thought|>
**分析**:
該方程是標準形式的二次方程 \(x^2 + x - 8 = 0\)。直接因式分解似乎有挑戰,因此嘗試通過配方來求解。
**第一步**:
在方程兩邊同時加1:
\(x^2 + x + 1 = 9\)。
**第二步**:
認識到 \(x^2 + x + 1\) 可以寫成 \((x + \frac{1}{2})^2 - (\frac{1}{2})^2 + 1\),化簡為 \((x + \frac{1}{2})^2 - \frac{1}{4} + 1 = (x + \frac{1}{2})^2 + \frac{3}{4}\)。
**下一步**:
令其等於9:
\((x + \frac{1}{2})^2 + \frac{3}{4} = 9\)。
**反思**:
在方程兩邊同時減去 \(\frac{3}{4}\):
\((x + \frac{1}{2})^2 = 9 - \frac{3}{4} = \frac{36}{4} - \frac{3}{4} = \frac{33}{4}\)。
**最後**:
對方程兩邊取平方根:
\(x + \frac{1}{2} = \pm \sqrt{\frac{33}{4}} = \pm \frac{\sqrt{33}}{2}\)。
**總結**:
求解 \(x\):
\(x = -\frac{1}{2} \pm \frac{\sqrt{33}}{2} = \frac{-1 \pm \sqrt{33}}{2}\)。
解為:
\(\boxed{\frac{-1 + \sqrt{33}}{2}, \frac{-1 - \sqrt{33}}{2}}\)。
<|end_of_thought|>
<|begin_of_solution|>
**解決方案**:
從 \(x^2 + x = 8\) 開始,將其重寫為 \(x^2 + x + 1 = 9\)。對左邊進行配方:
1. 將 \(x^2 + x + 1\) 重寫為 \((x + \frac{1}{2})^2 - (\frac{1}{2})^2 + 1 = (x + \frac{1}{2})^2 - \frac{1}{4} + 1 = (x + \frac{1}{2})^2 + \frac{3}{4}\)。
2. 令其等於9:\((x + \frac{1}{2})^2 + \frac{3}{4} = 9\)。
3. 減去 \(\frac{3}{4}\):\((x + \frac{1}{2})^2 = \frac{33}{4}\)。
4. 取平方根:\(x + \frac{1}{2} = \pm \frac{\sqrt{33}}{2}\)。
5. 求解 \(x\):\(x = -\frac{1}{2} \pm \frac{\sqrt{33}}{2}\)。
因此,解為 \(\boxed{\frac{-1 + \sqrt{33}}{2}, \frac{-1 - \sqrt{33}}{2}}\)。
<|end_of_solution|>
雖然這種推理能力不如[Nova - 0.5 - r1 - 7B](https://huggingface.co/oscar128372/Nova - 0.5 - r1 - 7B),但仍展現出了潛力。
🔧 技術細節
該模型推理能力的獲得純屬意外。在訓練時,不小心將一個推理數據集與其他較簡單的數據集混合在一起。結果發現,這個推理數據集教會了模型僅在處理更復雜、多步驟的提示時進行推理。
📄 許可證
本模型採用Apache - 2.0許可證。
⚠️ 重要提示
加載方式
不能以4位精度加載該模型。以4位精度加載會完全消除模型的推理能力,使其變成一個普通的基礎模型。如果你不希望模型進行推理,那麼以4位精度加載或許可行,但具體原因尚不明確。
提示模板
使用ChatML模板:
<|im_start|>system
{}<|im_end|>
<|im_start|>user
{}<|im_end|>
<|im_start|>assistant
{}
⚠️ 重要提示
我僅使用了 “You are a helpful assistant.” 系統提示對模型進行了測試,因此其他系統提示可能會產生不正確或意外的結果。
📚 詳細文檔
未來規劃
未來不會有e4版本。下一步計劃是推出1.0版本,也許還會有1.0 - r1版本。請關注未來可能出現的新推理模型。