Commit Graph
46 Commits
Author SHA1 Message Date
wassnameandClaudypoo dfa9cdfe5a quiet per-eval logging (INFO->DEBUG) + trim README to use-focused 120 lines
Per-eval INFO lines (rows/think_tokens/aux-stats/first-row/profile/demos) demoted to
DEBUG so a consumer calling evaluate() ~47x/run is not drowned; one-time + WARNING+ kept.
README 308->120: cut process-archeology + per-instrument showcase, added crisp dlogit
and SI definitions for new users.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 18:51:39 +08:00
wassnameandClaudypoo f5fc6302d4 validation: 82.6% is irreproducible -- its OWN code gives 0.780 on Qwen3-4B
Ran the exact 2026-05-08 eval (worktree at commit b20ec56, word readout) on
Qwen3-4B: top1 0.780, not 0.826. Every eval version agrees on ~0.78 (digit 0.773,
word-current 0.788, word-original 0.780). The 82.6% was a stale/erroneous table
entry, not a target this model reaches under any pipeline. Canonical value 0.773.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 04:42:49 +08:00
wassnameandClaudypoo 52b9688de5 README: word readout reads 0.788 not 0.826 -- 0.83 unreachable in current eval
Tested the documented cause (the old word-first-token gather): top1 0.788 on
Qwen3-4B, only ~1.5pt above digit (0.773), not the table's 0.826. So even
reverting the readout does not recover it; the 82.6% came from the broader
2026-05-08 pipeline. Current eval tops out ~0.77-0.79 by every lever.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 04:29:17 +08:00
wassnameandClaudypoo 4800066c1d README: model scale also caps top1 at 0.773 (Qwen3-8B), closing the 0.83 question
Third independent lever ruled out: Qwen3-8B reads exactly 0.773 like Qwen3-4B, so
0.83 is unreachable with the debiased digit readout at any fitting model size. The
gap is purely the superseded word-readout method.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 04:12:02 +08:00
wassnameandClaudypoo d9fecd503d explain MFV top1 0.77 vs 0.83: it's the word->digit readout debiasing
Exhausted the legitimate levers on the current (digit) readout: top1 0.72 (think
64), 0.77 (256, 512 collapses), 0.72 (BMA n_samples=8). The 82.6% required the old
word-first-token readout, replaced deliberately to drop the uneven-first-piece
word prior. 0.773 is the honest ceiling; 0.83 would need reverting the debiasing
(research poison). README note + journal updated.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 03:59:30 +08:00
wassnameandClaudypoo 1c8326d0ea README: add think-budget sensitivity (UAT2 -- steer delta grows with think)
MFQ-2 mean |steer delta| rises monotonically with the think budget: 0.068 (1) ->
0.149 (64) -> 0.319 (128) -> 0.682 (256), pmass >= 0.95. Proves the unified reader's
think budget carries the steer. Past ~512 the model closes </think> and the
readout collapses (coherent ceiling). Source: ablation_think_budget.py, job 228.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 03:31:15 +08:00
wassnameandClaudypoo d2a5cab4c9 README: fix -C side-instrument claims (neutral-collapse, not bidirectional)
Fresh-eyes audit caught it: big5/16pf/humor -C poles pin to the neutral midpoint
3.0 (degenerate profile, though pmass stays ~1.0), not the bidirectional move I
wrote. Only mfq2 and MFV are genuinely bidirectional at -C. Fixed big5
agreeableness -C (3.0 not 2.85) and minor MFV roundings.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 03:06:28 +08:00
wassnameandClaudypoo 82985b7bdd switch showcase to Qwen3-4B: coherent all poles, clean bidirectional steer
Qwen3-4B (the validation-table model) gives a fully coherent showcase: base/+C/-C
all pmass ~1.0 on ordinals and emitted_close <=9/264 on MFV, no -C collapse (that
was Qwen3.5-4B's gated-delta-net fragility). The Authority/Care vector moves the
MFV foundations apart bidirectionally (+C raises violations, -C lowers them and
raises "not wrong"), and also shifts agreeableness/16pf/humor -- a broad persona
axis, not an MFT-only or off-axis-null steer. Refresh the stale 82.6% validation
top1 to the reproducible 77.3%. README rewritten to match.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 03:02:41 +08:00
wassnameandClaudypoo 2cb580e202 README: correct mfq2 range text to match final figure (-C collapses loyalty/authority)
The old "+C lowers all, -C raises all" no longer matches: +C lowers most, -C is
mixed and collapses loyalty/authority into NaN (missing blue arm). Describe the
coherent +C arm as the readable steer and the -C pole as past coherent range.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 02:24:27 +08:00
wassnameandClaudypoo 12027350b9 README: report MFV showcase (base+pos coherent, -C over-steers), un-retract
The MFV base readout is coherent on Qwen3.5-4B (the earlier "excluded, base
incoherent" note was a misattribution of the -C pole's collapse + the bs=1 demo
NaN to base). +C is a moderate coherent steer; -C over-steers into the uniform
"everything is a violation" collapse, mirroring the ordinal -C instability. Adds
the MFV foundation-delta figure and the C-sweep follow-up note.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-25 02:22:37 +08:00
wassnameandClaudypoo 39d098f065 README: retract MFV showcase finding -- base readout was incoherent
The Qwen3.5-4B MFV base eval failed its own coherence canary (pmass=0.42,
top1_acc=0.28, mean_js/nll=NaN, demo p[f]=NaN), so the +6..+9 nat "everything is
a violation" deltas were a readout-collapse artifact, not a steering effect.
Remove the dumbbell + delta table + claim; keep only the coherent ordinal
showcase. MFV sensitivity delta lands once the vignette readout is coherent.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-24 14:51:38 +08:00
wassnameandClaudypoo 1b1910973a README: repoint hero images to the fresh Qwen3.5-4B showcase
The two top images still pointed at the pre-run figures; swap them for the real
mfq2 map/range from this run and drop the orphaned old PNGs.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-24 14:45:53 +08:00
wassnameandClaudypoo 5d0f19fcb6 README: real all-instrument steering showcase (Qwen3.5-4B)
One iso-KL calibrated mean-diff Authority/Care vector (C=+0.38) administered
across all 5 instruments from a steering-lite run_allinstr_showcase run.

- MFV dumbbell + delta table: -C lifts every violation-logit +6..+9 nats (the
  "everything is a violation" moral alien), +C near-inert except Social Norms -2.16.
- MFQ-2 map + range: near-uniform endorsement shift, every pole inside the human band.
- big5/16pf/humor ranges: off-axis nulls; humor base is itself the outlier.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-24 14:02:16 +08:00
wassnameandClaudypoo 1a450884e3 readme: add range-plot example + output-path scheme (map.png, range_<vector>.png); two plotting fns
Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-23 05:59:04 +08:00
wassnameandClaudypoo e613982c2e readme: moral-aliens framing -- map up top, design choices, dev/full modes
Reframes from MFV-only to the multi-instrument eval: leads with the LLM-vs-human-cultures
map and quickstart; documents the design choices (logprobs for sensitivity, sliding think
budget, fwd/rev position debias w/ arXiv:2308.11483, SI answer-flip metric, coherence
canary); dev (N=1 x 2 orderings, 64 think, greedy) vs full (N=4 x 2 orderings, high think,
+SI +sampling variance) modes; instrument zoo (MFV forced-choice working, Likert landed but
wiring in progress); used-in + moral_stories_foundations training labels. Preserves the
mechanism/labels/validation/citation content. Lint clean (humanizer).

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-21 10:27:09 +08:00
wassname fde697130d Merge branch 'main' of https://github.com/wassname/tinymfv 2026-06-18 21:32:07 +08:00
wassnameandClaudypoo 799042e16e readme: clarify informedness bullet
Lead with the plain point, introduce + link Youden's J, spell out the macro
averaging (one-vs-rest per foundation) and point at _informedness for the
formula. Fix stale "two scalars" -> "three". Drop the "flip-informedness"
coinage and "the headline" tell. External-panel comprehension pass: ready
(4.1/5), accuracy and caveats 4-5 across panelists.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-18 20:07:25 +08:00
wassnameandClaudypoo 205e96bf6a eval: add macro informedness (Youden's J) headline metric
Chance-corrected, argmax-only companion to mean_nll: moves when the answer
flips, not when confidence shifts. 0 = base-rate guessing, so it exposes
majority-class models that top1_acc flatters. Same flip-informedness family
as steering-lite's surgical informedness, anchored on the human argmax here.
README also points at the paired training set moral_stories_foundations.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-06-18 19:47:20 +08:00
wassname 49751fbeab refactor: update evaluation metrics to include pmass_allowed and nll_json 2026-05-21 06:05:16 +00:00
wassnameandClaude Opus 4.7 7d42568f8d guided: add n_samples / temperature / top_p for sampled think traces
Lets callers ask for N sampled think rollouts per direction instead of one
greedy trace. Per direction we Bayesian-model-average the answer logprobs
across the N samples (logsumexp_n lp - log N) before the fwd/rev average.
Raw per-sample [N, K] logprob matrices stay on the result as
lp_fwd_samples / lp_rev_samples so callers can re-aggregate (log-pooling,
majority vote, etc.).

gen_text and gen_text_rev are now always list[str] of length N (even at
N=1). think_tokens, think_tokens_rev, emitted_close, emitted_close_rev are
length-N lists. At N=1 the BMA is the identity and headline numbers match
the prior greedy path bit-for-bit.

Default max_think_tokens lowered 256 -> 64 for faster default eval (was
expensive overhead on small models that rarely emit </think> anyway).
README updated to match.

Phase 1.5 / Phase 2 already operated per-row, so they extend to B*N
expanded rows without change. Added an explicit assert that the HF
num_return_sequences expansion matches len(user_prompts) * n_samples.

Smoke-tested on Qwen3-0.6B: greedy N=1 matches BMA identity; N=4
temperature=0.7 returns [4, 7] sample matrices and finite pmass; guard
raises if n_samples>1 with temperature=0. evaluate() throughput log
extended to sum fwd+rev think tokens over all samples.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 01:17:23 +00:00
wassname e3b663d7f7 proofread 2026-05-13 10:48:28 +08:00
wassname cb31acff28 readme 2026-05-13 10:46:18 +08:00
wassname (Michael J Clark) 139c023bb0 Update README.md 2026-05-12 11:38:06 +08:00
wassname (Michael J Clark) 0b4381704f Update README.md 2026-05-12 11:30:04 +08:00
wassname (Michael J Clark) 9d13d7c44a Update README.md 2026-05-12 11:29:20 +08:00
wassname (Michael J Clark) 9db4a568d0 Update README.md 2026-05-12 11:11:42 +08:00
wassname (Michael J Clark) 844fe93821 Update README.md 2026-05-12 11:10:33 +08:00
wassname (Michael J Clark) ed90b79935 Update README.md 2026-05-12 11:05:02 +08:00
wassname b20ec56a09 forced-choice unification: drop legacy llm_/calibrated_, normalize human_*, justfile->09 2026-05-08 16:02:25 +08:00
wassname 8dfaf299ca rename 2026-05-08 15:30:06 +08:00
wassname c96d02a675 refactor 2026-05-08 15:15:14 +08:00
wassname d796df85c8 improved to have better airisk, better eval that distinguished factors 2026-05-08 14:04:56 +08:00
wassname d7a286acac docs: use simple emoji links for cross-referencing github and huggingface 2026-05-03 12:58:24 +08:00
wassname a8a35b308b docs: fix github repo links to point to wassname/tinymfv 2026-05-03 12:57:45 +08:00
wassname 898893d440 chore: remove uncalibrated raw LLM columns from final vignettes
- Updated scripts/07a_merge_labels.py to only merge calibrated_* and llm_dominant
- Updated README.md and scripts/05_upload_hf.py to reflect removed columns
- Re-merged and re-uploaded clean datasets to HuggingFace
2026-05-03 12:55:00 +08:00
wassname bcbdb9cc6f feat: multi-label moral foundation ratings with z-scored frame averaging and human calibration
- Add scripts/07_multilabel.py: LLM judge rates all 7 foundations per vignette
  using violation (forward) and acceptability (reverse) frames
- Foundation definitions drawn from Clifford et al. (2015) survey rubric
- Z-score each frame per foundation before averaging to cancel range bias
- Calibrate LLM Likert → human % via per-foundation OLS (classic set only)
- Add scripts/07a_merge_labels.py: merges llm_* and calibrated_* into vignette files
- Update README and HF dataset card with methodology and calibration quality table
- Classic set: 80.3% dominant-foundation accuracy, Pearson r 0.69-0.89 per foundation
2026-05-03 12:48:14 +08:00
wassname 881ac16c24 API improvements: rename clifford->classic, default load_vignettes to all, add dual-axis docs, and update HF upload script 2026-05-03 07:01:28 +08:00
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 (Michael J Clark) 7867a677d0 Update README.md 2026-05-03 05:51:05 +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
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