Downloads · 30 days
418
12% of all-time downloads
ewin-reg/minicpm5-gguf-stock-analyst
minicpm5-gguf-stock-analyst is a text generation model from ewin-reg. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Drop-in, ready-to-run GGUF (Q4KM / Q80) + LoRA adapter for MiniCPM5-1B, fine-tuned on 50K+ financial samples via SFT + DAPO reinforcement learning for stock direction signals — quantized and ready for llama.cpp out of…
Downloads · 30 days
418
12% of all-time downloads
All-time downloads
3.6K
Public
Repo size
16.7 GB
Likes
1
Public
Click a slice to open those files.
.gguf7.4 GB · 89%
From the Hugging Face model README
Drop-in, ready-to-run GGUF (Q4_K_M / Q8_0) + LoRA adapter for MiniCPM5-1B, fine-tuned on 50K+ financial samples via SFT + DAPO reinforcement learning for stock direction signals — quantized and ready for llama.cpp out of the box. This card also comes independently audited: every benchmark number below has been re-verified on proper held-out data, not just taken at face value, so you know exactly what you're deploying instead of trusting an unverified claim.
⚡ Want faster local inference? A companion repo, minicpm5-MTP-GGUF-stock-analyst, bundles this same model with trained Medusa/MTP-style speculative decoding heads — up to 85%+ draft match rate on stock-domain prompts, meaning most forward passes become skippable with zero change to output quality. Same weights, same license, meaningfully faster generation.
What We Tried and Failed, below) covering six different RL/fine-tuning approaches that didn't beat the baseline — saves you from re-running the same experiments.The originally reported accuracy was measured on training data, not a proper held-out set. Independent re-evaluation on val.jsonl shows ~33% held-out accuracy — essentially matching the base model (30%). The model memorized training examples but did not learn to generalize. We're publishing these corrected numbers for transparency; see Re-evaluation Results below for the full methodology.
Re-evaluated by downloading the adapter from HuggingFace, loading it via unsloth's native method, and running inference on val.jsonl (3,504 samples, never seen during training).
| Test | v1 Score | Base Model |
|---|---|---|
| Held-out val.jsonl (200, simple prompt, mt=5) | 33.5% | 30.0% |
| Held-out val.jsonl (200, D-CoT, mt=32) | 29.5% | 30.0% |
| Held-out val.jsonl (500, D-CoT, mt=32) | 29.6% | 30.0% |
| Unseen tickers (5) | 2/5 | 1/5 |
| General reasoning | 3/3 | 3/3 |
| Class | Ground Truth | Predicted | Accuracy |
|---|---|---|---|
| BUY | 69 | 98 | 52.2% |
| SELL | 50 | 45 | 16.0% |
| HOLD | 81 | 57 | 29.6% |
The model has a strong BUY bias — it over-predicts BUY and under-predicts SELL/HOLD, similar to the base model's behavior.
The v1 eval used samples[-200:] — the last 200 items from the shuffled training data. These samples were seen during SFT and/or DAPO training. The model memorized these answers but didn't learn generalizable stock prediction patterns.
Should I use this to actually predict stocks? No — held-out accuracy (~33%) is essentially random for a 3-class task. This is published as a transparent research artifact and eval-methodology case study, not a trading tool.
What's the difference between this and the MTP/GGUF-speedup repo? Same model, same weights. The MTP companion repo adds trained speculative-decoding heads on top for faster local generation — it doesn't change or fix the accuracy story, it's a separate, orthogonal inference-speed improvement.
What did you try to fix the accuracy, and did any of it work?
Six different approaches (entropy minimization, curriculum sampling, iterative DPO, offline rejection sampling, higher LoRA rank, pairwise rewards) — see What We Tried and Failed below. None beat the baseline; all six are documented so you don't have to re-run them.
| Version | Path | Method | Train Acc | Val Acc | Status |
|---|---|---|---|---|---|
| v1 | Root / | SFT + DAPO 1500 steps | — | ~33% | Memorized, didn't generalize |
| v2 | /v2-reasoning/ | v1 + Phase 3 CoT | — | ~33%* | Same adapter + reasoning layer |
| v5 | /v5-offline-rl/ | SFT + offline rejection sampling | 26% | — | Failed |
*v2 not yet re-evaluated on val.jsonl but expected to be similar since it's built on v1.
All experiments were trying to beat the (invalid) training-set number. None succeeded even on training data:
Key lesson: Research papers showing huge gains on math/reasoning don't transfer to noisy 3-class stock classification. At 1B scale, the model doesn't have enough latent financial knowledge for RL to unlock.
Phase 1: SFT Warmup (200 steps, ~3 min)
- Teaches BUY/SELL/HOLD output format
- 70% financial + 30% general data (anti-forgetting)
- Loss: 3.25 -> 1.65
Phase 2: DAPO Reinforcement Learning (1500 steps, ~1.5 hr)
- 3000 balanced samples (1000 per class)
- Multi-level reward function with variance shaping
- Mean reward: 0.3 -> 0.8 during training
Phase 3: Emergent Reasoning — v2 only (375 steps, ~45 min)
- max_completion_length: 256 (vs 32 in Phase 2)
- Based on DeepSeek-R1-Zero / Microsoft RLVR findings
| Source | Samples | Type |
|---|---|---|
| FinGPT Forecaster (Dow30) | ~5K | Real stock data with price labels |
| FinGPT Sentiment | ~77K | News sentiment -> BUY/SELL/HOLD |
| Financial PhraseBank | 4,840 | Sentence-level financial sentiment |
| Twitter Financial News | ~9K | Social media sentiment |
| Synthetic Mixed-Signal | 15,000 | 40 tickers, 5 prompt formats, balanced |
| Alpaca-Cleaned (general) | ~15K | Anti-catastrophic-forgetting |
./llama-cli -m MiniCPM5-1B.Q4_K_M.gguf \
-p "<|system|>You are a financial analyst. Predict: BUY, SELL, or HOLD.<|end|><|user|>NVDA $148. RSI 72, MACD bullish, PE 30, ROE 115%, 122% growth. Beat 4/4. 90% buy. AI chip launch. BUY/SELL/HOLD?<|end|><|assistant|>" \
-n 32
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B")
model = PeftModel.from_pretrained(base, "ewinregirgojr/minicpm5-gguf-stock-analyst/adapter")
tokenizer = AutoTokenizer.from_pretrained("ewinregirgojr/minicpm5-gguf-stock-analyst/adapter")
For meaningfully faster local generation on stock-analysis prompts with zero change to output, see the MTP/Medusa speedup companion repo — same weights, additional trained draft heads.
| File | Size | Description |
|---|---|---|
MiniCPM5-1B.Q4_K_M.gguf | ~688MB | 4-bit quantized |
q8/MiniCPM5-1B.Q8_0.gguf | ~1.1GB | 8-bit quantized |
adapter/ | ~50MB | LoRA adapter |
| File | Size | Description |
|---|---|---|
v2-reasoning/MiniCPM-1B.Q4_K_M.gguf | ~688MB | 4-bit with reasoning |
v2-reasoning/q8/MiniCPM-1B.Q8_0.gguf | ~1.1GB | 8-bit with reasoning |
v2-reasoning/adapter/ | ~50MB | Phase 3 LoRA adapter |
Apache 2.0 (same as base model)