ERNIE 4.5 is an open-source family of large models developed by Baidu based on the PaddlePaddle framework, covering a wide range of models from 0.3B to 424B parameters, supporting text processing, image generation, and multimodal tasks. The project is hosted on GitHub, with Hugging Face providing model downloads and community support, and AIStudio providing developers with an online training and deployment platform. ERNIE 4.5 uses the Mixed-Mode Expert (MoE) architecture, which is optimized for computational efficiency and is suitable for a wide range of scenarios, from mobile devices to high-performance servers. ERNIE 4.5 is optimized for computational efficiency for a wide range of scenarios, from mobile devices to high-performance servers, and outperforms similar models in tasks such as mathematical reasoning, instruction following, and world knowledge memory. paddlePaddle provides the ERNIEKit toolkit, which supports training, compression, and deployment of the model, lowering the barrier to development.
Function List
- Supports multimodal tasks and handles mixed text, image and visual-verbal input.
- Multiple models are available with parameters ranging from 0.3B to 424B to accommodate different hardware.
- Integrated ERNIEKit toolkit to support model training, fine-tuning and compression.
- Provides FastDeploy tools to optimize large model inference and deployment.
- Support 8K long sequence training, suitable for complex task processing.
- Compatible with Hugging Face model downloads to simplify model acquisition.
- An online development environment is available through AIStudio to support rapid experimentation and deployment.
Using Help
Installation and environment configuration
To use ERNIE 4.5 models, you first need to install the PaddlePaddle framework and the ERNIEKit toolkit. The following are the detailed installation steps:
- Installing PaddlePaddle
Select the GPU or CPU version according to your hardware environment. Run the following command to install:# GPU 版本 pip install --upgrade paddlepaddle-gpu # CPU 版本 pip install --upgrade paddlepaddle
Python 3.8 or later is recommended, and make sure you have the latest version of pip installed on your system.
- Installation of ERNIEKit
Clone the ERNIE repository from GitHub and install ERNIEKit:git clone https://github.com/PaddlePaddle/ERNIE.git cd ERNIE pip install -r requirements.txt
ERNIEKit provides model training and compression, and can be used directly with pre-configured scripts after installation.
- Download model
ERNIE 4.5 models can be downloaded from Hugging Face. The 0.3B model is used as an example:huggingface-cli download baidu/ERNIE-4.5-0.3B-Paddle --local-dir baidu/ERNIE-4.5-0.3B-Paddle
After downloading, the model files will be stored in a specified directory for local training or inference.
- Configure the AIStudio environment (optional)
interviews AIStudioAIStudio provides cloud computing power with PaddlePaddle pre-installed for rapid testing and deployment.
Main function operation flow
1. Model training
ERNIE 4.5 supports supervised fine-tuning (SFT) for very long sequences (8K). Take the 0.3B model as an example and run the following command:
erniekit train examples/configs/ERNIE-4.5-0.3B/sft/run_sft_8k.yaml
configuration file run_sft_8k.yaml
Contains model parameters and training settings, and is located in the GitHub repository at examples/configs
Catalog. Users can modify the learning rate, batch size and other parameters as needed. Training requires a GPU with at least 16GB of video memory, NVIDIA A100 or higher is recommended.
2. Multimodal tasking
ERNIE 4.5 supports mixed text and image input, which is suitable for generating graphic content. For example, use the ERNIE-ViLG module for text-to-image generation:
import paddlehub as hub
module = hub.Module(name="ernie_vilg")
results = module.generate_image(text_prompt=["一片宁静的湖泊"], style="landscape")
Users need to install PaddleHub first:
pip install --upgrade paddlehub
The generated result will be saved as an image file, which is suitable for advertising creativity, art design and other scenarios.
3. Model inference and deployment
The FastDeploy tool optimizes model inference performance and supports 4-bit/2-bit quantization. Run the following command to deploy the model:
fastdeploy --model baidu/ERNIE-4.5-0.3B-Paddle --device gpu --quantize q4
Once deployed, the model can run on low-resource devices such as a Raspberry Pi, suitable for edge computing scenarios.
4. Online development with AIStudio
On the AIStudio platform, developers can directly load ERNIE 4.5 models, upload datasets and run training tasks. The platform provides a visual interface to simplify hyperparameter tuning and model evaluation. Users can follow the steps below:
- Log in to AIStudio and create a new project.
- Select the ERNIE 4.5 model and import the dataset.
- Run a training or inference task using a preconfigured template to view real-time logs and results.
Featured Functions
- Mixed Expertise (MoE) Architecture: The MoE models of ERNIE 4.5 (e.g., 300B-A47B) improve multimodal task performance through a combination of parameter sharing and specialized parameters. Compared to traditional dense models, the MoE architecture reduces computational cost by activating only some of the parameters during inference.
- Long Sequence Support: 8K sequence length supports complex document processing and multi-round conversations, suitable for tasks such as legal document analysis and long story generation.
- Efficient deployment: FastDeploy provides multi-expert parallel collaboration and quantization techniques to ensure models run efficiently on low-end hardware. For example, a 0.3B model can run on a Raspberry Pi with 16GB of RAM.
caveat
- Ensure that the hardware meets the minimum requirements (see the documentation on the GitHub repository for details).
- Check Hugging Face and GitHub regularly for updates on the latest models and tools.
- AIStudio offers free arithmetic, but high-load tasks may require a paid upgrade.
application scenario
- academic research
Researchers can use ERNIE 4.5 to process academic papers, generate abstracts or answer specialized questions. The model supports long sequential inputs and can analyze complex documents to enhance research efficiency. - content creation
Content creators can utilize the multimodal feature to generate advertising material or social media content that combines graphics and text. For example, enter a text description to generate an image that matches a brand's style. - Edge device deployment
Developers can deploy the 0.3B model on mobile or IoT devices to enable offline voice assistant or text processing capabilities for network-less environments. - Enterprise Applications
Enterprises can quickly build customized AI solutions, such as customer service chatbots or data analytics tools, with AIStudio, reducing development costs.
QA
- What hardware does ERNIE 4.5 support?
ERNIE 4.5 offers a wide range of model sizes, with 0.3B models running on low-end devices such as the Raspberry Pi, and large models (e.g., 424B) requiring high-performance GPUs (e.g., NVIDIA A100). - How do I get the latest models?
Download the latest models via Hugging Face, or load pre-trained models directly from the AIStudio platform. Regularly check the GitHub repository for update logs. - Is AIStudio free?
AIStudio provides free basic arithmetic for small-scale experiments. High-performance tasks require the purchase of additional arithmetic, for prices see AIStudio Official WebsiteThe - How does ERNIE 4.5 compare to other models?
ERNIE 4.5 excels on multimodal tasks and mathematical reasoning, outperforming DeepSeek and Qwen3 in some benchmarks.The MoE architecture improves efficiency for diverse scenarios.