Replace naive gradient descent with Newton's method for Platt scaling
Claude
Unverified signature
0a66d61
2 parameters on a tiny dataset — Newton's method with analytic Hessian
converges in ~5-10 iterations instead of blindly running 10k steps.
https://claude.ai/code/session_0141cbZmdz7ziFkNsQbq7z5Y
Explore CTR calibration: map SGO scores to click-through rate predictions
Claude
Unverified signature
109fc16
Adds a research doc explaining how SGO's existing evaluation outputs (scores,
actions, bias calibration, counterfactual gradient) can be calibrated to predict
CTR using Platt scaling with a small set of anchor creatives with known CTRs.
Includes a reference script (ctr_calibrate.py) that fits a calibration function
from anchor runs and converts counterfactual score deltas into CTR deltas.
https://claude.ai/code/session_0141cbZmdz7ziFkNsQbq7z5Y
Fix XSS, VJP contract, binding, session security, name collisions, and error handling
Eric Xu
Unverified signature
ff413e9
1. XSS: Add esc() helper to sanitize all user/LLM data interpolated into
innerHTML (logStep, gradient table details, eval log, bias audit table).
2. VJP contract: Backend analyze_gradient() now returns structured ranked
data alongside text; frontend renders from backend rankings instead of
recomputing unweighted averages.
3. Bind uvicorn to 127.0.0.1 instead of 0.0.0.0.
4. Session-bound tickets: store sid in counterfactual ticket and verify on
stream pickup.
5. Name collision: use composite key (name_user_id) for cohort_map in both
web app and scripts to avoid persona lookup collisions; propagate
user_id through _evaluator dict.
6. Counterfactual error handling: add try-catch around fut.result() matching
the evaluate stream pattern.
Reframe analysis around persuadable middle, not universal appeal
Eric Xu
Unverified signature
88e3978
SGO does not try to please everyone. The analysis now segments evaluators
into champions (8+), persuadable (4-7), and not-for-them (1-3). Only the
persuadable middle drives optimization — the rest is context.
- evaluate.py: NPS-style segmentation in analysis output. Concerns are
drawn from the persuadable middle only. Low scorers shown as "not your
audience" rather than problems to solve.
- counterfactual.py: gradient header says "Priority Actions" and explains
it only consults persuadable evaluators.
- Web UI: "Find what to change" → "Directions for your goal". Step desc
explains the methodology.
- README: clarify that SGO focuses on moving the almost-convinced, not
pleasing everyone.
The semantic gradient is now a vector-Jacobian product: each evaluator
is weighted by their relevance to the user's stated goal.
Uniform: nabla_j = (1/n) sum_i J_ij (what pleases everyone)
VJP: nabla_j = sum_i v_i * J_ij (what moves toward goal)
Without a goal, behavior is unchanged (uniform weights). With a goal,
the LLM scores each evaluator's relevance (0-1) and the gradient
prioritizes changes that matter to the right audience.
- counterfactual.py: add --goal flag, compute_goal_weights(), VJP in analyze_gradient()
- web: add goal input field, pass through to counterfactual endpoint
- README: update math section with VJP formulation
Remove dating/relationship references from all files
Eric Xu
Unverified signature
92cf501
Add CoBRA-inspired bias auditing and calibration for expert panel fidelity
Eric Xu
Unverified signature
76bda55
Integrates research from CoBRA (arXiv:2509.13588, CHI'26 Best Paper) to
measure and calibrate cognitive biases in SGO's LLM evaluator pipeline,
closing the gap between simulated panels and real expert panels.
- Add bias_audit.py: runs framing, authority, and order-effect probes
through the same LLM+persona pipeline, comparing results to human
baselines (Tversky & Kahneman, Milgram)
- Add --bias-calibration flag to evaluate.py: appends bias-aware
instructions to reduce framing/authority/order artifacts
- Add research analysis doc connecting CoBRA methodology to SGO
Replace hardcoded keyword filters with LLM-based target-aware category mapping
Eric Xu
a4bb654
The stratified sampler used hardcoded substring matching to bucket 567
occupation values into 7 categories — misclassifying many (e.g. "sales
engineer" → tech) and dumping ~200 categories into "other". Since this is
fundamentally a retrieval problem, the LLM needs to see all categories
relative to the evaluation target.
- Add build_category_map.py: sends unique category values + entity
description to LLM, which returns 6-10 groups based on how those
categories would differ in evaluating the specific entity. Cached per
entity so the LLM call happens once.
- Remove occupation_bucket() and education_tier() from stratified_sampler.py;
education uses raw 7 values directly, occupation uses LLM mapping when
--entity is provided or raw values otherwise.
- Fix generate_cohort.py: add missing fields (sex, country, marital_status,
interests) so generated cohorts are compatible with the rest of the pipeline.
- Remove interests truncation (hobbies[:5] + skills[:3]) in persona_loader.py…
Remove all hardcoded paths, make skill portable
Eric Xu
74851ea
- SKILL.md: replace ~/Private_Projects/... with $SGO_DIR pattern,
add auto-detection of install location
- Scripts: data dir now defaults to <project>/data/nemotron/
instead of ~/Data/nvidia/...
- AGENT.md: use relative paths, fix domain-specific language
- Synced installed skill at ~/.claude/skills/sgo/
A framework for optimizing any entity against a population of evaluators
using LLMs as non-differentiable scoring functions and counterfactual
probes as gradient estimators.
Includes:
- Framework doc (README.md) with theory, diagrams, worked SaaS example
- Agent execution guide (AGENT.md) for interactive AI-assisted runs
- Scripts: setup, filtering, stratified sampling, evaluation,
counterfactual probing, cross-run comparison
- Templates for product, resume, and pitch entities
- Support for census-grounded (Nemotron) and LLM-generated cohorts