ARTI
ExamplesSQuAD 1.1

Read a passage on your own computer

English reading. A local answer.

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
Orders placed before 2 pm ship the same day. Standard shipping takes 3 business days. Returns are accepted within 30 days of delivery.
Your question

How many days after delivery can an item be returned?

Generated answer30

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.

A useful first step toward a document assistant: give the model one passage and one question, then ask for a short answer grounded in that 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 squad --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, "squad", 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.

SQuAD 1.1 · 256 fixed questions

Frozen base

Trainable values · 0

EM ↑
55.08
F1 ↑
62.56
SiLU residual · PyTorch

Trainable values · 131,072

EM ↑
55.60 ± 0.81
F1 ↑
62.43 ± 0.54
LoRA · PEFT

Trainable values · 131,072

EM ↑
56.77 ± 1.85
F1 ↑
64.22 ± 1.50
SiLU residual · ARTI

Trainable values · 131,072

EM ↑
55.60 ± 0.81
F1 ↑
62.43 ± 0.54
SQuAD 1.1 · 256 fixed heldout questions
Formula / implementationParametersEM ↑F1 ↑
Frozen baseone frozen-base run055.08—62.56—
SiLU residual · PyTorch3 random seeds131,07255.60± 0.8162.43± 0.54
LoRA · PEFT3 random seeds131,07256.77± 1.8564.22± 1.50
SiLU residual · ARTI3 random seeds131,07255.60± 0.8162.43± 0.54

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
Kenya has proven deposits of oil in Turkana and the commercial viability was just discovered. Tullow Oil estimates Kenya's oil reserves to be around 10 billion barrels. Exploration is still continuing to determine if there are more reserves. Kenya currently imports all crude petroleum requirements. Kenya, east Africa's largest economy, has no strategic reserves and relies solely on oil marketers' 21-day oil reserves required under industry regulations. Petroleum accounts for 20% to 25% of the national import bill.

How many barrels of oil is it estimated Kenya has?

Frozen base / seed 17

10 billion

SiLU residual · PyTorch / seed 17

10 billion

LoRA · PEFT / seed 17

10 billion

SiLU residual · ARTI / seed 17

10 billion

First question in the fixed order, seed 17; no score-based example selection. SQuAD 1.1 · CC BY-SA 4.0 · 57291f153f37b31900478044

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":"The library opens at 9 am on weekdays. On Saturday it opens at 10 am. It is closed on Sunday.","question":"When does the library open on Saturday?"}

Terminal / trained GPU asset
.\.venv\Scripts\python.exe reading_predict.py --work reading-qa-work --asset reading-qa-work/squad/arti-17/native-run/model --language en --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 →