Exploring Next-Generation Multimodal Encoder-Decoder Small Models: Architecture and Practices

    As the AI landscape is largely dominated by decoder-only large language models, handling complex multimodal tasks, mitigating hallucinations, and improving edge inference efficiency have become significant challenges. This article explores a newly open-sourced generation of multimodal encoder-decoder small models. It delves into the architectural evolution back to the encoder-decoder paradigm, innovative weight mapping and adaptation training techniques, multimodal and long-context capabilities, and practical cloud-native deployment strategies for developers.

    In the current era of large language models dominated by decoder-only architectures, mainstream solutions are gradually revealing limitations when handling complex multimodal tasks, suppressing model hallucinations, and improving edge device inference efficiency. Recently, an international tech giant open-sourced its new generation of multimodal long-context encoder-decoder small models. This move not only marks the return and modernization of the classic Transformer Encoder-Decoder route but also provides developers with a new technical choice for building efficient AI applications in resource-constrained environments.

    1. Architectural Evolution: From Decoder-Only Back to Encoder-Decoder

    Over the past few years, with the exponential growth in model scale, the decoder-only architecture has been highly favored for its excellent scalability in large-scale unsupervised pre-training. However, in practical applications, the decoder-only architecture still has room for optimization regarding multimodal feature alignment, factual accuracy of generated content (i.e., hallucinations), and efficiency in compute-constrained scenarios like mobile devices.

    In contrast, the Encoder-Decoder architecture inherently features a “understand first, generate later” characteristic. The encoder can perform deep bidirectional feature extraction on input long texts or cross-modal information, effectively suppressing information omission caused by unidirectional attention. The decoder then focuses on autoregressive generation based on the encoded features. This architecture often achieves higher task accuracy with fewer parameters in typical Seq2Seq tasks such as machine translation, text summarization, and instruction execution. The emergence of the new generation of encoder-decoder small models addresses this pain point by combining the classic architecture with modern training techniques, rebalancing model scale and inference efficiency.

    2. Core Technology Analysis: Weight “Seed” Mapping and Adaptation Training

    Building a high-quality encoder-decoder model usually requires large-scale pre-training from scratch, which entails high compute costs. This series of models adopts an innovative “adaptation” training route: utilizing a mature decoder-only model trained on trillions of tokens as a “seed” and mapping its weights to the new encoder-decoder structure.

    The core of this technical approach includes:

    1. Knowledge Inheritance: Through weight mapping, the new model directly inherits the strong language understanding and generalization capabilities of the original decoder model, avoiding semantic loss during the cold start phase.
    2. Reduced Compute Costs: Adapting the architecture and fine-tuning based on existing pre-trained weights requires significantly fewer compute resources than pre-training from scratch, enabling small-to-medium-scale models to possess a language understanding foundation comparable to large models.
    3. Structural Reorganization: Unidirectional decoder layers are reorganized into a bidirectional encoder and an autoregressive decoder. Through fine-tuning with specific task data, the model rapidly adapts to multimodal and long-context scenarios.

    3. Deep Integration of Multimodal and Long-Context Capabilities

    In terms of practical model capabilities, the new generation of encoder-decoder small models offers various parameter scales, such as 270M-270M, 1B-1B, and 4B-4B, to meet the deployment needs of different compute tiers. Its core capabilities are reflected in the following aspects:

    1. Multimodal Understanding and Reasoning: The model can simultaneously process image and text inputs, completing Visual Question Answering (VQA) and cross-modal reasoning tasks. The encoder maps visual and text features into a unified semantic space, while the decoder generates accurate answers based on this.
    2. Ultra-Long Context Support: It supports a maximum context input of 128K tokens and covers over 140 languages. This enables the model to handle tasks such as long document summarization and complex cross-lingual instruction understanding.
    3. Extreme Edge Optimization: The architecture performs excellently in edge scenarios with limited compute, such as mobile phones. Taking a function-calling specialized model from the same family as an example, the model size can be compressed to around 135MB through advanced quantization techniques, significantly reducing memory usage on edge devices.

    4. Engineering Practice and Cloud-Native Deployment

    When developers choose such small models for business implementation, efficiently integrating them into existing systems is key. In a cloud-native environment, general infrastructure like Baidu AI Cloud can be utilized to build highly available model inference services.

    4.1 Model Deployment and Serving

    For cloud deployment, a container platform (such as CCE) can be used to manage model inference Pods. Through Kubernetes’ HPA (Horizontal Pod Autoscaler) mechanism, compute nodes can be dynamically adjusted based on the QPS of API requests.

    1. # Pseudo-code: Loading the quantized encoder-decoder small model
    2. from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
    3. model_path = "path/to/quantized_encoder_decoder_model"
    4. tokenizer = AutoTokenizer.from_pretrained(model_path)
    5. model = AutoModelForSeq2SeqLM.from_pretrained(model_path, device_map="auto")
    6. def generate_response(text_input, image_input=None):
    7. # Multimodal input preprocessing
    8. inputs = tokenizer(text_input, return_tensors="pt")
    9. # Inference generation
    10. outputs = model.generate(**inputs, max_length=512)
    11. return tokenizer.decode(outputs[0], skip_special_tokens=True)

    4.2 Data Flow and Storage

    For multimodal tasks, a large volume of image and long-text data requires reliable storage and low-latency retrieval. Developers can use Object Storage (BOS) to store raw image resources and massive text data. When an inference request arrives, the relevant attachments are pulled from the object storage via a high-speed intranet channel and handed over to the model for processing.

    4.3 Asynchronous Tasks and Monitoring

    Faced with complex inference tasks involving long contexts (128K tokens), synchronous calls may lead to request timeouts. It is recommended to introduce message queues (such as Kafka or RabbitMQ) to asynchronousize time-consuming inference tasks. After a client submits a task, the system pushes it to the queue. Worker nodes consume the queue and call the model, notifying the client via a callback upon completion. Simultaneously, full-link integration with log services and monitoring alert systems tracks GPU utilization, inference latency, and error rates in real-time to ensure service stability.

    5. Conclusion

    The emergence of the new generation of multimodal encoder-decoder small models proves that beyond the decoder-only architecture, the classic encoder-decoder route still possesses strong vitality. Through ingenious weight mapping techniques and quantization optimization, such models demonstrate high engineering value in multimodal understanding, long-context processing, and edge deployment. For developers and enterprises, combining mature cloud-native infrastructure to apply these lightweight, highly efficient models to vertical business scenarios will be an effective path to achieve cost reduction and efficiency gains in AI technology.