The problem
Portfolio managers show predictable biases: holding losers too long and selling winners too early (the disposition effect), trading too much because they overestimate their edge (overconfidence), and refusing to sell below the original purchase price (cost-basis anchoring). Risk reports usually show profit and loss plus Value at Risk. They rarely explain why the performance looks the way it does.
Math can detect these patterns from prices, positions, and trades alone. The AI should only narrate a structured scorecard. It should not hunt for patterns in raw ledgers.
How it works
Simulated market → unbiased and biased traders → rule-based scorer → structured scores → task-trained AI → risk-committee memo.
Every stage is formula-based and auditable except the final memo generation. The model receives a scorecard; if the memo is wrong, the scorecard is wrong, and the metric path is traceable.
Training the AI coach
Base model: Qwen3-8B, an 8-billion-parameter open-weight model, adapted via 4-bit QLoRA (a memory-efficient training method) on a GCP NVIDIA L4
(~55 min). Dataset: 700 train + 100 validation simulated scorecard-to-memo pairs,
plus 2 verified real pairs from the scorer gate. Labels from a rule-based memo writer. No API spend.
Local serve via Ollama (a tool for running AI models locally) with a compressed model file (bde-coach, 84 MB).
Base vs trained coach
Same scorecard prompts, same local hardware (Ollama on AMD Radeon 890M integrated GPU).
Headline metrics
| Metric | Base Qwen3-8B | BDE coach |
|---|---|---|
| Biased case quality | 10/10 | 10/10 |
| Control case quality | 8/10 | 9/10 |
| Avg time per run | ~48s | ~27s |
| Quality score (1–10 scale) | 9.0 | 9.5 |
Quality scores are close. Domain correctness is not: the base model misreads PGR/PLR (profit-gain/loss realization ratios) as “growth/loss rate” and treats turnover 6.27 as “~6.3%.” The trained model writes risk-committee memos with correct disposition interpretation.
Economics
| Stage | Cost |
|---|---|
| Simulated data + rule-based scorer | $0 (rule-based script) |
| Dataset labeling | $0 (rule-based memo writer) |
| Training run (L4, ~1 hr) | ~$0.70–0.90 |
| Inference | $0 (local Ollama) |
Total cloud GPU spend under $1. After training, the full pipeline runs locally with no API keys.
Rule-based scorer gate
- Role
- Math finds bias before the AI narrates
Train cost
- Role
- Specialist coach, not a paid cloud model
Local inference
- Role
- Ollama compressed model on existing hardware
What the coach actually writes
Trained-model outputs for the two verified scorecards. Full text in the artifacts row above.
SUBJECT: Cost-basis Anchoring, Overconfidence / excess turnover, No-disposition discipline DIAGNOSIS PGR = 0.0462 · PLR = 0.0000 · turnover ≈ 6.27 (High) underwater day share = 63.42% · sell-below-cost = 0.00% Pattern: reluctance to crystallize losses; elevated trading without matching risk-adjusted edge. INTERVENTION Prohibit “get-even” holds below cost beyond policy. Cap gross turnover; require edge thesis for re-entry within five sessions of profit-taking.
SUBJECT: No Material Behavioral-risk Flags Present DIAGNOSIS Annualized turnover ≈ 2.42 (Moderate) Sharpe ≈ 0.24 · underwater share = 28.15% sell-below-cost rate = 23.33% No material behavioral-risk flags on this pack. Decisions consistent with the supplied baseline. INTERVENTION None required. Continue monitoring PGR/PLR gap, turnover vs Sharpe, and underwater / sell-below-cost on the next review pack.
What this proves, and what it doesn’t
Claims supported
- Simulated data is enough to build and gate a bias detector
- Rule-based evaluation before AI narration keeps the system auditable
- Training changes domain behavior, not surface benchmark scores.
- Local inference is viable after a sub-$1 training run
Limits of this note
| Constraint | Implication |
|---|---|
| Version 1 biases only | Herding, recency, loss aversion still open |
| Single simulated market path | 5 stocks × 252 days; no multi-path simulation |
| Simulated traders | Real portfolio-manager ledgers not yet validated |
| Single-response coach | No multi-turn coaching dialogue |