Run bounded native training jobs
Own a fine tuning plan, inspect a background job and save an exact continuation checkpoint.
// Run from a fresh output directory: model/adapter publication never overwrites.
// This bounded native fixture is not a pretrained text-quality benchmark.
import aner.token
import aner.gen
import aner.nn
nn.configure("cpu", "Float64", "preserve")
let codec = token.byte_tokenizer()
let training = token.corpus(codec, List("abba abba", "baab baab"), role: "training")
let validation = token.corpus(codec, List("held out scientific observation"), role: "validation")
let base = gen.decoder(codec, context: 8, width: 4, heads: 2,
layers: 1, seed: 41, dropout: 0.15)
let adapted = base.lora(List("block.0.qkv"), rank: 2, alpha: 4.0, seed: 71)
let plan = gen.fine_tune_plan(adapted, training, validation,
steps: 6, batch: 2, rate: 0.01, seed: 23,
clip_norm: 1.0, warmup_steps: 2, weight_decay: 0.01)
print(plan.summary())
print(plan.memory_summary())
let job = plan.start()
let result = job.wait()
print(job.status())
print(job.completed_steps())
print(job.trained_tokens())
print(result.validation_loss())
print(result.completed())
result.save_model("training-job.anergen")
result.save_adapter("training-job.anerlora")
let continuation = gen.resume_plan("training-job.anergen", training, validation, steps: 2)
let continued = continuation.start().wait()
print(continued.model().steps())
continued.save_model("training-job-continued.anergen")
Make it your experiment.
Use the matching development runtime. Save this program as examples/generative_training_jobs.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/generative_training_jobs.aner
aner run examples/generative_training_jobs.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Requires the matching unreleased runtime with bounded native training jobs. Uses synthetic byte tokenizer data. Run from a fresh writable directory because checkpoints and exports refuse existing destinations. This job API applies to bounded models; pretrained training is synchronous.
aner check examples/generative_training_jobs.aner
aner run examples/generative_training_jobs.anerBundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution