Update README.md
Browse files
README.md
CHANGED
|
@@ -15,87 +15,292 @@ tags:
|
|
| 15 |
---
|
| 16 |
# Trouter-20B
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
| 25 |
-
- **Parameters:** 20 billion
|
| 26 |
-
- **License:** Apache 2.0
|
| 27 |
-
- **Language(s):** English (primary)
|
| 28 |
-
- **Architecture:** Decoder-only transformer
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
-
|
| 35 |
-
- Text generation
|
| 36 |
-
- Question answering
|
| 37 |
-
- Dialogue systems
|
| 38 |
-
- Code completion
|
| 39 |
-
- Creative writing assistance
|
| 40 |
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
|
| 44 |
-
- Domain-specific text generation
|
| 45 |
-
- Instruction following
|
| 46 |
-
- Specialized reasoning tasks
|
| 47 |
|
| 48 |
-
###
|
| 49 |
|
| 50 |
-
|
| 51 |
-
-
|
| 52 |
-
-
|
| 53 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
### Training Data
|
| 58 |
|
| 59 |
-
|
| 60 |
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
-
|
| 72 |
|
| 73 |
-
|
| 74 |
|
| 75 |
-
|
| 76 |
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
-
|
| 81 |
-
model = AutoModelForCausalLM.from_pretrained("your-username/Trouter-20B")
|
| 82 |
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
```bibtex
|
| 91 |
-
@software{
|
| 92 |
-
title={Trouter-20B},
|
| 93 |
-
author={Your Name},
|
| 94 |
year={2025},
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
| 96 |
}
|
| 97 |
```
|
| 98 |
|
| 99 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
-
|
|
|
|
| 15 |
---
|
| 16 |
# Trouter-20B
|
| 17 |
|
| 18 |
+
<div align="center">
|
| 19 |
|
| 20 |
+

|
| 21 |
+

|
| 22 |
+

|
| 23 |
+

