search
HomeTechnology peripheralsAIModularly reconstruct LLaVA. To replace components, just add 1-2 files. The open source TinyLLaVA Factory is here.

The TinyLLaVA+ project is jointly created by Professor Wu Ji’s team from the Multimedia Signal and Intelligent Information Processing Laboratory (MSIIP) of the Department of Electronics of Tsinghua University and Professor Huang Lei’s team from the School of Artificial Intelligence of Beihang University. The MSIIP Laboratory of Tsinghua University has long been committed to research fields such as intelligent medical care, natural language processing and knowledge discovery, and multi-modality. The Beijing Airlines team has long been committed to research fields such as deep learning, multi-modality, and computer vision. The goal of the TinyLLaVA+ project is to develop a small cross-language intelligent assistant with multi-modal capabilities such as language understanding, question and answer, and dialogue. The project team will give full play to their respective advantages, jointly overcome technical problems, and realize the design and development of intelligent assistants. This will bring new breakthroughs in research fields such as intelligent medical care, natural language processing and knowledge discovery, and multimodality. At the same time, Tsinghua University’s MSIIP laboratory has long been committed to intelligence.

Recently, Tsinghua University and Beihang University jointly launched TinyLLaVA Factory, a multi-model software that supports customization, training, and evaluation. The code base of the dynamic large model, the code and models are all open source. This code base uses the factory model of software engineering as the design concept, modularly reconstructs the LLaVA code base, focusing on the readability of the code, the scalability of functions, and the reproducibility of experimental results. It makes it easier for researchers and practitioners to explore the training and design space of multi-modal large models.

模块化重构LLaVA,替换组件只需添加1-2个文件,开源TinyLLaVA Factory来了

  • ##Github project: https://github.com/TinyLLaVA/TinyLLaVA_Factory
  • Paper address: https://arxiv.org/abs/2405.11788
  • ##Hugging Face model address: https:// huggingface.co/tinyllava/TinyLLaVA-Phi-2-SigLIP-3.1B or https://huggingface.co/bczhou/TinyLLaVA-3.1B-SigLIP
  • 心心SOTA model address: https://sota.jiqizhixin.com/project/tinyllava
LLaVA is a high-quality open source project of the multi-modal community , favored by researchers and developers. Beginners who are new to multi-modal large models are also accustomed to using the LLaVA project as a starting point to learn and train multi-modal large models. However, the code of the LLaVA project is relatively obscure and difficult to understand. Once errors are accidentally changed, the training effect may be affected. For novices, they often dare not easily modify the details, which hinders understanding and exploring the essential details of multi-modal large models. encountered certain difficulties.

Recently, Tsinghua University and Beihang University jointly launched TinyLLaVA Factory, which modularizes and reconstructs the original LLaVA code, focusing on simple code implementation, scalability of new functions, and training results The reproducibility allows you to customize and train your own multi-modal large model with the smallest amount of code, while reducing the code error rate! Under the same model configuration, training data and training strategy, using TinyLLaVA Factory can train a model with slightly better performance than using LLaVA code. In order to make it easier for users to understand the code and use the model, the TinyLLaVA Factory project is also equipped with code documentation and a Demo website. Its overall architecture is shown in the figure below: [Architecture Diagram].

模块化重构LLaVA,替换组件只需添加1-2个文件,开源TinyLLaVA Factory来了

In the data preprocessing part, TinyLLaVA Factory abandons the brain-burning image processing and prompt processing processes in the LLaVA code, and provides a standard and reliable Extended image and text preprocessing for clarity. Among them, image preprocessing can be customized with a Processor, or you can use the Processor of some official visual encoders, such as the Image Processor that comes with CLIP ViT and SigCLIP ViT. For text preprocessing, the base class Template is defined, providing basic and common functions, such as adding System Message (Prompt), Tokenize, and generating tags Ground Truth. Users can easily extend to different LLMs by inheriting the base class. Chat Template.

模块化重构LLaVA,替换组件只需添加1-2个文件,开源TinyLLaVA Factory来了

In the model part, TinyLLaVA Factory naturally modularizes the large multi-modal model into three components - the large language model component, the visual encoder component, and the intermediate connector component. Each component is controlled by a factory object, which is responsible for the registration and replacement of new models. Users can more easily replace any one of the components without involving other parts.

模块化重构LLaVA,替换组件只需添加1-2个文件,开源TinyLLaVA Factory来了

TinyLLaVA Factory provides the current mainstream models for each component, as shown in the table below.

模块化重构LLaVA,替换组件只需添加1-2个文件,开源TinyLLaVA Factory来了

