# Official Ares Colab Run Instructions

Use this guide with:

```text
colab/OFFICIAL_Ares_Colab_Training_Run.ipynb
```

A copy is also provided as:

```text
/home/user/OFFICIAL_Ares_Colab_Training_Run.ipynb
```

## What this run does

This notebook trains Ares so it can generate from its own checkpoint weights. It does **not** use an external AI model for the core brain.

It uses:

- `wikimedia/wikipedia` from Hugging Face,
- optional `roneneldan/TinyStories` from Hugging Face,
- Ares machine-learning-process curriculum,
- thousands of Ares roleplay scenarios,
- Ares BPE tokenizer trained from scratch,
- Ares decoder-only Transformer training,
- validation loss/perplexity,
- optional roleplay SFT,
- final generation from the trained checkpoint,
- optional SQLite RAG memory.

## Step-by-step

### 1. Open Colab

Go to:

```text
https://colab.research.google.com/
```

Upload or open:

```text
OFFICIAL_Ares_Colab_Training_Run.ipynb
```

### 2. Enable GPU

In Colab:

```text
Runtime → Change runtime type → GPU
```

Then run the first cell. It should say:

```text
cuda available: True
```

If it says false, stop and fix the runtime before training.

### 3. Run cells top-to-bottom

Do not skip the validation or report cells. They tell you whether Ares is actually improving.

### 4. Use the default profile first

Default:

```python
PROFILE = "official_30m_512"
```

This uses:

```text
configs/ares_30m.json
~28.3M parameters
512-token context
8192-token tokenizer
8000 Wikipedia records
4000 ML-process records
12000 roleplay records
2000 TinyStories records
```

### 5. If Colab crashes or runs out of memory

Change:

```python
PROFILE = "smoke_10m"
```

or lower:

```python
BATCH_SIZE = 1
```

### 6. If the 512-context run works

Try:

```python
PROFILE = "context_30m_1024"
```

This uses:

```text
configs/ares_30m_ctx1024.json
1024-token context
```

### 7. Watch validation loss

Good sign:

```text
train loss down
validation loss down
saved_best: true
```

Bad sign:

```text
train loss down
validation loss up
```

That means overfitting. Stop, improve data, or lower the learning rate.

### 8. Real generation happens near the end

The important cells are:

```text
20. REAL GENERATION: sample from Ares' trained brain
22. REAL CHAT WRAPPER: Ares checkpoint + planning + RAG
```

Those cells load your checkpoint and tokenizer. The output comes from Ares weights.

### 9. Keep artifacts in Google Drive

The notebook stores outputs under:

```text
/content/drive/MyDrive/ares_official_training
```

Important outputs:

```text
tokenizer.json
ckpt_best.pt
ckpt_last.pt
training_report.html
roleplay_dataset.jsonl
roleplay_sft.txt
*.sqlite
*_summary.json
```

### 10. Do not publish secrets

Do not commit or upload:

```text
HF tokens
.env files
Google Drive private links
raw private data
checkpoints unless intentionally publishing model weights
SQLite databases unless intentionally publishing them
```

## Recommended first run summary

Use:

```python
PROFILE = "official_30m_512"
USE_FULL_EN_WIKIPEDIA = False
WIKIPEDIA_RECORDS = 8000
ML_PROCESS_RECORDS = 4000
ROLEPLAY_RECORDS = 12000
EXTRA_HF_RECORDS = 2000
TRAIN_STEPS = 1500
RUN_ROLEPLAY_SFT = True
```

If it succeeds, next run:

```python
PROFILE = "context_30m_1024"
TRAIN_STEPS = 3000
WIKIPEDIA_RECORDS = 25000
ROLEPLAY_RECORDS = 25000
```

## Plain-English training loop

1. Get public text knowledge from Wikipedia.
2. Add easier story/narrative data from TinyStories.
3. Add Ares' ML-process curriculum.
4. Add thousands of roleplay conversations.
5. Train Ares' own tokenizer.
6. Train Ares' Transformer with next-token prediction.
7. Track validation loss.
8. Save the best checkpoint.
9. Fine-tune on roleplay chat data.
10. Generate from the final checkpoint.
11. Build RAG memory.
12. Test, inspect, and scale carefully.