|
| 24 |
|
| 25 |
+
*A powerful 20 billion parameter language model for advanced natural language processing*
|
| 26 |
|
| 27 |
+
[π€ Model Card](https://huggingface.co/your-username/Trouter-20B) | [π Documentation](./USAGE_GUIDE.md) | [π¬ Discussions](https://huggingface.co/your-username/Trouter-20B/discussions) | [π Issues](https://github.com/your-username/Trouter-20B/issues)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
</div>
|
| 30 |
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## π Table of Contents
|
| 34 |
+
|
| 35 |
+
- [Overview](#overview)
|
| 36 |
+
- [Key Features](#key-features)
|
| 37 |
+
- [Quick Start](#quick-start)
|
| 38 |
+
- [Model Details](#model-details)
|
| 39 |
+
- [Performance](#performance)
|
| 40 |
+
- [Use Cases](#use-cases)
|
| 41 |
+
- [System Requirements](#system-requirements)
|
| 42 |
+
- [Training Details](#training-details)
|
| 43 |
+
- [Limitations & Bias](#limitations--bias)
|
| 44 |
+
- [License](#license)
|
| 45 |
+
- [Citation](#citation)
|
| 46 |
+
- [Acknowledgments](#acknowledgments)
|
| 47 |
+
|
| 48 |
+
## π― Overview
|
| 49 |
+
|
| 50 |
+
Trouter-20B is a state-of-the-art decoder-only transformer language model with 20 billion parameters. Designed for versatility and performance, it excels at a wide range of natural language understanding and generation tasks including reasoning, question answering, creative writing, code generation, and conversational AI.
|
| 51 |
+
|
| 52 |
+
## β¨ Key Features
|
| 53 |
+
|
| 54 |
+
- **20B Parameters**: Optimal balance between performance and computational efficiency
|
| 55 |
+
- **4K Context Length**: Process and generate longer sequences with 4096 token context window
|
| 56 |
+
- **Apache 2.0 License**: Fully open for commercial and research use
|
| 57 |
+
- **Optimized Architecture**: Efficient attention mechanisms with GQA (Grouped Query Attention)
|
| 58 |
+
- **Multi-lingual Capable**: Strong performance on English with support for multiple languages
|
| 59 |
+
- **Quantization Ready**: Compatible with 8-bit and 4-bit quantization for reduced memory footprint
|
| 60 |
+
- **Chat Optimized**: Built-in chat template for conversational applications
|
| 61 |
+
|
| 62 |
+
## π Quick Start
|
| 63 |
+
|
| 64 |
+
### Installation
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
pip install transformers>=4.38.0 torch>=2.0.0 accelerate bitsandbytes
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
### Basic Usage
|
| 71 |
+
|
| 72 |
+
```python
|
| 73 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 74 |
+
import torch
|
| 75 |
+
|
| 76 |
+
# Load model and tokenizer
|
| 77 |
+
model_id = "your-username/Trouter-20B"
|
| 78 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 79 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 80 |
+
model_id,
|
| 81 |
+
torch_dtype=torch.bfloat16,
|
| 82 |
+
device_map="auto"
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
# Generate text
|
| 86 |
+
prompt = "Explain the concept of neural networks:"
|
| 87 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 88 |
+
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
|
| 89 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
### Memory-Efficient Loading (4-bit)
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
from transformers import BitsAndBytesConfig
|
| 96 |
+
|
| 97 |
+
# Configure 4-bit quantization
|
| 98 |
+
bnb_config = BitsAndBytesConfig(
|
| 99 |
+
load_in_4bit=True,
|
| 100 |
+
bnb_4bit_quant_type="nf4",
|
| 101 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 105 |
+
model_id,
|
| 106 |
+
quantization_config=bnb_config,
|
| 107 |
+
device_map="auto"
|
| 108 |
+
)
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
For more detailed usage examples, see the [Usage Guide](./USAGE_GUIDE.md).
|
| 112 |
+
|
| 113 |
+
## π Model Details
|
| 114 |
+
|
| 115 |
+
| Specification | Value |
|
| 116 |
+
|--------------|-------|
|
| 117 |
+
| **Parameters** | 20 billion |
|
| 118 |
+
| **Architecture** | Decoder-only Transformer |
|
| 119 |
+
| **Layers** | 48 |
|
| 120 |
+
| **Hidden Size** | 5120 |
|
| 121 |
+
| **Attention Heads** | 40 (8 KV heads with GQA) |
|
| 122 |
+
| **Context Length** | 4096 tokens |
|
| 123 |
+
| **Vocabulary Size** | 32,000 tokens |
|
| 124 |
+
| **Activation** | SiLU (Swish) |
|
| 125 |
+
| **Positional Encoding** | RoPE (Rotary Position Embedding) |
|
| 126 |
+
| **Normalization** | RMSNorm |
|
| 127 |
+
| **Precision** | BFloat16 |
|
| 128 |
+
|
| 129 |
+
## π Performance
|
| 130 |
+
|
| 131 |
+
### Benchmark Results
|
| 132 |
+
|
| 133 |
+
| Benchmark | Score | Notes |
|
| 134 |
+
|-----------|-------|-------|
|
| 135 |
+
| MMLU (5-shot) | TBD | Multitask Language Understanding |
|
| 136 |
+
| HellaSwag | TBD | Commonsense Reasoning |
|
| 137 |
+
| TruthfulQA | TBD | Truthfulness & Accuracy |
|
| 138 |
+
| HumanEval | TBD | Code Generation |
|
| 139 |
+
| GSM8K | TBD | Mathematical Reasoning |
|
| 140 |
+
| BBH | TBD | Big Bench Hard |
|
| 141 |
+
|
| 142 |
+
*Benchmarks to be updated after comprehensive evaluation*
|
| 143 |
|
| 144 |
+
### Inference Speed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
+
| Configuration | Tokens/Second | Memory Usage |
|
| 147 |
+
|--------------|---------------|--------------|
|
| 148 |
+
| BF16 (A100 80GB) | ~XX tokens/s | ~40GB |
|
| 149 |
+
| 8-bit (A100 40GB) | ~XX tokens/s | ~20GB |
|
| 150 |
+
| 4-bit (RTX 4090) | ~XX tokens/s | ~10GB |
|
| 151 |
|
| 152 |
+
## π‘ Use Cases
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
+
### β
Recommended Uses
|
| 155 |
|
| 156 |
+
- **Text Generation**: Articles, stories, creative writing
|
| 157 |
+
- **Question Answering**: Information retrieval and explanation
|
| 158 |
+
- **Code Assistance**: Code completion, debugging, explanation
|
| 159 |
+
- **Summarization**: Document and conversation summarization
|
| 160 |
+
- **Translation**: Multi-language translation tasks
|
| 161 |
+
- **Dialogue Systems**: Chatbots and conversational AI
|
| 162 |
+
- **Content Analysis**: Sentiment analysis, classification
|
| 163 |
+
- **Educational Tools**: Tutoring and learning assistance
|
| 164 |
|
| 165 |
+
### β οΈ Limitations
|
| 166 |
+
|
| 167 |
+
- May generate incorrect or nonsensical information (hallucinations)
|
| 168 |
+
- Not suitable for high-stakes decision making without human oversight
|
| 169 |
+
- Performance may vary on specialized or domain-specific tasks
|
| 170 |
+
- Requires careful prompt engineering for optimal results
|
| 171 |
+
- May reflect biases present in training data
|
| 172 |
+
|
| 173 |
+
### β Out of Scope
|
| 174 |
+
|
| 175 |
+
- Real-time medical diagnosis or treatment recommendations
|
| 176 |
+
- Legal advice or binding interpretations
|
| 177 |
+
- Financial investment decisions
|
| 178 |
+
- Safety-critical systems without human verification
|
| 179 |
+
- Generating harmful, illegal, or unethical content
|
| 180 |
+
|
| 181 |
+
## π» System Requirements
|
| 182 |
+
|
| 183 |
+
### Minimum Requirements
|
| 184 |
+
|
| 185 |
+
- **GPU**: 24GB VRAM (with 4-bit quantization)
|
| 186 |
+
- **RAM**: 32GB system memory
|
| 187 |
+
- **Storage**: 50GB free space
|
| 188 |
+
- **CUDA**: 11.8 or higher
|
| 189 |
+
|
| 190 |
+
### Recommended Specifications
|
| 191 |
+
|
| 192 |
+
- **GPU**: A100 (40GB/80GB) or H100
|
| 193 |
+
- **RAM**: 64GB+ system memory
|
| 194 |
+
- **Storage**: 100GB+ SSD
|
| 195 |
+
- **Multi-GPU**: Supported via `device_map="auto"`
|
| 196 |
+
|
| 197 |
+
## ποΈ Training Details
|
| 198 |
|
| 199 |
### Training Data
|
| 200 |
|
| 201 |
+
Trouter-20B was trained on a diverse corpus of high-quality text data including:
|
| 202 |
|
| 203 |
+
- Web documents and articles
|
| 204 |
+
- Books and academic papers
|
| 205 |
+
- Code repositories
|
| 206 |
+
- Conversational data
|
| 207 |
+
- Multilingual text
|
| 208 |
|
| 209 |
+
**Total Training Tokens**: [Specify total tokens]
|
| 210 |
+
**Data Mix**: [Provide breakdown of data sources]
|
| 211 |
+
**Cutoff Date**: January 2025
|
| 212 |
|
| 213 |
+
### Training Infrastructure
|
| 214 |
|
| 215 |
+
- **Framework**: PyTorch 2.0+ with FSDP
|
| 216 |
+
- **Hardware**: [Specify GPU cluster details]
|
| 217 |
+
- **Training Time**: [Specify duration]
|
| 218 |
+
- **Optimizer**: AdamW
|
| 219 |
+
- **Learning Rate**: Cosine schedule with warmup
|
| 220 |
+
- **Batch Size**: [Specify effective batch size]
|
| 221 |
+
- **Sequence Length**: 4096 tokens
|
| 222 |
|
| 223 |
+
### Training Objective
|
| 224 |
|
| 225 |
+
Causal language modeling with next-token prediction using cross-entropy loss.
|
| 226 |
|
| 227 |
+
## βοΈ Limitations & Bias
|
| 228 |
|
| 229 |
+
### Known Limitations
|
| 230 |
|
| 231 |
+
1. **Hallucinations**: May generate plausible-sounding but incorrect information
|
| 232 |
+
2. **Temporal Knowledge**: Training data cutoff is January 2025
|
| 233 |
+
3. **Mathematical Reasoning**: May struggle with complex multi-step calculations
|
| 234 |
+
4. **Multilingual Performance**: Optimized for English; other languages may have reduced quality
|
| 235 |
+
5. **Context Window**: Limited to 4096 tokens
|
| 236 |
|
| 237 |
+
### Bias Considerations
|
|
|
|
| 238 |
|
| 239 |
+
Like all large language models, Trouter-20B may exhibit biases including:
|
| 240 |
+
|
| 241 |
+
- Gender, racial, and cultural biases from training data
|
| 242 |
+
- Western/English-centric perspective
|
| 243 |
+
- Potential stereotyping in generated content
|
| 244 |
+
|
| 245 |
+
**Mitigation Efforts**: We encourage users to:
|
| 246 |
+
- Implement appropriate content filtering
|
| 247 |
+
- Use diverse evaluation datasets
|
| 248 |
+
- Apply bias detection tools
|
| 249 |
+
- Provide human oversight for production deployments
|
| 250 |
+
|
| 251 |
+
## π License
|
| 252 |
|
| 253 |
+
Trouter-20B is released under the **Apache 2.0 License**. You are free to:
|
| 254 |
+
|
| 255 |
+
β
Use commercially
|
| 256 |
+
β
Modify and distribute
|
| 257 |
+
β
Use privately
|
| 258 |
+
β
Use for patent purposes
|
| 259 |
+
|
| 260 |
+
See [LICENSE](./LICENSE) file for full terms.
|
| 261 |
+
|
| 262 |
+
## π Citation
|
| 263 |
+
|
| 264 |
+
If you use Trouter-20B in your research or applications, please cite:
|
| 265 |
|
| 266 |
```bibtex
|
| 267 |
+
@software{trouter20b2025,
|
| 268 |
+
title={Trouter-20B: A 20 Billion Parameter Language Model},
|
| 269 |
+
author={Your Name/Organization},
|
| 270 |
year={2025},
|
| 271 |
+
month={10},
|
| 272 |
+
url={https://huggingface.co/your-username/Trouter-20B},
|
| 273 |
+
version={1.0},
|
| 274 |
+
license={Apache-2.0}
|
| 275 |
}
|
| 276 |
```
|
| 277 |
|
| 278 |
+
## π Acknowledgments
|
| 279 |
+
|
| 280 |
+
We thank the open-source community and the following projects that made this work possible:
|
| 281 |
+
|
| 282 |
+
- [Hugging Face Transformers](https://github.com/huggingface/transformers)
|
| 283 |
+
- [PyTorch](https://pytorch.org/)
|
| 284 |
+
- [LLaMA](https://ai.meta.com/llama/) architecture inspiration
|
| 285 |
+
- [EleutherAI](https://www.eleuther.ai/) for evaluation frameworks
|
| 286 |
+
|
| 287 |
+
## π€ Contributing
|
| 288 |
+
|
| 289 |
+
We welcome contributions! Please see our contributing guidelines and join the discussion on our Hugging Face page.
|
| 290 |
+
|
| 291 |
+
## π Contact & Support
|
| 292 |
+
|
| 293 |
+
- **Issues**: [GitHub Issues](https://github.com/your-username/Trouter-20B/issues)
|
| 294 |
+
- **Discussions**: [HuggingFace Discussions](https://huggingface.co/your-username/Trouter-20B/discussions)
|
| 295 |
+
- **Email**: your-email@example.com
|
| 296 |
+
- **Twitter**: [@YourHandle](https://twitter.com/yourhandle)
|
| 297 |
+
|
| 298 |
+
---
|
| 299 |
+
|
| 300 |
+
<div align="center">
|
| 301 |
+
|
| 302 |
+
**Built with β€οΈ for the AI community**
|
| 303 |
+
|
| 304 |
+
[β¬ Back to Top](#trouter-20b)
|
| 305 |
|
| 306 |
+
</div>
|