/** * bench/adaptation.ts — what does ON-PREM ADAPTATION COST? * * The rest of the harness measures how GOOD a model is. This measures how much * one write-through adaptation COSTS, which is the number an on-prem operator * needs before turning learning on: every run the host adapts on is CPU it is not * spending on the agent. * * It became measurable only once the gradient path was real. Before that a "fit" * was a forward pass plus an inert optimiser step, so any timing was a timing of * the wrong thing. * * The three knobs are the ones the host actually exposes * (`agent-runtime/src/infra/project-evermind-delta.ts`, and the cloud * coordinator's identical constants): * * • WINDOW — `ADAPT_WINDOW_TOKENS = 64`, the length of each training sequence * the run text is chunked into; * • EPOCHS — `new EvermindLMTrainer(lm, { epochs: 1 })`, passes per contribution; * • SKIP — `MIN_TEXT_CHARS = 20`, the floor below which a contribution is * dropped before any work happens; expressed here as how OFTEN the * floor fires. * * Two quantities are reported, and the difference matters. `positionsEvaluated` * comes from the model's own counter: exact, integer, hardware-independent — the * thing a curve should be asserted on. `elapsedMs` is what those positions cost on * THIS machine, which is what an operator budgets with and what no assertion * should depend on. */ import type { AdaptationCostOptions, AdaptationCostReport } from "./types.js"; /** * Chunk token ids into fixed-length training windows, dropping any tail too short * to have a next-token target. * * A byte-for-byte mirror of the host's own `windows()` helper, so a benchmarked * fit sees exactly the batches a production adaptation would. */ export declare function tokenWindows(ids: number[], size: number): number[][]; /** * How many of `requests` actually adapt at a given skip rate. * * Deterministic rather than sampled: a benchmark whose cost curve moved with an * RNG would be measuring the RNG. */ export declare function adaptationsAfterSkip(requests: number, skipRate: number): number; /** * Measure adaptation cost across a grid of (window, epochs, skip rate). * * Each grid point starts from a FRESH model, so the points are independent * measurements rather than a single model drifting through the grid (a diverged * checkpoint would otherwise make later points look different for reasons that * have nothing to do with cost). */ export declare function benchmarkAdaptationCost(opts?: AdaptationCostOptions): AdaptationCostReport; /** Render an {@link AdaptationCostReport} as a fixed-width table. */ export declare function formatAdaptationCostReport(report: AdaptationCostReport): string; //# sourceMappingURL=adaptation.d.ts.map