Instructions to use SaintsStudios/Mirror_AI_TUM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SaintsStudios/Mirror_AI_TUM with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="SaintsStudios/Mirror_AI_TUM")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SaintsStudios/Mirror_AI_TUM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
1. Model Architecture Overview
Mirror AI is a Sequence-to-Sequence (Seq2Seq) Transformer that uses a Pre-Layer Normalization (Pre-LN) design, which stabilizes training compared to classic Post-LN Transformers. It also employs SwiGLU activation in place of standard feed-forward networks.
2. Detailed Hyperparameters
Vocabulary Size (vocab_size): 16,000 (driven by the custom SentencePiece tokenizer). Model Dimension (d_model): 256 (the size of token embeddings and hidden states throughout the network). Attention Heads (nhead): 8 (dividing the 256-dimensional space into 8 parallel attention heads of size 32 each). Encoder Layers (num_encoder_layers): 4 Pre-LN encoder layers. Decoder Layers (num_decoder_layers): 4 Pre-LN decoder layers. Feed-Forward Dimension (d_ff): 1024 (the internal projection layer inside the SwiGLU block). Dropout Rate: 0.1 (applied to self-attention outputs, cross-attention, and SwiGLU layers during training). Positional Encoding: Sinusoidal absolute positional encodings.
3. Key Architectural Features
Pre-LN Structure: Normalization (nn.LayerNorm) is applied directly to the inputs of each sub-layer (attention and feed-forward) before adding residual connections. This prevents vanishing/exploding gradients. SwiGLU Feed-Forward Blocks: Instead of the standard ReLU or GELU MLPs, your model uses SwiGLU (Swish Gated Linear Unit) layers defined as: $$\text{SwiGLU}(x) = (\text{SiLU}(xW_1) \otimes xW_2)W_3$$ This is a modern feed-forward structure commonly used in state-of-the-art models like LLaMA and Mistral because it captures non-linear features much better.
Inference Examples:
BIDIRECTIONAL MODEL EVALUATION SUITE:
[Tumbuka -> English]
Source: Muli makola?
Output: are you afraid?
[English -> Tumbuka]
Source: How are you today?
Output: Kasi mwahuno wuli?
[Tumbuka -> English]
Source: Mu mutendeko Chiuta wakalenga kuchanya na charu cha pasi.
Output: In the beginning God created the heavens and the earth.
[English -> Tumbuka]
Source: In the beginning God created the heaven and the earth.
Output: Mu mutendeko Chiuta wakalenga mtambo na charu cha pasi.
[Tumbuka -> English]
Source: Zina lako ndiwe njani?
Output: What is your name?
[English -> Tumbuka]
Source: What is your name?
Output: Zina lako ndiwe njani?
- Downloads last month
- 101
16-bit
32-bit
Model tree for SaintsStudios/Mirror_AI_TUM
Unable to build the model tree, the base model loops to the model itself. Learn more.