Kina.ai

Specification

ADR: StoryLM-0 functional AdamW

Context

AGENTS.md step 4 asks for functional SGD before AdamW. Section 11 locked SGD as w - broadcast(lr) * g. Section 15 applies that rule to every decoder weight. Common LLM training uses AdamW (moments, bias correction, decoupled weight decay).

A new adamw primitive would invent fusion, mutability, and a step clock that the numbered specs do not define. Tensor-literal payloads are discarded, so constants must be host tensors.

Decision

Specify AdamW as the existing composition in 16-functional-adamw.md: PyTorch AdamW algebra, host-provided scalars including one and host-computed β**t, result (w', m', v'). No new operator. Do not differentiate through the update. Do not add argmax or sampling in this slice.

Consequences