LongCat-Next README

The project's README from github.com/meituan-longcat/LongCat-Next. As one markdown file: README.md.

LongCat-Next

LongCat Logo

Blog Hugging Face GitHub Demo
Wechat Twitter Follow
Paper License

Tech Report 📄

Model Introduction

evaluation

We develop LongCat-Next, a native multimodal model that processes text, vision, and audio under a single autoregressive objective with minimal inductive bias beyond the language paradigm. As an industrial-strength foundation model with A3B model size, it excels at seeing, creating, and talking, achieving strong performance across a wide range of multimodal benchmarks. In particular, leveraging semantically complete discrete representations, it surpasses the long-standing performance ceiling of discrete vision modeling on understanding tasks, and provides a unified solution for visual understanding and generation. This success demonstrates that discrete tokens can universally represent multimodal signals and be deeply internalized within a single discrete embedding space. We further provide extensive experiments to analyze this unified discrete training paradigm and uncover several interesting findings.

As a meaningful attempt toward native multimodality, we open-source the LongCat-Next and its tokenizers, hoping to foster further research and development in the community.

Key Features

This work primarily addresses the fundamental barrier to native multimodality through a design philosophy that prioritizes simplicity, treating vision and audio as intrinsic extensions of language. As a step toward this goal, we present LongCat-Next, a discrete native multimodal model that achieves industrial-strength performance within discrete frameworks while remaining highly competitive across a wide range of specialized domains. Built upon the LongCat-Flash-Lite MoE backbone (A3B) as a multi-task learner, the model unifies language, vision, and audio within a single discrete framework. In this paper, we make the following principal contributions:

🌟 Discrete Native Autoregression Paradigm (DiNA).

We introduce DiNA, a unified paradigm that extends next-token prediction from language to native multimodality, which internalizes diverse modalities into a shared token space. It simplifies multimodal modeling by creating modality-aware tokenizer-detokenizer pairs and leveraging the established training infrastructure of large language models.

🌟 Semantic Completeness for Discrete Visual Representation.

We improve discrete visual modeling by combining Semantic-and-Aligned Encoders (SAE) with Residual Vector Quantization (RVQ). This integration creates hierarchical discrete tokens that preserve both semantic abstraction and fine-grained visual details, surpassing traditional representation limitations.

🌟 Discrete Native-Resolution Vision Transformer (dNaViT).

Analogous to linguistic tokenizers, we propose dNaViT as a highly flexible, unified discrete interface for vision that extracts semantic features as "visual words", constructing a hierarchical representation space supporting dynamic tokenization and detokenization. dNaViT integrates seamlessly with large language models, ensuring high performance without degradation.

🌟 Exceling in Seeing, Creating, and Talking in a Unified Model.

Within the framework of DiNA, visual understanding and generation are elegantly reformulated as two manifestations of the same predictive process without performance compromise. This formulation bridges the long-standing architectural divide while introducing minimal interference between these traditionally competing objectives and preserving core language capabilities. Remarkably, LongCat-Next achieves competitive performance with specialized understanding models, while maintaining strong generative quality even under a 28× compression ratio, particularly in text rendering, while also excelling in advanced speech comprehension, low-latency voice conversation, and customizable voice cloning.

Please refer to our technical report for details!

Evaluation Results

evaluation

Quick Start

To use LongCat-Next with transformers, we need at least 3 GPUs (80GB VRAM each, e.g., H100/A100 80GB), and we recommend the following environment:

# (Install python=3.10, ffffmpeg<7, soundfile==0.13.1)
conda env create -f environment.yml -v

# (Install torch and other pip dependencies)
pip install -r requirements.txt && pip install -r requirements-post.txt --no-build-isolation

Basic Usage Example:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor

# Load model
model_name = "meituan-longcat/LongCat-Next"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True,
)
model.eval()

tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, fix_mistral_regex=True)
model.text_tokenizer = tokenizer # Dynamic binding
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)

# Set messages
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "What book is this?<longcat_img_start>./assets/book.png<longcat_img_end>"}
]

# Apply chat-template
text_input = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)
print(f"{text_input=}")

# Preprocessing
text_inputs, visual_inputs, audio_inputs = processor(text=text_input, return_tensors="pt")
text_inputs = text_inputs.to(model.device)
if visual_inputs is not None:
    visual_inputs = visual_inputs.to(model.device)
if audio_inputs is not None:
    audio_inputs = audio_inputs.to(model.device)

# AR
with torch.no_grad():
    outputs = model.generate(
        input_ids=text_inputs["input_ids"],
        visual_inputs=visual_inputs,
        audio_inputs=audio_inputs,
        return_dict_in_generate=True,
    )

# Text decoding
output_input_ids = outputs.sequences
text_output = tokenizer.decode(output_input_ids[0][len(text_inputs["input_ids"][0]):], skip_special_tokens=True)
print(f"{text_output=}")