The trainer is still modeled after LLaVA, using the Trainer that comes with Hugging Face, integrating Gradient Accumulation, Wandb logging and other features, and also supports DeepSpeed ZeRO2/ZeRO3 parallel training. For the evaluation part, TinyLLaVA Factory provides evaluation of 8 Benchmarks of SQA/GQA/TextVQA/VQAv2/POPE/MME/MM-Vet/MMMU.

Next, highlight the key points! The TinyLLaVA Factory Github project also teaches you how to customize your own multi-modal large model. LLM components, vision encoder components, connector components can be easily replaced by simply adding 1-2 files.

Take the replacement LLM model as an example. According to feedback from students who have used the LLaVA code base, LLaVA code is prone to errors when trying to replace non-Llama series language models. TinyLLaVA Factory can easily replace the language model by adding 2 py files, one is the Chat Template file and the other is the model file. When replacing the visual encoder, you only need to add 1 py file and inherit the base class of the visual encoder.

模块化重构LLaVA,替换组件只需添加1-2个文件,开源TinyLLaVA Factory来了

TinyLLaVA Factory also supports customization of training strategies. Users only need to modify the configuration file to pretrain and The finetuning stage implements any combination of freezing/full fine-tuning/partial fine-tuning/lora fine-tuning for the three module components (LLM/visual encoder/connector). It’s an easy-to-use tutorial for beginners!

模块化重构LLaVA,替换组件只需添加1-2个文件,开源TinyLLaVA Factory来了

As early as February this year, the TinyLLaVA project keenly captured the potential of LLM below 3B in multi-modal large models, taking advantage of the mainstream in the market The small-scale LLM trained a series of multi-modal large models with parameter sizes ranging from 0.89B to 3.1B. Experimental results show that through high-quality data selection and more detailed training strategies, small-scale LLM can also achieve similar or even superior task performance to large models. (See technical report https://arxiv.org/abs/2402.14289 for details)

The above is the detailed content of Modularly reconstruct LLaVA. To replace components, just add 1-2 files. The open source TinyLLaVA Factory is here.. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is Graph of Thought in Prompt EngineeringWhat is Graph of Thought in Prompt EngineeringApr 13, 2025 am 11:53 AM

Introduction In prompt engineering, “Graph of Thought” refers to a novel approach that uses graph theory to structure and guide AI’s reasoning process. Unlike traditional methods, which often involve linear s

Optimize Your Organisation's Email Marketing with GenAI AgentsOptimize Your Organisation's Email Marketing with GenAI AgentsApr 13, 2025 am 11:44 AM

Introduction Congratulations! You run a successful business. Through your web pages, social media campaigns, webinars, conferences, free resources, and other sources, you collect 5000 email IDs daily. The next obvious step is

Real-Time App Performance Monitoring with Apache PinotReal-Time App Performance Monitoring with Apache PinotApr 13, 2025 am 11:40 AM

Introduction In today’s fast-paced software development environment, ensuring optimal application performance is crucial. Monitoring real-time metrics such as response times, error rates, and resource utilization can help main

ChatGPT Hits 1 Billion Users? 'Doubled In Just Weeks' Says OpenAI CEOChatGPT Hits 1 Billion Users? 'Doubled In Just Weeks' Says OpenAI CEOApr 13, 2025 am 11:23 AM

“How many users do you have?” he prodded. “I think the last time we said was 500 million weekly actives, and it is growing very rapidly,” replied Altman. “You told me that it like doubled in just a few weeks,” Anderson continued. “I said that priv

Pixtral-12B: Mistral AI's First Multimodal Model - Analytics VidhyaPixtral-12B: Mistral AI's First Multimodal Model - Analytics VidhyaApr 13, 2025 am 11:20 AM

Introduction Mistral has released its very first multimodal model, namely the Pixtral-12B-2409. This model is built upon Mistral’s 12 Billion parameter, Nemo 12B. What sets this model apart? It can now take both images and tex

Agentic Frameworks for Generative AI Applications - Analytics VidhyaAgentic Frameworks for Generative AI Applications - Analytics VidhyaApr 13, 2025 am 11:13 AM

Imagine having an AI-powered assistant that not only responds to your queries but also autonomously gathers information, executes tasks, and even handles multiple types of data—text, images, and code. Sounds futuristic? In this a

Applications of Generative AI in the Financial SectorApplications of Generative AI in the Financial SectorApr 13, 2025 am 11:12 AM

Introduction The finance industry is the cornerstone of any country’s development, as it drives economic growth by facilitating efficient transactions and credit availability. The ease with which transactions occur and credit

Guide to Online Learning and Passive-Aggressive AlgorithmsGuide to Online Learning and Passive-Aggressive AlgorithmsApr 13, 2025 am 11:09 AM

Introduction Data is being generated at an unprecedented rate from sources such as social media, financial transactions, and e-commerce platforms. Handling this continuous stream of information is a challenge, but it offers an

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment