Granite 3.3 8b Instruct GGUF
Granite-3.3-8B-Instruct 是一款具有80億參數、支持128K上下文長度的語言模型,專為提升推理和指令跟隨能力而微調。
下載量 7,102
發布時間 : 5/10/2025
模型概述
基於Granite-3.3-8B-Base構建,該模型在衡量通用性能的基準測試上表現顯著提升,並在數學、編程和指令遵循方面有所改進。支持結構化推理,清晰區分內部思考與最終輸出。
模型特點
結構化推理
支持通過<think></think>和<response></response>標籤進行結構化推理,清晰區分內部思考與最終輸出。
長上下文支持
支持128K的上下文長度,適合處理長文檔摘要、問答等任務。
多語言支持
支持12種語言,包括英語、中文等,並可針對其他語言進行微調。
高性能推理
在AlpacaEval-2.0和Arena-Hard等基準測試上表現優異,尤其在數學、編程和指令遵循方面有顯著提升。
模型能力
思考推理
文本摘要
文本分類
信息抽取
問答系統
檢索增強生成(RAG)
編程相關任務
函數調用任務
多語言對話場景
長上下文任務
使用案例
通用指令跟隨
家居用品重新設計
重新設計一款常見家居用品,使其更具可持續性和用戶友好性。
提供詳細的改進方案和益處分析。
長文檔處理
長文檔摘要
對長文檔或會議記錄進行摘要。
生成簡潔準確的摘要內容。
編程輔助
代碼生成
根據自然語言描述生成代碼。
生成功能正確的代碼片段。
🚀 Granite-3.3-8B-Instruct
Granite-3.3-8B-Instruct是一款擁有80億參數、上下文長度達128K的語言模型。它經過微調,在推理和指令遵循能力上表現出色。該模型基於Granite-3.3-8B-Base構建,在AlpacaEval-2.0和Arena-Hard等通用性能基準測試中取得顯著提升,在數學、編碼和指令遵循方面也有改進。它支持通過<think></think>
和<response></response>
標籤進行結構化推理,能清晰區分內部思考和最終輸出。
🚀 快速開始
安裝依賴庫
pip install torch torchvision torchaudio
pip install accelerate
pip install transformers
運行示例代碼
from transformers import AutoModelForCausalLM, AutoTokenizer, set_seed
import torch
model_path="ibm-granite/granite-3.3-8b-instruct"
device="cuda"
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map=device,
torch_dtype=torch.bfloat16,
)
tokenizer = AutoTokenizer.from_pretrained(
model_path
)
conv = [{"role": "user", "content":"Redesign a common household item to make it more sustainable and user-friendly. Explain the changes and their benefits."}]
input_ids = tokenizer.apply_chat_template(conv, return_tensors="pt", thinking=True, return_dict=True, add_generation_prompt=True).to(device)
set_seed(42)
output = model.generate(
**input_ids,
max_new_tokens=8192,
)
prediction = tokenizer.decode(output[0, input_ids["input_ids"].shape[1]:], skip_special_tokens=True)
print(prediction)
✨ 主要特性
- 多語言支持:支持英語、德語、西班牙語、法語、日語、葡萄牙語、阿拉伯語、捷克語、意大利語、韓語、荷蘭語和中文等多種語言,用戶還可針對其他語言進行微調。
- 豐富的任務能力:具備思考、總結、文本分類、文本提取、問答、檢索增強生成(RAG)、代碼相關任務、函數調用任務、多語言對話以及長上下文任務(如長文檔/會議總結、長文檔問答等)處理能力。
- 結構化推理:支持通過
<think></think>
和<response></response>
標籤進行結構化推理,清晰區分內部思考和最終輸出。
📦 安裝指南
安裝以下必要的庫:
pip install torch torchvision torchaudio
pip install accelerate
pip install transformers
💻 使用示例
基礎用法
from transformers import AutoModelForCausalLM, AutoTokenizer, set_seed
import torch
model_path="ibm-granite/granite-3.3-8b-instruct"
device="cuda"
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map=device,
torch_dtype=torch.bfloat16,
)
tokenizer = AutoTokenizer.from_pretrained(
model_path
)
conv = [{"role": "user", "content":"Redesign a common household item to make it more sustainable and user-friendly. Explain the changes and their benefits."}]
input_ids = tokenizer.apply_chat_template(conv, return_tensors="pt", thinking=True, return_dict=True, add_generation_prompt=True).to(device)
set_seed(42)
output = model.generate(
**input_ids,
max_new_tokens=8192,
)
prediction = tokenizer.decode(output[0, input_ids["input_ids"].shape[1]:], skip_special_tokens=True)
print(prediction)
示例輸出
thinking=True
<think>To address this prompt, I'll focus on redesigning a common household item: the plastic water bottle. The goal is to make it more sustainable and user-friendly. Here are the proposed changes and their benefits:
1. **Material**: Replace plastic with biodegradable or recyclable materials like glass or plant-based plastics (PLA).
2. **Design**: Introduce a modular design for easy refilling and cleaning.
3. **Functionality**: Incorporate a built-in water filter for purification.
4. **Durability**: Enhance the bottle's lifespan through robust construction.
5. **User-friendliness**: Simplify the cap mechanism for easy opening and closing.
These changes would significantly reduce plastic waste, promote recycling, ensure access to clean drinking water, and enhance the overall user experience.
Now, I will detail each change and its benefits in a structured format.</think>
<response>### Redesign of the Plastic Water Bottle for Sustainability and User-Friendliness
#### 1. Material: Biodegradable or Recyclable Alternatives
**Change**: Transition from traditional PET plastic to glass or plant-based plastics (Polylactic Acid - PLA).
**Benefits**:
- **Sustainability**: Glass and PLA are biodegradable or highly recyclable, drastically reducing plastic pollution.
- **Health**: Unlike PET, these materials do not leach chemicals into the water, ensuring safer consumption.
#### 2. Modular Design for Easy Refilling and Cleaning
**Change**: Implement a detachable, interchangeable inner liner within a reusable outer casing.
**Benefits**:
- **User-Friendliness**: Users can easily remove the inner liner for thorough cleaning, reducing the risk of bacterial growth.
- **Sustainability**: The outer casing remains intact, encouraging reuse, while the inner liner can be replaced or recycled when worn out.
#### 3. Built-in Water Filter
**Change**: Integrate a removable, replaceable water filter into the bottle cap.
**Benefits**:
- **Accessibility**: Provides clean drinking water directly from any source (tap, river, etc.), eliminating the need for additional filtration devices.
- **Health**: Removes contaminants, bacteria, and impurities, ensuring safe hydration.
- **Sustainability**: Reduces the use of single-use plastic water bottles by offering a purification solution within a reusable container.
#### 4. Enhanced Durability
**Change**: Use high-quality, durable materials and robust construction techniques for both the outer casing and inner liner.
**Benefits**:
- **Longevity**: A more robust design increases the bottle's lifespan, reducing the frequency of replacements.
- **Cost-effectiveness**: Although the initial cost might be higher, the long-term savings from reduced replacements make it economical.
- **Sustainability**: Less frequent disposal means lower environmental impact.
#### 5. Simplified Cap Mechanism
**Change**: Adopt a one-touch, easy-to-open and close cap design, possibly inspired by sports bottle caps.
**Benefits**:
- **User-Friendliness**: Especially beneficial for children, elderly, or those with limited hand dexterity.
- **Convenience**: Quick access to water encourages more frequent hydration, promoting healthier habits.
### Conclusion
This redesigned water bottle addresses key sustainability concerns by minimizing plastic use and waste, while also enhancing user-friendliness through improved functionality, durability, and accessibility. By integrating biodegradable materials, a modular design, a built-in filter, robust construction, and a simple cap mechanism, the bottle not only reduces environmental footprint but also offers a superior user experience.</response>
thinking=False
Item for Redesign: Plastic Bottle (e.g., water or beverage bottle)
Redesign Concept: Eco-Friendly, Modular, and Multi-Functional Reusable Bottle
Changes:
1. Material: Replace the conventional plastic with food-grade, BPA-free, and recyclable materials such as stainless steel or glass. These materials are durable, non-toxic, and have a longer lifespan, reducing waste.
2. Modular Design: Introduce a modular design that allows users to customize their bottle according to their needs. This could include interchangeable caps, mouthpiece sizes, and carrying loops. Users can purchase additional modules as needed, promoting a more sustainable approach by reducing the need to buy an entirely new bottle for different purposes.
3. Integrated Filter: Incorporate a built-in, washable, and reusable filter that can remove impurities and improve the taste of water. This eliminates the need for single-use disposable filters or bottled water, further reducing plastic waste.
4. Smart Cap: Develop a smart cap with a built-in digital display and temperature sensor. This feature allows users to track their daily water intake, set hydration goals, and monitor the temperature of their beverage. The smart cap can be synced with a mobile app for additional functionality, such as reminders and progress tracking.
5. Easy-to-Clean Design: Ensure the bottle has a wide mouth and smooth interior surfaces for easy cleaning. Include a brush for hard-to-reach areas, making maintenance simple and encouraging regular use.
6. Collapsible Structure: Implement a collapsible design that reduces the bottle's volume when not in use, making it more portable and convenient for storage.
Benefits:
1. Sustainability: By using recyclable materials and reducing plastic waste, this redesigned bottle significantly contributes to a more sustainable lifestyle. The modular design and reusable filter also minimize single-use plastic consumption.
2. User-Friendly: The smart cap, easy-to-clean design, and collapsible structure make the bottle convenient and user-friendly. Users can customize their bottle to suit their needs, ensuring a better overall experience.
3. Healthier Option: Using food-grade, BPA-free materials and an integrated filter ensures that the beverages consumed are free from harmful chemicals and impurities, promoting a healthier lifestyle.
4. Cost-Effective: Although the initial investment might be higher, the long-term savings from reduced purchases of single-use plastic bottles and disposable filters make this reusable bottle a cost-effective choice.
5. Encourages Hydration: The smart cap's features, such as hydration tracking and temperature monitoring, can motivate users to stay hydrated and develop healthier habits.
By redesigning a common household item like the plastic bottle, we can create a more sustainable, user-friendly, and health-conscious alternative that benefits both individuals and the environment.
📚 詳細文檔
評估結果
多基準測試對比
模型 | Arena-Hard | AlpacaEval-2.0 | MMLU | PopQA | TruthfulQA | BigBenchHard | DROP | GSM8K | HumanEval | HumanEval+ | IFEval | AttaQ |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Granite-3.1-2B-Instruct | 23.3 | 27.17 | 57.11 | 20.55 | 59.79 | 61.82 | 20.99 | 67.55 | 79.45 | 75.26 | 63.59 | 84.7 |
Granite-3.2-2B-Instruct | 24.86 | 34.51 | 57.18 | 20.56 | 59.8 | 61.39 | 23.84 | 67.02 | 80.13 | 73.39 | 61.55 | 83.23 |
Granite-3.3-2B-Instruct | 28.86 | 43.45 | 55.88 | 18.4 | 58.97 | 63.91 | 44.33 | 72.48 | 80.51 | 75.68 | 65.8 | 87.47 |
Llama-3.1-8B-Instruct | 36.43 | 27.22 | 69.15 | 28.79 | 52.79 | 73.43 | 71.23 | 83.24 | 85.32 | 80.15 | 79.10 | 83.43 |
DeepSeek-R1-Distill-Llama-8B | 17.17 | 21.85 | 45.80 | 13.25 | 47.43 | 67.39 | 49.73 | 72.18 | 67.54 | 62.91 | 66.50 | 42.87 |
Qwen-2.5-7B-Instruct | 25.44 | 30.34 | 74.30 | 18.12 | 63.06 | 69.19 | 64.06 | 84.46 | 93.35 | 89.91 | 74.90 | 81.90 |
DeepSeek-R1-Distill-Qwen-7B | 10.36 | 15.35 | 50.72 | 9.94 | 47.14 | 67.38 | 51.78 | 78.47 | 79.89 | 78.43 | 59.10 | 42.45 |
Granite-3.1-8B-Instruct | 37.58 | 30.34 | 66.77 | 28.7 | 65.84 | 69.87 | 58.57 | 79.15 | 89.63 | 85.79 | 73.20 | 85.73 |
Granite-3.2-8B-Instruct | 55.25 | 61.19 | 66.79 | 28.04 | 66.92 | 71.86 | 58.29 | 81.65 | 89.35 | 85.72 | 74.31 | 84.7 |
Granite-3.3-8B-Instruct | 57.56 | 62.68 | 65.54 | 26.17 | 66.86 | 69.13 | 59.36 | 80.89 | 89.73 | 86.09 | 74.82 | 88.5 |
數學基準測試
模型 | AIME24 | MATH-500 |
---|---|---|
Granite-3.1-2B-Instruct | 0.89 | 35.07 |
Granite-3.2-2B-Instruct | 0.89 | 35.54 |
Granite-3.3-2B-Instruct | 3.28 | 58.09 |
Granite-3.1-8B-Instruct | 1.97 | 48.73 |
Granite-3.2-8B-Instruct | 2.43 | 52.8 |
Granite-3.3-8B-Instruct | 8.12 | 69.02 |
訓練數據
訓練數據主要來自兩個關鍵來源:
- 具有寬鬆許可的公開可用數據集。
- 用於增強推理能力的內部合成生成數據。
基礎設施
使用IBM的超級計算集群Blue Vela訓練Granite-3.3-8B-Instruct,該集群配備了NVIDIA H100 GPU,為在數千個GPU上訓練模型提供了可擴展且高效的基礎設施。
倫理考量與侷限性
Granite-3.3-8B-Instruct基於Granite-3.3-8B-Base構建,使用了寬鬆許可的開源數據和部分專有數據以提升性能。由於它繼承了前一個模型的基礎,因此適用於Granite-3.3-8B-Base的所有倫理考量和侷限性仍然適用。
資源鏈接
- 瞭解Granite的最新更新:https://www.ibm.com/granite
- 通過教程、最佳實踐和提示工程建議開始使用:https://www.ibm.com/granite/docs/
- 瞭解最新的Granite學習資源:https://github.com/ibm-granite-community/
🔧 技術細節
Granite-3.3-8B-Instruct基於Transformer架構,通過微調提升了推理和指令遵循能力。它使用了IBM的超級計算集群Blue Vela進行訓練,該集群配備了NVIDIA H100 GPU,為模型訓練提供了強大的計算支持。
📄 許可證
本項目採用Apache 2.0許可證。
Phi 2 GGUF
其他
Phi-2是微軟開發的一個小型但強大的語言模型,具有27億參數,專注於高效推理和高質量文本生成。
大型語言模型 支持多種語言
P
TheBloke
41.5M
205
Roberta Large
MIT
基於掩碼語言建模目標預訓練的大型英語語言模型,採用改進的BERT訓練方法
大型語言模型 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基礎模型的蒸餾版本,在保持相近性能的同時更輕量高效,適用於序列分類、標記分類等自然語言處理任務。
大型語言模型 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一個多語言大語言模型,針對多語言對話用例進行了優化,在常見的行業基準測試中表現優異。
大型語言模型 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基於100種語言的2.5TB過濾CommonCrawl數據預訓練的多語言模型,採用掩碼語言建模目標進行訓練。
大型語言模型 支持多種語言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基於Transformer架構的英語預訓練模型,通過掩碼語言建模目標在海量文本上訓練,支持文本特徵提取和下游任務微調
大型語言模型 英語
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI發佈的開放預訓練Transformer語言模型套件,參數量從1.25億到1750億,旨在對標GPT-3系列性能,同時促進大規模語言模型的開放研究。
大型語言模型 英語
O
facebook
6.3M
198
1
基於transformers庫的預訓練模型,適用於多種NLP任務
大型語言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多語言大語言模型系列,包含8B、70B和405B參數規模,支持8種語言和代碼生成,優化了多語言對話場景。
大型語言模型
Transformers 支持多種語言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基礎版是由Google開發的文本到文本轉換Transformer模型,參數規模2.2億,支持多語言NLP任務。
大型語言模型 支持多種語言
T
google-t5
5.4M
702
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98