anicca-agent commited on
Commit
757102a
Β·
verified Β·
1 Parent(s): 8ba4610

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +103 -0
README.md ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: HuggingFaceTB/SmolLM2-135M-Instruct
4
+ language: en
5
+ tags: [uplift, intervention, behavior, lora, sft]
6
+ ---
7
+
8
+ # Manager v0 β€” model card
9
+
10
+ ## What this is
11
+
12
+ The first post-trained checkpoint of **Manager**, Anicca's behavior
13
+ model. v0 is deliberately the smallest end-to-end run that really
14
+ executes: it proves the full circuit β€” intervention data β†’ post-training
15
+ β†’ preregistered uplift eval β†’ product case format β€” with real numbers,
16
+ including where it fails.
17
+
18
+ The model is an outcome model: given a person's history and an
19
+ intervention arm, it estimates P(visit | history, arm). The uplift
20
+ score used for targeting is the treated-minus-control difference.
21
+
22
+ ## Base model
23
+
24
+ `HuggingFaceTB/SmolLM2-135M-Instruct` (SmolLM2 135M, Apache-2.0).
25
+ Chosen because it is small enough to post-train and evaluate on free
26
+ CPU compute end to end, and openly licensed. Be.FM weights were
27
+ explicitly **not** used (rights not yet clear).
28
+
29
+ ## Training
30
+
31
+ - Framework: TRL `SFTTrainer` + PEFT LoRA β€” the standard TRL SFT recipe
32
+ (https://huggingface.co/docs/trl/sft_trainer). No custom training
33
+ infrastructure.
34
+ - LoRA: r=16, alpha=32, dropout 0, target modules all-linear; merged
35
+ into the base weights for release.
36
+ - Data: 1,000 Hillstrom intervention cases (prompt/completion),
37
+ 1 epoch β€” a uniform seed-0 subsample (`sft_train_v0.jsonl`) of the
38
+ 2,000 prepared cases, chosen to bound wall-clock on shared CPU
39
+ (see Compute). See `DATA_CARD.md`.
40
+ - Hyperparameters: lr 1e-3, cosine schedule, warmup 4 steps,
41
+ batch 16, max length 256, completion-only loss, seed 0.
42
+ - Compute: CPU (bf16) on the team VM (no GPU): the only Hugging Face
43
+ credential available to the team is read-only, so no hosted GPU job
44
+ could be launched, and no other free GPU credential exists. Paid
45
+ compute was not used (standing rule: free routes only).
46
+ Wall time and final loss are recorded in the run record
47
+ (anicca-ops `files/manager-v0-start-2026-11-14.md`) and in
48
+ `train_log.json` shipped with the weights.
49
+ - Run history, honestly: the first training attempt (fp32, 2,000 rows)
50
+ was killed at ~32 minutes by a runtime service restart before any
51
+ checkpoint existed (checkpoints were disabled in that configuration).
52
+ A bf16 restart measured ~75 s/step on this shared VM (the cell's
53
+ effective compute is ~1 core; bf16 matmuls are ~3.3x faster but
54
+ end-to-end step time only ~1.4x), so the published run trains on a
55
+ 1,000-row subsample with checkpointing every 25 steps and
56
+ auto-resume β€” the smallest configuration that finishes end to end
57
+ here. Details and timestamps: run record Β§2.
58
+
59
+ ## Evaluation (MG-06 protocol, frozen before scoring)
60
+
61
+ 1,000-row stratified subsample of the frozen test split; arms compared
62
+ on identical rows. Primary metric: Qini coefficient (sklift) with a
63
+ 500-resample bootstrap 95% CI. Gate (preregistered): lower CI must
64
+ exceed the random-targeting p95. Full numbers: `results/` and the v0
65
+ README. The base model scores Qini 0.0739, CI [βˆ’0.0458, 0.1853] β€”
66
+ **gate FAIL** (random p95 = 0.0715). Manager v0 scores Qini
67
+ **0.0041**, CI [βˆ’0.0839, 0.1045] β€” **gate FAIL**: no measurable
68
+ uplift skill, and a point estimate below its own base model. That
69
+ negative result is the v0 result; the write-up (v0 README Β§3)
70
+ discusses what it does and does not mean. All scores are computed in
71
+ fp32 β€” scoring dtype is part of the protocol (bf16 logit noise moves
72
+ this metric materially; see the write-up's measurement note).
73
+
74
+ ## Reproduce the eval
75
+
76
+ ```bash
77
+ pip install torch transformers scikit-learn scikit-uplift pandas numpy
78
+ python eval_uplift.py --source hillstrom.csv.gz \
79
+ --model <weights-dir-or-hf-id> --label manager-v0 \
80
+ --out eval_manager-v0.json
81
+ ```
82
+
83
+ The harness is verified against the original base-model run: every
84
+ classical-arm number reproduces exactly (prior / random / T-learner),
85
+ and the LLM arm reproduces to ~1e-5 when scoring in fp32
86
+ (`results/eval_base_rerun_fp32.json`).
87
+
88
+ ## Limitations
89
+
90
+ - One dataset (2008 e-mail marketing), one outcome (website visit in
91
+ two weeks), 1,000 training rows, a 135M model, CPU compute. v0 is a
92
+ circuit test, not a capability claim.
93
+ - The model has never seen product (Anicca) data; the product case
94
+ pipeline exists but the app-side export it needs is still missing
95
+ (see DATA_CARD.md).
96
+ - Probabilities are next-token probabilities over {0, 1}, normalized β€”
97
+ a scoring convention, not calibrated probabilities.
98
+
99
+ ## Feedback
100
+
101
+ Expert feedback is explicitly welcome β€” issues and PRs on
102
+ https://github.com/Daisuke134/anicca. Tell us what the eval gets wrong,
103
+ what the serialization loses, and what v1 should train on.