SuperAPI AI Directory

Qwen

Pretrained large language model proposed by Alibaba Cloud.

Open website

About this tool

Qwen (Tongyi Qianwen) is a series of pretrained large language models proposed by Alibaba Cloud, and its official repository is QwenLM/Qwen. This repository is no longer actively maintained because the codebase has significant differences, and it is recommended to follow QwenLM/Qwen2.

Purpose: The Qwen series includes base language models and chat models, which can be used for tasks such as chatting, content creation, information extraction, summarization, translation, code writing, and mathematical problem solving, and supports tool use, agent roles, and a code interpreter.

Main capabilities: The base models are stably pretrained on up to 3 trillion tokens of multilingual data, covering a wide range of domains and languages (with a focus on Chinese and English), and are competitive on benchmark datasets. The chat models are aligned with human preferences based on SFT and RLHF (not yet released). The models outperform baseline models of the same size on benchmarks such as MMLU, C-Eval, GSM8K, MATH, HumanEval, MBPP, and BBH; Qwen-72B outperforms LLaMA2-70B on all tasks and surpasses GPT-3.5 on 7 out of 10 tasks.

Usage: The repository provides a quick start guide and supports inference with ModelScope and Transformers. The environment requires Python 3.8 or above, PyTorch 1.12 or above (2.0 or above recommended), transformers 4.32 or above, and CUDA 11.4 or above (recommended). Prebuilt Docker images can be used to skip environment setup. Batch inference is supported, and enabling flash attention can speed it up by 40%. For CPU deployment, qwen.cpp is recommended. For multiple GPUs, the default loading method or vLLM and FastChat can be used. For API access, the Alibaba Cloud DashScope service can be used (including qwen-turbo and qwen-plus), and scripts are also provided to deploy an OpenAI-style API. Quantized models include Int4 and Int8, are based on AutoGPTQ, and support KV cache quantization. Fine-tuning supports full parameters, LoRA, and Q-LoRA, and provides the training script finetune.py and shell scripts, with support for DeepSpeed and FSDP.

Applicable scenarios: Suitable for natural language understanding, mathematical problem solving, code generation, multilingual translation, content creation, information extraction, summarization, tool use, agents, code interpreter, and more.

Limitations: The repository is no longer actively maintained; RLHF has not yet been released; KV cache quantization and flash attention cannot be used at the same time; the installation of quantized models depends on specific torch and CUDA versions; the model behind DashScope is an internal version, and no details are currently available.