# Images decoding
output_visual_ids = outputs.visual_ids
if output_visual_ids.size(0) > 0:
    image_path_list = model.model.decode_visual_ids_and_save(
        output_visual_ids,
        save_prefix="./output_image",
        **model.generation_config.visual_generation_config["custom_params"],
    )
    print(f"{image_path_list=}")

# Audio decoding
output_audio_text_ids = outputs.audio_text_ids
output_audio_ids = outputs.audio_ids
if output_audio_text_ids.size(-1) > 0:
    audio_text = tokenizer.decode(output_audio_text_ids[0], skip_special_tokens=True)
    print(f"{audio_text=}")
if output_audio_ids.size(0) > 0:
    audio_path_list = model.model.decode_audio_ids_and_save(
        output_audio_ids,
        save_prefix="./output_audio",
        **model.generation_config.audio_generation_config["custom_params"],
    )
    print(f"{audio_path_list=}")
Text - Tool Calling Example
from parse_model_response import parse_model_response

tools = [
    {
        "type": "function",
        "function": {
            "name": "func_add",
            "description": "Calculate the sum of two numbers",
            "parameters": {
                "type": "object",
                "properties": {
                    "x1": {"type": "number", "description": "The first addend"},
                    "x2": {"type": "number", "description": "The second addend"}
                },
                "required": ["x1", "x2"]
            }
        }
    }
]
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Please tell me what is $$125679 + 234519$$?"},
    {
        "role": "assistant",
        "content": "I'll calculate the sum of 125679 and 234519 for you.",
        "tool_calls": [{"type": "function", "function": {"name": "func_add", "arguments": {"x1": 125679, "x2": 234519}}}]
    },
    {"role": "tool", "name": "func_add", "content": '{"ans": 360198}'}
]

text_input = tokenizer.apply_chat_template(
    messages,
    tools=tools, # add tools here
    tokenize=False,
    add_generation_prompt=True,
)
print(f"{text_input=}")


# Preprocessing - AR - Text decoding
...

# Results parsing
parsed_message = parse_model_response(text_output.strip("\n"), tools)
print(f"{parsed_message=}")

See parse_model_response.py for detailed implementation and examples.

Image - Understanding Example
# Simply replace the messages in the main example with the messages below.
messages = [
    {"role": "user", "content": "What book is this?<longcat_img_start>./assets/book.png<longcat_img_end>"}
]
Image - Generation Example
# Simply replace the messages in the main example with the messages below.
# Suffix user content with '<longcat_img_start>' to force image generation.
messages = [
    {"role": "system", "content": ""},
    {"role": "user", "content": "A small kitten sitting naturally on a moss-covered forest floor, centered in the frame, holding a rectangular wooden sign gently with its front paws resting over the top edge. The kitten has soft, fluffy fur, a natural relaxed posture, and a calm, curious expression with a slightly open mouth (not exaggerated), looking directly at the camera.\n\nThe sign is positioned firmly in front of the kitten\'s chest, supported by its paws, with realistic contact and no floating effect. The board reads \"LongCat-Next: Lexicalizing Modalities as Discrete Tokens\" in clean, sharp black text, perfectly legible.\n\nThe environment is a lush forest with tall trees, ferns, and soft green foliage. The ground is covered with moss and small plants. Background softly blurred with natural depth of field. Lighting is soft, diffused sunlight filtering through the trees, creating gentle highlights and shadows. Realistic photography style, natural colors, high detail, no cartoonish exaggeration.<longcat_img_start>"}
]
Audio - Audio-to-Text Example
# Simply replace the messages in the main example with the messages below.
messages = [
    {"role": "user", "content": "<longcat_audio_start>./assets/math1.wav<longcat_audio_end>"}
]
Audio - Audio-to-Audio Example
# Simply replace the messages in the main example with the messages below.
# Suffix user content with '<longcat_audiogen_start>' to force audio generation.
messages = [
    {"role": "system", "content": "Replicate the voice in the audio clip to formulate an answer:<longcat_audio_start>./assets/system_audio.wav<longcat_audio_end>"},
    {"role": "user", "content": "<longcat_audio_start>./assets/math1.wav<longcat_audio_end><longcat_audiogen_start>"}
]
Audio - Speech Synthesis Example
# Simply replace the messages in the main example with the messages below.
# Suffix user content with '<longcat_audiogen_start>' to force audio generation.
messages = [
    {"role": "system", "content": "Replicate the voice in the audio clip to formulate an answer:<longcat_audio_start>./assets/vc_zh3.wav<longcat_audio_end>"},
    {"role": "user", "content": "用这个声音合成以下内容:明天的meeting在三楼的Conference Room举行。<longcat_audiogen_start>"}
]

