🚀 SPARK-mini-instruct模型
SPARK-mini-instruct是一款針對特定領域進行指令調優的語言模型。它基於SPARK-mini-base模型,在核電領域的大量數據上訓練而成,具有38億參數。該模型可用於核電領域的技術支持、系統性能提升等場景,為相關從業者提供了強大的工具。
🚀 快速開始
模型使用示例
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "nuclearnai/SPARK-mini-instruct"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
).to("cuda")
tokenizer = AutoTokenizer.from_pretrained(
model_name,
)
prompt = [
{
"role": "user",
"content": "What are the tech specs appliable to diesel generators?",
}
]
input_ids = tokenizer.apply_chat_template(
prompt,
return_tensors="pt",
).to("cuda")
output = model.generate(
input_ids=input_ids,
min_p=0.2,
temperature=1.0,
do_sample=True,
max_new_tokens=100,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
輸出示例
What are the tech specs appliable to diesel generators? The technical specifications applicable to diesel generators can vary depending on the specific reactor design and the licensing basis. However, some common technical specifications for diesel generators include: 1. Diesel generator operability requirements, such as minimum required fuel levels, starting air pressure, and surveillance testing intervals. 2. Limitations on the amount of time the diesel generators can be inoperable before the reactor must be shut down. 3.[continued...]
✨ 主要特性
- 領域適配性強:經過大量核電領域數據的訓練,能很好地適應核電領域的特定需求,為該領域的相關任務提供專業的支持。
- 指令響應能力:作為指令調優版本,能夠以類似聊天的格式對零樣本提示做出響應,方便用戶與模型進行交互。
- 多用途性:可用於加速科研人員和監管機構的工作、提升核電行業系統的性能,並且對沒有硬件加速或雲連接能力的從業者也具有可訪問性。
📦 安裝指南
此部分文檔未提及具體安裝步驟,若需使用該模型,可參考示例代碼中使用transformers
庫加載模型和分詞器的方式。確保安裝transformers 4.41
以保證與Phi3模型兼容。
💻 使用示例
基礎用法
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "nuclearnai/SPARK-mini-instruct"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
).to("cuda")
tokenizer = AutoTokenizer.from_pretrained(
model_name,
)
prompt = [
{
"role": "user",
"content": "What are the tech specs appliable to diesel generators?",
}
]
input_ids = tokenizer.apply_chat_template(
prompt,
return_tensors="pt",
).to("cuda")
output = model.generate(
input_ids=input_ids,
min_p=0.2,
temperature=1.0,
do_sample=True,
max_new_tokens=100,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
📚 詳細文檔
用途
直接使用
SPARK-mini-instruct高度適配核電領域,因此在響應時會帶有一定的偏向性。
具體用例
- 專業人員支持:為國家研究實驗室或監管機構的技術人員提供特定領域的語言模型,以便進一步微調以滿足更多用例需求。
- 系統性能提升:改善目前在核電行業中使用語言模型作為特徵提取器或預測AI系統模型主幹的系統性能。
- 廣泛可訪問性:為沒有硬件加速器或雲連接能力的從業者提供可訪問的模型。
許可證
許可證:CC - BY - NC,但以下有限數量的商業實體可進行免費、開放、不受限制的使用:
- 運營中的核電公用事業公司
- 監管機構(商業或政府)
- 研究實驗室和以研究為重點的團體(如國家實驗室和電力特定研究小組)
如需進一步信息或書面許可,請聯繫我們。
偏差、風險和限制
- 事實錯誤:儘管該模型在核電相關信息上進行了大量訓練,但和其他語言模型一樣,仍會出現事實和邏輯錯誤。
- 生產使用限制:在沒有進一步訓練或適用的防護措施的情況下,該模型不應用於生產用例。
- 有意偏差:為了實現可引導性,模型中引入了有意的偏差。
- 事實記憶不足:由於只有38億參數,模型可能會發出不正確的響應和事實,最終用戶開發者應提供應用防護措施。
- 提示模板問題:Phi - 3的提示模板存在一些問題,模型生成可能不會按預期停止,建議為
<|end|>
和<|end_of_text|>
特殊標記添加額外的停止條件。
訓練詳情
訓練數據
SPARK - mini - instruct的所有訓練數據均來自公開可用的來源,但不會公開。如需訓練數據的具體細節或共享訓練數據,請通過contact@nuclearn.ai聯繫Nuclearn,我們將根據具體情況提供。
訓練過程
該模型使用DeepSpeed Zero3在多節點的私有A100服務器集群上以bf16格式進行訓練。
評估
SPARK - mini - instruct在一組專門為測試特定核電行業知識而創建的私有基準測試上進行了評估。
完成任務(核電版HellaSWAG)
- 仿照HellaSWAG基準測試設計。
- 對複雜的核電站運營場景和事實段落進行各種完成任務。
多項選擇題問答(核電版MMLU)
- 仿照MMLU基準測試設計。
- 關於核電站運營、系統、工程等方面的多項選擇題問答。
環境影響
- 硬件類型:A100 - 80GB SXM4
- 雲服務提供商:Nuclearn訓練集群
模型架構和目標
SPARK - mini - instruct基於Phi3架構。
計算基礎設施
該模型在Nuclearn訓練集群上進行訓練,這是一個具有800Gb/s Infiniband連接的A100 - 80GB SXM服務器集群。
🔧 技術細節
模型架構
基於Phi3架構,經過特定的訓練和調優,以適應核電領域的任務需求。
訓練技術
使用DeepSpeed Zero3技術在多節點的私有A100服務器集群上進行訓練,採用bf16數據格式,提高訓練效率和模型性能。
📄 許可證
許可證:CC - BY - NC,部分商業實體可免費、開放、不受限制使用,具體見上文說明。