ARTI
ExamplesCMRC2018

Read a passage on your own computer

Chinese passages. Answers on your computer.

First load the saved program and answer your own passage on CPU. When you want to change the learned component, use the full training case and its measured comparison.

Qwen3-0.6B · First answer / CPU · Retraining / GPU

Reading exampleQwen3-0.6B + ARTI
Your passage
北城图书馆工作日上午九点开馆,周六上午十点开馆,周日闭馆。图书可以借阅21天,每本图书允许续借一次。
Your question

图书可以借阅多久?

Generated answer21天

Actual output from the program included in the starter. Check answers to your own material against its source.

THE SHORTEST PATH TO AN ANSWER

Load what is saved. Ask your question.

The starter contains the previously trained English and Chinese Formula inference programs, a tokenizer and a CPU script. You can run it before downloading the training data or creating a GPU environment.

The ZIP is 5.2 MB. The first run separately downloads the pinned 1.2 GB Qwen base and Python dependencies. Later runs reuse the downloaded model files.

The CPU example uses owned material, separate from benchmark scoring. This small model can misread a passage; inspect its answer against the source.

01 / THE IDEA

One passage. One grounded answer.

For a Chinese knowledge assistant, a factual answer has to survive changes in wording. This case asks the model to find the answer in a supplied Chinese passage.

Input
A complete passage and a question.
Output
A short answer generated by the model.
Learning
Only the final answer and native end token are supervised. The passage, question and padding are masked.
Program
A rank-32 nonlinear residual program after the last two MLPs. 131,072 trainable values; the base stays frozen.
Qwen3frozen base
down → SiLU → uplearnable Formula program
residualsame hidden shape

This case uses ARTI’s public Formula adapter profile. It does not exercise architecture search or forward plasticity.

02 / OPTIONAL: TRAIN A NEW PROFILE

Change the learned component. Then measure it.

These GPU steps reproduce the trained profile and comparison. They are separate from the CPU starter above.

1

Make a place to work.

Download the Python files and requirements above into one directory. Training requires a CUDA GPU and a compatible PyTorch installation. The dependency file pins the software used by the reproduction script.

Terminal / install into an isolated environment
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install torch==2.11.0 --index-url https://download.pytorch.org/whl/cu128
.\.venv\Scripts\python.exe -m pip install -r reading-requirements.txt

The training and prediction commands below follow this environment choice automatically. No activation is required.

2

Prepare the questions, then train.

The script downloads the pinned public model and author-hosted data, retains original IDs, and builds the same 512 / 128 / 256 train / validation / heldout split used here. Nothing is silently truncated.

Terminal / this case
.\.venv\Scripts\python.exe reading_qa.py prepare --work reading-qa-work
.\.venv\Scripts\python.exe reading_qa.py run --work reading-qa-work --language cmrc --method arti --seed 17

The first preparation downloads about 1.2 GB of model weights plus tokenizer and datasets. They stay in reading-qa-work and are reused. Training runs for 200 updates, batch 8, with no heldout checkpoint selection.

3

Read the files you get back.

native-run/model/
The inference asset, Formula declaration and tokenizer. The frozen base remains a separate pinned dependency.
native-run/checkpoints/
Training state for continuation: parameters, optimizer, RNG and the data cursor.
predictions.json
Every heldout ID, actual generated answer, references, EM and F1.
result.json
The measured score, parameter count, resource scopes and source identity.

The downloadable runner uses the native recipe underneath. If you already have chat JSONL data, start from its configuration instead.

Python / CausalLMRecipe
from pathlib import Path
from huggingface_hub import snapshot_download
from transformers import AutoTokenizer
from arti.language_recipe import CausalLMRecipe
from reading_qa import BASE, REVISION, config, load_base

work = Path("reading-qa-work").resolve()
base = snapshot_download(BASE, revision=REVISION,
    cache_dir=work / "hub-cache", local_files_only=True)
settings = config(work, "cmrc", 17, work / "my-native-run")
recipe = CausalLMRecipe(settings, model=load_base(base),
    tokenizer=AutoTokenizer.from_pretrained(base))
print(recipe.plan())
result = recipe.fit()
print(result["model"])

Understand the training configuration →

03 / THE ANSWERS

Judge the answer. Keep the evidence.

Same frozen base and parameter budget. Scores come from actual greedy generations, using the official scorer for this dataset.

EM Answers matching a reference under the task scorer. F1 Overlap between generated and reference answer text.

