Align-Anything Documentation

repository·main·Indexed 24 days ago

https://github.com/pku-alignment/align-anything

A modular framework for aligning any-to-any multi-modal large models with human values using algorithms such as SFT, DPO, and PPO. It includes a rule-based remote reward model framework for scalable experiments, tools for initializing and training multimodal models (Image+Text and Image+Text+Audio), and integration with evaluation benchmarks like MoralBench and XSafety.

Tokens
35.3K
Snippets
83
Records
163
Agent score
88%

What's inside Align-Anything

  1. Overview of JADE 3.0 Safety Alignment Dataset

    main

    JADE 3.0 is a high-quality Chinese dataset designed for the safety fine-tuning of Large Language Models (LLMs). It consists of triplets containing a "High-risk Question", a "Violating Response", and a "Safe and Useful Response". These triplets are generated based on high-risk scenarios identified by the JADE 1.0 testing platform, using LLM self-reflection and correction to ensure high quality.

    Note: The dataset contains examples of harmful and violating content for training purposes and does not represent the stance of the development team.

  2. Overview of the Evaluation Module

    main

    The align-anything evaluation module supports multimodal benchmarks across various modalities:

    • Text→Text
    • Text+Image/Video/Audio→Text
    • Text→Image/Video/Audio

    Generation Backends

    For most modalities, you can choose between the following backends based on your hardware and environment:

    • vLLM: Supported for most text and multimodal tasks.
    • DeepSpeed: Supported for specific multimodal tasks (e.g., A-OKVQA, MathVista, MMBench).
    • Accelerate: Used for diffusion-based generation tasks (Text→Image/Audio/Video).

    Local File Loading

    For Text→Image/Audio/Video tasks, where diffusion models often rely on specific frameworks, the module provides an option to load local files directly for evaluation.

  3. Overview of InterMT-Bench

    main
    InterMT-Bench is a benchmark designed to assess how Multimodal Large Language Models (MLLMs) align with human values in multi-turn, multimodal interactions. It addresses the lack of multimodal benchmarks for multi-turn settings by leveraging feedback from InterMT. The benchmark evaluates models across nine dimensions at both the turn and conversation levels using human-annotated ground truth.
  4. Overview of Align-Anything Features

    main

    Align-Anything is a highly modular framework designed to align any-to-any large models with human intentions and values. Key capabilities include:

    • Modular Framework: Easily customize code for different tasks.
    • Multi-Modal Fine-Tuning: Supports diverse modalities including image, video, and audio.
    • Alignment Methods: Supports SFT (Supervised Fine-Tuning), DPO (Direct Preference Optimization), PPO (Proximal Policy Optimization), and GRPO (Group Relative Policy Optimization).
    • Multi-Modal CLI: Command-line interface for image, audio, and video modalities.
    • O1-like Training: Supports reasoning-based training (e.g., using DollyTails datasets).
    • Rule-based RL: Reinforcement Learning encouraged by Deepseek-R1 patterns.
    • Hardware Support: Optimized for Nvidia GPUs and Huawei Ascend NPUs.
  5. Overview of JADE-Database

    main

    JADE (Linguistics-based Safety Evaluation Platform) provides targeted safety evaluation datasets for Large Language Models (LLMs). The platform uses linguistic mutation to transform low-trigger seed questions into high-risk questions, covering four major categories: Core Values, Illegal Activities/Crimes, Rights Infringement, and Discrimination/Bias.

    Note: The datasets contain examples of harmful and violating content. Due to regulations, politically sensitive test questions are not included in the public downloadable sets; users requiring such evaluations should contact mi_zhang@fudan.edu.cn.

  6. Overview of Chameleon Plus Fine-Tuning Pipeline

    main

    The Chameleon Plus Fine-Tuning Pipeline describes the process of enhancing the Chameleon-7B model for improved text-image interleaved input and output tasks.

    Key stages include:

    1. Base Model Training: Training the original Chameleon-7B model using a 4.6k subset from the laion-art dataset to create AA-Chameleon-7B-Base, which possesses image generation capabilities.
    2. Plus Model Training: Using the Align-Anything framework and specialized text-image interleaved datasets to train AA-Chameleon-7B-Plus, which significantly improves performance on interleaved I/O tasks.
  7. Overview of Eval-anything

    main

    Eval-anything is a framework designed to track the performance and safety of any-to-any modality large models.

    Key features include:

    • Safety Assessment: Uses self-developed datasets and over 50 integrated open-source datasets across five core dimensions (35 sub-dimensions).
    • Embodied Safety Evaluation: Evaluates text, image, video, speech, and action modalities, covering categories like corner cases, blind spots, and dangerous equipment. It focuses on execution safety, long-range trajectory safety, and hardware safety.
    • Platform Integration: Integrates with FlagEval for enhanced assessment.
  8. Overview of the Align-Anything Framework

    main

    Align-Anything is an open-source infrastructure designed to align any-to-any modality models (including LLMs and VLMs) with human values. It provides a highly modular framework for training and evaluation across diverse modalities such as image, video, and audio.

    Key capabilities include:

    • Modular Training: Supports various alignment algorithms including SFT, RM, DPO, PPO, KTO, SimPO, and ORPO.
    • Multi-Modality Support: Fine-tuning scripts for diverse models (image/video/audio).
    • Scalable Model Registration: Supports training and deploying over 25 different models.
    • Rule-based RL: Implementation of rule-based reinforcement learning inspired by Deepseek-R1.
  9. Overview of XSafety Multilingual Safety Benchmark

    main
    XSafety is a multilingual safety benchmark designed for Large Language Models (LLMs). It covers 14 types of common safety issues across 10 different languages spanning various language families. The benchmark is intended to evaluate the multilingual safety performance of both close-API and open-source models, specifically addressing the observation that LLMs often produce more unsafe responses for non-English queries compared to English ones.
  10. Train and Optimize on Ascend 910B Accelerators

    main
    The training and inference processes in Align-Anything are optimized for Ascend 910B accelerators. The RAGEN training loop and verifiable reward modules have been ported to achieve performance comparable to NVIDIA A100 systems, supporting scalable RL training in complex multi-turn settings.
  11. Enhance Agent Reasoning with Verifiable Rewards

    main
    Align-Anything supports the integration of rule-based verifiable rewards to improve complex reasoning tasks like mathematical reasoning and code generation. Unlike probabilistic reward models, verifiable rewards use automated, rule-based checks (such as unit tests for code or answer matching for math) to provide deterministic feedback. This reduces reward hacking and improves training stability.