Appearance
LLM, ML & Statistics
FIN uses three different types of intelligence working together: a Large Language Model (LLM) to reason and explain, Machine Learning (ML) to spot patterns and produce precise prices, and statistics to keep everything grounded in numbers.
Large Language Model (LLM)
The LLM is the "brain" that produces the thesis — the qualitative reasoning behind every prediction. Every time FIN runs, it feeds a rich set of data to the LLM so it can understand the full picture:
- Stock prices — open, high, low, close, and volume with technical indicators
- News articles — scored for sentiment (positive/negative) toward the company and the economy
- Surprise signals — unexpected events like earnings beats or economic shocks
- Psychology scores — 12 cognitive bias measurements (FOMO, herding, loss aversion, etc.)
- Competitor data — peer price performance, valuation metrics, and competitor news sentiment
- Financial statements — income, balance sheet, and cash flow data
- Calendar events — earnings dates, dividend dates, and other market-moving events
- Market context — beta, correlation, and relative strength vs SPY and sector ETFs
- Options data — put/call ratios and implied volatility
All of this is packed into a single prompt and sent to the LLM. The model weighs every signal, considers how they interact, and produces:
- A qualitative thesis — direction, conviction, regime assessment, bull/bear scenarios, and falsifiable hypotheses
- Falsifiable hypotheses — testable predictions registered as thesis monitors (checked daily against live data). Each prediction produces 2–4 hypotheses that are validated (unresolvable metrics or already-breached thresholds are rejected), deduplicated, and stored in the database. Every pipeline run checks active monitors against live market data — if a threshold is breached, it's marked as triggered and fed into subsequent predictions as context and ML features.
What Makes the LLM Approach Unique
Unlike a black-box algorithm, the LLM explains its reasoning. You can read the full thesis text to understand exactly why the system thinks the stock will move in a certain direction — which news articles influenced it, which psychology biases were most relevant, and how the technical signals factored in.
Machine Learning (ML)
While the LLM handles reasoning, ML produces the numeric price predictions by learning from past results.
Quantile Models
The system trains quantile GBM(Gradient Boosted Machine) models — five models per ticker and horizon that predict different points on the return distribution:
| Model | Predicts | Meaning |
|---|---|---|
| q10 | 10th percentile | "What's the worst-case scenario (90% chance returns will be better)" |
| q25 | 25th percentile | "What's the below-average scenario" |
| q50 | 50th percentile (median) | "What's the typical expected return" |
| q75 | 75th percentile | "What's the above-average scenario" |
| q90 | 90th percentile | "What's the best-case scenario (90% chance returns will be worse)" |
The q10–q90 gap forms the confidence band. These bands are optionally calibrated by conformal prediction to guarantee ~80% coverage.
GBM is like asking 5 "experts" (decision trees) to work together, where each new expert focuses on fixing the mistakes of the previous ones.
Why This Matters
Instead of getting a single prediction like "stock will go up 5%", you get:
"There's a 10% chance it drops more than -2%, a 50% chance it's around +1.5%, and a 10% chance it goes up more than +8%"
How ML Learns
Every prediction run saves a feature snapshot — a complete record of everything that went into that prediction:
- Technical indicators, sentiment scores, psychology biases
- Financial fundamentals, market context, options data
- Thesis features (conviction, regime probabilities, etc.)
- How far the AI's forecast diverged from the model's — that disagreement is later used to improve the model's error-correction, so predictions get better at recognising when the two methods clash
When the target date passes, the accuracy tracker resolves the snapshot with the actual outcome. Once enough resolved snapshots accumulate (100+), the system trains new models.
Quantile Regression (Pinball Loss)
Instead of predicting just the average return (which everyone does), they predict ranges:
- This tells you not just "what will happen" but "what's the range of possibilities"
- Pinball loss is the special math that makes the model focus on being accurate at specific percentiles
Hyperparameters (Model Settings)
| Setting | Value | What it means |
|---|---|---|
num leaves | 31 | Each "expert" tree can make ~31 different decisions |
learning rate | 5% | How much each new expert adjusts the previous ones' mistakes |
feature fraction | 80% | Each tree only looks at 80% of features (prevents over-reliance on any one feature) |
Tiered Architecture
At prediction time, the system picks the best available model:
- Tier 1 — Your personal quantile model (best accuracy, needs ~100 snapshots)
- Tier 2 — Pooled model from all users (good fallback)
- Tier 3 — Sector-transfer model (from a similar company)
- Tier 4 — Thesis heuristic (always available, no training needed). Neutral theses with moderate+ conviction (strength ≥ 40) produce a small symmetric signal so the LLM leg stays in the precision-weighted pool rather than falling back silently to a statistical-only baseline.
Each tier is performance-gated: if its recent accuracy or coverage drops below a threshold, it's automatically downgraded. You never see a bad model's output.
Self-Correction
If a model gets stale as market conditions change, it's retired automatically. The system falls back to Tier 4 (thesis heuristic) until fresh models can be trained.
Cold Start
New tickers don't wait weeks. The system backfills historical feature snapshots from existing price data, enabling Tier 1 training on the first retrain cycle.
Statistics
Statistics are the foundation that keeps the LLM and ML honest. They measure, validate, and quantify everything the system does.
Prediction Accuracy
Every prediction is measured against what actually happened:
| Metric | What It Tells You |
|---|---|
| Error % | How far off was the prediction? (absolute percentage difference) |
| Band Hit | Did the actual price fall within the confidence range? (Yes/No) |
| MAPE | Mean Absolute Percentage Error — the average error across recent predictions |
Gating
If the system's recent MAPE exceeds a configurable threshold, predictions are automatically withheld (gated) until accuracy recovers. This prevents unreliable predictions from reaching the dashboard.
Sentiment Thresholds
News sentiment scores use statistical boundaries:
- Below 45 — negative sentiment
- 45–55 — neutral
- Above 55 — positive sentiment
Technical Indicators
Statistics power the technical analysis:
- RSI (Relative Strength Index) — a 0–100 score. Above 70 suggests overbought, below 30 suggests oversold
- Trend detection — the ADF test distinguishes mean-reverting from random-walk behaviour (but never asserts a trend), while a separate 4-state hidden Markov model classifies the regime (bullish/bearish trend, mean-reverting, high-volatility) and trend-following indicators (ADX, Donchian channel, moving-average alignment, the Hurst exponent, trend slope/R²) provide positive evidence of an ongoing trend
- Volume analysis — whether trading volume is increasing or decreasing relative to historical norms
Psychology Scoring
Each of the 12 cognitive biases is scored on a 0–100 scale using statistical analysis of article text:
- Low (0–30) — barely detectable
- Medium (30–60) — some influence present
- High (60–100) — strongly influencing the market
A Third Opinion: The Statistical Referee
Alongside the AI and the machine-learning model, FIN computes a simple, classical forecast from the stock's own price history alone — no news reading, no trained model. It's a deliberately "dumb" number that exists to keep the smarter systems honest.
How it works, in plain terms:
- FIN first checks the recent price behaviour — does the price tend to oscillate around an average (mean-reverting), or does it show no reliable pattern (a random walk)?
- Then it produces a grounded estimate of the likely move and a range around it.
| What the price history shows | What the forecast expects |
|---|---|
| Random walk (no reliable pattern) | Essentially no move — at most a small drift from the recent trend |
| Mean-reverting (pulls back to its average) | A move back toward its ~20-day average (e.g., if the price is well above that average, the statistical view leans down) |
| Inconclusive | A blend of the two above |
What you get from it: an expected move, a confidence range (the wider the range, the less certain), and a confidence score that grows with more price history — a stock with only three weeks of data is trusted less than one with three months. It also has built-in honesty: it needs at least ~20 days of prices to say anything, and an extreme overnight jump (more than ~15%, which usually means a stock split or a bad data point) is ignored rather than chased.
Where you see it: in the Model Reconciliation panel on a prediction's Reasoning page, inside the purple "Statistical layer" box. It shows the role badge, the detected regime, the expected move, the range, and the confidence — and whenever the statistical view takes part in a forecast, you'll see a purple slice for it in the weight bar.
The four roles it can play (most are invisible to your live numbers):
- Shadow (on by default) — the forecast is recorded quietly for research and backtesting. It never touches the numbers you actually see.
- Honest fallback baseline — if both the ML model and the AI thesis are ever unavailable (for example, an outage), this statistical estimate becomes the published price instead of a rough sentiment placeholder.
- Shrinkage prior (experimental, off by default) — gently pulls pooled forecasts toward the statistical view.
- Plausibility anchor (experimental, off by default) — if the final forecast lands far outside the statistical envelope, FIN widens the band and lowers confidence (a "that looks suspicious" flag) without moving the point estimate.
- Options-market band floor (on by default) — a separate, market-based check that is not part of the statistical forecaster. It compares the band to the move implied by the options market's 30-day volatility and widens the band / trims confidence when the model is far tighter than traders expect. Because it uses the options market rather than price history, it is independent of the statistical anchor and the two never conflict.
The first two are safe to leave on. The experimental ones change live forecast numbers, so they stay off until backtesting confirms they help.
How They Work Together
Collected Data
↓
┌───────────────┐
│ Statistics │──→ Measure, validate, set thresholds
└───────────────┘
↓
┌───────────────┐
│ LLM │──→ Reason, produce thesis, explain
└───────────────┘
↓
┌───────────────┐
│ ML (Tier 1-4)│──→ Quantile price from thesis + features
└───────────────┘
↓
Price + band + reasoning
↓
(Feedback: actual outcome resolves snapshots → retrain ML)Statistics measure the raw data and validate the outputs. The LLM uses that data to reason about what will happen and produce a qualitative thesis. ML uses the thesis features plus all historical data to produce precise quantile price predictions. Statistics also produce an independent price-history forecast — the "statistical referee" shown in the Model Reconciliation panel — that acts as a quiet cross-check on the other two. Neutral theses are not discarded: moderate+ conviction neutral theses produce a small symmetric signal that keeps the LLM leg in the pool as a near-zero-return source, so the precision-weighted blend can still leverage the LLM's data-quality signal. The actual outcome feeds back to resolve feature snapshots, which train the next generation of ML models.

