当前位置: 首页 > news >正文

快手开源 Kwaipilot-AutoThink 思考模型,有效解决过度思考问题

在这里插入图片描述

新闻

  • 在专为防止数据泄露设计的挑战性基准测试LiveCodeBench Pro中,Kwaipilot-AutoThink位列所有开源模型榜首,甚至超越了Seed和o3-mini等强大的专有系统。

介绍

KAT(Kwaipilot-AutoThink) 是一个开源大语言模型,通过学习何时生成显式思维
链及何时直接作答,有效缓解过度思考问题。

在这里插入图片描述
它的发展遵循简洁的两阶段训练流程:

阶段核心思想关键技术成果
1. 预训练阶段在分离"推理"与"直接回答"的同时注入知识双机制数据
• 通过定制标签系统标注的非思考型查询
• 由多智能体求解器生成的思考型查询

知识蒸馏 + 多标记预测实现细粒度效用
基础模型在不承担完整预训练成本的情况下,获得强大的事实掌握和推理能力
2. 后训练阶段使推理过程可选项且高效冷启动自动思考 —— 多数表决设定初始思考模式
分步SRPO —— 中间监督机制奖励正确的模式选择及该模式下的答案准确性
模型仅在有益时触发思维链,减少标记使用并加速推理

在这里插入图片描述

数据格式

KAT生成的响应采用结构化模板,使推理路径清晰且机器可解析。
支持两种模式:

在这里插入图片描述

特殊标记

标记描述
<judge>分析输入内容以判断是否需要显式推理。
<think_on> / <think_off>表示推理功能是否启用(“on”)或跳过(“off”)。
<think>当选择think_on时,标记思维链片段的开始。
<answer>标记最终面向用户答案的开始。

🔧 Quick Start

from transformers import AutoTokenizer, AutoModelForCausalLMmodel_name = "Kwaipilot/KAT-V1-40B"# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name,torch_dtype="auto",device_map="auto"
)# prepare the model input
prompt = "Give me a short introduction to large language model."
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)# conduct text completion
generated_ids = model.generate(**model_inputs,max_new_tokens=65536,temperature=0.6,top_p=0.95,
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist() 
content = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
print("prompt:\n", prompt)
print("content:\n", content)
"""
prompt:
Give me a short introduction to large language model.
content:
<judge>
The user's request is to provide a concise factual introduction to large language models, which involves retrieving and summarizing basic information. This task is straightforward as it only requires recalling and presenting well-known details without deeper analysis. No complex reasoning is needed here—just a simple explanation will suffice.
</judge><think_off>
<answer>
A **Large Language Model (LLM)** is an advanced AI system trained on vast amounts of text data to understand, generate, and process human-like language. Here’s a concise introduction:### Key Points:
1. **Training**: Trained on diverse text sources (books, websites, etc.) using deep learning.
2. **Capabilities**: - Answer questions, generate text, summarize content, translate languages.- Understand context, sentiment, and nuances in language.
3. **Architecture**: Often based on **transformer models** (e.g., BERT, GPT, LLaMA).
4. **Scale**: Billions of parameters, requiring massive computational resources.
5. **Applications**: Chatbots, content creation, coding assistance, research, and more.### Examples:
- **OpenAI’s GPT-4**: Powers ChatGPT.
- **Google’s Gemini**: Used in Bard.
- **Meta’s LLaMA**: Open-source alternative.### Challenges:
- **Bias**: Can reflect biases in training data.
- **Accuracy**: May hallucinate "facts" not grounded in reality.
- **Ethics**: Raises concerns about misinformation and job displacement.LLMs represent a leap forward in natural language processing, enabling machines to interact with humans in increasingly sophisticated ways. 🌐🤖
</answer>
"""
http://www.dtcms.com/a/292365.html

相关文章:

  • Cy3-COOH 花菁染料Cy3-羧基
  • linux-日志服务
  • Gitlab-CI实现组件自动推送
  • 常用 Flutter 命令大全:从开发到发布全流程总结
  • 检索增强型生成助力无人机精准数学推理!RAG-UAV:基于RAG的复杂算术推理方法
  • Lua语言
  • MybatisPlus-16.扩展功能-枚举处理器
  • ORACLE DATABASE 11.2.0.4 RAC Install
  • Vue-22-通过flask接口提供的数据使用plotly.js绘图(一)
  • Oracle定时清理归档日志
  • RAG(检索增强生成)里的文档管理
  • 二次供水管理系统:远程监控+智能调控+故障预警解决方案
  • 用ffmpeg 进行视频的拼接
  • 【指南】网络安全领域:HW 行动(国家网络安全攻防演练)是什么?
  • 一些Avalonia与WPF内容的对应关系和不同用法
  • 单一职责原则(SRP):构建高质量软件的基石
  • Java 并发性深度解析
  • JS WebAPIs DOM节点概述
  • 网络层传输
  • 4G车载录像机的作用详解:提升行车安全与智能管理的核心技术
  • 数字签名(Digital Signature)
  • XSS内容分享
  • Windows 环境排除 Windows Defender 对指定路径或进程的影响
  • 在vscode 使用 remote-ssh
  • 【接口自动化】掌握接口自动化:核心概念讲解(理论知识)
  • 微博视觉算法面试30问全景精解
  • 8.4 Java 原生 TCP Socket 实现 HTTP 请求解析和请求分发
  • OpenCV基本的图像处理
  • 本地数据库有数据,web页面无信息显示,可能是pymysql的版本问题【pymysql连接本地数据库新旧版本的区别】
  • 【测试开发】----用例篇