Step-Audio-R1 首个成功实现测试时计算扩展的音频语言模型

简介

Step-Audio-R1 是首个成功实现测试时计算扩展的音频语言模型。它彻底解决了困扰现有模型的"逆向扩展"异常现象------即性能会随着推理链延长而反常下降的问题。

我们发现这一失效的根本原因在于文本替代推理 :传统模型因基于文本初始化,依赖语言抽象(分析文字转录)而非真实的声学特性。为解决模态错配问题,我们提出了模态基础推理蒸馏(MGRD)------一种迭代训练框架,将模型的推理焦点从文本替代转向声学分析。

这一创新方法孕育的 Step-Audio-R1 具备以下突破:

  • 成为首个音频推理模型,能通过测试时计算扩展持续提升性能
  • 在综合音频基准测试中超越 Gemini 2.5 Pro,媲美 Gemini 3
  • 将长时思考从音频智能的负担转化为核心优势

模型架构

Step-Audio-R1基于我们之前的StepAudio 2架构,由三个主要组件构成:

  1. 音频编码器 :采用预训练的Qwen2音频编码器,以25Hz帧率运行,训练期间保持冻结状态。
  2. 音频适配器:简易适配器(与Step-Audio 2相同)将编码器连接到LLM,并将特征帧率降采样至12.5Hz。
  3. LLM解码器 :以Qwen2.5 32B作为核心推理组件,直接接收适配器的潜在音频特征,生成纯文本输出(先输出推理过程,再生成最终回复)。

关键创新在于我们的训练方法------模态锚定推理蒸馏(MGRD)。该方法通过迭代优化模型的思维过程,逐步强化其与底层音频特征的关联,直至形成**"原生音频思维"**。

这确保模型的推理不仅基于转录文本,而是深深植根于音频本身的声学细微差别中。

模型使用

📜 要求

  • GPU:支持CUDA的NVIDIA显卡(测试环境:4×L40S/H100/H800/H20)。
  • 操作系统:Linux。
  • Python:>= 3.10.0。

⬇️ 下载模型

首先需要下载Step-Audio-R1模型权重。

方法A · Git LFS

bash 复制代码
git lfs install
git clone https://huggingface.co/stepfun-ai/Step-Audio-R1

方法 B · Hugging Face 命令行界面

bash 复制代码
hf download stepfun-ai/Step-Audio-R1 --local-dir ./Step-Audio-R1

🚀 部署与执行

我们提供两种方式来运行模型:Docker(推荐)或编译定制化的vLLM后端。

🐳 方法一 · 使用Docker运行(推荐)

需要定制化的vLLM镜像。

  1. 拉取镜像
