Downloads · 30 days
0
RaiRamones/indomla-1024
indomla-1024 is a text generation model from RaiRamones. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
IndoMLA-1024 is an experimental Indonesian decoder-only causal language model trained from scratch using an MLA-inspired low-rank key/value attention mechanism.
Downloads · 30 days
0
Access
Public
Updated Aug 17, 2026
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.pt1.7 GB · 100%
From the Hugging Face model README
IndoMLA-1024 is an experimental Indonesian decoder-only causal language model trained from scratch using an MLA-inspired low-rank key/value attention mechanism.
The model contains approximately 139.7 million parameters and supports a maximum context length of 1,024 tokens.
This project is intended primarily for research into Indonesian language modeling, efficient attention architectures, and controlled comparison between conventional Multi-Head Attention and low-rank KV attention designs.
Important: IndoMLA-1024 is a base pretrained language model. It is not instruction-tuned, chat-tuned, or RLHF-aligned.
| Property | Value |
|---|---|
| Model name | IndoMLA-1024 |
| Architecture | Decoder-only Transformer |
| Training type | From scratch |
| Objective | Causal Language Modeling |
| Parameters | 139,718,400 |
| Context length | 1,024 tokens |
| Vocabulary size | 16,000 |
| Transformer layers | 18 |
| Attention heads | 12 |
| Hidden size | 768 |
| Head dimension | 64 |
| FFN hidden size | 2,304 |
| KV latent rank | 256 |
| Attention mechanism | MLA-inspired low-rank KV attention |
| Positional encoding | RoPE |
| RoPE theta | 10,000 |
| Normalization | RMSNorm |
| MLP | SwiGLU |
| Dropout | 0.0 |
| Weight tying | Input embedding / LM head |
| Training precision | bfloat16 |
| Primary language | Indonesian |
IndoMLA-1024 follows a decoder-only Transformer architecture.
Each Transformer block consists of:
Input
│
├── RMSNorm
│
├── MLA-inspired Causal Self-Attention
│
├── Residual Connection
│
├── RMSNorm
│
├── SwiGLU Feed-Forward Network
│
└── Residual Connection
The full network contains 18 Transformer blocks.
A final RMSNorm is applied before the language-modeling head.
The model uses an MLA-inspired attention mechanism.
The term MLA-inspired is used intentionally because this implementation explores the idea of compressing key/value representations into a shared low-dimensional latent space, rather than attempting to reproduce every component of architectures such as DeepSeek MLA.
The query projection remains full-rank:
Hidden State
│
▼
Linear
768 → 768
│
▼
Q
Keys and values are generated through a shared compressed latent representation:
Hidden State
│
▼
KV Compression
768 → 256
│
▼
KV Latent
256 dimensions
│
├───────────────┐
│ │
▼ ▼
K Projection V Projection
256 → 768 256 → 768
│ │
▼ ▼
K V
The latent rank is:
256
compared with the model hidden size of:
768
This creates a low-rank bottleneck for key/value representations.
The attention configuration is:
Hidden size = 768
Attention heads = 12
Head dimension = 64
because:
768 / 12 = 64
The projected Q, K, and V representations are reshaped into 12 attention heads before causal scaled dot-product attention is performed.
IndoMLA-1024 uses Rotary Position Embeddings (RoPE).
Configuration:
RoPE theta = 10000
RoPE is applied to the query and key vectors before attention score computation.
The model does not rely on a learned absolute positional embedding table.
The configured maximum sequence length is:
1024 tokens
The model uses RMSNorm rather than standard LayerNorm.
The Transformer follows a pre-normalization structure conceptually equivalent to:
x = x + attention(rms_norm(x))
x = x + mlp(rms_norm(x))
A final RMSNorm is also applied after the Transformer stack.
Each Transformer block uses a SwiGLU feed-forward network.
The dimensions are:
768 → 2304 → 768
Conceptually:
Input
│
├── Linear → SiLU
│
└── Linear
│
▼
Element-wise multiplication
│
▼
Output projection
│
▼
Output
A simplified mathematical representation is:
SwiGLU(x) = W2(SiLU(W1(x)) ⊙ W3(x))
IndoMLA-1024 ties the token embedding matrix with the output language-modeling head.
Conceptually:
lm_head.weight = token_embedding.weight
This allows the model to reuse the same parameter matrix for input token representations and output token logits.
The model contains:
139,718,400 parameters
or approximately:
139.7M parameters
This places IndoMLA-1024 in the small language model research regime.
The goal of the project is not to compete directly with large production-scale language models, but to provide a manageable architecture for studying Indonesian language modeling and alternative attention designs.
The model uses a custom tokenizer with:
| Property | Value |
|---|---|
| Vocabulary size | 16,000 |
| EOS token ID | 3 |
| PAD token ID | 3 |
The tokenizer is loaded from:
tokenizer.json
Documents are tokenized and separated using an EOS token before being packed into fixed-length token sequences.
For causal language modeling, training samples conceptually contain:
input:
token_1 token_2 token_3 ... token_1024
target:
token_2 token_3 token_4 ... token_1025
The model therefore learns to predict the next token from the preceding context.
IndoMLA-1024 uses the Indonesian configuration of:
uonlp/CulturaX
with language configuration:
id
The dataset is accessed through Hugging Face dataset streaming.
Streaming allows the training pipeline to process large web-scale datasets without loading the full dataset into system memory or local storage.
Before tokenization and training, CulturaX samples pass through a custom filtering pipeline.
The notebook implementation includes filtering intended to remove or reduce low-quality web content.
Filtering criteria include checks related to:
The purpose of this filtering stage is to improve the effective quality of the Indonesian pretraining corpus.
Filtering cannot guarantee that all low-quality, harmful, duplicated, biased, or factually incorrect content has been removed.
The model is trained using standard autoregressive causal language modeling.
The objective is:
P(x1, x2, ..., xn)
=
∏ P(xt | x1, ..., xt-1)
At each position, the model predicts the next token conditioned on all preceding tokens.
Training loss is computed using token-level cross entropy.
The main training configuration is:
| Hyperparameter | Value |
|---|---|
| Context length | 1,024 |
| Micro batch size | 16 |
| Gradient accumulation | 2 |
| Effective batch size | 32 sequences |
| Tokens per optimizer step | 32,768 |
| Precision | bfloat16 |
| Optimizer | AdamW |
| Peak learning rate | 3e-4 |
| Minimum learning rate | 3e-5 |
| Adam beta1 | 0.9 |
| Adam beta2 | 0.95 |
| Weight decay | 0.1 |
| Gradient clipping | 1.0 |
| Warmup steps | 20 |
| LR schedule | Warmup + cosine decay |
| LR scheduler horizon | 10,000 steps |
| Gradient checkpointing | Enabled |
| Checkpoint interval | 500 steps |
The effective number of tokens processed per optimizer update is:
micro_batch_size
× gradient_accumulation
× context_length
16 × 2 × 1024
= 32,768 tokens
The notebook configures a main training target of:
5,000 optimizer steps
If all 5,000 optimizer steps are completed, the nominal training token budget would be:
5,000 × 32,768
which is:
163,840,000 tokens
or approximately:
163.8M training tokens
This number represents the nominal number of token positions processed by the optimizer configuration and should not necessarily be interpreted as the number of unique tokens in the underlying dataset.
The training process uses:
Warmup
↓
Peak LR
↓
Cosine Decay
↓
Minimum LR
Configured values:
Peak learning rate = 3e-4
Minimum learning rate = 3e-5
Warmup steps = 20
The optimizer is AdamW with:
beta1 = 0.9
beta2 = 0.95
weight_decay = 0.1
Gradient norm clipping is applied with:
max_grad_norm = 1.0
Gradient checkpointing is enabled during training.
Instead of storing every intermediate activation required for backpropagation, selected activations are recomputed during the backward pass.
Conceptually:
Without checkpointing:
More activation memory
Less recomputation
With checkpointing:
Less activation memory
More recomputation
This allows longer sequences or larger batches to fit within available GPU memory.
The training notebook records an AMD GPU environment using ROCm/HIP.
The environment includes approximately:
GPU VRAM: ~48 GB
The recorded software environment includes:
Python 3.10
PyTorch 2.9 development build
ROCm / HIP 7.2
Training precision:
bfloat16
PyTorch exposes ROCm GPUs through its CUDA-compatible interface, so code may still use APIs such as:
torch.cuda
even when the physical GPU is AMD.
Before meaningful training, the initial model loss was approximately:
9.83
This is expected for a randomly initialized language model with a vocabulary of this scale.
The initial smoke-training run showed decreasing loss:
| Step | Training Loss |
|---|---|
| 1 | ~9.83 |
| 10 | ~8.72 |
| 20 | ~7.89 |
| 30 | ~7.63 |
| 40 | ~7.44 |
| 50 | ~7.12 |
The longer training run continued reducing training loss.
Representative values recorded during training include:
| Global Step | Training Loss |
|---|---|
| 500 | ~4.79 |
| 1,000 | ~4.32 |
| 1,500 | ~4.10 |
| 2,000 | ~3.67 |
| 2,500 | ~3.73 |
| 3,000 | ~3.51 |
| 3,488 | ~3.38 |
These values represent training loss, not standardized downstream evaluation results.
Loss fluctuations between individual logging intervals are normal during stochastic optimization.
The current notebook primarily records optimization and training-loss behavior.
No standardized downstream benchmark suite is reported in this model card.
Therefore, the current model card does not claim performance on tasks such as:
A controlled evaluation protocol should be performed before making capability claims.
The training pipeline saves checkpoints periodically.
The configured checkpoint interval is:
500 optimizer steps
Checkpoint data includes information such as:
{
"run_id": ...,
"global_step": ...,
"model_state_dict": ...,
"optimizer_state_dict": ...,
"config": ...,
"train_loss": ...,
"val_loss": ...,
"block_size": ...,
"micro_batch_size": ...,
"grad_accum_steps": ...,
"tokens_per_step": ...,
"created_at": ...
}
Saving model configuration alongside model weights makes experiments easier to reproduce and inspect.
IndoMLA-1024 currently uses a custom PyTorch architecture.
The checkpoint should therefore be restored using the same model implementation used during training.
Example:
import torch
checkpoint = torch.load(
"checkpoint.pt",
map_location="cpu"
)
config = IndoMLAConfig(**checkpoint["config"])
model = IndoMLAForCausalLM(config)
model.load_state_dict(
checkpoint["model_state_dict"]
)
model.eval()
print("Checkpoint step:", checkpoint["global_step"])
The custom classes:
IndoMLAConfig
IndoMLAForCausalLM
must be available before loading the checkpoint.
The tokenizer can be loaded using the Hugging Face tokenizers library.
from tokenizers import Tokenizer
tokenizer = Tokenizer.from_file(
"tokenizer.json"
)
text = "Indonesia adalah negara"
encoding = tokenizer.encode(text)
print(encoding.ids)
Because IndoMLA-1024 is a causal language model, generation proceeds autoregressively:
Prompt
↓
Predict next token
↓
Append token
↓
Predict next token
↓
Append token
↓
...
The current implementation uses a custom PyTorch model, so inference should use the architecture defined in the accompanying notebook or source code.
The model should not automatically be assumed to work with:
AutoModelForCausalLM.from_pretrained(...)
unless the repository is subsequently packaged with the necessary Hugging Face Transformers-compatible configuration and modeling files.
IndoMLA-1024 is intended primarily for research and experimentation.
Appropriate use cases include:
IndoMLA-1024 is a base pretrained model.
The model has not been trained specifically to follow instructions such as:
Explain this concept.
Summarize this article.
Answer this question.
Write Python code.
Base-model completion behavior is more appropriate.
For example:
Indonesia adalah negara
may be continued autoregressively based on patterns learned during pretraining.
Instruction-following behavior would require additional training such as:
Base Pretraining
↓
Supervised Fine-Tuning
↓
Instruction Model
Potential alignment stages could additionally include preference optimization or other alignment methods.
IndoMLA-1024 is an experimental research model and has several important limitations.
At approximately:
139.7M parameters
the model is substantially smaller than modern production-scale large language models.
Its capabilities should therefore not be compared directly with multi-billion-parameter instruction-tuned systems without accounting for model scale, training compute, dataset size, and post-training.
The experiment represents relatively early-stage pretraining.
The configured 5,000-step run corresponds to approximately:
163.8M processed token positions
which is not necessarily a compute-optimal training budget for a model of this size.
Additional training may significantly change model behavior.
The model has not undergone supervised instruction tuning.
Therefore, it should not be expected to reliably:
The model has not undergone alignment procedures such as:
Generated content may therefore be inappropriate, incorrect, biased, unsafe, or otherwise undesirable.
CulturaX is derived from large-scale web data.
Although a custom filtering pipeline is applied, web-derived datasets can contain:
Generated text should not automatically be considered factual.
The current experiment does not provide comprehensive standardized downstream evaluation.
Training loss alone is insufficient for determining:
The main research motivation behind IndoMLA is to study whether compressed key/value representations can provide an interesting alternative to conventional Multi-Head Attention for relatively small Indonesian language models.
A simplified comparison is:
Conventional Multi-Head Attention
Hidden State
│
├──────► Q
│
├──────► K
│
└──────► V
versus:
IndoMLA-1024
Hidden State
│
├────────────────────► Q
│
▼
Compressed KV Latent
│
├────────────────────► K
│
└────────────────────► V
The KV latent dimension is:
256
while the hidden dimension is:
768
This architecture creates an explicit low-rank bottleneck for the key/value pathway.
This repository deliberately uses the terminology:
MLA-inspired
rather than claiming a complete implementation of Multi-head Latent Attention as used in larger architectures.
The central idea implemented here is the shared low-rank compression of key/value representations.
The query path remains full-rank.
Therefore, a more precise description of the architecture is:
A decoder-only Transformer with full-rank query projections and shared low-rank latent key/value projections.
This terminology helps distinguish the experimental design from complete implementations of other MLA architectures.
The architecture is suitable for controlled comparison with a conventional MHA baseline.
A rigorous comparison should match important experimental variables, including:
Tokenizer
Dataset
Data ordering
Context length
Parameter budget
Training tokens
Optimizer
Learning rate
Batch size
Precision
Evaluation protocol
Possible measurements include:
Without matched experimental conditions, architectural conclusions should be treated cautiously.
The reference notebook documents the experiment end-to-end, including:
Reference notebook:
indomla-1024.ipynb
Repository:
https://github.com/Rai7/indomla-1024
Current status:
Experimental Research Base Model
The project should currently be interpreted as an architecture and pretraining experiment rather than a production-ready language model.
Future work may include:
If you use this model or implementation in research, please cite the repository.
A formal citation entry can be added once the associated research paper or technical report receives its final publication metadata.
IndoMLA-1024 is released under the Apache License 2.0.
See the repository license for additional details.
This model is provided for research and educational purposes.
Model outputs may contain incorrect, biased, offensive, misleading, or unsafe information.
Users are responsible for evaluating outputs and determining whether the model is appropriate for their intended application.