Commit Graph
14 Commits
Author SHA1 Message Date
wassname addf47c5a0 quiet pmass-low warning: one summary per batch
Was emitting `logger.warning("pmass=0.XX<0.9 — top-5: ...")` per-row, which
spammed the log heavily during heavy-steering eval (many rows go OOD at once).
Now collects all low-pmass rows in the batch and emits one summary line with
the worst-case top-5, e.g.:

    pmass<0.9 on 7/16 rows in this batch; worst=0.412 top-5: '1'=0.40, ...

Same diagnostic signal, ~16× fewer log lines per batch.
2026-05-03 06:50:19 +08:00
wassname e996d57051 batch the eval: guided_rollout_batch + 4× speedup
Sequential eval was the bottleneck (~12s/vignette × 131 = 27 min/pass; with
bidirectional ±C × 14 methods, that projected to ~17 h). Three model calls
per row (phase1 generate, scoring forward, cosmetic continuation) became one
phase1 + one scoring per *batch*; continuation generate dropped (callers
only use p_true + pmass_format).

Parity smoke (scripts/smoke_batch_parity.py): float32 is bit-exact (max
Δp_true=0.0000 over 16 prompts, 4.3× speedup at limit=4). bf16 drifts on
individual rows — greedy argmax flips at near-tie tokens then phase1
diverges — but pmass agrees within 0.03 (scoring forward correct) and
aggregates over 131 vignettes will average out the per-row noise.

Other changes shipped in this commit:
- core.py: analyse() now returns raw_pmass dict alongside raw p_true (callers
  needed per-(vid,cond,frame) pmass for diagnostic warnings).
- guided.py guided_rollout: warn + log top-5 when pmass<0.9 (catches OOD
  steering / format-broken vignettes without a separate audit pass).
- eval.py: pre-tokenize a sample to log expected prompt+cache budget so OOM
  is predictable from the SHOULD line; group items by frame so each batch
  shares schema_hint + prefill.
2026-05-03 06:42:17 +08:00
wassname (Michael J Clark) 7867a677d0 Update README.md 2026-05-03 05:51:05 +08:00
wassname ac1c8cf7bb package 2026-05-02 16:51:15 +08:00
wassname b6f24cac1c add human labels 2026-05-02 15:58:08 +08:00
wassname 0f8048d5d9 Implement N-token evaluation with guided rollouts
- Refactored evaluation logic in `src/tinymfv/eval.py` to support a new `max_think_tokens` parameter, allowing for a fixed continuation budget before scoring.
- Introduced `guided_rollout` function in `src/tinymfv/guided.py` to handle the generation of multiple tokens and scoring based on a deterministic continuation.
- Updated the CLI in `scripts/03_eval.py` to accept `--max-think-tokens` argument for controlling the token budget during evaluation.
- Created a new specification document `docs/spec/20260501_n_token_eval.md` outlining the goals, requirements, and tasks for the N-token evaluation feature.
- Simplified the record creation in `scripts/02_rewrite.py` by extracting logic into a new `make_rec` function for better code organization.
2026-05-01 21:44:14 +08:00
wassnameandClaude Opus 4.7 a9412ee226 move openrouter-wrapper to dev-only dep group
Only used by scripts/0{2,4,6}_*.py for data prep, not by the installable
src/tinymfv/ package. Keeping it in [project].dependencies leaked a local
editable path dep into the built wheel's runtime requires.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 05:38:35 +08:00
wassname 52e91e1699 readme 2026-04-30 21:46:56 +08:00
wassname e5cacc0c29 readme 2026-04-30 21:45:23 +08:00
wassname 234424161c wip 2026-04-30 21:39:53 +08:00
wassnameandClaude Opus 4.7 a2e3124e06 fix airisk self_violate actor archetype + simplify to 2 conditions
other_violate is now the verbatim source (no LLM), only self_violate is
rewritten. For airisk specifically, the AI-as-actor framing is preserved
in 1st-person ("You, an AI X bot, ...") since a naive "You ..." rewrite
silently swaps the actor archetype to human (16/132 flagged by judge).

Pairwise consistency check (06_consistency.py) verifies same-situation
across the perspective shift. After the fix:
- clifford 97.7% same
- scifi    99.2% same
- airisk   86.3% -> 100.0% same

First eval signal on Qwen3-0.6B: airisk wrongness=+0.70, gap=+0.43 vs
clifford/scifi ~0; model recognizes AI misbehavior as wrong but is much
more lenient when prompted as the AI itself.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 21:29:38 +08:00
wassname 252e62abb7 decent 2026-04-30 21:22:07 +08:00
wassname a155f5594b valdiation 2026-04-30 20:08:12 +08:00
wassname ebf161b658 init 2026-04-30 17:10:09 +08:00