bash 复制代码
docker pull stepfun2025/vllm:step-audio-2-v20250909
  1. 启动服务 :

    假设模型已下载到当前目录的 Step-Audio-R1 文件夹中。

    bash 复制代码
    docker run --rm -ti --gpus all \
        -v $(pwd)/Step-Audio-R1:/Step-Audio-R1 \
        -p 9999:9999 \
        stepfun2025/vllm:step-audio-2-v20250909 \
        -- vllm serve /Step-Audio-R1 \
        --served-model-name Step-Audio-R1 \
        --port 9999 \
        --max-model-len 16384 \
        --max-num-seqs 32 \
        --tensor-parallel-size 4 \
        --chat-template '{%- macro render_content(content) -%}{%- if content is string -%}{{- content.replace("<audio_patch>\n", "<audio_patch>") -}}{%- elif content is mapping -%}{{- content['"'"'value'"'"'] if '"'"'value'"'"' in content else content['"'"'text'"'"'] -}}{%- elif content is iterable -%}{%- for item in content -%}{%- if item.type == '"'"'text'"'"' -%}{{- item['"'"'value'"'"'] if '"'"'value'"'"' in item else item['"'"'text'"'"'] -}}{%- elif item.type == '"'"'audio'"'"' -%}<audio_patch>{%- endif -%}{%- endfor -%}{%- endif -%}{%- endmacro -%}{%- if tools -%}{{- '"'"'<|BOT|>system\n'"'"' -}}{%- if messages[0]['"'"'role'"'"'] == '"'"'system'"'"' -%}{{- render_content(messages[0]['"'"'content'"'"']) + '"'"'<|EOT|>'"'"' -}}{%- endif -%}{{- '"'"'<|BOT|>tool_json_schemas\n'"'"' + tools|tojson + '"'"'<|EOT|>'"'"' -}}{%- else -%}{%- if messages[0]['"'"'role'"'"'] == '"'"'system'"'"' -%}{{- '"'"'<|BOT|>system\n'"'"' + render_content(messages[0]['"'"'content'"'"']) + '"'"'<|EOT|>'"'"' -}}{%- endif -%}{%- endif -%}{%- for message in messages -%}{%- if message["role"] == "user" -%}{{- '"'"'<|BOT|>human\n'"'"' + render_content(message["content"]) + '"'"'<|EOT|>'"'"' -}}{%- elif message["role"] == "assistant" -%}{{- '"'"'<|BOT|>assistant\n'"'"' + (render_content(message["content"]) if message["content"] else '"'"''"'"') -}}{%- set is_last_assistant = true -%}{%- for m in messages[loop.index:] -%}{%- if m["role"] == "assistant" -%}{%- set is_last_assistant = false -%}{%- endif -%}{%- endfor -%}{%- if not is_last_assistant -%}{{- '"'"'<|EOT|>'"'"' -}}{%- endif -%}{%- elif message["role"] == "function_output" -%}{%- else -%}{%- if not (loop.first and message["role"] == "system") -%}{{- '"'"'<|BOT|>'"'"' + message["role"] + '"'"'\n'"'"' + render_content(message["content"]) + '"'"'<|EOT|>'"'"' -}}{%- endif -%}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}{{- '"'"'<|BOT|>assistant\n<think>\n'"'"' -}}{%- endif -%}' \
        --enable-log-requests \
        --interleave-mm-strings \
        --trust-remote-code

服务启动后,将在 localhost:9999 上监听。

🐳 方法二 · 从源码运行(编译 vLLM)

Step-Audio-R1 需要定制化的 vLLM 后端。

  1. 下载源码

    bash 复制代码
    git clone https://github.com/stepfun-ai/vllm.git
    cd vllm
  2. 准备环境:

    bash 复制代码
    python3 -m venv .venv
    source .venv/bin/activate
  3. 安装与编译

    vLLM包含C++和Python代码。我们主要修改了Python部分,因此C++部分可直接使用预编译版本以加快流程。

    bash 复制代码
    # Use pre-compiled C++ extensions (Recommended)
    VLLM_USE_PRECOMPILED=1 pip install -e .
  4. 切换分支 :

    编译完成后,切换到支持 Step-Audio 的分支。

    bash 复制代码
    git checkout step-audio-2-mini
  5. 启动服务:

    bash 复制代码
    # Ensure you are in the vllm directory and the virtual environment is activated
    source .venv/bin/activate
    
    python3 -m vllm.entrypoints.openai.api_server \
        --model ../Step-Audio-R1 \
        --served-model-name Step-Audio-R1 \
        --port 9999 \
        --host 0.0.0.0 \
        --max-model-len 65536 \
        --max-num-seqs 128 \
        --tensor-parallel-size 4 \
        --gpu-memory-utilization 0.85 \
        --trust-remote-code \
        --enable-log-requests \
        --interleave-mm-strings \
        --chat-template '{%- macro render_content(content) -%}{%- if content is string -%}{{- content.replace("<audio_patch>\n", "<audio_patch>") -}}{%- elif content is mapping -%}{{- content['"'"'value'"'"'] if '"'"'value'"'"' in content else content['"'"'text'"'"'] -}}{%- elif content is iterable -%}{%- for item in content -%}{%- if item.type == '"'"'text'"'"' -%}{{- item['"'"'value'"'"'] if '"'"'value'"'"' in item else item['"'"'text'"'"'] -}}{%- elif item.type == '"'"'audio'"'"' -%}<audio_patch>{%- endif -%}{%- endfor -%}{%- endif -%}{%- endmacro -%}{%- if tools -%}{{- '"'"'<|BOT|>system\n'"'"' -}}{%- if messages[0]['"'"'role'"'"'] == '"'"'system'"'"' -%}{{- render_content(messages[0]['"'"'content'"'"']) + '"'"'<|EOT|>'"'"' -}}{%- endif -%}{{- '"'"'<|BOT|>tool_json_schemas\n'"'"' + tools|tojson + '"'"'<|EOT|>'"'"' -}}{%- else -%}{%- if messages[0]['"'"'role'"'"'] == '"'"'system'"'"' -%}{{- '"'"'<|BOT|>system\n'"'"' + render_content(messages[0]['"'"'content'"'"']) + '"'"'<|EOT|>'"'"' -}}{%- endif -%}{%- endif -%}{%- for message in messages -%}{%- if message["role"] == "user" -%}{{- '"'"'<|BOT|>human\n'"'"' + render_content(message["content"]) + '"'"'<|EOT|>'"'"' -}}{%- elif message["role"] == "assistant" -%}{{- '"'"'<|BOT|>assistant\n'"'"' + (render_content(message["content"]) if message["content"] else '"'"''"'"') -}}{%- set is_last_assistant = true -%}{%- for m in messages[loop.index:] -%}{%- if m["role"] == "assistant" -%}{%- set is_last_assistant = false -%}{%- endif -%}{%- endfor -%}{%- if not is_last_assistant -%}{{- '"'"'<|EOT|>'"'"' -}}{%- endif -%}{%- elif message["role"] == "function_output" -%}{%- else -%}{%- if not (loop.first and message["role"] == "system") -%}{{- '"'"'<|BOT|>'"'"' + message["role"] + '"'"'\n'"'"' + render_content(message["content"]) + '"'"'<|EOT|>'"'"' -}}{%- endif -%}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}{{- '"'"'<|BOT|>assistant\n<think>\n'"'"' -}}{%- endif -%}'

