链载Ai

标题: 事实证明千问qwen3小模型才是企业的生产力,他究竟能做什么呢? [打印本页]

作者: 链载Ai    时间: 昨天 20:56
标题: 事实证明千问qwen3小模型才是企业的生产力,他究竟能做什么呢?

4月底,阿里发布了qwen3系列模型,在全球互联网激起热烈的讨论,又一次证明阿里在开源模型届的号召力。

这次qwen3发布了6个不同体量参数开源模型

0.6b、1.7b、4b、8b、14b、32b、30bA14b、235bA22b

其中小体积模型特别引人注目,0.6b参数qwen3只有DeepSeek R1模型的千分之一的体积。

如此小的体积,让很多人对其充满期待,同时也带着疑问。

反正体积特别小,部署和测试成本很低,Make hands dirty 上手试试。

本文内容:



Qwen3小模型为什么是生产力


我们先看看,用户总结的qwen小模型的突出优点。

对于这种功能全面的小模型,在恰当使用的场景下,也能发挥巨大的作用;



本地部署和使用


我推荐使用Ollama的方式在PC或Mac进行本地部署。

先安装Ollama,进入官网

https://ollama.com/

下载适合你电脑的版本,安装完成后,下载对应的Qwen3模型

ollama run qwen3 # 模型下载qwen3:8b参数模型
ollama run qwen3:0.6b # 0.6b参数模型

运行以上命令后,有以下几种方式进行使用模型的问答

具体细节在这篇文章中不展开。

经过部署后我们具体看看都在小模型大用途的场景,以下主要针对0.6b和8b两个版本的qwen3模型进行实测;



总结文档内容


qwen3系列的小模型在总结文档上完成的比较出色

很多人担心小LLM模型在总结文档上无法精准达到效果,或者,出现严重的幻觉。

对此,GitHub上有机构针对市场上出现的上百款开源和私有模型进行测试对比。

我总结了和qwen小模型相关的对比,如下图所示,你会发现,8b模型的精准度要优于DeepSeek-R1

实测MCP+总结文本情况


对于简单的文本总结,相信两个参数的模型都没有问题,由于我们总结文档很有可能是需要总结网页的内容,经过对比,发现:




零样本或少量样本分类


样本分类的任务,我openai工程师分享的gpt分类测试

https://cookbook.openai.com/examples/leveraging_model_distillation_to_fine-tune_a_model

文章中提到的任务:根据红酒的描述文字,推断品种,

测试的效果:两个模型的差异

考虑到成本情况,8b模型相当于有竞争力。

当然,对0.6b进行微调/蒸馏,或许可以显著提升准确率,这个可以留在下一篇文章中进行测试。

以下是测试代码,大家可以自己运行:

记得先从kaggle上下载数据 https://www.kaggle.com/datasets/zynicide/wine-reviews

fromollamaimportchatimportpandasaspdimportnumpyasnpfromtqdmimporttqdmfrompydanticimportBaseModel,Fielddf=pd.read_csv('wine-reviews/winemag-data-130k-v2.csv')df_country=df[df['country']=='Italy']#只取部分数据进行测试varieties_less_than_five_list=(df_country["variety"].value_counts()[df_country["variety"].value_counts()<5].index.tolist())df_country=df_country[~df_country['variety'].isin(varieties_less_than_five_list)]df_country_subset=df_country.sample(n=500)classWineVariety(BaseModel):variety:str=Field(enum=varieties.tolist())defgenerate_prompt(row,varieties):#Formatthevarietieslistasacomma-separatedstringvariety_list=",".join(varieties)prompt=f"""基于此酒评,猜测可能的葡萄品种:这款酒由{row['winery']}在{row['province']}的{row['country']}城市酿造。产自{row['region_1']},描述为"{row['description']}"。由{row['taster_name']}评价,获得{row['points']}分。这里列出的可能选择的葡萄品种为:{variety_list}。请猜测最可能的葡萄品种?只需回答品种名称或列表中的品种名称。"""returnpromptdefcall_model(model,prompt):response=chat(model=model,messages=[{'role':'system','content':system_prompt},{'role':'user','content':prompt}],format=WineVariety.model_json_schema(),)vine_variety=WineVariety.model_validate_json(response.message.content)returnvine_variety.varietydefprocess_example(index,row,model,df,progress_bar):globalprogress_indextry:#Generatethepromptusingtherowprompt=generate_prompt(row,varieties)df.at[index,model+"-variety"]=call_model(model,prompt)#Updatetheprogressbarprogress_bar.update(1)progress_index+=1exceptExceptionase:print(f"Errorprocessingmodel{model}:{str(e)}")defprocess_dataframe(df,model):globalprogress_indexprogress_index=1#Resetprogressindex#Createatqdmprogressbarwithtqdm(total=len(df),desc="rocessingrows")asprogress_bar:#Processeachexamplesequentiallyforindex,rowindf.iterrows():try:process_example(index,row,model,df,progress_bar)exceptExceptionase:print(f"Errorprocessingexample:{str(e)}")returndfdf_country_subset=process_dataframe(df_country_subset,'qwen3:0.6b')df_country_subset=process_dataframe(df_country_subset,'qwen3')formodelinmodels:print(f'{model}准确度:{get_accuracy(model,df_country_subset)*100:.2f}%')




翻译


哪吒2中的“急急如律令”如何翻译,引起了一番讨论,我们看看两个小模型如何翻译的

可以看出,两者翻译都不会出错,但是8b模型在知识量上强很多,所以翻译上考虑的内容会更多

小语种翻译

qwen3支持129种语言,我在工作中正好遇到了小语种音乐歌词的问题,用来测试下

Aylonayin

Yuragimdagi cho'g-cho'g,

Tunlari uyqum yo'q-yo'q,

Bedorman-ey, hey bejonman-ey.

Sening bir bo'ying yo'q-yo'q,

Qilasan doim do'q-do'q,

Sezmaysan-ey, hey bilmaysan-ey.

Yuragimda atalgan muhabbat,

Faqat senga, faqat senga.

Naqorat:

Aylonayin, ho aylonayin,

Belingga belbog' bo'lib boylanoyin.

Aylonayin, ho aylonayin,

Yurgan yo'llaringdan-ey aylonayin.

Senga aytar so'zim bor-bor,

Mehringga yurak zor-zor,

Qiynaysan-ey, hech bilmaysan-ey.

Beparvo bo'lma yor-yor,

Sensiz bu dunyo tor-tor,

Ko'rmaysan-ey, hech sezmaysan-ey.

Yuragimda atalgan muhabbat,

Faqat senga, faqat senga.

Naqorat:

Aylonayin, ho aylonayin,

Belingga belbog' bo'lib boylanoyin.

Aylonayin, ho aylonayin,

我也不知道这是什么语种的歌词,看看0.6b和8b的翻译表现:

明显看出,在稍微专业一点的小语种领域:




总结

建议在企业项目中,如果对响应速度有要求的AI场景(或分类、文本提取等场景),先快速的用qwen3-0.6b模型快速测试。

后续我还会根据其他的实际场景,进行小模型的测试。

#Qwen3#小模型#mcp#AI翻译#AI总结#AI幻觉#LLM本地部署







欢迎光临 链载Ai (https://www.lianzai.com/) Powered by Discuz! X3.5