CoolFace
Modelpublic

RWKV-Red-Team/ARWKV-7B-Preview-0.1-NoG

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
4likes30downloads
Model Card

<div align="center"> <img src="./figures/banner.jpg" style="border-radius: 10px; width: 100%; height: 100%; object-fit: cover; box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5); border: 2px solid white;" alt="ARWKV" /> </div>

<h1 align="center">ARWKV๐Ÿชฟ</h1>

<p align="center"> <a href="https://arxiv.org/abs/2501.15570"><b>Paper Link</b>๐Ÿ‘๏ธ</a> | <a href="https://github.com/yynil/RWKVInside"><b>Github</b>โœ…</a> </p>

ARWKV-7B-FROM-32B (Preview 0.1)

<img src="./figures/architecture.png" alt="ARWKV Hybrid Architecture" width="30%">

Preview version with RWKV-7 time mixing and Transformer MLP

This version doesn't have the parameter "g". It freezes the MLP and uses 7B logits for distillation alignment.

๐Ÿ“Œ Overview

ALL YOU NEED IS RWKV

This is an early preview of our 7B parameter RNN-based model, trained on 2k context length (only stage-2 applied, without SFT or DPO) through 3-stage knowledge distillation from Qwen2.5-7B-Instruct. While being a foundational version, it demonstrates:

  • โ€”โœ… RWKV-7's efficient recurrence mechanism
  • โ€”โœ… No self-attention, fully O(n)
  • โ€”โœ… Constant VRAM usage
  • โ€”โœ… Single-GPU trainability

Roadmap Notice: We will soon open-source different enhanced versions with:

  • โ€”๐Ÿš€ 16k+ context capability
  • โ€”๐Ÿงฎ Math-specific improvements
  • โ€”๐Ÿ“š RL enhanced reasoning model

How to use

shell
pip3 install --upgrade rwkv-fla transformers

Before training: export WKV_MODE=chunk

python
from transformers import AutoModelForCausalLM, AutoTokenizer


model = AutoModelForCausalLM.from_pretrained(
    "RWKV-Red-Team/ARWKV-7B-Preview-0.1-NoG",
    device_map="auto",
    torch_dtype=torch.float16,
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
    "RWKV-Red-Team/ARWKV-7B-Preview-0.1-NoG"
)

๐Ÿ”‘ Key Features

ComponentSpecificationNote
ArchitectureRWKV-7 TimeMix + SwiGLUHybrid design
Context Window2048 training CTXPreview limitation
Training Tokens40MDistillation-focused
PrecisionFP16 inference recommended(16G Vram required)15%โ†‘ vs BF16

๐Ÿ—๏ธ Architecture Highlights

Core Modification Flow

diff
Qwen2.5 Decoder Layer:
- Grouped Query Attention
+ RWKV-7 Time Mixing (Eq.3)
- RoPE Positional Encoding
+ State Recurrence
= Hybrid Layer Output