fin-qa-002-sample / README.md
pradeep-xpert's picture
Upload folder using huggingface_hub
a0498aa verified
|
Raw
History Blame Contribute Delete
11.9 kB
---
license: cc-by-nc-4.0
language:
- en
tags:
- synthetic
- finance
- options
- derivatives
- knowledge-base
- instruction-tuning
- rag
- adversarial-robustness
pretty_name: "Options Strategies Knowledge Base (FIN-QA-002) — Sample"
size_categories:
- 1K<n<10K
configs:
- config_name: qa_pairs
data_files: finqa002_qa_pairs.csv
- config_name: multi_depth_answers
data_files: finqa002_multi_depth_answers.csv
- config_name: misconceptions
data_files: finqa002_misconceptions.csv
- config_name: adversarial_queries
data_files: finqa002_adversarial_queries.csv
- config_name: conversations
data_files: finqa002_conversations.csv
- config_name: options_concepts
data_files: finqa002_options_concepts.csv
- config_name: options_strategies
data_files: finqa002_options_strategies.csv
- config_name: ontology
data_files: finqa002_ontology.csv
- config_name: relations
data_files: finqa002_relations.csv
- config_name: payoff_formulas
data_files: finqa002_payoff_formulas.csv
- config_name: greeks_scenarios
data_files: finqa002_greeks_scenarios.csv
- config_name: examples
data_files: finqa002_examples.csv
---
# Options Strategies Knowledge Base — FIN-QA-002 (Sample)
A deterministic, ontology-driven synthetic **prompt/response knowledge-base corpus**
for options and derivatives. It pairs a concept ontology (11 option domains) and a
strategy library (single-leg through multi-leg structures) with multi-depth
answers (beginner → institutional), misconception corrections, adversarial probes,
payoff formulas, a Greeks-scenario P&L grid, worked examples, conversations, and a
typed relation graph.
This repository is the **public 500-question sample** of a **20,000-question**
commercial product. It is built by an unmodified production engine and validated
to **Grade A+ (10.0/10) across 6 canonical seeds**, with byte-identical
determinism per seed.
- **Unit of observation:** the prompt/question (`qa_pairs` row)
- **Sample size:** 500 questions · **Full product:** 20,000 questions
- **License:** CC-BY-NC-4.0 (sample) / commercial (full)
- **Contact:** pradeep@xpertsystems.ai · https://xpertsystems.ai
> **Positioning note.** Answers are *templated, structurally-controlled prose*
> rendered from a concept/strategy ontology — not human-verified factual ground
> truth. This corpus is built for **structural / retrieval / reranker /
> adversarial-robustness / agent-evaluation** work, not for teaching factual
> options knowledge via supervised fine-tuning. See **Limitations**. Each item is
> **educational** and **not investment advice**.
## Depth tiers, not a gold/distractor scheme
Every question in `multi_depth_answers` has **exactly four answers**, one per
audience depth: `beginner`, `intermediate`, `advanced`, `institutional`. All four
are legitimate renderings at different sophistication levels; there is
intentionally **no single "correct" answer**. The structure supports
depth-conditioned generation and depth-ranking tasks.
## Calibration anchors
| Metric | Observed (seed 42) | Target | Anchor |
|---|---|---|---|
| Difficulty mean (1–5) | 3.06 | 2.85–3.25 | Bloom's Taxonomy difficulty centering |
| Mid-difficulty (level 3) share | 0.31 | 0.26–0.42 | Bloom's mid-level concentration |
| Question-type spread | 5 types, even | exactly 5 even | OCC question-type taxonomy |
| Persona spread | 4 personas, even | exactly 4 even | retail/trader/quant/PM breadth |
| Reasoning-required answer share | 0.80 | 0.78–0.82 | FinQA reasoning fraction |
| Adversarial attack-type spread | 4 types, even | exactly 4 even | OWASP LLM Top-10 |
| Formula-coverage share | 0.45 | 0.30–0.60 | options-formula coverage |
Heavily-weighted **structural integrity floors** (all exact, all pass): exactly
4 distinct depth answers per question; full referential integrity across all
FKs; exactly one misconception per concept (all concepts covered); exactly 5
Greeks scenarios per strategy; per-table column-count contract; no relation
self-loops; complete adversarial behavior coverage.
## Tables (schema highlights)
| Table | Rows (sample) | Key columns |
|---|---|---|
| `finqa002_qa_pairs` | 500 | `qa_id`, `concept_id` (concept **or** strategy id), `question_text`, `question_type`, `persona_type`, `difficulty` |
| `finqa002_multi_depth_answers` | 2,000 | `answer_id`, `qa_id`, `depth_level`, `answer_text`, `contains_formula_flag`, `requires_reasoning_flag` |
| `finqa002_misconceptions` | 120 | `misconception_id`, `concept_id`, `incorrect_statement`, `why_wrong`, `correct_explanation`, `error_type` |
| `finqa002_adversarial_queries` | 120 | `adv_id`, `qa_id`, `attack_type`, `adversarial_question`, `expected_behavior` |
| `finqa002_conversations` | 80 | `conv_id`, `persona_type`, `turn_sequence` (JSON), `topic_drift_flag`, `resolution_flag` |
| `finqa002_options_concepts` | 120 | `concept_id`, `concept_name`, `category_l1`, `category_l2`, `difficulty_level`, `institutional_relevance_score`, `description_short`, `description_long` |
| `finqa002_options_strategies` | 30 | `strategy_id`, `strategy_name`, `legs_description`, `market_outlook`, `max_profit`, `max_loss`, `breakeven_points`, `risk_profile`, `margin_requirement_estimate` |
| `finqa002_ontology` | 117 | `node_id`, `node_type`, `name`, `parent_node`, `depth_level` |
| `finqa002_relations` | 75 | `relation_id`, `source_node`, `target_node`, `relation_type`, `strength_score` |
| `finqa002_payoff_formulas` | 30 | `formula_id`, `strategy_id`, `formula_latex`, `variable_definitions`, `interpretation` |
| `finqa002_greeks_scenarios` | 150 | `scenario_id`, `strategy_id`, `underlying_move_pct`, `iv_change_pct`, `time_decay_days`, `delta_impact`, `gamma_impact`, `theta_impact`, `vega_impact`, `pnl_estimate` |
| `finqa002_examples` | 30 | `example_id`, `strategy_id`, `example_type`, `example_description`, `solution_steps` |
`qa_pairs.concept_id` references **either** a concept (`CON_*`) **or** a strategy
(`STR_*`) — the QA layer is built over a merged entity set. `relations.source_node`
/ `target_node` reference **ontology `node_id`** values (not concept ids).
`conversations.turn_sequence` is JSON-encoded.
## Loading
```python
import pandas as pd
qa = pd.read_csv("finqa002_qa_pairs.csv")
answers = pd.read_csv("finqa002_multi_depth_answers.csv")
merged = qa.merge(answers, on="qa_id")
print(merged.groupby("qa_id").size().value_counts()) # all == 4
```
```python
from datasets import load_dataset
qa = load_dataset("xpertsystems/fin-qa-002-sample", "qa_pairs")["train"]
greeks = load_dataset("xpertsystems/fin-qa-002-sample", "greeks_scenarios")["train"]
```
## Use cases
- **SFT (style/format/depth):** depth-conditioned options-answer generation
(retail-plain vs institutional-desk voice).
- **Preference / ranking data:** depth-preference pairs encoding *audience fit*
(not factual correctness) for reranker / RLHF-style signals.
- **RAG & reranker evaluation:** topic-calibrated `(query, answer-shape)` pairs
over an 11-domain options ontology for MRR/NDCG-style metrics.
- **Adversarial robustness:** `adversarial_queries` provides mispricing,
volatility-trap, oversimplification, and hallucination-bait probes with
`expected_behavior` labels (clarify / correct / reject).
- **Scenario reasoning:** `greeks_scenarios` gives a deterministic
underlying-move × IV-change × time-decay P&L grid for sensitivity tasks.
## Limitations (full disclosure)
The build process inspected the engine line-by-line. Disclosed observations:
1. **Answers are templated prose, not verified facts.** Answer text is rendered
from concept/strategy metadata and depth templates; it is plausible and
structurally complete but **not** human-verified options truth. Do not use
`(question, answer)` pairs as factual SFT ground truth.
2. **No gold/preferred tier.** This is a 4-level depth corpus by design.
3. **Question-type and persona mixes are deterministic, not random.** They are
produced by index/modulo cycling, so they are exactly uniform by
construction (5 question types, 4 personas, 4 adversarial attack types).
Only `difficulty` is sampled (via an isolated `random.Random(seed)`).
4. **Misconceptions are one-per-concept, drawn from 5 templates.** Each concept
gets exactly one misconception cycled from a 5-entry template pool, anchored
to that concept's name. At full scale (800 concepts) the same 5 templates
recur; treat misconceptions as concept-tagged exemplars, not 800 unique items.
5. **`greeks_scenarios` is a closed-form heuristic grid**, not a Black-Scholes
pricer. Delta/gamma/theta/vega impacts and `pnl_estimate` are deterministic
linear approximations for scenario-shape training, not accurate option P&L.
6. **Strategy variants are parameterized labels.** Beyond the 18 base strategies,
additional rows are suffix-labeled variants ("for Earnings", "with Wider
Wings", …) sharing the base payoff metadata.
7. **`relations` reference ontology node ids**, and the relation set is partly
deterministic (curated pairs) plus a small per-strategy random edge; FK
integrity to `ontology.node_id` is verified.
8. **Manifest embeds the run's `output_dir` path** and a `seed`, but **no
wall-clock timestamp** — so the manifest is reproducible up to the output
path. Data files are byte-identical per seed.
No benchmark-theater was found: no hardcoded validation values, no
`max(actual, target)` floors, no always-true passes, no referential-integrity
leaks. Scorecard ranges were calibrated to observed 6-seed behavior; deterministic
distributions are scored as exact-target floors and the heavy weight sits on
structural integrity.
## Sample vs. full product
| Dimension | Sample (this repo) | Full product |
|---|---|---|
| Questions | 500 | 20,000 |
| Concepts | 120 | 800 |
| Strategies | 30 | 400 |
| Multi-depth answers | 2,000 | 80,000 |
| Misconceptions | 120 | 800 |
| Adversarial queries | 120 | 3,000 |
| Greeks scenarios | 150 | 2,000 |
| Conversations | 80 | 3,000 |
| License | CC-BY-NC-4.0 | Commercial |
| Validation | 6/6 seeds Grade A+ (10.0/10) | Full-scale QA suite |
## Determinism
Re-running the engine with the same seed produces **byte-identical data files**
(verified across all 12 CSVs) and **identical scored metrics**. The manifest is
reproducible up to the embedded output-directory path; there is no wall-clock
timestamp.
## Citation
```bibtex
@misc{xpertsystems_finqa002_2026,
title = {Options Strategies Knowledge Base (FIN-QA-002): A Synthetic,
Ontology-Driven Multi-Depth Options & Derivatives Q&A Corpus},
author = {XpertSystems.ai},
year = {2026},
howpublished = {Hugging Face Datasets},
note = {Sample (500 questions) of a 20,000-question commercial product.
Difficulty mix calibrated to Bloom's Taxonomy; strategy and
question-type taxonomy to OCC options curricula; reasoning-required
fraction to FinQA-style financial-reasoning corpora; adversarial
attack-type taxonomy to the OWASP LLM Top-10. License CC-BY-NC-4.0.},
url = {https://xpertsystems.ai}
}
```
Anchored benchmarks referenced for calibration: Bloom's Taxonomy of educational
objectives; OCC / standard options-strategy curricula (strategy & question-type
taxonomy); FinQA (Chen et al., financial numerical-reasoning QA); OWASP Top-10
for LLM Applications (adversarial attack taxonomy).
## Disclaimer
This dataset is **synthetic** and provided for AI/ML research and engineering.
Its content — including option strategies, payoff descriptions, and Greeks
scenarios — is **educational and illustrative only**, is **not investment
advice**, is not a recommendation to trade any option or security, and is not a
substitute for professional financial, legal, or compliance guidance. Options
trading involves substantial risk of loss.