CMRC2018 · 256 fixed questions

Frozen base

Trainable values · 0

EM ↑
46.88
F1 ↑
71.71
SiLU residual · PyTorch

Trainable values · 131,072

EM ↑
48.31 ± 0.23
F1 ↑
72.15 ± 1.23
LoRA · PEFT

Trainable values · 131,072

EM ↑
46.88 ± 1.95
F1 ↑
70.77 ± 1.40
SiLU residual · ARTI

Trainable values · 131,072

EM ↑
48.31 ± 0.23
F1 ↑
72.15 ± 1.23
CMRC2018 · 256 fixed heldout questions
Formula / implementationParametersEM ↑F1 ↑
Frozen baseone frozen-base run046.88—71.71—
SiLU residual · PyTorch3 random seeds131,07248.31± 0.2372.15± 1.23
LoRA · PEFT3 random seeds131,07246.88± 1.9570.77± 1.40
SiLU residual · ARTI3 random seeds131,07248.31± 0.2372.15± 1.23

EM / F1 are percentages, mean ± sample standard deviation over seeds 17, 29 and 43. The frozen base is measured once. This is a fixed public-dev slice, not an official hidden-test leaderboard result.

Read the formula behind the score.

This case selects a SiLU residual after the final two MLPs. The PEFT row uses standard LoRA on value projections. Those are different formulas and mounting positions; their scores compare the selected configurations, not the expressive power of the frameworks.

LoRA itself can be a Formula. For an implementation comparison, keep the formula, A/B weights, mounting, scale and precision identical. The paired check follows that boundary before discussing broader program composition.

The saved nonlinear program here retains its declaration and values. Its independent reload reproduced 512 heldout answers across the two languages; its three-update continuation retained matching parameters and data cursor.

Read the first heldout question and all answers
单星是不和任何其他同类星体组成聚星系统的单一天体。恒星、行星、小行星都存在单星系统。长久以来人们一直认为宇宙中大部分的恒星是聚星系统。以双星和三合星较为多见。单星反而较少。然而,根据2006年的一项研究,银河系中的主序星有2/3都是单星,改变了人们的传统认识。单星构成的恒星系统最为简单,围绕恒星运行的小星体(例如行星)的轨道比较简单,不会因为受到多个大天体的影响而走出怪异的路线,从而较容易维持合适的环境、温度和光照,有利于生命的存在。单星也可能因为位置的缘故,被人错认为和另一颗恒星组成双星。实际上两者之间并无相互旋转的运动关系。这样的双星被称为光学双星。太阳一般认为就是一个单星。尽管存在着未经证实的太阳伴星的传闻。可能是因为形成方式的不同,行星和小行星大多是单星。只有少数的小行星或者卫星构成双星系统。但是某些大型的卫星有时也被认为是与自己的母星构成双行星系统。例如:

单星的定义是什么?

Frozen base / seed 17

单星是不和任何其他同类星体组成聚星系统的单一天体。

SiLU residual · PyTorch / seed 17

单星是不和任何其他同类星体组成聚星系统的单一天体。

LoRA · PEFT / seed 17

单星是不和任何其他同类星体组成聚星系统的单一天体。

SiLU residual · ARTI / seed 17

单星是不和任何其他同类星体组成聚星系统的单一天体。

First question in the fixed order, seed 17; no score-based example selection. CMRC2018 · CC BY-SA 4.0 · DEV_479_QUERY_0

04 / YOUR MATERIAL

Ask your next question.

In the CPU starter, run the interactive command and paste a short passage. You can ask several questions without loading the model again.

Open the complete interactive command for your platform →
After GPU training: predict with that new asset

Create questions.jsonl with one complete ID/passage/question object per line. This path uses the asset produced by the optional GPU steps.

questions.jsonl
{"id":"my-question-001","context":"图书馆工作日上午九点开门,周六上午十点开门,周日闭馆。","question":"图书馆周六几点开门?"}

Terminal / trained GPU asset
.\.venv\Scripts\python.exe reading_predict.py --work reading-qa-work --asset reading-qa-work/cmrc/arti-17/native-run/model --language zh --input questions.jsonl --output answers.jsonl

Train only when you need to change the program.

Bring your own train/validation split, inspect missed answers, and evaluate on untouched questions. The fixed benchmark provides a reproducible protocol; its scores are specific to those slices.

Continue a saved training run →