[新发布] Supra-50M 正式推出!

Reddit r/LocalLLaMA 模型

摘要

SupraLabs 发布了 Supra-50M,一个紧凑的 5000 万参数因果语言模型,包含基础版和指令版,基于 fineweb-edu 的 200 亿个 token 训练,在多项关键基准测试中达到了可与 GPT-2 和 SmolLM 等更大模型竞争的水平。

https://preview.redd.it/kx39ammxno2h1.jpg?width=1080&format=pjpg&auto=webp&s=d1a2d5b27920a5b61a50547a6e70a6378445cae4 # SupraLabs 发布新模型! - Supra-50M **Supra-50M** 是一个紧凑的 5000 万参数因果语言模型(包含 BASE 和 INSTRUCT 版本),由 SupraLabs 从头构建,采用 Llama 风格架构,基于 200 亿个高质量教育网页文本 token 进行训练。尽管其参数规模远小于同类开源模型,但在多个关键基准测试中取得了具有竞争力甚至更优的结果。这是我们首个 **SupraLabs Scaling Up Plan** 模型。 🤗 [Supra-50M-Base](https://huggingface.co/SupraLabs/Supra-50M-Base) | [Supra-50M-Instruct](https://huggingface.co/SupraLabs/Supra-50M-Instruct) # 接下来是什么? - **Supra-124M** — 基础版、对话版、实验推理版 - **Supra-350M** — 基础版、对话版、推理版、编程版 # 🏆 基准测试 | 基准测试 | Supra-50M *(我们的)* | GPT-2 (124M) | SmolLM-135M | OpenELM-270M | |:-|:-|:-|:-|:-| | **参数数量** | **50M** | 124M *(2.5×)* | 135M *(2.7×)* | 270M *(5.4×)* | | **BLiMP** (语言学) | **76.3%** | 63.0% | 69.8% | N/A | | **SciQ** (科学) | 77.2% | 53.2% | 73.4% | **84.70%** | | **ARC-Easy** (知识) | 52.2% | 42.0% | 49.2% | **45.08%** | | **PIQA** (逻辑) | 62.2% | 63.0% | 67.3% | **69.75%** | | **HellaSwag** (上下文) | 31.8% | 29.5% | 42.0% | **46.71%** | # 🧠 架构与超参数 | 超参数 | 值 | |:-|:-| | 架构 | Llama (仅解码器 Transformer) | | 参数数量 | ~50M | | 词表大小 | 32,000 | | 隐藏层大小 | 512 | | 中间层大小 | 1,408 | | 隐藏层数 | 12 | | 注意力头数 | 8 | | 键值头数 | 4 (GQA) | | 最大位置嵌入 | 1,024 | | RoPE theta | 10,000 | | 绑定嵌入 | 是 | # 📚 训练数据 | 属性 | 值 | |:-|:-| | 数据集 | HuggingFaceFW/fineweb-edu (`sample-100BT`) | | 总 token 数 | 20B | | 序列长度 | 1,024 tokens | | 存储格式 | 内存映射二进制 (`uint16`, ~40 GB) | # 🔤 分词器 自定义 **Byte-Level BPE** 分词器,从头训练,基于从 `fineweb-edu (sample-10BT)` 中采样的 500,000 个文档。 | 属性 | 值 | |:-|:-| | 类型 | ByteLevelBPETokenizer | | 词表大小 | 32,000 | | 最小频率 | 2 | | 特殊 token | `<s>`, `<pad>`, `</s>`, `<unk>`, `<mask>` | # ⚙️ 训练配置 | 参数 | 值 | |:-|:-| | 轮次 | 1 | | 每设备批次大小 | 32 | | 梯度累积步数 | 4 | | 有效批次大小 | 128 × 1,024 tokens | | 学习率 | 6e-4 | | 学习率调度器 | 余弦退火 | | 预热比例 | 2% | | 优化器 | AdamW Fused (β1=0.9, β2=0.95) | | 权重衰减 | 0.1 | | 最大梯度范数 | 1.0 | | 精度 | bfloat16 | | torch.compile | 启用 | | 硬件 | 单 GPU | | 最终损失 | 3.259 | # 🚀 推理 — 指令版 import os, warnings os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" warnings.filterwarnings("ignore", category=UserWarning, module="transformers") import torch from transformers import pipeline, AutoTokenizer, logging logging.set_verbosity_error() MODEL_ID = "SupraLabs/Supra-50M-Instruct" tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, clean_up_tokenization_spaces=False) pipe = pipeline( "text-generation", model=MODEL_ID, tokenizer=tokenizer, device_map="auto", torch_dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32 ) def build_prompt(instruction, input_text=""): if input_text.strip(): return ( "Below is an instruction that describes a task, paired with an input " "that provides further context. Write a response that appropriately " "completes the request.\n\n" f"### Instruction:\n{instruction}\n\n" f"### Input:\n{input_text}\n\n### Response:\n" ) return ( "Below is an instruction that describes a task. Write a response that " "appropriately completes the request.\n\n" f"### Instruction:\n{instruction}\n\n### Response:\n" ) def generate(instruction, input_text=""): result = pipe( build_prompt(instruction, input_text), max_new_tokens=512, do_sample=True, temperature=0.7, top_k=50, top_p=0.9, repetition_penalty=1.15, pad_token_id=pipe.tokenizer.pad_token_id, eos_token_id=pipe.tokenizer.eos_token_id, return_full_text=False ) return result[0]['generated_text'].strip() while True: print("\nEnter an instruction (or 'exit' to quit):") user_input = input().strip() if user_input.lower() == "exit": break print("\nEnter additional context (optional, press Enter to skip):") context_input = input().strip() print(f"\nResponse:\n{generate(user_input, context_input)}\n") # 基础版 from transformers import pipeline import torch pipe = pipeline( "text-generation", model="SupraLabs/Supra-50M_BASE", device_map="auto", torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32 ) def generate_text(prompt, max_new_tokens=150): result = pipe( prompt, max_new_tokens=max_new_tokens, do_sample=True, temperature=0.5, top_k=25, top_p=0.9, repetition_penalty=1.2, pad_token_id=pipe.tokenizer.pad_token_id, eos_token_id=pipe.tokenizer.eos_token_id ) return result[0]['generated_text'] prompt = "The importance of education is" print(f"Prompt: {prompt}\n" + "-" * 40) print("\nOutput:\n" + generate_text(prompt)) # 💬 示例输出 **提示:** `"The main concept of physics is "` > **提示:** `"Artificial intelligence is "` > **提示:** `"Once upon a time, "` > *这是 SupraLabs Scaling Up Plan 中的第一个模型。欢迎反馈!*
查看原文

相似文章

[新模型] Supra-Title-0.3B 刚刚发布!

Reddit r/LocalLLaMA

Supra Labs 发布了 Supra Title,这是一个参数为 350M 的专用模型,用于生成聊天对话标题。该模型基于 LFM2.5 构建,以 GGUF 格式运行在任何硬件上,且无需系统提示。

[新模型] - SupraSafety-18M · 微型内容审核模型

Reddit r/LocalLLaMA

SupraLabs 发布了 SupraSafety-18M,这是一个微型的 18M 参数 BERT 风格的内容审核模型,基于 NVIDIA 的 Nemotron-3.5 数据集训练。它达到了 81.2% 的准确率,并能在边缘设备上高效运行。

[新模型] SupraLabs 推出了 Any2Any 模型系列!

Reddit r/LocalLLaMA

SupraLabs 发布了 Supra-A2A-Nano-Exp,这是一个小型任意到任意自回归模型,将文本和图像标记化统一到单个 Transformer 中,作为教育原型而非生产就绪系统。