Cree1865 / README.md
HarleyCooper's picture
Update Cree1865 model card: Cree-rubric run hda2wqhl + reward-ledger charts
6091549 verified
|
Raw
History Blame Contribute Delete
9.52 kB
---
language:
- crk
- en
license: apache-2.0
library_name: peft
pipeline_tag: text-generation
base_model: Qwen/Qwen3-30B-A3B-Instruct-2507
tags:
- cree
- nehiyawewin
- indigenous-languages
- low-resource-language
- dictionary
- grammar
- reinforcement-learning
- grpo
- tinker
- thinking-machines
- peft
- lora
widget:
- text: "Translate 'a good man' to Cree, preserving the 1865 orthography. Return only the answer."
- text: "Give the Cree for 'abandon' from Watkins 1865. Return only the answer."
---
<div align="center">
<img src="./assets/cree_dictionary_hero_banner.png" alt="Cree1865 — one 1865 Cree dictionary, rebuilt as a training loop" width="100%">
<h1>Cree1865 &middot; Tinker RL Adapter</h1>
<b>A reinforcement-learning adapter that read Rev. E. A. Watkins' 1865 <i>Dictionary of the Cree Language</i> and was scored against a deterministic, decomposed Cree reward ledger.</b>
<br><br>
<img src="https://img.shields.io/badge/Base-Qwen3--30B--A3B--Instruct-1a2a6c?style=flat-square">
<img src="https://img.shields.io/badge/Adapter-LoRA%20r32-7b1fa2?style=flat-square">
<img src="https://img.shields.io/badge/Method-GRPO%20%C2%B7%20Cree%20rubric-000000?style=flat-square">
<img src="https://img.shields.io/badge/Infra-Thinking%20Machines%20Tinker-b21f1f?style=flat-square">
<img src="https://img.shields.io/badge/Language-crk%20%C2%B7%20en-c9962b?style=flat-square">
<img src="https://img.shields.io/badge/License-Apache%202.0-2e7d32?style=flat-square">
<br>
<img src="https://img.shields.io/badge/Run-hda2wqhl%20%C2%B7%20800%20steps-2e7d32?style=flat-square&logo=weightsandbiases&logoColor=white">
<img src="https://img.shields.io/badge/Lineage-Dakota1890%E2%86%92Cree1865-555?style=flat-square">
</div>
---
## Overview
This is a **GRPO reinforcement-learning adapter** on `Qwen/Qwen3-30B-A3B-Instruct-2507`, trained for **Cree (nēhiyawēwin) dictionary and orthography behavior** drawn from a single historical source: **Rev. E. A. Watkins' 1865 _A Dictionary of the Cree Language_**.
It is a research bootstrap artifact built with the **Dakota1890** pipeline, retargeted to Cree. Training scores each sampled answer against a **deterministic Cree verifier** — no LLM judge — and logs every reward channel independently so failures can be read, not guessed.
> **Scope, stated plainly.** This is not a Cree language authority, a fluent-speaker replacement, or a production translator. It is a first, correctable model — the working endpoint for a community-in-the-loop second stage. Nēhiyawēwin belongs to its communities; this repository is a transparent technical artifact built in service of that work, not over it.
---
## Model Details
| Field | Value |
|---|---|
| Base model | `Qwen/Qwen3-30B-A3B-Instruct-2507` |
| Adapter | LoRA, rank 32 (PEFT) |
| Method | GRPO (grouped rollout RL) with a deterministic **Cree** reward ledger |
| Infrastructure | Thinking Machines Tinker |
| W&B run | [`hda2wqhl`](https://wandb.ai/christian-cooper-us/thinking-machines-qwen3-30b/runs/hda2wqhl) — `cree1865-synthetic-expansion-v1` |
| Steps | 800 |
| Batch / group size | 16 / 8 |
| Max sampled tokens | 256 |
| Temperature | 0.9 |
| Learning rate | `4e-5` |
| Tinker session | `9d734fdb-7851-5f2f-9949-e9e574eb9a55` |
| Languages | Cree `crk`, English `en` |
| Source | Watkins 1865 — Internet Archive `cihm_41985` |
| License | Apache-2.0 (code) · Public Domain (1865 text) |
---
## Training Data & Methodology
Everything derives from **one public-domain book** — a bilingual, two-part 1865 dictionary.
| Part | Direction | PDF pages | State |
|------|-----------|:---------:|-------|
| Front matter | pronunciation key + notes | 1–28 | reference |
| **Part I** | **English → Cree** | 29–210 | extracted |
| **Part II** | **Cree → English** | 212–end | extracted |
**Extraction snapshot** (full local build, 2026-06-24):
<div align="center">
| Pages | Usable entries | Multi-variant | SFT (train/val) | RL tasks |
|:-----:|:--------------:|:-------------:|:---------------:|:--------:|
| **463** | **19,560** | **4,049** | **18,463 / 972** | **38,870** |
</div>
Structured entries become a synthetic Q&A prompt bank and a set of verifiable RL tasks (English↔Cree translation, orthography, containment). This run trained on the balanced synthetic-expanded task set (`rl_tasks_synthetic_expanded_balanced.jsonl`).
---
## Reward Function
A **composite, deterministic** reward — every channel is checkable by code, logged, and inspectable:
| Channel | Weight | Verifies |
|---|:--:|---|
| Exact match | 0.20 | Normalized response equals the Watkins-derived answer |
| Target containment | 0.25 | Expected answer appears inside the response |
| Orthography recall | 0.20 | Cree marks, hyphens, apostrophes, and accents preserved |
| Character F1 | 0.20 | Spelling-level overlap for near misses |
| Concise length | 0.15 | No padding a lookup answer with unsupported text |
The verifier logs raw channel values, weighted contributions, the reconstructed composite, and a `composite_diff` for full auditability. This is the `cree` rubric — the run below was scored against exactly these channels.
---
## Reward Ledger (run `hda2wqhl`)
Logged live to W&B for all 800 steps and pulled directly from the run.
<div align="center">
<img src="./assets/cree_full_run_dashboard.png" alt="Cree reward ledger dashboard for run hda2wqhl" width="100%">
</div>
What the curves show, honestly:
- **Composite reward rises** from about `0.15` to a smoothed `~0.30` band — real upward movement, though noisy.
- **Concise length is the strongest channel**, climbing to roughly `0.95` and holding; it is the largest weighted contribution at the end.
- **Character F1 and orthography recall both contribute** and move in the `0.3``0.45` range, which is where orthographic learning is visible.
- **Exact match and target containment stay near `0.0`.** For short answer-only lookups these are the honest ceiling on composite reward and the clearest targets for the next iteration.
- **Policy entropy converges**, peaking early then settling to about `0.1``0.2` — the policy committing to a narrow answer style.
<table>
<tr>
<td width="50%" align="center">
<img src="./assets/cree_reward_progression.png" alt="Composite reward progression" width="100%">
<br><em>Composite reward, raw and smoothed.</em>
</td>
<td width="50%" align="center">
<img src="./assets/cree_reward_components.png" alt="Cree reward channels over training" width="100%">
<br><em>Each Cree reward channel, tracked independently.</em>
</td>
</tr>
</table>
No fluency or community-validation claim is made from this run. The useful signals are per-channel reward movement, English→Cree versus Cree→English asymmetry, and orthography behavior on held-out prompts.
---
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_name = "Qwen/Qwen3-30B-A3B-Instruct-2507"
adapter_name = "HarleyCooper/Cree1865"
model = AutoModelForCausalLM.from_pretrained(
base_model_name, device_map="auto", torch_dtype="auto", trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
model = PeftModel.from_pretrained(model, adapter_name)
messages = [
{"role": "system", "content": "You are a Cree language assistant working from Watkins 1865. Return only the answer."},
{"role": "user", "content": "Translate 'a good man' to Cree, preserving the 1865 orthography."},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
Treat the output as a **first attempt** — a starting point for community correction, not a final answer.
---
## Limitations & Ethical Notes
The source is a **missionary-era dictionary published in 1865**. It reflects the orthography, analysis, and **colonial-era framing** of its time, recorded across the Hudson's Bay territories. Outputs can inherit mistakes, omissions, and outdated descriptions from both the source extraction and the base model.
- This is **not** a Cree language authority, a fluent-speaker replacement, or a production translation system.
- Many tasks are dictionary lookups, not natural conversation; the reward verifies lookup behavior, not communicative fluency.
- Cree language work should be reviewed with **appropriate community and linguistic expertise**.
- The model is designed to be **corrected**: it is the working endpoint for a community-in-the-loop stage, not a finished teacher.
- No community has certified this model as fluent, authoritative, or safe for language instruction.
---
## Citation
> **Watkins, E. A. (1865).** *A Dictionary of the Cree Language, as Spoken by the Indians of the Hudson's Bay Territories.* London: Society for Promoting Christian Knowledge. Internet Archive: `cihm_41985`.
```bibtex
@misc{cree1865_model,
title = {Cree1865: A Single-Volume GRPO Cree Language Adapter},
author = {Cooper, Christian Harley},
year = {2026},
note = {Base: Qwen/Qwen3-30B-A3B-Instruct-2507. Source: Watkins 1865 (IA cihm_41985).
Method derived from Dakota1890.}
}
```
**Infrastructure & lineage:** Thinking Machines Tinker (RL), Anthropic (VLM extraction), and the [Dakota1890](https://github.com/HarleyCoops/Dakota1890) pipeline this work replays.