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