服务启动后,将监听 localhost:9999

🧪 客户端示例

获取示例代码并运行:

bash 复制代码
# Clone the repository containing example scripts
git clone https://github.com/stepfun-ai/Step-Audio-R1.git r1-scripts
cd r1-scripts

# Run the example
python examples-vllm_r1.py

引用

如果您在研究中发现我们的论文和代码有帮助,请考虑给予星标 ⭐️ 和引用 📝 😃

bash 复制代码
@article{tian2025step,
  title={Step-Audio-R1 Technical Report},
  author={Tian, Fei and Zhang, Xiangyu Tony and Zhang, Yuxin and Zhang, Haoyang and Li, Yuxin and Liu, Daijiao and Deng, Yayue and Wu, Donghang and Chen, Jun and Zhao, Liang and others},
  journal={arXiv preprint arXiv:2511.15848},
  year={2025}
}

Code

https://github.com/stepfun-ai/Step-Audio-R1

Model

https://hf-mirror.com/stepfun-ai/Step-Audio-R1

相关推荐
J_Xiong01171 分钟前
【Agents篇】07:Agent 的行动模块——工具使用与具身执行
人工智能·ai agent
SEO_juper7 分钟前
13个不容错过的SEO技巧,让您的网站可见度飙升
人工智能·seo·数字营销
小瑞瑞acd9 分钟前
【小瑞瑞精讲】卷积神经网络(CNN):从入门到精通,计算机如何“看”懂世界?
人工智能·python·深度学习·神经网络·机器学习
CoderJia程序员甲18 分钟前
GitHub 热榜项目 - 日榜(2026-02-06)
人工智能·ai·大模型·github·ai教程
wukangjupingbb23 分钟前
AI多模态技术在创新药研发中的结合路径、机制及挑战
人工智能
CoderIsArt33 分钟前
三大主流智能体框架解析
人工智能
民乐团扒谱机37 分钟前
【微实验】机器学习之集成学习 GBDT和XGBoost 附 matlab仿真代码 复制即可运行
人工智能·机器学习·matlab·集成学习·xgboost·gbdt·梯度提升树
Coder_Boy_39 分钟前
Deeplearning4j+ Spring Boot 电商用户复购预测案例中相关概念
java·人工智能·spring boot·后端·spring
芷栀夏42 分钟前
CANN ops-math:揭秘异构计算架构下数学算子的低延迟高吞吐优化逻辑
人工智能·深度学习·神经网络·cann
L5434144644 分钟前
告别代码堆砌匠厂架构让你的系统吞吐量翻倍提升
大数据·人工智能·架构·自动化·rpa