匿名用户2024年07月31日
66阅读

技术信息

官网地址
https://www.zhipu.ai
开源地址
https://modelscope.cn/models/ZhipuAI/MathGLM
授权协议
Apache License 2.0

作品详情

模型介绍

GPT Ca Solve Mathematical Problems Without a Calculator
Official Pytorch Implemetatio

Previous studies have typically assumed that large laguage models are uable to accurately perform arithmetic operatios, particularly multiplicatio of >8 digits, ad operatios ivolvig decimals ad fractios, without the use of calculator tools. This paper aims to challege this miscoceptio. With sufficiet traiig data, a 2 billio-parameter laguage model ca accurately perform multi-digit arithmetic operatios with almost 100% accuracy without data leakage, sigificatly surpassig GPT-4 (whose multi-digit multiplicatio accuracy is oly 4.3%). We also demostrate that our MathGLM, fietued from GLM-10B o a dataset with additioal multi-step arithmetic operatios ad math problems described i text, achieves similar performace to GPT-4 o a 5,000-samples Chiese math problem test set.

先前的研究通常假设大型语言模型在不使用计算器工具的情况下无法准确执行算术运算,特别是 >8 位数字的乘法以及涉及小数和分数的运算。 本文旨在挑战这种误解。 在足够的训练数据下,20亿参数的语言模型可以准确地进行多位算术运算,几乎100%的准确率且不会泄漏数据,大幅超越GPT-4(其多位乘法准确率仅为4.3%)。 我们还证明,我们的 MathGLM 在数据集上对 GLM-10B 进行了微调,并添加了额外的多步算术运算和文本中描述的数学问题,在 5,000 个样本的中国数学问题测试集上实现了与 GPT-4 类似的性能。

If you wat to fid the detailed itroductio, Read our paper: GPT Ca Solve Mathematical Problems Without a Calculator.

依赖

pip istall SwissArmyTrasformer==0.2.*

推理代码

method 1: use model

from modelscope import sapshot_dowload, Model, pipelie, Tasks

model_dir = sapshot_dowload('ZhipuAI/MathGLM', revisio='v1.0.0')
model = Model.from_pretraied(model_dir)
query = '鸡和兔在一个笼子里,共有35个头,94只脚,那么鸡有多少只?'
respose = model(query)
prit(respose)

"""Out
x=35-((94-35*2)/(4-2))=35-((94-70)/(4-2))=35-(24/(4-2))=35-(24/2)=35-12=23
"""

method 2: use pipelie

from modelscope import sapshot_dowload, Model, pipelie, Tasks

model_dir = sapshot_dowload('ZhipuAI/MathGLM', revisio='v1.0.0')
pipe = pipelie(task=Tasks.text_geeratio, model=model_dir)
query = '10*9*8=?'
respose = pipe(query)
prit(respose)

"""Out
x=10*9*8=90*8=720
"""

Citatio

@article{yag2023gpt,
  title={GPT Ca Solve Mathematical Problems Without a Calculator},
  author={Yag, Zhe ad Dig, Mig ad Lv, Qigsog ad Jiag, Zhihua ad He, Zehai ad Guo, Yuyi ad Bai, Jifeg ad Tag, Jie},
  joural={arXiv preprit arXiv:2309.03241},
  year={2023}
}

功能介绍

模型介绍 GPT Can Solve Mathematical Problems Without a Calculator Official Pytorch Implementation Prev

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论