加载中…
加载中…
🦉 github️ • 🤗 Hugging Face • 🤖 ModelScope • 🏔 MindSpore • 🐾 gitee️ • 💬 WeChat
我们采用标准的 Decoder-only 结构设计了 TeleChat2 模型,使用 Rotary Embedding
的位置编码方法、使用 SwiGLU
激活函数来替代GELU激活函数、使用基于 RMSNorm 的 Pre-Normalization进行层标准化操作。我们将TeleChat2的词嵌入层和输出lm
head层参数分开,有助于增强训练稳定性和收敛性。我们选择了GQA以节约attention部分的参数量和计算量、提升训练和推理速度。
TeleChat2的模型结构配置如下表所示:
| layer_num | hidden_size | ffn_hidden_size | head_num | tie_word_embeddings | GQA | |
|---|---|---|---|---|---|---|
| 3B | 24 | 3072 | 6144 | 24 | 否 | 否 |
| 7B | 30 | 4096 | 12288 | 32 | 否 | 否 |
| 35B | 64 | 6144 | 20480 | 48 | 否 | 否 |
| 115B | 96 | 8192 | 40960 | 64 | 否 | 是 |
我们开源的 TeleChat2 模型:
本次发布版本和下载链接见下表
| 模型版本 | 下载链接 |
|---|---|
| telechat2-3B | modelscope |
| telechat2-7B | modelscope |
| telechat2-35B | modelscope |
| telechat2-115B | modelscope |
TeleChat2 模型相比同规模模型在评测效果方面也有较好的表现,我们的评测集涵盖了包括MMLU、C-Eval、CMMLU、 GSM8K、MATH、HumanEval、BBH等数据集,评测能力包括了指令遵循、考试能力、数学计算和推理、代码生成等
MMLU 数据集是一个全面的英文评测数据集,涵盖了 57 个学科,包括人文学科、社会科学、自然科学、初等数学、美国历史、计算机科学、法律等等。
CEVAL 数据集是一个全面的中文评估测试集,包括初中、高中、大学和专业难度级别的多项选择题,涵盖了 52 个不同的学科领域。
CMMLU 数据集同样是一个全面的中文评估测试集,涵盖了从基础学科到高级专业水平的67个主题。
GSM8K 数据集包含了8.5K高质量的小学数学题,能够评估语言模型在数学推理能力上的表现。
HumanEval 数据集是一个由openai提供的代码能力测试数据集,它由 164 个编程问题组成,要求根据给定的问题和代码模板,生成正确的代码片段。
MBPP 数据集包含大约1000个众包的Python编程问题,涵盖编程基础知识、标准库功能等。每个问题包括任务描述、代码解决方案和3个自动化测试用例。
AlignBench是一个多维度全面评估中文大模型对齐水平的评测基准,包含638道单轮主观评测题。
MT-bench是一个用于评估聊天助手的具有挑战性的多轮开放式问题集,包含80通多轮主观评测题。
| Dataset | Llama-3.1-70B | Qwen1.5-110B | Qwen2-72-instruct | DeepSeek-v2 | TeleChat2-115B | TeleChat2-35B | TeleChat2-7B | TeleChat2-3B |
|---|---|---|---|---|---|---|---|---|
| C-Eval | - | - | 83.8 | 78 | 86.9 | 85 | 82 | 75 |
| MMLU | 86 | 80.4 | 82.3 | 77.8 | 80.9 | 82 | 79.6 | 72.9 |
| CMMLU | 69.01 | 87.64 | 87.47 | 81.6 | 89.94 | 90.18 | 84.6 | 73 |
| BBH | - | 74.8 | - | 79.7 | 89.04 | 88.6 | 77.3 | 65.99 |
| GSM8K | 95.1 | 85.4 | 91.1 | 92.2 | 92.2 | 91 | 86.8 | 64.7 |
| HumanEval | 80.5 | 52.4 | 86 | 81.1 | 75 | 73 | 56 | 38 |
| MBPP | 86 | 58.1 | 80.2 | 72 | 78 | 75 | 62.6 | 47 |
| AlignBench | - | 7.86 | 8.27 | 7.91 | 8.03 | 7.88 | 6.96 | 5.74 |
| MT-bench | 8.79 | 8.88 | 9.12 | 8.97 | 8.89 | 8.2 | 7.2 | 5.72 |
| IFEval | 87.5 | - | 77.6 | 63.8 | 82.81 | 79.63 | 73.1 | 61.29 |
当前模型推理兼容了单卡和多卡推理,以及针对长文推理做了部分优化工作。
模型推理方法示范
>>> import os
>>> import torch
>>> from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
>>> tokenizer = AutoTokenizer.from_pretrained('TeleChat2/Telechat2-3B', trust_remote_code=True)
>>> model = AutoModelForCausalLM.from_pretrained('TeleChat2/Telechat2-3B', trust_remote_code=True, device_map="auto",
torch_dtype=torch.float16)
>>> prompt = "生抽与老抽的区别?"
>>> 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=512
>>> )
>>> 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]
生抽和老抽是两种不同的酱油,它们在风味、色泽和用途上都有所区别。
1.颜色:生抽的颜色比较淡,而老抽的颜色较深。生抽的颜色呈红褐色或棕红色,而老抽的颜色则呈棕黑色。
2.味道:生抽具有鲜美的咸味和微甜的味浅,而老抽浓郁,颜色较深。根据个人口味和烹饪需求选择不同的酱油类型可以获得更好的口感和菜肴效果。
我们在此声明,不要使用TeleChat模型及其衍生模型进行任何危害国家社会安全或违法的活动。同时,我们也要求使用者不要将TeleChat模型用于没有安全审查和备案的互联网服务。我们希望所有使用者遵守上述原则,确保科技发展在合法合规的环境下进行。
我们已经尽我们所能,来确保模型训练过程中使用的数据的合规性。然而,尽管我们已经做出了巨大的努力,但由于模型和数据的复杂性,仍有可能存在一些无法预见的问题。因此,如果由于使用TeleChat开源模型而导致的任何问题,包括但不限于数据安全问题、公共舆论风险,或模型被误导、滥用、传播或不当利用所带来的任何风险和问题,我们将不承担任何责任。
如需引用我们的工作,请使用如下 reference:
@misc{wang2025technicalreporttelechat2telechat25,
title={Technical Report of TeleChat2, TeleChat2.5 and T1},
author={Zihan Wang and Xinzhang Liu and Yitong Yao and Chao Wang and Yu Zhao and Zhihao Yang and Wenmin Deng and Kaipeng Jia and Jiaxin Peng and Yuyao Huang and Sishi Xiong and Zhuo Jiang and Kaidong Yu and Xiaohui Hu and Fubei Yao and Ruiyu Fang and Zhuoru Jiang and Ruiting Song and Qiyi Xie and Rui Xue and Xuewei He and Yanlei Xue and Zhu Yuan and Zhaoxi Zhang and Zilu Huang and Shiquan Wang and Xin Wang and Hanming Wu and Mingyuan Wang and Xufeng Zhan and Yuhan Sun and Zhaohu Xing and Yuhao Jiang and Bingkai Yang and Shuangyong Song and Yongxiang Li and Zhongjiang He and Xuelong Li},
year={2025},
eprint={2507.18013},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2507.18013},
}