We recommend using the following set of sampling parameters for generation:

  • Text: {"max_new_tokens":2048,"do_sample":false}
  • Image - Understanding: {"max_new_tokens":1024,"do_sample":true,"temperature":0.4,"top_k":40,"top_p":0.85,"repetition_penalty":1.1}
  • Image - Generation: {"max_new_tokens":2048,"do_sample":false,"visual_generation_config":{"do_sample":true,"temperature":0.5,"top_p":0.75,"top_k":1024,"custom_params":{"cfg_scale":3,"token_h":37,"token_w":37,"anyres_prefix":"<longcat_img_token_size>{h} {w}</longcat_img_token_size>"}}}
  • Audio - Audio-to-Text: {"max_new_tokens":1024,"do_sample":true,"temperature":0.2,"top_k":20,"top_p":0.85,"repetition_penalty":1.1}
  • Audio - Audio-to-Audio/Speech Synthesis: {"max_new_tokens":2048,"do_sample":true,"temperature":0.2,"top_k":20,"top_p":0.85,"repetition_penalty":1.1,"audio_generation_config":{"audio_parallel_decoding":false,"do_sample":true,"temperature":0.5,"top_k":5,"top_p":0.85,"repetition_penalty":1.3,"custom_params":{"sampling_rate":24000,"wave_concat_overlap":1200}}}

Please note that the support for sampling parameters varies according to inference frameworks(For transformers, the inference parameter configuration is located in ./generation_config.json).

Deployment

We have implemented basic adaptations in SGLang to support the deployment of LongCat-Next. Please refer to this repository for more information: meituan-longcat/LongCat-Next-inference

SFT

We provide supervised fine-tuning (SFT) code for LongCat-Next, built on PyTorch FSDP2. It supports understanding (image+text → text), generation (text → image), and unified mixed-sample training. See sft/ and its README for setup, data preparation, and example training scripts.

License Agreement

This repository, including both the model weights and the source code, is released under the MIT License.

Any contributions to this repository are licensed under the MIT License, unless otherwise stated. This license does not grant any rights to use Meituan trademarks or patents.

For details, see the LICENSE file.

Usage Considerations

This model has not been specifically designed or comprehensively evaluated for every possible downstream application.

Developers should take into account the known limitations of large language models, including performance variations across different languages, and carefully assess accuracy, safety, and fairness before deploying the model in sensitive or high-risk scenarios. It is the responsibility of developers and downstream users to understand and comply with all applicable laws and regulations relevant to their use case, including but not limited to data protection, privacy, and content safety requirements.

Nothing in this Model Card should be interpreted as altering or restricting the terms of the MIT License under which the model is released.

Citation

We kindly encourage citation of our work if you find it useful.

@misc{meituanlongcatteam2026longcatnextlexicalizingmodalitiesdiscrete,
      title={LongCat-Next: Lexicalizing Modalities as Discrete Tokens}, 
      author={Meituan LongCat Team},
      year={2026},
      eprint={2603.27538},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2603.27538}, 
}

Contact

Please contact us at [email protected] or open an issue if you have any questions.

WeChat Group

LongCat-Next (meituan-longcat/LongCat-Next)

Searching Database…

这是什么?LongCat-Next 是美团推出的原生多模态基础模型,使用离散词元在单一自回归目标下处理文本、视觉和音频,构建于 LongCat-Flash-Lite MoE 骨干(A3B)之上。
这是开箱即用的应用,还是需要用代码加载的模型?它是一个随代码一起发布的开放权重研究模型,通过 Hugging Face transformers 加载,用于文本、图像理解/生成和音频任务,不是独立应用。
怎么让它跑起来?通过 Hugging Face transformers 加载,把 ./config.json 中的 WEIGHT_PATH_TO_LONGCAT_NEXT 指向下载好的权重,然后运行提供的文本、图像或音频示例脚本。
需要什么硬件和软件?你需要至少 3 块各带 80GB 显存的 GPU(例如 H100 或 A100),以及 Python 3.10+、torch 2.6+、transformers 4.57.6+ 和 accelerate 1.10.0+。
部署之前有什么注意事项?它尚未针对每种下游用途进行全面评估,且各语言的表现不一,开发者必须自行评估安全性和准确性;生产级部署目前依赖一个独立的、仅提供基础功能的 SGLang 集成。
LongCat-Next 开箱即能做什么?它能处理文本生成、图像理解与生成(即使在 28x 压缩率下也有出色的文字渲染),以及语音任务,包括低延迟语音对话和可定制的声音克隆。
DiNA 是什么?DiNA(Discrete Native Autoregression,离散原生自回归)是一种范式,它把下一词元预测从语言扩展到视觉和音频,方法是将每种模态转换为共享离散空间中的词元。
我可以自己微调这个模型吗?可以,项目提供了基于 PyTorch FSDP2 的监督微调代码,支持图像+文本到文本、文本到图像以及混合样本训练(见 sft/ 目录)。
为什么项目连分词器也开源了?因为模型的统一离散表示依赖定制的、感知模态的分词器-反分词器对,公开它们能让他人复现并在此基础上发展原生多模态方法。
Size
27.3 MB
Stars
477
Updated
CommitJul 21
Age
6mo
Commits · 90 Days