Skip to content

Tracking: modular decision inference in geistlib #583

Open
3 of 5 issues completed
Open

Description

@geisten

Goal

Add optional, application-neutral decision inference to geistlib: score explicit alternatives or trained classifier outputs without generating an answer string. Measure speedups at a declared, matched decision-quality target; do not treat Jev's advertised workflow ratios as a universal acceptance threshold.

Current foundation

As of main d2641c9, Bonsai 2 support already exists: PQ2_0, prism.hadamard, backend kernels and end-to-end coverage. Reuse it rather than creating a second format implementation.

Architecture and rollout

  • An additive, EXPERIMENTAL decision API with its own handle/options; immutable model weights remain shared and mutable state/workspace is owned by each decision instance.
  • A new decision build feature, disabled by default initially (proposed build spelling: DECISION=1), plus explicit instance-level readout selection. Existing Bonsai support is already shipped and must not become disabled by default as a side effect.
  • Start with selected answer-token scoring. Add an optimized selected-row readout behind the same contract after reference parity is established.
  • Resolve capabilities and allocate workspace at creation/plan time. Unsupported modes return GEIST_E_UNSUPPORTED; no silent fallback that changes score semantics.
  • Prompts, chat templates, JSON schemas, routing policy and application datasets remain with consumers, per docs/README.md. The library exposes numeric inference mechanisms.
  • Trained heads and multi-question evaluation are separate, gated research items.

Delivery

Use one bounded branch/PR per implementable issue, based on current main. The initial branch is codex/decision-scoring. Merge complete pieces behind the disabled decision feature; avoid a long-lived integration branch. Organize with the decision-inference and bonsai labels and this tracking issue; no separate GitHub Project.

Implementation

Delivered: #585 was merged in #592, and #586 was merged in #599. The additive API and selected-row readout remain behind the default-off DECISION=1 build feature. Evaluation infrastructure for #587 is in draft PR #608 on codex/decision-evaluation. The approved eight-question classic-MMLU development pilot is complete in #608: Metal first, then Apple CPU NEON, two trials per arm, cap512 and 128 calls/backend. Exact selected/DENSE logits and deterministic repeats pass. Direct chat and reasoning each get 4/8; cloze gets 6/8; reasoning has four invalid capped answers per backend. Descriptive timing ratios are 2.168 (Metal) and 2.328 (CPU). Held-out quality-matched speedup and Jev equivalence remain unproven; #587 and #588 stay open for their remaining evidence.

Confirmed evaluation order: Apple Silicon first (cpu_neon and Metal), MMLU first in #587; other backends follow later. The #586 measurement artifact documents strong head-only savings but no reliable Bonsai whole-query improvement. Quality-matched speedup remains unproven until #587.

Deferred research

Existing Bonsai work

These existing issues are related history, not duplicate implementation tasks or newly reopened blockers. Revalidate the relevant behavior as part of #587.

Definition of done

  • Feature-on and feature-off configurations have explicit, tested API behavior.
  • Existing text generation, logits access and embedding inference retain their contracts and quality.
  • Score semantics distinguish full-vocabulary probabilities, probabilities conditional on supplied alternatives, and empirically calibrated correctness estimates.
  • Benchmarks pin model/runtime revisions, tokenizer/prompt construction, hardware/backend, input/output lengths, question count, cache state and concurrency. Publish raw results, p50/p95, memory, decision quality and calibration where applicable.
  • Compare against both an optimized one-token/score baseline and ordinary generative/reasoning workflows. Report negative results and the cost of any fallback.
  • Follow AGENT.md: checked geometry, defined failure outputs, no hot-path allocation, required release/sanitizer/gcc checks and performance gates for each relevant implementation PR.

References

Activity

  1. added
    enhancementNew feature or request
    decision-inferenceOptional decision scoring, classifier heads, calibration and quality-matched inference benchmarks
    bonsaiBonsai model support, Prism ternary formats, correctness and performance
    on Oct 3, 2026
  2. geisten commented on Oct 4, 2026

    @geisten
    OwnerAuthor

    Next bounded step for #587: draft PR #608 (codex/decision-evaluation) adds offline preparation, calibration and paired quality/latency reporting after merged #592/#599. Module rollout remains default-off. CPU/Metal synthetic integration and required local checks pass; there is no Bonsai MMLU result or Jev performance claim yet. #587 retains the pending campaign decisions, external Prism parity and actual calibration/test evidence.

  3. geisten commented on Oct 5, 2026

    @geisten
    OwnerAuthor

    The configuration/preprompt question has now been resolved with the user: these policies live in geist-runtime / geistr, not in geistlib's engine. The same model may expose normal chat and opt-in fixed-option decisions, sharing immutable weights with isolated state. Each request chooses its operation explicitly; ordinary chat defaults remain unchanged. Unsupported requests fail rather than silently generating an answer.

    Five scoped runtime tickets now carry the implementation plan and acceptance criteria:

    1. feat(decision): opt-in per-model decision configuration and request contract geist-runtime#13 — default-off model permission and request/configuration contract.
    2. feat(decision): checkpoint-bound Bonsai 2 and Gemma 4 no-thinking profiles geist-runtime#14 — verified Bonsai 2 / Gemma 4 E2B-it no-thinking profiles and single-token boundaries.
    3. feat(decision): isolated runtime bridge to the existing geistlib scoring API geist-runtime#15 — wrapper around the existing capability and DENSE/SELECTED_ROWS scoring API.
    4. feat(geistr): explicit decide command and visible per-model decision capability geist-runtime#16 — geistr decide and visible per-model variant selection through the C API.
    5. eval(decision): Apple profile parity, latency and Gemma 4 quality evidence geist-runtime#17 — Apple parity/correctness, latency and Gemma evidence.

    The runtime work follows the existing geisten/geist-serve#149 epic and runtime foundations #1/#2/#4/#5/#11; #1 requires maintainer-reviewed API design before extraction. The decision bridge starts EXPERIMENTAL and revision-bound; #622 handles any later promotion of the exact required engine symbols. Existing #585/#586 scoring work is reused, not duplicated.

    #587 retains Bonsai quality/calibration/native-Prism ownership. #588 training and #589 shared-state optimization remain deferred. ModernBERT/Laya remain Python reference models; these tickets do not imply native encoder architectures. First work is finite supplied text options, Bonsai 2 PQ2_0 plus Gemma 4 E2B-it Q4_K_M, Apple CPU NEON/Metal and MMLU. No free model-generated JSON/text or HTTP/UI rollout is included. No new project was created.

  4. geisten commented on Oct 8, 2026

    @geisten
    OwnerAuthor

    Status (sweep 2026-10-08): the tracking issue is still valid. #587 waits for the M1 Max campaign (draft PR #608). #588 and #589 are deferred until #587's findings, as their bodies say, so I'm not starting them.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bonsaiBonsai model support, Prism ternary formats, correctness and performancedecision-inferenceOptional decision scoring, classifier heads, calibration and quality-matched inference benchmarksenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions