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

相关推荐
u1301305 小时前
AI 日报(2026年10月4日)
人工智能
飞塔老梅子5 小时前
17. Unsloth下载、安装及加载本地大模型 ❀ 老梅子学AI
人工智能·glm·lm studio·5.3·unsolth
打工仔折腾 AI6 小时前
把AI Agent托管在家用电脑:UU远程终端与端口映射实测记录
人工智能·后端·python·langchain·ai agent 实战
零基础1236 小时前
Agent 的 Memory 怎么做科研:以中医诊断场景为例
人工智能·经验分享·python·语言模型
归秋1426 小时前
人声节奏对齐软件推荐:从专业DAW到AI人声制作工具怎么选
人工智能
niyongsheng6 小时前
后端零改动,给若依换一套现代化前端
vue.js·开源·node.js
EasyBr指纹浏览器6 小时前
抖音创作者数据导出:怎样留下可比较的日报?
数据分析·开源·抖音·数据导出
2601_962966647 小时前
数学与应用数学专业想进管理咨询,2027届秋招需要补哪些商业知识和技能?
人工智能
ss2737 小时前
AI全栈实战 | 3.2-01 Python 基础:四大数据容器怎么选,推导式为什么是 Pythonic 的灵魂
开发语言·人工智能·python
Sweet锦7 小时前
不调 Python,不装向量库:我用纯 Java 写了一套以图搜图引擎
java·人工智能·开源·图搜索